text
stringlengths
4
1.02M
meta
dict
from distutils.core import setup from setuptools import find_packages PACKAGES = find_packages() setup( name='letsencrypt-appengine', version='1.0', description=( "A Django app to make letsencrypt SSL certificates easier to create/renew on Google App Engine." ), author='Adam Alton', a...
{ "content_hash": "6a9a8f101181992c50b35f8c11e709c7", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 104, "avg_line_length": 26.105263157894736, "alnum_prop": 0.6975806451612904, "repo_name": "adamalton/letsencrypt-appengine", "id": "0224b56b6f663a356a57eb5344cb2b689d3b1185"...
import io from steel.common import meta, args, fields from steel.fields import Field from steel.base import Structure from steel.fields.strings import Bytes __all__ = ['Chunk', 'Payload', 'ChunkList', 'ChunkStreamer'] class ChunkMetaclass(meta.DeclarativeMetaclass): def __init__(cls, name, bases, att...
{ "content_hash": "72bbbc7cc03ac6c351d13dde33339c0c", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 87, "avg_line_length": 35.44444444444444, "alnum_prop": 0.5618661257606491, "repo_name": "gulopine/steel", "id": "883dfc817a2f93a19f933a2093eb1d42be751846", "size": "5423"...
'''Module that configures setuptools to package libthumbor''' from setuptools import setup, find_packages from libthumbor import __version__ tests_require = [ 'mock', 'nose', 'coverage', 'yanc', 'preggy', 'ipdb', 'coveralls', 'thumbor', ] setup( name = 'libthumbor', version = ...
{ "content_hash": "09b2ab2a4597cf9bbb5b02f57823b0ca", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 70, "avg_line_length": 29.166666666666668, "alnum_prop": 0.5726984126984127, "repo_name": "webus/libthumbor", "id": "607605c74ddd1bd1cf620ff42b9fb9f7bc1c6400", "size": "184...
class Parameter: """Defines a parameter with a name and a value. Must provide a name and value. Parameters have a generic metadata property stored as a dictionary. .. code-block:: python parameter = Parameter('warp speed', 9.0, {'max': 10.0}) parameter.name #=> 'warp speed' paramete...
{ "content_hash": "bd978af6d1c015fc946c4a00aab93b50", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 71, "avg_line_length": 22.473684210526315, "alnum_prop": 0.5448868071818892, "repo_name": "razor-x/dichalcogenides", "id": "d386544879e9ccbc9052e47501eaa445e1c23fa0", "size...
"""Test runner for typeshed. Depends on mypy being installed. Approach: 1. Parse sys.argv 2. Compute appropriate arguments for mypy 3. Stuff those arguments into sys.argv 4. Run mypy.main('') 5. Repeat steps 2-4 for other mypy runs (e.g. --py2) """ import os import re import sys import argparse parser = argparse.A...
{ "content_hash": "d491836a7aaacb1cb50b641cbb84058e", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 97, "avg_line_length": 35.85, "alnum_prop": 0.5097629009762901, "repo_name": "srusskih/SublimeJEDI", "id": "48ad62e98a2ea72c9e5d72d387cdc3dd4bea829e", "size": "5759", "b...
from django.conf import settings from django.conf.urls import patterns, url, include from django.conf.urls.static import static from haystack.views import FacetedSearchView from haystack.forms import FacetedSearchForm from haystack.query import SearchQuerySet # Uncomment the next two lines to enable the admin: from cm...
{ "content_hash": "cc53158b3958b0f3f28682d0b812445f", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 79, "avg_line_length": 32.47899159663866, "alnum_prop": 0.5981888745148771, "repo_name": "arpitprogressive/arpittest", "id": "1094bf79e2d4559e535bfbfa4e75983777562ba3", "s...
from enum import Enum from azure.core import CaseInsensitiveEnumMeta class AssessmentStatusCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Programmatic code for the status of the assessment.""" #: The resource is healthy HEALTHY = "Healthy" #: The resource has a security issue that needs to be...
{ "content_hash": "f45a817b4bdfb3fbb9040bd103f220f5", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 100, "avg_line_length": 41.70124481327801, "alnum_prop": 0.7340298507462687, "repo_name": "Azure/azure-sdk-for-python", "id": "4326c66f40e8fdbb1ae13f91212f4cfd6a8e1d45", "...
""" Bootstrapper for test framework plugins. The entire rationale for this system is to get the modules in plugin/ imported without importing all of the supporting library, so that we can set up things for testing before coverage starts. The rationale for all of plugin/ being *in* the supporting library in the first ...
{ "content_hash": "fb47307e9ba305d65c974c2a512937b4", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 74, "avg_line_length": 32.883720930232556, "alnum_prop": 0.7475247524752475, "repo_name": "zzzeek/sqlalchemy", "id": "f93b8d3e629eca50e60a73f8bcc6268d2fe997de", "size": "14...
import datetime import json import os import sys import mysql.connector from mysql.connector import Error from tweepy import OAuthHandler from tweepy import Stream from tweepy.streaming import StreamListener from svm import Classifier from location import Location import settings os.environ['TZ'] = 'Asia/Jakarta' ...
{ "content_hash": "15938ca891fdc1b4f26fcc4fc7552c67", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 159, "avg_line_length": 42.180851063829785, "alnum_prop": 0.5604035308953341, "repo_name": "dwiajik/twit-macet-mining-v2", "id": "a2d8c643370189a92a00bbd6c0caad89579d90a3", ...
from .base_resource import BaseMediaResource, parse_media_id from synapse.http.servlet import parse_string, parse_integer from synapse.http.server import request_handler from twisted.web.server import NOT_DONE_YET from twisted.internet import defer import logging logger = logging.getLogger(__name__) class Thumbnai...
{ "content_hash": "fd67ab63ebf9fd2d1af677dfb2892a42", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 79, "avg_line_length": 39.55865921787709, "alnum_prop": 0.548086428470555, "repo_name": "illicitonion/synapse", "id": "1dadd880b27f44be2c0b396a08a2cef7b42f78d8", "size": "...
class ConfigurationError(Exception): """Raised when the cache isn't configured correctly.""" class QueueEmpty(Exception): """Raised when a connection cannot be acquired."""
{ "content_hash": "7c66dac6bcec039b8fa0131e62b1008d", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 59, "avg_line_length": 30.5, "alnum_prop": 0.73224043715847, "repo_name": "citrix-openstack-build/oslo.cache", "id": "3fb31c441f768b64902b48048e7a913a9c733845", "size": "770...
from __future__ import print_function, unicode_literals from future.builtins import input, open import os import re import sys from functools import wraps from getpass import getpass, getuser from glob import glob from contextlib import contextmanager from posixpath import join import boto.ec2 import boto.route53 fro...
{ "content_hash": "643823c801826cdd65fed84115eecef0", "timestamp": "", "source": "github", "line_count": 631, "max_line_length": 78, "avg_line_length": 30.253565768621236, "alnum_prop": 0.5776846516500785, "repo_name": "diogobaeder/giva", "id": "9177252f28c1675632c346f56407f163e5bc4be3", "size": "19...
from django.urls import reverse from django.contrib.auth.decorators import login_required, permission_required from django.shortcuts import redirect, render from django.views.decorators.http import require_POST from django.utils.translation import ugettext as _ from django.http import HttpRequest from course.models im...
{ "content_hash": "84b7461d83ef01e62f68a7a11361648d", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 94, "avg_line_length": 27.229166666666668, "alnum_prop": 0.608645753634277, "repo_name": "fsr/course-management", "id": "e2f3828b10ad17e37162b64c389684c2949b157a", "size": ...
from pso import pso from optitestfuns import ackley import unittest import math intVar = [] result = pso(ackley, [-5,-5], [5,5], intVar) print(result.exit) print('x_opt: {}'.format(result.xopt)) print('FO: {:2e}'.format(result.FO))
{ "content_hash": "43f3f27eb4d6632941682e1549659a70", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 44, "avg_line_length": 19.5, "alnum_prop": 0.6923076923076923, "repo_name": "CAChemE/stochastic-optimization", "id": "31074cf79232eb947d4c05669f893445039be22a", "size": "23...
import json from sqlalchemy import ( and_, Boolean, Column, Integer, String, Text, ) from sqlalchemy.ext.declarative import declared_attr from sqlalchemy.orm import foreign, relationship from superset import utils from superset.models.core import Slice from superset.models.helpers import AuditMixinNullable, Impor...
{ "content_hash": "f4147bc34a0681e07201682a65f80f7c", "timestamp": "", "source": "github", "line_count": 303, "max_line_length": 78, "avg_line_length": 30.933993399339933, "alnum_prop": 0.5939400405419822, "repo_name": "alanmcruickshank/superset-dev", "id": "8042ac9c1e03725fad973450bcebed0f4e63e8ca", ...
from django.db import models import common import ptree.constants as constants from django.template import defaultfilters import random from urlparse import urljoin from django.conf import settings class BaseExperiment(models.Model): """ Base class for all Experiments. """ name = models.CharField(max_...
{ "content_hash": "907b164ebc86a8142ba1020d55b08b83", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 95, "avg_line_length": 37.707692307692305, "alnum_prop": 0.5622195022439821, "repo_name": "pombredanne/django-ptree", "id": "6283f5ca572d39896fb9280bc8595878f4c7e5da", "siz...
""" Disk File Interface for the Swift Object Server The `DiskFile`, `DiskFileWriter` and `DiskFileReader` classes combined define the on-disk abstraction layer for supporting the object server REST API interfaces (excluding `REPLICATE`). Other implementations wishing to provide an alternative backend for the object se...
{ "content_hash": "84d4e665f9984137b5f1a27c83eafeb9", "timestamp": "", "source": "github", "line_count": 3348, "max_line_length": 79, "avg_line_length": 41.75776583034648, "alnum_prop": 0.5781266764421873, "repo_name": "notmyname/swift", "id": "362b3a3f34084c550bc9f2fe2c5e5cba049f05c6", "size": "140...
""" Brute force contiguity builders used for testing results of parallel algorithms """ _author_ = "Serge Rey <sjsrey@gmail.com>" import pysal as ps import numpy as np from itertools import combinations #sf = ps.open(ps.examples.get_path("nat.shp")) #sf = ps.open(ps.examples.get_path("columbus.shp")) #sf = ps.open(p...
{ "content_hash": "7d68101306237e96b273ec2f83eb0ea3", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 68, "avg_line_length": 26.772727272727273, "alnum_prop": 0.5206564799094511, "repo_name": "pysal/pPysal", "id": "7071998d51f3a55637952b543d21bf3f0a6ca073", "size": "3535",...
import itk from sys import argv itk.auto_progress(2) reader = itk.ImageFileReader.IUC2.New(FileName=argv[1]) filter = itk.SmoothingRecursiveGaussianImageFilter.New( reader, Sigma=eval(argv[3])) itk.imwrite(filter, argv[2])
{ "content_hash": "c513ae0c79534ee18144178cb3ee5138", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 55, "avg_line_length": 25.77777777777778, "alnum_prop": 0.7586206896551724, "repo_name": "malaterre/ITK", "id": "da956f812111beedf6ade22bfd1392234eb411f7", "size": "1057", ...
r""" For usage and a list of options, try this: $ python wpadmin.py -h This program lives here: https://github.com/raulchacon/wpadmin.py """ __version__ = '0.1.1' import os from functools import wraps class NotInWordPressRootError(Exception): def __init__(self, value): self.value = value def __str_...
{ "content_hash": "1c74f90d6d1e51afefd9d5082f026f38", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 82, "avg_line_length": 29.641221374045802, "alnum_prop": 0.603399433427762, "repo_name": "raulchacon/wpadmin.py", "id": "690ec52d0400f86a697595c661930ad3bcf635da", "size":...
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GL import _types as _cs # End users want this... from OpenGL.raw.GL._types import * from OpenGL.raw.GL import _errors from OpenGL.constant import Constant as _C import ctypes _...
{ "content_hash": "e1c5d54734932a9c7dfb65bcda643002", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 117, "avg_line_length": 39.625, "alnum_prop": 0.7555205047318612, "repo_name": "alexus37/AugmentedRealityChess", "id": "3615c9599622e57788dc8e9336cc9464c27fce48", "size": "...
import scrapy import astatsscraper.parsing import astatsscraper.pipelines # Info on spiders with args: # http://doc.scrapy.org/en/latest/topics/spiders.html#spider-arguments A_STATS_OWNED_GAMES_URL_BASE = 'https://astats.astats.nl/astats/User_Games.php?SPL=0&CTO=0&Limit=0&ToPlay=0&PerfectOnly=0&Hidden=0&AchievementsO...
{ "content_hash": "a92f853af7b50f9f549afb6f394d47be", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 181, "avg_line_length": 37.476190476190474, "alnum_prop": 0.7331639135959339, "repo_name": "SingingTree/AStatsScraper", "id": "704c46de1c7aa7b47dae405d379c741c16679be3", "s...
import logging logging.basicConfig(level=logging.ERROR) from pyblog.storage.qiniu_storage import QiniuStorageAdapter from pyblog.storage.storage_abstract import StorageAbstractAdapter from collections import deque class NoStorageDriverError(Exception): pass class StorageDriverFactory(object): __drivers = {'...
{ "content_hash": "94b74e88842953a173cab25ebbffbaa0", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 96, "avg_line_length": 34.03409090909091, "alnum_prop": 0.6143572621035058, "repo_name": "free-free/pyblog", "id": "5c2ab547c70a6ef7e475a35cbbf66248d590cdf6", "size": "3017...
import sys import os import shlex from pyhaystack import info # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # sys.path.insert(0...
{ "content_hash": "e2764830b9ec9b785c765f33b208b521", "timestamp": "", "source": "github", "line_count": 359, "max_line_length": 81, "avg_line_length": 31.754874651810585, "alnum_prop": 0.6952631578947368, "repo_name": "ChristianTremblay/pyhaystack", "id": "cce2ebb70af535d81b0afb61288f7068bebfc4f5", ...
"""Test the allgather API on a distributed Ray cluster.""" import pytest import ray import cupy as cp import torch from ray.util.collective.tests.util import ( create_collective_multigpu_workers, init_tensors_for_gather_scatter_multigpu, ) @pytest.mark.parametrize("tensor_backend", ["cupy", "torch"]) @pytes...
{ "content_hash": "d933d144c91ee4ce4ee24dc1d006878d", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 87, "avg_line_length": 34.93103448275862, "alnum_prop": 0.5725567620927937, "repo_name": "ray-project/ray", "id": "74ea2ebc11df2f7668d906f66130e8d9fe664e33", "size": "3039"...
from __future__ import print_function, division from builtins import range # Note: you may need to update your version of future # sudo pip install -U future import numpy as np import matplotlib.pyplot as plt N = 4 D = 2 # XOR X = np.array([ [0, 0], [0, 1], [1, 0], [1, 1], ]) T = np.array([0, 1, 1, ...
{ "content_hash": "0f0888e5eb001dd2139bba911a1752e9", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 74, "avg_line_length": 18.291666666666668, "alnum_prop": 0.6203492786636294, "repo_name": "balazssimon/ml-playground", "id": "ca39f0b525d974ede3379f6a4892d2d17b18e860", "si...
""" Usage: cm-tasks menu cm-tasks queue cm-tasks start cm-tasks stop cm-tasks halt cm-tasks kill """ from docopt import docopt import os import sys from cloudmesh.util.menu import ascii_menu def hallo(): print "hallo" def celery_start(): os.system("celery...
{ "content_hash": "623e1614b74a00945646fc22e9c76d3c", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 78, "avg_line_length": 18.26027397260274, "alnum_prop": 0.5723930982745686, "repo_name": "rajpushkar83/cloudmesh", "id": "d39db77319c57de846ac4fe0405b42b03ac4aac8", "size":...
import sys import warnings import functools import operator import numpy as np from numpy.core._multiarray_tests import array_indexing from itertools import product from numpy.testing import ( assert_, assert_equal, assert_raises, assert_array_equal, assert_warns, HAS_REFCOUNT, ) class TestIndexing: ...
{ "content_hash": "95bfd1e4646caaceccd433fd4b1a4016", "timestamp": "", "source": "github", "line_count": 1296, "max_line_length": 79, "avg_line_length": 38.00925925925926, "alnum_prop": 0.5296995533901746, "repo_name": "WarrenWeckesser/numpy", "id": "4bb5cb11ac3c856d86ae37f47075fb76b6e53aa4", "size"...
""" Django settings for todosite project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) i...
{ "content_hash": "e7d41fcc4c5af792b1535d0817e6fec5", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 71, "avg_line_length": 24.738636363636363, "alnum_prop": 0.7253100597152045, "repo_name": "KellyChan/python-examples", "id": "8358813c665adb223447654381f6aeb1182436bc", "si...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('info_timers', '0003_auto_20150228_1213'), ] operations = [ migrations.AddField( model_name='timer', name='auto_remove', ...
{ "content_hash": "c74f517899224463013fe4174d9d1822", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 53, "avg_line_length": 24.4, "alnum_prop": 0.5655737704918032, "repo_name": "ojarva/home-info-display", "id": "4704834dbd079b1b8b4cce04020c87dfc0003d9e", "size": "634", "...
from setuptools import setup import re VERSIONFILE="pymailinator/_version.py" verstrline = open(VERSIONFILE, "rt").read() VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]" mo = re.search(VSRE, verstrline, re.M) if mo: verstr = mo.group(1) major, minor, patch = verstr.split('.') release = "%s.%s" %(major, minor)...
{ "content_hash": "992fa42cba00cdbd166f0f4ea653aba1", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 79, "avg_line_length": 35.146341463414636, "alnum_prop": 0.6190145732130465, "repo_name": "mc706/py-mailinator", "id": "ee3b16e2e758e3311c19f5bc4450fe389777ea7e", "size": "...
try: from pipeline.component.nn.backend.fate_torch import nn, init, operation, optim, serialization except ImportError: nn, init, operation, optim, serialization = None, None, None, None, None __all__ = ['nn', 'init', 'operation', 'optim', 'serialization']
{ "content_hash": "bc9740c328f009fa0934dbc375810c1e", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 98, "avg_line_length": 44.333333333333336, "alnum_prop": 0.7030075187969925, "repo_name": "FederatedAI/FATE", "id": "52d08399b47aa9761cdff49b36c6b35081589ae3", "size": "266"...
from django.core.serializers import json from python import Deserializer json.PythonDeserializer = Deserializer from django.core.serializers.json import *
{ "content_hash": "32cece429f9f36d638e3f0b495339c5c", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 42, "avg_line_length": 38.75, "alnum_prop": 0.8516129032258064, "repo_name": "certik/chess", "id": "16c6bf6b27d64aebb7006745b72e613a8dbc09fc", "size": "155", "binary": fal...
import sys, os, tarfile from ftplib import FTP from src.utils import select_files, get_local_timestamp, get_remote_timestamp, \ update_progress, create_folder, is_compressed, is_tgz, is_gz, \ extract_gz, extract_tar from src.exceptions import ConnectionException, FtpPathExcep...
{ "content_hash": "ef20d1244617699b51f155e722760ec9", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 102, "avg_line_length": 41.51652892561984, "alnum_prop": 0.5602667462924256, "repo_name": "psikon/pyBlastDB", "id": "9dbad579268a6219da224b0af749c5180f6d8053", "size": "10...
__name__ = 'datatableview' __author__ = 'Tim Valenta' __version_info__ = (0, 8, 3) __version__ = '.'.join(map(str, __version_info__)) __date__ = '2013/11/14 2:00:00 PM' __credits__ = ['Tim Valenta', 'Steven Klass'] __license__ = 'See the file LICENSE.txt for licensing information.'
{ "content_hash": "d701be3d0c5a856c2077031652a846bf", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 67, "avg_line_length": 40.42857142857143, "alnum_prop": 0.607773851590106, "repo_name": "annabed/django-datatable-view", "id": "43ccc3ba69b3b0bc6dc2cd54335edde0a7f5bbbe", "s...
from datetime import date, datetime, timedelta from django.conf import settings from django.db import models from django.utils import timezone from django.utils.translation import ugettext as _ User = settings.AUTH_USER_MODEL DURATION = 30 # summer starts 1st June, ends 15th August SUMMER = ((6, 1), (8, 15)) # winte...
{ "content_hash": "2d94d365c6dfe54855b200bc9fa1e587", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 116, "avg_line_length": 36.588235294117645, "alnum_prop": 0.6446945337620579, "repo_name": "dotKom/onlineweb4", "id": "423eb0fa2765042f549325fdb5400d6fc72d6cef", "size": "...
""" WSGI config for travel_itinerary 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.7/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "travel_itinerary.settings") ...
{ "content_hash": "ff8d46541beb1003a25d9cc8343b3745", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 29.071428571428573, "alnum_prop": 0.7788697788697788, "repo_name": "lwl27/travel_itinerary", "id": "7685fa7f3a42703fb167483eb04126bca5e17294", "size"...
class Security: def __init__(self): import os env = os.environ if env.has_key('PYTHON_KEYFILE'): keyfile = env['PYTHON_KEYFILE'] else: keyfile = '.python_keyfile' if env.has_key('HOME'): keyfile = os.path.join(env['HOME'], keyfile) if not os.path.exists(keyfile): import sys for dir in ...
{ "content_hash": "8154e607829b92d81ea3ccf62e9ecb46", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 60, "avg_line_length": 26, "alnum_prop": 0.662004662004662, "repo_name": "OS2World/APP-INTERNET-torpak_2", "id": "0ffd511a079d5a0895d8207d2e319da1b621b16f", "size": "858", ...
from __future__ import unicode_literals from django.db import models class Server(models.Model): name = models.CharField( null=True, blank=True, max_length=500 ) ip = models.CharField( null=True, blank=True, max_length=500 )
{ "content_hash": "8450b862c12a0a574d1d3195c7d90058", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 39, "avg_line_length": 17.235294117647058, "alnum_prop": 0.5836177474402731, "repo_name": "prontodev/stillwithus", "id": "e81abbb9b1e7d9a34e87bd52a5023781c8e90382", "size":...
"""Temporary files. This module provides generic, low- and high-level interfaces for creating temporary files and directories. The interfaces listed as "safe" just below can be used without fear of race conditions. Those listed as "unsafe" cannot, and are provided for backward compatibility only. This module...
{ "content_hash": "fa78390c30514c6ae96c878deab6e8a1", "timestamp": "", "source": "github", "line_count": 622, "max_line_length": 78, "avg_line_length": 30.909967845659164, "alnum_prop": 0.579735774472069, "repo_name": "jt6562/XX-Net", "id": "e6843faee887b00d2a81304a28c4a573d9fb080a", "size": "19226"...
import sys import argparse def main(): parser = argparse.ArgumentParser() parser.add_argument( 'source_file', nargs='?', type=argparse.FileType('r'), default=sys.stdin ) parser.add_argument( '-v', '--version', action='version', version...
{ "content_hash": "00f048f06fb3361a4b72e149e4ffec03", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 38, "avg_line_length": 17.45945945945946, "alnum_prop": 0.5108359133126935, "repo_name": "wangyanxi/web-demos", "id": "5def48835066ca7a4daac1df86bd7fdb77dc15df", "size": "6...
''' @author: Frank ''' import unittest from kvmagent import kvmagent from kvmagent.plugins import vm_plugin class Test(unittest.TestCase): def testName(self): cmd = vm_plugin.StartVmCmd() cmd.bootDev = 'hd' cmd.cpuNum = 2 cmd.cpuSpeed = 2600 cmd.dataVolumePath = ['/tmp/d...
{ "content_hash": "ee5bd1f0fe85a26f181061520d9e297c", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 93, "avg_line_length": 26.065217391304348, "alnum_prop": 0.5654712260216848, "repo_name": "mrwangxc/zstack-utility", "id": "7f56277a65f5ace26babc5b36131541277bd0883", "size...
from django.core import management if __name__ == "__main__": management.execute_from_command_line()
{ "content_hash": "64cdbaf6ac9ec0b5e328c7dcbe445414", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 42, "avg_line_length": 26.5, "alnum_prop": 0.6792452830188679, "repo_name": "aniketpuranik/pynet_test", "id": "d97c024c5baa8c01debb3571eec83fd132922861", "size": "152", "b...
""" RimuHosting Driver """ try: import simplejson as json except ImportError: import json from libcloud.common.base import ConnectionKey, JsonResponse from libcloud.common.types import InvalidCredsError from libcloud.compute.types import Provider, NodeState from libcloud.compute.base import NodeDriver, NodeSiz...
{ "content_hash": "437f1b051788063e302be0eae0b7684a", "timestamp": "", "source": "github", "line_count": 323, "max_line_length": 79, "avg_line_length": 35.11145510835913, "alnum_prop": 0.5570055550656908, "repo_name": "kun--hust/libcloud_with_cn", "id": "acde57433680b2cece3cae06848062405a86c504", "s...
import os,sys import time home_dir =os.getenv("DRC_BASE") sys.path.append(home_dir + "/software/build/lib/python2.7/site-packages") sys.path.append(home_dir + "/software/build/lib/python2.7/dist-packages") import math import numpy as np import lcm from bot_core.pose_t import pose_t import time import drc_utils as bot...
{ "content_hash": "c2de979247012dd34eed0ba62668fa51", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 73, "avg_line_length": 23.785714285714285, "alnum_prop": 0.7222222222222222, "repo_name": "openhumanoids/oh-distro", "id": "b681f73ddc038025cb266d6c5c828c312676c7b5", "size...
import collections import io import sys import unittest def orderly(words): unique = [] counted = collections.Counter() for word in words: if word not in counted: unique.append(word) counted[word] += 1 return unique, counted def main(): n = int(input().strip()) wo...
{ "content_hash": "d43d93346a6af23b1ccac0b6d193431d", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 70, "avg_line_length": 24.904761904761905, "alnum_prop": 0.5793499043977055, "repo_name": "altermarkive/Coding-Interviews", "id": "b142b4d9e839d76741f6f4c3ed379fadb89ab890", ...
"""Package for managing security groups in AWS""" from .create_securitygroup import SpinnakerSecurityGroup from .destroy_sg import *
{ "content_hash": "aa3d021f493c7e02b7f7954198986d1e", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 56, "avg_line_length": 44.333333333333336, "alnum_prop": 0.8045112781954887, "repo_name": "gogoair/foremast", "id": "12d5107d879b1367c8b66a28bc898f7567cd5335", "size": "760"...
import csv import sys import codecs import requests from bs4 import BeautifulSoup import os import time def UnicodeDictReader(): with open('Artworks.csv', 'rb') as csvfile: csv_reader = csv.DictReader(csvfile) for row in csv_reader: yield dict([(key, unicode(value, 'utf-8')) for key, value in row.iter...
{ "content_hash": "5089071204d71d38609aed4822758092", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 84, "avg_line_length": 27.40625, "alnum_prop": 0.6305587229190421, "repo_name": "darenr/art-dataset-nlp-experiments", "id": "36a4a088babe0e8f246a84b9c02f27d01f269c62", "siz...
import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error f...
{ "content_hash": "b1361edee269dc052d31c075fe72e9c6", "timestamp": "", "source": "github", "line_count": 375, "max_line_length": 218, "avg_line_length": 45.55733333333333, "alnum_prop": 0.657106064153594, "repo_name": "Azure/azure-sdk-for-python", "id": "ba6078759086a5779262d8b7fab37f8845e3a712", "s...
"""Setup for data structures.""" from setuptools import setup extra_packages = { 'testing': ['ipython', 'pytest', 'pytest-watch', 'pytest-cov', 'tox'] } setup( name='Data structures', description='Python implementation of various data structures.', version='0.1', author='Sean Beseler, Morgan Nomur...
{ "content_hash": "4ea6b46a5d54e926df21d12d46109b8e", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 73, "avg_line_length": 27.15, "alnum_prop": 0.6519337016574586, "repo_name": "morganelle/data-structures", "id": "5cd7e9640e6a9a6cf0093d7fd743ccd2a34ad508", "size": "543", ...
""" homeassistant.components.device_tracker.ubus ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Device tracker platform that supports scanning a OpenWRT router for device presence. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.ubus/ """ imp...
{ "content_hash": "e6e52269909156ef1b2055e8ba322cd5", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 79, "avg_line_length": 32.641618497109825, "alnum_prop": 0.5519744997343722, "repo_name": "caiuspb/home-assistant", "id": "0355680a31da87e0b4759c42ee1dac15951ad150", "size...
from django.db import models, migrations from decimal import Decimal import dezede.models import django.db.models.deletion from django.conf import settings import image_cropping.fields import libretto.models.base class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(sett...
{ "content_hash": "da6125f5dee8aabb860c856663f985b9", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 393, "avg_line_length": 73.06818181818181, "alnum_prop": 0.6289269051321928, "repo_name": "dezede/dezede", "id": "5da71efba64085dc9245bdcf560a306996675448", "size": "3215",...
"""Class of Augeas Configurators.""" import logging import augeas from letsencrypt import errors from letsencrypt import reverter from letsencrypt.plugins import common from letsencrypt_apache import constants logger = logging.getLogger(__name__) class AugeasConfigurator(common.Plugin): """Base Augeas Configu...
{ "content_hash": "7156c0cde456528dceae02a1b2da795d", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 79, "avg_line_length": 36.03414634146341, "alnum_prop": 0.6005144172194395, "repo_name": "mitnk/letsencrypt", "id": "9b51c32a9a0eaac32477a13cb2c71ba18aa32ab6", "size": "73...
"""Implementation of seq2seq model. The model is based on: https://github.com/google/flax/tree/main/examples/seq2seq """ import logging import numpy as np from typing import Tuple from typing import Any from functools import partial import jax import jax.numpy as jnp from jax import random from flax import linen as ...
{ "content_hash": "ed573f8126e958d36c13d23a0ae66cf0", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 80, "avg_line_length": 33.61194029850746, "alnum_prop": 0.6039076376554174, "repo_name": "google/evojax", "id": "11ba39b106ca323d6b110bf688ef4ec1f6fce97d", "size": "7340",...
"""Code for encoding protocol message primitives. Contains the logic for encoding every logical protocol field type into one of the 5 physical wire types. This code is designed to push the Python interpreter's performance to the limits. The basic idea is that at startup time, for every field (i.e. every FieldDescrip...
{ "content_hash": "2d1ca11ea3f3fedf7ad55b8ef3c106f7", "timestamp": "", "source": "github", "line_count": 796, "max_line_length": 80, "avg_line_length": 32.65577889447236, "alnum_prop": 0.6682696006770793, "repo_name": "dstrockis/outlook-autocategories", "id": "80e59cab0adecaf245786cde94d00e019e5a7a76"...
from twython import Twython from easy_twitter.models import Settings def get_tweets(account): feed_account = Settings.objects.get(display_name=account) twitter = Twython(feed_account.consumer_key, feed_account.consumer_secret, feed_account.access_token, feed_account.access_token_secret) time_line =...
{ "content_hash": "721a0476934d8d4155f4e3fdcf49f044", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 199, "avg_line_length": 38.75, "alnum_prop": 0.75, "repo_name": "publicFunction/django-easy-twitter", "id": "91862464e8a5ad2422cc200d2f6ed8350f9362bb", "size": "620", "bi...
""" urlresolver XBMC Addon Copyright (C) 2011 t0mm0 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ...
{ "content_hash": "76403794a09e69d1012cf0d014aa91cf", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 141, "avg_line_length": 35.552083333333336, "alnum_prop": 0.5915616759449165, "repo_name": "TheWardoctor/Wardoctors-repo", "id": "fedf8a002379bf67960a8873eb3297b3a024fe0a", ...
from __future__ import unicode_literals import datetime from django.db import migrations, models import jobs.models class Migration(migrations.Migration): dependencies = [ ('jobs', '0027_auto_20160209_1709'), ] operations = [ migrations.AlterField( model_name='invitationcode...
{ "content_hash": "3c80aab3c281340bbdc63f3c04cab9c7", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 126, "avg_line_length": 31.057142857142857, "alnum_prop": 0.6016559337626495, "repo_name": "Santiago-vdk/jabbs", "id": "c0ab6458f0f8b6983ea43bbf3e23066b871daab5", "size": "...
""" H. Déjean copyright Xerox 2016 READ project mine a document (itemset generation) """ from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import sys, os.path sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(sys.arg...
{ "content_hash": "cba4f409bff5d53563acf7f4a8667d81", "timestamp": "", "source": "github", "line_count": 2163, "max_line_length": 308, "avg_line_length": 40.65695792880259, "alnum_prop": 0.5082953343719084, "repo_name": "Transkribus/TranskribusDU", "id": "6238aa2b80c58da2d76d51aa01701b9bb24173d4", "...
from __future__ import absolute_import import logging import re from django.core.urlresolvers import RegexURLResolver, RegexURLPattern from django.conf.urls import patterns, include, url from sentry.plugins import plugins logger = logging.getLogger('sentry.plugins') def ensure_url(u): if isinstance(u, (tuple,...
{ "content_hash": "61dd0c5852792a542f23690d3bc82f3f", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 97, "avg_line_length": 26.227272727272727, "alnum_prop": 0.6013864818024264, "repo_name": "JackDanger/sentry", "id": "63425aaae2f5af3aa8ec23da43d3a59db3c9bf85", "size": "11...
config = dict( port='8009', friendly_name='BitRanks', app_dir='sigtrac', name='sigtrac', user='sigtrac', env='env', settings='settings.py.prod', db='sigtrac', db_user='sigtrac', db_host='localhost', custom_domains='sigtrac.nyaruka.com www.bitranks.com bitranks.com', # compress=True, ...
{ "content_hash": "10c8b25746e1d14a6ae7190d7f0662bc", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 70, "avg_line_length": 24, "alnum_prop": 0.6398809523809523, "repo_name": "nyaruka/sigtrac", "id": "80fb9bfe7dba1ac3140a406c53ec64a635731a3a", "size": "336", "binary": fa...
import m5 from m5.objects import * m5.util.addToPath('../configs/common') from Caches import * nb_cores = 4 cpus = [ TimingSimpleCPU(cpu_id=i) for i in xrange(nb_cores) ] # system simulated system = System(cpu = cpus, physmem = SimpleMemory(), membus = CoherentBus()) # l2cache & bus system.toL2Bus = CoherentBus(cloc...
{ "content_hash": "d8d0f67fd8ca8e51736371f261616869", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 77, "avg_line_length": 27.975609756097562, "alnum_prop": 0.6652136006974717, "repo_name": "Dexhub/MTX", "id": "aad15a2ac0ffbf8bea226494a9678953192af5f0", "size": "2728", ...
__all__ = ["EdgeSplitter"] import datetime import warnings import networkx as nx import pandas as pd import numpy as np from math import isclose from ..core import StellarGraph from ..globalvar import FEATURE_ATTR_NAME class EdgeSplitter(object): """ Class for generating training and test data for link pred...
{ "content_hash": "e93fe60b1ad97bbfe55561d75e408640", "timestamp": "", "source": "github", "line_count": 1055, "max_line_length": 171, "avg_line_length": 46.60663507109005, "alnum_prop": 0.5820012202562538, "repo_name": "stellargraph/stellargraph", "id": "9de70cc4373ca1b050c66289cfacb76a756b2716", "...
import time import jwt from pandaharvester.harvesterconfig import harvester_config class HarvesterToken(): """ Methods of JSON Web Token used in harvester frontend """ algorithm = 'HS256' def __init__(self, **kwarg): # load secret from file with open(harvester_config.frontend.se...
{ "content_hash": "f0d1f368bae90b6f8cb635b5170ea157", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 99, "avg_line_length": 33.38461538461539, "alnum_prop": 0.6111751152073732, "repo_name": "dougbenjamin/panda-harvester", "id": "9b1762ecf593885b8234c7b6166cbcaa2645db4b", "...
from __future__ import unicode_literals from django.contrib.auth.models import User from django.test import TestCase from django_openid_auth.models import ( Permission, UserOpenID, ) class UserOpenIDModelTestCase(TestCase): def test_create_useropenid(self): user = User.objects.create_user('some...
{ "content_hash": "9482c548add8bdc565e0fc6b43b52494", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 75, "avg_line_length": 40.32608695652174, "alnum_prop": 0.6231805929919138, "repo_name": "kawamon/hue", "id": "d9a48c836aa37b0c92026dde4210ab9dc1ca3a5f", "size": "3239", ...
from optparse import OptionParser import os # Get the command line parameters parser = OptionParser() parser.add_option("-f", "--inputDirectory", dest="inputDirectory", default=os.path.dirname(os.path.realpath(__file__)), help="Give the input directory containing ALL the files from TG-GATEs") (optio...
{ "content_hash": "6695770fe655f03e453fc9f75ab81f54", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 119, "avg_line_length": 39, "alnum_prop": 0.717948717948718, "repo_name": "J0bbie/AdverseEffectsPredictor", "id": "cb36a6fad41334d7815f566ec39ac35cb9668c00", "size": "611", ...
import sys import struct file = open("inst_rom.bin", "rb") write_file = open("inst_rom_en.bin", "wb") roidata_start = 0x4c70 x = 0x3000 while True: _bytes = file.read(4) x += 4 if not _bytes: break _byte_array = bytearray(_bytes) if x<roidata_start: _byte_array.reverse() write...
{ "content_hash": "7138113f666dd9040b64e5f58e5206c0", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 42, "avg_line_length": 17.818181818181817, "alnum_prop": 0.6173469387755102, "repo_name": "StephenChusang/OS", "id": "7447bca9bd245761b758f4fe23fe43be8cfa8890", "size": "41...
from sqlalchemy.orm import sessionmaker from sqlalchemy.orm import scoped_session from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String Base = declarative_base() class User(Base): __tablename__ = 'huahu' id = Column(...
{ "content_hash": "9cbede94a304c02c5841e03f475bc3cb", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 86, "avg_line_length": 29, "alnum_prop": 0.6500638569604087, "repo_name": "huahu/sjianbing", "id": "06f8dc76ca977aba1f7ea6e38bc3767dca702c7b", "size": "783", "binary": fa...
import json from functools import wraps import flask import dci.auth_mechanism as am from dci.common import exceptions as dci_exc from dci.policies import ROLES def reject(): """Sends a 401 reject response that enables basic auth.""" auth_message = ('Could not verify your access level for that URL.' ...
{ "content_hash": "5c875c11c33c3502038972fb8eaa895f", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 77, "avg_line_length": 30.466666666666665, "alnum_prop": 0.6214442013129103, "repo_name": "enovance/dci-control-server", "id": "299904d0ef4400e736dda222c099917285aa6ad8", "...
import requests from .base import AbstractSharer class FacebookFeedSharer(AbstractSharer): def __init__(self, feed_id=None, access_token=None): super(FacebookFeedSharer, self).__init__() self.feed_id = feed_id self.access_token = access_token def send(self, message, **kw): req...
{ "content_hash": "03783a4289bcc0ebc27666ba63fcaec0", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 64, "avg_line_length": 30.42105263157895, "alnum_prop": 0.5761245674740484, "repo_name": "FelixLoether/python-sharer", "id": "137d63e18537cdf4e86aef03e21e6b370f3a0b5f", "si...
import sys import time import os import base64 import yaml from pprint import pprint try: from yaml import CLoader as Loader, CDumper as Dumper except ImportError: from yaml import Loader, Dumper def harvest_yaml(filename): lines = [] with open(filename) as fh: yaml_found = None for line in fh.readlin...
{ "content_hash": "43175d727ad9cc021d3b31665b221ba2", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 81, "avg_line_length": 19.18, "alnum_prop": 0.6475495307612096, "repo_name": "thaapaniemi/motonkone", "id": "dba3e85b3d4a6a43e42a88c792c5370d5fe4ae19", "size": "1006", "b...
import os from django.core.urlresolvers import reverse from rest_framework import status from rest_framework.authtoken.models import Token from rest_framework.test import APITestCase from api.models import Page, User class PageTests(APITestCase): def setUp(self): self.user = User.objects.create_user( ...
{ "content_hash": "0a7b37be69192586708885243b72e136", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 96, "avg_line_length": 37.924050632911396, "alnum_prop": 0.6365153538050734, "repo_name": "Siecje/agora-api", "id": "5e2bb1ed00eb2e1ad154d1bbc4bd0c080dc3b550", "size": "299...
from __future__ import absolute_import, unicode_literals import json import unittest from google.appengine.api import files from google.appengine.ext import testbed import webapp2 from webapp2_extras import i18n # workaround for i18n. without this test will not run app = webapp2.WSGIApplication( [webapp2.Route('...
{ "content_hash": "418f793533128f969b664c7201cf7fa6", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 102, "avg_line_length": 31.857142857142858, "alnum_prop": 0.6681614349775785, "repo_name": "renzon/blob_app", "id": "abc4dea9813d9a225fd86b6a7ea258c425d8050f", "size": "203...
from collections.abc import Iterable from pathlib import Path import time import openmc from openmc.checkvalue import check_type, check_value class Model: """Model container. This class can be used to store instances of :class:`openmc.Geometry`, :class:`openmc.Materials`, :class:`openmc.Settings`, :...
{ "content_hash": "6321bb75dfb1b2bc661be278cf5f9ded", "timestamp": "", "source": "github", "line_count": 240, "max_line_length": 82, "avg_line_length": 32.391666666666666, "alnum_prop": 0.593902752765629, "repo_name": "liangjg/openmc", "id": "7d6acb281ced4f38cd2e0bf55300bf1bae119273", "size": "7774"...
from django.core.urlresolvers import reverse from django.conf.urls import url, include from django.views.generic import RedirectView from .api import LinkedEventsAPIRouter from helusers import admin admin.autodiscover() api_router = LinkedEventsAPIRouter() class RedirectToAPIRootView(RedirectView): permanent =...
{ "content_hash": "a8d2f998331a4d98f2aa5f9f7b7b2b54", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 63, "avg_line_length": 27.75, "alnum_prop": 0.7102102102102102, "repo_name": "aapris/linkedevents", "id": "21da6a6301de508eaf3577dc9460ec66c6af02ab", "size": "666", "bina...
"""Shortest paths and path lengths using the A* ("A star") algorithm. """ from heapq import heappush, heappop from itertools import count import networkx as nx from networkx.utils import not_implemented_for __all__ = ['astar_path', 'astar_path_length'] @not_implemented_for('multigraph') def astar_path(G, source, ta...
{ "content_hash": "d6527bc70ae418a4f1b3c725285b3572", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 79, "avg_line_length": 30.3875, "alnum_prop": 0.5909090909090909, "repo_name": "JamesClough/networkx", "id": "3ec06460efae62427fb065a26b8b054215994886", "size": "5181", ...
""" Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were initially sorted according to their start times. Example 1: Given intervals [1,3],[6,9], insert and merge [2,5] in as [1,5],[6,9]. Example 2: Given [1,2],[3,5],[6,7],[8,...
{ "content_hash": "4b4dcfa6c5b457d7e53e3ea2fbaf6e52", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 104, "avg_line_length": 31.81132075471698, "alnum_prop": 0.5759193357058126, "repo_name": "tktrungna/leetcode", "id": "6e22be6a4e11ec0f28901b64e3268f0d1e98e2c0", "size": "1...
"""This script will check out llvm and clang, and then package the results up to a number of tarballs.""" import argparse import fnmatch import itertools import lzma import multiprocessing.dummy import os import platform import shutil import subprocess import sys import tarfile import time from update import PACKAGE_...
{ "content_hash": "fdaa59e56ee9fbb49d87914b2a902c91", "timestamp": "", "source": "github", "line_count": 704, "max_line_length": 92, "avg_line_length": 43.15767045454545, "alnum_prop": 0.652404305039002, "repo_name": "chromium/chromium", "id": "c7411f0a997ce1b6ab1fa2080d5fdb9096cecd78", "size": "305...
""" Django settings for myproject project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) ...
{ "content_hash": "b8f1f9bd39291db76dfa8075f2966dd0", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 203, "avg_line_length": 33.11333333333334, "alnum_prop": 0.6845178175961345, "repo_name": "nathanielbecker/business-contacter-django-app", "id": "bfc436cf27182f68d9a60abbc6a...
from __future__ import absolute_import import pytest import mock import opentracing def teardown_function(function): opentracing._reset_global_tracer() def test_opentracing_tracer(): assert opentracing.tracer is opentracing.global_tracer() assert isinstance(opentracing.global_tracer(), opentracing.Trace...
{ "content_hash": "de46658ade8596cdac7746f120d04e3e", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 70, "avg_line_length": 26.742857142857144, "alnum_prop": 0.7435897435897436, "repo_name": "kawamon/hue", "id": "aa0227cd83e129998d87bd6a834e6bedc37447f6", "size": "1515", ...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ebooks', '0110_auto_20200830_1750'), ] operations = [ migrations.AlterField( model_name='book', name='icon_style', field=models.CharField(blank=True, cho...
{ "content_hash": "0ee10ea9f8900e905bd900edc49076f8", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 215, "avg_line_length": 54.568627450980394, "alnum_prop": 0.5127560186848724, "repo_name": "flavoi/diventi", "id": "0bf88d5fb7d075592785bb8f6ec4dada75b960b7", "size": "2833...
from sandglass.time.api import API from sandglass.time.models.client import Client from sandglass.time.resource.model import ModelResource from sandglass.time.schemas.client import ClientListSchema from sandglass.time.schemas.client import ClientSchema class ClientResource(ModelResource): """ REST API resourc...
{ "content_hash": "a80df694725b7c175c5d26575b865b69", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 58, "avg_line_length": 25.63157894736842, "alnum_prop": 0.7659137577002053, "repo_name": "sanglass/sandglass.time", "id": "f248a44883a1d8b3a6d03eba0af8eb0b8530ea16", "size"...
from google.cloud import language def get_sentiment(in_text): language_client = language.Client() document = language_client.document_from_text(in_text) sentiment = document.analyze_sentiment().sentiment return (sentiment.score, sentiment.magnitude) def get_entities(in_text): language_client = l...
{ "content_hash": "8d773568e5c6b99bcd4394420cf810b7", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 67, "avg_line_length": 33.8, "alnum_prop": 0.7396449704142012, "repo_name": "spmassot/Spaghetti-Twitter-Bot", "id": "c670e3b9428d844399dd0282e4ab99c04ee4dc17", "size": "507...
from itertools import chain, groupby import numpy as np from ._base import Descriptor from ._graph_matrix import DistanceMatrix __all__ = ( "InformationContent", "TotalIC", "StructuralIC", "BondingIC", "ComplementaryIC", "ModifiedIC", "ZModifiedIC", ) class BFSTree(object): __slots_...
{ "content_hash": "eb04e519c85da53cd68fffc8cfd2b1e2", "timestamp": "", "source": "github", "line_count": 322, "max_line_length": 87, "avg_line_length": 22.850931677018632, "alnum_prop": 0.5501494971459636, "repo_name": "mordred-descriptor/mordred", "id": "0aca0af5559ae99568535eac8672af22c90224ce", "...
from setuptools import setup from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='splutter', packages=['splutter'], version='0.1.0', description='A moder...
{ "content_hash": "0f6c9a671996e6d2ab31e19c996bb075", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 64, "avg_line_length": 23.041666666666668, "alnum_prop": 0.6690777576853526, "repo_name": "ElegantBadger/splutter", "id": "c131b17d15f503fbc5ea2ba33bb9534e7421a95c", "size"...
import sys import unittest import threading import time import Gaffer import GafferTest class OutputRedirectionTest( GafferTest.TestCase ) : def testRedirection( self ) : out = [] err = [] with Gaffer.OutputRedirection( stdOut = out.append, stdErr = err.append ) : sys.stdout.write( "OUT" ) print( "PRI...
{ "content_hash": "ec8fa7dda87ac62c04891e7e1db2dbe3", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 124, "avg_line_length": 25.06451612903226, "alnum_prop": 0.6081081081081081, "repo_name": "hradec/gaffer", "id": "fc2f459d997f679cfc22d8e1fd324ea61e8041a1", "size": "3357",...
""" Functional tests for ``flocker.node._deploy``. """ from subprocess import check_call from twisted.trial.unittest import TestCase from .. import Deployer, Deployment, Application, DockerImage, Node from ..gear import GearClient from ..testtools import wait_for_unit_state, if_gear_configured from ...testtools impo...
{ "content_hash": "46ae66a28955b6a0f0754d7e80fa55cb", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 75, "avg_line_length": 37.38709677419355, "alnum_prop": 0.5530629853321829, "repo_name": "beni55/flocker", "id": "1aa3bf9ceaf5daf0a53413cb7f825d31aabf9392", "size": "2380",...
import ckeditor_uploader.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('inventory', '0005_item_views'), ] operations = [ migrations.AlterField( model_name='item', name='description', field=ckeditor_upl...
{ "content_hash": "0e69d3a85617ac4fcabcadc1ec19fae1", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 94, "avg_line_length": 23.647058823529413, "alnum_prop": 0.6268656716417911, "repo_name": "hackerspace-ntnu/website", "id": "d4489ada6001160467cfda472e06a22185f714ba", "siz...
import re import functools import distutils.core import distutils.errors import distutils.extension if "__PEX_UNVENDORED__" in __import__("os").environ: from setuptools.extern.six.moves import map # vendor:skip else: from pex.third_party.setuptools.extern.six.moves import map from .monkey import get_unpatched ...
{ "content_hash": "b7e919a78bed52fcc622baa37f908413", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 76, "avg_line_length": 30.62295081967213, "alnum_prop": 0.6472162740899358, "repo_name": "pantsbuild/pex", "id": "8553481363ec8eda34e670fb8854d1ce2d7639dd", "size": "1868",...
from setuptools import setup from setuptools import find_packages from xmm import __author__, __email__, __url__, __license__, __version__, __summary__, __keywords__ with open('requirements.in') as f: install_requires = f.read().splitlines() try: import pypandoc readme_contents = pypandoc.convert('README...
{ "content_hash": "98448e9d6a8f55053fdab633f62176dd", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 119, "avg_line_length": 30.75, "alnum_prop": 0.6043360433604336, "repo_name": "z/xonotic-map-manager", "id": "432bff96d480242489a31c1b574a5df4c7aa567d", "size": "1845", "...
from .async_client import RegistryAsyncClient from .client import RegistryClient __all__ = ( "RegistryClient", "RegistryAsyncClient", )
{ "content_hash": "b2ccaa932509492141ce233d840b873e", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 45, "avg_line_length": 20.714285714285715, "alnum_prop": 0.7310344827586207, "repo_name": "googleapis/python-apigee-registry", "id": "2e8903ad24908b4f2c338d86994fbe259517ba39"...
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/creature/npc/theme_park/shared_event_transport.iff" result.attribute_template_id = 9 result.stfName("theme_park_name","transport") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "8afb78da39d9c8151527cbdfc9bfceb5", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 78, "avg_line_length": 24.076923076923077, "alnum_prop": 0.7028753993610224, "repo_name": "obi-two/Rebelion", "id": "eee056dea72ac638a9e22cd6f6b6855fea0ecb79", "size": "458...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('csyllabusapi', '0004_auto_20171030_0200'), ] operations = [ migrations.CreateModel( name='User', fields=[ ('...
{ "content_hash": "7ecd4bf7c67a92d3bea0ccd3f8150a7f", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 114, "avg_line_length": 27, "alnum_prop": 0.5101327742837177, "repo_name": "CSyllabus/webapp", "id": "77a5a3fdb61f20945801b11876abf3a3ecf2a523", "size": "1503", "binary":...
from math import sqrt # function for calculating (Euclidean Distance Score) distance-based similarity score for person1 and person2 def similarity_distance(input_recs, person1, person2): # Gather list of shared_items shared_items = {} for item_key in input_recs[person1]: if item_key in input_recs[p...
{ "content_hash": "ae92ab6e85f63f700809b37c4b1f9af4", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 109, "avg_line_length": 44.925925925925924, "alnum_prop": 0.638636988183567, "repo_name": "jpbinary/Programming-Collective-Intelligence", "id": "5c7d7d9464a86d050e7a68b83b93b...
import asyncio import collections import concurrent.futures import errno import functools import gc import inspect import itertools import os import signal import socket import subprocess import ssl import stat import sys import threading import traceback import time import warnings import weakref
{ "content_hash": "9dc84a1266fd63e55297eba544e83693", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 25, "avg_line_length": 14.95, "alnum_prop": 0.862876254180602, "repo_name": "MagicStack/uvloop", "id": "2ccf9cae31016b266b5a8a656b3aea0c3e571fc9", "size": "361", "binary"...
from __future__ import unicode_literals, absolute_import from .syntax import * # noqa def exists(value): "Query to test if a value exists." if not isinstance(value, Token): raise TypeError('value must be a token') if not hasattr(value, 'identifier'): raise TypeError('value must support a...
{ "content_hash": "157c694f54541d6f3faea37ab70d1dba", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 59, "avg_line_length": 24.930232558139537, "alnum_prop": 0.6147388059701493, "repo_name": "bruth/cypher", "id": "b8dfebb8947567a90400cf68db74b4bfb6ec6f14", "size": "1072", ...
import logging import platform import re import sys from functools import reduce from google.protobuf import text_format from google.protobuf.descriptor import FieldDescriptor from google.protobuf.message import Message from pathlib import Path from typing import NewType, Any, Optional, List, Iterable UniqueId = NewT...
{ "content_hash": "f5642bce3e4ddd6251f22b6c268e503c", "timestamp": "", "source": "github", "line_count": 277, "max_line_length": 80, "avg_line_length": 34.75812274368231, "alnum_prop": 0.6615081013710012, "repo_name": "scheib/chromium", "id": "3bbd97a5f4cb60d4e8077111d8f4b4f1238b56ce", "size": "9791...
from agate.rows import Row from agate import utils @utils.allow_tableset_proxy def select(self, key): """ Create a new table with only the specified columns. :param key: Either the name of a single column to include or a sequence of such names. :returns: A new :class:`.Table`....
{ "content_hash": "923804618aa1f0fdde39b3ec1011e221", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 75, "avg_line_length": 25.96153846153846, "alnum_prop": 0.6311111111111111, "repo_name": "flother/agate", "id": "f806f6640db792c6f3058ca4d3510677ed1f6e28", "size": "722", ...
from setuptools import setup, find_packages from random_music.random_music import __version__ with open(u'README') as fh: long_description = fh.read() setup( name=u"random_music", version=__version__, author=u"Caoilte Guiry", author_email=u"", license=u'BSD License', description=u"Pla...
{ "content_hash": "4329fcfb50da694038828d3e71fbf619", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 69, "avg_line_length": 26.761904761904763, "alnum_prop": 0.6690391459074733, "repo_name": "caoilteguiry/random_music", "id": "9f520be5031dd7b90b1981461a97199332c4cf7d", "si...
""" Init Functions: None Classes: None Exceptions: None """ import os import platform import sys import ec2rlcore.logutil __all__ = ["awshelpers", "backup", "console_out", "constraint", "logutil", "main", "menu", "menu_config", "menu_item", "menu_textpad_mod", "module",...
{ "content_hash": "dd10e3e1b090cd45647237bfbbf059b2", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 75, "avg_line_length": 26, "alnum_prop": 0.6555944055944056, "repo_name": "gregbdunn/aws-ec2rescue-linux", "id": "e6c3bc7fc85b88b58af259daa5c913fc9251ba0a", "size": "1713",...