text stringlengths 4 1.02M | meta dict |
|---|---|
from django.conf.urls.defaults import patterns, include, url
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'', include('main_site.urls', namespace="main_site", app_name="main_site")),
u... | {
"content_hash": "8cc1924f942338cf313bb6c7d363bf0f",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 85,
"avg_line_length": 35.095238095238095,
"alnum_prop": 0.6540027137042063,
"repo_name": "skoczen/artechetype",
"id": "a847a12e26a980f57e66be6daaf57641e11d2d13",
"size": "... |
import os
_ = gettext = lambda s: s
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) + '/../'
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows enviro... | {
"content_hash": "14c8d10717e3cab2aff02f56245f57f0",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 75,
"avg_line_length": 30.84269662921348,
"alnum_prop": 0.7260473588342441,
"repo_name": "makimo/django-project-template",
"id": "078fef86c27f7047c6fbf8ba9ad5c501692dca45",
... |
process_name = 'tornadoircd'
##
# Local time
##
import pytz, datetime
localtime = pytz.timezone('America/Sao_Paulo')
now = datetime.datetime.now(localtime)
##
# IRCd
##
from datetime import datetime
ircd = {
'name': 'irc.testnetwork.org',
'date': str(now),
'listen': [('127.0.0.1', 6667)],
'motd': ['We... | {
"content_hash": "8851ebbdd6521badcf3420e20b40551d",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 72,
"avg_line_length": 20.258064516129032,
"alnum_prop": 0.6114649681528662,
"repo_name": "leandropls/tornadoirc",
"id": "debdcb16ce865ea1ff1e0a1318c86d24fe350d80",
"size":... |
"""Pipelines for mapreduce library."""
__all__ = [
"MapperPipeline",
]
from mapreduce import control
from mapreduce import model
from mapreduce import parameters
from mapreduce import pipeline_base
# pylint: disable=g-bad-name
# pylint: disable=protected-access
class MapperPipeline(pipeline_base._Output... | {
"content_hash": "7498d71a564e335f5394ce6cd8c71ce5",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 78,
"avg_line_length": 34.26495726495727,
"alnum_prop": 0.6727363432277376,
"repo_name": "Candreas/mapreduce",
"id": "3aad27fbd8520e8dda59668b7f3822df0366630a",
"size": "4... |
from argus.scenarios import base
class CloudScenario(base.BaseScenario):
"""Base scenario class for testing Cloudbase-Init."""
service_type = 'http'
@classmethod
def prepare_recipe(cls):
"""Prepare the underlying recipe.
Prepare the recipe using custom behavior tailo... | {
"content_hash": "bd4795f16f506f7e6b5873609c93b1e5",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 76,
"avg_line_length": 24.88235294117647,
"alnum_prop": 0.6572104018912529,
"repo_name": "stefan-caraiman/cloudbase-init-ci",
"id": "472ac48c5e5669f8ee8349998f57e066dee4fe8b"... |
def value(colors):
pass
| {
"content_hash": "4d114af24d5365afdba38856f81583ba",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 18,
"avg_line_length": 14,
"alnum_prop": 0.6428571428571429,
"repo_name": "exercism/xpython",
"id": "f83a1c237cb31b7325a803fc7d971f24f566623c",
"size": "28",
"binary": fal... |
"""Tests for `models.py` (model cloning, mainly)."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import os
import numpy as np
from tensorflow.python import keras
from tensorflow.python.eager import context
from tensorflow.python.framework ... | {
"content_hash": "14adcefabfcd39af76b3b8bee248be6a",
"timestamp": "",
"source": "github",
"line_count": 387,
"max_line_length": 80,
"avg_line_length": 36.2609819121447,
"alnum_prop": 0.6508943205301788,
"repo_name": "girving/tensorflow",
"id": "c550caeb80a2471d9b35e3a28213e2068890c63c",
"size": "14... |
import sys
from tieslib.tieslib import (
prompt, setup_ties_environment
)
from interp.interp import newenv_with_preload, driver_loop
def input_prompt():
return '%s\n> ' % prompt()
### Load and save history file ############################
import os
import readline
histfile = os.path.join(os.path.expanduser... | {
"content_hash": "4b57eb44539e9fcaa8e5d627d17b36a5",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 66,
"avg_line_length": 22.416666666666668,
"alnum_prop": 0.6381660470879802,
"repo_name": "sKabYY/es_utilities",
"id": "8f7333ef10149226ba0c840567a50587cb65913d",
"size": "... |
from typing import Any, Dict
from .model import Error
class ISignError(Exception):
def __init__(self, method: str, path: str, status_code: int, response: Dict[str, Any]) -> None:
super(ISignError, self).__init__()
self.method = method
self.path = path
self.status_code = status_cod... | {
"content_hash": "df1de09e2fb59c0385cea0891fc48e2b",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 99,
"avg_line_length": 32.13333333333333,
"alnum_prop": 0.6161825726141079,
"repo_name": "Paulius-Maruska/python-isign",
"id": "28503165d0748c1d208569a33d6bd23b18dba408",
"... |
from __future__ import with_statement
import unittest
import sys
from IECore import *
import os
class TestEXRReader(unittest.TestCase):
def testFactoryConstruction( self ) :
r = Reader.create( "test/IECore/data/exrFiles/AllHalfValues.exr" )
self.assertEqual( type( r ), EXRImageReader )
def testCanReadAndIsCo... | {
"content_hash": "ed8a9117bcf3911c03f73dddadaf388b",
"timestamp": "",
"source": "github",
"line_count": 339,
"max_line_length": 105,
"avg_line_length": 34.39823008849557,
"alnum_prop": 0.6724123145527828,
"repo_name": "tectronics/cortex-vfx",
"id": "69a076a183b37c011d00187f25e0b35c5445de21",
"size"... |
import copy
from collections import namedtuple
import ctypes
import re
import numpy as np
from numba.core.typing.templates import ConcreteTemplate
from numba.core import types, config, compiler
from .hlc import hlc
from .hsadrv import devices, driver, enums, drvapi
from .hsadrv.error import HsaKernelLaunchError
from ... | {
"content_hash": "eb88ef85eddf230b10f5d9f23b2fc5c4",
"timestamp": "",
"source": "github",
"line_count": 464,
"max_line_length": 80,
"avg_line_length": 32.18103448275862,
"alnum_prop": 0.5918162335922851,
"repo_name": "stonebig/numba",
"id": "c2efd690c243c199ebb212fff69265bcadf0d1dc",
"size": "14932... |
from .django_settings import *
INSTALLED_APPS += (
# 'corsheaders',
'wooey',
)
# MIDDLEWARE_CLASSES = [[i] if i == 'django.middleware.common.CommonMiddleware' else ['corsheaders.middleware.CorsMiddleware',i] for i in MIDDLEWARE_CLASSES]
MIDDLEWARE_CLASSES = list(MIDDLEWARE_CLASSES)
MIDDLEWARE_CLASSES.append('... | {
"content_hash": "7c57104d176472380ec468f067db8335",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 157,
"avg_line_length": 35,
"alnum_prop": 0.7346938775510204,
"repo_name": "hottwaj/Wooey",
"id": "7ac7eef603016179dbaacc89ffe9392a39d2bc18",
"size": "490",
"binary": fal... |
"""Support code for OAuth, including webhook support."""
from __future__ import absolute_import
import logging
from django.contrib import messages
from django.utils.translation import ugettext_lazy as _
from readthedocs.integrations.models import Integration
from readthedocs.oauth.services import registry, GitHubServ... | {
"content_hash": "b1ecf07153ab0ede1bb50b83b55f730c",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 85,
"avg_line_length": 33.30952380952381,
"alnum_prop": 0.647962830593281,
"repo_name": "pombredanne/readthedocs.org",
"id": "e3a75ed7c65a53012894bc3c65d11253f9a0a0c3",
"si... |
from rest_framework import filters
from rest_framework.viewsets import ModelViewSet
from .models import Tag
from .serializers import TagSerializer
class TagViewSet(ModelViewSet):
# model = Tag
queryset = Tag.objects.all()
serializer_class = TagSerializer
filter_backends = (filters.OrderingFilter,)
... | {
"content_hash": "c538ea958e1b2febd657ac6a5336a5b9",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 48,
"avg_line_length": 26.785714285714285,
"alnum_prop": 0.7333333333333333,
"repo_name": "ychab/mymoney-server",
"id": "b71f1c28c308d6a3956601c5769270f2ffab2432",
"size": ... |
"""
A collection of methods that load the MNIST data set or load and save neural networks to a file.
"""
import cPickle, gzip, pdb
import tarfile
import ntpath
from neural_network import *
data_dir = "."
def load_digit_data():
print "Opening MNIST dataset"
f = gzip.open(data_dir + "/mnist.pkl.gz", "rb")
... | {
"content_hash": "70998bf25515471f545c592f3e798080",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 216,
"avg_line_length": 37.18,
"alnum_prop": 0.6395911780527165,
"repo_name": "ashleyjsands/machine-learning",
"id": "a5306a8269e22314d3288aa3d7b8917a1cbce2c8",
"size": "18... |
"""
Install wagtail-relevancy using setuptools
"""
from wagtailrelevancy import __version__
with open('README.rst', 'r') as f:
readme = f.read()
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, ... | {
"content_hash": "9c93eb97874ea43d85086c80248e7c79",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 88,
"avg_line_length": 24.711111111111112,
"alnum_prop": 0.6492805755395683,
"repo_name": "takeflight/wagtail-relevancy",
"id": "e6139856601fd8c35deeb1a1f7b9693937df9b67",
... |
from nailgun.objects.plugin import PluginCollection
from nailgun.plugins.attr_plugin import ClusterAttributesPlugin
class PluginManager(object):
@classmethod
def process_cluster_attributes(cls, cluster, attrs, query=None):
if query is None:
query = PluginCollection.all()
for plug... | {
"content_hash": "239c3dbba1a3f362f162ac2b4e7d06f3",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 68,
"avg_line_length": 34.875,
"alnum_prop": 0.6630824372759857,
"repo_name": "andrei4ka/fuel-web-redhat",
"id": "3aab2e72914994b2b70454c8c2f1b6c6cf44f4eb",
"size": "1726",... |
from postcards.postcards import Postcards
from postcards.plugin_folder.slice_image import make_tiles, store_tiles
import sys
import os
import random
import ntpath
from PIL import Image
import os
from time import gmtime, strftime
class PostcardsFolder(Postcards):
"""
Send postcards with images from a local fol... | {
"content_hash": "d0728071d5ceb65dc21d1b18b865b785",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 107,
"avg_line_length": 36.17037037037037,
"alnum_prop": 0.5535531435592873,
"repo_name": "abertschi/postcards",
"id": "6f40212b6336178c8350a4788cf9c5af73234d57",
"size": ... |
from django.apps import AppConfig
class ScenesConfig(AppConfig):
name = 'scenes'
| {
"content_hash": "52cb69635aa59285b8d6d7cf2ec9a6f2",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 33,
"avg_line_length": 17.4,
"alnum_prop": 0.7471264367816092,
"repo_name": "jordifierro/abidria-api",
"id": "9ca11bbf7ca0b7d63bf22faf4e5a1668e87ded5a",
"size": "87",
"bin... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('tocayoapp', '0004_desig_uid'),
]
operations = [
migrations.RenameField('Token', 'token', 'name'),
]
| {
"content_hash": "eb44d3eac9dabffca1a45259a97a89cd",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 57,
"avg_line_length": 19.142857142857142,
"alnum_prop": 0.6343283582089553,
"repo_name": "philpot/tocayo",
"id": "28bb29230a687e389ce0413959293e3f1696b308",
"size": "338",... |
"""Tests for tensorflow.python.training.saver.py."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import math
import os
import random
import time
import numpy as np
import six
from google.protobuf.any_pb2 import Any
from tensorflow.co... | {
"content_hash": "06066974c1d3fe87173b764747f1a115",
"timestamp": "",
"source": "github",
"line_count": 3048,
"max_line_length": 89,
"avg_line_length": 42.42782152230971,
"alnum_prop": 0.6485230436127436,
"repo_name": "apark263/tensorflow",
"id": "dec23c50e8c069d4f2dd18c49ecdabb447f4872b",
"size": ... |
from pyface.action.action_manager_item import *
| {
"content_hash": "2a8ba630e55ecdb36b2e188b8538386c",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 47,
"avg_line_length": 48,
"alnum_prop": 0.8125,
"repo_name": "enthought/etsproxy",
"id": "d412c919f24ddac63127a84d16585d061ef26378",
"size": "63",
"binary": false,
"cop... |
import re
#from . import export
#@export
def fuzzyfinder(text, collection):
"""
Args:
text (str): A partial string which is typically entered by a user.
collection (iterable): A collection of strings which will be filtered
based on the input `text`.
Returns:
... | {
"content_hash": "53c8d957440c75165dd270760278fded",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 77,
"avg_line_length": 31.16,
"alnum_prop": 0.5905006418485238,
"repo_name": "edonyM/toolkitem",
"id": "892f627978d63ee9d329ab8c687f1142371f42f1",
"size": "803",
"binary"... |
from sqlalchemy.orm import joinedload, subqueryload, lazyload
from aquilon.exceptions_ import NotFoundException
from aquilon.aqdb.model import EsxCluster, VirtualMachine, ClusterResource
from aquilon.worker.broker import BrokerCommand # pylint: disable=W0611
from aquilon.worker.formats.cluster import ClusterList
cl... | {
"content_hash": "12df1fdad756d99bf2b06e8a48ca0481",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 80,
"avg_line_length": 42.808510638297875,
"alnum_prop": 0.5874751491053678,
"repo_name": "stdweird/aquilon",
"id": "6e3dc3f086febd560ac7557868cee744465c8e61",
"size": "271... |
import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
if os.environ.get('READTHEDOCS', ''):
# RTD doesn't use the repo's Makefile to build docs.
import subprocess
subprocess.run(["sphinx-apidoc", "--force", "-o", "./api", "../../rafem"])
# -- Project information ----------------------------... | {
"content_hash": "8781bc0ea00f24651f2ff711c8aec77c",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 78,
"avg_line_length": 28.506666666666668,
"alnum_prop": 0.6202057998129092,
"repo_name": "katmratliff/avulsion-bmi",
"id": "3fd8b59afdd8d16467ab0d8c3018bf0d02705250",
"siz... |
import django_filters
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext_lazy as _
try:
from django_filters import rest_framework as filters
except ImportError: # Back-ward compatible for django-rest-framework<3.7
from rest_framework import filters
from rest_framework... | {
"content_hash": "e99aeecc2a8c98e9f368d5598d492d6f",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 88,
"avg_line_length": 35.583333333333336,
"alnum_prop": 0.760343481654957,
"repo_name": "ad-m/django-teryt-tree",
"id": "25572a57a80a7638de6579011eb81a2270303655",
"size":... |
from ..estimators.estimator_base import H2OEstimator
from h2o.utils.typechecks import Enum
from h2o.utils.typechecks import assert_is_type
from h2o.frame import H2OFrame
from h2o.utils.typechecks import assert_is_type, Enum, numeric
class H2OPCA(H2OEstimator):
"""
Principal Component Analysis
"""
algo ... | {
"content_hash": "6ff7cba80910109eb2ddb7823b1f1f29",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 119,
"avg_line_length": 50.7,
"alnum_prop": 0.6394230769230769,
"repo_name": "ryfeus/lambda-packs",
"id": "0326903b24beddcd1cf2e69355f07d7ca44f0ae9",
"size": "8112",
"bi... |
from mock import patch
from django.template.loader import get_template
from mozillians.groups.tasks import email_membership_change
from nose.tools import eq_, ok_
from django.conf import settings
from mozillians.common.tests import TestCase
from mozillians.groups import tasks
from mozillians.groups.models import Grou... | {
"content_hash": "28f9c94805318bba896f4cac2256be0d",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 95,
"avg_line_length": 46.65625,
"alnum_prop": 0.6711319490957803,
"repo_name": "ChristineLaMuse/mozillians",
"id": "5909156490a83d2ca2b8cf81252fa876832a5494",
"size": "74... |
import glob
import os
import queue
import subprocess
import sys
import threading
import time
script_dir = os.path.dirname(os.path.realpath(__file__))
# Test executable
process_command = os.environ.get(
'CLIENT_SERVER_DYNAMIC_DISCOVERY_BIN')
if not process_command:
process_files = glob.glob(
os.path.jo... | {
"content_hash": "6242e66e38f57eddf5f6a5718931c1ed",
"timestamp": "",
"source": "github",
"line_count": 522,
"max_line_length": 124,
"avg_line_length": 34.06896551724138,
"alnum_prop": 0.5820400359874044,
"repo_name": "eProsima/Fast-RTPS",
"id": "6d26963f092124d5fc25d04359bc048e2c855e28",
"size": "... |
import os
from pilot.control.payloads import generic
from pilot.util.container import execute
import logging
logger = logging.getLogger(__name__)
class Executor(generic.Executor):
def __init__(self, args, job, out, err, traces):
super(Executor, self).__init__(args, job, out, err, traces)
def untar_... | {
"content_hash": "abf88dd5caa6f6c07030cb229c1f473b",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 92,
"avg_line_length": 31.763157894736842,
"alnum_prop": 0.6296603148301574,
"repo_name": "PalNilsson/pilot2",
"id": "a23c00b2e5d7e8e775487d3760bdc784ba5c744a",
"size": "15... |
'''
Author: Bu Kun
E-mail: bukun@osgeo.cn
CopyRight: http://www.yunsuan.org
'''
from torlite.model.core_tab import CabCatalog
class MCatalog():
def __init__(self):
self.tab = CabCatalog
try:
CabCatalog.create_table()
except:
pass
def query_all... | {
"content_hash": "526fe1503dbee173bbb32c684b8ffe06",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 85,
"avg_line_length": 28.196428571428573,
"alnum_prop": 0.538948701709943,
"repo_name": "jiaxiaolei/TorCMS",
"id": "190aba2b5d7b6d67e9be78ee70ea2c6488cfed6e",
"size": "160... |
"""
oauthlib.oauth1.rfc5849.endpoints.signature_only
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of the signing logic of OAuth 1.0 RFC 5849.
"""
from __future__ import absolute_import, unicode_literals
import logging
from .. import errors
from .base import BaseEndpoint
log = l... | {
"content_hash": "8504834591b3d2c39e7c75002f70f0ba",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 79,
"avg_line_length": 40.493975903614455,
"alnum_prop": 0.6349300803332342,
"repo_name": "kylebebak/Requester",
"id": "42977706d0ba8cc7d546a7b10f505bf0279ad697",
"size": "... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('phone_numbers', '0001_initial'),
('sims', '0001_initial'),
]
operations = [
migrations.... | {
"content_hash": "7779c9b52e7c495a6993e0b454bd49b4",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 137,
"avg_line_length": 25.227272727272727,
"alnum_prop": 0.6252252252252253,
"repo_name": "RobSpectre/garfield",
"id": "9e531d028911f49dbacc023fe83a8d0b0a7984a5",
"size": ... |
import pytest
@pytest.fixture(scope='function', autouse=True)
def mock_settings(monkeypatch):
class Settings:
ALIASES = ''
def __getattr__(self, item):
return None
settings = Settings()
monkeypatch.setattr('slackbot.settings', settings)
monkeypatch.setattr('slackbot.dispa... | {
"content_hash": "843f4fde017a2b25c44c36c6425f608b",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 65,
"avg_line_length": 24.785714285714285,
"alnum_prop": 0.6714697406340058,
"repo_name": "pengzhangdev/slackbot",
"id": "a5ac345111248ab9d2b079a99b682d389d5a8828",
"size":... |
import json
import logging
import random
import urllib
import urllib2
#app engine imports
from google.appengine.api import urlfetch
from google.appengine.ext import ndb
import webapp2
#Imports nossos
import bds
import comandos as c
import preGame as p
import game as g
#TOKEN TESTE: 105794279:AAEZQkZX-HnXHMBG8NHkc0CW... | {
"content_hash": "2e30e0eb314fecced9b9057edc947cce",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 128,
"avg_line_length": 40.39252336448598,
"alnum_prop": 0.5321610365571494,
"repo_name": "0Cristofer/PlayHangmanBot",
"id": "5926537fb64b76e1803c4fac078f8551e203e3b6",
"s... |
"""
This is a Python client for the Lastline Analyst API.
The :py:class:`AnalysisClient` class implements the client side of the Lastline Analyst API
methods. It can be imported into Python client code that uses the API.
The client is available at https://analysis.lastline.com/docs/llapi_client/analysis_apiclient.py ... | {
"content_hash": "df4412103f26444d1db2e0f318c18711",
"timestamp": "",
"source": "github",
"line_count": 5039,
"max_line_length": 100,
"avg_line_length": 43.64179400674737,
"alnum_prop": 0.5947405996062043,
"repo_name": "carbonblack/cb-lastline-connector",
"id": "31d9e9565f48f83a39ae7b68f5e905b91407b2... |
import ctypes
import functools
import windows
from windows import utils
from windows import winproxy
import windows.generated_def as gdef
# import windows.security # at the end of this file (loop import)
bltn_type = type
KNOW_INTEGRITY_LEVEL = gdef.FlagMapper(
gdef.SECURITY_MANDATORY_UNTRUSTED_RID,
gdef.SECU... | {
"content_hash": "505704fcc2870c29a2e9750bbbd72f12",
"timestamp": "",
"source": "github",
"line_count": 626,
"max_line_length": 206,
"avg_line_length": 43.67571884984026,
"alnum_prop": 0.6815039683991075,
"repo_name": "hakril/PythonForWindows",
"id": "091a1ce1ff2cdff80e0cc7f4ea363f3b98ce7e69",
"siz... |
import sys
from datetime import datetime
from pyvirtualdisplay import Display
from selenium import webdriver
display = Display(visible=0, size=(800, 600)) # Virtual display for headless mode
display.start()
wifi_address = "http://192.168.1.1"
wifi_username = "admin"
wifi_password = "admin"
driver = webdriver.Firefo... | {
"content_hash": "de8d8e23570e71a94b383b6b9500e660",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 102,
"avg_line_length": 42.82857142857143,
"alnum_prop": 0.7358238825883923,
"repo_name": "Pytlicek/Router-Modem-Features",
"id": "84ca609625a81624446b80dd11f75358f693db77",
... |
from __future__ import absolute_import
import itertools
import operator
import os
from plumbum.lib import six
from abc import abstractmethod, abstractproperty
import warnings
from functools import reduce
class FSUser(int):
"""A special object that represents a file-system user. It derives from ``int``, so it be... | {
"content_hash": "59039dead8d58b29280454e10f504eff",
"timestamp": "",
"source": "github",
"line_count": 493,
"max_line_length": 110,
"avg_line_length": 33.75456389452333,
"alnum_prop": 0.5785109067964666,
"repo_name": "AndydeCleyre/plumbum",
"id": "2c1fe06c4f80df3d2df150c24d058b300e4d460c",
"size":... |
"""
This module provides access to LDAP servers, along with some basic functionality required for Hue and
User Admin to work seamlessly with LDAP.
"""
import desktop.conf
import ldap
import ldap.filter
import logging
LOG = logging.getLogger(__name__)
CACHED_LDAP_CONN = None
def get_connection():
global CACHED_LDAP... | {
"content_hash": "36108c76857c7d8f6be6b035c739649c",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 101,
"avg_line_length": 32.82876712328767,
"alnum_prop": 0.6476110995201335,
"repo_name": "hortonworks/hortonworks-sandbox",
"id": "5668bc49405387eb8f3d32808cad5607e4118abf"... |
"""
gargoyle.helpers
~~~~~~~~~~~~~~~~
:copyright: (c) 2010 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import datetime
import json
import uuid
from django.core.serializers.json import DjangoJSONEncoder
cl... | {
"content_hash": "74af9e4cd8f942ee88552e3a6aa8704f",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 82,
"avg_line_length": 27.24137931034483,
"alnum_prop": 0.6734177215189874,
"repo_name": "nkovshov/gargoyle",
"id": "31540578dd51b0c147305368acedf4e57f1305ce",
"size": "790... |
class ExecutionConfiguration(object):
@staticmethod
def get_default_configuration():
return ExecutionConfiguration()
def __init__(self):
self.allow_to_transit_to_multiple_states = True
self.allow_to_stay_in_state_on_update = False
self.exit_when_end_state_is_encountered = F... | {
"content_hash": "d7f7c76f1b9f197705a5246414cdb1ae",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 55,
"avg_line_length": 32.4,
"alnum_prop": 0.6820987654320988,
"repo_name": "Hicks48/amber-state-machine-python",
"id": "da1c5e18e12acc8435fcf58fe55985c3200b8a3b",
"size": ... |
"""
Django settings for web project.
Generated by 'django-admin startproject' using Django 1.11.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
imp... | {
"content_hash": "c2c2cb2afe621c6927545579af1db4c8",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 91,
"avg_line_length": 25.6,
"alnum_prop": 0.6802884615384616,
"repo_name": "nikolaystanishev/traffic-sign-recognition",
"id": "adbcf1437ad19830875cc5f0b73c660c856aafa3",
... |
"""
Autopsy Forensic Browser
Copyright 2016 Basis Technology Corp.
Contact: carrier <at> sleuthkit <dot> org
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/LICE... | {
"content_hash": "98ddfb6b3f4a4528b046bd42e74a47e7",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 157,
"avg_line_length": 49.708333333333336,
"alnum_prop": 0.6955574182732607,
"repo_name": "dgrove727/autopsy",
"id": "ef79a623c230344949659636bc9dbf9eddd30c8b",
"size": "... |
'''
main issue here was to global patforrec. youll probs forget.
'''
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import matplotlib.dates as mdates
import numpy as np
from numpy import loadtxt
import time
totalStart = time.time()
date,bid,ask = np.loadtxt('GBPUSD1d.txt', u... | {
"content_hash": "e3e73c6fcaba809eff8e55213d8d5c82",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 85,
"avg_line_length": 30.451612903225808,
"alnum_prop": 0.565677966101695,
"repo_name": "PythonProgramming/Pattern-Recognition-for-Forex-Trading",
"id": "f8711ec747e3d04eba... |
import os
import unittest
import imath
import random
import IECore
import IECoreScene
import Gaffer
import GafferTest
import GafferScene
import GafferOSL
import GafferOSLTest
import GafferImage
class OSLShaderTest( GafferOSLTest.OSLTestCase ) :
def test( self ) :
s = self.compileShader( os.path.dirname( __file_... | {
"content_hash": "2edd70a3c6af48d82234c5743d6fc77c",
"timestamp": "",
"source": "github",
"line_count": 1048,
"max_line_length": 208,
"avg_line_length": 36.81393129770992,
"alnum_prop": 0.6615950856639279,
"repo_name": "boberfly/gaffer",
"id": "a884949f1a2fd6785ffc66d59b8775a9dd50216f",
"size": "40... |
"""This code example creates new cdn configurations.
To determine which configurations exist, run get_all_cdn_configurations.py.
"""
# Import appropriate modules from the client library.
from googleads import ad_manager
def main(client):
# Initialize appropriate service.
cdn_config_service = client.GetService(... | {
"content_hash": "fc44b6c1c7af17eb8a684a334a8a4503",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 75,
"avg_line_length": 32.19178082191781,
"alnum_prop": 0.5706382978723404,
"repo_name": "googleads/googleads-python-lib",
"id": "32a3e6d9cd572019ed7686c57c550c1481aa6a09",
... |
from absl.testing import absltest
import jaxopt
from jaxopt._src import test_util
class ImportTest(test_util.JaxoptTestCase):
def test_implicit_diff(self):
jaxopt.implicit_diff.root_vjp
from jaxopt.implicit_diff import root_vjp
def test_prox(self):
jaxopt.prox.prox_none
from jaxopt.prox import ... | {
"content_hash": "9cd6644a0247975ae861f65f4b78ea24",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 58,
"avg_line_length": 23.76086956521739,
"alnum_prop": 0.7365050320219579,
"repo_name": "google/jaxopt",
"id": "0b6882c1c93d88f6f238de8ff7333df7bb1993eb",
"size": "1669",
... |
"""Elliptical geometrical entities.
Contains
* Ellipse
* Circle
"""
from __future__ import print_function, division
from sympy.core import S, C, sympify, pi, Dummy
from sympy.core.logic import fuzzy_bool
from sympy.core.numbers import oo, Rational
from sympy.core.compatibility import range
from sympy.simplify impor... | {
"content_hash": "7ffc90394c8716e9d9fb776e9fd16bc3",
"timestamp": "",
"source": "github",
"line_count": 1507,
"max_line_length": 96,
"avg_line_length": 27.2435301924353,
"alnum_prop": 0.5064545985970382,
"repo_name": "Sumith1896/sympy",
"id": "bedbfde2621d2c2cc43601cc17e527bb8f0260b1",
"size": "410... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/attachment/engine/shared_bwing_engine_s02.iff"
result.attribute_template_id = 8
result.stfName("item_n","ship_attachment")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "e0d38c71938ca7b10e59526d01da738f",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 87,
"avg_line_length": 24.53846153846154,
"alnum_prop": 0.7053291536050157,
"repo_name": "anhstudios/swganh",
"id": "6e48894f55d5f7d6e45b2b3b93ebdb5ce93a863a",
"size": "464... |
import sys
import os
from qt import *
from qtcanvas import *
from treecanvas import *
from treecanvasview import *
from lpathtree_qt import *
from axis import *
from db import *
from dbdialog import *
from sqlviewdialog import *
from overlay import *
from translator import translate
from parselpath import parse_lpath
f... | {
"content_hash": "136f12ad1db5af74e50a5ab62ce66525",
"timestamp": "",
"source": "github",
"line_count": 271,
"max_line_length": 87,
"avg_line_length": 38.04428044280443,
"alnum_prop": 0.5860329776915616,
"repo_name": "hectormartinez/rougexstem",
"id": "8628a0922f00e2967cc743ed189790ee81e09d9a",
"si... |
import os
import time
import math
from IPython.display import display, HTML
import radiopadre
from radiopadre.render import render_refresh_button
class FileBase(object):
"""Base class referring to a datafile. Sets up some standard attributes in the constructor.
Attributes:
fullpath: the full path... | {
"content_hash": "32ff76738ba8a52b1700d4ddaca7d58a",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 95,
"avg_line_length": 35.28662420382165,
"alnum_prop": 0.5924187725631769,
"repo_name": "o-smirnov/padre",
"id": "4f4f41837259b47501dee4cdd7da67ea56d475ae",
"size": "5540... |
from __future__ import unicode_literals
from django.contrib import admin
from core.models import Post
from core.models import Category
from core.models import Comment
from core.models import Tag
from core.forms import PostForm
@admin.register(Post)
class PostAdmin(admin.ModelAdmin):
# raw_id_fields = ('tags',)
... | {
"content_hash": "b68e08d949a5249b0e0ac534249e37fa",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 39,
"avg_line_length": 25.5,
"alnum_prop": 0.7581699346405228,
"repo_name": "valbertovc/blog_django_bootstrap_ajax",
"id": "1129c4289ec35f2181c67b23ea2e26bb298bb16c",
"size... |
"The quick brown fox jumps over the lazy dog"
"The quick brown fox jumps over the lazy dog"
"The quick brown fox jumps over the lazy cat"
"The quick brown fox jumps over the lazy dog"
# Expression registers are similar but not quite--They are for evaluating arbitrary vimscript expressions. This MAY
# include a syste... | {
"content_hash": "048f60b9628956992611eff95c06f00a",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 118,
"avg_line_length": 51.09090909090909,
"alnum_prop": 0.7473309608540926,
"repo_name": "alexkuang/vim-ll",
"id": "3b7abd1d6623c26a77f2d9b8182407782ccba5bd",
"size": "106... |
import numpy as np
from matplotlib import pyplot, cm
min_samples = 256
with open('matplotlib_color_maps.py', 'w') as file:
file.write("""\"\"\"
matplotlib colormaps.
For more information, see
`Choosing Colormaps in Matplotlib <https://matplotlib.org/stable/tutorials/colors/colormaps.html>`_.
\"\"\"
""")
fo... | {
"content_hash": "8e48cc4b14f521114a81cf2699fb8723",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 100,
"avg_line_length": 33.275862068965516,
"alnum_prop": 0.5844559585492228,
"repo_name": "K3D-tools/K3D-jupyter",
"id": "e5b1f1a7cc7b56ac741d88a4cdaddf834e59da0f",
"size"... |
__all__ = ['GATDLSession', 'GAList', 'GAMetadata', 'GARoot', 'GATask', 'GAUser']
from .galist import GAList
from .gametadata import GAMetadata
from .garoot import GARoot
from .gatask import GATask
from .gauser import GAUser
from .gatdlsession import GATDLSession
from .sdkinfo import SDKInfo
def __setup_bambou():
... | {
"content_hash": "b6c86be1aec007d0cf13c7c5efe6b09d",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 94,
"avg_line_length": 33.888888888888886,
"alnum_prop": 0.7628415300546448,
"repo_name": "nuagenetworks/monolithe",
"id": "45a255ee60b60fbead7faf6bf058c5e505b07085",
"size... |
from celery.task import Task
from odnoklassniki_users.models import User
class OdnoklassnikiUsersFetchUsers(Task):
def run(self, ids, only_expired, *args, **kwargs):
return User.remote.fetch(ids=ids) # , only_expired=only_expired)
| {
"content_hash": "780cbd61f21276115abd76f11a0167d7",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 73,
"avg_line_length": 35.142857142857146,
"alnum_prop": 0.7398373983739838,
"repo_name": "ramusus/django-odnoklassniki-users",
"id": "b66d3fdc53069d4518893c51435ba42c0fd13cc6... |
import base64
import datetime
import hashlib
import io
import itertools
import json
import os
import random
import shutil
import subprocess
import tarfile
import tempfile
from configparser import ConfigParser
from contextlib import contextmanager
import factory
import factory.fuzzy
import factory.alchemy
import faker
... | {
"content_hash": "92f797ccdd78173c671f08dcd1c4ff44",
"timestamp": "",
"source": "github",
"line_count": 664,
"max_line_length": 140,
"avg_line_length": 41.20933734939759,
"alnum_prop": 0.6299747834667251,
"repo_name": "Diaoul/spkrepo",
"id": "faaf20cb7f1f0b71a5972bcd87987cd5d1057bea",
"size": "2738... |
import demistomock as demisto
from Active_Directory_Query import main, group_dn
import socket
import ssl
from threading import Thread
import time
import os
import pytest
import json
from IAMApiModule import *
from unittest.mock import patch
BASE_TEST_PARAMS = {
'server_ip': '127.0.0.1',
'secure_connection': 'N... | {
"content_hash": "2a3cbcf414235b045bb80f92e5644385",
"timestamp": "",
"source": "github",
"line_count": 661,
"max_line_length": 118,
"avg_line_length": 37.09833585476551,
"alnum_prop": 0.593181632819509,
"repo_name": "VirusTotal/content",
"id": "beb87186a07304283d83139e6169f602d8fdbfa6",
"size": "2... |
from soap import logger
from soap.common import indent
from soap.expression import (
AccessExpr, Expression, FixExpr, OutputVariableTuple, SelectExpr,
UpdateExpr, Variable
)
from soap.semantics.common import is_numeral
from soap.semantics.error import cast
from soap.semantics.functions import expand_expr
from ... | {
"content_hash": "6ec2565cdd13b4b43df4a9e6a7a762c8",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 79,
"avg_line_length": 35.260355029585796,
"alnum_prop": 0.5675448900822285,
"repo_name": "admk/soap",
"id": "0d8e1f95f10eefb39149197942fc50ff834f8bd6",
"size": "5959",
... |
from . import dbapi20
import unittest
import pg8000
from .connection_settings import db_connect
class Tests(dbapi20.DatabaseAPI20Test):
driver = pg8000
connect_args = ()
connect_kw_args = db_connect
lower_func = 'lower' # For stored procedure test
def test_nextset(self):
pass
def t... | {
"content_hash": "91cf7dd52044de0346c08b64116a7bbc",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 53,
"avg_line_length": 19.333333333333332,
"alnum_prop": 0.6576354679802956,
"repo_name": "realazthat/pg8000",
"id": "62eb1f905e0ce37e8cce15a957efce7ac49c2a7d",
"size": "42... |
from django.contrib import admin
from bambu_urlshortener.models import ShortURL
class ShortURLAdmin(admin.ModelAdmin):
list_display = ('url', 'slug', 'visits', 'last_visited')
readonly_fields = ('slug', 'visits', 'last_visited')
admin.site.register(ShortURL, ShortURLAdmin) | {
"content_hash": "f47b00a6b38d144b9129b7b04e7d6632",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 60,
"avg_line_length": 35.375,
"alnum_prop": 0.7420494699646644,
"repo_name": "iamsteadman/bambu-urlshortener",
"id": "1935fc5cd672a5d27e840831f25add6c90c67aca",
"size": "28... |
import datetime
from dateutil import parser as dateparser
EQUALS = 'eq'
NOT_EQUAL = 'neq'
LESS_THAN = 'lt'
LESS_THAN_EQUALS = 'lte'
GREATER_THAN = 'gt'
GREATER_THAN_EQUALS = 'gte'
IN = 'in'
NOT_IN = 'nin'
HAS = 'has'
ALL = (
EQUALS,
NOT_EQUAL,
GREATER_THAN,
GREATER_THAN_EQUALS,
LESS_THAN,
LES... | {
"content_hash": "83fbfd85b5a65e09e6ab044633298b2b",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 76,
"avg_line_length": 26.41830065359477,
"alnum_prop": 0.587085601187531,
"repo_name": "openstack/mistral",
"id": "208ebad6cec0ba8f57dd35fd953e4e2f7f0bab68",
"size": "473... |
"""Float class.
Represents an unbounded float using a widget.
"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from .domwidget import DOMWidget
from .widget import register
from .trait_types import Color
from traitlets import (Unicode, CFloat, Bool, Int, Casele... | {
"content_hash": "53835ad2e0cb31e4c1271ef64e13d381",
"timestamp": "",
"source": "github",
"line_count": 276,
"max_line_length": 123,
"avg_line_length": 37.13768115942029,
"alnum_prop": 0.6344390243902439,
"repo_name": "lancezlin/ml_template_py",
"id": "be574d4ef1157d6deb4d13b1122807fc380c09f0",
"si... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import gym
import numpy as np
import tensorflow.compat.v2 as tf
from gym import spaces
from gym.utils import seeding
import dice_rl.utils.common as common_utils
class LowRank(gym.Env):
... | {
"content_hash": "3c86216753790fa474d1c1976d05b964",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 80,
"avg_line_length": 32.98170731707317,
"alnum_prop": 0.6176742466259937,
"repo_name": "google-research/dice_rl",
"id": "d9438668f70e5a87709f84450e4902693017ca30",
"size... |
"""Weight of Evidence"""
import numpy as np
import pandas as pd
from sklearn.base import BaseEstimator
from category_encoders.ordinal import OrdinalEncoder
import category_encoders.utils as util
from sklearn.utils.random import check_random_state
__author__ = 'Jan Motl'
class WOEEncoder(BaseEstimator, util.Transform... | {
"content_hash": "9a7c74f9fe527931105afef268c0abda",
"timestamp": "",
"source": "github",
"line_count": 294,
"max_line_length": 134,
"avg_line_length": 37.034013605442176,
"alnum_prop": 0.5971711976487877,
"repo_name": "scikit-learn-contrib/categorical-encoding",
"id": "a37e2836510824e1972f70a1d13f22... |
import codecs
import os
import sys
from distutils.util import convert_path
from fnmatch import fnmatchcase
from setuptools import setup, find_packages
def read(fname):
return codecs.open(os.path.join(os.path.dirname(__file__), fname)).read()
# Provided as an attribute, so you can append to these instead
# of r... | {
"content_hash": "365efcfd2aab79bbfdadbcf56325b458",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 86,
"avg_line_length": 35.09285714285714,
"alnum_prop": 0.5623855078363525,
"repo_name": "ConsumerAffairs/django-eventlog-ca",
"id": "2389780c0f91c04437a3628845323f74782d7d6... |
import os
import sys
from pprint import pprint
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
import ccxt # noqa: E402
exchange = ccxt.poloniex({
#
# ↓ The "proxy" property setting below is for CORS-proxying only!
# Do not use it if... | {
"content_hash": "00c5fdcd9aba9b2138aa91b64dea951b",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 105,
"avg_line_length": 39.21621621621622,
"alnum_prop": 0.6815988973121985,
"repo_name": "ccxt/ccxt",
"id": "e9f851504fb2fb8a436ff1c9f681c272b78bac90",
"size": "1480",
"... |
import os
import sys
import tempfile
from argparse import ArgumentParser
from typing import Any
from django.conf import settings
from django.core.management.base import CommandError
from zerver.lib.export import export_realm_wrapper
from zerver.lib.management import ZulipBaseCommand
from zerver.models import Message,... | {
"content_hash": "54894efb40c6c49aab9a5bf28f000888",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 102,
"avg_line_length": 46.675824175824175,
"alnum_prop": 0.6136550912301354,
"repo_name": "brainwane/zulip",
"id": "0226b79e000a3a07f0c29e38cf066cbfdb75e3d0",
"size": "84... |
from __future__ import unicode_literals
from __future__ import print_function
from collections import OrderedDict
from doctest import DocTestCase
from io import StringIO
from math import ceil
import sys
import time
import traceback
from unittest.result import failfast
from unittest import TestCase
from green.output i... | {
"content_hash": "94e626d34e989baf3f2f8b0efefe7554",
"timestamp": "",
"source": "github",
"line_count": 801,
"max_line_length": 100,
"avg_line_length": 35.449438202247194,
"alnum_prop": 0.5440394435640078,
"repo_name": "CleanCut/green",
"id": "457504c5295924e2d88f532a72766b2f7bf0cbe7",
"size": "283... |
from flask_wtf.csrf import CsrfProtect
csrf = CsrfProtect()
| {
"content_hash": "5bce2de9822eb54c86694432391d9775",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 38,
"avg_line_length": 20.333333333333332,
"alnum_prop": 0.7868852459016393,
"repo_name": "bitmotive/flask-boilerplate",
"id": "7a1b09ba24d295c821a0b4c6621c5ef93dcf3fc5",
"s... |
import pushmanager.core.util
import tornado.gen
import tornado.web
from pushmanager.core.requesthandler import RequestHandler
class RequestServlet(RequestHandler):
@tornado.web.asynchronous
@tornado.web.authenticated
@tornado.gen.engine
def get(self):
request_id = pushmanager.core.util.get_in... | {
"content_hash": "6ca7a8131464e2fd9cbbebc010b3195b",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 83,
"avg_line_length": 28.74074074074074,
"alnum_prop": 0.5889175257731959,
"repo_name": "YelpArchive/pushmanager",
"id": "29c4d212e869f33e17a236e424bcdf15c979fc50",
"size"... |
from __future__ import division
import sys
import numpy as np
import scipy as sp
import scipy.optimize as opt
import time as time
from matplotlib import pyplot as plt
#DEMOGRAPHICS FUNCTIONS
def getDemographics(params, PrintAges, DiffDemog):
"""
Description:
-Imports data from csv files for initial populations, f... | {
"content_hash": "61a78efe0d67e0c369e531c35481ed46",
"timestamp": "",
"source": "github",
"line_count": 973,
"max_line_length": 237,
"avg_line_length": 36.77081192189106,
"alnum_prop": 0.6653250600927945,
"repo_name": "kerkphil/multi-country",
"id": "9e2d13a4ac6e4646e7fcfaa6668f56869d4c8b51",
"size... |
import datetime as dt
import itertools
import logging
import re
import urlparse
import bson
import pytz
import itsdangerous
from modularodm import fields, Q
from modularodm.exceptions import NoResultsFound
from modularodm.exceptions import ValidationError, ValidationValueError, QueryException
from modularodm.validato... | {
"content_hash": "747ff337de857f33c41a0f3b9dc880da",
"timestamp": "",
"source": "github",
"line_count": 1432,
"max_line_length": 157,
"avg_line_length": 36.50768156424581,
"alnum_prop": 0.6083130893857954,
"repo_name": "TomHeatwole/osf.io",
"id": "6e4e476596e73923e063b576b86dd2b75376af7e",
"size": ... |
import mysql.connector
def connect():
return mysql.connector.connect(user="root",password="wujixiaoo",database="suiyue")
| {
"content_hash": "558549102c67c045f3e6baa03cd7ed12",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 83,
"avg_line_length": 30.75,
"alnum_prop": 0.7804878048780488,
"repo_name": "oujiaqi/suiyue",
"id": "c17558ce1fab7b5d00fa5df8bfd75d973e1c785f",
"size": "170",
"binary": f... |
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "georef.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
| {
"content_hash": "b22a2a7aeb65705be1fb2aefc3b8238b",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 66,
"avg_line_length": 33,
"alnum_prop": 0.8,
"repo_name": "LKajan/georef",
"id": "6f7199894f842265d1b95d135c834352a2d25874",
"size": "166",
"binary": false,
"copies": "... |
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'Find Fruit',
# list of one or more... | {
"content_hash": "3b6e6f004af47a753515495f22154c31",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 144,
"avg_line_length": 31.86234817813765,
"alnum_prop": 0.4889453621346887,
"repo_name": "adaptivethreat/Empire",
"id": "57efe3079ab7c138ea03cdbd8fa38d768a1481d3",
"size"... |
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('stories', '0005_auto_20141221_1953'),
]
operations = [
migrations.AlterField(
model_name='story',
... | {
"content_hash": "0d3cec1dd3c1aadbec45502fa5f772d1",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 70,
"avg_line_length": 23.4,
"alnum_prop": 0.6175213675213675,
"repo_name": "klpdotorg/dubdubdub",
"id": "a8f12183bf840b5921d034b4d647928151515879",
"size": "492",
"binar... |
"""Wraps a Multigrid multiagent environment to be used as a dm_env."""
from typing import Any, Dict, List, Optional
import warnings
from acme import specs
from acme import types
from acme import wrappers
from acme.multiagent import types as ma_types
from acme.wrappers import multiagent_dict_key_wrapper
import dm_env
... | {
"content_hash": "78297e11e99baa8c433101cbfaf00a49",
"timestamp": "",
"source": "github",
"line_count": 300,
"max_line_length": 94,
"avg_line_length": 33.52,
"alnum_prop": 0.6938146380270486,
"repo_name": "deepmind/acme",
"id": "9c4b2287bbdb7c0512033dd175b7bc32a660e512",
"size": "10672",
"binary"... |
import os
import sys
import re
import time
import requests
from bioblend.galaxy import GalaxyInstance
from bioblend.galaxy import dataset_collections as collections
from bioblend import ConnectionError
from pyaccessories.TimeLog import Timer
import zipfile
class AutoSNVPhylError(ValueError):
"""Raise when a speci... | {
"content_hash": "54d64589535bdfa5d82a4b621a3ed766",
"timestamp": "",
"source": "github",
"line_count": 662,
"max_line_length": 123,
"avg_line_length": 41.11933534743203,
"alnum_prop": 0.5055288196612909,
"repo_name": "devonpmack/auto-SNVPhyl",
"id": "13557173fb32c4591ecc7e774b0235d324da03c0",
"siz... |
"""
This code is based on https://github.com/nwojke/deep_sort/blob/master/deep_sort/kalman_filter.py
"""
import numpy as np
import scipy.linalg
__all__ = ['KalmanFilter']
"""
Table for the 0.95 quantile of the chi-square distribution with N degrees of
freedom (contains values for N=1, ..., 9). Taken from MA... | {
"content_hash": "0dbf6ae1fce1b876f2c8195f17356039",
"timestamp": "",
"source": "github",
"line_count": 254,
"max_line_length": 96,
"avg_line_length": 38.09842519685039,
"alnum_prop": 0.5612276531983053,
"repo_name": "PaddlePaddle/models",
"id": "84c41ffd40960fc82a9611bc425857982f61ebaa",
"size": "... |
from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from argparse import ArgumentParser
from django.core.management.base import CommandError
from zerver.lib.actions import do_update_message_flags
from zerver.lib.management import ZulipBaseCommand
from zerver.models imp... | {
"content_hash": "63d699a716ef0acc4c74083397c6183a",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 91,
"avg_line_length": 39.69047619047619,
"alnum_prop": 0.5950809838032394,
"repo_name": "jrowan/zulip",
"id": "8b2215e1ca2bc41be8a8b8c3327af4a360a58cb1",
"size": "1667",
... |
""" Create a bin directory that symlinks the various scripts and
tools from my code repository.
"""
import sys, os
if __name__ == "__main__":
usage = "createBin.py [code-repo] [new-bin]"
symlinks = { # filename: linkname,
'alarm': 'alarm',
'centurion': 'centurion',
... | {
"content_hash": "1538a16337afacc8992d97ae7bf0cf57",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 64,
"avg_line_length": 29.836363636363636,
"alnum_prop": 0.47958561852528947,
"repo_name": "fretboardfreak/code",
"id": "0debaffe3edca1230cda11341c9fa47112d92564",
"size": ... |
from setuptools import setup
setup(name="multipool",
version="0.10.1",
description="Efficient multi-locus genetic mapping with pooled sequencing.",
author="Matt Edwards",
author_email="matted@mit.edu",
license="MIT",
url="https://github.com/matted/multipool",
packages=[],
... | {
"content_hash": "d67a4edb32d12d3e051d0777ada0f3eb",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 86,
"avg_line_length": 33.07142857142857,
"alnum_prop": 0.6414686825053996,
"repo_name": "matted/multipool",
"id": "cd1f450d52087458752a3e27d5ae04ff23e348b6",
"size": "485"... |
from __future__ import print_function
import os
import sys
import tempfile
from target_test import FileSystemTargetTestMixin
from helpers import with_config, unittest, skipOnTravis
from boto.exception import S3ResponseError
from boto.s3 import key
from moto import mock_s3
from moto import mock_sts
from luigi import... | {
"content_hash": "d04f9812f02e7b4aa947a05ea2467bdb",
"timestamp": "",
"source": "github",
"line_count": 544,
"max_line_length": 105,
"avg_line_length": 39.345588235294116,
"alnum_prop": 0.6276864137544385,
"repo_name": "republic-analytics/luigi",
"id": "96ae90646c553ff9786c3a24d5687bec6b69bd9f",
"s... |
"""
Copyright (C) 2015, MuChu Hsu
Contributed by Muchu Hsu (muchu1983@gmail.com)
This file is part of BSD license
<https://opensource.org/licenses/BSD-3-Clause>
"""
import os
import datetime
import re
import json
import logging
from scrapy import Selector
from cameo.utility import Utility
from cameo.localdb import Loc... | {
"content_hash": "ea9c4d20ffa7be08eb106f26e979ef1c",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 160,
"avg_line_length": 54.475806451612904,
"alnum_prop": 0.6712065136935603,
"repo_name": "muchu1983/104_cameo",
"id": "4a5c6e8b8f3f68894662f4112b03e2bcbc0996f5",
"size":... |
import importlib
import pickle as p
def process(task):
"""
Unele task-uri au nevoie de procesare inante de a fi trimise catre MQ
Procesatorul va adauga informatiile lipsa inainte de a face push.
"""
procesor = None
try:
procesor = importlib.import_module(
'jrunner.j... | {
"content_hash": "19e79e78d352f51444d993165fb981af",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 77,
"avg_line_length": 24.5,
"alnum_prop": 0.6469387755102041,
"repo_name": "gabriel-samfira/jrunner",
"id": "56a20abed589eb8d2e6199e02bd544b9a90cc187",
"size": "1097",
"... |
import sys
import os
from setuptools import setup
from distutils.sysconfig import get_python_lib
import yass
# Warn if we are installing over top of an existing installation. This can
# cause issues where files that were deleted from a more recent YASS are
# still present in site-packages.
overlay_warning = False
exi... | {
"content_hash": "92e911dad34bb51803934c8021c8d97a",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 105,
"avg_line_length": 33.6551724137931,
"alnum_prop": 0.657103825136612,
"repo_name": "mrnfrancesco/yass",
"id": "912c973d86e9095db39234d334558c1d90421f86",
"size": "2952... |
from __future__ import print_function, absolute_import, division
import sys
import os
import time
import datetime
import argparse
from Bio import SeqIO
###############################################################################
# FUNCTION DEFINITIONS
###############################################################... | {
"content_hash": "38496b059c0b74ef6138defcb3a5275f",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 79,
"avg_line_length": 30.320987654320987,
"alnum_prop": 0.48900651465798045,
"repo_name": "dacuevas/bioinformatics",
"id": "c47e99a480978fa48a528b694ca2612494bc8309",
"siz... |
import os
import qutip
import sys
import timeit
if len(sys.argv) != 3:
sys.exit("Please specify the maximum number of cores and qubits!")
num_cores = int(sys.argv[1]) # max number of cores
n = int(sys.argv[2]) # number of qubits
D = 2 ** n # total dimension
os.environ['OPENBLAS_NUM_T... | {
"content_hash": "d70b8fc7be1fb66b91326413cbf7e09a",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 70,
"avg_line_length": 24.96551724137931,
"alnum_prop": 0.6560773480662984,
"repo_name": "vsoftco/qpp",
"id": "06a72781185fd428fda6cbceadd16e0416440452",
"size": "784",
"... |
import numpy as np
from .utils.voronoi import voronoi_finite_polygons
class RandomPoints:
def __init__(self, points_number):
self.points_number = points_number
def generate(self, map_obj):
map_obj.points = np.random.random((self.points_number, 2))
class RelaxedPoints:
"""
Improve ... | {
"content_hash": "6b0a201d989a4142a1f5efa3593668fa",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 72,
"avg_line_length": 27.529411764705884,
"alnum_prop": 0.6303418803418803,
"repo_name": "Alerion/fantasy_map",
"id": "10b4b60e2d1e985f4d7adbf1d87c7fcb59e85d87",
"size": "... |
import numpy as np
import os, pdb
from hftools.testing import TestCase
class Test_1(TestCase):
readfun = None
basepath = None
dirname = None
extension = None
filename = "test1"
readpars = {"verbose":False}
def setUp(self):
self.facit_f = np.array([0, 1, 2, 3]) * 1e9
self.fa... | {
"content_hash": "af2a436e63a44cd947cb15f36a4b6acc",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 91,
"avg_line_length": 31.985915492957748,
"alnum_prop": 0.542492294143549,
"repo_name": "hftools/hftools",
"id": "10079b16450d733a2c445d7446a9a84fed0f2e6f",
"size": "2619"... |
import logging
import threading
from absl import flags as gflags
from ct.client import reporter
from Queue import Queue
FLAGS = gflags.FLAGS
gflags.DEFINE_integer("cert_db_writer_queue_size", 10, "Size of certificate "
"queue in db reporter")
class CertDBCertificateReport(reporter.CertificateR... | {
"content_hash": "a3fb89c0de7d78b63fc9508a3e58f094",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 78,
"avg_line_length": 33.559322033898304,
"alnum_prop": 0.5818181818181818,
"repo_name": "RJPercival/certificate-transparency",
"id": "86e66a19804171c259762de2abc14616adb6b6... |
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['tweet_me_screen'],
package_dir={'':'src'})
setup(**setup_args)
| {
"content_hash": "e80e301adc2990d74aa692c65d582cd9",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 60,
"avg_line_length": 27.666666666666668,
"alnum_prop": 0.7389558232931727,
"repo_name": "hawesie/strands_social",
"id": "888c2eeb83ae1f7b0583a827f78cf6cfaea067dc",
"size":... |
import json
import os
import shutil
import tempfile
import unittest
from telemetry.page import cloud_storage
from telemetry.page import page
from telemetry.page import page_set_archive_info
class MockPage(page.Page):
def __init__(self, url, name=None):
super(MockPage, self).__init__(url, None, name=name)
pag... | {
"content_hash": "2b2683de8a02f6096351b3b118d2a117",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 78,
"avg_line_length": 36.01639344262295,
"alnum_prop": 0.6739493248368988,
"repo_name": "chromium2014/src",
"id": "c288c7d121d66417d400e697b68b8664fda8c729",
"size": "675... |
import _plotly_utils.basevalidators
class LegendgroupValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="legendgroup", parent_name="bar", **kwargs):
super(LegendgroupValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "c14056a69be60c19815420cf1c47d5b5",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 79,
"avg_line_length": 37.5,
"alnum_prop": 0.6155555555555555,
"repo_name": "plotly/python-api",
"id": "51788b43d3d2baca24c7fc3d87e5f505df7e0f92",
"size": "450",
"binary"... |
"""
Command-line tool to inspect model embeddings.
"""
import argparse
import os
import sys
from typing import Iterable, Tuple
import mxnet as mx
import numpy as np
from . import constants as C
from . import model
from . import utils
from .data_io import tokens2ids
from .log import setup_main_logger
from .utils impor... | {
"content_hash": "ffa4484dbbc4a121ad3b2968550b8921",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 119,
"avg_line_length": 39.19402985074627,
"alnum_prop": 0.6618431073876618,
"repo_name": "mlperf/training_results_v0.6",
"id": "f87b7666c315f74f8dc5412d874b72a3be03840b",
... |
from google.cloud import aiplatform_v1beta1
def sample_list_model_versions():
# Create a client
client = aiplatform_v1beta1.ModelServiceClient()
# Initialize request argument(s)
request = aiplatform_v1beta1.ListModelVersionsRequest(
name="name_value",
)
# Make the request
page_re... | {
"content_hash": "4242f4bf33b2cf6401e333e4dc4d8c85",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 72,
"avg_line_length": 26.45,
"alnum_prop": 0.720226843100189,
"repo_name": "googleapis/python-aiplatform",
"id": "e04c1742e1e14e1cb8a316bb5db4885964a7f5f5",
"size": "1932"... |
import csv
from cStringIO import StringIO
from scrapy.link import Link
from .base import BaseLinkExtractor
# see http://docs.python.org/2/library/csv.html#csv-fmt-params
_FORMAT_PARAMETERS = (
('delimiter', ','),
('quotechar', '"'),
('doublequote', True),
('escapechar', None),
('lineterminator', ... | {
"content_hash": "4fd51ccc8ad4ee1c6eed7914a99d807d",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 102,
"avg_line_length": 32.857142857142854,
"alnum_prop": 0.6252173913043478,
"repo_name": "asa1253/portia",
"id": "714208a021d842c578f67a8b47cc11d27715c74c",
"size": "1150... |
import logging
import re
import os
import sys
import getopt
import xml.etree.ElementTree as et
pathList={}
class Test:
def main(self,argv):
try:
opts,args=getopt.getopt(argv[1:],"hl:f:d:")
except getopt.GetoptError:
... | {
"content_hash": "715f96d9709e07e86914a328b55db80c",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 67,
"avg_line_length": 32.02777777777778,
"alnum_prop": 0.35559410234171723,
"repo_name": "EffectHub/effecthub",
"id": "e3d97be91797e04ea4125c49e9aabc924e1ea276",
"size": "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.