text
stringlengths
4
1.02M
meta
dict
"""Controllers for the cron jobs.""" pass
{ "content_hash": "5df627f98e76912cfbe304ecdcc0b620", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 36, "avg_line_length": 14.333333333333334, "alnum_prop": 0.6744186046511628, "repo_name": "miyucy/oppia", "id": "63ee7650ec9296c591b268c27c257101720e0ef4", "size": "648", ...
import os import re import sys from setuptools import find_packages, setup def get_version(*file_paths): """Retrieves the version from magic_cards/__init__.py""" filename = os.path.join(os.path.dirname(__file__), *file_paths) version_file = open(filename).read() version_match = re.search(r"^__version...
{ "content_hash": "64c2378803c20df3ae357cb480012e01", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 90, "avg_line_length": 32.85897435897436, "alnum_prop": 0.5946156847444402, "repo_name": "pbaranay/django-magic-cards", "id": "0f16e2fad447c855fe9d1b4580301ff7310997c5", "s...
from __future__ import absolute_import from __future__ import unicode_literals from acos_client import errors as acos_errors from acos_client.v21 import base class HealthMonitor(base.BaseV21): # Valid types ICMP = 0 TCP = 1 HTTP = 3 HTTPS = 4 def get(self, name, **kwargs): return se...
{ "content_hash": "5c45235b8ae4b74e8838d0da31daccfb", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 77, "avg_line_length": 34.013698630136986, "alnum_prop": 0.5054369714055578, "repo_name": "mdurrant-b3/acos-client", "id": "46532d770479a6076444042ee92747516f1c2e86", "size...
import unittest from ...compatibility import StringIO from ...drawing import Drawing class TestWriteXdrcolOff(unittest.TestCase): """ Test the Drawing _write_col_off() method. """ def setUp(self): self.fh = StringIO() self.drawing = Drawing() self.drawing._set_filehandle(self...
{ "content_hash": "41ebaee6ae09c269226e2bfd877a9a58", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 51, "avg_line_length": 22.96, "alnum_prop": 0.6132404181184669, "repo_name": "applicationdevm/XlsxWriter", "id": "82f66c379bb550b2e8cf7153d36f5bc47621092a", "size": "747", ...
import sys import tensorflow as tf # ModuleNotFoundError is new in 3.6; older versions will throw SystemError if sys.version_info < (3, 6): ModuleNotFoundError = SystemError try: from . import rnn_inference from . import sampler_inputs from .transformer import INT_DTYPE, FLOAT_DTYPE from . import ...
{ "content_hash": "e272d7f17ded7cb96e4d35ad728404fd", "timestamp": "", "source": "github", "line_count": 270, "max_line_length": 88, "avg_line_length": 40.17037037037037, "alnum_prop": 0.6254840494191407, "repo_name": "EdinburghNLP/nematus", "id": "1f9d8e596ca8b99c7fccd85a5fbffe1d7a45d41e", "size": ...
import os, sys _open = open # rename for internal use -- gets redefined below def open(dbname, mode = "r"): text = _open(os.path.join(dbname, "config.dat"), "rb").read() line = text.split("\n")[0] if line == "index\tBerkeleyDB/1": import BerkeleyDB return BerkeleyDB.open(dbname, mode) ...
{ "content_hash": "edd9f771d26dad7b222d5b9731315ff6", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 70, "avg_line_length": 28.105263157894736, "alnum_prop": 0.5580524344569289, "repo_name": "dbmi-pitt/DIKB-Micropublication", "id": "d5ceb1f4a1c9a9eb9d84473d23fc0c448612d7f1",...
import numpy as np import matplotlib.pyplot as plt from scipy.io import loadmat from openmdao.api import Problem from wakeexchange.OptimizationGroups import OptAEP from wakeexchange.gauss import gauss_wrapper, add_gauss_params_IndepVarComps from wakeexchange.floris import floris_wrapper, add_floris_params_IndepVarCom...
{ "content_hash": "01d2fd432e56dcb1e15945b624979216", "timestamp": "", "source": "github", "line_count": 306, "max_line_length": 209, "avg_line_length": 40.1797385620915, "alnum_prop": 0.6246441642944286, "repo_name": "byuflowlab/gaussian-wake", "id": "4464703548da2fc456c878cf85a011d470ef7ade", "siz...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'Plan.is_default' db.delete_column(u'physical_plan', 'is_default') def bac...
{ "content_hash": "070e8354724a5ddb351c1e15dab6bdaa", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 239, "avg_line_length": 88.10596026490066, "alnum_prop": 0.5634395670475045, "repo_name": "globocom/database-as-a-service", "id": "52e867236fbcfd36793969aec62326225aabc590",...
from luma.oled.device import ssd1327 from luma.core.render import canvas from luma.core.framebuffer import diff_to_previous, full_frame from baseline_data import get_reference_data, primitives from helpers import serial, assert_invalid_dimensions, setup_function # noqa: F401 from unittest.mock import call def test_...
{ "content_hash": "38eaf7e369c1cb753c9be094ca2871ec", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 86, "avg_line_length": 32.691588785046726, "alnum_prop": 0.6400800457404231, "repo_name": "rm-hull/ssd1306", "id": "1b677dd4993e85bff2ae6754aca41b8a84a7e80f", "size": "363...
from __future__ import absolute_import import xml_models import xml_models.rest_client as rest_client from lxml import etree from xml_models.xpath_finder import MultipleNodesReturnedException try: from StringIO import StringIO except ImportError: from io import BytesIO as StringIO class ModelManager(object): ...
{ "content_hash": "408d36d74c7dc51ab2dd49f3e47e4e94", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 117, "avg_line_length": 30.877828054298643, "alnum_prop": 0.5860199296600235, "repo_name": "alephnullplex/xml_models2", "id": "14a31a2bf9462272e6b89554ad40c21b39f30a45", "...
from migrate.changeset import UniqueConstraint from migrate import ForeignKeyConstraint from oslo_log import log as logging from sqlalchemy import Boolean, BigInteger, Column, DateTime, Enum, Float from sqlalchemy import dialects from sqlalchemy import ForeignKey, Index, Integer, MetaData, String, Table from sqlalchemy...
{ "content_hash": "4379a919bd1f815803e2036977508eb0", "timestamp": "", "source": "github", "line_count": 1522, "max_line_length": 79, "avg_line_length": 40.48883048620237, "alnum_prop": 0.5923017006361158, "repo_name": "Juniper/nova", "id": "317e3c3f932520ce2bf6b1e0fb34c7328e6fbf5a", "size": "62237"...
"""Tests for the experimental input pipeline ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import itertools import math import threading import time import numpy as np from six.moves import zip_longest from tensorflow.contrib.data.python.kernel_t...
{ "content_hash": "d51f16a05a2b682e789a2250524b93e3", "timestamp": "", "source": "github", "line_count": 1001, "max_line_length": 87, "avg_line_length": 39.25174825174825, "alnum_prop": 0.5978722862742104, "repo_name": "ravindrapanda/tensorflow", "id": "db8429512bf2bf944e67b65d185aca99477c86d3", "si...
import imp import os from . import commands from . import statusfile from . import utils from ..objects import testcase # Use this to run several variants of the tests. ALL_VARIANT_FLAGS = { "default": [[]], "stress": [["--stress-opt", "--always-opt"]], "turbofan": [["--turbo", "--always-opt"]], "nocrankshaft...
{ "content_hash": "451b8785c11fbe734a6af4fbdea335f4", "timestamp": "", "source": "github", "line_count": 305, "max_line_length": 78, "avg_line_length": 31.455737704918032, "alnum_prop": 0.6394621638524077, "repo_name": "dreamllq/node", "id": "e0fff0d11a3d176b3faaac43819e827c552fea0b", "size": "11167...
import falcon import json import logging import time from kafka import client from kafka import common from kafka import producer from monasca.common import monasca_app from monasca.common import utils LOG = logging.getLogger(__name__) @monasca_app.Resourcify class KafkaDispatcher(object): def __init__(self, ...
{ "content_hash": "4841815aca7225e3815ee4f42fbf3791", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 77, "avg_line_length": 38.62135922330097, "alnum_prop": 0.48366013071895425, "repo_name": "litong01/python-monasca-api", "id": "308a7cd19d1e5326cb17f4e867565fe76adf3a15", ...
import ROOT import array def set_ticks(can): """ Display ticks on the upper and right axes. Args: can (ROOT.TCanvas): Canvas to set ticks on. """ can.SetTickx(1) can.SetTicky(1) def root_style(font=132): """ Sets the style for ROOT plots. The SNO+ standard style is adapted from a ...
{ "content_hash": "d03bdbac7d87e749508d4127b6d8d72d", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 79, "avg_line_length": 29.770114942528735, "alnum_prop": 0.6613899613899614, "repo_name": "jwaterfield/echidna", "id": "75b529d5ac843787a8c60ed2dda58814feaff56f", "size": "...
#!/usr/bin/env python import MMTK from AlGDock.BAT import * def _in_ring(ancestors): """ Returns a list of atoms in the same circular path as ancestors, which can be a single atom or list of atoms. """ if isinstance(ancestors,MMTK.ChemicalObjects.Atom): ancestors = [ancestors] in_ring = [] for child...
{ "content_hash": "b2e5018b9e8e03db51aebcf88ab89557", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 88, "avg_line_length": 32.201117318435756, "alnum_prop": 0.6469465648854962, "repo_name": "gkumar7/AlGDock", "id": "59c41be7f75124e1a81fdbeda7419eadde8e7a3f", "size": "576...
import player import random class Monster(player.Player): def __init__(self, game, location, name, description): player.Player.__init__(self, game, location) self.name = name self.description = description # print self.actions def get_input(self): # print "I am in"...
{ "content_hash": "ebf30767f2226ee416307073b9ef3db4", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 72, "avg_line_length": 29.127659574468087, "alnum_prop": 0.5522279035792549, "repo_name": "geekbert/HelloPythonSourceCode", "id": "24a577f1b9e67ab80c0716204702bf003dd86f9e", ...
from django.conf.urls import url, include try: import importlib except ImportError: from django.utils import importlib from allauth.socialaccount import providers from . import app_settings urlpatterns = [url('^', include('allauth.account.urls'))] if app_settings.SOCIALACCOUNT_ENABLED: urlpatterns += [...
{ "content_hash": "9109a441ee1fdc35a283db425059339f", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 75, "avg_line_length": 28, "alnum_prop": 0.7157738095238095, "repo_name": "sih4sing5hong5/django-allauth", "id": "e85d05dc129fdcd5d6f9c0630a31eb787d83cdc5", "size": "672", ...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('venta', '0054_alumno'), ] operations = [ migrations.DeleteModel( name='Alumno', ), migrations.RemoveField( model_nam...
{ "content_hash": "dc2d0f75f2ef6d1ac7394d13dd536fe5", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 39, "avg_line_length": 19.434782608695652, "alnum_prop": 0.5324384787472036, "repo_name": "vpadillar/pventa", "id": "d6018ac285129efe140e7c48e7a8edbab8ff7d3b", "size": "519...
"""The arguments helper for a database configuration.""" from plaso.lib import errors from plaso.cli.helpers import interface from plaso.cli.helpers import server_config class DatabaseConfigHelper(interface.ArgumentsHelper): """CLI arguments helper class for database configuration.""" NAME = u'database_config' ...
{ "content_hash": "76b519e0186f5be54364804568952efb", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 80, "avg_line_length": 36.41891891891892, "alnum_prop": 0.6975881261595547, "repo_name": "8u1a/plaso", "id": "67cc0a902cb0a71d4b6719a1d305d1b87223d947", "size": "2719", "...
import os import unittest from nose.plugins.attrib import attr from mi.core.log import get_logger from mi.dataset.dataset_driver import ParticleDataHandler from mi.dataset.driver.cg_cpm_eng.cpm.cg_cpm_eng_cpm_recovered_driver import parse from mi.dataset.driver.cg_cpm_eng.cpm.resource import RESOURCE_PATH __author__ ...
{ "content_hash": "cf53c472b3ecc8ed4458affb41685c66", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 86, "avg_line_length": 28.78787878787879, "alnum_prop": 0.7073684210526315, "repo_name": "oceanobservatories/mi-dataset", "id": "69f48051c4b831b2a7e6b5f0e2e721b98942d7a2", ...
from django.utils.encoding import smart_str from django.conf import settings from hashlib import sha1 from mediagenerator.generators.bundles.base import Filter from mediagenerator.utils import find_file, read_text_file, get_media_dirs from subprocess import Popen, PIPE import os import sys import re import posixpath ...
{ "content_hash": "14febc8a570b67604e52766e5999028a", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 89, "avg_line_length": 36.41836734693877, "alnum_prop": 0.5539366769403195, "repo_name": "stucchio/Django-Media-Generator", "id": "4c10f3c7cfb831aa9e4d8539eb0a3210677eb6f5",...
import UserDict import bson.objectid from .codecs import Codec class BaseModel(UserDict.IterableUserDict): fields = {} def __init__(self, **kwargs): '''All this simple constructor does is populate the instance's field values from any of the provided keyword arguments.''' self.data = {...
{ "content_hash": "f8ab5fa732e0d82172790027a2f3d4ee", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 81, "avg_line_length": 36.86, "alnum_prop": 0.5552088985349973, "repo_name": "nesv/pureodm", "id": "f7e11b3f689371c8330b52f6db81ea9975b057d4", "size": "7395", "binary": ...
__author__ = 'sergey' from dedupsqlfs.db.sqlite.table import Table class TableOption( Table ): _table_name = "option" def create( self ): c = self.getCursor() # Create table c.execute( "CREATE TABLE IF NOT EXISTS `%s` (" % self._table_name+ "name TEXT NOT...
{ "content_hash": "86fd34dfabcdbaa793406d87bfb81df5", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 100, "avg_line_length": 27.37313432835821, "alnum_prop": 0.5059978189749182, "repo_name": "sergey-dryabzhinsky/dedupsqlfs", "id": "af0dbd35daabd063b0999c278f0c1d7af4445ba3", ...
""" Tests which scan for certain occurrences in the code, they may not find all of these occurrences but should catch almost all. """ from __future__ import division, absolute_import, print_function import sys if sys.version_info >= (3, 4): from pathlib import Path import ast import tokenize import ...
{ "content_hash": "9a15b4f45e882ca155aa13de8d896455", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 79, "avg_line_length": 31.674418604651162, "alnum_prop": 0.5172540381791483, "repo_name": "mbayon/TFG-MachineLearning", "id": "c5818d21ce420f73c25eecdf85c3e4ee7c865e0b", "s...
from .generic import * from .utils import string_type from .pdf import PdfFileReader, PdfFileWriter from .pagerange import PageRange from sys import version_info if version_info < ( 3, 0 ): from cStringIO import StringIO StreamIO = StringIO else: from io import BytesIO from io import FileIO as file ...
{ "content_hash": "641897aeb2f3d9c15be048c36bc29a41", "timestamp": "", "source": "github", "line_count": 525, "max_line_length": 140, "avg_line_length": 38.23619047619048, "alnum_prop": 0.519378300288931, "repo_name": "malexandre/python-xhtml2pdf-demo", "id": "c8e6a6228ec655564367e63476be1c5684810f3a"...
"""Contains the core layers: Dense, Dropout. Also contains their functional aliases. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import six from six.moves import xrange # pylint: disable=redefined-builtin import numpy as np from tensorflow.python....
{ "content_hash": "e82100da0a60bc63aac3c70365b1d514", "timestamp": "", "source": "github", "line_count": 289, "max_line_length": 79, "avg_line_length": 40.325259515570934, "alnum_prop": 0.6614896172987815, "repo_name": "tntnatbry/tensorflow", "id": "b16012a69d03f57fa02f30b04cd42c655d12693f", "size":...
from stream_framework.tests.storage.base import TestBaseActivityStorageStorage from stream_framework.storage.redis.activity_storage import RedisActivityStorage class RedisActivityStorageTest(TestBaseActivityStorageStorage): storage_cls = RedisActivityStorage
{ "content_hash": "facbe64d733705a2d4fb18e8bc87ed04", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 80, "avg_line_length": 44.166666666666664, "alnum_prop": 0.8754716981132076, "repo_name": "SergioChan/Stream-Framework", "id": "b2293d481e4890e53c962302636622f2074fecb5", "s...
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse f...
{ "content_hash": "d7965364f60d643e0dbba4d4fea44bc7", "timestamp": "", "source": "github", "line_count": 418, "max_line_length": 222, "avg_line_length": 45.76555023923445, "alnum_prop": 0.6454260324098275, "repo_name": "Azure/azure-sdk-for-python", "id": "5fd3e3ac4c0562185386ed6ea5978dabe5676f9c", "...
from tempest.api.identity import base from tempest.common.utils import data_utils from tempest import test class GroupsV3TestJSON(base.BaseIdentityV3AdminTest): @test.attr(type='smoke') def test_group_create_update_get(self): name = data_utils.rand_name('Group') description = data_utils.rand_...
{ "content_hash": "ff5e8b554a684736e84a63cd2bda1e52", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 71, "avg_line_length": 42.608695652173914, "alnum_prop": 0.5793367346938776, "repo_name": "Vaidyanath/tempest", "id": "d4a83e29b7e7ae5d2e83cf822580b6b925af7ca8", "size": "4...
""" Implement transformation on Numba IR """ from collections import namedtuple, defaultdict import logging from numba.core.analysis import compute_cfg_from_blocks, find_top_level_loops from numba.core import errors, ir, ir_utils from numba.core.analysis import compute_use_defs _logger = logging.getLogger(__name__...
{ "content_hash": "9944362e1e8e5cead40e2418e8617f2a", "timestamp": "", "source": "github", "line_count": 526, "max_line_length": 84, "avg_line_length": 33.659695817490494, "alnum_prop": 0.5885343123411466, "repo_name": "sklam/numba", "id": "d01747884ac309144274d8b49596faf53eb2ff35", "size": "17705",...
"""Give names to parts of a numpy array.""" from typing import Iterable, List, Mapping, MutableMapping, Tuple, Union import numpy as np def lengths_to_ranges( lengths: Mapping[str, int]) -> MutableMapping[str, List[int]]: """Eg: {a: 2, b: 3} -> {a: [0, 1], b: [2, 3, 4]} .""" ranges = {} start = 0 for ke...
{ "content_hash": "a7a18fb256664be501df6cbfecd3a042", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 80, "avg_line_length": 30.17543859649123, "alnum_prop": 0.6232558139534884, "repo_name": "deepmind/deepmind-research", "id": "857573c79a2c15c4ed3c70eb338f7e63e182b890", "s...
VERSION = 10.0 HOST = 'localhost' PORT = 20010 # This is the path to the upload directory UPLOAD_FOLDER = 'uploads/' # These are the extension that we are accepting to be uploaded ALLOWED_EXTENSIONS = ['txt', 'md', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'png', 'jpg', 'jpeg', 'gif'] # Should the database be reinit...
{ "content_hash": "4291bf3bacad456e06b353ae894c0dec", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 100, "avg_line_length": 34.36363636363637, "alnum_prop": 0.6772486772486772, "repo_name": "FroeMic/CDTM-Backend-Workshop-WT2016", "id": "0000b497ea3558987741cabbec01dd68a665c...
from .manager import manager bp = manager
{ "content_hash": "669881c6fefc9c3de6c517daddb1e912", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 28, "avg_line_length": 14.333333333333334, "alnum_prop": 0.7674418604651163, "repo_name": "IfengAutomation/mockserver", "id": "da221fc5f27ee3b09553856141da7ecc0aca11ae", "si...
from __future__ import absolute_import, print_function from hashlib import sha256 import hmac import logging import six from simplejson import JSONDecodeError from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from django.views.generic import View from django.utils.crypto import...
{ "content_hash": "f10baa78bb81ef675d6864c59e180a99", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 89, "avg_line_length": 34.24752475247525, "alnum_prop": 0.6134721017635155, "repo_name": "zenefits/sentry", "id": "301a09627b262814120264adc7b59c45f2a22a3a", "size": "3459...
from gloria.service.decorator import task, Property @task() class Svc4Task0: '''Svc4Job0 description''' def __init__(self): print(self.__class__.__name__ + ' __init__') self._my_int_property = 1 self._my_bool_property = False @Property d...
{ "content_hash": "27c7ac198537d00a4873ee65f2044082", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 92, "avg_line_length": 30.807692307692307, "alnum_prop": 0.5280898876404494, "repo_name": "unix-beard/gloria", "id": "454563859cf51a3763fb8868cd806603bdaf8350", "size": "80...
from random import random with open('random.txt', 'w') as f: for k in range(1000000): print('{:6f}'.format(random()), file=f)
{ "content_hash": "c11fd24f5c2c6b8de7ea5fe6db909a1c", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 47, "avg_line_length": 27.8, "alnum_prop": 0.6115107913669064, "repo_name": "ThomasLee969/OperatingSystem", "id": "4156d035a9bb81bc93bcc13e82a5a44869a2db9e", "size": "139", ...
"""Contains benchmark imports and a list of benchmarks. All modules within this package are considered benchmarks, and are loaded dynamically. Add non-benchmark code to other packages. """ from perfkitbenchmarker import import_util def _LoadBenchmarks(): return list(import_util.LoadModulesForPath(__path__, __name...
{ "content_hash": "5ed3e1ff2215e0b5402a3de9c366fe1e", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 73, "avg_line_length": 28.375, "alnum_prop": 0.7422907488986784, "repo_name": "kivio/PerfKitBenchmarker", "id": "399ebe75683b8b32ca203078b8b864a05ae4f76b", "size": "1064", ...
import os import sys from gunicorn.errors import ConfigError from gunicorn.app.base import Application from gunicorn.app import djangoapp from gunicorn import util class WSGIApplication(Application): def init(self, parser, opts, args): if opts.paste and opts.paste is not None: path = os.path....
{ "content_hash": "95b8a02068ecb48d071aa6fa1f5586be", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 73, "avg_line_length": 27.4, "alnum_prop": 0.6100104275286757, "repo_name": "bertucho/moviestalk", "id": "e772cee3f5eec88356aef50b75521cbce0000d85", "size": "2046", "bina...
from suplemon.linelight.color_map import color_map class Syntax: def get_comment(self): return ("-- ", "") def get_color(self, raw_line): color = color_map["white"] return color
{ "content_hash": "567c5c6ec2b7cf8d4ab8d3c4cc47fe7b", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 50, "avg_line_length": 21.3, "alnum_prop": 0.6009389671361502, "repo_name": "richrd/suplemon", "id": "3a33921d14902852ebf162b6ce5e2a4714d14c1f", "size": "213", "binary": ...
from distutils.core import setup setup(name='pt-law-downloader', version='1.0.0', description='Downloader of the official texts of the portuguese law.', long_description=open('README.md').read(), author='Jorge C. Leitão', url='https://github.com/jorgecarleitao/pt_law_downloader', py...
{ "content_hash": "d059421d8359e44482338e40f9938748", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 76, "avg_line_length": 40.25, "alnum_prop": 0.6273291925465838, "repo_name": "publicos-pt/pt_law_downloader", "id": "5a9c43a3abde333b05ea7c3604d2f1e58835d77a", "size": "645...
def lovefunc(flower, flower2): return (flower + flower2) % 2 != 0
{ "content_hash": "39efa9296e2b7f3df8f8e30376c38ad3", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 38, "avg_line_length": 35, "alnum_prop": 0.6428571428571429, "repo_name": "the-zebulan/CodeWars", "id": "c5bfd11b12cfac832b63a450c555c610d092a828", "size": "70", "binary":...
import numpy as np from asap3.MonteCarlo.Base import GlobalOptimizer from ase.units import kB from ase.optimize import LBFGS class BasinHopping(GlobalOptimizer): def __init__(self, atoms, log='-', traj=None, localopt=LBFGS, fmax=1e-2): GlobalOptimizer.__init__(self, atoms, log, traj) self.localopt...
{ "content_hash": "67a02b79354f101c86ccff07b5aec20f", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 77, "avg_line_length": 32.7, "alnum_prop": 0.5802752293577982, "repo_name": "auag92/n2dm", "id": "da29ae85518b642bd6e32597b3b73e820cbebf26", "size": "1308", "binary": fal...
"""Syslog notification service.""" import syslog import voluptuous as vol from homeassistant.components.notify import ( ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService, ) CONF_FACILITY = "facility" CONF_OPTION = "option" CONF_PRIORITY = "priority" SYSLOG_FACILITY = { "ke...
{ "content_hash": "a6c5ff087aa00cd46f84dd225dd0620d", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 86, "avg_line_length": 26.097826086956523, "alnum_prop": 0.6197417742607247, "repo_name": "nkgilley/home-assistant", "id": "5a5bac002e42131bb0ff45bfeaefc23eda059678", "size...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'network'} DOCUMENTATION = ''' --- module: nxos_pim_rp_address extends_documentation_fragment: nxos version_added: "2.2" short_description: Manages configuration of an PIM static RP address in...
{ "content_hash": "14291c1ddad3258a54d514a670ddb825", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 85, "avg_line_length": 29.910526315789475, "alnum_prop": 0.600739046278374, "repo_name": "e-gob/plataforma-kioscos-autoatencion", "id": "dba519c02db5a4c3db2b85d76da18cd3e0f6...
from __future__ import unicode_literals, absolute_import from django.contrib.auth.models import AbstractUser from django.core.urlresolvers import reverse from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ @python_2_unicod...
{ "content_hash": "16ace9c2bb9d8fb0142eed1443fa5fc0", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 74, "avg_line_length": 30.88888888888889, "alnum_prop": 0.7146282973621103, "repo_name": "jeuvreyl/viewer-django", "id": "0b249e28aec0867bd33d249a9bf71b2212561b46", "size":...
from django.contrib import admin from .models import Experiment, Test class TestInline(admin.TabularInline): model = Test max_num = 2 extra = 2 class ExperimentAdmin(admin.ModelAdmin): inlines = (TestInline, ) list_display = ('name', 'start', 'end', 'is_active', ) # exclude = ('status', ) ...
{ "content_hash": "18e0cd8197eec0dffc40d94bb2445cac", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 58, "avg_line_length": 23.9, "alnum_prop": 0.6401673640167364, "repo_name": "htadg/ABToast", "id": "a778cac1db6863477ed4fcc4d8a73803f9d600b3", "size": "478", "binary": fa...
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Tickfont(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "scattercarpet.marker.colorbar" _path_str = "scattercarpet.marker.colorbar.tickfont" _valid...
{ "content_hash": "40c2d05a90244f094b1aa727d0e26abf", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 83, "avg_line_length": 37.61233480176212, "alnum_prop": 0.561841180604357, "repo_name": "plotly/python-api", "id": "82bb0600607127d9a15d5e5132f020191a0e5c1a", "size": "853...
import curses import calendar import gevent import time import global_mod as g import getstr def draw_window(state, window): window.clear() window.refresh() win_header = curses.newwin(5, 75, 0, 0) if 'browse_height' in state['blocks']: height = str(state['blocks']['browse_height']) if...
{ "content_hash": "d0dbc0cee44b446ac80eb1807c7d47b3", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 198, "avg_line_length": 40.68888888888889, "alnum_prop": 0.597669761514655, "repo_name": "esotericnonsense/bitcoind-ncurses", "id": "945a3b3b113d51cecbabc515a71a18ff6cbf9a80...
import numpy as np from IPython import embed from teafacto.blocks.seq.oldseqproc import SimpleVec2Idx, MemVec2Idx from teafacto.blocks.seq.enc import SimpleSeq2Vec from teafacto.blocks.seq.enc import Seq2Idx, Seq2Vec from teafacto.blocks.lang.wordvec import Glove from teafacto.blocks.memory import LinearGateMemAddr, D...
{ "content_hash": "13e5be4fb9b3ee72b03ddb1f0c212d4e", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 133, "avg_line_length": 33.4264705882353, "alnum_prop": 0.6315442146942367, "repo_name": "lukovnikov/teafacto", "id": "a98a40c303da5b660a1f837c702af1fa1521f9ad", "size": "...
import math import numpy as np import pandas as pd from scipy import stats from scipy.stats import norm import scipy.stats as stats import scipy.stats as st import matplotlib import matplotlib.pyplot as plt import re import scipy.stats import matplotlib.pyplot as mlab fhand = raw_input('Enter .csv file name or keyword...
{ "content_hash": "c2d78a1520319d5502bd517853d4d390", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 54, "avg_line_length": 21.666666666666668, "alnum_prop": 0.7846153846153846, "repo_name": "lastralab/Statistics", "id": "32fb794f54cf0b110fe6ed9e49636868ba2fe734", "size": ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('directorio', '0021_auto_20160506_1031'), ] operations = [ migrations.AlterField( model_name='profesor', name='organizacion',...
{ "content_hash": "e77be2c2ba2313dccaa60ada38be9412", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 116, "avg_line_length": 27.608695652173914, "alnum_prop": 0.5795275590551181, "repo_name": "josemfc/directorio-iep", "id": "3ce2a9b488a367f4dbf423b85f5fd68674dd18c5", "size...
from expects import expect RETURN_VALUE = '42' with description('Refactoring goodies'): def a_method(self, return_value=RETURN_VALUE): return return_value with it('uses methods defined inside its context'): expect(self.a_method()).to.be.equal(RETURN_VALUE) with context('when using nest...
{ "content_hash": "62ac03a4457e870fb434dd1e2cf83759", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 61, "avg_line_length": 25.444444444444443, "alnum_prop": 0.6746724890829694, "repo_name": "jaimegildesagredo/expects_docs_mamba_formatter", "id": "5fa58655fe1c03fad67c0bd9dcf...
""" model resource define @author xu_fanghui @date 2014-09-03 @version demo 0.1 """ from django.db import models class Company(models.Model): name = models.CharField(unique=True, max_length=255) simple_name = models.CharField(unique=True, max_length=60) address = models.CharField(max_len...
{ "content_hash": "af8b249e772463bd4a03be03464f515c", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 72, "avg_line_length": 36.72222222222222, "alnum_prop": 0.716338880484115, "repo_name": "xufanghui/djg-rest-demo", "id": "b581ad6c3cf573b088e31ccd5f132a9c63235397", "size":...
""" Manages information about the host OS and hypervisor. This class encapsulates a connection to the libvirt daemon and provides certain higher level APIs around the raw libvirt API. These APIs are then used by all the other libvirt related classes """ import operator import os import socket import sys import thread...
{ "content_hash": "89d5f18130d4518cb26aa2664896aefa", "timestamp": "", "source": "github", "line_count": 997, "max_line_length": 79, "avg_line_length": 38, "alnum_prop": 0.575278466979887, "repo_name": "NeCTAR-RC/nova", "id": "de22a6d00f89c9198ecacedc34babfdc99ad7e59", "size": "38813", "binary": f...
import os import sys import time import json import argparse from st2client import models from st2client.client import Client END_STATES = ['succeeded', 'failed'] ST2HOST = 'localhost' parser = argparse.ArgumentParser() parser.add_argument('--name', action="store", dest="name", required=True) parser.add_argument('--...
{ "content_hash": "568d68a5ef2d669af95fec569166181b", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 77, "avg_line_length": 26.016129032258064, "alnum_prop": 0.6354618722876627, "repo_name": "StackStorm/st2cd", "id": "b2fd76a6fa48094dec53e5fb9f8ab290b63ba36d", "size": "163...
from website import settings from website.project import Node from modularodm.query.querydialect import DefaultQueryDialect as Q from framework.analytics.piwik import PiwikClient def activity(): popular_public_projects = [] popular_public_registrations = [] hits = {} if settings.PIWIK_HOST: ...
{ "content_hash": "12ed2e818f0856c3319c5be0f402ee0d", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 94, "avg_line_length": 30.59493670886076, "alnum_prop": 0.5771617707902358, "repo_name": "AndrewSallans/osf.io", "id": "c4c75afa4e1f879cad514608e26d778e928bb5c9", "size": "...
""" main.py -- Udacity conference server-side Python App Engine HTTP controller handlers for memcache & task queue access $Id$ created by wesc on 2014 may 24 """ __author__ = 'wesc+api@google.com (Wesley Chun)' import webapp2 from google.appengine.api import app_identity from google.appengine.api import mail f...
{ "content_hash": "556759382dcfe3d1d88bc42e3e2a8906", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 79, "avg_line_length": 35.266666666666666, "alnum_prop": 0.6427221172022685, "repo_name": "poAndroid/p4_conference", "id": "3f2faf62f4eaaa306388e61b6f884adca6757a6f", "size...
import collections from hopper.utils.logger import * from BaseField import * from hopper.utils.Collections import * # Marked options (e.g. './app -t' or './app --test') class Option(BaseField): def __init__(self, shortname, longname, description = None, multiple = False, required = False, default = None, va...
{ "content_hash": "5951a09494ec9877fe5bc99a5fb3e808", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 92, "avg_line_length": 29.08823529411765, "alnum_prop": 0.6461071789686552, "repo_name": "Xilinx/hopper", "id": "32cd21d02a807e41374508b802e2c68dbc992cfa", "size": "4058",...
import string solve = "pythonchallenge.com/pc/def/map.html" def shift_cypher(value, orig): finish = "" for i in orig: if i.isalpha(): # cypher only works with letters if ord(i) + value > 122: # 122 is the value for 'z'. For looping value back to 'a' i = chr(97 + (ord(i) + value - 122) - 1) # 97 is 'a', ...
{ "content_hash": "b3e66e676fa755d7bf48d784fdea8e5c", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 85, "avg_line_length": 19.8, "alnum_prop": 0.6481481481481481, "repo_name": "yarabarla/python-challenge", "id": "531504bfe53e0de67d57be5668d904752b20036f", "size": "644", ...
import abc import six from nova import keymgr from nova.openstack.common import log as logging LOG = logging.getLogger(__name__) @six.add_metaclass(abc.ABCMeta) class VolumeEncryptor(object): """Base class to support encrypted volumes. A VolumeEncryptor provides hooks for attaching and detaching volumes, ...
{ "content_hash": "72d8b2a28304a2bc39e0ddbde7176d03", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 79, "avg_line_length": 29.906976744186046, "alnum_prop": 0.6835147744945568, "repo_name": "sacharya/nova", "id": "ac5331c8aa3b5733f3b0a983bea81d496bfe948e", "size": "2007",...
from __future__ import unicode_literals import frappe from frappe import _ import frappe.defaults from frappe.modules.import_file import get_file_path, read_doc_from_file from frappe.translate import send_translations from frappe.core.doctype.doctype.doctype import (clear_permissions_cache, validate_permissions_for_do...
{ "content_hash": "ddadb557f3205fbd30d4ccc495abc6ea", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 106, "avg_line_length": 33.5625, "alnum_prop": 0.7081670657089651, "repo_name": "paurosello/frappe", "id": "cc5a2998499dc5551c53e690ea74b1b574a6ab76", "size": "3860", "b...
from ingenico.connect.sdk.data_object import DataObject class Level3SummaryData(DataObject): """ Deprecated; Use ShoppingCart.amountBreakdown instead """ __discount_amount = None __duty_amount = None __shipping_amount = None @property def discount_amount(self): """ | ...
{ "content_hash": "f95378937ad3329a0d2bcc31bd5b5ed5", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 99, "avg_line_length": 31.38157894736842, "alnum_prop": 0.6352201257861635, "repo_name": "Ingenico-ePayments/connect-sdk-python3", "id": "93363c3b90e82fd68ac267a30d41214741e6...
from panda3d.core import LVector3f import DNAGroup import DNABattleCell import DNAUtil class DNAVisGroup(DNAGroup.DNAGroup): COMPONENT_CODE = 2 def __init__(self, name): DNAGroup.DNAGroup.__init__(self, name) self.visibles = [] self.suitEdges = [] self.battleCells = [] def...
{ "content_hash": "9e4f5e13f93e4504478dca1a59a359d7", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 85, "avg_line_length": 27.180555555555557, "alnum_prop": 0.629535002554931, "repo_name": "Spiderlover/Toontown", "id": "4a8e5e9d15eaa5c1a2e94048ede4309dc24808a5", "size": "...
""" Django settings for karaoke 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, ...) im...
{ "content_hash": "a4e468ccc8b78779678a7331acc72638", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 71, "avg_line_length": 25.28846153846154, "alnum_prop": 0.7258555133079848, "repo_name": "xoneco/slidesharekaraoke", "id": "2807cc2f535c5344b65afd35c7cf31360e40298c", "siz...
"""Tests for the ResourceCache class""" import copy import mock import pytest from swimlane.core.cache import ResourcesCache, check_cache from swimlane.core.resources.base import APIResource from swimlane.core.resources.record import Record def test_len(mock_app, mock_record): """Test cache length includes all...
{ "content_hash": "bb05e0f1e4782db64192792c1ca492ce", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 116, "avg_line_length": 25.70718232044199, "alnum_prop": 0.6806361487212551, "repo_name": "Swimlane/sw-python-client", "id": "ae93cfda68b2bb30534cd60fd3be948c0f5a9b0d", "s...
from app import app from flask.ext.compress import Compress app.run(debug=False, port=8080) Compress(app)
{ "content_hash": "20b0af9eacf9c5324de7c73acc793432", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 39, "avg_line_length": 21.4, "alnum_prop": 0.794392523364486, "repo_name": "starcalibre/MNIST3D", "id": "5ac489c6bd760bbf0ae612b816319d9fdd5b29e6", "size": "130", "binary"...
import os import re __all__ = [ 'branch_to_db', 'branch_to_domain', 'branch_to_slug', 'branch_to_url', 'get_active_branch_name', ] def get_active_branch_name(path=None): from git import Repo return Repo(path or os.getcwd()).active_branch.name def branch_to_domain(branch_name, domain_pa...
{ "content_hash": "90e511d9bb4c4e7269ebfc04654bc665", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 73, "avg_line_length": 27.616666666666667, "alnum_prop": 0.6155703077851539, "repo_name": "MyBook/fabric-utils", "id": "51edd8d271d7d20a0e853689016224bfb223e01e", "size": "...
from model.contact import Contact import re class ContactHelper: def __init__(self, app): self.app = app def open_contact_page(self): wd = self.app.wd if not (wd.current_url.endswith("/index.php") and len(wd.find_elements_by_name("searchstring")) > 0): wd.find_element_by_...
{ "content_hash": "9ec9fc3042d98b9852442785fe2b167d", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 143, "avg_line_length": 44.867924528301884, "alnum_prop": 0.6094407064760303, "repo_name": "kasiazubielik/python_training", "id": "2a09920aa51371b51e1cbdf9deed5b6fada2a900",...
from function_type import BuiltinFunction class SubMethod(BuiltinFunction): def __init__(self): super().__init__( self.SUB_METHOD, pos_args=["self", "other"] )
{ "content_hash": "421178f6c8b52d8607d628160fbdb93a", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 41, "avg_line_length": 22.88888888888889, "alnum_prop": 0.558252427184466, "repo_name": "PiJoules/python-type-inference", "id": "f069b2a09518eec0828200d3fd68f92a01023141", "...
from django.db import models from django.utils.translation import ugettext_lazy as _ class PaymentMethodManager(models.Manager): def get_query_set(self): qs = super(PaymentMethodManager, self).get_query_set() return qs.filter(is_enabled=True) class PaymentMethod(models.Model): TYPE_BUYSAFE =...
{ "content_hash": "de83141c2af60eb836e7dd46fec84f9b", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 77, "avg_line_length": 33.94827586206897, "alnum_prop": 0.5931945149822245, "repo_name": "uranusjr/django-buysafe", "id": "ffdb88ab79bb51fcf7750da289794eea855e218f", "size"...
import random from string import ascii_lowercase from unittest import TestCase import jwt from gargantua.utils import render_md_to_html, \ generate_passwd, validate_passwd, generate_token, validate_token class TestMarkdown(TestCase): def test_render_md_to_html(self): scenarios = ( {'md'...
{ "content_hash": "9060d9bc19281dda0b6c41d504344bfb", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 106, "avg_line_length": 32.292682926829265, "alnum_prop": 0.6193353474320241, "repo_name": "Laisky/laisky-blog", "id": "1fb542ec933f01040968c7b930f524d0ad7af468", "size": "...
from entity import Entity import project class Task(Entity): _matchon = 'task' _filter_keys = [ 'project', 'assignee', 'workspace', 'completed_since', 'modified_since' ] _fields = [ 'assignee','created_by','created_at','completed','completed_at', 'followers','modified_at','name','notes','projects','parent'...
{ "content_hash": "f6f175915a83c1ce833dad34cd99ddcb", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 83, "avg_line_length": 23.786516853932586, "alnum_prop": 0.6868209730751063, "repo_name": "mburgs/asanorm", "id": "b2b10b2be03f67f8b37ae5199196d999964d2727", "size": "2142"...
import functools import getpass import logging import time import uuid import novaclient.exceptions import novaclient.client from cloudenvy import exceptions def not_found(func): @functools.wraps(func) def wrapped(*args, **kwargs): try: return func(*args, **kwargs) except novaclie...
{ "content_hash": "b76d857b57f36df33dd352c262924f01", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 81, "avg_line_length": 32.675105485232066, "alnum_prop": 0.5910382231404959, "repo_name": "cloudenvy/cloudenvy", "id": "ce04498fa1c5c1f1471b9e69c3b5890580ad2262", "size": ...
""" Sphinx plugins for web API docs. """ import inspect import logging import re import sys try: import json except ImportError: import simplejson as json from django.contrib.auth.models import User from django.http import HttpRequest from django.template.defaultfilters import title from djblets.util.http imp...
{ "content_hash": "cce2c79e5ab38604cde075e15373e87c", "timestamp": "", "source": "github", "line_count": 994, "max_line_length": 80, "avg_line_length": 32.74849094567404, "alnum_prop": 0.5615015974440895, "repo_name": "1tush/reviewboard", "id": "f7cde07ab8969e1fd6f6d3996c6cceb4a3decca4", "size": "32...
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response from nssrc.com.citrix.netscaler.nitro.service.options import options from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_...
{ "content_hash": "ae1b8586a13dff3df4bb2a28cb7711a7", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 375, "avg_line_length": 34.422764227642276, "alnum_prop": 0.7175247992442135, "repo_name": "mahabs/nitro", "id": "d1819ec00ec77ceecb063ccf574e0576bbfc4756", "size": "4848"...
import mock # NOTE(jokke): simplified transition to py3, behaves like py2 xrange from six.moves import range from glance.domain import proxy import glance.tests.utils as test_utils UUID1 = 'c80a1a6c-bd1f-41c5-90ee-81afedb1d58d' TENANT1 = '6838eb7b-6ded-434a-882c-b344c77fe8df' class FakeProxy(object): def __ini...
{ "content_hash": "8e0ebde0c4c5c97898ef345d5106d192", "timestamp": "", "source": "github", "line_count": 288, "max_line_length": 73, "avg_line_length": 34.697916666666664, "alnum_prop": 0.6148303812668868, "repo_name": "klmitch/glance", "id": "6979cab776fc31e9683a3e9b944de879b93367c5", "size": "1065...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Action.actor_object_id' db.alter_column('actstream_action', 'actor_object_id', self.gf('django.db.models.f...
{ "content_hash": "8947093550ac936f8cba67424826f7dc", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 204, "avg_line_length": 74.55913978494624, "alnum_prop": 0.5742717046437843, "repo_name": "Eksmo/django-activity-stream", "id": "380370c627c299aef2c2f000d3c6e3cae9884bcc", ...
from __future__ import absolute_import from __future__ import print_function import csv import copy import re import json import fnmatch import hashlib import itertools import numpy as np import numexpr as ne import scipy.special import os import sys from time import clock from tqdm import tqdm import contextlib impor...
{ "content_hash": "8e378b5fb0280cb12f690bbb0bba5963", "timestamp": "", "source": "github", "line_count": 518, "max_line_length": 107, "avg_line_length": 31.77992277992278, "alnum_prop": 0.5821285384521929, "repo_name": "kratsg/optimization", "id": "933c5a9410c0332bf3039c54b38a6cfd0d4b66e4", "size": ...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from six ...
{ "content_hash": "031860b3f53d003e9e8e26936704ac6f", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 102, "avg_line_length": 36.78865979381443, "alnum_prop": 0.6361216197281772, "repo_name": "digwanderlust/pants", "id": "37b056bd09a2ceee5d445f302c2a08798704701a", "size": ...
import requests import time from testutils import prefix, api_v0 test_user = 'test_user' @prefix('test_v0_create_team') def test_api_v0_create_team(team): team_name = "v0_create_team_team" requests.delete(api_v0('teams/'+team_name)) re = requests.post(api_v0('teams'), json={"name": team_name, 'scheduling...
{ "content_hash": "b9678302e8661484db32b247c7672958", "timestamp": "", "source": "github", "line_count": 410, "max_line_length": 132, "avg_line_length": 37.41951219512195, "alnum_prop": 0.5904054230217703, "repo_name": "diegocepedaw/oncall", "id": "85c5b97b7e91ff27fdd7fb82ae850b20d03bfb0d", "size": ...
from ryu.services.protocols.bgp.signals import SignalBus class BgpSignalBus(SignalBus): BGP_ERROR = ('error', 'bgp') BGP_DEST_CHANGED = ('core', 'dest', 'changed') BGP_VRF_REMOVED = ('core', 'vrf', 'removed') BGP_VRF_ADDED = ('core', 'vrf', 'added') BGP_NOTIFICATION_RECEIVED = ('bgp', 'notificatio...
{ "content_hash": "9d1a0e2cc6a05cc6627a8c5c5965e895", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 78, "avg_line_length": 29.472727272727273, "alnum_prop": 0.5638494756323257, "repo_name": "ntts-clo/ryu", "id": "7f41c93f50406dc504e786e2adef39179169fc4d", "size": "1621", ...
from datetime import timedelta from django.db import transaction, models, router from django.utils import timezone from reversion.models import Revision, Version from reversion.management.commands import BaseRevisionCommand class Command(BaseRevisionCommand): help = "Deletes revisions for a given app [and model]...
{ "content_hash": "44045b45b0269f99e6d2ca73132010c7", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 105, "avg_line_length": 43.744680851063826, "alnum_prop": 0.5038910505836576, "repo_name": "etianen/django-reversion", "id": "cbece29d50a6f258bbb3ca55729972c2090d5e73", "si...
import jasy.core.FlagSet as FlagSet import jasy.script.optimize.CryptPrivates as CryptPrivates import jasy.script.optimize.BlockReducer as BlockReducer import jasy.script.optimize.LocalVariables as LocalVariables import jasy.script.optimize.CombineDeclarations as CombineDeclarations import jasy.script.optimize.Closure...
{ "content_hash": "a35d811470f4f6dc9a94c45865d15238", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 110, "avg_line_length": 30.3, "alnum_prop": 0.6317774634606318, "repo_name": "sebastian-software/jasy", "id": "3b823a14f4e57f5c9eaa746a235280f9fa4f981e", "size": "2229", ...
import unittest import IECore import Gaffer import GafferTest class ProceduralHolderTest( unittest.TestCase ) : def testType( self ) : n = Gaffer.ProceduralHolder() self.assertEqual( n.typeName(), "Gaffer::ProceduralHolder" ) self.failUnless( n.isInstanceOf( Gaffer.ParameterisedHolderComputeNode.staticType...
{ "content_hash": "f16b31a5730e274bb0eba297fcadfd5b", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 120, "avg_line_length": 32.42622950819672, "alnum_prop": 0.7067745197168858, "repo_name": "davidsminor/gaffer", "id": "ce92a45192f34d748ea94dcffef07d502dd48add", "size": "3...
"""Define the Django Silk setup.""" import os from setuptools import setup # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) README = open('README.md', 'rb').read().decode("UTF-8") setup( name='django-silk', version='3.0.4', packages=[...
{ "content_hash": "393e5b15b28bae1fe7566141173c98e1", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 78, "avg_line_length": 32.5, "alnum_prop": 0.5789173789173789, "repo_name": "mtford90/silk", "id": "ebc938ca4ccff78affdf4c9d601408eac39b24e4", "size": "1779", "binary": f...
""" Unit tests for Spark ML Python APIs. """ import sys if sys.version_info[:2] <= (2, 6): try: import unittest2 as unittest except ImportError: sys.stderr.write('Please install unittest2 to test with Python 2.6 or earlier') sys.exit(1) else: import unittest from pyspark.tests imp...
{ "content_hash": "f8ff79f7adc6a4ae310bd95c9e2f5609", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 98, "avg_line_length": 31.071428571428573, "alnum_prop": 0.6400656814449918, "repo_name": "hengyicai/OnlineAggregationUCAS", "id": "b627c2b4e930bf5e5a2e36b671f3a2000cd11054",...
from lxml import etree from glob import iglob from pprint import pprint import tarfile from common import EXPORTS_PATH def ted_documents(): for compl in iglob(EXPORTS_PATH + '/*.tgz'): tf = tarfile.open(compl, 'r:gz') for member in tf.getmembers(): if not member.name.endswith('.xml'): ...
{ "content_hash": "c44197ed9697313a9c313f3bab657430", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 63, "avg_line_length": 26.568421052631578, "alnum_prop": 0.49247226624405704, "repo_name": "pudo-attic/ted-xml", "id": "37859378406dac65aa3332349cfe711de229ef2f", "size": "...
from nltk.corpus import gutenberg from nltk import ConditionalFreqDist from random import choice cfd = ConditionalFreqDist() prev_word = None for word in gutenberg.words('austen-persuasion.txt'): cfd[prev_word][word] += 1 prev_word = word word = 'therefore' i = 1 # Find all words that can possibly follow the...
{ "content_hash": "ac7843eb777b0fecd71b84c15edb4543", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 58, "avg_line_length": 23.666666666666668, "alnum_prop": 0.6941649899396378, "repo_name": "desilinguist/acm-crossroads-nltk", "id": "14ab8f9153c7369a383c8b37bc4e8db40cb84e38"...
from tempest import cli from tempest import config from tempest import exceptions from tempest.openstack.common import log as logging CONF = config.CONF LOG = logging.getLogger(__name__) class SimpleReadOnlyNovaManageTest(cli.ClientTestBase): """ This is a first pass at a simple read only nova-manage test....
{ "content_hash": "c04dad862b44617b179c95fdb61c2afa", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 78, "avg_line_length": 32.63095238095238, "alnum_prop": 0.6056183874498359, "repo_name": "Mirantis/tempest", "id": "dae0cf860593e1abda5ef328d2c7d59ae5c9c433", "size": "3377...
""" Interfaces for Hadoop filesystem access via HttpFs/WebHDFS """ import errno import logging import posixpath import stat import threading import time from django.utils.encoding import smart_str from django.utils.translation import ugettext as _ from desktop.lib.rest import http_client, resource from hadoop.fs impo...
{ "content_hash": "1276176e2c07dd5a5b9ca135cdfad418", "timestamp": "", "source": "github", "line_count": 875, "max_line_length": 133, "avg_line_length": 29.461714285714287, "alnum_prop": 0.6320260677295473, "repo_name": "nvoron23/hue", "id": "412d85eea5a3a06545ac166ed4858571ec2ee504", "size": "26571...
""" Implements a global range check used to filter out very obvious errors. """ from util import obs_utils def test(p, parameters): """ Runs the quality control check on profile p and returns a numpy array of quality control decisions with False where the data value has passed the check and True w...
{ "content_hash": "cb48bd910d3aafd1ed65cefe0d8a33bb", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 74, "avg_line_length": 26.666666666666668, "alnum_prop": 0.653125, "repo_name": "IQuOD/AutoQC", "id": "f0a21149dede7c530abd7111804291f5280dce97", "size": "640", "binary":...
from gm_pr.models import Project, Repo def proj_repo(request): """ Retrieve project list from a Slack request or web request. Parameter come from GET and can be either 'channel_name' or 'project' (they both give the same result) return a tuple: list of projects, channel name """ repos = None ...
{ "content_hash": "29a8d335f036a33c76c2b58a85a10ecd", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 79, "avg_line_length": 33.75, "alnum_prop": 0.6459259259259259, "repo_name": "Genymobile/gm_pr", "id": "895669c32c67879d66bc02f7ea752e9fcfb38ed7", "size": "1252", "binary...
import frappe import unittest from frappe.test_runner import make_test_objects test_records = frappe.get_test_records('Email Domain') class TestDomain(unittest.TestCase): def setUp(self): make_test_objects('Email Domain', reset=True) def tearDown(self): frappe.delete_doc("Email Account", "Test") frappe.dele...
{ "content_hash": "7d417084854398c692bc141c70058c58", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 79, "avg_line_length": 36.47222222222222, "alnum_prop": 0.7555217060167555, "repo_name": "mhbu50/frappe", "id": "7522dd5282ebdef7b388a309a1dcfa4b8b2c5a60", "size": "1434", ...
import bsp as openmoto_bsp # bsp should point to the bsp file for your hw import threading import time # Thread class for PWM Turn signals class turnThread (threading.Thread): def __init__(self, threadID, name, output, event): threading.Thread.__init__(self) self.threadID = threadID se...
{ "content_hash": "eeb5297a22e87999a015fe58b6264f3d", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 92, "avg_line_length": 37.509803921568626, "alnum_prop": 0.5812859383167799, "repo_name": "hakmo/openmoto", "id": "5a33c23a9a17fba06f0d76791720a958391fc186", "size": "1984"...
import string s = "The Lion, the Witch and the Ward-Robe" # clint's text s = "The Lion, the Witch, and the Ward-robe" # bea's text exclude = set(string.punctuation) s = ''.join(ch for ch in s if ch not in exclude).lower() print s
{ "content_hash": "7c587819c1217f30c004ae31a3017ee4", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 58, "avg_line_length": 25.88888888888889, "alnum_prop": 0.6824034334763949, "repo_name": "FantasyFactionTools/contest-ebooks", "id": "af1242a8cc59e32646c9efd1a8837d7ea5582573"...
import os from os.path import sep, join, exists from itertools import groupby from xml.etree.ElementTree import Element, tostring import re import json from tools.arm_pack_manager import Cache from tools.targets import TARGET_MAP from tools.export.exporters import Exporter, TargetNotSupportedException from tools.utils...
{ "content_hash": "c92e8ddf39cc6cb9d680c199f51d77f8", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 88, "avg_line_length": 36.4472049689441, "alnum_prop": 0.5625426039536469, "repo_name": "betzw/mbed-os", "id": "e0403aedf27c5f0632a8a75aa56349b545da8ef5", "size": "5868", ...
import re # Separates a tag: at the beginning of the subject from the rest of it re_subject_tag = re.compile('([^:\s]*):\s*(.*)') class Commit: """Holds information about a single commit/patch in the series. Args: hash: Commit hash (as a string) Variables: hash: Commit hash subje...
{ "content_hash": "18b895a7682a152e6cc7c7c0632501f1", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 75, "avg_line_length": 30.10144927536232, "alnum_prop": 0.5671641791044776, "repo_name": "EleVenPerfect/S3C2440", "id": "89cce7f88a297dd32e486cd3cd1a7a0ef7819332", "size": ...
""" Install any components that fall under 'galaxy_tools' directive in main.yaml """ from cloudbio.galaxy.tools import _install_tools from cloudbio.custom.galaxy import _prep_galaxy def install_cbl_galaxy_tools(env): _prep_galaxy(env) _install_tools(env)
{ "content_hash": "f4bdf497105776e1dab5789841553fbc", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 76, "avg_line_length": 26.5, "alnum_prop": 0.7509433962264151, "repo_name": "chapmanb/cloudbiolinux", "id": "5376cff9a0f1ee2033471cd430e4062ec1a648f8", "size": "265", "bi...
import unittest from decimal import Decimal from posixpath import join as pjoin import numpy as np import pandas as pd import pytest import ibis import ibis.backends.impala as api # noqa: E402 import ibis.common.exceptions as com import ibis.expr.datatypes as dt import ibis.expr.rules as rules import ibis.expr.types...
{ "content_hash": "3d7df9fc2f1f8242c478cf530e8d68b0", "timestamp": "", "source": "github", "line_count": 634, "max_line_length": 78, "avg_line_length": 29.518927444794954, "alnum_prop": 0.5683141864814321, "repo_name": "cloudera/ibis", "id": "bba4da5a62c0fbda9202a2bba7d952f13199696e", "size": "18715...