text
stringlengths
4
1.02M
meta
dict
""" Logging Configuration """ from __future__ import absolute_import import logging def setup(): fmt = '%(asctime)s|%(levelname)s|%(module)s|%(message)s' logging.basicConfig(format=fmt) log = logging.getLogger('nel') log.setLevel(logging.DEBUG) def getLogger(): return logging.getLogger('nel') set...
{ "content_hash": "2cc36bad105578efe3442719c0c4ca35", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 60, "avg_line_length": 23.142857142857142, "alnum_prop": 0.6820987654320988, "repo_name": "wikilinks/sift", "id": "8329c390ac4ecfb452fc989994723ea9a31245fb", "size": "324",...
import socket import os import argparse from os.path import isdir class HTTPServer(): BUFFER_SIZE = 1024*8 def __init__(self, port=80, verbose=False): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) sock.bind(("", ar...
{ "content_hash": "9e98b779df0f7c4bb60003ced1abfff8", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 70, "avg_line_length": 34.74496644295302, "alnum_prop": 0.5070504152984354, "repo_name": "Squaar/webserver", "id": "173105a3a471f0a71d37c3542626cea89372a353", "size": "519...
"""The admin module.""" from . import views
{ "content_hash": "92892a2c64f47763851f88b57833c7f4", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 23, "avg_line_length": 22, "alnum_prop": 0.6590909090909091, "repo_name": "codeforamerica/comport", "id": "02dcde2ed06c251ef7e6ae7578a5a54b07aee387", "size": "68", "binary...
import re from thefuck.utils import for_app from thefuck.system import open_command @for_app('yarn', at_least=2) def match(command): return (command.script_parts[1] == 'help' and 'for documentation about this command.' in command.stdout) def get_new_command(command): url = re.findall( r'...
{ "content_hash": "005dc7228fe61e84cd52ebf14cd665ac", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 74, "avg_line_length": 25.352941176470587, "alnum_prop": 0.6705336426914154, "repo_name": "mlk/thefuck", "id": "a4d8f931ece3c32847700187deb22cf8f208fb9a", "size": "431", ...
import six from django.template import TemplateSyntaxError from django.template.loader import render_to_string from ttag import core, args class TemplateTagOptions(core.Options): def __init__(self, meta, *args, **kwargs): super(TemplateTagOptions, self).__init__(meta=meta, *args, **kwargs) self....
{ "content_hash": "64d0f233bf2b7de53ae0467c3fff1a1f", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 78, "avg_line_length": 34.12068965517241, "alnum_prop": 0.627589691763517, "repo_name": "lincolnloop/django-ttag", "id": "af7ee134a4e5711cdce216b7a0242faab2159ddc", "size":...
import csv import pdb import sys import gzip import os from itertools import islice, chain from collections import defaultdict import collections.abc from copy import copy from sys import intern from numbers import Integral __all__ = ["Entry", "Gr", "Variant", "bed", "appris", "gff3", "vcf", "depth_alt_depth_function...
{ "content_hash": "cc8e7b96f968b811ed183f5c8086f4f3", "timestamp": "", "source": "github", "line_count": 886, "max_line_length": 156, "avg_line_length": 31.2686230248307, "alnum_prop": 0.4581648859370488, "repo_name": "eawilson/CoverMi", "id": "d26e5a3e319bef5f6559d4f235266eee566d1657", "size": "277...
from staticflatpages.tests.tests import StaticFlatpageTests from staticflatpages.tests.tests import StaticFlatpageUtilTests from staticflatpages.tests.sitemaps import StaticFlatpageSitemapTest
{ "content_hash": "ebc63f6ce81e5922df23f10a5cacb053", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 68, "avg_line_length": 64.33333333333333, "alnum_prop": 0.9067357512953368, "repo_name": "bradmontgomery/django-staticflatpages", "id": "a37b5d6096dfc3a779943f3e6585dd6b99f3c4...
from ..exceptions import AllocationException class IBPException(AllocationException): ''' Generic exception for IBP related errors ''' def __init__(self, *args, **kwargs): self.ibpResponse = kwargs.pop("response", None) super(IBPException, self).__init__(*args, **kwargs)
{ "content_hash": "4454ff1fef998f0059f1fd566d54ed55", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 59, "avg_line_length": 42.42857142857143, "alnum_prop": 0.6801346801346801, "repo_name": "periscope-ps/unis", "id": "6e9b8ea7e2bd07dc4d06872cc020b7b5cecd74b2", "size": "811"...
import numpy as np import cv2 file = 'vid_7.gif' cap = cv2.VideoCapture(file) # params for ShiTomasi corner detection feature_params = dict( maxCorners = 100, qualityLevel = 0.3, minDistance = 7, blockSize = 7 ) # Parameters for lucas kanade optical...
{ "content_hash": "1a1edbc1ff50ce40934d602280da7868", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 89, "avg_line_length": 34.666666666666664, "alnum_prop": 0.6119909502262444, "repo_name": "AutonomyLab/deep_intent", "id": "a574e1e85fa078f9feab8f279f5ec46e5471e9a0", "size...
"""A JSONRPC class with an IPC backend.""" from socket import socket, AF_UNIX, SOCK_STREAM, SHUT_RDWR from rpctools.jsonrpc import JSONRPC, is_valid_json RECV_CHUNK = 4096 # max number of bytes to read from connection at a time. class IPCRPC(JSONRPC): """Sends JSON RPC over an Unix domain socket.""" def __i...
{ "content_hash": "ce12cbc87839834f97c450e33df674f3", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 75, "avg_line_length": 36.18181818181818, "alnum_prop": 0.6457286432160804, "repo_name": "ChrisCalderon/PyRPCTools", "id": "76e940f4dae44043b1dff54ad8f151cff528bd8b", "size...
from kivy.properties import ObjectProperty from kivy.clock import Clock from kivy.uix.button import Button from kivy.uix.label import Label from kivy.uix.boxlayout import BoxLayout from kivy.uix.gridlayout import GridLayout from kivy.uix.tabbedpanel import TabbedPanelContent, TabbedPanelHeader,\ TabbedPanel from k...
{ "content_hash": "3903e432305f77bcc6895ec9e9ab1d53", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 78, "avg_line_length": 31.688, "alnum_prop": 0.6149962130775056, "repo_name": "mohammadj22/kivy-designer", "id": "5aebddceb982c87a266c7548d22c79838732842c", "size": "3961"...
from typing import Optional, Any import sys import unittest try: from tools.lib.template_parser import ( TemplateParserException, is_django_block_tag, tokenize, validate, ) except ImportError: print('ERROR!!! You need to run this via tools/test-tools.') sys.exit(1) cla...
{ "content_hash": "244e9834df246784a1a9557d558071c0", "timestamp": "", "source": "github", "line_count": 251, "max_line_length": 100, "avg_line_length": 28.824701195219124, "alnum_prop": 0.48680027643400137, "repo_name": "amanharitsh123/zulip", "id": "a16fc387e8443681c6d37de693d8b2c08608410d", "size...
""" Certificate generation module. """ from OpenSSL import crypto TYPE_RSA = crypto.TYPE_RSA TYPE_DSA = crypto.TYPE_DSA def createKeyPair(type, bits): """ Create a public/private key pair. Arguments: type - Key type, must be one of TYPE_RSA and TYPE_DSA bits - Number of bits to use in the...
{ "content_hash": "c2a3a14a018e1966cae050b3d4426163", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 83, "avg_line_length": 34.906666666666666, "alnum_prop": 0.5935828877005348, "repo_name": "mhils/pyopenssl", "id": "da0624f74599290b5911c66cf62e62b20039dc61", "size": "2736...
from csv import DictReader from petsafeconfig import CSV_FILENAME from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request from product_spiders.items import Product, ProductLoader import logging class PetstreetmallComSpider(BaseSpider): name = 'petstree...
{ "content_hash": "be3641f1100f5980bc1f842d2019b453", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 148, "avg_line_length": 42.03361344537815, "alnum_prop": 0.5281887245101959, "repo_name": "ddy88958620/lib", "id": "37a645c289e6906ab538b59230d264d2e38c959a", "size": "500...
import os, sys, cPickle import wx # ensure this import works before starting the application import matplotlib # ensure this import works before starting the application # ensure pyeq2 can be imported before starting the application if -1 != sys.path[0].find('pyeq2-master'):raise Exception('Please rename git checkout...
{ "content_hash": "8109fbf61872b03a7e753ad975b35fd0", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 153, "avg_line_length": 47.849557522123895, "alnum_prop": 0.6611799519141853, "repo_name": "jamesrp/pyeq2", "id": "6fec2a2f10d704d049dc4e9a3b0f51ead96fbd5b", "size": "1081...
from CIM15.IEC61970.Core.IdentifiedObject import IdentifiedObject class ReadingType(IdentifiedObject): """Type of data conveyed by a specific Reading.Type of data conveyed by a specific Reading. """ def __init__(self, multiplier="M", unit="N", kind="phaseAngle", reverseChronology=False, defaultQuality='',...
{ "content_hash": "b86ea62f3c53b7f21283991b89a520eb", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 295, "avg_line_length": 47.61073825503356, "alnum_prop": 0.6537919368480406, "repo_name": "rwl/PyCIM", "id": "8fc3b367227e1d0dad6252a8cfac23f520c375b8", "size": "8194", ...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('academics', '0022_auto_20160203_...
{ "content_hash": "93db7efb014d865c2ddb3877056d1705", "timestamp": "", "source": "github", "line_count": 255, "max_line_length": 182, "avg_line_length": 50.63921568627451, "alnum_prop": 0.5575001936033455, "repo_name": "rectory-school/rectory-apps", "id": "12d796a49ed281bcd90924db24a6676777afabb5", ...
""" KubeVirt API This is KubeVirt API an add-on for Kubernetes. OpenAPI spec version: 1.0.0 Contact: kubevirt-dev@googlegroups.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class V1alpha2MachinePreference...
{ "content_hash": "32b44216758234a56f30a6853f7dea03", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 101, "avg_line_length": 28.4390243902439, "alnum_prop": 0.5723270440251572, "repo_name": "kubevirt/client-python", "id": "94f99e8d93f1781f191e594ecbb7644325c7c442", "size"...
"""HTTP utility code shared by clients and servers. This module also defines the `HTTPServerRequest` class which is exposed via `tornado.web.RequestHandler.request`. """ import calendar import collections import copy import datetime import email.utils from functools import lru_cache from http.client import responses ...
{ "content_hash": "c41bff097e412161e2a6723be4a56ac9", "timestamp": "", "source": "github", "line_count": 1118, "max_line_length": 93, "avg_line_length": 31.626118067978535, "alnum_prop": 0.5878443350868262, "repo_name": "bdarnell/tornado", "id": "bd32cd0c49cc2e369eed7a5724a8f0402f3a227d", "size": "3...
<<<<<<< HEAD <<<<<<< HEAD # Copyright (C) 2001-2010 Python Software Foundation # Contact: email-sig@python.org # email package unit tests import re import time import base64 import unittest import textwrap from io import StringIO, BytesIO from itertools import chain from random import choice import email import emai...
{ "content_hash": "4e8948624a9e7ef4a03e4c33275c550b", "timestamp": "", "source": "github", "line_count": 15891, "max_line_length": 460, "avg_line_length": 38.47379019570826, "alnum_prop": 0.5994942646801453, "repo_name": "ArcherSys/ArcherSys", "id": "47141e70b059a1471acee28c1548b4b4b6db0874", "size"...
""" This package implements various grain boundary analyses """
{ "content_hash": "2696a5a4215fea39b87030580bc7f6b1", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 55, "avg_line_length": 21.333333333333332, "alnum_prop": 0.765625, "repo_name": "davidwaroquiers/pymatgen", "id": "d8c9c1b04368a6c22d90c0e68a8152647e2711f7", "size": "158", ...
import os import nibabel as nib def save2nifti(data, file_name): """Save 3D/4D dataset as nifti file. Note that the header is derived from MNI standard template, thus the data should be in RAS space. FSL is required. """ fsl_dir = os.getenv('FSLDIR') # for code testing if not fsl_dir: ...
{ "content_hash": "a52537d202cf05fbb531bcc6333d69ff", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 72, "avg_line_length": 31.714285714285715, "alnum_prop": 0.6216216216216216, "repo_name": "sealhuang/brainDecodingToolbox", "id": "470a6a22c5628e3927d2050c76de3cd99b6b296d", ...
import argparse import os import re import shutil import subprocess import sys import urlparse DEFAULT_USER_REQUEST = True DEFAULT_USE_TEST_SCHEDULER = True # 0 means the batch would be the whole list of urls. DEFAULT_BATCH_SIZE = 0 DEFAULT_VERBOSE = False DEFAULT_TEST_CMD = 'OfflinePageSavePageLaterEvaluationTest.tes...
{ "content_hash": "f580b48d3864c472de7ba7446d115c98", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 79, "avg_line_length": 34.19796954314721, "alnum_prop": 0.6534065607837316, "repo_name": "chromium/chromium", "id": "55fe656b76ea3c2217b393a0af86083e7a533e94", "size": "75...
"""BBOB noiseless testbed. The optimisation test functions are represented as classes :py:class:`F1` to :py:class:`F24` and :py:class:`F101` to :py:class:`F130`. Each of these classes has an _evalfull method which expects as argument an array of row vectors and returns a 'noisy' and a 'noiseless' float values. This m...
{ "content_hash": "573706b1abc141f6cae07a2ac3d9ff1f", "timestamp": "", "source": "github", "line_count": 2172, "max_line_length": 331, "avg_line_length": 33.06077348066298, "alnum_prop": 0.5845866755793226, "repo_name": "PyQuake/earthquakemodels", "id": "57478fe8935c10f0efe41c078cc23b44115d1d63", "s...
from django.core.management.base import BaseCommand from optparse import make_option from django.conf import settings from datetime import datetime from requests import HTTPError from go_http.contacts import ContactsApiClient from subscription.models import Subscription SUBSCRIPTION_STANDARD = 1 # less than week 32...
{ "content_hash": "e23b1ea8edde7be8a15bb977a4ecb610", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 79, "avg_line_length": 41.04, "alnum_prop": 0.5365497076023392, "repo_name": "praekelt/ndoh-control", "id": "aa6bdfd8d5c100631f7b99b7497a443da5c547c1", "size": "4104", "...
""" This is an example python program. The triple quotation marks indicate a comment block. It is good practice, especially for code that you submit in this class, to have lots of documentation comments in your code. """ # Comments on a single line can also be designated by the leading pound sign # (hash mark). "...
{ "content_hash": "f6b6c504c0a94290c92373bdd7123d8b", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 78, "avg_line_length": 31.492957746478872, "alnum_prop": 0.6947674418604651, "repo_name": "cdfassnacht/CodeCDF", "id": "6cd0a02a845505df97251410570cd8c96c3d61e2", "size": ...
def match(command, settings): toks = command.script.split() return (len(toks) > 0 and toks[0].endswith('.py') and ('Permission denied' in command.stderr or 'command not found' in command.stderr)) def get_new_command(command, settings): return 'python ' + command.sc...
{ "content_hash": "da96e83a4c2bd5a4204a2a3e10755e3e", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 57, "avg_line_length": 32.5, "alnum_prop": 0.6123076923076923, "repo_name": "dionyziz/thefuck", "id": "507a934b14030e88bb1553168482128299c16ca7", "size": "456", "binary":...
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.absp...
{ "content_hash": "6b9c2b48174a22d6842b091a483d495a", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 267, "avg_line_length": 43.02054794520548, "alnum_prop": 0.6865148861646234, "repo_name": "JohnSnowLabs/spark-nlp", "id": "14449a04d3e41d1e0127143f989a1418df3841dd", "size...
from django.test import TestCase from django.core.exceptions import ValidationError from django.core.urlresolvers import resolve from lists.views import home_page,view_list from django.http import HttpRequest from django.template.loader import render_to_string from lists.models import Item,List # Create your tests here...
{ "content_hash": "b05dcd30ce0c3fb58685ddaa18092887", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 84, "avg_line_length": 34.46875, "alnum_prop": 0.655938349954669, "repo_name": "HaoPatrick/tdd-pyhton", "id": "d493024c98c7850e0e8ad207e0af01a910363ee1", "size": "2206", ...
from .sub_resource import SubResource class VirtualNetworkGatewayIPConfiguration(SubResource): """IP configuration for virtual network gateway. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :param private_ip_allo...
{ "content_hash": "3416830e2bbbf902cc14838fced58fe1", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 126, "avg_line_length": 43.72222222222222, "alnum_prop": 0.6670902160101652, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "55aad7008a92625b91e173db8302b47dd8c2ec3b",...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('publication_backbone', '0002_auto_20151207_1759'), ] operations = [ migrations.RenameField( model_name='publication', old_na...
{ "content_hash": "256a66368c181e1057fed5a4e8bc5cc9", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 60, "avg_line_length": 21.333333333333332, "alnum_prop": 0.5963541666666666, "repo_name": "Excentrics/publication-backbone", "id": "7c14fa457a5dc1371ac05bd0d8704c9222c832f6",...
from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database from google.protobuf import descriptor_pb2 # @@protoc_insertion_point(imports) _sym_db = _symbol_da...
{ "content_hash": "8ce933ad5277edaec05d95319a9c0f88", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 627, "avg_line_length": 40.54320987654321, "alnum_prop": 0.7082825822168087, "repo_name": "jameshp/deviceadminserver", "id": "242172e804ec036427bba11dd960cabd4ad5a016", "s...
from __future__ import absolute_import, print_function, division import re from contextlib import contextmanager from pony.orm.core import Database from pony.utils import import_module def test_exception_msg(test_case, exc_msg, test_msg=None): if test_msg is None: return error_template = "incorrect exception...
{ "content_hash": "910a41ed385fba4971ebe2ec55767aed", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 101, "avg_line_length": 36.19285714285714, "alnum_prop": 0.6003552397868561, "repo_name": "ponyorm/pony", "id": "f4cdb32731d698201b2d3e01b3708aed4cd1b697", "size": "5067",...
from django.conf.urls import include, url from olympia.ratings.api_urls import ratings_v3, ratings_v4 v3_api_urls = [ url(r'^abuse/', include('olympia.abuse.urls')), url(r'^accounts/', include('olympia.accounts.urls')), url(r'^addons/', include('olympia.addons.api_urls')), url(r'^', include('olympia....
{ "content_hash": "8fd89a50944409620b828feb37b1df25", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 63, "avg_line_length": 38.970588235294116, "alnum_prop": 0.6407547169811321, "repo_name": "atiqueahmedziad/addons-server", "id": "58be5e1991bc82378ba307a23697b2e2efe391d8", ...
import copy import datetime import hashlib import uuid from keystoneclient.common import cms from oslo_config import cfg from oslo_utils import timeutils import six from six.moves import range from keystone import exception from keystone.tests import unit from keystone.tests.unit import utils as test_utils from keyst...
{ "content_hash": "dc87ea6c6e69869be8d8ecba02fc9004", "timestamp": "", "source": "github", "line_count": 539, "max_line_length": 79, "avg_line_length": 44.59554730983302, "alnum_prop": 0.5842659233681408, "repo_name": "klmitch/keystone", "id": "feb7e017ac931db84bc5fd3ea4b0e600933fdc03", "size": "245...
"""The app module, containing the app factory function.""" from flask import Flask, render_template from flaskMDL.settings import ProdConfig from flaskMDL.assets import assets from flaskMDL.extensions import ( bcrypt, cache, db, login_manager, migrate, debug_toolbar, ) from flaskMDL import publ...
{ "content_hash": "71bb0c7c615fff97ddb31e00f1a11aed", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 73, "avg_line_length": 26.672727272727272, "alnum_prop": 0.6939331970006817, "repo_name": "jimmyho/Flask-Material-Lite", "id": "ea52456463c95d089b93e335f7dd6e47b5af1df4", "...
from saw.mods import Mod class Filter: _filters = dict() _loaded = False @classmethod def init(cls): if cls._loaded: return cls._filters = Mod.load_modules(__file__, 'saw.filters') cls._loaded = True @classmethod def exists(cls, name): cls.init() ...
{ "content_hash": "9648b63c7ed1bf17125a87a1d6db12b3", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 82, "avg_line_length": 28.258064516129032, "alnum_prop": 0.5856164383561644, "repo_name": "diNard/Saw", "id": "21f393f98c1d85a67867dc16ba8544304446dff0", "size": "876", "...
from flask import redirect, g from flask_appbuilder import expose from flask_appbuilder.models.sqla.interface import SQLAInterface from flask_babel import gettext as __ from flask_babel import lazy_gettext as _ from superset import appbuilder from superset.models.sql_lab import Query, SavedQuery from .base import Su...
{ "content_hash": "f02bd8b32a2330a31ba242d79b022af5", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 75, "avg_line_length": 28.69148936170213, "alnum_prop": 0.6129032258064516, "repo_name": "FrederichCheng/incubator-superset", "id": "eea71d467abfba2b3943d2343825a635f6e3b291"...
import sys SUITE = 'cpu2006' def abort(): sys.stderr.write('Usage: configure.py {}-<benchmark name>-<input size>\n'.format(SUITE)) sys.exit(1) def decompose(program): chunks = program.split('-') if len(chunks) != 3: abort() return chunks[1], chunks[2] def process(programs): if len(pr...
{ "content_hash": "9baf543782aa63a3b5048ac9e5a30930", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 92, "avg_line_length": 28.333333333333332, "alnum_prop": 0.616289592760181, "repo_name": "learning-on-chip/studio", "id": "b2d5f62334de0685eb314f04eb89980c79991564", "size"...
from ..utils.data_utils import get_file import numpy as np def load_data(path='boston_housing.npz', seed=113, test_split=0.2): """Loads the Boston Housing dataset. # Arguments path: path where to cache the dataset locally (relative to ~/.keras/datasets). seed: Random seed for shuf...
{ "content_hash": "1ffc1e6cd6b27b0f45e63d8d24e02af3", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 94, "avg_line_length": 32.794117647058826, "alnum_prop": 0.5973094170403588, "repo_name": "parag2489/keras_superpixel_pooling", "id": "e4ee571c8481b2e96914cba879ef53d3eb0964e...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/wearables/ithorian/shared_ith_jacket_s04.iff" result.attribute_template_id = 11 result.stfName("wearables_name","ith_jacket_s04") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return resul...
{ "content_hash": "1ab09d786e3a6dc87ec575bc2d9e278e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 81, "avg_line_length": 24.692307692307693, "alnum_prop": 0.7071651090342679, "repo_name": "obi-two/Rebelion", "id": "c7d3df44cb531118640c06504e8f1edc804c6d58", "size": "466...
''' Render a graph full of gtk widgets and draw some lines! ''' import gtk import gtk.gdk as gdk import vwidget.main as vw_main import visgraph.renderers as vg_render import visgraph.drawing.bezier as vw_bezier import visgraph.drawing.catmullrom as vw_catmullrom zero_zero = (0,0) class GtkVisGraphOverview(gtk.Draw...
{ "content_hash": "268487cfbcb8dad6ac9c958eb1e85205", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 118, "avg_line_length": 31.352941176470587, "alnum_prop": 0.5772983114446529, "repo_name": "joshuahoman/vivisect", "id": "c83fcece71c504674ede6244d8f6dd185e1d1d2f", "size"...
""" You are given a positive integer num consisting only of digits 6 and 9. Return the maximum number you can get by changing at most one digit (6 becomes 9, and 9 becomes 6).   Example 1: Input: num = 9669 Output: 9969 Explanation: Changing the first digit results in 6669. Changing the second digit results in 9969....
{ "content_hash": "fa5134e8ca591c8bfec9cfd8bf6ca31f", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 99, "avg_line_length": 20.782608695652176, "alnum_prop": 0.6673640167364017, "repo_name": "franklingu/leetcode-solutions", "id": "f04440abc5264a87b45ae4c1dd2f5fd0d8ee7798", ...
""" Django settings for DjangoChannel project. Generated by 'django-admin startproject' using Django 1.9. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import o...
{ "content_hash": "20f9e0c35793ed068d375e607dfeee8e", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 99, "avg_line_length": 26.263157894736842, "alnum_prop": 0.6739192671056399, "repo_name": "ivermac/DjangoChannel", "id": "6bf1d8600887a3a25c1d6a66f7822450e25c5b9d", "size"...
from bokeh.io import show, output_file from bokeh.plotting import figure output_file("bar_basic.html") fruits = ['Apples', 'Pears', 'Nectarines', 'Plums', 'Grapes', 'Strawberries'] p = figure(x_range=fruits, plot_height=350, title="Fruit Counts", toolbar_location=None, tools="") p.vbar(x=fruits, top=[5, ...
{ "content_hash": "71dba89a05e06d3db4addd16846ce4eb", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 77, "avg_line_length": 25.5, "alnum_prop": 0.6691176470588235, "repo_name": "philippjfr/bokeh", "id": "858f11e28241ee32a8e923366ba67660c0fd5832", "size": "408", "binary":...
""" """ # FIXME: this is seriously under-documented from datetime import datetime from actstream.managers import ActionManager, stream class MyActionManager(ActionManager): @stream def mystream(self, obj, verb='posted', time=None): if time is None: # FIXME from Joel: this pro...
{ "content_hash": "70be8301d949036aae74adab6bd68861", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 71, "avg_line_length": 30.266666666666666, "alnum_prop": 0.6607929515418502, "repo_name": "ProjectFacet/facet", "id": "435d2542d3241132b53b880bb60e0e3ec6df8e0a", "size": "4...
from inc_noesis import * def registerNoesisTypes(): handle = noesis.register("The Legend of Korra", ".dat") noesis.setHandlerExtractArc(handle, datExtract) return 1 def datExtract(fileName, fileLen, justChecking): with open(fileName, "rb") as fs: if justChecking: retu...
{ "content_hash": "72fdc0b763e6bc324e246036e09b6df2", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 73, "avg_line_length": 31.666666666666668, "alnum_prop": 0.49736842105263157, "repo_name": "TheDeverEric/noesis-importers", "id": "96efa20f7d9f312ecfdf29564e90af69b3238994", ...
"""Sync script for GitNamed.""" import os import sys import subprocess import settings named_conf_master = os.path.join(settings.named_path, 'named.conf.master') named_conf_slave = os.path.join(settings.named_path, 'named.conf.slave') transfer_key_name = 'master2slave' transfer_key = u''' key %s { algorithm hm...
{ "content_hash": "f57f3a0400590de8ea320a456ede9fac", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 75, "avg_line_length": 27.746268656716417, "alnum_prop": 0.5745024206562668, "repo_name": "Wyvernsquare/dns", "id": "f4a640aef67866beefbc36856cf890e3590adc5d", "size": "44...
"""Group action implementations""" import six import sys from keystoneauth1 import exceptions as ks_exc from openstackclient.common import command from openstackclient.common import utils from openstackclient.i18n import _ from openstackclient.identity import common class AddUserToGroup(command.Command): """Ad...
{ "content_hash": "98fe4d620ee6efc065f34b71cb141bea", "timestamp": "", "source": "github", "line_count": 358, "max_line_length": 75, "avg_line_length": 32.114525139664806, "alnum_prop": 0.5080455771070714, "repo_name": "redhat-openstack/python-openstackclient", "id": "fdb94da64142f2dd0937f2fac0fbe85aa...
import torch from torch.autograd import Function from _ext import ext_lib class ReLUF(Function): def forward(self, input): self.save_for_backward(input) output = input.new() if not input.is_cuda: ext_lib.relu_forward(input, output) else: raise Exception("No...
{ "content_hash": "781895a179d1be382f7ed00789f1d296", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 65, "avg_line_length": 27, "alnum_prop": 0.6133333333333333, "repo_name": "DingKe/pytorch_workplace", "id": "fbe8ef48262add5ce40fa6310c6852c61d7ec38c", "size": "695", "bi...
import numpy as np import pandas as pd import matplotlib.pyplot as plt dataset = pd.read_csv("Market_Basket_Optimisation.csv",header = None) transactions = [] for i in range(0,7501): transactions.append([str(dataset.values[i,j]) for j in range(0,20)]) from apyori import apriori # min_support = 3*7/7500 rules = ap...
{ "content_hash": "ebb644ec34fd4c51d4e3b9a62085b5ac", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 102, "avg_line_length": 29.333333333333332, "alnum_prop": 0.7159090909090909, "repo_name": "jigargandhi/UdemyMachineLearning", "id": "14359b10f193b31ad7fd9bee77fb22ae37a34ada...
import hashlib import os import socket import six def tostr(s, encoding='utf-8'): if six.PY2: return s.encode(encoding) if isinstance(s, bytes): return s.decode(encoding) return s def read_file_content(filename, default=''): if not os.path.isfile(filename): return default ...
{ "content_hash": "c2350f1fa2e2c476f4395776b626ff69", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 64, "avg_line_length": 21.30188679245283, "alnum_prop": 0.579273693534101, "repo_name": "openatx/weditor", "id": "b1a8f1b0f43fc48d0b1f950f3c03cf01c0c65bbe", "size": "1148",...
from test import root_path # Actual Imports from utilities import TT from iterators import BatchGenerator, Dataset, ImageIterator from dataset import icpr2012 root = root_path() # 1. Test BatchGenerator # flt, mapper = icpr2012() TT.verbose = True # batches = BatchGenerator(Dataset(root+'/datasets/ICPR 2012/testing/s...
{ "content_hash": "9b6bed804c6413e0e0e827a98a34b947", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 123, "avg_line_length": 32, "alnum_prop": 0.7302631578947368, "repo_name": "znck/mitosis-detection", "id": "64553a9d548f63b0d353bb6e427f5587d249f1fc", "size": "621", "bin...
from common_settings import * from bundle_config import config DEBUG = True TEMPLATE_DEBUG = DEBUG import os MEDIA_ROOT = os.path.join(config["core"]["data_directory"], "media") STATIC_ROOT = os.path.join(config["core"]["data_directory"], "static") LOGIN_REDIRECT_URL = "/badge/"
{ "content_hash": "6068d5c5182e52cced779255c17c62a5", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 70, "avg_line_length": 25.636363636363637, "alnum_prop": 0.723404255319149, "repo_name": "silverstripesoftware/make_my_badge", "id": "f0d131a6f935d336aeb410e1fb12de30172c7255...
import _plotly_utils.basevalidators class ShowticklabelsValidator(_plotly_utils.basevalidators.BooleanValidator): def __init__( self, plotly_name="showticklabels", parent_name="histogram2dcontour.colorbar", **kwargs ): super(ShowticklabelsValidator, self).__init__( ...
{ "content_hash": "c268ebb454d8d1ed4648f1e74668b256", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 77, "avg_line_length": 31, "alnum_prop": 0.5977229601518027, "repo_name": "plotly/python-api", "id": "a6bc8dda55128f5467b79ad7a0e7be361afba4d5", "size": "527", "binary": ...
class Environment(object): def __init__(self, config_file=""): self.kintone_domain = "" self.kintone_id = "" self.kintone_password = "" self.database_uri = "" self.mail_domain = "" self.mail_api_key = "" self.translator_client_id = "" self.translator_...
{ "content_hash": "199d4d8606f02939e826ced9511c6171", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 124, "avg_line_length": 44.036144578313255, "alnum_prop": 0.559781121751026, "repo_name": "icoxfog417/kanaria", "id": "ed9aaf3137d27350cd9e322b993622350ab9f603", "size": "3...
import datetime import sys import threading import uuid import fixtures import kombu import testscenarios from oslo import messaging from oslo.messaging._drivers import amqpdriver from oslo.messaging._drivers import common as driver_common from oslo.messaging._drivers import impl_rabbit as rabbit_driver from oslo.mes...
{ "content_hash": "30a580140e6b31360007977f6a4cd166", "timestamp": "", "source": "github", "line_count": 632, "max_line_length": 79, "avg_line_length": 34.610759493670884, "alnum_prop": 0.5282070037487429, "repo_name": "JioCloud/oslo.messaging", "id": "39afb3ca489327a11fa37e0441ddb4e0b4c2e2de", "siz...
""" Linux on Hyper-V and Azure Test Code, ver. 1.0.0 Copyright (c) Microsoft Corporation 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/LICEN...
{ "content_hash": "83be63ce248bd532445d62220b4881b4", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 97, "avg_line_length": 39.649532710280376, "alnum_prop": 0.6051856216853271, "repo_name": "mihaico/lis-test", "id": "767bdc1eeaa8da17847cb42c76a0b6161331b263", "size": "84...
from rx.observable import Observable from rx.internal.basic import noop from rx.subjects import AsyncSubject from rx.disposables import CompositeDisposable from rx.concurrency import immediate_scheduler, current_thread_scheduler from rx.internal import extensionmethod class ChainObservable(Observable): def _subs...
{ "content_hash": "6061993a119ccaa80a339bc6dd5d9b67", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 81, "avg_line_length": 28.012048192771083, "alnum_prop": 0.632258064516129, "repo_name": "dbrattli/RxPY", "id": "c775492d435c55c79bb7ce7673dac16c495122b0", "size": "2325", ...
""" Created on Fri Nov 13 11:51:49 2015 @author: pabloem """ import os from PIL import Image def filePaths(rootdir, key): """ Returns a list with the paths of all the files that starts with the sting key. rootdir: init directory to start the search recursively. key: string used to filter the search....
{ "content_hash": "415ce93651fc40cfb9975da313886bfd", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 75, "avg_line_length": 25.944444444444443, "alnum_prop": 0.6295503211991434, "repo_name": "pabloesm/site_recipes", "id": "60920341a63ce62be58137eec0b7a7ff1dd38462", "size":...
# Copyright 2014 Lukas Kemmer # # 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 wr...
{ "content_hash": "a72ebf8505c634d57bab62d4c8ea89be", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 69, "avg_line_length": 30.966666666666665, "alnum_prop": 0.7029063509149623, "repo_name": "lukas-ke/faint-graphics-editor", "id": "bbf085767ef163a45e97005e24543b15adc1e64b", ...
import masterPlugin import MatrixUtils ## Wrapper for MatrixUtils.printWorkingDirectory() class printWorkingDirectory(masterPlugin.masterPlugin): def __init__(this): super().__init__() this.command = "printWorkingDirectory" this.aliases = ["pwd"] this.commandInfo = {'requiredArg...
{ "content_hash": "ee79fc1e09a14ee70da0408029ef55dd", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 59, "avg_line_length": 29.57894736842105, "alnum_prop": 0.6583629893238434, "repo_name": "charlesdaniels/hercm", "id": "360843732dd23fb0c184db3c1c9b792c5d28c059", "size": "...
from gwt.ui.ScrollPanel import ( DOM, Event, Factory, ScrollPanel, SimplePanel, )
{ "content_hash": "2133d2caa85a8eed4e6fa10ea4b1d9a9", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 32, "avg_line_length": 14.571428571428571, "alnum_prop": 0.6176470588235294, "repo_name": "anandology/pyjamas", "id": "3df7f9cbf26aab6882c0d540bc8ce41f1abef407", "size": "10...
""" WSGI config for myrestapi project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SET...
{ "content_hash": "7746ebce70627c2735d4589e8d26317c", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 24.6875, "alnum_prop": 0.7721518987341772, "repo_name": "JoseMariaMicoli/superlist-api-Django", "id": "3cc74bb5a31ba668cedfacfa55b8687696004217", "si...
""" Created on Mon Aug 8 10:56:46 2016 Credit: # Copyright (C) 2004-2015 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. # NetworkX:http://networkx.github.io/ Modified by @author: ahmadw1 on Aug 8 201...
{ "content_hash": "e6007085c2a70a6253851773f65b1931", "timestamp": "", "source": "github", "line_count": 505, "max_line_length": 90, "avg_line_length": 36.152475247524755, "alnum_prop": 0.6345511310730131, "repo_name": "walid-ahmad/TieDecay", "id": "d64a16b5d6214b5a26b965892fb7f44ddff8e899", "size":...
import foauth.providers class Dropbox(foauth.providers.OAuth2): # General info about the provider provider_url = 'https://www.dropbox.com/' docs_url = 'https://www.dropbox.com/developers/reference/api' favicon_url = 'https://cf.dropboxstatic.com/static/images/favicon-vflk5FiAC.ico' category = 'Fil...
{ "content_hash": "d83aab76990242b8ff78cc486965b9dd", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 94, "avg_line_length": 38.68181818181818, "alnum_prop": 0.6768507638072856, "repo_name": "foauth/foauth.org", "id": "ec606b0f3dfbed9faf9e823bcba97cda8d41fe35", "size": "851...
# -*- coding: utf-8 -*- """ Created on Sun Mar 20 13:32:28 2016 @author: pablo """ import os dir_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) import sys sys.path.append(dir_path) #path to src from src import np,odeint,interp1d,Hyperplume,plt class SSM(Hyperplum...
{ "content_hash": "c83099f1e628bd9b61642f76f993a6b3", "timestamp": "", "source": "github", "line_count": 330, "max_line_length": 280, "avg_line_length": 53.096969696969694, "alnum_prop": 0.6223604611345737, "repo_name": "Pabsm94/HyperPlume", "id": "7854584c6d5f0474a568180df09a67ab4a2d2c14", "size": ...
import os from distutils.core import setup from Cython.Distutils import Extension from Cython.Build import cythonize CUR_DIR = os.path.dirname(os.path.abspath(__file__)) SRC_DIR = os.path.join(CUR_DIR, 'src') TPM_DIR = os.path.join(SRC_DIR, 'tpm') include_dirs = [SRC_DIR] src_files = ["pytpm/_tpm.pyx"] # TPM library ...
{ "content_hash": "dc368be46f39a7b04744b16dbc46f6cb", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 56, "avg_line_length": 24.806451612903224, "alnum_prop": 0.6423927178153446, "repo_name": "phn/pytpm", "id": "576c54cc4416f099963d9e3a9f9b22f5af470ae5", "size": "769", "b...
from .client import PredictionServiceClient from .async_client import PredictionServiceAsyncClient __all__ = ( "PredictionServiceClient", "PredictionServiceAsyncClient", )
{ "content_hash": "565e6bd0a7b02ac7f2f1d71024daa8ad", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 54, "avg_line_length": 25.857142857142858, "alnum_prop": 0.7845303867403315, "repo_name": "googleapis/python-automl", "id": "d5ecd0dd035dda16c60928c0f9e4c6016bdd9dc1", "size...
from azure.identity import DefaultAzureCredential from azure.mgmt.apimanagement import ApiManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-apimanagement # USAGE python api_management_get_api_tag_description.py Before run the sample, please set the values of the cl...
{ "content_hash": "ba5b7585a62ace1588a0bfc9cce66475", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 156, "avg_line_length": 34.285714285714285, "alnum_prop": 0.7341666666666666, "repo_name": "Azure/azure-sdk-for-python", "id": "e62bc2c99f3c568da5ac7721c12343c2c809994c", "...
import contextlib import datetime import sys import types import warnings from freezegun import freeze_time class ModuleWithWarning: """ A module that triggers warnings on attribute access. This does not happen with regular modules, there has to be a bit of lazy module magic going on in order for th...
{ "content_hash": "9d5ae42ff6e771ce0432e9cb00954746", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 111, "avg_line_length": 33.226190476190474, "alnum_prop": 0.6936581870297385, "repo_name": "spulec/freezegun", "id": "5ee32ae48dd08e970e0615852b1176f7cf0afc2b", "size": "27...
import json import numpy as np import pandas as pd # Configura contextos contextos = [ {"arquivo_comentarios":"../../dados/dadospessoais-comentarios-pdfs-filtrado.csv", "prefixo_saida":"../site/data/"} ] #for i in range(1, 7): # obj = {"arquivo_comentarios" : "../../data/contextos/dadospessoais-comentarios...
{ "content_hash": "c8d9fb7a572ccb449f4783d7c6502028", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 124, "avg_line_length": 39.35576923076923, "alnum_prop": 0.5289518690447105, "repo_name": "W3CBrasil/AI-Social", "id": "6d7f61084280353c8c327f8c0e90ef9db22e14ab", "size": ...
import subprocess import sys import setup_util def start(args): setup_util.replace_text("cowboy/src/hello_world_app.erl", "\"benchmarkdbpass\", \".*\", 3306", "\"benchmarkdbpass\", \"" + args.database_host + "\", 3306") try: subprocess.check_call("./rebar get-deps", shell=True, cwd="cowboy") subprocess.ch...
{ "content_hash": "c1af17434947f6808454619c5b1a47ba", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 157, "avg_line_length": 37.15, "alnum_prop": 0.6877523553162853, "repo_name": "domix/FrameworkBenchmarks", "id": "60537f4b29c6cff5e3ae050a075b16bdb296eb39", "size": "743", ...
import os import json import string import random import nova_v2_base def cinder_request(self, url_detail, request_type='get', request_name=None, data=None, locust_name=None): url = self.get_endpoint('volumev2') if url_detai...
{ "content_hash": "9eafde66fa75e1e3c05b185d1cedd857", "timestamp": "", "source": "github", "line_count": 264, "max_line_length": 76, "avg_line_length": 31.03409090909091, "alnum_prop": 0.4738191138777005, "repo_name": "pcrews/rannsaka", "id": "c2fcef9fe3061731da8d4fe3d21502506829d617", "size": "8193...
from __future__ import annotations import unittest from unittest import mock from unittest.mock import PropertyMock from airflow.providers.google.cloud.hooks.spanner import SpannerHook from airflow.providers.google.common.consts import CLIENT_INFO from tests.providers.google.cloud.utils.base_gcp_mock import ( GCP...
{ "content_hash": "0ecd5be2361f36237a73b0cc247bdf69", "timestamp": "", "source": "github", "line_count": 655, "max_line_length": 108, "avg_line_length": 50.98473282442748, "alnum_prop": 0.6854618954933374, "repo_name": "cfei18/incubator-airflow", "id": "2f9f3d6a888e7810b3d0f6b71786a2bd3e281c2e", "si...
"""Git implementation of _version.py.""" import errno import os import re import subprocess import sys def get_keywords(): """Get the keywords needed to look up the version information.""" # these strings will be replaced by git during git-archive. # setup.py/versioneer.py will grep for the variable name...
{ "content_hash": "20e1ce25d410f58ded186da174841bc1", "timestamp": "", "source": "github", "line_count": 510, "max_line_length": 79, "avg_line_length": 35.245098039215684, "alnum_prop": 0.5697357440890125, "repo_name": "jburos/stancache", "id": "568bba33b117a2da2f9d2d1c8c729eabd641ec6e", "size": "18...
""" Visualize the Urban Aerosol Distribution ======================================== _thumb: .4, .4 """ import seaborn as sns import opcsim sns.set(style='ticks', font_scale=1.25) # Load the example urban distribution d = opcsim.load_distribution("Urban") # Plot the number-weighted pdf with modes ax = opcsim.plots.p...
{ "content_hash": "b88abd56bee212433232433d6d43bb87", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 47, "avg_line_length": 21.23076923076923, "alnum_prop": 0.6757246376811594, "repo_name": "dhhagan/opcsim", "id": "68f5b77559fd6ded9745dfe4072db948ebd6417f", "size": "552", ...
from django import forms from . import models class QACreateForm(forms.ModelForm): class Meta: model = models.QualityAssuranceCheck fields = [ 'content_changed', 'technical_quality_changed', 'comment' ] class QAEditForm(forms.ModelForm): class Meta...
{ "content_hash": "cc9c22a8663c0467fe69630b3141b7c5", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 44, "avg_line_length": 22.565217391304348, "alnum_prop": 0.5606936416184971, "repo_name": "WebArchivCZ/Seeder", "id": "4670ef04ab13aeed765d28b5f397c606697be933", "size": "5...
import numpy as np from scipy.integrate import dblquad from scipy.integrate import quad from scipy.stats import uniform from cgpm.cgpm import CGpm from cgpm.network.importance import ImportanceNetwork from cgpm.uncorrelated.directed import DirectedXyGpm from cgpm.uncorrelated.uniformx import UniformX from cgpm.utils...
{ "content_hash": "1405451304c8fc3a67876978efa38d91", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 80, "avg_line_length": 33.394557823129254, "alnum_prop": 0.5569362395599918, "repo_name": "probcomp/cgpm", "id": "5033419afcc54411f408893ba2906478ac920519", "size": "5539"...
def sieve(): pass
{ "content_hash": "243fe72566cd141a777c29c3f1654fe0", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 12, "avg_line_length": 11, "alnum_prop": 0.5454545454545454, "repo_name": "rootulp/xpython", "id": "dff3aafa8d77c50be9d1030ef03ef581b089c6aa", "size": "22", "binary": fals...
from multithreadCrawler import * from snapshotAnalyzer import * crawlModeActivated = False if __name__ == '__main__': # url = raw_input('URL: ') snapshotList = [] if crawlModeActivated: url = 'http://www.aone-video.com/avi.htm' urlList = getURLs(url) snapshotList = getSnapshots(url...
{ "content_hash": "60c32e0fed663dfab6e6f93742b3abe4", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 111, "avg_line_length": 35.31372549019608, "alnum_prop": 0.575235980011105, "repo_name": "trthanhquang/wayback-data-collector", "id": "a8f3cc578bcdb7342153f752644d0a7dcec411d...
"""JSON utility functions.""" from __future__ import annotations from collections import deque import json import logging import os import tempfile from typing import Any, Callable from homeassistant.core import Event, State from homeassistant.exceptions import HomeAssistantError _LOGGER = logging.getLogger(__name__...
{ "content_hash": "0328c5d1ed0c307a277a796c7ada0b2d", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 136, "avg_line_length": 32.23943661971831, "alnum_prop": 0.5941459152468327, "repo_name": "adrienbrault/home-assistant", "id": "fac008d9f0fd2c8182889eca20a9529bc01e469f", ...
EnsureSConsVersion(1,2) import os import inspect import platform def get_cuda_paths(): """Determines CUDA {bin,lib,include} paths returns (bin_path,lib_path,inc_path) """ # determine defaults if os.name == 'nt': bin_path = 'C:/CUDA/bin' lib_path = 'C:/CUDA/lib' inc_path = 'C:/CUDA/include' ...
{ "content_hash": "146eb32af9682a7f31be02f7f3d5c7a5", "timestamp": "", "source": "github", "line_count": 224, "max_line_length": 175, "avg_line_length": 31.066964285714285, "alnum_prop": 0.64290846385975, "repo_name": "brendanlong/cuda-scons", "id": "0dd19a1e5342d86145bf9474bbea29ce70df2872", "size"...
from django.forms import MultiWidget, HiddenInput from versatileimagefield.widgets import (ClearableFileInputWithImagePreview, SizedImageCenterpointWidgetMixIn) class ImagePreviewFileInput(ClearableFileInputWithImagePreview): template_with_initial_and_imagepreview = """ ...
{ "content_hash": "530d043d1770732e0fb5cd0d6c178f2c", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 76, "avg_line_length": 40.15384615384615, "alnum_prop": 0.6120689655172413, "repo_name": "taedori81/saleor", "id": "fc462ace16d1ec3b73cad164e08610cb0fa9a694", "size": "1044...
import os import tempfile from wsgiref.util import FileWrapper from celery.task import task from celery.utils.log import get_task_logger from django.conf import settings import zipfile from corehq.apps.app_manager.models import get_app from corehq.apps.hqmedia.cache import BulkMultimediaStatusCache from corehq.apps.hqm...
{ "content_hash": "33c79b6b77809009691a34ccb085b8dd", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 120, "avg_line_length": 38.75471698113208, "alnum_prop": 0.5949367088607594, "repo_name": "puttarajubr/commcare-hq", "id": "92cca4f06c84e7442427ded6a311bb2679c5907b", "siz...
""" This script is used initialize the sample project with user-specific values """ # Imports ###################################################################### from __future__ import print_function import os import re import sys import time import shutil # Metadata ###############################################...
{ "content_hash": "a1e7e7e92500f674af43e4e67bdf854f", "timestamp": "", "source": "github", "line_count": 283, "max_line_length": 112, "avg_line_length": 32.71024734982332, "alnum_prop": 0.584206546397321, "repo_name": "mtik00/glowing-octo-dubstep", "id": "7d7ad1ec7a5c28c4154d826f895ab0262de9ebe1", "...
from app import app, models from flask import render_template, request, abort, jsonify from .forms import DataAddForm from flask import make_response import urllib.parse DESC_TABLE = { 'id': False, 'word_id': False, 'word_string': False, 'fresh_rate': True, 'rank_good': True, 'rank_bad': True, ...
{ "content_hash": "27717e0e33feb498328dab4f8f6963d0", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 88, "avg_line_length": 33.73988439306358, "alnum_prop": 0.603392153503512, "repo_name": "wonook/LimeDictionary", "id": "42e61ca7318523eaa5981181ccea030b1d7097e5", "size": ...
import copy import random import time from oslo.config import cfg import six from cinder.openstack.common._i18n import _, _LE, _LI from cinder.openstack.common import log as logging periodic_opts = [ cfg.BoolOpt('run_external_periodic_tasks', default=True, help='Some periodic tas...
{ "content_hash": "7de546e96d72af2d643f2ddc496728ad", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 79, "avg_line_length": 35.984924623115575, "alnum_prop": 0.5839966485127775, "repo_name": "blueboxgroup/cinder", "id": "f05bca10bdc6ca4a5f43840ec9746471aaff9566", "size": ...
"""Members service.""" from .config import MemberServiceConfig from .service import MemberService __all__ = ( "MemberService", "MemberServiceConfig", )
{ "content_hash": "dc52d6cc368d0166a211d192114185d1", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 39, "avg_line_length": 16.3, "alnum_prop": 0.6993865030674846, "repo_name": "inveniosoftware/invenio-communities", "id": "c0852bf2738a16fa1511218b0b8e2f4e0b4e1247", "size":...
"""Return the short version string.""" from mpfmonitor._version import __short_version__ print("{}.x".format(__short_version__))
{ "content_hash": "77f7d5b4ced5f13a1dd647a7631d0398", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 49, "avg_line_length": 43, "alnum_prop": 0.6976744186046512, "repo_name": "missionpinball/mpf-monitor", "id": "2d3833d491afed96c8820ea00e918fba793c81c0", "size": "129", "b...
"""Module containing the core callback. """ __authors__ = [ '"Sverre Rabbelier" <sverre@rabbelier.nl>', '"Lennard de Rijk" <ljvderijk@gmail.com>', ] from soc.tasks import grading_survey_group as grading_group_tasks from soc.tasks import surveys as survey_tasks from soc.tasks.updates import start_update from so...
{ "content_hash": "14f7f6a2555895a83ad45536e520935e", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 79, "avg_line_length": 38.43478260869565, "alnum_prop": 0.7207498383968972, "repo_name": "MatthewWilkes/mw4068-packaging", "id": "5e148a24f468655a57020bd1ec7097ad79e2b32b", ...
import os import sys def convert_line_endings(file_path): if '\r\n' in open(file_path, 'rb').read(): print '%s contains DOS line endings. Converting' % file_path with open(file_path, 'rb') as infile: text = infile.read() text = text.replace('\r\n', '\n') with open(f...
{ "content_hash": "76c9cb2f03caef87c14e892f6bd62716", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 86, "avg_line_length": 34.91891891891892, "alnum_prop": 0.5185758513931888, "repo_name": "markfinal/BuildAMation", "id": "771665ea0da09272f5fa49e4a99c2201460c4cc3", "size":...
import unittest import sys try: from django.conf import settings settings.configure(DEBUG=True, TEMPLATE_DEBUG=True) except ImportError, e: pass from hamlpy.template.loaders import get_haml_loader, TemplateDoesNotExist class DummyLoader(object): """ A dummy template loader that only loads templates fr...
{ "content_hash": "e03fcefbe46f19bc0aff35297ba3aa23", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 124, "avg_line_length": 34.851351351351354, "alnum_prop": 0.6393951143854207, "repo_name": "GetHappie/HamlPy", "id": "27643aaa68120a5480deaa406c2c1da58d31215a", "size": "25...
import SomethingNotExist
{ "content_hash": "801c28e2b5fc631bbdbca38e26c0a85b", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 24, "avg_line_length": 25, "alnum_prop": 0.92, "repo_name": "huoxudong125/dlr", "id": "64a248922117b9de4df45b6dfd79cdd3fbeea9d7", "size": "44", "binary": false, "copies"...
# For more information, see http://lilyx.net/pages/nltkjapanesecorpus.html from __future__ import print_function import sys from nltk.corpus.reader import util from nltk import compat from nltk.corpus.reader.util import * from nltk.corpus.reader.api import * class ChasenCorpusReader(CorpusReader): ...
{ "content_hash": "68ae794225194d79c4d0182ec4033689", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 86, "avg_line_length": 35.208955223880594, "alnum_prop": 0.536244171259008, "repo_name": "enriquesanchezb/practica_utad_2016", "id": "a34bee756387fb817b64ea14d6fd73a7943092f...
""" Implentation of Brocade Quantum Plugin. """ from oslo.config import cfg from quantum.agent import securitygroups_rpc as sg_rpc from quantum.api.rpc.agentnotifiers import dhcp_rpc_agent_api from quantum.api.rpc.agentnotifiers import l3_rpc_agent_api from quantum.common import rpc as q_rpc from quantum.common impor...
{ "content_hash": "0505560c18a2b82c51ec4fbc4c33d7fb", "timestamp": "", "source": "github", "line_count": 443, "max_line_length": 79, "avg_line_length": 40.284424379232505, "alnum_prop": 0.5611341477081699, "repo_name": "liqin75/vse-vpnaas-plugin", "id": "895a967ef60fc41e95244abddd0e531d2f2746bb", "s...
try: from panda3d.core import NodePath, TextNode import panda3d except ImportError: panda3d = None #coloredtextbox class: this will be converted to a canvas drone using "build_canvasdrone" class coloredtextbox(object): #obligatory argument list for __init__: canvasdrone, object, identifier, parame...
{ "content_hash": "31e1560c2381fa6abf4cdeed1725b98d", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 119, "avg_line_length": 34.91549295774648, "alnum_prop": 0.6236385639370714, "repo_name": "agoose77/hivesystem", "id": "d45daeccabefff96b5a586758281db0c1695fd1d", "size": "...
from tdbus import SimpleDBusConnection, DBUS_BUS_SYSTEM, DBusHandler, signal_handler, DBusError import logging logging.basicConfig(level=logging.DEBUG) CONN_AVAHI = 'org.freedesktop.Avahi' PATH_SERVER = '/' IFACE_SERVER = 'org.freedesktop.Avahi.Server' conn = SimpleDBusConnection(DBUS_BUS_SYSTEM) try: result =...
{ "content_hash": "a9331ee03ef34342afc68786ff16f002", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 95, "avg_line_length": 28.974358974358974, "alnum_prop": 0.7053097345132744, "repo_name": "DanLipsitt/python-tdbus", "id": "915c3bf0813eb72e55ee42b63244a7ca3176b821", "size...
import grpc from ..registry import RegistryService_pb2 as registry_dot_RegistryService__pb2 class RegistryServiceStub(object): # missing associated documentation comment in .proto file pass def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.FindRegister...
{ "content_hash": "755b7a12802f439f47734be95d10caed", "timestamp": "", "source": "github", "line_count": 368, "max_line_length": 123, "avg_line_length": 54.15760869565217, "alnum_prop": 0.7653788258906171, "repo_name": "mitdbg/modeldb", "id": "66e6e4665b9efcbfd0f780f76e2c52f15483cc88", "size": "2000...
from __future__ import absolute_import import warnings from django.template import loader from django.utils import six from . import filters, filterset from .. import compat class DjangoFilterBackend(object): default_filter_set = filterset.FilterSet @property def template(self): if compat.is_c...
{ "content_hash": "d0ad94716d1be154e20233e89fdb018d", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 105, "avg_line_length": 34.81553398058252, "alnum_prop": 0.6070831009481317, "repo_name": "rvmoura96/projeto-almoxarifado", "id": "a837324cf1ea53a6ef2436fd4b82d1319460b2c0",...