text stringlengths 4 1.02M | meta dict |
|---|---|
import sciunit
from sciunit.scores import BooleanScore
# import morphounit.capabilities as cap
import morphounit.plots as plots
import os
from subprocess import call
import shlex
import json
from datetime import datetime
import matplotlib.backends.backend_pdf
from neurom.apps.cut_plane_detection import find_cut_plane... | {
"content_hash": "cbfa4be5a63488cbe043c62ac8332dc1",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 176,
"avg_line_length": 43.50476190476191,
"alnum_prop": 0.6155866900175131,
"repo_name": "pedroernesto/morphounit",
"id": "04e34460e65044d48179cc6c247d0ee72cdd69b1",
"siz... |
"""
Flask-Uploads
-------------
Flask-Uploads provides flexible upload handling for Flask applications. It
lets you divide your uploads into sets that the application user can publish
separately.
Links
`````
* `documentation <http://packages.python.org/Flask-Uploads>`_
* `development version
<http://bitbucket.org/le... | {
"content_hash": "5aa44eb88bb8103a37c20f1de16f5922",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 83,
"avg_line_length": 29.285714285714285,
"alnum_prop": 0.6501742160278746,
"repo_name": "codecool/flask-uploads",
"id": "5d0e00cd2d0974542eb9b15066d0aa0d3c797065",
"size"... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'SliderPlugin.show_ribbon'
db.delete_column('cmsplugin_sliderplugin', 'show_ribbon')
# Renaming field 'Sli... | {
"content_hash": "e0441fbadffe762f8c7731ba6c74db31",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 170,
"avg_line_length": 62.207317073170735,
"alnum_prop": 0.5796902568123897,
"repo_name": "samirasnoun/django_cms_gallery_image",
"id": "62a419cce501cc65926651451ca35e2ccf49... |
import gzip
import logging
import os
import shutil
import time
from abc import ABC, abstractmethod
import numpy as np
import requests
from astropy.io import fits
from astropy.io.ascii import ecsv
from astropy.table import Table
from astropy.utils.data import clear_download_cache
from ..utils import makedirs_if_needed... | {
"content_hash": "dbaea0c75a546a1b5a95c6c89bc0d27d",
"timestamp": "",
"source": "github",
"line_count": 378,
"max_line_length": 112,
"avg_line_length": 31.566137566137566,
"alnum_prop": 0.5852329869259135,
"repo_name": "sagasurvey/saga",
"id": "91a1cb7abc58d4c46c238b17b6aa34c1af89155d",
"size": "11... |
try:
import cStringIO as StringIO
except ImportError:
import StringIO
import poplib
import time
from mailbox import Mailbox, Message
import mailpile.mailboxes
from mailpile.conn_brokers import Master as ConnBroker
from mailpile.i18n import gettext as _
from mailpile.i18n import ngettext as _n
from mailpile.ma... | {
"content_hash": "4570d761e764a8772bb1241edc26f91c",
"timestamp": "",
"source": "github",
"line_count": 326,
"max_line_length": 78,
"avg_line_length": 32.86503067484663,
"alnum_prop": 0.4922531267500467,
"repo_name": "laborautonomo/Mailpile",
"id": "3e18093c818890e26888513ade116b89c3a3525f",
"size"... |
from django.utils.translation import ugettext_lazy as _
from rest_framework import permissions
class IsAssetRemovable(permissions.BasePermission):
"""
Object-level permission to delete an asset
only when its records_set is empty.
"""
message = _('Cannot delete an asset with existing records bound... | {
"content_hash": "98da75001b10c210ed22a74e8faf1f20",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 80,
"avg_line_length": 31,
"alnum_prop": 0.6774193548387096,
"repo_name": "BasicWolf/minicash",
"id": "96560e0ff417a94991095402d59add59530509d9",
"size": "558",
"binary":... |
class DoublyListNode(object):
def __init__(self, val):
self.val = val
self.next = None
self.prev = None
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution(object):
def levelOrder(self, root):
... | {
"content_hash": "46c19adf5b8758eceba2f8e4ab8e9949",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 47,
"avg_line_length": 27.25581395348837,
"alnum_prop": 0.4735494880546075,
"repo_name": "youhusky/Facebook_Prepare",
"id": "1a1c1f890270a9028084a4797965c813dbaa401a",
"siz... |
from subprocess import call, check_output#, run
import subprocess
import os
from multiprocessing import Pool
import time
import argparse
import logging
def chunks(l, n):
"""Yield successive n-sized chunks from l."""
for i in range(0, len(l), n):
yield l[i:i + n]
parser = argparse.ArgumentParser()
pa... | {
"content_hash": "d83c4738a34ed5062467248a849cc692",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 161,
"avg_line_length": 33.652542372881356,
"alnum_prop": 0.6557542180810879,
"repo_name": "raonyguimaraes/ngs_metrics",
"id": "c0bbb7d4bef3bdcac2531a7bc4cc9ab3d678aa60",
... |
import sys
import numpy as np
from numpy import sqrt, squeeze, zeros_like
from numpy.random import randn, uniform
def init_unif(sz):
"""
Uniform intialization
Heuristic commonly used to initialize deep neural networks
"""
bnd = 1 / sqrt(sz[0])
p = uniform(low=-bnd, hig... | {
"content_hash": "ea6f1a6459388967fd3dac0cae5435ae",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 95,
"avg_line_length": 26.68595041322314,
"alnum_prop": 0.5602353669866832,
"repo_name": "mnick/scikit-kge",
"id": "a844b04ad5b2c1c27d7e253b970f49be2c9c8f2e",
"size": "322... |
import copy
import multiprocessing
import random
from deap import creator, base, tools, algorithms
from train import Train
creator.create("FitnessMin", base.Fitness, weights=(-1.0, 1.0, -0.1, -0.1))
creator.create("Individual", list, fitness=creator.FitnessMin)
toolbox = base.Toolbox()
toolbox.register("attr_bool"... | {
"content_hash": "f84f5289a798d7e6b7831e3340920cc3",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 96,
"avg_line_length": 30.19047619047619,
"alnum_prop": 0.6692954784437434,
"repo_name": "mikoim/funstuff",
"id": "cc59ff2422ddae04bd0b53c2d33b20509fbe975d",
"size": "1902"... |
from lookml.core import \
View,\
Dimension,Dimension_Group,Filter,Parameter,\
Measure,\
Explore,Model,Manifest, DENSE_LOOKML_THRESHOLD
from lookml.lib.project import *
from lookml import lkml
| {
"content_hash": "62620233825566fde5f5f2d7d3a749ea",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 50,
"avg_line_length": 29.714285714285715,
"alnum_prop": 0.7451923076923077,
"repo_name": "looker-open-source/pylookml",
"id": "d4321612d76938ebd8bbdb4788e93573c58b727d",
"s... |
from __future__ import division, absolute_import
from itertools import cycle
from operator import itemgetter
from toolz import unique, groupby
import bokeh.plotting as bp
from bokeh.io import _state
from bokeh.palettes import brewer
from bokeh.models import HoverTool, LinearAxis, Range1d
from ..dot import funcname
f... | {
"content_hash": "11e8e94b25c8fcfaad5abb8b1657efc1",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 87,
"avg_line_length": 31.84328358208955,
"alnum_prop": 0.5650339817201782,
"repo_name": "clarkfitzg/dask",
"id": "79c3d3bc6a0704966ee717b9a69f2fd5cd2a04a2",
"size": "8534... |
import os
import sys
import click
from alertaclient.api import Client
from alertaclient.auth.utils import get_token
from alertaclient.config import Config
CONTEXT_SETTINGS = dict(
auto_envvar_prefix='ALERTA',
default_map={'query': {'compact': True}},
help_option_names=['-h', '--help'],
)
cmd_folder = os.... | {
"content_hash": "6a4b976ba77593ab6afe6566cef9c12b",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 145,
"avg_line_length": 38.08108108108108,
"alnum_prop": 0.6462029808374734,
"repo_name": "alerta/python-alerta",
"id": "663f2e7f02e3031a1116cbc8128d31ad71dd314c",
"size": ... |
from msrest.serialization import Model
class Usage(Model):
"""Describes network resource usage.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar unit: An enum describing the unit of measurement. Default value:
"Count" .
:vartype unit: str
:pa... | {
"content_hash": "cfa1dfca78743da19f13cd3cd498317a",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 74,
"avg_line_length": 30.15,
"alnum_prop": 0.587893864013267,
"repo_name": "rjschwei/azure-sdk-for-python",
"id": "dda586f17b6a7891410dd0e1e9aa1bc6c17a9cd2",
"size": "1680... |
"""
Base settings for Sigma Pi, Gamma Iota chapter website.
"""
import os
BASE_DIR = os.getcwd()
EC_EMAIL = "gr-sigmapi@wpi.edu"
ACTIVES_EMAIL = "sigmapiactives@wpi.edu"
ALUMNI_EMAIL = "sigmapialumni@wpi.edu"
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_... | {
"content_hash": "9d29740304bf5883ddbd5bc68ccbdc70",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 85,
"avg_line_length": 30,
"alnum_prop": 0.6604790419161677,
"repo_name": "sigmapi-gammaiota/sigmapi-web",
"id": "b23a971ffd4caf424c10400e958a91461bef473e",
"size": "5010"... |
import copy
import datetime
import json
import logging
import os
import re
import time
import warnings
from collections import defaultdict
from typing import List
import pandas as pd
import requests
from pyshex import ShExEvaluator
from rdflib import Graph
from shexer.shaper import Shaper
from wikidataintegrator.wdi_... | {
"content_hash": "e5732d879d92630656dc13b138c51ea0",
"timestamp": "",
"source": "github",
"line_count": 3682,
"max_line_length": 164,
"avg_line_length": 43.96822379141771,
"alnum_prop": 0.5911631900476246,
"repo_name": "SuLab/WikidataIntegrator",
"id": "51419fccfeaf7f7eade21c2c1e91c363f82c4c04",
"s... |
r"""Classes for ADMM algorithms for Total Variation (TV) optimisation
with an :math:`\ell_1` data fidelity term"""
from __future__ import division, absolute_import
import copy
import numpy as np
from sporco.admm import admm
from sporco.array import zpad, atleast_nd, zdivide
from sporco.fft import real_dtype, fftn_fu... | {
"content_hash": "e728a85c1e3a4a001226e3656f7205b2",
"timestamp": "",
"source": "github",
"line_count": 750,
"max_line_length": 79,
"avg_line_length": 32.288,
"alnum_prop": 0.5392302609844731,
"repo_name": "bwohlberg/sporco",
"id": "5380f68077e804416eceb9264a80345bd753ace8",
"size": "24507",
"bin... |
import boto
import glob
import os
import nback.lib.logger as logger
import nback.lib.utils as utils
import nback.settings as settings
class AWSS3(logger.Logger):
FIRST_DAY_OF_MONTH = '01'
MB_IN_BYTES = 1049000
MULTIPART_UPLOAD_CHUNK_SIZE = 250 * MB_IN_BYTES
SPLIT_FILES_CMD = 'split -b %d %s %s'
... | {
"content_hash": "7a342479523421baf34437af6211dd25",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 80,
"avg_line_length": 39.104,
"alnum_prop": 0.5822422258592471,
"repo_name": "Niklas9/naktul",
"id": "4741c634b42cd5e66775b9af5a29a837c3c78c14",
"size": "4889",
"binary... |
"""Test Transformer model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import re
import sys
import unittest
from absl import flags
from absl.testing import flagsaver
import tensorflow as tf
from tensorflow.python.eager import context # py... | {
"content_hash": "a7212b0c89fe515e8c529bc7aced30b3",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 80,
"avg_line_length": 33.09604519774011,
"alnum_prop": 0.6563673608740185,
"repo_name": "tombstone/models",
"id": "a65cc4bcbf3a1c4281a36730a1ab60c496f3c7aa",
"size": "654... |
from paython.lib.cc import CreditCard
from paython.exceptions import DataValidationError
from nose.tools import assert_equals, assert_false, assert_true, with_setup, raises
def setup():
"""setting up the test"""
global test_cards
test_cards = {
'visa': "4111111111111111",
'amex': ... | {
"content_hash": "f3fa6712e32c62b1a91ec9996fff8f12",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 96,
"avg_line_length": 28.359116022099446,
"alnum_prop": 0.5536723163841808,
"repo_name": "jacobpgallagher/Paython",
"id": "bd569189d592c2459a0cf01d0fac67eebbaf5644",
"siz... |
from flask import Flask
app = Flask(__name__)
import annotaria.views | {
"content_hash": "09389eeb5c5236282809b87420112690",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 23,
"avg_line_length": 17.25,
"alnum_prop": 0.7536231884057971,
"repo_name": "ciromattia/annotaria",
"id": "e14bee08eeb9ea92fc56bfc0764ec18e0e8f1b5e",
"size": "69",
"binar... |
import re
import json
import base64
from urllib import request
from OpenSSL import crypto
from urllib.error import HTTPError
from pay_with_amazon.payment_response import PaymentResponse
class IpnHandler(object):
"""Instant Payment Notifications (IPN) can be used to monitor the state
transition of payment obj... | {
"content_hash": "3d66ddda9ef3bb16cda93a9835af368b",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 85,
"avg_line_length": 34.4478527607362,
"alnum_prop": 0.5991095280498664,
"repo_name": "srmccray/login-and-pay-with-amazon-sdk-python",
"id": "04a2f7211a550697338ef5c011de2... |
"""create notifications table
Revision ID: b2e218bdc6a2
Revises: f65b7be13efa
Create Date: 2017-03-31 20:44:45.212045
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b2e218bdc6a2'
down_revision = 'f65b7be13efa'
branch_labels = None
depends_on = None
def upgr... | {
"content_hash": "d0bc6b0434f2cf49111e89ab3ffddccf",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 70,
"avg_line_length": 23.08823529411765,
"alnum_prop": 0.6700636942675159,
"repo_name": "CrystalKoan/morpheus-api",
"id": "e1e7b4882e6ad25808e4bf7d6fdd51335cae9831",
"size... |
__all__ = ["singleton", "classproperty", "cached_property"]
from cached_property import cached_property
from singleton import singleton
class ClassPropertyDescriptor(object):
def __init__(self, func, name=None, doc=None):
self.func = func.__func__
self.__name__ = name or self.func.__name__
... | {
"content_hash": "372834c133263818b849a594ead4d6ad",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 72,
"avg_line_length": 28.88888888888889,
"alnum_prop": 0.6025641025641025,
"repo_name": "Luiti/etl_utils",
"id": "89a0417ea7047016b9200056f620e3f05d33f8f9",
"size": "1621"... |
from abc import ABC, abstractmethod
from . import conditions_combinations as combinations
class Condition(ABC):
"""Base interface of conditions"""
@abstractmethod
def __call__(self, context):
"""Execute condition
Args:
context (dict): execution context
Returns:
... | {
"content_hash": "9f8611b9cab070a4770f47370f1e2be5",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 74,
"avg_line_length": 21.53731343283582,
"alnum_prop": 0.5675675675675675,
"repo_name": "Clustaar/clustaar.authorize",
"id": "6997b51f1fbe2bd07dd77458998e6d70da97a518",
"s... |
from flask import Flask, Response,request, jsonify, url_for
import pika
import sys
import os
import socket
app = Flask(__name__)
# Enable debugging if the DEBUG environment variable is set and starts with Y
# app.debug = os.environ.get("DEBUG", "").lower().startswith('y')
#
hostname = socket.gethostname()
# urandom ... | {
"content_hash": "4600a9f92a92432e2afdfcc74b84573b",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 77,
"avg_line_length": 25.761904761904763,
"alnum_prop": 0.581022797288971,
"repo_name": "di-unipi-socc/DockerFinder",
"id": "ea6e8997d07fb2374662e6e703ee843cfce6cc09",
"si... |
from befh.restful_api_socket import RESTfulApiSocket
from befh.exchanges.gateway import ExchangeGateway
from befh.market_data import L2Depth, Trade
from befh.util import Logger
from befh.instrument import Instrument
from befh.clients.sql_template import SqlClientTemplate
from functools import partial
from datetime impo... | {
"content_hash": "91ac518ddead2292df6db4818ad15d02",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 125,
"avg_line_length": 34.50729927007299,
"alnum_prop": 0.5569539925965098,
"repo_name": "Aurora-Team/BitcoinExchangeFH",
"id": "57e40f7368e3174b0c333a02b924d1c97d238d6b",
... |
from pkg_resources import require
require("cothread==2.14")
from cothread.catools import *
import cothread
from Generic_BPMDevice import *
from subprocess import Popen, PIPE
import numpy as np
class SparkERXR_EPICS_BPMDevice(Generic_BPMDevice):
"""Libera BPM Device class that uses Epics to communicate with PVs.
... | {
"content_hash": "b0ad88669609ed04de67d055be24d9cb",
"timestamp": "",
"source": "github",
"line_count": 224,
"max_line_length": 123,
"avg_line_length": 36.066964285714285,
"alnum_prop": 0.5933902710731526,
"repo_name": "dharryman/BPM_Test_Framework",
"id": "cccc5897c9e9dac672532fd40084f12725a15b05",
... |
import socket
from os import mkdir
from os.path import join, exists
from sys import platform
from asyncio import sleep
from math import sqrt
from uuid import uuid4
from enum import Enum
from csv import DictReader
from cyrandom import choice, shuffle, uniform
from time import time
from pickle import dump as pickle_dump... | {
"content_hash": "5f9edf177cdfa2e9b0989cb8e6adb2ad",
"timestamp": "",
"source": "github",
"line_count": 336,
"max_line_length": 120,
"avg_line_length": 31.666666666666668,
"alnum_prop": 0.5942669172932331,
"repo_name": "tallypokemap/Monocle",
"id": "b22ad895c372fd003234925d28b38498d8283d26",
"size"... |
from setuptools import find_packages, setup
with open("README.md", "r") as readme:
long_description = readme.read()
setup(
name='mrnag',
version='1.0.0.dev0',
description='Utilities for aggregating information about open merge requests.',
long_description=long_description,
packages=find_pack... | {
"content_hash": "29a5438e38075ef5d495c0c01abde286",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 83,
"avg_line_length": 24,
"alnum_prop": 0.6354166666666666,
"repo_name": "hg-jt/mrnag",
"id": "672df81d75ad81e39b0da5ed3f153dda2ba250e7",
"size": "502",
"binary": false,... |
from __future__ import print_function
from six import PY2
import sys
import time
if PY2:
import exceptions
else:
import builtins as exceptions
from robot import utils
from objecttoreturn import ObjectToReturn
class ExampleLibrary:
def print_(self, msg, stream='stdout'):
"""Print given message ... | {
"content_hash": "f29973fbb647ceb95c4df01f4e4827e8",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 85,
"avg_line_length": 30.28108108108108,
"alnum_prop": 0.5885398072117101,
"repo_name": "userzimmermann/robotframework",
"id": "c31afc9605587874a7efb7505269376325402ea5",
... |
"""Dig through jobs/FOO.env, and execute a janitor pass for each of the project"""
import argparse
import json
import os
import re
import subprocess
import sys
ORIG_CWD = os.getcwd() # Checkout changes cwd
def test_infra(*paths):
"""Return path relative to root of test-infra repo."""
return os.path.join(ORI... | {
"content_hash": "34d6dd3486e345dd4f5d0a123eff0b15",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 99,
"avg_line_length": 31.765822784810126,
"alnum_prop": 0.6096832038254633,
"repo_name": "mindprince/test-infra",
"id": "a86e5b38d7ef71de65d329cc898342c77bce0a39",
"size"... |
import unittest
import checksieve
class TestSetFlag(unittest.TestCase):
def test_setflag(self):
sieve = '''
require ["imap4flags"];
setflag "\\Seen";
'''
self.assertFalse(checksieve.parse_string(sieve, False))
def test_setflag_with_variable(self):
sieve = '... | {
"content_hash": "099e45544cae508a7ce83ff20d5b1ed5",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 65,
"avg_line_length": 26.860759493670887,
"alnum_prop": 0.5645617342130066,
"repo_name": "dburkart/mail-sieve-verifier",
"id": "6add88d66ad690ed420573156a485386a68d931e",
... |
from .cmd_base import DoitCmdBase, check_tasks_exist
from .cmd_base import subtasks_iter
import os
class ResetDep(DoitCmdBase):
name = "reset-dep"
doc_purpose = ("recompute and save the state of file dependencies without "
"executing actions")
doc_usage = "[TASK ...]"
cmd_options = ... | {
"content_hash": "26c11d7da1c2a22ef1c966cf7e3b5d97",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 79,
"avg_line_length": 38.973333333333336,
"alnum_prop": 0.6117003079028396,
"repo_name": "JohannesBuchner/doit",
"id": "fffa16b90e1b820e90e55ef125dc9f0a572377c5",
"size": ... |
from collections import Counter
class Solution(object):
@staticmethod
def majorityElement(nums):
"""
majority_element == PEP8 (forced mixedCase by LeetCode)
:type nums: List[int]
:rtype: int
"""
return Counter(nums).most_common(1)[0][0]
| {
"content_hash": "766275de6a945a45a00caecb38cb7162",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 63,
"avg_line_length": 24.583333333333332,
"alnum_prop": 0.6033898305084746,
"repo_name": "the-zebulan/LeetCode",
"id": "7b22500ae9f819dbd843ef81d9d15197134d6e1c",
"size": ... |
"""
Django settings for django_event_example project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE... | {
"content_hash": "a220ff9964b33973efcbe9d53846cad6",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 71,
"avg_line_length": 22.594202898550726,
"alnum_prop": 0.6545862732520846,
"repo_name": "ailove-dev/django-event",
"id": "8ddc7be3169ae125f39b43673b7d86ab22190dda",
"siz... |
from django.conf.urls.defaults import *
urlpatterns = patterns("",
url(r"^$", "changesets.views.changesets", name="changeset_index"),
)
| {
"content_hash": "964fc849c4025e656a91f25ed0b8c1e5",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 70,
"avg_line_length": 28.2,
"alnum_prop": 0.6950354609929078,
"repo_name": "hbussell/pinax-tracker",
"id": "748cc1bf5a42708b032a2eb2c3ef34d4cfb9f9c2",
"size": "141",
"bin... |
"""
sphinxcontrib.gravatar.nodes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:author: tell-k <ffk2005@gmail.com>
:copyright: tell-k. All Rights Reserved.
"""
from __future__ import (
division,
print_function,
absolute_import,
unicode_literals,
)
import os
import posixpath
import hashl... | {
"content_hash": "f1625117acb2b769be2fab92a83b98b3",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 72,
"avg_line_length": 27.364963503649633,
"alnum_prop": 0.618031475060016,
"repo_name": "tell-k/sphinxcontrib-gravatar",
"id": "6140533439f8388d19dce37be3a43d41390c34bd",
... |
from django.core.management.base import BaseCommand, CommandError
from mapi.importers import *
class Command(BaseCommand):
help = 'Imports all stations and stores them to database'
def handle(self, *args, **options):
import_stations()
| {
"content_hash": "eefc45058e5e833a836ad634595e95e3",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 65,
"avg_line_length": 26.3,
"alnum_prop": 0.7072243346007605,
"repo_name": "timokoola/mjuna",
"id": "2c8a1b66ad219c25dd8bdfc115ed7a9c8aea6d56",
"size": "287",
"binary": ... |
import os
import math
import argparse
from PIL import Image, ImageSequence, ImageColor, ImageOps
import numpy as np
#
# First pass to read mouse light data & export into CATMAID tiles.
# WARNING: Python tuples are (x,y,z) but numpy arrays are (z,y,x)
#
class MouseStack:
def __init__(self, path, globalsize, tilesiz... | {
"content_hash": "5e5f7645fbd2cb8a99c3ff48cf77ab34",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 141,
"avg_line_length": 43.068627450980394,
"alnum_prop": 0.4988618256316868,
"repo_name": "openconnectome/open-connectome",
"id": "eee39e1ca8325786800f8237e05946d029e8cf6d"... |
"""
Nello.io lock platform.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/lock.nello/
"""
from itertools import filterfalse
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.lock im... | {
"content_hash": "c9fd241d6a70a17fdceb327d51fb9246",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 75,
"avg_line_length": 32.45454545454545,
"alnum_prop": 0.5938375350140056,
"repo_name": "stefan-jonasson/home-assistant",
"id": "04030c92425774cf68c89886bb040955fe2fb94a",
... |
"""doc."""
from flask import Blueprint, flash, redirect, render_template, request, url_for
from app import db
from helpers import object_list
from models import Port, Tag
from Port.forms import PortForm
ports = Blueprint('ports', __name__, template_folder='templates')
@ports.route('/')
def index():
"""doc."""
... | {
"content_hash": "4c08cab26c0e5102fd50d221c0154ac0",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 99,
"avg_line_length": 32.137614678899084,
"alnum_prop": 0.5695118469882957,
"repo_name": "kentaro0919/billing",
"id": "b0e61c1dbda9aef52250c61f608cc81f24cc18d4",
"size": ... |
import os
import sys
import errno
import optparse
import logging
import subprocess
import stat
import datetime
import time
import re
import fuse
from tempfile import mkstemp
from threading import Lock
fuse.fuse_python_api = (0, 2)
log = logging.getLogger('fuse_rsync')
class RsyncModule():
"""
This class... | {
"content_hash": "3d739e132acaf82ab0ac7466307685f9",
"timestamp": "",
"source": "github",
"line_count": 344,
"max_line_length": 160,
"avg_line_length": 35.21511627906977,
"alnum_prop": 0.5282317979197623,
"repo_name": "zaddach/fuse-rsync",
"id": "1df95feb779599e069444e57a2cc3e57a168fb07",
"size": "... |
import sys
import csv
import ctypes
import time
from arango import ArangoClient
monthDecode = {
"JAN":"01", "FEB":"02", "MAR":"03", "APR":"04",
"MAY":"05", "JUN":"06", "JUL":"07", "AUG":"08",
"SEP":"09", "OCT":"10", "NOV":"11", "DEC":"12"
}
def decodeDate(d):
if len(d) == 24:
month = d[3:6]
day = d[0:2]... | {
"content_hash": "8c6e3ca3755f2c42ea2d0752deac1a14",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 165,
"avg_line_length": 30.367346938775512,
"alnum_prop": 0.5789650537634409,
"repo_name": "graetzer/arangodb",
"id": "79e37f69b6c17829f66949189aecd0c8c626f86b",
"size": "4... |
import time
from concurrent import futures
# Pin Definitons:
_ledPin = 21
# blink ON duration in sec
_blink_duration = 0.15
# https://stackoverflow.com/questions/19033818/how-to-call-a-function-on-a-running-python-thread
# https://docs.python.org/3.4/library/concurrent.futures.html
# generating the executor takes tim... | {
"content_hash": "e291f400e1ca454640d2ea7c8993898b",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 133,
"avg_line_length": 37.083333333333336,
"alnum_prop": 0.5803370786516854,
"repo_name": "AlanFromJapan/alanWebSites",
"id": "e1846b92845f5c4cb0bbf9eeae61a87b50326367",
"... |
"""
reader.py
Matthew Brooks, 2018
Assembler for the MBVM.
"""
def load_from_file(file_path):
"""
TODO
:param file_path:
:return:
"""
with open(file_path, 'r') as f:
data = f.readlines()
processed_lines = []
for line in data:
line = line.strip()
# Remove c... | {
"content_hash": "7ac597a692c9d797bc94a196eb826d70",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 48,
"avg_line_length": 16.466666666666665,
"alnum_prop": 0.5607287449392713,
"repo_name": "mattixtech/mbas",
"id": "2ae993663ed63cf96bc45aa8024f1dba4f758f25",
"size": "494"... |
from django.template import Template, Context
from .base import BaseSelectableTestCase
__all__ = (
'JqueryTagTestCase',
'ThemeTagTestCase',
)
class JqueryTagTestCase(BaseSelectableTestCase):
def assertJQueryVersion(self, result, version):
expected = "//ajax.googleapis.com/ajax/libs/jquery/%s/jq... | {
"content_hash": "de96c8e239ed4f42d56b20c981af52c9",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 107,
"avg_line_length": 41.6,
"alnum_prop": 0.6339882943143813,
"repo_name": "affan2/django-selectable",
"id": "c0042fb0282ca60aa3777f2849b1a40d2701ebed",
"size": "4784",
... |
"""
Cache middleware. If enabled, each Django-powered page will be cached based on
URL. The canonical way to enable cache middleware is to set
``UpdateCacheMiddleware`` as your first piece of middleware, and
``FetchFromCacheMiddleware`` as the last::
MIDDLEWARE_CLASSES = [
'django.middleware.cache.UpdateCa... | {
"content_hash": "923b7430c84a574658a1672e5f3d6647",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 102,
"avg_line_length": 40.53107344632768,
"alnum_prop": 0.6732645664901031,
"repo_name": "errx/django",
"id": "6faebcd3f3950d8b8f619a747c7edd5a9cebd398",
"size": "7174",
... |
from django.conf.urls import include, url
from django.contrib import admin
from django.conf.urls.i18n import i18n_patterns
from .views import home, home_files
urlpatterns = [
# Examples:
# url(r'^$', 'taskbuster.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^(?P<filename>(r... | {
"content_hash": "8219770dfda4576946ca786bf1ea07b6",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 55,
"avg_line_length": 26.57894736842105,
"alnum_prop": 0.6415841584158416,
"repo_name": "RDV1984/taskbuster-boilerplate",
"id": "2b35be0c20571c96a590a32d8538318baedcef55",
... |
"""
Implements a cache for plot data at the project level. Cached plot data has a "path" (e.g. 'optimization/generations_data')
and dependencies (a list of files that are used to produce that data) as well as the parameters used in that data.
The cache object is passed to the `calc_graph` method and the plot is respons... | {
"content_hash": "96bc9c48d2edaaf7a0f3339c4ed71d75",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 123,
"avg_line_length": 41.27472527472528,
"alnum_prop": 0.6308572949946751,
"repo_name": "architecture-building-systems/CEAforArcGIS",
"id": "d569779d7d7d9593555cdbb0d260d2... |
from sn_agent_web import SettingsBase, Required
class WebSettings(SettingsBase):
def __init__(self, **custom_settings):
self.STATIC_ROOT_URL = '/static'
self.ETH_CLIENT = 'http://geth:8545'
self._ENV_PREFIX = 'SN_WEB_'
self.COOKIE_SECRET = Required(str)
super().__init__(**c... | {
"content_hash": "0229a1c3ea7ae8d2adefced6c15b795d",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 47,
"avg_line_length": 33.6,
"alnum_prop": 0.6220238095238095,
"repo_name": "jensenbox/singnet",
"id": "b56d68f9527e0ee7c2c95c446bfac218f99d2bdc",
"size": "336",
"binary"... |
'''OpenGL extension VERSION.GL_1_5
Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_VERSION_GL_1_5'
_DEPRECATED = False
GL_BUFFER_SIZE = constan... | {
"content_hash": "53af40720760eb6aed42e1f21ac81354",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 108,
"avg_line_length": 36.583333333333336,
"alnum_prop": 0.7712504495863806,
"repo_name": "Universal-Model-Converter/UMC3.0a",
"id": "a92600ef8638c2662a1d3ba09d511da7a4567d... |
import os
# Read version from VERSION file
__version__ = open(
os.path.join(os.path.dirname(os.path.realpath(__file__)), 'VERSION')
).read().rstrip()
| {
"content_hash": "b1e1831fc40627bbd5ec33ee8b13f054",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 72,
"avg_line_length": 22.285714285714285,
"alnum_prop": 0.6602564102564102,
"repo_name": "pablodav/burp_server_reports",
"id": "f70d36636215f58502603634e3405240e239ae00",
"... |
import re
from django.http import HttpResponse
from django.shortcuts import render
from rest_framework.renderers import JSONRenderer
from . import utils
def index(request, short_url):
short_url = re.sub("/seguimiento/", "", short_url)
item = utils.get_proyecto_from_short_url(short_url)
item.expediente_e... | {
"content_hash": "5325603c449a8f4e5767e3b1947fb58c",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 70,
"avg_line_length": 29.032258064516128,
"alnum_prop": 0.6155555555555555,
"repo_name": "proyectosdeley/proyectos_de_ley",
"id": "e10890ea63982992954be9364cb063095a98c494",... |
import mock
import pytest
import furl
import pytz
import datetime
from urlparse import urlparse
from nose.tools import * # noqa:
from addons.wiki.models import WikiPage
from addons.wiki.tests.factories import (
WikiFactory,
WikiVersionFactory,
)
from api.base.settings.defaults import API_BASE
from framework.... | {
"content_hash": "6f11d8292b7121e5575d375a4c303a9c",
"timestamp": "",
"source": "github",
"line_count": 619,
"max_line_length": 116,
"avg_line_length": 43.97738287560582,
"alnum_prop": 0.6433399456322092,
"repo_name": "pattisdr/osf.io",
"id": "c1d03befd4fce3dedf34cedd864bc242e94c4f1b",
"size": "272... |
import bisect
import collections
from typing import Dict, List, Optional, Set, Tuple, Union
from uqbar.objects import new
import supriya # noqa
from supriya.nonrealtime.NodeTransition import NodeTransition
from supriya.nonrealtime.SessionObject import SessionObject
from supriya.nonrealtime.State import State
class... | {
"content_hash": "b6165965bbde0655eda4608b0e569d42",
"timestamp": "",
"source": "github",
"line_count": 532,
"max_line_length": 87,
"avg_line_length": 38.80451127819549,
"alnum_prop": 0.5593392753342376,
"repo_name": "Pulgama/supriya",
"id": "20956617d90219189a934b9935369dd47599997d",
"size": "2064... |
import os
import math
import platform
import zipfile
from os import path
from PIL import Image
def find_files(directory, extensions):
for root, dirs, files in os.walk(directory):
for basename in files:
if basename.lower().endswith(extensions):
filename = path.join(root, basenam... | {
"content_hash": "54a050f8df2a84a3910f851df6899de5",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 88,
"avg_line_length": 30.68686868686869,
"alnum_prop": 0.6099407504937459,
"repo_name": "eliasku/imwork",
"id": "2c8b23f9dc1de224153f0fd06983a29869d963e2",
"size": "3038",... |
import subprocess
import sys
import os.path
import signal
def get_postfix(platform):
if platform == 'win32':
return '.exe'
elif platform == 'darwin':
return '.app'
else:
return ''
PRJ_NAME_BASE = "UnitTests"
PRJ_POSTFIX = get_postfix(sys.platform)
start_on_android = False
start_o... | {
"content_hash": "7abdbdc571aff11013e7ce3ff3dcc0cc",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 119,
"avg_line_length": 40.544642857142854,
"alnum_prop": 0.5910592380532922,
"repo_name": "dava/dava.engine",
"id": "f0a25d5745b0f967f37c3a038aa6aa0435b824b0",
"size": "5... |
"""Helper methods for common tasks."""
from __future__ import annotations
from collections.abc import Callable
import logging
from typing import TYPE_CHECKING, TypeVar
from soco import SoCo
from soco.exceptions import SoCoException, SoCoUPnPException
from typing_extensions import Concatenate, ParamSpec
from homeassi... | {
"content_hash": "6d60bf94e2d19d700299a3f5f69ae109",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 83,
"avg_line_length": 36.64835164835165,
"alnum_prop": 0.6017991004497751,
"repo_name": "rohitranjan1991/home-assistant",
"id": "fbc1d2642eabb1d76bc24cb034fc4b1c5de5e3b8",
... |
'''Inbound SQS worker.'''
import json
import logging
from utils.sqs import check_queue, delete_message
from utils.updatehelpers import update_curr_temp
queueURL = ''
logging.basicConfig(filename='SQSErrors.log')
def main():
while True:
response = check_queue(queueURL)
if response:
try... | {
"content_hash": "2c861a24b3f85554e768941f28da9b38",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 72,
"avg_line_length": 30.93103448275862,
"alnum_prop": 0.5785953177257525,
"repo_name": "ARowden/Python-Thermostat",
"id": "525e4e9f7b8bf916426f2b9eb89ceba7262308df",
"siz... |
"""
Script for building the example.
Usage:
python setup.py py2app
"""
from distutils.core import setup
import py2app
setup(
name='TableModel',
app=["TableModel.py"],
data_files=["English.lproj"],
)
| {
"content_hash": "625ed6090a32830534e2fcf8eb50e9d1",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 33,
"avg_line_length": 15.5,
"alnum_prop": 0.6728110599078341,
"repo_name": "Khan/pyobjc-framework-Cocoa",
"id": "e070366174e8f2cc8f06d7ef450b79dee8cdc990",
"size": "217",
... |
class Storage:
def __getitem__(self, key):
pass
def __setitem__(self, key, value):
pass
def __delitem__(self, key):
pass
| {
"content_hash": "4943f375aaa002b3231f5c2890df7317",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 38,
"avg_line_length": 17.666666666666668,
"alnum_prop": 0.5031446540880503,
"repo_name": "Muzer/smartbot",
"id": "46714e2cbe51fecd9686929409f4c15a1b1768cb",
"size": "159",
... |
"""A collection of random tools for dealing with dates in Python"""
from datetime import datetime, timedelta
from dateutil import parser
from dateutil.relativedelta import relativedelta
import calendar
#-------------------------------------------------------------------------------
# Miscellaneous date func... | {
"content_hash": "98eaf356c91e5f42911925fc036128fc",
"timestamp": "",
"source": "github",
"line_count": 615,
"max_line_length": 80,
"avg_line_length": 30.98048780487805,
"alnum_prop": 0.5440088175090537,
"repo_name": "willgrass/pandas",
"id": "bb1b3a1f0b18ebac52c807eac5354ad2df00b8cf",
"size": "190... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0009_auto_20150326_1241'),
]
operations = [
migrations.AlterField(
model_name='user',
name='lang',
fiel... | {
"content_hash": "459e8d78cc652ca74b6f0da749c5e1cd",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 118,
"avg_line_length": 29.24,
"alnum_prop": 0.5896032831737346,
"repo_name": "curiosityio/taiga-docker",
"id": "96eb7581bd628e19211b31fbf560423f2b44ca07",
"size": "755",
... |
"""Test suite for :data:`sphinxcontrib.argdoc`.
Test implementation
-------------------
- Unit tests are provided for regular expressions used to identify different
patterns from :obj:`argparse` output
- Unit and functional tests e.g. for :func:`sphinxcontrib.argdoc.ext.format_argparser_as_docstring` are
... | {
"content_hash": "d4b937d8adb43619abb1d2120bd882da",
"timestamp": "",
"source": "github",
"line_count": 754,
"max_line_length": 230,
"avg_line_length": 52.87002652519894,
"alnum_prop": 0.3783614288581176,
"repo_name": "Lemma1/MAC-POSTS",
"id": "33e89b2e2773386416e03ab6b76583f136f86d0f",
"size": "39... |
import re
from functools import reduce
def find_substring_n_times():
n = int(input())
text = "\n".join(input() for _ in range(n))
t = int(input())
for _ in range(t):
print(len(re.findall(r'\B(%s)\B' % input().strip(),text)))
find_substring_n_times() | {
"content_hash": "04167bb6118e1e2231a813471916af89",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 66,
"avg_line_length": 27.8,
"alnum_prop": 0.5863309352517986,
"repo_name": "vbsteja/code",
"id": "8228912dc1d266d0f69db7b1c8a55ad82c055e7c",
"size": "278",
"binary": fal... |
import http.client
import json
import time
from conf.config import VR_PORT, SERVER_PORT, OCTBS_PORT, API_TEST_KEY, CONSOLEPROXY_PORT
from models.ApiResponse import ApiResponse
from utils.commonUtil import buildRetObj
from views.api.center.api import PARAM_NOT_NULL
from core.err_code import CONNECT_SERVER_ERR
def api... | {
"content_hash": "a134204870e42a66630949977f347915",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 117,
"avg_line_length": 27.337423312883434,
"alnum_prop": 0.6824506283662477,
"repo_name": "maqg/wcrobot",
"id": "d2d0bed20fa7a2c5357505798f131a238a5854ab",
"size": "4499"... |
from robber import expect
from robber.matchers.base import Base
class Length(Base):
"""
expect('str').to.have.length(3)
expect([1, 2, 3]).to.have.length(3)
"""
def matches(self):
return len(self.actual) == self.expected
def failure_message(self):
return 'Expected "%s" to have ... | {
"content_hash": "6e557297611e891075830e8158f5b21c",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 84,
"avg_line_length": 24.55,
"alnum_prop": 0.6069246435845214,
"repo_name": "taoenator/robber.py",
"id": "5c76cd41813826e6c4141d9762b0ca1b38fa71fa",
"size": "982",
"bina... |
import textwrap
import pytest
from pants.core.goals import tailor
from pants.core.goals.tailor import (
AllOwnedSources,
DisjointSourcePutativeTarget,
EditBuildFilesRequest,
EditedBuildFiles,
PutativeTarget,
PutativeTargets,
PutativeTargetsRequest,
TailorSubsystem,
UniquelyNamedPut... | {
"content_hash": "da25f915f598c728f71ddab65c3b8a53",
"timestamp": "",
"source": "github",
"line_count": 384,
"max_line_length": 96,
"avg_line_length": 33.416666666666664,
"alnum_prop": 0.5444201995012469,
"repo_name": "jsirois/pants",
"id": "f8dd2d4622a5699c7c87f841e7131202111b3eaa",
"size": "12964... |
"""Unit tests for counters and counter names."""
from __future__ import absolute_import
import unittest
from apache_beam.utils import counters
from apache_beam.utils.counters import CounterName
class CounterNameTest(unittest.TestCase):
def test_name_string_representation(self):
counter_name = CounterName('c... | {
"content_hash": "adf9cda300f55f1fee9d1fb0c9725bc8",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 79,
"avg_line_length": 42.375,
"alnum_prop": 0.4280563749590298,
"repo_name": "RyanSkraba/beam",
"id": "d86886143dbc91f8e623fd80367bf7ec36482a0d",
"size": "3836",
"binary... |
import unittest
from pyra.iindex import InvertedIndex, INF
class TestInvertedIndex(unittest.TestCase):
def setUp(self):
pass
def test_trivial_corpus(self):
corpus = "the quick brown fox jumps over the lazy dog and the brown dog runs away"
tokens = corpus.split()
iidx = Inver... | {
"content_hash": "8aca40b40b2ae60b1393d928c8bd2693",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 90,
"avg_line_length": 60.853658536585364,
"alnum_prop": 0.47935871743486974,
"repo_name": "afourney/pyra",
"id": "0ab84bbc7db632acc3892ac51007052257c6a23f",
"size": "2541"... |
"""Dataset preprocessing utils, for creating tf records etc.."""
import tensorflow.compat.v1 as tf
def int64_feature(value):
return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))
def int64_list_feature(value):
return tf.train.Feature(int64_list=tf.train.Int64List(value=value))
def bytes_featu... | {
"content_hash": "1440d75b8e7bd0237c6734fbe0195be0",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 71,
"avg_line_length": 26.25925925925926,
"alnum_prop": 0.7588152327221439,
"repo_name": "tensorflow/tpu",
"id": "12950b0ca41a387bb62ddc26549d78323fd0bf9e",
"size": "1398",... |
"""add new netloc tracking table
Revision ID: 669e9df34ea7
Revises: 5552dfae2cb0
Create Date: 2020-01-20 01:36:51.862767
"""
# revision identifiers, used by Alembic.
revision = '669e9df34ea7'
down_revision = '5552dfae2cb0'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from s... | {
"content_hash": "31aa352dc940ab8b6f015d5f984258d3",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 106,
"avg_line_length": 32.943396226415096,
"alnum_prop": 0.7394043528064147,
"repo_name": "fake-name/ReadableWebProxy",
"id": "bd385f28e893098f82c6b5f494e2c5b0c69f04e7",
"... |
from django.db import connection
from django.shortcuts import render_to_response
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from data_related_to_me import DataRelatedToMe
from .forms import FilterForm
# Create your views here.
@login_required
def view_test_query(req... | {
"content_hash": "8a4bbae5db5161e82552cc69fb228d9e",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 110,
"avg_line_length": 33.29370629370629,
"alnum_prop": 0.626339004410838,
"repo_name": "IQSS/miniverse",
"id": "29bf0fc81ca74e2b4424ee8b9a96a424e503d7be",
"size": "4761"... |
from shotgun_api3.shotgun import Shotgun
from elefant.utilities import config
from shotgun_replica import cleanSysName, connectors, _create_shotgun_classes, thumbnails
from shotgun_replica.utilities import debug
from shotgun_replica.sync import sync_settings
# leave empty for every entity to be checked
UPDATE_ONLY = [... | {
"content_hash": "f08d758144f48db4b9bf69b8a3d41bfb",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 89,
"avg_line_length": 34.471698113207545,
"alnum_prop": 0.5514504652435687,
"repo_name": "dahiro/shotgun-replica",
"id": "b459142a683e59d14e91196600dd1d091b5591b0",
"size... |
import SocketServer
import json
import Globals
from Vec2D import Vec2D
from Environment import Environment
from Circle import Circle,Obstacle
def trajectory(start,v_start,end,v_end,delta_t,obstacles):
obs = obstacles + Globals.STATIC_OBSTACLES
env = Environment(obs)
return env.path(start,v_start,end,v_e... | {
"content_hash": "216ea8d85a69b5902762115a1e5664f2",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 94,
"avg_line_length": 32.33870967741935,
"alnum_prop": 0.5635910224438903,
"repo_name": "31415us/linesNcircles",
"id": "1bbf5f1069c05f465c0de5e07d842fb4075f2fee",
"size": ... |
"""
@author: J.W. Spaak
Contains all functions, that are needed to generate communities as well as
compute the EF of those communities
Contains the same functions as community_construction_coex, but does so for
the replacing community structure
"""
import numpy as np
import pickle
from numpy.random import uniform as ... | {
"content_hash": "22fd41abe23ce5834cb1a858b8faca23",
"timestamp": "",
"source": "github",
"line_count": 393,
"max_line_length": 86,
"avg_line_length": 41.770992366412216,
"alnum_prop": 0.5699317738791423,
"repo_name": "juergspaak/EF-at-invariant-richness",
"id": "3abd09f6c4c2bc0a2a170beb12cd3ed8e0b13... |
"""Tests for pipelines_common."""
# internal imports
import tensorflow as tf
from magenta.common import testing_lib as common_testing_lib
from magenta.music import sequences_lib
from magenta.music import testing_lib
from magenta.pipelines import pipelines_common
from magenta.protobuf import music_pb2
class Pipeline... | {
"content_hash": "464e83c7a3e3eb9bacf0d0d085b578b1",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 118,
"avg_line_length": 37.166666666666664,
"alnum_prop": 0.6236386931454196,
"repo_name": "bda2017-shallowermind/MusTGAN",
"id": "d1530de72254eb115ecbde75e5d133179f2da2f5",
... |
scene.run("BehaviorSetCommon.py")
def setupBehaviorSet():
scene = getScene()
print "Setting up behavior set for Reaching ..."
#scene.loadAssetsFromPath("behaviorsets/reaching/skeletons")
#scene.loadAssetsFromPath("behaviorsets/reaching/motions")
scene.addAssetPath("script", "behaviorsets/reaching/scripts")
... | {
"content_hash": "2e001487330f4b61026ab165914f0567",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 82,
"avg_line_length": 54.53367875647668,
"alnum_prop": 0.8120665083135392,
"repo_name": "gsi-upm/SmartSim",
"id": "edafd907e60acd58b7b00c63ebad4a2375d1a98b",
"size": "105... |
import argparse
from ConfigParser import ConfigParser
import pexpect
def main(args):
url = args.url
user, host = url.split('@', 1)
cfg_file = 'ssh.cfg'
cfg = ConfigParser()
cfg.read(cfg_file)
passwd = cfg.get(user, host)
child = pexpect.spawn('ssh {0}'.format(url))
child.expect('passw... | {
"content_hash": "bc338709e290416f665ebd3a085a9134",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 75,
"avg_line_length": 24.17391304347826,
"alnum_prop": 0.6438848920863309,
"repo_name": "lifuzu/bashrc.d",
"id": "3f73f65b3780dd34f1a53bf36e1acd3deb9f2bf4",
"size": "694",... |
import unittest
import sys, os, time
import json
sys.path.append('./')
import browser.firefox as firefox
import common.shared as shared
from cstests.smoketests.smokecfg import smokecfg
import cspages.login.loginpage as loginpage
import cspages.dashboard.dashboardpage as dashboardpage
# from cstests.smoketests import... | {
"content_hash": "b3bfc7fcb93db78ba375fd0135889369",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 115,
"avg_line_length": 35.96774193548387,
"alnum_prop": 0.6964125560538117,
"repo_name": "DaanHoogland/cloudstack",
"id": "01ea449505ec54a7d5910cbfb6bf18284b0e5035",
"size... |
import copy
import datetime
import logging
import os
import django
from django.core.urlresolvers import reverse
from django import http
from django.utils import timezone
from django.utils import unittest
from mox import IgnoreArg # noqa
from mox import IsA # noqa
from horizon import exceptions
from horizon.workflo... | {
"content_hash": "b56b7e28f769178dfd2f35b93d785de7",
"timestamp": "",
"source": "github",
"line_count": 1805,
"max_line_length": 81,
"avg_line_length": 44.89418282548476,
"alnum_prop": 0.5220031098057606,
"repo_name": "AlexOugh/horizon",
"id": "bf8d6ae197b1fd70b6a84a19b3d39cb1f2f3eeef",
"size": "81... |
"""Module contains classes presenting Element and Specie (Element + oxidation state) and PeriodicTable."""
import re
import json
import warnings
from io import open
from pathlib import Path
from enum import Enum
from typing import Optional, Callable
from itertools import product, \
combinations
from collections im... | {
"content_hash": "03ac7a8f45b963ad80fa1cf6b53db4fc",
"timestamp": "",
"source": "github",
"line_count": 1571,
"max_line_length": 106,
"avg_line_length": 31.476129853596436,
"alnum_prop": 0.5283221096483245,
"repo_name": "tschaume/pymatgen",
"id": "18f171406e6c07fdb8b90b0a673392134f6ab47e",
"size": ... |
from tempest.api.identity import base
from tempest.common.utils import data_utils
from tempest import test
class EndPointsTestJSON(base.BaseIdentityV2AdminTest):
@classmethod
def resource_setup(cls):
super(EndPointsTestJSON, cls).resource_setup()
cls.service_ids = list()
s_name = data... | {
"content_hash": "fcbca992815f75ed47ee71db0e3bd9f3",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 79,
"avg_line_length": 44.63636363636363,
"alnum_prop": 0.6287459994180972,
"repo_name": "Tesora/tesora-tempest",
"id": "651a3161ffe4109999b1f75cf97d0a6518ed7f8d",
"size": ... |
"""The tests for the Demo Media player platform."""
import datetime
import socket
import unittest
import pysonos.snapshot
from unittest import mock
import pysonos
from pysonos import alarms
from homeassistant.setup import setup_component
from homeassistant.components.media_player import sonos, DOMAIN
from homeassistan... | {
"content_hash": "0d522d2856c537b56e3e1007cb7ac9c3",
"timestamp": "",
"source": "github",
"line_count": 341,
"max_line_length": 79,
"avg_line_length": 37.0791788856305,
"alnum_prop": 0.6088263207845619,
"repo_name": "persandstrom/home-assistant",
"id": "cb3da3ab8998d73e31ad682930161e20e3991178",
"s... |
import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ENDI_FEED = 'http://elnuevodia.feedsportal.com/c/34275/f/623466/index.rss'
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
PROJECT_PATH = os.sep.join(os.path.realpath(os.path.dirname(__file__)).split('/'))
PROJECT_NAME = PROJECT_PATH.split... | {
"content_hash": "026c75a8b486d50f6225236adcc55a14",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 124,
"avg_line_length": 35.026490066225165,
"alnum_prop": 0.6825486859519758,
"repo_name": "gcollazo/angryt",
"id": "f1502d209f81998b720515b6a25443d8b48a89fd",
"size": "53... |
from contextlib import contextmanager
import os
import shutil
import tempfile
import yaml
class FilemakerBase(object): # pragma: nocover
"""Override marked methods to do something useful. Base class serves as
a dry-run step generator.
"""
def __init__(self, root, fdef):
self.fdef = fdef
... | {
"content_hash": "86cc3080ab8c19caefe9eb0c96bf7d11",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 76,
"avg_line_length": 26.391752577319586,
"alnum_prop": 0.559375,
"repo_name": "thebjorn/pydeps",
"id": "30362ab625e22c789c0c5ba0dc5a01077fb9db85",
"size": "2584",
"bina... |
import time
import json
from websocket import create_connection
from behave import given, when, then, step
from assertpy import assert_that
from websocketservice import WebSocketService
@given( 'the websocket connection is open' )
def step_impl( context ):
context.ws = create_connection( context.websockurl )
@giv... | {
"content_hash": "686d83eec956046f2d86a8c63773da70",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 71,
"avg_line_length": 30.434782608695652,
"alnum_prop": 0.6635714285714286,
"repo_name": "Eelco81/server-test-project",
"id": "e1ae116a252092a708ccc36a9f82275b2c68b515",
"... |
"""Recipe r"""
import os
from mako.template import Template
from birdhousebuilder.recipe import conda
r_install_script = Template(
"""
% for pkg in pkg_list:
install.packages("${pkg}", dependencies = TRUE, repo="${repo}")
% endfor
"""
)
def install_pkgs(pkgs, repo, prefix):
from subprocess import check_call
... | {
"content_hash": "50a83f1bbd9c2c9d5497d7e01b317d69",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 76,
"avg_line_length": 24.468354430379748,
"alnum_prop": 0.5773409208484221,
"repo_name": "bird-house/birdhousebuilder.recipe.r",
"id": "f7a86e77300d211e155e2c98e815ded96e409... |
from _thread import start_new_thread
from .socket_server import Server
def init():
start_new_thread(Server.start, ())
| {
"content_hash": "31af43e7cedc99867aa1468d17b6505f",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 38,
"avg_line_length": 17.857142857142858,
"alnum_prop": 0.72,
"repo_name": "JanlizWorldlet/FeelUOwn",
"id": "345f9079f8abfe00bf451caafaa6d9557e951d45",
"size": "150",
"bi... |
from datetime import datetime, timedelta
import time
from pysolar.util import get_sunrise_sunset
START_DATE = datetime.strptime('2013-01-31', "%Y-%m-%d")
LAT, LON = 52.518611111111, 13.408055555556
def daterange(start_date, end_date):
for n in range(int((end_date - start_date).days)):
yield start_date + ... | {
"content_hash": "afa7d0c73d28548e924b25ab6eb329ce",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 81,
"avg_line_length": 32.5,
"alnum_prop": 0.6802197802197802,
"repo_name": "morreene/tradenews",
"id": "1f5b5c57328840576c1cda010ef63b42dc203ce5",
"size": "910",
"binary... |
class Consumer(object):
"""
A class for consuming resources
"""
API_KEY = 'abcdefghijklmnopqustuvwxyz'
def process_resource(self, resource):
"""
This method processes Resource objects and returns a printable string
"""
response = resource.make_a_network_heavy_call(se... | {
"content_hash": "fff5e485981b9186c305734f0df46ba9",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 77,
"avg_line_length": 32.166666666666664,
"alnum_prop": 0.6347150259067358,
"repo_name": "ambitioninc/ambition-py-tests-guide",
"id": "b775cf367079ab7633f06005d2651ec50d31d1... |
import sys, os, re, json
import itertools
from collections import Counter
import time
from numpy import *
import pandas as pd
def invert_dict(d):
return {v:k for k,v in d.iteritems()}
def flatten1(lst):
return list(itertools.chain.from_iterable(lst))
def load_wv_pandas(fname):
return pd.read_hdf(fname,... | {
"content_hash": "fef9c90e45ffd8238296dbc405885730",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 77,
"avg_line_length": 30.427083333333332,
"alnum_prop": 0.5920917494008902,
"repo_name": "dmitrinesterenko/cs224d",
"id": "729cea4309a270434a19c66d1bfaf70a74078968",
"siz... |
import abc
from cmath import pi
import multiprocessing as mp
import os
import queue
import threading
class NoMoreJobsException(Exception):
"""An exception indicating that no more jobs are available."""
pass
def worker(job_queue, result_queue, shutdown_event, pinned_cpus_queue,
pinned_cpus_semaphore, ... | {
"content_hash": "15c61096c5d7a0737e283ce3bfb773c4",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 79,
"avg_line_length": 33.84431137724551,
"alnum_prop": 0.6838287331917905,
"repo_name": "iree-org/iree-llvm-sandbox",
"id": "c0ab689133c9fccc5c893f96d15ed38c7e353453",
"s... |
import cv2
import numpy as np
import win32gui, win32ui, win32con, win32api
def grab_screen(region=None):
hwin = win32gui.GetDesktopWindow()
if region:
left,top,x2,y2 = region
width = x2 - left + 1
height = y2 - top + 1
else:
width = win32api.GetSystemMetrics(wi... | {
"content_hash": "a36bc6bab24098041994a768acd4ed9d",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 79,
"avg_line_length": 33.05555555555556,
"alnum_prop": 0.6890756302521008,
"repo_name": "Sentdex/pygta5",
"id": "b54a15b46f2f835909e44b46e9a8d1e80baf8ca1",
"size": "1212",... |
from cno.core.base import CNOBase
from cno.core.results import BooleanResults
from cno.core.models import BooleanModels
from cno.misc.profiler import do_profile
from cno.io.reactions import Reaction
import pandas as pd
import numpy as np
import pylab
import time
import bottleneck as bn
from collections import default... | {
"content_hash": "cfae92fc44bdfcb80f870a670667dc55",
"timestamp": "",
"source": "github",
"line_count": 340,
"max_line_length": 103,
"avg_line_length": 37.055882352941175,
"alnum_prop": 0.5795698071275498,
"repo_name": "cellnopt/cellnopt",
"id": "1f0df7548bcdab595ea2e62a8f7616fbeb774953",
"size": "... |
"""Wrappers for protocol buffer enum types."""
import enum
class ClassificationType(enum.IntEnum):
"""
Type of the classification problem.
Attributes:
CLASSIFICATION_TYPE_UNSPECIFIED (int): Should not be used, an un-set enum has this value by default.
MULTICLASS (int): At most one label is a... | {
"content_hash": "ac3996a8536ecf054126ef56be07379f",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 107,
"avg_line_length": 27.470588235294116,
"alnum_prop": 0.6498929336188437,
"repo_name": "dhermes/gcloud-python",
"id": "b98cd0818972d907b6edc56739cb1f2a75bf3ef4",
"size"... |
"""
https://code.google.com/codejam/contest/6214486/dashboard
Max recursion depth exceeded on large input. This could be
avoided by visiting rooms in order of their assigned value,
largest value first.
"""
import itertools as it
FOUR_DOORS = ((1, 0), (-1, 0), (0, 1), (0, -1))
def memo(f):
"""memoization dec... | {
"content_hash": "4cfc9b5a37394b2d9aa44bca061743d4",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 89,
"avg_line_length": 26.561643835616437,
"alnum_prop": 0.5729757607013924,
"repo_name": "py-in-the-sky/challenges",
"id": "b1773eb779865723ee13a77d86b08c9146e0f374",
"siz... |
import random, sys, sqlite3, getopt
sys.path.insert(0, "modules/")
from collections import Counter
from monmods import GetNature
from monmods import Shiny
from monmods import RareRoll
class Nature(object):
conn = sqlite3.connect('PTA_ORAS.db')
ModUp = 2
ModDown = 2
def __init__(self,nature):
# I have to put string... | {
"content_hash": "e37d391cb39942eea837792239720565",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 113,
"avg_line_length": 34.03225806451613,
"alnum_prop": 0.6834123222748815,
"repo_name": "Phixia/WildEncounter",
"id": "3b100ba692aac1ff9ecfddb88db4bc44ed8bb318",
"size": ... |
from django.db import migrations, models
from django.db.models.functions import Length
def forwards_func(apps, schema_editor):
max_length = 63
Project = apps.get_model('projects', 'Project')
projects_invalid_slug = (
Project
.objects
.annotate(slug_length=Length('slug'))
.f... | {
"content_hash": "1152989fff4a701fa4d434a3474eef02",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 84,
"avg_line_length": 27.70212765957447,
"alnum_prop": 0.5998463901689708,
"repo_name": "rtfd/readthedocs.org",
"id": "ee27e9602a9a00859c0f85390519b245797f3c2d",
"size": "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.