text stringlengths 4 1.02M | meta dict |
|---|---|
"""
The `cretonne.entities` module predefines all the Cretonne entity reference
operand types. There are corresponding definitions in the `cretonne.entities`
Rust module.
"""
from __future__ import absolute_import
from cdsl.operands import EntityRefKind
#: A reference to an extended basic block in the same function.
... | {
"content_hash": "3c862af6b2e13c5099b835890a4a03bc",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 78,
"avg_line_length": 40.285714285714285,
"alnum_prop": 0.7446808510638298,
"repo_name": "sunfishcode/cretonne",
"id": "614b4d6284d8862d6339956c750704a7a6a305a3",
"size": ... |
from django import forms
from haystack.forms import SearchForm
class DateRangeSearchForm(SearchForm):
start_date = forms.DateField(required=False)
end_date = forms.DateField(required=False)
def search(self):
# First, store the SearchQuerySet received from other processing.
sqs = super(Dat... | {
"content_hash": "69aaa570192cb3b87042c09e2176f1a0",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 75,
"avg_line_length": 32.75,
"alnum_prop": 0.648854961832061,
"repo_name": "mmitucha/blavanet-web",
"id": "de318214500389266a45affab79e61a27f1a5ccb",
"size": "786",
"bin... |
"""JSON Web Tokens
Provides support for creating (encoding) and verifying (decoding) JWTs,
especially JWTs generated and consumed by Google infrastructure.
See `rfc7519`_ for more details on JWTs.
To encode a JWT use :func:`encode`::
from google.auth import crypt
from google.auth import jwt
signer = cr... | {
"content_hash": "d85d40ecd7f5c00bd10c37e6839a9567",
"timestamp": "",
"source": "github",
"line_count": 830,
"max_line_length": 88,
"avg_line_length": 34.65421686746988,
"alnum_prop": 0.6251434134130655,
"repo_name": "javier-ruiz-b/docker-rasppi-images",
"id": "a4f04f529e039d74a8e8dd388e0ce9d14fe3a14... |
"""A set of stream oriented parsers for http requests and responses, inline
with the current draft recommendations from the http working group.
http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-17
Unlike other libraries, this is for clients, servers and proxies.
Missing:
comma parsing/header folding
""... | {
"content_hash": "a2f010b8f1fa819fa0e0d01a32aab855",
"timestamp": "",
"source": "github",
"line_count": 584,
"max_line_length": 79,
"avg_line_length": 30.85958904109589,
"alnum_prop": 0.517367661746754,
"repo_name": "alard/warctozip",
"id": "fa070747b577ce1c46dfbfe178606c26f9584d0a",
"size": "18022... |
import logging
import re
import time
import urlparse
import urllib2
from lxml import html
from django.utils.translation import ugettext as _
from desktop.lib.rest.resource import Resource
from desktop.lib.view_util import format_duration_in_millis
from hadoop.yarn.clients import get_log_client
from jobbrowser.mode... | {
"content_hash": "de4855a1d07b854aa61593a57259983f",
"timestamp": "",
"source": "github",
"line_count": 391,
"max_line_length": 124,
"avg_line_length": 32.41943734015345,
"alnum_prop": 0.6491795519091196,
"repo_name": "keedio/hue",
"id": "c615baca506be3f304bd338cc804a98156e321f6",
"size": "13468",
... |
""" Using convolutional net on MNIST dataset of handwritten digits
MNIST dataset: http://yann.lecun.com/exdb/mnist/
CS 20: "TensorFlow for Deep Learning Research"
cs20.stanford.edu
Chip Huyen (chiphuyen@cs.stanford.edu)
Lecture 07
"""
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import time
import tensorflow as t... | {
"content_hash": "09f331400e77f907595fe1730af54a06",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 106,
"avg_line_length": 38.92934782608695,
"alnum_prop": 0.5253385453022477,
"repo_name": "YeEmrick/learning",
"id": "966945ca25578acb2a2935ece7b7effaa1dae848",
"size": "7... |
"""Geometrical Points.
Contains
--------
Point
"""
from sympy.core import S, sympify
from sympy.core.compatibility import iterable
from sympy.simplify import simplify
from sympy.geometry.exceptions import GeometryError
from sympy.functions.elementary.miscellaneous import sqrt
from entity import GeometryEntity
clas... | {
"content_hash": "774c19fcda38c2482e1b9f02f42beb30",
"timestamp": "",
"source": "github",
"line_count": 366,
"max_line_length": 88,
"avg_line_length": 29.204918032786885,
"alnum_prop": 0.5301712040415381,
"repo_name": "Cuuuurzel/KiPyCalc",
"id": "1204ef9a5e080d25abea473d5f135772eab3a191",
"size": "... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.remote")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "048602c90128e8afa4b31c59a1dfc861",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 70,
"avg_line_length": 25.22222222222222,
"alnum_prop": 0.7092511013215859,
"repo_name": "mhfowler/mhfowler",
"id": "7f1f1ac1aa18550c284bded223c2db948c2f9547",
"size": "249"... |
from pyecmd import *
from ecmd import ecmdDataBuffer
extensions = {}
if hasattr(ecmd, "fapi2InitExtension"):
extensions["fapi2"] = "ver1"
with Ecmd(**extensions):
t = loopTargets("pu", ECMD_SELECTED_TARGETS_LOOP)[0]
data = t.getScom(0x1234)
t.putScom(0x1234, 0x10100000)
# These interfaces may... | {
"content_hash": "0a1304e9a5cc5ee7f095d2a7659a9456",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 93,
"avg_line_length": 37.35,
"alnum_prop": 0.6720214190093708,
"repo_name": "open-power/eCMD",
"id": "a55fd0959d747e01b4c39a11ed38fdde96651bea",
"size": "1494",
"binary"... |
from .copy_sink import CopySink
class SqlSink(CopySink):
"""A copy activity SQL sink.
:param additional_properties: Unmatched properties from the message are
deserialized this collection
:type additional_properties: dict[str, object]
:param write_batch_size: Write batch size. Type: integer (or E... | {
"content_hash": "146b1d689130d8ae359e1d64dc40e17e",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 268,
"avg_line_length": 53.63492063492063,
"alnum_prop": 0.6700207161882213,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "88837785773d8659213f1230feda4e9747a87302",... |
import logging
import unittest
import mock
class TestAppEngineHandler(unittest.TestCase):
PROJECT = "PROJECT"
def _get_target_class(self):
from google.cloud.logging.handlers import AppEngineHandler
return AppEngineHandler
def _make_one(self, *args, **kw):
return self._get_targe... | {
"content_hash": "921fc16aeb51f4118d56543b17d03e4e",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 93,
"avg_line_length": 38.84688995215311,
"alnum_prop": 0.579012193619904,
"repo_name": "googleapis/python-logging",
"id": "8eedfad9b053db0d3312655d729d37f7e976a149",
"siz... |
import math
import pygame
from lib.Globals import UnitType, Debug, Vars, LoadImage
import lib.Effects
class Projectile(pygame.sprite.Sprite):
""" All projectiles will inherit this class for a basic projectile. """
def __init__(self, d=None, l=-1, offset=0):
pygame.sprite.Sprite.__init__(self)
s... | {
"content_hash": "392621af824918a40cafaa67db6634ea",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 141,
"avg_line_length": 32.23478260869565,
"alnum_prop": 0.5521985432964661,
"repo_name": "zorchenhimer/NoudaEngine",
"id": "d95e1322076de6f698d2490bfbff467fdc2c9e9a",
"si... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import glob
import os
import shutil
from contextlib import contextmanager
from pex.interpreter import PythonInterpreter
from pants.backend.native.subsystems.native_t... | {
"content_hash": "390bdacaa128bf724cc615d95281a7f7",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 118,
"avg_line_length": 47.36942675159236,
"alnum_prop": 0.7131908027430416,
"repo_name": "foursquare/pants",
"id": "b383780e88265a356fdf1c18913c325a35341b8f",
"size": "75... |
from ironic.drivers import pxe
from cisco_ironic_contrib.ironic.cimc import boot as cimc_boot
from cisco_ironic_contrib.ironic.cimc import vendor as cimc_vendor
class PXEAndCIMCNeutronDriver(pxe.PXEAndCIMCDriver):
def __init__(self):
super(PXEAndCIMCNeutronDriver, self).__init__()
self.boot = ci... | {
"content_hash": "9eb0327a74d095cb41d3247b9c6bae2b",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 66,
"avg_line_length": 33,
"alnum_prop": 0.7373737373737373,
"repo_name": "Tehsmash/cisco-ironic-contrib",
"id": "bb0456c5cd04bb336fbf93d884713bef5ab461ff",
"size": "978",
... |
"""Install and check status of CRLSet and download chromium CRLSet."""
import os
import pathlib
import subprocess
from typing import Sequence
import pw_package.git_repo
import pw_package.package_manager
def crlset_tools_repo_path(path: pathlib.Path) -> pathlib.Path:
return path / 'crlset-tools'
def crlset_exec... | {
"content_hash": "a6fb4892e09d334b539e8478354f497b",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 72,
"avg_line_length": 33.1578947368421,
"alnum_prop": 0.6095238095238096,
"repo_name": "google/pigweed",
"id": "f17002a2b9e79cfc956a169c109e013ce7fa003c",
"size": "3104",
... |
from datetime import datetime, timezone
def from_isoformat(iso):
return datetime.strptime(iso, '%Y-%m-%dT%H:%M:%S.%f')
def utcnow():
return datetime.now(timezone.utc)
| {
"content_hash": "ddce781a2983e8e504d1a02731400ae4",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 57,
"avg_line_length": 19.88888888888889,
"alnum_prop": 0.6871508379888268,
"repo_name": "optiflows/nyuki",
"id": "1b8eaddf47e7f0a5cb80003547b6a16aef4c6903",
"size": "179",
... |
"""
parser.local.companyParser module (imdb package).
This module provides the functions used to parse the
information about companies in a local installation of the
IMDb database.
Copyright 2008 Davide Alberani <da@erlug.linux.it>
This program is free software; you can redistribute it and/or modify
it under the ter... | {
"content_hash": "e88b6b9acd9acf15257c79b85c6015df",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 76,
"avg_line_length": 33.99248120300752,
"alnum_prop": 0.6516257465162575,
"repo_name": "GetSomeBlocks/Score_Soccer",
"id": "9e91e8c6fae4f075478b02c58eecc9128e512ef8",
"s... |
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload
from urllib.parse import parse_qs, urljoin, urlparse
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,... | {
"content_hash": "9a55d409de5a4baf3b1b004b2d5e11f4",
"timestamp": "",
"source": "github",
"line_count": 642,
"max_line_length": 255,
"avg_line_length": 44.848909657320874,
"alnum_prop": 0.6428993158059251,
"repo_name": "Azure/azure-sdk-for-python",
"id": "0f3781eda127d438b24cf1ecd10d6a03162512e1",
... |
def test_public_propagation_from_project(data_builder, as_admin):
"""
Tests:
- 'public' is a propagated property
"""
project = data_builder.create_project()
session = data_builder.create_session()
acquisition = data_builder.create_acquisition()
payload = {'public': False}
r = as_a... | {
"content_hash": "e85015f100a37ece425a203d6446d038",
"timestamp": "",
"source": "github",
"line_count": 310,
"max_line_length": 115,
"avg_line_length": 33.55161290322581,
"alnum_prop": 0.6216709931737333,
"repo_name": "scitran/api",
"id": "2dd69a9a4545cb95b50291a577dec4fd615bb04c",
"size": "10440",... |
import ble
import uuids
cateye_base='-ceed-1000-8000-00805f9b34fb'
class CateyeService(ble.Service):
uuid_def=('00004001'+cateye_base,'cateye_service','Cateye Service')
| {
"content_hash": "7be52912383e14f5d4d11fef69157682",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 71,
"avg_line_length": 25,
"alnum_prop": 0.76,
"repo_name": "markrages/ble",
"id": "a55e559ce284e38b6a36d1215217fb70814922ca",
"size": "195",
"binary": false,
"copies": ... |
import unittest
from tests.unit.test_account import TestAccount
from tests.unit.test_application import TestApplication
from tests.unit.test_usages import TestUsages
from tests.unit.test_conferences import TestConferences
from tests.unit.test_mms_messages import TestMmsMessages
from tests.unit.test_sms_messages import ... | {
"content_hash": "c3e032d6492987cd048b839d4118716e",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 76,
"avg_line_length": 48.6078431372549,
"alnum_prop": 0.8104074223477209,
"repo_name": "jaymin-panchal/zang-python",
"id": "ebb36f491c315700e82d95483ecfc1489b55b959",
"siz... |
from pathlib import Path
import pickle
import json
import torchaudio
import progressbar
import argparse
import os
import matplotlib
matplotlib.use('agg')
def get_all_metadata(path_dir, suffix="_metadata.json"):
out = []
for root, dirs, filenames in os.walk(path_dir):
for f in filenames:
if... | {
"content_hash": "44ebb54190abb2d362f04f2a07006234",
"timestamp": "",
"source": "github",
"line_count": 362,
"max_line_length": 80,
"avg_line_length": 25.93646408839779,
"alnum_prop": 0.5956970923421024,
"repo_name": "facebookresearch/libri-light",
"id": "dcaaef008e0c079d3223e4d6accc9aa6d750907f",
... |
import socket
if __name__ == "__main__":
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(("192.168.43.12", 9000))
data = "some data"
sock.sendall(data)
result = sock.recv(1024)
print result
sock.close()
| {
"content_hash": "03ee311ec777cc95a81a6e50b8f6641d",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 60,
"avg_line_length": 25.4,
"alnum_prop": 0.6141732283464567,
"repo_name": "kiran4399/beagleboat",
"id": "5d1206a492e1f3ab4365eddcf9402a1f19d2c17b",
"size": "254",
"bina... |
project = 'Basis Set Exchange'
copyright = '2020, Benjamin Pritchard and Susi Lehtola'
author = 'Benjamin Pritchard and Susi Lehtola'
# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = ''
# -- General configuration ---------------------------------------------------
# If... | {
"content_hash": "8b9c05bfb2c9c143d9d501184bc22c2f",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 78,
"avg_line_length": 30.713286713286713,
"alnum_prop": 0.6559653916211293,
"repo_name": "MOLSSI-BSE/basis_set_exchange",
"id": "8e44dbddf65dbec628f7abccb6e8dabe6eff8f82",
... |
"""Module for Assessment object"""
from sqlalchemy import and_
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import remote
from sqlalchemy.orm import validates
from ggrc import db
from ggrc.models import reflection
from ggrc.models.audit import Audit
from ggrc.models.comment import Commenta... | {
"content_hash": "84ba4020b0b8919df06b21a3bcccef53",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 79,
"avg_line_length": 33.34070796460177,
"alnum_prop": 0.6671532846715329,
"repo_name": "kr41/ggrc-core",
"id": "d651ee8592a3b4098304d2808df591bf40349f31",
"size": "7648"... |
import scrapy
import talib
from mykgb import indicator
from myapp.models import *
from mykgb.items import *
class PriceDailySignalSpider(scrapy.Spider):
name = "price_daily_signal"
allowed_domains = ["www.sina.com"]
start_urls = ['http://www.sina.com/']
def parse(self, response):
# print(resp... | {
"content_hash": "0caafa77227523e095af87fb0d906233",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 106,
"avg_line_length": 40.509803921568626,
"alnum_prop": 0.5033881897386253,
"repo_name": "back1992/mezzanine-api-docker",
"id": "c60be735018a6cf3ec87455728a7cfe25ff7d2ff",
... |
import unittest
from mygrations.formats.mysql.file_reader.create_parser import CreateParser
class TableDifferenceTest(unittest.TestCase):
def test_simple_create(self):
a = CreateParser()
a.parse(
"""CREATE TABLE `tasks` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
... | {
"content_hash": "1e35010b00ec399fc931d87d8a98fdd9",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 241,
"avg_line_length": 37.870370370370374,
"alnum_prop": 0.5491442542787286,
"repo_name": "cmancone/mygrations",
"id": "de3c4a4b6e7d76662c5afdf18fb4fe0467c1fd69",
"size": ... |
import math
import numpy as np
import time
from RULEngine.Debug.debug_interface import DebugInterface
from RULEngine.Util.Pose import Pose
from RULEngine.Util.Position import Position
from RULEngine.Util.constant import PLAYER_PER_TEAM, POSITION_DEADZONE, BALL_RADIUS, ROBOT_RADIUS
from RULEngine.Util.geometry import g... | {
"content_hash": "a03d8c6fba2a38abbf2a880bc19e43a6",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 117,
"avg_line_length": 44.241610738255034,
"alnum_prop": 0.6456310679611651,
"repo_name": "Gagnon06/StrategyIA",
"id": "ddd73e7892d360e7e47fc4e6f314a34cf382d681",
"size":... |
try:
localscene
except:
import localscene
else:
localscene = reload(localscene)
from localscene import LocalScene, getLocalScene
| {
"content_hash": "7e9cd3d2eef6bff79aaf0c96b0227a08",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 48,
"avg_line_length": 14.4,
"alnum_prop": 0.75,
"repo_name": "antont/tundra",
"id": "73a567176dd7c8a80d33f6f573c727795c4970a9",
"size": "209",
"binary": false,
"copies... |
from fjord.base.tests import TestCase
from fjord.translations import gengo_utils
from fjord.translations.models import SuperModel
from fjord.translations.utils import translate
class TestGeneralTranslate(TestCase):
def setUp(self):
gengo_utils.GENGO_LANGUAGE_CACHE = (
{u'opstat': u'ok',
... | {
"content_hash": "041d65e66cbe79e25abdcd9f52c599ef",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 74,
"avg_line_length": 34.75,
"alnum_prop": 0.5827338129496403,
"repo_name": "Ritsyy/fjord",
"id": "74c52ad9d04595f4d2f9f0804cb542b1bb0f74e5",
"size": "1112",
"binary": f... |
from msrest.serialization import Model
class NextHopResult(Model):
"""The information about next hop from the specified VM.
:param next_hop_type: Next hop type. Possible values include: 'Internet',
'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal',
'HyperNetGateway', 'None'
:type next_ho... | {
"content_hash": "c24be4fbcc0c3bc3e4147e04d2a51f79",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 121,
"avg_line_length": 42.74193548387097,
"alnum_prop": 0.6588679245283019,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "648de03fb284aa08ae1cc75420519a239dfea288",
... |
import types
from b3.tools.compilers.cc import CC
# TODO(team): review catalina compiler support.
class CatalinaCompiler(CC):
"""Catalina is based upon LCC (a robust, widely used and portable C compiler
front-end), with a custom back-end that generates Large Memory Model (LMM)
PASM code for the Propeller.
"... | {
"content_hash": "649cf2d301dd60fd3650a5aea0d80581",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 80,
"avg_line_length": 39.895348837209305,
"alnum_prop": 0.6304284465170504,
"repo_name": "robionica/b3",
"id": "497b6a155021fdd2e5823c191a698f3c8e29707d",
"size": "4054",
... |
import asyncio
import logging
import abc
from functools import partial
from lsshipper.connection import logstash_connection
from lsshipper.common.utils import get_files
from lsshipper.common.files import File, ship
from lsshipper.database import DataBase
logger = logging.getLogger(name="general")
class BaseUploader(m... | {
"content_hash": "878711198cbb65a45e04309a710e6f97",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 75,
"avg_line_length": 35.53947368421053,
"alnum_prop": 0.5764531654942614,
"repo_name": "stavinsky/lsshipper",
"id": "88f4b559ea972374aeb880f1b8587bccc9fd1f62",
"size": "2... |
import ctypes as ct
import pyglet.gl as gl
class Shader:
"""A helper class for compiling and communicating with shader programs.
"""
def __init__(self, vert_files, frag_files):
"""
Parameters
----------
:vert_files: a list of files that contain the vertex shader code.
... | {
"content_hash": "7af615a7766d826416b60d11c8f73289",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 85,
"avg_line_length": 34.515151515151516,
"alnum_prop": 0.5829675153643546,
"repo_name": "neozhaoliang/pywonderland",
"id": "a6ca5595eec8e509543406515eb3557fbf8652f9",
"s... |
import os
import warnings
from abc import ABC, abstractmethod
from contextlib import contextmanager
from dataclasses import dataclass
import numpy as np
import pooch
from packaging.version import Version
from shapely.geometry import MultiPolygon
from ..core.regions import Regions
from ..core.utils import _flatten_pol... | {
"content_hash": "cbe770a29bc25bab5c0571803854bc80",
"timestamp": "",
"source": "github",
"line_count": 548,
"max_line_length": 86,
"avg_line_length": 26.467153284671532,
"alnum_prop": 0.6008687258687259,
"repo_name": "mathause/regionmask",
"id": "03a1db1c9c931592af6482bbafe87ba57a431e03",
"size": ... |
"""This is a minimal example for calling Fortran functions"""
from __future__ import print_function
import numpy as np
from kernel_tuner import tune_kernel
def tune():
size = int(80e6)
a = np.random.randn(size).astype(np.float32)
b = np.random.randn(size).astype(np.float32)
c = np.zeros_like(b)
... | {
"content_hash": "229a225b728ae66af0bb6f0a4ebda893",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 61,
"avg_line_length": 21.87878787878788,
"alnum_prop": 0.5844875346260388,
"repo_name": "benvanwerkhoven/kernel_tuner",
"id": "ca26ffb90b4afe1fc7b77bc7e7d5eb7ea9e50de8",
"... |
from django.conf.urls.defaults import *
from django.conf.urls import include
from django.views.generic import DetailView, ListView, TemplateView
from gigs.gig_registry.models import Gig, Band, Venue, Location
from django.contrib.auth.views import logout
urlpatterns = patterns(
'gigs.portal.views',
url(r'^$', T... | {
"content_hash": "218391e6f4686ae4e102f87970dae33e",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 148,
"avg_line_length": 71,
"alnum_prop": 0.6938472942920682,
"repo_name": "shaunokeefe/gigs",
"id": "9a669816b50af8368278e3be0eaee5a6b740786a",
"size": "1349",
"binary":... |
from __future__ import print_function
from builtins import str, input, object
from past.builtins import basestring
from copy import copy
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta # for doctest
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMult... | {
"content_hash": "24bfeafa3fb89cf5f7c184765b4f2aec",
"timestamp": "",
"source": "github",
"line_count": 627,
"max_line_length": 90,
"avg_line_length": 31.913875598086126,
"alnum_prop": 0.6063468265867067,
"repo_name": "cswaroop/airflow",
"id": "f07ce5f53c16f7326f871592d44511ab8f67a573",
"size": "20... |
import time
import tempfile
import os
from pyWire.packet.packet import Packet
from pyWire.capture.file_capture import FileCapture
from pyWire.capture.fileformats.PcapFile import PcapFile
from pyWire.capture.callbacks import Callback
class LinkTypes(object):
NULL = 0
ETHERNET = 1
IEEE802_5 = 6
PPP = 9
... | {
"content_hash": "ef72c6f35a3a0ad31455148e3111582b",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 114,
"avg_line_length": 41.142857142857146,
"alnum_prop": 0.6477623456790124,
"repo_name": "SnifferMaster/pyWire",
"id": "5855a70f2d3509b2ae215ace3bb87a3b59a2271c",
"size":... |
"""
Python interface for EZTV.
Works by screen-scraping the homepage and show pages, but depending as little
on the names of elements or structure of the DOM as possible.
"""
__version__ = "3.0.1"
import bs4
import re
import collections
import urlparse
import urllib
import urllib2
SCHEME = 'https'
HEADERS = {
'... | {
"content_hash": "a8d348d601c974fb4654e0fcd3916c77",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 96,
"avg_line_length": 39.681614349775785,
"alnum_prop": 0.5816476438015595,
"repo_name": "henryforever14/eztvit-python",
"id": "16608e8a2a29580bc52ef60a451b685c0eac186f",
... |
from oslo_log import versionutils
from oslo_policy import policy
from barbican.common.policies import base
deprecated_orders_get = policy.DeprecatedRule(
name='orders:get',
check_str='rule:all_but_audit',
deprecated_reason=base.LEGACY_POLICY_DEPRECATION,
deprecated_since=versionutils.deprecated.WALLA... | {
"content_hash": "c2f92b9ae780d9a9ea81ea80050acdd4",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 74,
"avg_line_length": 30.336283185840706,
"alnum_prop": 0.5974329054842473,
"repo_name": "openstack/barbican",
"id": "fe921ac379026954478a520dbfd2fbc0d40dcc69",
"size": "... |
from djangoappengine.settings_base import *
import os
SECRET_KEY = '=r-$b*8hglm+858&9t043hlm6-&6-3d3vfc4((7yd0dbrakhvi'
INSTALLED_APPS = (
# 'django.contrib.admin',
'django.contrib.contenttypes',
'django.contrib.auth',
'django.contrib.sessions',
'django.contrib.sites',
'djangotoolbox',
# ... | {
"content_hash": "7a5d83fce88cabd7f8c3cc394b00f460",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 83,
"avg_line_length": 29.673076923076923,
"alnum_prop": 0.7135450421257291,
"repo_name": "tjsavage/djangononrel-starter",
"id": "2d3b9a6ddc374b313e7330ae87692da92008a83f",
... |
"""
比赛相关urls配置
"""
from django.conf.urls import patterns, url
urlpatterns = patterns(
'apps.game.views',
url('^createFixtures$', 'createFixtures'),
url('^getGame$', 'getGame'),
url('^editGame$', 'editGame'),
url('^deleteGame$', 'deleteGame'),
url('^saveFixtures$', 'saveFixtures'),
url('^fi... | {
"content_hash": "078c8849d7cd0364f696a8e91e5cd260",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 46,
"avg_line_length": 24.1875,
"alnum_prop": 0.6175710594315246,
"repo_name": "zWingz/webbasketball",
"id": "13b90d0226408a44ae991f3c6ce33a00cf7427ce",
"size": "468",
"b... |
from __future__ import unicode_literals
import pytest
from httoop.exceptions import InvalidLine
def test_response_protocol_with_http1_0_request_():
pass
def test_request_protocol_with_invalid_name(request_):
with pytest.raises(InvalidLine):
request_.protocol.parse(b'HTCPCP/1.1')
| {
"content_hash": "6a0d8bcf237c6aa721933d89dd119528",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 54,
"avg_line_length": 20.714285714285715,
"alnum_prop": 0.7724137931034483,
"repo_name": "spaceone/httoop",
"id": "d68639ca0bcc80caf284db9977558f0c9e315292",
"size": "290"... |
if __name__ == "__main__":
# needs to be run from the root of the repository
from bllipparser import RerankingParser, Tree
rrp = RerankingParser()
rrp.load_parser_model('first-stage/DATA/EN', terms_only=True)
tree1 = Tree('''(S1 (INTJ (UH Oh) (JJ sure) (. !)))''')
tree2 = Tree('''(S1 (FRAG (... | {
"content_hash": "3469377c80f1d388360b14b4fc3fd177",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 73,
"avg_line_length": 30.571428571428573,
"alnum_prop": 0.6004672897196262,
"repo_name": "dmcc/bllip-parser",
"id": "33543655b517b4765d032a91599324fb5f061c9c",
"size": "97... |
"""Various classes representing distributed values."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import weakref
from tensorflow.python.distribute import device_util
from tensorflow.python.distribute import tpu_util
from tensorflow.python.... | {
"content_hash": "5140bf38f08d368988d1f18f8ef79fee",
"timestamp": "",
"source": "github",
"line_count": 255,
"max_line_length": 86,
"avg_line_length": 37.63529411764706,
"alnum_prop": 0.6787537772220485,
"repo_name": "frreiss/tensorflow-fred",
"id": "26b46185eda9e3ee77ad678ef36ab49161b34eb7",
"size... |
from .css import CssFormat
from .cocos2d import Cocos2dFormat
from .img import ImageFormat
from .html import HtmlFormat
from .jsonformat import JSONFormat
from .caat import CAATFormat
from .less import LessFormat
from .scss import ScssFormat
formats = {'css': CssFormat,
'cocos2d': Cocos2dFormat,
... | {
"content_hash": "c20bd14a3ede703fa2346e1a98eee46e",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 36,
"avg_line_length": 27.555555555555557,
"alnum_prop": 0.655241935483871,
"repo_name": "beni55/glue",
"id": "1fd72d86f834de7ca3cebe652724e551d04b25bd",
"size": "496",
"... |
from js9 import j
import os
import capnp
# import msgpack
import base64
ModelBaseCollection = j.data.capnp.getModelBaseClassCollection()
ModelBase = j.data.capnp.getModelBaseClass()
# from JumpScale9.clients.tarantool.KVSInterface import KVSTarantool
class $NameModel(ModelBase):
'''
'''
def __init__(sel... | {
"content_hash": "b1af48ab1f892c44593875756392bfeb",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 141,
"avg_line_length": 36.18181818181818,
"alnum_prop": 0.6187185929648241,
"repo_name": "Jumpscale/core9",
"id": "0311578069a8a5a7f7d3c85c04e1762e92ca9f2e",
"size": "3184... |
import pytest
import numpy as np
from skimage.external.tifffile import imread
from canon.img.subtract_bg import subtract
from .. import resource
def test_subtract():
image = imread(resource('test00001.tiff'))
img_sub = subtract(image, 0.001)
# subtracting background should reduce max intensity
assert... | {
"content_hash": "b668cec10c3596831c1b59b03d7ee8f5",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 56,
"avg_line_length": 27.77777777777778,
"alnum_prop": 0.706,
"repo_name": "structrans/Canon",
"id": "5747d0a26e4b9f540f6704069b1117b502783198",
"size": "500",
"binary":... |
from random import shuffle, randint
from itertools import islice
from django.views.generic import TemplateView
from chartjs.colors import next_color, COLORS
from chartjs.views.lines import BaseLineChartView
class ColorsView(TemplateView):
template_name = 'colors.html'
def get_context_data(self, **kwargs):
... | {
"content_hash": "02b6ae41a0f97d6b0d0716e7e38249f8",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 79,
"avg_line_length": 29.25581395348837,
"alnum_prop": 0.6470588235294118,
"repo_name": "brunobord/django-chartjs",
"id": "46f0851fcab4caea412302fc5d83546a809851a5",
"size... |
import numpy as np
import os
import torch
import torch.nn as nn
import argparse
from filelock import FileLock
from ray import tune
from ray.tune.schedulers import PopulationBasedTraining
from torch.utils.data import DataLoader, Subset
from torchvision.datasets import CIFAR10
import torchvision.transforms as transforms... | {
"content_hash": "422de5b835753043e01c0b2352900106",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 79,
"avg_line_length": 32.740112994350284,
"alnum_prop": 0.5958584987057809,
"repo_name": "pcmoritz/ray-1",
"id": "a79178c65652ebc8d50a600f3830b5e4099a4927",
"size": "5795... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from numpy import inf
class Node(object):
"""Node class as building block for linked list."""
def __init__(self, data):
self.data = data
self.next = None
class LinkedList(object):
... | {
"content_hash": "cf7049c85f2f3ee1586c586aec88ad42",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 68,
"avg_line_length": 23.07913669064748,
"alnum_prop": 0.5151184538653366,
"repo_name": "bowen0701/algorithms_data_structures",
"id": "0f514a0e00c13d52f0f39c76dcbbb965e0f77... |
"""Classes supporting creation and editing of questions."""
__author__ = 'John Orr (jorr@google.com)'
import cgi
import copy
import urllib
from common import schema_fields
from controllers.utils import ApplicationHandler
from controllers.utils import BaseRESTHandler
from controllers.utils import XsrfTokenManager
fro... | {
"content_hash": "b5df7fdb964e13a4a2560ff9ce464101",
"timestamp": "",
"source": "github",
"line_count": 482,
"max_line_length": 79,
"avg_line_length": 39.02697095435685,
"alnum_prop": 0.5825846579129232,
"repo_name": "leo-at-rsmart/shiny-octo-batman",
"id": "b551a6ab2bec3d844464bb7c904706e76d3c8d4f",... |
"""Handle the frontend for Home Assistant."""
import asyncio
import hashlib
import json
import logging
import os
from aiohttp import web
from homeassistant.core import callback
from homeassistant.const import HTTP_NOT_FOUND
from homeassistant.components import api, group
from homeassistant.components.http import Home... | {
"content_hash": "ccc1e6f0399c21b3b72948437ee43a84",
"timestamp": "",
"source": "github",
"line_count": 284,
"max_line_length": 79,
"avg_line_length": 33.144366197183096,
"alnum_prop": 0.6082014235631573,
"repo_name": "eagleamon/home-assistant",
"id": "4d9fb8624d8180b91e9aae8db4188fe4ae90ceb0",
"si... |
source_link = "https://github.com/frappe/frappe"
docs_base_url = "https://frappe.github.io/frappe"
headline = "Superhero Web Framework"
sub_heading = "Build extensions to ERPNext or make your own app"
hide_install = True
long_description = """Frappe is a full stack web application framework written in Python,
Javascrip... | {
"content_hash": "c88e21c0313b3a9c319d474c541c4c07",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 89,
"avg_line_length": 44.4,
"alnum_prop": 0.7484984984984985,
"repo_name": "drukhil/frappe",
"id": "dd90839762d7117fca86ede9735cd06a09303a89",
"size": "1333",
"binary": ... |
import unittest
from numba.core.compiler import compile_isolated, Flags
from numba.core import types, utils
enable_pyobj_flags = Flags()
enable_pyobj_flags.set("enable_pyobject")
force_pyobj_flags = Flags()
force_pyobj_flags.set("force_pyobject")
def is_in_mandelbrot(c):
i = 0
z = 0.0j
for i in range(10... | {
"content_hash": "8b6189ed51a2031d770973872dc78c68",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 57,
"avg_line_length": 23.314285714285713,
"alnum_prop": 0.6078431372549019,
"repo_name": "sklam/numba",
"id": "43826b1ec538b4a1e270f5f47fafc141ec308f97",
"size": "816",
... |
from decimal import *
import getpass
import math
import os
import os.path
import platform
import sys
import time
from jsonrpc import ServiceProxy, json
BASE_FEE=Decimal("0.001")
def check_json_precision():
"""Make sure json library being used does not lose precision converting BTC values"""
n = Decimal("20000... | {
"content_hash": "6e6a7e277ea5078c3fbcc548fa56da6f",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 111,
"avg_line_length": 38.52777777777778,
"alnum_prop": 0.6168503450406839,
"repo_name": "my-first/octocoin",
"id": "8add3b5ccb3686e751fb5368fc9c82988a448ed6",
"size": "1... |
"""This script will generate up to date documentation for RoboFab.
Provided you have installed RoboFab correctly and you're using
python 2.1 or higher.
This script will make a bunch of HTML files in robofab/Documentation/robofabDoc/
It collects all docstrings, shows classes, methods and functions.
This script uses p... | {
"content_hash": "8547e4d15842d0351f6bc439fe3b2696",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 89,
"avg_line_length": 28.151785714285715,
"alnum_prop": 0.7421503330161751,
"repo_name": "bitforks/robofab",
"id": "29ad3d38a26d6697319241d10ff7a02233cb73a3",
"size": "31... |
from numpy import linalg as LA
from numpy import genfromtxt
import numpy as np
from sys import argv
import string
import datetime
import os
import csv
import fnmatch
from math import ceil
import scipy.io as sio
# read in command line args
params = list(argv)
outputDir = params[1]
outputMatch = params[2]
compDir = par... | {
"content_hash": "1828ecec8fb99e7577988b4998e3b364",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 116,
"avg_line_length": 23.300884955752213,
"alnum_prop": 0.7330041777440183,
"repo_name": "gkiar/MR-devtools",
"id": "d3775ff42cbaa6b668be805a1cf56299a0d6d81d",
"size": "... |
import _thread as thread
from websocket import WebSocketApp
class WebSocketService():
def __init__( self, url, onMessage ):
def runWS( service ):
service._wsapp.run_forever()
self._wsapp = WebSocketApp( url, on_message=onMessage )
thread.start_new_thread( runW... | {
"content_hash": "6b2361eca5dffdae88084b2cca80dce9",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 63,
"avg_line_length": 26,
"alnum_prop": 0.5846153846153846,
"repo_name": "Eelco81/server-test-project",
"id": "1a0e8259227f4c3d16a3489f0cc422008e93e14f",
"size": "391",
... |
"""Tools (notably `xpSpace`) for processing and presenting experiment data."""
import collections
import copy
import warnings
import colorama
import numpy as np
from mpl_tools import place
from patlib.std import nonchalance
from struct_tools import AlignedDict, complement, intersect, transps
from tabulate import tabu... | {
"content_hash": "56ff7478441ff73026b8ae6e392f7030",
"timestamp": "",
"source": "github",
"line_count": 891,
"max_line_length": 88,
"avg_line_length": 40.32098765432099,
"alnum_prop": 0.5467906251739687,
"repo_name": "nansencenter/DAPPER",
"id": "33017693bf0c0f150a8bbd99a34307c238cd3c9e",
"size": "... |
BOT_NAME = 'cnbetabot'
SPIDER_MODULES = ['cnbetabot.spiders']
NEWSPIDER_MODULE = 'cnbetabot.spiders'
ITEM_PIPELINES = ['cnbetabot.pipelines.CnbetabotPipeline']
DATABASE = {
'drivername': 'postgres',
'host': 'localhost',
'port': '5432',
'username': 'dbuser',
'password': 'YOUR_PASSWORD',
'database': 'scrape... | {
"content_hash": "3174b56d8d141690c9c7e8e77609210f",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 485,
"avg_line_length": 41.27956989247312,
"alnum_prop": 0.773117999479031,
"repo_name": "cdpath/cnbetabot",
"id": "5b1860b0e49453e815dc30b2d65b773bb44d63d5",
"size": "4273... |
from distutils.core import setup
import interpreter
setup(
name='simple interpreter',
version=interpreter.__version__,
description='Simple interpreter for Pascal language.',
author='Lucas Magnum',
author_email='lucasmagnumlopes@gmail.com',
packages=['interpreter'],
)
| {
"content_hash": "6550d3d87f983012dd1343e0650ce8cc",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 58,
"avg_line_length": 22.692307692307693,
"alnum_prop": 0.7186440677966102,
"repo_name": "LucasMagnum/simple-interpreter",
"id": "8df9189213eafb9b523b6a7227a6fde9bab3b9c7",
... |
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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://www.apa... | {
"content_hash": "3fd76823dec5df4a4210e514eedd1713",
"timestamp": "",
"source": "github",
"line_count": 255,
"max_line_length": 88,
"avg_line_length": 31.909803921568628,
"alnum_prop": 0.6138626029249109,
"repo_name": "SUSE/azure-storage-python",
"id": "370f7319d2ce6f366d29f825cd04db132a335719",
"s... |
import socket
HOST = 'localhost'
PORT = 8800
c = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
c.connect((HOST,PORT))
c.send("\xde\xad\xbe\xef")
| {
"content_hash": "bab2309a999a81f5c201839659f80630",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 52,
"avg_line_length": 18.75,
"alnum_prop": 0.7133333333333334,
"repo_name": "RegaledSeer/netsecnoobie",
"id": "08e836903ac5be601a22dbe4fab87aa5e0e66124",
"size": "150",
"... |
tab = self.notebook.mainTab
tab.settings['Program'] = 'abinit'
tab.settings['Output file name'] = 'BaTiO3.out'
#
# SettingsTab
#
tab = self.notebook.settingsTab
tab.settings['Eckart flag'] = False
tab.settings['Neutral Born charges'] = False
tab.settings['Sigma value'] = 5
tab.settings['Mass definition'] = 'program'
#
... | {
"content_hash": "c18ca37ef4078f1d18b58214f8d370f1",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 66,
"avg_line_length": 33.45614035087719,
"alnum_prop": 0.6958573675930781,
"repo_name": "JohnKendrick/PDielec",
"id": "2af84711bd557e6be11267ae52ae679f82bc208b",
"size": "... |
"""Kills any running jobs trees in a rogue jobtree.
"""
import os
import sys
import xml.etree.cElementTree as ET
from sonLib.bioio import logger
from sonLib.bioio import getBasicOptionParser
from sonLib.bioio import parseBasicOptions
from jobTree.src.master import getConfigFileName
from jobTree.src.jobTreeRun import ... | {
"content_hash": "1056151c4eb9f41df6b2cc3795787843",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 111,
"avg_line_length": 36.4,
"alnum_prop": 0.6910866910866911,
"repo_name": "harvardinformatics/jobTree",
"id": "da074428aa6583231cd8a9b242fa10285a62af58",
"size": "2768",... |
from django.db.models.query import F
from rest_framework.permissions import IsAuthenticated
from rest_framework.viewsets import ReadOnlyModelViewSet
from .serializers import LearnerClassroomSerializer
from kolibri.core.auth.api import KolibriAuthPermissionsFilter
from kolibri.core.auth.filters import HierarchyRelation... | {
"content_hash": "8c2dd9295fab367ea477bc44d1718ad2",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 80,
"avg_line_length": 37.5625,
"alnum_prop": 0.7343316694398225,
"repo_name": "DXCanas/kolibri",
"id": "905cf2dc9414929b172864ac2c2c36ff98709781",
"size": "1803",
"binar... |
"""The testing subpackage contains functions for verifying and testing dimod
objects. Testing objects/functions can be imported from the :mod:`dimod.testing`
namespace. For example:
>>> from dimod.testing import assert_sampler_api
"""
from dimod.testing.asserts import *
| {
"content_hash": "98e0623ed9b50d358965bd850bf35505",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 80,
"avg_line_length": 34.125,
"alnum_prop": 0.7875457875457875,
"repo_name": "oneklc/dimod",
"id": "81b8416e4e8633b259983ba61da4cdaeb38a2aa7",
"size": "965",
"binary": fa... |
import functools
import os
import re
import shlex
import sysconfig
from pathlib import Path
from .. import mlog
from .. import mesonlib
from ..environment import detect_cpu_family
from .base import (
DependencyException, DependencyMethods, ExternalDependency,
ExternalProgram, ExtraFrameworkDependency, PkgCon... | {
"content_hash": "d3132997574d68169f532a660985a0c7",
"timestamp": "",
"source": "github",
"line_count": 501,
"max_line_length": 156,
"avg_line_length": 38.22355289421158,
"alnum_prop": 0.5373368146214099,
"repo_name": "jeandet/meson",
"id": "014be84ab851229cc275ed43e08099c78c7e6b77",
"size": "19826... |
from __future__ import print_function
from builtins import object
from lib.common import helpers
class Stager(object):
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'DuckyLauncher',
'Author': ['@xorrior'],
'Description': ('Generates a ducky script th... | {
"content_hash": "05353b83f263c5e579573ac38fc17c06",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 148,
"avg_line_length": 35.651685393258425,
"alnum_prop": 0.49889694295619286,
"repo_name": "byt3bl33d3r/Empire",
"id": "4ca847833ae9f8c10a1c53b1507be67ab20411b0",
"size": ... |
import matplotlib.pyplot as plt
import numpy as np
from theano import tensor as T
import data
def data_loader():
data_processor = data.Processor()
dataset = data_processor.get_dataset()
data_length = len(dataset)
training_set = dataset[:(data_length*6/10)]
validation_set = dataset[(data_length*6/... | {
"content_hash": "4aa719dfaf1df0d50b71a62efe1ce9d2",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 110,
"avg_line_length": 37.203252032520325,
"alnum_prop": 0.5428321678321678,
"repo_name": "shams-sam/logic-lab",
"id": "96a2fa49e386970f6314482f189709df140156a9",
"size":... |
import redash.models
from redash.utils import gen_query_hash, utcnow
from redash.utils.configuration import ConfigurationContainer
class ModelFactory(object):
def __init__(self, model, **kwargs):
self.model = model
self.kwargs = kwargs
def _get_kwargs(self, override_kwargs):
kwargs = ... | {
"content_hash": "358167a3f4057a8518d311a655c48521",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 111,
"avg_line_length": 32.50854700854701,
"alnum_prop": 0.4983567766530827,
"repo_name": "jmvasquez/redashtest",
"id": "7bf04bde94fbbf923076a58622ff40b28246b6cf",
"size":... |
from platform import system
from ._base import Question
class ChoiceSelect(Question):
def __init__(self, name, query, choices=None, size=7,
default="", color=None, colormap=None):
super().__init__(name, query, default, color, colormap)
self._keys_in_use = [
"Enter", "A... | {
"content_hash": "df7cfd9d18c01649023870df7cfb7971",
"timestamp": "",
"source": "github",
"line_count": 300,
"max_line_length": 79,
"avg_line_length": 37.526666666666664,
"alnum_prop": 0.4834784153490851,
"repo_name": "imdaveho/impromptu",
"id": "18945c05d67cedadf4dc76c875e30b5d440afe38",
"size": "... |
from extList import extList
import unittest # built in unit test tool
# TESTS
#testing creating extlist
class CreateExtlistTests(unittest.TestCase):
#setup list for testing
def setUp(self):
#create list
self.aList = extList()
def test_CreateExtlist(self):
#assert
self.assertTrue(isinstance(self.aL... | {
"content_hash": "c87d1af1ee930c275a190f5beadf0aa5",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 91,
"avg_line_length": 18.982062780269057,
"alnum_prop": 0.6832034018426648,
"repo_name": "bendacoder/extList.py",
"id": "16664157b270be6a751a1a66db346d11d9e6331b",
"size"... |
from panda3d.core import *
from panda3d.direct import *
# Import the type numbers
class PyDatagramIterator(DatagramIterator):
# This is a little helper Dict to replace the huge <if> statement
# for trying to match up datagram subatomic types with add funtions
# If Python had an O(1) "case" statement we wo... | {
"content_hash": "34a050db1ecda1c044d4304c45e9c941",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 80,
"avg_line_length": 39.552845528455286,
"alnum_prop": 0.5075025693730729,
"repo_name": "brakhane/panda3d",
"id": "e97600f6b4c94fd44330b6b23242641078dd6ac0",
"size": "50... |
from __future__ import division
import operator
import warnings
from datetime import time, datetime
from datetime import timedelta
import numpy as np
from pandas.core.base import _shared_docs
from pandas.types.common import (_NS_DTYPE, _INT64_DTYPE,
is_object_dtype, is_datetime64_dtype... | {
"content_hash": "e597eb12808b771358ab5eff8a1fbdb1",
"timestamp": "",
"source": "github",
"line_count": 2166,
"max_line_length": 84,
"avg_line_length": 36.340720221606645,
"alnum_prop": 0.5448586020275936,
"repo_name": "andyraib/data-storage",
"id": "024306edef2d8bc16a0ada981d3d8db046dcb192",
"size... |
"""
:mod:`ddfs <ddfscli>` -- DDFS command line utility
==================================================
:program:`ddfs` is a tool for manipulating data stored in :ref:`ddfs`.
Some of the :program:`ddfs` utilities also work with data stored in Disco's temporary filesystem.
.. note::
This is the manpage for the :... | {
"content_hash": "1406e3f2cc5a0501fb323b6383a0b73a",
"timestamp": "",
"source": "github",
"line_count": 400,
"max_line_length": 97,
"avg_line_length": 29.84,
"alnum_prop": 0.596514745308311,
"repo_name": "scrapinghub/disco",
"id": "75fb549bd9cc8e6bde2b2d42e49d316bf4b74524",
"size": "11958",
"bina... |
"""CSR sparse matrix tests."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import test_util
from tensorflow.p... | {
"content_hash": "e3e0821f2e0cab1ea4830e98e15c674a",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 103,
"avg_line_length": 42.55555555555556,
"alnum_prop": 0.6459530026109661,
"repo_name": "sarvex/tensorflow",
"id": "79874ab31b2c43a040d1aeea259fb289d1c1926c",
"size": "6... |
"""This examples shows how to subscribe to a virtual signal in a virtual interface of SignalBroker
This example works with 'virtual_example_pub.py' and it is meant to receive the signals publish from 'virtual_example_pub.py'.
In this code we get the stream of data from the SignalBroker grpc server for the signal: ' in... | {
"content_hash": "7629751230a28f2e2fe813f9f1a69eaf",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 143,
"avg_line_length": 32.353846153846156,
"alnum_prop": 0.6875891583452212,
"repo_name": "AleksandarFilipov/signalbroker-server",
"id": "92471d59827c3c6d5af62ce2e5126265552... |
"""
Use a set of query reads to sweep out overlapping reads from another file.
% python scripts/sweep-reads2.py <query reads> <search reads>
Results end up in <search reads>.sweep2.
Use '-h' for parameter help.
"""
from __future__ import print_function
import sys
import khmer
import os.path
import screed
from khmer... | {
"content_hash": "fc361c53607d531f6c951a774e14bd7e",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 79,
"avg_line_length": 28.375,
"alnum_prop": 0.5863436123348018,
"repo_name": "F1000Research/khmer",
"id": "528dd8778a5f83d4c1ed4727a5a80bfcf8cafe70",
"size": "2524",
"bi... |
import pickle
import matplotlib as mpl
import matplotlib.pyplot as plt
import os
from examples.lowRankTensorApproximations.fig_pars import set_labels, set_pars
os.nice(19)
def save_experiment_settings(kind_list, Ns, kinds, sol_rank_range_set, material_list,
data_folder='data_for_plot'):
... | {
"content_hash": "ef7a33ab43d5398e8fc5054c756a880b",
"timestamp": "",
"source": "github",
"line_count": 590,
"max_line_length": 131,
"avg_line_length": 47.54406779661017,
"alnum_prop": 0.47385119960072725,
"repo_name": "vondrejc/FFTHomPy",
"id": "182d8c766db772a953b29156289501d2e2e66aec",
"size": "... |
import sys
import random
from test_base import *
class TestBlockLD(TestBase):
def generate(self):
self.clear_tag()
for n in range(50000):
store_not_load = random.randint(0,1)
tag = random.randint(0, 15)
index = random.randint(0,self.sets_p-1)
taddr = self.get_addr(tag,index)
... | {
"content_hash": "a4ee5a1ea66db1d1582c56a60709a471",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 62,
"avg_line_length": 20.34285714285714,
"alnum_prop": 0.5898876404494382,
"repo_name": "litex-hub/pythondata-cpu-blackparrot",
"id": "b6ca139a678c7000c7bdb0593d984384501438... |
import os
# from logging.handlers import SysLogHandler
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
SECRET_KEY = 'k0zg0kibq7lv3$vcodk0*6g&nq8yzgue_wfxvai%k1yy@5=myd'
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = ['0.0.0.0']
# Application definition
INSTALLED_APPS = (
# 'django.contrib.admin',
... | {
"content_hash": "055cf79834775086188eb99152b3167c",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 65,
"avg_line_length": 23.096153846153847,
"alnum_prop": 0.6894254787676936,
"repo_name": "Mistchenko/Dockers",
"id": "07afbc0bc73fe795452a02dbae730b6d12d411f1",
"size": "1... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class AccountInfo(Choreography):
def __init__(self, temboo_session):
"""
Create a n... | {
"content_hash": "12db1d8c576906795e73238c3515020f",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 175,
"avg_line_length": 42.98684210526316,
"alnum_prop": 0.6954392408937864,
"repo_name": "jordanemedlock/psychtruths",
"id": "28734fcb19415cb6f867cce43033178e6cce96f6",
"s... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
"""Contributed port of MADDPG from OpenAI baselines.
The implementation has a couple assumptions:
- The number of agents is fixed and known upfront.
- Each agent is bound to a policy of the same name.
- Discret... | {
"content_hash": "fd1881c36c4585e8aec978d703655ee2",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 79,
"avg_line_length": 36.84699453551912,
"alnum_prop": 0.6827821444460922,
"repo_name": "ujvl/ray-ng",
"id": "74f0cd2e4b245b96f5c41e2afd65b8208c35a4d3",
"size": "6743",
... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/hair/bothan/shared_hair_bothan_male_s11.iff"
result.attribute_template_id = -1
result.stfName("hair_name","hair")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "300fa072a235781761740e8b080f3579",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 80,
"avg_line_length": 23.46153846153846,
"alnum_prop": 0.6918032786885245,
"repo_name": "obi-two/Rebelion",
"id": "179d44744e80076469f67be5696fa7835bc0a646",
"size": "450"... |
import numpy as n
from numpy.random import randn, rand, random_integers
import os
from util import *
BATCH_META_FILE = "batches.meta"
class DataProvider:
BATCH_REGEX = re.compile('^data_batch_(\d+)(\.\d+)?$')
def __init__(self, data_dir, batch_range=None, init_epoch=1, init_batchnum=None, dp_params={}, test=F... | {
"content_hash": "7f12a640a043196552a16a9de74d456b",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 120,
"avg_line_length": 42.57142857142857,
"alnum_prop": 0.6018618748646893,
"repo_name": "olivernina/idropout",
"id": "7899ca8fabd56619a55db60cfade70aea3fa2b85",
"size": ... |
from django.contrib.auth.decorators import login_required
from django.urls import path
from django.utils.translation import gettext_lazy as _
from oscar.core.application import OscarConfig
from oscar.core.loading import get_class
class CatalogueReviewsConfig(OscarConfig):
label = 'reviews'
name = 'oscar.apps... | {
"content_hash": "8feffabd5f827953efd02fb2bf247d7e",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 99,
"avg_line_length": 41.275862068965516,
"alnum_prop": 0.6691729323308271,
"repo_name": "solarissmoke/django-oscar",
"id": "521582e54912ea61a1580bc84c21aa31f72381a7",
"si... |
"""List all tasks for your Organization via the GCI API."""
import argparse
import re
import client as gciclient
argparser = argparse.ArgumentParser(description='GCI CSV Task Uploader.')
argparser.add_argument('--apikey', type=str, nargs='?', required=True,
help='api key')
argparser.add_argum... | {
"content_hash": "007e745d41b5d9f12cf5021df86e4f43",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 73,
"avg_line_length": 26.634146341463413,
"alnum_prop": 0.5952380952380952,
"repo_name": "Freso/google-codein-api",
"id": "0bdf9c8b4f020a218873699ab5d66f7068cd7ef2",
"size... |
import django.contrib.postgres.fields.jsonb
import django.db.models.deletion
import oauthlib.common
from django.db import migrations, models
import saleor.core.utils.json_serializer
def update_contentypes(apps, schema_editor):
"""Update content types.
We want to have the same content type id, when the model... | {
"content_hash": "e3a7fb662270f3671e4675ed91d62f87",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 86,
"avg_line_length": 34.06211180124224,
"alnum_prop": 0.49671772428884026,
"repo_name": "mociepka/saleor",
"id": "df94e1c957b59257017b8a07918e01c6a24b1d4c",
"size": "553... |
import random
import time
from utils import SupplyResult
from utils.tech import get_active_period, get_newly_active, get_all_public_channels, get_all_tags
from utils.tech import generate_list_of_channels, get_top_growers_for_last_week, default_ending
from utils.tech import chunker
subreddit = 'all'
t_channel = '@red... | {
"content_hash": "3edfa7a03b43728e960cee99c20d36fc",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 131,
"avg_line_length": 42.45238095238095,
"alnum_prop": 0.6674144699943915,
"repo_name": "Fillll/reddit2telegram",
"id": "e1cc820b8e3bf4e56502c92f4ad988731c6896a4",
"size"... |
from oslo_config import cfg
from magnum.i18n import _
docker_registry_group = cfg.OptGroup(name='docker_registry',
title='Options for Docker Registry')
docker_registry_opts = [
cfg.StrOpt('swift_region',
help=_('Region name of Swift')),
cfg.StrOpt('swift_re... | {
"content_hash": "3e2fc781b645baf08a14c2a240f30546",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 77,
"avg_line_length": 28.53846153846154,
"alnum_prop": 0.6199460916442049,
"repo_name": "openstack/magnum",
"id": "36b27f5506a403323125a51053192c1fdcef3fc9",
"size": "1286... |
from pyNIBE import pyNIBE | {
"content_hash": "84201217079d55e129148c5bbf70ac91",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 25,
"avg_line_length": 25,
"alnum_prop": 0.88,
"repo_name": "hypokondrickard/pyNIBE",
"id": "f3f8caa6f7ce5a9e5d25ec110251e4022340ccce",
"size": "25",
"binary": false,
"c... |
from finch import Finch
from time import sleep
# Instantiate the Finch object and connect to Finch
tweety = Finch()
# Get the Z-Axis acceleration
zAccel = tweety.acceleration()[2]
# Do the following while the Finch is not upside down (z value in gees above -0.7)
while zAccel > -0.7:
left_obstacle, right_obs... | {
"content_hash": "9046317b9c234689c85971003e0f624d",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 82,
"avg_line_length": 28.806451612903224,
"alnum_prop": 0.6461366181410975,
"repo_name": "Amanda1223/Finch",
"id": "2928a1429e7d1b1ad3a9b32448632bf6199b6003",
"size": "947... |
import os
from setuptools import setup, find_packages
__version__ = None
exec(open('cabby/_version.py').read())
def here(*path):
return os.path.join(os.path.dirname(__file__), *path)
def get_file_contents(filename):
with open(here(filename)) as fp:
return fp.read()
# This is a quick and dirty way... | {
"content_hash": "f63a9d8a9d0616c9eeeeb041f6e109f8",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 70,
"avg_line_length": 31.703703703703702,
"alnum_prop": 0.6325934579439252,
"repo_name": "Intelworks/cabby",
"id": "0fdfb0c4b1e7e8e4b036688149a3114d28b55487",
"size": "171... |
"""
persistlab.testsuite.measfile
~~~~~~~~~~~~~
This module tests the data file parsing.
:copyright: (c) 2013 by Stephane Henry..
:license: BSD, see LICENSE for more details.
"""
import sys
import unittest
import pandas
import pandas as pd
import numpy as np
from persistlab import measfile
from... | {
"content_hash": "035a008d5dc24963ca7e15732262b16c",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 78,
"avg_line_length": 26.08695652173913,
"alnum_prop": 0.6016666666666667,
"repo_name": "ushiro/persistlab",
"id": "b2a8e7872adb09350c5aa99ef1358fa6b101cd9b",
"size": "30... |
def base36encode(number, alphabet='0123456789abcdefghijklmnopqrstuvwxyz'):
"""Converts an integer to a base36 string."""
if not isinstance(number, (int)):
raise TypeError('number must be an integer')
base36 = ''
sign = ''
if number < 0:
sign = '-'
number = -number
if 0 <=... | {
"content_hash": "5c731e447b8b6b657dab8ae8aca3d75b",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 74,
"avg_line_length": 26.822222222222223,
"alnum_prop": 0.6412593206296603,
"repo_name": "iAmMrinal0/reddit",
"id": "8d91a81c6c72b89e6676771cc0c16e6483ddd829",
"size": "12... |
from training_data_generator.scripts.analyzer import analyze_morph
def tagging(l, r, ne, ylabel):
for i in range(l, r):
prefix = 'B' if i == l else 'I'
ylabel[i] = prefix + '-' + ne
def matching(sentence, ne_list):
def get_word_pos_list(sentence, ne_list):
word_pos_list = []
... | {
"content_hash": "78d6da74ff4e5c2ffcca8388dde49162",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 92,
"avg_line_length": 30.225,
"alnum_prop": 0.5268817204301075,
"repo_name": "Hironsan/HotPepperGourmetDialogue",
"id": "aebb4d526f524e5238b818ffed469716560c7446",
"size":... |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('builder', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migr... | {
"content_hash": "60dbe0de60f626d02263abbdb1f1cb87",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 114,
"avg_line_length": 31.962962962962962,
"alnum_prop": 0.578215527230591,
"repo_name": "istrategylabs/franklin-api",
"id": "21479d3ffeb9676998f62894df8513f851c1244c",
"s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.