text stringlengths 4 1.02M | meta dict |
|---|---|
"""ECLAIR is a package for the robust and scalable
inference of cell lineages from gene expression data.
ECLAIR achieves a higher level of confidence in the estimated lineages
through the use of approximation algorithms for consensus clustering and by combining the information from an ensemble of minimum spanning tr... | {
"content_hash": "5f42ceac968c8c321e8327d3274e568b",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 211,
"avg_line_length": 43.72857142857143,
"alnum_prop": 0.6886638353479255,
"repo_name": "GGiecold/ECLAIR",
"id": "917414728b8f029d21effb163c6d4c9696807ddc",
"size": "3284... |
from django.conf.urls import url
from . import views
app_name = 'search_app'
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^movie-search/$', views.search_by_title, name='movie_search'),
url(r'^movie/(?P<movie_id>[0-9]+)/', views.movie_detail, name='detail'),
url(r'^actor/(?... | {
"content_hash": "32c8d72a046e48d55a43eeab070615b4",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 82,
"avg_line_length": 41.63636363636363,
"alnum_prop": 0.6397379912663755,
"repo_name": "hannahhall/movies",
"id": "cce51e1e1a379783d9d4e3d50300df3fbca9ed2e",
"size": "458... |
"""
This file contains a minimal set of tests for compliance with the extension
array interface test suite, and should contain no other tests.
The test suite for the full functionality of the array is located in
`pandas/tests/arrays/`.
The tests in this file are inherited from the BaseExtensionTests, and only
minimal ... | {
"content_hash": "4896befc891597141919d923501be454",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 81,
"avg_line_length": 26.828125,
"alnum_prop": 0.6893807027761599,
"repo_name": "pandas-dev/pandas",
"id": "b51846e34fd8835dc2ac5ff7f47ccb3a01ea1cff",
"size": "5151",
"... |
import inviwopy
# import inviwopy.glm as glm
import numpy as np
import h5py
import time
from envisionpy.utils.exceptions import *
from .baseNetworks.LinePlotSubnetwork import LinePlotSubnetwork
class DensityOfStates(LinePlotSubnetwork):
'''
Manages a subnetwork for density of states (DoS) visualisation.
... | {
"content_hash": "23e16ae40b29b40dcc29519209faafa2",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 149,
"avg_line_length": 53.724489795918366,
"alnum_prop": 0.6779677113010446,
"repo_name": "rartino/ENVISIoN",
"id": "08c61b7d9d85b4afb9151bf88b41e5e402479848",
"size": "1... |
"""
Walk whole MIB
++++++++++++++
Send a series of SNMP GETNEXT requests using the following options:
* with SNMPv2c, community 'public'
* over IPv4/UDP
* to an Agent at demo.snmplabs.com:161
* for all OIDs in IF-MIB
* with MIB lookup enabled
Functionally similar to:
| $ snmpwalk -v2c -c public demo.snmplabs.com I... | {
"content_hash": "e5122c510cc9346c12630cb857288392",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 84,
"avg_line_length": 24.025,
"alnum_prop": 0.6409989594172737,
"repo_name": "etingof/pysnmp",
"id": "f900018f0b94a2c610f2276288095d496c636d88",
"size": "961",
"binary":... |
from datetime import date
import io
import json
import requests
from unittest import mock
import os
from django.test import TestCase, override_settings
from django.core.management import call_command
from django.core.management.base import CommandError
from geotrek.common.tests.factories import RecordSourceFactory, T... | {
"content_hash": "37fbc502cbec9a5a1f2107f9c931c761",
"timestamp": "",
"source": "github",
"line_count": 608,
"max_line_length": 129,
"avg_line_length": 52.389802631578945,
"alnum_prop": 0.6643330298559006,
"repo_name": "makinacorpus/Geotrek",
"id": "c7fd47b72199d883536151988bac0dd41ffb74a9",
"size"... |
import re
import errno
import sys
from socket import getfqdn
from os.path import getmtime, join, exists
from urllib import urlencode
from ConfigParser import ConfigParser
from django.shortcuts import render_to_response
from django.http import HttpResponse, QueryDict
from django.conf import settings
from django.contrib... | {
"content_hash": "d317ba693c52f6ee95848c1a56d3bc23",
"timestamp": "",
"source": "github",
"line_count": 432,
"max_line_length": 120,
"avg_line_length": 29.87037037037037,
"alnum_prop": 0.6684748915065096,
"repo_name": "dkulikovsky/graphite-ch-web",
"id": "52aecbd64b039add9ea54d6ba801a9a49254af2d",
... |
"""
Testing module for the class ContinuousColumn
"""
from unittest import TestCase
import numpy as np
from numpy import nan
from setup_tests import list_ordered_equal, CHAID
import pytest
def test_chaid_vector_converts_strings():
"""
Check that error raised when string column supplied
"""
with pytest.... | {
"content_hash": "b5600054508285855a52a72c7af98a75",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 101,
"avg_line_length": 33.53125,
"alnum_prop": 0.6812674743709226,
"repo_name": "Rambatino/CHAID",
"id": "8939bdf1f7f64342d21f21465d5c86bc0e414e6f",
"size": "1073",
"bin... |
from girder.api import access
from girder.api.describe import Description
from girder.api.rest import Resource
from girder import logger
import requests
import os
class ImageDomainDynamicsSearch(Resource):
def __init__(self):
self.resourceName = 'imagedomaindynamicssearch'
self.route('GET', (), s... | {
"content_hash": "6562c53147e34ba0af93d44b3046d541",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 121,
"avg_line_length": 35.65384615384615,
"alnum_prop": 0.7421790722761596,
"repo_name": "lewismc/image_space",
"id": "5053ce64a9eeafb7b4e8ec1144d2e051cb097dad",
"size": "... |
from interface import LSODES_IVP_Integrator
| {
"content_hash": "f7d168c08501cacec6c59eb5a2453fd1",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 43,
"avg_line_length": 44,
"alnum_prop": 0.8636363636363636,
"repo_name": "bjodah/symodesys",
"id": "6352b12dbfcf63d6e6f2abe813e297ab3a38c8a1",
"size": "44",
"binary": fal... |
"""
Django settings for test_django_project 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_... | {
"content_hash": "37fc4502e616e48b068fe3cc07ea06ee",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 76,
"avg_line_length": 23.823529411764707,
"alnum_prop": 0.7283950617283951,
"repo_name": "ricomoss/django-fixtureless",
"id": "7fc27f0cf3cf4e3cba042ad4a458651e62e043bb",
"... |
from datetime import date
import django_filters
from ...discount import DiscountValueType
from ...discount.models import Sale, Voucher
from ..core.filters import EnumFilter, ObjectTypeFilter
from ..core.types.common import DateRangeInput, IntRangeInput
from ..utils import filter_by_query_param
from .enums import (
... | {
"content_hash": "4f86df014c41284d44b067b6f0bb5423",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 79,
"avg_line_length": 29.300970873786408,
"alnum_prop": 0.6756129887342611,
"repo_name": "UITools/saleor",
"id": "d805b9bc9014b965bb59e20415eee697065f2f78",
"size": "3018... |
from unittest import TestCase, main, mock
import gzip
from click.testing import CliRunner
from micronota.commands._uniprot import cli
class Tests(TestCase):
@mock.patch('micronota.commands._uniprot.add_metadata', return_value=9)
def test(self, mock_add_metadata):
runner = CliRunner()
with ru... | {
"content_hash": "178e1703c2e22b1efd0ce7490b91c437",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 78,
"avg_line_length": 30.5,
"alnum_prop": 0.6110283159463488,
"repo_name": "RNAer/micronota",
"id": "ac83b602d88546944f4df94f0a2b9db5f5343149",
"size": "671",
"binary": ... |
"""Lists load balancer health check policies."""
from baseCmd import *
from baseResponse import *
class listLBHealthCheckPoliciesCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "false"
"""list resources by display flag; only ROOT admin is eligible to pass this parameter"""
... | {
"content_hash": "8a7b46c1884f48ccc7e2916d949fbd1c",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 98,
"avg_line_length": 35.74324324324324,
"alnum_prop": 0.5977315689981096,
"repo_name": "MissionCriticalCloud/marvin",
"id": "e1e5cf93832985c1c9523a98ec65e3fe28ea2385",
"s... |
import numpy as np
from nlaugmenter.interfaces.SentenceOperation import SentenceOperation
from nlaugmenter.tasks.TaskTypes import TaskType
"""
Base Class for implementing the different input transformations a generation should be robust against.
"""
class RandomUpperPerturbation(SentenceOperation):
tasks = [
... | {
"content_hash": "d8b587ae68f9be5da740ea39dc1f3c38",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 102,
"avg_line_length": 21.33695652173913,
"alnum_prop": 0.46663270504330107,
"repo_name": "GEM-benchmark/NL-Augmenter",
"id": "64416ad38c5ad035f0a53bf0a8e3198c809f6d5f",
"... |
from hashlib import sha1
import sys
from re import compile
from tuttle.error import TuttleError
from tuttle.resource import ResourceMixIn, MalformedUrl
from snakebite.client import Client
class HDFSResource(ResourceMixIn, object):
"""An HTTP resource"""
scheme = 'hdfs'
__ereg = compile("^hdfs://([^/^:]... | {
"content_hash": "3cc9b5bdf86a7a9fc6b30e0a7e20c89d",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 91,
"avg_line_length": 32.69387755102041,
"alnum_prop": 0.6054931335830213,
"repo_name": "lexman/tuttle",
"id": "916256df365b941a8c4a6907acd074db3ee21e42",
"size": "1625",
... |
'''
App Web que escoge una carrera universitaria de la Universidad Interameriacana de Panama;
usando Flask, en la misma se ingresa un nombre y se sigue un test para escoger la carrera y
este redirecciona a la pagina de la universidad
'''
from flask import Flask
from flask import render_template
from flask import... | {
"content_hash": "5b819718a98d00bfa041159c701202fd",
"timestamp": "",
"source": "github",
"line_count": 372,
"max_line_length": 279,
"avg_line_length": 43.18817204301075,
"alnum_prop": 0.6521847379559318,
"repo_name": "hakuruklis/PROYECTO-PCIII",
"id": "72ed1b953822f5e28d7e653a790a8ca2f8fb4e25",
"s... |
import platform, sys, os, subprocess
import psutil
from app.api.models.LXDModule import LXDModule
import logging
def readInstanceDetails():
instanceDetails = ("Python Version: {}".format(platform.python_version()))
instanceDetails +=("\nPython Path: {}".format(' '.join(path for path in sys.path)))
instanc... | {
"content_hash": "56a5e8cb4208fa03c09232dedd9d9dc4",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 97,
"avg_line_length": 34,
"alnum_prop": 0.6354489164086687,
"repo_name": "AdaptiveScale/lxdui",
"id": "43e6dcf630d44336ba5d7cfb0550237f381454a4",
"size": "1292",
"binary... |
'''
Created by auto_sdk on 2014-12-17 17:22:51
'''
from top.api.base import RestApi
class ScitemMapBatchQueryRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.outer_code = None
self.page_index = None
self.page_size = None
self.sc_item_... | {
"content_hash": "53059f46231cf6281d345b16e5972208",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 55,
"avg_line_length": 28.5,
"alnum_prop": 0.6842105263157895,
"repo_name": "CooperLuan/devops.notes",
"id": "0fbb7b0c8279073508da3fc3af203106ca75d9f1",
"size": "399",
"b... |
import csv
import os
import re
HERE = os.path.dirname(os.path.abspath(__file__))
def sexa_to_dec(dh, min, secs, sign):
return sign*(dh + float(min)/60 + float(secs)/60**2)
def string_to_dec(s, neg):
parsed = filter(
None, re.split('[\'" °]', unicode(s, 'utf-8')))
sign = -1 if parsed[-1] == neg... | {
"content_hash": "221dbd5fe78d02b653f1c286f9547c2b",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 76,
"avg_line_length": 23.564102564102566,
"alnum_prop": 0.5701849836779108,
"repo_name": "DesignSafe-CI/adama_example",
"id": "254d3eb13c5c946032ff2492cdff8bad1362dc10",
"... |
"""
Django settings for gettingstarted project.
Generated by 'django-admin startproject' using Django 1.10.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
im... | {
"content_hash": "16ce6d20bf1b44271b82542908f3296b",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 91,
"avg_line_length": 26.66906474820144,
"alnum_prop": 0.6973293768545994,
"repo_name": "SebasWS/Programa-permanencia-adacemica",
"id": "971aa7046395540d4fb9027bc9801113703... |
def foo(ids):
for vert in bpy.context.active_object.data.vertices:
vert.select = False
for id in ids:
bpy.context.active_object.data.vertices[id].select = True
| {
"content_hash": "54aea32f8a22f30cf03f1c55b244c0c6",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 65,
"avg_line_length": 36.8,
"alnum_prop": 0.6684782608695652,
"repo_name": "alextsui05/toolbox",
"id": "657b87cb2912c926adf4ec098fcb1a0d1b80d8a2",
"size": "482",
"binary"... |
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class CertificateTestCase(IntegrationTestCase)... | {
"content_hash": "f3fffff84a29171bb11aaf6794707aeb",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 165,
"avg_line_length": 42.67741935483871,
"alnum_prop": 0.5716445308282043,
"repo_name": "twilio/twilio-python",
"id": "a77489cc4b2ef92621d7e745c2fda3257e8c21e7",
"size":... |
import re
import subprocess
from deoplete.base.source import Base
class Source(Base):
def __init__(self, vim):
Base.__init__(self, vim)
self.name = 'cmake'
self.mark = '[cmake]'
self.filetypes = ['cmake']
self.rank = 600
self.debug_enabled = False
self._comm... | {
"content_hash": "62740b7c0144cb8a3f5c3a8ba735689d",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 80,
"avg_line_length": 33.98571428571429,
"alnum_prop": 0.5380411937788987,
"repo_name": "zchee/deoplete-clang",
"id": "f6e88b3ec37ebda8488985f35d9257890dabb9d0",
"size": "... |
import unittest
from core.core import Core
class BucketTests(unittest.TestCase):
def runTest(self):
self.test_get_products()
self.test_get_product_success()
self.test_get_product_fail()
@classmethod
def setUpClass(cls):
cls.core = Core.get_instance()
cls.core... | {
"content_hash": "c0e460601afbb130b2d6e9eb28f06b33",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 107,
"avg_line_length": 39.63636363636363,
"alnum_prop": 0.6295871559633027,
"repo_name": "helicontech/zoo",
"id": "da9597053bc7a3842b2d4933d716e34e78358042",
"size": "3513... |
from fastapi import FastAPI, Response
app = FastAPI()
@app.get("/legacy/")
def get_legacy_data():
data = """<?xml version="1.0"?>
<shampoo>
<Header>
Apply shampoo here.
</Header>
<Body>
You'll have to use soap here.
</Body>
</shampoo>
"""
return Response(content=da... | {
"content_hash": "446d9dfd3af18982e4aa80f5ddc6b9bc",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 63,
"avg_line_length": 19.666666666666668,
"alnum_prop": 0.5819209039548022,
"repo_name": "tiangolo/fastapi",
"id": "6643da6e6d61ac322a9ecacc1d9defd8ddfdba9a",
"size": "354... |
from pywedding import app
from gdata.spreadsheet.service import SpreadsheetsService, ListQuery
from gdata.spreadsheet.text_db import Record
from datetime import datetime
client = SpreadsheetsService()
feed = client.GetWorksheetsFeed(visibility='public', projection='basic', key=app.config['SPREADSHEET_KEY'])
sheet ... | {
"content_hash": "17fb8f0c3c71758e5d8c9b3c8e5a2224",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 156,
"avg_line_length": 35.41803278688525,
"alnum_prop": 0.5626012497107151,
"repo_name": "Kehrlann/pywedding",
"id": "3d717a46bca7b89b566d2b0afaa134d2a7e1d21e",
"size": "... |
import sys
from configparser import ConfigParser
class ConfigTool(object):
""" This object realises the parser and index of the configuration files """
def __init__(self, config_path):
self.config = ConfigParser()
self.config.read(config_path)
def configsectionmap(self, section):
... | {
"content_hash": "51d19dfa975700510d4da6e047d60637",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 84,
"avg_line_length": 33.28,
"alnum_prop": 0.5961538461538461,
"repo_name": "caiomartini/SonarCommitAnalyzer",
"id": "57f0ab100f33e4d316c0ff04c1eda2e490c360c9",
"size": "8... |
"""
homeassistant.components.automation.event
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Offers event listening automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/components/automation.html#event-trigger
"""
import logging
CONF_EVENT_TYPE = "ev... | {
"content_hash": "6029b0f46f3f3885d1ddfe16fb620d90",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 78,
"avg_line_length": 29.823529411764707,
"alnum_prop": 0.6410256410256411,
"repo_name": "pottzer/home-assistant",
"id": "c172b8e0e11552d99b6f222803a8c261dce0487b",
"size"... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import math
import os
import sys
import errno
import re
import shutil
import tempfile
import codecs
import atexit
import weakref
import warnings
import numpy as np
import matplotlib as mpl
from ma... | {
"content_hash": "cec2e64f4caa8920fd8825fb57af17d2",
"timestamp": "",
"source": "github",
"line_count": 962,
"max_line_length": 133,
"avg_line_length": 37.91995841995842,
"alnum_prop": 0.5687655911620384,
"repo_name": "louisLouL/pair_trading",
"id": "e75c08f8bd7429460dd332b4074c0ff35050e473",
"size... |
__all__ = ['phpunit', 'coverfish', 'lint', 'phpcs', 'phpcpd', 'phpmd', 'security_checker']
| {
"content_hash": "7d1c9897373567a3c4d64b1f29446096",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 90,
"avg_line_length": 91,
"alnum_prop": 0.5934065934065934,
"repo_name": "mi-schi/php-code-checker",
"id": "fff2778c36a69265cceff56f1e6cb2487336958a",
"size": "91",
"bina... |
import copy
from loqusdb.build_models.variant import build_variant
class TestInsertVariant:
def test_insert_one_variant(self, mongo_adapter, simplest_variant):
"""Test to insert one variant"""
mongo_adapter.add_variant(simplest_variant)
db = mongo_adapter.db
# Get the variant w... | {
"content_hash": "78f8cf02ba0acf053cc5c5ccd9b0c5a0",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 88,
"avg_line_length": 34.84532374100719,
"alnum_prop": 0.6212449674821926,
"repo_name": "moonso/loqusdb",
"id": "e86a46eab2503ab59f6c9940128d1569d496ea3b",
"size": "9687"... |
import gntp.notifier
'''
No purpose here other than creating a callable library for system notifications
'''
class message:
def __init__(self, messagex):
growl = gntp.notifier.GrowlNotifier(
applicationName = "RSEvent Notification",
notifications = ["New Updates","New Messages"],
... | {
"content_hash": "e5bf74ae6ee390643984ef02212c3fde",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 79,
"avg_line_length": 27.333333333333332,
"alnum_prop": 0.5640243902439024,
"repo_name": "krazybean/message_agent_abandoned",
"id": "454d4f63df2ac00f2031b315116833bd1d497291... |
"""
Handle compressed filesystems
This replicates functionality that 'archivemount' would provide
"""
import logging
import tempfile
import tarfile
import os
import shutil
logger = logging.getLogger(__name__)
class InsightsCompressedFile(object):
"""
This class handles uncompressing and mounting compressed ... | {
"content_hash": "a7708b84f4368df95102f7c0cf7c8b34",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 86,
"avg_line_length": 33.6,
"alnum_prop": 0.625,
"repo_name": "wcmitchell/insights-core",
"id": "f13018b77a8682a4dfe74f2daf92d52721de10d0",
"size": "1680",
"binary": fal... |
from .avatar import *
from .room import *
from .exit import *
| {
"content_hash": "d8b7c6ce00a2bdca7c9cdc48836c8e61",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 21,
"avg_line_length": 20.666666666666668,
"alnum_prop": 0.7096774193548387,
"repo_name": "elastic-event-components/e2c",
"id": "f75d0d1678e49c48c9023b22642ab8bec94c1b92",
"... |
from __future__ import division
import numpy
import sys
import brukerIO
import math
def cpmgadd2D(dataset, lb=0, gb=0, nEchoes=None, slope=0,
cycle=None, echo_parity='both'):
"""
A faire :
ser file reshape en 4 dim (F1, HCF1(re/im), F2, HCF2(re/im))
note : en QF HCF1 a une dimen... | {
"content_hash": "703d0b3469af89fb7b6f76fc0590c280",
"timestamp": "",
"source": "github",
"line_count": 292,
"max_line_length": 128,
"avg_line_length": 41.21917808219178,
"alnum_prop": 0.6055167829843802,
"repo_name": "jtrebosc/JTutils",
"id": "449153b41ebef1fa0eef063ca86b6de3fe834382",
"size": "12... |
"""Contains the version string of AlphaFold inference components."""
__version__ = "0.1.1dev"
| {
"content_hash": "c2e33a763520589672e3e398cb9a63fe",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 68,
"avg_line_length": 31.666666666666668,
"alnum_prop": 0.7052631578947368,
"repo_name": "GoogleCloudPlatform/vertex-ai-alphafold-inference-pipeline",
"id": "0b4345aa4f84f7ec... |
from app import db
from models import *
import datetime
# create the db and tables
db.create_all()
# prepare data to insert
year = 1982
month = 4
day = 3
birthday = datetime.date(year, month, day)
now = datetime.datetime.now()
today = datetime.date(now.year, now.month, now.day)
yesterday = datetime.date(now.year, n... | {
"content_hash": "86d77eeb7755bc895418d17ac212495b",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 98,
"avg_line_length": 21.381818181818183,
"alnum_prop": 0.70578231292517,
"repo_name": "abmorton/stockhawk",
"id": "d85ca52402346be7dfaf6277ede793e7a996a2e4",
"size": "117... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('client', '0002_auto_20150122_1116'),
]
operations = [
migrations.CreateModel(
name='Item',
fields=[
('id', m... | {
"content_hash": "47986185c362a5fc8f24e8fa75e15130",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 127,
"avg_line_length": 42.75,
"alnum_prop": 0.5723684210526315,
"repo_name": "delete/estofadora",
"id": "5cb13f1237927ddf37ba90aaba236f0795192613",
"size": "1392",
"bina... |
from pandas.compat import StringIO, callable, signature
from pandas.lib import cache_readonly # noqa
import sys
import warnings
from textwrap import dedent
from functools import wraps
def deprecate(name, alternative, alt_name=None):
alt_name = alt_name or alternative.__name__
def wrapper(*args, **kwargs):
... | {
"content_hash": "6f16fa94450dd13e3e5832e350c5a517",
"timestamp": "",
"source": "github",
"line_count": 292,
"max_line_length": 79,
"avg_line_length": 33.19178082191781,
"alnum_prop": 0.6001857201815931,
"repo_name": "BigDataforYou/movie_recommendation_workshop_1",
"id": "58cd0c13d8ec76c9b950052bca2e... |
from pyttsx.drivers import _espeak
import ctypes
import wave
import time
import threading
import StringIO
class Synth(object):
_done = False
def __init__(self):
self.rate = _espeak.Initialize(_espeak.AUDIO_OUTPUT_RETRIEVAL, 1000)
assert self.rate != -1, 'could not initialize espeak'
_es... | {
"content_hash": "9b9e18fc6ad847a7bb18c4b719ecc4f5",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 76,
"avg_line_length": 28.63888888888889,
"alnum_prop": 0.5645004849660524,
"repo_name": "proppy/appengine-vm-fortunespeak-python",
"id": "e9941a27217759cd503e7b85b6c98549b52... |
import json
from nltk.corpus import wordnet as wn
from itertools import combinations
if __name__ == '__main__':
data = json.load(open('data/nasa_kw.json'))
outfile = 'data/keyword_synset_scores.json'
kw_field = 'keyword'
max_items = 700000 # limit keyword pairs to analyse. there are ~1100 projects, tha... | {
"content_hash": "8195d43d1f6625580827d3dc02d39368",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 104,
"avg_line_length": 34.88135593220339,
"alnum_prop": 0.5889212827988338,
"repo_name": "jonroberts/nasaMining",
"id": "fd5994e4022dcaf8fefb00cd4bbe36dd87b5251e",
"size":... |
"""Maps subworkflow of Oozie to Airflow's sub-dag"""
import logging
import os
from typing import Dict, List, Set, Type
from xml.etree.ElementTree import Element
from o2a.converter.oozie_converter import OozieConverter
from o2a.converter.relation import Relation
from o2a.converter.renderers import BaseRenderer
from o2... | {
"content_hash": "0b978a9691003d00ae7554999a90ddb8",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 108,
"avg_line_length": 36.99,
"alnum_prop": 0.6428764530954312,
"repo_name": "GoogleCloudPlatform/oozie-to-airflow",
"id": "2757afad508958735ee0f2bf4adfbfab0e698050",
"si... |
'''Manipulate feature sets'''
import numpy as np
import unittest
import pdb
def rescale(train, test):
"""
Rescale the data so that each feature in the training set is in
the interval [0,1], and apply the same transformations to the test
set, using the statistics computed on the training set.
Arg... | {
"content_hash": "0b508370609f7c6628c6131fefc7de93",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 80,
"avg_line_length": 28.346938775510203,
"alnum_prop": 0.5478761699064075,
"repo_name": "rlowrance/mlpack",
"id": "6221556a12afa502c332bc45f6d8d230fdd81f56",
"size": "41... |
from rest_framework import serializers
from django.contrib.auth.models import User
from mockatron_core.models import *
from .classes import *
class UserCreateSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ('first_name', 'last_name', 'email', 'username', 'password')
... | {
"content_hash": "aba210aa6c82a24df63f980ba8d448bc",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 147,
"avg_line_length": 38.285714285714285,
"alnum_prop": 0.6487873134328358,
"repo_name": "rodrigozc/mockatron",
"id": "066d06adab14f7e4eb3f53df5d61a8e32f3d8bf5",
"size": ... |
from __future__ import unicode_literals
import datetime
import decimal
import itertools
from copy import copy
from argeweb.libs.wtforms import widgets
from argeweb.libs.wtforms.compat import text_type, izip
from argeweb.libs.wtforms.i18n import DummyTranslations
from argeweb.libs.wtforms.validators import StopValida... | {
"content_hash": "cf2ac240dc5874cc13f1cbbefc61aa1a",
"timestamp": "",
"source": "github",
"line_count": 1019,
"max_line_length": 125,
"avg_line_length": 34.066732090284596,
"alnum_prop": 0.5883793282249237,
"repo_name": "argeweb/start",
"id": "b4dd81d5ede6424ecc3849527a8d45af6fa9385a",
"size": "347... |
'''
Record Order in BIFF8
Workbook Globals Substream
BOF Type = workbook globals
Interface Header
MMS
Interface End
WRITEACCESS
CODEPAGE
DSF
TABID
FNGROUPCOUNT
Workbook Protection Block
WINDOWPROTECT
PROTECT
PASSWORD
... | {
"content_hash": "cdbbdb5faa8501d3cf1b58268fab2a26",
"timestamp": "",
"source": "github",
"line_count": 631,
"max_line_length": 113,
"avg_line_length": 32.4770206022187,
"alnum_prop": 0.5218367247352754,
"repo_name": "rhefner1/ghidonations",
"id": "3bf8381d4dda4d56612aea4c76c78bb88877410b",
"size":... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('data_interfaces', '0014_createscheduleinstanceactiondefinition_start_date_case_property'),
]
operations = [
migrations.AddField(
model_name='automaticupdaterule',
na... | {
"content_hash": "f25a1fc87dea520e0577b339f5c3bc2a",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 100,
"avg_line_length": 26,
"alnum_prop": 0.6418269230769231,
"repo_name": "dimagi/commcare-hq",
"id": "48642d8ebf3bcdf4c5b098fba8110e317a1f9913",
"size": "466",
"binary"... |
class Deque:
def __init__(self):
self.items = []
def isEmpty(self):
return self.items == []
def addFront(self, item):
self.items.append(item)
def addRear(self, item):
self.items.insert(0,item)
def removeFront(self):
return self.items.pop()
def removeR... | {
"content_hash": "d1d1e6b9d6c2b352e339b51f183b5af6",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 33,
"avg_line_length": 19.80952380952381,
"alnum_prop": 0.5673076923076923,
"repo_name": "robin1885/algorithms-exercises-using-python",
"id": "f6b582b6b8be1e6b04b4dce9721d74e... |
from . import BaseBackend
import flask
class SessionBackend(BaseBackend):
"""
The default storage backend. Stores and retrieves OAuth tokens using
the :ref:`Flask session <flask:sessions>`.
"""
def __init__(self, key="{bp.name}_oauth_token"):
"""
Args:
key (str): The na... | {
"content_hash": "bd5e56e15cdac915ac6fa9bb4f7fe588",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 83,
"avg_line_length": 34.096774193548384,
"alnum_prop": 0.6045411542100284,
"repo_name": "jsfan/flask-dance",
"id": "5b28588f3f169ee69d57a8f54338ce53f1f02457",
"size": "10... |
default_app_config = "taiga.base.apps.BaseAppConfig"
| {
"content_hash": "27166f1e90c87c9139b2b0ddb0fedf38",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 52,
"avg_line_length": 53,
"alnum_prop": 0.7924528301886793,
"repo_name": "mattcongy/itshop",
"id": "5a7db2f0c3e684ef698b1001ea5f60f795ed0731",
"size": "989",
"binary": fa... |
def mergesort(unsorted_list):
if len(unsorted_list) < 2:
return unsorted_list
sorted_list = []
midpoint = len(unsorted_list) // 2
first_half = mergesort(unsorted_list[:midpoint])
second_half = mergesort(unsorted_list[midpoint:])
while (len(first_half) > 0) and (len(second_half) > 0):
... | {
"content_hash": "2ea4b3ae226768f42feb268f840ccc6c",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 70,
"avg_line_length": 35.94915254237288,
"alnum_prop": 0.5582272512965583,
"repo_name": "markableidinger/sorting",
"id": "19dffff443517d2025bce68b6343651f80e1a6ed",
"size"... |
'''
Copyright 2014 eBay Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... | {
"content_hash": "312da38482641533691551dff6e352eb",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 110,
"avg_line_length": 41.57575757575758,
"alnum_prop": 0.619533527696793,
"repo_name": "eBay/cronus-agent",
"id": "7f0b1e91dbac9a5c8617853c43ddf2797c7288e1",
"size": "277... |
"""
# Seomoz Backlink Analysis
Discover relevant backlinks.
"""
import os
import csv
import time
import argparse
import numpy as np
import pandas as pd
from lsapi import lsapi
api = lsapi('member-76bd0a8077', '09e78de0f24fbbf8b41b46623b75d5e6')
parser = argparse.ArgumentParser(description='Seomoz Analyzer')
pars... | {
"content_hash": "24f39e8ccf728c0158b1515ac17bfd22",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 117,
"avg_line_length": 25.6056338028169,
"alnum_prop": 0.6303630363036303,
"repo_name": "conceptcreative/free_grants_community",
"id": "fc3d57af10138fbce98ba4d8aa9bcbc51f3f7... |
#===============================================================================
# Abstraction
#===============================================================================
from core import Generator, Actor, Terminator, Interface, Filter, Flow
#================================================================... | {
"content_hash": "4dfb7133c0f009b5bd897a620376e62f",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 80,
"avg_line_length": 34.771929824561404,
"alnum_prop": 0.4808274470232089,
"repo_name": "pygics-app/prometheus",
"id": "b58d62cc2760afbc1042e6bf3bd0c130fedcfa74",
"size"... |
from __future__ import absolute_import
import six
import redis
from funcy import memoize, merge
from functools import wraps
import warnings
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
CACHEOPS_REDIS = getattr(settings, 'CACHEOPS_REDIS', None)
CACHEOPS_DEFAULTS = getattr(s... | {
"content_hash": "805542eec8a77fcd6f516a9aaf1997de",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 99,
"avg_line_length": 29.602040816326532,
"alnum_prop": 0.6511547742157877,
"repo_name": "Tapo4ek/django-cacheops",
"id": "8315ce118806ee140db919e7e7fff6fe5f105b24",
"size... |
import asyncio
import datetime
import enum
import json
import math
import time
import warnings
from email.utils import parsedate
from multidict import CIMultiDict, CIMultiDictProxy
from . import hdrs, payload
from .helpers import HeadersMixin, SimpleCookie, sentinel
from .http import RESPONSES, SERVER_SOFTWARE, HttpV... | {
"content_hash": "f45cd4f1ad101376a2d04563a2f1b6d8",
"timestamp": "",
"source": "github",
"line_count": 599,
"max_line_length": 91,
"avg_line_length": 33.53255425709516,
"alnum_prop": 0.5577516678283382,
"repo_name": "AraHaanOrg/aiohttp",
"id": "f1de727322405331937801a0fded9d4ee57eabd0",
"size": "2... |
"""Namespace Manager Module."""
from .namespace_manager import *
| {
"content_hash": "96ab21f7779a480e9eafeee2d00313b3",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 32,
"avg_line_length": 8.875,
"alnum_prop": 0.676056338028169,
"repo_name": "Suwmlee/XX-Net",
"id": "a0035aeafa77c0cbf1ed8834f15349996cfa8c6b",
"size": "676",
"binary": fa... |
from os import environ
from fabric.api import run, env, sudo, task, cd, settings
from gitric.api import git_seed, git_reset, allow_dirty
from fabtools import deb, require
env.user = environ['DOTFILES_USER']
env.hosts = environ['DOTFILES_HOST']
allow_dirty = allow_dirty # Silence flake8
home_dir = "/home/%s" % env.... | {
"content_hash": "0d499758bcc95fec0a7882f7a0a752e1",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 152,
"avg_line_length": 26.779661016949152,
"alnum_prop": 0.6455696202531646,
"repo_name": "dhilipsiva/.files",
"id": "74a3cd18cbbe851758d4ea6fa67ae7a086c4a414",
"size": "1... |
import base64
from saml2.authn_context import INTERNETPROTOCOLPASSWORD
from saml2.saml import NAMEID_FORMAT_TRANSIENT
from saml2.samlp import NameIDPolicy
from s2repoze.plugins.sp import make_plugin
from saml2.server import Server
ENV1 = {'SERVER_SOFTWARE': 'CherryPy/3.1.2 WSGI Server',
'SCRIPT_NAME': '',
'A... | {
"content_hash": "35dd20061b67eeda640a817dc31daa30",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 102,
"avg_line_length": 35.33766233766234,
"alnum_prop": 0.565600882028666,
"repo_name": "Runscope/pysaml2",
"id": "cb07c65ec6842bc6c96f1ea27255164aa90f32ff",
"size": "2768... |
from twisted.internet import reactor
from twisted.spread import pb
from twisted.python import log
from buildbot import util
from collections import defaultdict
class StepProgress:
"""I keep track of how much progress a single BuildStep has made.
Progress is measured along various axes. Time consumed is one th... | {
"content_hash": "2a6ed3025565cbe6610204f6752c2bae",
"timestamp": "",
"source": "github",
"line_count": 308,
"max_line_length": 77,
"avg_line_length": 36.564935064935064,
"alnum_prop": 0.5903924702539514,
"repo_name": "denny820909/builder",
"id": "62aae3171d33f009d509ad6cdc14c8a733501e17",
"size": ... |
from juriscraper.opinions.united_states.state import delaware
class Site(delaware.Site):
def __init__(self, *args, **kwargs):
super(Site, self).__init__(*args, **kwargs)
self.url = 'http://courts.delaware.gov/opinions/List.aspx?ag=Superior%20Court'
self.court_id = self.__module__
| {
"content_hash": "2ea60aba1ebd4984ed34e3175fb14db8",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 86,
"avg_line_length": 34.666666666666664,
"alnum_prop": 0.657051282051282,
"repo_name": "m4h7/juriscraper",
"id": "7850914affc6ee88e792218ac98ba15c9c6056ac",
"size": "470",... |
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundEr... | {
"content_hash": "b19a6dc557741a00ec0ec797e243f642",
"timestamp": "",
"source": "github",
"line_count": 880,
"max_line_length": 265,
"avg_line_length": 51.125,
"alnum_prop": 0.664369859968882,
"repo_name": "Azure/azure-sdk-for-python",
"id": "dbcb0e4b08a5dcb057bae474867b1ffcb3361a97",
"size": "4549... |
from __future__ import absolute_import
from django.conf.urls import url
from talks.contributors.views import (contributors_home, contributors_events,
contributors_eventgroups, contributors_persons)
urlpatterns = [
url(r'^$', contributors_home, name='contributors-home'),
u... | {
"content_hash": "c62c1b1c301075572957700eefdf6a17",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 85,
"avg_line_length": 45.083333333333336,
"alnum_prop": 0.6987060998151571,
"repo_name": "ox-it/talks.ox",
"id": "ce1d0d9194c2c8b494344f25b0e3db2353675976",
"size": "541",... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
from mpl_toolkits.axisartist import Subplot
from mpl_toolkits.axisartist import SubplotHost, \
ParasiteAxesAuxTrans
from mpl_toolkits.axisartist.grid_helper_curvelinear import \
GridHelperCurveLinear
def curvelinear_test1(fi... | {
"content_hash": "b194ab47bb311b24b92ece3d6c96f58f",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 76,
"avg_line_length": 32.404761904761905,
"alnum_prop": 0.6029879990203282,
"repo_name": "bundgus/python-playground",
"id": "4080aaadc9741a17b2c5de360bb88e47c81bfa2e",
"s... |
import collections
import hashlib
import itertools
import six
from oslo_serialization import jsonutils
from heat.common import exception
from heat.common.i18n import _
from heat.engine import attributes
from heat.engine.cfn import functions as cfn_funcs
from heat.engine import function
class GetParam(function.Funct... | {
"content_hash": "af2df7d8e26a2f1ce90ea2a00890bff3",
"timestamp": "",
"source": "github",
"line_count": 677,
"max_line_length": 79,
"avg_line_length": 33.06499261447563,
"alnum_prop": 0.5279874916238553,
"repo_name": "jasondunsmore/heat",
"id": "5356ee51da42dfe9edf3b0cdad3e425ff16a4ebd",
"size": "2... |
import requests
from copy import deepcopy
import json
import os
import pkg_resources
from .config import SMARTAPI_URL
def restructure_specs(spec):
"""SmartAPI API restructure each spec when storing them. This function converts them back to the original smartapi specification"""
copy_spec = deepcopy(spec)
... | {
"content_hash": "3b0642455008ff90e661b8fa2739fb18",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 135,
"avg_line_length": 32.979166666666664,
"alnum_prop": 0.6114971572962729,
"repo_name": "biothings/biothings_explorer",
"id": "bfccc6a1afb1e7716c01c2681eecd96fa6944720",
... |
from django.db import models
from django.contrib.auth.models import User
from datetime import datetime
from proso_user.models import Session
from django.db.models.signals import pre_save
from django.dispatch import receiver
from proso.django.models import disable_for_loaddata
class Comment(models.Model):
usernam... | {
"content_hash": "4fed7666f45fb4a3cbadf646307df12c",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 70,
"avg_line_length": 30.11627906976744,
"alnum_prop": 0.6772200772200773,
"repo_name": "adaptive-learning/proso-apps",
"id": "9dfb41ace3a3034b04bd8ae954c9be9d3d612d50",
"... |
"""Berksfile related tests."""
import unittest
FIRST_BERKS = """
source 'https://supermarket.getchef.com'
cookbook 'newrelic_plugins', git: '[email protected]:rackspace-cookbooks/newrelic_plugins_chef.git'
cookbook 'disable_ipv6', path: 'test/fixtures/cookbooks/disable_ipv6'
cookbook 'wrapper', path: 'test/fixtures/coo... | {
"content_hash": "a82d587e30c277db8959b8a14a552ad5",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 96,
"avg_line_length": 34.108333333333334,
"alnum_prop": 0.6166625946738333,
"repo_name": "brint/fastfood",
"id": "de11f4b5c0d46fe57d62bdbfb3607485d2083c1d",
"size": "4093... |
import time
from datetime import datetime
import nose
import openpyxl
from nose.tools import eq_, ok_, raises
from ..Alignment import Alignment
from ..Color import Color
from ..Fill import Fill
from ..Font import Font
from ..Style import Style
from ..Workbook import Workbook
from .utils import get_output_path
def t... | {
"content_hash": "fcde26569a98d98d7e57583e8ad3323f",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 465,
"avg_line_length": 34.93582887700535,
"alnum_prop": 0.6372263891014848,
"repo_name": "kz26/PyExcelerate",
"id": "b477a8d6283ffb38eccb99bda5f65be08176b2fb",
"size": "6... |
from pudzu.charts import *
from pudzu.sandbox.bamboo import *
import scipy.stats
flags = pd.read_csv("../dataviz/datasets/countries.csv").filter_rows("organisations >> un").split_columns('country', "|").explode('country').set_index('country').drop_duplicates(subset='flag', keep='first')
continents = flags.groupby("con... | {
"content_hash": "9f59a2148249865a848644c779276f25",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 206,
"avg_line_length": 51.50574712643678,
"alnum_prop": 0.6744030350368221,
"repo_name": "Udzu/pudzu",
"id": "7d80ea2dcfc1d79d19d5fe7eb1424cb25d4797bd",
"size": "4481",
... |
import tensorflow as tf
import sys
def minimum(a, b):
"""
Minimum t-norm, also called the Gödel t-norm, is the standard semantics for conjunction in Gödel fuzzy logic.
It occurs in most t-norm based fuzzy logics as the standard semantics for weak conjunction.
.. math:: \top_min(a, b) = min(a, b)
... | {
"content_hash": "f3a58024ab86ceeb60f2a86e262df0cb",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 113,
"avg_line_length": 36.23170731707317,
"alnum_prop": 0.6529787950185123,
"repo_name": "uclmr/inferbeddings",
"id": "c83213d2556c8d45c1eb22791fc8b0c58d6ade38",
"size": "... |
import sys, logging
logging.basicConfig(level=15, stream=sys.stderr, format="%(levelname)1s:%(filename)10s:%(lineno)3d:%(message)s")
# make log level names shorter so that we can show them
logging.addLevelName(50, 'C')
logging.addLevelName(40, 'E')
logging.ad... | {
"content_hash": "f55f9141f3f4eefd05619b2db862ff69",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 137,
"avg_line_length": 26.593984962406015,
"alnum_prop": 0.6335877862595419,
"repo_name": "hexhex/hexlite",
"id": "aacc8bbbf99b43a26b87fb8ad6304a3f48ff28aa",
"size": "353... |
from django.contrib import admin
from .models import FormType
class FormTypeAdmin(admin.ModelAdmin):
pass
admin.site.register(FormType, FormTypeAdmin)
| {
"content_hash": "41ec246a1cec55a9bad23093fdda5ed3",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 44,
"avg_line_length": 16,
"alnum_prop": 0.79375,
"repo_name": "astrikov-d/dartcms",
"id": "0ca4f73c28b1d23bade751c79b95b32b82e57f21",
"size": "160",
"binary": false,
"... |
import os
from .tts import TTS
from .nlu import NLU
VERSION_PATH = os.path.join(os.path.dirname(__file__), "VERSION.txt")
with open(VERSION_PATH) as f:
__version__ = f.read().strip()
| {
"content_hash": "b9d02a5d5a10229c9729445c521d254b",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 69,
"avg_line_length": 21.11111111111111,
"alnum_prop": 0.6684210526315789,
"repo_name": "art1415926535/yandex_speech",
"id": "2d1332c063d5192148fa591ae206f25bb159c070",
"si... |
# Copyright 2016 by caixw, All rights reserved.
# Use of this source code is governed by a MIT
# license that can be found in the LICENSE file.
# @api POST /users/login 登录
# @apiGroup users
#
# @apiRequest json
# @apiParam username string 登录账号
# @apiParam password string 密码
#
# @apiSuccess 201 OK
# @apiParam expires ... | {
"content_hash": "7482c1a4726a6c5bf444a53ede756052",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 48,
"avg_line_length": 19.304347826086957,
"alnum_prop": 0.6430180180180181,
"repo_name": "a233894432/gowork",
"id": "c868e562fb11fbb6f3f297e7be8ae03d45b92459",
"size": "95... |
from aleph.views.context import blueprint as cache
from aleph.views.base_api import blueprint as base_api
from aleph.views.sessions_api import blueprint as sessions_api
from aleph.views.roles_api import blueprint as roles_api
from aleph.views.groups_api import blueprint as groups_api
from aleph.views.permissions_api im... | {
"content_hash": "7cfbd659dd9b0db05f01efd1fe8b9619",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 76,
"avg_line_length": 51.13953488372093,
"alnum_prop": 0.7989995452478399,
"repo_name": "pudo/aleph",
"id": "43cfcc749156285c2268006a6651d6134ab0765a",
"size": "2199",
"... |
import sublime, sublime_plugin
from xml.dom import minidom
import urllib, logging, urllib2, sys
import re, os.path,HTMLParser
from BeautifulSoup import BeautifulSoup
hh = urllib2.HTTPHandler()
hsh = urllib2.HTTPSHandler()
#hh.set_http_debuglevel(1)
#hsh.set_http_debuglevel(1)
opener = urllib2.build_opener(hh, hsh, url... | {
"content_hash": "1b225f638846b0c4d1b5d4dcdb3b2a94",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 106,
"avg_line_length": 27.821428571428573,
"alnum_prop": 0.6774711168164314,
"repo_name": "remcoder/SublimeHandcraft",
"id": "4469428620a0671ceb09f0da80c06c33a8d7629c",
"... |
import collections
import functools
from typing import List
from test_framework import generic_test
from test_framework.test_utils import enable_executor_hook
Endpoint = collections.namedtuple('Endpoint', ('is_closed', 'val'))
Interval = collections.namedtuple('Interval', ('left', 'right'))
def union_of_intervals(... | {
"content_hash": "6ffa3f1bca533848903ad7130ae959e3",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 79,
"avg_line_length": 29.529411764705884,
"alnum_prop": 0.6354581673306773,
"repo_name": "shobhitmishra/CodingProblems",
"id": "423e0d1c6a3bf61c2091e57e263ef2a034871d5a",
... |
import requests
from bs4 import BeautifulSoup
from PIL import Image
import sys
import os
import gi
from gi.repository import Gdk
gi.require_version('Gdk', '3.0')
def get_comic():
r = requests.get("http://xkcd.com/")
website_content = BeautifulSoup(r.content)
comic_div = website_content.findAll("div", {... | {
"content_hash": "6ceb2b1921d5d965316d8f5d6b59ed3e",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 138,
"avg_line_length": 26.974683544303797,
"alnum_prop": 0.6227123416236509,
"repo_name": "saru95/xkcd",
"id": "0677a70624d20d3c89cd6b460330f85a721d64d5",
"size": "2154",
... |
import sys
import hashlib
from pyftpdlib.authorizers import AuthenticationFailed
class Authorizer:
def __init__(self, username, password, directory, permission=None):
self.username = username
self.password = password
self.directory = directory
self.permission = permission or "elrad... | {
"content_hash": "bce083a052371ce9e992429ceb60f5a0",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 74,
"avg_line_length": 25.74137931034483,
"alnum_prop": 0.6584058941728065,
"repo_name": "tokibito/soloftpd",
"id": "3f6a414abceafa1f07f2f67f355ae11071ef35c2",
"size": "149... |
from __future__ import absolute_import
import six
from django.http import HttpResponse, StreamingHttpResponse
from sentry import eventstore
from sentry.api.bases.project import ProjectEndpoint
from sentry.api.exceptions import ResourceDoesNotExist
from sentry.lang.native.applecrashreport import AppleCrashReport
from... | {
"content_hash": "77f9b2c817ff957a1f8f16203d678cb0",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 99,
"avg_line_length": 40.32692307692308,
"alnum_prop": 0.6351931330472103,
"repo_name": "beeftornado/sentry",
"id": "15131841ab3ebfe5e715179e6fcf78ca02bf3494",
"size": "20... |
import unittest
from datetime import datetime
import mock
from airflow.exceptions import AirflowException
from airflow.models import DAG
from airflow.operators.check_operator import (
CheckOperator, IntervalCheckOperator, ThresholdCheckOperator, ValueCheckOperator,
)
class TestCheckOperator(unittest.TestCase):
... | {
"content_hash": "9e7d855bde975a9f1ba3285cc9a3be61",
"timestamp": "",
"source": "github",
"line_count": 306,
"max_line_length": 87,
"avg_line_length": 31.709150326797385,
"alnum_prop": 0.5753890549314645,
"repo_name": "wooga/airflow",
"id": "66bab5afaa31e4f72e8d0ef3dd6c70433205c11c",
"size": "10491... |
from unittest import mock
from unittest.mock import patch
import pendulum
import pytest
from pytest import param
from sqlalchemy.engine.url import make_url
from airflow.cli import cli_parser
from airflow.cli.commands import db_command
from airflow.exceptions import AirflowException
class TestCliDb:
@classmethod... | {
"content_hash": "7359bd391342fef50c5acd7c80eacb4c",
"timestamp": "",
"source": "github",
"line_count": 400,
"max_line_length": 110,
"avg_line_length": 42.17,
"alnum_prop": 0.564678681527152,
"repo_name": "lyft/incubator-airflow",
"id": "125e5d7c3e28d8c80350e2b3635d4bb53efa415e",
"size": "17654",
... |
import asyncio
import asyncio.streams
import collections
import ctypes
import struct
from . import aioutils
Event = collections.namedtuple('Event', ['flags', 'cookie', 'name', 'alias'])
_libc = ctypes.cdll.LoadLibrary('libc.so.6')
class LibC:
"""Proxy to C functions for inotify"""
@classmethod
def ino... | {
"content_hash": "26be195b59a2ae831d6ed5a67c6bb7f5",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 114,
"avg_line_length": 30.823076923076922,
"alnum_prop": 0.5739955078612429,
"repo_name": "rbarrois/aionotify",
"id": "113f68d7d77f4f677bd9ac9505b5e320adfec99e",
"size": ... |
from .api_types import *
class Notification(object):
"""
Base class for all notifications.
"""
class ServerConnectedNotification(Notification):
"""
Reports that the server is running. This notification is issued once after
the server has started running but before any requests are processed to let
th... | {
"content_hash": "443c01ff4ac6cf047a6106e5704230a7",
"timestamp": "",
"source": "github",
"line_count": 405,
"max_line_length": 93,
"avg_line_length": 26.750617283950618,
"alnum_prop": 0.7140483662543844,
"repo_name": "guillermooo/dart-sublime-bundle-releases",
"id": "6649e00f058494212638b587f0bc6ad3... |
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO_TRIG = 17
GPIO_ECHO = 18
GPIO.setup(GPIO_TRIG, GPIO.OUT)
GPIO.setup(GPIO_ECHO, GPIO.IN)
GPIO.output(GPIO_TRIG, GPIO.LOW)
if __name__ == '__main__':
try:
while True:
time.sleep(3)
GPIO.output(GPIO_TRIG, True)
... | {
"content_hash": "2f0c2ef7c0e4ef73c033f08c81d62fb4",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 46,
"avg_line_length": 24.214285714285715,
"alnum_prop": 0.5501474926253688,
"repo_name": "perchouli/raspberry-gadgets",
"id": "ec8f4ec07e153b3fb460f5bfe908607b783288f1",
"... |
##################################
# Import des modules et ajout du path de travail pour import relatif
import sys
sys.path.insert(0 , 'C:/Users/WILLROS/Perso/Shade/scripts/LocalWC-Shade-App/apis/')
from voca import AddLog , StringFormatter , OutFileCreate , OdditiesFinder
##################################
#... | {
"content_hash": "ce7325f85405c1ee08f5990cfa2aba7e",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 148,
"avg_line_length": 43.77142857142857,
"alnum_prop": 0.6664490861618799,
"repo_name": "sighill/shade_app",
"id": "860b324697958f44d077d67bdbd74e3f71a67c80",
"size": "16... |
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class UsersConfig(AppConfig):
"""Configuration for users app."""
name = 'ariane.apps.users'
verbose_name = _("Users")
| {
"content_hash": "7162237350e6cffe0cec7453f124d35e",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 55,
"avg_line_length": 24.77777777777778,
"alnum_prop": 0.7130044843049327,
"repo_name": "DebVortex/ariane-old-",
"id": "5aaa8ed8723acd4c613586890735074329765b65",
"size": "... |
import numpy as np
from distla_core.analysis.errors import errors_invsqrt
from distla_core.utils import pops
if __name__ == "__main__":
local_rows = np.array([128, 256, 512, 1024, 2048])
ROWS = tuple(pops.NROWS * local_rows)
DTYPES = (np.float32,) # dtype of the matrices
P_SZS = (256,) # panel size of the ... | {
"content_hash": "dfd8a7b1520ad3f48b3fde0e43244299",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 80,
"avg_line_length": 52.34285714285714,
"alnum_prop": 0.6730349344978166,
"repo_name": "google/distla_core",
"id": "1435fa865f444e427582a83fc9d9162c6984dd0a",
"size": "25... |
import sys
import socket
import re
import string
# you may use urllib to encode data appropriately
import urllib
from urlparse import urlparse
def help():
print "httpclient.py [GET/POST] [URL]\n"
class HTTPResponse(object):
def __init__(self, code=200, body=""):
self.code = code
self.body = bo... | {
"content_hash": "87887b009c97ede5fcd9bd8547fd2f60",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 145,
"avg_line_length": 31.369426751592357,
"alnum_prop": 0.542741116751269,
"repo_name": "wrflemin/CMPUT404-assignment-web-client",
"id": "20ba7203cec67ec815bc83b3ac300983b... |
# -*- coding:utf-8 -*-
import urllib
import urllib2
import json
from voice2cmd import voice2cmd
def joinRoom(url):
url=url+'join'
values ={'trainer':'rsj'} # 对数据进行JSON格式化编码
jdata = json.dumps(values)
req = urllib2.Request(url, jdata) # 生成页面请求的完整数据
response = urllib2.urlopen(req) # 发送页面请求... | {
"content_hash": "6fd4b5920f0c9c88f77f7176ab93b36a",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 74,
"avg_line_length": 28.89830508474576,
"alnum_prop": 0.6580645161290323,
"repo_name": "jaceyen/vocmon",
"id": "e1e5d444d1b541b250aae08fb7547b53c2adcb36",
"size": "1789",... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Produkte', '0003_auto_20171027_1709'),
]
operations = [
migrations.AlterField(
model_name='spendenstufe',
name='id',
... | {
"content_hash": "3fe94fe96d1d159dacae682139cb535f",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 73,
"avg_line_length": 22.444444444444443,
"alnum_prop": 0.6089108910891089,
"repo_name": "valuehack/scholarium.at",
"id": "566d6e265f1f587b5a1e2dfd7fc7f4155139baca",
"size... |
from django.contrib import admin
class PermissionAdmin(admin.ModelAdmin):
fieldsets = (
(None, {'fields': (('type', 'folder',))}),
(None, {'fields': (('user', 'group', 'everybody'),)}),
(None, {'fields': (
('can_edit','can_read','can_add_children')
)}... | {
"content_hash": "7d79b72ca8bfd3c428bc13b7064678c5",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 62,
"avg_line_length": 32.25,
"alnum_prop": 0.4754521963824289,
"repo_name": "KristianOellegaard/django-filer",
"id": "9498d9233136cb4d2fa63104e25ba0dee858710f",
"size": "4... |
import numpy as np
import seaborn as sns
from matplotlib import pyplot as plt
from matplotlib import animation
import numpy as np
def plot_sample_imgs(get_imgs_fun, img_shape, plot_side=5, savepath=None, cmap='gray'):
"""
Generate visual samples and plot on a grid
:param get_imgs_fun: function that given ... | {
"content_hash": "bdc350d5eec328e3626551697be2aaef",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 107,
"avg_line_length": 31.95798319327731,
"alnum_prop": 0.6205627136471207,
"repo_name": "5agado/data-science-learning",
"id": "1bd262b1c1bb4a21b3dfd267b1ea741f45ec2825",
... |
from django.db.models import (
CharField, F, Func, IntegerField, OuterRef, Q, Subquery, Value,
)
from django.db.models.fields.json import KeyTextTransform, KeyTransform
from django.db.models.functions import Cast, Concat, Substr
from django.test.utils import Approximate, ignore_warnings
from django.utils import tim... | {
"content_hash": "0580aa004c6151cf3ae2d20456b2f795",
"timestamp": "",
"source": "github",
"line_count": 738,
"max_line_length": 119,
"avg_line_length": 44.3739837398374,
"alnum_prop": 0.5775925247343349,
"repo_name": "ghickman/django",
"id": "07200f9f9742304cfeb3d9eca3a3c4b93b44ab13",
"size": "3274... |
"""SqueezeDet Demo.
In image detection mode, for a given image, detect objects and draw bounding
boxes around them. In video detection mode, perform real-time detection on the
video stream.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cv2
im... | {
"content_hash": "bce19256e354c71cc38a23053b9caae3",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 79,
"avg_line_length": 30.804651162790698,
"alnum_prop": 0.5794956968141326,
"repo_name": "goan15910/ConvDet",
"id": "cee5eef0b22df999fe43dce808ef25832e43e269",
"size": "6... |
"""Module that implements SSDP protocol."""
import re
import select
import socket
import logging
from datetime import datetime, timedelta
from typing import Dict, List, Optional, Set # noqa: F401
from xml.etree import ElementTree
import requests
import zeroconf
from netdisco.util import etree_to_dict
DISCOVER_TIMEO... | {
"content_hash": "c0aaee7586c1749d9b21c30d994918d1",
"timestamp": "",
"source": "github",
"line_count": 291,
"max_line_length": 79,
"avg_line_length": 30.302405498281786,
"alnum_prop": 0.5647539124518032,
"repo_name": "balloob/netdisco",
"id": "7c4dd9ccd8af3a1d7b8870e7ffd5d4c376824716",
"size": "88... |
from telebot import types
inline_buttons = {
'settings': {
'index': {'Приветствие': 'greetings',
"Интервал команды '/joke'": 'joke',
'Запретить стикеры': 'stickers'
},
'greetings': {
'Включить приветствия': 'allow_greetings',
... | {
"content_hash": "71e5fa4686d97058dd30ef7ef08ca718",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 82,
"avg_line_length": 31.976744186046513,
"alnum_prop": 0.5214545454545455,
"repo_name": "Ars2014/PyBananium",
"id": "7c724e2892872632412d5165ec2bcc547fc5088e",
"size": "1... |
from msrest.serialization import Model
class HttpMessage(Model):
"""HTTP message.
:param content: HTTP message content.
:type content: object
"""
_attribute_map = {
'content': {'key': 'content', 'type': 'object'},
}
def __init__(self, content=None):
super(HttpMessage, se... | {
"content_hash": "1d7e7015af3c037b28020b2ed61c9c2b",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 56,
"avg_line_length": 21.529411764705884,
"alnum_prop": 0.5901639344262295,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "f94eada2e8a3fdeb5a7c3e8e620fe5d81dbfce98",... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.