text stringlengths 4 1.02M | meta dict |
|---|---|
import unittest
from logica import historico
from logica import usuario
from logica import filme
class TestHistorico(unittest.TestCase):
def setUp(self):
historico.remover_todos_historicos()
usuario.remover_todos_usuarios()
filme.remover_todos_filmes()
usuario.inicia... | {
"content_hash": "0af0d7945bfe8cc42a921fd0d1987535",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 70,
"avg_line_length": 33.47142857142857,
"alnum_prop": 0.6551429790866411,
"repo_name": "jpsoousa/Projeto_APD",
"id": "71aa1f2365a5e7ffba7836d542ddfda7aba67d83",
"size": "... |
import numpy as np
from scipy import stats
import pandas as pd
import seaborn as sns
from pydataset import data
import matplotlib.pyplot as plt
import matplotlib.cm as cm
sns.set_palette("deep", desat=.6)
sns.set_context(rc={"figure.figsize": (8, 4)})
faithful = data('faithful')
faithful.head(272) #number of lines of ... | {
"content_hash": "c324234200021bb069ad405017f99474",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 54,
"avg_line_length": 25.88235294117647,
"alnum_prop": 0.7568181818181818,
"repo_name": "lastralab/Statistics",
"id": "2a917a6a788d42d420e49fa6bcb97019155ba954",
"size": "... |
import sys
from time import perf_counter
import pygame
import random
from SystemPanic.Core import config
from SystemPanic.Core.game_state import new_game_state, advance, GAME_MODES
from SystemPanic.Core.paks import new_paks, load_all_paks
from SystemPanic.Core.draw_util import init_font, draw_text, font
from SystemPa... | {
"content_hash": "368209ad31a883fb2751e14d665b632f",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 116,
"avg_line_length": 34.333333333333336,
"alnum_prop": 0.5688437775816416,
"repo_name": "xaroth8088/SystemPanic",
"id": "318353bc0b3704d46b8acb61d277ab745eaf0489",
"siz... |
from setuptools import setup, find_packages
import sys
import os
import platform
sys.path.insert(0, '.')
from ln import __version__
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
install_requires = ['flask', 'requests', 'sqlalchemy', 'python-dateutil']
# Trick lifted from tox... | {
"content_hash": "1836cd88035555bdba39a0ff15e96619",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 77,
"avg_line_length": 29.482758620689655,
"alnum_prop": 0.6666666666666666,
"repo_name": "seibert/ln",
"id": "657982a00ca35d1dddc7b8e41ced800db43c8606",
"size": "855",
"... |
"""Main Functions
Python just takes your code and starts doing what
it says, from top to bottom. When you run the code
in the window here, Python just reads it top to
bottom and executes it. When it encounters things
like |def|, it knows to save them for later so you
can call them. But if it encounters code that it
ca... | {
"content_hash": "0f06e04b9b51b0085108fc32b7e5338d",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 52,
"avg_line_length": 29.689655172413794,
"alnum_prop": 0.7299651567944251,
"repo_name": "shiblon/pytour",
"id": "f502bfe79db0da213e0bcd928d60b3d3c8f03558",
"size": "1735"... |
"""Module file."""
import tensorflow as tf
import tensorflow_ranking as tfr
import tensorflow_transform as tft
from tfx.examples.ranking import features
from tfx.examples.ranking import struct2tensor_parsing_utils
from tfx_bsl.public import tfxio
def make_decoder():
"""Creates a data decoder that that decodes ELWC... | {
"content_hash": "ac79627c796235b0a427a78dc6e014a3",
"timestamp": "",
"source": "github",
"line_count": 244,
"max_line_length": 93,
"avg_line_length": 38.92213114754098,
"alnum_prop": 0.6914815204801517,
"repo_name": "tensorflow/tfx",
"id": "655dd0b388131d96af2b41ffd754a8854b19bbcb",
"size": "10093... |
"""Tests for Incremental PCA."""
import numpy as np
import pytest
from dask import array as da
from sklearn import datasets, decomposition as sd
from sklearn.decomposition import PCA
from dask_ml.decomposition import IncrementalPCA
from dask_ml.utils import flip_vector_signs
try:
from sklearn.utils._testing impor... | {
"content_hash": "2daa746766dba0b60884b3c227f75993",
"timestamp": "",
"source": "github",
"line_count": 481,
"max_line_length": 88,
"avg_line_length": 37.21829521829522,
"alnum_prop": 0.655122332700257,
"repo_name": "dask/dask-ml",
"id": "ce8fbc876e014520858a7cd6743d156321711220",
"size": "17902",
... |
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListType
from pyangbind.lib.ya... | {
"content_hash": "a82fde14ec12b3b0a70f15f42d534fb5",
"timestamp": "",
"source": "github",
"line_count": 382,
"max_line_length": 563,
"avg_line_length": 39.35602094240838,
"alnum_prop": 0.5564719968072369,
"repo_name": "napalm-automation/napalm-yang",
"id": "d4d9f3deeca0508a38958052aa97250875e57a14",
... |
"""Pipe support code for Squires.
This module contains code for building and handling of
pipes, ie 'command | modifier'.
"""
#TODO(bbuxton): Support chaining pipes.
__author__ = 'bbuxton@google.com (Ben Buxton)'
import re
import subprocess
import sys
# Character used as a pipe to split command line
PIPE_CHAR = '|'
... | {
"content_hash": "fb8a0e65b8d9e98f306fd00562036209",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 77,
"avg_line_length": 24.571428571428573,
"alnum_prop": 0.6497093023255814,
"repo_name": "tectronics/squires",
"id": "8ed665746721b96f03af5ae55a422cf8141cf35a",
"size": "... |
def provides_facts():
"""
Returns a dictionary keyed on the facts provided by this module. The value
of each key is the doc string describing the fact.
"""
return {'foo': 'The foo information.'}
def get_facts(device):
return {'foo': None}
| {
"content_hash": "fbf37c269ad22b00f13eb49beb4b9521",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 78,
"avg_line_length": 26.5,
"alnum_prop": 0.6528301886792452,
"repo_name": "pklimai/py-junos-eznc",
"id": "48832d7ffa7efc57dcafdb60b71856ef6ad41eac",
"size": "265",
"bin... |
from util.graphalgorithim import djtree
class ExclusionGraph(object):
def __init__(self):
self.exInfo = {}
def getSwitch(self, node):
info = self.exInfo.get(node)
if info:
switch = info.switch
else:
switch = None # No exInfo, no switch
return switch
def infoNames(self, info):
if info is None:
... | {
"content_hash": "6c5ae3b3e1dcd4fb0d4d774ec7c1f831",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 64,
"avg_line_length": 22.445887445887447,
"alnum_prop": 0.675602700096432,
"repo_name": "ncbray/pystream",
"id": "13c79a0dc5e1c17b76ba1af430f34228f3d267b2",
"size": "5763... |
"""Tests for prompts."""
import os
from typing import List
from unittest import mock
from absl import flags
from absl.testing import absltest
from absl.testing import parameterized
import flax.linen as nn
import jax
import jax.numpy as jnp
import numpy as np
from prompt_tuning import prompts
import seqio
from tensorfl... | {
"content_hash": "55cffe746a385710f48b6be575cd51da",
"timestamp": "",
"source": "github",
"line_count": 357,
"max_line_length": 79,
"avg_line_length": 35.109243697478995,
"alnum_prop": 0.6208712302537099,
"repo_name": "google-research/prompt-tuning",
"id": "315621384deb3b835197ea9f5fef83ba2b65db14",
... |
"""Rally command: verify"""
import configparser
import datetime as dt
import json
import os
import webbrowser
from rally.cli import cliutils
from rally.cli import envutils
from rally.cli import yamlutils as yaml
from rally.common import logging
from rally import exceptions
from rally import plugins
TIME_FORMAT = "%Y... | {
"content_hash": "b00ae9fc4f290c2168e8630d8f781daf",
"timestamp": "",
"source": "github",
"line_count": 808,
"max_line_length": 79,
"avg_line_length": 49.243811881188115,
"alnum_prop": 0.5486692301892483,
"repo_name": "openstack/rally",
"id": "f82e7bf41488a9ff5ca8d644b54791f18dd855d7",
"size": "404... |
"""Importer which would also call decoration on a module upon import
"""
__docformat__ = 'restructuredtext'
import pdb
import os
from os.path import basename, join as pathjoin, dirname
from glob import glob
import sys
from functools import wraps
from ..log import lgr
from six import iteritems
if sys.version_info < ... | {
"content_hash": "11bb130d86396046abc42f0faa703130",
"timestamp": "",
"source": "github",
"line_count": 349,
"max_line_length": 114,
"avg_line_length": 44.30085959885387,
"alnum_prop": 0.5802988163766898,
"repo_name": "jgors/duecredit",
"id": "46e134fa8a029b4211e0f2e0aa57f80e79b4a4a3",
"size": "158... |
from contextlib import redirect_stderr, redirect_stdout
from io import StringIO
from json import JSONDecodeError
from pathlib import Path
from textwrap import dedent
from unittest import TestCase
import json
import os
import subprocess
import sys
import tempfile
try: # pragma: no cover
from importlib import metad... | {
"content_hash": "79283b8fe18ff81765066eebdec0534b",
"timestamp": "",
"source": "github",
"line_count": 911,
"max_line_length": 78,
"avg_line_length": 31.475301866081228,
"alnum_prop": 0.5004882471925787,
"repo_name": "Julian/jsonschema",
"id": "6d42af614846c6ffbd4df2bcaff99abdf9b6286f",
"size": "2... |
import sys
import unittest
from lazy import lazy
class TestCase(unittest.TestCase):
def assertException(self, exc_cls, pattern, func, *args, **kw):
"""Assert an exception of type 'exc_cls' is raised and
'pattern' is contained in the exception message.
"""
try:
func(*a... | {
"content_hash": "22075ec48f1ba1ad4f3398cb59d0e034",
"timestamp": "",
"source": "github",
"line_count": 595,
"max_line_length": 79,
"avg_line_length": 27.556302521008405,
"alnum_prop": 0.5318980239082703,
"repo_name": "DANCEcollaborative/forum-xblock",
"id": "27943a1cf5e58e0582c2b564ab4e8135a94acb73"... |
import httplib
from contextlib import contextmanager
from .stubs import VCRHTTPConnection, VCRHTTPSConnection
_HTTPConnection = httplib.HTTPConnection
_HTTPSConnection = httplib.HTTPSConnection
try:
import requests.packages.urllib3.connectionpool
_VerifiedHTTPSConnection = requests.packages.urllib3.connectio... | {
"content_hash": "2a2680e12a6a790444078c1ffb67e28f",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 107,
"avg_line_length": 34.29577464788732,
"alnum_prop": 0.7638603696098563,
"repo_name": "charlax/vcrpy",
"id": "f5b82cbf32cc5065d3a811e77bd076aec058d938",
"size": "2435",... |
from django.forms import widgets
from rest_framework import serializers
from onadata.apps.api.models import Project
from onadata.apps.logger.models import Instance
from onadata.libs.permissions import get_object_users_with_permissions
from onadata.libs.serializers.fields.boolean_field import BooleanField
from onadata.... | {
"content_hash": "dad70a2a1554db7f98738d77f5934f79",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 74,
"avg_line_length": 36.971698113207545,
"alnum_prop": 0.645317683082419,
"repo_name": "mainakibui/kobocat",
"id": "9327c0158022cc71a67f64de81652ed2f43fe49d",
"size": "3... |
from neutron import context
from neutron.ipam.drivers.neutrondb_ipam import db_api
from neutron.ipam.drivers.neutrondb_ipam import db_models
from neutron.openstack.common import uuidutils
from neutron.tests.unit import testlib_api
class TestIpamSubnetManager(testlib_api.SqlTestCase):
"""Test case for SubnetManage... | {
"content_hash": "eb401d15d8e2c2e8770b4345af4f178e",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 78,
"avg_line_length": 43.08387096774194,
"alnum_prop": 0.5956873315363881,
"repo_name": "NeCTAR-RC/neutron",
"id": "c632efb978c4104ac6fdfb9b4cab66e2af7ecd4e",
"size": "73... |
from django.shortcuts import render
from cacheback.jobs import QuerySetFilterJob
from cacheback.jobs import FunctionJob
from cacheback.decorators import cacheback
from dummyapp import jobs
from dummyapp import models
def fetch():
return models.DummyModel.objects.filter(name__contains='1')
def fetch_with_arg(q... | {
"content_hash": "d111cbb27f8478d5652cda06986684cd",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 72,
"avg_line_length": 27.837209302325583,
"alnum_prop": 0.647451963241437,
"repo_name": "codeinthehole/django-cacheback",
"id": "85494d4cc0552a3cb39ca52563d7bd775f398e12",
... |
"""Testcases for Downpour."""
from __future__ import print_function
import paddle
import paddle.fluid as fluid
import os
import signal
import subprocess
import time
import unittest
import sys
from op_test import OpTest
from paddle.fluid.trainer_desc import DistMultiTrainer
from paddle.fluid.device_worker import Downp... | {
"content_hash": "92232bacca304da01ce8aad4f724fcde",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 95,
"avg_line_length": 40.32214765100671,
"alnum_prop": 0.5660785619174434,
"repo_name": "chengduoZH/Paddle",
"id": "9dbea19ca556460da7fedb13217f8b20d58a15c4",
"size": "66... |
from six import iteritems
SST_DEFAULT_SETTINGS = {
'cookie_name': 'vn',
'cookie_action': 'cookie_action',
'cookie_status': 'cookie_status',
'cookie_status_refused': 0,
'cookie_status_accepted': 1,
'cookie_max_age': 63072000,
'cookie_path': '/',
'cookie_salt': '',
'cookie_httponly':... | {
"content_hash": "532b5389ebbe2adb3e25967812cdf393",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 61,
"avg_line_length": 26.181818181818183,
"alnum_prop": 0.6085069444444444,
"repo_name": "merll/server-side-tracking",
"id": "b9419405384c3747564c5cd8fac1f9f106954a29",
"s... |
from setuptools import setup
from git_version import git_version
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(name='python-ev3dev2',
version=git_version(),
descript... | {
"content_hash": "f78db5ec4af7db7915c8aac762a99085",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 102,
"avg_line_length": 39.714285714285715,
"alnum_prop": 0.6726618705035972,
"repo_name": "rhempel/ev3dev-lang-python",
"id": "6decb294024c8e5c0265f5f3d15a044dc3bb2d7a",
"... |
"""Based on https://stackoverflow.com/q/59978887/3219667.
Update: not working. May want to revisit
"""
import socket
from loguru import logger
HOST = '127.0.0.1'
PORT = 65439
ACK_TEXT = 'text_received'
def main():
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
sock.setsockopt(socket... | {
"content_hash": "23eac14b97944f3c3d2c01d268a97fe0",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 79,
"avg_line_length": 24.627906976744185,
"alnum_prop": 0.5476864966949953,
"repo_name": "KyleKing/My-Programming-Sketchbook",
"id": "0ecead66b693db7b9b91cf9a2e31d643d1853b7... |
'''Copyright 2013 Cosnita Radu Viorel
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 use, copy, modify, merge, publish, distribute,... | {
"content_hash": "f46f2bd8aef09e2e3b4bda19039539f3",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 126,
"avg_line_length": 81.92307692307692,
"alnum_prop": 0.8037558685446009,
"repo_name": "rcosnita/fantastico-todo",
"id": "6616a4632e50368dce53e7fafa6153b05271e0d2",
"siz... |
class Vertex(object):
def __init__(self, name):
self.level = None
self.parent = None
self.start = None
self.finish = None
self.name = name
def reset(self):
self.level = None
self.parent = None
self.start = None
self.finish = None
... | {
"content_hash": "5760c8df346e098153c7ddd7009e05f5",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 29,
"avg_line_length": 21.529411764705884,
"alnum_prop": 0.5136612021857924,
"repo_name": "dimakuv/python-algos",
"id": "9d8e8d01037427d292015f8eb2d620a7ab48c745",
"size": ... |
"""
A request handler with a few improvements.
"""
from tornado.web import RequestHandler
class request_handler(RequestHandler):
def param(self, name):
return self.get_argument(name)
def params(self, name):
return self.get_arguments(name)
| {
"content_hash": "a63e84ae95a601e820922bcd07cae789",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 42,
"avg_line_length": 21.153846153846153,
"alnum_prop": 0.6763636363636364,
"repo_name": "pmatiello/tornado-bootstrap",
"id": "35ca071878092bc1cce955697775fe5ac7eb783b",
"... |
import json
import datetime
from mock import MagicMock
import dateutil.parser
from django.utils import six
from django.utils.http import urlquote
from django.utils import timezone
from django.test import TestCase
from django.test.utils import override_settings
from django import template
from django.contrib.auth impo... | {
"content_hash": "421152e8e91ae1e63f129d1258814516",
"timestamp": "",
"source": "github",
"line_count": 1137,
"max_line_length": 181,
"avg_line_length": 36.22515391380827,
"alnum_prop": 0.633898222783335,
"repo_name": "benemery/wagtail",
"id": "8326c92fc602e306639661615808a32c589271d5",
"size": "41... |
from setuptools import setup, find_packages
import os
import pages
package_name = 'django-page-cms'
base = os.path.dirname(__file__)
def local_open(fname):
return open(os.path.join(base, fname), 'r')
data_dirs = []
for directory in os.walk('pages/templates'):
data_dirs.append(directory[0][6:] + '/*.*')
f... | {
"content_hash": "c60f2f834351083747e3f5d65abee435",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 80,
"avg_line_length": 28.372881355932204,
"alnum_prop": 0.6200716845878136,
"repo_name": "batiste/django-page-cms",
"id": "44a27311992522d9259d79c7b385f43c9613500e",
"siz... |
import subprocess
import logging
import re
from . import SMTLibSolverBackend, PopenSolverProxy
from ...errors import MissingSolverError
log = logging.getLogger(__name__)
def get_version():
try:
version_string = subprocess.check_output(['z3', '-version']).decode('utf-8')
version_match = re.match('... | {
"content_hash": "d5affd301d006f2eb002e185024b74bf",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 104,
"avg_line_length": 36.827586206896555,
"alnum_prop": 0.6605805243445693,
"repo_name": "angr/claripy",
"id": "258211d88cefde75133a999c1d586161be070fd9",
"size": "2136",... |
import threading
import json
import time
import socket
# import urllib
# import urllib2
# import zmq
from util.Res import Res
from util.log import *
class SensorHelper:
TYPE_TEMP = "T"
TYPE_HUM = "H"
TYPE_PIR = "P"
TYPE_LUM = "L"
TYPE_ALL = "A"
def __init__(self):
self._sock = None
... | {
"content_hash": "75a9d1d5a1942bba4617f8c0e50d6618",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 74,
"avg_line_length": 31.174603174603174,
"alnum_prop": 0.4847250509164969,
"repo_name": "fangjing828/LEHome",
"id": "e2f3909d39128f427a214788e0b0ab4f15312d29",
"size": "... |
import argparse
import logging
import getpass
import os
import os.path
import sys
import centinel
import centinel.config
import centinel.daemonize
PID_FILE = "/tmp/centinel.lock"
# Constants
DEFAULT_CONFIG_FILE = os.path.expanduser('~' + getpass.getuser() +
"/.centinel/config... | {
"content_hash": "fdc332bf90f1b0c9eeb5736f026be78a",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 86,
"avg_line_length": 40.50738916256157,
"alnum_prop": 0.5861607685759456,
"repo_name": "rpanah/centinel",
"id": "f8084487317e7f731beb2c86c1f738948f548f24",
"size": "8245... |
from pos_parameters import filename_parameter, value_parameter, \
string_parameter, list_parameter,\
vector_parameter
import pos_wrappers
class preprocess_slice_volume(pos_wrappers.generic_wrapper):
_template = """pos_slice_volume \
-i {input_image... | {
"content_hash": "c3b65d89c6406addde598a63f4eb4524",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 103,
"avg_line_length": 43.41935483870968,
"alnum_prop": 0.5586924219910847,
"repo_name": "chrisfilo/poSSum",
"id": "5235ecd72361d18ec46a5fe96fbfa42a0110dda6",
"size": "269... |
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.pipelin... | {
"content_hash": "7d4815471fd69db57e1c76014a63d73c",
"timestamp": "",
"source": "github",
"line_count": 333,
"max_line_length": 208,
"avg_line_length": 44.168168168168165,
"alnum_prop": 0.650870274680446,
"repo_name": "Azure/azure-sdk-for-python",
"id": "83d0bc9c44088ef57164bffe03d6bb7846d5353d",
"... |
"""
This module contains code to convert document graphs to GraphML files.
"""
from copy import deepcopy
from networkx import write_graphml as nx_write_graphml
from discoursegraphs.readwrite.generic import (
attriblist2str, layerset2str, remove_root_metadata)
def write_graphml(docgraph, output_file):
"""
... | {
"content_hash": "eda576c009ff7b3ddac9afe8698925ed",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 76,
"avg_line_length": 26.363636363636363,
"alnum_prop": 0.7293103448275862,
"repo_name": "arne-cl/discoursegraphs",
"id": "9d9029694f4fec33dbe319e65e414f28eb6d4019",
"size... |
"""Merc
Usage:
main.py FILE
"""
from docopt import docopt
from merc.merc import Merc
import time
import logging
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s [%(module)10s.%(funcName)-15s] [%(levelname)5s] %(message)s')
with open('VERSION') as f:
version = f.read().strip()
args = docopt(__doc_... | {
"content_hash": "be34c555e7d17c666437c9a7f59d3ed8",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 122,
"avg_line_length": 22.652173913043477,
"alnum_prop": 0.6775431861804223,
"repo_name": "rustyfausak/merc",
"id": "7427c8877afa6b8fd3560575a69acec7b19eccf1",
"size": "52... |
from abc import abstractmethod
# abstract command class
class Command(object):
@abstractmethod
def execute(self): pass
@abstractmethod
def undo(self): pass
# special concrete implementations of command, these are helpers for remote
class NoCommand(Command):
"""our null command"""
def execute(self):
... | {
"content_hash": "aab7f73f323da081896e4594b0c6d6d4",
"timestamp": "",
"source": "github",
"line_count": 250,
"max_line_length": 85,
"avg_line_length": 25.864,
"alnum_prop": 0.6653263223012682,
"repo_name": "jmcguire/learning",
"id": "89220bcb28df2203565da963e95b0cdb1c37fadb",
"size": "6466",
"bin... |
"""Support for the Xiaomi vacuum cleaner robot."""
from functools import partial
import logging
from miio import DeviceException, Vacuum
import voluptuous as vol
from homeassistant.components.vacuum import (
ATTR_CLEANED_AREA,
PLATFORM_SCHEMA,
STATE_CLEANING,
STATE_DOCKED,
STATE_ERROR,
STATE_I... | {
"content_hash": "6ffd2f42c731ca7bcf21aa1a61180140",
"timestamp": "",
"source": "github",
"line_count": 525,
"max_line_length": 111,
"avg_line_length": 34.78476190476191,
"alnum_prop": 0.5649983572445515,
"repo_name": "adrienbrault/home-assistant",
"id": "8551a80ff891bb3098c3e47ff29b318c7c374082",
... |
import inspect
import os
import subprocess
import socket
import sys
import time
# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder
cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],"..")))
if cmd_subfolder not in... | {
"content_hash": "ceaf863fd88250da500996d256820a5e",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 129,
"avg_line_length": 27.736842105263158,
"alnum_prop": 0.6837444655281467,
"repo_name": "wenghengcong/MQTTExplore",
"id": "c74aa4d6d380d50e9878fcdfb1c762839237b5fc",
"si... |
from docutils import nodes
from docutils.parsers.rst import directives
from docutils.parsers.rst import Directive as BaseDirective
from recommonmark.parser import CommonMarkParser
from . import yaml
def string_list(argument):
if ',' in argument:
entries = argument.split(',')
else:
entries = a... | {
"content_hash": "3179aecf7ff3db59be078b150c4bb7dd",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 79,
"avg_line_length": 28.74736842105263,
"alnum_prop": 0.5754302453313804,
"repo_name": "julot/sphinxcontrib-dd",
"id": "d7585ab15ba43f2f4c42e73b0986fadf8df11b30",
"size"... |
import warnings
from typing import Callable, List, Optional, Sequence, Tuple, Union
import torch
from torch import Tensor
from ..utils import _log_api_usage_once, _make_ntuple
interpolate = torch.nn.functional.interpolate
class FrozenBatchNorm2d(torch.nn.Module):
"""
BatchNorm2d where the batch statistics... | {
"content_hash": "cb593e244edddf8913df1fa88a3419be",
"timestamp": "",
"source": "github",
"line_count": 319,
"max_line_length": 259,
"avg_line_length": 42.15987460815047,
"alnum_prop": 0.6099338240761395,
"repo_name": "pytorch/vision",
"id": "d4bda7decc52d61b601dde7e19e23aae96994379",
"size": "1344... |
"""Unit tests for the auths module."""
import github3
import pytest
from .helper import UnitHelper, create_url_helper
url_for = create_url_helper('https://api.github.com/authorizations/1')
class TestAuthorization(UnitHelper):
"""Authorization unit tests."""
described_class = github3.auths.Authorization
... | {
"content_hash": "07bab6dab426444219a2306421e2680e",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 79,
"avg_line_length": 33.11702127659574,
"alnum_prop": 0.6151622229360745,
"repo_name": "itsmemattchung/github3.py",
"id": "a8609d32ff2c09bbd32227ec8c96cf5bc0b45e3b",
"siz... |
import unittest
from unittest.mock import patch
from test.helper import TestHelper,\
generate_album_info, \
generate_track_info, \
capture_log
from beets import config
from beets.library import Item
class MbsyncCliTest(unittest.TestCase, TestHelper):
def setUp(self):
self.setup_beets()
... | {
"content_hash": "17f943128162f5c1523fc529abbe2410",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 77,
"avg_line_length": 32.94021739130435,
"alnum_prop": 0.5619534730242535,
"repo_name": "beetbox/beets",
"id": "d1c5e48b0ed2067d3c1c98eb4393a821386d7550",
"size": "6710",... |
"""Helpers for data entry flows for config entries."""
from __future__ import annotations
import logging
from typing import Any, Awaitable, Callable, Union
from homeassistant import config_entries
from homeassistant.components import dhcp, mqtt, ssdp, zeroconf
from homeassistant.core import HomeAssistant
from homeass... | {
"content_hash": "eb2148938a0306c219d7c96d9ccc493d",
"timestamp": "",
"source": "github",
"line_count": 250,
"max_line_length": 88,
"avg_line_length": 35.664,
"alnum_prop": 0.6347016599371915,
"repo_name": "jawilson/home-assistant",
"id": "0a565b3b9ebb71d92cc71ddcfc29741d83183ec0",
"size": "8916",
... |
#!/usr/bin/env python3
# Copyright (c) 2020-2021 The DÃSH Core Developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.messages import CTransaction, FromHex, hash256, ser_compact_size, ser_string
from test_... | {
"content_hash": "1f89372cf22fb78606ffa0c9a6084052",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 119,
"avg_line_length": 45.13265306122449,
"alnum_prop": 0.6493330318788153,
"repo_name": "biblepay/biblepay",
"id": "4e8d3f39b00d209b418414f62f7ec7c29a95fc2c",
"size": "44... |
import json
from datetime import datetime
import os.path
import sys
import optparse
import re
_script_path = os.path.realpath(__file__)
sys.path.insert(0, os.path.normpath(_script_path + "/../../"))
try:
import json_comment_eater
finally:
sys.path.pop(0)
import struct_generator
import element_generator
HEAD = ""... | {
"content_hash": "b7561ad01aa99aa82ff6fccab589187a",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 80,
"avg_line_length": 32.92638036809816,
"alnum_prop": 0.6618222470653997,
"repo_name": "leighpauls/k2cro4",
"id": "d4f90c547466ed5b1a539d17fbddc353c818c1d5",
"size": "68... |
"""
Logging package for Python. Based on PEP 282 and comments thereto in
comp.lang.python.
Copyright (C) 2001-2014 Vinay Sajip. All Rights Reserved.
To use, simply 'import logging' and log away!
"""
import sys, os, time, cStringIO, traceback, warnings, weakref, collections
__all__ = ['BASIC_FORMAT', 'B... | {
"content_hash": "79466316251556595003def6d64fb3b9",
"timestamp": "",
"source": "github",
"line_count": 1729,
"max_line_length": 93,
"avg_line_length": 35.86755349913245,
"alnum_prop": 0.5618963154075627,
"repo_name": "kubaszostak/gdal-dragndrop",
"id": "67fe5053b102504932d0b70db5a33c5bf96da224",
"... |
"""Vendor: HP"""
import re
import logging
from compass.hdsdiscovery import base
from compass.hdsdiscovery import utils
#Vendor_loader will load vendor instance by CLASS_NAME
CLASS_NAME = 'Hp'
class Hp(base.BaseVendor):
"""Hp switch object"""
def __init__(self):
# the name of switch model belonging... | {
"content_hash": "da0e3653aa4ca4e7c970bdaa7c55995c",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 75,
"avg_line_length": 29.529411764705884,
"alnum_prop": 0.6142098273572377,
"repo_name": "SysCompass/compass",
"id": "095885c7c0b7ed744344f88627b83e61ed9bc00d",
"size": "1... |
import importlib
import os
from os import getcwd
from .errors import ImproperConfigurationError
try:
import configparser
except ImportError:
import ConfigParser as configparser
def _config():
parser = configparser.ConfigParser()
parser.read([
os.path.join(os.path.dirname(__file__), 'defaults... | {
"content_hash": "492e8b25a64fda20a3015481cf337821",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 86,
"avg_line_length": 25.032258064516128,
"alnum_prop": 0.6713917525773195,
"repo_name": "riddlesio/python-semantic-release",
"id": "82d0b67dc51cd32d354fdb74856350557ea4a249... |
import sys
print (sys.argv[1]) | {
"content_hash": "08c43c5fb8e3c3932b6337d67b96639a",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 19,
"avg_line_length": 15,
"alnum_prop": 0.7333333333333333,
"repo_name": "hercklub/animated-graph",
"id": "301e00b92bbf4d4a3d43e3d8f04d0223e20f3b27",
"size": "54",
"binar... |
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
| {
"content_hash": "7d686dc9b0ec2a38aee641b236261939",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 59,
"avg_line_length": 33.6,
"alnum_prop": 0.6369047619047619,
"repo_name": "infrae/mobi.caching",
"id": "cf538d82b87103c25260c4d60f5bdeb7dfab33b6",
"size": "318",
"binary... |
"""
plan.core
~~~~~~~~~
Core classes for Plan.
:copyright: (c) 2014 by Shipeng Feng.
:license: BSD, see LICENSE for more details.
"""
import re
import os
import tempfile
import shlex
import subprocess
from .commands import Echo
from .job import CommandJob, ScriptJob, ModuleJob, RawJob
from .outp... | {
"content_hash": "a1413eff26d75e5ec8fb038f68abb448",
"timestamp": "",
"source": "github",
"line_count": 286,
"max_line_length": 79,
"avg_line_length": 36.68531468531469,
"alnum_prop": 0.576153259626382,
"repo_name": "namely/plan",
"id": "e50add5969e15fed4770c339161590a8149e3fac",
"size": "10516",
... |
from json import load
from os.path import join
from functools import lru_cache
from collections import defaultdict
from django.conf import settings
def _split(assets):
parts = defaultdict(lambda: defaultdict(list))
for _, items in assets.get('chunks', {}).items():
for item in items:
name,... | {
"content_hash": "2f47bc614eb96f5cd413635642a51a42",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 78,
"avg_line_length": 28.366666666666667,
"alnum_prop": 0.600470035252644,
"repo_name": "alexey-grom/django-webpack",
"id": "2acefe3d332aca043717c28449feb95a97b12c44",
"si... |
import os.path
import os
import time
import tarfile
import random
import redleader.util as util
class CodeDeployManager(object):
def __init__(self, context):
self._context = context
def create_code_deploy_package(self, path):
n = "code_deploy_package%s.tgz" % random.randrange(0, 10000000)
... | {
"content_hash": "991a4b4719d67f4b42a767035eefaede",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 121,
"avg_line_length": 39.31818181818182,
"alnum_prop": 0.584971098265896,
"repo_name": "mmcdermo/RedLeader",
"id": "5b76d9b962462d851e44afa840cefa5e34788c7e",
"size": "25... |
"""
Prints page views for each entity_aspect_wikidb. Merges page view and entity
usage data.
Usage:
entity_page_views (-h|--help)
entity_page_views <aggregated-entity-usage-file> --page-view-file=<location>
[<dbname-file>]
[--output=<location>]
... | {
"content_hash": "13ad3b7efc62baccb33a9cd38f716fa5",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 80,
"avg_line_length": 28.910828025477706,
"alnum_prop": 0.5441727252698833,
"repo_name": "hall1467/wikidata_usage_tracking",
"id": "329ffb27d742f5ad2af298a57a7e9af67b4f3237... |
"""ResNet50 model for Keras.
# Reference:
- [Deep Residual Learning for Image
Recognition](https://arxiv.org/abs/1512.03385)
Adapted from code contributed by BigMoyan.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from tensorflow.python.k... | {
"content_hash": "52656d8af7b924e83331fcf510b2045d",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 148,
"avg_line_length": 38.97482014388489,
"alnum_prop": 0.6584217812644209,
"repo_name": "Kongsea/tensorflow",
"id": "5238ba70c1c6ac221145c4b467d62d0fafea9b54",
"size": "... |
from oslo_log import log as logging
from cinder import exception
from cinder.i18n import _
from cinder import interface
import cinder.volume.driver
from cinder.volume.drivers.dothill import dothill_common as dothillcommon
from cinder.volume.drivers.san import san
DEFAULT_ISCSI_PORT = "3260"
LOG = logging.getLogger(_... | {
"content_hash": "4f0f0dbb59cb0825bd1960a7d11787ec",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 75,
"avg_line_length": 36.67403314917127,
"alnum_prop": 0.5808978608014462,
"repo_name": "bswartz/cinder",
"id": "b92a71b01b6bff0c6352109ca8d29c73309170ff",
"size": "7286"... |
from oslo_config import cfg
from nova.tests.functional.api_sample_tests import test_servers
from nova.tests.unit.api.openstack import fakes
from nova.tests.unit.image import fake
CONF = cfg.CONF
CONF.import_opt('osapi_compute_extension',
'nova.api.openstack.compute.legacy_v2.extensions')
class Confi... | {
"content_hash": "6c3b93476aec77bb2dd50e3957b13d72",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 75,
"avg_line_length": 42.24193548387097,
"alnum_prop": 0.6281023291332569,
"repo_name": "mmnelemane/nova",
"id": "4ec10d333b8d958dda8ff560c3dfc10eec89fa55",
"size": "3251"... |
import re
def reverse_str(string):
string = string.strip()
string = re.sub("\s+", " ", string)
result = [word[::-1] for word in string[::-1].split(" ")]
return " ".join(result)
# "degree CS":
print reverse_str(" CS degree")
print reverse_str("CS degree")
print reverse_str("CS degree ")
print re... | {
"content_hash": "51e6ddf0824cc02bf1e5d495b5926af7",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 61,
"avg_line_length": 25,
"alnum_prop": 0.6,
"repo_name": "mre/the-coding-interview",
"id": "b5aa67663a42b92a7d170586d7626bb2aa4c2ae4",
"size": "350",
"binary": false,
... |
from django.conf.urls import patterns, url
from accounts import views
urlpatterns = patterns('',
url(r'^register/$', views.register, name = 'register'),
url(r'^login/$', 'django.contrib.auth.views.login', name = 'login'),
url(r'^profile/$', views.profile, name = 'profile'),
)
| {
"content_hash": "3c64c9e41638e5c8dd9abb9f61a8e619",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 72,
"avg_line_length": 29.6,
"alnum_prop": 0.652027027027027,
"repo_name": "burk/helgapp",
"id": "9f101dccb85014895c7e71f6abe41b594b4330d9",
"size": "296",
"binary": fals... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Submission.sketh_note'
db.add_column('challenges_submission', 'sketh_note', self.gf('django.db.models.fields... | {
"content_hash": "74a9ed90b29d52be16ed87391a810f06",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 182,
"avg_line_length": 76.77397260273973,
"alnum_prop": 0.5516103131412258,
"repo_name": "mozilla/mozilla-ignite",
"id": "a678a3a2908a1b93d152a88b3caec840a13203b8",
"size... |
"""Glance exception subclasses"""
import six
import six.moves.urllib.parse as urlparse
from glance.i18n import _
_FATAL_EXCEPTION_FORMAT_ERRORS = False
class RedirectException(Exception):
def __init__(self, url):
self.url = urlparse.urlparse(url)
class GlanceException(Exception):
"""
Base Gla... | {
"content_hash": "f5ae5b38d10c1564a6a820f9a164dc9c",
"timestamp": "",
"source": "github",
"line_count": 442,
"max_line_length": 79,
"avg_line_length": 31.30316742081448,
"alnum_prop": 0.6714368314541775,
"repo_name": "rajalokan/glance",
"id": "097957a70fad84cacd61d3e7fade131f30f42fbe",
"size": "145... |
import argparse
import ConfigParser
import json
import copy
from netaddr import IPNetwork
from vnc_api.vnc_api import *
def get_ip(ip_w_pfx):
return str(IPNetwork(ip_w_pfx).ip)
# end get_ip
class VncProvisioner(object):
def __init__(self, args_str=None):
self._args = None
if not args_str:... | {
"content_hash": "a76c1a9d9c7b362a96941dc6a98c4f63",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 78,
"avg_line_length": 34.99465240641711,
"alnum_prop": 0.5655562347188264,
"repo_name": "sajuptpm/contrail-controller",
"id": "80ad4d4d22878e54bee27de9821de562d0cf8b3a",
... |
import base64
import logging
import uuid
import requests
from django.conf import settings
from django.contrib.auth import get_user_model
from django.db import transaction
from rest_framework import generics, status, views
from rest_framework.authtoken.models import Token
from rest_framework.exceptions import APIExcept... | {
"content_hash": "0b69c10e5cb5adfdf46c9572a29b9b72",
"timestamp": "",
"source": "github",
"line_count": 567,
"max_line_length": 159,
"avg_line_length": 37.15520282186949,
"alnum_prop": 0.5973323206911283,
"repo_name": "opennode/nodeconductor-assembly-waldur",
"id": "4ddcf067cde14fc05a607b22cabfdf3dfa... |
import urllib2
try:
from xml.etree import ElementTree
ElementTree # workaround for pyflakes issue #13
except ImportError:
ElementTree = None
from test import CollectorTestCase
from test import get_collector_config
from test import run_only
from test import unittest
from mock import patch
from diamond.co... | {
"content_hash": "90d7d03af3cfb9832054aa56f4e1e1c7",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 79,
"avg_line_length": 33.52247191011236,
"alnum_prop": 0.6291268644209821,
"repo_name": "ceph/Diamond",
"id": "48fe75db0e15fd1e5e67355a8b50ba888de0695b",
"size": "6080",
... |
import unittest
from automergetool.amt_utils import Conflict
from automergetool.solvers.gen_single_line import *
def prompt_accept(conflict: Conflict, resolution: str) -> bool:
return True
def prompt_refuse(conflict: Conflict, resolution: str) -> bool:
return False
def user_input(msg: str, result: str) -... | {
"content_hash": "bdf275302a125c4de6075891891998b1",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 115,
"avg_line_length": 29.983783783783785,
"alnum_prop": 0.5831981251126735,
"repo_name": "xgouchet/AutoMergeTool",
"id": "78a4580d74d1de2a8e9a0214811c91ce31ec473f",
"siz... |
"""
Server API
Reference for Server API (REST/Json)
OpenAPI spec version: 2.0.21
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class WidgetHookPhrase(object):
"""
NOTE: This class is auto generated b... | {
"content_hash": "58c4b8edf77f2c67ccb5d311c366fd1f",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 118,
"avg_line_length": 23.62230215827338,
"alnum_prop": 0.5118014313994214,
"repo_name": "kinow-io/kinow-python-sdk",
"id": "39f23d90a885b40f2aa33ed97762e8d3ba802cab",
"s... |
import os
import sys
import argparse
import shutil
parser = argparse.ArgumentParser(description='Android system files extractor')
parser.add_argument("-p", "--prefix", metavar="NAME", required=True,
help="Prefix for stored files, e.g. galaxy-s7-us")
SYSTEM_FILES = [
"/proc/cpuinfo",
"/sy... | {
"content_hash": "c2fb6700bee08745852a5e57771dda8e",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 100,
"avg_line_length": 30.38095238095238,
"alnum_prop": 0.5188087774294671,
"repo_name": "Teaonly/easyLearning.js",
"id": "feecf4b6fbd82a7f6fbe163c212942e445796db6",
"siz... |
from wpilib import IterativeRobot
from wpilib import DigitalOutput
import wpilib
from wpilib.command import Scheduler
from wpilib import LiveWindow
import logging
from oi import OI
from robotMap import RobotMap
from subsystems.driveTrain import DriveTrain
from subsystems.intakeLauncher import IntakeLauncher
from subs... | {
"content_hash": "16c57c1679c808d1447bb0243bebf64a",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 74,
"avg_line_length": 29.008064516129032,
"alnum_prop": 0.6244092299138171,
"repo_name": "dbadb/2016-Stronghold",
"id": "4c6d2bb2c417023f66a782887cb898ba2d6a65e4",
"size"... |
import Display
import Helper
from skimage.color import rgb2gray
import numpy as np
from scipy import misc
from sklearn import svm, grid_search, metrics
from sklearn.neural_network import MLPClassifier
from skimage.feature import greycomatrix, greycoprops
from skimage import img_as_ubyte, io
from sklearn import decompos... | {
"content_hash": "a184d8d8a25b850b52367c3483686dc1",
"timestamp": "",
"source": "github",
"line_count": 368,
"max_line_length": 169,
"avg_line_length": 43.41847826086956,
"alnum_prop": 0.6165978220052573,
"repo_name": "oduwa/Pic-Numero",
"id": "d799f21a5af5997b869783270be4f9888907fa29",
"size": "15... |
"""Fichier contenant le paramètre 'harnacher' de la commande 'familier'."""
from primaires.interpreteur.masque.parametre import Parametre
class PrmHarnacher(Parametre):
"""Commande 'familier harnacher'."""
def __init__(self):
"""Constructeur du paramètre"""
Parametre.__init__(self, "harnache... | {
"content_hash": "3064479107fdd2bc30d54a75f957d055",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 78,
"avg_line_length": 43.5,
"alnum_prop": 0.5813305468477882,
"repo_name": "vlegoff/tsunami",
"id": "353b93c86fb5d3501214d210c44cf5f96187e933",
"size": "4456",
"binary":... |
"""Tests for db.task layer."""
import json
import mock
from rally.common import objects
from rally import consts
from tests.unit import test
class TaskTestCase(test.TestCase):
def setUp(self):
super(TaskTestCase, self).setUp()
self.task = {
"uuid": "00ef46a2-c5b8-4aea-a5ca-0f54a10cb... | {
"content_hash": "937b4d43fd9505aeef70c19a83a9ac83",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 77,
"avg_line_length": 42.67763157894737,
"alnum_prop": 0.6197009403422229,
"repo_name": "vefimova/rally",
"id": "38975d18f91ea97dea0e20dc6620c98875959ee7",
"size": "7117"... |
import setuptools, re
import os
class RunTestsCommand(setuptools.Command):
description = "Test command to run testr in virtualenv"
user_options = [
('coverage', 'c',
"Generate code coverage report"),
]
boolean_options = ['coverage']
def initialize_options(self):
self.cw... | {
"content_hash": "aa2740c498382d138f9d4ce14f357df5",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 73,
"avg_line_length": 27.74074074074074,
"alnum_prop": 0.5627503337783711,
"repo_name": "eonpatapon/contrail-controller",
"id": "79eca299c878bee9575042040e00b693f0dbfc9c",
... |
"""
Downloads, extracts, and loads symbols for the current version of Google Chrome
running under the debugger. This only works for official, Google Chrome builds.
To use, add this to .lldbinit:
command script import /path/to/tools/lldb/lldb_chrome_symbols.py
If you are attached to any Google Chrome process, type... | {
"content_hash": "7d6b153466c665d4840a0a79f220c2be",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 119,
"avg_line_length": 38.07936507936508,
"alnum_prop": 0.6411004585243851,
"repo_name": "scheib/chromium",
"id": "2277728e0389d0a674bac885c1c635cbff771248",
"size": "496... |
import telebot
import config
import dbhelper
import dictionary
import fnmatch
import os
import json
import requests
import time
# Initialize bot
bot = telebot.TeleBot(config.token)
#checks whether the file is having some pre-saved data or not
#if the file contains no data then ---> makes a list/dict with the name use... | {
"content_hash": "49d2220dbc64c91b0b8f34120c03d6c7",
"timestamp": "",
"source": "github",
"line_count": 446,
"max_line_length": 280,
"avg_line_length": 60.39461883408072,
"alnum_prop": 0.6613454113454114,
"repo_name": "mrgigabyte/proxybot",
"id": "bc2d686a168bb766a607221cccb5613f7e55ad1c",
"size": ... |
"""
Driver base-classes:
(Beginning of) the contract that compute drivers must follow, and shared
types that support that contract
"""
import sys
from oslo.config import cfg
from nova.openstack.common import importutils
from nova.openstack.common import log as logging
from nova import utils
from nova.virt i... | {
"content_hash": "b52a9f53ce4c8fdc6b5c4687ced6b68a",
"timestamp": "",
"source": "github",
"line_count": 986,
"max_line_length": 79,
"avg_line_length": 40.29918864097363,
"alnum_prop": 0.6431357745061029,
"repo_name": "shootstar/novatest",
"id": "a0613a97a386c01d45e2bcb42b249091f6f2c2d4",
"size": "4... |
import json
import os
import sys
import time
import signal
from os.path import basename, dirname, join
from random import shuffle
from swift import gettext_ as _
from contextlib import closing
from eventlet import Timeout
from swift.obj import diskfile, replicator
from swift.common.utils import (
get_logger, ratel... | {
"content_hash": "83b066f98fe97dc73860f67b1a6212a1",
"timestamp": "",
"source": "github",
"line_count": 419,
"max_line_length": 79,
"avg_line_length": 45.49403341288783,
"alnum_prop": 0.5434372049102927,
"repo_name": "psachin/swift",
"id": "49a745dfb074eeafaace26f5e99d9dc3c2a0f44d",
"size": "19657"... |
from setuptools import setup, find_packages
from thumbor_memcached import __version__
tests_require = [
'mock',
'nose',
'coverage',
'yanc',
'preggy',
'tox',
'ipdb',
'coveralls',
'sphinx',
]
setup(
name='thumbor-memcached',
version=__version__,
description='thumbor-memca... | {
"content_hash": "cf55679185bc98c55a727c4b10a85bfd",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 84,
"avg_line_length": 27.333333333333332,
"alnum_prop": 0.6050135501355014,
"repo_name": "thumbor-community/thumbor-memcached",
"id": "0ef575da0570c0c553942b577ab96721314110... |
"""Virtual file system for managing files locally or in the cloud."""
__author__ = 'Pavel Simakov (psimakov@google.com)'
import datetime
import os
from entities import BaseEntity
import jinja2
from common import jinja_utils
from models import MemcacheManager
from google.appengine.api import namespace_manager
from ... | {
"content_hash": "a6538efc656342e2ff13954ac6cf55d0",
"timestamp": "",
"source": "github",
"line_count": 624,
"max_line_length": 80,
"avg_line_length": 35.79647435897436,
"alnum_prop": 0.6129292205757264,
"repo_name": "wavemind/mlgcb",
"id": "84c4322a2de0104515f08231603704a951bec0e2",
"size": "22935... |
from django.conf.urls import patterns, url, include
from rest_framework import routers
from views import RecipeViewSet
router = routers.DefaultRouter()
router.register(r'recipe', RecipeViewSet)
urlpatterns = patterns('',
url(r'^', include(router.urls)),
) | {
"content_hash": "7a0ca517e6facff5f6f3b549adc9d59d",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 51,
"avg_line_length": 26.1,
"alnum_prop": 0.7662835249042146,
"repo_name": "virtualwalkers/arch-recipe",
"id": "65d72511c0baf049cf5703939d358bcad0bc471e",
"size": "261",
... |
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
# TODO: Delete this code once this version of pymel has been out for while!
# ok, we recently deleted some files (batch.py and gui.py) from pymel...
# ...however, some users may still have some pesky .pyc's lying around... and if
# they do, th... | {
"content_hash": "6c6090046bcdda588350966a77c78661",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 80,
"avg_line_length": 46.06060606060606,
"alnum_prop": 0.6546052631578947,
"repo_name": "assumptionsoup/pymel",
"id": "36b8bc4f83988263763318e9d6ae454ed0a69082",
"size": "... |
"""
Filter for detecting images where the object is too small
in comparison to the size of the image.
"""
import numpy
from ..utils.image_utils import read_image
from ..utils.object_extraction import extract_object
from filter import Filter
def get_object_ratio(obj):
"""Calculate the ratio of the object's size ... | {
"content_hash": "4fdfaf22f3c4568c09bc3339c4cd0d1d",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 80,
"avg_line_length": 35.611111111111114,
"alnum_prop": 0.6056942277691107,
"repo_name": "vismantic-ohtuprojekti/qualipy",
"id": "b73bcd1075a6dd924f96b4094c29db1925e4bc8a",
... |
"""timecast/modules/__init__.py"""
from timecast.modules._ar import AR
from timecast.modules._linear import Linear
from timecast.modules._predict_constant import PredictConstant
from timecast.modules._predict_last import PredictLast
from timecast.modules.core import Module
__all__ = ["Module", "AR", "Linear", "Predict... | {
"content_hash": "0591e2a41861f7939ff54f2bd512b797",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 70,
"avg_line_length": 43.25,
"alnum_prop": 0.7716763005780347,
"repo_name": "google/timecast",
"id": "6419456c46a290b325077704476e8664df1c9c37",
"size": "921",
"binary": ... |
from django.utils.translation import get_language
from django.shortcuts import get_object_or_404, render_to_response
from django.template import RequestContext
from django.http import Http404
from django.core.paginator import Paginator
from cmskit.articles.models import Article
def index(request):
articles = Arti... | {
"content_hash": "fa91e86e2ca0a4d346ac5368dfd6e4fd",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 77,
"avg_line_length": 39.04545454545455,
"alnum_prop": 0.6775320139697323,
"repo_name": "ozgurgunes/django-cmskit",
"id": "f306428e2d159d74d63fc63da2a4e713a7b360ac",
"size... |
"""Grammar for BigQuery types."""
from typing import List, Sequence, Tuple, Union # noqa: F401
from .bq_abstract_syntax_tree import AppliedRuleOutputType # noqa: F401
from .bq_types import BQType # noqa: F401
from .bq_types import BQArray, BQScalarType, BQStructType
from .query_helper import apply_rule, separated_... | {
"content_hash": "403870ab0860fb0b8aa7b8472420a67e",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 96,
"avg_line_length": 35.98412698412698,
"alnum_prop": 0.651080723423026,
"repo_name": "verilylifesciences/purplequery",
"id": "9502ed395e896755c2741d4a7477f3aac6aa2aa7",
... |
from WorkingWithWorksheets import DisplayHideScrollBars
import jpype
import os.path
asposeapispath = os.path.join(os.path.abspath("../../../"), "lib/")
dataDir = os.path.join(os.path.abspath("./"), "data/")
print "You need to put your Aspose.Cells for Java APIs .jars in this folder:\n"+asposeapispath
#print dataDir
... | {
"content_hash": "f1745955a2d1ed1d0cdfb4317dc52146",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 94,
"avg_line_length": 31.928571428571427,
"alnum_prop": 0.7449664429530202,
"repo_name": "fahadadeel/Aspose.Cells-for-Java",
"id": "26d1499cd7048968e6740a4f77c71da4a4b23963"... |
import datetime
from decimal import Decimal
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import path, reverse
from django.utils.dateparse import parse_date
from rest_framework import generics, serializers, status
from rest_framework.test import APIRequestFactory
fr... | {
"content_hash": "628ddd50482ff811d73097d6f3402862",
"timestamp": "",
"source": "github",
"line_count": 416,
"max_line_length": 106,
"avg_line_length": 37.12980769230769,
"alnum_prop": 0.6392593551728603,
"repo_name": "alex/django-filter",
"id": "2c37618f8b63f5387a1166daf8609e55a96f431b",
"size": "... |
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^trigger-500$', 'tests.views.raise_exc', name='sentry-raise-exc'),
url(r'^trigger-500-decorated$', 'tests.views.decorated_raise_exc', na... | {
"content_hash": "b2784147aa4b5338198d6372a39f887c",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 104,
"avg_line_length": 48.285714285714285,
"alnum_prop": 0.6923076923076923,
"repo_name": "WoLpH/django-sentry",
"id": "148e5850267fb91d1271dc08e01ee79a7e7da10a",
"size": ... |
import os
import shutil
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "build")))
import build_utils
script_dir = os.path.abspath(os.path.dirname(__file__))
wxwebkit_dir = os.path.abspath(os.path.join(script_dir, "..", "..", "..", "WebKitBuild", "Debug" + build_utils.git_bra... | {
"content_hash": "911a1fa996460e846305c48287013df1",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 130,
"avg_line_length": 35.705882352941174,
"alnum_prop": 0.6457990115321252,
"repo_name": "mogoweb/webkit_for_android5.1",
"id": "5c6795de0df9aa7d29f92ca4e3a3c80d650cbd2c",
... |
__all__ = ("FlashPolicyProtocol", "FlashPolicyFactory",)
import re
from twisted.internet.protocol import Protocol, Factory
class FlashPolicyProtocol(Protocol):
"""
Flash Player 9 (version 9.0.124.0 and above) implements a strict new access
policy for Flash applications that make Socket or XMLSocket connec... | {
"content_hash": "34eea5344691cc40a4cf43890e4ce6e5",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 139,
"avg_line_length": 31.138297872340427,
"alnum_prop": 0.672360778954561,
"repo_name": "boonedox/AutobahnPython",
"id": "00f67f09faef6caa684c6bc0ed1694f6d8e6a6c0",
"size... |
import json
import os
from glob import glob
def convert(_dir, version, edition ='pc'):
with open(os.path.join(_dir, 'dataPaths.json')) as f:
datapaths = json.load(f)
data = _grabdata(_dir, datapaths[edition][version])
ret = {}
for datum in ('recipes', 'materials', 'protocol', 'version',
... | {
"content_hash": "6f246156feb69f369661b0c0357b5957",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 76,
"avg_line_length": 31.49438202247191,
"alnum_prop": 0.5736710667142347,
"repo_name": "rom1504/python-minecraft-data",
"id": "bf233de713ba8f5a84a9bb37e818d98bfc07e160",
... |
from setuptools import setup, find_packages
from swift import __canonical_version__ as version
name = 'swift'
with open('requirements.txt', 'r') as f:
requires = [x.strip() for x in f if x.strip()]
setup(
name=name,
version=version,
description='Swift',
license='Apache License (2.0)',
aut... | {
"content_hash": "c75fb444bbf6ed198bc565c9cbcedfc0",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 79,
"avg_line_length": 39.254901960784316,
"alnum_prop": 0.6203796203796204,
"repo_name": "tsli/test",
"id": "6c4c2328c19fb88da1836736976a47f1e11818c2",
"size": "4612",
... |
from viewflow import flow
from viewflow.base import this, Flow
from .models import DocumentProcess
from documents import views
class DocumentFlow(Flow):
process_class = DocumentProcess
start = (
flow.Start(views.DocumentCreateView)
.Next(this.edit_draft)
)
edit_draft = (
... | {
"content_hash": "c5576c9061b3559b2080277e63bf7767",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 71,
"avg_line_length": 21.25,
"alnum_prop": 0.6367647058823529,
"repo_name": "sychsergiy/DocFlow",
"id": "fc18c91ce5727d06036b109fefdda87077dfcc26",
"size": "680",
"binar... |
from datetime import datetime
from django.db import models
from django.utils.html import escape
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from tribes.m... | {
"content_hash": "d61b31eca974fad652d92e3a13554b3b",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 115,
"avg_line_length": 32.475903614457835,
"alnum_prop": 0.6581339269152291,
"repo_name": "indro/t2c",
"id": "3af8a0631494ab45aca9f13041843784b4779f58",
"size": "5391",
... |
from fabric.api import settings, sudo
from cuisine import package_clean, package_ensure
from fabuloso import fabuloso
import fabuloso.utils as utils
CINDER_CONF = '/etc/cinder/cinder.conf'
CINDER_API_PASTE_CONF = '/etc/cinder/api-paste.ini'
def stop():
with settings(warn_only=True):
sudo("nohup service ... | {
"content_hash": "d6d12c14c6f8dbd0f614a71579ea6195",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 79,
"avg_line_length": 40.99354838709677,
"alnum_prop": 0.6292099464903997,
"repo_name": "StackOps/fabuloso-catalog-havana",
"id": "2ffbf7090f9539cb1951c603c996715ddff52f2f"... |
import unittest
from driver_env import env
import driver_test_utils
import driver_tools
import elftools
import filetype
import re
class TestNativeDriverOptions(driver_test_utils.DriverTesterCommon):
def setUp(self):
super(TestNativeDriverOptions, self).setUp()
driver_test_utils.ApplyTestEnvOverrides(env)
... | {
"content_hash": "1f01a06e56f898c6cdb6ed3728ff7616",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 79,
"avg_line_length": 42.01136363636363,
"alnum_prop": 0.6494454963483905,
"repo_name": "cvsuser-chromium/native_client",
"id": "302838ef104ead97e7d9e89e66943bd930ed4c84",
... |
from fastapi.testclient import TestClient
from docs_src.custom_response.tutorial009c import app
client = TestClient(app)
def test_get():
response = client.get("/")
assert response.content == b'{\n "message": "Hello World"\n}'
| {
"content_hash": "94f9c0cd01c38bfd7407405d159284f1",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 66,
"avg_line_length": 23.9,
"alnum_prop": 0.7112970711297071,
"repo_name": "tiangolo/fastapi",
"id": "23c711abe9a0e5380f8a16a1e890ba1b6e55baa9",
"size": "239",
"binary":... |
from copy import copy
class TextStyle:
font = None
size = None
align = None
line_spacing = None
color = None
bold = None
italic = None
attributes = ("font",
"size",
"align",
"line_spacing",
"color",
... | {
"content_hash": "5a5868bd8cf3f782b0b884fd4b1e9edc",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 62,
"avg_line_length": 22.163265306122447,
"alnum_prop": 0.4677716390423573,
"repo_name": "spirali/elphie",
"id": "9683466fabd635aa8f31b46583f87d59f147431f",
"size": "1087"... |
"""
agileboards
~~~~~~~~~~~
:copyright: (c) 2013-2014 by Linovia, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
""" | {
"content_hash": "2ccb9470f8d96e3c8abecc46e16c1d77",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 67,
"avg_line_length": 20.714285714285715,
"alnum_prop": 0.6620689655172414,
"repo_name": "linovia/django-agile-boards",
"id": "d07f86de80e072f402e83ce20a1cf14040d1c9e9",
"s... |
"""A deep MNIST classifier using convolutional layers.
Sample usage:
python mnist.py --help
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
import sys
import time
import tensorflow as tf
import tensorflow.contrib.eager as ... | {
"content_hash": "36a658ccd5fc347a2a7dbcd7ba6a99a3",
"timestamp": "",
"source": "github",
"line_count": 354,
"max_line_length": 80,
"avg_line_length": 35.82768361581921,
"alnum_prop": 0.6389655444295513,
"repo_name": "nolanliou/tensorflow",
"id": "b9ac79f46c83bb709918e3b72830b90ddcfd71b4",
"size": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.