text
stringlengths
4
1.02M
meta
dict
""" The :mod:`sklearn.feature_extraction.text` submodule gathers utilities to build feature vectors from text documents. """ from __future__ import unicode_literals import array from collections import Mapping, defaultdict import numbers from operator import itemgetter import re import unicodedata import numpy as np ...
{ "content_hash": "b552efbb141ce2255010e965eb78992e", "timestamp": "", "source": "github", "line_count": 1330, "max_line_length": 79, "avg_line_length": 37.578947368421055, "alnum_prop": 0.6155662264905962, "repo_name": "mattilyra/scikit-learn", "id": "3c17263d945462fa85f23765779f04575bbbdc76", "siz...
from datetime import datetime import numpy as np import pytest from pandas import ( Series, Timestamp, ) import pandas._testing as tm class TestConvert: def test_convert(self): # GH#10265 dt = datetime(2001, 1, 1, 0, 0) td = dt - datetime(2000, 1, 1, 0, 0) # Test coercio...
{ "content_hash": "7ffe2f6997fcdca0fa1131590953c7f0", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 83, "avg_line_length": 36.39568345323741, "alnum_prop": 0.5870725439810239, "repo_name": "datapythonista/pandas", "id": "4832780e6d0d366a90b7b92ff2e1c633b0dc0443", "size":...
import os DATA_DIR = '../data/raw/' LOG_DIR = '../data/logs' REPROCESS_DIR = '../data/reprocess' paths = [DATA_DIR,LOG_DIR,REPROCESS_DIR] for path in paths: if not os.path.exists(path): os.makedirs(path)
{ "content_hash": "2871e48f5b2f492af96c02f05775c3c3", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 40, "avg_line_length": 18.25, "alnum_prop": 0.639269406392694, "repo_name": "richhorace/docker-getpocket-elastic", "id": "94d62063d69f0daa23685ddf734069baf3f6ff18", "size":...
import base64 import uuid import mock import mox from oslo.config import cfg from oslo.serialization import jsonutils import webob from nova.api.openstack.compute import servers from nova.compute import api as compute_api from nova.compute import task_states from nova.compute import vm_states from nova import context...
{ "content_hash": "3baf44b7fc231fe23991a2a91311113e", "timestamp": "", "source": "github", "line_count": 1541, "max_line_length": 79, "avg_line_length": 38.75924724205062, "alnum_prop": 0.5473647200642915, "repo_name": "luzheqi1987/nova-annotation", "id": "16f8ce14bf38064d38eb49a87007409a5558f2ec", ...
import os import threading from ginga import GingaPlugin from ginga.misc import Bunch from ginga.util import iohelper from ginga.gw import Widgets, Viewers class Thumbs(GingaPlugin.GlobalPlugin): def __init__(self, fv): # superclass defines some variables for us, like logger super(Thumbs, self)....
{ "content_hash": "5b1da4b6031363622526b51c0d4900a8", "timestamp": "", "source": "github", "line_count": 733, "max_line_length": 80, "avg_line_length": 36.84993178717599, "alnum_prop": 0.5589944837288512, "repo_name": "stscieisenhamer/ginga", "id": "143c281b2529813949ce11fa3d4be492913f40cf", "size":...
import _plotly_utils.basevalidators class WidthValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="width", parent_name="scatter3d.marker.line", **kwargs ): super(WidthValidator, self).__init__( plotly_name=plotly_name, parent_name=p...
{ "content_hash": "2871fd6130c8a3111161e1eea78d5426", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 80, "avg_line_length": 33.93333333333333, "alnum_prop": 0.5834970530451866, "repo_name": "plotly/plotly.py", "id": "af159b59ebcb6694c489cd64e12dae6507ded1d2", "size": "509"...
''' Local settings - Run in Debug mode - Use console backend for emails - Add Django Debug Toolbar - Add django-extensions as app ''' from .common import * # noqa # DEBUG # ------------------------------------------------------------------------------ DEBUG = env.bool('DJANGO_DEBUG', default=True) TEMPLATES[0]['OPT...
{ "content_hash": "0c337af22038fea380290bc78510d358", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 99, "avg_line_length": 31.57377049180328, "alnum_prop": 0.48753894080996885, "repo_name": "EnigmaMaster1234/furnishing", "id": "3cc52ed9554d1e8634b2757960f5221c7824e611", "...
from django.core.urlresolvers import reverse from django import http import django.test from mox3.mox import IsA # noqa from oslo_serialization import jsonutils from openstack_dashboard import api from openstack_dashboard.dashboards.project.network_topology.views import \ TranslationHelper from openstack_dashboa...
{ "content_hash": "bc8f7aacf6618bb81d835f8dc90358cc", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 79, "avg_line_length": 43.350710900473935, "alnum_prop": 0.5420356401005795, "repo_name": "dan1/horizon-x509", "id": "65cbcd6b85699cfbc0d59703d1a859300aba8080", "size": "9...
""" Flask-Pushrod ships with a few normalizers by default. For more info, see :meth:`~flask.ext.pushrod.Pushrod.normalize`. Flask-Pushrod's built-in normalizers are generally named with the scheme :samp:`normalize_{type}`. .. note:: Normalizers also apply to subclasses, unless the subclass defines another normaliz...
{ "content_hash": "87c22b4c7b102bc98a6679838d1bbe86", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 76, "avg_line_length": 26.983606557377048, "alnum_prop": 0.6123936816524909, "repo_name": "UYSio/Flask-Pushrod", "id": "c26223bbd3fca2499fb49f0df5212fe86ccb6b50", "size": ...
""" Beacon to monitor certificate expiration dates from files on the filesystem. .. versionadded:: 3000 :maintainer: <devops@eitr.tech> :maturity: new :depends: OpenSSL """ import logging from datetime import datetime import salt.utils.beacons import salt.utils.files try: from OpenSSL import crypto HAS_OPE...
{ "content_hash": "460983e0ec13dc62e5b8dcf2f8aac9ee", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 95, "avg_line_length": 33.861111111111114, "alnum_prop": 0.49302707136997537, "repo_name": "saltstack/salt", "id": "b9b5990206388c5fa249aaaec5938f8cd48e458c", "size": "609...
""" Manage ufw setup """ import logging from installation import chroot try: import ufw _UFW = True except ImportError: _UFW = False def run(params, dest_dir="/install"): cmd = ["ufw"] cmd.extend(params) if not _UFW: # Could not import ufw module (missing?) # Will call ufw c...
{ "content_hash": "024928d283ce25bfba3720e7ba03b53c", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 85, "avg_line_length": 28.64864864864865, "alnum_prop": 0.49528301886792453, "repo_name": "DecisionSystemsGroup/DSGos", "id": "433260201564f366bea4ddb369c2180d366f5ea0", "s...
from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/space/booster/shared_booster_mk3.iff" result.attribute_template_id = -1 result.stfName("string_id_table","") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "1e207081d47676533690509101ac9884", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 80, "avg_line_length": 23.76923076923077, "alnum_prop": 0.6957928802588996, "repo_name": "obi-two/Rebelion", "id": "9bf978d119df25e5c9554822bec64cde578dafd9", "size": "454"...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shaping_templeat.settings.development") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "36d344f8441ed507abef60804262b20a", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 92, "avg_line_length": 27.666666666666668, "alnum_prop": 0.7269076305220884, "repo_name": "hamedtorky/django-starter-template", "id": "035220a1f505bd983ae97b800591e4e02cd42762...
import sys import pymongo import urllib.request import json import time from datetime import datetime from bs4 import BeautifulSoup # To get everything from pymongo import MongoClient def main(arg1): #connect to MongoDB client = MongoClient() db = client.Stocks articles = db.Articles #Que...
{ "content_hash": "90e3fea6c341ac73c653d24f1908ee2c", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 162, "avg_line_length": 38, "alnum_prop": 0.562753036437247, "repo_name": "ethanabowen/StockProject", "id": "0c7b51b601ccc23eb716030f403a9456a6acdc12", "size": "2470", "b...
import os import subprocess from cinder.rootwrap import filters from cinder.rootwrap import wrapper from cinder import test class RootwrapTestCase(test.TestCase): def setUp(self): super(RootwrapTestCase, self).setUp() self.filters = [ filters.RegExpFilter("/bin/ls", "root", 'ls', '/[...
{ "content_hash": "26ddae604403d8b0de8de0be9501890f", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 77, "avg_line_length": 41.95575221238938, "alnum_prop": 0.6131617802151444, "repo_name": "NewpTone/stacklab-cinder", "id": "0819a556ff4937c99982eafcaf9e3d3bb8b1ca9f", "siz...
import os import sys from cairis.core.ARM import * __author__ = 'Shamal Faily' def main(args=None): if args is None: args = sys.argv[1:] cairisApp = IRISApp() cairisApp.MainLoop() if __name__ == '__main__': try: import gtk gtk.remove_log_handlers() from cairis.gui.IRISApp import IRISApp ...
{ "content_hash": "b22aa94c05405bd44446fe15686a2d12", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 44, "avg_line_length": 22.08, "alnum_prop": 0.6340579710144928, "repo_name": "nathanbjenx/cairis", "id": "b7cebc1ea39d3b56622a344378dce7b56892de58", "size": "1372", "bina...
""" This module adds shared support for generic api modules In order to use this module, include it as part of a custom module as shown below. The 'api' module provides the following common argument specs: * rate limit spec - rate: number of requests per time unit (int) - rate_limit: time window ...
{ "content_hash": "cff4dcc9eaaf694c8a4888feacbcdb73", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 77, "avg_line_length": 27.95, "alnum_prop": 0.5463327370304114, "repo_name": "SergeyCherepanov/ansible", "id": "781518591fb6dd8cc70562da7932392ade1f31d1", "size": "4456", ...
from graphics import * import math a = 50 #the top corner coords. b = 70 #the second bottom corner. length = b - a window_width = 800 window_height = 600 row_total = (window_width - (2 * a)) / length col_total = (window_height - (2 * a)) / length cell_total = row_total * col_total #the cell class contains methods to i...
{ "content_hash": "279cd419ba9d97399512bfef8957c6b4", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 94, "avg_line_length": 31.87272727272727, "alnum_prop": 0.5590416428978894, "repo_name": "PassaEP/CGOL", "id": "5a57848ff813b6d4c7b704d45184d1cdb431c2f5", "size": "1753", ...
""" Copyright (c) 2013, Regents of the University of California All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list o...
{ "content_hash": "23baa49b59fb95f52ed14e2f76ef153b", "timestamp": "", "source": "github", "line_count": 616, "max_line_length": 79, "avg_line_length": 36.50487012987013, "alnum_prop": 0.6106639391648508, "repo_name": "ucla/PushHubCore", "id": "04ff75e4c50314ddaccb7b30b36d698fc8a85fdc", "size": "224...
import re import types from datetime import datetime, timedelta from decimal import Decimal from unittest import TestCase, mock from django.core.exceptions import ValidationError from django.core.files.base import ContentFile from django.core.validators import ( BaseValidator, DecimalValidator, EmailValida...
{ "content_hash": "9423b9e4a0cc1b981469fba562a0046b", "timestamp": "", "source": "github", "line_count": 810, "max_line_length": 88, "avg_line_length": 39.598765432098766, "alnum_prop": 0.6185814497272019, "repo_name": "blighj/django", "id": "02bee30ac1319912ed39d5e80609845a21540072", "size": "32178...
from __future__ import absolute_import, division, print_function, unicode_literals import json import logging import mock import os from .common import BaseTest from c7n.exceptions import PolicyExecutionError from c7n.policy import Policy from c7n import handler class HandleTest(BaseTest): def test_init_config...
{ "content_hash": "baae540ff8d70a71b162b95bcdf64e53", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 87, "avg_line_length": 37.3469387755102, "alnum_prop": 0.5386156648451731, "repo_name": "kapilt/cloud-custodian", "id": "8b790cae0ca4a105999148b68de0897ae9192126", "size":...
import os import io import re from setuptools import setup def read(*names, **kwargs): with io.open( os.path.join(os.path.dirname(__file__), *names), encoding=kwargs.get("encoding", "utf8") ) as fp: return fp.read() def find_version(*file_paths): f = read(*file_paths) m = re.s...
{ "content_hash": "070b20336ec15bbdc27b6470a9b1241f", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 68, "avg_line_length": 32.32692307692308, "alnum_prop": 0.5455086258179654, "repo_name": "etecor/bklv2", "id": "2ef0c2f417bdaeb8df1d27733e5494633fed07f3", "size": "1706", ...
import configparser import os import traceback import Bom.Facture as Facture #import Command.logger as pp from Command.logger import bcolors as pp class Client: def __init__(self,name, adress, period,mail="",city="",zipcode="",amount=0): self.name = name self.adress=adress self.period=perio...
{ "content_hash": "87a249bb95fed935c094e2f62554054a", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 122, "avg_line_length": 38.95505617977528, "alnum_prop": 0.5350447072396884, "repo_name": "phalocrateGreg/FactureGui", "id": "f3b7006cadac4c0849f6ec2160360984b119e011", "si...
"""The tests for the Monoprice Blackbird media player platform.""" import unittest from unittest import mock import voluptuous as vol from collections import defaultdict from homeassistant.components.media_player.const import ( SUPPORT_TURN_ON, SUPPORT_TURN_OFF, SUPPORT_SELECT_SOURCE, ) from homeassistant....
{ "content_hash": "c103309201609f843a165fe95778d9e2", "timestamp": "", "source": "github", "line_count": 340, "max_line_length": 83, "avg_line_length": 32.07058823529412, "alnum_prop": 0.5066030814380044, "repo_name": "joopert/home-assistant", "id": "0b6eda16c152fa48a6de7443a27363a5e7b05e62", "size"...
''' Created on Dec 19, 2017 @Author: hjp Description: Extracting EnWikipedia files into single text. ''' import time import datetime from gensim.corpora import WikiCorpus def enwiki(srcPath, tarPath): index = 0 space = " " output = open(tarPath, 'w') wiki = WikiCorpus(srcPath, lemmatize=F...
{ "content_hash": "50507873143fc95951350783054742c6", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 113, "avg_line_length": 25.457142857142856, "alnum_prop": 0.5959595959595959, "repo_name": "hjpwhu/Python", "id": "86cde647d1d627f5ccb49d6424750d057cb1aaa3", "size": "915",...
"""Auto-generated file, do not edit by hand. SM metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_SM = PhoneMetadata(id='SM', country_code=None, international_prefix=None, general_desc=PhoneNumberDesc(national_number_pattern='1\\d{2}', possible_length=(3,)), em...
{ "content_hash": "1619587710c696b22ebd4210610e37b8", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 110, "avg_line_length": 69.5, "alnum_prop": 0.7464028776978417, "repo_name": "gencer/python-phonenumbers", "id": "61bb8401ed00c45bcc1ea1b483c69cd3b9f0b7e4", "size": "556", ...
import json import os import pandas import matplotlib.pyplot as plt def read_profile(): file_in = open('./Data/Superhost/Profile_Super.txt') superhost_list_tmp = file_in.read().split('\n') superhost_list = [] for superhost in superhost_list_tmp: if superhost != '': superhost_list.a...
{ "content_hash": "7bc11827f0288e0369005a3d5da593c8", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 122, "avg_line_length": 36.5, "alnum_prop": 0.6018463371054199, "repo_name": "lifei96/Airbnb-superhosts-crawler-with-data-analyzer", "id": "d8c79594cf7263d7449691bf5b198894e8...
from django.contrib.auth.decorators import user_passes_test, REDIRECT_FIELD_NAME from organizations.models import OrganizationUser def organizations_member_required(function=None, redirect_field_name=REDIRECT_FIELD_NAME, login_url=None): """ Decorator for views that checks that the user is logged in if the cu...
{ "content_hash": "b2ea1aa4917c058caa7206deeace9ddb", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 132, "avg_line_length": 40.029411764705884, "alnum_prop": 0.7200587803085966, "repo_name": "arteria/django-ar-organizations", "id": "0e81de4454fb7256efdbf05218561408d5accd01"...
liste = [1, 2, True, 9, 8, 7, "Kuchen"] # Um ein Element der Liste auszugeben, schreibt man den Namen der Liste # und dahinter in eckigen Klammern den Index des Elementes. # Wichtig zu wissen ist dabei, dass Python so wie viele andere # Programmiersprachen jede Zaehlung mit 0 beginnt. # Gebe alle Elemente der Liste...
{ "content_hash": "bdf799c597312553e5f808d5aaa6182f", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 81, "avg_line_length": 37, "alnum_prop": 0.7125307125307125, "repo_name": "PlayLucky/PythonTutorials", "id": "a370de0e2b7df1f556ad97fe83eed9fedbc7f46a", "size": "732", "b...
from oslo_utils.fixture import uuidsentinel from oslo_versionedobjects import fixture as ovo_fixture from nova import context from nova import exception from nova import objects from nova import test class ConsoleAuthTokenTestCase(test.TestCase): def setUp(self): super(ConsoleAuthTokenTestCase, self).set...
{ "content_hash": "819f1cbb0964a3904c6b8fa89b212723", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 74, "avg_line_length": 37.18604651162791, "alnum_prop": 0.6454033771106942, "repo_name": "mahak/nova", "id": "35efcc64d5bc61a9215ebf8bef7bdbde422e5487", "size": "2244", "...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('projects', '0005_auto_20150202_1041'), ] operations = [ migrations.CreateModel( name='EpiCollectProject', fields=[ ...
{ "content_hash": "7d5a7bc637330c78b5bc7912aa1f5b0c", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 135, "avg_line_length": 26.782608695652176, "alnum_prop": 0.564935064935065, "repo_name": "ExCiteS/geokey-epicollect", "id": "4a915e3b2448545cc02ec6e5e61f3773e4540312", "si...
def two_or_three(): x = 3 [0 for x in range(3)] return x # Will return 2 in Python 2 and 3 in Python 3. print(two_or_three())
{ "content_hash": "f56912eac1148146edad18b27600d4b2", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 59, "avg_line_length": 23, "alnum_prop": 0.6014492753623188, "repo_name": "github/codeql", "id": "11b876016bd1a353a7df05536c12af69be64cb90", "size": "139", "binary": false...
from Vintageous.vi.utils import modes from collections import namedtuple from Vintageous.tests import set_text from Vintageous.tests import add_sel from Vintageous.tests import get_sel from Vintageous.tests import first_sel from Vintageous.tests import ViewTest # TODO: Test against folded regions. # TODO: Ensure th...
{ "content_hash": "6d93213f1e8b57f29023eb2fc28d7585", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 149, "avg_line_length": 63.06521739130435, "alnum_prop": 0.594105480868666, "repo_name": "zhangtuoparis13/Vintageous", "id": "39e0d19fad1779ec3c6da7ab8717d2d317f8be4a", "s...
""" Extends geotrek.settings.base using values coming from a .INI file (default: etc/settings.ini). It prevents users from editing a python file to configure Geotrek, and provides a way to restrict the set of configurable options. In addition, the same .INI file is used by buildout in order to create config files of...
{ "content_hash": "20e9ada3694cac308eca9728deb38519", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 119, "avg_line_length": 41.65925925925926, "alnum_prop": 0.6534495021337127, "repo_name": "johan--/Geotrek", "id": "d4c91082746f636b04c5eb6a312b003456bab56f", "size": "562...
""" pygments.lexers.modula2 ~~~~~~~~~~~~~~~~~~~~~~~ Multi-Dialect Lexer for Modula-2. :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include from pygments.util import get_bool_opt, ge...
{ "content_hash": "b1c62aba398c94d3a6dcfc4f26b1bde4", "timestamp": "", "source": "github", "line_count": 1579, "max_line_length": 84, "avg_line_length": 33.60101329955668, "alnum_prop": 0.5415410132689988, "repo_name": "sonntagsgesicht/regtest", "id": "cad2f4fd40864a1777424d8348bda725dbc1963f", "siz...
from unittest import mock from horizon import exceptions from openstack_dashboard import api from openstack_dashboard.test import helpers as test @mock.patch('swiftclient.client.Connection') class SwiftApiTests(test.APIMockTestCase): def test_swift_get_containers(self, mock_swiftclient): containers = se...
{ "content_hash": "c3011f3e2d6e6c918ab14e02068199a5", "timestamp": "", "source": "github", "line_count": 286, "max_line_length": 80, "avg_line_length": 41.42307692307692, "alnum_prop": 0.5755043470920909, "repo_name": "openstack/horizon", "id": "64d38f88d0da8e7759b1dc101547433cbe3a485e", "size": "12...
from __future__ import unicode_literals import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('server', '0012_auto_20160524_1959'), ] operations = [ migrations.AlterField( model_name='membership', name='...
{ "content_hash": "c98ff3a508700bee81bd4dd7c7c3719e", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 192, "avg_line_length": 30.916666666666668, "alnum_prop": 0.5889487870619946, "repo_name": "mwillmott/techbikers", "id": "469d8cd6f41e1c32105fe5186e83edfc4817d83d", "size":...
import json from datetime import datetime from timecard.models import admin_required, is_admin, db, config, set_config, User, TimeSegment, Template, TemplateSegment from flask import Blueprint, session, request, abort, jsonify from flask_cas import login_required api_views = Blueprint('api', __name__, url_prefix='/a...
{ "content_hash": "a14440864455e553bf1e3b524b31c58c", "timestamp": "", "source": "github", "line_count": 387, "max_line_length": 122, "avg_line_length": 37.98449612403101, "alnum_prop": 0.6048979591836735, "repo_name": "justinbot/timecard", "id": "956a424d8669253bd887daffc92911feca8e1e7a", "size": "...
import sys import logging import functools from queue import Queue from threading import currentThread from PyQt5 import QtCore from PyQt5.QtWidgets import * import envi.threads as e_threads logger = logging.getLogger(__name__) def idlethread(func): ''' A decorator which causes the function to be called by...
{ "content_hash": "4b082b1e42807a9be67d61cea269a19b", "timestamp": "", "source": "github", "line_count": 270, "max_line_length": 77, "avg_line_length": 25.733333333333334, "alnum_prop": 0.6157167530224525, "repo_name": "bat-serjo/vivisect", "id": "c2d3fba5ae64ef79aa256d2f991f38212dc9ba78", "size": "...
"""Glazier interface to NTP time service.""" import logging import os import socket import time # do not remove: internal placeholder 1 from glazier.lib import execute from glazier.lib.constants import WINPE_SYSTEM32 import ntplib from glazier.lib import errors BINARY = os.path.join(WINPE_SYSTEM32, 'cmd.exe') RETR...
{ "content_hash": "5c5328b94346b1d7062d8dc31cf0099f", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 76, "avg_line_length": 28.056338028169016, "alnum_prop": 0.6812248995983936, "repo_name": "google/glazier", "id": "a420d175da489bdcc83a0416b080da50c93be4ee", "size": "2588"...
import os import sys import pytest try: from unittest.mock import Mock except ImportError: from mock import Mock from vcr import VCR from subliminal.cache import region vcr = VCR(path_transformer=lambda path: path + '.yaml', match_on=['method', 'scheme', 'host', 'port', 'path', 'query', 'body'], ...
{ "content_hash": "2f366947a9aab376c1f010143bd83fc7", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 81, "avg_line_length": 23.92105263157895, "alnum_prop": 0.6897689768976898, "repo_name": "t4lwh/subliminal", "id": "fc87405aec51b0687f5ae49e0a89dd29d25a6c23", "size": "933"...
""" Continuous Random Variables - Prebuilt variables Contains ======== Arcsin Benini Beta BetaPrime Cauchy Chi ChiNoncentral ChiSquared Dagum Erlang Exponential FDistribution FisherZ Frechet Gamma GammaInverse Kumaraswamy Laplace Logistic LogNormal Maxwell Nakagami Normal Pareto QuadraticU RaisedCosine Rayleigh Studen...
{ "content_hash": "9d9b6020d69bd4b3c271eee774feb9ef", "timestamp": "", "source": "github", "line_count": 2514, "max_line_length": 90, "avg_line_length": 24.066030230708034, "alnum_prop": 0.48689299527288354, "repo_name": "abhiii5459/sympy", "id": "3bb794329f7d8286f197405d841f9fc9f28c553d", "size": "...
from openstack import exceptions from openstack.network.v2 import address_scope as _address_scope from openstack.network.v2 import agent as _agent from openstack.network.v2 import auto_allocated_topology as \ _auto_allocated_topology from openstack.network.v2 import availability_zone from openstack.network.v2 impor...
{ "content_hash": "84ef8716214568eb1117eaafe72d3763", "timestamp": "", "source": "github", "line_count": 4155, "max_line_length": 79, "avg_line_length": 45.92707581227437, "alnum_prop": 0.5897383493950018, "repo_name": "stackforge/python-openstacksdk", "id": "48a2928ec7cd723f4223c6cc718f8649e03aea1a",...
def makeRandomForestClassificationInputs(positivesFileName, negativesFileName, validPositivesFileName, validNegativesFileName): # Make inputs for a random forward classifier # ASSUMES THAT FEATURES ARE SORTED IN THE SAME WAY IN ALL FILES positivesFeatureMat = np.loadtxt(positivesFileName) negativesFeatureMat = ...
{ "content_hash": "8b3220a385c5823b10cc6264c0691fff", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 192, "avg_line_length": 59.6578947368421, "alnum_prop": 0.8151742390824879, "repo_name": "imk1/IMKTFBindingCode", "id": "02579e70412f0bee46d277934f690170d5750d22", "size": ...
""" Migrate audits for snapshots Create Date: 2016-11-17 11:49:04.547216 """ # disable Invalid constant name pylint warning for mandatory Alembic variables. # pylint: disable=invalid-name from logging import getLogger from alembic import op from sqlalchemy.sql import column from sqlalchemy.sql import select from sq...
{ "content_hash": "dd245ec9b9eabfbf1df4cf1faec03ae2", "timestamp": "", "source": "github", "line_count": 228, "max_line_length": 79, "avg_line_length": 31.93421052631579, "alnum_prop": 0.6411207251751133, "repo_name": "AleksNeStu/ggrc-core", "id": "c63d35fc28ebb2d3968235e3862858e0d4df96e5", "size": ...
''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
{ "content_hash": "23b5af92850facdb8ef1fdf7029a2c53", "timestamp": "", "source": "github", "line_count": 879, "max_line_length": 215, "avg_line_length": 43.9419795221843, "alnum_prop": 0.6454886731391586, "repo_name": "arenadata/ambari", "id": "5fe970904bee091370c81e6572ee464a24c197b4", "size": "386...
""" First run the following in a mongo shell: db.getCollection('addondataversenodesettings').update({'user_settings': {'$type': 2}}, {$rename: { user_settings: 'foreign_user_settings'}}, {multi: true}) Then change the user_settings field of AddonDataverseNodeSettings to foreign_user_settings """ import sys impor...
{ "content_hash": "fd0a7118ebab23005e11996f99a8a28c", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 159, "avg_line_length": 32.282051282051285, "alnum_prop": 0.6965845909451946, "repo_name": "Nesiehr/osf.io", "id": "551fc257ed60c30969075db1e89b5a3ea6346a00", "size": "1259...
from common.constants import FRAME_RATE from common import mvc class ProcessModel(mvc.MVCObject): """ Subclasses of this Model are designed to run in a separate process. They do their work at their own rate and return a result when they finish by putting the result in the given queue. """ ...
{ "content_hash": "c1e18ad70090118575c70919ea305333", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 53, "avg_line_length": 27.833333333333332, "alnum_prop": 0.6706586826347305, "repo_name": "Wopple/fimbulvetr", "id": "a71636a7cf35b9d05b40dad64496699837277ca8", "size": "50...
""" Copies the Info.plist and adds extra fields to it like the git hash of the engine. Precondition: $CWD/../../flutter is the path to the flutter engine repo. usage: copy_info_plist.py --source <src_path> --destination <dest_path> --bitcode --minversion=<deployment_target> """ import subprocess import argparse imp...
{ "content_hash": "43a26c875ff99f05a8fbae44ac46cdb3", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 114, "avg_line_length": 35.340425531914896, "alnum_prop": 0.7025888019265503, "repo_name": "jason-simmons/flutter_engine", "id": "d9e9333674d77feeefe029a3869a41f90fd70a83", ...
from app import create_app, db from app.models import User if __name__ == '__main__': app = create_app('development') with app.app_context(): db.create_all() if User.query.filter_by(username='john').first() is None: User.register('john', 'cat') app.run()
{ "content_hash": "e5f42f8f2357ffb500e025a1c0cdfdb6", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 65, "avg_line_length": 29.6, "alnum_prop": 0.5912162162162162, "repo_name": "miguelgrinberg/oreilly-intro-to-flask-video", "id": "c7a903ae3860b1522c7daff074b204f2ade1f092", ...
from unittest.mock import Mock, patch from django.test import SimpleTestCase from groups.managers import GroupQuerySet from groups.models import Group class GroupQuerySetTest(SimpleTestCase): def setUp(self): self.queryset = GroupQuerySet(model=Group) @patch.object(GroupQuerySet, 'filter') def...
{ "content_hash": "20aa919c440df122a5e4aa3310b8183e", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 77, "avg_line_length": 35.05714285714286, "alnum_prop": 0.7180114099429503, "repo_name": "srtab/alexandriadocs", "id": "f4de0f65fce22e20216c67ca5039ee062aaff7d7", "size": "...
from django.db import models, transaction from django.utils.translation import ugettext as _ from grappelli.fields import PositionField class Help(models.Model): """ Help Entry. """ title = models.CharField(_('Title'), max_length=50) # order order = PositionField(_('Order')) ...
{ "content_hash": "789027a431a74c8f6fb9e6fed35af32f", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 118, "avg_line_length": 26.285714285714285, "alnum_prop": 0.576766304347826, "repo_name": "codysoyland/django-grappelli", "id": "46d03638fe47500aabd8239f9551c427fd1f1744", ...
from __future__ import unicode_literals import sure
{ "content_hash": "22403b54309909c185e4f072a38ebc0f", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 39, "avg_line_length": 26, "alnum_prop": 0.7884615384615384, "repo_name": "andresriancho/HTTPretty", "id": "90474651e4192fc6b6697cdb5b590cfcb39e4ae9", "size": "98", "binar...
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', # Examples: url(r'',include('snv.urls',namespace='snv')) # url(r'^snvproj/', include('snvproj.foo.urls')), # Uncom...
{ "content_hash": "53430920fb9b5e31f59b051b0eb6ba85", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 71, "avg_line_length": 30.77777777777778, "alnum_prop": 0.6877256317689531, "repo_name": "jtapial/snvdb", "id": "a8d92798a3a07b02b041c5b10be994887cac0826", "size": "563", ...
import datetime import unittest import sqlite3 as sqlite try: import zlib except ImportError: zlib = None 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 v...
{ "content_hash": "88d140848d1180ac81abc716558920af", "timestamp": "", "source": "github", "line_count": 380, "max_line_length": 134, "avg_line_length": 35.26315789473684, "alnum_prop": 0.5961194029850746, "repo_name": "yousafsyed/casperjs", "id": "a8fdad9ee13e3531809bf891e490b7f2b280cb05", "size": ...
from devp2p.multiplexer import Multiplexer, Packet, Frame, DeserializationError def test_frame(): mux = Multiplexer() p0 = 0 mux.add_protocol(p0) # test normal packet packet0 = Packet(p0, cmd_id=0, payload=b'x' * 100) mux.add_packet(packet0) frames = mux.pop_frames() assert len(frames...
{ "content_hash": "b1de01c783b688cc12182064ecad23e8", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 84, "avg_line_length": 28.51101321585903, "alnum_prop": 0.6287082818294191, "repo_name": "ethereum/pydevp2p", "id": "e9aa4e401c4f24014584b367dd6751b415464820", "size": "64...
import datetime from django.utils import timezone def submittable_timestamp(timestamp): """ Helper function to translate a possibly-timezone-aware datetime into the format used in the go_live_at / expire_at form fields - "YYYY-MM-DD hh:mm", with no timezone indicator. This will be interpreted as bein...
{ "content_hash": "97bb76899e4ccd7fd84ece5287818e46", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 95, "avg_line_length": 36.10526315789474, "alnum_prop": 0.7274052478134111, "repo_name": "nimasmi/wagtail", "id": "472059460f40b06a88f572b3e80e35d743116be8", "size": "686",...
""" Filters that accept a `CommandLineInterface` as argument. """ from __future__ import unicode_literals from .base import Filter __all__ = ( 'HasArg', 'HasCompletions', 'HasFocus', 'HasSearch', 'HasSelection', 'HasValidationError', 'IsAborting', 'IsDone', 'IsMultiline', 'IsRea...
{ "content_hash": "7b1daa210f45f9fc65f70dfd47c0146f", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 78, "avg_line_length": 21.656976744186046, "alnum_prop": 0.599731543624161, "repo_name": "ALSchwalm/python-prompt-toolkit", "id": "cc001fde2e570e6e1cde63ed8ce955d63a485ca7",...
import unittest import threading import imath import IECore import Gaffer import GafferUI import GafferTest import GafferUITest class NestedPlugTestNode( Gaffer.Node ) : def __init__( self ) : Gaffer.Node.__init__( self ) IECore.registerRunTimeTyped( NestedPlugTestNode ) Gaffer.Metadata.registerValue( NestedPl...
{ "content_hash": "de86dc4ceb2ce6630b11d0ed6a39c464", "timestamp": "", "source": "github", "line_count": 1373, "max_line_length": 152, "avg_line_length": 32.50182083029862, "alnum_prop": 0.6496358543417367, "repo_name": "appleseedhq/gaffer", "id": "5446e68d816961e0ab24ebeccfc40a88cbdd79ad", "size": ...
""" fs.expose.sftp ============== Expose an FS object over SFTP (via paramiko). This module provides the necessary interfaces to expose an FS object over SFTP, plugging into the infrastructure provided by the 'paramiko' module. For simple usage, the class 'BaseSFTPServer' provides an all-in-one server class based on...
{ "content_hash": "1ed08b2f48f06e9551a9521e75792993", "timestamp": "", "source": "github", "line_count": 324, "max_line_length": 971, "avg_line_length": 36.888888888888886, "alnum_prop": 0.6769578313253012, "repo_name": "offlinehacker/pyfilesystem", "id": "df4a8066ba191a9a648da26a3eade2cbf629215c", ...
def getVersion(): import random return "3.0.0." + str(random.randint(1, 99)) ######################################################################### def getValue(section, name, filePath = "default"): import os, os.path from ConfigParser import SafeConfigParser if (filePath == "default...
{ "content_hash": "34b99ab9c7f9e6df9be10f4f17e69e55", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 84, "avg_line_length": 24.65909090909091, "alnum_prop": 0.6353302611367128, "repo_name": "chaosking121/mal", "id": "a7ef293610f4d89ad19bc172aa8d0b80a2849118", "size": "325...
""" Django settings for counselling_site project. Generated by 'django-admin startproject' using Django 1.8.2. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # B...
{ "content_hash": "9aa9316d377d8ac294cee98701193e09", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 71, "avg_line_length": 25.763157894736842, "alnum_prop": 0.6877766428328226, "repo_name": "oinopion/cardiff-wellbeeing", "id": "bd7900a39b10e795c6e410534db75387ce70dea3", ...
import pyramid_handlers from blue_yellow_app.controllers.base_controller import BaseController from blue_yellow_app.viewmodels.register_viewmodel import RegisterViewModel from blue_yellow_app.viewmodels.signin_viewmodel import SigninViewModel class AccountController(BaseController): @pyramid_handlers.action(rende...
{ "content_hash": "05f3b6a313b7dbdac58aeb9dc4d57ae8", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 75, "avg_line_length": 33.14545454545455, "alnum_prop": 0.5913329676357653, "repo_name": "mikeckennedy/python-for-entrepreneurs-course-demos", "id": "d6f418daa2cb72c5209b3fa0...
"""Denon HEOS Media Player.""" from functools import reduce, wraps import logging from operator import ior from typing import Sequence from pyheos import HeosError, const as heos_const from homeassistant.components.media_player import MediaPlayerEntity from homeassistant.components.media_player.const import ( ATT...
{ "content_hash": "6aea90e7607b8d33b7c06ea5dd6420a2", "timestamp": "", "source": "github", "line_count": 384, "max_line_length": 88, "avg_line_length": 33.283854166666664, "alnum_prop": 0.6091855097410218, "repo_name": "adrienbrault/home-assistant", "id": "6e271bf60cd995fa3e8b0799f2be11dc22437f3f", ...
import os TRAIN_DIR = 'flickr_logos_27_dataset' IMAGES_DIR = os.path.join(TRAIN_DIR, 'flickr_logos_27_dataset_images') CROPPED_IMAGES_DIR = os.path.join(TRAIN_DIR, 'flickr_logos_27_dataset_images_cropped') ANNOT_FILE = os.path.join(TRAIN_DIR, 'flickr_logos_27_dataset_training_set_annotation.txt') CROPPED_ANNOT_FILE = ...
{ "content_hash": "c77284c444a6be304f5b238df66b4590", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 108, "avg_line_length": 56, "alnum_prop": 0.6964285714285714, "repo_name": "satojkovic/DeepLogo", "id": "49a83e73b5e4c16d77f0f01112806e4ac61c9a69", "size": "896", "binary...
import sys from django.db import models from django.urls import reverse from django.utils.crypto import get_random_string FIELD_PROXIES = { 'bigint': 'BigIntegerField', 'bin': 'BinaryField', 'boolean': 'BooleanField', 'char': 'CharField', 'csv': 'CommaSeparatedIntegerField', 'date': 'DateField...
{ "content_hash": "8f7b56bf9331483c7351e6129a67c58c", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 84, "avg_line_length": 28.34426229508197, "alnum_prop": 0.6443030653556969, "repo_name": "fmarco/django-lite", "id": "3d5c7259d9ec14f7447817979bb6ae71fd142e14", "size": "17...
import logging from .client import Client from .lock import Lock _log = logging.getLogger(__name__) # Prevent "no handler" warnings to stderr in projects that do not configure # logging. try: from logging import NullHandler except ImportError: # Python <2.7, just define it. class NullHandler(logging.Handl...
{ "content_hash": "195a58a8a735e9ef3b88ef492a8e7107", "timestamp": "", "source": "github", "line_count": 300, "max_line_length": 81, "avg_line_length": 24.576666666666668, "alnum_prop": 0.5901261359012614, "repo_name": "kireal/python-etcd", "id": "2032be3a529f5e96c69c3786f4f93dc9322b56c6", "size": "...
import os import pytest from expecter import expect from .conftest import load TESTS = os.path.dirname(__file__) ROOT = os.path.dirname(TESTS) IMAGES = os.path.join(ROOT, 'data', 'images') def describe_get(): def describe_visible(): def with_nominal_text(client): path = os.path.join(IMAGE...
{ "content_hash": "2343d24bac835302a3d67ed50dad22c2", "timestamp": "", "source": "github", "line_count": 216, "max_line_length": 78, "avg_line_length": 35.33796296296296, "alnum_prop": 0.5601991353334207, "repo_name": "DanLindeman/memegen", "id": "083f839b5e6e6ac7fb15b70fa14734281f4fa640", "size": "...
"""Test flash_air_music.configuration functions/classes.""" import pytest from flash_air_music import configuration, exceptions from flash_air_music.__main__ import __doc__ as doc def common_init(monkeypatch, tmpdir, skip_ffmpeg=False): """Perform common test setup. :param monkeypatch: pytest fixture. ...
{ "content_hash": "52f892c719d924c3179b4c929839873b", "timestamp": "", "source": "github", "line_count": 379, "max_line_length": 117, "avg_line_length": 34.047493403693935, "alnum_prop": 0.6308121512709237, "repo_name": "Robpol86/FlashAirMusic", "id": "4e584f49b3d689324310703505f0728f373cdba4", "siz...
__author__ = 'abdul' import mongoctl.repository as repository from mongoctl.mongoctl_logging import * from mongoctl.errors import MongoctlException from mongoctl.utils import document_pretty_string import mongoctl ############################################################################### # status command TODO:...
{ "content_hash": "d437d18b15b7c6a706c6a1f132ae96ca", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 79, "avg_line_length": 33.5, "alnum_prop": 0.564179104477612, "repo_name": "richardxx/mongoctl-service", "id": "594eab762bb42a6e558708abae52a98bc4a78e5d", "size": "1340", ...
from pathlib import Path from aioworkers.core.config import Config from aioworkers.core.context import Context config = Config() config.load(Path(__file__).with_suffix('.yaml')) async def test_autorun(loop): async with Context(config.autorun, loop=loop) as ctx: await ctx.sv._future assert ctx.sv...
{ "content_hash": "f1467a6bf1aa901f598a69a656a5380a", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 61, "avg_line_length": 25.789473684210527, "alnum_prop": 0.6316326530612245, "repo_name": "aamalev/aioworkers", "id": "cb4a8a0c6a9229c75690fb54e8d028a12ba9ad4f", "size": "9...
import datetime import warnings import re from math import ceil from collections import namedtuple from contextlib import contextmanager from distutils.version import LooseVersion import numpy as np from pandas.util.decorators import cache_readonly, deprecate_kwarg from pandas.core.base import PandasObject import pan...
{ "content_hash": "8d2b604b052fbb797e68ee1214272885", "timestamp": "", "source": "github", "line_count": 3903, "max_line_length": 101, "avg_line_length": 33.83064309505509, "alnum_prop": 0.5546004650070812, "repo_name": "sunzhxjs/JobGIS", "id": "50e0ab66a8726a5a3ec80f46db1c7fcd9b90c91e", "size": "13...
import web_idl from . import name_style from . import style_format from .blink_v8_bridge import blink_class_name from .blink_v8_bridge import blink_type_info from .code_node import CodeNode from .code_node import EmptyNode from .code_node import LiteralNode from .code_node import SequenceNode from .code_node import re...
{ "content_hash": "3bdbba975c8a32a4f3b6c48dbbd4a8b4", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 92, "avg_line_length": 37.86764705882353, "alnum_prop": 0.6249838187702266, "repo_name": "nwjs/chromium.src", "id": "0431dc58763d2e2f016c0f7166e2a7152b286c3a", "size": "78...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import sys if sys.version_info[0] >= 3: from io import BytesIO class BytesStrIO(BytesIO): def __init__(self, *args): args_new = [] ...
{ "content_hash": "f7ed086a2135c213d58d7933e4ca2a01", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 60, "avg_line_length": 29.153846153846153, "alnum_prop": 0.5408970976253298, "repo_name": "HankFaan/fbthrift", "id": "e8ba5f100f120cbceb39b1078684a204edca201f", "size": "15...
''' 导入数据集的信息 import_meta()从dataset_list调用信息生成数据集 import_tables()从datacn_tables调用信息生成数据表 ''' import os import pathlib import re import shutil import sys from openpyxl import load_workbook from PIL import Image from torcms.core.tools import get_uu8d from torcms.model.category_model import MCategory from torcms.model...
{ "content_hash": "ac7f2f8562a74763ceb240f3d34ec3f8", "timestamp": "", "source": "github", "line_count": 293, "max_line_length": 102, "avg_line_length": 28.948805460750854, "alnum_prop": 0.5208677198773874, "repo_name": "bukun/TorCMS", "id": "266c135768bbf242bb97caed00e0941925ee2e4b", "size": "8687"...
"""Blink bindings presubmit script See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmit API built into gcl. """ # Make sure binding templates are considered as source files. WHITE_LIST = (r'.+\.tmpl$',) # Changes to v8/ do not change generated code or tests...
{ "content_hash": "9d2d9341f677215454c3d811f0209065", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 142, "avg_line_length": 34.32, "alnum_prop": 0.6853146853146853, "repo_name": "google-ar/WebARonARCore", "id": "e430ded081378f361b0807ad9063db6024aa94ad", "size": "3246", ...
"""Python configuration for MathEquationInput interaction.""" from __future__ import annotations from extensions.interactions import base from typing import List MYPY = False if MYPY: # pragma: no cover from extensions import domain class MathEquationInput(base.BaseInteraction): """Interaction for math e...
{ "content_hash": "f0c040e6f237882410386974088734bc", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 79, "avg_line_length": 31.11111111111111, "alnum_prop": 0.6185714285714285, "repo_name": "oppia/oppia", "id": "9f7cad388f1386545d228e1bc3f2fe6615d7d4d9", "size": "2023", ...
"""This example creates a creative field associated with a given advertiser. To get an advertiser ID, run get_advertisers.py. """ import argparse import sys from apiclient import sample_tools from oauth2client import client # Declare command-line flags. argparser = argparse.ArgumentParser(add_help=False) argparser....
{ "content_hash": "0baf97b412704073c3c8bd91c3ff42f8", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 77, "avg_line_length": 28.90740740740741, "alnum_prop": 0.6822549647661755, "repo_name": "falbassini/googleads-dfa-reporting-samples", "id": "46cebe933a5848e2ab13598b8f31f611...
import sys sys.path.append("../") import bandicoot as bc import glob import multiprocessing as mp import os records_path = 'users_bandicoot/' antenna_file = 'antennas.csv' number_of_processors = 8 def load_and_compute(f): user_id = os.path.basename(f)[:-4] try: B = bc.read_csv(user_id, records_path, ...
{ "content_hash": "5af815acaf4d2fb2f0b0440b073cccf4", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 76, "avg_line_length": 25.666666666666668, "alnum_prop": 0.687012987012987, "repo_name": "yvesalexandre/bandicoot", "id": "e346fb90d713773afea71683779cb93fad170a42", "size"...
from __future__ import absolute_import from rest_framework.response import Response from sentry.api.base import DocSection from sentry.api.bases.project import ProjectEndpoint from sentry.api.paginator import OffsetPaginator from sentry.api.serializers import serialize from sentry.models import EventUser class Proj...
{ "content_hash": "4ca857752cddd6bf2fc965140edb8e20", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 93, "avg_line_length": 35.86274509803921, "alnum_prop": 0.5751776927282668, "repo_name": "zenefits/sentry", "id": "2e699555096d7a1bee622c68722f08ca96805a8c", "size": "1829"...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "ffd6f554a966eeda62db4f42fbec0e11", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 68, "avg_line_length": 25, "alnum_prop": 0.7066666666666667, "repo_name": "lucernae/django-backup", "id": "3c5e30013ae0317b9cc94da429abd388662fa538", "size": "225", "binar...
from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', # Home page url(r'^$', "corpus.views.home", name='home'), url(r'^admin/', include(admin.site.urls)), url(r'^corpus/', include('corpus.urls', namespace='corpus')), )
{ "content_hash": "f294c05244c7b97c8412bd9f3400bb4e", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 65, "avg_line_length": 29.5, "alnum_prop": 0.6610169491525424, "repo_name": "machinalis/iepy", "id": "38f3d3576844493020d8f90b056405257a7a8775", "size": "295", "binary": ...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'certified'} DOCUMENTATION = ''' module: na_ontap_service_processor_network short_description: NetApp ONT...
{ "content_hash": "5310243cf22f11d160c7e80e8c04efca", "timestamp": "", "source": "github", "line_count": 278, "max_line_length": 157, "avg_line_length": 38.78776978417266, "alnum_prop": 0.6017805805434481, "repo_name": "SergeyCherepanov/ansible", "id": "14c974804b0586292fdde91d8eb8cb8e66383522", "si...
#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to us...
{ "content_hash": "e3f7f627428023b9bcacabad38f7ac00", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 106, "avg_line_length": 37.282442748091604, "alnum_prop": 0.5919328419328419, "repo_name": "EmanueleCannizzaro/scons", "id": "d22adfee5ce0a42b1bc8735c8aaf836c48b1a2d8", "s...
''' Version agnostic psutil hack to fully support both old (<2.0) and new (>=2.0) psutil versions. The old <1.0 psutil API is dropped in psutil 3.0 Should be removed once support for psutil <2.0 is dropped. (eg RHEL 6) Built off of http://grodola.blogspot.com/2014/01/psutil-20-porting.html ''' from __future__ impor...
{ "content_hash": "e7de7faa523d19e99bb7bdae854359de", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 77, "avg_line_length": 31.97979797979798, "alnum_prop": 0.5849652558433355, "repo_name": "smallyear/linuxLearn", "id": "bfd407fc1cfa0ebc050b63d29f4905fdc39e0ca6", "size": "...
from __future__ import print_function import unittest import numpy as np import paddle.fluid.core as core from op_test import OpTest def max_pool2D_forward_naive(x, ksize, strides, paddings, global_po...
{ "content_hash": "cf2df7d331aa1fc633d115e9f108336e", "timestamp": "", "source": "github", "line_count": 331, "max_line_length": 79, "avg_line_length": 29.939577039274923, "alnum_prop": 0.5501513622603431, "repo_name": "reyoung/Paddle", "id": "634df65bb5ad5ceab4ef4c019c1f243888351b12", "size": "1052...
from unittest import TestCase from basic_math.accumulate import add from framework.tags import tag class TestUnitA(TestCase): def test_one_param(self): self.assertRaises(TypeError, lambda: add(1)) @tag("Nightly", priority=10) def test_two_params(self): self.assertEquals(3, add(1, 2), "A...
{ "content_hash": "ae1f7c6735f7698dcb0afaa6e34f5d97", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 78, "avg_line_length": 25.42105263157895, "alnum_prop": 0.6666666666666666, "repo_name": "crazeejeeves/trisuite", "id": "96047a0ab7d0ffd05b65393eefe66260ae45b4f0", "size": ...
"""Collection of tests for {{cookiecutter.module_name}}.py""" import click from click.testing import CliRunner from distutils.version import LooseVersion from {{cookiecutter.module_name}} import main, __version__ def test_version(): """Ensure that --version shows a version number that matches the __version__ ...
{ "content_hash": "31d7706c7d1d0eb01b015a30fef97d8d", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 76, "avg_line_length": 36.76923076923077, "alnum_prop": 0.6841004184100419, "repo_name": "goerz/cookiecutter-pyscript", "id": "535e55bf51d4af1f108edd5aaa5f49b8af11aa6e", "s...
from django.core.management.base import BaseCommand, CommandError from django_deploy.system import setup_geodjango from django_deploy.utils import fab_task class Command(BaseCommand): @fab_task def handle(self, *args, **kwargs): setup_geodjango()
{ "content_hash": "9c7344f83b6e08be8fa9a11accd3c61d", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 65, "avg_line_length": 29.88888888888889, "alnum_prop": 0.7434944237918215, "repo_name": "typeish/django-deploy", "id": "e51889cf8d73daac4adc7d2a4430c1145dbb4aec", "size": "...
from __future__ import absolute_import from __future__ import print_function import theano.tensor as T from ..layers.core import Layer, Merge from ..utils.theano_utils import ndim_tensor from six.moves import range class Sequential(Layer): ''' Simple linear stack of layers. inherited from Layer:...
{ "content_hash": "38c5f7b938d62539f76b448595ce8a7a", "timestamp": "", "source": "github", "line_count": 268, "max_line_length": 107, "avg_line_length": 35.52985074626866, "alnum_prop": 0.5393824826717076, "repo_name": "xiaoda99/keras", "id": "8c4ea8604c355dce97fa9bb1e5808b416e0dade9", "size": "9546...
import bpy import bmesh import struct import json from . import materials, entities, meshes, spot_lights, directional_lights def write(report, dir, filepath, scene): objects = scene.objects blender_objects = [o for o in objects if not o.parent and o.type in entities.type_map.keys()] ...
{ "content_hash": "1a0f42c15ebc7c26b20f0ec1f525fbbf", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 82, "avg_line_length": 31.32, "alnum_prop": 0.6641123882503193, "repo_name": "morganbengtsson/io_mos", "id": "428ba3cf518087419bd707c19031c8af58bccc23", "size": "783", "b...
from typing import Any from iopath.common.file_io import PathHandler, TabularIO class TabularUriParser: def parse_uri(self, uri: str) -> None: pass class TabularPathHandler(PathHandler): def _opent( self, path: str, mode: str = "r", buffering: int = 32, **kwargs: Any ) -> TabularIO: ...
{ "content_hash": "87d5040f26747e7a5b1847403affd626", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 86, "avg_line_length": 26.9375, "alnum_prop": 0.6473317865429234, "repo_name": "facebookresearch/iopath", "id": "73921ea160a5e22732034c62dda86585cc52e7fb", "size": "504", ...
from __future__ import print_function import six import array, struct try: from urllib.parse import unquote except ImportError: from urllib import unquote from .protocol import * import beng_proxy.translation.uri def _parse_port(address): if address[0] == '[': i = address.find(']', 1) if ...
{ "content_hash": "96f5be50917d4f2cd1cad96975aa9b63", "timestamp": "", "source": "github", "line_count": 230, "max_line_length": 81, "avg_line_length": 41.18695652173913, "alnum_prop": 0.5893592315000528, "repo_name": "CM4all/beng-proxy", "id": "35405a313d56ed4c875ad36ddc014513a729afc8", "size": "95...
"""This module contains the Apache Livy sensor.""" from typing import Any, Dict, Optional, Union from airflow.providers.apache.livy.hooks.livy import LivyHook from airflow.sensors.base import BaseSensorOperator from airflow.utils.decorators import apply_defaults class LivySensor(BaseSensorOperator): """ Moni...
{ "content_hash": "d0ce81ca670d14842b9c60ebad1da5a3", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 93, "avg_line_length": 31.6, "alnum_prop": 0.6357243319268636, "repo_name": "DinoCow/airflow", "id": "ae470c909a631f6f516e6113f8bbb0bb2d490fda", "size": "2208", "binary":...
def cos_sphere_dist(sintheta,costheta, sinphi,cosphi, sintheta_o,costheta_o, sinphi_o,cosphi_o): """ NAME: cos_sphere_dist PURPOSE: computes the cosine of the spherical distance between two points on the sphere INPUT: ...
{ "content_hash": "05b70438b4bccbff59dda2e83fc80e22", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 64, "avg_line_length": 29.625, "alnum_prop": 0.5414908579465542, "repo_name": "jobovy/mwdust", "id": "3accadf78ff1f96cca13a8c65979c2dd937f5671", "size": "919", "binary": ...
import csv import time import rospy import mavros from mavros.srv import ParamPull, ParamPush, ParamGet, ParamSet class Parameter(object): """Class representing one parameter""" def __init__(self, param_id, param_value=0): self.param_id = param_id self.param_value = param_value def __rep...
{ "content_hash": "ce104c9e3711344dd18c33546119f17d", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 104, "avg_line_length": 28.97222222222222, "alnum_prop": 0.5835091083413231, "repo_name": "Shedino/SherpaHighLevel", "id": "33b3e51b45207d3c30e39b4974b90941ebfe6142", "siz...
"""Unit tests for the pipeline options module.""" import logging import unittest import hamcrest as hc from apache_beam.transforms.display import DisplayData from apache_beam.transforms.display_test import DisplayDataItemMatcher from apache_beam.options.pipeline_options import PipelineOptions from apache_beam.options...
{ "content_hash": "bfc0a7dc834f70cd1544c81d8870ef00", "timestamp": "", "source": "github", "line_count": 223, "max_line_length": 82, "avg_line_length": 39.964125560538115, "alnum_prop": 0.6164721723518851, "repo_name": "manuzhang/incubator-beam", "id": "1a644b449e423d48d123cc1e263e3086c9908e8f", "si...
import Gaffer import GafferDispatch def __isPreTasksPlug( plug ) : return plug.getName() == "preTasks" and isinstance( plug.parent(), GafferDispatch.TaskNode ) def __preTasksPlugGetItemWrapper( originalGetItem ) : def getItem( self, key ) : if isinstance( key, str ) and __isPreTasksPlug( self ) : if key not...
{ "content_hash": "e0aa0fd055bf8d5192bee344bf04ae06", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 101, "avg_line_length": 31.923076923076923, "alnum_prop": 0.7397590361445783, "repo_name": "appleseedhq/gaffer", "id": "7a367dd587419d2dca6825ee453761adfc4cdaf1", "size": "...
from django.conf import settings from PIL import Image from appconf import AppConf class AvatarConf(AppConf): DEFAULT_SIZE = 80 RESIZE_METHOD = Image.ANTIALIAS STORAGE_DIR = 'avatars' GRAVATAR_BASE_URL = 'http://www.gravatar.com/avatar/' GRAVATAR_BACKUP = True GRAVATAR_DEFAULT = None DEFA...
{ "content_hash": "bd67cba40e28b73c5bc754641dad7443", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 71, "avg_line_length": 29.966666666666665, "alnum_prop": 0.660734149054505, "repo_name": "Brendtron5000/django-avatar", "id": "78b56f251bfdaa806de8653a5d7674b04eb0ab8e", "s...
"""Launch a beam pipeline that trains all models.""" import ast import re import time from absl import app from absl import flags from absl import logging import apache_beam as beam from neural_structural_optimization import models from neural_structural_optimization import pipeline_utils from neural_structural_optim...
{ "content_hash": "af10440ae8cbe28e5e17d3a89ff5ed09", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 79, "avg_line_length": 29.055118110236222, "alnum_prop": 0.675609756097561, "repo_name": "google-research/neural-structural-optimization", "id": "b4bceafa46bd2ba3ee1829c7a40...