text
stringlengths
4
1.02M
meta
dict
import json import execjs._exceptions as exceptions from execjs._abstract_runtime import AbstractRuntime from execjs._abstract_runtime_context import AbstractRuntimeContext from execjs._misc import encode_unicode_codepoints try: import PyV8 except ImportError: _pyv8_available = False else: _pyv8_available...
{ "content_hash": "06900da806ba40cc32c095bcf6a31d5f", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 105, "avg_line_length": 31.03488372093023, "alnum_prop": 0.5327838141626077, "repo_name": "doloopwhile/PyExecJS", "id": "06ddcb75ef96b11ec68caba7f1163a372c645f16", "size": ...
""" Miscellaneous convenience functions for iterating over blocks, txs, etc. """ import time import threading from .scan import LongestChainBlockIterator, TxIterator from .track import TrackedSpendingTxIterator, UtxoSet from .blockchain import BlockChainIterator #####################################################...
{ "content_hash": "5944c3babf3b44df2dad0967037f50b6", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 106, "avg_line_length": 36.48979591836735, "alnum_prop": 0.6178225205070843, "repo_name": "fungibit/chainscan", "id": "11d5e0d546e4efff3fa0dff6081951a161bb8b0c", "size": "...
import pytest import requests from pprint import pprint requests.packages.urllib3.disable_warnings() req_symbols = ['bigip_mgmt_ip', 'bigip_username', 'bigip_password', 'bigip_port'] def missing_bigip_symbols(): for sym in req_symbols: if not hasattr(pytest.symbols, sym): return True re...
{ "content_hash": "860188201a36c16b7f350d3c2f8753b8", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 82, "avg_line_length": 25.62264150943396, "alnum_prop": 0.5537555228276878, "repo_name": "f5devcentral/f5-cccl", "id": "d9ce59741f9197acb4010c28c430f0b58f71b8e8", "size": ...
from django.db import models from django.contrib.auth.models import Group, User from goflow.workflow.models import Process, Activity, Transition, UserProfile from goflow.workflow.notification import send_mail from datetime import timedelta, datetime from django.core.urlresolvers import resolve from django.core.ma...
{ "content_hash": "02ca331002e25f4b7ef6b90641e6c6b1", "timestamp": "", "source": "github", "line_count": 826, "max_line_length": 117, "avg_line_length": 41.26634382566586, "alnum_prop": 0.5615795341195798, "repo_name": "zen4ever/django-goflow", "id": "df20e38e5238d8c4356936c71c4d1fbedc2f5532", "size...
""" Command line tool to assign example tests to CI test jobs. """ # TODO: Need to handle running examples on different chips import os import sys import re import argparse try: from Utility.CIAssignTest import AssignTest except ImportError: test_fw_path = os.getenv("TEST_FW_PATH") if test_fw_path: ...
{ "content_hash": "d39e2e8e17fc62caf908341cf219526e", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 99, "avg_line_length": 28.476190476190474, "alnum_prop": 0.669732441471572, "repo_name": "krzychb/rtd-test-bed", "id": "bd6bdaf3b82d7fc7bd162e9605420d1dbb093aa8", "size": "...
from setuptools import setup, find_packages setup(name='valid_model', version='0.3.6', description="Generic data modeling and validation", long_description="""\ """, classifiers=[ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License' ], ...
{ "content_hash": "aff1bcb2845641127f3d2cf5a6faebf0", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 72, "avg_line_length": 28.307692307692307, "alnum_prop": 0.5529891304347826, "repo_name": "outbrain/valid_model", "id": "bb7e9aaa1f7d6fe5d1f61c1eacfe33a29f4176eb", "size": ...
import pandas as pd import numpy as np import matplotlib.pyplot as pt dataset= pd.read_csv('data.csv') X = dataset.iloc[:,-1].values y = dataset.iloc[:3].values """from sklearn.cross_validation import train_test_split X_train, X_test, y_train, y_test = train_test_split(X,y,test_size = 0.2, random_state = 0)""" # Fi...
{ "content_hash": "c505fc9a55522b19b194c42301c488aa", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 93, "avg_line_length": 23.047619047619047, "alnum_prop": 0.7169421487603306, "repo_name": "jigargandhi/UdemyMachineLearning", "id": "7c79610ed5df43c19be8ea5f4e95c5c2539f8bc6"...
from __future__ import unicode_literals import os import io import re import binascii import pickle from collections import defaultdict from sortedcontainers import SortedSet import logging logging.basicConfig( format='%(asctime)s [%(process)d] [%(levelname)s] %(message)s', datefmt='%Y-%m-%d %H:%M:%S', l...
{ "content_hash": "f65489477b93dcb80f6c3a5b1cf2d194", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 77, "avg_line_length": 30.43103448275862, "alnum_prop": 0.4985835694050991, "repo_name": "geovedi/py-phrasematcher", "id": "697db960300be6322cc8f29675408322154d8e37", "siz...
from math import sqrt from numba import cuda, float32, uint32, void from numba.cuda import compile_ptx, compile_ptx_for_current_device from numba.cuda.testing import skip_on_cudasim, unittest, CUDATestCase @skip_on_cudasim('Compilation unsupported in the simulator') class TestCompileToPTX(unittest.TestCase): def...
{ "content_hash": "7cd5890b4666af0be7d3d7f706b22198", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 78, "avg_line_length": 35.980645161290326, "alnum_prop": 0.6135915366684598, "repo_name": "stonebig/numba", "id": "0d229a103d49ce26c2c4e3d878cdaaee9d4ef2f0", "size": "5577...
from builtins import str import fnmatch import mimetypes import os import time import uuid from django.conf import settings from django.core.exceptions import ValidationError from django.db import models from django.utils.translation import gettext_lazy as _ import math from django_cradmin.utils import crhumanize from ...
{ "content_hash": "0c5a486170a237a89226378c8dd296ae", "timestamp": "", "source": "github", "line_count": 263, "max_line_length": 114, "avg_line_length": 43.27756653992395, "alnum_prop": 0.6572658583728694, "repo_name": "appressoas/django_cradmin", "id": "a564402218fb8455df589b875c271df7b5c6e92d", "s...
from error import * from tokens import * from events import * from nodes import * from loader import * from dumper import * __version__ = '5.1' try: from cyaml import * __with_libyaml__ = True except ImportError: __with_libyaml__ = False #---------------------------------------------------------------...
{ "content_hash": "64975ef39062bd6fae06f015b54c9edf", "timestamp": "", "source": "github", "line_count": 405, "max_line_length": 90, "avg_line_length": 30.076543209876544, "alnum_prop": 0.641737131598391, "repo_name": "instinct-vfx/rez", "id": "e7a419dd2b5b9aa65d92de28689e9f84bb80d3c5", "size": "121...
__author__ = 'Guorong Xu<g1xu@ucsd.edu>' import os import YamlFileMaker from cfnCluster import ConnectionManager from util import DesignFileLoader workspace = "/shared/workspace/RNASeqPipeline" data_dir = "/shared/workspace/data_archive/RNASeq" ## run all analysis from download, alignment, counting and differential ...
{ "content_hash": "0a9d45166db8379262f9fb0215de4732", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 132, "avg_line_length": 41.32203389830509, "alnum_prop": 0.7063166529942576, "repo_name": "ucsd-ccbb/jupyter-genomics", "id": "3f3c4cd6b7de334cee51f6c81dd1e92c8bacf4d1", "s...
import pytest from webdriver.error import NoSuchAlertException from tests.support.sync import Poll @pytest.fixture def add_event_listeners(session): """Register listeners for tracked events on element.""" def add_event_listeners(element, tracked_events): element.session.execute_script(""" ...
{ "content_hash": "e5d7d297e39fb67764be22d927fd26c5", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 92, "avg_line_length": 30.943181818181817, "alnum_prop": 0.6296364304076386, "repo_name": "chromium/chromium", "id": "42a74ba41fbc4d4943650fc6cfa23e24561b679c", "size": "5...
""" """ __author__ = 'Alisue <lambdalisue@hashnote.net>' import os from maidenhair.loaders.base import unite_dataset as _unite_dataset from maidenhair.compat import OrderedDict def default_unite_function(data): """ A default unite_function which recieve `data` and return filename without middle extensions...
{ "content_hash": "ae3da3b13cf8c756a5c50a4a8bd91ee2", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 79, "avg_line_length": 31.71014492753623, "alnum_prop": 0.636654478976234, "repo_name": "lambdalisue/maidenhair", "id": "9223c5c9d7def9dc3b358518b36fb5ac6d435ebb", "size": ...
import requests, sys import json import os.path import csv import argparse import seaborn as sns import struct def hex2rgb(rgb): return struct.unpack('BBB', rgb.decode('hex')) def rgb2hex(rgb): return struct.pack('BBB',*rgb).encode('hex') # -------------------------------------------------------------------...
{ "content_hash": "037f3e6225021662aa27a13c97348318", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 213, "avg_line_length": 42.24752475247525, "alnum_prop": 0.5305835481603, "repo_name": "jdeligt/Genetics", "id": "79f20a5d4aa02d888e55012cc7640bc9066b4839", "size": "8534"...
import time from nova.image import glance from nova.openstack.common import cfg from nova.openstack.common import log as logging from nova.virt import driver from nova.virt.powervm import operator LOG = logging.getLogger(__name__) powervm_opts = [ cfg.StrOpt('powervm_mgr_type', default='ivm', ...
{ "content_hash": "f9cd181a4a17fa738bf0e5a588ca57e5", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 79, "avg_line_length": 34.59473684210526, "alnum_prop": 0.5887722501141032, "repo_name": "maoy/zknova", "id": "0ce31353501d118e4590a498f9b945d652e10abd", "size": "7214", ...
import os import os.path from hashlib import sha1 import requests import sh URLS = {'test': 'https://raw.githubusercontent.com/python/cpython/master/Lib/test/test_ssl.py', 'code': 'https://raw.githubusercontent.com/python/cpython/master/Lib/ssl.py'} DESTDIR = os.path.join(os.path.dirname(__file__), 'upstream...
{ "content_hash": "9027101cc6714dda4942bdf4d9ec1c30", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 95, "avg_line_length": 32.148148148148145, "alnum_prop": 0.6071428571428571, "repo_name": "imron/scalyr-agent-2", "id": "1b20509c385478f3d6ffe07360beca0503fa36d7", "size": ...
from __future__ import unicode_literals from django.db import models, migrations import symposion.speakers.models class Migration(migrations.Migration): dependencies = [ ('speakers', '0001_initial'), ] operations = [ migrations.AlterField( model_name='speaker', n...
{ "content_hash": "bd9ce311b1dd42cfa9347b428e7a83d8", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 100, "avg_line_length": 23.736842105263158, "alnum_prop": 0.6341463414634146, "repo_name": "njl/pycon", "id": "d2bc135f40703f96dc5ec1b9496e7fb22951d58a", "size": "475", "...
import json import mimetypes from contextlib import contextmanager from unittest import mock from django.db import DEFAULT_DB_ALIAS from django.test import TestCase, Client from django.test.client import encode_multipart from django.core.files import File from django.contrib.auth.models import User from binder.json i...
{ "content_hash": "46f6e75c623ff5b30f2ebf532649795b", "timestamp": "", "source": "github", "line_count": 369, "max_line_length": 110, "avg_line_length": 35.078590785907856, "alnum_prop": 0.6910537700865266, "repo_name": "CodeYellowBV/django-binder", "id": "57d515af7f27f1f951faeef26628562f201d922e", ...
from tastypie.resources import ModelResource, ALL_WITH_RELATIONS, ALL from django.conf import settings from django.conf.urls import url from django.http import HttpResponse from tastypie import fields from cbh_core_model.models import Project, PinnedCustomField, CustomFieldConfig from cbh_core_ws.serializers import Cus...
{ "content_hash": "7f438ef5a69b9a1cd0b356569c9cc040", "timestamp": "", "source": "github", "line_count": 877, "max_line_length": 290, "avg_line_length": 47.66020524515393, "alnum_prop": 0.4560266041437389, "repo_name": "strets123/cbh_chembl_ws_extension", "id": "41e6f8adc0e99580f6ce7ccbd2f27930bc9fc20...
''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
{ "content_hash": "516c3359a9239501509afa6e315679cf", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 114, "avg_line_length": 31.401639344262296, "alnum_prop": 0.6188984599321325, "repo_name": "samiunn/incubator-tinkerpop", "id": "d77cde1daa2c10a157b07211340b917ffb8d4098", ...
import logging import os from urllib import parse from wsgiref.util import FileWrapper from django.http import HttpResponse, FileResponse, StreamingHttpResponse from django.shortcuts import render from django.conf import settings from speech.models import Record from speech.forms import FeedbackForm from speech impor...
{ "content_hash": "872375e5722b274453383a983de7208d", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 98, "avg_line_length": 28.797752808988765, "alnum_prop": 0.6379243074522044, "repo_name": "Lvadislav/russian-speech-site", "id": "0ba7e69515d59d4c6bf9fb80c9259b7751d28ec8", ...
import re import os from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request, HtmlResponse from scrapy.utils.response import get_base_url from scrapy.utils.url import urljoin_rfc import csv from product_spiders.items import Product, ProductLoader class VanC...
{ "content_hash": "9c50ed29005fb93a22ff80e565fe9928", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 119, "avg_line_length": 35.6125, "alnum_prop": 0.5752895752895753, "repo_name": "0--key/lib", "id": "9380595f48ca521584cdf876555260ede2d42b92", "size": "2849", "binary": ...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='ReceiptLog', fields=[ ('id', models.AutoField(verbose_name='ID', serial...
{ "content_hash": "376fe190418a4b711193715ffaa0db04", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 156, "avg_line_length": 52.41935483870968, "alnum_prop": 0.6221538461538462, "repo_name": "ministryofjustice/manchester_traffic_offences_pleas", "id": "54d558f5ae111a94de535c...
__author__ = 'wcong' ''' this is node exception '''
{ "content_hash": "81e76e0a14cd9865f471facb6fe94bd3", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 22, "avg_line_length": 10.6, "alnum_prop": 0.5660377358490566, "repo_name": "wcong/ants", "id": "c30c4d8fa0ae27635fe7368d2ab49d8fe32e45a6", "size": "69", "binary": false, ...
from __future__ import print_function from gocd_cli.command import BaseCommand from gocd_cli.utils import get_settings __all__ = ['Decrypt', 'Encrypt'] class BaseEncryptionCommand(object): _encryption_module = None _settings = None @property def settings(self): if self._settings is None: ...
{ "content_hash": "87df21f41fc3cd0e09b5e767a511fa13", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 88, "avg_line_length": 29.520833333333332, "alnum_prop": 0.6047988708539167, "repo_name": "gaqzi/gocd-cli", "id": "3d22f760c575763a9ccabb053a879899acea514f", "size": "2834"...
"""Tests for the worker.""" import time # pylint: disable=unused-import,g-bad-import-order from grr.lib import server_plugins # pylint: enable=unused-import,g-bad-import-order from grr.lib import aff4 from grr.lib import data_store from grr.lib import flags from grr.lib import flow from grr.lib import flow_runner f...
{ "content_hash": "1e172939535df0e7afe003ca4173d394", "timestamp": "", "source": "github", "line_count": 224, "max_line_length": 77, "avg_line_length": 34.183035714285715, "alnum_prop": 0.6610944234034217, "repo_name": "MiniSEC/GRR_clone", "id": "8a3b427de90ad77c7b3d15dab5012330ec7d2b57", "size": "7...
""" The MIT License (MIT) Copyright (c) 2013 Niko Skrypnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge...
{ "content_hash": "6cb64ae256926c8e636aeab16cb6564d", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 77, "avg_line_length": 33.446666666666665, "alnum_prop": 0.6252740681682281, "repo_name": "nskrypnik/kivy3", "id": "de9080efeea943009f449bcecef390ff3e471e4b", "size": "501...
''' Performs the same check as in Test_02 verifying that zPoS forked blocks that stake a zerocoin which is spent on mainchain on an higher block are still accepted. ''' from test_framework.authproxy import JSONRPCException from fake_stake.base_test import NPCcoin_FakeStakeTest from time import sleep class zPoSFakeSta...
{ "content_hash": "6ab5bcf306f847d9ff03e0fb1ff0dcda", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 189, "avg_line_length": 37.464285714285715, "alnum_prop": 0.5955672068636797, "repo_name": "npccoin/npccoin", "id": "b10c9ed797670cd867c7d0a1b8fe15baa93772f2", "size": "44...
import codecs from invoke.vendor.six.moves.queue import Queue from invoke.vendor.six.moves import zip_longest from invoke.util import ExceptionHandlingThread from pytest import skip from fabric import Connection _words = "/usr/share/dict/words" def _worker(queue, cxn, start, num_words, count, expected): tail...
{ "content_hash": "20668ef28d1e39bc86d3a3d3d99a3f30", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 79, "avg_line_length": 39.824175824175825, "alnum_prop": 0.6067880794701986, "repo_name": "fabric/fabric", "id": "99c80092eb29079ade4638ba98be419beb99d1dc", "size": "3624",...
import nltk import re def __parse_hashtags(t): ''' Get any hashtags from the hashtags entity. ''' if t.get('entities') is not None: return [h['text'].lower() for h in t['entities']['hashtags']] else: return [] def __parse_links(t): ''' Get any links from the urls entity. ...
{ "content_hash": "a05cf4818bb114dc3f3ad85a688c5347", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 81, "avg_line_length": 27.70731707317073, "alnum_prop": 0.565580985915493, "repo_name": "averagesecurityguy/twanalyze", "id": "5e21690f15faddd2c1db6031d0631a005f5eb3d8", "s...
PLAYER = ['/usr/bin/mpv'] # Respect default terminal colors in curses interface. DEFAULT_TERMINAL_COLORS = False
{ "content_hash": "391c28213352c5d6b0a5b5f819cc2a1a", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 54, "avg_line_length": 28.5, "alnum_prop": 0.7543859649122807, "repo_name": "hjalti/ruv-cli", "id": "9270b1b66cd76e12545a94b874f9e11d24cc8e9e", "size": "220", "binary": fa...
hello~
{ "content_hash": "fb606e1aa1da4767b3d7fb7e72dd811f", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 6, "avg_line_length": 7, "alnum_prop": 0.7142857142857143, "repo_name": "choznerol/c4lab-git-tutorial", "id": "4ee95d23e713af43d99280fda42f70712d5aa78f", "size": "7", "bin...
""" Project Honeypot Http:BL API Client Example: .. code:: python import httpbl ip_address = '127.10.20.5' print 'Querying {}'.format(ip_address) bl = httpbl.HttpBL('my-key') print(bl.query(ip_address)) """ import socket __version__ = '1.0.1' DNSBL_SUFFIX = 'dnsbl.httpbl.org.' # Visitor Typ...
{ "content_hash": "44f7245f8530c028f3fe6b20918b05da", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 77, "avg_line_length": 27.22695035460993, "alnum_prop": 0.5324303203959364, "repo_name": "gmr/httpbl", "id": "409eaf2f689b293e5f80b6b70c8d183083088a93", "size": "3839", ...
import pybullet as p p.connect(p.GUI) cube = p.loadURDF("cube.urdf") frequency = 240 timeStep = 1. / frequency p.setGravity(0, 0, -9.8) p.changeDynamics(cube, -1, linearDamping=0, angularDamping=0) p.setPhysicsEngineParameter(fixedTimeStep=timeStep) for i in range(frequency): p.stepSimulation() pos, orn = p.getBasePo...
{ "content_hash": "08c86f96588d6fe9b8af0ac8ebb1cb1a", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 61, "avg_line_length": 29.833333333333332, "alnum_prop": 0.7653631284916201, "repo_name": "MTASZTAKI/ApertusVR", "id": "a706dd00eea1395f7b16e4d18ea1192e96f5c7c1", "size": "...
from django.conf.urls import patterns, url, include urlpatterns = patterns('apps.reportes.views', #reportes_consolidados url(r'^reportes_consolidados/$', 'reportes_consolidados'), url(r'^reportes_detallados/$', 'reportes_detallados'), url(r'^reportes_transacciones/$', 'reportes_transacciones'), url(r...
{ "content_hash": "743d69a391a823e29b5c73d670a99268", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 64, "avg_line_length": 28.285714285714285, "alnum_prop": 0.6919191919191919, "repo_name": "AnthonyWainer/sisJuridico", "id": "848f4c0647cf8585063cc1c0e03295f078592729", "si...
from odoo import models class AccountInvoiceLine(models.Model): _inherit = ['account.invoice.line'] def get_digital_purchases(self): partner = self.env.user.partner_id # Get paid invoices purchases = self.sudo().search_read( domain=[('invoice_id.state', '=', 'paid'), ('i...
{ "content_hash": "46499a29d70096e4431f59e91abc41f0", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 152, "avg_line_length": 35.94736842105263, "alnum_prop": 0.6046852122986823, "repo_name": "vileopratama/vitech", "id": "b6b28026ddeb99945d5d422b5ddee20c7e9d91f9", "size": "...
import _plotly_utils.basevalidators class MetasrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__(self, plotly_name="metasrc", parent_name="streamtube", **kwargs): super(MetasrcValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "f6a11d61e9bdf14f3d381bd8525fcedc", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 82, "avg_line_length": 36.09090909090909, "alnum_prop": 0.6221662468513854, "repo_name": "plotly/plotly.py", "id": "c886449d3bd9370ec8bcbf0a542c495fc65a1c66", "size": "397"...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "workshop.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "e7a2ff46733b26287e7664e6d700ff5d", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 72, "avg_line_length": 25.444444444444443, "alnum_prop": 0.7117903930131004, "repo_name": "solidit/votacao", "id": "37563af854cda34da6e27a61ec259e3261e5ccab", "size": "251",...
from ssdb.client import StrictSSDB, SSDB from ssdb.connection import (BlockingConnectionPool, ConnectionPool, Connection) from ssdb.utils import SortedDict from ssdb.exceptions import (AuthenticationError, ConnectionError, BusyLoadingError, DataError, InvalidResponse, ...
{ "content_hash": "a9d6e5cc16cd5cad920ad276ba4e491c", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 80, "avg_line_length": 45.6875, "alnum_prop": 0.6757865937072504, "repo_name": "wrongwaycn/ssdb-py", "id": "8995c9f1b1ceaab59e7bfbe0f3f0e80785bc777e", "size": "745", "bin...
import demistomock as demisto # noqa: F401 from CommonServerPython import * # noqa: F401 def main(): drilldown_results = [] incident = demisto.incident() if not incident: raise ValueError("Error - demisto.incident() expected to return current incident " "from context but...
{ "content_hash": "021d1fee5fc393bf59937fd3641e4c66", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 100, "avg_line_length": 38.61904761904762, "alnum_prop": 0.6171393341553637, "repo_name": "VirusTotal/content", "id": "703ff460cce1d45590a2dbb4a18f05808c4960de", "size": "1...
from flask import Blueprint, current_app from flask_login import current_user, login_required main = Blueprint('main', __name__) public = Blueprint('public', __name__) # Admin login not required from .views import ( agreements, communications, outcomes, search, service_updates, services, suppliers, stats, u...
{ "content_hash": "fe3e05d79d5031743b2eead9b1e39518", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 83, "avg_line_length": 27.84, "alnum_prop": 0.7413793103448276, "repo_name": "alphagov/digitalmarketplace-admin-frontend", "id": "1f814b870f8321d56940a7c9ba0c749b34807131", ...
"""Compile reStructuredText to HTML, using Nikola architecture.""" from __future__ import unicode_literals, print_function import io import lxml.html from pkg_resources import resource_filename from mako.template import Template from nikola.plugin_categories import Command class CommandRst2Html(Command): """Com...
{ "content_hash": "3b3137db3f6be890357036c84fc10c77", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 112, "avg_line_length": 40.666666666666664, "alnum_prop": 0.6601092896174864, "repo_name": "andredias/nikola", "id": "6e6aa3bd1d87bf2e923da15cb0d9526a0b762d73", "size": "29...
from __future__ import print_function import json import struct import re import base64 import httplib import sys settings = {} class BitcoinRPC: def __init__(self, host, port, username, password): authpair = "%s:%s" % (username, password) self.authhdr = "Basic %s" % (base64.b64encode(authpair)) self.conn = ht...
{ "content_hash": "b8687bc4a4e757601675e70857cb9737", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 90, "avg_line_length": 26.365384615384617, "alnum_prop": 0.6542669584245077, "repo_name": "fullcoins/fullcoin", "id": "b4e0dabd92c16dde007bab98c1ecf3bfbe75f9a3", "size": "...
from requestbuilder import Arg from requestbuilder.mixins import TabifyingMixin from euca2ools.commands.ec2 import EC2Request class DescribeInstanceTypes(EC2Request, TabifyingMixin): DESCRIPTION = '[Eucalyptus only] Show information about instance types' ARGS = [Arg('InstanceType', metavar='INSTANCETYPE', na...
{ "content_hash": "c6fad5f14d1174de4e3e633e45a3b89f", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 76, "avg_line_length": 48.1578947368421, "alnum_prop": 0.4926775956284153, "repo_name": "nagyistoce/euca2ools", "id": "69c11a2dd43df4b07593a56410194e854d77944c", "size": "5...
from ..utils import Scraper from .exams_helpers import * from bs4 import BeautifulSoup from collections import OrderedDict from datetime import datetime from pytz import timezone import re class UTMExams: """A scraper for UTM exams.""" host = 'https://m.utm.utoronto.ca/' @staticmethod def scrape(loc...
{ "content_hash": "ecba1cca45d13e8296e909b3a683636c", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 77, "avg_line_length": 32.20338983050848, "alnum_prop": 0.5036842105263157, "repo_name": "cobalt-uoft/uoft-scrapers", "id": "e42e5450112d45c170a687e43dcb57008ce5d0b7", "si...
from flask import Flask from flask import render_template from config import DB from db_layer import MyDataBaseLayer ##################################################################### DB_Conn = 0 app = Flask(__name__) @app.route("/") def app_root(): global DB_Conn return render_template("root.html",name=1...
{ "content_hash": "18d070b149a9f793800e3e65a56ad4cc", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 69, "avg_line_length": 20.35, "alnum_prop": 0.5675675675675675, "repo_name": "thomasvincent/utilities", "id": "0c27888289f5607f38cc1af1960a8581f95cbdd8", "size": "407", "...
class Inventory: def __init__(self): self.slots = [] def add_item(self, item): self.slots.append(item) class SortedInventory(Inventory): def add_item(self, item): super().add_item(item) self.slots.sort()
{ "content_hash": "d23c00a6d5ef3617d56e21b72d19400c", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 33, "avg_line_length": 19.071428571428573, "alnum_prop": 0.550561797752809, "repo_name": "CaseyNord/Treehouse", "id": "7cc0f9de6ef499e7ae53b19025583f8cd24a7738", "size": "2...
""" Implement slices and various slice computations. """ import itertools from llvmlite import ir from numba.six.moves import zip_longest from numba import cgutils, types, typing from .imputils import (lower_builtin, lower_getattr, iternext_impl, impl_ret_borrowed, impl_...
{ "content_hash": "e2c0efb901deb0fc7744bb050d7fa40a", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 96, "avg_line_length": 33.5311004784689, "alnum_prop": 0.5971746575342466, "repo_name": "jriehl/numba", "id": "cc81883a1dbad992eb84503147a88f05fcab4fba", "size": "7008", ...
""" Functions for handling the execution of a pipeline graph """ import logging from dask import delayed logger = logging.getLogger(__name__) def delay_pipeline(pipeline, pipe): """ Return a ``dask.delayed`` pipeline ready to execute Args: pipeline (list[Task]): A list of curried ``Task`` ready to ...
{ "content_hash": "faf67ebd5a0d665708fba8240e26fbd0", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 77, "avg_line_length": 29.846153846153847, "alnum_prop": 0.6481958762886598, "repo_name": "c11/yatsm", "id": "027515a48789ee0e16575886a79119e41f4871d1", "size": "776", "b...
# (c) 2009-2014 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav # Original PyFileServer (c) 2005 Ho Chun Wei. # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php """ WSGI middleware that handles GET requests on collections to display directories. See `...
{ "content_hash": "a7ce351fe4ebf806fec1c9dcfd79e1af", "timestamp": "", "source": "github", "line_count": 333, "max_line_length": 217, "avg_line_length": 43.42042042042042, "alnum_prop": 0.5363441455149042, "repo_name": "saukrIppl/seahub", "id": "8b20fdf75faabb2dbfaccffde0da6cd51364dcb3", "size": "14...
from django.conf.urls import url from .views import * urlpatterns = [ # Add bin data url(r'^add_bin_data/', add_bin_data, name ="add_bin_data"), ]
{ "content_hash": "993ccbe543ff35edc1d0e57196eccb87", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 63, "avg_line_length": 16.3, "alnum_prop": 0.6196319018404908, "repo_name": "bath-hacker/binny", "id": "41c9c420f1efdcede623bf44627e217a8fe27499", "size": "163", "binary"...
from __future__ import division import sqlite3 from bisect import bisect_left import plotly.plotly as py from plotly.graph_objs import Scatter, Figure, Layout, Data, YAxis, XAxis from feemodel.util import DataSample from feemodel.app.predict import PVALS_DBFILE from feemodeldata.plotting.plotrrd import BASEDIR de...
{ "content_hash": "1c596269e2a34b06ee227280bb4bfddc", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 75, "avg_line_length": 29.24468085106383, "alnum_prop": 0.6213168424881775, "repo_name": "bitcoinfees/bitcoin-feemodel-data", "id": "b7e6129db622711592b894cfa7f14f8bbe198a09"...
from math import factorial print reduce(lambda x, y: x * y, filter(lambda n: factorial(n-1)%n == n-1, [i for i in range(1,21)]), 1)
{ "content_hash": "203539f102e0af4a397c7eb3955bc4ae", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 104, "avg_line_length": 65.5, "alnum_prop": 0.6641221374045801, "repo_name": "jacksarick/My-Code", "id": "80854cf317daac3e56a6aa407a89d10b3bbcf763", "size": "242", "binary...
import unittest from base64 import b64encode from airflow import configuration from airflow import models from airflow.contrib.operators.ssh_operator import SSHOperator from airflow.models import DAG, TaskInstance from airflow.settings import Session from airflow.utils import timezone from airflow.utils.timezone impor...
{ "content_hash": "1406bcfdc022672480299619370ab5bb", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 87, "avg_line_length": 31.333333333333332, "alnum_prop": 0.569813829787234, "repo_name": "r39132/airflow", "id": "3cf12cab6c612eab34bba060f2f95b84490890ca", "size": "6828"...
def create_model(project_id, dataset_id, display_name): """Create a model.""" # [START automl_vision_object_detection_create_model] from google.cloud import automl # TODO(developer): Uncomment and set the following variables # project_id = "YOUR_PROJECT_ID" # dataset_id = "YOUR_DATASET_ID" ...
{ "content_hash": "aa1fcaa822d106dcfa35f7563c39a994", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 113, "avg_line_length": 41.3235294117647, "alnum_prop": 0.7103202846975089, "repo_name": "GoogleCloudPlatform/python-docs-samples", "id": "d00c0a669b8cb228d0658b4dfa2c2f419a1...
from .se import Lower_SE from .sma import Lower_SMA
{ "content_hash": "50d1b259f0f5bb20df1442259fd416a6", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 26, "avg_line_length": 26, "alnum_prop": 0.7692307692307693, "repo_name": "ljwolf/spvcm", "id": "899bccd21c2a9f94735151c115790d1e30562ab5", "size": "52", "binary": false, ...
from pyface.tasks.api import Editor, Task, TaskPane from traits.api import Bool, Instance, Property, Str, cached_property # Local imports. from pyface.tasks.action.listening_action import ListeningAction class TaskAction(ListeningAction): """ An Action that makes a callback to a Task. Note that this is a co...
{ "content_hash": "8420edf1e74b391ece1daa0928bdb15b", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 80, "avg_line_length": 32.76642335766423, "alnum_prop": 0.4847404767208732, "repo_name": "geggo/pyface", "id": "66d7f5d9db6945c7f3e3e060b57789355e6b1978", "size": "4518", ...
from django.conf.urls import patterns, url from log import views urlpatterns = patterns('', url(r'^entry/$', views.EntryListAPIView.as_view(), name='log_entry_list'), url(r'^entry/id/$', views.EntryCreateAPIView.as_view(), name='log_entry_id'), # Use optional ending slash since Backbone models don't use ...
{ "content_hash": "3363538d8a7f318d8e113539e312808c", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 81, "avg_line_length": 37.81818181818182, "alnum_prop": 0.6778846153846154, "repo_name": "thachhoang/log", "id": "53142e044af11e71de5552e08159a50c67557f38", "size": "416", ...
import os import sys from .server import app def main(): """The application command-line entry point.""" # Get contextual information project_directory = os.path.abspath(os.path.normpath('.')) relationships_filename = 'relationships.json' # Set default config values app.config.setdef...
{ "content_hash": "b88ace0cb2bd366dde28faf4382f5f96", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 108, "avg_line_length": 35.60606060606061, "alnum_prop": 0.6885106382978723, "repo_name": "joeyespo/mockdown", "id": "e86519206e2c91cf582726b2850e6949648f8b68", "size": "11...
"""Sending email This program uses :py:mod:`smtplib` to send emails. Notes: * ``smtp_info`` file has each item on a separate line. * Email address used is specially created for this chapter. * Use :func:`input` for password to prevent storing in unencrypted file. """ def main(): # Connecting to an ...
{ "content_hash": "f96e43fd56f35e2fd3cc770b6ff1d33c", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 99, "avg_line_length": 27.575, "alnum_prop": 0.6300997280145059, "repo_name": "JoseALermaIII/python-tutorials", "id": "b50cdb66bb6d53c8ebf3b696f247d21b2c36efce", "size": "1...
''' salt.serializers.yamlex ~~~~~~~~~~~~~~~~~~~~~~~~~~ YAMLEX is a format that allows for things like sls files to be more intuitive. It's an extension of YAML that implements all the salt magic: - it implies omap for any dict like. - it implies that string like data are str, not unicode ...
{ "content_hash": "9fdf163e5ae7264d695a5bc8fbc1080d", "timestamp": "", "source": "github", "line_count": 414, "max_line_length": 113, "avg_line_length": 31.096618357487923, "alnum_prop": 0.632204443063539, "repo_name": "stephane-martin/salt-debian-packaging", "id": "65fbf58e4859aeb8ae38d2feaa8a9f66811...
import os, requests, json from typing import Any from urllib.parse import urljoin from igf_data.utils.dbutils import read_json_data from igf_data.utils.fileutils import check_file_path def get_request( url: str, headers: Any = None, verify: bool = False, jsonify: bool = True) \ -> Any:...
{ "content_hash": "0c7a63cbe99680019e0c377e80af9554", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 85, "avg_line_length": 27.581818181818182, "alnum_prop": 0.5910788837618106, "repo_name": "imperial-genomics-facility/data-management-python", "id": "f5b2157bd3c48df0b953274...
"""Admin application.""" import importlib import pkgutil from flask_admin import Admin from flask_admin.base import AdminIndexView, MenuLink from flask.ext.admin.contrib.sqla import ModelView from flask_login import current_user from pygotham import factory, filters __all__ = ('create_app',) class HomeView(AdminI...
{ "content_hash": "93382e7a4026f6cc02a83f0150459739", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 72, "avg_line_length": 31.375, "alnum_prop": 0.6607854297097325, "repo_name": "djds23/pygotham-1", "id": "8800c5b43d8264be55d4b04ab9a3347f5793d4d1", "size": "1757", "bina...
from distutils.core import setup setup(name='NIDAQtools', version='0.1', description='High-level tools for working with NI DAQmx devices', author='Jaap Kokorian', author_email='jkokorian@gmail.com', url='', packages=['nidaqtools'], )
{ "content_hash": "23693817982bc86e8d93692755fa1b88", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 71, "avg_line_length": 27.5, "alnum_prop": 0.64, "repo_name": "jkokorian/pydaqtools", "id": "7476f9830e4e8a97a5abfcf846c5588f97bb555f", "size": "298", "binary": false, ...
import RPi.GPIO as GPIO import time import os import uinput #print('Button Pressed') GPIO.setmode(GPIO.BCM) GPIO.setup(24, GPIO.IN, pull_up_down=GPIO.PUD_UP) while True: input_state = GPIO.input(24) if input_state == False: #print('Button Pressed') #<- for debugging only with uinput.Device([u...
{ "content_hash": "91ca220c2d6d323e139500920bf37965", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 57, "avg_line_length": 24.61111111111111, "alnum_prop": 0.654627539503386, "repo_name": "andreknieriem/photobooth", "id": "c7edef341e69e2ea6c3040cebf0369cd5b85655e", "size"...
list = [hello];print(list);
{ "content_hash": "17c335bef12d4780c13cbc90eb036927", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 27, "avg_line_length": 27, "alnum_prop": 0.6666666666666666, "repo_name": "DataScience-SacState/HackDavis", "id": "f103b1cc975820d476575667b0ad7e1120160096", "size": "27", ...
from oslo_config import cfg from tempest.common import credentials_factory as common_creds from tempest.common import tempest_fixtures as fixtures from tempest import config from tempest.lib import auth from tempest.lib import exceptions as lib_exc from tempest.lib.services.identity.v2 import token_client as v2_client...
{ "content_hash": "d56395af276d745ee9d0381b313fb846", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 79, "avg_line_length": 40.422413793103445, "alnum_prop": 0.6464064832586905, "repo_name": "HybridF5/tempest", "id": "3c104b2e484ceea5d3e8113d09830c87ce1be94c", "size": "53...
from extended_choices import Choices LOG_LEVELS = Choices( # constant, db_id, friendly string # Indicates the importance of the event. # Events with level >= HIGH are denormalised on the # case as well and 'mark' the progress of a case # indirectly ("HIGH", 29, "HIGH"), ("MODERATE", 21, "MO...
{ "content_hash": "09dbbcb557bac3e0067cf6e45f6b3c03", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 105, "avg_line_length": 31.807692307692307, "alnum_prop": 0.6299879081015719, "repo_name": "ministryofjustice/cla_backend", "id": "64d7fc9cfd18be11082184f72134d93ec08118a5", ...
""" luigi.hadoop has moved to :py:mod:`luigi.contrib.hadoop` """ # Delete this file any time after 28 July 2015 import warnings from luigi.contrib.hadoop import * warnings.warn("luigi.hadoop module has been moved to luigi.contrib.hadoop", DeprecationWarning)
{ "content_hash": "9b828a4975a84598626e0d9556ba2fd0", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 75, "avg_line_length": 25.09090909090909, "alnum_prop": 0.7282608695652174, "repo_name": "17zuoye/luigi", "id": "6fb4c90c3150cab1acdef27e91eeeacd74824bc4", "size": "879", ...
"""Allows to configure custom shell commands to turn a value for a sensor.""" from collections.abc import Mapping from datetime import timedelta import json import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from homeassistant.const import ( CONF_COMM...
{ "content_hash": "d893c7eb4afff876635ef96abf9d0249", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 86, "avg_line_length": 32, "alnum_prop": 0.6061422413793104, "repo_name": "kennedyshead/home-assistant", "id": "10c5a16f60b37f9fe451577e16a51f86a925bcdd", "size": "5568", ...
import sys,os import pickle import socket class ClientArgv(object): def __init__(self,argvs): self.argvs = argvs self.argvs_parser() self.handle() def handle(self): self.connect() #接收打印欢迎信息 server_data = self.client_socket.recv(1024) print server_data ...
{ "content_hash": "589541e3f59ff119dd3fcf565662a7d1", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 82, "avg_line_length": 34.16891891891892, "alnum_prop": 0.5159185287719992, "repo_name": "AlanProject/day08", "id": "b38b0a30bf29b4f5b5388261580ce69c0b056762", "size": "52...
from azure.identity import DefaultAzureCredential from azure.mgmt.streamanalytics import StreamAnalyticsManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-streamanalytics # USAGE python create_an_event_hub_output_with_json_serialization.py Before run the sample, ple...
{ "content_hash": "e6aa00704a749ca509d27c41b9526635", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 163, "avg_line_length": 39.301886792452834, "alnum_prop": 0.6159385501680269, "repo_name": "Azure/azure-sdk-for-python", "id": "94e7738d29a20c0ec23d8b37dc6363a2ab75c0f4", "...
from angr.errors import SimEngineError, SimMemoryError from angr.analyses.bindiff import differing_constants from angr.analyses.bindiff import UnmatchedStatementsException from angr import Analysis, register_analysis from . import chain_builder from . import gadget_analyzer from . import common import pickle import i...
{ "content_hash": "68ed560c3fa9de6b4eb8304f72eb22ac", "timestamp": "", "source": "github", "line_count": 422, "max_line_length": 118, "avg_line_length": 40.822274881516584, "alnum_prop": 0.5757822023567656, "repo_name": "salls/angrop", "id": "b0076fad48db250094723a4558f77acecab3cbe8", "size": "17227...
'''Wrapper for http://oss.sgi.com/projects/ogl-sample/ABI/wglext.h Generated by tools/gengl.py. Do not modify this file. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: gengl.py 601 2007-02-04 05:36:59Z Alex.Holkner $' from ctypes import * from pyglet.gl.lib import link_WGL as _link_function from pyglet.g...
{ "content_hash": "8b892c55e96883b56eda50f0aa0810e5", "timestamp": "", "source": "github", "line_count": 778, "max_line_length": 181, "avg_line_length": 76.66066838046272, "alnum_prop": 0.7566815331477817, "repo_name": "mattpap/sympy-polys", "id": "b715ec8e1017a2f8cf233c8c58b0b876277ebbfc", "size": ...
from sklearn import svm from sklearn import datasets clf = svm.SVC() iris = datasets.load_iris() X, y = iris.data, iris.target clf.fit(X, y) import pickle s = pickle.dumps(clf)
{ "content_hash": "b7741401cf99d7d71e9cee995b4d16e3", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 29, "avg_line_length": 16.363636363636363, "alnum_prop": 0.7166666666666667, "repo_name": "suresh/notes", "id": "f7b6cc291f5b84211bb633b93189e58f5fab9ca0", "size": "180", ...
import argparse import time import math import torch import torch.nn as nn from torch.autograd import Variable import data import model parser = argparse.ArgumentParser(description='PyTorch PennTreeBank RNN/LSTM Language Model') parser.add_argument('--data', type=str, default='./data/penn', help='...
{ "content_hash": "ff13826dfe6817f423d9bc97fb4e7a4d", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 106, "avg_line_length": 39.39267015706806, "alnum_prop": 0.578548644338118, "repo_name": "edgarriba/examples", "id": "88ed6007ef61688a0b47fa7764d314107787b60c", "size": "7...
import couchdb import json class Handle_DB(): def __init__(self,url): self.server = couchdb.Server(url) try: self.db = self.server.create('tweets') except: self.db = self.server['tweets'] def add_tweet(self, id, tweet, BOW, sentiment, city, label)...
{ "content_hash": "7f31d1ccfb8bbe131d3c0885b08480cb", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 123, "avg_line_length": 29.140350877192983, "alnum_prop": 0.48946417820590005, "repo_name": "Le0nHardt/Cloud-Project", "id": "775a5000fa46b1c48b5e283ff6234e4b2c0822a2", "si...
from __future__ import absolute_import, unicode_literals import argparse import os import sys from .options import project class BaseCommand(object): """A CLI command. """ name = None description = None default_arguments = [project] arguments = [] def __init__(self, parser=None): ...
{ "content_hash": "1acaced61c2f11b3ef107d5a75384f69", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 60, "avg_line_length": 24.559322033898304, "alnum_prop": 0.5914423740510697, "repo_name": "kennethreitz/pipenv", "id": "0ca48682ed8c7e42d1db37c541a5f7cfaba77320", "size": "...
"""Python configuration for recording multiple incorrect submissions issue.""" from __future__ import annotations from extensions.issues import base class MultipleIncorrectSubmissions(base.BaseExplorationIssueSpec): """Issue that's recorded when the learner answers multiple times incorrectly in the same car...
{ "content_hash": "ea2a9cf47b7ea7bd845ba2d090a28c39", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 80, "avg_line_length": 28.703703703703702, "alnum_prop": 0.6103225806451613, "repo_name": "brianrodri/oppia", "id": "501aec6129e31bb7dae85c266739c37e5789f468", "size": "139...
"""TOPI Testing Util functions. Used to verify the correctness of operators in TOPI . """ from __future__ import absolute_import as _abs from .conv1d_ncw_python import conv1d_ncw_python, group_conv1d_ncw_python from .conv2d_hwcn_python import conv2d_hwcn_python from .conv2d_nchw_python import conv2d_nchw_python from ...
{ "content_hash": "6a256eb4a034092afac2f5818ef8bb6f", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 98, "avg_line_length": 44.40983606557377, "alnum_prop": 0.8028792912513842, "repo_name": "dmlc/tvm", "id": "c3d222cfd1209eba25793f243cc800e73e7d4569", "size": "3495", "bi...
from LogReader import LogReader import math import json import pickle class DataCondenser: def __init__(self): self.rdrLog = LogReader() def condenseData(self, strPath): dataOwl = None log = self.rdrLog.loadLog(strPath) dataOwl = log.getOwlData() ...
{ "content_hash": "0a737cb531bd52d276d909c7e0561fbf", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 104, "avg_line_length": 36.109756097560975, "alnum_prop": 0.49037487335359675, "repo_name": "code-iai/semrec", "id": "f519bb82ca50f2dd3ca0e3a689441f33915112d6", "size": "29...
""" sentry.web.urls ~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import __all__ = ('urlpatterns',) from django.conf.urls import include, patterns, url from django.conf import settings impo...
{ "content_hash": "5fe59ec8d3ceaa06bcf8873b07afa0cb", "timestamp": "", "source": "github", "line_count": 372, "max_line_length": 175, "avg_line_length": 52.674731182795696, "alnum_prop": 0.6506761929063537, "repo_name": "fuziontech/sentry", "id": "bf2476c0d89947d4d31d59aac1a0ed4644a508bd", "size": "...
from sys import (oar, baz) oar
{ "content_hash": "1c0161098b47d4ded43549c55d5e0057", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 26, "avg_line_length": 10.333333333333334, "alnum_prop": 0.7096774193548387, "repo_name": "int19h/PTVS", "id": "77b4ee7927465395fe0cfee677a6b0126789b2d0", "size": "31", "b...
""" Title: Text generation with a miniature GPT Author: [Apoorv Nandan](https://twitter.com/NandanApoorv) Date created: 2020/05/29 Last modified: 2020/05/29 Description: Implement a miniature version of GPT and train it to generate text. """ """ ## Introduction This example demonstrates how to implement an autoregress...
{ "content_hash": "9f5bc7fe20ff39eb3510a3a05a750553", "timestamp": "", "source": "github", "line_count": 299, "max_line_length": 152, "avg_line_length": 33.130434782608695, "alnum_prop": 0.6723198061780739, "repo_name": "keras-team/keras-io", "id": "7d68291637252304d3801e0861cd44b6db2f3cbd", "size":...
import sys import re all_features = ['OSPL'] ignore_regex = ['<\?xml .*\?>', '<splice_meta_config version=.*>', '<!--xmlns:xsi=.*-->', '<serviceMapping>', '<element name=.* command=.*>', '</serviceMapping>', '</splice_meta...
{ "content_hash": "5faad54407d017d048bb6d7335768601", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 68, "avg_line_length": 26.203125, "alnum_prop": 0.5491949910554562, "repo_name": "osrf/opensplice", "id": "03f6a696c6df9c4417b398da34b0ff159fa5e1bd", "size": "1696", "bin...
"""Extract what lint expects for cmap from our data.""" import argparse import sys from nototools import lint_config from nototools import noto_data from nototools import opentype_data from nototools import unicode_data from nototools import cmap_data _PHASE_TWO_SCRIPTS = """ Arab, Aran, Armi, Armn, Avst, Bali, B...
{ "content_hash": "8866267ba97be60de2ede955a88f861c", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 79, "avg_line_length": 33.80392156862745, "alnum_prop": 0.6690835266821346, "repo_name": "dougfelt/nototools", "id": "93b3b2b0ad66c34b7e852abfdfeaf233eaf97b73", "size": "7...
from django.conf.urls import url from personas.views import Personas,EditarContrato,CrearContrato,EditarPersona, ReportePersonasExcel, Bienvenida, DetalleContrato,\ ModificarContrato,ReporteEDPExcel,ReporteODCExcel,ficha,DetalleEdp,ModificarEdp,BorrarEdp,ModificarOdc,DetalleOdc,BorrarOdc,ReporteFiniquito,\ crear_docODC...
{ "content_hash": "804f667a9758fb6b331dd90801031c29", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 154, "avg_line_length": 54.733333333333334, "alnum_prop": 0.6803897685749086, "repo_name": "Ykharo/tutorial_P3_4", "id": "888e3bc8a6269467ce87a54c5bf8c65ff8bcddae", "size":...
class DitError(Exception): pass class ArgumentError(DitError): pass class NoTaskSpecifiedError(DitError): pass class SubprocessError(Exception): pass def maybe_raise_unrecognized_argument(argv): if len(argv) > 0: raise ArgumentError("Unrecognized argument: %s" % argv[0])
{ "content_hash": "548b7fb035e97d638496fc65b8b0a87e", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 66, "avg_line_length": 16.210526315789473, "alnum_prop": 0.7045454545454546, "repo_name": "filipelbc/dit", "id": "b16b0b81ba1436a058616e8384d04329b3dd0d34", "size": "334", ...
import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import syscall_name usage = "perf script -s syscall-counts.py [comm]\n"; for_comm = None if len(sys.argv) > 2: sys.exit(usage) if ...
{ "content_hash": "5094d2765923297e81b3becd84627ec8", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 77, "avg_line_length": 25.017543859649123, "alnum_prop": 0.6129032258064516, "repo_name": "KristFoundation/Programs", "id": "e66a7730aeb5de966b25d9f6401188d0db7c305b", "siz...
"""Hook for Google Drive service""" from typing import IO, Any, Optional, Sequence, Union from googleapiclient.discovery import Resource, build from googleapiclient.http import HttpRequest, MediaFileUpload from airflow.providers.google.common.hooks.base_google import GoogleBaseHook class GoogleDriveHook(GoogleBaseH...
{ "content_hash": "2a25839b6382b54eb542675407422e61", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 107, "avg_line_length": 41.41121495327103, "alnum_prop": 0.5854208982171067, "repo_name": "lyft/incubator-airflow", "id": "94390503aae67b1849dcd69c949e50ec9ca30646", "size...
import time import praw import re import urllib2 import signal, sys # This string is sent by praw to reddit in accordance to the API rules user_agent = ("REDDIT Bot v1.4 by /u/USERNAME") r = praw.Reddit(user_agent=user_agent) # Fill in the bot's username and password here username = "USERNAME" password = "PASSWORD" r...
{ "content_hash": "f7e78366c1d58230f8fd91caede39291", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 151, "avg_line_length": 45.29197080291971, "alnum_prop": 0.5866236905721193, "repo_name": "XSlicer/RedditMTGBot", "id": "130140aa828ef217c3422adc901c837234023e27", "size":...
""" Presence analyzer. """ from .main import APP from . import views
{ "content_hash": "ffd4dc94e2bfe3862c6bbfbae29e55f0", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 21, "avg_line_length": 11.666666666666666, "alnum_prop": 0.6857142857142857, "repo_name": "stxnext-kindergarten/presence-analyzer-gderdak", "id": "c60a4dfa84f49b326aad699948a1...
import os from django.contrib.auth.decorators import login_required from django.core.exceptions import ValidationError from django.http.response import HttpResponse from django.shortcuts import render, redirect from WhatManager2 import whatimg import bibliotik.settings import WhatManager2.settings from books import s...
{ "content_hash": "977ebd36cc94e3de5593d6a04255c564", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 98, "avg_line_length": 37.73026315789474, "alnum_prop": 0.6284219703574542, "repo_name": "davols/WhatManager2", "id": "72193895d3173eaa4b6ba57ad7aef83e37ae66f7", "size": "...
import pickle man = [] other = [] try: with open('sketch.txt') as data: for each_line in data: try: (role, line_spoken) = each_line.split(':',1) line_spoken = line_spoken.strip() if role == 'Other Man': man.append(li...
{ "content_hash": "1d45f2d8b3c394dd6f3d0f9723a6f4e6", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 107, "avg_line_length": 29.392857142857142, "alnum_prop": 0.5188335358444714, "repo_name": "tdean1995/HFPythonSandbox", "id": "30062583a2a464eca1d287f671aad915ba113864", "s...
""" Created on Tue Nov 03 13:06:56 2015 @author: Eunice """ if __name__ == '__main__': import sys sys.path.append("..") from pyalgotrade import bar from pyalgotrade import plotter # 以上模块仅测试用 from pyalgotrade.broker.fillstrategy import DefaultStrategy from pyalgotrade.broker.backtesting import Tra...
{ "content_hash": "f7cffadcdd101bd512f805c048791853", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 126, "avg_line_length": 27.049689440993788, "alnum_prop": 0.5524684270952928, "repo_name": "UpSea/midProjects", "id": "d181c6fb490be41346a5036c5bbc8d8537f0ca89", "size": "...
import os import scipy.misc from model import DCGAN from utils import pp import tensorflow as tf flags = tf.app.flags flags.DEFINE_integer("epoch", 10, "epoch to train [25]") flags.DEFINE_float("learning_rate", 0.0002, "Learning rate of for adam [0.0002]") flags.DEFINE_float("beta1", 0.5, "Momentum term of adam [0.5...
{ "content_hash": "0290e41d65808e3bac5f8cf718e96370", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 106, "avg_line_length": 40.11904761904762, "alnum_prop": 0.686646884272997, "repo_name": "pascal220/ESPCN_OCT", "id": "7a0c4d44a9d8f4c3ce1efa9905db89e00f6c8c0b", "size": "1...
from datacanvas.dataset import DataSet def test_text_file(): url = 'file://test_output_text_file.bin' content_write = 'test_text_file' o = DataSet(url=url, format='text') o.put_raw(content_write) i = DataSet(url=url, format='text') content_read = i.get_raw() assert content_read == content_...
{ "content_hash": "08acf7b7dd551162be65ef2ca1bea037", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 46, "avg_line_length": 29.714285714285715, "alnum_prop": 0.6522435897435898, "repo_name": "DataCanvasIO/pyDataCanvas", "id": "5b156577c236d27424431e8588d722f18ed3aed2", "si...
from point import Point from sensor import Sensor from device import Device from rule import Rule
{ "content_hash": "91ae14b12674dc02334309c111ca5bac", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 25, "avg_line_length": 24.5, "alnum_prop": 0.8367346938775511, "repo_name": "TempoIQ/tempoiq-python", "id": "ba83f02ea9fa054f61bb393fb97e4fbbc3616968", "size": "98", "bina...
from __future__ import absolute_import import abc import copy import random from builtins import map from builtins import object from builtins import range from opentuner.search import technique from .technique import SearchTechnique class GlobalEvolutionaryTechnique(SearchTechnique): def __init__(self, ...
{ "content_hash": "2244d598d35afa64d98582870fafd9b1", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 99, "avg_line_length": 30.364963503649633, "alnum_prop": 0.6161057692307692, "repo_name": "jansel/opentuner", "id": "a7ea2357437b2b8fe29f3221c65b49bbc218fae2", "size": "41...