text stringlengths 4 1.02M | meta dict |
|---|---|
"""Python 2.7 collections module compatibility for 2.6."""
# pylint: disable=wildcard-import
from googlecloudsdk.third_party.py27.mirror.collections import *
| {
"content_hash": "546e06e18d44fbf9b0eff03123882296",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 64,
"avg_line_length": 39.75,
"alnum_prop": 0.7861635220125787,
"repo_name": "flgiordano/netcash",
"id": "46e053f8a1b7ee5b2c1180e599017396ae70b3db",
"size": "755",
"binary... |
import hashlib
import hmac
import random
import string
def rand_salt():
return "".join( random.choice(string.letters) for x in range(5) ) # generate a random 5-letter string
def make_secure_val(username , salt = None ):
if not salt:
salt = rand_salt()
h = hmac.new(salt, userna... | {
"content_hash": "0fb6e73b0ba63652aeb4801d4f6ebd63",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 107,
"avg_line_length": 25.91891891891892,
"alnum_prop": 0.5495307612095933,
"repo_name": "divkakwani/college-administration",
"id": "ba7908b9b772f20166dcf75a00bc0c3cf54febc7... |
import os
import time
import sys
import traceback
"""
ScriptLog.py - A scripting library that allows for out put to the screen, a file or both. You can use different parts of this package
to tag what you are doing at the time of the logging. It takes logging one step farther by also showing the trace back informa... | {
"content_hash": "5fc41a12cec4fd1972b64563fc8d59ee",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 157,
"avg_line_length": 31.2979797979798,
"alnum_prop": 0.5149265773761498,
"repo_name": "wags007/BIND_DHCP_to_dnsmasq",
"id": "cc4ebce7a02a9fb76309e0ef928e17b42b47ec03",
... |
from django.conf.urls import include # noqa
from django.conf.urls import patterns
from django.conf.urls import url
from openstack_dashboard.dashboards.admin.networks.agents \
import views as agent_views
from openstack_dashboard.dashboards.admin.networks.ports \
import urls as port_urls
from openstack_dashboar... | {
"content_hash": "695a98547876287aef61c1cf74c62eb0",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 72,
"avg_line_length": 42.94871794871795,
"alnum_prop": 0.6847761194029851,
"repo_name": "intlabs/cannyos-backend-dashboard",
"id": "09318cc4b7c702f59366f0c01ffa5eb649d45112"... |
import re
class XPathTranslator(object):
def __init__(self, selector):
self.selector = selector
def get_selector(self):
sel = self.selector
sel = self.do_translations(sel)
sel = self.do_fixes(sel)
return sel
def do_translations(self, sel):
sel = self._tran... | {
"content_hash": "26dbcfd797a716bd85680ace8c67365c",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 113,
"avg_line_length": 32.333333333333336,
"alnum_prop": 0.5248067010309279,
"repo_name": "gabrielfalcao/dominic",
"id": "aa5e73c299df9ce2c0c43e69131fa001ddb06db1",
"size"... |
"""Functions to plot M/EEG data on topo (one axes per channel)
"""
from __future__ import print_function
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eri... | {
"content_hash": "0b5eaa70d7b8e33c5a20949c9d6ff393",
"timestamp": "",
"source": "github",
"line_count": 715,
"max_line_length": 79,
"avg_line_length": 40.01398601398601,
"alnum_prop": 0.581999300943726,
"repo_name": "wronk/mne-python",
"id": "3bcad971d0887a2ca5fc1d8412945071734edb34",
"size": "2861... |
import collections.abc as collections_abc
import itertools
from .. import AssertsCompiledSQL
from .. import AssertsExecutionResults
from .. import config
from .. import fixtures
from ..assertions import assert_raises
from ..assertions import eq_
from ..assertions import in_
from ..assertsql import CursorSQL
from ..sch... | {
"content_hash": "bf4a648491ff4ccaf56907c82e5221d5",
"timestamp": "",
"source": "github",
"line_count": 1881,
"max_line_length": 79,
"avg_line_length": 30.995746943115364,
"alnum_prop": 0.49391969538445707,
"repo_name": "zzzeek/sqlalchemy",
"id": "6394e4b9a10da712ecf0c33883c919c952d8b72c",
"size": ... |
""" Download and install WordPress
"""
import os
import subprocess
import shutil
from distutils.dir_util import copy_tree
import tarfile
import urllib.request
import config_loader
import template
from teminal_colors import echo
# Public (html) directory
WWW_DIR = '/srv/www'
def install_wordpress():
"""Download a... | {
"content_hash": "ef5443e9c96939d04ebb855c8d78dd1d",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 79,
"avg_line_length": 33.30379746835443,
"alnum_prop": 0.6092740402888636,
"repo_name": "stef-k/starter",
"id": "ec0a0c039b4293bf275f6d16a69b88e5ca9aece7",
"size": "2631",... |
"""Converts cirq circuits into latex using qcircuit."""
from cirq.contrib.qcircuit.qcircuit_diagram import (
circuit_to_latex_using_qcircuit,
)
from cirq.contrib.qcircuit.qcircuit_diagram_info import (
escape_text_for_latex,
get_multigate_parameters,
get_qcircuit_diagram_info,
)
| {
"content_hash": "db5055d08cea09998bb2f53fbd0e6c94",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 57,
"avg_line_length": 27.09090909090909,
"alnum_prop": 0.7483221476510067,
"repo_name": "balopat/Cirq",
"id": "c01091cebbdec467eb373cb0eed8fe441c16c2f7",
"size": "883",
... |
import os
from sys import argv
import ntpath
import requests
import hashlib
import json
FORMATS = ['py', 'html', 'java', 'go', 'htm', 'css', 'rb', 'md', 'txt']
URL_INDEX = "http://localhost:9200/code/"
URL_TYPE = URL_INDEX + "source_file/"
def read_file(file):
try:
txt = open(file)
return txt.r... | {
"content_hash": "b84f974f16e53eeb4c7d4d59715369a9",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 71,
"avg_line_length": 20.821428571428573,
"alnum_prop": 0.5403087478559176,
"repo_name": "ipedrazas/search-ctl",
"id": "16158df4c38cce0c7ab7dcc0dff511e14f33e29b",
"size": ... |
default_app_config = 'distributed_task.apps.DistributedTaskConfig'
from .core.decorators import register_task | {
"content_hash": "e7d4573be5d3ac93a4294901c935bb49",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 66,
"avg_line_length": 36.666666666666664,
"alnum_prop": 0.8363636363636363,
"repo_name": "mrcrgl/django_distributed_task",
"id": "9eb5202b39a9839de0a4a17557fc98f3c22d5e5d",
... |
from ovsdbapp.backend.ovs_idl import idlutils
from neutron.common import _deprecate
_deprecate._MovedGlobals(idlutils)
| {
"content_hash": "2ee1f3b6027cf890aec8a2326b4e74b6",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 45,
"avg_line_length": 24.2,
"alnum_prop": 0.8264462809917356,
"repo_name": "eayunstack/neutron",
"id": "b8d140f8db1a3f550242fcb2ec7806b16121199e",
"size": "731",
"binary"... |
"""Support for Balboa Spa Wifi adaptor."""
from __future__ import annotations
import asyncio
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
CURRENT_HVAC_HEAT,
CURRENT_HVAC_IDLE,
FAN_HIGH,
FAN_LOW,
FAN_MEDIUM,
FAN_OFF,
HVAC_MO... | {
"content_hash": "593f08f1d02eea78ee936863d27a5a3f",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 88,
"avg_line_length": 36.04347826086956,
"alnum_prop": 0.6267447871790454,
"repo_name": "home-assistant/home-assistant",
"id": "edd44b03f17c108907f4a215b4db45eb78483151",
... |
import os
import sys
import threading
from datetime import datetime
from syncplay import constants
from syncplay import utils
from syncplay.messages import getMessage, getLanguages, setLanguage, getInitialLanguage
from syncplay.players.playerFactory import PlayerFactory
from syncplay.utils import isBSD, isLinux, isMac... | {
"content_hash": "59a5b1706a17bbff436b85d54708eb85",
"timestamp": "",
"source": "github",
"line_count": 1509,
"max_line_length": 204,
"avg_line_length": 53.91583830351226,
"alnum_prop": 0.6964318637151391,
"repo_name": "Syncplay/syncplay",
"id": "c5d05121b17d977d593dbfc1b83f499353c844c9",
"size": "... |
from sys import stderr
from os import environ
from urlparse import urlparse
from StringIO import StringIO
from zipfile import ZipFile, ZIP_DEFLATED
from time import time
from flask import Flask
from flask import request
from flask import Response
from flask import render_template
from osgeo import ogr
from util impor... | {
"content_hash": "42f78c0636c35790517b40b6ec89fc76",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 93,
"avg_line_length": 30.72077922077922,
"alnum_prop": 0.652716127668569,
"repo_name": "codeforamerica/mdc-municipality-geo-api",
"id": "a56258ac3277e74476e5056e58f34ec2eb5... |
from __future__ import unicode_literals
from collections import namedtuple
import itertools
import six
from .exceptions import InvalidParametersException
UrlParameter = UP = namedtuple('UrlParameter', ['url_component', 'required'])
UP.__new__.__defaults__ = (False, )
VariableParameter = VP = namedtuple('VariablePar... | {
"content_hash": "f011791d767bf3634c1af8c73f789db5",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 100,
"avg_line_length": 36.039800995024876,
"alnum_prop": 0.577167310877968,
"repo_name": "merll/server-side-tracking",
"id": "e130d9714db518497b698d585a92c5efa1850aa4",
"... |
import os, inspect
from compiler.error import AssemblerError, ParseError, ExtensionError
from compiler.executor import Executor
from compiler.tokenizer import Tokenizer, Token
from compiler.token import TokenType, SYMBOLS, KEYWORDS
from compiler.assembler import Assembler
from compiler.expression import Stack, Expressi... | {
"content_hash": "e7865f855d7b0c0552bcc4a4eee66793",
"timestamp": "",
"source": "github",
"line_count": 430,
"max_line_length": 100,
"avg_line_length": 33.6,
"alnum_prop": 0.533014950166113,
"repo_name": "Syntox32/LittleMan",
"id": "edacee31f97cd7f1bd8edfe898e472c019833028",
"size": "14472",
"bin... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('planilla', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='planilla',
name='curso',
field=m... | {
"content_hash": "f8e6cf48f62bd8dea9ee25a7b0ddc6ac",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 54,
"avg_line_length": 20.72222222222222,
"alnum_prop": 0.5844504021447721,
"repo_name": "matt987/presente",
"id": "8a2363574c339a40723bb14a449c92556aff7b50",
"size": "397"... |
from django import template
register = template.Library()
@register.filter
def tohex(value):
"""Return repr in hex"""
try:
value = int(value)
except TypeError:
return "Unrecognized Number"
return "%x" % value
@register.filter
def tohexpair(value):
"""Return hex in couples"""
... | {
"content_hash": "c8423acdb058f19bda0c785840acfec6",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 65,
"avg_line_length": 21.36842105263158,
"alnum_prop": 0.6305418719211823,
"repo_name": "fim/keymaker",
"id": "009400624eae956b47feba0cbac4aa0f320d8246",
"size": "406",
... |
"""
logbook.compat
~~~~~~~~~~~~~~
Backwards compatibility with stdlib's logging package and the
warnings module.
:copyright: (c) 2010 by Armin Ronacher, Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
import collections
import logging
import sys
import warnings
from datetime imp... | {
"content_hash": "8b52151514afee6cf99892da2c079acd",
"timestamp": "",
"source": "github",
"line_count": 297,
"max_line_length": 88,
"avg_line_length": 34.78787878787879,
"alnum_prop": 0.6006581494386373,
"repo_name": "pombredanne/logbook",
"id": "b65ac006043f0ada51b2c6b8e19e1c8d435828da",
"size": "... |
"""Kraken Softimage Plug-in."""
import os
def dccTest():
"""Returns true or false after checking if the `KRAKEN_DCC` environment
variable is set to use this plugin.
.. note::
The variable value to activate the Softimage plugin is: `Softimage`.
Returns:
bool: True if the environment ... | {
"content_hash": "b36944a797a7eb97a5e8182cb8d5a460",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 76,
"avg_line_length": 22.5,
"alnum_prop": 0.6383838383838384,
"repo_name": "oculusstorystudio/kraken",
"id": "3c47d6960c9097c90aac4839a75d4a7472197e86",
"size": "495",
"... |
import numpy as np
import pytest
import coremltools as ct
from coremltools.converters.mil.mil import Builder as mb
from coremltools.converters.mil.testing_utils import get_op_types_in_program
from .compression_passes import (WeightAffineQuantizer, WeightPalettizer,
WeightSparsifier)
... | {
"content_hash": "a80058d75267bb89f4517b8c92ad3411",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 109,
"avg_line_length": 36.76470588235294,
"alnum_prop": 0.6488,
"repo_name": "apple/coremltools",
"id": "b0f66d317598149460223910723ee8e24c1cd615",
"size": "2720",
"bina... |
from compileall import compile_file
from fnmatch import fnmatch
import os
from fabric.api import task
@task
def clean(directory):
"""
Clean project python compiled files
"""
for root, paths, files in os.walk(directory):
for file in files:
if fnmatch(file, '*.pyc'):
... | {
"content_hash": "dbfb4116895598e8f113d38dff8733c8",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 71,
"avg_line_length": 23.323529411764707,
"alnum_prop": 0.5397225725094578,
"repo_name": "kpachnis/dj-fabric-tasks",
"id": "8ab27d6c66674ab592a5a1ca46d3c2460dfb0619",
"siz... |
import requests
from apps.core.models import UserProfile
from django.conf import settings
from social.exceptions import AuthFailed
USER_INFO_LI_REQUEST_URL = ('https://api.linkedin.com/v1/people/~:('
'id,'
'firstName,'
'lastName,'
... | {
"content_hash": "653ac776e8f4f609eb11c21ad063604d",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 76,
"avg_line_length": 39.705882352941174,
"alnum_prop": 0.5955555555555555,
"repo_name": "cgvt/website",
"id": "f648a48985663147bbaeea1e9bfabaa2a8b13cd0",
"size": "1350",
... |
from .macro import WrappedMacroBuilder
class G4Run(WrappedMacroBuilder):
def __init__(self, events):
super(G4Run, self).__init__()
self.events = events
self.add_command("/run/beamOn %d" % self.events)
def add_scorer(self, scorer):
# TODO: type checking?
self.wrap(score... | {
"content_hash": "ee59c6875dff2c227bc92bb031c6f3c3",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 56,
"avg_line_length": 26.833333333333332,
"alnum_prop": 0.6211180124223602,
"repo_name": "janpipek/pyg4app",
"id": "dae56eca9e4135f258f6487d8ed26691c780b4f5",
"size": "322... |
from datetime import datetime
import os.path
import stat
import shutil
import tempfile
import unittest
from StringIO import StringIO
try:
from svn import core, repos
has_svn = True
except:
has_svn = False
from trac.log import logger_factory
from trac.test import TestSetup
from trac.core import TracError
... | {
"content_hash": "ba63394d227c2e34929d008aab319348",
"timestamp": "",
"source": "github",
"line_count": 820,
"max_line_length": 86,
"avg_line_length": 44.886585365853655,
"alnum_prop": 0.6030918031896106,
"repo_name": "dokipen/trac",
"id": "c3c014a28ddc01ad316578ac4456cf48e5be0757",
"size": "37503"... |
import os
import djcelery
from gork.settings.base import *
djcelery.setup_loader()
CELERYBEAT_SCHEDULER = "djcelery.schedulers.DatabaseScheduler"
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '%s/../test.db' % PROJECT_ROOT,
}
}
... | {
"content_hash": "c44ef4f857010436cd28a4a97b338a47",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 79,
"avg_line_length": 20.666666666666668,
"alnum_prop": 0.6360448807854138,
"repo_name": "indexofire/gork",
"id": "24e77bdea5e20fe3352c3ca188167dbc3fa02b47",
"size": "1450... |
import sqlite3
from abc import ABCMeta
class Database:
__metaclass__ = ABCMeta
_sql_table = u'''TABLE DEFINITION'''
def __init__(self, database_file, database_name):
self._connection = sqlite3.connect(database_file, detect_types=sqlite3.PARSE_DECLTYPES)
self._database_name = database_nam... | {
"content_hash": "bb562cd01905a994643f25b4c48f71fa",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 95,
"avg_line_length": 34.476190476190474,
"alnum_prop": 0.6339779005524862,
"repo_name": "Staubteufel/AliCouponHunter",
"id": "927182445496216a1cf56347890be6ab4125e5c8",
"... |
"""typy fragments"""
import inspect
from ._errors import TyError, FragmentError
__all__ = ('Fragment', 'is_fragment')
class Fragment(object):
def __init__(self):
raise NotImplementedError()
@classmethod
def init_idx(cls, ctx, idx_ast):
raise FragmentError(cls.__name__ + " does not imple... | {
"content_hash": "f0db078aed9d2d4b382d7305f9817a23",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 102,
"avg_line_length": 31.743589743589745,
"alnum_prop": 0.6163166397415186,
"repo_name": "cyrus-/typy",
"id": "5911a890477feec6ce444eb4341ac75002bde3ce",
"size": "6190",... |
"""
constants.py
author: Kevin Jamieson, kevin.g.jamieson@gmail.com,
Lalit Jain, lalitkumarj@gmail.com
last updated: 2/21/2015
Main configuration file for next_backend. Feel free to adjust by hand, but it
should be adjusted through docker environment variables. To allow for fig
usage and docker linking, we use the... | {
"content_hash": "f0eca4976dd716ada511edd2746118e8",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 112,
"avg_line_length": 36.53763440860215,
"alnum_prop": 0.7195409064155386,
"repo_name": "crcox/NEXT",
"id": "97413ba280d00c2c4838f0e6aa6755011d6e85f5",
"size": "3398",
... |
"""Datastore backed Blobstore API stub.
Class:
BlobstoreServiceStub: BlobstoreService stub backed by datastore.
"""
import base64
import os
import time
import urlparse
from google.appengine.api import apiproxy_stub
from google.appengine.api import blobstore
from google.appengine.api import datastore
from... | {
"content_hash": "8163bcefbf93f00a0288b5e7910a106c",
"timestamp": "",
"source": "github",
"line_count": 429,
"max_line_length": 80,
"avg_line_length": 33.47552447552447,
"alnum_prop": 0.661653088225054,
"repo_name": "GoogleCloudPlatform/python-compat-runtime",
"id": "c3e70726f60f86ba795504f582b04bb96... |
"""This module contains functions and methods that relate to the DataInfo class
which provides a container for informational attributes as well as summary info
methods.
A DataInfo object is attached to the Quantity, SkyCoord, and Time classes in
astropy. Here it allows those classes to be used in Tables and uniformly... | {
"content_hash": "3f87858735ce6286a61e220ce1aecfa3",
"timestamp": "",
"source": "github",
"line_count": 532,
"max_line_length": 88,
"avg_line_length": 34.494360902255636,
"alnum_prop": 0.5793689717181625,
"repo_name": "tbabej/astropy",
"id": "922b015329eedf5b65418b593d7578f7a16fe0df",
"size": "1844... |
from settings import url
from mood import MoodSpinner
from need import NeedCheckBoxes
from gender import GenderRadioBox
from kivy.layout.box import BoxLayout
from kivy.uix.checkbox import CheckBox
from kivy.properties import BooleanProperty, StringProperty
class HomelessWidget(BoxLayout):
handicaped = BooleanP... | {
"content_hash": "ace68ac3d8634f4d9dfb7e4e6882aa4d",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 68,
"avg_line_length": 27,
"alnum_prop": 0.7244444444444444,
"repo_name": "b3j0f/simpleneed",
"id": "30453c3685d2c79e3d0690d9c8524f425ba2f601",
"size": "675",
"binary": f... |
from django.utils import timezone
from django.test import TestCase
from breach.models import Target, Victim, Round, SampleSet
class RuptureTestCase(TestCase):
def setUp(self):
target = Target.objects.create(
endpoint='https://di.uoa.gr/?breach=%s',
prefix='test',
alphab... | {
"content_hash": "b43fe5c712d4296ebe95518bcfd9b54e",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 67,
"avg_line_length": 30.042857142857144,
"alnum_prop": 0.5359010936757014,
"repo_name": "dionyziz/rupture",
"id": "59fe77fe578c248f5694d83babcd5513468871cb",
"size": "210... |
import os
import sys
if os.environ.get('SERVER_SOFTWARE', '').startswith('Google App Engine'):
sys.path.insert(0, 'lib.zip')
else:
import re
from google.appengine.tools.devappserver2.python import stubs
re_ = stubs.FakeFile._skip_files.pattern.replace('|^lib/.*', '')
re_ = re.compile(re_)
stubs.FakeFile._... | {
"content_hash": "2e5b1dc405842f0ec56290d0622d56f5",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 73,
"avg_line_length": 27.3,
"alnum_prop": 0.7124542124542125,
"repo_name": "terradigital/gae-init",
"id": "142d4705af712c74c2af22c64a4bc67e59c8026e",
"size": "563",
"bin... |
import pandas as pd
import os
import shutil
import tensorflow as tf
from sklearn.preprocessing import MinMaxScaler
TRAIN = ""
TEST = ""
def Create_scale_data_files(trainPath,testPath , trunck=False):
# check if fiels are not created yet
train_p , train_n = os.path.split(trainPath)
test_p ,test_n = o... | {
"content_hash": "9c29c818b50b582f494f5458efc5a82f",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 120,
"avg_line_length": 35.44897959183673,
"alnum_prop": 0.5889464594127807,
"repo_name": "motkeg/Deep-learning",
"id": "ee7fc65dbb01f243dbac050361cfbc91a546cb04",
"size": ... |
import django.contrib.postgres.fields.jsonb
import django.db.models.deletion
from django.db import migrations, models
import waldur_core.core.fields
import waldur_mastermind.invoices.models
class Migration(migrations.Migration):
dependencies = [
('structure', '0010_customer_geolocation'),
('invo... | {
"content_hash": "a5fababab005d6d363f7562cf78fad5a",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 77,
"avg_line_length": 32.827586206896555,
"alnum_prop": 0.4096638655462185,
"repo_name": "opennode/waldur-mastermind",
"id": "59787dc6104c7b3b875382de16e646c3aa387465",
"s... |
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # FIXME
import settings
from rain import Measurement, build_timestamp, get_prediction_data, AmbientDataFetcher
from utils import tweet_status
from weatherchecks import does_it_snow, does_it_rain
from datastorage import Da... | {
"content_hash": "a8e5cf48eb1d28202d1984376075939e",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 123,
"avg_line_length": 35.280575539568346,
"alnum_prop": 0.6392740619902121,
"repo_name": "chrigu/schifftszbaern",
"id": "ba5c44f26f089054fe6935f5dd188711e8653f95",
"size... |
"""
Validation errors, and some surrounding helpers.
"""
from __future__ import annotations
from collections import defaultdict, deque
from pprint import pformat
from textwrap import dedent, indent
import heapq
import itertools
import attr
from jsonschema import _utils
WEAK_MATCHES: frozenset[str] = frozenset(["any... | {
"content_hash": "d7327b57d34be1bf7aa772de64ab21c7",
"timestamp": "",
"source": "github",
"line_count": 396,
"max_line_length": 79,
"avg_line_length": 28.626262626262626,
"alnum_prop": 0.5821277346506705,
"repo_name": "python-poetry/poetry-core",
"id": "87db3df3a6dde1bbc0aae1128ca21f365e774666",
"s... |
import copy
import uuid
import ldap
from keystone import assignment
from keystone.common import cache
from keystone.common import ldap as common_ldap
from keystone.common import sql
from keystone import config
from keystone import exception
from keystone import identity
from keystone.openstack.common.db.sqlalchemy im... | {
"content_hash": "ccda0fbe0a822a0ae837f6116a436b96",
"timestamp": "",
"source": "github",
"line_count": 1414,
"max_line_length": 79,
"avg_line_length": 44.15205091937765,
"alnum_prop": 0.5924941135013054,
"repo_name": "dsiddharth/access-keys",
"id": "0d8bc66528c170b792f8da7c7a60f9e4f1e674a1",
"size... |
import sys
sys.path.append('..')
from deepgraph.graph import *
from deepgraph.solver import *
from deepgraph.nn.core import *
from deepgraph.nn.loss import *
from deepgraph.nn.conv import *
from deepgraph.nn.init import *
from deepgraph.utils.datasets import *
from theano.tensor.nnet import relu
data = load_data("..... | {
"content_hash": "22ec6a905ebe83962fbe26ec1b90c0cd",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 92,
"avg_line_length": 28.208791208791208,
"alnum_prop": 0.6408258667705493,
"repo_name": "sebastian-schlecht/deepgraph",
"id": "83e29d596c5add82b1d2b35081000f03e1fabd70",
... |
"""
=======================
YAML-formatted data I/O
=======================
This module handles input from YAML formatted data. Because this code is in
bad need of cleanup and because in the long run, I (Stephen Edie) hope to
replace the input mechanism with something cleaner and faster (not involving
YAML), the docu... | {
"content_hash": "143635d9e66ee18e2e93a67bd32b6a83",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 76,
"avg_line_length": 22.083333333333332,
"alnum_prop": 0.6471698113207547,
"repo_name": "VlachosGroup/VlachosGroupAdditivity",
"id": "530f8a0e0eeb27009b925e1310d8d31023d27f... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class DeleteWordList(Choreography):
def __init__(self, temboo_session):
"""
Create ... | {
"content_hash": "b822a8262fed1dfb286d52643f74873b",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 123,
"avg_line_length": 39.59154929577465,
"alnum_prop": 0.6929918178584134,
"repo_name": "lupyuen/RaspberryPiImage",
"id": "bd3734b2057e56f6d92d5a38280d551ddc78bf74",
"siz... |
"""Split RR7 products, for some reason!"""
# stdlib
import sys
import re
# 3rd Party
from pyiem.util import get_dbconn, utc
def main():
"""Go"""
pgconn = get_dbconn("afos")
acursor = pgconn.cursor()
payload = getattr(sys.stdin, "buffer", sys.stdin).read()
payload = payload.decode("ascii", error... | {
"content_hash": "ffe11e8cd967daf2327e8aa9eec5bbe2",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 74,
"avg_line_length": 22.805555555555557,
"alnum_prop": 0.584652862362972,
"repo_name": "akrherz/pyWWA",
"id": "69404658e18e5b3f720ed4e837ee4874abfcd1ae",
"size": "821",
... |
class PossibleApp(object):
"""A factory class that can be used to create a running instance of app.
Call Create() to launch the app and begin manipulating it.
"""
def __init__(self, app_type, target_os):
self._app_type = app_type
self._target_os = target_os
self._platform = None
self._platform... | {
"content_hash": "664b4e2500f9021e9d8bd8636acd8760",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 74,
"avg_line_length": 24.42105263157895,
"alnum_prop": 0.6745689655172413,
"repo_name": "cricketclubucd/davisdragons",
"id": "ee53f5bc1d3c188bfbf2d5a14cd65d9c34663b2c",
"s... |
from __future__ import unicode_literals
from django.db import models, migrations
import autoslug.fields
class Migration(migrations.Migration):
dependencies = [
('blog', '0002_auto_20141010_1432'),
]
operations = [
migrations.AddField(
model_name='category',
name=... | {
"content_hash": "c1c9d99883a038e9f643988f831b8843",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 96,
"avg_line_length": 23.9,
"alnum_prop": 0.6192468619246861,
"repo_name": "sai-prasanna/simple-django-blog",
"id": "03a16f77d7739abd5dbeb87a17df171e6aff579e",
"size": "50... |
from cattle import concurrency # NOQA
import sys
import os
import logging
from logging.handlers import RotatingFileHandler
import argparse
_LOG_SIZE = 2097152
_LOG_COUNT = 2
if __name__ == '__main__':
dist = os.path.join(os.path.dirname(__file__), "dist")
if os.path.exists(dist):
sys.path.insert(0, ... | {
"content_hash": "cd9a2f03ef27dab2d4c8eb5d47594938",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 72,
"avg_line_length": 27.067961165048544,
"alnum_prop": 0.6276901004304161,
"repo_name": "cloudnautique/cloud-cattle",
"id": "33356902ec1b09797a5a5fbafa407816f205e08c",
"... |
"""
A platform independent file lock that supports the with-statement.
.. autodata:: filelock.__version__
:no-value:
"""
from __future__ import annotations
import sys
import warnings
from ._api import AcquireReturnProxy, BaseFileLock
from ._error import Timeout
from ._soft import SoftFileLock
from ._unix import ... | {
"content_hash": "31c05a25afd607f724f531ecfc5f2668",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 102,
"avg_line_length": 25.958333333333332,
"alnum_prop": 0.6958266452648475,
"repo_name": "pybuilder/pybuilder",
"id": "afcdb706d7a5e1ff89a9271bc19938616d537909",
"size": ... |
"""This module provides the components needed to build your own __import__
function. Undocumented functions are obsolete.
In most cases it is preferred you consider using the importlib module's
functionality over this module.
"""
# (Probably) need to stay in _imp
from _imp import (lock_held, acquire_lock, release_lo... | {
"content_hash": "b4fa9caba5396f54b6247d02cbc9daa3",
"timestamp": "",
"source": "github",
"line_count": 283,
"max_line_length": 83,
"avg_line_length": 34.371024734982335,
"alnum_prop": 0.6166341112367636,
"repo_name": "timm/timmnix",
"id": "408838387befba18d0f5014418727b3b824231c9",
"size": "9727",... |
import collectd
# Function to split DataType definition into string (used in map function)
def split_to_value(item):
return item.split(":")[0]
# Read types.db to memory
def read_types_from_file():
global data_sources
data_sources = {}
types_file = open('./collectd_plugin/types.db', 'r')
for str ... | {
"content_hash": "f241938085bb024a288bcd922f2c4e7b",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 193,
"avg_line_length": 26.38095238095238,
"alnum_prop": 0.644404332129964,
"repo_name": "ngmon/ngmon",
"id": "1d58aebb6b6f1dcc9c2854cd5a7acb8dfb699b6c",
"size": "1108",
... |
from __future__ import print_function
import sys
import os
import gui_menu
from multiprocessing import Process, Pipe
import util
import conf
import filters
import threading
import time
# OSX has an error when launching GUI subprocesses
# If use_config_gui is false, the program will just watch ~/.headmouse
use_config_g... | {
"content_hash": "49fdfc571a2b81fe1422ce05f6931cfb",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 113,
"avg_line_length": 36.239263803680984,
"alnum_prop": 0.5994582698493313,
"repo_name": "aranchelk/headmouse",
"id": "9854ce22ae4c3f37e386d074882768dbd428b3a9",
"size":... |
import sys
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.paging i... | {
"content_hash": "d33c1976e97abaaa59a75f4bc6419089",
"timestamp": "",
"source": "github",
"line_count": 564,
"max_line_length": 186,
"avg_line_length": 46.31382978723404,
"alnum_prop": 0.6632211630488879,
"repo_name": "Azure/azure-sdk-for-python",
"id": "308a562b141564a5d5b6b29318c40d319a6f38c0",
"... |
import os
import sys
from django.utils.importlib import import_module
def setup_environ(dunder_file=None, project_path=None, relative_project_path=None, settings_path=None):
assert not (dunder_file and project_path), ("You must not specify both "
"__file__ and project_path")
if dunder_file is no... | {
"content_hash": "4f0a26ec09b80048c59e1edd01c7374e",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 103,
"avg_line_length": 37.80555555555556,
"alnum_prop": 0.6700955180014695,
"repo_name": "zhiwehu/IBookmark",
"id": "10c90429a6adb8484418adb0086125119b848f6b",
"size": "13... |
import artistools.makemodel.botyanski2017 | {
"content_hash": "4bd2cadac8581ce2e5906ddcba1e21cc",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 41,
"avg_line_length": 41,
"alnum_prop": 0.926829268292683,
"repo_name": "lukeshingles/artistools",
"id": "8eceb50b381a86e0da6e4cb1446f4846a108ade1",
"size": "65",
"binary... |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('order', '0032_auto_20200427_0044'),
]
operations = [
mig... | {
"content_hash": "73a0a96a45b030f73e8a37e7e6599edf",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 152,
"avg_line_length": 35.333333333333336,
"alnum_prop": 0.652122641509434,
"repo_name": "inventree/InvenTree",
"id": "2c3abbb0d0d36219b90fccb45131d8ccb71d65c0",
"size": "... |
import rosunit
import unittest
import re
from flexbe_core.core.user_data import UserData
from .logger import Logger
from .test_interface import TestInterface
from .test_context import TestContext, LaunchContext
from .data_provider import DataProvider
class Tester(object):
def __init__(self):
self._test... | {
"content_hash": "f017671f3eb59f931c71f09462108a9d",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 116,
"avg_line_length": 43.298780487804876,
"alnum_prop": 0.5414730319673285,
"repo_name": "team-vigir/flexbe_behavior_engine",
"id": "8a386328b3b988e6eb84c5c521757a75578df5... |
"""Tests for the Zsh extended_history parser."""
import unittest
from plaso.lib import timelib
from plaso.parsers import zsh_extended_history
from tests import test_lib as shared_test_lib
from tests.parsers import test_lib
class ZshExtendedHistoryTest(test_lib.ParserTestCase):
"""Tests for the Zsh extended_histor... | {
"content_hash": "37b6928bad0422a3f6588c14f19be650",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 76,
"avg_line_length": 34.92727272727273,
"alnum_prop": 0.7225403435710568,
"repo_name": "dc3-plaso/plaso",
"id": "11c9a170bd53485d47507dfdb6ba191d20a39285",
"size": "1963"... |
"""
Convert MBGA avatars from GIF -> PNG format so OpenCV can load them.
Requires ImageMagick to be installed (www.imagemagick.org)
"""
import os
import glob
def convert():
gifs = glob.glob(os.path.join("data/mbga/avatar/", "*.gif"))
for gif in gifs:
png = gif.replace(".gif", ".png")
# only save the first ... | {
"content_hash": "ee8414e85dd9c876ae4b6c2f5b629b2c",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 68,
"avg_line_length": 26.941176470588236,
"alnum_prop": 0.6441048034934498,
"repo_name": "6/jcrawler",
"id": "8fc70ec4a83783e049c7dd822dc2b02c0008f288",
"size": "458",
"... |
"""Tests the RelationshipUtil."""
from tests.unittest_utils import ForsetiTestCase
import unittest.mock as mock
import unittest
from google.cloud.forseti.common.util import relationship
class RelationshipUtilTest(ForsetiTestCase):
"""Test relationship_util."""
def test_get_resource_ancestors_from_full_name... | {
"content_hash": "276fd8d91ea7fcebbbf6d74aaf86f299",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 71,
"avg_line_length": 37.03508771929825,
"alnum_prop": 0.6475603979156798,
"repo_name": "forseti-security/forseti-security",
"id": "60a7c3c005da795f7aeac80bc936da0ac589a80d"... |
import ddt
from django.urls import reverse
from unittest import mock
from horizon import exceptions as horizon_exceptions
from manila_ui.api import manila as api_manila
from manila_ui.tests.dashboards.project import test_data
from manila_ui.tests import helpers as test
INDEX_URL = reverse('horizon:project:user_messa... | {
"content_hash": "052bfe1d45b9df34ec03275ec08f1fc3",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 79,
"avg_line_length": 38.355555555555554,
"alnum_prop": 0.6286210892236385,
"repo_name": "openstack/manila-ui",
"id": "5fbee91270d863f4946bd5c1a20b487ebd87266f",
"size": "... |
import eventlet
from eventlet import semaphore
import netaddr
from oslo.config import cfg
from quantum.agent.common import config
from quantum.agent.linux import external_process
from quantum.agent.linux import interface
from quantum.agent.linux import ip_lib
from quantum.agent.linux import iptables_manager
from quant... | {
"content_hash": "e6e33812ab350778d10234b1be322d83",
"timestamp": "",
"source": "github",
"line_count": 737,
"max_line_length": 79,
"avg_line_length": 43.43962008141113,
"alnum_prop": 0.5420896454786819,
"repo_name": "yamt/neutron",
"id": "368cfb5c6eef7a3619f29ada1f05fd13ad06e782",
"size": "32739",... |
import re
from SCons.Script import *
def do_subst_in_file(targetfile, sourcefile, dict):
"""Replace all instances of the keys of dict with their values.
For example, if dict is {'%VERSION%': '1.2345', '%BASE%': 'MyProg'},
then all instances of %VERSION% in the file will be replaced with 1.2345 etc.
""... | {
"content_hash": "a2629a3615918e0be0d5cb37103a1d9d",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 84,
"avg_line_length": 34.725806451612904,
"alnum_prop": 0.6000928936367859,
"repo_name": "pquerna/ckl",
"id": "042035a8d8d37c84a9c6d286a185b3416298c1f9",
"size": "2277",
... |
import csv
import argparse
import sys
from agoTools.admin import Admin
from agoTools.admin import AGOLItems
def _raw_input(prompt=None, stream=None, input=None):
# A raw_input() replacement that doesn't save the string in the
# GNU readline history.
if not stream:
stream = sys.stderr
if not in... | {
"content_hash": "de937cb2d2266890b5aea3bfdd69a836",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 76,
"avg_line_length": 24.910714285714285,
"alnum_prop": 0.657347670250896,
"repo_name": "ecaldwell/ago-tools",
"id": "a53da158c7b5c9961656b0c0e0910b3548ecda2e",
"size": "1... |
"""Telegram platform for notify component."""
import logging
import voluptuous as vol
from homeassistant.components.notify import (
ATTR_DATA,
ATTR_MESSAGE,
ATTR_TARGET,
ATTR_TITLE,
PLATFORM_SCHEMA,
BaseNotificationService,
)
from homeassistant.components.telegram_bot import (
ATTR_DISABLE... | {
"content_hash": "2069eb24e960161e276e08e8646819b2",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 88,
"avg_line_length": 36.8515625,
"alnum_prop": 0.6302734789060844,
"repo_name": "toddeye/home-assistant",
"id": "b87ddc670c359dc37606f765fe08819f9cfffa29",
"size": "4717... |
from swgpy.object import *
def create(kernel):
result = Ship()
result.template = "object/ship/shared_blacksun_medium_s02_tier3.iff"
result.attribute_template_id = -1
result.stfName("","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "90128635338efed90671775513f30889",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 69,
"avg_line_length": 21.307692307692307,
"alnum_prop": 0.6714801444043321,
"repo_name": "anhstudios/swganh",
"id": "ae2b9a456ac107e190fd8f6df7d6f2147d9f8c86",
"size": "42... |
matches_payouts_probabilities_file = open('matching_bonus.csv', 'r')
line = matches_payouts_probabilities_file.readline()
expected_value = 0.0
while line:
tokens = line.split(',')
if len(tokens) != 3 or len(tokens[1]) < 1:
break
payout = float(tokens[1])
probability = float(tokens[2])
expect... | {
"content_hash": "9849214214ea759dfaec1c47c93a92db",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 68,
"avg_line_length": 36.07142857142857,
"alnum_prop": 0.697029702970297,
"repo_name": "jhurt/slotmath",
"id": "056bdd817bfc6dfddc1e41ceca4a20f7ebb54c29",
"size": "505",
... |
import sys
from PyQt4 import QtGui, QtCore
class Button(QtGui.QPushButton):
def mouseMoveEvent(self, e):
if e.buttons() != QtCore.Qt.RightButton:
return
# write the relative cursor position to mime data
mimeData = QtCore.QMimeData()
# simple string with 'x,y'
m... | {
"content_hash": "69bafab9abd73ac7d393ef251e471603",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 91,
"avg_line_length": 29.058252427184467,
"alnum_prop": 0.5746742398930839,
"repo_name": "go2net/PythonBlocks",
"id": "7c3c04e0c134626f0c2fff253329d4c099a2915b",
"size": ... |
import json
import unittest
from stix import Entity, EntityList
from stix.utils import NamespaceInfo
import stix.bindings.stix_core as core_binding
from stix.core import STIXPackage
import stix.utils
import cybox.utils
def round_trip_dict(cls, dict_):
obj = cls.object_from_dict(dict_)
dict2 = cls.dict_from_ob... | {
"content_hash": "43350f2f8829355dbd33588bf2788cf2",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 79,
"avg_line_length": 26.05982905982906,
"alnum_prop": 0.6208592981305346,
"repo_name": "benjamin9999/python-stix",
"id": "f50a7226c4f23786f63628b38e27a3b5c7b658dc",
"siz... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2, 7):
pytestmark = pytest.mark.skip("F5 Ansible modules require Python >= 2.7")
from ansible.module_utils.basic import AnsibleModule
try:
from librar... | {
"content_hash": "7c36dca575bbc78c28bf39894eafba0b",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 77,
"avg_line_length": 28.95505617977528,
"alnum_prop": 0.5983701979045402,
"repo_name": "thaim/ansible",
"id": "6c7f325b0121359517f304acbadb8d193a5cbd3e",
"size": "5311",... |
import logging
from neutronclient.common import utils
from neutronclient.neutron import v2_0 as neutronv20
from neutronclient.neutron.v2_0.vpn import utils as vpn_utils
from neutronclient.openstack.common.gettextutils import _
class ListIPsecPolicy(neutronv20.ListCommand):
"""List ipsecpolicies that belongs to a... | {
"content_hash": "2238f54020b4d99302493419819d9ef5",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 76,
"avg_line_length": 36.333333333333336,
"alnum_prop": 0.5938073394495413,
"repo_name": "vijayendrabvs/ssl-python-neutronclient",
"id": "a8a43238cc6484c61c749d90a460e23fe8... |
"""Platform for shared base classes for sensors."""
from __future__ import annotations
from homeassistant.helpers.entity import DeviceInfo, EntityDescription
from homeassistant.helpers.update_coordinator import (
CoordinatorEntity,
DataUpdateCoordinator,
)
from .const import DOMAIN
class FlumeEntity(Coordin... | {
"content_hash": "735d365cc23e302caf7d1e7933db0989",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 70,
"avg_line_length": 31.03846153846154,
"alnum_prop": 0.6245353159851301,
"repo_name": "w1ll1am23/home-assistant",
"id": "7cd84127c647e7083584e5621876fa8faa4773c5",
"size... |
import pandas as pd
import tensorflow as tf
# Step 1 - Load and parse the data
# Importing of data
titanic_train = pd.read_csv('/Users/path/to/train.csv')
titanic_test = pd.read_csv('/Users/path/to/test.csv')
titanic_test_result = pd.read_csv('/Users/path/to/genderclassmodel.csv')
# dropping if tables
titanic_train = ... | {
"content_hash": "59591cc908dc7ca66c7231cfaddbfbcf",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 98,
"avg_line_length": 29.236842105263158,
"alnum_prop": 0.6801680168016802,
"repo_name": "bondenitrr2015/Machine-Learning",
"id": "2660bc5a2916efda8b79cd918033fb334ff59bd2"... |
import sys
import os
import importlib
import glob
# Imoprt and instantiate each Cmd object.
_this_dir = os.path.dirname(__file__)
_this_mod = os.path.basename(_this_dir)
def build_cmds(sub_parser):
cmd_objs = {}
imlist = glob.glob(os.path.join(_this_dir, "*.py"))
imlist.remove(os.path.join(_this_dir, "... | {
"content_hash": "655718753459d0b1f1426ec548b81a63",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 68,
"avg_line_length": 26.545454545454547,
"alnum_prop": 0.6015981735159818,
"repo_name": "jeffbuttars/pcm",
"id": "77f55f97bd24393cb3cd5e2146c9c988c2abb890",
"size": "876"... |
from PyQt4 import Qt, QtCore
class OkAddCase(Qt.QWidget):
def __init__(self, parent=None):
Qt.QWidget.__init__(self, parent)
self.nameEdit = Qt.QLineEdit(self)
self.nameEdit.setPlaceholderText("名称")
self.cateEdit = Qt.QLineEdit(self)
self.cateEdit.setPlaceholderText... | {
"content_hash": "35fa67b3ccf8dd2b39e7805a483e2440",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 92,
"avg_line_length": 33.86440677966102,
"alnum_prop": 0.58008008008008,
"repo_name": "ghold/OneKeySql",
"id": "294f7be2fb3a1afd79475636b9654c7fc1f294df",
"size": "2018",
... |
import requests as req
from requests.exceptions import ConnectionError as ce
from urllib3.exceptions import MaxRetryError,NewConnectionError
import asyncio
import concurrent.futures
import multiprocessing
from multiprocessing import Process
import os
import sys
import re
import bs4
from apikeys import apikey... | {
"content_hash": "f51c84ee00e86e3642bb516169777633",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 494,
"avg_line_length": 40.84615384615385,
"alnum_prop": 0.5637947269303202,
"repo_name": "Bharat123rox/DailyNews",
"id": "ca8438f3c292a4feb9cf22652b953d996452d7e6",
"size... |
"""This module contains a Google Cloud Text to Speech Hook."""
from typing import Dict, Optional, Sequence, Union
from google.api_core.retry import Retry
from google.cloud.texttospeech_v1 import TextToSpeechClient
from google.cloud.texttospeech_v1.types import (
AudioConfig,
SynthesisInput,
SynthesizeSpeec... | {
"content_hash": "9f38de62f8cb3fd0dda3383084d271c7",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 160,
"avg_line_length": 46.410526315789475,
"alnum_prop": 0.6965298253572239,
"repo_name": "bolkedebruin/airflow",
"id": "eae6702bdef83531ce5b3775cb12fc3aba62c134",
"size":... |
import sys
from tuple_normaliser import normalise_tuple
class DupeReader:
def __init__(self, truth_files):
self.dupes = set([])
for truth_file in truth_files:
with open(truth_file) as truth:
self.dupes.update(normalise_tuple(tuple(line.strip().split(' '))) for line in truth.readlines())
def ... | {
"content_hash": "cf78c7d280d4a889b49c7ebb3e78494d",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 115,
"avg_line_length": 32.26315789473684,
"alnum_prop": 0.6574225122349103,
"repo_name": "cronin101/TTS3",
"id": "399cea9422137ce4b8962a34d8d73c4c4138c5da",
"size": "1226"... |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Preferences(object):
def setupUi(self, Preferences):
Preferences.setObjectName("Preferences")
Preferences.resize(465, 374)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePol... | {
"content_hash": "613113eb0d3b117de8e98e1ce001004e",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 108,
"avg_line_length": 63.65882352941176,
"alnum_prop": 0.7229717242653854,
"repo_name": "scholer/cadnano2.5",
"id": "3767fa09086666b694392a2eda0c550b1b6df976",
"size": "5... |
import os
import signal
from unittest import mock
from django.db.backends.postgresql.client import DatabaseClient
from django.test import SimpleTestCase
class PostgreSqlDbshellCommandTestCase(SimpleTestCase):
def _run_it(self, dbinfo):
"""
That function invokes the runshell command, while mockin... | {
"content_hash": "21fb1bc0a2e0b83b1192b88244900cf0",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 86,
"avg_line_length": 34.80172413793103,
"alnum_prop": 0.4877384196185286,
"repo_name": "frankvdp/django",
"id": "8e5af5f1f352fde876276d923ad52a0549d0330c",
"size": "4039... |
__title__ = 'asana'
__license__ = 'MIT'
__copyright__ = 'Copyright 2016 Asana, Inc.'
from asana.version import __version__
from .client import Client
| {
"content_hash": "9cdffa4700b746efa9d65d52e973b2b4",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 44,
"avg_line_length": 25.166666666666668,
"alnum_prop": 0.6688741721854304,
"repo_name": "Asana/python-asana",
"id": "863b9d3120671c67cb8c0aabe30b9277caddce8d",
"size": "15... |
from pyvisdk.thirdparty import Enum
VAppAutoStartAction = Enum(
'guestShutdown',
'none',
'powerOff',
'powerOn',
'suspend',
)
| {
"content_hash": "8080855f9e1081fb08bcca427ae47e84",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 35,
"avg_line_length": 14.7,
"alnum_prop": 0.6326530612244898,
"repo_name": "xuru/pyvisdk",
"id": "4f31a9146a8cef3237f1238093ae5e14b3691b5e",
"size": "272",
"binary": fal... |
from builtins import object
import json
import sys
from nose.tools import assert_equal, assert_true
from desktop.lib.django_test_util import make_logged_in_client
from desktop.settings import BASE_DIR
from useradmin.models import User
from azure.conf import ABFS_CLUSTERS
from beeswax.server import dbms
from indexer.... | {
"content_hash": "8ca623766ca5058218e4ebac37027fe6",
"timestamp": "",
"source": "github",
"line_count": 987,
"max_line_length": 138,
"avg_line_length": 66.3920972644377,
"alnum_prop": 0.5897694150681377,
"repo_name": "kawamon/hue",
"id": "a905ffe516febdd86e88e2c8dc8932ec34739b90",
"size": "66345",
... |
import re
import json
import os.path
import logging
from datetime import datetime
from requests_oauthlib import OAuth1Session
from models import AirCondition, AirAverage
from leda import settings
# From https://twitter.com/Guangzhou_Air/following
CITYS = {
'Guangzhou_Air': 'Guangzhou',
'BeijingAir': 'Beijing'... | {
"content_hash": "02cd60048d40a66a56413cf6a7f063a9",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 120,
"avg_line_length": 33.583333333333336,
"alnum_prop": 0.554058844381425,
"repo_name": "banbanchs/leda",
"id": "d4330f1f698805e7b33ce8779710fabef67af313",
"size": "5658... |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.zone_hvac_air_loop_terminal_units import AirTerminalSingleDuctVavHeatAndCoolReheat
log = logging.getLogger(__name__)
class TestAirTerminalSingleDuctVavHeatAndCoolReheat(unittest... | {
"content_hash": "a0f96777d1f84d436a93d12e955f173f",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 161,
"avg_line_length": 53.05555555555556,
"alnum_prop": 0.7183246073298429,
"repo_name": "rbuffat/pyidf",
"id": "b9c98e91cad1ecb7e712b9efa4a10f200a0849e5",
"size": "4775",... |
from eventlet import greenthread
from oslo.config import cfg
import sqlalchemy as sa
from sqlalchemy.orm import exc
from neutron.db import model_base
from neutron.db import models_v2
from neutron.extensions import agent as ext_agent
from neutron import manager
from neutron.openstack.common.db import exception as db_e... | {
"content_hash": "7a244b3cc11e322f11331fcab3bd3f54",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 79,
"avg_line_length": 42.10204081632653,
"alnum_prop": 0.5984003877847794,
"repo_name": "noelbk/neutron-juniper",
"id": "9a574a3f27df477c41b77870fff2fdbae423ac23",
"size"... |
"""
Checks if all the libraries in setup.py are listed in installation.rst file
"""
import os
import re
import sys
from os.path import dirname
from typing import Dict, List, Set
from rich import print
from rich.console import Console
from rich.table import Table
AIRFLOW_SOURCES_DIR = os.path.join(dirname(__file__), ... | {
"content_hash": "05a9b85cf2fabf6ab36ff37780e1f663",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 102,
"avg_line_length": 35.11440677966102,
"alnum_prop": 0.6772052612525643,
"repo_name": "danielvdende/incubator-airflow",
"id": "5417b624fd9640c9911073a6c888d48a47ad6d90",... |
class ItemPedido(object):
def __init__(self, descricao, peso, preco):
self.descricao = descricao
self.peso = peso
self.preco = preco
def subtotal(self):
return self.peso * self.preco
| {
"content_hash": "2887e6ffa82af93c3a2b9702dfb0234a",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 47,
"avg_line_length": 25,
"alnum_prop": 0.6044444444444445,
"repo_name": "pythonprobr/metaprog101",
"id": "ab65bd0192d9cd5536e1d3c15dbb17de7a0771c2",
"size": "225",
"bina... |
from ._redis_management_client import RedisManagementClient
from ._version import VERSION
__version__ = VERSION
try:
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as... | {
"content_hash": "3b2c90c866fb539fee9270babcfe915c",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 82,
"avg_line_length": 25,
"alnum_prop": 0.6755555555555556,
"repo_name": "Azure/azure-sdk-for-python",
"id": "dfcf2b7ee7840cfa2d33946cc136251196bac514",
"size": "918",
"... |
from django.contrib import admin
# Register your models here.
from .models import Website, Article, Concept, ArticleConcept
admin.site.register(Website)
admin.site.register(Article)
admin.site.register(Concept)
admin.site.register(ArticleConcept) | {
"content_hash": "c11d86f89287d78f269d17bd22fdcdfb",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 61,
"avg_line_length": 27.555555555555557,
"alnum_prop": 0.8225806451612904,
"repo_name": "Soaring-Outliers/news_graph",
"id": "4f3bfc805607578a3d871aff7a66df1abe6a751a",
"s... |
"""
solc = Solidity compiler
You must install the solc binary first.
"""
from __future__ import print_function #This *must* be the first line
import sys
import os
import subprocess
# Contracts & related files
mul7 = 'mul7.sol'
abi_filename = 'test.abi'
evm_filename = 'test.binary'
def rm_temp_files():
try:
... | {
"content_hash": "3058967bcad89f992d3637332a3e8fe2",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 73,
"avg_line_length": 22,
"alnum_prop": 0.5417287630402384,
"repo_name": "joelcan/tools-eth-contract-dev",
"id": "2ca002b2396398ceea82f78627e84eb85034ac45",
"size": "1365"... |
"""
def myrange(start, stop, step):
while start < stop:
yield start
start += step
if timers[0].value == 50:
for value in myrange(0, 5, 1):
print(value)
"""
func_stack = slice(int, 0, 50)
FUNC_MYRANGE = 90
FUNC_MYRANGE_RETURN_1 = 91
FUNC_MYRANGE_RESUME_1 = 92
FUNC_MYRANGE_FRAME_SIZE =... | {
"content_hash": "ab1905ec65505b1614cc9d9305783034",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 102,
"avg_line_length": 29.443037974683545,
"alnum_prop": 0.6324161650902838,
"repo_name": "Perlence/porcupy",
"id": "ed391a87bd9925e714ddf190e1c02be743fdb383",
"size": "23... |
"""
Check current Husky battery status (via ROS)
usage:
./battery.py [<node IP> <master IP> | -m <metalog> [F]]
"""
import sys
import os
from huskyros import HuskyROS
# apyros should be common lib - now in katarina code
from apyros.sourcelogger import SourceLogger
from apyros.metalog import MetaLog, disableA... | {
"content_hash": "68d77f9968576bdba3561b713f35bd45",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 142,
"avg_line_length": 31.630434782608695,
"alnum_prop": 0.5972508591065292,
"repo_name": "robotika/husky",
"id": "f64e453df77282b8b4d8a7bce5b078b7e157e97b",
"size": "1473... |
import sys
import logging
import math
import json
from urlparse import urlparse
from django.conf import settings
from django.utils.html import strip_tags
from elasticsearch import Elasticsearch
from shapely.geometry import box
from hypermap.aggregator.utils import mercator_to_llbbox, get_date
REGISTRY_MAPPING_PRECI... | {
"content_hash": "8e8caf563b0eee3e86077b2bdb2f5907",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 109,
"avg_line_length": 37.99595141700405,
"alnum_prop": 0.4915290356952584,
"repo_name": "cga-harvard/HHypermap",
"id": "01c9fff68f3ab14ac39c1e1b68d9d27693522a19",
"size"... |
from base import *
########## IN-MEMORY TEST DATABASE
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": ":memory:",
"USER": "",
"PASSWORD": "",
"HOST": "",
"PORT": "",
},
}
########## CACHE CONFIGURATION
# See: https://docs.djangoproje... | {
"content_hash": "b62faa0a8483a7bfce500b5b8654e6b7",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 75,
"avg_line_length": 25.86111111111111,
"alnum_prop": 0.6493018259935553,
"repo_name": "GotlingSystem/apnea",
"id": "f6ee7b76472c009483cd06c4efaa79085adcea06",
"size": "1... |
import wx
from wx import Colour
from ..controller.cellinfo import CellType
# this import fails in HUDSON
# from wxPython._gdi import wxFONTWEIGHT_BOLD, wxFONTWEIGHT_NORMAL
# wxFONTWEIGHT_BOLD = 92
# wxFONTWEIGHT_NORMAL = 90
# DEBUG using wx.FONTWEIGHT_BOLD, wx.FONTWEIGHT_NORMAL
class Colorizer(object):
def __... | {
"content_hash": "9881f4cc795483519b52aaacd057ebfe",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 110,
"avg_line_length": 36.36893203883495,
"alnum_prop": 0.6364121729845168,
"repo_name": "HelioGuilherme66/RIDE",
"id": "b6e8656c48e4e12bf3b5db5d52087af3d524cc15",
"size"... |
import sys
import warnings
import platform
sys.path.append('.')
true = True
false = False
none = None
INT_SIZE = 4 # on all tested platforms
def get_dword_size():
# ugly but portable
(arch, exe) = platform.architecture()
if arch.startswith('64'):
return 8
else:
return 4
class jemal... | {
"content_hash": "b5c2cb3193aa69eed1d554f61d5a9c5a",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 96,
"avg_line_length": 27.886138613861387,
"alnum_prop": 0.5208592224391976,
"repo_name": "codercold/shadow",
"id": "5918b429ba63f776e8719bc0fc6919d007defce8",
"size": "56... |
"""
Functions used to load commonly available datasets.
"""
import cPickle
import gzip
import logging
import numpy as np
import os
import sys
import tarfile
import urllib2
logger = logging.getLogger(__name__)
def _valid_path_append(path, *args):
"""
Helper to validate passed path directory and append any s... | {
"content_hash": "64ecbd7e3ef6c4bb399c88b32b534fa5",
"timestamp": "",
"source": "github",
"line_count": 436,
"max_line_length": 89,
"avg_line_length": 30.21788990825688,
"alnum_prop": 0.5766223908918406,
"repo_name": "Bam4d/neon",
"id": "90cd7407fd8cdd4c5c53bb9aeee87e8a5e88560f",
"size": "13916",
... |
import _plotly_utils.basevalidators
class WidthsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="widthsrc", parent_name="scatterternary.marker.line", **kwargs
):
super(WidthsrcValidator, self).__init__(
plotly_name=plotly_name,
pa... | {
"content_hash": "19c447d52ce1a8968c0a674360b1c908",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 88,
"avg_line_length": 33.857142857142854,
"alnum_prop": 0.6012658227848101,
"repo_name": "plotly/python-api",
"id": "e109339b20e21a968be344e7687d9e73a46d1900",
"size": "47... |
from django.contrib import admin
from django.contrib.contenttypes import generic
from djangregator.models import *
class TimelineEntryAdmin(admin.ModelAdmin):
list_display = ('published', 'content_type')
date_hierarchy = 'published'
list_filter = ('content_type',)
class ActivityEntryAdmin(admin.ModelA... | {
"content_hash": "23555eccb1e9731b55c8b3c370c58d0c",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 56,
"avg_line_length": 29.86842105263158,
"alnum_prop": 0.7894273127753304,
"repo_name": "idan/djangregator",
"id": "ce14f6e3338975f5af9ad00f4ebbe596acd67b1e",
"size": "270... |
"""The io module provides the Python interfaces to stream handling. The
builtin open function is defined in this module.
At the top of the I/O hierarchy is the abstract base class IOBase. It
defines the basic interface to a stream. Note, however, that there is no
separation between reading and writing to streams; impl... | {
"content_hash": "4704861bf64541bb862d9597d117d235",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 80,
"avg_line_length": 37.13861386138614,
"alnum_prop": 0.7278059184217542,
"repo_name": "EnviroCentre/jython-upgrade",
"id": "4102ad62d568900ff6360f5f3de3c75e8dbec9e9",
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.