text stringlengths 4 1.02M | meta dict |
|---|---|
import psycopg2
from psycopg2 import extras
from flask import Flask, request, session, g, redirect, url_for, \
abort, render_template, flash
import config
from contextlib import closing
from database import connect_db
# create our little application :)
app = Flask(__name__)
app.config.from_object(config)
app.c... | {
"content_hash": "d4fe1825fa1091652d7ee12267157954",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 119,
"avg_line_length": 26.72826086956522,
"alnum_prop": 0.6380642537616917,
"repo_name": "casassg/schedule_generator",
"id": "0d309dd282a01ce8bb5599857373df2b9ae1f1d1",
"s... |
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from setupDB import Base, Project, Category, Entry
engine = create_engine('sqlite:///projects.db')
# Bind the engine to the metadata of the Base class so that the
# declaratives can be accessed through a DBSession instance
Base.metadata.bi... | {
"content_hash": "c0eddfd7ee2f76995e0c35f513b2d457",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 92,
"avg_line_length": 33.23529411764706,
"alnum_prop": 0.7663716814159292,
"repo_name": "pash080/projects_web",
"id": "612554f2aeb2b42d234678e47620d6bae2f4af48",
"size": "... |
def build_from_name(city_name):
return {
'match':{
'name':{
'query':city_name,
'operator':'and',
'fuzziness':'AUTO'
}
}
}
def build_from_guide(guide, regions=None, weathers=None, months=None, ignore_cids=Non... | {
"content_hash": "f1a64a5e654e0ae3aa3dfe5c6e81ea36",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 106,
"avg_line_length": 31.375,
"alnum_prop": 0.499003984063745,
"repo_name": "whosken/destinate",
"id": "d6c88877f6348395133e891479fc3793bc89156b",
"size": "2008",
"bina... |
from copy import deepcopy
from enum import Enum, unique
import json
from kii import exceptions as exc
class Clause:
def __str__(self):
return '<Clause Object:{0}> {1}'.format(
id(self),
json.dumps(self.query(), ensure_ascii=False))
@classmethod
def all(cls):
retur... | {
"content_hash": "29f23e6dd98427e571454b97c8368888",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 86,
"avg_line_length": 24.09765625,
"alnum_prop": 0.5218025611930621,
"repo_name": "ta2xeo/python3-kii",
"id": "002d41abd27bf89f5b9a5cfe05429edddcc5c593",
"size": "6169",
... |
"""Test Python APIs for working with formatters"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class SBFormattersAPITestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
NO_DEBUG_... | {
"content_hash": "f12f0902273bc5e2816a0a6d13441d50",
"timestamp": "",
"source": "github",
"line_count": 500,
"max_line_length": 92,
"avg_line_length": 40.456,
"alnum_prop": 0.5758849120031639,
"repo_name": "endlessm/chromium-browser",
"id": "f01d7c457c5f400b581df26c3b641be8e917f7cd",
"size": "20228... |
"""Add a new file to the ``fdep.yml`` file.
.. code:: bash
fdep add [--version=if_any] <local path> <remote path>
.. note:: This doesn't download the file. Use ``fdep install`` to download the files.
"""
import sys
from fdep.commands import ConfigRequiredMixin, SubcommandRunner
class AddCommandRunner(Subcomma... | {
"content_hash": "a48d28fff2bf6b532dfd1316dcff25dc",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 85,
"avg_line_length": 26.16216216216216,
"alnum_prop": 0.6229338842975206,
"repo_name": "checkr/fdep",
"id": "4af3dcda452b37a50d9626ab4e1bbba19faab546",
"size": "968",
"... |
import logging
import json
import os
import io
import unittest
import hashlib
import xml.etree.ElementTree as ET
import requests
from base64 import b64encode
from environs import Env
from dvvset import DVVSet
import boto3
from botocore.config import Config
from botocore.utils import fix_s3_host
env = Env()
env.read_... | {
"content_hash": "1127f7c2129711c198d5087545dac387",
"timestamp": "",
"source": "github",
"line_count": 288,
"max_line_length": 102,
"avg_line_length": 39.958333333333336,
"alnum_prop": 0.5319777546054918,
"repo_name": "imgrey/riak-middleware",
"id": "652ee8b869fbfbcd5df3c5435a9dd50765d80fd4",
"siz... |
r"""Find the full path to commands.
which(command, path=None, verbose=0, exts=None)
Return the full path to the first match of the given command on the
path.
whichall(command, path=None, verbose=0, exts=None)
Return a list of full paths to all matches of the given command on
the path.
whichgen(comman... | {
"content_hash": "61f7f29f78df23166496e9f88a65ce8a",
"timestamp": "",
"source": "github",
"line_count": 334,
"max_line_length": 80,
"avg_line_length": 36.616766467065865,
"alnum_prop": 0.5726901062959935,
"repo_name": "trentm/which",
"id": "99f5e3fc6d318fcd4aea60cad1f431a6751637ca",
"size": "12440"... |
import copy
import functools
import os
import re
import stat
import json
import shlex
import shutil
import textwrap
import platform
from enum import Enum
from pathlib import PurePath
from .. import mlog
from .. import mesonlib
from ..compilers import clib_langs
from ..mesonlib import MesonException, OrderedSet
from ..... | {
"content_hash": "43bd5933a3fd8d0ce9eee7012e80a2db",
"timestamp": "",
"source": "github",
"line_count": 1500,
"max_line_length": 165,
"avg_line_length": 40.70066666666666,
"alnum_prop": 0.562185713583725,
"repo_name": "MathieuDuponchelle/meson",
"id": "e67f4c08613cf77bd44601f715d55d77da0ce08c",
"si... |
from peewee import *
from playhouse.sqlite_ext import *
import datetime
from pushbullet import PushBullet
import ConfigParser
import re
config = ConfigParser.RawConfigParser()
config.read('app.cfg')
db = SqliteDatabase("eventbullet.db")
api_key = config.get("pushbullet", "api_key")
title_base = config.get("pushbulle... | {
"content_hash": "637fa0cb6e15912f622641526f249944",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 117,
"avg_line_length": 28.22429906542056,
"alnum_prop": 0.6158940397350994,
"repo_name": "takudo/eventbullet",
"id": "cc10adb57ac67271cceb54dad62e13ceefd9036a",
"size": "... |
from __future__ import absolute_import
import errno
import os
import sys
import signal
from mock import Mock, patch, call
from celery import _find_option_with_arg
from celery import platforms
from celery.five import open_fqdn
from celery.platforms import (
get_fdmax,
ignore_errno,
set_process_title,
... | {
"content_hash": "34438040357f0e98d5a74ead4e82a6e0",
"timestamp": "",
"source": "github",
"line_count": 691,
"max_line_length": 75,
"avg_line_length": 33.32706222865412,
"alnum_prop": 0.5388857527465369,
"repo_name": "sivaprakashniet/push_pull",
"id": "b01ad12c124ad05f4f4f152aae22c15b41b88ba2",
"si... |
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""
Test file created by XlsxWriter against a file created by Excel.
"""
def setUp(self):
self.maxDiff = None
filename = 'chart_gradient03.xlsx'
... | {
"content_hash": "727c520ef896678896b0a1f9334d6c03",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 68,
"avg_line_length": 27.10169491525424,
"alnum_prop": 0.5428392745465916,
"repo_name": "jkyeung/XlsxWriter",
"id": "8b0e50a85edba90ba00b82f34114d36e195b2009",
"size": "17... |
from chunsabot.database import Database
def make_initial_config():
Database.mkdir()
if Database.config_exists():
print("There exists account info. \r\nReally overwrite config file? (Y / N)")
if input().lower() == "y":
result = True
else:
result = False
else:... | {
"content_hash": "4954b3ad265c8d2846f5eae8e02fc829",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 121,
"avg_line_length": 36.4375,
"alnum_prop": 0.5909090909090909,
"repo_name": "susemeee/Chunsabot-framework",
"id": "68c7beabc533fe3e09c1d37e358265c1c7713e98",
"size": "1... |
"""
Can be run to install all the subpieces.
"""
from __future__ import print_function
try:
from setuptools import setup
from setuptools.command.install import install
from setuptools.command.sdist import sdist
except ImportError:
from distutils.core import setup
from distutils.command.install imp... | {
"content_hash": "18ef2813b3a564a42179ce9ac740a95a",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 75,
"avg_line_length": 22.259615384615383,
"alnum_prop": 0.5952483801295896,
"repo_name": "databricks-edu/build-tooling",
"id": "34577b57b55dfeb1125710f9504291b44a5005f0",
... |
"""Test for kubernetes_e2e.py"""
import os
import shutil
import string
import tempfile
import urllib2
import unittest
import time
import kubernetes_e2e
FAKE_WORKSPACE_STATUS = 'STABLE_BUILD_GIT_COMMIT 599539dc0b99976fda0f326f4ce47e93ec07217c\n' \
'STABLE_BUILD_SCM_STATUS clean\n' \
'STABLE_BUILD_SCM_REVISION v1.7.0-... | {
"content_hash": "3d9066b73548b230f2512d72eb39e5d7",
"timestamp": "",
"source": "github",
"line_count": 488,
"max_line_length": 141,
"avg_line_length": 39.66393442622951,
"alnum_prop": 0.6006406282289729,
"repo_name": "foxish/test-infra",
"id": "41f584dbd5488853a4a4c91e49230358269f87a5",
"size": "2... |
import datetime
import unittest
from unittest.mock import Mock, patch
import pendulum
from airflow import settings
from airflow.models.dag import DAG
from airflow.models.skipmixin import SkipMixin
from airflow.models.taskinstance import TaskInstance as TI
from airflow.operators.dummy_operator import DummyOperator
fro... | {
"content_hash": "0ce1a24b7fd821be302a2a2272f5e023",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 91,
"avg_line_length": 32.25,
"alnum_prop": 0.5968992248062015,
"repo_name": "mrkm4ntr/incubator-airflow",
"id": "a9145701c6458734bdf5b83b6565d3678dd81026",
"size": "3884",... |
import datetime
from pyoperant import hwio, utils, ComponentError
class BaseComponent(object):
"""Base class for physcal component"""
def __init__(self, name=None, *args, **kwargs):
self.name = name
pass
## Hopper ##
class HopperActiveError(ComponentError):
"""raised when the hopper is u... | {
"content_hash": "9edf739e1d4460866f519369384c5651",
"timestamp": "",
"source": "github",
"line_count": 438,
"max_line_length": 120,
"avg_line_length": 27.006849315068493,
"alnum_prop": 0.5571899568856201,
"repo_name": "MarvinT/pyoperant",
"id": "cef3f698a6570bee4351c58937ad02de374f103a",
"size": "... |
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from orcid_api_... | {
"content_hash": "b75a38da1a2307a8a2c12738ff21c011",
"timestamp": "",
"source": "github",
"line_count": 462,
"max_line_length": 276,
"avg_line_length": 30.125541125541126,
"alnum_prop": 0.5963500502945825,
"repo_name": "Royal-Society-of-New-Zealand/NZ-ORCID-Hub",
"id": "d6136c099959326c5aa9819cdc23e3... |
import json
import logging
import urllib2
from celery.schedules import crontab
from celery.task import periodic_task
from django.conf import settings
from corehq.apps.accounting.models import Currency
update_logger = logging.getLogger("currency_update")
smsbillables_logger = logging.getLogger("smsbillables")
@peri... | {
"content_hash": "8bd7db392400bf34d8ee02a34f337b79",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 110,
"avg_line_length": 38.785714285714285,
"alnum_prop": 0.7044198895027625,
"repo_name": "gmimano/commcaretest",
"id": "af37f354577181f1a35dac725828ac1ce367b7bf",
"size":... |
def quicksort(myList, start, end):
if start < end:
# partition the list
pivot = partition(myList, start, end)
# sort both halves
quicksort(myList, start, pivot-1)
quicksort(myList, pivot+1, end)
return myList
def partition(myList, start, end):
pivot = myList[start]
... | {
"content_hash": "33c5b63fbdf7856c1bb7bc3afb765c8f",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 54,
"avg_line_length": 27.77777777777778,
"alnum_prop": 0.559,
"repo_name": "salman-bhai/DS-Algo-Handbook",
"id": "cdd384606d209d39215ee3f6bab445681dc61c80",
"size": "1000"... |
from OpenGLCffi.GLES1 import params
@params(api='gles1', prms=['mode'])
def glBlendEquationOES(mode):
pass
| {
"content_hash": "162b0498b7529ddbecf86b22c242739c",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 35,
"avg_line_length": 18.333333333333332,
"alnum_prop": 0.7454545454545455,
"repo_name": "cydenix/OpenGLCffi",
"id": "8e336a510399d976cc9cb841e675ca7e6866d44e",
"size": "11... |
from abc import ABC, abstractmethod
class Serializable(ABC):
def __init__(self):
super(Serializable, self).__init__()
@abstractmethod
def serialize(self):
pass
@staticmethod
@abstractmethod
def unserialize(marshall):
pass
| {
"content_hash": "a340f313603881c8a46daaa22874d8d4",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 44,
"avg_line_length": 18.266666666666666,
"alnum_prop": 0.6277372262773723,
"repo_name": "ismtabo/file-mixer",
"id": "82961f9c29d43822243dc7056ebd29cb78a3a74b",
"size": "2... |
"""
Yet Another Django Profiler middleware implementation
"""
from __future__ import unicode_literals
import cProfile
import logging
import marshal
import os
import pstats
import subprocess
import tempfile
try:
from unittest import mock
except ImportError:
import mock
from django.core.exceptions import Midd... | {
"content_hash": "b475bcf436622c6821f879f60fe4cf9e",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 149,
"avg_line_length": 40.83040935672515,
"alnum_prop": 0.621741621311945,
"repo_name": "wiliamsouza/yet-another-django-profiler",
"id": "9ca14e12f70558c08d28285cb7d24b5cc2... |
import dragonfly
import bee
from bee import *
from bee.spyderhive.hivemaphive import hivemapframe
import Spyder
from dragonfly.commandhive import commandhive, commandapp
from panda3d.core import getModelPath
import os
getModelPath().prependPath(os.getcwd())
from bee import hivemodule
class myhivemapframe(hivemapf... | {
"content_hash": "392ef92987408e005b29739796c1ae7a",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 57,
"avg_line_length": 16.40909090909091,
"alnum_prop": 0.7188365650969529,
"repo_name": "agoose77/hivesystem",
"id": "b6507d1cc06e597fba60ac89c8c76b06e6b34bbf",
"size": "7... |
''' This script shows how to use a Motor Stage
'''
from basil.dut import Dut
dut = Dut('mercury_pyserial.yaml')
dut.init()
print(dut["MotorStage"].get_position())
# dut["MotorStage"].set_position(100000)
| {
"content_hash": "1869225768785a2f28ed050815a56b54",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 46,
"avg_line_length": 20.7,
"alnum_prop": 0.7053140096618358,
"repo_name": "SiLab-Bonn/basil",
"id": "81e530b35c76fd35344aaa7237cbc1bfeb5bba2a",
"size": "424",
"binary":... |
"""FixMatch with Distribution Alignment and Adaptative Confidence Ratio.
"""
import os
import sys
from typing import Callable
import jax
import jax.numpy as jn
import objax
from absl import app
from absl import flags
from absl.flags import FLAGS
from objax.typing import JaxArray
from semi_supervised_domain_adaptation... | {
"content_hash": "63d87706836801f56e8c252eff9a6bbb",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 113,
"avg_line_length": 50.3203125,
"alnum_prop": 0.6365471200124204,
"repo_name": "google-research/adamatch",
"id": "e2bc3c7611420e935ba3cb73273c9ffac921ccbd",
"size": "7... |
from os.path import abspath, dirname, join
import astropy.config as _config
import astropy.io.registry as io_registry
from astropy import extern
from .table import Table
class Conf(_config.ConfigNamespace):
"""
Configuration parameters for `astropy.table.jsviewer`.
"""
jquery_url = _config.ConfigIt... | {
"content_hash": "0529103c8c444d9c599b506ed999e3d0",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 82,
"avg_line_length": 32.717171717171716,
"alnum_prop": 0.6023464032108675,
"repo_name": "lpsinger/astropy",
"id": "bc36e63812f9e0272cbd3041246ad0bf66b600f9",
"size": "65... |
from django.http import HttpResponse
from django.shortcuts import render
from django.contrib.auth import authenticate, login
def persona_login(request):
user = authenticate(assertion=request.POST['assertion'])
if user:
login(request, user)
return HttpResponse('OK')
| {
"content_hash": "e2f72d0da1b66ba43b14920b46b873c8",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 60,
"avg_line_length": 28.8,
"alnum_prop": 0.75,
"repo_name": "PeterHo/mysite",
"id": "ea5cd1464cf140183ad93054c141df6dbd7869f4",
"size": "288",
"binary": false,
"copie... |
from django.db import models
class Election(models.Model):
name = models.CharField(max_length=128)
description = models.TextField()
country = models.ForeignKey('core.Country', null=True, blank=True)
live_date = models.DateTimeField()
dead_date = models.DateTimeField()
active = models.BooleanF... | {
"content_hash": "006d24280f6dfa1e9801de1bc9e1b4ad",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 70,
"avg_line_length": 26.2,
"alnum_prop": 0.6946564885496184,
"repo_name": "JustinWingChungHui/electionleaflets",
"id": "c1385bd687aef0b14f9d920f57fb220fb7fc3c1c",
"size":... |
import collections
import time
from logging import getLogger
import django
from django.db import models
from django.db.models import query
from django.db.models.fields.related_descriptors import ForwardManyToOneDescriptor
__version__ = '1.2.3'
logger = getLogger(__name__)
class PrefetchManagerMixin(models.Manager)... | {
"content_hash": "7071afd20e09843ca64cd28ad1f0ba68",
"timestamp": "",
"source": "github",
"line_count": 289,
"max_line_length": 132,
"avg_line_length": 37.259515570934255,
"alnum_prop": 0.5653789004457652,
"repo_name": "ionelmc/django-prefetch",
"id": "5a70c6815c735fef784cb66681a97bd08d1c78f7",
"si... |
"""SCons.Tool.sunf95
Tool-specific initialization for sunf95, the Sun Studio F95 compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 20... | {
"content_hash": "e39c1a966f8bd3dc79f0a33bf219db06",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 119,
"avg_line_length": 34.1875,
"alnum_prop": 0.729890310786106,
"repo_name": "sftd/scons",
"id": "fd0be66ea802cec53afdc9604557e85983a0de43",
"size": "2188",
"binary": f... |
from datetime import datetime, timedelta
import json
from django import template
from django.conf import settings
from django.core.urlresolvers import reverse
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from corehq.... | {
"content_hash": "2e2054e613f67181ecb589e1301353bc",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 149,
"avg_line_length": 32.4046511627907,
"alnum_prop": 0.6306875269125879,
"repo_name": "gmimano/commcaretest",
"id": "95c96c82abab2a2b7785f6a0c435c406235fed3a",
"size": ... |
import time
from struct import pack
from electrum_arg.i18n import _
from electrum_arg.util import PrintError, UserCancelled
from electrum_arg.keystore import bip39_normalize_passphrase
from electrum_arg.bitcoin import serialize_xpub
class GuiMixin(object):
# Requires: self.proto, self.device
messages = {
... | {
"content_hash": "cd7ff575cd4aab5d6960bf6c5b6aeffa",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 79,
"avg_line_length": 38.23376623376623,
"alnum_prop": 0.5996376811594203,
"repo_name": "argentumproject/electrum-arg",
"id": "ae200355641cccac14281509332cbc7fc0c8894f",
... |
from setuptools import setup, find_packages
with open('README.md') as f:
long_description = f.read()
with open('requirements.txt') as f:
requirements = f.read().splitlines()
with open('extra_requirements.txt') as f:
extra_requirements = f.read().splitlines()
setup(
name='nussl',
version="1.1.9",... | {
"content_hash": "444974e37fb5d8e6dd9b4d2ba5e156a2",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 91,
"avg_line_length": 35.26,
"alnum_prop": 0.627906976744186,
"repo_name": "interactiveaudiolab/nussl",
"id": "944a3efe37c786bb84de1fa6669863e754a092ae",
"size": "1763",
... |
"""Wrapper for pulse
Generated with:
tools/genwrappers.py pulseaudio
Do not modify this file.
"""
__docformat__ = 'restructuredtext'
__version__ = '$Id: wrap.py 1694 2008-01-30 23:12:00Z Alex.Holkner $'
import ctypes
from ctypes import *
import pyglet.lib
_lib = pyglet.lib.load_library('pulse')
_int_types = (c_i... | {
"content_hash": "2b9a9828886c1abf2b53920289e3a9c5",
"timestamp": "",
"source": "github",
"line_count": 2507,
"max_line_length": 88,
"avg_line_length": 36.81053051455923,
"alnum_prop": 0.6393632699059425,
"repo_name": "bitcraft/pyglet",
"id": "970487f5faad1554826730c3da20c4d7365073db",
"size": "922... |
from multiprocessing.connection import Listener, Client
from os import path, environ
import datetime
address = path.join(environ['XDG_RUNTIME_DIR'], 'i3timer')
authkey = bytes(environ['XDG_SESSION_COOKIE'], 'ascii')
class Timer(object):
def __init__(self):
self.stop()
@property
def current(self... | {
"content_hash": "71e2b1bd8910b7c9de78def3ca50c21b",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 97,
"avg_line_length": 21.7,
"alnum_prop": 0.5765488991295443,
"repo_name": "sniegu/i3timer",
"id": "e2557b316408bf913736ef95376f8b832d193290",
"size": "1968",
"binary": ... |
import os
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
from app import app, db
#app.config.from_object(os.environ['APP_SETTINGS'])
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', MigrateCommand)
if __name__ == '__main__':
manager.run() | {
"content_hash": "fdc0e0889f972042cd291f79573c44e7",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 53,
"avg_line_length": 18.823529411764707,
"alnum_prop": 0.721875,
"repo_name": "sotdjin/glibglab",
"id": "8583eb13d1f1bb98886d2659ffa44b1c0f604e55",
"size": "320",
"bina... |
from scipy import linspace
from scipy.stats import norm
import numpy as np
import math
def densitiesPlot( densities, unit, legend = None ):
import matplotlib.pyplot as plt
L = len( densities[0] )/2
pts = symmetric_lattice( L=L, unit=unit )
for density in densities:
plt.plot( pts, density )
... | {
"content_hash": "4456289e01b1220d6796d23765c98168",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 201,
"avg_line_length": 39.923371647509576,
"alnum_prop": 0.608637236084453,
"repo_name": "notbanker/pysport",
"id": "c31b632de963495286ddbeac0f25079e082cf5b8",
"size": "1... |
from django.conf import settings
from django.conf.urls import patterns, include, url
urlpatterns = patterns('members.views',
url(r'^$', 'members_home', name="home"),
url(r'^login/$', 'members_login', name="login"),
url(r'^cancel/$', 'members_cancel', name="cancel"),
url(r'^purchase/(\S+)/$', 'purchase', name="... | {
"content_hash": "566944fe6243c1638d2fba0731910431",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 69,
"avg_line_length": 43.07692307692308,
"alnum_prop": 0.6339285714285714,
"repo_name": "pizzapanther/Super-Neutron-Drive",
"id": "174714b94b3b7402e1de540311571190a42aa584",... |
"""
Admin support code for DurationFields.
"""
import ttcal
from django.forms.fields import Field
from django.forms import ValidationError
from django.forms.utils import flatatt
from django.forms.widgets import TextInput
from django.utils.safestring import mark_safe
from django.utils.encoding import force_text
class ... | {
"content_hash": "6ba98c50942f767f722c0ae76355489d",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 78,
"avg_line_length": 33.51724137931034,
"alnum_prop": 0.6198559670781894,
"repo_name": "datakortet/dkmodelfields",
"id": "a1b776fc9a4c28f368fad42d61d7698830ed781c",
"size... |
import scrapy
from scrapy.loader.processors import Join, MapCompose, TakeFirst
from w3lib.html import remove_tags
from classics_spider.utils import Sanitizer
class ClassicsSpiderItem(scrapy.Item):
post_id = scrapy.Field(
input_processor=MapCompose(remove_tags),
output_processor=Join(),
)
... | {
"content_hash": "3fcfe1813f860af99ae955221657e359",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 75,
"avg_line_length": 31.083333333333332,
"alnum_prop": 0.6943699731903485,
"repo_name": "adaschevici/classics_crawler",
"id": "b543098f382296a4926ee5174856431b9b99214b",
... |
from decimal import Decimal
from typing import List, Union
from ...asset import Asset
from ...call_builder.base import BaseStrictReceivePathsCallBuilder
from ...call_builder.call_builder_sync.base_call_builder import BaseCallBuilder
from ...client.base_sync_client import BaseSyncClient
from ...type_checked import type... | {
"content_hash": "de1ed52050fc244ac716b4e33675cb7f",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 139,
"avg_line_length": 45.258620689655174,
"alnum_prop": 0.7272380952380952,
"repo_name": "StellarCN/py-stellar-base",
"id": "e0efc568a69e0d07278db80aa036082dac6451ed",
"s... |
"""Isomap for manifold learning"""
# Author: Jake Vanderplas -- <vanderplas@astro.washington.edu>
# License: BSD, (C) 2011
import numpy as np
from ..base import BaseEstimator
from ..neighbors import NearestNeighbors, kneighbors_graph
from ..utils.graph import graph_shortest_path
from ..decomposition import KernelPCA... | {
"content_hash": "6424bb3ef8044ce41a00cba7576fe5c7",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 79,
"avg_line_length": 35.02970297029703,
"alnum_prop": 0.5891746749576031,
"repo_name": "cdegroc/scikit-learn",
"id": "c7ba7ed37105df4c71019b94c91803ca3008c403",
"size": ... |
def test_import():
import pelican_jupyter
assert pelican_jupyter.__version__ is not None
assert pelican_jupyter.__version__ != "0.0.0"
assert len(pelican_jupyter.__version__) > 0
def test_import_markup():
from pelican_jupyter import markup as nb_markup
assert nb_markup
def test_import_liqu... | {
"content_hash": "b1d6af53272b4395c8090b6c00182546",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 51,
"avg_line_length": 22.22222222222222,
"alnum_prop": 0.69,
"repo_name": "danielfrg/pelican-ipynb",
"id": "e062a4f6589c9ca1f19539f1b0f71c0a0d4e5108",
"size": "400",
"bi... |
import web
import hashlib
import cgi
#import Image
from PIL import Image
import os
import os.path
import random
import string
import time
import hashlib
import socket
from sign import sign
from config import upload_path,app_root
from conn import client
cgi.maxlen = 5 * 1024 * 1024 #文件大小限制,需要 try except
db = client.py... | {
"content_hash": "05d52fdc3567790987e8d9cccf127bac",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 73,
"avg_line_length": 24.138461538461538,
"alnum_prop": 0.6488209050350542,
"repo_name": "otarim/pyblog",
"id": "253474c9a46edfee49c461fdcbedc2e357864589",
"size": "3190"... |
import argparse, sys, copy, gzip, time, math, re
import numpy as np
import pandas as pd
from scipy import stats
from collections import Counter, defaultdict, namedtuple
import statsmodels.formula.api as smf
from operator import itemgetter
import warnings
from svtools.vcf.file import Vcf
from svtools.vcf.genotype import... | {
"content_hash": "4f068c64eb31db820d1d694ac306c85a",
"timestamp": "",
"source": "github",
"line_count": 595,
"max_line_length": 253,
"avg_line_length": 39.22016806722689,
"alnum_prop": 0.582533424751457,
"repo_name": "abelhj/svtools",
"id": "ff54efaba5c82568b53873f128d5d5ecfa9fb3a4",
"size": "23359... |
import unittest
from django.test import TestCase
from django.utils import six
from django.db.models import (CharField, TextField,
BooleanField, ForeignKey,
SmallIntegerField)
from django.contrib.auth.models import User
from django.utils.translation import uge... | {
"content_hash": "3d9afb8f3c06b20ad74a9ab264d8ee62",
"timestamp": "",
"source": "github",
"line_count": 394,
"max_line_length": 107,
"avg_line_length": 39.53299492385787,
"alnum_prop": 0.6893297380585516,
"repo_name": "luanfonceca/speakerfight",
"id": "ca8e5806697795db4f321f1a8b5fd246d8e308c7",
"si... |
"""
Utilities for handling command line-related tasks - parsing arguments for
program options, expanding args into paths etc.
@author James Skinner
@version 0.1
"""
__all__ = [
"WinShlex",
"Args",
"parseargs"
]
import getopt
import shlex
from collections import namedtuple
from spiralx.props import Props
clas... | {
"content_hash": "33e514c0fd933cfd04f84b3004bac85e",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 79,
"avg_line_length": 23.02857142857143,
"alnum_prop": 0.6133167907361455,
"repo_name": "spiralx/mypy",
"id": "dad27f455e31c51f841b87e5822881292073852a",
"size": "2418",
... |
from pyswagger import App
from ..utils import get_test_data_folder
import unittest
_json = 'application/json'
_xml = 'application/xml'
class PatchObjTestCase(unittest.TestCase):
""" test patch_obj.py """
@classmethod
def setUpClass(kls):
kls.app = App._create_(get_test_data_folder(
... | {
"content_hash": "a62778368c828deb2c05963d7a890444",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 69,
"avg_line_length": 34.29032258064516,
"alnum_prop": 0.5989338350580119,
"repo_name": "mission-liao/pyswagger",
"id": "abf211436d3fcd2bce62f5162d3b6ed782938d32",
"size":... |
import numpy as np
import pandas as pd
import sklearn.preprocessing
def load_glove(vectors_file, normalize=False):
"""
Load a GloVe formatted file, which is simply of the format
<word_0><space><vec_0,0><space><vec_0,1><space>...<newline>
<word_1><space><vec_1,0><space><vec_1,1><space>...<newl... | {
"content_hash": "4bce15e5fbea7f4e90e7438142078706",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 78,
"avg_line_length": 36.861111111111114,
"alnum_prop": 0.6137905048982668,
"repo_name": "chicago-justice-project/article-tagging",
"id": "ec7d7befcdd0179e2686bbbfa92f5326c9... |
import json
import pathlib
import proto
import re
import shutil
import tempfile
import requests
from typing import (
Any,
Dict,
List,
NamedTuple,
Optional,
Sequence,
Tuple,
TYPE_CHECKING,
Union,
)
from google.api_core import operation
from google.api_core import exceptions as api_ex... | {
"content_hash": "ac1cfb06bf5a12420de482f17804c8b8",
"timestamp": "",
"source": "github",
"line_count": 5034,
"max_line_length": 278,
"avg_line_length": 46.72367898291617,
"alnum_prop": 0.608417266492919,
"repo_name": "googleapis/python-aiplatform",
"id": "222f7df1a8c765fd00854b169eb1991b9efc2912",
... |
from __future__ import absolute_import, division, print_function
import time
import WatchmanEdenTestCase
class TestEdenJournal(WatchmanEdenTestCase.WatchmanEdenTestCase):
def test_eden_journal(self):
def populate(repo):
repo.write_file("hello", "hola\n")
repo.commit("initial comm... | {
"content_hash": "907fbbf70cae675b97325c98600f764d",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 87,
"avg_line_length": 35.747252747252745,
"alnum_prop": 0.5410390408853366,
"repo_name": "wez/watchman",
"id": "1adb2474d81f307cc3ac1fd4886b8494eb160144",
"size": "3385",
... |
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.shortcuts import render
from django.views.generic import DetailView, TemplateView
from django.http import HttpResponse
from ojoalplato.cards.forms import RestaurantSearchForm
from ojoalplato.cards.models import Restaurant, Wine
from ... | {
"content_hash": "2cf3daabd858f9dc2c8caf2a4a2657a2",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 78,
"avg_line_length": 33.23943661971831,
"alnum_prop": 0.6411016949152543,
"repo_name": "javipalanca/ojoalplato",
"id": "1138ab1874daa616e4701a0cc9a4b3bbce495cc2",
"size":... |
import time
from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, live_only)
from knack.util import CLIError
# pylint: disable=line-too-long
# pylint: disable=too-many-lines
class SBNSMigrationCRUDScenarioTest(ScenarioTest):
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
# Te... | {
"content_hash": "cc418564fabaa40d422b62045e72326d",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 167,
"avg_line_length": 47.382716049382715,
"alnum_prop": 0.6293642522146952,
"repo_name": "yugangw-msft/azure-cli",
"id": "a3ddc2b106dd9400ea4faa5d0d87e49d4a3ab4d8",
"siz... |
"""
kindlepush
~~~~~~~~~~
Kindlepush is trying to rescue you from manually clicking the deliver
button to send the doc from your kindle library to your kindle. It
is for 3G devices, such as kindle dx.
It was created by @blahgeek, now maintained by @lord63.
:copyright: (c) 2014 BlahGeek.
... | {
"content_hash": "8b671216a420d3f2db22926131082711",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 73,
"avg_line_length": 28.8,
"alnum_prop": 0.6493055555555556,
"repo_name": "lord63/kindledxpush",
"id": "a80b26cd6abc18d5a7d50a23dffd9f3cbb13bebd",
"size": "622",
"binar... |
"""The base classes for RDFValue tests."""
import time
from grr.client.components.rekall_support import rekall_types as rdf_rekall_types
from grr.lib import aff4
from grr.lib import rdfvalue
from grr.lib import test_lib
from grr.lib import type_info
from grr.lib.rdfvalues import client as rdf_client
from grr.lib.rdfval... | {
"content_hash": "5956bbd92510d4b17be407b9675f5f90",
"timestamp": "",
"source": "github",
"line_count": 275,
"max_line_length": 81,
"avg_line_length": 33.90181818181818,
"alnum_prop": 0.7054596160034323,
"repo_name": "pidydx/grr",
"id": "7b173ac1b08273c448c045f16b27364752733752",
"size": "9371",
... |
from asynctest import TestCase
from parameterized import parameterized
from async_hvac import AsyncClient
from async_hvac.tests.util import RequestsMocker
class TestApproleRoutes(TestCase):
"""Unit tests providing coverage for approle auth backend-related methods/routes."""
@parameterized.expand([
... | {
"content_hash": "4f63012e2963a686d4de93b36a7f7030",
"timestamp": "",
"source": "github",
"line_count": 610,
"max_line_length": 130,
"avg_line_length": 35.1983606557377,
"alnum_prop": 0.5248474686786829,
"repo_name": "Aloomaio/async-hvac",
"id": "866c6031a4da11f5ae0e80c9c3fca4b217addafd",
"size": "... |
"""
This module contains XMLSchema classes creator for xmlschema package.
Two schema classes are created at the end of this module, XMLSchema10 for XSD 1.0 and
XMLSchema11 for XSD 1.1. The latter class parses also XSD 1.0 schemas, as prescribed by
the standard.
Those are the differences between XSD 1.0 and XSD 1.1 an... | {
"content_hash": "89dabdb1a4151baeb52fc48a7faec9f1",
"timestamp": "",
"source": "github",
"line_count": 1289,
"max_line_length": 116,
"avg_line_length": 47.24204809930178,
"alnum_prop": 0.6275884719599311,
"repo_name": "brunato/xmlschema",
"id": "e6f8768ddce6939d3aefe68265c52d90f3f5d523",
"size": "... |
"""The :mod:`~deap.creator` is a meta-factory allowing to create classes that
will fulfill the needs of your evolutionary algorithms. In effect, new
classes can be built from any imaginable type, from :class:`list` to
:class:`set`, :class:`dict`, :class:`~deap.gp.PrimitiveTree` and more,
providing the possibility to im... | {
"content_hash": "1e07004c75977fcf0a0bf6eed87ba6a1",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 78,
"avg_line_length": 38.78048780487805,
"alnum_prop": 0.6283018867924528,
"repo_name": "Gab0/gekkoJaponicus",
"id": "1932ef24eadc6257d7b1dac21d0e3fdf2ae47e5c",
"size": "... |
import os
from os.path import join
import numpy as np
import pandas as pd
from hagelslag.evaluation import DistributedROC, DistributedReliability
eval_path = "/glade/p/work/dgagne/ncar_coarse_neighbor_eval_2016_s_2/"
eval_files = sorted(os.listdir(eval_path))
eval_test = pd.read_csv(join(eval_path, eval_files[0]))
m... | {
"content_hash": "1fce9b1178f5f6929278498c9904a259",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 115,
"avg_line_length": 51.351351351351354,
"alnum_prop": 0.6447368421052632,
"repo_name": "djgagne/hagelslag",
"id": "8343a7051a84e911c248685849fcac7c617fdef9",
"size": "1... |
from zeus.models import TestCaseMeta
def test_repository_test_details(
client,
db_session,
default_login,
default_testcase,
default_build,
default_repo,
default_repo_access,
):
db_session.add(
TestCaseMeta(
repository_id=default_testcase.repository_id,
n... | {
"content_hash": "c6fa444131239f95123b738bcb5f54f9",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 63,
"avg_line_length": 27.40625,
"alnum_prop": 0.6054732041049031,
"repo_name": "getsentry/zeus",
"id": "f9989ae4c399b4809b74bd31b76e7daf93082228",
"size": "877",
"binary... |
from copy import deepcopy
# Copied from django/utils/html.py
# TODO(robryk): Remove once we start using a version of Django that includes these
from django.utils.html import conditional_escape, mark_safe
def format_html(format_string, *args, **kwargs):
"""
Similar to str.format, but passes all arguments throug... | {
"content_hash": "c4a81caa52568c34b4187cc74b840eb1",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 159,
"avg_line_length": 41.769911504424776,
"alnum_prop": 0.5315677966101695,
"repo_name": "zielmicha/satori",
"id": "5869a698783f51bcc979e5c50263043fb8e9fc77",
"size": "9... |
"""The Euler sampling method for ito processes."""
from typing import Callable, List, Optional
import tensorflow.compat.v2 as tf
from tf_quant_finance import types
from tf_quant_finance import utils as tff_utils
from tf_quant_finance.math import custom_loops
from tf_quant_finance.math import random
from tf_quant_fin... | {
"content_hash": "d93cad7210954e28b4d9385c86dc3419",
"timestamp": "",
"source": "github",
"line_count": 527,
"max_line_length": 107,
"avg_line_length": 41.9146110056926,
"alnum_prop": 0.6386889401964779,
"repo_name": "google/tf-quant-finance",
"id": "a9326753dd606bd776dbbb47fb96ef0c367f8f90",
"size... |
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Series(models.Model):
name = models.CharField(max_length=128)
number = models.PositiveSmallIntegerField()
year = models.PositiveSmallIntegerField()
parent = models.ForeignKey('... | {
"content_hash": "777bc6298dae492ad164df44f2428bfa",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 94,
"avg_line_length": 34.87179487179487,
"alnum_prop": 0.6963235294117647,
"repo_name": "reiniervdwindt/power-rangers-api",
"id": "63c9e29bb0e0f2470998476d3e6d0ff6cba456cb",... |
from __future__ import unicode_literals
import appointment.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('appointment', '0002_vaccineappointment_20181031_1852'),
]
operations = [
migrations.AddField(
model_name='appo... | {
"content_hash": "2d1b244521934d9ae9f71e2dde214370",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 134,
"avg_line_length": 36.911764705882355,
"alnum_prop": 0.6438247011952192,
"repo_name": "SaturdayNeighborhoodHealthClinic/clintools",
"id": "db64fc02cda5eb0ea62f2071eb84b5... |
'''
Copyright 2017 Dell Inc. or its subsidiaries. All Rights Reserved.
Author(s):
George Paulos
RackHD Functional Integration Test (FIT) library
This is the main common function library for RackHD FIT tests.
'''
# Standard imports
import fit_path # NOQA: unused import
import os
import sys
import json
import subproc... | {
"content_hash": "f534866fb618ac03afe45d88d57239d9",
"timestamp": "",
"source": "github",
"line_count": 1138,
"max_line_length": 125,
"avg_line_length": 39.78822495606327,
"alnum_prop": 0.5439828618123191,
"repo_name": "DavidjohnBlodgett/RackHD",
"id": "387f14ead5d7ea3f8a4d592bdcc7bc61c957a163",
"s... |
"""
Unit tests for the NetApp Data ONTAP cDOT multi-SVM storage driver library.
"""
import copy
import ddt
import mock
from oslo_log import log
from manila import context
from manila import exception
from manila.share.drivers.netapp.dataontap.client import api as netapp_api
from manila.share.drivers.netapp.dataontap... | {
"content_hash": "1af487a85bb26ed64eb5506b90792a8f",
"timestamp": "",
"source": "github",
"line_count": 789,
"max_line_length": 79,
"avg_line_length": 40.98605830164765,
"alnum_prop": 0.584297111757066,
"repo_name": "bswartz/manila",
"id": "286947020b71a91a63e05ee9b11e840df41834cd",
"size": "32971"... |
"""
Django settings for qr_code_demo project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os... | {
"content_hash": "8c5154500390abaefeb683bb6c63f4fa",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 344,
"avg_line_length": 32.224,
"alnum_prop": 0.7055610724925522,
"repo_name": "dprog-philippe-docourt/django-qr-code",
"id": "68da1a3091c8dae69c06cd8d2344aa825545793b",
"... |
import logging
import time
from universe import pyprofile
from universe.vectorized import core
logger = logging.getLogger(__name__)
DEFAULT_MAX_EPISODE_SECONDS = 20 * 60. # Default to 20 minutes if there is no explicit limit
class TimeLimit(core.Wrapper):
def _configure(self, **kwargs):
super(TimeLimi... | {
"content_hash": "eaa2b2a45d944bbee83533bf3a7551d3",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 112,
"avg_line_length": 37.092592592592595,
"alnum_prop": 0.6465302046929605,
"repo_name": "rht/universe",
"id": "49fb05aca45a27bc47c88396ffbbb5187e6a2903",
"size": "2003",... |
from .pulsectl import Module
class Module(Module):
def __init__(self, config, theme):
super().__init__(config, theme, "sink")
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
| {
"content_hash": "81366dece002f0238c013be4aedb9fb6",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 53,
"avg_line_length": 21.77777777777778,
"alnum_prop": 0.6632653061224489,
"repo_name": "tobi-wan-kenobi/bumblebee-status",
"id": "31fecec2f4d74b17482f73ec5d96a5c7cec1e099",
... |
"""Tests the Tensorboard mesh plugin."""
import collections.abc
import os
import shutil
import numpy as np
import tensorflow as tf
import time
from unittest import mock
from werkzeug import test as werkzeug_test
from werkzeug import wrappers
from tensorboard.backend import application
from tensorboard.backend.event_p... | {
"content_hash": "be6a3351bc3c606428b8b38ab7292e15",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 86,
"avg_line_length": 38.74603174603175,
"alnum_prop": 0.5625768127816468,
"repo_name": "tensorflow/tensorboard",
"id": "e56c1fa82d45e61d9ce12da1bd0b9f59f27acbca",
"size"... |
"""Sliver manager.
The sliver manager has several functions. It is responsible for
creating, resource limiting, starting, stopping, and destroying
slivers. It provides an API for users to access these functions and
also to make inter-sliver resource loans. The sliver manager is also
responsible for handling delegat... | {
"content_hash": "c92cf6dfd7ae21d14acf240a1c1b2ec2",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 100,
"avg_line_length": 35.93076923076923,
"alnum_prop": 0.6343395418539928,
"repo_name": "dreibh/planetlab-lxc-nodemanager",
"id": "6db569a757f896dd659cddb24704dec82b251de3... |
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""
Test file created by XlsxWriter against a file created by Excel.
"""
def setUp(self):
self.set_filename('textbox11.xlsx')
def test_create_file(s... | {
"content_hash": "f527c0d1e0dfc1a4b5ff220e2b719ab5",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 76,
"avg_line_length": 25.11111111111111,
"alnum_prop": 0.6268436578171092,
"repo_name": "jmcnamara/XlsxWriter",
"id": "67ef2d7ac22f6821e34487883b66fd1ed876e1a4",
"size": "... |
import RPi.GPIO as GPIO
import time
import os
import subprocess as sub
import sys
import socket
from clint.textui import colored
BCN3DSigmaxLCDPath = "home/pi/BCN3DSigmaxLCD"
BCN3DSigmaPath = "/home/pi/BCN3DSigma"
BCN3DPlusPath = "/home/pi/BCN3DSigmax"
BCN3DSigmaScreenPath = "home/pi/BCN3DSigmaLCD"
repoPath = "/home/p... | {
"content_hash": "33629b7f962c80b9ea8bdb7ad6504909",
"timestamp": "",
"source": "github",
"line_count": 335,
"max_line_length": 119,
"avg_line_length": 27.053731343283584,
"alnum_prop": 0.6679907315458458,
"repo_name": "BCN3D/SD-Auto-Loader",
"id": "886af2ef182fd13ab2f76b2a08014785aa15b0f8",
"size"... |
import json
import urllib2
import pymongo
# connect to mongo
connection = pymongo.MongoClient("mongodb://localhost")
# get a handle to the reddit database
db = connection.reddit
stories = db.stories
# get the reddit home page
reddit_page = urllib2.urlopen("http://www.reddit.com/r/technology/.json")
# parse the js... | {
"content_hash": "af9e7c3ac39a61f4c09077d07c60ac38",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 73,
"avg_line_length": 21.666666666666668,
"alnum_prop": 0.7307692307692307,
"repo_name": "fabella/pymongo",
"id": "cad5c6e041d338dbaf266b55e3be8b7b5d52d3c7",
"size": "520"... |
import argparse
import json
from taxonomyschema.request import Requestor
from taxonomyschema.vocabulary import VocabularyEncoder, VocabularyManifest
from requests.exceptions import HTTPError
def run(models_dir, url):
r = Requestor(url)
data = json.dumps(VocabularyManifest(models_dir), cls=VocabularyEncoder)
... | {
"content_hash": "3f9c0a2743fc4d86d572a93e651aad32",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 76,
"avg_line_length": 25.458333333333332,
"alnum_prop": 0.5900163666121113,
"repo_name": "JiscRDSS/taxonomyschema",
"id": "e0ae9b28891a98b45600f3e854b50823c0f4dcd5",
"size... |
"""A very simple MNIST classifier.
See extensive documentation at
https://www.tensorflow.org/get_started/mnist/beginners
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import sys
from tensorflow.examples.tutorials.mnist import input_dat... | {
"content_hash": "8b6fa03e843d6051d73ad6f46f446285",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 89,
"avg_line_length": 32.53968253968254,
"alnum_prop": 0.6639024390243903,
"repo_name": "Becavalier/MachineLearning",
"id": "ff560f89c87edc0d21e266cececb4a9b6dd69957",
"si... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import str
from past.builtins import basestring
from past.utils import old_div
import copy
from datetime import datetime, timedelta
import dateutil.parser
f... | {
"content_hash": "e93955228150beccfb4a7d980b64fe14",
"timestamp": "",
"source": "github",
"line_count": 2135,
"max_line_length": 97,
"avg_line_length": 33.78032786885246,
"alnum_prop": 0.5192939643099791,
"repo_name": "jason-z-hang/airflow",
"id": "48126af31a3888d37f0b5b2d190df144273dea7d",
"size":... |
from __future__ import absolute_import
from rest_framework.response import Response
from django.db.models import Count
from sentry.api.bases import SentryAppsBaseEndpoint
from sentry.models import SentryApp
from sentry.api.permissions import SuperuserPermission
class SentryAppsStatsEndpoint(SentryAppsBaseEndpoint):... | {
"content_hash": "d9b044059af8b3e18c233d794d632a8e",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 100,
"avg_line_length": 30.862068965517242,
"alnum_prop": 0.664804469273743,
"repo_name": "beeftornado/sentry",
"id": "82d0332c8e357af6860da21c6d409e7e5ba27e94",
"size": "8... |
"""Tensor utility functions."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import functools
import inspect
import re
from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.util import decorator_utils
from... | {
"content_hash": "d6e7d74b69c6417403813edc04f218dc",
"timestamp": "",
"source": "github",
"line_count": 673,
"max_line_length": 80,
"avg_line_length": 38.690936106983656,
"alnum_prop": 0.6668842889511886,
"repo_name": "frreiss/tensorflow-fred",
"id": "202460272e402685e74f5be4c3a40d5a67d933cd",
"siz... |
from openerp import models, fields, api
class BarcodeEventsMixin(models.AbstractModel):
""" Mixin class for objects reacting when a barcode is scanned in their form views
which contains `<field name="_barcode_scanned" widget="barcode_handler"/>`.
Models using this mixin must implement the method on... | {
"content_hash": "a1d051a25e4d27fa1f1b438703f32544",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 129,
"avg_line_length": 44.63636363636363,
"alnum_prop": 0.6995926680244399,
"repo_name": "vileopratama/vitech",
"id": "383e622c0a1693bfa4254f711d3040d7acd37150",
"size": "... |
"""Tests for the Find flow."""
from grr.client import vfs
from grr.lib import action_mocks
from grr.lib import aff4
from grr.lib import flags
from grr.lib import test_lib
from grr.lib import type_info
from grr.lib import utils
# pylint: disable=unused-import
from grr.lib.flows.general import find
# pylint: enable=unuse... | {
"content_hash": "5cb57abe4d2cd08bc540cbffd5d54699",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 77,
"avg_line_length": 33.85,
"alnum_prop": 0.6617429837518464,
"repo_name": "pchaigno/grr",
"id": "70cee94fe6fed38f23267187e9dbd9682957945e",
"size": "6156",
"binary": ... |
from approvaltests import verify
from approval_utilities.utilities.markdown_table import MarkdownTable
def test_markdown_table():
# begin-snippet: markdown_table_example
inputs = ["verify json", "verify all", "verify parameters", "verify as json"]
table = MarkdownTable.with_headers(
"Input", "Came... | {
"content_hash": "b654b3d6844b61bd7f934e3e3a9c2681",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 82,
"avg_line_length": 28.586206896551722,
"alnum_prop": 0.6393244873341375,
"repo_name": "approvals/ApprovalTests.Python",
"id": "81df0631ba363b0fbe01e0e37e05a8eb79f4f341",
... |
'''
Copyright 2015 University of Auckland
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 agre... | {
"content_hash": "bd3f255949889a9fb3d9ee68e8a6d09a",
"timestamp": "",
"source": "github",
"line_count": 660,
"max_line_length": 141,
"avg_line_length": 41.7030303030303,
"alnum_prop": 0.6407862229327133,
"repo_name": "alan-wu/neon",
"id": "d7793882e0b96283e5adeb502944f5e3751ed490",
"size": "27524",... |
import pygame, sys, math
class Meme(pygame.sprite.Sprite):
def __init__(self, screensize, levelNumber, speed=[0,0], pos=[0,0], size=None):
#print screensize, levelNumber
pygame.sprite.Sprite.__init__(self, self.containers)
self.image = pygame.image.load("rsc/levelmat" + str(levelNumber) + "... | {
"content_hash": "0f6b9434090fcdf832ba999d50b6a0fb",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 92,
"avg_line_length": 31.330578512396695,
"alnum_prop": 0.522025850699024,
"repo_name": "KRHS-GameProgramming-2016/Memefinity",
"id": "e538cba82a98de1133dc6d44b6f4816af5108... |
from kde import KDE
from smoothers_lowess import lowess
import bandwidths
| {
"content_hash": "e89856863e44b2b99fde91da5dc21980",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 35,
"avg_line_length": 24.666666666666668,
"alnum_prop": 0.8513513513513513,
"repo_name": "pprett/statsmodels",
"id": "5c0a13a071297a64f17b775a20ba5d0313ab5bc7",
"size": "74... |
import sys
from lxml import etree
dtd = etree.DTD(open("dotscene.dtd"))
root = etree.parse(sys.argv[1])
if dtd.validate(root):
print("validation successful")
else:
print(dtd.error_log.filter_from_errors()) | {
"content_hash": "157bda5878d6bc7ebd3187f6da4ae578",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 45,
"avg_line_length": 21.5,
"alnum_prop": 0.7162790697674418,
"repo_name": "OGRECave/DotSceneFormat",
"id": "e3ba83d591b3748c43aba65e42d0876add6ee102",
"size": "235",
"b... |
from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Histogram2dContour(_BaseTraceType):
# class properties
# --------------------
_parent_path_str = ""
_path_str = "histogram2dcontour"
_valid_props = {
"autobinx",
"autobiny",
"autoco... | {
"content_hash": "3922d67b42d228e8d0264e2f0fe4f8ba",
"timestamp": "",
"source": "github",
"line_count": 2773,
"max_line_length": 89,
"avg_line_length": 37.009376126938335,
"alnum_prop": 0.5477018718271021,
"repo_name": "plotly/python-api",
"id": "05cdb8caa405d5177de3315a16e2c62afcad26f9",
"size": "... |
"""TensorFlow ops for array / tensor manipulation."""
# Copyright 2015-present The Scikit Flow Authors. All Rights Reserved.
#
# 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://w... | {
"content_hash": "95792b58fa6cccd4780107639f380efa",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 91,
"avg_line_length": 39.108108108108105,
"alnum_prop": 0.6762266758811334,
"repo_name": "awni/tensorflow",
"id": "4c16afb58955b408b3338f89e3e8ceea836f3517",
"size": "2894... |
def create_multipliers():
return [lambda x : i * x for i in range(5)]
if __name__ == '__main__':
for multiplier in create_multipliers():
print(multiplier(2)) # Devrait afficher 0, 2, 4, 6, 8
| {
"content_hash": "946ee490c1631b61f511fdfaeba236a4",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 61,
"avg_line_length": 29.857142857142858,
"alnum_prop": 0.5980861244019139,
"repo_name": "Quebec-Python/atelierdebug",
"id": "d1a21edda0a234057d34b58fe5c352c67b254dd8",
"si... |
import os
import re
import hashlib
from functools import partial
class Disc:
def __init__(self, id, size, intitial_position, delay=1,
angular_velocity=1):
self.id = int(id)
self.size = int(size)
self.initial_position = int(intitial_position)
self.dela... | {
"content_hash": "b30f6c9ee5504e2eb537a6431a28dfc0",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 99,
"avg_line_length": 29.39189189189189,
"alnum_prop": 0.551264367816092,
"repo_name": "bbglab/adventofcode",
"id": "cb935013c8e826e200b8359c78100ce49b3fe7de",
"size": "21... |
"""User-facing customization options to create and train a text classifier."""
import dataclasses
from typing import Optional
from mediapipe.model_maker.python.core import hyperparameters as hp
from mediapipe.model_maker.python.text.text_classifier import model_options as mo
from mediapipe.model_maker.python.text.tex... | {
"content_hash": "993ad09865758d9a13f417d043beaf00",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 81,
"avg_line_length": 39.44,
"alnum_prop": 0.7799188640973631,
"repo_name": "google/mediapipe",
"id": "a02f17347e9d33ba9bab787b63ea502e987b7e6a",
"size": "1593",
"binary... |
import xmlrpc.client
url = "http://www.pythonchallenge.com/pc/phonebook.php"
proxy = xmlrpc.client.ServerProxy(url)
print(proxy.system.listMethods())
print(proxy.system.methodHelp("phone"))
#from http://www.pythonchallenge.com/pc/return/evil4.jpg
print(proxy.phone("Bert"))
#555-ITALY
| {
"content_hash": "904730b952564f16f09145d03c31feb9",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 56,
"avg_line_length": 35.625,
"alnum_prop": 0.775438596491228,
"repo_name": "feliposz/python-challenge-solutions",
"id": "dfb8721d75496a15366f5fdef2032c10852021b9",
"size":... |
from __future__ import unicode_literals
from calaccess_raw import fields
from .base import CalAccessBaseModel, DocumentCloud
from django.template.defaultfilters import floatformat
from django.utils.encoding import python_2_unicode_compatible
from django.contrib.humanize.templatetags.humanize import intcomma
@python_2... | {
"content_hash": "1453a06605764a9ca3cdb4fea9e0d805",
"timestamp": "",
"source": "github",
"line_count": 1374,
"max_line_length": 95,
"avg_line_length": 29.71834061135371,
"alnum_prop": 0.5464207871084662,
"repo_name": "jsfenfen/django-calaccess-raw-data",
"id": "b6b35f1d558a217501b7d43b46ffdf3665ede5... |
import keyword as kw
from .repr import ReprPrinter
from .str import StrPrinter
# A list of classes that should be printed using StrPrinter
STRPRINT = ('Add', 'Infinity', 'Integer', 'Mul', 'NegativeInfinity',
'Pow', 'Zero')
class PythonPrinter(ReprPrinter, StrPrinter):
"""A printer which converts an... | {
"content_hash": "eaac854afa9bb3b0a774d1d23b705a98",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 81,
"avg_line_length": 35.89156626506024,
"alnum_prop": 0.6153071500503524,
"repo_name": "diofant/diofant",
"id": "fd488177e2bbbc27995d8cee62a17506c25b94dc",
"size": "2979"... |
"""
http://adventofcode.com/day/11
Part 1
------
Santa's previous password expired, and he needs help choosing a new
one.
To help him remember his new password after the old one expires,
Santa has devised a method of coming up with a password based on
the previous one. Corporate policy dictates that passwords must be... | {
"content_hash": "02378d1daec48db44956685b15ee8d4a",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 70,
"avg_line_length": 30.24264705882353,
"alnum_prop": 0.6824702163870654,
"repo_name": "rnelson/adventofcode",
"id": "efa242e5e0361d49bd5d2c0b56a0952d0f284188",
"size": ... |
from metadata.models import TanitJobsCategory
from django.core.management.base import BaseCommand
CHOICES = [
'Tous secteurs',
'Informatique',
"Centres d'appels",
'Industrie',
'Ingenierie',
"Technologie de l'information",
'Commerce',
'Formation',
'Marketing',
'Télécommunications... | {
"content_hash": "631236627c5f16a688b2818279acf7f9",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 57,
"avg_line_length": 23,
"alnum_prop": 0.6279401282965075,
"repo_name": "firasbenmakhlouf/JobLookup",
"id": "ceb44ed6eee81e1c2e76f7a456d0d39a1e853c2d",
"size": "1431",
... |
import pyat.sync
import time
import random
from .util import a_task, a_failing_task, make_args, make_kwargs, \
FailedTaskException
MIN_TIME = 1.0
MAX_TIME = 2.0
DELTA_TIME = MAX_TIME - MIN_TIME
STEP_TIME = 0.1
TIMEOUT_DELAY = 0.5
def test_future():
'''
Test a task scheduled N seconds in the future i... | {
"content_hash": "cc5d112eb7cf353f8b02a37fa58a8fae",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 74,
"avg_line_length": 26.28921568627451,
"alnum_prop": 0.6212940518366585,
"repo_name": "vrtsystems/pyat",
"id": "3b6685eddc9969b95240d17672e35ec671bb9426",
"size": "5484... |
exec(open('parse.py').read())
Node = dict
Leaf = str
def typeExpression(env, e):
if type(e) == Leaf:
pass # Complete base cases for booleans for Problem #3.
if type(e) == Node:
for label in e:
children = e[label]
if label == 'Number':
return 'TyNumber'
... | {
"content_hash": "39e36b5f016d49bc747b89c60f037ae6",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 68,
"avg_line_length": 29.23913043478261,
"alnum_prop": 0.47137546468401487,
"repo_name": "lapets/pylium",
"id": "867efb97b83150f48364de04171584a89ccd6e29",
"size": "1689",... |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('passive_data_kit', '0050_datasourcereference'),
]
operations = [
migrations.AddField(
model_name='datapoint',
name='source_reference... | {
"content_hash": "98699c8a515f3fedf3442695352284a8",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 176,
"avg_line_length": 30.41176470588235,
"alnum_prop": 0.6576402321083172,
"repo_name": "audaciouscode/PassiveDataKit-Django",
"id": "c89316012a88f942733289d7b58166533168a6... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.