text stringlengths 4 1.02M | meta dict |
|---|---|
"""The common front-end functionality."""
import abc
import locale
import logging
import multiprocessing
import os
import pdb
import signal
import sys
import threading
import traceback
from dfvfs.lib import definitions as dfvfs_definitions
from dfvfs.path import factory as path_spec_factory
from dfvfs.resolver import... | {
"content_hash": "bfc3c8099041995debc46c343224b345",
"timestamp": "",
"source": "github",
"line_count": 1584,
"max_line_length": 80,
"avg_line_length": 36.23863636363637,
"alnum_prop": 0.6626249956447511,
"repo_name": "iwm911/plaso",
"id": "94557101bde9cb596be43639c8db2b262ad56bc5",
"size": "58100"... |
import os,re,copy
from waflib import Configure, TaskGen, Task, Logs, Errors
def configure(conf):
conf.env['CDS_LIB_PATH'] = conf.bldnode.make_node('cds.lib').abspath()
conf.env['CDS_HDLVAR_PATH'] = conf.bldnode.make_node('hdl.var').abspath()
conf.env['CDS_LIBS_FLAT'] = {}
conf.env['CDS_HDL_VIEW_MAP'] = {'.vams': ... | {
"content_hash": "3d7dbbff47f095857cca07bed0fc3d9b",
"timestamp": "",
"source": "github",
"line_count": 255,
"max_line_length": 134,
"avg_line_length": 33.54509803921569,
"alnum_prop": 0.6594575637128829,
"repo_name": "ahartel/brick",
"id": "0f6d83198cd4f338924e7229981790c17132d510",
"size": "8554"... |
"""Abstractions for the head(s) of a model.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import abc
import six
from tensorflow.contrib import framework as framework_lib
from tensorflow.contrib import layers as layers_lib
from tensorflow.contrib.lear... | {
"content_hash": "2a4a6554776fee62720a9004fcb663ce",
"timestamp": "",
"source": "github",
"line_count": 2101,
"max_line_length": 89,
"avg_line_length": 39.00428367444074,
"alnum_prop": 0.6428710889832576,
"repo_name": "Mazecreator/tensorflow",
"id": "a67694d1c93c9d01bf63fc216b83d87ab390c456",
"size... |
"""Trying to make a report that corresponds to
https://github.com/OpenTreeOfLife/germinator/wiki/Overview-of-repository-statistics
"""
import time
start_clock = time.time()
from peyotl.phylesystem.phylesystem_umbrella import Phylesystem
from peyotl.nexson_syntax import get_nexml_el
from peyotl import gen_otu_dict,... | {
"content_hash": "3bfc14358e4c16d0a3d4abb52293f04b",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 94,
"avg_line_length": 33.064935064935064,
"alnum_prop": 0.6182246661429693,
"repo_name": "OpenTreeOfLife/peyotl",
"id": "0fd8436424d6ce7f141fc38e84a759947ba49e8f",
"size":... |
from .workflow import * # noqa
from .share import * # noqa
from .feeds import * # noqa
| {
"content_hash": "13b3dcc153381573a9d1465e175e56b7",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 31,
"avg_line_length": 30,
"alnum_prop": 0.6666666666666666,
"repo_name": "aaxelb/SHARE",
"id": "f9313083fb246582600bbfe4f6dae5b70ac49630",
"size": "90",
"binary": false,
... |
from recipe_engine import recipe_api
from . import android
from . import chromebook
from . import chromecast
from . import default
from . import ios
from . import valgrind
from . import win_ssh
"""Abstractions for running code on various platforms.
The methods in this module define how certain high-level functions ... | {
"content_hash": "32934bbd93ba7dd1a68af777cf837e98",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 79,
"avg_line_length": 32.60679611650485,
"alnum_prop": 0.6543099598034837,
"repo_name": "rubenvb/skia",
"id": "4ba6ff7c8568effcbe4fcdc772e1af01c48c51ca",
"size": "6907",
... |
from oslo_serialization import jsonutils
from oslo_utils.fixture import uuidsentinel
import webob
from werkzeug import wrappers
from blazar.api import context as api_context
from blazar import exceptions
from blazar import tests
class ContextTestCase(tests.TestCase):
def setUp(self):
super(ContextTestCa... | {
"content_hash": "8d7f0bf22b8f884bf750086394e43973",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 77,
"avg_line_length": 37.01075268817204,
"alnum_prop": 0.5735037768739105,
"repo_name": "ChameleonCloud/blazar",
"id": "4206c6708bec62fc850833e13a6c957e417a535c",
"size": ... |
import base64
import getopt
import httplib
import json
import re
import os
import os.path
import sys
import StringIO
import urlparse
import xml.dom.minidom
import zipfile
from ApigeePlatformTools import httptools, deploytools
def printUsage():
print 'Usage: deploynodeapp -n [name] -o [organization] -e [environment]... | {
"content_hash": "89b0dce6e68920267a8eeea88a83c739",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 94,
"avg_line_length": 28.46766169154229,
"alnum_prop": 0.6186648025166026,
"repo_name": "r3mus/api-platform-tools",
"id": "ef73d715860d0ec3635bf536ed6739d93317d6e6",
"siz... |
from nose.tools import eq_
from standup.tests import BaseTestCase
class LandingsViewsTestCase(BaseTestCase):
def test_help_view(self):
response = self.client.get('/help')
eq_(response.status_code, 200)
| {
"content_hash": "4284668ff9f4aaa698d41efa73095386",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 43,
"avg_line_length": 28,
"alnum_prop": 0.7142857142857143,
"repo_name": "rehandalal/standup",
"id": "9ff44a95ed822ae3864341d5d884d98993ccc9e2",
"size": "224",
"binary": ... |
from abc import ABCMeta, abstractmethod
from datetime import datetime
from six import add_metaclass
from .base import LocatedDeployEntity
__author__ = 'y.gavenchuk'
@add_metaclass(ABCMeta)
class DataBase(LocatedDeployEntity):
DEFAULT_BACKUP_COUNT = 5
__slots__ = ('_host', '_user', '_port', '_db_name', '_pa... | {
"content_hash": "c2992064c1d8558fe79e00317d1c0648",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 77,
"avg_line_length": 28.10810810810811,
"alnum_prop": 0.5413461538461538,
"repo_name": "ygavenchuk/web-deploy",
"id": "49ae1d9f7a46b9aff015be189cb901a4f84512a7",
"size": ... |
from unittest import mock
from oslo_utils import timeutils
import pytz
from sqlalchemy.dialects.mysql import base as mysql_base
from sqlalchemy.dialects.sqlite import base as sqlite_base
from sqlalchemy import types
import testtools
from senlin.db.sqlalchemy import types as db_types
class DictTest(testtools.TestCas... | {
"content_hash": "1217e43805876e9712cdf8d522d9d8d6",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 66,
"avg_line_length": 33.06153846153846,
"alnum_prop": 0.6444858073522569,
"repo_name": "stackforge/senlin",
"id": "baac4653a98c29a67c4d4165f683bd0ad874c3ac",
"size": "48... |
"""
agentredrabbit - A general purpose transport agent between Redis and RabbitMQ
"""
__title__ = "agentredrabbit"
__version__ = "1.3"
__author__ = "Rohit Yadav"
__license__ = "MIT"
__copyright__ = "Copyright 2013 Rohit Yadav, Wingify"
| {
"content_hash": "4be75e984254a7fe1966cc60c0109311",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 77,
"avg_line_length": 29.5,
"alnum_prop": 0.673728813559322,
"repo_name": "lucknerjb/agentredrabbit",
"id": "8471c92836513bc203201416ddb887880d821cdd",
"size": "260",
"bi... |
import pickle
import os
import unittest
from ample.util import benchmark_util
@unittest.skip("not a regular test")
class Test(unittest.TestCase):
def test_benchmark(self):
pklfile = "/home/jmht/ample-dev1/examples/toxd-example/ROSETTA_MR_0/resultsd.pkl"
with open(pklfile) as f:
d = pic... | {
"content_hash": "b175f73e9d5662d66d2731347552e157",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 89,
"avg_line_length": 29.705882352941178,
"alnum_prop": 0.6396039603960396,
"repo_name": "rigdenlab/ample",
"id": "609ec8a37a7ee853625a4ce09a73b1694fb14e6c",
"size": "505"... |
"""
Copyright (c) <2014> <Solkeera/mScotty>
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, distr... | {
"content_hash": "cbe04b8a4c229f0052bc7b3f8c310134",
"timestamp": "",
"source": "github",
"line_count": 592,
"max_line_length": 152,
"avg_line_length": 34.652027027027025,
"alnum_prop": 0.5075558155406065,
"repo_name": "mScotty/pyitasa",
"id": "c5dee81aad8fb2bd57f70f5f06816392246842a0",
"size": "20... |
"""Remove year field from automobiles
Revision ID: 5ad1f9ba378e
Revises: 395cec770df2
Create Date: 2015-10-22 00:49:05.990505
"""
# revision identifiers, used by Alembic.
revision = '5ad1f9ba378e'
down_revision = '395cec770df2'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto ge... | {
"content_hash": "0d3b51ae6856cd179c07f4495c56141f",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 102,
"avg_line_length": 25.153846153846153,
"alnum_prop": 0.7018348623853211,
"repo_name": "richgieg/auto-store",
"id": "476395b8e1b1799d4145f72a2003efdb271677d6",
"size": ... |
"""A setuptools based setup module.
"""
from __future__ import print_function
import os
import fnmatch
import re
import sys
import subprocess
import yaml
# Always prefer setuptools over distutils
from setuptools import setup, Command
from setuptools_lint.setuptools_command import PylintCommand
from six import string... | {
"content_hash": "835560871b650c7cb7a5c7fbc62f31ca",
"timestamp": "",
"source": "github",
"line_count": 295,
"max_line_length": 107,
"avg_line_length": 34.81016949152542,
"alnum_prop": 0.574934268185802,
"repo_name": "git001/openshift-ansible",
"id": "c6a132ae20c11ba840985eb24e29ea2849a2a531",
"siz... |
import os
from flask import Flask, request, Response
from flask import render_template, url_for, redirect, send_from_directory
from flask import send_file, make_response, abort
from angular_flask import app, api_manager, lm
# routing for API endpoints, generated from the models designated as API_MODELS
from angular_... | {
"content_hash": "2a68aa4da6ba58f37dcffee696c7261e",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 79,
"avg_line_length": 29.683333333333334,
"alnum_prop": 0.6911847276810781,
"repo_name": "ben-h-johnson/duelysttrack",
"id": "38c8a157c742e71df54ad895bbef95fa85ce46cc",
"s... |
import re
import config
from article_builder import ArticleBuilder
from keyword_extractor import KeywordExtractor
from product_searcher import ProductSearcher
from table_builder import TableBuilder
from wordpress_uploader import WordPressUploader
class Manager(object):
MIN_PRODUCTS = 5
def __init__(self):
... | {
"content_hash": "646f77e5d189ec1434b2d4e20c6dadbc",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 103,
"avg_line_length": 36.629629629629626,
"alnum_prop": 0.6228513650151668,
"repo_name": "netarachelhershko/amazon_aotumation",
"id": "e30589fb7059605ea57659b97775e7b041d72... |
from functions import getSecret
def test_secrets():
access_token = getSecret('twitter-rob')
assert (len(access_token)) | {
"content_hash": "bb1c425805303cab3b5819e67ef2725f",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 43,
"avg_line_length": 19.571428571428573,
"alnum_prop": 0.6715328467153284,
"repo_name": "robertdenton/cascadiaquakes",
"id": "4c4aa03d7058d68cf558067e32158bebf3465e53",
"s... |
import logging
import os
import re
import unicodedata
from collections import defaultdict
from .base import Word, Sentence, Corpus, CorpusDirectoryIterator
from ..utils.setup_logging import setup_logging
setup_logging()
logger = logging.getLogger(__name__)
def _get_word(line):
word_info = line.split()
is_m... | {
"content_hash": "d7be68b8fcb8a850dbaed21b927791bd",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 109,
"avg_line_length": 36.344086021505376,
"alnum_prop": 0.6088757396449704,
"repo_name": "crscardellino/dnnwsd",
"id": "cb1432a0ecf4b7054c2d172933bc3baf196c7189",
"size":... |
"""Template config validator."""
import logging
import voluptuous as vol
from homeassistant.components.sensor import (
DEVICE_CLASSES_SCHEMA as SENSOR_DEVICE_CLASSES_SCHEMA,
DOMAIN as SENSOR_DOMAIN,
)
from homeassistant.config import async_log_exception, config_without_domain
from homeassistant.const import (... | {
"content_hash": "bdfeabf2872e4c85e7d219dc9e2a810d",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 211,
"avg_line_length": 32.07936507936508,
"alnum_prop": 0.6556160316674914,
"repo_name": "adrienbrault/home-assistant",
"id": "edef5673f31c97a8380a2fcb7ed3537b40ae224c",
... |
from solution import Solution
inpt = ["aa", "aab"]
sol = Solution()
result = sol.longestCommonPrefix(inpt)
print(result)
| {
"content_hash": "411133fe6582ab87bd30a36cb9b543e9",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 38,
"avg_line_length": 20.333333333333332,
"alnum_prop": 0.7295081967213115,
"repo_name": "zhlinh/leetcode",
"id": "02f3d91d04b3c51b13daaca256f4429db0386c1d",
"size": "169",... |
import praw
import time
import datetime
import sqlite3
'''USER CONFIGURATION'''
USERNAME = ""
#This is the bot's Username. In order to send mail, he must have some amount of Karma.
PASSWORD = ""
#This is the bot's Password.
USERAGENT = ""
#This is a short description of what the bot does. For example "/u/GoldenSight... | {
"content_hash": "2a52d516df241c8022e74cc40096252b",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 540,
"avg_line_length": 32.32663316582914,
"alnum_prop": 0.6817969842997047,
"repo_name": "tehp/reddit",
"id": "96a0d87f9cfbcd1cfbe005505739f0517d174a1b",
"size": "6450",
... |
"""Eager-graph unified check numerics callback."""
import collections
import threading
import numpy as np
from tensorflow.core.protobuf import debug_event_pb2
from tensorflow.python.debug.lib import op_callbacks_common
from tensorflow.python.debug.lib import source_utils
from tensorflow.python.eager import monitorin... | {
"content_hash": "fad177421d309cc505b432a8ebc18265",
"timestamp": "",
"source": "github",
"line_count": 453,
"max_line_length": 81,
"avg_line_length": 38.90286975717439,
"alnum_prop": 0.6572093287181524,
"repo_name": "tensorflow/tensorflow",
"id": "fe22b6b9f8f832c17deeb77981d33f4b04aeef87",
"size":... |
from django.conf.urls import patterns, url
from .feeds import FoiRequestFeed, FoiRequestFeedAtom
urlpatterns = patterns("froide.foirequest.views",
url(r"^(?P<obj_id>\d+)$", 'shortlink', name="foirequest-notsolonglink"),
url(r"^(?P<obj_id>\d+)/auth/(?P<code>[0-9a-f]+)/$", 'auth', name="foirequest-longerauth")... | {
"content_hash": "59cd7ee1bdc97a8fa4c931f55ec5dc2c",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 147,
"avg_line_length": 73.94736842105263,
"alnum_prop": 0.6185053380782918,
"repo_name": "catcosmo/froide",
"id": "bd6056c479279894e7813632c1f4b6674cbaf581",
"size": "2810... |
from graphql import build_schema, parse, validate
from ..fixtures import big_schema_sdl # noqa: F401
def test_validate_invalid_query(benchmark, big_schema_sdl): # noqa: F811
schema = build_schema(big_schema_sdl, assume_valid=True)
query_ast = parse(
"""
{
unknownField
..... | {
"content_hash": "1032b3774689d418e6db65df8e050412",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 86,
"avg_line_length": 33.15151515151515,
"alnum_prop": 0.5621572212065814,
"repo_name": "graphql-python/graphql-core",
"id": "dec9bbc6080f0d360e6e36ae016f3e33a7143e24",
"s... |
"""
Russian Wikipedia
+++++++++++++++++
"""
from revscoring.features import wikitext
from revscoring.features.modifiers import max
from revscoring.languages import russian
from . import wikipedia
cn_templates = wikitext.revision.template_names_matching(
r"Нет[ _]АИ",
name="ruwiki.revision.cn_templates")
# L... | {
"content_hash": "837bc7b8758797e751bc35a1d5c47ac2",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 77,
"avg_line_length": 30.72222222222222,
"alnum_prop": 0.7251356238698011,
"repo_name": "wiki-ai/wikiclass",
"id": "b10718752fd7902e44ef0ba2092a210ed5695226",
"size": "112... |
from random import Random
import scrapy
from scrapy.selector import Selector, HtmlXPathSelector
from selenium import webdriver
import time
from cwgooglelinkedin.items import GoogleLinkedIn
import urlparse
class GoogleLinkedInsBrowserSpider(scrapy.Spider):
name = "googlelinkedin_browser"
allowed_domains = [... | {
"content_hash": "35b5a7556790c32219ad6fcc454d9f2c",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 105,
"avg_line_length": 33.77358490566038,
"alnum_prop": 0.6206703910614525,
"repo_name": "trujunzhang/djzhang-targets",
"id": "e2ac39640844bc61f0d168df1f49ceeec6f03799",
"... |
from display.handlers.base import BaseHandler
class UiGeneralHandler(BaseHandler):
def get(self):
title = 'UiGeneralHandler'
self.render('ui/general.html', title = title, **self.render_dict) | {
"content_hash": "30a2ebffc100a01eabfc73a5cb627a84",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 73,
"avg_line_length": 35.166666666666664,
"alnum_prop": 0.7109004739336493,
"repo_name": "owlsn/h_crawl",
"id": "3edc0d6987e518f1cdd9b79e58b9b2a02daa190e",
"size": "211",
... |
match:
| {
"content_hash": "7c0c08b1c677482a941b62c9220e12dd",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 6,
"avg_line_length": 7,
"alnum_prop": 0.7142857142857143,
"repo_name": "google/intellij-community",
"id": "fa72643e309c4eee43f220209f7f285859b6458d",
"size": "7",
"binary... |
__author__ = "Trevor Nielsen"
"""
Executes all of the macros in a list/tuple/whatever at the same time. It waits for all of the specified
macros to finish if they aren't daemons.
"""
from grt.core import GRTMacro
class ConcurrentMacros(GRTMacro):
"""
Executes all macros concurrently.
"""
def __init... | {
"content_hash": "f29fc36eba11862eb1e8df8f82d36ea0",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 103,
"avg_line_length": 24.696969696969695,
"alnum_prop": 0.6,
"repo_name": "grt192/2012rebound-rumble",
"id": "546beed198ccf58ec750e4048a670b3d55b1e153",
"size": "815",
... |
import base64
import hashlib
import os
import random
import re
import time
import uuid
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
from rhumba import RhumbaPlugin
from twisted.internet import defer, reactor
from twisted.enterpris... | {
"content_hash": "e85cec110a9392c979da72152d05a772",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 79,
"avg_line_length": 31.84862385321101,
"alnum_prop": 0.5719429641365404,
"repo_name": "praekeltfoundation/seed-xylem",
"id": "6998243b7c85b1716a2932a784201e6c15971994",
... |
import sys
import unittest2
from stripe import StripeError
from stripe.test.helper import StripeUnitTestCase
class StripeErrorTests(StripeUnitTestCase):
def test_formatting(self):
err = StripeError(u'öre')
if sys.version_info > (3, 0):
assert str(err) == u'öre'
else:
... | {
"content_hash": "e211f4f856ded01d2cfb5d141e71e522",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 66,
"avg_line_length": 31.25,
"alnum_prop": 0.5768888888888889,
"repo_name": "uploadcare/stripe-python",
"id": "24c86629f9801183f9e86358175ca72432bbdf17",
"size": "1155",
... |
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from django.db import connection
_survey_sql = """
WITH most_recent_survey AS (
SELECT DISTINCT ON (survey.blockface_id) survey.*
FROM survey_survey AS survey
ORDER BY survey.bloc... | {
"content_hash": "7386f15d068d05e4079bdeb0f0574f46",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 64,
"avg_line_length": 27.26829268292683,
"alnum_prop": 0.6010733452593918,
"repo_name": "RickMohr/nyc-trees",
"id": "2c21b6c7c0a03b5007f545093e5b283234a6d159",
"size": "22... |
from ricky import __appname__, __version__
from setuptools import setup
long_description = ""
with open('requirements.txt') as f:
install_requires = [l for l in f.read().splitlines()
if not l.startswith('#')]
setup(
name=__appname__,
version=__version__,
scripts=[],
packa... | {
"content_hash": "a65a28be664760ac3e9045d10ecec190",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 79,
"avg_line_length": 25.78125,
"alnum_prop": 0.5987878787878788,
"repo_name": "paultag/ricky",
"id": "4331a38a6c80f5233daac53ab4ed51001b84ec6c",
"size": "825",
"binary"... |
from MafiaBot.MafiaRole import MafiaRole
from MafiaBot.MafiaAction import MafiaAction
from MafiaBot.Items.Probe import Probe
class Alien(MafiaRole):
def GetRolePM(self):
return 'You are an Alien. You may secretly probe other players during the night. Once you have probed all other remaining living player... | {
"content_hash": "e366115a70489c46672a84469353fb5b",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 217,
"avg_line_length": 45.35,
"alnum_prop": 0.5927967658948916,
"repo_name": "LLCoolDave/MafiaBot",
"id": "87ae9ba494d8318328094631efd8fc849d1b96f3",
"size": "2721",
"bi... |
from helper import *
def doTest():
res = doCheck([' ', 'check', '-p', realpath('./_test.css')])
res = res.find('[ERROR] 1. should add @author in the head of')
equal(res, 0, 'check by cmd line is ok')
res = doFix([' ', 'fix', '-p', realpath('./_test.css')])
expect = '''.test {
width: 100px;
}''... | {
"content_hash": "60e67d90f4422fe1ab0816b46d8afacc",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 97,
"avg_line_length": 39.3448275862069,
"alnum_prop": 0.5766871165644172,
"repo_name": "wangjeaf/CSSCheckStyle",
"id": "a6235fb5d449adbe95d73921d2cd16068eb06d18",
"size": ... |
"""
This module creates a random graph of a specified size that has
characteristics of a simple social network. For the size given, that
many nodes will be created with random properties; a similar (slightly
smaller) number of relationships will also be created, the number
differing due to the use of CREATE UNIQUE and ... | {
"content_hash": "441f7a239e53bdbc370a983fe4f1c500",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 97,
"avg_line_length": 35.955882352941174,
"alnum_prop": 0.6165644171779141,
"repo_name": "nicolewhite/py2neo",
"id": "e8d07c8a2d144cf732766c599c3aaa8d7b36a88f",
"size": "... |
"""The arguments helper for a server configuration."""
from plaso.lib import errors
from plaso.cli.helpers import interface
class BaseServerConfigHelper(interface.ArgumentsHelper):
"""CLI arguments helper class for server configuration."""
NAME = u'server_config'
DESCRIPTION = u'Argument helper for a server c... | {
"content_hash": "d1084b696f221b8d449a288ec85f2b12",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 80,
"avg_line_length": 35,
"alnum_prop": 0.6960187353629976,
"repo_name": "jorik041/plaso",
"id": "394df447dea81bdb971a7d9a39dd0e135079a563",
"size": "2159",
"binary": fa... |
import numpy as np
import SimpleITK as sitk
from ContinuousRegistration.Source.util import warp_image, warp_point_set, compose_displacement_fields
from ContinuousRegistration.Source.util import logging
def tre(superelastix, point_sets, deformation_field_file_names):
try:
point_set_fixed0_to_moving1 = warp_... | {
"content_hash": "992499aaeeccefac8da5e273e914c10f",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 133,
"avg_line_length": 46.292929292929294,
"alnum_prop": 0.6543748636264456,
"repo_name": "SuperElastix/SuperElastix",
"id": "2c4526d247fb656975aa742575fa31ed9ec06f14",
"s... |
"""Platform to retrieve Jewish calendar information for Home Assistant."""
from __future__ import annotations
from datetime import date as Date, datetime
import logging
from typing import Any
from hdate import HDate
from hdate.zmanim import Zmanim
from homeassistant.components.sensor import SensorEntity, SensorEntit... | {
"content_hash": "9b1e52685eaa4955b06a675558b490ed",
"timestamp": "",
"source": "github",
"line_count": 293,
"max_line_length": 89,
"avg_line_length": 33.42662116040955,
"alnum_prop": 0.6185419644680417,
"repo_name": "jawilson/home-assistant",
"id": "6db8003661428dbf466c4f8cf7adf663318580f5",
"size... |
from ..ant import Ant
from ..world import World, Edge, Node
from ..solver import Solver
import unittest
from unittest import mock
class SolverTest(unittest.TestCase):
def setUp(self):
self.nodes = [Node(name='a'), Node(name='b')]
self.world = mock.Mock(World)
self.world.nodes = self.nodes[... | {
"content_hash": "589a7742df2ef2443e0f07d8ccdcce6b",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 76,
"avg_line_length": 34.49090909090909,
"alnum_prop": 0.5482340537691092,
"repo_name": "fmcardoso/aco-scs",
"id": "99b178b351e909b203bb6523cdee376a921f0189",
"size": "189... |
"""Script to ensure a configuration file exists."""
import argparse
import logging
import os
from collections import OrderedDict
from glob import glob
from platform import system
from unittest.mock import patch
from typing import Dict, List, Sequence
import homeassistant.bootstrap as bootstrap
import homeassistant.co... | {
"content_hash": "70774c9ace2f79892056c3135519bb2c",
"timestamp": "",
"source": "github",
"line_count": 297,
"max_line_length": 79,
"avg_line_length": 37.02693602693603,
"alnum_prop": 0.5819769027916705,
"repo_name": "Zac-HD/home-assistant",
"id": "154754c667a7722a7174c02ed2a3f8e6c5eab401",
"size":... |
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from djblets.util.fields import JSONField
class ChangeDescription(models.Model):
"""
The recorded set of changes, containing optional description text
and fields that have changed.
T... | {
"content_hash": "e57f0c156e9a0862aed947208e7575e9",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 78,
"avg_line_length": 40.23157894736842,
"alnum_prop": 0.587388801674516,
"repo_name": "atagar/ReviewBoard",
"id": "abb1074d104506a883e1f0a255e2a231841038f4",
"size": "382... |
from copy import deepcopy
from distutils.version import StrictVersion
from django.db.models import F, Q, Exists, OuterRef
from api.base.exceptions import InvalidFilterOperator, InvalidFilterValue
from api.base.filters import ListFilterMixin
from api.base import utils
from osf.models import AbstractNode, NodeRelation... | {
"content_hash": "0bd77bcbbad221bf9d141e1b64e04589",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 136,
"avg_line_length": 50.41489361702128,
"alnum_prop": 0.6100443131462334,
"repo_name": "CenterForOpenScience/osf.io",
"id": "e34733df1096ad334e661ae153e2cf862e759847",
"... |
import contextlib
import errno
import logging
import os
import stat
from plumbum.commands.base import shquote
from plumbum.commands.processes import ProcessLineTimedOut, iter_lines
from plumbum.machines.base import PopenAddons
from plumbum.machines.remote import BaseRemoteMachine
from plumbum.machines.session import S... | {
"content_hash": "98e44d3ed8e9249bc55cf67f22bcbd51",
"timestamp": "",
"source": "github",
"line_count": 515,
"max_line_length": 109,
"avg_line_length": 34.19223300970874,
"alnum_prop": 0.5530694531205633,
"repo_name": "tomerfiliba/plumbum",
"id": "6b16d17c36ef6a534a66b71631946c7cc2ee13c2",
"size": ... |
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import salt libs
import integration
class StdTest(integration.ModuleCase):
'''
Test standard client calls
'''
def test_cli(self):
'''
Test... | {
"content_hash": "891649808817b103f477cfb4ee802df2",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 62,
"avg_line_length": 30.778761061946902,
"alnum_prop": 0.46204715353651526,
"repo_name": "stephane-martin/salt-debian-packaging",
"id": "22a43c8935d9d86f26be7ad13f3247e6ad... |
from tools import *
from default_record import *
from xen.xend import uuid
from xen.xend import XendDomain, XendNode
from xen.xend import BNVMAPI, BNStorageAPI
from xen.xend.server.netif import randomMAC
from xen.xend.ConfigUtil import getConfigVar
from xen.xend.XendAPIConstants import *
from xen.xend.XendAuthS... | {
"content_hash": "855e0e5eb53ca805ddcfb498dbd6d0d3",
"timestamp": "",
"source": "github",
"line_count": 362,
"max_line_length": 118,
"avg_line_length": 36,
"alnum_prop": 0.5768876611418048,
"repo_name": "Hearen/OnceServer",
"id": "1c9b29b09de593d9ce8726ef6642790f5d69c318",
"size": "13032",
"binar... |
import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='django-optimistic-lock',
version='1.0.1.dev0',
description='Offline optimistic locking for Django',
url='https://github.com/gavinwahl/django-optimistic-lock',
... | {
"content_hash": "61471514eac70552ee162aa9268717aa",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 70,
"avg_line_length": 30.625,
"alnum_prop": 0.6122448979591837,
"repo_name": "gavinwahl/django-optimistic-lock",
"id": "67e9b77fafaa60c3e67a4a950df2be1017c13de7",
"size": ... |
from typing import Any, Dict
import sentry_sdk
from flask import Flask
from flask_compress import Compress
from flask_cors import CORS
from sentry_sdk.integrations.flask import FlaskIntegration
from werkzeug.middleware.proxy_fix import ProxyFix
from alerta.database.base import Database, QueryBuilder
from alerta.excep... | {
"content_hash": "d9cf9df6ea303aba7060791df9be9e7a",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 89,
"avg_line_length": 26.21311475409836,
"alnum_prop": 0.7204502814258912,
"repo_name": "guardian/alerta",
"id": "986189aea66a40dc22198dcfcf2887b0ec82fe75",
"size": "3198... |
import logging
import optparse
import os
import sys
from StringIO import StringIO
import re
import unittest
# Run build_server so that files needed by tests are copied to the local
# third_party directory.
import build_server
build_server.main()
BASE_PATH = None
EXPLICIT_TEST_FILES = None
from fake_fetchers import C... | {
"content_hash": "087a8ae6f2b6fa5fde59f98c93db3e0e",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 80,
"avg_line_length": 33.425,
"alnum_prop": 0.6196709050112191,
"repo_name": "junmin-zhu/chromium-rivertrail",
"id": "da02e75296e397a519d168d9d3cc63a4d0370531",
"size": "... |
import wx
import wx.calendar
from wx.lib.masked import TimeCtrl
from wx.lib.agw import hypertreelist as HTL
from datetime import datetime, time
from lib import Task, DATA, PRIORITIES, DEFAULT_PRIORITY
from decorators import requires_selection
ID_ADD_TASK = 1000
ID_ADD_SUBTASK = 1010
ID_COLLAPSE = 1020
ID_EXPAND = 103... | {
"content_hash": "3674d00f717718321657f9dbad04d302",
"timestamp": "",
"source": "github",
"line_count": 367,
"max_line_length": 216,
"avg_line_length": 34.40871934604905,
"alnum_prop": 0.5882958504909724,
"repo_name": "codekoala/treedo",
"id": "8202f03672beb11ae1ea6c4b0e9b2b948fc1dcb5",
"size": "12... |
import allure
from allure.constants import AttachmentType
@allure.step("Test foo")
def test_foo():
prepare()
allure.attach("Response", "<div>bla-bla-bla</div>", AttachmentType.HTML)
pass
@allure.step("Prepare")
def prepare():
pass | {
"content_hash": "cc00a5d8ee7782be02a77395ef8e8375",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 76,
"avg_line_length": 20.666666666666668,
"alnum_prop": 0.6975806451612904,
"repo_name": "victorivanovspb/texzametki",
"id": "cfbffe5d587a345f4f1aca67a011429c389b00e5",
"s... |
"""
This module provides some facilities for constructing and plotting trees. It
is mostly a wrapper around a very limited subset of functions from the R
`ape` package (Analyses of Phylogenetics and Evolution).
R must be installed, the `ape` R package must be installed, and the Python
package ``rpy2`` must be installe... | {
"content_hash": "abc9f98fa35db5667e490956a31cdbd7",
"timestamp": "",
"source": "github",
"line_count": 487,
"max_line_length": 118,
"avg_line_length": 30.3305954825462,
"alnum_prop": 0.6107237153882608,
"repo_name": "alimanfoo/anhima",
"id": "b9a920a7d9a2479ba51acf150590a3e729ba6a17",
"size": "147... |
"""Convert the CFS grib data into something mimicing IEMRE.
This will allow for downstream usage by PSIMS/Drydown. Run from RUN_NOON.sh
"""
import os
import sys
import datetime
import numpy as np
from scipy.interpolate import NearestNDInterpolator
from tqdm import tqdm
import pygrib
from pyiem.util import utc, ncopen... | {
"content_hash": "e9d2176e81521924344bbb235d3353b9",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 79,
"avg_line_length": 31.788659793814432,
"alnum_prop": 0.604021404248419,
"repo_name": "akrherz/iem",
"id": "4fa74b896c9f1fc155bd0171cb0ca54cd6bd15d5",
"size": "6167",
... |
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q
import os
import requests
from beer_search_v2.models import Brewery, UntappdStyle, Country, AlcoholCategory, ContainerType, Product
from collections import OrderedDict
def get_main_display():
"""
Returns a list of dictionari... | {
"content_hash": "536986adcfe590427819c4a0f6cf96c0",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 115,
"avg_line_length": 40.525,
"alnum_prop": 0.5999383096853794,
"repo_name": "Ernir/bjorleitin",
"id": "cd25b830f78ed91e533f5966f31bac32aeaf002c",
"size": "9732",
"bin... |
import inspect
from pycket import values
from pycket.error import SchemeException
from rpython.rlib import jit, objectmodel, unroll
from rpython.rlib.objectmodel import specialize
class EndOfInput(Exception):
pass
class ArgParser(object):
_attrs_ = ['context', 'args', 'index']
_immutable_fields_ =... | {
"content_hash": "97303a1119ac980dc99db55ef22f9d9a",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 77,
"avg_line_length": 26.752380952380953,
"alnum_prop": 0.6023495906016376,
"repo_name": "samth/pycket",
"id": "ed3f8b9130d483b88e40342673d0ace40e3c286e",
"size": "2810",... |
from django.conf.urls import patterns, include, url
from django.views.generic.base import TemplateView
from django.contrib import admin as default_admin
from .admin import admin, staff, user
urlpatterns = patterns('',
url(r'^admin/', include(default_admin.site.urls)),
url(r'^adminpanel/', include(admin.urls))... | {
"content_hash": "994b5e1f3c73401dbdbafc14e5804851",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 65,
"avg_line_length": 38.214285714285715,
"alnum_prop": 0.7009345794392523,
"repo_name": "barszczmm/django-wpadmin",
"id": "f0eb3504605bc781a3b6d42217580c4c6eb828cd",
"siz... |
from __future__ import absolute_import
from scimath.units.acceleration import *
| {
"content_hash": "c8ae7d52ef858ac4f95f784045fda43f",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 40,
"avg_line_length": 40,
"alnum_prop": 0.8,
"repo_name": "enthought/etsproxy",
"id": "ed63c43de533f35fe8abd0a8921883b1a63acda8",
"size": "95",
"binary": false,
"copies... |
from biicode.common.model.brl.brl_user import BRLUser
from biicode.common.utils.serializer import Serializer, DictDeserializer, SetDeserializer
from biicode.server.model.epoch.utc_datetime import UtcDatetime
from biicode.common.exception import InvalidNameException, ForbiddenException, BiiException
from biicode.server.... | {
"content_hash": "0555e385eae91f9a8e0aca435694703e",
"timestamp": "",
"source": "github",
"line_count": 330,
"max_line_length": 100,
"avg_line_length": 38.54545454545455,
"alnum_prop": 0.6158018867924528,
"repo_name": "biicode/bii-server",
"id": "5aa227dfd2618e9e02000438161e646f9f92c702",
"size": "... |
import sys
import os
import serial
import time
from os.path import join
def send_data( c, data ):
c.read( 100 );
length = len( data )
c.write( "%d " % length )
print "Sending:%d bytes" % length
buffersize = 512
sent = 0
while sent < length:
... | {
"content_hash": "e81ec28e05111465e9e2dce9b55acc75",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 96,
"avg_line_length": 26.44859813084112,
"alnum_prop": 0.5095406360424029,
"repo_name": "SymbiSoft/logman-for-symbian",
"id": "bb6cc3096041801b6322c553212afcd161ee10da",
... |
from unittest.mock import MagicMock
import pytest
from allauth.socialaccount.models import SocialAccount, SocialLogin
from pontoon.base.adapter import PontoonSocialAdapter
# We have to support customized adapter during the transition of accounts
# between providers
def _get_sociallogin(user, provider):
"""
... | {
"content_hash": "d3d8c0fcdc1609e0709fdc0e8543d88e",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 73,
"avg_line_length": 25.559322033898304,
"alnum_prop": 0.7095490716180372,
"repo_name": "mozilla/pontoon",
"id": "77286696dd6e5bccfd7011e6dbc5667dde3ef57c",
"size": "1508... |
"""
A modification of updating_plot3.py.
Three of the plots are now oriented vertically, but the dataspace of all
6 plots is still linked. Panning along the X axis of a vertical plot
will move the Y axis of one of the horizontally-oriented plots, and vice
versa.
"""
# Major library imports
from numpy import arange
fr... | {
"content_hash": "32a29b771db7bbbd33a308f49f85093e",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 79,
"avg_line_length": 35.60655737704918,
"alnum_prop": 0.5844843462246777,
"repo_name": "burnpanck/chaco",
"id": "30c64d89795c45064948c46f48cdf4076dad415a",
"size": "4366... |
"""
RenderPipeline
Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com>
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... | {
"content_hash": "74434811a204aacb43572df7ab6e9e3c",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 92,
"avg_line_length": 40.40909090909091,
"alnum_prop": 0.7705286839145107,
"repo_name": "eswartz/RenderPipeline",
"id": "bd86761d8fa0362083e3314e3d86204ad645344e",
"size":... |
import argparse
import io
import os
import pstats
import sys
from collections import Counter
from itertools import chain
def get_lines(dir_path):
rval = []
for name in sorted(os.listdir(dir_path)):
path = os.path.join(dir_path, name)
if not os.path.isdir(path):
with io.open(path, "... | {
"content_hash": "a7e4f4dedc077d4239f37a33dac5b00b",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 78,
"avg_line_length": 31.42222222222222,
"alnum_prop": 0.6113861386138614,
"repo_name": "simleo/pydoop",
"id": "3ce32d7d894a48cd1a6cfd4d1760b396e5e752ae",
"size": "3460",
... |
import re
import os
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, HtmlResponse
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
from scrapy import log
from urllib import urlencode
import hashlib
import csv
fr... | {
"content_hash": "1f5a0ba02994f37fc7750fcef912aa8f",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 78,
"avg_line_length": 33.76119402985075,
"alnum_prop": 0.5972590627763041,
"repo_name": "ddy88958620/lib",
"id": "a4cd1db499dafd42dbb1e67fa7c5bbc8349b116e",
"size": "2262"... |
from twitterpandas import TwitterPandas
from examples.keys import TWITTER_OAUTH_SECRET, TWITTER_OAUTH_TOKEN, TWITTER_CONSUMER_SECRET, TWITTER_CONSUMER_KEY
__author__ = 'willmcginnis'
def friendship_option():
# get our own user id
user_id = tp.api_id
# use it to find all of our own friends (people we fol... | {
"content_hash": "9bf35e356a58c142e4c0930b97d98103",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 114,
"avg_line_length": 33.86,
"alnum_prop": 0.6414648552864737,
"repo_name": "wdm0006/twitter-pandas",
"id": "3bdcc05503bfcb3a97465dad14bc6fbb472d0e73",
"size": "1693",
... |
"""
Tests for ``admin.release``.
"""
import json
import os
from gzip import GzipFile
from StringIO import StringIO
import tempfile
from textwrap import dedent
from unittest import skipUnless
from setuptools import __version__ as setuptools_version
from effect import sync_perform, ComposedDispatcher, base_dispatcher... | {
"content_hash": "e6ef81353ea855a370f9c765f5177e14",
"timestamp": "",
"source": "github",
"line_count": 2058,
"max_line_length": 114,
"avg_line_length": 36.032069970845484,
"alnum_prop": 0.52370741969415,
"repo_name": "lukemarsden/flocker",
"id": "65ca4140cc2694380a3a2dc463b521aedda3e5cc",
"size": ... |
"""Small wrapper around `jax.random`."""
from typing import Optional, Union, overload
from etils.array_types import PRNGKey, ui32 # pylint: disable=g-multiple-import
import jax
from jax import numpy as jnp
import jax.random
import numpy as np
class RandomState:
"""Small stateful wrapper around `jax.random.split`... | {
"content_hash": "d3e595c69cfcac9cf9c3bd50d17ebfaf",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 80,
"avg_line_length": 31.763513513513512,
"alnum_prop": 0.6309295894490534,
"repo_name": "google-research/jax3d",
"id": "6da503d5b07f2e71c9207188107389d488f78a97",
"size"... |
from pycalendar.datetime import DateTime
from pycalendar.period import Period
from twext.python.clsprop import classproperty
import txweb2.dav.test.util
from txweb2.http_headers import MimeType
from txweb2.stream import MemoryStream
from twisted.internet.defer import inlineCallbacks, succeed, returnValue
from twist... | {
"content_hash": "d323eb75b3957fdc395e21b742adba3d",
"timestamp": "",
"source": "github",
"line_count": 1086,
"max_line_length": 158,
"avg_line_length": 45.705340699815835,
"alnum_prop": 0.6858530099121606,
"repo_name": "macosforge/ccs-calendarserver",
"id": "040cb43b42a679bae7e1cea30ce8644b92a7c6b6"... |
from tixi3 import tixi3wrapper
# define handles
tixi = tixi3wrapper.Tixi3()
xmlInputFilename = "MainFile.xml"
xmlOutputFilename = "Result_out.xml"
# Open a CPACS configuration file. First open the CPACS-XML file
# with TiXI to get a tixi handle.
tixi.open(xmlInputFilename, recursive=True)
# remove an Element from th... | {
"content_hash": "0fa7b4531f81b930fce0cb95d05ad992",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 100,
"avg_line_length": 21.40909090909091,
"alnum_prop": 0.7059447983014862,
"repo_name": "melven/tixi",
"id": "25b27d885e68a470ef093cac3b087988f19d93a0",
"size": "1139",
... |
import itertools
import numpy as np
import pytest
from numpy.testing import assert_array_almost_equal
from sklearn.neighbors._ball_tree import BallTree
from sklearn.neighbors import DistanceMetric
from sklearn.utils import check_random_state
rng = np.random.RandomState(10)
V_mahalanobis = rng.rand(3, 3)
V_mahalanobis... | {
"content_hash": "0975f6891227472a813b1537d01722dc",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 76,
"avg_line_length": 32.71641791044776,
"alnum_prop": 0.6208941605839416,
"repo_name": "bnaul/scikit-learn",
"id": "8da703dbe207df813c969e4758f6d77e94ee88bc",
"size": "21... |
"""Test transaction signing using the signrawtransaction* RPCs."""
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_raises_rpc_error, hex_str_to_bytes
from test_framework.messages import sha256
from test_framework.script import CScript, OP_0
from deci... | {
"content_hash": "bbfe5d9b0c849e4a531e690df130db6b",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 712,
"avg_line_length": 53.55681818181818,
"alnum_prop": 0.7088903034160832,
"repo_name": "droark/bitcoin",
"id": "dcafc828573f08efe3bf94056990f23b5998ddf0",
"size": "9640... |
from __future__ import annotations
from airflow.exceptions import AirflowException
from airflow.providers.databricks.hooks.databricks import RunState
def normalise_json_content(content, json_path: str = 'json') -> str | bool | list | dict:
"""
Normalize content or all values of content if it is a dict to a s... | {
"content_hash": "26f85011cdf862ad1ba44d1b70cf407d",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 103,
"avg_line_length": 40.0377358490566,
"alnum_prop": 0.6663524976437323,
"repo_name": "cfei18/incubator-airflow",
"id": "fa6e180826aa8966e7f065df989ecb8a6f175806",
"size... |
from datetime import date, datetime
from dateutil.parser import parse
from dateutil.relativedelta import relativedelta
from .time import Time
class Filter:
def __init__(self, value):
self.value = value
self.filters = {'%s__exact': value}
def __call__(self, field_name):
return {filter%field_name: value for f... | {
"content_hash": "147bb019e39b340d3b3fc89f985e1a39",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 236,
"avg_line_length": 32.37894736842105,
"alnum_prop": 0.6511703511053316,
"repo_name": "bmampaey/SOLARNET-python-client",
"id": "03a0dcd86ae522d93da6e0520de7fe19e89e4d9e",... |
import imp
import platform
import sys
from ctypes import (cdll,
POINTER, pointer,
c_char_p,
c_size_t, c_double, c_int, c_uint64, c_uint32,
create_string_buffer)
#Linux
if platform.system() == 'Linux':
if platform.architecture()[0] == '64... | {
"content_hash": "9fdd093027b75b99e1be44a418c47d85",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 108,
"avg_line_length": 34.87966804979253,
"alnum_prop": 0.5372353081132525,
"repo_name": "inuitwallet/bippy_old",
"id": "b14f8357c193fafda9bfb017550a44f9bb06705d",
"size"... |
"""
homeassistant.components.sensor.vera
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for Vera sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.vera/
"""
import logging
from requests.exceptions import RequestException
import homeassistant.u... | {
"content_hash": "c9680c132267aec6571c8416225096c1",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 79,
"avg_line_length": 34.43150684931507,
"alnum_prop": 0.6136860950865327,
"repo_name": "caiuspb/home-assistant",
"id": "7fb72fd91b72c08037e66206f12f8621fb11ce31",
"size"... |
"""Support for getting data from websites with scraping."""
from __future__ import annotations
import logging
from typing import Any
from bs4 import BeautifulSoup
import httpx
import voluptuous as vol
from homeassistant.components.rest.data import RestData
from homeassistant.components.sensor import (
CONF_STATE... | {
"content_hash": "e095fe12a9840b3f40c845ca3bc7ba10",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 87,
"avg_line_length": 33.07920792079208,
"alnum_prop": 0.6194253217599521,
"repo_name": "GenericStudent/home-assistant",
"id": "8f2a672ef06ab59f945051bddf9e30f3d192eb47",
... |
import re
import shutil
import time
import fnmatch
import sys
import hotspotter.tpl
import numpy as np
import pylab
import os
from os.path import expanduser, join, relpath, realpath, normpath, exists, dirname
from hotspotter.other.AbstractPrintable import AbstractManager
from hotspotter.other.ConcretePrintable import D... | {
"content_hash": "10f11f5bab31ae0598b13a7e5820ad4b",
"timestamp": "",
"source": "github",
"line_count": 557,
"max_line_length": 123,
"avg_line_length": 42.17414721723519,
"alnum_prop": 0.553488570090673,
"repo_name": "Erotemic/hotspotter",
"id": "2a84b5b415e638d29dd26559ce44d0e8caef88d4",
"size": "... |
from webmarks.bookmarks import models
from webmarks.bookmarks import serializers
from webmarks.drf_utils.cache import CustomListKeyConstructor
from webmarks.storage.crawler import Crawler
from webmarks.storage.storage import FileStore
from webmarks.bookmarks.filters import BookmarkFilter
from webmarks.bookmarks.filters... | {
"content_hash": "3cb428b3d40484e2e74cdc84af515eba",
"timestamp": "",
"source": "github",
"line_count": 275,
"max_line_length": 95,
"avg_line_length": 31.047272727272727,
"alnum_prop": 0.6632700866713516,
"repo_name": "EricMuller/mynotes-backend",
"id": "ea1bf78bae7ece9c7aee8b85a0d7918ff582b167",
"... |
import time
from random import randint
from itertools import chain
import input
from helpers import *
from modules import *
"""
Conway's Game of Life
A board is represented like this::
{(x, y): state, ...}
...where `state` is an int from 0..2 representing a color
"""
def random_color():
color = []
choi... | {
"content_hash": "e3f0cfbfb67efdaf99eff8a22259e4e5",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 105,
"avg_line_length": 31.905882352941177,
"alnum_prop": 0.5800147492625368,
"repo_name": "derblub/pixelpi",
"id": "bcea63b8ad8822fe8b54203f5361c66e945f75b7",
"size": "54... |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_M... | {
"content_hash": "14a96858fcf562d3986191194fc0df47",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 76,
"avg_line_length": 29,
"alnum_prop": 0.43340094658553074,
"repo_name": "fin/froide",
"id": "372e76b08c1de11660dc963f107a0338112f4c4a",
"size": "1553",
"binary": false... |
'''
This will eventually get replaced with Require.js
but until then it's a quick hack to save time.
'''
import os
EXIT_SUCCESS = 0
def precompile(compiler='handlebars'):
'''
Quick hack to precompile all templates
'''
success = 0
print("[*] Precompiling templates, please wait ...")
files = f... | {
"content_hash": "3c7ed53b30aeb3375b627c24a6678d9d",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 72,
"avg_line_length": 27.9375,
"alnum_prop": 0.546607009694258,
"repo_name": "BishopFox/iSpy",
"id": "e51c86ca783a9b2ea74623d14f7d9da77b17af26",
"size": "1363",
"binary"... |
from functools import partial
from flowlight.tasks.task import _Task
class Node:
"""Abstract representation of `Machine` and `Group`.
:param name: the unique name of a `Node`.
Usage::
>>> machine = Machine('host1')
>>> isinstance(machine, Node)
True
>>> group = Group([Mac... | {
"content_hash": "a2cd9e28d43151001234a34d7388700c",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 72,
"avg_line_length": 27.62857142857143,
"alnum_prop": 0.5832471561530507,
"repo_name": "tonnie17/flowlight",
"id": "56284f94ca70ea6b81125158fae45f5c732e7408",
"size": "96... |
import mock
from lab_assistant.tests import cases
import lab_assistant
class TestExperimentPublish(cases.TestCase):
def test_publish_calls_tasks(self):
task = mock.MagicMock()
experiment = type('Experiment', (lab_assistant.experiments.Experiment,), {
'publish_tasks': [task]
})... | {
"content_hash": "192097a2c4df9b8e13330efa56c24b7a",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 82,
"avg_line_length": 28.6,
"alnum_prop": 0.6573426573426573,
"repo_name": "joealcorn/lab_assistant",
"id": "0c2d9a9e7ff3a4a70e0e80cc2a43f4b9dd499bea",
"size": "429",
"b... |
from flask import render_template
def html_redirect(url):
""" Generates redirect pages using the meta refresh HTML tag.
Proper redirects use 301 responses - this isn't possible with static sites. To circumvent, send HTML pages
with meta refresh tags.
:param str url: The URL to redirect to.
:retu... | {
"content_hash": "961b7e9fb60d7f070a13c4a613d8fe00",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 110,
"avg_line_length": 30.692307692307693,
"alnum_prop": 0.7142857142857143,
"repo_name": "wcpr740/wcpr.org",
"id": "ee64b8ec9e5e0c11bfad94a86507271c7c7ebf5a",
"size": "39... |
"""Keras implementation of efficientdet."""
import functools
from absl import logging
import numpy as np
import tensorflow as tf
import dataloader
import hparams_config
import utils
from backbone import backbone_factory
from backbone import efficientnet_builder
from tf2 import fpn_configs
from tf2 import postprocess
f... | {
"content_hash": "931a86f5033c5b48a42f0ed866c648cd",
"timestamp": "",
"source": "github",
"line_count": 989,
"max_line_length": 80,
"avg_line_length": 35.900910010111225,
"alnum_prop": 0.6014476426519462,
"repo_name": "google/automl",
"id": "e21402e54b5bea217845ad929b0958dc63abb7b1",
"size": "36188... |
from google.cloud import dialogflowcx_v3beta1
def sample_detect_intent():
# Create a client
client = dialogflowcx_v3beta1.SessionsClient()
# Initialize request argument(s)
query_input = dialogflowcx_v3beta1.QueryInput()
query_input.text.text = "text_value"
query_input.language_code = "languag... | {
"content_hash": "bd62fbe401753e1735c94cc43462e9b2",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 63,
"avg_line_length": 27.166666666666668,
"alnum_prop": 0.7131901840490797,
"repo_name": "googleapis/python-dialogflow-cx",
"id": "f1839d477212e8c05e46031a167cd51adb15870d",... |
class AnnotationMeta(type):
def __call__(cls, *args, **kwargs):
if cls._can_be_static and cls._is_static_call(*args, **kwargs):
self = super(AnnotationMeta, cls).__call__()
self(args[0])
return args[0]
else:
return super(AnnotationMeta, cls).__call__(*... | {
"content_hash": "0b885157e7c61dc716789a53c5fa3a5d",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 71,
"avg_line_length": 22.03921568627451,
"alnum_prop": 0.6459074733096085,
"repo_name": "prkumar/uplink",
"id": "b02bd862901d6683af3383fb335dbe26ef2311d9",
"size": "3372"... |
"""
Traverse an HDFS tree and output disk space usage by block size.
"""
# DOCS_INCLUDE_START
import pydoop.hdfs as hdfs
from common import MB, TEST_ROOT
def usage_by_bs(fs, root):
stats = {}
for info in fs.walk(root):
if info['kind'] == 'directory':
continue
bs = int(info['block_s... | {
"content_hash": "959c7e8c50ef6197f6e035de6aabb26c",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 64,
"avg_line_length": 26.88,
"alnum_prop": 0.5491071428571429,
"repo_name": "elzaggo/pydoop",
"id": "e5e4e64b34e78cd30a42100601b2275b7722dd11",
"size": "1283",
"binary":... |
import os
import dj_database_url
from project_runpy import env
BASE_DIR = os.path.dirname(__file__)
SECRET_KEY = env.get('SECRET_KEY', 'Rotom')
DEBUG = env.get('DEBUG')
ALLOWED_HOSTS = ['*']
DATABASES = {'default': dj_database_url.config(default='sqlite:///' +
os.path.join(BASE_DIR, 'example_project.db'))}
... | {
"content_hash": "91dcf4295afd5739c0667710f3c1cf77",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 79,
"avg_line_length": 29.936507936507937,
"alnum_prop": 0.6344998232591021,
"repo_name": "crccheck/django-aws-admin",
"id": "ef726d9c44952dd21211688cb8866c08ff093941",
"s... |
from math import ceil
from time import sleep
import os
import re
from database import User, Item
from . import data_manipulation
from . import gtk_element_editor
from . import window_creator
from .decorators import use_threading, use_spinner
class WindowHandler:
spinner = None
task_count = 0
user_list = ... | {
"content_hash": "d181c26cbbef6637cecf5f2037803f50",
"timestamp": "",
"source": "github",
"line_count": 768,
"max_line_length": 120,
"avg_line_length": 34.4140625,
"alnum_prop": 0.5861899356791525,
"repo_name": "peto2006/sortiment-frontent",
"id": "782c255ad38612416ab35e14de9ad6ddafbba317",
"size":... |
import time
import testtools
from tempest.api.identity import base
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
CONF = config.CONF
class UsersV3TestJSON(base.BaseIdentityV3AdminTest):
@classmethod
def skip_checks(cls):
super(UsersV3... | {
"content_hash": "e80ed73f8617227fba440ce887db2401",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 77,
"avg_line_length": 46.062893081761004,
"alnum_prop": 0.6119606772255598,
"repo_name": "masayukig/tempest",
"id": "8955a93ed9f85d9eb911200a78582bc8f4b8a5e9",
"size": "7... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('daiquiri_jobs', '0006_owner_blank_true'),
]
operations = [
migrations.AddField(
model_name='job',
name='creation_time',
... | {
"content_hash": "c6a8baaf030052302358e7120b0e8383",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 62,
"avg_line_length": 22,
"alnum_prop": 0.5984848484848485,
"repo_name": "aipescience/django-daiquiri",
"id": "ca45d4932612b7f6ac459383fa9dabd62d5456a4",
"size": "466",
... |
"""A dummy backend for use in tests.
This backend implements the backend API in the simplest way possible. It is
used in tests of the frontends.
"""
from __future__ import unicode_literals
import pykka
from mopidy import backend
from mopidy.models import Playlist, Ref, SearchResult
def create_dummy_backend_proxy... | {
"content_hash": "6d486d6340a8a2ff3c7e90e0bdd547a8",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 76,
"avg_line_length": 27.513513513513512,
"alnum_prop": 0.6394891944990176,
"repo_name": "abarisain/mopidy",
"id": "94b01433817811aba8f2030572ddf265bf5aeb32",
"size": "30... |
from __future__ import absolute_import, unicode_literals
import hashlib
import os
import random
import re
import string
import tempfile
import time
import warnings
import pickle
from django.conf import settings
from django.core import management
from django.core.cache import get_cache
from django.core.cache.backends.... | {
"content_hash": "c7faaf9d0d4b702ac780cf244a89d4da",
"timestamp": "",
"source": "github",
"line_count": 1927,
"max_line_length": 190,
"avg_line_length": 42.587960560456665,
"alnum_prop": 0.6306554400672622,
"repo_name": "eltonsantos/django",
"id": "da80c4805805f3727047d0f4edfa858730f7ec7c",
"size":... |
from django.conf.urls import patterns, url
urlpatterns = patterns('',
# Core
url(r'^$',
'mcfinance.core.views.dashboard',
name='dashboard'),
url(r'^switch-account/(?P<account_id>[0-9a-f]{24})/$',
'mcfinance.core.views.switch_account',
name='switch-account'),
)
| {
"content_hash": "e4999904457712bc02d336eb4db08748",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 58,
"avg_line_length": 22.071428571428573,
"alnum_prop": 0.5922330097087378,
"repo_name": "lardissone/mcfinance",
"id": "9c7cae5a535f94ebe29a21b686db7b41c72a5d91",
"size": ... |
"""Python wrapper for prefetching_ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.data.ops import iterator_ops
from tensorflow.python.eager import context
from tensorflow.pytho... | {
"content_hash": "a1c4d65478ffbd9adb3c190c5c1c4f1f",
"timestamp": "",
"source": "github",
"line_count": 325,
"max_line_length": 116,
"avg_line_length": 40.91692307692308,
"alnum_prop": 0.6837118363663709,
"repo_name": "kevin-coder/tensorflow-fork",
"id": "efa8a11b75ba4c4c7094fc415c3b445076ebb337",
... |
r"""Provides tools for interpolating irregularly spaced data onto a regular grid.
Deprecated in 0.9 in favor of the more general `interpolate` subpackage.
"""
import warnings
import metpy.deprecation
from .interpolate import (interpolate, inverse_distance, natural_neighbor,
remove_nan_obser... | {
"content_hash": "80256f022c6506130271f263460e8951",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 94,
"avg_line_length": 46.21052631578947,
"alnum_prop": 0.7015945330296127,
"repo_name": "jrleeman/MetPy",
"id": "5385480462190be0b12668258af8bde8775772c7",
"size": "1016",... |
__source__ = 'https://leetcode.com/problems/valid-parenthesis-string/description/'
# Time: O()
# Space: O()
#
# Description: Leetcode # 678. Valid Parenthesis String
#
# Given a string containing only three types of characters: '(', ')' and '*',
# write a function to check whether this string is valid.
# We define the... | {
"content_hash": "4ea1a9f56c3ddf7ab997df4abe415717",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 109,
"avg_line_length": 25.050420168067227,
"alnum_prop": 0.5038577658503858,
"repo_name": "JulyKikuAkita/PythonPrac",
"id": "f2efa1f5c3f88ce03531734b78090d5e083669ba",
"s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.