text
stringlengths
4
1.02M
meta
dict
from django.db.backends.postgresql_psycopg2 import base from transaction_hooks.mixin import TransactionHooksDatabaseWrapperMixin class DatabaseWrapper(TransactionHooksDatabaseWrapperMixin, base.DatabaseWrapper): pass
{ "content_hash": "53188abbaa66a0d1d925a858068e6da1", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 72, "avg_line_length": 30.75, "alnum_prop": 0.7886178861788617, "repo_name": "carljm/django-transaction-hooks", "id": "0ae316897c9b26ac06bb8ac7ba2fcd5acc6edf1f", "size": "24...
from __future__ import absolute_import from __future__ import print_function from typing import Any from argparse import ArgumentParser from django.core.management.base import BaseCommand from zerver.lib.actions import do_rename_stream from zerver.lib.str_utils import force_text from zerver.models import Realm, Serv...
{ "content_hash": "82918b3a270731eb70a44bd86d91ea11", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 86, "avg_line_length": 37.48717948717949, "alnum_prop": 0.5807113543091655, "repo_name": "jrowan/zulip", "id": "1cc11bd2b9459c2bbfa304646dd441f03576280c", "size": "2924", ...
__version__=''' $Id: textobject.py 3959 2012-09-27 14:39:39Z robin $ ''' __doc__=""" PDFTextObject is an efficient way to add text to a Canvas. Do not instantiate directly, obtain one from the Canvas instead. Progress Reports: 8.83, 2000-01-13, gmcm: created from pdfgen.py """ import sys import string from types impor...
{ "content_hash": "7356bc3d5e8cd6d1ad23619b06da7bc5", "timestamp": "", "source": "github", "line_count": 448, "max_line_length": 139, "avg_line_length": 40.761160714285715, "alnum_prop": 0.5801434751656536, "repo_name": "nakagami/reportlab", "id": "8326a5c139b2b0fa4d57b4d57804746d8b93e28a", "size": ...
import numpy as np import cv2 def drawMatches(img1, kp1, img2, kp2, matches): """ My own implementation of cv2.drawMatches as OpenCV 2.4.9 does not have this function available but it's supported in OpenCV 3.0.0 This function takes in two images with their associated keypoints, as well as a l...
{ "content_hash": "814d51abbd59eae9f0011b0af7f8f9c7", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 81, "avg_line_length": 32.067567567567565, "alnum_prop": 0.6367467340918669, "repo_name": "NataliaDymnikova/camera-position-by-line", "id": "dcb0ec0d0d2841d039c09afd3912fa9b4...
import os import numpy as np import pycuda.driver as drv from pycuda.tools import context_dependent_memoize from struct import unpack_from from pytools import memoize, memoize_method from float_ew import call_compound_kernel from layers import DataLayer, FullLayer, ConvLayer, PoolLayer, _get_sm_count class GPUTensor(...
{ "content_hash": "9a6ec1bb644a183b162b25d859d47043", "timestamp": "", "source": "github", "line_count": 1029, "max_line_length": 108, "avg_line_length": 36.97959183673469, "alnum_prop": 0.5418112057184905, "repo_name": "baidu-research/nervanagpu", "id": "612b3a0239166b1881aefa630ff96f9c95ec4aab", "...
import sys, string, hashlib from Crypto.PublicKey import RSA from OP_RETURN import * CN = raw_input("Which is the primary Host Name of your website (Common Name - CN)?") #Common Name O = raw_input("Which is the Organizations name?") #Organization O2 = O.replace(" ", "_") #Replace the spaces of the Organization with un...
{ "content_hash": "485ad1f7546dce8477b1dc37e0834d94", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 111, "avg_line_length": 47.38, "alnum_prop": 0.6758125791473195, "repo_name": "Cr0wTom/Block-SSL", "id": "9fd75b8a1e8571beb1c5ef18a4b39d5a32304d3a", "size": "2388", "bina...
import numpy as np import pdb import math from FoldResult import FoldResult import Maybe import errors class CvResult(object): '''Cross-validation result. Created by running main program cv-cell.py Contains results from n-fold cross validation. ''' def __init__(self): self.fold_results...
{ "content_hash": "46ea37a73829357a995fd16793fed5c6", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 80, "avg_line_length": 35.87323943661972, "alnum_prop": 0.5520219866509619, "repo_name": "rlowrance/re-local-linear", "id": "fb91e610f485cf019e430df6e4aec7b53c77bf44", "si...
import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * import dateparser STYLES_DICT = { 'black': '', 'green': 'primary', 'red': 'danger' } DATE_FORMAT = '%Y-%m-%d %H:%M:%S' def create_blocks(text: str, entitlement: str, options: list, reply: str) -> list: ...
{ "content_hash": "b269eb29115c9386ab06ce194c9cb2e6", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 121, "avg_line_length": 33.895833333333336, "alnum_prop": 0.5449702929727515, "repo_name": "VirusTotal/content", "id": "13a9e5e1330131387096df61b15532af20afda70", "size": ...
from debug_mode_logging import DebugModeLoggingMiddleware
{ "content_hash": "89d204e404f57e226c798a0aef847ce2", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 57, "avg_line_length": 58, "alnum_prop": 0.896551724137931, "repo_name": "prior/djextras", "id": "819f2abf594edaf7d31d12e607626ec8201bd60b", "size": "58", "binary": false,...
import os HAIL_USE_FULL_QUERY = os.environ.get('HAIL_USE_FULL_QUERY') is not None
{ "content_hash": "11d049eab1aaaf66b40d1f3f9928d96a", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 71, "avg_line_length": 27.666666666666668, "alnum_prop": 0.7349397590361446, "repo_name": "danking/hail", "id": "f1163e1a73f3628e8baad5cc4f0e2384a5e7adbe", "size": "83", "...
""" Common fabric utilities used for different tasks such as manager setup, child management, AMI creation and so on. """ from fabric.api import put, get, sudo, run from cStringIO import StringIO __all__ = ['use_vpc_sources', 'update_hosts'] def use_vpc_sources(): """ Updates the APT sources for instances...
{ "content_hash": "eeae1d28782a1d4135172273bf693718", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 79, "avg_line_length": 32.79245283018868, "alnum_prop": 0.6904487917146145, "repo_name": "GaretJax/pop-utils", "id": "faf3f516d306e33d3766f3cd6a385534d059a141", "size": "17...
"""Tests for `tf.data.Iterator`.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import warnings from absl.testing import parameterized import numpy as np from tensorflow.core.protobuf import cluster_pb2 from tensorflow.core.protobuf import config_pb2 f...
{ "content_hash": "5f78c6a2f0f32e1c53d292d0adccfd89", "timestamp": "", "source": "github", "line_count": 1009, "max_line_length": 80, "avg_line_length": 38.69970267591675, "alnum_prop": 0.6361145257119443, "repo_name": "aam-at/tensorflow", "id": "a59c64d50b2469ee0d19aa79278aa8455b5a5856", "size": "3...
while True: reply = input('Enter text: ') if reply == 'stop': break print(reply.upper())
{ "content_hash": "77cdfe1620e2f3e1a368542d912b8042", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 33, "avg_line_length": 25.25, "alnum_prop": 0.5841584158415841, "repo_name": "eroicaleo/LearningPython", "id": "7b22891cacfb2413cbc8e7927332f0a556d81c57", "size": "129", "...
""" code that tests the SimpleGraph class defined in simple_graph.py can be run with py.test """ import pytest # used for the exception testing import unittest from simple_graph import Node, Edge class MyFuncTestCase(unittest.TestCase): # g.nodes(): return a list of all nodes in the graph # g.edges(): re...
{ "content_hash": "50f1a7218cf3b8d35ff1ceffb95e21f4", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 159, "avg_line_length": 29.426395939086294, "alnum_prop": 0.5778851129894773, "repo_name": "CharlesGust/data_structures", "id": "06c767a4bdcadf1de4c7510e6cbda63c1ce0e810", ...
import os import sys from setuptools import setup, Command, find_packages # Pull version from source without importing # since we can't import something we haven't built yet :) exec(open('kafka/version.py').read()) class Tox(Command): user_options = [] def initialize_options(self): pass def fi...
{ "content_hash": "94c7a0e5552ea2f5979bc8ff6b29e54d", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 71, "avg_line_length": 28.34375, "alnum_prop": 0.6273428886438809, "repo_name": "Yelp/kafka-python", "id": "f611c3cfc241917935168b316c401eea741bdf84", "size": "1814", "bi...
import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General conf...
{ "content_hash": "b54d14afc57f9d2173cf6d882af16a16", "timestamp": "", "source": "github", "line_count": 318, "max_line_length": 92, "avg_line_length": 31.4748427672956, "alnum_prop": 0.7082625636926766, "repo_name": "andrewsomething/fabric-package-management", "id": "5481cb09903f03a8cb62bbfe434d0828f...
from __future__ import absolute_import, division, print_function import abc import functools import itertools import re import warnings from ._compat import string_types, with_metaclass from ._typing import TYPE_CHECKING from .utils import canonicalize_version from .version import Version, LegacyVersion, parse if TY...
{ "content_hash": "f9631db96d39e67ebdcd7aa9145a92f3", "timestamp": "", "source": "github", "line_count": 861, "max_line_length": 88, "avg_line_length": 37.198606271777, "alnum_prop": 0.5650680654427376, "repo_name": "kimjinyong/i2nsf-framework", "id": "a42cbfef3325fc2425c765ddf12c296053d53f48", "siz...
from __future__ import unicode_literals from django.apps import AppConfig class OccurrenceConfig(AppConfig): name = 'occurrence'
{ "content_hash": "38f2370063dd13cd34101c9064d2a613", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 39, "avg_line_length": 19.428571428571427, "alnum_prop": 0.7647058823529411, "repo_name": "parksandwildlife/wastd", "id": "3037b7ce35fe55c47949ffd9150b133015630b93", "size":...
"""This module contains an object that represents a Encrypted PassportFile.""" from typing import TYPE_CHECKING, List, Optional from telegram._telegramobject import TelegramObject from telegram._utils.defaultvalue import DEFAULT_NONE from telegram._utils.types import JSONDict, ODVInput if TYPE_CHECKING: from tel...
{ "content_hash": "3e69ab696833f86ea14263a74eed9d23", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 96, "avg_line_length": 32.64705882352941, "alnum_prop": 0.6048048048048048, "repo_name": "tzpBingo/github-trending", "id": "4158648367074576a34eceb5e94cab488254f633", "siz...
import json import unittest import webapp2 import webtest from google.appengine.ext import ndb from dashboard import group_report from dashboard import short_uri from dashboard.common import testing_common from dashboard.common import utils from dashboard.models import anomaly from dashboard.models import bug_data f...
{ "content_hash": "823b758116c77f9bc980baff93b3cd3b", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 77, "avg_line_length": 38.23837209302326, "alnum_prop": 0.6842025239470884, "repo_name": "catapult-project/catapult-csm", "id": "4aa48091fb0d1e9d97aad90fef5c4aa1cf722d1f", ...
from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListType from pyangbind.lib.ya...
{ "content_hash": "549b632b821ae0272082140cd9cdd2d0", "timestamp": "", "source": "github", "line_count": 478, "max_line_length": 377, "avg_line_length": 38.38075313807531, "alnum_prop": 0.5805080126458083, "repo_name": "napalm-automation/napalm-yang", "id": "d4cc4b0651cf5f5fd4a4fae5d5b49347444b30a6", ...
import json import datetime from django.core.urlresolvers import reverse from django.http import Http404, HttpResponse from django.shortcuts import render, get_object_or_404, redirect from django.template import loader, Context from django.contrib.sites.models import Site from django.contrib.auth.decorators import lo...
{ "content_hash": "16ef312783a5d7fd9990312d6226cab1", "timestamp": "", "source": "github", "line_count": 277, "max_line_length": 142, "avg_line_length": 34.581227436823106, "alnum_prop": 0.6015241674496294, "repo_name": "PyCon/pycon", "id": "66c69821dfc84649173cabd590255a4859c1c1a2", "size": "9579",...
import simplejson as json from twisted.web import resource, static from twisted.internet import defer from coherence import log class JsonInterface(resource.Resource, log.Loggable): logCategory = 'json' #isLeaf = False def __init__(self, controlpoint): resource.Resource.__init__(self) lo...
{ "content_hash": "d1907d78d850a222914d05ebfd8696bf", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 128, "avg_line_length": 38.616279069767444, "alnum_prop": 0.5459199036434809, "repo_name": "furbrain/Coherence", "id": "1190aabef5757af330104d5610f8f748ca5e7930", "size": "...
class NotFoundError(Exception): def __init__(self, path): self.path = path def __str__(self): return "Error: %s not found." % self.path class CmdError(Exception): def __init__(self, exitstatus, output): self.status = exitstatus self.output = output def __str__(self): ...
{ "content_hash": "86c5cb0198e55ab938da9549d566c685", "timestamp": "", "source": "github", "line_count": 407, "max_line_length": 153, "avg_line_length": 33.434889434889435, "alnum_prop": 0.531305114638448, "repo_name": "bticino/openembedded", "id": "54c12bac2ad07af4c5296ed3d9dbb8c9f179edac", "size":...
import getpass import sys import argparse # In the main directory of the repo where you are developing with PyGithub, # type: # git submodule add git://github.com/jacquev6/PyGithub.git PyGithub # git submodule init # git submodule update # # That will populate a PyGithub subdirectory with a clone of PyGithub ...
{ "content_hash": "7005d2264b4a08530324d4339ef3d029", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 75, "avg_line_length": 23.91111111111111, "alnum_prop": 0.7267657992565055, "repo_name": "SLAC-Lab/svn_to_git", "id": "807002f5a2e329088e0f1b543a318c6e361006a2", "size": "1...
from toscaparser.common.exception import ExceptionCollector from toscaparser.common.exception import UnknownFieldError from toscaparser.elements.capabilitytype import CapabilityTypeDef import toscaparser.elements.interfaces as ifaces from toscaparser.elements.interfaces import InterfacesDef from toscaparser.elements.re...
{ "content_hash": "429e7edd697f2f0d8c4f2a88ab57507b", "timestamp": "", "source": "github", "line_count": 218, "max_line_length": 78, "avg_line_length": 40.75688073394495, "alnum_prop": 0.537647720877884, "repo_name": "openstack/tosca-parser", "id": "07551e7a34493b2270e5f7631296f9b2dc441d92", "size":...
import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from iniconfig import IniConfig class Config(IniConfig): # file section file_useCsvWizard = IniConfig.iniproperty('file', 'useCsvWizard', True) file_owner = IniConfig.iniproperty('file', 'owner', {'name...
{ "content_hash": "d99f71958fc2fc0ea3c6edf4725f5d17", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 84, "avg_line_length": 33, "alnum_prop": 0.7108585858585859, "repo_name": "dmiro/iniconfig", "id": "e165dd06930227abc75394b533c90d61766e4f7e", "size": "1633", "binary": f...
from Primitives.RockPrimitives import * from Planners.RockTestPlanner import * numLocs = 2 numRocks = 2 rockLocs = [0, 0, 1, 1] robotX = 0 robotY = 1 rockSampled = [0, 0] rockQuality = [0.5, 0.5] initial_state = RockState(numLocs, numRocks, rockLocs, rockQuality, rockSampled, robotX, robotY) goal_state = initial_st...
{ "content_hash": "ac5eb94652afd01a7504a820f154d8d8", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 96, "avg_line_length": 32.5, "alnum_prop": 0.7420118343195267, "repo_name": "ciarakamahele/sasy", "id": "fc804d207fa3b7dfe7b78c9890962e8b00d2eac4", "size": "1437", "binar...
''' Created on Dec 11, 2016 @author: safdar ''' from basetrainer import BaseTrainer from keras.layers.core import Flatten, Dropout, Dense, Lambda, Activation from keras.layers.advanced_activations import ELU from keras.layers.convolutional import Convolution2D from keras.models import Sequential from keras.optimizers ...
{ "content_hash": "6dcd42805859c24a76d309896d47978f", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 90, "avg_line_length": 30.529411764705884, "alnum_prop": 0.6255619781631342, "repo_name": "safdark/behavioral-cloning", "id": "c0ef3eaa1f56c98ed6fc5d2f615aac054216d616", "s...
from __future__ import absolute_import, unicode_literals import copy import inspect import os import pydoc __all__ = [ 'settings', ] DEFAULT = { 'AUTH_COLLECTION': '', 'CORS': { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET,POST,PUT,PATCH,DELETE,OPTIONS', ...
{ "content_hash": "6d7377a9757f5636b667c2c0f480467f", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 79, "avg_line_length": 28.210526315789473, "alnum_prop": 0.5377798507462687, "repo_name": "lvieirajr/mongorest", "id": "13cd1a9a8cf35383560273bcffa4cdac90050e59", "size": "...
#!/usr/bin/env python """Assorted utilities shared between parts of apitools.""" import collections import os import random from protorpc import messages import six from six.moves import http_client import six.moves.urllib.error as urllib_error import six.moves.urllib.parse as urllib_parse import six.moves.urllib.req...
{ "content_hash": "325bd65942f4cfe00d5e41c6dce2b42a", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 80, "avg_line_length": 33.65384615384615, "alnum_prop": 0.684, "repo_name": "craigcitro/original-apitools", "id": "5158bfa4eb069fda9e61ca5904db8c6dbaded7f5", "size": "7000...
"""momentsinfo_convroll4_doublescale_fs5""" import numpy as np import theano import theano.tensor as T import lasagne as nn import data import load import nn_plankton import dihedral import tmp_dnn import tta batch_size = 128 chunk_size = 32768 num_chunks_train = 240 momentum = 0.9 learning_rate_schedule = { ...
{ "content_hash": "49f736e76c30df7ae5565e78fb669651", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 194, "avg_line_length": 33.116279069767444, "alnum_prop": 0.7082162921348315, "repo_name": "yejingxin/kaggle-ndsb", "id": "e1afd1502e71875b0c5127ae06055466d176f79b", "size"...
import marshmallow from molecule import logger from molecule.model import base LOG = logger.get_logger(__name__) class AnsibleSchema(base.Base): config_file = marshmallow.fields.Str() playbook = marshmallow.fields.Str() raw_env_vars = marshmallow.fields.Dict() extra_vars = marshmallow.fields.Str() ...
{ "content_hash": "2f966ada2deb5f64db4d6aa71b18f94a", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 71, "avg_line_length": 28.53932584269663, "alnum_prop": 0.728740157480315, "repo_name": "kireledan/molecule", "id": "98cfc46f6b6976e5dddfabfdb0ebf31feab2147e", "size": "366...
import socket import Queue import time import select def plugin_main(parameter, queue): host = 'localhost' sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) port = int(parameter) sock.bind(('localhost', port)) sock.listen(5) insock = [sock] while True: inready, outready, ex...
{ "content_hash": "c5f42ea1669fa623285534948f9e32b2", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 70, "avg_line_length": 23.88888888888889, "alnum_prop": 0.5224806201550387, "repo_name": "Pathangi-Jatinshravan/py_shipper", "id": "fa8626ade2bf959faf958e52227262e580a68a2c",...
"""This API defines FeatureColumn for sequential input. NOTE: This API is a work in progress and will likely be changing frequently. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections from tensorflow.python.feature_column import feat...
{ "content_hash": "265bb4ba602642e6ddcba7d628bfc96a", "timestamp": "", "source": "github", "line_count": 548, "max_line_length": 80, "avg_line_length": 37.589416058394164, "alnum_prop": 0.6989174231758823, "repo_name": "brchiu/tensorflow", "id": "67ffb939663358b5e356b3b626978db959c1bac9", "size": "2...
"""Clipper Management Utilities""" from __future__ import print_function, with_statement, absolute_import from fabric.api import * from fabric.contrib.files import append import os import requests import json import yaml import pprint import subprocess32 as subprocess import shutil from sklearn import base from sklear...
{ "content_hash": "d2ccb7b2811da70e29581501395b1358", "timestamp": "", "source": "github", "line_count": 1257, "max_line_length": 134, "avg_line_length": 40.517899761336515, "alnum_prop": 0.5491940075788813, "repo_name": "rmdort/clipper", "id": "3df0663604baa2ab0f10420056f5028127f632fd", "size": "50...
from __future__ import absolute_import import theano import theano.tensor as T import numpy as np from six.moves import range epsilon = 1.0e-9 def mean_squared_error(y_true, y_pred): return T.sqr(y_pred - y_true).mean() def mean_absolute_error(y_true, y_pred): return T.abs_(y_pred - y_true).mean() def squar...
{ "content_hash": "49db7d42251a124c18c66a0760246f40", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 74, "avg_line_length": 30.317073170731707, "alnum_prop": 0.6798069187449718, "repo_name": "jmportilla/keras", "id": "4388406b805eb6dba51eb5dd556ec6006c8c5d91", "size": "124...
import unittest import requests import json class TestBasicAPI(unittest.TestCase): def setUp(self): self.data = {"text" : "Example sentences, which can be tokenized. We can also split the sentences. We can extract scores like an agatston score of 432."} self.headers = {'Content-Type': 'application/json'} self....
{ "content_hash": "4995ace8757d3496286816cb56b28aae", "timestamp": "", "source": "github", "line_count": 357, "max_line_length": 501, "avg_line_length": 32.02521008403362, "alnum_prop": 0.6746260823930726, "repo_name": "904labs/ctTrakr", "id": "4943878db4301533f5ae83497b00793f7fcccc64", "size": "114...
"""User models.""" import datetime from flask_login import UserMixin, AnonymousUserMixin from oneiNote.database import Column, Model, SurrogatePK, db, \ reference_col, relationship from oneiNote.extensions import bcrypt class Role(SurrogatePK, Model): """A role for a user.""" __tablename__ = 'roles' ...
{ "content_hash": "9b35442ae5d0a91eddef9dfba4271345", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 79, "avg_line_length": 30.88888888888889, "alnum_prop": 0.6190647482014389, "repo_name": "on3iro/oneiNote", "id": "8a03ce67c738d0405341f6e90985ac348048050b", "size": "2804"...
from webapp2 import RequestHandler from src.handlers import BaseHandler from src.settings import JINJA_ENVIRONMENT, DEBUG from src.main.scraper import Scraper class Index(RequestHandler): def get(self): template_values = { 'nav': 'home', } template = JINJA_ENVIRONMENT.get_templ...
{ "content_hash": "0ce30ace5698c16b636c77d696382572", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 78, "avg_line_length": 27.45, "alnum_prop": 0.6757741347905283, "repo_name": "Tjorriemorrie/housing", "id": "c77fdb678cfbfb312a2222c5af7e65b26f565381", "size": "549", "bi...
import re from babel.numbers import format_currency from muntjac.demo.sampler.ExampleUtil import ExampleUtil from muntjac.api import VerticalLayout, Table from muntjac.ui.window import Notification from muntjac.ui.table import IHeaderClickListener, IFooterClickListener from muntjac.util import defaultLocale class ...
{ "content_hash": "c336b5ec611ce3444b65544f8e6e487f", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 80, "avg_line_length": 34.31404958677686, "alnum_prop": 0.6274084778420038, "repo_name": "rwl/muntjac", "id": "15f82014c48cdc6366dd6c6a926e732f3fc33203", "size": "4153", ...
import logging import random import time from config import get_self_fqdn from redis_manager import healthy_root_redis from topology import get_best_source def health_check_leaf(local_rd, info): # There is a chance that cascade.py has restarted and last time we self-selected to be # a branch, but this time w...
{ "content_hash": "9a2c812d17cca9d41e06f0746230f8cd", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 98, "avg_line_length": 42.81818181818182, "alnum_prop": 0.6764331210191082, "repo_name": "zorkian/cascade", "id": "970016a227b48bbd0cf63b8962064b295f9ce23a", "size": "2355"...
''' Nif User Interface, connect custom properties from properties.py into Blenders UI''' # ***** BEGIN LICENSE BLOCK ***** # # Copyright © 2005-2015, NIF File Format Library and Tools contributors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permi...
{ "content_hash": "153bf98d98190facaccd799f01d3cf0f", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 105, "avg_line_length": 43.73863636363637, "alnum_prop": 0.6923876331514679, "repo_name": "nightstrike/blender_nif_plugin", "id": "5b5c7e11613ae02b44fb1a0b4799094fe925594f", ...
import os _basedir = os.path.abspath(os.path.dirname(__file__)) class DefaultConfig(object): DEBUG = False TESTING = False SQLALCHEMY_DATABASE_URI = 'sqlite:////var/lib/pony-express/ponyexpress.db' REQUEST_LOG = '/var/log/ponyexpress.log' class ProductionConfig(DefaultConfig): SQLALCHEMY_DATABA...
{ "content_hash": "d854326bd1d2b0f7dfe84dc738c30913", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 95, "avg_line_length": 29.071428571428573, "alnum_prop": 0.6855036855036855, "repo_name": "TelekomCloud/pony-express", "id": "a5162cb0e75f103921280bc4ff7dc93ebc143b1a", "si...
""" Define and register a listing directive using the existing CodeBlock """ from __future__ import unicode_literals from codecs import open as codecs_open # for patching purposes try: from urlparse import urlunsplit except ImportError: from urllib.parse import urlunsplit # NOQA from docutils import core f...
{ "content_hash": "fbc7af3ba0353930a6e188b2cb220100", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 87, "avg_line_length": 31.189473684210526, "alnum_prop": 0.5693553830577118, "repo_name": "kotnik/nikola", "id": "eb60055e5e6fae27ca3bd25cdc4b09d1dec6a0c1", "size": "4106",...
import json import argparse import Queue import socket import datetime import time import os import mosquitto import logging import logging.handlers import math from mqttrpc.client import TMQTTRPCClient from jsonrpc.exceptions import JSONRPCError logger = logging.getLogger('') handler = logging.handlers.SysLogHandl...
{ "content_hash": "be34a02c645e9ebef3af0111cf78489f", "timestamp": "", "source": "github", "line_count": 366, "max_line_length": 122, "avg_line_length": 33.29234972677595, "alnum_prop": 0.5533032416906032, "repo_name": "contactless/sensor-tools-scada-client", "id": "8027663f72f9d2db5a4dd7f8d5c0d6f734a...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Localisation.logo_image' db.add_column(u'cms_localisation', 'logo_image', ...
{ "content_hash": "689781bf659fe241925101221cae1849", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 195, "avg_line_length": 77, "alnum_prop": 0.560285393618727, "repo_name": "universalcore/unicore-cms-django", "id": "ec6a7a1da824cda05402aabea1005a11e139a7c4", "size": "12...
from __future__ import absolute_import import re import six from six import reraise from six.moves import range from impala.util import _escape from impala.error import (Error, Warning, InterfaceError, DatabaseError, InternalError, OperationalError, ProgrammingError, ...
{ "content_hash": "5ccbee9d1cda4c44970b96bd38169f42", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 79, "avg_line_length": 30.43404255319149, "alnum_prop": 0.6387024608501118, "repo_name": "mariusvniekerk/impyla", "id": "c629ddd10b7f45403ed34366c9b2b2a2782a18ca", "size":...
""" Load the cornell movie dialog corpus. Available from here: http://www.cs.cornell.edu/~cristian/Cornell_Movie-Dialogs_Corpus.html """ class CornellData: """ """ def __init__(self, dirName): """ Args: dirName (string): directory where to load the corpus """ ...
{ "content_hash": "ec2531e1be61f62f5a83e03a90c9757b", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 116, "avg_line_length": 29.786516853932586, "alnum_prop": 0.5224443606186345, "repo_name": "Fogapod/ChatBot", "id": "1248ab27dfc41e2769e3a16507926ebedfc5f857", "size": "333...
import cStringIO import textwrap __all__ = ["print_nested_list"] def tokenize_list(obj): if isinstance(obj, list): yield "(" for item in obj: for elem in tokenize_list(item): yield elem yield ")" else: yield obj def wrap_lines(lines): for line i...
{ "content_hash": "19df31289a7f62fde2c1daabe0a280d1", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 84, "avg_line_length": 28.745098039215687, "alnum_prop": 0.5163710777626194, "repo_name": "amelim/RIP-2013", "id": "2b515699ce186f0c1ac408a2fae30483d1e065f1", "size": "1466...
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Find-GPOLocation', 'Author': ['@harmj0y'], 'Description': ('Takes a user/group name and optional domain, and determines the computers in the domain the user/g...
{ "content_hash": "29183cba886e334aa9d35875f1519aed", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 189, "avg_line_length": 35.888888888888886, "alnum_prop": 0.47678018575851394, "repo_name": "rvazarkar/Empire", "id": "33b5c7adc2f9b5d6d9265da1aa317293df08aef7", "size": "...
extensions = ["sphinx.ext.autodoc"] # The master toctree document. master_doc = "index" # General information about the project. project = "doc8" # pylint: disable=redefined-builtin copyright = "2013, OpenStack Foundation" # The name of the Pygments (syntax highlighting) style to use. pygments_style = "sphinx" # --...
{ "content_hash": "ae8822cf12a381640c3ccf24b2576c89", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 79, "avg_line_length": 30.944444444444443, "alnum_prop": 0.6732495511669659, "repo_name": "stackforge/doc8", "id": "94bdea9d945caefc0aad94716604725f7618c05b", "size": "1330...
import time from typing import Any, Callable, Dict, Iterable, Iterator, Optional, TypeVar from pynamodb.constants import (CAMEL_COUNT, ITEMS, LAST_EVALUATED_KEY, SCANNED_COUNT, CONSUMED_CAPACITY, TOTAL, CAPACITY_UNITS) from pynamodb.settings import OperationSettings _T = TypeVar('_T') ...
{ "content_hash": "1f12cce463d83e3a62d084311b59c90d", "timestamp": "", "source": "github", "line_count": 222, "max_line_length": 134, "avg_line_length": 34.28378378378378, "alnum_prop": 0.613060044672185, "repo_name": "pynamodb/PynamoDB", "id": "0f19c360c8f25e415d2cf4ca59ca2963b189c9d9", "size": "76...
import requests from lib.base import OpscenterAction class DecommissionNode(OpscenterAction): def run(self, node_ip, cluster_id=None): if not cluster_id: cluster_id = self.cluster_id url = self._get_full_url([cluster_id, 'ops', 'decommission', node_ip]) return requests.post(...
{ "content_hash": "0e95edcd9a4a8b9480afac95a2cd7d23", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 78, "avg_line_length": 25.53846153846154, "alnum_prop": 0.6596385542168675, "repo_name": "pidah/st2contrib", "id": "692422461672e7e5aedaae65846ed1589d51c77d", "size": "332"...
"""Trains a Bayesian neural network to classify MNIST digits. The architecture is LeNet-5 [1]. #### References [1]: Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. _Proceedings of the IEEE_, 1998. http://yann.lecun.com/exdb/publis/p...
{ "content_hash": "ddde451e9c4feb01b7881e70d9ef2275", "timestamp": "", "source": "github", "line_count": 333, "max_line_length": 116, "avg_line_length": 38.687687687687685, "alnum_prop": 0.6202747807187767, "repo_name": "GoogleCloudPlatform/ml-on-gcp", "id": "a5b8e56e32dd64d9a43c71a91558ab2966465135",...
""" Covenant Add-on This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the...
{ "content_hash": "742e8790d590c82ba02a0e6168573c76", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 154, "avg_line_length": 42.0125, "alnum_prop": 0.5415055043141922, "repo_name": "TheWardoctor/Wardoctors-repo", "id": "7207c27aa9fc6b2844fae3327aaf7ce3ac242621", "size": "...
import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('..')) from schematics i...
{ "content_hash": "4e56f0793e4bc2d6213ba8ea889b5268", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 87, "avg_line_length": 32.64876033057851, "alnum_prop": 0.6991520060751804, "repo_name": "openprocurement/schematics", "id": "cf674f9a8948059a6a5a46c7f9f2016143cd1516", "s...
from __future__ import annotations import pytest import scitbx.matrix from cctbx import sgtbx from cctbx.sgtbx import bravais_types from dxtbx.model import Crystal, Experiment, ExperimentList from dials.algorithms.indexing import assign_indices, non_primitive_basis from dials.array_family import flex @pytest.mark....
{ "content_hash": "1fd0e6b7e0f4add6775200eafd5018f9", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 82, "avg_line_length": 37.37735849056604, "alnum_prop": 0.7062089853609288, "repo_name": "dials/dials", "id": "6e124cebe34a406900580793ae0094d72683c583", "size": "1981", ...
from __future__ import print_function from xml.etree import ElementTree as et import os, sys def reportfordir(path, reportfilename): """ Usage: python exemplarlistreport.py directorypath reportfile.txt Output will be appended to existing reportfile.txt """ with open(reportfilename, mode="a", encod...
{ "content_hash": "58667cf04cfee2a510a1a585982ffb86", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 93, "avg_line_length": 42.285714285714285, "alnum_prop": 0.5281531531531531, "repo_name": "silnrsi/sldr", "id": "f8049224eb6b8da3dc0ed2d12d4bffd12c55f213", "size": "1823", ...
"""Copyright 2011 The University of Michigan Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writi...
{ "content_hash": "0b0a55fd05cf0a507daf0e9aa1aa7cac", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 96, "avg_line_length": 35.04827586206896, "alnum_prop": 0.5956316410861865, "repo_name": "jieyu/maple", "id": "75e021b25f37217e3bc1fa479a74bd4be4d8efcd", "size": "5082", ...
from typing import Optional from fastapi import FastAPI, Security from fastapi.security import OAuth2AuthorizationCodeBearer from fastapi.testclient import TestClient app = FastAPI() oauth2_scheme = OAuth2AuthorizationCodeBearer( authorizationUrl="authorize", tokenUrl="token", description="OAuth2 Code Be...
{ "content_hash": "f373f386c2e1687952db598bb8d5306e", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 88, "avg_line_length": 28.925925925925927, "alnum_prop": 0.5458813486982501, "repo_name": "tiangolo/fastapi", "id": "bdaa543fc343a2d3bad999f2d7a70e95f7b4f898", "size": "234...
import os import ctypes import time import threading import traceback import cv2 import numpy as np from pynq.drivers import video from pynq.drivers.video import HDMI from cffi import FFI from ikalog.utils import * from ikalog.inputs import VideoInput class PynqCapture(VideoInput): # override def _enumerat...
{ "content_hash": "2502124c9eb6c8fcb088da64ac22128e", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 112, "avg_line_length": 32.53260869565217, "alnum_prop": 0.5512863347811561, "repo_name": "deathmetalland/IkaLog", "id": "e7d86c7b0ccb358bf700e9793d1e828470797d08", "size"...
import copy import mock from openstackclient.common import exceptions from openstackclient.network import utils as network_utils from openstackclient.network.v2 import security_group_rule from openstackclient.tests.compute.v2 import fakes as compute_fakes from openstackclient.tests import fakes from openstackclient.te...
{ "content_hash": "4d6c93248d287acb44ee59e62afbdf24", "timestamp": "", "source": "github", "line_count": 1075, "max_line_length": 79, "avg_line_length": 37.32372093023256, "alnum_prop": 0.5876679211424869, "repo_name": "redhat-openstack/python-openstackclient", "id": "2a64b88442f6ff48229e20e74e9f832f5...
import pygame import time import argparse from pygame.locals import * from numpy import * from naoqi import ALProxy joy = None hat_up = None hat_down = None hat_left = None hat_right = None motion = None posture = None speech = None memory = None leds = None is_nao_walking = None is_nao_headmoving = None is_nao_turnin...
{ "content_hash": "bb796541b71a9306d4afde756dbb58b0", "timestamp": "", "source": "github", "line_count": 396, "max_line_length": 90, "avg_line_length": 29.404040404040405, "alnum_prop": 0.45980762624527655, "repo_name": "ThotAlion/FIRE", "id": "86950e2ad32132eb5105cb74b43577ce03e882e2", "size": "116...
from django.core.paginator import Paginator from django.shortcuts import get_object_or_404 from django.template.loader import render_to_string from django.template.response import TemplateResponse from django.urls import reverse from django.utils.translation import gettext as _ from django.views.generic.base import Vie...
{ "content_hash": "82877db80afd7f17c226fefacc84abe1", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 118, "avg_line_length": 35.57837837837838, "alnum_prop": 0.6399270738377393, "repo_name": "mixxorz/wagtail", "id": "ebb72306e0168691f901420bd749f29d656feb30", "size": "658...
"""First version Revision ID: 4c23f9943036 Revises: None Create Date: 2013-04-18 12:37:52.535777 Apply all the changes added since 3.9.0, if they were not already applied. """ # revision identifiers, used by Alembic. revision = '4c23f9943036' down_revision = None # TODO: add here all the missing migrators from: # ....
{ "content_hash": "3dd4759b835771a5f595f4ad97e2ec55", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 75, "avg_line_length": 21.275, "alnum_prop": 0.690560125342734, "repo_name": "ganeshgore/myremolab", "id": "2dc2409545af674248960d4a924a116e82772164", "size": "2553", "b...
from itertools import groupby from operator import itemgetter import web import pysolr import string import json from collections import defaultdict from nltk.corpus import stopwords from nltk.tokenize import word_tokenize from sner import Ner urls = ( '/', 'SimpleIndexSearchPage', '/entityAwareSearchPage', ...
{ "content_hash": "3757d76aae3b01ca9164511513131d2e", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 115, "avg_line_length": 33.936619718309856, "alnum_prop": 0.6158954139863042, "repo_name": "candidate-selection-tutorial-sigir2017/candidate-selection-tutorial", "id": "38d9...
from smsgw.core import db from datetime import datetime from sqlalchemy.sql.expression import text from sqlalchemy.ext.declarative import AbstractConcreteBase from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound class BaseModel(AbstractConcreteBase, db.Model): __table_args__ = {'mysql_engine': 'Inn...
{ "content_hash": "1adf20954a55690ce456f023b070c2f2", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 72, "avg_line_length": 29.04, "alnum_prop": 0.6150137741046832, "repo_name": "VojtechBartos/smsgw", "id": "f9a6a40d0336e78da53c5bbb0ee7ea4324f17716", "size": "1542", "bin...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('products', '0025_auto_20191006_1746'), ] operations = [ migrations.AddField( model_name='product', name='price', field=models.PositiveIntegerField(blank=...
{ "content_hash": "4b41ac1692fcdbb3d7567ff9d01e6afd", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 91, "avg_line_length": 24.294117647058822, "alnum_prop": 0.5907990314769975, "repo_name": "flavoi/diventi", "id": "c0a193cc23b0edebda7fdfaacd6ea9423bcd4271", "size": "462",...
import pipes import tempfile from behave import given, then from gppylib.db import dbconn from gppylib.gparray import GpArray from test.behave_utils.utils import run_cmd class Tablespace: def __init__(self, name): self.name = name self.path = tempfile.mkdtemp() self.dbname = 'tablespace_...
{ "content_hash": "65ba6423dccb5f1415a052f0a1e4e7ae", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 121, "avg_line_length": 38.018957345971565, "alnum_prop": 0.6546995761655447, "repo_name": "jmcatamney/gpdb", "id": "ded17ff5763f6a485e958936503a219cda8cdeb8", "size": "80...
" File manager models" from django.db import models from django.utils.translation import ugettext_lazy as _ from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.template.loader import render_to_string from django.template.defaultfilters import slugify ...
{ "content_hash": "9389d3afb079df123a403e56ca07b006", "timestamp": "", "source": "github", "line_count": 317, "max_line_length": 125, "avg_line_length": 31.61198738170347, "alnum_prop": 0.5425606226923461, "repo_name": "makinacorpus/ionyweb", "id": "5be27c21c830d90b029e69648e704a4d50c44f4c", "size":...
""" Copyright (c) 2014, Philipp Krähenbühl All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this l...
{ "content_hash": "2ce5836651544edd5760ffd30b6facb0", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 155, "avg_line_length": 45.36666666666667, "alnum_prop": 0.7134459955914768, "repo_name": "LiZimo/FuncFlow", "id": "eaa00fdfa48e231cd63e480ef8b90552742155a2", "size": "2750...
import os import time import pandas as pd import numpy as np import tsam.timeseriesaggregation as tsam def test_hierarchical(): raw = pd.read_csv( os.path.join(os.path.dirname(__file__), "..", "examples", "testdata.csv"), index_col=0, ) orig_raw = pd.read_csv( os.path.join( ...
{ "content_hash": "d6b1162ad9fce10f60b47332a12ca9c5", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 84, "avg_line_length": 26.071428571428573, "alnum_prop": 0.6143835616438356, "repo_name": "FZJ-IEK3-VSA/tsam", "id": "7025ce3b32f7632aaf08939304343d895d3d2648", "size": "14...
""" A Python package for recipe parsing and management. """ import yaml try: from cStringIO import StringIO except ImportError: from io import StringIO from .exceptions import LoadError, ParseError, PyprikaError, FieldError # noqa from .ingredient import Ingredient # noqa from .quantity import Quantity # n...
{ "content_hash": "43dd9705057d7e73818490ed3910dc6b", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 79, "avg_line_length": 34.260416666666664, "alnum_prop": 0.6397081179689875, "repo_name": "OEP/pyprika", "id": "88fcbd1db9da3e509077f5b7cc6ecfe05a708ea8", "size": "3289", ...
from unittest import mock import pytest from praw.exceptions import ClientException, RedditAPIException from praw.models import Rule from ... import IntegrationTest class TestRule(IntegrationTest): @property def subreddit(self): return self.reddit.subreddit(pytest.placeholders.test_subreddit) ...
{ "content_hash": "47106c1fb4b5eee85796951c0445c377", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 85, "avg_line_length": 38.17989417989418, "alnum_prop": 0.575110864745011, "repo_name": "praw-dev/praw", "id": "f189b2c7db29a2fd4c86f06ba858b5a6678900a4", "size": "7216", ...
""" Tests for the zipline.finance package """ import itertools import operator import pytz from unittest import TestCase from datetime import datetime, timedelta import numpy as np from nose.tools import timed from six.moves import range import zipline.protocol from zipline.protocol import Event, DATASOURCE_TYPE ...
{ "content_hash": "54dcd8af8a5dc597fbca5f32c76ec223", "timestamp": "", "source": "github", "line_count": 515, "max_line_length": 79, "avg_line_length": 34.84660194174757, "alnum_prop": 0.5743898361751922, "repo_name": "wavelets/zipline", "id": "a9fa724d19c4ffa46fd098718080772ed1019052", "size": "185...
import os from vee.commands.main import command, argument, group from vee.environment import Environment from vee.cli import style, style_note from vee import log from vee.package import Package def describe(pkg, cache, depth=0): print (' ' * depth) + style(pkg.name, 'blue'), pkg.id, style( '***' if ...
{ "content_hash": "1f2ba230421b6dfaf68ee55b8881af40", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 81, "avg_line_length": 20.565217391304348, "alnum_prop": 0.6088794926004228, "repo_name": "westernx/vee", "id": "2268d821d0cf16d8ac5d5c87e58b82940d3faf0a", "size": "1419", ...
""" Example to show sending, receiving and parsing amqp annotated message(s) to Event Hubs. """ import os from azure.eventhub import EventHubProducerClient, EventHubConsumerClient from azure.eventhub.amqp import AmqpAnnotatedMessage, AmqpMessageBodyType CONNECTION_STR = os.environ['EVENT_HUB_CONN_STR'] EVENTHUB_NAME...
{ "content_hash": "55bf002c282df2bc4e44e2285b0501e9", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 87, "avg_line_length": 33.98039215686274, "alnum_prop": 0.6846508944027697, "repo_name": "Azure/azure-sdk-for-python", "id": "3ce87b62ece2d4d8e5da4185b48344735f9432f7", "s...
from operator import eq from rpython.rlib import jit, objectmodel from rpython.rlib.rarithmetic import r_int, r_uint, intmask MASK_32 = r_uint(0xFFFFFFFF) def mask(hash, shift): return (hash >> shift) & 0x01f def bitpos(hash, shift): return (1 << mask(hash, shift)) & MASK_32 def ...
{ "content_hash": "74674744bd7d632adad920931691975f", "timestamp": "", "source": "github", "line_count": 724, "max_line_length": 112, "avg_line_length": 34.24309392265194, "alnum_prop": 0.49390932558889966, "repo_name": "pycket/pycket", "id": "94f56861331f9b92e348892ad70b72f543b7b054", "size": "2479...
import logging import sys from collections import defaultdict from typing import Any, Callable, Set log = logging.getLogger(__name__) class Tool: """ Tool represents a program that runs over source code. It returns a nested dictionary structure like: {'relative_filename': {'line_number': [error1, ...
{ "content_hash": "4fa563b20a0edfb62b9618ff6cb67224", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 88, "avg_line_length": 32.9646017699115, "alnum_prop": 0.5653691275167785, "repo_name": "justinabrahms/imhotep", "id": "d1c04b866d0fb8519fd057a405c201d9acd7719e", "size": ...
import unittest from google.datacatalog_connectors.commons_test import utils class UtilsTestCase(unittest.TestCase): def test_instance_should_succeed(self): utils.Utils()
{ "content_hash": "b7ef0a8c4d7d2783102cdab7c220b199", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 60, "avg_line_length": 20.77777777777778, "alnum_prop": 0.7647058823529411, "repo_name": "GoogleCloudPlatform/datacatalog-connectors", "id": "5b2f8ec22c015716d0e19960417116797...
from .hashable import Hashable, HashableManager, HashableQueryMixin from .lazy_attributes import LazyAttributes, LazyAttributesMixin from .queryset import SearchableQuerySetMixin __all__ = [ # .hashable 'Hashable', 'HashableManager', 'HashableQueryMixin', # .lazy_attributes 'LazyAttributes', ...
{ "content_hash": "b05746b7f61c72eaa1fe307e67215d8b", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 67, "avg_line_length": 26.266666666666666, "alnum_prop": 0.7284263959390863, "repo_name": "gamernetwork/gn-django", "id": "6aaa9674a3e8db427ad2fe115ef426ca8ef7d9cd", "size"...
from bitfinex.client import Client, TradeClient
{ "content_hash": "ead43ca4390078f208ff9d2ed65f54e6", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 47, "avg_line_length": 47, "alnum_prop": 0.8723404255319149, "repo_name": "chris-ch/coinarb", "id": "f1108e6acafeb1f2ce87cdb63b4346dc38e7fbbb", "size": "47", "binary": fal...
import scrapy class Subject(scrapy.Item): id = scrapy.Field() campus = scrapy.Field() semester = scrapy.Field() name = scrapy.Field() hours = scrapy.Field() classes = scrapy.Field()
{ "content_hash": "21c65a842bc1e8272b076f35202f33ac", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 29, "avg_line_length": 20.8, "alnum_prop": 0.6346153846153846, "repo_name": "ranisalt/moita-ufsc-crawler", "id": "58d3a1c4661edac41a591354387cd7b53cdcc8ff", "size": "360", ...
from nesdoc.utils import * from nesdoc.generators import * from nesdoc.html import * __all__ = [ "generate_interface" ] # A list of all functions with their short description, with links to the # long description def generate_fnlist_short(ht, name, fns): if len(fns) > 0: ht.tag("p") ht.heading(name) for...
{ "content_hash": "291a8c96b739a038b875cb7be270475c", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 98, "avg_line_length": 30.68, "alnum_prop": 0.6053889613211647, "repo_name": "barriquello/iotstack", "id": "b299f1cbd98b81b4ff730a1491716ada730b8929", "size": "2678", "bi...
""" Should specifically use: touchtechnology.common.backends.auth.UserSubclassBackend touchtechnology.common.backends.auth.EmailUserSubclassBackend """
{ "content_hash": "53396fe6f53958cda4bfbb3b989a5032", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 63, "avg_line_length": 26.166666666666668, "alnum_prop": 0.8280254777070064, "repo_name": "goodtune/vitriolic", "id": "f5860e9bafdaad426155b3f5615b64d9c7c2b4b4", "size": "15...
from typing import ( Any, AsyncIterable, Awaitable, Callable, Iterable, Sequence, Tuple, Optional, ) from google.cloud.aiplatform_v1beta1.types import model from google.cloud.aiplatform_v1beta1.types import model_evaluation from google.cloud.aiplatform_v1beta1.types import model_evaluat...
{ "content_hash": "38864c1f0fe1d8b41bcc9769899ef20d", "timestamp": "", "source": "github", "line_count": 403, "max_line_length": 98, "avg_line_length": 40.04218362282879, "alnum_prop": 0.6569994422755159, "repo_name": "sasha-gitg/python-aiplatform", "id": "c1c5e47d21c48f319c481368eb95d5e5ba9e457c", ...
from setuptools import setup # Version info -- read without importing _locals = {} with open("releases/_version.py") as fp: exec(fp.read(), None, _locals) version = _locals["__version__"] setup( name="releases", version=version, description="A Sphinx extension for changelog manipulation", long_des...
{ "content_hash": "75c35e27497e758920011a019fd56262", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 88, "avg_line_length": 39.69565217391305, "alnum_prop": 0.6215772179627601, "repo_name": "bitprophet/releases", "id": "f4cae3c15798154ae10f8204515248436f79ce0d", "size": "1...
import pytest import cv2 from plantcv.plantcv import spatial_clustering @pytest.mark.parametrize("alg, min_size, max_size", [['DBSCAN', 10, None], ['OPTICS', 100, 5000]] ) def test_spatial_clustering(alg, min_size, max_size, test_data): ...
{ "content_hash": "b2ae5abe14b26e1444dc844cd9690c89", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 101, "avg_line_length": 39.05, "alnum_prop": 0.6235595390524968, "repo_name": "danforthcenter/plantcv", "id": "d63dd92713b13db92146cd6cf204f3cb0747e1a1", "size": "781", "...
from __future__ import absolute_import, division, print_function, unicode_literals from amaascore.corporate_actions.corporate_action import CorporateAction class Notification(CorporateAction): def __init__(self, asset_manager_id, corporate_action_id, record_date, corporate_action_status='Open', ...
{ "content_hash": "bea6c5617014054e489d424a08d9e61e", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 118, "avg_line_length": 70.46666666666667, "alnum_prop": 0.630085146641438, "repo_name": "nedlowe/amaas-core-sdk-python", "id": "3020192121538c0cc1555520347e38260798a1a0", ...
from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext from django.core.urlresolvers import reverse from .models import Movie from django.contrib.auth import logout from ...
{ "content_hash": "047ac0f014bf8db01f7a2bcafe821243", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 113, "avg_line_length": 30.59375, "alnum_prop": 0.625638406537283, "repo_name": "huzaifafaruqui/Movies-Website", "id": "cd29c32f55cde4675bc2637999a04f018447e8e9", "size": ...
import os import discord import re import time from wow import * from util import * from settings import * client = discord.Client() @client.event async def on_message(message): """Listens for specific user messages.""" # Current time (Used for cache busting character thumbnails). epoch_time = int(time.t...
{ "content_hash": "6d7af1a43e5dc01b2649fb7204ecd39a", "timestamp": "", "source": "github", "line_count": 366, "max_line_length": 162, "avg_line_length": 37.743169398907106, "alnum_prop": 0.4723468944549008, "repo_name": "JamesIves/discord-wow-armory-bot", "id": "b6019d725878fede494d5e1a19a370bf6438553...
from keystone.policy import controllers from keystone.policy.core import * from keystone.policy import routers
{ "content_hash": "5f7e03f9a613ce5fce21a601097d8fa7", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 39, "avg_line_length": 37, "alnum_prop": 0.8468468468468469, "repo_name": "paypal/keystone", "id": "121905e4644ec0d831980f7cac0d835ccdd89e47", "size": "735", "binary": fal...
from jinja2 import Template from IPython.display import IFrame, HTML import os import json from .base_plotter import IPlotter class ChartistPlotter(IPlotter): """Class for creating chartist.js charts in ipython notebook.""" head = """ <!-- Load Chartist.js --> <link rel='stylesheet' href='ht...
{ "content_hash": "aecaef600ca0acbc0dae7abf702aa18c", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 104, "avg_line_length": 35.96590909090909, "alnum_prop": 0.5001579778830963, "repo_name": "niloch/iplotter", "id": "277b47787bb8091bc48a941c54a5d7de2e94dd53", "size": "3165...
import pandas as pd import numpy as np from enum import IntEnum from . import Utils as tsutil from . import TimeSeries_Cutting as tscut from . import DateTime_Functions as dtfunc class cTimeInfo: # class data def __init__(self): self.mSignalFrame = None self.mTimeMin = None; self....
{ "content_hash": "b68720f2cb16494f185d1435e663f2ea", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 128, "avg_line_length": 38.611111111111114, "alnum_prop": 0.608763897972531, "repo_name": "antoinecarme/pyaf", "id": "19895d1b96fb8695a9c8174a2665856155eec3d7", "size": "7...
import os, sys import time from test.testlib import * from git import * class TestRepo(object): def setup(self): self.repo = Repo(GIT_REPO) @raises(InvalidGitRepositoryError) def test_new_should_raise_on_invalid_repo_location(self): if sys.platform == "win32": Repo("C:\\WIN...
{ "content_hash": "92eaa235216c421aeacde1c78b7bf6f6", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 142, "avg_line_length": 37.531496062992126, "alnum_prop": 0.603272841707752, "repo_name": "kergoth/git-origin", "id": "abf17be866ee552b65dc01b1d3bb6ada40db547b", "size": "...
"""Test the importprunedfunds and removeprunedfunds RPCs.""" from decimal import Decimal from test_framework.test_framework import DigiByteTestFramework from test_framework.util import ( assert_equal, assert_raises_rpc_error, ) class ImportPrunedFundsTest(DigiByteTestFramework): def set_test_params(self):...
{ "content_hash": "1d18a32c49ad9e59d7e16b0b00248f19", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 117, "avg_line_length": 40.151785714285715, "alnum_prop": 0.6559928841449856, "repo_name": "aurarad/auroracoin", "id": "d665b37c3a3cd4cf39c412889cc0c815ad98cd5f", "size": ...
""" Copyright (c) 2016 - Sean Bailey - All Rights Reserved Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agree...
{ "content_hash": "6a7a7b6cba1f16dd2f815dcd843b494a", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 72, "avg_line_length": 39.2, "alnum_prop": 0.7772108843537415, "repo_name": "LuckehPickle/chat", "id": "d8034515473bedab96a477c1f3331c073920d790", "size": "588", "binary"...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ploghubapp', '0011_auto_20170816_1114'), ] operations = [ migrations.AlterField( model_name='historicaluserprofile', name='a...
{ "content_hash": "e76f773d2b0f0068d750036f69ac7942", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 71, "avg_line_length": 25.82608695652174, "alnum_prop": 0.5858585858585859, "repo_name": "ploggingdev/ploghub", "id": "0223670c05cbfe6339b815a228446be9a66f6bcd", "size": "6...
"""gl publish - Publish commits upstream.""" from . import helpers, pprint def parser(subparsers, _): """Adds the publish parser to the given subparsers object.""" desc = 'publish commits upstream' publish_parser = subparsers.add_parser( 'publish', help=desc, description=desc.capitalize(), aliases=['pb'...
{ "content_hash": "7af8a88e394e632789689efffd9ace58", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 74, "avg_line_length": 31.041666666666668, "alnum_prop": 0.6859060402684564, "repo_name": "sdg-mit/gitless", "id": "19b62273b9a25724dab84b2fcad86dacdfb31234", "size": "848"...