text
stringlengths
4
1.02M
meta
dict
from airflow.contrib.hooks.imap_hook import ImapHook from airflow.sensors.base_sensor_operator import BaseSensorOperator from airflow.utils.decorators import apply_defaults class ImapAttachmentSensor(BaseSensorOperator): """ Waits for a specific attachment on a mail server. :param attachment_name: The na...
{ "content_hash": "4ea5a53d9ff5df65eaaecf42d2c0200a", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 98, "avg_line_length": 38.80701754385965, "alnum_prop": 0.6098553345388789, "repo_name": "fenglu-g/incubator-airflow", "id": "c0eb9b6cd22c3057c511c483b8191a9181553eb5", "si...
"""Tests for unicode_data.py.""" __author__ = "[email protected] (Roozbeh Pournader)" import unittest from nototools import unicode_data class UnicodeDataTest(unittest.TestCase): """Tests for unicode_data module.""" def test_name(self): """Tests the name() method.""" self.assertEqual("WAR...
{ "content_hash": "8333bdf750ee11f378b2e146dfe7f646", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 88, "avg_line_length": 44.85507246376812, "alnum_prop": 0.6583198707592892, "repo_name": "googlei18n/nototools", "id": "15ad71821be4a8cb9135e38c635afdfddb0668d0", "size": ...
league_schema_name = None def tn(tablename: str) -> str: if league_schema_name is not None: return '`{0}`.`{1}`'.format(league_schema_name, tablename) else: return '`{0}`'.format(tablename)
{ "content_hash": "5b8b5c5c4c50ef97bee0d9cd943e58b5", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 66, "avg_line_length": 27, "alnum_prop": 0.6111111111111112, "repo_name": "incnone/necrobot", "id": "dbc68366610d58b392a7781da0696038447e1120", "size": "216", "binary": fa...
import os from logshipper.tail import Tail from st2reactor.sensor.base import Sensor class FileWatchSensor(Sensor): def __init__(self, sensor_service, config=None): super(FileWatchSensor, self).__init__(sensor_service=sensor_service, config=config) s...
{ "content_hash": "caaa22e788cdfcf45fb22f6d39935e12", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 76, "avg_line_length": 27.25925925925926, "alnum_prop": 0.5665760869565217, "repo_name": "grengojbo/st2", "id": "9c4e32fb36d5d25a63b24814a0af38a60abf4a06", "size": "1472", ...
from __future__ import print_function from setuptools import setup description = "Git commit message linter written in python, checks your commit messages for style." long_description = """ Great for use as a commit-msg git hook or as part of your gating script in a CI pipeline (e.g. jenkins, github actions). Many of ...
{ "content_hash": "f9f502d9d4d038fc0768384cbaf77b0a", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 120, "avg_line_length": 42.63492063492063, "alnum_prop": 0.6809381980640358, "repo_name": "jorisroovers/gitlint", "id": "b94cd50e1cb06b0c5ba68a8c653472fc12b85b1e", "size": ...
import os import tempfile import time import types from ironic_lib import disk_utils import mock from oslo_concurrency import processutils from oslo_config import cfg from oslo_utils import uuidutils import testtools from testtools import matchers from ironic.common import boot_devices from ironic.common import excep...
{ "content_hash": "c9ff93f88dd1729bcf19827ae5a57bfa", "timestamp": "", "source": "github", "line_count": 2557, "max_line_length": 79, "avg_line_length": 42.03011341415721, "alnum_prop": 0.5856277507420606, "repo_name": "jiazichenzhan/Server_Manage_Plugin", "id": "a8e8d05dd054a52d84e1f676baee81f573b6be...
"""This code example creates new labels. To determine which labels exist, run get_all_labels.py. This feature is only available to DFP premium solution networks.""" import uuid # Import appropriate modules from the client library. from googleads import dfp def main(client): # Initialize appropriate service. ...
{ "content_hash": "b034a638723272f13c749355779c7cda", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 77, "avg_line_length": 25.973684210526315, "alnum_prop": 0.6474164133738601, "repo_name": "haveal/googleads-python-lib", "id": "c9f2d4a3abf9ebd598adf4ab8b5664b6429e4397", "...
import os import json import datetime from pprint import pprint from copy import deepcopy import numpy as np import pandas as pd from tqdm.notebook import tqdm # #### Configuration # In[2]: ROOT = '..' # In[3]: datafile_date = '2020-03-27-v5' # In[4]: PROCESS_SMALL_DOCS = False # Small docs are the indiv...
{ "content_hash": "ad35791dabcd9c9a4b869a6a165b239c", "timestamp": "", "source": "github", "line_count": 419, "max_line_length": 148, "avg_line_length": 21.083532219570404, "alnum_prop": 0.5619198551052751, "repo_name": "roaminsight/roamresearch", "id": "0bb97b2e2403724c36f12b45f54930d1ce5ba040", "s...
from ggrc import db from .mixins import BusinessObject, Timeboxed, CustomAttributable from .object_owner import Ownable from .object_person import Personable from .relationship import Relatable from .track_object_state import HasObjectState, track_state_for_class class OrgGroup(HasObjectState, CustomAttributable, ...
{ "content_hash": "6896d3e910d6666e44362993e103f732", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 69, "avg_line_length": 34.6, "alnum_prop": 0.7475915221579962, "repo_name": "josthkko/ggrc-core", "id": "02ae4a22d03ffd24480b017b7e383ee90ba66f77", "size": "632", "binary...
from novaclient import extension from novaclient.tests import utils from novaclient.tests.v1_1 import fakes from novaclient.v1_1.contrib import migrations extensions = [ extension.Extension(migrations.__name__.split(".")[-1], migrations), ] cs = fakes.FakeClient(extensions=extensions) cla...
{ "content_hash": "6d3ff7b81170f5d5b99c2caa44500904", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 68, "avg_line_length": 32.464285714285715, "alnum_prop": 0.6314631463146315, "repo_name": "neumerance/cloudloon2", "id": "7b49c4cc70e84ac13432dcc0c655d8de1a2a8e07", "size":...
"""Tests for the GTFlow split handler Ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import random from tensorflow.contrib.boosted_trees.proto import learner_pb2 from tensorflow.contrib.boosted_trees.proto import split_info_pb2 from tensorflow.con...
{ "content_hash": "3b18d439e2fa5e3607eea56d9bdc309a", "timestamp": "", "source": "github", "line_count": 671, "max_line_length": 80, "avg_line_length": 41.83904619970194, "alnum_prop": 0.5997720310607679, "repo_name": "ZhangXinNan/tensorflow", "id": "2589504762787deaf598777650b8372320824c22", "size"...
class ImageFinder: ''' Inteface / Abstract Class concept for readability.''' def find(self, image): # explicitly set it up so this can't be called directly raise NotImplementedError('Exception raised, ImageFinder is supposed to be an interface / abstract class!') class ImageFinderFlickr(Im...
{ "content_hash": "e0538ede898910226c46fbcdad518fb7", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 115, "avg_line_length": 28.53488372093023, "alnum_prop": 0.6536267318663407, "repo_name": "lmokto/py-designpattern", "id": "89e00f2932823cd5f6f4596e98a1a577bd11bab2", "size...
from __future__ import absolute_import from json import loads from ...core.json_encoder import serialize_json from ...document.util import references_json from ..message import Message from . import register @register class patch_doc_1(Message): ''' Define the ``PATCH-DOC`` message (revision 1) for sending Docum...
{ "content_hash": "75513499e585e2e546a35363d0f8b833", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 99, "avg_line_length": 27.76530612244898, "alnum_prop": 0.6277104005880191, "repo_name": "rs2/bokeh", "id": "ec65c7f89be671739b9af27c8f7813008c5970e4", "size": "2721", "b...
from __future__ import division, print_function, absolute_import import amitgroup as ag import numpy as np from pnet.layer import Layer @Layer.register('intensity-threshold-layer') class IntensityThresholdLayer(Layer): def __init__(self, threshold=0.5): self._threshold = threshold def _extract(self,...
{ "content_hash": "93c302a5f41920ed7e31423713cc770f", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 65, "avg_line_length": 26.727272727272727, "alnum_prop": 0.6615646258503401, "repo_name": "amitgroup/parts-net", "id": "e6ec518ffdf06f9717aa6741b0af0ad3c784f95e", "size": "...
"""Modify Group Entry Message.""" from enum import IntEnum from pyof.foundation.base import GenericMessage from pyof.foundation.basic_types import ( FixedTypeList, Pad, UBInt8, UBInt16, UBInt32) from pyof.v0x04.common.header import Header, Type from pyof.v0x04.controller2switch.common import Bucket __all__ = ('Gr...
{ "content_hash": "c9b8c8f60d313e7a7f8979575dfdc0e8", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 78, "avg_line_length": 29.397849462365592, "alnum_prop": 0.6349670811997074, "repo_name": "cemsbr/python-openflow", "id": "17771251d020b07aea0177b11eb23e68d818ca95", "size"...
from version import __VERSION__, VERSION from _jep import * from hook import * class JavaException(Exception): def __init__(self, er): # error is "classname: message" clazz, message = er.split(':', 1) super(JavaException, self).__init__(message) # the java class name of exception ...
{ "content_hash": "35f9f9fbe6403f6d009fa6cc4b0b4629", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 52, "avg_line_length": 31.727272727272727, "alnum_prop": 0.6246418338108882, "repo_name": "hydrosolutions/model_RRMDA_Themi", "id": "30a53d5aedbb0efbc0ef87bb188d2968850522a9"...
import pexpect import sys from getpass import getpass import time import re def main(): DeviceIp = '184.105.247.71' User = 'pyclass' Port = 22 Pass = getpass() SSHconn = pexpect.spawn('ssh -l {} {} -p {}'.format(User, DeviceIp, Port)) SSHconn.timeout = 5 SSHconn.expect('assword:') SSH...
{ "content_hash": "090f1652f058c08939526de8e4010932", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 78, "avg_line_length": 22.8, "alnum_prop": 0.6140350877192983, "repo_name": "brutalic/pynet_brutal", "id": "93905e1c7d87b4e935389e1fbe427a9561c483a2", "size": "707", "bin...
"""Tests for Renault selects.""" from unittest.mock import patch import pytest from renault_api.kamereon import schemas from homeassistant.components.select import ( ATTR_OPTION, DOMAIN as SELECT_DOMAIN, SERVICE_SELECT_OPTION, ) from homeassistant.config_entries import ConfigEntry from homeassistant.const...
{ "content_hash": "19a953de2e8bc698557c4daa171af32b", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 83, "avg_line_length": 35.174193548387095, "alnum_prop": 0.7267057960381511, "repo_name": "nkgilley/home-assistant", "id": "8ab9f116dbab5c01efadc2ca46bb8e5e8f34981a", "siz...
from .visitor import unwrap def cron(spec=None, **kwargs): """Decorator to mark a task as being on a cron schedule.""" if not (spec or kwargs): raise ValueError('You must pass either a cron spec or keyword arguments') def decorator(fn): original = unwrap(fn) original.rundeck_cron = ...
{ "content_hash": "98e76b1e4e1c140bd6835aa7c16495b1", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 81, "avg_line_length": 22.91304347826087, "alnum_prop": 0.6091081593927894, "repo_name": "coderanger/fabric-rundeck", "id": "80d83a2b05ecdd2265f9576cea41579980245bf3", "siz...
""" DataObject is just a dictionary with only a name attribute and rooms for other hooks. $Id: DataObject.py 11 2005-12-24 09:13:33Z duan $ """ __version__='$Revision: 11 $'[11:-2] __author__ = "Duan Guoqiang ([email protected])" import util class DataObject(dict): """ DataObject is_a dict. """ ...
{ "content_hash": "3b363fefeb8f140bd6ae253e1a70636d", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 70, "avg_line_length": 28.071428571428573, "alnum_prop": 0.4770992366412214, "repo_name": "mattduan/codegen", "id": "69134e747d17ef64eb3f9e051e3340d5c610b4de", "size": "256...
""" Test extension array for storing nested data in a pandas container. The ListArray stores an ndarray of lists. """ from __future__ import annotations import numbers import random import string import numpy as np from pandas._typing import type_t from pandas.core.dtypes.base import ExtensionDtype import pandas ...
{ "content_hash": "2c137cc4c04f2d9334df53f95f870f1e", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 85, "avg_line_length": 28.984848484848484, "alnum_prop": 0.5852064819654992, "repo_name": "pandas-dev/pandas", "id": "f281a0f82e0e735a7c0aefa81a3266854cfebb13", "size": "3...
from __future__ import unicode_literals import os import sys import pbr.version sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))) # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the d...
{ "content_hash": "105fc2b8b0b77343bc6bf2056f3928d5", "timestamp": "", "source": "github", "line_count": 216, "max_line_length": 79, "avg_line_length": 32.36574074074074, "alnum_prop": 0.700328994421399, "repo_name": "magic0704/python-keystoneclient", "id": "593d7e235c13b306c8b63b1c5082c906f84f5b81", ...
""" Utilities that help wikibot scripts. This script should be imported in all scripts rather than directly importing pywikibot, as it handles exceptions when importing pywikibot appropriately. """ from __future__ import (division, absolute_import, unicode_literals, print_function) import logg...
{ "content_hash": "7f129c8826ceb9226086ab7da64eb618", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 78, "avg_line_length": 37.6985294117647, "alnum_prop": 0.5923542032377609, "repo_name": "pywikibot-catfiles/file-metadata", "id": "74db29d1c3525890b2cf2f46205c780ce2d82b59",...
import json import math import multiprocessing import optparse import os from os.path import join import random import shlex import subprocess import sys import time from testrunner.local import execution from testrunner.local import progress from testrunner.local import testsuite from testrunner.local import utils fr...
{ "content_hash": "a32026a853112aec0ec8e7c59997f300", "timestamp": "", "source": "github", "line_count": 469, "max_line_length": 80, "avg_line_length": 34.430703624733475, "alnum_prop": 0.5974114441416893, "repo_name": "kingland/runtime", "id": "928c71b743a44a5871c5434412f51c388f55c142", "size": "17...
""" Run unittests for a given set of functions """ import os import subprocess as sp import sys from termcolor import cprint from .utils import env_manager from .utils.findfunc import find_manifest def fancy_print(header, msg): cprint(header + ": ", 'blue', end='') cprint(msg, 'yellow') def setup_parser(p...
{ "content_hash": "287fbdda820f62d48f151dbb5b8384cc", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 103, "avg_line_length": 28.142857142857142, "alnum_prop": 0.6395939086294417, "repo_name": "balihoo/blambda", "id": "3bef3fdbbc4a75241f8ca38561cd97130f4d9169", "size": "118...
print("################################################################################") print("# Implementation of a multivariate pattern analysis based on the scikitlearn ") print("# toolbox (http://scikit-learn.org/stable/). It reads a matlab file containing ") print("# Xm: a matrix of trials x chans x...
{ "content_hash": "05e224cbceda43287cf169cf31078855", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 109, "avg_line_length": 42.5, "alnum_prop": 0.5657439446366782, "repo_name": "cjayb/kingjr_natmeg_arhus", "id": "6c102ff8811f47292db141e11ffcdadbdee4f208", "size": "8670",...
class Holder(object): def __init__(self, value, start_line=None, start_column=None, end_line=None, end_column=None, filename=None): self.value = value self.start_line = start_line self.star...
{ "content_hash": "9ea035c40619e7d4a5b97cb7fc683e57", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 79, "avg_line_length": 35.73170731707317, "alnum_prop": 0.5290102389078498, "repo_name": "cloudify-cosmo/cloudify-dsl-parser", "id": "1ccff6eda2308afea1b9c1541f2e10d790511879...
'''Logicni elementi za Boolove formule.''' class Var: '''Razred za spremenljivke.''' def __init__(self, name): self.name = name def evaluate(self, assignments={}): '''Funkcija, ki vraca vrednost spremenljivke.''' return (self.setVariables(assignments)) def setVariables(self, ...
{ "content_hash": "b509e9b70f58ec2737bb06fb59f4b700", "timestamp": "", "source": "github", "line_count": 460, "max_line_length": 112, "avg_line_length": 30.854347826086958, "alnum_prop": 0.5239202423730007, "repo_name": "urska19/LVR-sat", "id": "d6adaf0a988581fe87bd0811f6df62b957993fd8", "size": "14...
import atexit from operator import attrgetter from abc import ABCMeta, abstractmethod from .util import StrKeyDict HIGH = 'HIGH' LOW = 'LOW' # TODO: More implementations: IN, OUT, ANALOG, PWM, # ... IC2, SERIAL, SERVO, INTERRUPTION IN = 'IN' OUT = 'OUT' ANALOG = 'ANALOG' PWM = 'PWM' class WrongPinMode(Exception): ...
{ "content_hash": "a0030230bc5f687a39dcb9ee42814b1c", "timestamp": "", "source": "github", "line_count": 454, "max_line_length": 84, "avg_line_length": 30.526431718061673, "alnum_prop": 0.5903023306154845, "repo_name": "Vido/pingo", "id": "b9f3c2e0f5a539664f6e6b9e90b6e0574e2405a9", "size": "13912", ...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('ep', '0001_initial'), ] operations = [ migrations.CreateModel( name='PrefectDeviceP...
{ "content_hash": "e6af5cac3c0d79a23ab90877c9571913", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 137, "avg_line_length": 32.17857142857143, "alnum_prop": 0.5937846836847946, "repo_name": "dschien/energy-aggregator", "id": "752252a6f24b65190d8976e2f377c0f62ab37ea6", "si...
""" Memory commands test module """ from tests.utils import ( GefUnitTestGeneric, gdb_run_cmd, gdb_start_silent_cmd, _target, ) class MemoryCommand(GefUnitTestGeneric): """ `memory` command testing module""" def test_cmd_memory_watch(self): self.assertFailIfInactiveSession(gdb_run_c...
{ "content_hash": "12e3fb45a7a5e6b69c50da1cc7b986e1", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 75, "avg_line_length": 36.76190476190476, "alnum_prop": 0.5785837651122625, "repo_name": "hugsy/gef", "id": "aed65ce704cd9355c7bde1bc2ab1f773e87b2699", "size": "2316", "b...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import collections import inspect import sys from abc import abstractmethod from functools import update_wrapper import six from pants.build_graph.address import Add...
{ "content_hash": "4686c3b95f224ced98d8ca4303509527", "timestamp": "", "source": "github", "line_count": 461, "max_line_length": 100, "avg_line_length": 38.017353579175705, "alnum_prop": 0.6635284719844802, "repo_name": "mateor/pants", "id": "048d8d67de909e41b204b257125cb6dbbbefe2e2", "size": "17673...
import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configurat...
{ "content_hash": "cb9aeb225950f640cc947ed39b660fb3", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 80, "avg_line_length": 32.23580786026201, "alnum_prop": 0.7037388241668925, "repo_name": "Ziftr/counterpartyd", "id": "152846cf94a3faf3556edff92907751427eae195", "size": "...
import textwrap from lymph.client import Client from lymph.cli.base import Command, handle_request_errors class InspectCommand(Command): """ Usage: lymph inspect [--ip=<address> | --guess-external-ip | -g] <address> [options] Options: --ip=<address> Use this IP for all sockets. ...
{ "content_hash": "126feefaaf2cf349c9cbcf1f8a826eee", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 88, "avg_line_length": 33.21052631578947, "alnum_prop": 0.5689381933438986, "repo_name": "itakouna/lymph", "id": "4be48aecab7e3ecd7f3a6e7c73f6e020f38018d3", "size": "1262",...
""" Sandwich demo based on code from http://nbviewer.ipython.org/6576096 """ import numpy as np from matplotlib import pyplot as plt from sklearn.metrics import pairwise_distances from sklearn.neighbors import NearestNeighbors from metric_learn import LMNN, ITML_Supervised, LSML_Supervised, SDML_Supervised def sand...
{ "content_hash": "1e5e082ecde93367e216bdd59bd6f8c0", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 80, "avg_line_length": 28.967741935483872, "alnum_prop": 0.6551596139569413, "repo_name": "terrytangyuan/metric-learn", "id": "34b48a00b074587d5c8fbfd41ca7c75a59ae2f47", "s...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' lookup: aws_ssm author: - Bill Wang <ozbillwang(at)gmail.com> - Marat Bakeev <hawara(at)gmail.com> - Michael De La Rue <[email protected]> version_added: 2.5 requirements: - boto3 - bot...
{ "content_hash": "90cf8b8d32f2720ea38fb2adc43d57e6", "timestamp": "", "source": "github", "line_count": 223, "max_line_length": 154, "avg_line_length": 45.72645739910314, "alnum_prop": 0.6429341963322546, "repo_name": "SergeyCherepanov/ansible", "id": "39d0175c394d4532bdfea66a9f9b86f3e09b5b1f", "si...
from nodetraq.tests import * class TestDnsController(TestController): def test_index(self): response = self.app.get(url(controller='dns', action='index')) # Test response...
{ "content_hash": "50db722e9ffcd1c2f6ee42bd9fa0aa9a", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 70, "avg_line_length": 28, "alnum_prop": 0.673469387755102, "repo_name": "seryl/Nodetraq", "id": "27555016e75e0f7e5f4d7b2b33bb256757620e00", "size": "196", "binary": false...
"""This module is deprecated. Please use :mod:`airflow.providers.docker.operators.docker_swarm`.""" import warnings from airflow.providers.docker.operators.docker_swarm import DockerSwarmOperator # noqa warnings.warn( "This module is deprecated. Please use `airflow.providers.docker.operators.docker_swarm`.", ...
{ "content_hash": "8f262407da895ca0f764a7024ef81d7e", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 99, "avg_line_length": 32.90909090909091, "alnum_prop": 0.7707182320441989, "repo_name": "danielvdende/incubator-airflow", "id": "b023da796a4c83c5f0795d440d94191548486793", ...
from django.conf.urls import url from payments import views urlpatterns = [ url(r'^stripe/charge', views.stripe_charge_view, name='stripe'), url(r'^paypal/success', views.paypal_success_view, name='paypal_success'), url(r'^paypal/cancel', views.paypal_cancel_view, name='paypal_cancel'), ]
{ "content_hash": "59cd450c535f594765ef0c3d32bb46ab", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 78, "avg_line_length": 37.875, "alnum_prop": 0.7161716171617162, "repo_name": "pdiazv/makaw", "id": "522ba4d656fd8c2280baa33318addcc82c197787", "size": "327", "binary": fa...
import os from datetime import datetime, timedelta from django.core.files import File from survey.services.csv_uploader import CSVUploader, UploadService from survey.tests.base_test import BaseTest from survey.models import UploadErrorLog from django.utils.timezone import utc class CSVUploaderTest(BaseTest): de...
{ "content_hash": "0a116fb4750b6e63b1d0b434af960de2", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 126, "avg_line_length": 42.82142857142857, "alnum_prop": 0.6530442035029191, "repo_name": "unicefuganda/mics", "id": "17d9063c09a41dee5c98eef579a027ff1755b550", "size": "35...
"""\ Move files from "uploading" to "in progress". Example: %(prog)s --username ACCESS_KEY_ID --password SECRET_ACCESS_KEY \\ --input check_files.log https://www.encodeproject.org """ import json import requests import sys try: from urllib.parse import urljoin except ImportError: from urlparse im...
{ "content_hash": "fc5d5eb17056997602811383b221f034", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 97, "avg_line_length": 31, "alnum_prop": 0.5649193548387097, "repo_name": "kidaa/encoded", "id": "04e039750aa61c93f1e818bd75889a210b15671e", "size": "2480", "binary": fal...
from setuptools import find_packages from setuptools import setup REQUIRED_PACKAGES = [ 'torch==1.11.0', 'transformers', 'datasets', 'tqdm' ] setup( name='trainer', version='0.1', install_requires=REQUIRED_PACKAGES, setup_requires=REQUIRED_PACKAGES, packages=find_packages(), in...
{ "content_hash": "5152f17a0191cb2235c455d887fd9c9f", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 89, "avg_line_length": 23, "alnum_prop": 0.6864988558352403, "repo_name": "GoogleCloudPlatform/ai-platform-samples", "id": "97b25842e509cacb75ed002665ad6b85e7c4cef0", "size...
from django.template.defaultfilters import slugify from django.contrib.auth.models import User from django.core.validators import validate_email, ValidationError from django.db.models import EmailField from django.utils.http import urlencode from django.contrib.auth import REDIRECT_FIELD_NAME from django.utils import i...
{ "content_hash": "d5110455b31bc1466bf0afc465d45cd2", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 69, "avg_line_length": 28.51764705882353, "alnum_prop": 0.6377887788778878, "repo_name": "1st/django-allauth", "id": "4df5197f15bd99bf6c2439a82b5751b5bde22a79", "size": "24...
import logging from redis import StrictRedis from django.conf import settings logger = logging.getLogger('django.request') redis_connection = StrictRedis.from_url(settings.REDIS_URL) def try_redis_call(method_name, *args, **kwargs): method = getattr(redis_connection, method_name) default = kwargs.pop('defaul...
{ "content_hash": "675fb8388e078468e1f3c1a35c835c8e", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 69, "avg_line_length": 34.4, "alnum_prop": 0.6773255813953488, "repo_name": "reverie/jotleaf.com", "id": "8f2887f2e8fec94693f30537b43ed669f41fa485", "size": "688", "binar...
""" Django settings for server project. Generated by 'django-admin startproject' using Django 1.10.1. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os ...
{ "content_hash": "d57fb8719a5957e18b1dbf031d00cfe4", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 91, "avg_line_length": 25.447154471544714, "alnum_prop": 0.6846645367412141, "repo_name": "Likegram/study_run", "id": "e4c542fe3cdf10735c11570c2dbfc941db54317e", "size": "...
def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('control', parent_package, top_path) config.add_subpackage('tests') return config
{ "content_hash": "667c1e2cb19611e252c0a68b84d574d3", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 63, "avg_line_length": 45.2, "alnum_prop": 0.7389380530973452, "repo_name": "roryyorke/python-control", "id": "3ed3e3a7e2f171af07a1f281be59802375a951d7", "size": "226", "b...
import sys print('using print') sys.stdout.write('using sys.stdout.write') sys.stderr.write('using sys.stderr.write') import logging logging.debug('Debug') logging.info('Info') logging.warning('Warning') logging.error('Error') # # HTML outputs # # Using `pandas`. Here we find two representations: both text and HTML. ...
{ "content_hash": "f7b8ae7fe05df38a5c411ed1017d1e53", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 71, "avg_line_length": 18.4468085106383, "alnum_prop": 0.6839677047289504, "repo_name": "mwouts/jupytext", "id": "76ef61020be2fe8e1048851c27d475cba458a8ed", "size": "1179",...
"""slycot_convert_test.py - test SLICOT-based conversions RMM, 30 Mar 2011 (based on TestSlycot from v0.4a) """ import numpy as np import pytest from control import bode, rss, ss, tf from control.tests.conftest import slycotonly numTests = 5 maxStates = 10 maxI = 1 maxO = 1 @pytest.fixture(scope="module") def fix...
{ "content_hash": "86089b209d0e0533e03ed52c1c6d60ed", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 76, "avg_line_length": 42.83568075117371, "alnum_prop": 0.60861464270057, "repo_name": "murrayrm/python-control", "id": "edd355b3bc4a9a1cd48a3b8e85de67007ef69c95", "size":...
import optparse import os import time import unittest from webkitpy.common.system import executive_mock from webkitpy.common.system.executive_mock import MockExecutive2 from webkitpy.common.system.systemhost_mock import MockSystemHost from webkitpy.layout_tests.port import android from webkitpy.layout_tests.port impo...
{ "content_hash": "6023ce7b786d5f2a36b6bf8bbd3653af", "timestamp": "", "source": "github", "line_count": 299, "max_line_length": 159, "avg_line_length": 48.39799331103679, "alnum_prop": 0.6548268951696496, "repo_name": "heke123/chromium-crosswalk", "id": "42a052d9b34b1674d5c3050e2ce2d928506aeb06", "...
{ 'name': 'Audit Trail', 'version': '1.0', 'category': 'Tools', 'description': """ This module lets administrator track every user operation on all the objects of the system. =========================================================================================== The administrator can subscribe to r...
{ "content_hash": "7bead34e680b948f1cc2cc803cdcdb98", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 94, "avg_line_length": 35.12, "alnum_prop": 0.5728929384965832, "repo_name": "ntiufalara/openerp7", "id": "41958c84f66f96f68e8ff7ea93e3fbdc7e59970a", "size": "1858", "bin...
import logging import _socket import types import os from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, ENOTCONN, ESHUTDOWN, EINTR, EISCONN, ENOENT, EAGAIN import _io from concurrence import Tasklet, FileDescriptorEvent, TIMEOUT_CURRENT from concurrence.io import IOStream DEFAULT_BACKLOG = 512 XMOD =...
{ "content_hash": "85b906bb3bdbc40734ca77ae3b794c37", "timestamp": "", "source": "github", "line_count": 349, "max_line_length": 170, "avg_line_length": 37.730659025787965, "alnum_prop": 0.6130012150668287, "repo_name": "toymachine/concurrence", "id": "d03b7dc66f45841926a858b2ccfa911f7e1e1240", "siz...
import os.path def full_path(fname): dirpath = os.path.dirname(os.path.realpath(__file__)) return os.path.join(dirpath, fname) def load(fname): return open(full_path(fname)).read()
{ "content_hash": "3a5486409e67e910f30f9bc67dcf5a64", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 57, "avg_line_length": 19.7, "alnum_prop": 0.6751269035532995, "repo_name": "lukleh/Tiny-Stackbased-Virtual-Machine-in-Python", "id": "ec229d614179682270f1cde115a1f554c3bd249...
from django.core.exceptions import ImproperlyConfigured from django.template import Origin, Template, Context, TemplateDoesNotExist, add_to_builtins from django.utils.importlib import import_module from django.conf import settings template_source_loaders = None class LoaderOrigin(Origin): def __init__(s...
{ "content_hash": "71a24f95e494ef4490db80c7bf7e2476", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 209, "avg_line_length": 41.474747474747474, "alnum_prop": 0.6573307355090112, "repo_name": "greggian/TapdIn", "id": "127d857e2fa2ecdebc76afd07d6810a346e8d379", "size": "511...
from allauth.account.signals import password_reset from django.core.signals import request_finished from django.dispatch import receiver @receiver(request_finished) def set_request_finished(sender, **kwargs): print("Request finished!") @receiver(password_reset) def set_password_reset(sender, **kwargs): prin...
{ "content_hash": "4732de2971333e8c0ff88796469e9e50", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 50, "avg_line_length": 26.923076923076923, "alnum_prop": 0.7742857142857142, "repo_name": "groundupnews/gu", "id": "82da6c6c718c9c8e233b19b1af15ac53f7e90d06", "size": "350"...
""" Default key bindings.:: registry = load_key_bindings() app = Application(key_bindings_registry=registry) """ from __future__ import unicode_literals from prompt_toolkit.key_binding.registry import ConditionalRegistry, MergedRegistry from prompt_toolkit.key_binding.bindings.basic import load_basic_bindings,...
{ "content_hash": "af21f54bb497dccc70c963329d16f0cb", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 208, "avg_line_length": 41.32773109243698, "alnum_prop": 0.675884505896706, "repo_name": "unnikrishnankgs/va", "id": "fb2c1070f7992bcccba7397cbf1d01b99a0d0adb", "size": "4...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.framework import test_util from tensorflow.python.ops import array_ops from ...
{ "content_hash": "a3de8177ad74a76ed792141003517e4a", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 80, "avg_line_length": 34.99519230769231, "alnum_prop": 0.6903420799560379, "repo_name": "chemelnucfin/tensorflow", "id": "ba611a450c28c4c958ec8a24f5dd9a1184c1031a", "size...
from django.utils.translation import ugettext_lazy as _ import horizon from openstack_dashboard.dashboards.newtouch import dashboard class Server(horizon.Panel): name = _("Server") slug = "server" dashboard.Newtouch.register(Server)
{ "content_hash": "150755dcf0810fc12f94422a0c31c427", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 61, "avg_line_length": 20.5, "alnum_prop": 0.7642276422764228, "repo_name": "zouyapeng/horizon-newtouch", "id": "fde05017921d249656d3921555da143ad6514886", "size": "246", ...
__version__ = '0.2-devel' from .logger import Logger from .robot_database import RobotDatabase
{ "content_hash": "98caebaa51b0f6e5ca4cc810274ec336", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 41, "avg_line_length": 19.4, "alnum_prop": 0.7422680412371134, "repo_name": "robotframework/DbBot", "id": "66520c936e100df1ce78691c58e36875976fe258", "size": "705", "binar...
from gi.repository import Gio settings = Gio.Settings('org.mate.pluma') auto_detected_encodings = ['UTF-8', 'BIG5', 'BIG5-HKSCS', 'EUC-TW', 'GB18030', 'GB2312', 'GBK', 'CURRENT', 'ISO-8859-15', 'UTF-16'] settings.set_strv('auto-detected-encodings', auto_detected_encodings) ## http://foreachsam.github.io/book-util-g...
{ "content_hash": "3e026835edafe6b2926db4c2268af98d", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 131, "avg_line_length": 43.1, "alnum_prop": 0.7192575406032483, "repo_name": "foreachsam/book-lang-python", "id": "73a5504089ab9386b39c3e06e7152c4227026ae3", "size": "455",...
import logging from io import BytesIO import docker from emuvim.api.util.path_utils import get_absolute_path def build_dockerfile_dir(folder, tag): dcli = docker.from_env().api folder = get_absolute_path(folder) build_stream = dcli.build(folder, tag=tag) logging.info('Docker build result:') for ...
{ "content_hash": "76fbbd78ede2a53e84cba7cc15f4f1f6", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 70, "avg_line_length": 29.075, "alnum_prop": 0.6620808254514188, "repo_name": "mpeuster/son-emu", "id": "39d8a2be37c607184843af3141df5773da530615", "size": "1163", "binar...
from __future__ import print_function """ CParser.py - C parsing library Copyright 2010 Luke Campagnola Distributed under MIT/X11 license. See license.txt for more infomation. Used for extracting data such as macro definitions, variables, typedefs, and function signatures from C files (preferrably header files). """...
{ "content_hash": "4656e0785f76ce9bd69fdc8fc3c3c259", "timestamp": "", "source": "github", "line_count": 1329, "max_line_length": 237, "avg_line_length": 42.090293453724605, "alnum_prop": 0.5099574528942759, "repo_name": "meganbkratz/acq4", "id": "7699f1c8ead4270a8beae17455d4c985b6a1628d", "size": "...
"""Calculation methods related to volume based on cclib data.""" from __future__ import print_function import copy import numpy try: from PyQuante.CGBF import CGBF from cclib.bridge import cclib2pyquante module_pyq = True except: module_pyq = False try: from pyvtk import * ...
{ "content_hash": "22346d3431adfbd7b420001d86ed51f4", "timestamp": "", "source": "github", "line_count": 261, "max_line_length": 126, "avg_line_length": 37.14942528735632, "alnum_prop": 0.5552805280528053, "repo_name": "Schamnad/cclib", "id": "8ef6f354b589160bc181d22232119b57f8efbaed", "size": "9899...
import os import sys import time import urllib import tempfile from shutil import rmtree, copyfile from distutils.dir_util import mkpath import yaml from jinja2 import Environment, PackageLoader, FileSystemLoader, StrictUndefined from hokusai import CWD from hokusai.lib.command import command from hokusai.lib.confi...
{ "content_hash": "8c18c36e955dd3a3ab49b36cccfac27f", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 127, "avg_line_length": 35.77391304347826, "alnum_prop": 0.6737967914438503, "repo_name": "izakp/hokusai", "id": "df7d6745dbb639e74f3392465490f4e33ca4fdd5", "size": "4114"...
import tarfile import numpy as np from paddle.io import Dataset from paddle.dataset.common import _check_exists_and_download __all__ = [] URL_DEV_TEST = ( 'http://www-lium.univ-lemans.fr/~schwenk/' 'cslm_joint_paper/data/dev+test.tgz' ) MD5_DEV_TEST = '7d7897317ddd8ba0ae5c5fa7248d3ff5' # this is a small set ...
{ "content_hash": "66a36d5a885dddc5508b31494decfa4b", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 93, "avg_line_length": 34.973958333333336, "alnum_prop": 0.5189873417721519, "repo_name": "luotao1/Paddle", "id": "8cf66c27f8c50e4d49c66387e104c18fa30e6af4", "size": "7328...
import unittest from pyparsing import ParseException from tests.utils.grammar import get_record_grammar """ CWR Original Work Title for Versions grammar tests. The following cases are tested: """ __author__ = 'Bernardo Martínez Garrido' __license__ = 'MIT' __status__ = 'Development' class TestOriginalWorkTitleGr...
{ "content_hash": "b0ebaa4772eee9127bd78ba08131d24e", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 383, "avg_line_length": 40.28333333333333, "alnum_prop": 0.6412908564335954, "repo_name": "weso/CWR-DataApi", "id": "3a9b131057e44210005f6d78f7dd2a4a97a8f853", "size": "244...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='TestModel', fields=[ ('id', models.AutoField(auto_c...
{ "content_hash": "4ae55e1b62916c3b3b5a218ee1c04d5d", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 114, "avg_line_length": 24.863636363636363, "alnum_prop": 0.56672760511883, "repo_name": "centralniak/learn-select-for-update", "id": "73ab63078fdca4076dad44e1443b521ff559b06...
__VERSION__ = '0.7.2' import sys if sys.version_info[:2] < (2, 3): print >> sys.stderr, "Sorry, xlwt requires Python 2.3 or later" sys.exit(1) from Workbook import Workbook from Worksheet import Worksheet from Row import Row from Column import Column from Formatting import Font, Alignment, Borders, Pattern, P...
{ "content_hash": "72657e6b07e04fab7b6edf0f57f4c9d4", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 68, "avg_line_length": 27.928571428571427, "alnum_prop": 0.7442455242966752, "repo_name": "alextreme/Django-Bingo", "id": "dcc23f04e246e95737ebeab8723dffb9fb41535e", "size"...
import sys sys.path.append("web2py") import argparse import os from db.Corpus_DB import Corpus_DB def ImportCorpus(corpus_filename_or_folder, database_path): database_filename = '{}/corpus.db'.format(database_path) with Corpus_DB(database_path, isInit=True) as corpus_db: if os.path.isfile(corpus_filename_or_fol...
{ "content_hash": "65fb70ab3d85761a540308c5f3151ab6", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 110, "avg_line_length": 39.44444444444444, "alnum_prop": 0.7295774647887324, "repo_name": "maoxuxiang/termite_mallet_project", "id": "f0e2cdee26178d0dbfd56897a65761a68359c4e5...
""" compares two pdf files. """ import io import logging import sys import pdfminer.settings from pdfminer import high_level, layout pdfminer.settings.STRICT = False logging.basicConfig() def compare(file1, file2, **kwargs): # If any LAParams group arguments were passed, # create an LAParams object and ...
{ "content_hash": "ceea7846e107a2304c568f2f73a91174", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 78, "avg_line_length": 40.34965034965035, "alnum_prop": 0.5523396880415945, "repo_name": "goulu/pdfminer", "id": "68478fb779353e6d872c5d6be83a6217d98243b0", "size": "5794"...
import base64 import json import logging import os import random import time from opencenteragent.utils import detailed_exception from opencenterclient.client import OpenCenterEndpoint from state import StateMachine, StateMachineState from primitives import OrchestratorTasks name = 'adventurator' endpoint = 'http://l...
{ "content_hash": "da9c88b2f2cfce9d7be70443736dbf67", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 79, "avg_line_length": 32.16062176165803, "alnum_prop": 0.5509908168197196, "repo_name": "rcbops/opencenter-agent", "id": "9b37e55ecaf701747e7beeeba194cc7f6ac2a340", "size...
import requests import json import pandas as pd def QA_fetch_get_future_domain(): """ 获取快期的主连代码 return [list] """ res = pd.DataFrame(json.loads(requests.get("https://openmd.shinnytech.com/t/md/symbols/latest.json").text)).T return res.loc[res.ins_name.str.contains('主连')].underlying_symbol.app...
{ "content_hash": "075eb35d742cffa8fbe0acfd5732c092", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 114, "avg_line_length": 22.842105263157894, "alnum_prop": 0.6451612903225806, "repo_name": "QUANTAXIS/QUANTAXIS", "id": "2e34370976c0c32c75357001ea4ad0728e575209", "size": ...
""" compute_water_level_filter_saliniy.py ~~~~~~~~ This script is used to: 1- calculate water depth above pressure sensor from pressure reading and coincident barometric pressure measurements. 2- calculate total water depth 3- calculate water surface elevation 4- filter salinity when water level...
{ "content_hash": "8e1669a5c888ec159341da9202079cc4", "timestamp": "", "source": "github", "line_count": 670, "max_line_length": 177, "avg_line_length": 53.723880597014926, "alnum_prop": 0.562967078760939, "repo_name": "twdb/sonde", "id": "69a800726d21b99d96b1ff2ea341f9d446c5f414", "size": "35995", ...
import webob from lxml import etree from nova.api.openstack import views from nova.api.openstack import wsgi from nova.api.openstack import xmlutil from nova.compute import instance_types from nova import db from nova import exception class Controller(object): """Flavor controller for the OpenStack API.""" ...
{ "content_hash": "321ff21b8ee93a866847930c2d65313a", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 77, "avg_line_length": 32.38135593220339, "alnum_prop": 0.6443339439937189, "repo_name": "salv-orlando/MyRepo", "id": "7280ecbce855febf5247ee86057e9cacdbafc793", "size": "...
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import data import logger import test_topic_model import util if __name__ == "__main__": logger.init('train_topic_model.log') logger.log.info("Topic Model Training start running...") util.text_p...
{ "content_hash": "d91f27981a9c81e922a5a38bb4127a8f", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 119, "avg_line_length": 30.8, "alnum_prop": 0.700487012987013, "repo_name": "wjfwzzc/train_model", "id": "55ca4723b70dd4e5ab7c06b99fa7ba2095957a6c", "size": "1257", "bina...
from string import Template from datetime import date bitcoinDir = "./"; inFile = bitcoinDir+"/share/qt/Info.plist" outFile = "Friendshipcoin-Qt.app/Contents/Info.plist" version = "unknown"; fileForGrabbingVersion = bitcoinDir+"bitcoin-qt.pro" for line in open(fileForGrabbingVersion): lineArr = line.repla...
{ "content_hash": "9353bf7425c1d628f603d83f8a5260b8", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 69, "avg_line_length": 27.5, "alnum_prop": 0.7121212121212122, "repo_name": "friendshipCoin/friendshipcoin", "id": "7791ad2db2ef5f053e8cad9fee3870d5ad2f6e88", "size": "909"...
from tigershark.facade import CompositeAccess from tigershark.facade import ElementAccess from tigershark.facade import ElementSequenceAccess from tigershark.facade import Facade from tigershark.facade import Money from tigershark.facade import SegmentAccess from tigershark.facade import SegmentConversion from tigersha...
{ "content_hash": "033dbb5a3ba30861e590d2e4437922a9", "timestamp": "", "source": "github", "line_count": 389, "max_line_length": 96, "avg_line_length": 44.01542416452442, "alnum_prop": 0.6722345520383133, "repo_name": "jdavisp3/TigerShark", "id": "ca593e3bbd8f8af8bf8f52ef3156e4787b41953b", "size": "...
import factory import os import six import uuid from django.contrib.auth import get_user_model from django.core.files.storage import default_storage from ..models import WooeyJob, ScriptGroup, Script, ScriptParameter, ScriptParameterGroup, ScriptParameters from .. import settings as wooey_settings class ScriptGrou...
{ "content_hash": "62b293a3dd89c003c0038c2beae0566e", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 107, "avg_line_length": 26.63157894736842, "alnum_prop": 0.7200263504611331, "repo_name": "waytai/Wooey", "id": "a8bfd6882fd178fa1825bf0accb966a7893a3c72", "size": "1518", ...
__author__ = 'jules' import cProfile import deepThought.ORM.ORM as ORM from deepThought.scheduler.PPPolicies import PPPolicies import deepThought.simulator.simulator as simulator def main(): job = ORM.deserialize("/tmp/output.pickle") scheduler = PPPolicies(job) job.initialize() scheduler.initialize()...
{ "content_hash": "54ce94ad3e4a753ff6c7a95289f3be2a", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 86, "avg_line_length": 29.470588235294116, "alnum_prop": 0.7145708582834331, "repo_name": "juliusf/Genetic-SRCPSP", "id": "aedf6c189099d3e7a70d7808c53f28a9cfe811d5", "size"...
import unittest import textwrap from .. import Document, Section, DefinitionList, Paragraph, Container class DefinitionListTestCase(unittest.TestCase): __shortLorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque facilisis nisi vel nibh" def setUp(self): unittest.TestCase.se...
{ "content_hash": "622ace91f6241a35591c54d26b6a2e94", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 114, "avg_line_length": 34.58585858585859, "alnum_prop": 0.4420268691588785, "repo_name": "jacquev6/RecursiveDocument", "id": "f08715515a7f56333a5ec048c6015e3bfe844e79", "...
import bz2, datetime import unittest import sqlite3 as sqlite class SqliteTypeTests(unittest.TestCase): def setUp(self): self.con = sqlite.connect(":memory:") self.cur = self.con.cursor() self.cur.execute("create table test(i integer, s varchar, f number, b blob)") def tearDown(self): ...
{ "content_hash": "1db4ff491b698626fc686dc23415a8b6", "timestamp": "", "source": "github", "line_count": 328, "max_line_length": 134, "avg_line_length": 34.8780487804878, "alnum_prop": 0.6002622377622377, "repo_name": "TathagataChakraborti/resource-conflicts", "id": "8da5722d55faff89d40272e3840a3e2f7e...
import sys, os import fontforge import optparse # print 'ARGV :', sys.argv[1:] parser = optparse.OptionParser() parser.add_option('-w', '--woff', dest="woff", action="store_true", default=False, help='Save in WOFF format (.woff)' ...
{ "content_hash": "7818e9bc51816ce89f46a635ce6a0c4a", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 64, "avg_line_length": 29.252747252747252, "alnum_prop": 0.5274229902329076, "repo_name": "quitequinn/advanced-font-converter", "id": "af6996e3fab935815c6b2180aa09f6c5ee11f38...
@app.route('/api/v1.0/<int:api_key>/scrape/rushhour/new',methods=['GET']) ########scrapes the Rush Hour index page def get_rush_hour_index(api_key): if str(api_key)!=the_api_key: return 401 #base_url = 'http://www.rushhour.nl/store_master.php?idxGroup=2&idxGenre=2&idxSubGenre=&app=250' week = datet...
{ "content_hash": "a037bc5dc832eb84c7e1e13d0dc22c75", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 406, "avg_line_length": 33.75735294117647, "alnum_prop": 0.6144630799390111, "repo_name": "siquick/ss_api", "id": "24d84abf886cde487b9f2f8a0601399d7d82f0e6", "size": "4591...
'''Autogenerated by get_gl_extensions script, do not edit!''' from OpenGL import platform as _p, constants as _cs, arrays from OpenGL.GL import glget import ctypes EXTENSION_NAME = 'GL_EXT_stencil_clear_tag' def _f( function ): return _p.createFunction( function,_p.GL,'GL_EXT_stencil_clear_tag',False) _p.unpack_con...
{ "content_hash": "cc43829ff3131b04e6e70b30627b25b3", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 78, "avg_line_length": 39.833333333333336, "alnum_prop": 0.7545327754532776, "repo_name": "frederica07/Dragon_Programming_Process", "id": "117fbe415912208c7e3cc118b1aadeb03e6...
"""Offer time listening automation rules.""" import voluptuous as vol from homeassistant.const import CONF_PLATFORM from homeassistant.core import HassJob, callback from homeassistant.helpers import config_validation as cv from homeassistant.helpers.event import async_track_time_change # mypy: allow-untyped-defs, no-...
{ "content_hash": "68934cf27cb3f06c5be48ee3593e6826", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 82, "avg_line_length": 29.853932584269664, "alnum_prop": 0.5957847196085811, "repo_name": "Danielhiversen/home-assistant", "id": "000d73b6cd191a6301c977f1ac8e886d48d5cf78", ...
__author__ = 'mongolrgata' import os import struct import sys NUL_CHAR16 = chr(0).encode('utf-16le') def read_unsigned_int32(file): """ :param file: :type file: io.FileIO :return: :rtype: int """ return struct.unpack('<L', file.read(4))[0] def read_filename(file): """ :param f...
{ "content_hash": "ced7844083da732e4aa4bceadf87c945", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 86, "avg_line_length": 20.182795698924732, "alnum_prop": 0.5652637187000533, "repo_name": "mongolrgata/cool-beauty-tools", "id": "79586e2b912a5d15043a95a10cdeb8a50432824d", ...
"""Function for interpolating formatted errors from the TensorFlow runtime. Exposes the function `interpolate` to interpolate messages with tags of the form {{type name}}. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import iterto...
{ "content_hash": "8fc02a0848ce541128bd307c1f6c4866", "timestamp": "", "source": "github", "line_count": 290, "max_line_length": 80, "avg_line_length": 34.03793103448276, "alnum_prop": 0.6520109411407152, "repo_name": "snnn/tensorflow", "id": "bc3c81b2a2f19bfa89bb2e2a418ea8239a5075d9", "size": "1056...
from __future__ import unicode_literals from django.contrib import admin from django.contrib.auth.admin import UserAdmin from .models import Profile from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse User = get_user_model() class UserProfileInline(admin.StackedInline): mo...
{ "content_hash": "c36cd3c90386552e1e392a370c267880", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 71, "avg_line_length": 32.61290322580645, "alnum_prop": 0.6805143422354105, "repo_name": "jcda/django-edge-PSA-integration", "id": "927651ecdf2c8064637a428e32af4bcd0a8e18be",...
import inspect # list of methods that check everything other than attributes ALL_BUT_ATTRIBUTES = [ inspect.ismodule, inspect.isclass, inspect.ismethod, inspect.isfunction, inspect.isgeneratorfunction, inspect.isgenerator, inspect.istraceback, inspect.isframe, inspect.iscode, i...
{ "content_hash": "c3c73bc4dbcde8e7e85b5775dbe0f01a", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 116, "avg_line_length": 33.72992700729927, "alnum_prop": 0.5639471975762822, "repo_name": "20tab/upy", "id": "5ebfae42f85c0b56d4360c705d1825deb51b065c", "size": "4668", ...
"""Common functionality for switches that aren't session oriented and have an API to talk to. This only works with the vlan_pool network allocator.""" import logging import re import requests from hil.errors import SwitchError from hil.model import SwitchSession from hil.network_allocator import get_network_allocator...
{ "content_hash": "8d12ab7f8d443a29b4744a09c85fe838", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 79, "avg_line_length": 34.76129032258064, "alnum_prop": 0.5861172976985894, "repo_name": "CCI-MOC/haas", "id": "df5151d5337980480cde33929752c8ccacdf76d8", "size": "5388", ...
from mod_pywebsocket import handshake def web_socket_do_extra_handshake(request): raise handshake.AbortedByUserException("abort for test") def web_socket_transfer_data(request): raise handshake.AbortedByUserException("abort for test") # vi:sts=4 sw=4 et
{ "content_hash": "2e6f7554c55333066b4f6072bbe0b43c", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 60, "avg_line_length": 22.333333333333332, "alnum_prop": 0.7686567164179104, "repo_name": "GoogleChromeLabs/pywebsocket3", "id": "63cb541bb7ec4044745798ab97ae7ccba57e04f7", ...
from __future__ import unicode_literals from django.apps import AppConfig class OrdersConfig(AppConfig): name = 'orders'
{ "content_hash": "88767fa2dd0bd91cca089d89fdf541f3", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 39, "avg_line_length": 18.285714285714285, "alnum_prop": 0.75, "repo_name": "cmwaura/aura", "id": "f9fdc0c09929f6711efa5d002d0e4a5066cae6ba", "size": "128", "binary": fals...
from __future__ import unicode_literals from django.test import TestCase from .models import A, B, Bar, D, DataPoint, Foo, RelatedPoint class SimpleTest(TestCase): def setUp(self): self.a1 = A.objects.create() self.a2 = A.objects.create() for x in range(20): B.objects.create(...
{ "content_hash": "442cf43dac57cb3f7fa821dc23f292ea", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 81, "avg_line_length": 36.57857142857143, "alnum_prop": 0.6104276508494435, "repo_name": "52ai/django-ccsds", "id": "010151d61e9ccaceec55a043a9f01e04edd70b47", "size": "51...
from speech_style import * from kb import * from task3 import get_restaurants, rank_restaurants def modify_options(dialogs, kb, accept_prob=0.25, save='all'): new_dialogs = [] for dialog in dialogs: restaurants = get_restaurants(dialog) specialities = set([kb[restaurant]['R_speciality'] for re...
{ "content_hash": "4f4218897c6db521802943dc884310c2", "timestamp": "", "source": "github", "line_count": 307, "max_line_length": 191, "avg_line_length": 64.86644951140065, "alnum_prop": 0.6732951692276791, "repo_name": "chaitjo/personalized-dialog", "id": "e2bc999aadbe3d59e1e467533cac0cdc592c1361", ...
import scrapy from tutorial.items import QuoteItem class QuotesSpider(scrapy.Spider): name = "quotes" start_urls = [ 'http://quotes.toscrape.com/page/1/', ] def parse(self, response): for quote in response.xpath('//div[@class="quote"]'): item = QuoteItem() item...
{ "content_hash": "6a8dd9e1d7ae994713871af35bd4c69e", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 84, "avg_line_length": 35.55, "alnum_prop": 0.5921237693389592, "repo_name": "gnublet/py_explorations", "id": "95ade8866c03774d5758ddc29ace752d50f079b6", "size": "711", "...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): db.alter_column('sentry_projectoptions', 'key', self.gf('django.db.models.fields.CharField')(max_length=64)) def backwards(self, orm): ...
{ "content_hash": "0c6a44fc773ddb52b03f1de9467b540a", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 182, "avg_line_length": 81.55020080321285, "alnum_prop": 0.5450605732295873, "repo_name": "NickPresta/sentry", "id": "79b6a027ca1ef579de6e9532fb7e9c15d3266fba", "size": "2...
""" Display the X selection. Configuration parameters: cache_timeout: how often we refresh this module in seconds (default is at every py3status configured interval) command: the xsel command to run (default 'xsel') max_size: stip the selection to this value (default 15) symmetric: show ...
{ "content_hash": "2ea81e5f4e5edddc185934739341c860", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 76, "avg_line_length": 26.823529411764707, "alnum_prop": 0.5805921052631579, "repo_name": "UmBsublime/py3status", "id": "51515a333f2f0f602992abdaa6391cac828da26e", "size": ...
from preggy import expect from tests.base import FilterTestCase class ContrastFilterTestCase(FilterTestCase): def test_contrast_filter(self): image = self.get_filtered('source.jpg', 'thumbor.filters.contrast', 'contrast(20)') expected = self.get_fixture('contrast.jpg') ssim = self.get_ss...
{ "content_hash": "6fef767ec5f179dcb9c1aa4056f3cd36", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 91, "avg_line_length": 32.166666666666664, "alnum_prop": 0.7020725388601037, "repo_name": "BetterCollective/thumbor", "id": "51efa33ec65634f634887e75dec72a8a4a6ef4aa", "siz...
""" rstblog.utils ~~~~~~~~~~~~~ Various utilities. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from math import ceil from jinja2 import Markup class Pagination(object): """Internal helper class for paginations""" def __init__(self, builder, ...
{ "content_hash": "a662d8e8fa30f7eabd2bf1ed90a235da", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 77, "avg_line_length": 27.24742268041237, "alnum_prop": 0.5331063185773742, "repo_name": "oddbird/rstblog", "id": "f6b2ced29175fa1f95d393e5f34d8a4c38e15c67", "size": "2667"...
"""engine.SCons.Tool.icc Tool-specific initialization for the OS/2 icc compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Fou...
{ "content_hash": "c9c94369b5f7e2980aeed72b0bb91d33", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 107, "avg_line_length": 39.056603773584904, "alnum_prop": 0.7169082125603865, "repo_name": "james-dibble/Embedded-Systems-Assignment", "id": "ac6d6aadeab9c62c3780cae5b7bb6b43...
from setuptools import setup, find_packages from codecs import open import os import sys from libmproxy import version # Based on https://github.com/pypa/sampleproject/blob/master/setup.py # and https://python-packaging-user-guide.readthedocs.org/ here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.j...
{ "content_hash": "7d127af073cc100b288d1e9ee4a80a08", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 125, "avg_line_length": 31.347457627118644, "alnum_prop": 0.6082725060827251, "repo_name": "bazzinotti/mitmproxy", "id": "a59638078599891ef7148c3555d183727c1dd34e", "size"...