text stringlengths 4 1.02M | meta dict |
|---|---|
tickets = []
# allocate new tickets
def make_tickets():
for i in range(10):
tickets.append("ticket_" + str(i))
# log all tickets currently in the system to terminal
def show_all_tickets():
term_light_blue = "\033[0;94m"
term_reset = "\033[0;0m"
for ticket in tickets:
print term_li... | {
"content_hash": "b952d9726a9bd7a318b55495331f147c",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 53,
"avg_line_length": 17.583333333333332,
"alnum_prop": 0.6066350710900474,
"repo_name": "kouritron/uvs",
"id": "3e2c7cc836d70e4bfa54ab06f5a6df205306b2a9",
"size": "424",
... |
from collections import OrderedDict
import gym
import logging
import numpy as np
import re
from typing import Callable, Dict, List, Optional, Tuple, Type
from ray.util.debug import log_once
from ray.rllib.models.tf.tf_action_dist import TFActionDistribution
from ray.rllib.models.modelv2 import ModelV2
from ray.rllib.p... | {
"content_hash": "a7b7b003baea6bcdee3ac026b3d3d4d3",
"timestamp": "",
"source": "github",
"line_count": 644,
"max_line_length": 79,
"avg_line_length": 47.44565217391305,
"alnum_prop": 0.5585337915234823,
"repo_name": "richardliaw/ray",
"id": "900d6cb570e39ec1cba4995bbf7c5f3fafabee7c",
"size": "3055... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('inout', '0007_auto_20170102_0146'),
]
operations = [
migrations.AlterModelOptions(
name='entry',
options={'verbose_name_plur... | {
"content_hash": "25281ca81178203ed664ad1ef794d8a1",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 58,
"avg_line_length": 23.59090909090909,
"alnum_prop": 0.5741811175337187,
"repo_name": "detialiaj/pro",
"id": "936a136295e7df86f4b59d60b4274bb56aafd816",
"size": "592",
... |
from collections import OrderedDict
@IN.hook
def access_keys():
entity_bundle = IN.entitier.entity_bundle
keys = {}
group = 'Entity Admin'
keys[group] = OrderedDict() # we may need order
keys_entity_type = keys[group]
# administer all entities
keys_entity_type['admin_all_entity'] = {
'title' : s('(Adminis... | {
"content_hash": "3988bbfcf7f0d900b545d152f4ffb49c",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 90,
"avg_line_length": 31.682692307692307,
"alnum_prop": 0.6127465857359636,
"repo_name": "vinoth3v/In",
"id": "4be5acf38e6f87d7ef59ffa81418adf4510fe07f",
"size": "3295",
... |
from unittest import TestCase, expectedFailure
from autodepgraph import visualization as vis
import autodepgraph as adg
import networkx as nx
from autodepgraph.graph import AutoDepGraph_DAG
import yaml
import os
test_dir = os.path.join(adg.__path__[0], 'tests', 'test_data')
class Test_Graph(TestCase):
@classmeth... | {
"content_hash": "28cb12e9e70a8abb54a296cc164ccb80",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 98,
"avg_line_length": 41.627906976744185,
"alnum_prop": 0.6093575418994414,
"repo_name": "AdriaanRol/AutoDepGraph",
"id": "0b766784c030f24fdf9818f39126d2f04af79ff7",
"siz... |
""" Wrapper around the dynamo3 RateLimit class """
from future.utils import python_2_unicode_compatible, iteritems, itervalues
from dynamo3 import RateLimit
@python_2_unicode_compatible
class TableLimits(object):
""" Wrapper around :class:`dynamo3.RateLimit` """
def __init__(self):
self.total = {}
... | {
"content_hash": "bd66d47b8391dbf15f7b1ff41bac8cff",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 79,
"avg_line_length": 38.464516129032255,
"alnum_prop": 0.49966454209996647,
"repo_name": "mathcamp/dql",
"id": "583f0bf7afbacf9fb0f90ac3dbc0287937ea68d2",
"size": "5962"... |
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from .. import Error, Tags, Warning, register
REFERRER_POLICY_VALUES = {
'no-referrer', 'no-referrer-when-downgrade', 'origin',
'origin-when-cross-origin', 'same-origin', 'strict-origin',
'strict-origin-when-cross-ori... | {
"content_hash": "51bfa8f8ca72d11ad68f04ee4a6853e3",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 90,
"avg_line_length": 32.991902834008094,
"alnum_prop": 0.6878144557614431,
"repo_name": "koordinates/django",
"id": "8cf3d1d61e1043c1527b6dee8c5bcca64b3e4145",
"size": "... |
"""Runs the 'ar' command after removing its output file first.
This script is invoked like:
python gcc_ar_wrapper.py --ar=$AR --output=$OUT $OP $INPUTS
to do the equivalent of:
rm -f $OUT && $AR $OP $OUT $INPUTS
"""
import argparse
import os
import subprocess
import sys
import wrapper_utils
def main():
parse... | {
"content_hash": "cfdd134f31318bf057e395da4d100bf3",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 79,
"avg_line_length": 31.82191780821918,
"alnum_prop": 0.6229014205768403,
"repo_name": "chrisdickinson/nojs",
"id": "893b859f0826280105569204e7dc3c3a6b081a4a",
"size": "2... |
from django.db import models
class Setting(models.Model):
VALUE_TYPES = (
("B", "Bool"),
("S", "String"),
("N", "Number")
)
key = models.CharField(max_length=100, primary_key=True)
value = models.CharField(max_length=2000)
description = models.CharField(max_length=2000)
... | {
"content_hash": "19e3cf60fc9d882f06fddeeb1ef82c45",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 76,
"avg_line_length": 29.272727272727273,
"alnum_prop": 0.5822981366459627,
"repo_name": "narcolepticsnowman/GarageWarden",
"id": "1ed2b701da806c26f52585c772792f63517f9551",... |
from link import Wrapper
from link.utils import list_to_dataframe
class ElasticSearch(Wrapper):
"""
wraps an ElasticSearch connection and extends the functionality
to do tasks like put queries into dataframes
"""
def __init__(self, wrap_name = None, **kwargs):
self.options = {}
if k... | {
"content_hash": "d9e9547a56ffa8ef3e7250233ecf30b5",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 83,
"avg_line_length": 32.7125,
"alnum_prop": 0.5842567825754681,
"repo_name": "dhrod5/link",
"id": "898e4fd56884ab8a8fac3038a081a643d6db4267",
"size": "2617",
"binary": ... |
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.utils import six
from django.utils.six.moves import zip
from djblets.testing.decorators import add_fixtures
from djblets.webapi.errors import INVALID_FORM_DATA
from reviewboard.reviews.models import DefaultReviewer, Group
... | {
"content_hash": "079eb06af9f600cc7777bd5cd95720a1",
"timestamp": "",
"source": "github",
"line_count": 898,
"max_line_length": 79,
"avg_line_length": 37.783964365256125,
"alnum_prop": 0.5746831712348953,
"repo_name": "brennie/reviewboard",
"id": "d3cff52acc079023d15b6982a86729de4a94efdb",
"size": ... |
import os
import xlrd
from TableCode.cs_data import GenCSTableData
from TableCode.cs_file import GenCSTableManagerFile, genCSLoadTablesFile
from TableCode.go_data import GenGolangTableData
from TableCode.go_file import GenGoTableManagerFile, genGolangLoadTablesFile
from const import excel_dir
def processExcel(filePa... | {
"content_hash": "3f752be07c23ba4c8d03c043b7520e48",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 85,
"avg_line_length": 33.5,
"alnum_prop": 0.6136962247585601,
"repo_name": "Mikejinhua/UnitySocketProtobuf3Demo",
"id": "e429b1e29f7ccc7a997895c815fce59e827679d3",
"size":... |
"""Contain all zeromq devices needed by OCT
"""
from __future__ import print_function, unicode_literals
import zmq
def forwarder(frontend, backend):
"""Simple pub/sub forwarder
:param int frontend: fontend zeromq port
:param int backend: backend zeromq port
"""
try:
context = zmq.Context(... | {
"content_hash": "30ba4968692f0e3ba63d4e22cb1aae94",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 100,
"avg_line_length": 26.912280701754387,
"alnum_prop": 0.6023468057366362,
"repo_name": "karec/oct",
"id": "2878f4eebcaa1f4ece07b142476a8c1153d7321d",
"size": "1534",
... |
from django import forms
class SendEmailForm(forms.Form):
to_email = forms.CharField()
subject = forms.CharField()
message = forms.CharField()
class SendHTTPRequestForm(forms.Form):
http_method = forms.ChoiceField(choices=(
("get", "GET"),
("post", "POST"),
("head", "HEAD"),
... | {
"content_hash": "1f1d712f2530cee77fc201b3508b4a2a",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 45,
"avg_line_length": 23.166666666666668,
"alnum_prop": 0.592326139088729,
"repo_name": "theju/dtwt",
"id": "47f8544d8ba9d535c57b500c9d8ed95867e9c676",
"size": "417",
"b... |
from ._models_py3 import AadAuthenticationParameters
from ._models_py3 import AddressSpace
from ._models_py3 import ApplicationGateway
from ._models_py3 import ApplicationGatewayAuthenticationCertificate
from ._models_py3 import ApplicationGatewayAutoscaleConfiguration
from ._models_py3 import ApplicationGatewayAvailab... | {
"content_hash": "f70a5bb7d1f8fb27a360583deeb4cf35",
"timestamp": "",
"source": "github",
"line_count": 1125,
"max_line_length": 105,
"avg_line_length": 44.448,
"alnum_prop": 0.826113910887129,
"repo_name": "Azure/azure-sdk-for-python",
"id": "dc066145698c5cdccaf27f356a525828fb47686f",
"size": "504... |
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('iiits', '0059_auto_20160717_0609'),
]
operations = [
migrations.AlterField(
model_... | {
"content_hash": "a78458ab3954aba32faa816b8578db15",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 110,
"avg_line_length": 26,
"alnum_prop": 0.6030769230769231,
"repo_name": "IIITS/iiits.ac.in",
"id": "79094171d897f57a2a4f0df5c1978a00d2070601",
"size": "720",
"binary":... |
import clr
clr.AddReferenceByPartialName("PresentationCore")
clr.AddReferenceByPartialName("PresentationFramework")
clr.AddReferenceByPartialName("WindowsBase")
clr.AddReferenceByPartialName("IronPython")
clr.AddReferenceByPartialName("Microsoft.Scripting")
from math import *
from System import *
from System.Windows ... | {
"content_hash": "49a3f4d1825860f8ccf5d3df48d48621",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 88,
"avg_line_length": 26.177083333333332,
"alnum_prop": 0.6975726223637088,
"repo_name": "jstammers/EDMSuite",
"id": "12b6d9165e1405e19568186f934dacd0bfea4f06",
"size": "3... |
from ....testing import assert_equal
from ..preprocess import Tensor2ApparentDiffusion
def test_Tensor2ApparentDiffusion_inputs():
input_map = dict(args=dict(argstr='%s',
),
debug=dict(argstr='-debug',
position=1,
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=di... | {
"content_hash": "be39235b2df156b05f738d6ad8e7102b",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 78,
"avg_line_length": 26.22222222222222,
"alnum_prop": 0.6398305084745762,
"repo_name": "iglpdc/nipype",
"id": "c7bd91a6103486080f09c1a527c1721f25a6e316",
"size": "1234",
... |
import click
from nctrader import settings
from nctrader.compat import queue
from nctrader.price_parser import PriceParser
from nctrader.price_handler.yahoo_daily_csv_bar import YahooDailyCsvBarPriceHandler
from nctrader.strategy import DisplayStrategy
from nctrader.position_sizer.fixed import FixedPositionSizer
from ... | {
"content_hash": "38be145e6394c82c19358d20b2f5f488",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 91,
"avg_line_length": 35.074074074074076,
"alnum_prop": 0.737064413938754,
"repo_name": "nwillemse/nctrader",
"id": "7f224c154b2e9624c8a98b4fbc71b5b768a7fe36",
"size": "28... |
import os
import optparse
import sys
import m5
from m5.objects import *
m5.util.addToPath('../common')
# --------------------
# Define Command Line Options
# ====================
parser = optparse.OptionParser()
parser.add_option("-d", "--detailed", action="store_true")
parser.add_option("-t", "--timing", action="... | {
"content_hash": "654e8be767099df34cd8b3d266b3353c",
"timestamp": "",
"source": "github",
"line_count": 258,
"max_line_length": 95,
"avg_line_length": 31.914728682170544,
"alnum_prop": 0.6148894826329852,
"repo_name": "lixt/lily2-gem5",
"id": "6880f8db54ff49656a23404adfc4a47ebd4aa47c",
"size": "983... |
"""
@author: Adam Reinhold Von Fisher - https://www.linkedin.com/in/adamrvfisher/
"""
#N Period Edge Ratio Computation for single issue with graphical displays
#Imports
from YahooGrabber import YahooGrabber
import numpy as np
import time as t
import pandas as pd
import matplotlib.pyplot as plt
from m... | {
"content_hash": "662a528fe3d0862d922782d261d4977c",
"timestamp": "",
"source": "github",
"line_count": 272,
"max_line_length": 124,
"avg_line_length": 37.481617647058826,
"alnum_prop": 0.620892594409024,
"repo_name": "adamrvfisher/TechnicalAnalysisLibrary",
"id": "86336447f4d581e6e06f7d7e81d25f0e6aa... |
from pyvisdk.base.managed_object_types import ManagedObjectTypes
from pyvisdk.base.base_entity import BaseEntity
import logging
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
class HostAutoStartManager(Base... | {
"content_hash": "cd57bc11e880b9f6aeec36585febaeed",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 96,
"avg_line_length": 41.689655172413794,
"alnum_prop": 0.684449958643507,
"repo_name": "xuru/pyvisdk",
"id": "4d5cefdf07a703b1f4e7600d3e80756528d08abd",
"size": "2419",
... |
"""Non-terminal symbols of Python grammar (from "graminit.h")."""
# This file is automatically generated; please don't muck it up!
#
# To update the symbols in this file, 'cd' to the top directory of
# the python source tree after building the interpreter and run:
#
# python Lib/symbol.py
#--start constants--
s... | {
"content_hash": "9c6cdafea59b7879518556f467977243",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 69,
"avg_line_length": 18.285714285714285,
"alnum_prop": 0.6748798076923077,
"repo_name": "Integral-Technology-Solutions/ConfigNOW-4.3",
"id": "daf86ab27e9f4323fe72483edc5622... |
from participantCollection import ParticipantCollection
import re
import pyperclip
# Edit me!
nextYearURL = ""
year = 2018
participants = ParticipantCollection()
numberStillIn = participants.sizeOfParticipantsWhoAreStillIn()
initialNumber = participants.size()
percentStillIn = int(round(100 * numberStillIn / initial... | {
"content_hash": "60ec21e1ffdebf6e7f5b63575d08e1ed",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 145,
"avg_line_length": 33.450980392156865,
"alnum_prop": 0.6512309495896834,
"repo_name": "foobarbazblarg/stayclean",
"id": "ad4e4d05764f5e4a9fd3bfac928efbcff8dbe1dc",
"si... |
from django.contrib import admin
from blog.models import Tag, BlogPost
admin.site.register(Tag)
admin.site.register(BlogPost)
| {
"content_hash": "3f2b4e829ecaf79ccafb769a6198ce29",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 37,
"avg_line_length": 13.2,
"alnum_prop": 0.7878787878787878,
"repo_name": "azul-cloud/cityinfo",
"id": "d57d50c9cf0f19d50d60c4527536aa42698e0255",
"size": "132",
"binar... |
"""Classes for solving optimization models for transmission expansion planning"""
from .OpfModels import *
from .OptModels import *
from .TepScenariosModels import *
#from .TepRobustnessAnalysis import *
#from .TepScenariosNSGA import *
__all__ = ['OpfModels', 'OptModels', 'TepScenariosModels'] | {
"content_hash": "8cfef32b2129f18ae4b4291882a3898a",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 81,
"avg_line_length": 37,
"alnum_prop": 0.7736486486486487,
"repo_name": "csvelasq/TepUnderScenarios",
"id": "01aab30c25bc86aea3a7418e3bf57805b8678bb1",
"size": "296",
"b... |
"""
>>> from pybrain.tools.shortcuts import buildNetwork
>>> from test_recurrent_network import buildRecurrentNetwork
>>> from test_peephole_lstm import buildMinimalLSTMNetwork
>>> from test_peephole_mdlstm import buildMinimalMDLSTMNetwork
>>> from test_nested_network import buildNestedNetwork
... | {
"content_hash": "36f29a07ced95d4303befcf297465530",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 87,
"avg_line_length": 28.48936170212766,
"alnum_prop": 0.6221060492905153,
"repo_name": "daanwierstra/pybrain",
"id": "ae90db644f67b6587e11d19b789a337b96d1dccb",
"size": ... |
import xpcom
from xpcom import components, nsError, _xpcom, logger
class Factory:
_com_interfaces_ = components.interfaces.nsIFactory
# This will only ever be constructed via other Python code,
# so we can have ctor args.
def __init__(self, klass):
self.klass = klass
def createInstance(sel... | {
"content_hash": "bb47e70d182e1e65c296c00b408dbbb7",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 86,
"avg_line_length": 38.5,
"alnum_prop": 0.6196660482374768,
"repo_name": "dgomez10/xanon",
"id": "b65483dd2db94907b55825d7a5fdf2c4d285f757",
"size": "2868",
"binary": ... |
"""Utility functions used across the application."""
import os
def list_files(root_dir, ext):
"""Return the list of files in a directory tree with a given extension.
Args:
root_dir (str): the path to the root directory.
ext (str): the file extension
Returns:
list(str): a list of... | {
"content_hash": "718fcde7a742a2c0fc02eb18838169f8",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 75,
"avg_line_length": 28.227272727272727,
"alnum_prop": 0.6231884057971014,
"repo_name": "StuartMacKay/checklists_scrapers",
"id": "7fe5272ec4b7ef353de872b7bab88f9ef2e1d0c4"... |
__author__ = 'Shamal Faily'
class GoalAssociation:
def __init__(self,associationId,envName,goalName,goalDimName,aType,subGoalName,subGoalDimName,alternativeId,rationale):
self.theId = associationId
self.theEnvironmentName = envName
self.theGoal = goalName
self.theGoalDimension = goalDimName
self.... | {
"content_hash": "0b630799540ab48ea4ef23367668bf07",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 239,
"avg_line_length": 51.32,
"alnum_prop": 0.7427903351519876,
"repo_name": "failys/CAIRIS",
"id": "493a11978d3ff6ac76cb9849942d547f019a684c",
"size": "2081",
"binary":... |
"""run_bot.py run a Clusterfuzz bot locally."""
import os
import signal
from local.butler import appengine
from local.butler import common
from local.butler import constants
def _setup_bot_directory(args):
"""Set up the bot directory."""
appengine.symlink_config_dir()
src_root_dir = os.path.abspath('.')
if ... | {
"content_hash": "052a2132447167b4e34d178eaabf59ef",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 80,
"avg_line_length": 32.46017699115044,
"alnum_prop": 0.6682115594329335,
"repo_name": "google/clusterfuzz",
"id": "19807b8df8c1d4eceaaec8ff886d9f5a74fbcee6",
"size": "4... |
"""Parser for Molpro output files"""
import itertools
import numpy
from . import logfileparser
from . import utils
def create_atomic_orbital_names(orbitals):
"""Generate all atomic orbital names that could be used by Molpro.
The names are returned in a dictionary, organized by subshell (S, P, D and so on... | {
"content_hash": "45d02dac1ed149b239a5e34c3f3e6570",
"timestamp": "",
"source": "github",
"line_count": 881,
"max_line_length": 140,
"avg_line_length": 46.82406356413167,
"alnum_prop": 0.5191263453893145,
"repo_name": "Schamnad/cclib",
"id": "f69236ac92352068f5d2d54b5ffa06afee626e79",
"size": "4145... |
from django.utils.encoding import smart_unicode
from django.utils.xmlutils import SimplerXMLGenerator
from rest_framework.compat import StringIO
import re
import xml.etree.ElementTree as ET
# From xml2dict
class XML2Dict(object):
def __init__(self):
pass
def _parse_node(self, node):
node_tre... | {
"content_hash": "a77cad024cb13d11ebf1418d22ff3ef7",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 86,
"avg_line_length": 29.29,
"alnum_prop": 0.5547968589962444,
"repo_name": "Chilledheart/seahub",
"id": "84fcb5dbbe086c9f133fa05b4e4d5754687c2ad8",
"size": "2929",
"bi... |
"""Astroid hooks for the ssl library."""
from astroid import MANAGER, parse, register_module_extender
def ssl_transform():
return parse(
"""
from _ssl import OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_INFO, OPENSSL_VERSION
from _ssl import _SSLContext, MemoryBIO
from _ssl import (
SSLErr... | {
"content_hash": "76b426663e4789902fe019a5257a5a31",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 102,
"avg_line_length": 50.353846153846156,
"alnum_prop": 0.617781851512374,
"repo_name": "ruchee/vimrc",
"id": "ddccca94dfc31e97d4fe5bcf60e97c38b46a0a5a",
"size": "3764",
... |
"""Utility functions for handling times, dates, etc."""
import datetime
import logging
import re
import warnings
import cftime
import numpy as np
import pandas as pd
import xarray as xr
from ..internal_names import (
BOUNDS_STR, RAW_END_DATE_STR, RAW_START_DATE_STR,
SUBSET_END_DATE_STR, SUBSET_START_DATE_STR,... | {
"content_hash": "f891fe33f59addaa95e3713f53698c40",
"timestamp": "",
"source": "github",
"line_count": 612,
"max_line_length": 107,
"avg_line_length": 32.6078431372549,
"alnum_prop": 0.6340950090198436,
"repo_name": "spencerkclark/aospy",
"id": "beaea138d470a3eccbf67d993fa9f434d834c73f",
"size": "... |
"""Handle Python version/platform incompatibilities."""
import sys
try:
import threading
except ImportError:
import dummy_threading as threading
py32 = sys.version_info >= (3, 2)
py3k_warning = getattr(sys, 'py3kwarning', False) or sys.version_info >= (3, 0)
py3k = sys.version_info >= (3, 0)
jython = sys.pla... | {
"content_hash": "c6a32d1ddf1c28c0588b7c2e4be39006",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 79,
"avg_line_length": 24.9765625,
"alnum_prop": 0.6199562089458868,
"repo_name": "femmerling/DirMaker",
"id": "12d349a5b86e36d05afabada774fe2b34513ed5f",
"size": "3430",
... |
from .dataset import Dataset
class DocumentDbCollectionDataset(Dataset):
"""Microsoft Azure Document Database Collection dataset.
:param additional_properties: Unmatched properties from the message are
deserialized this collection
:type additional_properties: dict[str, object]
:param description... | {
"content_hash": "03b46845d2e96dd3fcaa6d8d3f86b4e1",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 237,
"avg_line_length": 47.8235294117647,
"alnum_prop": 0.6867568675686757,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "60c3df76af60def4aa9d17d98dbad47625927bbb",
"... |
import changelog
import re
import subprocess
import sys
def checkExistingTag(version):
if (subprocess.call(('git show-ref --verify --quiet refs/heads/%s' % version).split()) == 0 or
subprocess.call(('git show-ref --verify --quiet refs/tags/%s' % version).split()) == 0):
print "Error: The tag '%s' ... | {
"content_hash": "790a1adcaab3e6c0f5a9d02c5b042985",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 147,
"avg_line_length": 30.75,
"alnum_prop": 0.6183378500451672,
"repo_name": "lumapps/lumX",
"id": "e0a639a7ef8f3dc827ef8e655c949c44899ce740",
"size": "2238",
"binary": ... |
"""
Created on Wed Jul 5 16:51:39 2017
@author: AnthonyN
https://www.quantstart.com/articles/Forecasting-Financial-Time-Series-Part-1
Predicting Price Returns
"""
import numpy as np
import pandas as pd
lags = 5
start_test = pd.to_datetime('2017-06-18')
from sklearn.linear_model import LogisticRegre... | {
"content_hash": "d11c8845a99de2adbabdd4975bf76128",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 87,
"avg_line_length": 27.20754716981132,
"alnum_prop": 0.6525658807212206,
"repo_name": "anthonyng2/Machine-Learning-For-Finance",
"id": "bcf933d7ed5d072bd45256611324464da12... |
import os
import sys
import yaml
import random
import tempfile
import threading
from rackattack.physical.tests.integration import use_local_inaugurator
import rackattack.physical.config
from rackattack.physical.ipmi import IPMI
use_local_inaugurator.verify()
VAR_DIRPATH = os.path.join("/var", "lib", "rackattackphys... | {
"content_hash": "9f326cc5b0535fb3453083f8dff140ce",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 107,
"avg_line_length": 39.28813559322034,
"alnum_prop": 0.6553062985332183,
"repo_name": "Stratoscale/rackattack-physical",
"id": "dc5e5d8235d6256afa5191ec15683af123d47a08",... |
import pandas as pd
import torch
import os
from time import time
from tqdm import tqdm
from bert_serving.client import BertClient
data_folder = os.path.dirname(os.getcwd()) + "/data"
train = pd.read_csv(data_folder + "/raw/train.csv")
bc = BertClient()
def gen_encodings(df, column):
t0 = time()
_list = list... | {
"content_hash": "00c97f14157ca314bee71082c316eed6",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 64,
"avg_line_length": 27.8,
"alnum_prop": 0.6145940390544707,
"repo_name": "Diyago/Machine-Learning-scripts",
"id": "f142ca156776f35811ee57a6be6eefc455b8d45b",
"size": "18... |
import ctypes
import platform
import sys
libfilename = "libcstreamgeo.so"
if platform.uname()[0] == "Darwin":
libfilename = "libcstreamgeo.dylib"
try:
libcstreamgeo = ctypes.cdll.LoadLibrary(libfilename)
except OSError as e:
sys.stderr.write('ERROR: cannot open shared library %s\n' % libfilename)
sys.s... | {
"content_hash": "cc907d25346239bba099a85e855eb7f9",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 120,
"avg_line_length": 39.45945945945946,
"alnum_prop": 0.75,
"repo_name": "mrdmnd/streamgeo",
"id": "76e66eed50e2d664717ffcffd2ab5a896b889ac8",
"size": "1460",
"binary"... |
import collections
import os
import sys
import abbreviations
import config
import extractor_util as util
import levenshtein
CACHE = dict() # Cache results of disk I/O
# This defines the Row object that we read in to the extractor
parser = util.RowParser([
('doc_id', 'text'),
('section_id', 'tex... | {
"content_hash": "82615e448dc7e6909c0c3af179834c0e",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 146,
"avg_line_length": 34.34920634920635,
"alnum_prop": 0.6046672828096118,
"repo_name": "HazyResearch/dd-genomics",
"id": "d345724deea65db0ad621c4aea7787c504d1f3ab",
"si... |
"""Support for Huawei LTE router notifications."""
import logging
import voluptuous as vol
import attr
from homeassistant.components.notify import (
BaseNotificationService, ATTR_TARGET, PLATFORM_SCHEMA)
from homeassistant.const import CONF_RECIPIENT, CONF_URL
import homeassistant.helpers.config_validation as cv
... | {
"content_hash": "6ee593a7d138c5c4bc374d486f3a7ba3",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 74,
"avg_line_length": 31.01923076923077,
"alnum_prop": 0.6769993800371977,
"repo_name": "aequitas/home-assistant",
"id": "2222c1333dd556b075bc76f3789bb697b11a596f",
"size"... |
'''
Testing functionality of function designed generating spreadsheet
for quintiles on another data set.
Created on 13 Nov 2014
@author: chris
'''
def main():
fname = '/home/chris/Projects/Cookit/family-food-datasets/ConsGORHH-12dec13.xls'
from quintiles import get_fruit_n_veg_data, plottity
re... | {
"content_hash": "320472f48e6209075e6250a6a3cfe2d0",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 150,
"avg_line_length": 34.03333333333333,
"alnum_prop": 0.6571988246816847,
"repo_name": "chrisjdavie/Cookit",
"id": "8b954e556892ee99c50864cd84ae91a771bebf1d",
"size": "1... |
"""
Wavefront REST API
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST API documentation... | {
"content_hash": "c0e1fb234f69ac03ba113585b7f07b81",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 409,
"avg_line_length": 35.026315789473685,
"alnum_prop": 0.7317806160781367,
"repo_name": "wavefrontHQ/python-client",
"id": "41368e5700c1537aa69642c6369a049cd7f15e48",
"s... |
from ktane.model.modules.abstract_module import AbstractModule, ModuleState
class MemoryModule(AbstractModule):
def export_to_string(self):
pass
def import_from_string(self, string):
pass
def translate_to_commands(self):
pass
def __init__(self):
super().__init__()
... | {
"content_hash": "ae7607e76cf65961c048f33da5c3e163",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 75,
"avg_line_length": 23.38888888888889,
"alnum_prop": 0.6294536817102138,
"repo_name": "hanzikl/ktane-controller",
"id": "d205172c5267331e21e50f5e3e9a3a313231ecb5",
"size... |
'''craigslist blob event module.
This should only be used internally by the client module.'''
import hashlib
import clblob
import clcommon.anybase
import clcommon.profile
class Event(object):
'''Base class for various events used in the client.'''
params = []
def __init__(self, client, method, name, ... | {
"content_hash": "0115f9292d7a2c49028423c4f38fbfa8",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 79,
"avg_line_length": 35.30672268907563,
"alnum_prop": 0.5846721409020588,
"repo_name": "pdfernhout/python-clblob",
"id": "101a2a2b5fb61ed1ee3c81bb5c28772094ca1bfe",
"siz... |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Quantization'] , ['MovingMedian'] , ['Seasonal_Minute'] , ['ARX'] ); | {
"content_hash": "5c00f236e8aa03806c715747db6f2191",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 91,
"avg_line_length": 41,
"alnum_prop": 0.7195121951219512,
"repo_name": "antoinecarme/pyaf",
"id": "da8369d4e5d0a253558d31f9a3e40d2d5f388bde",
"size": "164",
"binary": f... |
"""
sentry.conf.settings
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from hashlib import md5
from sentry.conf.defaults import *
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
i... | {
"content_hash": "58435e6f1c151ae89bcd489f88a38b22",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 92,
"avg_line_length": 32.46666666666667,
"alnum_prop": 0.6707734428473648,
"repo_name": "optimal-outsource/django-sentry",
"id": "eae9dbd0ae1962c239bd538ee5caa203c39c9015",
... |
"""
Generate data to be used with e.g. network_space.py
"""
import os
import sys
import copy
import pickle
import itertools
from multiprocessing import Pool, cpu_count
from multiprocessing.pool import ThreadPool
import numpy as np
import numpy.random as npr
from tqdm import tqdm, trange
from setup import generate_b... | {
"content_hash": "12b8c947366105113e2f37cad3d9c602",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 111,
"avg_line_length": 28.685567010309278,
"alnum_prop": 0.5683737646001797,
"repo_name": "kpj/SDEMotif",
"id": "460ed6fad3e0e8a68a9366e26036da6210550d06",
"size": "5565"... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example.local_settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "e76ccb1ca04cebaffa659970e7dc5fd0",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 77,
"avg_line_length": 26,
"alnum_prop": 0.7136752136752137,
"repo_name": "caktus/django-comps",
"id": "9c6e9a4c0d01855198ce5ec18679c8cf3150737e",
"size": "256",
"binary":... |
"""CherryPy dispatchers.
A 'dispatcher' is the object which looks up the 'page handler' callable
and collects config for the current request based on the path_info, other
request attributes, and the application architecture. The core calls the
dispatcher as early as possible, passing it a 'path_info' argument.
The de... | {
"content_hash": "68c980c2a763405acd40edfe7d5d6374",
"timestamp": "",
"source": "github",
"line_count": 636,
"max_line_length": 104,
"avg_line_length": 38.01729559748428,
"alnum_prop": 0.5928284875305017,
"repo_name": "bmbove/omxremote",
"id": "a6774cd18ce2f8bccc6c858a6baeceb7c9d01ade",
"size": "24... |
"""
If "modified" date/time is not defined in article metadata, fall back to the "created" date.
"""
from pelican import signals
from pelican.contents import Content, Article
def add_modified(content):
if not isinstance(content, Article):
return
if not content.settings.get('ALWAYS_MODIFIED', Fals... | {
"content_hash": "fc5f82e5088aed0fc4868f6243a0513f",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 92,
"avg_line_length": 28.95,
"alnum_prop": 0.696027633851468,
"repo_name": "jeorryb/datarambler",
"id": "0f2578b6675199962a5c910075dad27c0b02cb07",
"size": "579",
"binar... |
from __future__ import absolute_import
import pytest
from sentry.models import EventError
@pytest.mark.parametrize(
"error,type,message,data",
(
({"type": "unknown_error"}, "unknown_error", "Unknown error", {}),
({"type": "unknown_error", "foo": "bar"}, "unknown_error", "Unknown error", {"fo... | {
"content_hash": "9a7009d94c80b544eec2fcce800a57f1",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 100,
"avg_line_length": 31.97222222222222,
"alnum_prop": 0.5682015638575152,
"repo_name": "beeftornado/sentry",
"id": "166632a4ada01c07219b1dc4713b124762be9219",
"size": "1... |
import datetime
import io
import json
from PIL import Image
import re
from urllib import urlencode
import urllib2
from urlparse import urlparse
from openerp import api, fields, models, SUPERUSER_ID, _
from openerp.tools import image
from openerp.exceptions import Warning
from openerp.addons.website.models.website impo... | {
"content_hash": "8b2973d43d3f9b9aa99424f9940174dc",
"timestamp": "",
"source": "github",
"line_count": 552,
"max_line_length": 189,
"avg_line_length": 49.66304347826087,
"alnum_prop": 0.6075727730356753,
"repo_name": "vileopratama/vitech",
"id": "474fa747ccdba62cea4086fd6f015c9171ad8907",
"size": ... |
from f5_cccl.resource.ltm.policy import Rule
from mock import Mock
import pytest
@pytest.fixture
def bigip():
bigip = Mock()
return bigip
action_0 = {
"request": True,
"redirect": True,
"location": "http://boulder-dev.f5.com",
"httpReply": True
}
action_1 = {
"request": True,
"redir... | {
"content_hash": "0e11877fc7924c6231dd2b446348e625",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 67,
"avg_line_length": 22.651162790697676,
"alnum_prop": 0.5657084188911704,
"repo_name": "richbrowne/f5-cccl",
"id": "d3e9487530ccb17f3481bfdae476bd6d96c1c64d",
"size": "... |
from collections import deque
import re
import time
import logging
from twisted.python import log
from txstatsd.metrics.metermetric import MeterMetricReporter
SPACES = re.compile("\s+")
SLASHES = re.compile("\/+")
NON_ALNUM = re.compile("[^a-zA-Z_\-0-9\.]")
RATE = re.compile("^@([\d\.]+)")
def normalize_key(key):... | {
"content_hash": "f01033f5c9dad42d72cb87af1a21456b",
"timestamp": "",
"source": "github",
"line_count": 351,
"max_line_length": 79,
"avg_line_length": 35.09116809116809,
"alnum_prop": 0.5659657384103272,
"repo_name": "wikimedia/operations-debs-txstatsd",
"id": "425a0b9f16b9ecff2dc7eba8aeb179e2dbc2d10... |
from urlparse import urlparse
from lastuserapp import init_for, app
init_for('dev')
REDIS_URL = app.config.get('REDIS_URL', 'redis://localhost:6379/0')
# REDIS_URL is not taken by setup_default_arguments function of rq/scripts/__init__.py
# so, parse it into pieces and give it
r = urlparse(REDIS_URL)
REDIS_HOST = r... | {
"content_hash": "2538c283c132b0e982dacfc006d6bca6",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 86,
"avg_line_length": 26.066666666666666,
"alnum_prop": 0.7340153452685422,
"repo_name": "sindhus/lastuser",
"id": "4387a35f6b20a24bdd2808f1154231b7dba023a3",
"size": "391... |
def read_markers (filename):
"Read an ordered list of marker names from a file."
with open(filename, 'r') as f:
lines = f.readlines()
return [line.strip() for line in lines]
class Person:
"Person class, to contain the data on a subject."
def __init__ (self,family, id, dad, mom, sex):
self.family = fa... | {
"content_hash": "cccb1bd229ebdd425e8d747d8e125761",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 99,
"avg_line_length": 31.40625,
"alnum_prop": 0.6371475953565506,
"repo_name": "kbroman/PyBroman",
"id": "c51d46bb2133f8f50d0f10432ebd465f30b9df0e",
"size": "3357",
"bin... |
import os
#from flask import Flask
from flask import Blueprint
app = Blueprint("urls", __name__,
template_folder='templates',
static_folder='static')
#app = Flask(__name__)
app.debug = True
app.config = {}
app.config.update(dict(
#DATABASE=os.path.join(app.root_path, 'urls.db'),
DATABASE='url... | {
"content_hash": "1e5a3b96a0b3f6904fe3a778348012f9",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 53,
"avg_line_length": 21.142857142857142,
"alnum_prop": 0.6418918918918919,
"repo_name": "anokata/pythonPetProjects",
"id": "0241b9a5ce0878fcadbd7e89ceb0c8ea678bd0d4",
"si... |
#!/usr/bin/python3
import re
class foo:
"""Kinda sort not really string-y object"""
def __init__(self, val):
self.val = val
def __iter__(self):
for x in self.val:
yield x
print(re.compile('foo').match(foo('foo')))
#!/usr/bin/python3
class bar(foo):
"""slightly strin... | {
"content_hash": "d70929c72a8ae81a17fdce88a6ccd978",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 67,
"avg_line_length": 19.0625,
"alnum_prop": 0.6409836065573771,
"repo_name": "kcr/reap",
"id": "c9835cb4533ca4cb22b74d0a89b89b7b15f3d3fd",
"size": "1374",
"binary": fal... |
"""
its very common and normal to control program flow in Python
using exception handling using try..except.
try:
# some code that might raise exception.
except Exception as e:
# handle any exception raised in try block.
else:
# code that runs in case no exceptions were raised.
finally:
# ... | {
"content_hash": "95fc1519c11d06dbffce6c6e2713c042",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 65,
"avg_line_length": 27.24705882352941,
"alnum_prop": 0.6101036269430051,
"repo_name": "rajendrauppal/coding-interview",
"id": "2f13914acd30077b69f6168209f4b4172843c614",
... |
import os, cv2
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
_projectDirectory = os.path.dirname(__file__)
_imagesDirectory = os.path.join(_projectDirectory, "images")
_images = []
for _root, _dirs, _files in os.walk(_imagesDirectory):
for _file in _files:
i... | {
"content_hash": "44bfae6f0b1c502b5ed2ca08fdcbc475",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 61,
"avg_line_length": 27.37837837837838,
"alnum_prop": 0.6771964461994077,
"repo_name": "userdw/RaspberryPi_3_Starter_Kit",
"id": "fe1857c11005a873843a25b129cde0c85f914a10",... |
from mitsuba.core import *
from mitsuba.core import Transform as tf
from coll_detection import *
class Torso:
def __init__(self, itp): # itp is initial torso point
self._torso_radius = 5.5
self._torso_length = 18.0
self._init_clavile_toWorld = tf.translate(Vector(itp.x, itp.y+(self._torso_... | {
"content_hash": "32379fea49aaba56d6b5fa4ba868b000",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 200,
"avg_line_length": 44.18446601941748,
"alnum_prop": 0.5638321248077346,
"repo_name": "wbap/Hackathon2015",
"id": "31978b81ff7f22338e56d9dd5e50023b899d76be",
"size": "... |
"""Model script to test TF-TensorRT integration."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.contrib.tensorrt.test import tf_trt_integration_test_base as trt_test
from tensorflow.python.framework import constant_op... | {
"content_hash": "07986f101b5403c8c959e763945a1f5c",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 85,
"avg_line_length": 35.586776859504134,
"alnum_prop": 0.6212261960055736,
"repo_name": "seanli9jan/tensorflow",
"id": "7545bb9df20f295a8fdbc82b573cdb3407f8c5e4",
"size"... |
"""
Wrapper classes for Cif input and output from Structures.
"""
import math
import os
import re
import textwrap
import warnings
from collections import OrderedDict, deque
from functools import partial
from inspect import getfullargspec as getargspec
from io import StringIO
from itertools import groupby
from pathlib ... | {
"content_hash": "3494c47cbf71ee6a7a75405562df47ed",
"timestamp": "",
"source": "github",
"line_count": 1481,
"max_line_length": 120,
"avg_line_length": 41.072248480756244,
"alnum_prop": 0.5232623134082988,
"repo_name": "gmatteo/pymatgen",
"id": "4c0249877ff399f0656dc839f7f897671acb0738",
"size": "... |
"""Tests for Volume Code."""
import datetime
import os
import shutil
import socket
import sys
import tempfile
import time
import enum
import eventlet
import mock
from mox3 import mox
import os_brick
from oslo_concurrency import processutils
from oslo_config import cfg
from oslo_serialization import jsonutils
from osl... | {
"content_hash": "3c143c652bef4ac0b53d39a47dd7d768",
"timestamp": "",
"source": "github",
"line_count": 7610,
"max_line_length": 81,
"avg_line_length": 45.40026281208936,
"alnum_prop": 0.5468399055271262,
"repo_name": "apporc/cinder",
"id": "08c9010b7424bf6e923ad8b073678a10f13ef75d",
"size": "34622... |
"""Support for EZVIZ camera."""
import logging
from pyezviz.client import EzvizClient
from pyezviz.exceptions import HTTPError, InvalidURL, PyEzvizError
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_PASSWORD,
CONF_TIMEOUT,
CONF_TYPE,
CONF_URL,
CONF_USE... | {
"content_hash": "be6b8ea240b008c93af41cdeb744dd3c",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 87,
"avg_line_length": 30.45762711864407,
"alnum_prop": 0.6783528102392877,
"repo_name": "mezz64/home-assistant",
"id": "fbd49102f3c3875882fd70855b04f7f1bf9412fc",
"size":... |
"""
This example mirrors the 8-direction movement example here:
https://github.com/Mekire/meks-pygame-samples/blob/master/eight_dir_move.py
The difference is that this example uses delta time.
Delta time is a method of assuring that updates are unaffected by
changes in framerate.
"""
import os
import sys
import pygame... | {
"content_hash": "755537eb32a203df731180b78f075f08",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 79,
"avg_line_length": 30.58108108108108,
"alnum_prop": 0.58285461776403,
"repo_name": "imn00133/pythonSeminar17",
"id": "4fc4dccdb36ba4e6a7811567f2c8d24e9dfbcf34",
"size"... |
from django.contrib.contenttypes.generic import GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models.fields.related import ManyToManyRel, RelatedField
from django.db.models.related import RelatedObject
from django.db.models.fields.related import a... | {
"content_hash": "90b8c97defdd08e09bdefe8becf6b01d",
"timestamp": "",
"source": "github",
"line_count": 263,
"max_line_length": 86,
"avg_line_length": 34.52471482889734,
"alnum_prop": 0.5851321585903083,
"repo_name": "theatlantic/django-taggit2",
"id": "0dfd58423b84945133037ad1ea928e74498d1ba9",
"s... |
from __future__ import unicode_literals
import frappe
def get_context(context):
return { "obj": frappe.get_doc("About Us Settings", "About Us Settings") }
| {
"content_hash": "8baf8910528e8574383f4d82c35190a3",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 75,
"avg_line_length": 31.4,
"alnum_prop": 0.7261146496815286,
"repo_name": "gangadhar-kadam/hrfrappe",
"id": "13554fe53ba7ef36848e82549b6a560fda0c6cd0",
"size": "262",
"b... |
"""
Tools for managing a federated Carbon cluster.
"""
__version_info__ = ('1', '1', '10')
__version__ = '.'.join(__version_info__)
class CarbonateException(Exception):
pass
| {
"content_hash": "f85fe4b39f292d6f477de0523b27b99a",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 46,
"avg_line_length": 18.1,
"alnum_prop": 0.6187845303867403,
"repo_name": "jssjr/carbonate",
"id": "56e8fa8b17d1dec738220127b79a52632b0ab211",
"size": "181",
"binary": ... |
import pickle
import os
def read_pickle_ex(filepath):
with open(filepath, "rb") as fin:
return pickle.load(fin)
def read_pickle_withdefaults(filepath, default):
if os.path.exists(filepath):
return read_pickle_ex(filepath)
return default
def write_pickle_ex(obj, filepath):
with open(fi... | {
"content_hash": "6dc97c7598825a2bac7d23f966de7cf0",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 56,
"avg_line_length": 25.09090909090909,
"alnum_prop": 0.6721014492753623,
"repo_name": "5hun/imgov",
"id": "a68324a86954cfcc3a1697dab00769fcf7034cff",
"size": "576",
"b... |
from __future__ import absolute_import, print_function
from celery.utils.log import get_task_logger
from sentry.models import Organization, OrganizationMember
from sentry.tasks.base import instrumented_task
logger = get_task_logger(__name__)
@instrumented_task(name='sentry.tasks.send_sso_link_emails', queue='auth'... | {
"content_hash": "de418eb7a29f79dcc295f5dd281ad15f",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 74,
"avg_line_length": 30.59259259259259,
"alnum_prop": 0.6900726392251816,
"repo_name": "daevaorn/sentry",
"id": "6e708a13b931eb8d7a410532ee12090ca633a356",
"size": "826",... |
import bitcoin
from bitcoin import *
from bitcoin import hash160_to_p2sh, hash160_to_p2pkh
from util import print_error, profiler
import time
import sys
import struct
#
# Workalike python implementation of Bitcoin's CDataStream class.
#
import struct
import StringIO
import random
from keystore import xpubkey_to_addres... | {
"content_hash": "817d3c197e3b65925f2d05946b8142ec",
"timestamp": "",
"source": "github",
"line_count": 875,
"max_line_length": 159,
"avg_line_length": 36.114285714285714,
"alnum_prop": 0.5643037974683545,
"repo_name": "argentumproject/electrum-arg",
"id": "a7721148452e3577ada221cee1fb18255d893600",
... |
if __name__ == '__main__':
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(('', 9011))
sock.listen(5)
while True:
connection,address = sock.accept()
try:
connection.settimeout(5)
buf = connection.recv(1024)
print(bu... | {
"content_hash": "b9db805caee16be87c732ff6c4404259",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 60,
"avg_line_length": 31,
"alnum_prop": 0.5161290322580645,
"repo_name": "buaawp/pums",
"id": "a797e6f77a9a1dc9df89735d64f8f743d0f499cd",
"size": "558",
"binary": false,... |
from selenium import webdriver
from selenium.webdriver import ChromeOptions
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.common.keys import Keys
import re
import time
import pandas as pd
import p... | {
"content_hash": "db3275c61be85aefa9e5bfbef6092372",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 78,
"avg_line_length": 25.955555555555556,
"alnum_prop": 0.5787671232876712,
"repo_name": "jamiemori/robinhood_technical_analysis",
"id": "b3fcfed4d460b568c2b5ac6df8ae50b1b1e... |
from telemetry.core import video
from telemetry.core import web_contents
DEFAULT_TAB_TIMEOUT = 60
class Tab(web_contents.WebContents):
"""Represents a tab in the browser
The important parts of the Tab object are in the runtime and page objects.
E.g.:
# Navigates the tab to a given url.
tab.Navigat... | {
"content_hash": "02e5895b98d64f4f89a228c4ba46fdf6",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 80,
"avg_line_length": 34.14427860696517,
"alnum_prop": 0.6698236922628588,
"repo_name": "sgraham/nope",
"id": "4dc251f7c1f418eb4a0d3502dbbe95f5bc56d43e",
"size": "7026",
... |
import os
from pathlib import Path
from novelsCrawler.settings import DOWNLOADS
def main(novel_dir=DOWNLOADS, gbk_dir=None):
if gbk_dir is None or os.path.isdir(gbk_dir) is False:
gbk_dir = os.path.join(novel_dir, "gbk_novel")
if os.path.isdir(gbk_dir) is False:
os.mkdir(gbk_dir)
... | {
"content_hash": "526f3a6084c68945549d5a2ab19d6752",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 64,
"avg_line_length": 31.625,
"alnum_prop": 0.5915678524374176,
"repo_name": "yytang2012/novels-crawler",
"id": "b99a4d602fa882a987d016ab76b776a007987870",
"size": "759",
... |
import math
"""
This prediction models need a minimum range of input values of 15-20 to be able to make future predictions.
"""
class Prediction_Models:
def __init__(self, logger):
self.logger = logger
def average(self, x):
assert len(x) > 0
return float(sum(x)) / ... | {
"content_hash": "3012b77a23c5c8281ebb39ace5fcfee9",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 112,
"avg_line_length": 27.065934065934066,
"alnum_prop": 0.5245635403978888,
"repo_name": "ema/conpaas",
"id": "57c7e7fe9dc8f6a4a7f617f1c9d40b63e65d8d7c",
"size": "2464",
... |
import unittest, random, sys, time, json
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts
import h2o_kmeans, h2o_import as h2i, h2o_jobs as h2j
def define_params(SEED):
paramDict = {
# always do grid (see default below)..no destination key should be specified if grid?
# comma separat... | {
"content_hash": "1c8c6478d8b6cb1ba5093ca4cb40f0b1",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 105,
"avg_line_length": 39.05494505494506,
"alnum_prop": 0.5469893078221723,
"repo_name": "woobe/h2o",
"id": "a464baf9e64f93f96da26a35eb23ddd826c47abb",
"size": "3554",
"... |
import httplib
import json
import logging
import socket
import urlparse
import uuid
LOG = logging.getLogger(__name__)
def log_curl_request(conn, base_url, url, method, kwargs):
curl = ['curl -i -X %s' % method]
for (key, value) in kwargs['headers'].items():
header = '-H \'%s: %s\'' % (key, value)
... | {
"content_hash": "fccaedbaf2bcacbf07061d3256c93c34",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 92,
"avg_line_length": 35.291866028708135,
"alnum_prop": 0.49783080260303686,
"repo_name": "ccrouch/tuskar",
"id": "6298ca5ae66bc3dd2fbf73c00678412c9e35e1b7",
"size": "818... |
"""Functions and classes for managing collision tests between multiple objects.
This module defines the :class:`WorldCollider` class, which makes it easy to
ignore various collision pairs in a WorldModel.
For groups of objects, the :meth:`self_collision_iter` and
:meth:`group_collision_iter` functions perform broad-p... | {
"content_hash": "b824b5995cb6d277ff3576893b85b9d6",
"timestamp": "",
"source": "github",
"line_count": 748,
"max_line_length": 115,
"avg_line_length": 39.01470588235294,
"alnum_prop": 0.5624507418702669,
"repo_name": "krishauser/Klampt",
"id": "d762fda0f2ff046c156cd6eae88764fbabe07383",
"size": "2... |
import os
from setuptools import setup, find_packages
from version import get_git_version
VERSION, SOURCE_LABEL = get_git_version()
PROJECT = 'dossier.web'
AUTHOR = 'Diffeo, Inc.'
AUTHOR_EMAIL = 'support@diffeo.com'
URL = 'http://github.com/dossier/dossier.web'
DESC = 'DossierStack web services'
def read_file(file_... | {
"content_hash": "16662aa6a15f833a8c7cf98400a19cf7",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 49,
"avg_line_length": 23.35593220338983,
"alnum_prop": 0.5638606676342526,
"repo_name": "dossier/dossier.web",
"id": "c0c54ad22cf8f880d862140b146e3d3823fd5c66",
"size": "1... |
from ._globals import *
| {
"content_hash": "98c63bebe3b212e68bcb977d85dbc82e",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 23,
"avg_line_length": 24,
"alnum_prop": 0.7083333333333334,
"repo_name": "nak/pyllars",
"id": "66c5a35d75225f252c1a93a9e2045bba10339acb",
"size": "24",
"binary": false,
... |
from pretend import call_recorder, call
from static_precompiler.compilers import SCSS, SASS
from static_precompiler.exceptions import StaticCompilationError
from static_precompiler.utils import normalize_path, fix_line_breaks
import os
import pytest
def test_compile_file():
compiler = SCSS()
assert (
... | {
"content_hash": "bfce3fad39f05f55dd5621bdd08b4658",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 120,
"avg_line_length": 31.18407960199005,
"alnum_prop": 0.6094447989789407,
"repo_name": "paera/django-static-precompiler",
"id": "849b1953bcd31c676fc308eb0313b2b749fd32ec"... |
'''Support code for reading the instruction database in insns.yml'''
import itertools
import os
import re
from typing import Dict, List, Optional, Tuple, cast
from serialize.parse_helpers import (check_keys, check_str, check_bool,
check_list, index_list, get_optional_str,
... | {
"content_hash": "0baed03b9265d6c1552ac39cb109c87b",
"timestamp": "",
"source": "github",
"line_count": 405,
"max_line_length": 79,
"avg_line_length": 42.15308641975309,
"alnum_prop": 0.5279990627928772,
"repo_name": "lowRISC/opentitan",
"id": "0645887c098492ddb8ea1b9592905412e4e21ef6",
"size": "17... |
"""Tests for ceilometer/publish.py
"""
import datetime
from oslo.config import cfg
import eventlet
import mock
from ceilometer import sample
from ceilometer.openstack.common import jsonutils
from ceilometer.openstack.common import network_utils
from ceilometer.openstack.common import rpc as oslo_rpc
from ceilometer.... | {
"content_hash": "762b3e2501441b20b3f6cb2db8048085",
"timestamp": "",
"source": "github",
"line_count": 412,
"max_line_length": 78,
"avg_line_length": 38.34466019417476,
"alnum_prop": 0.5369034054943663,
"repo_name": "rickerc/ceilometer_audit",
"id": "febd947f9e9201a179e0c36939ee050678339504",
"siz... |
import re
from django.shortcuts import render, get_object_or_404
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.forms import TextInput, Select, NumberInput
from django.forms.models import modelform_factory
from django_ajax.decorators import ajax
from manage.actio... | {
"content_hash": "2f6f261a0bc56a6cd09f749335ba8349",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 83,
"avg_line_length": 32.03,
"alnum_prop": 0.5838276615672807,
"repo_name": "ReanGD/web-home-manage",
"id": "9bf83616c7b9f8f9a6af25808363223074a52472",
"size": "6431",
... |
from .controllers import candidates_import_from_master_server, candidates_import_from_sample_file, \
candidate_politician_match, retrieve_candidate_photos, retrieve_candidate_politician_match_options
from .models import CandidateCampaign, CandidateCampaignListManager, CandidateCampaignManager
from .serializers impo... | {
"content_hash": "f5f31341ca3243573cecb98129136bc7",
"timestamp": "",
"source": "github",
"line_count": 1024,
"max_line_length": 128,
"avg_line_length": 52.3212890625,
"alnum_prop": 0.6365791291039066,
"repo_name": "wevote/WebAppPublic",
"id": "95d912b2b2d9d36f0c440507f8e2550d08e2d0f3",
"size": "53... |
import json
import time
from tempest.common.rest_client import RestClient
from tempest import exceptions
class InterfacesV3ClientJSON(RestClient):
def __init__(self, config, username, password, auth_url, tenant_name=None):
super(InterfacesV3ClientJSON, self).__init__(config, username,
... | {
"content_hash": "c30a5f2445680959194506e018883480",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 79,
"avg_line_length": 40.205882352941174,
"alnum_prop": 0.5537673738112655,
"repo_name": "eltonkevani/tempest_el_env",
"id": "7fb0fa97ba40af0339af596ca0b12b79997b73d0",
"s... |
"""
<Author>
Justin Cappos
<Start Date>
March 14th, 2013
<Description>
A basic library that demonstrates PolyHash when applied to passwords (see
https://polypasswordhasher.poly.edu/ for details). This includes thresholdless
password support via AES 256.
<Usage>
import polypasswordhasher
# require kn... | {
"content_hash": "c0d5dd5747e883272d2732864e8c50d9",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 118,
"avg_line_length": 32.68,
"alnum_prop": 0.6997144022847818,
"repo_name": "PolyPasswordHasher/PolyPasswordHasher-Python",
"id": "cdd60920e4a19987da1280fcf716b691c5ce8a0e"... |
import sys
import os.path
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))
import time
import IPCThread
IPCThread = IPCThread.Class
# put your imports here
class Class (IPCThread):
def __init__(self, name, API):
IPCThread.__init__(self, name, API)
... | {
"content_hash": "011c45d900470bb958c53a7944ab9af0",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 97,
"avg_line_length": 25.25925925925926,
"alnum_prop": 0.624633431085044,
"repo_name": "kamil-mech/tvcs",
"id": "18bf0d0e2ed841737308e9d23e89e6c2a435dddc",
"size": "732",
... |
from __future__ import absolute_import, unicode_literals
import re
from unittest import TestCase
from uuid_upload_path.uuid import uuid
from uuid_upload_path.storage import upload_to_factory, upload_to
class TestCaseBase(TestCase):
# HACK: Backport for Python 2.6.
def assertRegexpMatches(self, value, regex... | {
"content_hash": "fad01da26efa0dd6ba54741431ac68b4",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 72,
"avg_line_length": 26,
"alnum_prop": 0.6319628647214854,
"repo_name": "etianen/django-uuid-upload-path",
"id": "6f905f41f803192a94afe623e7280b616acaee5a",
"size": "1508... |
from setuptools import setup
setup(
name = 'meerkat',
packages = ['meerkat'],
version = '0.3.7',
description = 'A program for reciprocal space reconstruction',
author = 'Arkadiy Simonov, Dmitry Logvinovich',
author_email = 'aglietto@gmail.com',
url = 'https://github.com/aglie/meerkat.git',
# download_url... | {
"content_hash": "a71f55157038b0eec70e990a3b986de2",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 86,
"avg_line_length": 34.285714285714285,
"alnum_prop": 0.6854166666666667,
"repo_name": "aglie/meerkat",
"id": "1c932b90fc3a2ec9199b3c3b402bb8598951f076",
"size": "480",
... |
from rbuild import errors
from rbuild import pluginapi
from rbuild.pluginapi import command
from rbuild_plugins.build import packages
from rbuild_plugins.build import refresh
class BuildPackagesCommand(command.BaseCommand):
"""
Builds or rebuilds specified packages, or all checked-out packages
if none are... | {
"content_hash": "1c80119e7c99f4686ae8e99f3271b26a",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 79,
"avg_line_length": 40.244897959183675,
"alnum_prop": 0.6610040567951319,
"repo_name": "fedora-conary/rbuild",
"id": "8283f2547a85abe57a2d6bcb653cad21a4b8b010",
"size": ... |
import re
from mezzanine import template
from django.core.urlresolvers import RegexURLResolver
from research import urls
register = template.Library()
@register.simple_tag
def active(request, pattern=''):
path = request.path
if pattern == '/' and pattern != path:
return ''
if re.search(patter... | {
"content_hash": "5566e9968f348c8ecaa15b482e53431f",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 53,
"avg_line_length": 17.40909090909091,
"alnum_prop": 0.6657963446475196,
"repo_name": "inkasjasonk/rs",
"id": "19ae36f9a8f0aa27c179eb4aedaea88cd2683bb9",
"size": "384",
... |
"""
This script generates a convolutional neural network based classifier to detect X-ray astronomical cavities.
The codes are written under the structure designed by Theano and Lasagne.
References
==========
[1] Lasagne tutorial
http://lasagne.readthedocs.io/en/latest/user/tutorial.html
[2] Theano tutorial
ht... | {
"content_hash": "e9b7cf8c34c6e83830b850c4d713e744",
"timestamp": "",
"source": "github",
"line_count": 471,
"max_line_length": 108,
"avg_line_length": 29.976645435244162,
"alnum_prop": 0.5996175366527374,
"repo_name": "myinxd/cavdet",
"id": "108730f00e9fa227c9469c0cd3d3d2bbcf3e725c",
"size": "1417... |
"""Adding the ability to specify certificate replacements
Revision ID: 33de094da890
Revises: ed422fc58ba
Create Date: 2015-11-30 15:40:19.827272
"""
# revision identifiers, used by Alembic.
revision = '33de094da890'
down_revision = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import ... | {
"content_hash": "d10468af27206556a8adf1933ae15c52",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 97,
"avg_line_length": 32.41935483870968,
"alnum_prop": 0.7213930348258707,
"repo_name": "nevins-b/lemur",
"id": "76624e966725318d75becb00909ab58dfd1faadf",
"size": "1005",... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.