text stringlengths 4 1.02M | meta dict |
|---|---|
"""Print the list of available maps according to the game."""
from absl import app
from pysc2 import run_configs
def main(unused_argv):
with run_configs.get().start(want_rgb=False) as controller:
available_maps = controller.available_maps()
print("\n")
print("Local map paths:")
for m in sorted(available... | {
"content_hash": "85af6757eac6e08caece3e8f58b1ffb2",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 61,
"avg_line_length": 23.545454545454547,
"alnum_prop": 0.666023166023166,
"repo_name": "deepmind/pysc2",
"id": "babfaed0341ca400fa180385ac89c6ffc7851683",
"size": "1133",... |
"""File system custom event formatter helpers."""
from plaso.formatters import interface
from plaso.formatters import manager
class NTFSFileReferenceFormatterHelper(interface.CustomEventFormatterHelper):
"""NTFS file reference formatter helper."""
IDENTIFIER = 'ntfs_file_reference'
def FormatEventValues(self... | {
"content_hash": "a01841279cb6e41f7060832eda78643c",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 78,
"avg_line_length": 31.55,
"alnum_prop": 0.716851558372953,
"repo_name": "kiddinn/plaso",
"id": "427e90126548dc1e5e83a79ee5ef51d4fd93dc59",
"size": "1917",
"binary": f... |
import argparse
import curses
import os
import re
import sys
import time
from operator import sub
_SRC_PATH = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', '..'))
sys.path.append(os.path.join(_SRC_PATH, 'third_party', 'catapult', 'devil'))
from devil.android import device_errors
from devil.andro... | {
"content_hash": "0e4a719a99f71ebb56278d2b984d32cc",
"timestamp": "",
"source": "github",
"line_count": 1005,
"max_line_length": 80,
"avg_line_length": 36.67860696517413,
"alnum_prop": 0.6070750366230807,
"repo_name": "Samsung/ChromiumGStreamerBackend",
"id": "032e847303504674763be890e1955c764b2772e9... |
import unittest
from quickbooks.objects.item import Item
class ItemTests(unittest.TestCase):
def test_unicode(self):
item = Item()
item.Name = "test"
self.assertEquals(unicode(item), "test")
| {
"content_hash": "2d5b9c64df23f503fa013b80d61a7540",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 48,
"avg_line_length": 20.272727272727273,
"alnum_prop": 0.6636771300448431,
"repo_name": "ferdiaz/python-quickbooks",
"id": "841aa189e3c0c0f09e9a3e461f47d7faa00ef85c",
"si... |
"""Base class to make optimizers weight decay ready."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import ops
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import resource_variable_ops
fro... | {
"content_hash": "cbd75c599e864105b87d3c0b643be469",
"timestamp": "",
"source": "github",
"line_count": 347,
"max_line_length": 79,
"avg_line_length": 45.98847262247838,
"alnum_prop": 0.7224589547562351,
"repo_name": "ZhangXinNan/tensorflow",
"id": "b9cf40eb7b2d11c98b93c51213145ca4e2670318",
"size"... |
"""
WSGI config for source project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTI... | {
"content_hash": "0a48d0aa3ca264fb9eaf12fd8a049566",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 24.375,
"alnum_prop": 0.7692307692307693,
"repo_name": "toladata/TolaProfile",
"id": "a64d3153fbbf2f492cf038814ad2a7ea5c9c3f10",
"size": "390",
"bi... |
import re
import markdown
from typing import Any, Dict, List, Optional
from typing.re import Match
from markdown.preprocessors import Preprocessor
# There is a lot of duplicated code between this file and
# help_settings_links.py. So if you're making a change here consider making
# it there as well.
REGEXP = re.compi... | {
"content_hash": "c94f93880aab00739b10ee3f6a3b78fd",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 94,
"avg_line_length": 35.925925925925924,
"alnum_prop": 0.6054123711340206,
"repo_name": "tommyip/zulip",
"id": "f13e411c1c81a07f1510158968a8ca35a500b423",
"size": "3880"... |
"""
yaspin.api
~~~~~~~~~~
This module implements the Yaspin API.
"""
import signal
from .core import Yaspin
from .signal_handlers import default_handler
def yaspin(*args, **kwargs):
"""Display spinner in stdout.
Can be used as a context manager or as a function decorator.
Arguments:
spinner (... | {
"content_hash": "325ab8135d39f3a7490aa1b62f55b7fb",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 72,
"avg_line_length": 28.423529411764704,
"alnum_prop": 0.6216887417218543,
"repo_name": "kennethreitz/pipenv",
"id": "3e0c22ef91694068a0f5a91cc529360692ce1468",
"size": "... |
import lib.clusters as clusters
import sys
argvs = sys.argv
argc = len(argvs)
# 引数がなければ使い方を表示してプログラムを終了する。
if (argc < 2):
print 'Usage: # python %s path_to_blogdata.txt' % argvs[0]
quit()
input_file_path = argvs[1]
output_file_path = 'draw2d.result.jpg'
# こっからメイン
blognames,words,data = clusters.read_file(input... | {
"content_hash": "3f093d9687f7443ba69062e19de515e0",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 60,
"avg_line_length": 21.3,
"alnum_prop": 0.7323943661971831,
"repo_name": "saxsir/hhlab2013s-js-a",
"id": "336c2e144b0d6907570221a4bb6597f41bf2bf21",
"size": "507",
"bi... |
"""Common classes and methods for managing long running jobs."""
__author__ = 'Sean Lip'
import ast
import copy
import datetime
import logging
import traceback
import utils
from core.platform import models
(base_models, job_models,) = models.Registry.import_models([
models.NAMES.base_model, models.NAMES.job])
ta... | {
"content_hash": "4a669e77d4f37b1e699265f988817a26",
"timestamp": "",
"source": "github",
"line_count": 1188,
"max_line_length": 81,
"avg_line_length": 40.19191919191919,
"alnum_prop": 0.6383932311300997,
"repo_name": "wangsai/oppia",
"id": "0b48a1be644d5cc27e7da4b9ad90c50d4a7f39c5",
"size": "48371... |
from ant.core import log
# USB1 ANT stick interface. Running `dmesg | tail -n 25` after plugging the
# stick on a USB port should tell you the exact interface.
SERIAL = '/dev/ttyUSB0'
# If set to True, the stick's driver will dump everything it reads/writes
# from/to the stick.
DEBUG = False
# Set to None to disable... | {
"content_hash": "a6a65c3700a7bd2ce598aa80e4d8ae37",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 75,
"avg_line_length": 27.555555555555557,
"alnum_prop": 0.6935483870967742,
"repo_name": "nputikhin/simple-ant-hrm",
"id": "a17868cfc96d691fea21d2fc6d5c72a45d73e5bf",
"siz... |
import sys
from pyArango.connection import *
from pyArango.graph import *
from pyArango.collection import *
class Social(object):
class male(Collection):
_fields = {
"name" : Field()
}
class female(Collection):
_fields = {
... | {
"content_hash": "65b8686e93555343a727bb111887ece3",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 95,
"avg_line_length": 36.583333333333336,
"alnum_prop": 0.45011389521640094,
"repo_name": "tariqdaouda/pyArango",
"id": "739a863a14040ce4875bcc7b395ed323b1e14af7",
"size":... |
import logging
import pyauto_functional # must come before pyauto.
import policy_base
import pyauto
from policy_test_cases import PolicyPrefsTestCases
class PolicyPrefsUITest(policy_base.PolicyTestBase):
"""Tests user policies and their impact on the prefs UI."""
settings_pages = [
'chrome://settings-fr... | {
"content_hash": "5985a27d69ae7c94e65d5e9c19a9a9a6",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 80,
"avg_line_length": 37.525,
"alnum_prop": 0.6655562958027982,
"repo_name": "keishi/chromium",
"id": "12c126a076edf257c74c33edfc2385ca7e909c79",
"size": "6807",
"binar... |
from __future__ import annotations
import logging
from doc2dash.parsers.types import Parser
from .docsets import DocSet
from .parsers.patcher import patch_anchors
log = logging.getLogger(__name__)
def convert_docs(
*,
parser: Parser,
docset: DocSet,
quiet: bool,
) -> None:
"""
User *parse... | {
"content_hash": "04319342e78adf84f859686741746de8",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 76,
"avg_line_length": 23.53488372093023,
"alnum_prop": 0.5849802371541502,
"repo_name": "hynek/doc2dash",
"id": "cd577231141afa1308f224c66d7180efaf7df7ef",
"size": "1012",... |
import os
import multiprocessing
import shutil
# Provide access to the helper scripts
def modify_path():
scripts_dir = os.path.dirname(__file__)
while not 'Scripts' in os.listdir(scripts_dir):
scripts_dir = os.path.abspath(os.path.join(scripts_dir, '..'))
scripts_dir = os.path.join(scripts_dir, 'S... | {
"content_hash": "e0d7622c23613d714b5fd41b5f7c8880",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 70,
"avg_line_length": 29.595744680851062,
"alnum_prop": 0.6024442846872753,
"repo_name": "mkraska/CalculiX-Examples",
"id": "ce6ca7e981fc7381479b54bd9a719a1c9aed2b67",
"si... |
import requests
from allauth.socialaccount.providers.oauth2.views import (
OAuth2Adapter,
OAuth2CallbackView,
OAuth2LoginView,
)
from .provider import SpotifyOAuth2Provider
class SpotifyOAuth2Adapter(OAuth2Adapter):
provider_id = SpotifyOAuth2Provider.id
access_token_url = "https://accounts.spot... | {
"content_hash": "442bab42eebcaac1d034a7e7f1207169",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 88,
"avg_line_length": 31.555555555555557,
"alnum_prop": 0.7335680751173709,
"repo_name": "rsalmaso/django-allauth",
"id": "83fe5a1b96d72d94927e762b178cdb10f87d74b2",
"size... |
import ipdb
import sys
sys.path.append('./..')
import mtSet.pycore.modules.splitter as SPLIT
import mtSet.pycore.modules.multiTraitSetTest as MTST
import mtSet.pycore.modules.chi2mixture as C2M
from mtSet.pycore.utils.utils import smartAppend
from mtSet.pycore.utils.utils import smartDumpDictHdf5
import scipy as SP
i... | {
"content_hash": "59125a7628105c63dac56d3c5f5615bb",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 125,
"avg_line_length": 37.946107784431135,
"alnum_prop": 0.6585134921887328,
"repo_name": "PMBio/mtSet",
"id": "bf2f5676a83935ece03dc60fc22e7426ef14c3a4",
"size": "6963",... |
from leancloud import Object
from leancloud import Query
from leancloud import LeanCloudError
from flask import Blueprint
from flask import request
from flask import redirect
from flask import url_for
from flask import render_template
class Todo(Object):
pass
todos_view = Blueprint('todos', __name__)
@todos_vi... | {
"content_hash": "e233fad3221a26c3034a4834b12be1fb",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 64,
"avg_line_length": 23.7027027027027,
"alnum_prop": 0.6590649942987458,
"repo_name": "leancloud/python-getting-started",
"id": "d68cce2149be2990137144462757b902374ce9fb",
... |
from openstack import resource
from openstack import utils
class Router(resource.Resource, resource.TagMixin):
resource_key = 'router'
resources_key = 'routers'
base_path = '/routers'
# capabilities
allow_create = True
allow_fetch = True
allow_commit = True
allow_delete = True
all... | {
"content_hash": "559e4c88eac312f8293e9ba8f1ce104b",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 79,
"avg_line_length": 37.932330827067666,
"alnum_prop": 0.6402378592666006,
"repo_name": "dtroyer/python-openstacksdk",
"id": "afe0f104b8c7e2f6cd54fcc4bdb78c3a6d4bdf80",
... |
from paste.script import templates
class OortAppTemplate(templates.Template):
summary = "A clean Oort web app package"
_template_dir = 'paste_templates/oort_app'
required_templates = ['basic_package']
use_cheetah = False
| {
"content_hash": "225048b4b6b8185b7d271d1801cf4360",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 46,
"avg_line_length": 29.875,
"alnum_prop": 0.7238493723849372,
"repo_name": "tectronics/oort.python-oortpub",
"id": "4f9775f2989525d83fc59babb2678200fe5a70ba",
"size": "23... |
"""Tests for the Withings component."""
import datetime
import re
from typing import Any
from unittest.mock import MagicMock
from urllib.parse import urlparse
from aiohttp.test_utils import TestClient
import pytest
import requests_mock
from withings_api.common import NotifyAppli, NotifyListProfile, NotifyListResponse
... | {
"content_hash": "70fc5f32d8839a57671164679a65b828",
"timestamp": "",
"source": "github",
"line_count": 242,
"max_line_length": 88,
"avg_line_length": 31.376033057851238,
"alnum_prop": 0.6520479388910839,
"repo_name": "partofthething/home-assistant",
"id": "a5946ff0533ce3ecf54d99bb00608cff42919ef3",
... |
import random
import unittest
import sys
sys.path.append('..')
from common.document import Document
from common.model import Model
from common.vocabulary import Vocabulary
from model_evaluator import ModelEvaluator
class ModelEvaluatorTest(unittest.TestCase):
def setUp(self):
self.model = Model(20)
... | {
"content_hash": "fecece4a0954a2c9a5e60804a618918e",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 74,
"avg_line_length": 32.69444444444444,
"alnum_prop": 0.6508071367884452,
"repo_name": "ankazhao/python-sparselda",
"id": "7b918d30a159745232dca7fd07254914d4e5ef99",
"siz... |
import logging
from gi.repository import Gst
from lib.config import Config
from lib.clock import Clock
from lib.args import Args
class Blinder(object):
# create logging interface
log = logging.getLogger('Blinder')
def __init__(self):
# remember some things
self.acaps = Config.getAudioC... | {
"content_hash": "c6007d2959642b8dcbb8cf3a22fd94bd",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 96,
"avg_line_length": 33.50349650349651,
"alnum_prop": 0.5312043414735963,
"repo_name": "voc/voctomix",
"id": "5c60e6da230569124a3f273401e6e1cfb8154f8e",
"size": "4814",
... |
from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine.resources.openstack.neutron import neutron
from heat.engine import support
from heat.engine import translation
class Net(neutron.NeutronResource):
"""A resource... | {
"content_hash": "7751c675171b64f8638d4e8ec83a6c5c",
"timestamp": "",
"source": "github",
"line_count": 283,
"max_line_length": 79,
"avg_line_length": 38.93992932862191,
"alnum_prop": 0.5774954627949184,
"repo_name": "noironetworks/heat",
"id": "62a19e1ff75d18c7cd6bf5f2b8625f23281e257b",
"size": "1... |
import logging
import itertools
import os
import sqlite3
import exifread
from photodedup.fileindex import FileIndex
logger = logging.getLogger()
class PhotoDedup():
"""
Photodedup deduplicates all image files stored within a directory. It uses sqlite to store exif info for images,
and uses a built-in f... | {
"content_hash": "7676a3f22fbbb9d7cc323ae177ae82ba",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 116,
"avg_line_length": 30.82962962962963,
"alnum_prop": 0.5478135511773186,
"repo_name": "puyuan/photodedup",
"id": "3402a57386545b1ae0f68046546768ae7c7320af",
"size": "4... |
from mic import msger
from mic.utils import runner
def exec_cmd(cmd_and_args, as_shell = False, catch = 3):
"""
Execute command, catching stderr, stdout
Need to execute as_shell if the command uses wildcards
"""
msger.debug("exec_cmd: %s" % cmd_and_args)
args = cmd_and_args.split()
msger.d... | {
"content_hash": "b75b3bb1cb2b4dd543227ddef5d14eb1",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 84,
"avg_line_length": 28.572649572649574,
"alnum_prop": 0.6317678731678134,
"repo_name": "marcosbontempo/inatelos",
"id": "7ad3aa968502520e8c0d65b137e1258e07968652",
"siz... |
"""This module contains Databricks operators."""
import time
from typing import Any, Dict, List, Optional, Union
from airflow.exceptions import AirflowException
from airflow.models import BaseOperator
from airflow.providers.databricks.hooks.databricks import DatabricksHook
XCOM_RUN_ID_KEY = 'run_id'
XCOM_RUN_PAGE_UR... | {
"content_hash": "020673fb3dcdfe4849641c33c2584d64",
"timestamp": "",
"source": "github",
"line_count": 493,
"max_line_length": 107,
"avg_line_length": 43.36511156186612,
"alnum_prop": 0.6406286542869171,
"repo_name": "dhuang/incubator-airflow",
"id": "8956b43be1de76859fb3176980427221e7319d3c",
"si... |
'''
Implements the targetcli root UI.
This file is part of targetcli.
Copyright (c) 2011-2013 by Datera, Inc
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/LICE... | {
"content_hash": "1db0797f4b30ed24cf7737293062a899",
"timestamp": "",
"source": "github",
"line_count": 345,
"max_line_length": 121,
"avg_line_length": 35.118840579710145,
"alnum_prop": 0.5332618025751072,
"repo_name": "agrover/targetcli-fb",
"id": "39e5ee99c342724df236646cfb42d7043c0008ae",
"size"... |
"""Unit tests for hash command."""
import os
from gslib.exception import CommandException
import gslib.tests.testcase as testcase
from gslib.tests.testcase.integration_testcase import SkipForS3
from gslib.tests.util import ObjectToURI as suri
_TEST_FILE_CONTENTS = '123456\n'
_TEST_FILE_B64_CRC = 'nYmSiA=='
_TEST_FIL... | {
"content_hash": "c5b5ded1c52d55e06b62c001a700c28d",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 79,
"avg_line_length": 43.38053097345133,
"alnum_prop": 0.653406772745818,
"repo_name": "fishjord/gsutil",
"id": "c166c34eec4190c70316fd7f89e22facb2b77c8b",
"size": "5522"... |
class Formatter:
def __init__(self, key_points,fmt):
if not hasattr(self, fmt):
raise ValueError("invalid option: use 'md', 'json' or 'html'")
self._fmt = fmt
self._kp = key_points
self._options = {
'default': self.default,
... | {
"content_hash": "7215b596b1fc88509e05bf5bfd1aaded",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 74,
"avg_line_length": 25.151515151515152,
"alnum_prop": 0.4566265060240964,
"repo_name": "lekhakpadmanabh/Summarizer",
"id": "f99e8e272561f5eb8f7a8e52004be11e985193fe",
"s... |
import math
import time
from AnyQt.QtGui import QColor
from AnyQt.QtCore import Qt, QRectF, QLineF
from ..annotationitem import TextAnnotation, ArrowAnnotation, ArrowItem
from . import TestItems
class TestAnnotationItem(TestItems):
def test_textannotation(self):
text = "Annotation"
annot = Text... | {
"content_hash": "df9e7893e62008817be8fda704882868",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 77,
"avg_line_length": 28.388059701492537,
"alnum_prop": 0.6272344900105152,
"repo_name": "cheral/orange3",
"id": "ec77bef642ed216f41ce5881a2ee31e495c2e83b",
"size": "1902"... |
import unittest
import ray
import ray.rllib.agents.impala as impala
from ray.rllib.utils.framework import try_import_tf
from ray.rllib.utils.test_utils import check_compute_single_action, \
framework_iterator
tf1, tf, tfv = try_import_tf()
class TestIMPALA(unittest.TestCase):
@classmethod
def setUpClass... | {
"content_hash": "1c3792eafa8dcfbe0c738791b665c4ab",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 78,
"avg_line_length": 33.166666666666664,
"alnum_prop": 0.534209509083881,
"repo_name": "richardliaw/ray",
"id": "a9697c50bb096e564d85c7e2e97b4930bf8da6f5",
"size": "2587"... |
from django.contrib import admin
from .models import SocialAccount, SocialToken
class SocialAccountAdmin(admin.ModelAdmin):
search_fields = ('user__username', )
raw_id_fields = ('user',)
list_display = ('user', 'uid', 'provider')
list_filter = ('provider',)
class SocialTokenAdmin(admin.ModelAdmin):
... | {
"content_hash": "580b2168cecf732635c0855c0508c59b",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 80,
"avg_line_length": 31.46153846153846,
"alnum_prop": 0.6589242053789731,
"repo_name": "houssemFat/bloodOn",
"id": "ffcf0eaffba3f63d1714bb1b22de55fcfa793ed0",
"size": "81... |
"""
====================================
Linear algebra (:mod:`scipy.linalg`)
====================================
.. currentmodule:: scipy.linalg
Linear algebra functions.
.. seealso::
`numpy.linalg` for more linear algebra functions. Note that
although `scipy.linalg` imports most of them, identically named... | {
"content_hash": "8c3fce868892fdc2c39afb92ee85dc3a",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 78,
"avg_line_length": 30.393364928909953,
"alnum_prop": 0.7140184001247466,
"repo_name": "befelix/scipy",
"id": "35d2505d0c46c7cd6e260c106b62c8cde860e03c",
"size": "6413"... |
"""Tests for gzip compressed stream file."""
# Note: do not rename file to gzip.py this can cause the exception:
# AttributeError: 'module' object has no attribute 'GzipFile'
# when using pip.
import os
import unittest
from dfvfs.lib import definitions
from dfvfs.lib import gzipfile
from dfvfs.path import factory as... | {
"content_hash": "e7131c8157c0fbda94bfbaf7b4dea529",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 75,
"avg_line_length": 29.635359116022098,
"alnum_prop": 0.6793437733035048,
"repo_name": "joachimmetz/dfvfs",
"id": "d3649f5019a65ae81fec7855e341a3e8640abf07",
"size": "5... |
from __future__ import with_statement
from __future__ import unicode_literals
import os
import random
import string
import codecs
from six import StringIO, BytesIO
import logging
import socket
from pytds.tds_types import TimeType, DateTime2Type, DateType, DateTimeOffsetType, BitType, TinyIntType, SmallIntType, \
I... | {
"content_hash": "037ecca350cc6aeae046a7144df95cbe",
"timestamp": "",
"source": "github",
"line_count": 1085,
"max_line_length": 155,
"avg_line_length": 37.13732718894009,
"alnum_prop": 0.5886732516007346,
"repo_name": "tpow/pytds",
"id": "876e6c0ec6b63031a42e1001a56a1d551c54daf1",
"size": "40325",... |
"""
Watchman command line tool
"""
import click
from watchman import Watchman
# Disable the warning that Click displays (as of Click version 5.0) when users
# use unicode_literals in Python 2.
# See http://click.pocoo.org/dev/python3/#unicode-literals for more details.
click.disable_unicode_literals_warning = True
... | {
"content_hash": "f2fbe2788985298ddabe21d6298f033b",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 78,
"avg_line_length": 20.3125,
"alnum_prop": 0.6876923076923077,
"repo_name": "skcript/watchman",
"id": "46af5c4fd66a10c5a4b49fbcf514a32deca56f07",
"size": "676",
"binar... |
from six.moves import urllib
from six.moves.urllib.error import URLError, HTTPError
import json, re, base64
import contextlib
from ..errors.exceptionfactory import ExceptionFactory
class Client(object):
def __init__(self, token, secret):
self.config = {
'api_root': 'https://secure.sakura.a... | {
"content_hash": "c24920f414a40c2ee7199c0563b7605d",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 99,
"avg_line_length": 37.630434782608695,
"alnum_prop": 0.5427498555748123,
"repo_name": "sakura-internet/saklient.python",
"id": "1ed1e2a8030383fc71fbb96674ffbfb427076983",... |
from proteus import *
from proteus.default_p import *
from marin import *
from proteus.mprans import MCorr
LevelModelType = MCorr.LevelModel
coefficients = MCorr.Coefficients(LSModel_index=2,V_model=0,me_model=4,VOFModel_index=1,
applyCorrection=applyCorrection,nd=nd,checkMass=False,... | {
"content_hash": "6ef09a1aaa786707635a6d7df2ab85aa",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 110,
"avg_line_length": 28.692307692307693,
"alnum_prop": 0.6072386058981233,
"repo_name": "erdc-cm/air-water-vv",
"id": "42a7ee5945e575f7e59d3588a50b3e6bdc36a0e8",
"size":... |
from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar, Union, cast
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 im... | {
"content_hash": "d02a162098329796829b34f29ca5e8a9",
"timestamp": "",
"source": "github",
"line_count": 5108,
"max_line_length": 272,
"avg_line_length": 42.743931088488644,
"alnum_prop": 0.6155558405393522,
"repo_name": "Azure/azure-sdk-for-python",
"id": "09fd2862d36580800acb46403729037ad4ba2c78",
... |
import numpy as np
from search.kws import KWS
from ip import doc_processor
from search import plot_accuracy
# Process the images and generate a feature map
doc_processor.main()
# process the logs, do some plots and stdout
plot_accuracy.main()
# Load training and validation data
kws = KWS()
kws.load_train_and_valid... | {
"content_hash": "18ba152b51b07fa96e486577215208b7",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 85,
"avg_line_length": 22.64,
"alnum_prop": 0.7438162544169611,
"repo_name": "dwettstein/pattern-recognition-2016",
"id": "b1d986433fafacc67d2388aa31216cf9ec09b16f",
"size"... |
import argparse
import kaurna
class CLIDispatcher:
operation_info={
'create_kaurna_key':{
'help':'Create the kaurna KMS key and key alias. This must be called before kaurna can be used. Because creating KMS keys is a non-reversible operation, this must be done manually.',
'initia... | {
"content_hash": "24ebb40bbd1580dc4f9365d18020778f",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 309,
"avg_line_length": 52.574585635359114,
"alnum_prop": 0.5916351408154686,
"repo_name": "edofleini/kaurna",
"id": "7b287be3ba8387f60fb73a502a5a69fcb0ef730f",
"size": "9... |
"""Support for Minut Point sensors."""
import logging
from homeassistant.components.sensor import DOMAIN
from homeassistant.const import (
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_PRESSURE,
DEVICE_CLASS_TEMPERATURE,
TEMP_CELSIUS,
UNIT_PERCENTAGE,
)
from homeassistant.helpers.dispatcher import async_disp... | {
"content_hash": "005fd9133b51be4d3ac79e17334de291",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 85,
"avg_line_length": 31.463414634146343,
"alnum_prop": 0.6406976744186047,
"repo_name": "pschmitt/home-assistant",
"id": "70fe1ef0b6dc27d781641ed20b26df30efb94711",
"size... |
import os
import sys
import traceback
from _pydev_bundle import pydev_log
from _pydevd_bundle import pydevd_traceproperty, pydevd_dont_trace, pydevd_utils
import pydevd_tracing
import pydevd_file_utils
from _pydevd_bundle.pydevd_breakpoints import LineBreakpoint, get_exception_class
from _pydevd_bundle.pydevd_comm imp... | {
"content_hash": "e61e4e6e4cf22ac33be6d1035081afb0",
"timestamp": "",
"source": "github",
"line_count": 929,
"max_line_length": 190,
"avg_line_length": 50.70398277717976,
"alnum_prop": 0.5211234714673914,
"repo_name": "JetBrains/intellij-community",
"id": "9fbdedaee9ec005135d1b1687fa5c53d4d65518d",
... |
import binascii
import socket
import struct
import argparse
import sys
import logging
import os
import traceback
import socket
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import Ether, IP, IPv6, TCP, sendp, conf, sniff
from random import randint
from capability import *
from colorama impo... | {
"content_hash": "47e812b17bd0e958f44b217a9e8078c7",
"timestamp": "",
"source": "github",
"line_count": 250,
"max_line_length": 233,
"avg_line_length": 47.556,
"alnum_prop": 0.5780132895954243,
"repo_name": "ecthros/pina-colada",
"id": "cbfce865d3f99f1b065aa4eb683b098ca596af9f",
"size": "11912",
... |
from django.conf.urls import url
from django.conf import settings
from django.views.generic import TemplateView
import os
from django.views.static import serve
import zerver.views.registration
import zerver.views.auth
import zerver.views.email_log
# These URLs are available only in the development environment
use_pro... | {
"content_hash": "fa2ea69339d370091f18963d68a1b359",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 102,
"avg_line_length": 40.888888888888886,
"alnum_prop": 0.65527950310559,
"repo_name": "jackrzhang/zulip",
"id": "341bf81b9d90c86d7e94f7baa515d861f1a46111",
"size": "2576... |
import os
import pytest
from selenium.webdriver import FirefoxProfile
from selenium.webdriver.firefox.options import Options
@pytest.fixture(params=['capabilities', 'firefox_profile', 'firefox_options'])
def driver_kwargs(request, driver_kwargs, profile):
if request.param == 'capabilities':
options = {'... | {
"content_hash": "e8bf60412b70c9284ebff2a18ae326c4",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 78,
"avg_line_length": 30.6,
"alnum_prop": 0.7099673202614379,
"repo_name": "DrMarcII/selenium",
"id": "7166ee7dcaacd68c68f471c0474e26cebed21492",
"size": "2012",
"binary... |
from datetime import datetime
from enum import Enum
from math import inf
from typing import Union
class Mode(Enum):
TRAINING = 0
INFER_TRAIN = 1
INFER_VAL = 2
class Tracker:
epoch: int
n_epochs: Union[int, float]
batch: int
n_batches: int
global_batch: int
mode: Mode
start_ti... | {
"content_hash": "8488ffb45bbe4262759a54ea84cb8f15",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 85,
"avg_line_length": 28.88679245283019,
"alnum_prop": 0.5930764206401045,
"repo_name": "googleinterns/out-of-distribution",
"id": "80c7237481e0e51f78fb0342697b66f56ea30193"... |
"""
module documentation
"""
def more(text, numlines = 15):
lines = text.splitlines()
while lines:
chunk = lines[:numlines]
lines = lines[numlines:]
for line in chunk:
print(line)
if line and input('More?') not in ['y', 'Y']:
break
if __name__ == '__ma... | {
"content_hash": "ffaf5c8948d3e7f14c9add7a0ae1ad3c",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 53,
"avg_line_length": 20.05263157894737,
"alnum_prop": 0.5223097112860893,
"repo_name": "ordinary-developer/lin_education",
"id": "283ca79bf859bd4e3ca7b3c2d5d565aba51ae846",... |
"""
certs.py
~~~~~~~~
This module returns the preferred default CA certificate bundle.
If you are packaging Requests, e.g., for a Linux distribution or a managed
environment, you can change the definition of where() to return a separately
packaged CA bundle.
"""
import os.path
certifi = None
try:
import certifi... | {
"content_hash": "e065ce162933743dc3072c498fdaa426",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 76,
"avg_line_length": 20.535714285714285,
"alnum_prop": 0.6782608695652174,
"repo_name": "mozilla/firefox-flicks",
"id": "81482767b3681dee10ec6ac45229c5c6ad722857",
"size"... |
import time
class Chrono:
"""
A utility class to compute elapsed time.
Typical usage:
c = Chrono().on()
...
print "elapsed time: %.1fs" % c.off()
"""
def __init__(self, nbDigit=1):
self.t0 = None
self.nbDigit = nbDigit
def on(self):
self.t0 = time.time()
return self
def get(self):
t = time.time(... | {
"content_hash": "b159786964c4071f014fd7d78dbd2c41",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 71,
"avg_line_length": 22.80952380952381,
"alnum_prop": 0.581419624217119,
"repo_name": "Transkribus/TranskribusDU",
"id": "5113b4cb1b79723b6f7c93d4774f37a68f6fd2ad",
"size... |
"""Test misc module."""
import os
import shutil
from unittest import mock
import pytest
from ..misc import pass_dummy_scans, check_valid_fs_license
@pytest.mark.parametrize(
"algo_dummy_scans,dummy_scans,expected_out", [(2, 1, 1), (2, None, 2), (2, 0, 0)]
)
def test_pass_dummy_scans(algo_dummy_scans, dummy_scans... | {
"content_hash": "189509050dfd9f22118d9a987658ddef",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 91,
"avg_line_length": 32.916666666666664,
"alnum_prop": 0.670253164556962,
"repo_name": "oesteban/niworkflows",
"id": "dc7d781744e60c507922c9d5a65e2e587e7d4f89",
"size": "... |
from datetime import datetime
from pandas.compat import range, lrange
import os
import operator
import nose
import numpy as np
from pandas import Series, DataFrame, Index, isnull, notnull, pivot, MultiIndex
from pandas.core.datetools import bday
from pandas.core.panel import Panel
from pandas.core.panel4d import Pane... | {
"content_hash": "ba1a386a95be471943e4f07a534df68f",
"timestamp": "",
"source": "github",
"line_count": 1103,
"max_line_length": 120,
"avg_line_length": 35.034451495920216,
"alnum_prop": 0.5613177030768832,
"repo_name": "stevenzhang18/Indeed-Flask",
"id": "3772d4b9c272bebaf7593a7b0503624d407e60bf",
... |
import oembed
import simplejson
from oembed.exceptions import AlreadyRegistered, NotRegistered, OEmbedMissingEndpoint
from oembed.models import StoredProvider, StoredOEmbed
from oembed.resources import OEmbedResource
from oembed.tests.oembed_providers import BlogProvider
from oembed.tests.tests.base import BaseOEmbedT... | {
"content_hash": "b5ddcc37677e627f460c7fcce4975ff2",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 100,
"avg_line_length": 45.31506849315068,
"alnum_prop": 0.6774486094316807,
"repo_name": "ericholscher/djangoembed",
"id": "8529acb2c91852ba5c83e70d769929db6b22d039",
"siz... |
import csv
import itertools
import operator
import numpy as np
import nltk
import sys
import os
import time
from datetime import datetime
from utils import *
from rnn import RNNTheano
_VOCABULARY_SIZE = int(os.environ.get('VOCABULARY_SIZE', '8000'))
_HIDDEN_DIM = int(os.environ.get('HIDDEN_DIM', '80'))
_LEARNING_RATE ... | {
"content_hash": "d99110386d9b3d56360932b3e489c492",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 124,
"avg_line_length": 42.043010752688176,
"alnum_prop": 0.6741687979539642,
"repo_name": "khuongnn/NERRNN",
"id": "9f794a922debe9b908caf8b95ad06e26678b82a5",
"size": "393... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
import os
import signal
import time
import traceback
from contextlib import contextmanager
import psutil
from pants.base.build_environment import get_... | {
"content_hash": "dc6893952228cb854c2797a40975ed72",
"timestamp": "",
"source": "github",
"line_count": 487,
"max_line_length": 100,
"avg_line_length": 40.652977412731005,
"alnum_prop": 0.6749671684008486,
"repo_name": "15Dkatz/pants",
"id": "a545691b75635957d96e810b72ffb9ed91224155",
"size": "1994... |
from thumbor.filters import BaseFilter, filter_method
from thumbor.ext.filters import _round_corner
class Filter(BaseFilter):
@filter_method(r'[\d]+(?:\|[\d]+)?', BaseFilter.PositiveNumber, BaseFilter.PositiveNumber, BaseFilter.PositiveNumber, BaseFilter.Boolean)
def round_corner(self, radius, r, g, b, trans... | {
"content_hash": "2f4e347e7c900f3ddcc5e526498977ff",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 141,
"avg_line_length": 38.27272727272727,
"alnum_prop": 0.6377672209026128,
"repo_name": "voxmedia/thumbor",
"id": "3c5c4335d060f962205445efca9b3425ff653156",
"size": "109... |
import sys
import argparse
import funannotate.library as lib
def main(args):
# setup menu with argparse
class MyFormatter(argparse.ArgumentDefaultsHelpFormatter):
def __init__(self, prog):
super(MyFormatter, self).__init__(prog, max_help_position=48)
parser = argparse.ArgumentParser(pr... | {
"content_hash": "bf2798db2ee842236a8cbc184eef98ec",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 105,
"avg_line_length": 47.08695652173913,
"alnum_prop": 0.58264081255771,
"repo_name": "nextgenusfs/funannotate",
"id": "a38d7fd12e86ffcaec57ceef1c2970632b91947f",
"size":... |
import masterPlugin
import os
import libHercmIO
## load command plugin
#
# Based on arguments, loads a matrix from a file into WORKINGMATRIX, then
# then returns it as a libHercMatrix.hercMatrix instance
class loader(masterPlugin.masterPlugin):
def __init__(this):
super().__init__()
this.command... | {
"content_hash": "1ab979dd43e845ffff90f3abd16af835",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 80,
"avg_line_length": 32.90909090909091,
"alnum_prop": 0.5828729281767956,
"repo_name": "charlesdaniels/hercm",
"id": "137b423cdbfd17bb0fb58a91151197555cdb2343",
"size": "... |
"""Starter script for all nova services.
This script attempts to start all the nova services in one process. Each
service is started in its own greenthread. Please note that exceptions and
sys.exit() on the starting of a service are logged and the script will
continue attempting to launch the rest of the services.
... | {
"content_hash": "c290a1fbad18f44e0f9bcd9cd5b5e3f3",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 79,
"avg_line_length": 35.4054054054054,
"alnum_prop": 0.6301526717557252,
"repo_name": "luogangyi/bcec-nova",
"id": "0c44de6e21bd5a087fed459c7d62dcd1d0a485ac",
"size": "33... |
'''
Created on Mar 2, 2013
@author: nino
'''
class PermissionDeniedError(Exception):
pass
class User(object):
def __init__(self, name):
self.name = name
def is_authorized(self, action): return True
def can_throw(self): return False
def increment(self, stat, count=1): pass
| {
"content_hash": "be8ee1e1785749cd7e76ec9b11c9a462",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 48,
"avg_line_length": 15.45,
"alnum_prop": 0.6440129449838188,
"repo_name": "escherba/marx",
"id": "3462aff42af4c4e77cb6b41054808d3e0b153191",
"size": "309",
"binary": f... |
"""Error codes for PostgresSQL
This module contains symbolic names for all PostgreSQL error codes.
"""
# psycopg2/errorcodes.py - PostgreSQL error codes
#
# Copyright (C) 2006-2010 Johan Dahlin <[email protected]>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU ... | {
"content_hash": "b02660e27367b347586dc48a210a32ad",
"timestamp": "",
"source": "github",
"line_count": 428,
"max_line_length": 73,
"avg_line_length": 31.507009345794394,
"alnum_prop": 0.7517241379310344,
"repo_name": "bcarroll/authmgr",
"id": "b8742f52a2f74fb0581f7d2906c8dc0832f6cefd",
"size": "13... |
"""Extracts the unwind tables in from breakpad symbol files
Runs dump_syms on the given binary file and extracts the CFI data into the
given output file.
The output file is a binary file containing CFI rows ordered based on function
address. The output file only contains rows that match the most popular rule
type in C... | {
"content_hash": "171ce2c200e928fdaa88a7fcb3fa7a9c",
"timestamp": "",
"source": "github",
"line_count": 280,
"max_line_length": 80,
"avg_line_length": 36.375,
"alnum_prop": 0.6745213549337261,
"repo_name": "youtube/cobalt_sandbox",
"id": "25c3130e635385d9dd527ed9276d9f0f4f458204",
"size": "10371",
... |
"""
Presubmit for Chromium HTML/CSS/JS resources. See chrome/browser/PRESUBMIT.py.
"""
from . import regex_check
class ResourceChecker(object):
def __init__(self, input_api, output_api, file_filter=None):
self.input_api = input_api
self.output_api = output_api
self.file_filter = file_filter
def Depr... | {
"content_hash": "5a0baeabb5e1ad019999e32b62958317",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 82,
"avg_line_length": 40.77142857142857,
"alnum_prop": 0.6527680448493343,
"repo_name": "chromium/chromium",
"id": "8365d9bbc87b7942d0a5c0fe474322b5b1d0df12",
"size": "299... |
import uuid
from oslo_config import cfg
from oslo_serialization import jsonutils
import webob
from cinder.api import extensions
from cinder.api.v2 import snapshot_metadata
from cinder.api.v2 import snapshots
import cinder.db
from cinder import exception
from cinder import test
from cinder.tests.api import fakes
CON... | {
"content_hash": "ddeb418d997c543d038dff4d7f47bda7",
"timestamp": "",
"source": "github",
"line_count": 538,
"max_line_length": 78,
"avg_line_length": 38.11524163568773,
"alnum_prop": 0.567833804740076,
"repo_name": "blueboxgroup/cinder",
"id": "2fd62ca3707762107cab57ec913bd9bef01fb01f",
"size": "2... |
import getopt
import imp
import os
import os.path
import sys
import tempfile
import time
import zipfile
try:
# try Python 3.x style
from urllib.request import urlretrieve
except ImportError:
# nope, must be 2.x; this hack is equivalent
import imp
# protect import from fixer
urlretrieve = imp.lo... | {
"content_hash": "fa385c9cf58789c65b250c6962b04888",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 130,
"avg_line_length": 28.52340425531915,
"alnum_prop": 0.551544084738177,
"repo_name": "azatoth/scons",
"id": "2191532c7f6a2c1b62a371bcb87b8d9ddcd41a49",
"size": "7415",... |
"""
Django settings for gettingstarted project, on Heroku. Fore more info, see:
https://github.com/heroku/heroku-django-template
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/s... | {
"content_hash": "c1bf9bfcb441f5be7b61c5b50d55c99a",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 75,
"avg_line_length": 27.647540983606557,
"alnum_prop": 0.7032315446190335,
"repo_name": "toroio-alex/heroku-python",
"id": "24b9558ecbd00a0927139c6fb1b2df4d106791fd",
"s... |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import http.client
import urllib.parse
class HTTPBasicsTest (BitcoinTestFramework):
def setup_nodes(self):
return start_nodes(4, self.options.tmpdir)
def setup_chain(self):
print("Initializing tes... | {
"content_hash": "450eaca745cbeaf45ab1d4c550810d94",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 129,
"avg_line_length": 40.25714285714286,
"alnum_prop": 0.6323633782824698,
"repo_name": "BTCfork/hardfork_prototype_1_mvf-bu",
"id": "133d89ad6dfaa5941005a808be73512f68340... |
import os
import platform
def provide_system_boot_type():
if platform.system() == 'Linux':
# See also:
# http://askubuntu.com/a/162896
if os.path.exists('/sys/firmware/efi'):
return { 'system_boot_type': 'UEFI' }
else:
return { 'system_boot_type': 'BIOS' }
... | {
"content_hash": "2cccf7dfb9a31988d0a58ba0c72fd79b",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 49,
"avg_line_length": 25.133333333333333,
"alnum_prop": 0.5464190981432361,
"repo_name": "uvsmtid/common-salt-states",
"id": "a11d82234b9c526266e33b03debc20d1eacb0712",
"s... |
from swgpy.object import *
def create(kernel):
result = Ship()
result.template = "object/ship/shared_blacksun_heavy_s03.iff"
result.attribute_template_id = -1
result.stfName("","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "ed6ef71c96a7e91ae9ecf253f2ccaa10",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 62,
"avg_line_length": 20.76923076923077,
"alnum_prop": 0.6666666666666666,
"repo_name": "obi-two/Rebelion",
"id": "cdafa95485f24e5e8be00d19ae90a91525a59b87",
"size": "415"... |
"""
RenderPipeline
Copyright (c) 2014-2016 tobspr <[email protected]>
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 right... | {
"content_hash": "cbda035d5167bff119eb795c6e1356fc",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 98,
"avg_line_length": 40.6375,
"alnum_prop": 0.6607197785296832,
"repo_name": "croxis/SpaceDrive",
"id": "7bed13ab75f3530e9b7c8e9fafe0ceda9f63e840",
"size": "3251",
"bin... |
#
"""Instance Messenger base classes for protocol support.
You will find these useful if you're adding a new protocol to IM.
"""
# Abstract representation of chat "model" classes
from twisted.words.im.locals import ONLINE, OFFLINE, OfflineError
from twisted.words.im import interfaces
from twisted.int... | {
"content_hash": "e652cacb3980530523e373e9ff037666",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 80,
"avg_line_length": 30.171641791044777,
"alnum_prop": 0.5750680187979224,
"repo_name": "hlzz/dotfiles",
"id": "be1368e22948783e5e555a86287a63dfb408480a",
"size": "8160"... |
from pythonds.trees.binaryTree import BinaryTree
import operator
x = BinaryTree('*')
x.insertLeft('+')
l = x.getLeftChild()
l.insertLeft(4)
l.insertRight(5)
x.insertRight(7)
def printexp(tree):
sVal = ""
if tree:
sVal = '(' + printexp(tree.getLeftChild())
sVal = sVal + str(tree.getRootVal())
sV... | {
"content_hash": "6a8a5798de5aef0860f29179b9b0ce3e",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 86,
"avg_line_length": 23.5,
"alnum_prop": 0.6470588235294118,
"repo_name": "robin1885/algorithms-exercises-using-python",
"id": "ea41d9356024cdc7ce381cfcf4197fa438aaafc1",
... |
"""Test Hierarchical Deterministic wallet function."""
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
class WalletHDTest(BitcoinTestFramework):
def setup_chain(self):
print("Initializing test directory "+self.options.tmpdir)
initialize_chain_clean... | {
"content_hash": "c581f6a7c221e0017b9bd2973a162a0d",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 108,
"avg_line_length": 44.08411214953271,
"alnum_prop": 0.6109815560737757,
"repo_name": "YxomNPO/YxomCoin",
"id": "d7f6553cd9918b1b9bbdfa2d199470e2fcf3121c",
"size": "49... |
"""Tests for filesystem elements, including Foxhound and related objects.
"""
import datreant as dtr
import pytest
import os
import py.path
class TestFoxhound:
"""Test Foxhound functionality"""
@pytest.fixture
def treant(self, tmpdir):
with tmpdir.as_cwd():
t = dtr.treants.Container... | {
"content_hash": "64da50b8fb9c0344b68dde236949ae7a",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 73,
"avg_line_length": 20.333333333333332,
"alnum_prop": 0.6311475409836066,
"repo_name": "andreabedini/datreant",
"id": "6b83810385f03b91e02dbc0bf058b677bd89132a",
"size":... |
from shapely.geometry import Point
from geopandas import read_file, datasets, GeoSeries
# Derive list of valid query predicates based on underlying index backend;
# we have to create a non-empty instance of the index to get these
index = GeoSeries([Point(0, 0)]).sindex
predicates = sorted(p for p in index.valid_quer... | {
"content_hash": "2b5d87d0c6fd9a13369f980185e71fd1",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 77,
"avg_line_length": 32.88461538461539,
"alnum_prop": 0.6429824561403509,
"repo_name": "geopandas/geopandas",
"id": "24fac10e6883271ff9f83b45e77fe10c79e788d4",
"size": "... |
def main():
pass
if __name__ == '__main__':
main()
import os
import math
import ChronoEngine_python_core as chrono
import ChronoEngine_python_postprocess as postprocess
# ---------------------------------------------------------------------
#
# Create the simulation system.
# (Do not create parts and con... | {
"content_hash": "d089c693a4a8c07fb3c20e8033a34c0f",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 92,
"avg_line_length": 30.73643410852713,
"alnum_prop": 0.6610340479192938,
"repo_name": "tjolsen/chrono",
"id": "8b455de89219650b451cd77e9ddf5a407bf68e48",
"size": "4297"... |
from oslo_serialization import jsonutils
from neutron.openstack.common import log
from neutron.plugins.vmware.api_client import exception as api_exc
from neutron.plugins.vmware.common import exceptions as nsx_exc
from neutron.plugins.vmware.common import utils
from neutron.plugins.vmware import nsxlib
from neutron.plu... | {
"content_hash": "4d547997d8252fde14351c546b803d25",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 77,
"avg_line_length": 40.88265306122449,
"alnum_prop": 0.5897915886684139,
"repo_name": "cloudbase/neutron-virtualbox",
"id": "5e20d2d51c3ce9623319377b9160e278b3face3c",
... |
from mezzanine.utils.email import send_mail_template
from mezzanine.conf import settings
def send_invite_code_mail(code, site_url, login_url):
context = {
'code': code,
'site_name': settings.SITE_TITLE,
'site_url': site_url,
'login_url': login_url,
}
send_mail_template(
... | {
"content_hash": "389c4a353195096aaa26f5a4e7054132",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 54,
"avg_line_length": 26.75,
"alnum_prop": 0.6149532710280374,
"repo_name": "averagehuman/mezzanine-invites",
"id": "22664820988d9cb053d139af0d215c3db5e28a4f",
"size": "53... |
import requests
class Parla(object):
r = requests
api_key = None
version = 3
base_url = 'http://demo.ckan.org/api/{version}/action/'
resp = None # response from server
resp_status = None # shortcut to response.status_code
resp_headers = None # shortcut to response.status_code
resp_j... | {
"content_hash": "d9241b17e9707d9ac152655c47cde38d",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 99,
"avg_line_length": 29.24390243902439,
"alnum_prop": 0.5963302752293578,
"repo_name": "rosscdh/ckan-parliament-uk",
"id": "9a0538b29178636a56663a36edabbaf11d909df1",
"si... |
from urllib.parse import quote
import pytest
from tests.functional import get_logger
from tests.functional.services.api.conftest import USER_API_CONFS
from tests.functional.services.api.registries import get_registry_info
from tests.functional.services.utils.http_utils import (
RequestFailedError,
http_del,
... | {
"content_hash": "f29b3485e313928a0fe08620c0227468",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 88,
"avg_line_length": 35.670731707317074,
"alnum_prop": 0.6564102564102564,
"repo_name": "anchore/anchore-engine",
"id": "96e9b7ca5a5e0e79b6e47a5a0fa7dd348df8f562",
"size"... |
'''
Scriot that gets
# Uptime when running config last changed
ccmHistoryRunningLastChanged = '1.3.6.1.4.1.9.9.43.1.1.1.0'
and
# Uptime when startup config last saved
ccmHistoryStartupLastChanged = '1.3.6.1.4.1.9.9.43.1.1.3.0'
compare them and decided whether or not latest changes in running-config are saved in... | {
"content_hash": "3bec1725bb7e37c4e6e6605f403cffa7",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 100,
"avg_line_length": 33.816326530612244,
"alnum_prop": 0.7054918527459264,
"repo_name": "laetrid/learning",
"id": "32ef61edf06763f7141919e6308f628ea3892a84",
"size": "16... |
"""
Created on Jun 19, 2012
@author: Bilel Msekni
@contact: [email protected]
@author: Houssem Medhioub
@contact: [email protected]
@organization: Institut Mines-Telecom - Telecom SudParis
@license: Apache License, Version 2.0
"""
import pyocni.TDD.fake_Data.categories as f_categories
imp... | {
"content_hash": "f30d8fe1d2a99ea46baf5c2414e041bd",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 100,
"avg_line_length": 29.52542372881356,
"alnum_prop": 0.6733639494833524,
"repo_name": "MarouenMechtri/CNG-Manager",
"id": "7b6ab341659cfc691ad7582a0a55bc40af770b3e",
"s... |
"""
Generates increasingly bigger/more Service Chain requirements for a
network topology, reports how well the algorithm performed.
"""
import getopt
import logging
import math
import random
import sys
import traceback
import CarrierTopoBuilder
import MappingAlgorithms
import UnifyExceptionTypes as uet
from collect... | {
"content_hash": "cd8cf872695fe0a9690e2de5f6477f36",
"timestamp": "",
"source": "github",
"line_count": 486,
"max_line_length": 87,
"avg_line_length": 42.74485596707819,
"alnum_prop": 0.583902955617599,
"repo_name": "hsnlab/mapping",
"id": "209f766bd9e7184296b487183ba5265a4acd37f1",
"size": "21349"... |
from nmrpystar import starast
from nmrpystar.unparse.maybeerror import MaybeError
class Loop(starast.StarBase):
def __init__(self, keys, rows):
if not isinstance(keys, list):
raise TypeError('Loop needs list of keys')
if len(keys) != len(set(keys)):
raise ValueError('Loop ... | {
"content_hash": "a45892b7ff6714f4576f49ed4b254840",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 92,
"avg_line_length": 28.685567010309278,
"alnum_prop": 0.568733153638814,
"repo_name": "mattfenwick/NMRPyStar",
"id": "1933bcfef402bb8b4afa50d80e5253717392b2d3",
"size":... |
import pytest
from api.base.settings.defaults import API_BASE
from osf.models import MetaSchema
from osf_tests.factories import (
ProjectFactory,
RegistrationFactory,
AuthUserFactory,
CollectionFactory,
DraftRegistrationFactory,
)
from website.project.metadata.schemas import LATEST_SCHEMA_VERSION
f... | {
"content_hash": "593a2f2132768e81ea02ce80efafca5d",
"timestamp": "",
"source": "github",
"line_count": 379,
"max_line_length": 183,
"avg_line_length": 46.6490765171504,
"alnum_prop": 0.6463800904977376,
"repo_name": "chrisseto/osf.io",
"id": "e7a02770d512911796f9a237195cf4b58f2e98da",
"size": "176... |
"""Handles ConsoleProxy API requests."""
from oslo.config import cfg
from nova.compute import rpcapi as compute_rpcapi
from nova.console import rpcapi as console_rpcapi
from nova.db import base
from nova.openstack.common import rpc
from nova.openstack.common import uuidutils
CONF = cfg.CONF
CONF.import_opt('console_... | {
"content_hash": "b3fd7f2ba001ee15c4d60d4be56d5840",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 75,
"avg_line_length": 40.983050847457626,
"alnum_prop": 0.6559139784946236,
"repo_name": "zestrada/nova-cs498cc",
"id": "91966a7ff7dd9efe77fe5fcaf50739781308afbe",
"size":... |
from __future__ import division, print_function, absolute_import
docdict = {}
def get(name):
return docdict.get(name)
def add_newdoc(place, name, doc):
docdict['.'.join((place, name))] = doc
add_newdoc("scipy.special", "_lambertw",
"""
Internal function, use `lambertw` instead.
""")
add_newd... | {
"content_hash": "a6f4e6d0bdf80dcbfd0b528988f9d801",
"timestamp": "",
"source": "github",
"line_count": 2732,
"max_line_length": 84,
"avg_line_length": 20.612005856515374,
"alnum_prop": 0.5819896292086945,
"repo_name": "RobertABT/heightmap",
"id": "a1027263104d6c57e5606133be607c210db75d31",
"size":... |
# -*- coding: utf-8 -*-
import base64
import json
import os
import os.path
import shutil
import tempfile
import pytest
import six
from docker.client import Client
from docker.constants import DEFAULT_DOCKER_API_VERSION
from docker.errors import DockerException
from docker.utils import (
parse_repository_tag, par... | {
"content_hash": "600332e6927ea7e23b95db806a2545b4",
"timestamp": "",
"source": "github",
"line_count": 792,
"max_line_length": 79,
"avg_line_length": 35.96590909090909,
"alnum_prop": 0.5615938213094611,
"repo_name": "shakamunyi/docker-py",
"id": "04183f9f8718b95283807f72d9429d8b9de9d6d5",
"size": ... |
import webob
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.api.openstack import xmlutil
from nova import db
from nova import exception
from nova.openstack.common.db import exception as db_exc
from nova.openstack.common.gettextutils import _
class ExtraSpecsTemplate(xmlutil.T... | {
"content_hash": "0438665eefabd6f8171e27df9749dfcd",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 79,
"avg_line_length": 39.20634920634921,
"alnum_prop": 0.6246963562753036,
"repo_name": "imsplitbit/nova",
"id": "39deab8024431f45367015041ce070bd731e2c2f",
"size": "5621... |
"""
I contain ResourceUnpickler, which will unpickle any python object
named with the file extension .trp.
"""
import warnings
from pickle import Unpickler
_msg = ("is deprecated as of Twisted 9.0. Resource persistence "
"is beyond the scope of Twisted Web.")
warnings.warn("twisted.web.trp " + _msg , Deprec... | {
"content_hash": "8514fb999f8a417b399ddf89f71ee88a",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 75,
"avg_line_length": 29.1,
"alnum_prop": 0.7027491408934707,
"repo_name": "movmov/cc",
"id": "e9cfcd3fd5cec904587be59dfa5096071d99d377",
"size": "665",
"binary": false,... |
"""Config flow for OpenWeatherMap."""
from __future__ import annotations
from pyowm import OWM
from pyowm.commons.exceptions import APIRequestError, UnauthorizedError
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import (
CONF_API_KEY,
CONF_LATITUDE,
CONF_LONGI... | {
"content_hash": "9e8bb6532f951cd388f45a85cf9d9f69",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 86,
"avg_line_length": 32.18796992481203,
"alnum_prop": 0.5631861714552675,
"repo_name": "nkgilley/home-assistant",
"id": "c418231946f41848e1b313124b578950d1fbe95f",
"size... |
from __future__ import unicode_literals
from django.db import models, migrations
import form.models
class Migration(migrations.Migration):
dependencies = [
('form', '0016_auto_20160620_0006'),
]
operations = [
migrations.RemoveField(
model_name='packagecomparison',
... | {
"content_hash": "f770f18e79b0aff7f287b0efe82cb74a",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 377,
"avg_line_length": 43.93617021276596,
"alnum_prop": 0.6024213075060533,
"repo_name": "andrewhead/Search-Task-Logger",
"id": "ae1f815fc9bdb2d1e7f4ac1e95a30bb0b6fc090c",
... |
"""
Django settings for arguman 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_DIR, ...)
im... | {
"content_hash": "56e1e51d77e0fb2a1cc44f071782ed12",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 71,
"avg_line_length": 25.63736263736264,
"alnum_prop": 0.7023146163737677,
"repo_name": "omeripek/arguman.org",
"id": "4178be4138f48728a4a4e7a656b242ef2715fc90",
"size": ... |
__all__ = ["models", "views", "helpers"] | {
"content_hash": "db0b2cf1a1dc850641bc4b0a3d7fbccc",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 40,
"avg_line_length": 40,
"alnum_prop": 0.525,
"repo_name": "jackjennings/RoboToDo",
"id": "a4b005de89f5b0c14e9c6f6cbaf9d5db8f563a03",
"size": "40",
"binary": false,
"c... |
"""
The main component of OpenFlow controller.
- Handle connections from switches
- Generate and route events to appropriate entities like Ryu applications
"""
import contextlib
import logging
import random
from socket import IPPROTO_TCP
from socket import TCP_NODELAY
from socket import SHUT_WR
from socket import ti... | {
"content_hash": "1dc608793c39be5ab30cb0d8d9420303",
"timestamp": "",
"source": "github",
"line_count": 557,
"max_line_length": 98,
"avg_line_length": 39.876122082585276,
"alnum_prop": 0.5354103822430327,
"repo_name": "osrg/ryu",
"id": "d79f290add05406f8f12aed94a9766b7afe756f7",
"size": "22900",
... |
"""
WSGI config for m_explorer project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SE... | {
"content_hash": "0a06a333e0d7b3517ed7e70d0dcad89c",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 24.8125,
"alnum_prop": 0.7682619647355163,
"repo_name": "marvel-explorer/marvel-explorer",
"id": "ecf89f030fca363d7cde5cc0826332f14aa2a61c",
"size": ... |
import os
import sys
from manager import CrawlGraphManager
from data import GRAPHS
SCRIPT_FOLDER = os.path.abspath(os.path.split(sys.argv[0])[0])
CHARTS_FOLDER = os.path.join(SCRIPT_FOLDER, 'diagrams')
def generate_filename(graph_name):
name = graph_name
name = name.replace(' ', '_')
name = name.lower()... | {
"content_hash": "d1947773ffd5948376e1df20e05559a0",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 99,
"avg_line_length": 19.638297872340427,
"alnum_prop": 0.6338028169014085,
"repo_name": "RajatGoyal/frontera",
"id": "17a64fb9b773f40db17a62bf44dd16cbce7e0c5e",
"size": "... |
import logging
LOGGER = logging.getLogger("metric")
| {
"content_hash": "3e0d1942b9c618a80d7df41f89d313a8",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 36,
"avg_line_length": 17.666666666666668,
"alnum_prop": 0.7735849056603774,
"repo_name": "sloe/metric",
"id": "6fbe632d01ccdf82804f287ba30afab4d58562b0",
"size": "54",
"b... |
from __future__ import division
import warnings
import numpy as np
import scipy.sparse as sp
from .base import BaseEstimator, ClassifierMixin, RegressorMixin
from .utils import check_random_state
from .utils.validation import check_array
from .utils.validation import check_consistent_length
from .utils.random import ... | {
"content_hash": "6c0f90f4aa6bc5f9f3f4e2a6b3c76899",
"timestamp": "",
"source": "github",
"line_count": 464,
"max_line_length": 79,
"avg_line_length": 36.185344827586206,
"alnum_prop": 0.549434187016081,
"repo_name": "icdishb/scikit-learn",
"id": "196aefb45b0b71f06004ce198b5d47f203f8644f",
"size": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.