text
stringlengths
4
1.02M
meta
dict
""" Django settings for our little example project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_D...
{ "content_hash": "e2122bd99c0d0cd47aa2ffdbad444a01", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 71, "avg_line_length": 23.815384615384616, "alnum_prop": 0.708656330749354, "repo_name": "gabegaster/django-offlinecdn", "id": "0e468a17fa65aafe83e1e1082e155a323832d522", "...
import argparse import collections import contextlib import itertools import multiprocessing.pool import os.path import sqlite3 from typing import Callable from typing import Counter from typing import Dict from typing import Generator from typing import Iterable from typing import List from typing import Optional from...
{ "content_hash": "7a50ab08e48ba1d19137aa9234a9e9d2", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 79, "avg_line_length": 31.848, "alnum_prop": 0.6425521225822658, "repo_name": "Yelp/git-code-debt", "id": "b1dd3c5bc3d54610060549c446310c6f442284a2", "size": "7962", "bi...
"""Support for departure information for Rhein-Main public transport.""" import asyncio from datetime import timedelta import logging from RMVtransport import RMVtransport from RMVtransport.rmvtransport import RMVtransportApiConnectionError import voluptuous as vol from homeassistant.components.sensor import PLATFORM...
{ "content_hash": "dce65d1a19cfb240ceb89d20b220badb", "timestamp": "", "source": "github", "line_count": 285, "max_line_length": 86, "avg_line_length": 30.185964912280703, "alnum_prop": 0.5636405904916889, "repo_name": "titilambert/home-assistant", "id": "76e75d77a58f67a89067d5ff4149b3689068b60d", "...
from __future__ import division from datetime import timedelta import textwrap import warnings import numpy as np from pandas._libs import lib, tslibs from pandas._libs.tslibs import NaT, Timedelta, Timestamp, iNaT from pandas._libs.tslibs.fields import get_timedelta_field from pandas._libs.tslibs.timedeltas import ...
{ "content_hash": "bf53d2fcad3dee85dd39ad95bd28c549", "timestamp": "", "source": "github", "line_count": 1065, "max_line_length": 79, "avg_line_length": 34.91830985915493, "alnum_prop": 0.5669033021404755, "repo_name": "MJuddBooth/pandas", "id": "74fe8072e692410839c2c8c1170489c60210424e", "size": "3...
import logging logging.basicConfig() import av from av.codec import CodecContext, CodecParser from av.video import VideoFrame from av.packet import Packet cc = CodecContext.create('mpeg4', 'r') print(cc) fh = open('test.mp4', 'r') frame_count = 0 while True: chunk = fh.read(819200) for packet in cc.pa...
{ "content_hash": "58c99010e71eca496afd9307dea9df05", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 61, "avg_line_length": 19.25, "alnum_prop": 0.6217532467532467, "repo_name": "PyAV-Org/PyAV", "id": "bdb6724f4186cbcf8a03961a766d9e9e13345078", "size": "616", "binary": f...
from __future__ import absolute_import # encoding: UTF-8 import unittest import pytest from six import iteritems from mock import patch from tests.common import FakeUser from tml.strings import to_string from tml.token.transform import TransformToken, Error, PIPE_CHAR, DBL_PIPE_CHAR import tml.token.data @pytest.mar...
{ "content_hash": "72a3844a97c62baa59a4949aa3ae5b0e", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 85, "avg_line_length": 42.76923076923077, "alnum_prop": 0.5946043165467626, "repo_name": "translationexchange/tml-python", "id": "7210aeb5c90b0e408e5cdfe7ad4f585439b31a4f", ...
from django.db import models from django.contrib.auth.models import User class Record(models.Model): user = models.ForeignKey(User, verbose_name='User') title = models.CharField(verbose_name='Title', default='', max_length=255) duration = models.CharField(verbose_name='Duration', default='00:00', max_leng...
{ "content_hash": "e46f834383fb682a6a8beba5324b831a", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 89, "avg_line_length": 42.09090909090909, "alnum_prop": 0.7170626349892009, "repo_name": "lecrec/backend", "id": "1019dad465545760ac031f9088d76de98aadeb20", "size": "926", ...
import mock from oslo_config import cfg from oslo_utils import uuidutils from saharaclient.api import base as sahara_base from rally import consts from rally import exceptions from rally.plugins.openstack.scenarios.sahara import utils from tests.unit import test CONF = cfg.CONF SAHARA_UTILS = "rally.plugins.openstac...
{ "content_hash": "85633edad4f05dfcd5025e53f1514c56", "timestamp": "", "source": "github", "line_count": 390, "max_line_length": 79, "avg_line_length": 36.207692307692305, "alnum_prop": 0.516960555201473, "repo_name": "cernops/rally", "id": "c332294e4020a52640404819ad9d593c9e611d02", "size": "14751"...
from pygal import Line def make_chart(values, seulav): chart = Line(title="It Works!") chart.add("Weight (lbs)", values) chart.add("Weight Trend", seulav) chart.render_to_file('fwt/static/img/todate.svg') return chart
{ "content_hash": "813120469c6bf4b135fd7a641291249b", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 56, "avg_line_length": 27.444444444444443, "alnum_prop": 0.6518218623481782, "repo_name": "fgandiya/fwt", "id": "725d7d0ac3b607a5766f4d50b654da2c50fa0569", "size": "247", ...
import re import unittest from flask import url_for from app import create_app, db from app.models import User, Role class FlaskClientTestCase(unittest.TestCase): def setUp(self): self.app = create_app('testing') self.app_context = self.app.app_context() self.app_context.push() db.c...
{ "content_hash": "7f507428e187e8cf6446d14eb362c41b", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 74, "avg_line_length": 36.660714285714285, "alnum_prop": 0.5986361422308817, "repo_name": "Tuklab/tuklab101", "id": "892f7c05a99a85d154f3320dafa2321307c85c71", "size": "205...
import sys import boto3 import json import base64 class colors: SUCCESS = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' securityGroupId = sys.argv[1] numberOfChangesExpected = sys.argv[2] boto3.setup_default_session(profile_name='ChaoSlingr') client = boto3.client('ec2') print("Va...
{ "content_hash": "1c120a96984aff732832bca88e9522f7", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 173, "avg_line_length": 34.416666666666664, "alnum_prop": 0.7263922518159807, "repo_name": "Optum/ChaoSlingr", "id": "eb5f0fd7152af4645306a3721dc67821658e6652", "size": "84...
'''textfilestreamlet.py: module defining a streamlet based on TextFileSpout''' import glob from heron.dsl.src.python.streamlet import Streamlet from heron.dsl.src.python.operation import OperationType from heron.spouts.src.python.textfiles.textfilespout import TextFileSpout # pylint: disable=access-member-before-defi...
{ "content_hash": "8fe8668c503c2a89f56777098a472211", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 89, "avg_line_length": 37.71111111111111, "alnum_prop": 0.6882734236888627, "repo_name": "srkukarni/heron", "id": "5762078a3a93b843134818a1623e3d16f16ab1e8", "size": "2276"...
def dismiss(user, keys): """ Dismiss a hint. Expects parameters ``user`` as a user object and ``keys`` as an iterable. """ from zenaida.contrib.hints.models import Dismissed keystring = "".join(keys) return Dismissed.objects.create(user=user, key=keystring)
{ "content_hash": "c0be43b257b1cc8531f0b037c4bd9c4b", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 64, "avg_line_length": 26.272727272727273, "alnum_prop": 0.6643598615916955, "repo_name": "littleweaver/django-zenaida", "id": "baa9461551aa93ee6333efdedc930f941f1adc06", "...
"""Django model to DOT (Graphviz) converter by Antonio Cavedoni <antonio@cavedoni.org> Make sure your DJANGO_SETTINGS_MODULE is set to your project or place this script in the same directory of the project and call the script like this: $ python modelviz.py [-h] [-d] <app_label> ... <app_label> > <filename>.dot $ dot...
{ "content_hash": "95c0c94924e4d67b887630cacce1c3f1", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 106, "avg_line_length": 29.11, "alnum_prop": 0.5398488491927173, "repo_name": "glasslion/djflow", "id": "f2e96e1a59707dcc9ad392335a15b1d0838fc068", "size": "5844", "bina...
import sys import os import time class Monitor: def __init__(self, path: str, warningThreshold: int, ErrorThreshold: int): self.path = path self.warningThreshold = warningThreshold self.errorThreshold = ErrorThreshold self.seekbuffer = 1 def __check__thresholds(self): if...
{ "content_hash": "19cb65a033d4bee4b9d519eb6341d02c", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 134, "avg_line_length": 33.32098765432099, "alnum_prop": 0.5505742867728789, "repo_name": "nohupped/ADtoLDAP", "id": "68b589e58404003967b9f1494f839700b8183b6c", "size": "27...
import time def rebuild(self): ######################################################### # Grid <--> CoordSys loops print time.ctime() + ' started - rebuilding grids and coordsys' # first processing basic grids and coordsys for grid in self.griddict.values(): if grid.rcid == 0 or grid.rcid...
{ "content_hash": "1b3af16f925c609259d167b30ebca64d", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 68, "avg_line_length": 40.12, "alnum_prop": 0.5204386839481555, "repo_name": "saullocastro/mapy", "id": "f810c4ca4bbb2b35ade323f1aca74ee2ed9fcf09", "size": "2006", "binar...
import collections import tables import os import ShareYourSystem as SYS import sys #</ImportSpecificModules> #<DefineLocals> JoiningStr='_' #</DefineLocals> #<DefineClass> class JoinerClass(SYS.TablerClass): #<DefineHookMethods> def initAfter(self): #<DefineSpecificDo> self.JoinedVariablesList=[] #</Defin...
{ "content_hash": "c53973da791f8d8707916a47209a990a", "timestamp": "", "source": "github", "line_count": 295, "max_line_length": 99, "avg_line_length": 24.861016949152543, "alnum_prop": 0.5389964548677393, "repo_name": "Ledoux/ShareYourSystem", "id": "42c0a63f65ebcc2ca140ee0db12bd99000b1a3bf", "size...
import unittest import mock from cinder.tests.unit.volume.drivers.dell_emc.unity \ import fake_exception as ex from cinder.volume import configuration as conf from cinder.volume.drivers.dell_emc.unity import driver ######################## # # Start of Mocks # ######################## class MockAdapter(objec...
{ "content_hash": "74cc8746f046306446c6e971e162990d", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 78, "avg_line_length": 32.13779527559055, "alnum_prop": 0.6415533504838907, "repo_name": "ge0rgi/cinder", "id": "b1ce7721bd1da56df6323193cb8419b1ff3abb26", "size": "8786",...
from __future__ import unicode_literals from django.db import models, migrations import datetime from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('imager_images', '0010_auto_20150728_1429'), ] operations = [ migrations.AddField( ...
{ "content_hash": "08188c5ea7d67fae941c49ae8f7fb863", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 148, "avg_line_length": 35.945945945945944, "alnum_prop": 0.5887218045112782, "repo_name": "gatita/django-imager", "id": "ab4f2610a2105023114f4437f85c1f3681c0ca8e", "size":...
"""Testing binary Heap.""" import pytest @pytest.fixture def empty_heap(): """Fixture for empty_heap.""" from src.binheap import Binheap bh = Binheap() return bh @pytest.fixture def heap(): """Fixture for a heap.""" from src.binheap import Binheap bh = Binheap([10, 4, 2, 6, 13, 72, 1, 4...
{ "content_hash": "8ecbe0f7d112a0ca79230dab7a3cf4c6", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 63, "avg_line_length": 22.883116883116884, "alnum_prop": 0.6089670828603859, "repo_name": "clair3st/Data-Structures", "id": "55ff62c27d8284db7421e54866688b886a95996d", "siz...
""" MI logging can be configured using a combination of two of four files. there is first a "base" configuration, and then a "local" set of overrides. the base configuration is from the file specified in the environment variable MI_LOGGING_CONFIG or res/config/mi-logging.yml (ie, users can set MI-specific configuratio...
{ "content_hash": "a05be3897da96dd59594c57867e46065", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 164, "avg_line_length": 35.650485436893206, "alnum_prop": 0.6744281045751634, "repo_name": "tapanagupta/mi-instrument", "id": "ac8c8c7160ade27fe6dc86dcc4e16cf0f3697062", "...
from unittest import mock import pytest from mopidy.internal import path from mopidy.models import Track from mopidy.stream import actor from tests import path_to_data_dir @pytest.fixture def config(): return { "proxy": {}, "stream": { "timeout": 1000, "metadata_blacklis...
{ "content_hash": "7e35a5892d23ce916dc7ef95724f86d9", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 73, "avg_line_length": 26.126984126984127, "alnum_prop": 0.6743620899149453, "repo_name": "jodal/mopidy", "id": "24af43506bcc5d907b3aca236a7dfbbe3766d7ae", "size": "1646", ...
from . import * import datetime __author__ = 'Preetam' # <editor-fold desc="MongoDB models"> # Class AuditModel - Should be embedded in all DynamicDocument and Document models of the project class AuditModel(EmbeddedDocument): created_date = DateTimeField(default=datetime.datetime.now, required=False) updat...
{ "content_hash": "0d89b8c70e2406a4cb8385d1421792cc", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 97, "avg_line_length": 27.851063829787233, "alnum_prop": 0.692131398013751, "repo_name": "usc-isi-i2/dig-crowd-sourcing", "id": "a78451e40b823e4a423d02bde009250850fff0bd", ...
"""Utilities to test TF-TensorRT integration.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from collections import namedtuple import itertools import os import warnings import numpy as np import six from tensorflow.contrib.tensorrt.python import trt_...
{ "content_hash": "89c012fbbeecc6914b8b9e8c6c76bc6e", "timestamp": "", "source": "github", "line_count": 533, "max_line_length": 80, "avg_line_length": 38.68105065666041, "alnum_prop": 0.6634330891982345, "repo_name": "dongjoon-hyun/tensorflow", "id": "a725d0651c92fe18bcfd284cffd40cdfec2e6c69", "siz...
import copy from osc_lib.tests import utils as osc_lib_utils from openstackclient import shell from openstackclient.tests.unit.integ import base as test_base from openstackclient.tests.unit import test_shell class TestIntegV2ProjectID(test_base.TestInteg): def setUp(self): super(TestIntegV2ProjectID, s...
{ "content_hash": "9393d3d723659bcc19f13ac92ea315d9", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 75, "avg_line_length": 32.19591836734694, "alnum_prop": 0.6005324543610547, "repo_name": "dtroyer/python-openstackclient", "id": "4e707a376286f14bef14d21d1f48c36a571bf642", ...
from ec2api.tests.functional import base from ec2api.tests.functional import config CONF = config.CONF class RegionTest(base.EC2TestCase): def test_describe_regions(self): data = self.client.describe_regions() self.assertNotEmpty(data['Regions']) region = CONF.aws.aws_region if ...
{ "content_hash": "3af08dea3d505d4b820102dc6be390eb", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 72, "avg_line_length": 26.928571428571427, "alnum_prop": 0.649867374005305, "repo_name": "vishnu-kumar/ec2-api", "id": "cabda0312d3338502f3163c8627ba57300af421e", "size": "...
from __future__ import unicode_literals from django.db import models, migrations import featureditem.fields import sorl.thumbnail.fields class Migration(migrations.Migration): dependencies = [ ('manifestos', '0004_auto_20150513_2110'), ] operations = [ migrations.AddField( m...
{ "content_hash": "400e01174e9f46b836aa8418b1048af7", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 164, "avg_line_length": 32.31111111111111, "alnum_prop": 0.5990371389270976, "repo_name": "gwhigs/digital-manifesto", "id": "80625f949fc2ca23184d8077e8509ac5597e29ba", "siz...
from __future__ import unicode_literals from django.db import migrations, models import dotmanca.storage import gallery.models class Migration(migrations.Migration): dependencies = [ ('gallery', '0003_auto_20170701_1436'), ] operations = [ migrations.AlterField( model_name=...
{ "content_hash": "3745263a7294d28e1928949334ea8550", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 129, "avg_line_length": 24.428571428571427, "alnum_prop": 0.6627680311890838, "repo_name": "evanepio/dotmanca", "id": "1f96c9ed156866ff7d70e4ad68866e307175d321", "size": "5...
from ctypes import * import os import subprocess import unittest import sys import gdb_rsp import test_files.test_basic as test_basic # These are set up by Main(). COMMAND = None class Tests(unittest.TestCase): def test_disconnect(self): process = gdb_rsp.PopenDebugStub(COMMAND) try: # Connect. ...
{ "content_hash": "144e12f0e62b062a960753bbc80c7666", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 67, "avg_line_length": 25.360655737704917, "alnum_prop": 0.6593406593406593, "repo_name": "youtube/cobalt_sandbox", "id": "9fd9628b5a6b9463f351ca257c9e26c1064a5835", "size"...
from __future__ import absolute_import from __future__ import division import sklearn.naive_bayes import submissions from data import * mnb = sklearn.naive_bayes.MultinomialNB() mnb.fit(train, target) pred = mnb.predict(test) submissions.save_csv(pred, "multinomial_naive_bayes.csv")
{ "content_hash": "547ea7c6c33af300b7ce1ecfe9dfe7bb", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 57, "avg_line_length": 22.153846153846153, "alnum_prop": 0.7708333333333334, "repo_name": "wjfwzzc/Kaggle_Script", "id": "33e222ec85d46f514fd810da2966840198c2af4a", "size":...
from collections import OrderedDict from typing import Dict, Type from .base import CloudRedisTransport from .grpc import CloudRedisGrpcTransport from .grpc_asyncio import CloudRedisGrpcAsyncIOTransport from .rest import CloudRedisRestTransport from .rest import CloudRedisRestInterceptor # Compile a registry of tran...
{ "content_hash": "9a5fb782b536cc0ab2fd3a4ee093af2a", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 81, "avg_line_length": 33.130434782608695, "alnum_prop": 0.8031496062992126, "repo_name": "googleapis/gapic-generator-python", "id": "bfee7cc29940cf18c9ae30d5868eac75fcd8a445...
""" Copyright 2013 The Trustees of Princeton University Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicab...
{ "content_hash": "c73523f0b667bfd644a08aafa3c56373", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 109, "avg_line_length": 36.916666666666664, "alnum_prop": 0.7133182844243793, "repo_name": "jcnelson/syndicatemail", "id": "5dec46a376d6e11e0d3f96a983cd6d821e7cc42c", "size...
from __future__ import print_function import getopt import glob import sys from PIL import Image if len(sys.argv) == 1: print("PIL File 0.4/2003-09-30 -- identify image files") print("Usage: pilfile [option] files...") print("Options:") print(" -f list supported file formats") print(" -i show...
{ "content_hash": "d541422f61c0583a433403ad10c6bd0d", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 77, "avg_line_length": 25.807692307692307, "alnum_prop": 0.5136612021857924, "repo_name": "mnahm5/django-estore", "id": "e673ce97bff5f4c010cb56b3bd6fb8938accd4d1", "size": ...
from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.db import models class ExampleModel(models.Model): VOTE_CHOICES = ( ("up", "Up"), ("down", "Down"), ) user = models.ForeignKey('auth.user') vote = models.CharField(max...
{ "content_hash": "11e58a36f10d88e9d680f9d7d4dfc09f", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 75, "avg_line_length": 32.68421052631579, "alnum_prop": 0.6827697262479872, "repo_name": "django-djam/django-djam", "id": "d154fb46ee1f508f93b390ef0e76192facc62b04", "size"...
"""Scraper for Kentucky Supreme Court CourtID: ky Court Short Name: Ky. History: 2014-08-07: Created by mlr. 2014-12-15: Updated to fetch 100 results instead of 30. For reasons unknown this returns more recent results, while a smaller value leaves out some of the most recent ite...
{ "content_hash": "9d25a06e0f5c951d0d349264dff50f2b", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 103, "avg_line_length": 39.93125, "alnum_prop": 0.5686335889810612, "repo_name": "brianwc/juriscraper", "id": "1aca59bcdb7bc0293f9547168703dfa37248c71e", "size": "6389", ...
import datetime import collections from .config import Config class Stmt(object): """Base class for all statement classes. """ def __init__(self, placeholder=None, quote_all_col_refs=None, quote_all_values=None, **kwargs): """Constructor Keyword Arguments: placeholder (string...
{ "content_hash": "4dcd7e917ac55772f516c756284dec2d", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 117, "avg_line_length": 39.666666666666664, "alnum_prop": 0.6009030477862787, "repo_name": "lovette/mysqlstmt", "id": "48e7da4eff971bc571771a9f87cb7970c6c1d5f4", "size": "...
from google.cloud import dialogflowcx_v3beta1 def sample_get_environment(): # Create a client client = dialogflowcx_v3beta1.EnvironmentsClient() # Initialize request argument(s) request = dialogflowcx_v3beta1.GetEnvironmentRequest( name="name_value", ) # Make the request response...
{ "content_hash": "08e8195cce782487d9e01d16276bb596", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 69, "avg_line_length": 25.31578947368421, "alnum_prop": 0.7276507276507277, "repo_name": "googleapis/python-dialogflow-cx", "id": "b6acb5c3d47e257ffeeec8807a77eb1bdbadea4c", ...
import logging from getpass import getpass from os import path from django.core.management.base import BaseCommand from ...utils.download import _download, gen_monthly_report_links, login class Command(BaseCommand): help = 'Download your monthly patron reports from Patreon (CSV).' def add_arguments(self, p...
{ "content_hash": "fa39fd95db4c5b7316328408b26e7b9b", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 99, "avg_line_length": 37.7, "alnum_prop": 0.6569407603890363, "repo_name": "DjangoGirls/djangogirls", "id": "c5aec4b97dde3803d651ce894dfe2455be798cf2", "size": "1131", "...
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Validate that use of \glossaries in TeX source files causes SCons to be aware of the necessary created glossary files. Test configuration contributed by Robert Managan. """ import os import TestSCons test = TestSCons.TestSCons() latex = test.where_i...
{ "content_hash": "c70f02f8df3c6e7306705d3d53e04f7d", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 71, "avg_line_length": 25.344086021505376, "alnum_prop": 0.7335596096733136, "repo_name": "timj/scons", "id": "05ddf1284bb189c05ff6db3e252f5abd56abd50f", "size": "3459", ...
import os import sys import json import fnmatch import unittest from uuid import uuid4 HERE = os.path.dirname(os.path.abspath(__file__)) WEBAPP_PATH = os.path.abspath(os.path.join(HERE, 'webapp')) sys.path.insert(0, HERE) sys.path.insert(1, WEBAPP_PATH) FLASK_COVERAGE = os.environ.get('FLASK_COVERAGE', None) if FLA...
{ "content_hash": "536fd22bdc7319cb99641a1ec7bf4cb1", "timestamp": "", "source": "github", "line_count": 444, "max_line_length": 162, "avg_line_length": 33.87837837837838, "alnum_prop": 0.6294375747905864, "repo_name": "scieloorg/opac", "id": "54cc21106798ec8e18a5bdb8a2901f5e904a18d0", "size": "1517...
from maps.models import UserProfilePicture, UserBio, Adventure, Map , MapSegment, WayPoint, DayNote from maps.serealizers import UserProfilePictureSerializer, UserBioSerializer, AdventureSerializer, MapSerializer, MapSegmentSerializer from maps.forms import ProfilePhotoUploadForm from django.http import JsonResponse f...
{ "content_hash": "dbeadc33ccb6dd243f394912f1fe811b", "timestamp": "", "source": "github", "line_count": 356, "max_line_length": 134, "avg_line_length": 35.53370786516854, "alnum_prop": 0.5609486166007905, "repo_name": "agilman/django-maps", "id": "6f3681738dc9484e3f559ff4f1d759eb5d0eb55a", "size": ...
import argparse import os import libcst as cst import pathlib import sys from typing import (Any, Callable, Dict, List, Sequence, Tuple) def partition( predicate: Callable[[Any], bool], iterator: Sequence[Any] ) -> Tuple[List[Any], List[Any]]: """A stable, out-of-place partition.""" results = ([], [])...
{ "content_hash": "087de5a296c791ec877032cbea94f423", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 150, "avg_line_length": 44.106280193236714, "alnum_prop": 0.6028477546549835, "repo_name": "googleapis/python-channel", "id": "643b44ce3e775e4e865a34df31cb30ab5f5a0a81", "...
from py2neo.core import Graph, Node, Relationship, Path, PropertySet, LabelSet from py2neo.batch.core import Batch, Job, CypherJob, Target from py2neo.batch.push import PushNodeLabelsJob, PushPropertiesJob, PushPropertyJob from py2neo.cypher.util import StartOrMatch __all__ = ["CreateNodeJob", "CreateRelationshipJob"...
{ "content_hash": "196333eb1423a9edaa2bf8f8e19c4e3c", "timestamp": "", "source": "github", "line_count": 279, "max_line_length": 92, "avg_line_length": 36.22222222222222, "alnum_prop": 0.6226993865030674, "repo_name": "nicolewhite/py2neo", "id": "325fad57c2fa264f245333f9502eb28988c26769", "size": "1...
from .Base import * from .helper import isCssProp class FEDUnknownCssNameChecker(RuleChecker): '''{ "summary":"错误的css属性", "desc":"本工具会帮您查找错误的CSS属性,如果写错了,即可收到错误提示" }''' def __init__(self): self.id = 'unknown-css-prop' self.errorLevel = ERROR_LEVEL.ERROR self.err...
{ "content_hash": "5486833bb304091a50aa403ecc7140d4", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 81, "avg_line_length": 27.41176470588235, "alnum_prop": 0.6180257510729614, "repo_name": "wangjeaf/CSSCheckStyle", "id": "7e9f0109b48dbf1ed504dc8758c57a433bd9b714", "size":...
from likelihood import Likelihood from logistic import Logistic from gaussian import Gaussian from softmax import Softmax from regression_network import RegressionNetwork
{ "content_hash": "cc1e7cf320cf8e9e321480f485324854", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 48, "avg_line_length": 34.2, "alnum_prop": 0.8771929824561403, "repo_name": "VirgiAgl/V_AutoGP", "id": "aefe56f8872980dd9422f5487f9be8ac55bf310e", "size": "171", "binary":...
from django.db import models from django.contrib.auth.models import User class Account(models.Model): name = models.CharField(max_length=200) slug = models.SlugField(max_length=250) description = models.TextField() owner = models.ForeignKey(User) balance = models.PositiveIntegerField() created...
{ "content_hash": "cb84ceb28b9b1f0cf1405ead7ecf4b7b", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 67, "avg_line_length": 29.6, "alnum_prop": 0.6567567567567567, "repo_name": "Apreche/Open-Ducats", "id": "526f18e13de01b82fce36feb3eb1bbafc814c07d", "size": "740", "binar...
from django.conf.urls import url from django_irods.views import rest_check_task_status, rest_download, download urlpatterns = [ # for download request from resource landing page url(r'^download/(?P<path>.*)$', download, name='django_irods_download'), # for download request from REST API url(r'^rest_dow...
{ "content_hash": "e47d1321a2393e57a85b5fe345c71353", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 39.142857142857146, "alnum_prop": 0.656934306569343, "repo_name": "hydroshare/hydroshare", "id": "9615dd9a41c977466d51096725109fd8f958649b", "size": ...
"""Tests for miscellaneous functionality in tensorflow.ops.nn.""" import functools import math from absl.testing import parameterized import numpy as np from tensorflow.python.eager import def_function from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow....
{ "content_hash": "d80d24dfcc521997f4995b33188fba8a", "timestamp": "", "source": "github", "line_count": 1994, "max_line_length": 116, "avg_line_length": 37.32447342026078, "alnum_prop": 0.6157608330534095, "repo_name": "paolodedios/tensorflow", "id": "f8f161d4ff074e4d60c0b7926f9be5a473790127", "siz...
import re class Directives: def __init__(self, start_block_pattern, end_block_pattern): self.__directives_block_pattern = re.compile(start_block_pattern + r' beautify( \w+[:]\w+)+ ' + end_block_pattern) self.__directive_pattern = re.compile(r' (\w+)[:](\w+)') self.__directives_end_ignor...
{ "content_hash": "f629836485d890cd4f40fecfff9377a1", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 128, "avg_line_length": 33.689655172413794, "alnum_prop": 0.6345957011258956, "repo_name": "Masood-M/yalih", "id": "cad31f64ad1db3a9669d7d7f86a5e057b38b5a87", "size": "2139...
"""Gradients for operators defined in nn_ops.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.framework import tensor_util from tensorflo...
{ "content_hash": "33bdda421188d54d4c58a8b84bb546a9", "timestamp": "", "source": "github", "line_count": 710, "max_line_length": 80, "avg_line_length": 36.25774647887324, "alnum_prop": 0.5976770384182107, "repo_name": "manazhao/tf_recsys", "id": "f1453f9ef0de544bbaf2b18866736595230c0c15", "size": "2...
import logging from django.utils.translation import ugettext_lazy as _ from django.conf import settings from django.core.cache import cache from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.http import Http404 from readthedocs.projects.models import Project, Domain log = logg...
{ "content_hash": "b3acc0cc7bd8519860464a468597c361", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 99, "avg_line_length": 42.355828220858896, "alnum_prop": 0.5238991888760139, "repo_name": "SteveViss/readthedocs.org", "id": "ac0a94772124dee7fd8c5cfd43fdac508bdb11a6", "s...
default_app_config = 'brasilcomvc.accounts.apps.AccountsAppConfig'
{ "content_hash": "52ff653671d9fb0c35c7d97fb61e4164", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 66, "avg_line_length": 67, "alnum_prop": 0.835820895522388, "repo_name": "brasilcomvc/brasilcomvc", "id": "3b097450f8fb7fc5dcc47802232921fc616cc852", "size": "67", "binary...
from setuptools import setup, find_packages import os.path # Package data # ------------ _name = 'jpl.mcl.site.sciencedata' _version = '0.0.7' _description = 'Science data for the MCL site' _url = 'https://github.com/MCLConsortium/' + _name _downloadURL = 'https://github.com/MCL...
{ "content_hash": "83d0e03662d9cf8bc97c6ebe2cfc2c25", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 108, "avg_line_length": 30.0531914893617, "alnum_prop": 0.6230088495575221, "repo_name": "MCLConsortium/mcl-site", "id": "135f70918bbac9925de809b96f322162ff0f1e3d", "size":...
from django.core.paginator import Paginator def paginate(queue, per_page): paginator = Paginator(queue, per_page) for num in paginator.page_range: yield paginator.page(num)
{ "content_hash": "b2e7348eae9a3cc823d70dcce4123965", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 43, "avg_line_length": 27.285714285714285, "alnum_prop": 0.7225130890052356, "repo_name": "akabos/python-django-djapian", "id": "b3bc49db06dcede57b07f500af1b8e9d9c1586d0", "...
import time from twitter.common import log from twitter.common.quantity import Amount, Time from apache.aurora.admin.admin_util import format_sla_results, print_results from apache.aurora.client.api import AuroraClientAPI from apache.aurora.client.base import check_and_log_response, DEFAULT_GROUPING, group_hosts fro...
{ "content_hash": "e5cd9a118f5137a3052b7ba1de734c99", "timestamp": "", "source": "github", "line_count": 232, "max_line_length": 100, "avg_line_length": 42.293103448275865, "alnum_prop": 0.7100489196901753, "repo_name": "mkhutornenko/incubator-aurora", "id": "162f9afea67e409d784e436c96f55ceed0537ca1",...
from .version import VERSION, RELEASE
{ "content_hash": "6c416b554aa060fc2acd18d231dc52da", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 37, "avg_line_length": 19.5, "alnum_prop": 0.7948717948717948, "repo_name": "tartley/genesis", "id": "972cd83bc75e5b8cf653569460ce2d53d4aa6a3f", "size": "40", "binary": fa...
from .profile import * # noqa
{ "content_hash": "28fcdbf1af5ff02322ec7f431f8494bf", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 30, "avg_line_length": 31, "alnum_prop": 0.6774193548387096, "repo_name": "ecobasa/ecobasa", "id": "2cb0d9ccdc9e4caa59812488ff3db359c897e813", "size": "56", "binary": fals...
""" Field classes. """ import datetime import os import re import time import urlparse import warnings from decimal import Decimal, DecimalException try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.core.exceptions import ValidationError from django.core import valida...
{ "content_hash": "824d16cd752c0e8c1af79dd7ccfb755a", "timestamp": "", "source": "github", "line_count": 924, "max_line_length": 128, "avg_line_length": 34.371212121212125, "alnum_prop": 0.706130545672093, "repo_name": "tjsavage/rototutor_djangononrel", "id": "06a1618a6cc76579cc2f4da52073a9b230c8575a"...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('people', '0005_merge'), ] operations = [ migrations.AlterField( model_name='internaluser', ...
{ "content_hash": "a81bf96f8abcaa7f8f254533c4269792", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 130, "avg_line_length": 28, "alnum_prop": 0.6041666666666666, "repo_name": "rameshgopalakrishnan/v_excel_inventory", "id": "bd05c3148a2d5154d83b38409f324a163bd7638e", "size...
''' Copyright (C) 2022, WAFW00F Developers. See the LICENSE file for copying permission. ''' NAME = 'Huawei Cloud Firewall (Huawei)' def is_waf(self): schemes = [ self.matchCookie(r'^HWWAFSESID='), self.matchHeader(('Server', r'HuaweiCloudWAF')), self.matchContent(r'hwclouds\.com'), ...
{ "content_hash": "0eb09b1dd9726932e1d3dd2432e54338", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 56, "avg_line_length": 24.055555555555557, "alnum_prop": 0.6327944572748267, "repo_name": "EnableSecurity/wafw00f", "id": "7cb6c0f5e3e11d51847a75008253b198bb125d92", "size"...
"""Batch normalization layers.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import REDACTED.transformer_lingvo.lingvo.compat as tf from REDACTED.transformer_lingvo.lingvo.core import base_layer from REDACTED.transformer_lingvo.lingvo.core import py_uti...
{ "content_hash": "9758e131110c411cebc8ab6d527aef7f", "timestamp": "", "source": "github", "line_count": 510, "max_line_length": 100, "avg_line_length": 40.88235294117647, "alnum_prop": 0.6246043165467626, "repo_name": "mlperf/training_results_v0.7", "id": "22c76b5f3c0d8b4bd52886bafce67dd494baa2ce", ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function # pylint: disable=unused-imports from tensorflowjs import converters from tensorflowjs import quantization from tensorflowjs import version __version__ = version.version
{ "content_hash": "076fcf91447ceb7dd2e7d8b189706d7b", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 38, "avg_line_length": 28.1, "alnum_prop": 0.800711743772242, "repo_name": "tensorflow/tfjs", "id": "946f94954b2c5d3c59dee104e63c5200822616df", "size": "937", "binary": f...
"""Test suite for XenAPI.""" import ast import base64 import contextlib import cPickle as pickle import functools import os import re from nova.compute import api as compute_api from nova.compute import instance_types from nova.compute import power_state from nova.compute import task_states from nova.compute import v...
{ "content_hash": "bea0504edfad936b3e9cf2dfc6349175", "timestamp": "", "source": "github", "line_count": 3047, "max_line_length": 79, "avg_line_length": 42.51361995405317, "alnum_prop": 0.5543735863330734, "repo_name": "aristanetworks/arista-ovs-nova", "id": "b226b34df5ec2106efee8270bd3719661ce4ac7e",...
import io import unittest from PyPDF2 import PdfFileReader import frappe import frappe.utils.pdf as pdfgen class TestPdf(unittest.TestCase): @property def html(self): return """<style> .print-format { margin-top: 0mm; margin-left: 10mm; margin-right: 0mm; } </style> <p>This is a test htm...
{ "content_hash": "58819965cf66352010ba7b2469a9e6ca", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 65, "avg_line_length": 27.46, "alnum_prop": 0.6766205389657683, "repo_name": "almeidapaulopt/frappe", "id": "f23db32845eff16bebb9e786b0faaec44567f415", "size": "1470", "b...
import matplotlib x=randn(10000) hist(x,100) sql_s='select count(*) from grid_quarters_public where quarter="2010_q2"';
{ "content_hash": "df46aaaf8b5f44e7b56572e4f896ba05", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 74, "avg_line_length": 24.2, "alnum_prop": 0.743801652892562, "repo_name": "tgebru/demographics_code", "id": "3e095a521759443f704aaa8120b52b22e21239c9", "size": "121", "bi...
from ev3dev.auto import OUTPUT_A, OUTPUT_B, OUTPUT_D, LargeMotor, MediumMotor from ev3dev.auto import INPUT_1, INPUT_2, ColorSensor, UltrasonicSensor import time import ev3dev.ev3 as ev3 ultrasonicSensor = UltrasonicSensor(INPUT_1) colorSensor = ColorSensor(INPUT_2) clawMotor = MediumMotor(OUTPUT_B) leftTire = LargeMo...
{ "content_hash": "4c66d607f4a632158560414bf1e8d5bf", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 77, "avg_line_length": 28.02857142857143, "alnum_prop": 0.746177370030581, "repo_name": "chandlercr/aima-python", "id": "a2415761f5198be80892613f914660d22cfa4315", "size": ...
""" Parsing functions for Binvox files. https://www.patrickmin.com/binvox/binvox.html Exporting meshes as binvox files requires the `binvox` executable to be in your path. """ import os import subprocess import numpy as np import collections from .. import util from ..base import Trimesh # find the executable for b...
{ "content_hash": "e35379441715fd72431aae8fe8073c77", "timestamp": "", "source": "github", "line_count": 579, "max_line_length": 79, "avg_line_length": 30.694300518134714, "alnum_prop": 0.5804636506864731, "repo_name": "mikedh/trimesh", "id": "ec3569f6e3d8674771877fcc35069577a933d8cc", "size": "1777...
"""Unit tests for Deployment methods.""" import github3 from .helper import UnitIteratorHelper, create_url_helper, create_example_data_helper url_for = create_url_helper( 'https://api.github.com/repos/octocat/example/deployments/1' ) get_repo_example_data = create_example_data_helper('repos_deployment_example') ...
{ "content_hash": "fd9d08340bb8d3f006b96956c6e52464", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 85, "avg_line_length": 28.29032258064516, "alnum_prop": 0.6795895096921323, "repo_name": "degustaf/github3.py", "id": "d2a0d22941e15b692ddfaa03e52fb1c92443870d", "size": "8...
"""Experimental API for building input pipelines. This module contains experimental `Dataset` sources and transformations that can be used in conjunction with the `tf.data.Dataset` API. Note that the `tf.data.experimental` API is not subject to the same backwards compatibility guarantees as `tf.data`, but we will prov...
{ "content_hash": "70b88812bdc1e6ab6fb11764acc688d6", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 92, "avg_line_length": 44.36842105263158, "alnum_prop": 0.8348754448398576, "repo_name": "snnn/tensorflow", "id": "2ac159d38aafdc07f2c8725780448c85c67e3ec4", "size": "4904"...
import argparse import base64 import httplib2 from googleapiclient import discovery from oauth2client.client import GoogleCredentials class AnnotationResult(object): def __init__(self, json_response): self.json_response = json_response self._parsed = False def __str__(self): return str(self.json_re...
{ "content_hash": "dab1f1542dbe0ec10bc90e7d0a84c297", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 85, "avg_line_length": 30.515151515151516, "alnum_prop": 0.641261171797418, "repo_name": "wenjiesha/menu_picture", "id": "f7e3736cffe3dac77c7f759f3bd156eb1087d7eb", "size"...
"""Tests for the elpy.impmagic module""" import re import sys import unittest from elpy import impmagic from elpy.tests.support import BackendTestCase TEST_SOURCE = '''# test file import time import logging os.getcwd() time.sleep(1) ''' @unittest.skipIf(sys.version_info >= (3, 5), "importmagic fails in 3.5") cla...
{ "content_hash": "0aa7961249f7d0f62f2dfdaea176526d", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 79, "avg_line_length": 34.55555555555556, "alnum_prop": 0.6097266881028939, "repo_name": "DaVinci789/.emacs.d", "id": "97c6f86b0604afd0f39d93654be6df5c4cb2c851", "size": "2...
import json import math import numpy as np import pandas as pd import pytest from scipy.sparse import csr_matrix, csc_matrix from mlflow.models.signature import infer_signature from mlflow.models.utils import ( _Example, _read_tensor_input_from_json, _read_sparse_matrix_from_json, ) from mlflow.types.utils...
{ "content_hash": "7b949e72f7b773f32e1cc370dd1f19bc", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 100, "avg_line_length": 39.186602870813395, "alnum_prop": 0.5822954822954823, "repo_name": "mlflow/mlflow", "id": "103c9382225201e498e3b992cb14b30a16810501", "size": "8190...
""" Response is a module to handle the response of the FOXSI telescopes """ from __future__ import absolute_import import pandas as pd import numpy as np import warnings import os import matplotlib.pyplot as plt import astropy.units as u from scipy import interpolate import pyfoxsi import h5py __all__ = ['Respons...
{ "content_hash": "6c56d9c47ce6515db853217ece7da468", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 146, "avg_line_length": 37.173469387755105, "alnum_prop": 0.6231128191051332, "repo_name": "samuel-badman/foxsi-smex", "id": "c9c07e39ad9d5cfce81c6e5a6d9b0071d413e860", "s...
from django.contrib.admin import ModelAdmin, TabularInline from django.contrib.admin.helpers import InlineAdminForm from django.contrib.admin.tests import AdminSeleniumTestCase from django.contrib.auth.models import Permission, User from django.contrib.contenttypes.models import ContentType from django.test import Requ...
{ "content_hash": "a348afbb800ae45ed1de219af43381fd", "timestamp": "", "source": "github", "line_count": 1353, "max_line_length": 138, "avg_line_length": 48.886917960088695, "alnum_prop": 0.639649854862119, "repo_name": "koordinates/django", "id": "8728a9bc098eecd0ccf4dffbaf9dfa9f62c33a1f", "size": ...
"""Tests for Plex server.""" from unittest.mock import patch from plexapi.exceptions import BadRequest, NotFound import pytest from homeassistant.components.media_player.const import ( ATTR_MEDIA_CONTENT_ID, ATTR_MEDIA_CONTENT_TYPE, DOMAIN as MEDIA_PLAYER_DOMAIN, MEDIA_TYPE_EPISODE, MEDIA_TYPE_MOV...
{ "content_hash": "48a7b3a1d76e576380698ac911c8f13e", "timestamp": "", "source": "github", "line_count": 311, "max_line_length": 140, "avg_line_length": 35.72025723472669, "alnum_prop": 0.5229993698802773, "repo_name": "toddeye/home-assistant", "id": "e5c19d31c4ed821a90a63c0a346b089b0fab5e4f", "size...
import pytest from pycvs.cli import PyCvs # Imports for mocking import os.path import shutil import sys def get_class(mocker): init = mocker.patch.object(PyCvs, '__init__') init.return_value = None return PyCvs() def test_no_parameter(mocker): obj = get_class(mocker) mocker.patch.object(sys, 'a...
{ "content_hash": "ac0d00791d51456eb9c5da99ef287b9f", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 78, "avg_line_length": 25.3265306122449, "alnum_prop": 0.6639806607574537, "repo_name": "gerson23/pycvs", "id": "a3a27136fd2b1e9d159cd42f409a4246825036b5", "size": "1241", ...
from ui.accounts import AccountsForm
{ "content_hash": "85c9a84b543790882ea19452c1cffcc4", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 36, "avg_line_length": 36, "alnum_prop": 0.8888888888888888, "repo_name": "baverman/cakeplant", "id": "47df64e17e70c6ecc4618e818cddc17e54b78557", "size": "36", "binary": f...
""" Copyright (c) 2004-Present Pivotal Software, Inc. This program and the accompanying materials are made available under the terms of the under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache....
{ "content_hash": "bb493b0e9331fe8d7f28aefdd7d0a30a", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 112, "avg_line_length": 35.857142857142854, "alnum_prop": 0.6502877379371403, "repo_name": "edespino/gpdb", "id": "7b4c616c92e2d42c2f144aff7464ca11fe71d6d1", "size": "2282"...
from typing import Any, Generator class Task(object): taskid: int = 0 def __init__(self, target: Generator[Any, Any, Any]): Task.taskid += 1 self.tid: int = Task.taskid self.target = target self.sendval = None def run(self): return self.target.send(self.sendval) i...
{ "content_hash": "a42285661549769f354e48dfc4cc86d7", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 57, "avg_line_length": 21.925925925925927, "alnum_prop": 0.5422297297297297, "repo_name": "ASMlover/study", "id": "a08e626ec997d1e8d7d06b3767d6a49cfcb40289", "size": "1986"...
"""Beautiful Soup Elixir and Tonic "The Screen-Scraper's Friend" http://www.crummy.com/software/BeautifulSoup/ Beautiful Soup uses a pluggable XML or HTML parser to parse a (possibly invalid) document into a tree representation. Beautiful Soup provides provides methods and Pythonic idioms that make it easy to navigate...
{ "content_hash": "824e6c2032f610f838604a55c4838810", "timestamp": "", "source": "github", "line_count": 468, "max_line_length": 467, "avg_line_length": 39.02564102564103, "alnum_prop": 0.5919842312746386, "repo_name": "nasa/CrisisMappingToolkit", "id": "a5b89462bc56d9b0da0fd35c92e11d7f61d23955", "s...
""" List all Windows services installed. $ python scripts/winservices.py AeLookupSvc (Application Experience) status: stopped, start: manual, username: localSystem, pid: None binpath: C:\Windows\system32\svchost.exe -k netsvcs ALG (Application Layer Gateway Service) status: stopped, start: manual, username: NT AUTHOR...
{ "content_hash": "fd1f45a4e57a3d2246fce359a5a7e962", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 79, "avg_line_length": 28.64, "alnum_prop": 0.6941340782122905, "repo_name": "HongxuChen/dotfiles", "id": "8cc5ed4e9fdccf0bdeff97dd3e249ba75e39db91", "size": "1621", "bin...
from click.testing import CliRunner from mock import Mock, patch from sigopt.cli import cli class TestClusterCreateCli(object): def test_cluster_create(self): services = Mock() runner = CliRunner() with \ runner.isolated_filesystem(), \ patch('sigopt.orchestrate.controller.OrchestrateServic...
{ "content_hash": "d5f11a8517f33821d284a96964a512b9", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 90, "avg_line_length": 30, "alnum_prop": 0.69375, "repo_name": "sigopt/sigopt-python", "id": "b4c7df2e25df81ca01eef8849e07d008cde26d64", "size": "551", "binary": false, ...
""" Class for interacting with our PXE server and Access Control (c) 2015 Massachusetts Institute of Technology """ import socket import logging logger = logging.getLogger(__name__) import lophi.globals as G class PXEServer: def __init__(self,ip_address,acl_port=G.PXE_ACL_PORT): """ ...
{ "content_hash": "f18f4009e10cf8e908c6c952444c25f1", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 115, "avg_line_length": 35.35507246376812, "alnum_prop": 0.49292887886862063, "repo_name": "mit-ll/LO-PHI", "id": "d6851765c1e20d6b64777f9741e7f74b91048130", "size": "4879...
from .auth_endpoint import Auth from .data_acceleration_report_endpoint import DataAccelerationReport from .data_alert_endpoint import DataAlerts from .databases_endpoint import Databases from .datasources_endpoint import Datasources from .endpoint import Endpoint, QuerysetEndpoint from .exceptions import ( ServerR...
{ "content_hash": "26f2ea732639dacb2de619f22fb9626f", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 69, "avg_line_length": 38.13333333333333, "alnum_prop": 0.8409090909090909, "repo_name": "tableau/server-client-python", "id": "e14bb8cff1aa14336769aaa9b4ad3084997afeeb", "...
""" Defines the Intermediate Representation that is generated by the frontend and fed to the backends. The goal of this module is to define all data types that are common to the languages and serialization formats we want to support. """ from __future__ import absolute_import, division, print_function, unicode_litera...
{ "content_hash": "deb93e29080989bd64b8507d67cd307e", "timestamp": "", "source": "github", "line_count": 1831, "max_line_length": 98, "avg_line_length": 36.3604587657018, "alnum_prop": 0.5759132420091324, "repo_name": "posita/stone", "id": "aeae3dd24dcfdb8c0a5098541fb89edf25b475eb", "size": "66576",...
import pytest from mock import patch, call, Mock, MagicMock import os from blt.tools import bundle # -- Set Fixtures ------------------------------------------------------------- @pytest.fixture def cmds(): config = { 'bundle': { 'BUNDLE_ROOT': '/tmp/bundles/', 'LOCAL': 'sqlite:///...
{ "content_hash": "4f3a074a55188be2be09f4e1299c15d7", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 142, "avg_line_length": 36.87931034482759, "alnum_prop": 0.6250584385226742, "repo_name": "dencold/blt", "id": "945d00ba196249d071080a0ca10711c22a6b8dcd", "size": "2139", ...
from __future__ import absolute_import import itertools import logging import thread import urlparse from django.conf import settings # noqa import glanceclient as glance_client from openstack_dashboard.api import base LOG = logging.getLogger(__name__) def glanceclient(request): o = urlparse.urlparse(base....
{ "content_hash": "6a75df8b2c47060736622c3412531d42", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 77, "avg_line_length": 28.261904761904763, "alnum_prop": 0.6128896377422073, "repo_name": "deepakselvaraj/federated-horizon", "id": "ca9db82d0095deb5b69840ba141426b9aac72240"...
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineRespon...
{ "content_hash": "2da1a471eb46aa81c0ff18857c2bfde2", "timestamp": "", "source": "github", "line_count": 726, "max_line_length": 214, "avg_line_length": 42.80440771349862, "alnum_prop": 0.6401403011970652, "repo_name": "Azure/azure-sdk-for-python", "id": "777057c256cb4c1a72ec385fd9f8cb330a9ddfe7", "...
from __future__ import division from mapproxy.compat.image import Image, transform_uses_center from mapproxy.image import ImageSource, image_filter from mapproxy.srs import make_lin_transf, bbox_equals class ImageTransformer(object): """ Transform images between different bbox and spatial reference systems. ...
{ "content_hash": "0e2279dca958ee1db7d3172cfa853d6c", "timestamp": "", "source": "github", "line_count": 324, "max_line_length": 102, "avg_line_length": 37.20987654320987, "alnum_prop": 0.5512607830126078, "repo_name": "olt/mapproxy", "id": "a96042da61672b526363776815127d13d478c768", "size": "12700"...
import roax.context as context import roax.schema as s import unittest from roax.resource import Forbidden, Resource, operation from roax.security import ContextSecurityRequirement, SecurityRequirement, nested class Never(SecurityRequirement): def authorized(self): raise Forbidden req1 = ContextSecurityR...
{ "content_hash": "2855425766311d99a6331cc7d8087ba3", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 81, "avg_line_length": 25.966101694915253, "alnum_prop": 0.6305483028720626, "repo_name": "pbryan/roax", "id": "9275c99b667903ab633d08095165d6f776517c5a", "size": "1532", ...
import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText class EmailClient(object): """ Email Client to manage connection information for SMTP server """ def __init__(self, host, port, username, password, use_ssl=False): self.host = host self....
{ "content_hash": "23d50e1ba71c3bf51773c991ba526207", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 103, "avg_line_length": 33.431372549019606, "alnum_prop": 0.5882697947214076, "repo_name": "Brok-Bucholtz/TopOfThePile", "id": "d5ea258cc33fc4e5515abc17b7da93b582c30973", "...
"""Supports OMNI Combined, Definitive, IMF and Plasma Data, and Energetic Proton Fluxes, Time-Shifted to the Nose of the Earth's Bow Shock, plus Solar and Magnetic Indices. Downloads data from the NASA Coordinated Data Analysis Web (CDAWeb). Supports both 5 and 1 minute files. Parameters ---------- platform : string ...
{ "content_hash": "a55b23a476197fd126195c23af80664c", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 101, "avg_line_length": 36.16326530612245, "alnum_prop": 0.6079288939051919, "repo_name": "aburrell/pysat", "id": "f90197ab677b4204d9fe84f578b69ff91bf83bb8", "size": "7112...
import unittest import warnings import sys from test import test_support class TestSpecifics(unittest.TestCase): def test_debug_assignment(self): # catch assignments to __debug__ self.assertRaises(SyntaxError, compile, '__debug__ = 1', '?', 'single') import __builtin__ prev = __bui...
{ "content_hash": "503ec5e7f1ce49b8af6d9c01a245db6b", "timestamp": "", "source": "github", "line_count": 268, "max_line_length": 95, "avg_line_length": 35.742537313432834, "alnum_prop": 0.5327278421547135, "repo_name": "MalloyPower/parsing-python", "id": "c567fa432abb6efafc3c6463a94c003819296063", "...
import csv import numpy as np import stream class PLDStream(stream.VectorStream): def __init__(self, file='/var/datasets/wdc/pld-arc'): self.f=open(file,'r') stream.VectorStream.__init__(self,p=65133, n=69878) self.reader=csv.reader(self.f, delimiter='\t') self._lastRow=None ...
{ "content_hash": "db72f4dbe49b1b7542aad5a7820888f4", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 73, "avg_line_length": 28.972972972972972, "alnum_prop": 0.4631529850746269, "repo_name": "mitliagkas/pyliakmon", "id": "fd0e1af53938ae59202d0229b2bb1e090035b3ff", "size": ...
from django.contrib import auth from django.core.exceptions import ImproperlyConfigured from models import CertificateIndex, Certificate from binascii import crc32 def get_user(request): if not hasattr(request, '_cached_user'): request._cached_user = auth.get_user(request) return request._cached_user ...
{ "content_hash": "4768665e07f78ce2df88575075da88cd", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 106, "avg_line_length": 41.52, "alnum_prop": 0.552504816955684, "repo_name": "agladkov/django-sslauth", "id": "e2e363876e4a09157c435a3c9697c6b5d075c261", "size": "2076", ...
import time import inspect import pickle import os import pytest from pyparsing import * from bayesdb.bql_grammar import * from bayesdb.engine import Engine from bayesdb.parser import Parser import bayesdb.functions as functions import numpy engine = Engine('local') parser = Parser() test_M_c = {'idx_to_name': {'1': ...
{ "content_hash": "04ea6d725153ee039c538d70a6471cae", "timestamp": "", "source": "github", "line_count": 1437, "max_line_length": 278, "avg_line_length": 57.17466945024356, "alnum_prop": 0.6580939629990263, "repo_name": "poppingtonic/BayesDB", "id": "d601549e2a9317602246d7ac450a85009726362f", "size"...
import Tkinter from PIL import Image, ImageDraw, ImageTk import Layer import ChooseFrieze, L_sys_Main, DrawMain, ChooseWallpaper # This class stores the layers, their thumbnails, and coords class Meta: def __init__(self, i): self.instance = i self.im = Image.new('RGBA', (900, 600), 'white') ...
{ "content_hash": "c521f5068139207093093d7d205656c7", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 114, "avg_line_length": 36.75373134328358, "alnum_prop": 0.5955329949238579, "repo_name": "mntalateyya/Shapes_Studio", "id": "684a36308a0ccd0b47aee0ad6f0e58fdaceaa582", "s...
import os import oslo_messaging as messaging import requests from oslo_log import log as logging from gbpservice.nfp.configurator.agents import agent_base from gbpservice.nfp.configurator.lib import fw_constants as const from gbpservice.nfp.configurator.lib import utils as load_driver from gbpservice.nfp.core import ...
{ "content_hash": "7cceefa0b2ef9096600750e3e6797943", "timestamp": "", "source": "github", "line_count": 433, "max_line_length": 79, "avg_line_length": 35.4526558891455, "alnum_prop": 0.5765748159729008, "repo_name": "jiahaoliang/group-based-policy", "id": "29b64cce8f98bf3ddecb3b16d5a120cbc5c12e4f", ...
import javabridge import bioformats from collections import OrderedDict import numpy as np from tqdm import tqdm from xml.etree import cElementTree as etree class LIFContainer: def __init__(self, filename): self.filename = filename self.metadata_in_xml = bioformats.get_omexml_metadata(filename) ...
{ "content_hash": "5b0fe30cdfffa1add623c1e1f003d5a6", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 79, "avg_line_length": 39.26190476190476, "alnum_prop": 0.5215281989084294, "repo_name": "gangiman/FRAPanalyzer", "id": "83f5cb3fc004a9f12f40581183b7a3290e2a70d1", "size":...
from __future__ import division, unicode_literals import unittest import os import warnings from pymatgen.command_line.enumlib_caller import EnumlibAdaptor from pymatgen import Element, Structure from pymatgen.transformations.standard_transformations import \ SubstitutionTransformation from monty.os.path import whi...
{ "content_hash": "96550e12655feda614dc5bdf57ca0c09", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 83, "avg_line_length": 42.489208633093526, "alnum_prop": 0.5765323399932272, "repo_name": "gpetretto/pymatgen", "id": "0d6338ffe33c993299cb1b14bec262cb4d09c932", "size": "...