text stringlengths 4 1.02M | meta dict |
|---|---|
import os
from datetime import timedelta
from flask import Flask, session, request, redirect, render_template, jsonify, send_file
from flask_assets import Environment, Bundle
from lib import tweet
app = Flask(__name__)
app.config['SECRET_KEY'] = os.environ['SECRET_KEY']
app.config['JSON_AS_ASCII'] = False
assets = En... | {
"content_hash": "5a6ad8b2fa463d482f5eccaf166bbfe1",
"timestamp": "",
"source": "github",
"line_count": 370,
"max_line_length": 101,
"avg_line_length": 27.345945945945946,
"alnum_prop": 0.6045661197865191,
"repo_name": "suitai/MyTweetApp",
"id": "6b50138fc5e6463cbe6093a2b32cae7f18e3f064",
"size": "... |
import tensorflow as tf
import numpy as np
import os
import sys
import random
import subprocess
from redis import Redis
import time
sys.path.append(os.path.realpath(".."))
import helpers.utils as hlp
from models.feed_forward import FFDiscrete
class TRPODiscreteTrainer(FFDiscrete):
def __init__(self, sess, args)... | {
"content_hash": "bb3c62af0cb7aa1f4fce85f3b407f1a9",
"timestamp": "",
"source": "github",
"line_count": 410,
"max_line_length": 119,
"avg_line_length": 42.87073170731707,
"alnum_prop": 0.5309779825908858,
"repo_name": "Fritz449/SRLF",
"id": "5f0772280cac7d1dd106e4534254b873b3a65efb",
"size": "17577... |
class kit:
def __init__(self):
self.form_status = False;
def pwd(self):
import os;
return os.getcwd();
def is_win(self):
import sys
is_windows = hasattr(sys, 'getwindowsversion')
return is_windows
def SP(self): ... | {
"content_hash": "2d37f3f6225c8f00e7c7e191ae9401a1",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 137,
"avg_line_length": 31.867346938775512,
"alnum_prop": 0.5462696125520333,
"repo_name": "shadowjohn/UCL_LIU",
"id": "72e45ee561558d8503dec22711e1a0725c2c6412",
"size": "... |
from src.infrastructure.singleton import Singleton
from src.resource.clusterresourcemanager import ClusterResourceManager
from src.resource.storagedomainresourcemanager import StorageDomainResourceManager
from src.resource.hostresourcemanager import HostResourceManager
# @singleton
class ResourceManagersContainer(Sing... | {
"content_hash": "b7399e4f9bc1058674cef75d91292b0e",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 82,
"avg_line_length": 32.638888888888886,
"alnum_prop": 0.7463829787234042,
"repo_name": "oVirt/ovirt-engine-sdk-tests",
"id": "9022ab795dfa9ab76d40cfbb9e2d8de5fd62da91",
... |
from __future__ import absolute_import, unicode_literals
from gaegraph.business_base import NodeSearch, DeleteNode
from produto_app.commands import ListProdutoCommand, SaveProdutoCommand, UpdateProdutoCommand, \
ProdutoPublicForm, ProdutoDetailForm, ProdutoShortForm
def save_produto_cmd(**produto_properties):
... | {
"content_hash": "ecb436d5a5a99d104c014880b2ea6473",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 100,
"avg_line_length": 28.893333333333334,
"alnum_prop": 0.7092754960775265,
"repo_name": "marcosxddh/aula_script",
"id": "bc902be43543bcb409da304a654f435af8938931",
"size... |
import muffin
app = muffin.Application("web")
@app.register("/text")
def text(request):
return "Hello, World!"
| {
"content_hash": "d6b3e6592560c8a7ab15aca13d9640e9",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 31,
"avg_line_length": 14.75,
"alnum_prop": 0.6779661016949152,
"repo_name": "timothycrosley/hug",
"id": "88710fcb282b2b4b7ff9db126f1f3d79cce6509b",
"size": "118",
"binary... |
import datetime
import itertools
import logging
import os
import pathlib
import platform
import subprocess
import sys
import tempfile
import time
from typing import List, NoReturn, Optional
import click
import requests
from datahub.cli.docker_check import (
check_local_docker_containers,
get_client_with_error... | {
"content_hash": "172adf55c6c63202c799a96ae9c2aeec",
"timestamp": "",
"source": "github",
"line_count": 404,
"max_line_length": 124,
"avg_line_length": 32.83168316831683,
"alnum_prop": 0.611881785283474,
"repo_name": "linkedin/WhereHows",
"id": "c94f50dd2e5fe8c441422c4e4ff3483602c3a5ae",
"size": "1... |
import socket
import datetime
import random
from future.utils import iteritems
from pandaharvester.harvesterconfig import harvester_config
from pandaharvester.harvestercore import core_utils
from pandaharvester.harvestercore.job_spec import JobSpec
from pandaharvester.harvestercore.file_spec import FileSpec
from panda... | {
"content_hash": "5152639690488a1985ee885553b07d1d",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 116,
"avg_line_length": 58.09848484848485,
"alnum_prop": 0.5095840396401096,
"repo_name": "PanDAWMS/panda-harvester",
"id": "b0d7823b5276b2b55fdb0cad77d07e840b927a2c",
"si... |
import unittest
from food_chain import recite
# Tests adapted from `problem-specifications//canonical-data.json` @ v2.1.0
class FoodChainTest(unittest.TestCase):
def test_fly(self):
expected = [
"I know an old lady who swallowed a fly.",
"I don't know why she swallowed the fly. ... | {
"content_hash": "0ef8830f2027bcf41bbf30dfeae52048",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 75,
"avg_line_length": 38.432432432432435,
"alnum_prop": 0.5672761368963901,
"repo_name": "N-Parsons/exercism-python",
"id": "e87b57ef96ae8fd116df77bcbbe70fc230fbbcb9",
"s... |
import pytz
import json
from django.core.exceptions import ValidationError
from rest_framework import serializers as ser
from rest_framework import exceptions
from api.base.exceptions import Conflict
from api.base.utils import absolute_reverse, get_user_auth
from website.project.metadata.utils import is_prereg_admin_... | {
"content_hash": "17653f3b80980cdbc9a15ec0971127fb",
"timestamp": "",
"source": "github",
"line_count": 382,
"max_line_length": 159,
"avg_line_length": 44.86910994764398,
"alnum_prop": 0.6450408401400234,
"repo_name": "binoculars/osf.io",
"id": "bee631d69d8da98f96aaf6f44f570e9ebb3b4978",
"size": "1... |
from parsl.config import Config
from parsl.executors import FluxExecutor
from parsl.providers import SlurmProvider
from parsl.launchers import SrunLauncher
config = Config(
executors=[
FluxExecutor(
provider=SlurmProvider(
partition="YOUR_PARTITION", # e.g. "pbatch", "pdebug"
... | {
"content_hash": "c3f71b13552c7803945b0f2a1e45d082",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 70,
"avg_line_length": 34.41379310344828,
"alnum_prop": 0.5340681362725451,
"repo_name": "Parsl/parsl",
"id": "1ced615f4d6267218e727354614392d9cf8bfd1e",
"size": "998",
"... |
def curry(_curried_func, *args, **kwargs):
def _curried(*moreargs, **morekwargs):
return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs))
return _curried
### Begin from Python 2.5 functools.py ########################################
# Summary of changes made to the Python 2.5 code below:... | {
"content_hash": "6119058f3557c45f566a79d172beba76",
"timestamp": "",
"source": "github",
"line_count": 320,
"max_line_length": 130,
"avg_line_length": 37.690625,
"alnum_prop": 0.581295083326424,
"repo_name": "t11e/django",
"id": "b66fdd3012d0f12ddc039b9569315b5784d0b66e",
"size": "14616",
"binar... |
import six.moves as sm
from gem import vector
def flip(plane):
''' Flips the plane.'''
fA = -plane[0]
fB = -plane[1]
fC = -plane[2]
fD = -plane[3]
fNormal = -plane[4]
return [fA, fB, fC, fD, fNormal]
def normalize(pdata):
''' Return the normalized plane.'''
vec = vector.Vector(3, d... | {
"content_hash": "331159b204442e168b945bea45a228dc",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 133,
"avg_line_length": 33.08461538461538,
"alnum_prop": 0.5370843989769821,
"repo_name": "explosiveduck/pyGameMath",
"id": "2c78a39b60ddcabdfc5533e6f85d8e7117a215a0",
"si... |
"""
The ios lacp fact class
It is in this file the configuration is collected from the device
for a given resource, parsed, and the facts tree is populated
based on the configuration.
"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from copy import deepcopy
from ansible.modu... | {
"content_hash": "b8a7ed5c83e01e0cd65fab8ba5ad7479",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 75,
"avg_line_length": 30.53846153846154,
"alnum_prop": 0.6192275398824517,
"repo_name": "thaim/ansible",
"id": "455460fc94100224c3df7dd4b2c05eb1b18e9a70",
"size": "2528",
... |
"""This example illustrates how to create an account.
Note by default this account will only be accessible via parent MCC.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more information, see the "Caching au... | {
"content_hash": "0d3481801aa8328d302986b2d59aea73",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 78,
"avg_line_length": 30.274509803921568,
"alnum_prop": 0.7007772020725389,
"repo_name": "coxmediagroup/googleads-python-lib",
"id": "273f311b3b1e8e7b95cd951987a48de813341f0... |
import rospy
from rosgraph_msgs.msg import Log
from std_msgs.msg import String
from ros_wild import Subscriber
def callback_log(msg):
u""" callback for /rosout and /rosout_agg """
print(msg.msg)
def callback_string(msg):
u""" callback for some string topic """
print(msg.data)
def main():
rosp... | {
"content_hash": "e40b3733a05eeb4490382f0b8a38158f",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 50,
"avg_line_length": 20.346153846153847,
"alnum_prop": 0.6597353497164461,
"repo_name": "yuma-m/ros_wild",
"id": "3cabb29110f1715f697ffc8a5a2fa47b3cf7405f",
"size": "554"... |
"""
Tests that data is retained after an import/export or export/import cycle.
"""
from __future__ import unicode_literals
from __future__ import print_function
from lxml import etree
import os
from shutil import rmtree, copytree
from subprocess import check_call
from tempfile import mkdtemp
from unittest import Test... | {
"content_hash": "48b5b60a238afe24100e8be49122a2bd",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 79,
"avg_line_length": 32.69911504424779,
"alnum_prop": 0.5853856562922869,
"repo_name": "mitsei/xbundle",
"id": "ab09f834298647f092b6e4296ede35f1e79935c1",
"size": "7390"... |
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
import logging
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
try:
from thrift.protocol import fastbinary
except:
fastbinary = No... | {
"content_hash": "f04e1503167e4748cb6021db6beff077",
"timestamp": "",
"source": "github",
"line_count": 10272,
"max_line_length": 188,
"avg_line_length": 30.737344236760123,
"alnum_prop": 0.6402288001925671,
"repo_name": "srishtyagrawal/storm",
"id": "5f9f324c58ccb9d6f2de6ff2b1de2056cc7d4802",
"siz... |
from glob import *
import turhouseconfig
from event import notification
configfile = ''
Glob.config = turhouseconfig.TurhouseConfig(configfile)
notification.ezs_notification('Test: ', 'Test Device', 'Test event')
| {
"content_hash": "1f40d3b0268a3ca7e59f9da69a2a9b10",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 68,
"avg_line_length": 30.571428571428573,
"alnum_prop": 0.7897196261682243,
"repo_name": "janredl/turhouse",
"id": "6d4a7ba5f4afc160c31e55e9b72e5d8338947eb4",
"size": "261"... |
from __future__ import annotations
import pandas as pd
from . import ProgressiveTest
from progressivis.core import aio, Sink
from progressivis import Print
from progressivis.table import Table
from progressivis.table.cmp_query import CmpQueryLast
from progressivis.table.constant import Constant
from progressivis.stat... | {
"content_hash": "18c1e55d54c73d13e7aa3029b6efd85b",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 85,
"avg_line_length": 37.07575757575758,
"alnum_prop": 0.6322026971802207,
"repo_name": "jdfekete/progressivis",
"id": "d5576c0de38ddc2f0eb4633de5e1e66cdfb32742",
"size": ... |
import unittest
from unittest.mock import Mock, patch
import pytest
from airflow.exceptions import AirflowException
from airflow.providers.tableau.hooks.tableau import TableauJobFinishCode
from airflow.providers.tableau.operators.tableau import TableauOperator
class TestTableauOperator(unittest.TestCase):
"""
... | {
"content_hash": "02bdf06886e7d32de337c7c650247c21",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 110,
"avg_line_length": 39.45945945945946,
"alnum_prop": 0.6525684931506849,
"repo_name": "dhuang/incubator-airflow",
"id": "4d8e20f5e02284e355e55531cce234f7d95a9dd9",
"si... |
import logging
log = logging.getLogger(__name__)
try:
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.layers.normalization import BatchNormalization
from keras.layers.advanced_activations import PReLU, LeakyReLU
from keras.optimizers import A... | {
"content_hash": "47b89d89816e50ed4bafbd94add877cc",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 82,
"avg_line_length": 32.904761904761905,
"alnum_prop": 0.6637723106608779,
"repo_name": "pierre-chaville/automlk",
"id": "f81e879774ab49f0871068206ee633d3be5c9c84",
"size... |
import vim
from orgmode._vim import echo, echom, echoe, ORGMODE, apply_count, repeat, insert_at_cursor, indent_orgmode
from orgmode import settings
from orgmode.menu import Submenu, Separator, ActionEntry, add_cmd_mapping_menu
from orgmode.keybinding import Keybinding, Plug, Command
from orgmode.liborgmode.checkboxes i... | {
"content_hash": "e3f1757d2fd47242ea57bd6a3577496f",
"timestamp": "",
"source": "github",
"line_count": 328,
"max_line_length": 107,
"avg_line_length": 29.3140243902439,
"alnum_prop": 0.6764430577223088,
"repo_name": "lucianp/dotfiles",
"id": "bb93fc1757fd04c3e6dc506b222032b68e45e4c4",
"size": "964... |
import csv
import numpy as np
import xlrd
from openerp.tools.translate import _
from openerp import netsvc
from openerp.osv import osv, fields
from lxml import etree
from tempfile import TemporaryFile
import base64
import os
import time
from datetime import date, datetime
class is_contract_automobile(osv.osv):
_n... | {
"content_hash": "91a0d5804f39f7290edabfed7c57c2ad",
"timestamp": "",
"source": "github",
"line_count": 300,
"max_line_length": 201,
"avg_line_length": 48.63333333333333,
"alnum_prop": 0.5565455791638109,
"repo_name": "tonygalmiche/is_contract_edi",
"id": "abbed9dda28a49032426a8cb99bb98fb83b91848",
... |
"""
Objects representing MediaWiki sites (wikis).
This module also includes functions to load families, which are
groups of wikis on the same topic in different languages.
"""
#
# (C) Pywikibot team, 2008-2017
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literal... | {
"content_hash": "8f8ffbd46b2ec261c78a302d8e0e31e6",
"timestamp": "",
"source": "github",
"line_count": 7946,
"max_line_length": 92,
"avg_line_length": 40.29272589982381,
"alnum_prop": 0.5546872559859573,
"repo_name": "npdoty/pywikibot",
"id": "2e282d1fd0de8e5f24b57196cb72bd1b0aa3db05",
"size": "32... |
from ..broker import Broker
class AuthServerBroker(Broker):
controller = "auth_servers"
def show(self, **kwargs):
"""Shows the details for the specified auth server.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:``... | {
"content_hash": "0b2dbb63c2680827f25c21aa46ac3f74",
"timestamp": "",
"source": "github",
"line_count": 935,
"max_line_length": 615,
"avg_line_length": 53.971122994652404,
"alnum_prop": 0.5979826803796842,
"repo_name": "infobloxopen/infoblox-netmri",
"id": "585b6c4687fdd6c28794b61ec9d4f25d3b939bab",
... |
import numpy as np
import pytest
from pandas import (
DataFrame,
Series,
)
import pandas._testing as tm
class TestConvert:
def test_convert_objects(self, float_string_frame):
oops = float_string_frame.T.T
converted = oops._convert(datetime=True)
tm.assert_frame_equal(converted, f... | {
"content_hash": "9a2ea25de8edfe7f63a11ae5d2c5c913",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 85,
"avg_line_length": 37.52542372881356,
"alnum_prop": 0.5925925925925926,
"repo_name": "pandas-dev/pandas",
"id": "118af9f532abeb96e67e761cd2c1a2e5b2c494e4",
"size": "221... |
import Tensile.Tensile as Tensile
def test_2sum_gsu_src(tmpdir):
Tensile.Tensile([Tensile.TensileTestPath("disabled/multi_sum/2sum_gsu_src.yaml"), tmpdir.strpath])
def test_2sum(tmpdir):
Tensile.Tensile([Tensile.TensileTestPath("disabled/multi_sum/2sum.yaml"), tmpdir.strpath])
def test_2sum_gsu(tmpdir):
Tensile.T... | {
"content_hash": "77ad56f4e43e57ac5f58effaa39ccc39",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 108,
"avg_line_length": 41,
"alnum_prop": 0.7815482502651113,
"repo_name": "ROCmSoftwarePlatform/Tensile",
"id": "2f08def0d6083ab441d004d5f0ed664f9a0c528e",
"size": "2243",... |
from typing import Any
from argparse import ArgumentParser
from zerver.models import all_realm_filters
from zerver.lib.actions import do_add_realm_filter, do_remove_realm_filter
from zerver.lib.management import ZulipBaseCommand
import sys
class Command(ZulipBaseCommand):
help = """Create a link filter rule for ... | {
"content_hash": "f0ac35d85c7f4bfba040e0f945cafa4e",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 95,
"avg_line_length": 42.967213114754095,
"alnum_prop": 0.5963372758489126,
"repo_name": "brockwhittaker/zulip",
"id": "a814e1c78c9dd7e2c07fc294634790abe6c779ea",
"size": ... |
from __future__ import absolute_import, print_function, unicode_literals
import json
from distutils.version import LooseVersion
def create_pages():
from cms.models import Placeholder
from cms.api import create_page, add_plugin, publish_page
from django.conf import settings
from django.contrib.auth.mo... | {
"content_hash": "bebc93413b7d6d708903701771b882af",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 85,
"avg_line_length": 35.693548387096776,
"alnum_prop": 0.6375960234975147,
"repo_name": "Glasgow2015/team-10",
"id": "1ec6075aa0ac1a72c7ce246e2ebbaddaac3b385f",
"size": "... |
from chaco.shell.scaly_plot import ScalyPlot
from enable.component_editor import ComponentEditor
from pyface.workbench.api import TraitsUIEditor
from traits.api import Any, Enum, HasTraits, Property, Str
from traitsui import api as tui
class PlotUI(HasTraits):
""" Simple Traits UI proxy for a Chaco plot.
"""
... | {
"content_hash": "eff8b0c16aedac94419418a262fab3fe",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 80,
"avg_line_length": 26.717391304347824,
"alnum_prop": 0.5728234336859235,
"repo_name": "burnpanck/chaco",
"id": "be78bd5c35665805bffe9f3371bd87a39b27e7aa",
"size": "368... |
"""A utility script to automate the process of symbolizing a SyzyASan
minidump.
"""
from collections import namedtuple
import optparse
import os
import re
import subprocess
import sys
# The sentinel value that we use at the end of the command executed in the
# debugger.
_SENTINEL = 'ENDENDEND'
# The default values... | {
"content_hash": "3639f914c12171e9862881cf06df8744",
"timestamp": "",
"source": "github",
"line_count": 622,
"max_line_length": 80,
"avg_line_length": 35.27009646302251,
"alnum_prop": 0.6287719938007111,
"repo_name": "wangming28/syzygy",
"id": "b2bf6778de0a9a39ce07b8a89017874e63a0bbd6",
"size": "22... |
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.pat... | {
"content_hash": "c0b12179801218a21730f46cbf59bd26",
"timestamp": "",
"source": "github",
"line_count": 233,
"max_line_length": 80,
"avg_line_length": 32.39484978540773,
"alnum_prop": 0.7053524112347642,
"repo_name": "ravello/testmill",
"id": "85f399cf232308ecb3beac6c6f3f0bb69425f8b2",
"size": "797... |
"""Utilities for admins."""
import csv
import ipaddress
import json
import logging
import random
from LatLon23 import string2latlon
from auvsi_suas.proto import interop_admin_api_pb2
from auvsi_suas.views.decorators import require_superuser
from auvsi_suas.views.json import ProtoJsonEncoder
from django import shortcut... | {
"content_hash": "94514ca8564a8940233a3884d85cdd33",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 78,
"avg_line_length": 35.55652173913043,
"alnum_prop": 0.6089508437270726,
"repo_name": "auvsi-suas/interop",
"id": "e7ea08321aa04002201195fb72363736090c5e2c",
"size": "4... |
class NoSyncDbRouter(object):
using = None
schema = None
app_labels = []
def db_for_read(self, model, **hints):
if model._meta.app_label in self.app_labels:
return self.using
def db_for_write(self, model, **hints):
if model._meta.app_label in self.app_labels:
... | {
"content_hash": "26d5435107947435083a4c88004eb706",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 54,
"avg_line_length": 21.77777777777778,
"alnum_prop": 0.6394557823129252,
"repo_name": "chop-dbhi/varify",
"id": "0398a6378be4160963ce729df66846836e79d42a",
"size": "1176... |
import copy
import pprint
import ipaddr
import netaddr
from neutronclient.common import exceptions as neutron_exc
from neutronclient.v2_0 import client as neutron_client
from cloudferrylib.base import exception
from cloudferrylib.base import network
from cloudferrylib.os.identity import keystone as ksresource
from c... | {
"content_hash": "b7947d65c25a85065195cd8dd31b7b2e",
"timestamp": "",
"source": "github",
"line_count": 1740,
"max_line_length": 79,
"avg_line_length": 41.76149425287356,
"alnum_prop": 0.5129704809743343,
"repo_name": "mgrygoriev/CloudFerry",
"id": "63386cf4b6f7222d0ffa8b5c29e8fcde54292072",
"size"... |
""" A script/util to upgrade all files in a directory
This is rather conservative in its approach, only copying/overwriting
new and unedited files.
To be used by "upgrade" feature.
"""
try:
from IPython.external.path import path
except ImportError:
from path import path
import md5,pickle
def showdiff(old,ne... | {
"content_hash": "54bb8d400eb17cef91af4d803d2d09f8",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 105,
"avg_line_length": 29.34065934065934,
"alnum_prop": 0.5400749063670413,
"repo_name": "toomoresuch/pysonengine",
"id": "2f31e93174ab2b1afdef4baf719ecc2a108f63b9",
"size... |
"""
Created on Thu Mar 24 08:18:04 2016
@author: npop
Decimation parameter calculator
Given an evaluation frequency, the following is calculated:
"""
import numpy as np
# utils
from utilsEvalFreq import *
from utilsIO import *
class DecimationParams(object):
###################
### CONSTRUCTOR
##################... | {
"content_hash": "341190d64812cbc3928362c518608b2b",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 136,
"avg_line_length": 31.733333333333334,
"alnum_prop": 0.6914996767937944,
"repo_name": "nss350/magPy",
"id": "348b4449acf05d21fa9e8372366e0e38a850a96c",
"size": "6188"... |
"""Tests for rss widget serializer"""
import time
import pytest
from rest_framework.serializers import ValidationError
from open_discussions.test_utils import PickleableMock
from widgets.factories import WidgetInstanceFactory, WidgetListFactory
from widgets.serializers import rss
@pytest.mark.django_db
@pytest.mark... | {
"content_hash": "71aeafe435eb261b8c0e97980a8b3f2f",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 81,
"avg_line_length": 33.08080808080808,
"alnum_prop": 0.601526717557252,
"repo_name": "mitodl/open-discussions",
"id": "bfda131a7ad0397f79b533f64ce660490585e914",
"size":... |
import pandas as pd
import os
import numpy as np
import util
# from scipy.spatial.distance import cdist
def read_route_id_process_key(city):
config = pd.read_csv(os.path.dirname(os.path.realpath(__file__)) + '/city_url.config')
return config[config['city']==city].values[0][4]
def read_city_url_from_config(ci... | {
"content_hash": "2dd3ce9e2654e3126df444f2cb6dfacb",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 90,
"avg_line_length": 29.925,
"alnum_prop": 0.6524644945697577,
"repo_name": "FiniteElementries/OneBus",
"id": "eb112cd9d97d39f157acf6afee1feaa214d4f442",
"size": "1197",
... |
import shelve, time
def startup(addPluginHook, addHook, world) :
addPluginHook(world, "delignore", main, 4, ["self", "info", "args", "world"])
def main(self, info, args, world) :
"""delignore <hostmask>
Removes a hostmask from the bot's ignore list"""
if args[1].lower() in self.ignorelist :
self.ign... | {
"content_hash": "8e1066b365d3c62934bf69c06c665ada",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 81,
"avg_line_length": 44.90909090909091,
"alnum_prop": 0.6497975708502024,
"repo_name": "sonicrules1234/sonicbot",
"id": "cac9c340933b9a562002ee9bd1bbcde2ec4e0681",
"size"... |
""" Implements a 2D-ray class - same as algebra.Ray2D, but without the
dependency from the algebra package.
A ray is an infinite line and is defined by the equation
y(x) = y0 + x * slope in a cartesian coordinate system
"""
__author__ = "mozman <mozman@gmx.at>"
import math
from dxfwrite.algebra import equals_almost,... | {
"content_hash": "5ea8edcfcd5b07380563007759aefe84",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 78,
"avg_line_length": 33.25,
"alnum_prop": 0.5798424633011099,
"repo_name": "sbarton272/AcousticBarcodes-Explorations",
"id": "d4a12f66a9421bdd8a0284f317f7b92a1a17c981",
... |
def install(*packages):
pass
def update():
pass
| {
"content_hash": "9e16a9026299e01d11ee66efef3b6b8a",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 23,
"avg_line_length": 9.666666666666666,
"alnum_prop": 0.603448275862069,
"repo_name": "hatchery/genepool",
"id": "2db5cd0a5ac700b62288074a8ed24e348cfd5226",
"size": "58",
... |
"""
Django settings for web project.
Generated by 'django-admin startproject' using Django 1.8.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths in... | {
"content_hash": "2b62ac54a92a775ab511bf44dba5cd88",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 71,
"avg_line_length": 25.774509803921568,
"alnum_prop": 0.6903765690376569,
"repo_name": "postfix/viper-1",
"id": "c00cfb0dc35d76209dd19ad566118f24ecf8eeb2",
"size": "262... |
import socket, traceback, sys, copy, re, time, threading, select
from datetime import datetime, timedelta
import apsw # See README.md
from pubsub import pub # See README.md
from libfap import * # See README.md
import settings
############################
# Classes
############################
class clsBakerMessage(... | {
"content_hash": "45e94afefb5fca60cd2f55daf50612b7",
"timestamp": "",
"source": "github",
"line_count": 610,
"max_line_length": 315,
"avg_line_length": 41.24262295081967,
"alnum_prop": 0.6545830352174259,
"repo_name": "KG7AFQ/baker",
"id": "d3a670ece763e487051f63923448215fbc82f333",
"size": "26701"... |
__author__ = 'arnaud'
from flask_selfdoc.autodoc import Autodoc # noqa: F401
from flask_selfdoc.autodoc import Selfdoc # noqa: F401
| {
"content_hash": "b740a8f31d289a042c5a183a940d9126",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 55,
"avg_line_length": 33.75,
"alnum_prop": 0.7407407407407407,
"repo_name": "jwg4/flask-autodoc",
"id": "edb516946c66de66125478c27cb1d90b3083e8d4",
"size": "135",
"binary... |
import re
import sys
import inspect
from mongrel2.config import rc
S_IP_ADDRESS = lambda x, token: ['ip_address', token]
S_WORD = lambda x, token: ['word', token]
S_EMAIL_ADDR = lambda x, token: ['email', token]
S_OPTION = lambda x, token: ['option', token.split("-")[-1]]
S_INT = lambda x, token: ['int', int(toke... | {
"content_hash": "99125e341bfcd2c5d7689cef69d0fb7d",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 106,
"avg_line_length": 32.65182186234818,
"alnum_prop": 0.6250464972101674,
"repo_name": "mongrel2/mongrel2",
"id": "dbb56e316ed5ab22d53994316f5b3549db74bd60",
"size": "8... |
def getMem():
with open('/proc/meminfo') as f:
total = int(f.readline().split()[1])
free = int(f.readline().split()[1])
buffers = int(f.readline().split()[1])
cache = int(f.readline().split()[1])
mem_use = total-free-buffers-cache
print mem_use/1024
while True:
time.sleep... | {
"content_hash": "60b4274e913cb64d55f64917eac0a4db",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 46,
"avg_line_length": 30.636363636363637,
"alnum_prop": 0.5667655786350149,
"repo_name": "edonyM/toolkitem",
"id": "45c73a1a102b7e5bfc97985adae35bdb1480cd96",
"size": "337... |
from datetime import datetime
from distutils import spawn
import argparse
import json
import os
import platform
import shutil
import socket
import sys
import urllib
import urllib2
__version__ = '5.9.1'
###############################################################################
# Options
#########################... | {
"content_hash": "8883ba0d1bd39ac3a596a04496a3ddc7",
"timestamp": "",
"source": "github",
"line_count": 376,
"max_line_length": 79,
"avg_line_length": 28.361702127659573,
"alnum_prop": 0.5837396849212303,
"repo_name": "lipis/gae-init",
"id": "50694c82f3021240d176a07fdbe8e5fef7325fc6",
"size": "1070... |
"""
Start up a Simple topology
"""
from mininet.net import Mininet
from mininet.node import Controller, RemoteController
from mininet.log import setLogLevel, info, error, warn, debug
from mininet.cli import CLI
from mininet.topo import Topo
from mininet.util import quietRun
from mininet.moduledeps import pathCheck
from... | {
"content_hash": "d198fa91d8331ccdb087b49922c9e861",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 109,
"avg_line_length": 32.12258064516129,
"alnum_prop": 0.5955011046394858,
"repo_name": "opennetworkinglab/spring-open",
"id": "a0e184e7687f70e27977873d8939236f6c884b29",
... |
from __future__ import print_function
import argparse
import random
SEPARATORS = {
'colon': ':',
'dash': '-',
'none': '',
'space': ' ',
}
def parse_args():
parser = argparse.ArgumentParser(description='Generate random MAC address')
parser.add_argument('-s', '--separator',
... | {
"content_hash": "633d971f2e44554a4103f3b843090968",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 86,
"avg_line_length": 27.06896551724138,
"alnum_prop": 0.575796178343949,
"repo_name": "olavmrk/python-macgen",
"id": "a17e1fcb820c54b1ba276e278912a7ca66178d88",
"size": "... |
__all__ = ['statement_to_annotations']
from indra.assemblers.english import EnglishAssembler
from indra.databases import identifiers
from indra.statements.agent import get_grounding, default_ns_order
grounding_ns = default_ns_order + \
['NCIT', 'PUBCHEM', 'CHEMBL']
def statement_to_annotations(stmt, annotate_a... | {
"content_hash": "35a314c66b03a0ac66c7d8dc7db7ddf3",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 74,
"avg_line_length": 35.35294117647059,
"alnum_prop": 0.5782029950083195,
"repo_name": "bgyori/indra",
"id": "7d369c63e93e71317ef6d0cc36ce93bdf6094f61",
"size": "2404",
... |
import numpy as np
import pytest
from sklearn.compose import make_column_transformer
from sklearn.datasets import load_breast_cancer, make_classification
from sklearn.exceptions import NotFittedError
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import average_precision_score, precision_reca... | {
"content_hash": "1fce328e56a2fea98ad1b66904ee5b99",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 88,
"avg_line_length": 38.1546052631579,
"alnum_prop": 0.676868695577205,
"repo_name": "sergeyf/scikit-learn",
"id": "165e2b75df36edddd7822c11a8ae95ca45b6d8e1",
"size": "1... |
from setuptools import setup
from odk_tools import __version__
setup(
name="odk_tools",
version=__version__,
description="Tools for working with ODK XLSForms.",
url="https://github.com/lindsay-stevens/",
author="Lindsay Stevens",
author_email="lindsay.stevens.au@gmail.com",
packages=['odk_t... | {
"content_hash": "5533a6c7962814e61bd63597cd39b7bd",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 55,
"avg_line_length": 28.28,
"alnum_prop": 0.6223479490806223,
"repo_name": "lindsay-stevens/odk_tools",
"id": "09167eefa2708cdcac2400477eceb256a50fc62a",
"size": "707",
... |
from django.db import models
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth import get_user_model
from fuzzy_modeling.models.utils import PyFuzzyMixin
from fuzzy.System import System
User = get_user_model()
class SystemModel(mo... | {
"content_hash": "2411c479a3c1d3e5b628c0391450d630",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 99,
"avg_line_length": 32.28089887640449,
"alnum_prop": 0.6038983640793596,
"repo_name": "arruda/cloudfuzzy",
"id": "59ddd8d663275b5c59c86c89d8f1f67791c30646",
"size": "289... |
import unittest
import mxnet as mx
import numpy as np
from converter._mxnet_converter import convert
from collections import namedtuple
from converter import utils
def _mxnet_remove_batch(input_data):
for blob in input_data:
input_data[blob] = np.reshape(input_data[blob], input_data[blob].shape[1:])
... | {
"content_hash": "1ae23736e35f396ceafc2c422f955cc6",
"timestamp": "",
"source": "github",
"line_count": 973,
"max_line_length": 98,
"avg_line_length": 31.585817060637204,
"alnum_prop": 0.521882016073927,
"repo_name": "mlperf/training_results_v0.6",
"id": "5d26c5faf754371331bf247c5c79eb03665a19c9",
... |
from oslo_serialization import jsonutils as json
from six.moves.urllib import parse as urllib
from tempest.lib.api_schema.response.compute.v2_1 import migrations as schema
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
class MigrationsClient(base_compute_clien... | {
"content_hash": "92634d6770fd9e8954e9a8a834d721b9",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 77,
"avg_line_length": 34.12,
"alnum_prop": 0.6764361078546307,
"repo_name": "HybridF5/tempest",
"id": "5eae8aaa85d8c55c578ddb8d2657e83c1d743f30",
"size": "1462",
"binary... |
"""Prints the version of bob and exits
"""
def main():
"""Main routine, called by the script that gets the configuration of bob.blitz"""
import bob.blitz
print (bob.blitz.get_config())
return 0
| {
"content_hash": "d057725d126e5de43c542b1ab870e241",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 83,
"avg_line_length": 20.5,
"alnum_prop": 0.6878048780487804,
"repo_name": "tiagofrepereira2012/bob.extension",
"id": "c5efe3d1aad02442f6f5df98523ba180deb8a8be",
"size": "... |
"""
This module defines constants that are intended to be imported into the Flask
app configuration by default.
"""
# flask.config settings.
DEBUG = False
SECRET_KEY = 'A0gjhsd3678HK'
# Misc settings.
HOST = '0.0.0.0'
LOGGING_CONF = 'mongows/configs/logging.yaml'
MONGOHQ_URL = 'http://localhost:27017/mws'
NO_SAMPLE =... | {
"content_hash": "976d8f87eeda6fa518ba9fa6bc544272",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 77,
"avg_line_length": 22.6,
"alnum_prop": 0.7345132743362832,
"repo_name": "mcomella/mongo-web-shell",
"id": "f5493ecf66a021371b5f5f0e5df8fd2472650dfc",
"size": "339",
"... |
"""
Tests specific to the lines module.
"""
from nose.tools import assert_true
from timeit import repeat
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.testing.decorators import cleanup, image_comparison
@cleanup
def test_invisible_Line_rendering():
"""
Github iss... | {
"content_hash": "324c83bbd7366ac607ced44262e3565e",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 79,
"avg_line_length": 28.81578947368421,
"alnum_prop": 0.6748858447488585,
"repo_name": "RobertABT/heightmap",
"id": "6eefd1e5353df371e3463814c9017043c9ae2916",
"size": "2... |
"""
lookupy.tests
~~~~~~~~~~~~~
This module contains tests for the lookupy module written using
nose to be run using::
$ nosetests -v
"""
import re
from nose.tools import assert_list_equal, assert_equal, assert_raises
from .lookupy import filter_items, lookup, include_keys, Q, QuerySet, \
Co... | {
"content_hash": "1f5fd506c193b7fdab037a201315c429",
"timestamp": "",
"source": "github",
"line_count": 335,
"max_line_length": 139,
"avg_line_length": 44.50149253731343,
"alnum_prop": 0.5738529648510866,
"repo_name": "naiquevin/lookupy",
"id": "1f15a091f08362e860f8344d2bcbb1c5f0e785a4",
"size": "1... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "spmurraydev.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "585a38dfd5038cd1e88be234f8d8bee8",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 75,
"avg_line_length": 25.77777777777778,
"alnum_prop": 0.7155172413793104,
"repo_name": "hijonathan/spmurraydev.com",
"id": "7bc47c71d97e69bd4e87b38cb99e8f99e000774a",
"siz... |
import os
import re
import uuid
import copy
from airflow.contrib.hooks.gcs_hook import GoogleCloudStorageHook
from airflow.contrib.hooks.gcp_dataflow_hook import DataFlowHook
from airflow.models import BaseOperator
from airflow.version import version
from airflow.utils.decorators import apply_defaults
class DataFlow... | {
"content_hash": "c0f187e6f19f520ccfbe800968fd7251",
"timestamp": "",
"source": "github",
"line_count": 407,
"max_line_length": 93,
"avg_line_length": 39.57248157248157,
"alnum_prop": 0.6103936421209487,
"repo_name": "fenglu-g/incubator-airflow",
"id": "e880642f6067c9315cf9da99697e7f42af60f06f",
"s... |
from mrcrowbar.colour import TEST_PALETTE
from mrcrowbar import models as mrc
from mrcrowbar.lib.images import base as img
class TIMFile( mrc.Block ):
file_name = mrc.Bytes( length=13 )
size = mrc.UInt32_LE()
data = mrc.Bytes( length=mrc.Ref( "size" ) )
@property
def repr( self ):
return... | {
"content_hash": "130f44b734a946dd599330ed2c1374e4",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 76,
"avg_line_length": 28.333333333333332,
"alnum_prop": 0.5859582542694497,
"repo_name": "moralrecordings/mrcrowbar",
"id": "887c9954d4cdf7583ae3001c503eef75ffb9a6c3",
"si... |
"""
The project pages map for basic_i18n
"""
from optimus.pages.views.base import PageViewBase
# from optimus.conf import settings
"""
Page objects
"""
class Index(PageViewBase):
"""
Default index page
"""
title = "My project"
template_name = "index.html"
destination = "index_{language_code}... | {
"content_hash": "82dd376eb95066291067f438ca954707",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 49,
"avg_line_length": 16.46153846153846,
"alnum_prop": 0.6542056074766355,
"repo_name": "sveetch/Optimus",
"id": "b667e4537717165b73460eeac2f1a6215850ae07",
"size": "452",... |
import datetime
import functools
import html
import logging
import os
import re
import time
import urllib
import urllib.parse
from collections import defaultdict, deque
from dataclasses import dataclass
from io import StringIO
from typing import (
Any,
Callable,
Dict,
Generic,
Iterable,
List,
... | {
"content_hash": "c6c3948c8e16a8e9dd21e56db9c854c6",
"timestamp": "",
"source": "github",
"line_count": 2423,
"max_line_length": 160,
"avg_line_length": 41.803549319026004,
"alnum_prop": 0.5907592062395103,
"repo_name": "timabbott/zulip",
"id": "9654abe8514b5cc55d9de656821105e617dfcc9f",
"size": "1... |
import re
import json
from pygics import Burst
from django.contrib import admin
from django.contrib.auth.decorators import login_required
from django.http import JsonResponse
from archon.settings import SESSION_COOKIE_AGE
from archon.view import *
ARCHON_DEBUG = False
class ManagerAbstraction:
... | {
"content_hash": "6326b5e145049501924416ff8ffab3b5",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 116,
"avg_line_length": 36.49122807017544,
"alnum_prop": 0.49198717948717946,
"repo_name": "HyechurnJang/archon",
"id": "f061361346e5c53e6f9bfc725e3bc9a264fe2453",
"size":... |
"""
Create SQL statements for QuerySets.
The code in here encapsulates all of the SQL construction so that QuerySets
themselves do not have to (and could be backed by things other than SQL
databases). The abstraction barrier only works one way: this module has to know
all about the internals of models in order to get ... | {
"content_hash": "88165a9999008742ead7736f76022694",
"timestamp": "",
"source": "github",
"line_count": 2131,
"max_line_length": 111,
"avg_line_length": 43.991553261379636,
"alnum_prop": 0.5897531628016128,
"repo_name": "pwmarcz/django",
"id": "7524a3582d46d259863aeaa42a5d55cd16b42b51",
"size": "93... |
from django.apps import AppConfig
from django.contrib.contenttypes.checks import check_generic_foreign_keys
from django.core import checks
from django.utils.translation import ugettext_lazy as _
class ContentTypesConfig(AppConfig):
name = 'django.contrib.contenttypes'
verbose_name = _("Content Types")
de... | {
"content_hash": "9ece9ff58f430b01185b2678be852bc6",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 73,
"avg_line_length": 33.083333333333336,
"alnum_prop": 0.7657430730478589,
"repo_name": "errx/django",
"id": "fbe4fccfa6c45a95d4b6f5a6141d584c7f39b84c",
"size": "397",
... |
from flask import Blueprint
from utils.crossdomains import crossdomain
from utils.config import get_app_configurations
#get app configurations
config = get_app_configurations()
static = Blueprint('static', __name__, static_folder = config['static_dir'])
@static.route('/')
def serve_index():
"""
The default request ... | {
"content_hash": "8c0a594534ffae949aa8c487d33e8e79",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 76,
"avg_line_length": 25.904761904761905,
"alnum_prop": 0.7352941176470589,
"repo_name": "DigitalSlideArchive/PanCanViewer",
"id": "ded723d02e868ab6f244daa9003f1feb7ccd3fdf"... |
from django.contrib import messages
from django.core.paginator import InvalidPage
from django.http import Http404, HttpResponsePermanentRedirect
from django.shortcuts import get_object_or_404, redirect
from django.utils.http import urlquote
from django.utils.translation import gettext_lazy as _
from django.views.generi... | {
"content_hash": "7b0fe883237a948be42abdc47853dfed",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 81,
"avg_line_length": 36.88,
"alnum_prop": 0.6404555314533622,
"repo_name": "sasha0/django-oscar",
"id": "d2eb07e9e34117d8c8620ca08530b13443307fb3",
"size": "7376",
"bi... |
from unittest.mock import patch, Mock
import pytest
import yaml
from asphalt.core import command
DerivedApplication = None
def test_quickstart_application(monkeypatch, tmpdir, capsys):
def mock_input(text):
if text == 'Project name: ':
return 'Example Project'
elif text == 'Top leve... | {
"content_hash": "ff19d707bb5100cf225c9727cd65ba76",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 94,
"avg_line_length": 29.604026845637584,
"alnum_prop": 0.6474722285196101,
"repo_name": "Siecje/asphalt",
"id": "103d3fda7b741113c0a236a1a48d654a76294063",
"size": "4411... |
import os
import unittest
from AlphaGo.util import sgf_to_gamestate
from AlphaGo.preprocessing.game_converter import run_game_converter
class TestSGFLoading(unittest.TestCase):
def test_ab_aw(self):
with open('tests/test_data/sgf_with_handicap/ab_aw.sgf', 'r') as f:
sgf_to_gamestate(f.read())... | {
"content_hash": "0e04f0fa4fb3688c5bb2fc7a55309d3b",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 75,
"avg_line_length": 30.09375,
"alnum_prop": 0.6053997923156802,
"repo_name": "Rochester-NRT/RocAlphaGo",
"id": "8d661558ce9b8e0e8967054c465268bf6190ec4e",
"size": "963",... |
"""
proxy.py
~~~~~~~~
⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on
Network monitoring, controls & Application development, testing, debugging.
:copyright: (c) 2013-present by Abhinav Singh and contributors.
:license: BSD, see LICENSE for more details.
"""
i... | {
"content_hash": "af2622b8e77cfc167a3395e9d319081d",
"timestamp": "",
"source": "github",
"line_count": 424,
"max_line_length": 93,
"avg_line_length": 39.242924528301884,
"alnum_prop": 0.5702265761163532,
"repo_name": "abhinavsingh/proxy.py",
"id": "f43c0a47329da90f0b54ce3c9ab9bec871ea351e",
"size"... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('servicemap', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='service',
name='log_services',
f... | {
"content_hash": "9e7dd2b40aaa62a3a6c854268297a2b5",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 96,
"avg_line_length": 28.037037037037038,
"alnum_prop": 0.5812417437252312,
"repo_name": "vegitron/servicemap",
"id": "c4735d01b594fd61624b1bcb88feff5ce060d95d",
"size": "... |
"""Tests for the runtime support utils."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from dragnn.protos import export_pb2
from dragnn.protos import spec_pb2
from dragnn.python import network_units
from dragnn.python import run... | {
"content_hash": "6020eb9eebbeff2622eb092c96a7bd2a",
"timestamp": "",
"source": "github",
"line_count": 327,
"max_line_length": 80,
"avg_line_length": 41.58715596330275,
"alnum_prop": 0.6348996249724245,
"repo_name": "derekjchow/models",
"id": "7488e33e1e369b100b7d50a5ae42e6241fd12ecd",
"size": "14... |
"""Translates Rackspace monitoring entities to labels in graphite_api"""
from graphite_api_rackspace import metadata
__version__ = metadata.version
__author__ = metadata.authors[0]
__license__ = metadata.license
__copyright__ = metadata.copyright
| {
"content_hash": "7ddb870a1298e01d79a33464f19e9cf0",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 72,
"avg_line_length": 27.77777777777778,
"alnum_prop": 0.752,
"repo_name": "JustinHop/graphite_api_rackspace",
"id": "8f873baa53e5881e8cbe618e1a7cc3095e7f5b46",
"size": "27... |
"""
Django settings for openlc project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... | {
"content_hash": "3972fb4c9bdb3be50d88639d5cbfbc70",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 86,
"avg_line_length": 25.649484536082475,
"alnum_prop": 0.7226688102893891,
"repo_name": "Astrogel/test",
"id": "07f359c3da7d4f8b487ef4ec0ae025b6780815d0",
"size": "2488",... |
""" Create the implicit zero concentrations in a model
:Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
:Author: Jonathan Karr <jonrkarr@gmail.com>
:Date: 2018-11-28
:Copyright: 2017-2018, Karr Lab
:License: MIT
"""
from .core import Transform
from wc_lang.core import DistributionInitConcentration
from wc_utils.ut... | {
"content_hash": "5471bd630d06f35511fe2401d25e9364",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 109,
"avg_line_length": 33.075,
"alnum_prop": 0.6643990929705216,
"repo_name": "KarrLab/obj_model",
"id": "e604c08525e2f27b6e9c0e25dd14e42659bd9b08",
"size": "1323",
"bin... |
import os
import pytest
import pip.baseparser
from pip import main
from pip import cmdoptions
from pip.basecommand import Command
from pip.commands import commands
class FakeCommand(Command):
name = 'fake'
summary = name
def main(self, args):
index_opts = cmdoptions.make_option_group(
... | {
"content_hash": "bef35c34ba51002916ccaf42d1c7cf07",
"timestamp": "",
"source": "github",
"line_count": 290,
"max_line_length": 78,
"avg_line_length": 34.682758620689654,
"alnum_prop": 0.5873931199045536,
"repo_name": "1stvamp/pip",
"id": "3801aec5bd0ce765928b7d589bb283051155cbb7",
"size": "10058",... |
from parsl.monitoring.monitoring import MonitoringHub
__all__ = ['MonitoringHub']
| {
"content_hash": "2b2738280eadb23c40ab2bbbd7e43660",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 53,
"avg_line_length": 27.666666666666668,
"alnum_prop": 0.7710843373493976,
"repo_name": "Parsl/parsl",
"id": "4f72c82e034601f32c6c0616c265444c7b8c64d7",
"size": "83",
"b... |
import os
import unicodedata
import shutil
import logging
import datetime
import re
from werkzeug.utils import secure_filename
from flask import current_app, render_template
from weasyprint import HTML, CSS
from geonature.utils.env import BACKEND_DIR
# get the root logger
log = logging.getLogger()
def remove_file(... | {
"content_hash": "855abc3e8e2cc02c514deacdb7be4cdf",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 109,
"avg_line_length": 33.77777777777778,
"alnum_prop": 0.6611842105263158,
"repo_name": "PnEcrins/GeoNature",
"id": "6fbdb01818182cc8b620a0a12bce593b60cad34b",
"size": "3... |
"""Test createwallet arguments.
"""
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
assert_raises_rpc_error
)
class CreateWalletWatchonlyTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
def skip_test_if_m... | {
"content_hash": "b43d4c32007253f08edab9db57e60922",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 126,
"avg_line_length": 41.31683168316832,
"alnum_prop": 0.6743350107836089,
"repo_name": "pstratem/bitcoin",
"id": "24799fe5f20898e710860a1696dbdaf3964704aa",
"size": "43... |
from setuptools import setup, find_packages
import sargasso
setup(
name="sargasso",
version=sargasso.__version__,
url='https://github.com/statbio/Sargasso',
license='MIT License',
author='Owen Dando',
author_email='owen.dando@ed.ac.uk',
packages=find_packages(),
install_requires=[
... | {
"content_hash": "d0d43ad94d50096c476546ef6bc1d20d",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 46,
"avg_line_length": 24.09375,
"alnum_prop": 0.569390402075227,
"repo_name": "statbio/Sargasso",
"id": "2710a99dfcbf3f85f53cce3626e9cc91957fc21d",
"size": "771",
"binar... |
"""
Miscellaneous commands.
"""
import supybot
import supybot.world as world
# Use this for the version of this plugin. You may wish to put a CVS keyword
# in here if you\'re keeping the plugin in CVS or some similar system.
__version__ = "%%VERSION%%"
__author__ = supybot.authors.jemfinch
# This is a dictionary m... | {
"content_hash": "dd27e0aad061c32bc944c7954881fa45",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 77,
"avg_line_length": 22.703703703703702,
"alnum_prop": 0.7275693311582382,
"repo_name": "ProgVal/Limnoria-test",
"id": "95dbd64b1481c95a939e3e7c21ab2cec7c601dab",
"size":... |
"""
:Authors: - Iason
"""
import argparse
import sys
import logging
import math
from reader import load_grammar
from collections import defaultdict, Counter
from sentence import make_sentence
from slice_variable import SliceVariable
from sliced_earley import SlicedEarley
from sliced_nederhof import SlicedNederhof
from... | {
"content_hash": "13a803b941834f6ce58e22330ad24d23",
"timestamp": "",
"source": "github",
"line_count": 340,
"max_line_length": 137,
"avg_line_length": 36.62352941176471,
"alnum_prop": 0.6201413427561837,
"repo_name": "wilkeraziz/pcfg-sampling",
"id": "43d3d20467ef69e52c9fc12479778e44f647b642",
"si... |
import datetime
import functools
import json
from django import http
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.db import connection, transaction
import olympia.core.logger
from . import models as context
task_log = olympia.core.logger.getLogger('z.task')
def... | {
"content_hash": "992948e6ed58ea9557e94b76f54f13c3",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 79,
"avg_line_length": 34.88780487804878,
"alnum_prop": 0.6223434004474273,
"repo_name": "aviarypl/mozilla-l10n-addons-server",
"id": "63b140d96581b9d2cc005c38cbbe3f2bf66755... |
from __future__ import absolute_import
from .. import *
import six
from django.utils.hashcompat import md5_constructor, sha_constructor
from django.utils.encoding import smart_str
from django.contrib.auth.models import AnonymousUser
from django.utils.translation import ugettext_lazy as _
import datetime
REDIRECT_FI... | {
"content_hash": "4d4e905f1aa54305875c17f70951cf92",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 146,
"avg_line_length": 37.6953642384106,
"alnum_prop": 0.6055867884750527,
"repo_name": "conversocial/mongoengine",
"id": "9eb45e773553881d2c30e366cf74fb74d7d4d257",
"siz... |
from __future__ import absolute_import
import json
import gevent
import logging
from django.conf import settings
from django.views.generic.base import View
from django.views.decorators.csrf import csrf_exempt
from django.utils.decorators import method_decorator
from queue_manager.sqs import sqs_writer
from queue_manage... | {
"content_hash": "44b5d20832d89d456cd6c4daccac5439",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 77,
"avg_line_length": 31.67241379310345,
"alnum_prop": 0.5895481763745237,
"repo_name": "CitoEngine/cito_engine",
"id": "b9cb760a8666d079245fefd32a9acf18392188cf",
"size":... |
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import ofproto_v1_3
from ryu.lib.packet import packet
from ryu.lib.packet import ethernet
class SimpleSwitch13(app_... | {
"content_hash": "5a49f252a2cdfe618ba9f809a8da5413",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 78,
"avg_line_length": 37.02298850574713,
"alnum_prop": 0.609438062713443,
"repo_name": "muzixing/ryu",
"id": "899b3845d49d6fdf5dbeead16af00531e1cca74b",
"size": "3834",
... |
import re
from configparser import ConfigParser
from os.path import isfile
from .client import ArchivesSpaceClient
from .reporter import CSVReporter
from .validator import Validator
class DACSspace:
"""Base DACSspace class. Fetches data from AS, validates and reports results."""
def __init__(self, as_config... | {
"content_hash": "fcba48409c4339705b28d3d8183de47d",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 93,
"avg_line_length": 39.22222222222222,
"alnum_prop": 0.6328611898016997,
"repo_name": "RockefellerArchiveCenter/DACSspace",
"id": "75a3d81418674b308c2cdc161299bf4d32f4eca7... |
from django.db import connection
from common import BaseEvolutionOperations
class EvolutionOperations(BaseEvolutionOperations):
def rename_column(self, opts, old_field, new_field):
if old_field.column == new_field.column:
# No Operation
return []
qn = connection.ops.qu... | {
"content_hash": "751860036361259990158fd34bf57028",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 80,
"avg_line_length": 34.357142857142854,
"alnum_prop": 0.6528066528066528,
"repo_name": "timbroder/ai-stager",
"id": "f1fade644f062ba851b92b80357469b8c9cdfcb4",
"size": "... |
__author__ = 'lqrz'
import codecs
import logging
# import glob
import sys
logger = logging.getLogger('')
hdlr = logging.FileHandler('decompoundingEvaluation.log')
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
logger.setLevel(logging.DEBUG)
... | {
"content_hash": "67e799416e30841a0142d229791303b2",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 142,
"avg_line_length": 37.910714285714285,
"alnum_prop": 0.5984455958549223,
"repo_name": "jodaiber/semantic_compound_splitting",
"id": "8fcadf363be276263a58e0a5a1f0a8dd58e... |
from unittest import TestCase
from yawast.scanner.plugins.dns import basic
class TestGetText(TestCase):
def test_get_text(self):
recs = basic.get_text("adamcaudill.com")
self.assertTrue(len(recs) > 0)
for rec in recs:
if rec.startswith("v="):
self.assertEqual... | {
"content_hash": "5d7ff08f8a0cb20a82e5d34c6cdbc362",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 85,
"avg_line_length": 26.714285714285715,
"alnum_prop": 0.6336898395721925,
"repo_name": "adamcaudill/yawast",
"id": "8dc586197cd59b1371e37d0c967543e876f1c55d",
"size": "5... |
"""Sentry logging module."""
from __future__ import absolute_import, print_function
import logging
import warnings
import pkg_resources
import six
from flask import g
from werkzeug.utils import import_string
from . import config
from .ext import InvenioLoggingBase
try:
pkg_resources.get_distribution('raven')
... | {
"content_hash": "b218d4075775a66af5bf9f77386de9ca",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 79,
"avg_line_length": 35.348101265822784,
"alnum_prop": 0.6098478066248881,
"repo_name": "inveniosoftware/invenio-logging",
"id": "f841449df72cab68ad7efe08db3f557533d9563b"... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import weakref
from tensorflow.python.eager import backprop
from tensorflow.python.eager import def_function
from tensorflow.python.framework import constant_op
from tensorflow.python.framewor... | {
"content_hash": "209db2801b2fc9ba87700e42ab79e96c",
"timestamp": "",
"source": "github",
"line_count": 280,
"max_line_length": 78,
"avg_line_length": 29.867857142857144,
"alnum_prop": 0.6663876599306469,
"repo_name": "Bismarrck/tensorflow",
"id": "77cc8ee981a176f9f57028832039fa9bfe1f47a1",
"size":... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 7, transform = "Fisher", sigma = 0.0, exog_count = 100, ar_order = 12); | {
"content_hash": "21b72392005e34a4dfda1536304aae9c",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 163,
"avg_line_length": 37.57142857142857,
"alnum_prop": 0.7034220532319392,
"repo_name": "antoinecarme/pyaf",
"id": "08198878228c7b7894c96833d3bd5dc70ad2f8a6",
"size": "263... |
from voluptuous import Schema, Required, All, Length, Range, Url
modelresource_form_schema = Schema({
Required('url'): All(unicode,Url()),
Required('filename'):unicode,
Required('resource_type'):unicode
}) | {
"content_hash": "27d79a06d71c0533c2f25719d083ff04",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 64,
"avg_line_length": 30.285714285714285,
"alnum_prop": 0.7264150943396226,
"repo_name": "itsrifat/vwadaptor",
"id": "a14cc498e8904dc5beb53835df1a60b5100f9ac1",
"size": "21... |
'''Type enumerations'''
from enum import unique
from neurom.utils import OrderedEnum
@unique
class NeuriteIter(OrderedEnum):
'''Neurite iteration orders'''
FileOrder = 1 # Order in which neurites appear in the file
# NRN simulator order: soma -> axon -> basal -> apical
# Coming from:
# https:/... | {
"content_hash": "98d47b2be7b3485d7e9e3cda409fbad2",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 135,
"avg_line_length": 25.756756756756758,
"alnum_prop": 0.6385099685204617,
"repo_name": "mgeplf/NeuroM",
"id": "40e1ff86ec2d3c720c06ff3afd9477627744bcbc",
"size": "3600"... |
"""
Some help came from:
https://stackoverflow.com/questions/21964061/qt-qlineedit-error-popup-balloon-message
"""
import sys
import Qt.QtCore as QtCore
import Qt.QtWidgets as QtWidgets
class SuggestionListWidget(QtWidgets.QWidget):
def __init__(self, parent):
super(SuggestionListWidget, self).__init_... | {
"content_hash": "5e7b557d8454e77d21b6b62ad1389f49",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 108,
"avg_line_length": 29.56875,
"alnum_prop": 0.6114986260832805,
"repo_name": "david-cattermole/qt-learning",
"id": "b49c0116cc115578fb21830af4ab414081007af2",
"size": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.