text stringlengths 4 1.02M | meta dict |
|---|---|
from os.path import exists
from os.path import getmtime
from . import old_statusfile
# These outcomes can occur in a TestCase's outcomes list:
SKIP = "SKIP"
FAIL = "FAIL"
PASS = "PASS"
OKAY = "OKAY"
TIMEOUT = "TIMEOUT"
CRASH = "CRASH"
SLOW = "SLOW"
# These are just for the status files and are mapped below in DEFS:
... | {
"content_hash": "b97409a3126137edaf6a2c007b733253",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 77,
"avg_line_length": 26.617391304347827,
"alnum_prop": 0.6481541979745181,
"repo_name": "windyuuy/opera",
"id": "634fe6a08a82ac639f87a4dd14161d1699d10836",
"size": "4730... |
import logging
import socket
import gevent
import haigha.connection
EXCHANGE = "sutro"
LOG = logging.getLogger(__name__)
class MessageSource(object):
"""An AMQP based message source.
This will monitor a fanout exchange on AMQP and signal on receipt of any
messages.
"""
def __init__(self, hos... | {
"content_hash": "6c95b128a6fc33bface3dfc89b023778",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 79,
"avg_line_length": 27.865853658536587,
"alnum_prop": 0.5754923413566739,
"repo_name": "spladug/sutro",
"id": "2fe0f1d2d6a768dda2ab8fff1985a2e060376e6f",
"size": "2285",... |
import os
import logging
import json
import datetime
import psycopg2
import time
import threading
import secrets
from pyramid.config import Configurator
from pyramid.session import SignedCookieSessionFactory
from pyramid.view import view_config
from pyramid.events import NewRequest, subscriber
from waitress import serv... | {
"content_hash": "d0e055c7e37275e70c0f5ed4da7eeabb",
"timestamp": "",
"source": "github",
"line_count": 339,
"max_line_length": 120,
"avg_line_length": 30.04424778761062,
"alnum_prop": 0.6252331860579283,
"repo_name": "efrainc/Wazzap",
"id": "d047e170d298b5f1e67a854904a4c562a0a1dc26",
"size": "1020... |
import unittest
from satellite import tree_from_traversals
# Tests adapted from `problem-specifications//canonical-data.json` @ v2.0.0
class SatelliteTest(unittest.TestCase):
def test_empty_tree(self):
preorder = []
inorder = []
expected = {}
self.assertEqual(tree_from_traversal... | {
"content_hash": "66d74b43480dff3dc95e39a46949d592",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 75,
"avg_line_length": 29.422535211267604,
"alnum_prop": 0.5390138822403063,
"repo_name": "smalley/python",
"id": "c5d312dbebad0e3b30a847beedfb1357980b1fda",
"size": "2089"... |
"""
Tests for warning suppression features of Trial.
"""
from __future__ import division, absolute_import
import unittest as pyunit
from twisted.trial import unittest
from twisted.trial.test import suppression
class SuppressionMixin(object):
"""
Tests for the warning suppression features of... | {
"content_hash": "c09f7a71728fe0b134aeff6fecc46ac3",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 81,
"avg_line_length": 37.48125,
"alnum_prop": 0.6341504085376022,
"repo_name": "timkrentz/SunTracker",
"id": "7ea2e386aa3fe4f69088f90103ddeb986a908846",
"size": "6071",
... |
from __future__ import unicode_literals
import frappe, json
import frappe.utils
import frappe.defaults
import frappe.widgets.form.meta
from frappe import _
@frappe.whitelist()
def getdoc(doctype, name, user=None):
"""
Loads a doclist for a given document. This method is called directly from the client.
Requries "do... | {
"content_hash": "a502c8272f0a6bd3609d9acb874f8d26",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 86,
"avg_line_length": 26.283464566929133,
"alnum_prop": 0.7028160575194727,
"repo_name": "rkawale/Internalhr-frappe",
"id": "b81e2a4bd42b9a10426d2dab7c282623e51a5259",
"s... |
"""
Copyright 2010 Sami Dalouche
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | {
"content_hash": "c61da33ca87ccdb2220005f6229c9db0",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 120,
"avg_line_length": 31.899328859060404,
"alnum_prop": 0.6686303387334315,
"repo_name": "pymager/pymager",
"id": "f27b08f91fb5f6c2db243f3cb04bff924c02cffd",
"size": "47... |
from kivy.uix.screenmanager import Screen
from kivy.uix.togglebutton import ToggleButton
from kivy.uix.popup import Popup
from kivy.lang import Builder
from kivy.utils import get_color_from_hex
from kivy.properties import NumericProperty
from screens import screenmanager
import random
__author__ = 'ohaz'
Builder.load... | {
"content_hash": "962ddef10d6e45e4b87a717ce22c834a",
"timestamp": "",
"source": "github",
"line_count": 224,
"max_line_length": 117,
"avg_line_length": 34.839285714285715,
"alnum_prop": 0.5934136340338289,
"repo_name": "ohaz/Colours",
"id": "12534806fe2941e8ec58e2bc1e352fcdf5f1d4c9",
"size": "7804"... |
"""Put user defined tasks in the plugins folder. You can start with
some customizations in this file which is included by default."""
from invoke import task
| {
"content_hash": "e6fc51bdfb19fca43f78385b3e63f52f",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 67,
"avg_line_length": 26.833333333333332,
"alnum_prop": 0.7701863354037267,
"repo_name": "ADicksonLab/wepy",
"id": "8bbc62ffdfb19d1bfd927254c21c8b382c40331e",
"size": "161"... |
from __future__ import (absolute_import, print_function, division)
import os
import select
import socket
import sys
import threading
import time
import traceback
import binascii
from six.moves import range
import certifi
from backports import ssl_match_hostname
import six
import OpenSSL
from OpenSSL import SSL
from ... | {
"content_hash": "843954694f5c8ed51a0e101f9cfd0ff8",
"timestamp": "",
"source": "github",
"line_count": 917,
"max_line_length": 160,
"avg_line_length": 35.0567066521265,
"alnum_prop": 0.5670513578249915,
"repo_name": "ikoz/mitmproxy",
"id": "68a7127023d33b8764540ac967452e81cbb6517d",
"size": "32147... |
import sys
import Queue
import threading
import pykeyvi
import argparse
import os
import gzip
import unicodedata, re
control_chars = ''.join(map(unichr, range(0,32)))
control_char_re = re.compile('[%s]' % re.escape(control_chars))
def remove_control_chars(s):
return control_char_re.sub('', s)
def print_progress... | {
"content_hash": "9cbe206ec0d07f973db77661ce6b4e9d",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 129,
"avg_line_length": 29.846153846153847,
"alnum_prop": 0.5526509572901326,
"repo_name": "DavidNemeskey/keyvi",
"id": "582501e265f09ea57ae0130e97f487cc0a485891",
"size": ... |
import datetime
import time
from pysqlite2._sqlite import *
paramstyle = "qmark"
threadsafety = 1
apilevel = "2.0"
Date = datetime.date
Time = datetime.time
Timestamp = datetime.datetime
def DateFromTicks(ticks):
return apply(Date, time.localtime(ticks)[:3])
def TimeFromTicks(ticks):
return apply(Time,... | {
"content_hash": "6a57aeee08811eee061505189c7eb0cf",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 88,
"avg_line_length": 25.323076923076922,
"alnum_prop": 0.6646415552855407,
"repo_name": "cigamit/boxeehack",
"id": "78f29a4fe1e6f179c58d795e1a6f8471e3c87173",
"size": "26... |
"""Preprocess tags per video and create their node description"""
import csv
import pandas as pd
import json
if __name__ == '__main__':
print("Load json file...")
json_data = json.load(open('data_clusters_v6.json'))
cluster = dict()
g_index = 0
for key, g in json_data.items():
cluster[g_index] = g
g_index+=1... | {
"content_hash": "e292a7ebad67e0ebd4a164c8bee6956c",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 78,
"avg_line_length": 19.74561403508772,
"alnum_prop": 0.6023989338071968,
"repo_name": "cwkenwaysun/TEDmap",
"id": "608be620f06920ead4a74c675b0be1914c424ee7",
"size": "2... |
import mock
import testtools
import webob.exc
from nova.api.openstack import api_version_request as api_version
from nova.api.openstack.compute import hosts as os_hosts_v21
from nova.compute import power_state
from nova.compute import vm_states
from nova import context as context_maker
from nova import db
from nova im... | {
"content_hash": "7ea54af958c49d53c9b6946958222e8b",
"timestamp": "",
"source": "github",
"line_count": 425,
"max_line_length": 78,
"avg_line_length": 41.974117647058826,
"alnum_prop": 0.6120298222994562,
"repo_name": "jianghuaw/nova",
"id": "308202e8b1d9136fbc4e84c6f0cf12e3eb33003b",
"size": "1847... |
"""
A compiler from a Relay expression to TVM's graph runtime.
The compiler is built from a few pieces.
First we define a compiler from a single Relay expression to the
graph langauge. We require the expression to be a function.
The function's parameters correspond to the placeholder/inputs
and model parameters found... | {
"content_hash": "cd84701ca64f6e6f0448feaef1ddeb28",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 81,
"avg_line_length": 38.32911392405063,
"alnum_prop": 0.6406869220607662,
"repo_name": "mlperf/training_results_v0.7",
"id": "cf31e9cff833c412623610887e5e505defefcb94",
"... |
"""Utilities and helper functions."""
import contextlib
import os
import shutil
import tempfile
from oslo.config import cfg
from brick.initiator import connector
from brick.openstack.common import lockutils
from brick.openstack.common import log as logging
from brick.openstack.common import processutils
CONF = cf... | {
"content_hash": "6aa844cbae846a7e46f5d4d88ca67e2d",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 76,
"avg_line_length": 29.88421052631579,
"alnum_prop": 0.5833039802747446,
"repo_name": "hemna/cinder-brick",
"id": "4d64fbb5955a49ee02d972dae2ff64158476bc2f",
"size": "34... |
from __future__ import print_function
import re
out = open('README.md', 'w')
out.write("""### Repository for open source packages
Open source packages mirrored here for convenience.
""")
def add_name(row):
res = {'home': row[1]}
m = re.match(r'.*[=/](.+)', row[0])
res['name'] = m.group(1) if m else row[0]... | {
"content_hash": "3626614f69091559228ee506e5b8209c",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 278,
"avg_line_length": 72.47727272727273,
"alnum_prop": 0.6782690498588899,
"repo_name": "radiasoft/foss-mirror",
"id": "39f434377a6c8fb40156353506a6f2edd8811ccc",
"size":... |
"""PipelineRunner, an abstract base runner object."""
# pytype: skip-file
import importlib
import logging
import os
import shelve
import shutil
import tempfile
from typing import TYPE_CHECKING
from typing import Optional
from apache_beam.options.pipeline_options import StandardOptions
if TYPE_CHECKING:
from apach... | {
"content_hash": "17a7074473a088096001a890d311271e",
"timestamp": "",
"source": "github",
"line_count": 410,
"max_line_length": 80,
"avg_line_length": 33.30731707317073,
"alnum_prop": 0.6775043936731108,
"repo_name": "apache/beam",
"id": "f2e09edb28eec392fe6d2b3217898ab26637001c",
"size": "14441",
... |
import sys
from ptnode import *
from color import rgb_tuple_to_hex_str,hex_str_to_rgb_tuple
#-----------------------------------------------------------------------------
#
# Constants
#
#-----------------------------------------------------------------------------
DUNNART_SPAN_LENGTH_FACTOR = 21 # multiply number... | {
"content_hash": "2741753ebd93cd51980fbd3d1cfcde62",
"timestamp": "",
"source": "github",
"line_count": 539,
"max_line_length": 80,
"avg_line_length": 38.17439703153989,
"alnum_prop": 0.5115182737169518,
"repo_name": "NirBenTalLab/proorigami-cde-package",
"id": "4144e068f832e9297d74ad57c4f6a4e46c88fb... |
import sys
import argparse
from socks1 import * #import all the socks from the file
from twisted.internet import reactor
#from twisted.protocols import socks
from twisted.python import log
sys.path.append('.')
import marionette_tg.conf
def startthestuff(port, address):
ip = address
s5 = Socks5(address,... | {
"content_hash": "8882ec5c143bd4201ffce21889ae8880",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 93,
"avg_line_length": 24.725,
"alnum_prop": 0.6855409504550051,
"repo_name": "flipchan/LayerProx",
"id": "3502b24791e61a978412b3cd4a44b7d5635c662e",
"size": "1145",
"bin... |
import copy
from nova.api.validation import parameter_types
create_backup = {
'type': 'object',
'properties': {
'createBackup': {
'type': 'object',
'properties': {
'name': parameter_types.name,
'backup_type': {
'type': 'strin... | {
"content_hash": "3d77f4aa965a8d614b41c6f9187b5d7b",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 65,
"avg_line_length": 27.741935483870968,
"alnum_prop": 0.5348837209302325,
"repo_name": "mahak/nova",
"id": "29401c853b427550feb8fe69ad87d1ec8dd383a7",
"size": "1491",
... |
from __future__ import absolute_import
import os
import re
from OpenSSL import SSL
from netlib import http_auth, certutils, tcp
from .. import utils, platform, version
from .primitives import RegularProxyMode, TransparentProxyMode, UpstreamProxyMode, ReverseProxyMode, Socks5ProxyMode
TRANSPARENT_SSL_PORTS = [443, 8443... | {
"content_hash": "7c98c7b9710458ccc691bea31f194035",
"timestamp": "",
"source": "github",
"line_count": 283,
"max_line_length": 116,
"avg_line_length": 36.2226148409894,
"alnum_prop": 0.6089162032972393,
"repo_name": "ryoqun/mitmproxy",
"id": "3f5796694da4803ded4055593baf09e255bce7a6",
"size": "102... |
import logging
import datetime
from decimal import Decimal
from django.conf import settings
from django.db import models, connection
from django.contrib.auth.models import User
class Overdraft(Exception):
pass
logger = logging.getLogger('wallet')
handler = logging.StreamHandler()
formatter = logging.Formatter(... | {
"content_hash": "0b92544dee772d5ebac0c7b12b96970e",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 77,
"avg_line_length": 31.887755102040817,
"alnum_prop": 0.6432,
"repo_name": "wengcq/django-wallet",
"id": "a7944b051002ebde0c7f41e0933efc64b10f89da",
"size": "3125",
"b... |
from __future__ import print_function, division
from os.path import join
import tempfile
import shutil
from io import BytesIO
try:
from subprocess import STDOUT, CalledProcessError
from sympy.core.compatibility import check_output
except ImportError:
pass
from sympy.utilities.exceptions import SymPyDepre... | {
"content_hash": "1a034243d1303fe7ea26135c762db941",
"timestamp": "",
"source": "github",
"line_count": 319,
"max_line_length": 99,
"avg_line_length": 37.66457680250784,
"alnum_prop": 0.5558884727424054,
"repo_name": "wolfram74/numerical_methods_iserles_notes",
"id": "9a2f3a206d7cd8cb21425b5ea561ef76... |
"""
Sample script that monitors smartcard readers.
__author__ = "http://www.gemalto.com"
Copyright 2001-2012 gemalto
Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com
This file is part of pyscard.
pyscard is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser Ge... | {
"content_hash": "ef96a62677ee595b42d16620757a2dc2",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 75,
"avg_line_length": 31.177419354838708,
"alnum_prop": 0.7387480600103467,
"repo_name": "mixja/eap-sim-lab",
"id": "178b6a87bfdced34cebec70a123b5e12e9d633bf",
"size": "19... |
from rest_framework import serializers
from .models import Message
from .permissions import IsOwnerOrReadOnly
from rest_framework.permissions import IsAuthenticated
class MessageReadSerializer(serializers.ModelSerializer):
pk = serializers.IntegerField(read_only=True)
author = serializers.CharField(read_only=... | {
"content_hash": "14d612875d82e54f1de67d50005ed399",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 67,
"avg_line_length": 33.24,
"alnum_prop": 0.7340553549939831,
"repo_name": "fmarco/message-board",
"id": "422d8bcd61b286263495c81866c0f00be187ce89",
"size": "831",
"bin... |
import os
__author__ = 'brucewootton'
"""
In memory blob store with file lock and appending support.
"""
BLOBS = {}
def startup():
pass
def file_name(uuid):
pass
def get_blob(uuid):
return BLOBS[uuid]
def write_blob(uuid, blob):
BLOBS[uuid] = blob
def append_data(uuid, value):
if uuid in B... | {
"content_hash": "7baf74f55ab699499ba41b9f5daf1c0a",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 58,
"avg_line_length": 12.083333333333334,
"alnum_prop": 0.6091954022988506,
"repo_name": "MPC-Berkeley/barc",
"id": "5b989074dc5bac3aec25f637a26c28a403d4ec2c",
"size": "43... |
import numpy as np
from skeleton import Skeleton
class MocapDataset:
def __init__(self, fps, skeleton):
self._skeleton = skeleton
self._fps = fps
self._data = None # Must be filled by subclass
self._cameras = None # Must be filled by subclass
def remove_joints(self, joints_to_remove):
kept... | {
"content_hash": "1826b536befde9165e0b17b92cd14466",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 64,
"avg_line_length": 24.216216216216218,
"alnum_prop": 0.6551339285714286,
"repo_name": "MTASZTAKI/ApertusVR",
"id": "c297220dbfb4df239b5d46121027246179a5e806",
"size": "... |
def initialize(context):
# The initialize function sets any data or variables that
# you'll use in your algorithm.
# For instance, you'll want to define the security
# (or securities) you want to backtest.
# You'll also want to define any parameters or values
# you're going to use later.
... | {
"content_hash": "6c4b0fc794eed811867fa2ee1c73725f",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 83,
"avg_line_length": 47.76923076923077,
"alnum_prop": 0.6856682769726248,
"repo_name": "mmilutinovic1313/zipline-with-algorithms",
"id": "49d938dab5f3f4d4da303a500ead7bb275... |
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
from msrest import Serializer
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineRespon... | {
"content_hash": "5e01db02e43b970a77ba55a2030507fd",
"timestamp": "",
"source": "github",
"line_count": 1297,
"max_line_length": 233,
"avg_line_length": 43.46723207401696,
"alnum_prop": 0.624509995210813,
"repo_name": "Azure/azure-sdk-for-python",
"id": "a13fae65a3c455b584b1412113da31403bf0bb61",
"... |
from SCons.Script import *
# Helper for creating source lists with certain files only enabled by config
# settings.
def FeatureSources(config, files):
output = []
for f in files:
if type(f) == tuple:
if config[f[0]]:
output.append(File(f[1]))
else:
output.append(File(f))
return output
# Raise an erro... | {
"content_hash": "b71177f2a71261af308f0dbfad6bffe6",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 76,
"avg_line_length": 26.105263157894736,
"alnum_prop": 0.7217741935483871,
"repo_name": "gil0mendes/Infinity-OS",
"id": "ec8a3374bad5b0ad3427314a7df0a2e21933b511",
"size"... |
import sys
from setuptools import setup, find_packages
# To install the library, open a Terminal shell, then run this
# file by typing:
#
# python setup.py install
#
# You need to have the setuptools module installed.
# Try reading the setuptools documentation:
# http://pypi.python.org/pypi/setuptools
REQUIRES = []... | {
"content_hash": "0c1cccf05eb3a6546227c87a1023432c",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 62,
"avg_line_length": 20.25,
"alnum_prop": 0.6867283950617284,
"repo_name": "jfiala/swagger-spring-demo",
"id": "066a6b125299865afacbd1d475c4d8fb24a8878e",
"size": "648",
... |
try:
import sys
import codecs
import inspect
except:
print('Library Error')
sys.exit(0)
def main():
try:
input_code = openSourceCode(sys.argv[2])
except:
print('File is not exist')
if __name__ == '__main__':
if len(sys.argv) != 3:
print('usage : python fuzzer.py <option> <filename>')
sys.exit(0)
... | {
"content_hash": "b733951eb9aef728fa938b6ebbb60118",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 55,
"avg_line_length": 14.521739130434783,
"alnum_prop": 0.6317365269461078,
"repo_name": "ied206/adv_ku_fuzz",
"id": "0ec4838b9d771614be479e0d0a0e10de7198da62",
"size": "3... |
from django.contrib import admin
from models import FilmSearch, Films, Developers, Notes
class FilmSearchAdmin(admin.ModelAdmin):
list_display = (
"Film", "Developer", "Dilution", "ASA_ISO", "create_timestamp", "last_update_timestamp",
)
list_filter = (
"Film",
)
class FilmsAdmin(a... | {
"content_hash": "69769208aad133226640e55b4373bb48",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 96,
"avg_line_length": 20.653061224489797,
"alnum_prop": 0.6373517786561265,
"repo_name": "summychou/GGFilm",
"id": "495ddc3e6a5c62fe9493d0ffdbabbee9b981e7d9",
"size": "101... |
import database
import math
class Rectangle(object):
def __init__(self, pt1, pt2):
x1, y1 = pt1
x2, y2 = pt2
self.left = min(x1, x2)
self.right = max(x1, x2)
self.top = max(y1, y2)
self.bottom = min(y1, y2)
def contains(self, pt3):
x3, y3 = pt3
return self.left <= x3 <= self.right and self.bottom... | {
"content_hash": "a15d9a74dc47666611ea3217f73cea0e",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 78,
"avg_line_length": 27.840579710144926,
"alnum_prop": 0.6775117126496616,
"repo_name": "swanndri/ROS-Healthcare-Simulator",
"id": "a3bc64b1eec56b7e4c5eea1ce2f37f4909c4db3... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
from pants.binaries.binary_tool import NativeTool
logger = logging.getLogger(__name__)
class YarnpkgDistribution(NativeTool):
"""Represents a sel... | {
"content_hash": "1f1abfe698afb12af18075770be95fa5",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 93,
"avg_line_length": 26.38888888888889,
"alnum_prop": 0.7136842105263158,
"repo_name": "UnrememberMe/pants",
"id": "4e381740fe0896858d083dd5f09f5a6a25389ff6",
"size": "62... |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | {
"content_hash": "8e44aefef46443a7e9ed3c4a745637d1",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 85,
"avg_line_length": 31.901639344262296,
"alnum_prop": 0.7410071942446043,
"repo_name": "arenadata/ambari",
"id": "64589ec49683f534a2403ae036a2fbc767feaedd",
"size": "196... |
import pytest
from fastapi.testclient import TestClient
from docs_src.first_steps.tutorial001 import app
client = TestClient(app)
openapi_schema = {
"openapi": "3.0.2",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {
"/": {
"get": {
"responses": {
... | {
"content_hash": "8dc5f8c3fca833b0ac331434ee6ad7db",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 72,
"avg_line_length": 27.23076923076923,
"alnum_prop": 0.5037664783427496,
"repo_name": "tiangolo/fastapi",
"id": "48d42285c8e704c7870ab756d52f3849809e6312",
"size": "1062... |
from unittest import mock
from airflow.providers.google.cloud.operators.facebook_ads_to_gcs import FacebookAdsReportToGcsOperator
GCS_BUCKET = "airflow_bucket_fb"
GCS_OBJ_PATH = "Temp/this_is_my_report_json.json"
GCS_CONN_ID = "google_cloud_default"
FACEBOOK_ADS_CONN_ID = "facebook_default"
API_VERSION = "v6.0"
FIELD... | {
"content_hash": "0f29d83b20153b8b1db821ab6bb01eec",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 104,
"avg_line_length": 42.22641509433962,
"alnum_prop": 0.5285969615728329,
"repo_name": "wooga/airflow",
"id": "a2b8b6b9dade566bc948e824b82d8043dd3112e0",
"size": "3023",... |
"""Convert Gettext PO localization files to Comma-Separated Value (.csv) files.
See: http://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/csv2po.html
for examples and usage instructions.
"""
from translate.storage import po
from translate.storage import csvl10n
class po2csv:
def convert... | {
"content_hash": "bd5da42c0c5eaaf6f4eb26f1a7a00a85",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 93,
"avg_line_length": 35.845238095238095,
"alnum_prop": 0.6552640318830953,
"repo_name": "staranjeet/fjord",
"id": "57ca47aa77a2d3ff33c52e517f301cc0636e8b9f",
"size": "377... |
"""
TFLite testcases
================
This article is a test script to test TFLite operator with Relay.
"""
from __future__ import print_function
from functools import partial
import pytest
import numpy as np
import tvm
import tempfile
from tvm import te
from tvm import relay
try:
import tensorflow.compat.v1 as tf... | {
"content_hash": "2d391d4af5cb47176bad2bcd4fd0b2b8",
"timestamp": "",
"source": "github",
"line_count": 4935,
"max_line_length": 135,
"avg_line_length": 35.42938196555218,
"alnum_prop": 0.5372389101141589,
"repo_name": "dmlc/tvm",
"id": "abb05354d921cecb0ece3e5c8107fecfba4c9286",
"size": "175690",
... |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
# Create one-input, one-output, no-fee transaction:
class MempoolCoinbaseTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 1
self.setup_clean_chain = False
... | {
"content_hash": "2e909299ceaa807942bcb6b95702d77f",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 105,
"avg_line_length": 40.125,
"alnum_prop": 0.6227068189685012,
"repo_name": "kallewoof/elements",
"id": "6f0073019d228777af7669432a2ea8da84eae708",
"size": "3190",
"bi... |
import warnings as _warnings
_warnings.resetwarnings()
_warnings.filterwarnings('error')
from tdi import html
template = html.from_string("""
<node tdi="item">
<node tdi="nested">
<node tdi="subnested"></node>
</node><tdi tdi=":-nested">
</tdi>
</node>
""".lstrip())
class Model(object):
def r... | {
"content_hash": "9a2435448d6f781ca5be2b1af32bc927",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 74,
"avg_line_length": 23.9375,
"alnum_prop": 0.5391644908616188,
"repo_name": "ndparker/tdi",
"id": "25ec0d692078d119f75e965475c83d8a118e18cc",
"size": "788",
"binary": ... |
"""
Partial! M4 Design Of Experiments driver.
Consider this only as a hint as to how this might be done.
The code here has only been developed to test feasibility,
and was written by someone without much 'mool' knowledge.
"""
__all__ = ('DOE',)
import mool.Optimization.DOE
from openmdao.lib.drivers.caseiterdriver imp... | {
"content_hash": "084d3cc30d6df69760ef8fb15f0c43aa",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 86,
"avg_line_length": 36.12359550561798,
"alnum_prop": 0.5580093312597201,
"repo_name": "DailyActie/Surrogate-Model",
"id": "0bd536995c4203cf6edc2f713cd2127f46e230f5",
"si... |
import os
import httplib as http
from flask import request
from flask import send_from_directory
from framework import status
from framework import sentry
from framework.auth import cas
from framework.routing import Rule
from framework.flask import redirect
from framework.routing import WebRenderer
from framework.exc... | {
"content_hash": "71489b38eb278d67dfd37ffce7b4dca5",
"timestamp": "",
"source": "github",
"line_count": 1631,
"max_line_length": 139,
"avg_line_length": 31.368485591661557,
"alnum_prop": 0.5036159649740042,
"repo_name": "zachjanicki/osf.io",
"id": "f68f22235a0a9aec6cd6bd6a0246249c050dc1ba",
"size":... |
"""This code example gets an team by its id. To determine which teams
exist, run get_all_teams.py."""
__author__ = 'api.shamjeff@gmail.com (Jeff Sham)'
# Locate the client library. If module was installed via "setup.py" script, then
# the following two lines are not needed.
import os
import sys
sys.path.insert(0, os.... | {
"content_hash": "2791588ed93e303af919d8c156a56dca",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 80,
"avg_line_length": 28.806451612903224,
"alnum_prop": 0.6685330347144457,
"repo_name": "donspaulding/adspygoogle",
"id": "7425e5f7dcc71d7bc418e59b2ed16c9d14455a29",
"siz... |
import logging
from .scriptable_strategy import ScriptableStrategy
def create_strategy(args = None):
return __IBS()
class __IBSStrategyBase(ScriptableStrategy):
def __init__(self, buy_value, sell_value):
super().__init__('IBS_%f_%f'
% (buy_value, sell_value),
... | {
"content_hash": "a8ca26a4c79ab21ebd5326f23885b2f3",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 59,
"avg_line_length": 28.652173913043477,
"alnum_prop": 0.4795144157814871,
"repo_name": "stonewell/learn-curve",
"id": "50f55745f8c794bd05bad89491c4ea391f85486a",
"size":... |
"""
Classes for dynamic generation of mock objects.
"""
import inspect
def serialize_obj(obj):
if isinstance(obj, float):
val = str(round(obj, 10))
elif isinstance(obj, dict):
d = {}
for k1, v1 in obj.items():
d[k1] = serialize_obj(v1)
val = str(d)
elif isinsta... | {
"content_hash": "a3ef8e5a408d608cbff5ac75a0aef65f",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 73,
"avg_line_length": 30.955156950672645,
"alnum_prop": 0.4540055048529625,
"repo_name": "tomasdubec/openstack-cinder",
"id": "d39a96300dfda8c016afc2d669d5c0bdeef5c459",
... |
"""
Created on Fri Jan 9 12:52:31 2015
@author: stuart
"""
import os
import glob
import numpy as np
import pysac.yt as sacyt
import pysac.mhs_atmosphere as atm
l_mpi=False
scales, physical_constants = \
atm.units_const.get_parameters()
#define the models required
spruits = ['spruit_const','spruit_sqrt','spruit_l... | {
"content_hash": "f013b4160aa35473e1d3e4a81f7d6f09",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 85,
"avg_line_length": 42.07608695652174,
"alnum_prop": 0.46912942392146734,
"repo_name": "SWAT-Sheffield/pysac",
"id": "901a3878c491943e5e7ee451342b353816228eda",
"size": ... |
"""
Unit tests for the NetApp 7mode NFS storage driver
"""
import ddt
import mock
from os_brick.remotefs import remotefs as remotefs_brick
from oslo_utils import units
from cinder import test
from cinder.tests.unit.volume.drivers.netapp.dataontap import fakes as fake
from cinder.tests.unit.volume.drivers.netapp impor... | {
"content_hash": "df3f49ba9fb410dc46ba923ebcf55988",
"timestamp": "",
"source": "github",
"line_count": 254,
"max_line_length": 76,
"avg_line_length": 40.72047244094488,
"alnum_prop": 0.5983757130426375,
"repo_name": "ge0rgi/cinder",
"id": "378878a9430910c9b3df68424afcfc2806222b55",
"size": "10972"... |
from .responses import PERMISSION_DENIED
def sudo_required(func):
def wrapper(*args, **kwargs):
request = None
if 'request' in kwargs.keys():
request = kwargs['request']
elif 'request' in func.__code__.co_varnames:
request_pos = func.__code__.co_varnames.index('request')
request = args[request_pos]
... | {
"content_hash": "723151db855ec01df2f424b727be4597",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 59,
"avg_line_length": 29.135135135135137,
"alnum_prop": 0.6753246753246753,
"repo_name": "YuriyLisovskiy/messenger",
"id": "990f14975b16843d8524e4a617a3c64846c0d865",
"siz... |
from __future__ import annotations
import dataclasses
from dataclasses import dataclass
from typing import Iterable, List, Mapping, Optional, Tuple
from pants.backend.python.subsystems.python_native_code import PythonNativeCodeSubsystem
from pants.backend.python.util_rules import pex_environment
from pants.backend.py... | {
"content_hash": "9ea5cc8eb4991ad3fd1f2bfe4ff58be5",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 100,
"avg_line_length": 37.661764705882355,
"alnum_prop": 0.6710920213458285,
"repo_name": "benjyw/pants",
"id": "2e98e953cf31247d2438fbc55d00cee8f4056c16",
"size": "7815"... |
import codecs
import hyperframe
def http2_read_raw_frame(rfile):
header = rfile.safe_read(9)
length = int(codecs.encode(header[:3], 'hex_codec'), 16)
if length == 4740180:
raise ValueError("Length field looks more like HTTP/1.1: %s" % rfile.peek(20))
body = rfile.safe_read(length)
retur... | {
"content_hash": "0f0d2bb5e74c421969ea727cb99f65ff",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 86,
"avg_line_length": 25.761904761904763,
"alnum_prop": 0.6802218114602587,
"repo_name": "tdickers/mitmproxy",
"id": "d45be64611866fe43fbb473901fc015295ad1759",
"size": "5... |
import tornado.web
import json
from jaeger_client.local_agent_net import LocalAgentSender
from jaeger_client.config import (
Config,
DEFAULT_SAMPLING_PORT,
DEFAULT_REPORTING_PORT,
)
from jaeger_client.constants import (
SAMPLER_TYPE_CONST,
SAMPLER_TYPE_REMOTE,
)
from jaeger_client.sampler import Re... | {
"content_hash": "9f1ba506aecd23ae7be390ce0e4b18d4",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 96,
"avg_line_length": 28.01904761904762,
"alnum_prop": 0.6084296397008837,
"repo_name": "guillermo-sentinella/jaeger-client-python",
"id": "88c9b2967476bedeaeb154d417be0d22... |
from eth_tools import Contract, address
from nose.tools import assert_equal
from pyethereum import tester as t
INITIALIZE = 0
SET_CONFIGURATION = 1
BUY_TICKET = 2
GET_TICKET_OWNER = 3
GET_TICKET_NUMBERS = 4
TRANSFER_TICKET = 5
CHECK_WINNERS = 6
CLAIM_WINNINGS = 7
GET_BALANCE = 8
SET_PAYOUTS = 9
WITHDRAW = 10
START_LOT... | {
"content_hash": "2438d6488087e689b69822eabd981e36",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 93,
"avg_line_length": 39.26589595375722,
"alnum_prop": 0.6229942587958193,
"repo_name": "jeffanthony/ethereum-powerball",
"id": "611c4710a9d350edb3a17414e5994556192fa9cd",
... |
import argparse
import fnmatch
import ntpath
import sys
import os
import shutil
from helpers import compile_helper
from subprocess import call
# Add this to your path
protoc_path = "protoc"
# Specify desired language / output
parser = argparse.ArgumentParser()
parser.add_argument("-l", "--lang", help="Language to pro... | {
"content_hash": "c95fbdbe6f1c0a0ba550c0cc971986a7",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 83,
"avg_line_length": 29.455696202531644,
"alnum_prop": 0.650623119896863,
"repo_name": "cstrachan88/PoGo-Proxy.NET",
"id": "d807da32eb2081afa5e082318b741eae4a63575a",
"si... |
"""
jenkinsapi plugins
"""
from __future__ import print_function
import logging
import time
import re
try:
from StringIO import StringIO
from urllib import urlencode
except ImportError:
# Python3
from io import BytesIO as StringIO
from urllib.parse import urlencode
import json
import requests
from ... | {
"content_hash": "5b3181f85c9513c5ce2c0bcb84a82612",
"timestamp": "",
"source": "github",
"line_count": 296,
"max_line_length": 79,
"avg_line_length": 35.44932432432432,
"alnum_prop": 0.5936338511388545,
"repo_name": "salimfadhley/jenkinsapi",
"id": "9083c67cb4ad90b715b0196b0b0465d3bbdd86d5",
"size... |
from __future__ import unicode_literals
from django.db import models
class Building(models.Model):
name = models.CharField(max_length=200)
lat = models.FloatField()
lng = models.FloatField()
def __unicode__(self):
return self.name
| {
"content_hash": "91bd6188912d591e00fb8897fced227a",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 40,
"avg_line_length": 21.818181818181817,
"alnum_prop": 0.7333333333333333,
"repo_name": "andrewwong97/path-hero",
"id": "a4f2941b6be042367bab1e09a3c0493bf121bb2d",
"size"... |
from os.path import abspath
from io import BytesIO
import copy
import numpy
import unittest
# Enthought library imports
from mayavi.core.engine import Engine
from mayavi.core.null_engine import NullEngine
from mayavi.sources.array_source import ArraySource
from mayavi.modules.outline import Outline
from mayavi.module... | {
"content_hash": "ef08c7d7990ea747ad3e81e2382ff3b4",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 122,
"avg_line_length": 31.401459854014597,
"alnum_prop": 0.5743840074384008,
"repo_name": "dmsurti/mayavi",
"id": "7e086e05911f4d75941eb96f4f85c439e281716f",
"size": "450... |
import optparse
import StringIO
import sys
from pyang import plugin
_COPYRIGHT_NOTICE = """
// DO NOT EDIT
// generated by pyang using OpenConfig https://github.com/openconfig/public
//
// Copyright (C) 2014,2015 Nippon Telegraph and Telephone Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "Lic... | {
"content_hash": "265772916a8f1d350a2e0841d90f13ab",
"timestamp": "",
"source": "github",
"line_count": 630,
"max_line_length": 165,
"avg_line_length": 30.79047619047619,
"alnum_prop": 0.5419630889782452,
"repo_name": "h-naoto/gobgp",
"id": "45a25078724ae5719bf3adc168f25ccdf8501b30",
"size": "20017... |
import getpass
import time
import asyncio
from spade.agent import Agent
from spade.behaviour import CyclicBehaviour
class DummyAgent(Agent):
class MyBehav(CyclicBehaviour):
async def on_start(self):
print("Starting behaviour . . .")
self.counter = 0
async def run(self):
... | {
"content_hash": "76bae0b31227f3a5f98b9fac376379ad",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 53,
"avg_line_length": 23.41025641025641,
"alnum_prop": 0.5859802847754655,
"repo_name": "javipalanca/spade",
"id": "2790febd737ba0f7ea203bce7344f65bc0088d0f",
"size": "913... |
from django.contrib import admin
from .models import Minutes
from cms.admin import ContentManageableModelAdmin
@admin.register(Minutes)
class MinutesAdmin(ContentManageableModelAdmin):
date_hierarchy = 'date'
def get_list_filter(self, request):
fields = list(super().get_list_filter(request))
... | {
"content_hash": "acf571e44eb919fabc078362ca0b26bc",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 56,
"avg_line_length": 29.058823529411764,
"alnum_prop": 0.7064777327935222,
"repo_name": "manhhomienbienthuy/pythondotorg",
"id": "63f7fdd4dbdcf5aecea554f5b0940e3590f82dfa",... |
from pygame.sprite import Sprite
import pygame
import os
from math import cos, sin, atan2, degrees, pi, sqrt
from mixins import ImageBatch
from random import randrange
from random import choice as randchoice
import well
def vector_add(rads1, speed1, rads2, speed2):
x = speed1 * cos(rads1) + speed2 * cos(rad... | {
"content_hash": "160ff83c214284c7b3f7084d5ac8e41d",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 107,
"avg_line_length": 23.743589743589745,
"alnum_prop": 0.5606911447084233,
"repo_name": "Saevon/spacebattle",
"id": "25c8e88e06dc0fd6161cef57b3d00297bf213d41",
"size": ... |
"""
$ python cmdln_help1.py help
HelpShell: blah blah blah
$ python cmdln_help1.py help documented
documented: blah documented blah
$ python cmdln_help1.py help hashelpfunc
hashelpfunc: blah hashelpfunc blah
$ python cmdln_help1.py help undocumented
cmdln_help1.py: no help on 'undocum... | {
"content_hash": "060da23703be2b623ac93d6fbe1674fb",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 74,
"avg_line_length": 28.041666666666668,
"alnum_prop": 0.6693907875185735,
"repo_name": "trentm/cmdln",
"id": "05695f213bdef23df28ea121b9e5089f3a40733b",
"size": "1369",
... |
"""
Widget mixin that only renders selected options with QuerySetSequence.
For details about why this is required, see :mod:`dal.widgets`.
"""
from dal.widgets import WidgetMixin
from django import forms
from django.contrib.contenttypes.models import ContentType
class QuerySetSequenceSelectMixin(WidgetMixin):
... | {
"content_hash": "834e6bae4665ba6be2f4e5476386f440",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 78,
"avg_line_length": 33.3921568627451,
"alnum_prop": 0.6335877862595419,
"repo_name": "yourlabs/django-autocomplete-light",
"id": "00e3eb38e54748bef1151c7073fb66f3c2f0ab34"... |
import configparser
from functools import lru_cache
import glob
import io
import os
import re
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import pandas as pd
# import numpy as np
TEST_RESULT_ROOT = "/Users/esteele/tmp/wifi-test/root/wifi-test-results"
METADATA_FILENAME = "metadata.ini"
TEST_RE... | {
"content_hash": "2e0eaf90ffb693797b373893f5b5bb97",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 78,
"avg_line_length": 36.89041095890411,
"alnum_prop": 0.5890580517390767,
"repo_name": "ConnectBox/wifi-test-framework",
"id": "851fe4f30eba16f9ec962f25c0e77a3e934f9c92",
... |
from __future__ import absolute_import, division, print_function, unicode_literals
import json
import os
import unittest
from binascii import unhexlify
from bitcoin.base58 import *
def load_test_vectors(name):
with open(os.path.dirname(__file__) + '/data/' + name, 'r') as fd:
for testcase in json.load(... | {
"content_hash": "5d58904b2404af39d233ae02c101ae2c",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 105,
"avg_line_length": 36.04255319148936,
"alnum_prop": 0.6381345926800472,
"repo_name": "Peerapps/PeerChat",
"id": "a57d1fe17edbffe68d8bfa2ca57ad2d7b19817bb",
"size": "20... |
from Framework.Resposta import Resposta
from Models.Sala.Sala import Sala as ModelSala
class RespostaVer(Resposta):
def __init__(self,sala):
self.corpo = ModelSala(sala)
| {
"content_hash": "244f75243c0a7e41a51083d390f83562",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 46,
"avg_line_length": 25,
"alnum_prop": 0.7714285714285715,
"repo_name": "AEDA-Solutions/matweb",
"id": "76c16c1a1321e0a1def9da126e84f5e3e5d7fd00",
"size": "175",
"binary... |
import os
import httplib as http
from flask import request
from flask import send_from_directory
from framework import status
from framework import sentry
from framework.auth import cas
from framework.routing import Rule
from framework.flask import redirect
from framework.sessions import session
from framework.routin... | {
"content_hash": "2c01c2eb39c93fd020105be00a046cb7",
"timestamp": "",
"source": "github",
"line_count": 1490,
"max_line_length": 134,
"avg_line_length": 31.85973154362416,
"alnum_prop": 0.505297971393061,
"repo_name": "ckc6cz/osf.io",
"id": "5881a3539c7d430de51040233a94889c398746bb",
"size": "47495... |
"""Tests for neurodsp.timefrequency.wavelets."""
from neurodsp.tests.settings import FS, FREQ1, FREQS_ARR
from neurodsp.timefrequency.wavelets import *
###################################################################################################
#################################################################... | {
"content_hash": "09b57d23d83fc1414554f1f13d74d72e",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 99,
"avg_line_length": 32.225806451612904,
"alnum_prop": 0.5665665665665666,
"repo_name": "voytekresearch/neurodsp",
"id": "702dfca323dc22d8367b6d0ad7732f738d017aa2",
"size... |
from glanceclient.common import http
from glanceclient.common import utils
from glanceclient.v2 import image_members
from glanceclient.v2 import image_tags
from glanceclient.v2 import images
from glanceclient.v2 import metadefs
from glanceclient.v2 import schemas
from glanceclient.v2 import tasks
class Client(object)... | {
"content_hash": "84dd0e679e396733c2ecf0a74be11808",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 79,
"avg_line_length": 40.65909090909091,
"alnum_prop": 0.6562325321408609,
"repo_name": "mmasaki/python-glanceclient",
"id": "803673ba537baf29f069f0f202b6be0d381139fa",
"s... |
from Crypto.PublicKey import RSA
from user_sync.error import AssertionException
def read_key(filename):
with open(filename, 'r') as f:
return f.read()
def write_key(data, filename):
with open(filename, 'w') as f:
f.write(data)
def encrypt_file(passphrase, filename):
data = read_key(fi... | {
"content_hash": "d825aa4d475b8f9b20ddd39881d2844b",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 113,
"avg_line_length": 34.41818181818182,
"alnum_prop": 0.6460644479661912,
"repo_name": "adobe-apiplatform/user-sync.py",
"id": "60c5a98ad5664f251dd59bdd7b53da16994c830d",
... |
import json
import logging
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon.forms import fields
from horizon import workflows
from openstack_dashboard.contrib.sahara.content.data_processing \
.utils import helpers
from openstack_dashboa... | {
"content_hash": "06c6c9a5c3db4b2b7905910c33620a91",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 79,
"avg_line_length": 35.35751295336787,
"alnum_prop": 0.5665298944900352,
"repo_name": "damien-dg/horizon",
"id": "cbb5efbdf307cbda3382a6400d16988ddc7a8849",
"size": "73... |
import sys
import gtk
import pygtk
pygtk.require('2.0')
import mateapplet
from nm_dispatcher_olsrd_applet import applet_factory
if __name__ == '__main__': # testing for execution
print('Starting factory')
if len(sys.argv) > 1 and sys.argv[1] == '-d': # debugging
mainWindow = gtk.Window()
mainWindow.set_title('... | {
"content_hash": "9d9bcfaf11381895762ec2e17a912cbc",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 84,
"avg_line_length": 27.692307692307693,
"alnum_prop": 0.7069444444444445,
"repo_name": "eighthave/nm-dispatcher-olsrd-applet",
"id": "bc8727a7584d8d09cc6cce22bbed05bee5db3... |
import pika
connection=pika.BlockingConnection(pika.ConnectionParameters(host="10.0.0.25"))
channel=connection.channel()
channel.exchange_declare(exchange="direct_logs",type="direct")
result=channel.queue_declare(exclusive=True)
queue_name=result.method.queue
severties=["error",]
for i in severties:
channel.que... | {
"content_hash": "9eca2504fb49494e33795330df0ba630",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 79,
"avg_line_length": 25.238095238095237,
"alnum_prop": 0.7830188679245284,
"repo_name": "xiaoyongaa/ALL",
"id": "a45d4b301048853dfdc50ed57e35276c09dfd5fc",
"size": "530",... |
import sys
import pygfa
import networkx as nx
import matplotlib.pyplot as plt
import argparse
import logging
logging.basicConfig(level=logging.DEBUG)
if __name__ == '__main__':
# -------------------------CLI-ARGUMENT-MANAGEMENT-------------------------------- #
parser = argparse.ArgumentParser (descrip... | {
"content_hash": "5235f864f5ddec003ff348efb9cbf1a8",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 103,
"avg_line_length": 37.8421052631579,
"alnum_prop": 0.5127491886879926,
"repo_name": "AlgoLab/pygfa",
"id": "21e4f75b2101dedeea4cf761be7b049f722cfdd4",
"size": "2157",
... |
from msrest.pipeline import ClientRawResponse
from .. import models
class Paths(object):
"""Paths operations.
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An objec model deserialize... | {
"content_hash": "61cebe347291d1a264c6eaf9c3a6f340",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 101,
"avg_line_length": 34.784615384615385,
"alnum_prop": 0.637328615656789,
"repo_name": "sharadagarwal/autorest",
"id": "478f2a330a550b6b20e042501b67aa686d450ced",
"size"... |
import functools
import collections
from paddle.trainer.config_parser import *
from .activations import LinearActivation, SigmoidActivation, TanhActivation, \
ReluActivation, IdentityActivation, SoftmaxActivation
from .evaluators import *
from .poolings import MaxPooling, AvgPooling, BasePoolingType
from .attrs im... | {
"content_hash": "8b21758403bdb9c473694e5bdda1c232",
"timestamp": "",
"source": "github",
"line_count": 4754,
"max_line_length": 93,
"avg_line_length": 32.56583929322676,
"alnum_prop": 0.6056207934477903,
"repo_name": "beckett1124/Paddle",
"id": "9b6e5774bc82dc05e14a2565fa9cce98764adf04",
"size": "... |
"""Tests for _adapter._low."""
import time
import unittest
from grpc._adapter import _low
_STREAM_LENGTH = 300
_TIMEOUT = 5
_AFTER_DELAY = 2
_FUTURE = time.time() + 60 * 60 * 24
_BYTE_SEQUENCE = b'\abcdefghijklmnopqrstuvwxyz0123456789' * 200
_BYTE_SEQUENCE_SEQUENCE = tuple(
bytes(bytearray((row + column) % 256 f... | {
"content_hash": "5104c17e9fcf94f71028f57f800ea2ad",
"timestamp": "",
"source": "github",
"line_count": 342,
"max_line_length": 80,
"avg_line_length": 37.64035087719298,
"alnum_prop": 0.713431212615552,
"repo_name": "tatsuhiro-t/grpc",
"id": "b04ac1c95098a0cf23b89ce304223ccb3ebec89d",
"size": "1440... |
import os
import unittest
import numpy as np
from scipy import sparse
from autosklearn.pipeline.components.data_preprocessing.one_hot_encoding import OneHotEncoder
from autosklearn.pipeline.util import _test_preprocessing
class OneHotEncoderTest(unittest.TestCase):
def setUp(self):
self.categorical = [T... | {
"content_hash": "63da81576784e0857f4f6a266fb8532b",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 93,
"avg_line_length": 40.858333333333334,
"alnum_prop": 0.4482969610442586,
"repo_name": "hmendozap/auto-sklearn",
"id": "d062a202de11aba213d795dd0621870cff4d6e7c",
"size... |
def detect_platform():
""" Attempt to detect the current platform. Returns : 'Sitara Am35172',
'BeagleBone >=3.8'. """
platform = ''
with open('/proc/cpuinfo', 'rb') as f:
cpuinfo = f.read().lower()
#In this part do it the parameter verification with 'v7l' that
#represent de ARMv7 architecture (Usi... | {
"content_hash": "3327e684c0058b5194852ac9cab19389",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 82,
"avg_line_length": 37.03225806451613,
"alnum_prop": 0.681184668989547,
"repo_name": "dec4n/PyBBIO-CM-T3517",
"id": "39501f99b40b6d40bcd1a6c726678c19d03aff01",
"size": "... |
import pickle
import numpy as np
from PIL import Image
from sklearn.grid_search import GridSearchCV
from sklearn.svm import SVC
import openface
import redis
from cumera.celeryconf import app
from demos.classifier import align, net
from models import FaceImage
from redis_cli import REDIS_CONNECTION_POOL
class Face:
... | {
"content_hash": "b63e9e63f2678429a36f40dbfb9ee24c",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 93,
"avg_line_length": 28.796992481203006,
"alnum_prop": 0.554046997389034,
"repo_name": "helloworldajou/webserver",
"id": "00bbde3ac566158a3ff056a4a96e901bc7b97eff",
"siz... |
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/poi/shared_tatooine_valariangang_large1.iff"
result.attribute_template_id = -1
result.stfName("poi_n","base_poi_building")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "64cdce0a60c7e6df7ab398dad63452b2",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 80,
"avg_line_length": 24.153846153846153,
"alnum_prop": 0.7006369426751592,
"repo_name": "anhstudios/swganh",
"id": "68217281e971cf09ea71116255f880544b0cc666",
"size": "45... |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | {
"content_hash": "5d8a298e5788b216fbf2b067c095518f",
"timestamp": "",
"source": "github",
"line_count": 322,
"max_line_length": 142,
"avg_line_length": 43.25155279503105,
"alnum_prop": 0.7086953399870755,
"repo_name": "radicalbit/ambari",
"id": "14d6ce2ce1f3e72cc6e065f4d4ff8c16a9936257",
"size": "1... |
import sys
from treetagger3 import TreeTagger
tt = TreeTagger(encoding='utf-8',language='french')
with open (sys.argv[1], "r") as myfile:
data=myfile.read()
tags = tt.tag(data)
tagstats = {}
for tag in tags:
wordCategory = tag[1]
tagstats[wordCategory] = tagstats.get(wordCategory, 0) + 1
for tag in tagstats:
p... | {
"content_hash": "725c5299eea16493e25b83e332972d0c",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 59,
"avg_line_length": 25.142857142857142,
"alnum_prop": 0.7102272727272727,
"repo_name": "semplea/characters-meta",
"id": "a4a39d811eabf3b2eb1f5dc6e7625a65903c07e6",
"size... |
from setuptools import setup
setup(name='iribaker',
version='0.2',
description='Safely convert IRI-like string to IRI.\nReplaces invalid charactes with an underscore (i.e. does not support roundtripping).\nFalls back to standard URL percent encoding.',
url='http://github.com/clariah/iribaker',
... | {
"content_hash": "c0569ac9a4d27f51d90e4732ae975544",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 191,
"avg_line_length": 40.357142857142854,
"alnum_prop": 0.6743362831858407,
"repo_name": "CLARIAH-SDH/iribaker",
"id": "3189d08bfe75a6006cea5cf682ed6e75acbb3bec",
"size":... |
from wxglterm_interface import TermUI, TermWindow
from term_plugin_base import TermPluginBase
import tkinter
import sys
import logging
class DefaultTkTermWindow(TermPluginBase, TermWindow):
def __init__(self):
TermPluginBase.__init__(self,
name="default_term_window",
... | {
"content_hash": "4eebb3ee59f4f4edca0a8ca3166dd1d2",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 79,
"avg_line_length": 27.953703703703702,
"alnum_prop": 0.5074527989400464,
"repo_name": "stonewell/wxglterm",
"id": "9c14b3e3a89ae84837517e35a860325509b542e5",
"size": "... |
"""A setup module for the GRPC Python package."""
from distutils import core as _core
import setuptools
import sys
_EXTENSION_SOURCES = (
'grpc/_adapter/_c/module.c',
'grpc/_adapter/_c/types.c',
'grpc/_adapter/_c/utility.c',
'grpc/_adapter/_c/types/client_credentials.c',
'grpc/_adapter/_c/types/se... | {
"content_hash": "0c0a9138811acd67aefb8b9badadf5eb",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 57,
"avg_line_length": 24.18840579710145,
"alnum_prop": 0.6273217495506291,
"repo_name": "wkubiak/grpc",
"id": "5398b099360645659e13d6b3cb3bc0c9dbdfd1fa",
"size": "3198",
... |
from __future__ import with_statement
import os
import cPickle
from twisted.persisted import styles
from buildbot.util import json
import sqlalchemy as sa
metadata = sa.MetaData()
last_access = sa.Table('last_access', metadata,
sa.Column('who', sa.String(256), nullable=False),
sa.Column('writing', sa.Integer... | {
"content_hash": "dc27578fa79c673c1689fb51472dfd78",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 147,
"avg_line_length": 38.68283582089552,
"alnum_prop": 0.6441593517893315,
"repo_name": "denny820909/builder",
"id": "297d7a2c134f6752aa6ec7aa45685c19068b232b",
"size": ... |
"""Handles all requests relating to compute resources (e.g. guest VMs,
networking and storage of VMs, and compute hosts on which they run)."""
import base64
import copy
import functools
import re
import string
import uuid
from oslo_config import cfg
from oslo_log import log as logging
from oslo_serialization import j... | {
"content_hash": "54372a7bfa8931e94f7cf37d67867dac",
"timestamp": "",
"source": "github",
"line_count": 4140,
"max_line_length": 79,
"avg_line_length": 43.9963768115942,
"alnum_prop": 0.5755689148755113,
"repo_name": "alvarolopez/nova",
"id": "1cf915196efa044c23f52566b5b4587e11fa703f",
"size": "182... |
import operator
from fractions import Fraction, gcd
from functools import lru_cache
from numbers import Real, Integral, Rational, Complex
from math import trunc, frexp, log10, log2, isnan, isinf, floor
from itertools import count
from fixedpoint.qformat import QFormat
def lowest_set_bit(x):
"""The lowest set bi... | {
"content_hash": "a1b8b74bc8c6449ad0d3729881c0025e",
"timestamp": "",
"source": "github",
"line_count": 554,
"max_line_length": 120,
"avg_line_length": 36.151624548736464,
"alnum_prop": 0.6263730776912323,
"repo_name": "sixty-north/fixedpointtest",
"id": "d2eca778dfb7096a4b0d283390dc386432827950",
... |
__author__ = "Christopher Perry"
__email__ = "ozbonus@gmail.com"
"""
Take a text file wherein each line of text consist of space delimited characters
followed by an integer. This program prints the Mth element of the (1-based)
list. In the case of an index error, that input is ignored.
"""
import sys
def mth_to_last... | {
"content_hash": "893fb1f33d84339e4790c72c8a56a800",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 80,
"avg_line_length": 30.416666666666668,
"alnum_prop": 0.589041095890411,
"repo_name": "OzBonus/CodeEval",
"id": "de3ed08b14a3df598698abfcfd0654481aaf3e7c",
"size": "753"... |
from json import dumps
try:
from urlparse import parse_qsl
except ImportError:
from urllib.parse import parse_qsl
def facebook_compliance_fix(session):
def _compliance_fix(r):
# if Facebook claims to be sending us json, let's trust them.
if 'application/json' in r.headers['content-type']:... | {
"content_hash": "e32e061ef66f856c6657925439f9164b",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 78,
"avg_line_length": 33.38709677419355,
"alnum_prop": 0.6309178743961352,
"repo_name": "emedinaa/contentbox",
"id": "b6b8b369faf616abfe2563596e2cb5a917c21d10",
"size": "1... |
from nltk import RegexpParser
from collections import Counter
import word2vec, uuid, random
from string import punctuation
from datetime import datetime
from db_tables import metadata, CriteriaConceptStaging, ConceptPredictors, \
ConceptPredictorsReject, ConceptTerms, ConceptTermsReject, CriteriaTagged
# helper ... | {
"content_hash": "5b75144976e42380a466cee65cd51d8d",
"timestamp": "",
"source": "github",
"line_count": 450,
"max_line_length": 134,
"avg_line_length": 38.91555555555556,
"alnum_prop": 0.5326062128825948,
"repo_name": "jasonost/clinicaltrials",
"id": "d3c24e71437313458212a6623ef688d43b22903e",
"siz... |
from django.db import models
from django.utils import timezone
from employees.models import Employee
import datetime
from mis.base import BaseProfile
class Organizer(BaseProfile):
name = models.CharField(max_length=255, verbose_name="Name of Organizer", unique=True)
email = models.EmailField(blank=True, nul... | {
"content_hash": "cc871cb1ba28a6ebc2ff390de0c0ae60",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 121,
"avg_line_length": 34.73684210526316,
"alnum_prop": 0.6242424242424243,
"repo_name": "rcdosado/URO-MIS",
"id": "3ee4845e8885e0e80bd0e9b73d58493d6bcceded",
"size": "330... |
import os
import yaml
import sys
from jinja2 import Environment, Template
autogen_warning="""////
AUTOGENERATED FILE - this file was generated via ./gen_template_docs.py.
Changes to .adoc or HTML files may be overwritten! Please change the
generator or the input template (./*.jinja)
////
"""
template = T... | {
"content_hash": "8db0efa11f3f90fe682e4b28002344a5",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 119,
"avg_line_length": 32.6530612244898,
"alnum_prop": 0.644375,
"repo_name": "jboss-openshift/cct_module",
"id": "56ead40884965e4df399254827b45ee1e18b2094",
"size": "1623... |
from __future__ import unicode_literals
import re
import sys
from django.conf import settings
from django.template import (Node, Variable, TemplateSyntaxError,
TokenParser, Library, TOKEN_TEXT, TOKEN_VAR)
from django.template.base import render_value_in_context
from django.template.defaulttags import token_kwargs
... | {
"content_hash": "86b0bcb5695eb9335bcf19ff37c3f94f",
"timestamp": "",
"source": "github",
"line_count": 488,
"max_line_length": 117,
"avg_line_length": 35.35450819672131,
"alnum_prop": 0.602445951428737,
"repo_name": "ZhaoCJ/django",
"id": "bce10b9de6f1904f624422aea93b4f9240d38f0b",
"size": "17253"... |
import unittest
from os import path
from integration.pegasus.test_helper import get_channel
from pyprobe import SensorError
from pyprobe.sensors.pegasus.sensor_phy_drive import PegasusPhysicalDriveSensor
FAKE_UTIL = path.join(path.dirname(__file__), 'pegasus.py')
NO_CONTROLLERS = path.join(path.dirname(__file__), 'n... | {
"content_hash": "93a6fdc65d152a49b38b5150ddcb3710",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 115,
"avg_line_length": 52,
"alnum_prop": 0.703125,
"repo_name": "dittert/pyprobe",
"id": "312cb15020c80a59f54baa2d702813c6ee517dc0",
"size": "3346",
"binary": false,
"... |
from network import LoRa
import time
import binascii
import socket
import struct
APP_EUI = 'AD A4 DA E3 AC 12 67 6B'
APP_KEY = '11 B0 28 2A 18 9B 75 B0 B4 D2 D8 C7 FA 38 54 8B'
DEV_ADDR = '00 00 00 0A'
NWK_SWKEY = '2B 7E 15 16 28 AE D2 A6 AB F7 15 88 09 CF 4F 3C'
APP_SWKEY = '2B 7E 15 16 28 AE D2 A6 AB F7 15 88 09 C... | {
"content_hash": "1ba9e12125966d6f5aea2a30d57bf09d",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 112,
"avg_line_length": 41.36046511627907,
"alnum_prop": 0.5094180489176272,
"repo_name": "Xykon/pycom-micropython-sigfox",
"id": "08f2a645d3bfcadb22542aa142786e29b0b53ecf",
... |
"""
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Written (W) 2095-2010 Andre Kahles
Copyright (C) 2009-2010 by... | {
"content_hash": "c94190053384ed6f63bd6b328394755e",
"timestamp": "",
"source": "github",
"line_count": 297,
"max_line_length": 225,
"avg_line_length": 38.696969696969695,
"alnum_prop": 0.5605150961454799,
"repo_name": "ratschlab/RNA-geeq",
"id": "9b554a43a71a552d9fca008fe02ddf826d4f4ccb",
"size": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.