text stringlengths 4 1.02M | meta dict |
|---|---|
from setuptools import setup
setup(name='learningml',
version='0.3',
description='This repository demonstrates how to make a project pip installable, write a Python module in C and use scikit-learn, keras and spearmint.',
url='https://github.com/weissercn/learningml',
author='Constantin Weisser... | {
"content_hash": "d50f0e0f21933631ac1dd149c2f1d088",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 158,
"avg_line_length": 32.705882352941174,
"alnum_prop": 0.6187050359712231,
"repo_name": "weissercn/learningml",
"id": "72bc8fa0b6e920aa6bfabbd030a60a5584c2cc6a",
"size":... |
import pytest
from .config import *
@pytest.fixture
def app():
main.app.config["TESTING"] = True
main.app.config["SQLALCHEMY_DATABASE_URI"] = TEST_DATABASE_URI
main.db.create_all()
return main.app
@pytest.fixture
def test_client(app):
return app.test_client()
def test_hello(test_client):
a... | {
"content_hash": "39385a8c95297978a95a97268793130d",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 92,
"avg_line_length": 29.385826771653544,
"alnum_prop": 0.6543408360128617,
"repo_name": "JungWinter/yellowid-flask",
"id": "1a8683fdb1d1d0da7e6efa1309788057c6bec6c6",
"s... |
"""Exception types that can be raised by Gnuplot.py."""
class Error(Exception):
"""All our exceptions are derived from this one."""
pass
class OptionError(Error):
"""Raised for unrecognized option(s)"""
pass
class DataError(Error):
"""Raised for data in the wrong format"""
pass
| {
"content_hash": "6a353aae5d824d5fcade124df1fe05db",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 55,
"avg_line_length": 17.27777777777778,
"alnum_prop": 0.6591639871382636,
"repo_name": "pombredanne/ompc",
"id": "0a4e27f2f312c23032ba09cf9f2f31160f7c8835",
"size": "546"... |
from cgum.utility import *
from cgum.program import Program
import codecs
import json
import tempfile
from subprocess import Popen
class Mappings(object):
@staticmethod
def from_json(jsn):
before_to_after = dict()
after_to_before = dict()
for m in jsn:
src = int(m['src'])
... | {
"content_hash": "4b520ed7758377cbbd6eccefe784bd7b",
"timestamp": "",
"source": "github",
"line_count": 288,
"max_line_length": 81,
"avg_line_length": 32.763888888888886,
"alnum_prop": 0.5922000847816872,
"repo_name": "ChrisTimperley/PythonCGum",
"id": "2fe555bf3f8a8e05534d9f0d5bda5368d0a72daa",
"s... |
from importlib import import_module
from django.apps import apps
from django.core.management.base import BaseCommand, CommandError
from django.core.management.color import no_style
from django.core.management.sql import emit_post_migrate_signal, sql_flush
from django.db import DEFAULT_DB_ALIAS, connections
class Com... | {
"content_hash": "90e534a92002b3ee5fb56d648f41b877",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 92,
"avg_line_length": 43.78048780487805,
"alnum_prop": 0.6072423398328691,
"repo_name": "edmorley/django",
"id": "f6ae83940a534c18bf9029f0ba7b1f023ab296c2",
"size": "3590"... |
import sys
try:
pyreadline_codepage=sys.stdout.encoding
except AttributeError: #This error occurs when pdb imports readline and doctest has replaced
#stdout with stdout collector
pyreadline_codepage="ascii" #assume ascii codepage
def ensure_unicode(text):
... | {
"content_hash": "958a00912cca2a40159f723b2cf16283",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 100,
"avg_line_length": 34.95,
"alnum_prop": 0.6666666666666666,
"repo_name": "chvrga/outdoor-explorer",
"id": "f33fa099c5dec12401b6f5ceb82eadbca9244350",
"size": "1101",
... |
'''
Copyright 2016, EMC, Inc.
Author(s):
George Paulos
'''
import fit_path # NOQA: unused import
import os
import sys
import subprocess
import fit_common
# Select test group here using @attr
from nose.plugins.attrib import attr
@attr(all=True, regression=True, smoke=True)
class redfish10_api_schemas(fit_common.un... | {
"content_hash": "7e356ed80a96ad8b74672ea424d8bed3",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 133,
"avg_line_length": 38.2,
"alnum_prop": 0.6581899775617053,
"repo_name": "srinia6/RackHD",
"id": "e7a5d35027b92f8db95233e5cc363cb44660581f",
"size": "1337",
"binary":... |
import os
import pytest
import sh
from molecule.verifier import testinfra
@pytest.fixture()
def testinfra_instance(molecule_instance):
return testinfra.Testinfra(molecule_instance)
@pytest.fixture
def patched_code_verifier(mocker):
return mocker.patch('molecule.verifier.testinfra.Testinfra._flake8')
@py... | {
"content_hash": "8ce4f32a7d8860c4cb03b63187b05daa",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 79,
"avg_line_length": 30.01123595505618,
"alnum_prop": 0.6918757019842755,
"repo_name": "rgreinho/molecule",
"id": "16a8b596be2567f267fb41cd2ca03201a6d5033b",
"size": "379... |
#!/usr/bin/env python2.7
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this li... | {
"content_hash": "b9839defc6fdd22f2647e471d0976351",
"timestamp": "",
"source": "github",
"line_count": 502,
"max_line_length": 199,
"avg_line_length": 31.878486055776893,
"alnum_prop": 0.6082609510716741,
"repo_name": "soltanmm-google/grpc",
"id": "0374cf75a1a17c548b950d6f71bba83c71fd5572",
"size"... |
from django.core.urlresolvers import reverse, NoReverseMatch
class Menu:
submenus = ()
def shown(self):
"""
All menus are shown by default.
Override this method to implement custom behavior.
"""
return True
def url(self):
"""
Try to reverse `url_na... | {
"content_hash": "784a1cde4960df8d37f6f3744df63bd8",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 72,
"avg_line_length": 26.944444444444443,
"alnum_prop": 0.5474226804123712,
"repo_name": "hatchrbr/django-alacarte",
"id": "35ecea45a2ad8ec9aea85bd6adb32ba3761b5f67",
"siz... |
import os
import sys
import pytest
import glob
import json
import numpy as np
import sh
def assert_close(current, expected):
np.testing.assert_allclose(current, expected, atol=1e-2, rtol=1e-2)
def check_reference_feature_json(output, reference_file):
"""Compare JSON to a reference using knowledge about it... | {
"content_hash": "44dde8a216e3be22f2cd3398ef77502d",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 79,
"avg_line_length": 36.91954022988506,
"alnum_prop": 0.6080323785803238,
"repo_name": "Don86/microscopium",
"id": "e3176da463b92e2216ea3e24c1dc0ec2ea0700e5",
"size": "32... |
from __future__ import absolute_import, division, print_function
from functools import partial
import tensorflow as tf
import tensorflow_probability as tfp
from tensorflow.python import keras
from tensorflow.python.ops import init_ops_v2
from odin.backend.alias import (parse_activation, parse_constraint,
... | {
"content_hash": "42dc056b40ba1d7cabf31766a438a03c",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 78,
"avg_line_length": 33.75423728813559,
"alnum_prop": 0.627165453175998,
"repo_name": "imito/odin",
"id": "df53aa983f69dbcda304fc22e3ee2239f80e0b5a",
"size": "3983",
"... |
import socket,sys
host = ''
port = 55055
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((host, port))
s.listen(1)
print "Server is running on port %d; press Ctrl-C to terminate." % port
clientsock,addr = s.accept()
recvfromclientbuf = clientsock... | {
"content_hash": "3fe24d441721377125375deddb98b05a",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 71,
"avg_line_length": 24.772727272727273,
"alnum_prop": 0.710091743119266,
"repo_name": "NineLamas/pwq",
"id": "f66e987de00cd5d5962450f556b844dd77a5b539",
"size": "579",
... |
import arcpy, collections
from Parcel import Parcel
from LegacyCountyStats import *
import json
import webbrowser
from ConfigParser import ConfigParser
class Summary:
def __init__(self):
pass #placeholder
def writeSummaryTxt(Summary,outDirTxt,outName,totError,outPage,outJSON):
try:
Validation_JSON = {
'... | {
"content_hash": "c0916fab353a4477b0d352fe5d5ea8b5",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 368,
"avg_line_length": 72.08203125,
"alnum_prop": 0.6737115916111202,
"repo_name": "WIStCart/V3ValidationTool",
"id": "c539b9b5f5001beb478e46100e6c279a5f57a71d",
"size": ... |
import logging
import time
from parsl.providers.kubernetes.template import template_string
logger = logging.getLogger(__name__)
from parsl.providers.error import *
from parsl.providers.provider_base import ExecutionProvider
from parsl.utils import RepresentationMixin
try:
from kubernetes import client, config
... | {
"content_hash": "1f2fb18bcaba1d7f8b3c537078073bae",
"timestamp": "",
"source": "github",
"line_count": 302,
"max_line_length": 114,
"avg_line_length": 39.86423841059602,
"alnum_prop": 0.551540825649971,
"repo_name": "swift-lang/swift-e-lab",
"id": "070acefb78aceb6116e7f5dcc9c3f27b1b281405",
"size"... |
"""
Based on script by CCL Forensics
"""
import sys
import os
import os.path as path
sys.path.append('/usr/local/munki/munkireportlib')
import re
import ccl_asldb
import json
import platform
# Event Type strings to array position logformat 1
EVENTS = { 'filesharing.sessions.afp': 0,
'filesharing.sessions... | {
"content_hash": "a1d9e1078844d99b84063e3a50f7b3eb",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 98,
"avg_line_length": 33.48,
"alnum_prop": 0.48845081640780563,
"repo_name": "poundbangbash/munkireport-php",
"id": "a7e6ca4cd5305025d8a8f76581ef9503e3781e1c",
"size": "5... |
import os
import dj_database_url
from decouple import config
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
ALLOWED_HOSTS = ['*']
SECRET_KEY = config('SECRET_KEY')
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# Application definition
DATABASES = {
'... | {
"content_hash": "0aebfb2cf3ff0a2b419e07adb58ec63f",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 87,
"avg_line_length": 24.402298850574713,
"alnum_prop": 0.6655675930287329,
"repo_name": "citiufpe/citi-webplate",
"id": "dbb34b5ec58e2c241a5953e57c1b6f7ec7002936",
"size"... |
'''
This module checks if all Glassfish servers are running
and if the SPECjEnterprise2010 application is running
'''
from twisted.internet import reactor
from twisted.web.client import Agent
from twisted.web.http_headers import Headers
from twisted.internet.protocol import Protocol
from twisted.internet.defer import D... | {
"content_hash": "05ff6e3558fe4ba62c4a3d8987d9fe09",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 82,
"avg_line_length": 26.571428571428573,
"alnum_prop": 0.5962365591397849,
"repo_name": "jacksonicson/paper.IS2015",
"id": "d04e44de3c5dbe687f88e3af264f3f51d84780fd",
"si... |
from CIM15.IEC61970.Core.IdentifiedObject import IdentifiedObject
class Hazard(IdentifiedObject):
"""A hazard is any object or condition that is a danger for causing loss or perils to an asset and/or people. Examples of hazards are trees growing under overhead power lines, a park being located by a substation (i.e... | {
"content_hash": "2b9ac37e49624bfb74645f2feb387ead",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 703,
"avg_line_length": 41.71666666666667,
"alnum_prop": 0.6448262085497403,
"repo_name": "rwl/PyCIM",
"id": "9903c50a77abee654f273c792bec0822d694fae6",
"size": "3603",
"... |
from typing import Any, TYPE_CHECKING
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from .._version import VERSION
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
class AzureDigit... | {
"content_hash": "ed7169e21f4a1a43a3206a93b14c3060",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 134,
"avg_line_length": 47.64912280701754,
"alnum_prop": 0.7106038291605302,
"repo_name": "Azure/azure-sdk-for-python",
"id": "1be0c6b5217f4db50223dba5d6133ab76df92204",
"s... |
"""The tests for the counter component."""
# pylint: disable=protected-access
import asyncio
import logging
from homeassistant.core import CoreState, State, Context
from homeassistant.setup import async_setup_component
from homeassistant.components.counter import (
DOMAIN, CONF_INITIAL, CONF_RESTORE, CONF_STEP, CO... | {
"content_hash": "862bf606d3ef0b473f04497427130a01",
"timestamp": "",
"source": "github",
"line_count": 245,
"max_line_length": 75,
"avg_line_length": 26.151020408163266,
"alnum_prop": 0.606524114250039,
"repo_name": "jamespcole/home-assistant",
"id": "97a39cdeb73b46b61e5761cbce842a9372052d1b",
"si... |
import sqlite3
from datetime import datetime
from pprint import pprint
import sys
import os
from datetime import datetime
import pickle
import hk_new
start_analysis_at = datetime.strptime('20120406','%Y%m%d')
end_analysis_at = datetime.strptime('20120531','%Y%m%d')
conn = sqlite3.connect('C:/projects/dbs/SP2_data.db... | {
"content_hash": "4ac22a71486e761daad94d016a13bda9",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 76,
"avg_line_length": 22.895238095238096,
"alnum_prop": 0.6830282861896838,
"repo_name": "annahs/atmos_research",
"id": "98bb4c169488140869105af9d5557716122d54ed",
"size"... |
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_wall = False
... | {
"content_hash": "a11e3dc326d8dbfedffa1698c2c4cc27",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 105,
"avg_line_length": 40.38028169014085,
"alnum_prop": 0.6236484129752354,
"repo_name": "magacoin/magacoin",
"id": "138d6a2232365fb43b3adf2e56508ee43f8f5117",
"size": "31... |
from traductor.translators.base import BaseTranslator
class Cpuset(BaseTranslator):
"""
"""
def translate(self, value):
"""
:param value:
:return:
"""
if not value:
return ""
return "--cpuset-cpus=%s" % value | {
"content_hash": "c358a1cd826bbda362c71328d65c31aa",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 53,
"avg_line_length": 18.866666666666667,
"alnum_prop": 0.5229681978798587,
"repo_name": "the0rem/traductor",
"id": "cf25b0193f72c7f0891918a0ecad99f2e4a3ddb4",
"size": "28... |
"""Implements commands for running blink web tests."""
import os
import subprocess
from argparse import Namespace
from typing import Optional
from common import DIR_SRC_ROOT
from test_runner import TestRunner
_BLINK_TEST_SCRIPT = os.path.join(DIR_SRC_ROOT, 'third_party', 'blink',
'... | {
"content_hash": "77e0fe9927d48bbc2b39cda64dce351d",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 78,
"avg_line_length": 30.454545454545453,
"alnum_prop": 0.6348258706467662,
"repo_name": "chromium/chromium",
"id": "44ffc5f45b1ac86a08492b261f2138fd32570660",
"size": "11... |
from keystone.tests.unit.ksfixtures.auth_plugins import ConfigAuthPlugins # noqa
from keystone.tests.unit.ksfixtures.backendloader import BackendLoader # noqa
from keystone.tests.unit.ksfixtures.cache import Cache # noqa
from keystone.tests.unit.ksfixtures.key_repository import KeyRepository # noqa
from keystone.te... | {
"content_hash": "8b3265926234f72498cc5082e2b70251",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 81,
"avg_line_length": 73.8,
"alnum_prop": 0.8319783197831978,
"repo_name": "cernops/keystone",
"id": "eb30572ca9aa9f49265932b0c75ad59d5ccfd087",
"size": "915",
"binary": ... |
import _plotly_utils.basevalidators
class UidValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="uid", parent_name="densitymapbox", **kwargs):
super(UidValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit... | {
"content_hash": "b589beabcdfb978eec570ce4cb8c3b82",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 81,
"avg_line_length": 36.25,
"alnum_prop": 0.6022988505747127,
"repo_name": "plotly/python-api",
"id": "7a70dc6221611b0905e60a4f4b6895199c19115a",
"size": "435",
"binary... |
import masterPlugin
import MatrixUtils
## Wrapper for MatrixUtils.paint()
class paint(masterPlugin.masterPlugin):
def __init__(this):
super().__init__()
this.command = "paint"
this.aliases = None
this.commandInfo = {'requiredArguments': [[0, int, 'col1'],
[1, int, 'row... | {
"content_hash": "ebc386b3b55bb21ba617130b42969bb2",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 80,
"avg_line_length": 35.24390243902439,
"alnum_prop": 0.5515570934256055,
"repo_name": "charlesdaniels/hercm",
"id": "018f4e7b2cb884d6735f945e0bf46422edc1279e",
"size": "... |
import requests
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from django.test import LiveServerTestCase
class LoginTestCase(LiveServerTestCase):
@override_settings(DEBUG=True)
def test_login(self):
response = requests.get(self.live_server_url + reverse(... | {
"content_hash": "342d18b36bd67123ff09ff4c4a8240b0",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 77,
"avg_line_length": 29.846153846153847,
"alnum_prop": 0.7654639175257731,
"repo_name": "fjsj/liveservererror",
"id": "18880de85cee19c089578955f1e69283379932c3",
"size": ... |
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource ... | {
"content_hash": "4bfc0d6578cf76cfe42cf4b6a2321272",
"timestamp": "",
"source": "github",
"line_count": 511,
"max_line_length": 192,
"avg_line_length": 36.76320939334638,
"alnum_prop": 0.620142659427233,
"repo_name": "tysonholub/twilio-python",
"id": "575ee7a68bc9ad4032d1cf483e0031a80a8a2ee7",
"siz... |
"""
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
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.a... | {
"content_hash": "e27ac799f08c4ab04bfe005b4a03e905",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 76,
"avg_line_length": 24.568627450980394,
"alnum_prop": 0.6927374301675978,
"repo_name": "detiber/lib_openshift",
"id": "038c6460f87713748023f91017bd31c73e13852f",
"size":... |
import os
# Variables
__author__ = "Rodrigo 'ItsPaper' Muรฑoz"
__authoremail__ = "Rodrigo.mcuadrada@gmail.com"
__version__ = "Alpha"
# Functions
def welcome():
print("Welcome to IMES: Itspaper's Message Encryption System!")
print("Made by: {}. You are using Version: {}".format(__author__, __version__))
de... | {
"content_hash": "42284388206d72dbb4274f097171f2c6",
"timestamp": "",
"source": "github",
"line_count": 303,
"max_line_length": 85,
"avg_line_length": 24.31023102310231,
"alnum_prop": 0.5054303556882976,
"repo_name": "ItsPapermunoz/IMES",
"id": "13cc116f7a880c8288ca17052b5e0f27cee1cdd9",
"size": "7... |
import sys
import os
from gi.repository import GLib
realpath = GLib.get_current_dir()
sys.path.append(realpath + '/Modules/')
sys.path.append(realpath + '/Apps/')
from Apps.MenuBar import MenuBar
from Apps.AppsWindow import AppsWindow
os.system('python MenuBar_main.py &')
os.system('python AppsWindow_main.py &')
| {
"content_hash": "23b1f2d9b3a836f7ff1f6f8e4104adb2",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 40,
"avg_line_length": 21.266666666666666,
"alnum_prop": 0.7523510971786834,
"repo_name": "OlivierLarrieu/HYDV2",
"id": "176cb617655d1c820c4740bb0a34feec3cf4ba0e",
"size": ... |
"""
Formatting and style flags for ecstasy.
"""
from enum import Enum, unique
import ecstasy.errors as errors
LIMIT = 0
class Hack(object):
"""
A hack namespace to make enumeration work continuously
across multiple flag enum-classes. 'last' will be
set to the last enumerated enum-class and
start to the value a... | {
"content_hash": "a1e965662c0b4d1c8c5d53a97f635e1a",
"timestamp": "",
"source": "github",
"line_count": 233,
"max_line_length": 71,
"avg_line_length": 20.549356223175966,
"alnum_prop": 0.6741854636591479,
"repo_name": "goldsborough/ecstasy",
"id": "b797db7c168fd6ea70cedac286a6873958f2fd07",
"size":... |
"""Utility to package and upload the USB gadget framework.
"""
import argparse
import hashlib
import io
import os
import zipfile
try:
from urllib.request import Request, urlopen
except ImportError: # For Py2 compatibility
from urllib2 import Request, urlopen
def MakeZip(directory=None, files=None):
"""Const... | {
"content_hash": "f689a25cae010e34bb627b6dcb1b9c57",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 69,
"avg_line_length": 25.821052631578947,
"alnum_prop": 0.6498165511618427,
"repo_name": "chromium/chromium",
"id": "cfb6efeb16048705e4a7d699fc2a96386d88b65b",
"size": "26... |
from os.path import join
from gtts import gTTS
from newspaper import Article
def make_an_audio(url, filename, lang=None):
if lang is None:
lang = 'en'
article = Article(url)
article.download()
article.parse()
tts = gTTS(text=article.text, lang=lang)
f = open(join('audio', filename), ... | {
"content_hash": "4527edc1d6b12e6a63108d3aa7a0c060",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 44,
"avg_line_length": 21.352941176470587,
"alnum_prop": 0.6391184573002755,
"repo_name": "Fillll/pockebot",
"id": "4657e4f5fcf9bfa948958fbc98911fb96cc19472",
"size": "380"... |
"""Accesses the google.cloud.language.v1beta2 LanguageService API."""
import collections
import json
import os
import pkg_resources
import platform
from google.gax import api_callable
from google.gax import config
from google.gax import path_template
import google.gax
from google.cloud.gapic.language.v1beta2 import ... | {
"content_hash": "aa934338fc89dc39c893d7b6d12cf22a",
"timestamp": "",
"source": "github",
"line_count": 298,
"max_line_length": 167,
"avg_line_length": 46.31208053691275,
"alnum_prop": 0.6477066879211651,
"repo_name": "calpeyser/google-cloud-python",
"id": "0150ca4f4b8378c81bec5efd9ad6acb8a72ac90c",
... |
import os
import sys
import string
import xml.etree.ElementTree as etree
from xml.etree.ElementTree import SubElement
from utils import _make_path_relative
from utils import xml_indent
fs_encoding = sys.getfilesystemencoding()
def _get_filetype(fn):
if fn.rfind('.cpp') != -1 or fn.rfind('.cxx') != -1:
re... | {
"content_hash": "b5138e33af993a247d3a4d62f28ed1c0",
"timestamp": "",
"source": "github",
"line_count": 435,
"max_line_length": 139,
"avg_line_length": 33.08735632183908,
"alnum_prop": 0.5827138192176753,
"repo_name": "RT-Thread/rt-thread",
"id": "0405eb0b1b540105741e4cb74ba96bede11017ce",
"size": ... |
import warnings
import pandas as pd
import pyspark
import pyspark as ps
from pyspark.sql.column import Column
import ibis.common.exceptions as com
import ibis.expr.schema as sch
import ibis.expr.types as types
from ibis.backends.base.sql import BaseSQLBackend
from ibis.backends.base.sql.ddl import (
CreateDatabas... | {
"content_hash": "f48f808fc022d8f5e7581282fdfd5c50",
"timestamp": "",
"source": "github",
"line_count": 530,
"max_line_length": 116,
"avg_line_length": 30.39245283018868,
"alnum_prop": 0.5724484728085424,
"repo_name": "cloudera/ibis",
"id": "86b1f125661bf95b48ce63a9b48e679ba2b5d658",
"size": "16108... |
def game_log(text):
global log
# Create the log if it does not exist
try:
log
except NameError:
log = []
log.append(text)
def get_game_log_html():
global log
try:
return '<br>'.join(log)
except NameError:
return 'The game has not yet begun!'
| {
"content_hash": "b0df6782a3b3a3555c019db8508f16b7",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 44,
"avg_line_length": 20.466666666666665,
"alnum_prop": 0.5667752442996743,
"repo_name": "robertecurtin/plutos-envy",
"id": "a05d9070c3e14c22d74f080855cf8807f6d6779f",
"si... |
import json
from datetime import datetime, timedelta
from unittest import mock
import redis
import responses
from django.conf import settings
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.utils.timezone import get_current_timezone, now
from mockredis import mock_redis_clie... | {
"content_hash": "ecb54e44e2926564950858e2ed012883",
"timestamp": "",
"source": "github",
"line_count": 616,
"max_line_length": 100,
"avg_line_length": 45.300324675324674,
"alnum_prop": 0.5979931911843755,
"repo_name": "frigg/frigg-hq",
"id": "7f9aad0bea49adc6197a2546cf9c1f1dcf825eb6",
"size": "279... |
"""Utility functions (file reading, simple IDL parsing by regexes) for IDL build.
Design doc: http://www.chromium.org/developers/design-documents/idl-build
"""
import os
import cPickle as pickle
import re
import string
import subprocess
KNOWN_COMPONENTS = frozenset(['core', 'modules'])
KNOWN_COMPONENTS_WITH_TESTING... | {
"content_hash": "20502e8e1837bcf7ac0bd9704c8caa03",
"timestamp": "",
"source": "github",
"line_count": 373,
"max_line_length": 108,
"avg_line_length": 34.48793565683646,
"alnum_prop": 0.6442786069651741,
"repo_name": "Pluto-tv/blink-crosswalk",
"id": "7c89a62c40a9aca51392148b2c07f397b7fadd8f",
"si... |
"""
Python library for interacting with the T1 API. Uses third-party module Requests
(http://docs.python-requests.org/en/latest/) to get and post data, and ElementTree
to parse it.
"""
from __future__ import absolute_import
from .utils import filters
from .service import T1, T1Service
from . import errors
from .metada... | {
"content_hash": "a5cffeb7cf0728dc505294580b74753e",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 82,
"avg_line_length": 35.57142857142857,
"alnum_prop": 0.6626506024096386,
"repo_name": "Cawb07/t1-python",
"id": "d3291d90c19ba42f76c708ed8f495be930f0e82b",
"size": "522"... |
from django.db import models
from django import forms
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from sorl.thumbnail import ImageField as SorlImageField
from .utils.urls import is_absolute_url
import os
from uuid import uuid4
class SlugURLValidator(ob... | {
"content_hash": "575f3326d4d9ed6789f9ddd3d089af7c",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 120,
"avg_line_length": 28.87912087912088,
"alnum_prop": 0.7256468797564688,
"repo_name": "kimus/django-blocks",
"id": "18394bb0254d77cffc2246678c4d888fa0990c3a",
"size": "... |
"""WSGI application initialization for Nova APIs."""
import os
import sys
from oslo_config import cfg
from oslo_log import log as logging
from oslo_reports import guru_meditation_report as gmr
from oslo_reports import opts as gmr_opts
from oslo_service import _options as service_opts
from paste import deploy
from no... | {
"content_hash": "a9bb7b47fe6f088d34075916eb9a2b33",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 79,
"avg_line_length": 33.60629921259842,
"alnum_prop": 0.6747891283973758,
"repo_name": "mahak/nova",
"id": "d60069ce844f91a3f68626e02873f7e74ce11622",
"size": "4840",
... |
from indico_piwik.piwik import PiwikRequest
class PiwikQueryBase:
"""Base Piwik query"""
def __init__(self, query_script):
from indico_piwik.plugin import PiwikPlugin
self.request = PiwikRequest(server_url=PiwikPlugin.settings.get('server_api_url'),
site_id... | {
"content_hash": "c02915ce0e53008e24a82ea2e73c0560",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 96,
"avg_line_length": 38.1551724137931,
"alnum_prop": 0.6095797559873475,
"repo_name": "indico/indico-plugins",
"id": "ce00289a41adb8350b03a1ffcfacee1b4d014b5e",
"size": "... |
import discord
from discord.ext import commands
from . import switch, wiiu_support, wiiu_results, ctr_support, ctr_results
class Results(commands.Cog):
"""
Parses game console result codes.
"""
def fetch(self, error):
if ctr_support.is_valid(error):
return ctr_support.get(error)
... | {
"content_hash": "025cc2200cec708e126ce8fbe2d2dfdb",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 89,
"avg_line_length": 33.32692307692308,
"alnum_prop": 0.5779572994806693,
"repo_name": "ihaveamac/Kurisu",
"id": "b14c001e3de600d07ad43cd889404f94a6525365",
"size": "866... |
"""
Created on 10 October 2017
@author: Ashiv Dhondea
"""
import matplotlib.pyplot as plt
from matplotlib import rc
rc('font', **{'family': 'serif', 'serif': ['Helvetica']})
rc('text', usetex=True)
params = {'text.latex.preamble' : [r'\usepackage{amsmath}', r'\usepackage{amssymb}']}
plt.rcParams.update(param... | {
"content_hash": "357c16b8df0db39294a0b7dceedd8bc8",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 225,
"avg_line_length": 37.94047619047619,
"alnum_prop": 0.6655161593975526,
"repo_name": "AshivDhondea/SORADSIM",
"id": "d82c4824af3e15e4361bd473db883504c625cb44",
"size":... |
import nose
import nose.config
import sys
from nose.plugins.manager import DefaultPluginManager
c = nose.config.Config()
c.plugins=DefaultPluginManager()
c.srcDirs = ['package']
if not nose.run(config=c):
sys.exit(1)
| {
"content_hash": "f8ccf00ea1a479cf935c80c2c4799f85",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 53,
"avg_line_length": 24.555555555555557,
"alnum_prop": 0.7692307692307693,
"repo_name": "QualiSystems/Azure-Shell",
"id": "4603b5825375bef098ce51681e7fc427691dbcbc",
"size... |
from page_get.basic import get_page
from decorators.decorator import parse_decorator
import json
def get_followers_list_return(uid, page):
followers_wb_temp_url = 'https://m.weibo.cn/api/container/getIndex?containerid={}_-_followers_-_{}&luicode={}&lfid={}&featurecode={}&type=uid&value={}&page={}'
container... | {
"content_hash": "684f173ad982360735506278618ae086",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 160,
"avg_line_length": 31.408163265306122,
"alnum_prop": 0.6185834957764782,
"repo_name": "KingOfBanana/SocialNetworkAI",
"id": "5fd328de0adac4465d7ad45c404c612df65d17d4",
... |
''' Dummy NFC Provider to be used on desktops in case no other provider is found
'''
from . import NFCBase
from kivy.clock import Clock
from kivy.logger import Logger
class ScannerDummy(NFCBase):
'''This is the dummy interface that gets selected in case any other
hardware interface to NFC is not available.
... | {
"content_hash": "2bb9b41de14902b3e508b98930b3f9e9",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 80,
"avg_line_length": 28.384615384615383,
"alnum_prop": 0.5962059620596206,
"repo_name": "asfin/electrum",
"id": "a0d3e2643ecfa1bb0cf1b96d1eb57ee4b32e4ba9",
"size": "1476"... |
"""
Utility functions for the random forest classifier.
@copyright: The Broad Institute of MIT and Harvard 2015
"""
import numpy as np
import pandas as pd
import pickle
"""Return a function that gives a prediction from a design matrix row
"""
def gen_predictor(params_filename="./models/test/scikit_randf-params"):
... | {
"content_hash": "64abc86f6ae3f8c3210c446d370c09b0",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 71,
"avg_line_length": 24.428571428571427,
"alnum_prop": 0.6939571150097466,
"repo_name": "broadinstitute/ebola-predictor",
"id": "fddaf290dfd65572262aecbb7f977fbe9ce7b774",
... |
import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extens... | {
"content_hash": "d08d30d9bcd102d6e6337cb6c6972880",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 79,
"avg_line_length": 30.576158940397352,
"alnum_prop": 0.6647173489278753,
"repo_name": "jic-dtool/dtool-create",
"id": "13b3a695694e95a60da400ead0e0379607f5e93c",
"size... |
import sys
import time
from websocket import create_connection
from json import *
if(len(sys.argv)< 2):
print "test requires sitename: python testWebSocketOperations_server.py <url>"
sys.exit(2)
site = sys.argv[1]
ws = create_connection("ws://"+site)
#-----------------------------------------------------------------... | {
"content_hash": "6a34e3bc82ebfd85d9bcf1eec0b081e4",
"timestamp": "",
"source": "github",
"line_count": 1275,
"max_line_length": 129,
"avg_line_length": 36.199215686274506,
"alnum_prop": 0.5418598604671317,
"repo_name": "oncoscape/Oncoscape",
"id": "ebfef96c68a609c1e0b4294a8243ccb5dc8ef923",
"size"... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Stream.running'
db.add_column(u'twitter_stream', 'running',
self.gf('django.db.models.fields.B... | {
"content_hash": "ee019928cdcc5885b56a84c57ef50ce8",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 146,
"avg_line_length": 63.28395061728395,
"alnum_prop": 0.5446742099102614,
"repo_name": "chalkchisel/django-social-stream",
"id": "44efd4696f7af4a64849bdc8d0c1e2996c8c4c3e"... |
import json
import requests
url = 'https://api.github.com/search/issues?q=is:issue+label:official-cve-feed+\
state:closed+repo:kubernetes/kubernetes&per_page=100'
headers = {'Accept': 'application/vnd.github.v3+json'}
res = requests.get(url, headers=headers)
gh_items = res.json()['items']
# Use link header to iterate... | {
"content_hash": "e6f56ee4e166d8fd7f4cf3153343c75b",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 82,
"avg_line_length": 37.88,
"alnum_prop": 0.6325237592397043,
"repo_name": "kubernetes/sig-security",
"id": "f51733b61e4826f5463031c0a6a684886c0388cc",
"size": "2506",
... |
def extractWanderingtranslationsWordpressCom(item):
'''
Parser for 'wanderingtranslations.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
if "WATTT" in item['tags']:
return buildReleaseMessage... | {
"content_hash": "1d960d35dd35b75571e008f562915fb9",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 89,
"avg_line_length": 28.428571428571427,
"alnum_prop": 0.7361809045226131,
"repo_name": "fake-name/ReadableWebProxy",
"id": "6d7696bf0dc80fff4610cb4c847477f951ac83fe",
"s... |
"""
[env]
# Conda Environment
conda create --name automate_po_job python=3.9.7
conda info --envs
source activate automate_po_job
conda deactivate
# if needed to remove
conda env remove -n [NAME_OF_THE_CONDA_ENVIRONMENT]
[path]
cd /Users/brunoflaven/Documents/03_git/BlogArticlesExamples/automate_po_job_demo_support/00... | {
"content_hash": "7d36e388e34683e746fc5d3fe3fd1dbd",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 104,
"avg_line_length": 19.633333333333333,
"alnum_prop": 0.7357102433503112,
"repo_name": "bflaven/BlogArticlesExamples",
"id": "8e61a111db1fa7c2d50f953236b0747feb048f90",
... |
import re
import nltk
from . import tokenizers as tok
from . import summary as summ
# mod = moderate
def mod_max_unit_func(unit_num):
return 5 * unit_num ** (1/12)
class Document(object):
def __init__(self, filename=None, text=None,
max_unit_func=lambda x: 5*x**(1/12)):
self.filena... | {
"content_hash": "304505903601d16e0590f4d5ece9ecf8",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 89,
"avg_line_length": 31.094488188976378,
"alnum_prop": 0.5292479108635098,
"repo_name": "euirim/maple",
"id": "550d577e5244d5d6bb583b62ee1d267452031720",
"size": "3949",... |
from decorator import decorate
def get_recorder(spy, attribute, context):
decorator_map = {
'function': FunctionRecorder(spy),
'instance_method': InstanceMethodRecorder(spy),
'class_method': ClassMethodRecorder(spy),
'static_method': StaticMethodRecorder(spy)
}
return deco... | {
"content_hash": "6b3eedee624cf367267157e89a35e7fd",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 55,
"avg_line_length": 21.89830508474576,
"alnum_prop": 0.5928792569659442,
"repo_name": "bywires/chara",
"id": "3c4345cabdf03f552ca311d2a4b36af04b12c7a9",
"size": "1292",
... |
from bilanci.tree_dict_models import deep_sum
from bilanci.utils import couch, nearly_equal
from bilanci.utils.comuni import FLMapper
from django.test import TestCase
from django.core.management import BaseCommand
from django.conf import settings
from collections import OrderedDict
from optparse import make_option
im... | {
"content_hash": "564c55a3bf2e0fe47cd53c0bd79db39f",
"timestamp": "",
"source": "github",
"line_count": 447,
"max_line_length": 199,
"avg_line_length": 46.982102908277405,
"alnum_prop": 0.5337364887386314,
"repo_name": "DeppSRL/open_bilanci",
"id": "f211fdadcfdfb098605f027d557a031674bd5f8c",
"size"... |
import socket
from test_framework.socks5 import Socks5Configuration, Socks5Command, Socks5Server, AddressType
from test_framework.test_framework import NavCoinTestFramework
from test_framework.util import *
from test_framework.netutil import test_ipv6_local
'''
Test plan:
- Start navcoind's with different proxy config... | {
"content_hash": "89eea0ba37c799e0d600cba1ffc83baa",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 146,
"avg_line_length": 42.584210526315786,
"alnum_prop": 0.6051167964404894,
"repo_name": "navcoindev/navcoin-core",
"id": "3e0a6f50f4f8958f925250c65e6bd3e4f774041e",
"si... |
from idaapi import *
from idautils import *
from idc import *
from SimpleXMLRPCServer import SimpleXMLRPCServer
import cPickle
def is_connected() :
return True
def wrapper_get_raw(oops) :
F = {}
for function_ea in Functions() :
F[ function_ea ] = []
f_start = function_ea
f_end ... | {
"content_hash": "9a6813bdfb2688ac9ebffd44b609eac7",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 123,
"avg_line_length": 34.18881118881119,
"alnum_prop": 0.5199427285743505,
"repo_name": "d9w/6858-android-intents",
"id": "0bf8c805137b7e9b1695c527a8686208d58cafa1",
"si... |
import os
import numpy as np
import pandas as pd
import subprocess
import optparse
from sklearn.svm import SVC
from sklearn import cross_validation
from sklearn import grid_search
from sklearn.metrics import precision_score
from sklearn.metrics import recall_score
from sklearn.metrics import f1_score
from sklearn impor... | {
"content_hash": "97bb6c4cc8afdf6502c41ec6d40885f0",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 505,
"avg_line_length": 33.384105960264904,
"alnum_prop": 0.6712953779012101,
"repo_name": "enricopal/STEM",
"id": "3ef5bfec754f2886c2ce61bd7503ce7d971221f1",
"size": "504... |
"""Eager mode TF policy built using build_tf_policy().
It supports both traced and non-traced eager execution modes."""
import functools
import logging
import threading
from typing import Dict, List, Optional, Tuple
from ray.util.debug import log_once
from ray.rllib.models.catalog import ModelCatalog
from ray.rllib.... | {
"content_hash": "9b717d742a3022cb524633b04980844b",
"timestamp": "",
"source": "github",
"line_count": 794,
"max_line_length": 79,
"avg_line_length": 39.885390428211586,
"alnum_prop": 0.5285926300167356,
"repo_name": "pcmoritz/ray-1",
"id": "edc6eaafa26e994b2054c2960f81b19cbd4a446f",
"size": "3166... |
"""Support for Tile device trackers."""
import logging
from homeassistant.components.device_tracker.config_entry import TrackerEntity
from homeassistant.components.device_tracker.const import SOURCE_TYPE_GPS
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.const import ATTR_ATTRIBUTION, CONF_P... | {
"content_hash": "9dabd4226b3faafa8d638e77e8866301",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 87,
"avg_line_length": 29.37162162162162,
"alnum_prop": 0.6252587991718427,
"repo_name": "partofthething/home-assistant",
"id": "f7cc4e1736e6cd23ef7b81e77a1b91a5837d063a",
... |
import warnings
import numpy as np
from skimage.viewer.qt import QtWidgets, has_qt, FigureManagerQT, FigureCanvasQTAgg
import matplotlib as mpl
from matplotlib.figure import Figure
from matplotlib import _pylab_helpers
from matplotlib.colors import LinearSegmentedColormap
if has_qt and 'agg' not in mpl.get_backend().... | {
"content_hash": "02c38d04bf713d88ab62f837321e4c3e",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 83,
"avg_line_length": 30.84037558685446,
"alnum_prop": 0.6229258639062262,
"repo_name": "newville/scikit-image",
"id": "524e9b6166c4d2dc0cef47c9acb0723bcd64baba",
"size":... |
import itsdangerous
import mock
from nose.tools import * # flake8: noqa
import unittest
from django.utils import timezone
from tests.base import ApiTestCase
from osf_tests.factories import (
AuthUserFactory
)
from api.base.settings.defaults import API_BASE
from framework.auth.oauth_scopes import public_scopes
f... | {
"content_hash": "101831291a120101b8af7a3e1acb3be0",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 96,
"avg_line_length": 34.95,
"alnum_prop": 0.6012671162885755,
"repo_name": "icereval/osf.io",
"id": "758263b7ef0df56b2fbcb37330ecec8d548d8c54",
"size": "4917",
"binary... |
from baremetal_network_provisioning.common import constants as hp_const
from baremetal_network_provisioning.ml2 import (hp_network_provisioning_driver
as np_drv)
from baremetal_network_provisioning.ml2 import mechanism_hp as hp_mech
import contextlib
import mock
from os... | {
"content_hash": "b754f627701df5edafd3d6a839dd98d1",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 78,
"avg_line_length": 38.76777251184834,
"alnum_prop": 0.4799511002444988,
"repo_name": "selvakumars2/baremetal-network-provisioning",
"id": "878122269cc46f38922396b182390f... |
import logging
import gevent
from ...policy import Policy
from . import models
logger = logging.getLogger(__name__)
class MongoPolicy(Policy):
_name = "mongo"
def search_domain(self, protocol):
return models.Domain.search(protocol)
def search_mynetwork(self, protocol):
return mode... | {
"content_hash": "cc4537f0e85002a44f5fe715fa3cd6ea",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 91,
"avg_line_length": 30.1875,
"alnum_prop": 0.5797101449275363,
"repo_name": "radical-software/mongrey",
"id": "5805758107c9f655810ddbe04157070dbc95b080",
"size": "1957",... |
from collections import namedtuple
from io import StringIO
import click
import errno
import json
import logging
import os
import pathlib
import sys
from .benchmark.codec import JsonEncoder
from .benchmark.compare import RunnerComparator, DEFAULT_THRESHOLD
from .benchmark.runner import CppBenchmarkRunner, JavaBenchmark... | {
"content_hash": "9ea3303f4ab54bb63f64935915b3f5a9",
"timestamp": "",
"source": "github",
"line_count": 930,
"max_line_length": 79,
"avg_line_length": 38.755913978494625,
"alnum_prop": 0.6317731598368616,
"repo_name": "laurentgo/arrow",
"id": "d8eeb7bab0ebbaab8f920dee6ce69527cf293c40",
"size": "368... |
import pytest
def test_answer_is_served_from_chosen_port(docker_compose, nginxproxy):
r = nginxproxy.get("http://web.nginx-proxy.tld/port")
assert r.status_code == 200
assert "answer from port 90\n" in r.text
| {
"content_hash": "2645b522bca2fcdf2a01095c34655ae4",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 71,
"avg_line_length": 31.857142857142858,
"alnum_prop": 0.7085201793721974,
"repo_name": "itsafire/nginx-proxy",
"id": "3c95ba629c269be8fc793328de904e5445b44320",
"size": "... |
import random
from Pyro5.api import expose, oneway
@expose
class GameServer(object):
def __init__(self, engine):
self.engine = engine
def register(self, name, observer):
robot = self.engine.signup_robot(name, observer)
self._pyroDaemon.register(robot) # make the robot a pyro object
... | {
"content_hash": "1a1ed4e37ce55f4ac603d815a2cd6a84",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 72,
"avg_line_length": 23.858974358974358,
"alnum_prop": 0.5706609349811929,
"repo_name": "irmen/Pyro5",
"id": "a7cdb4f3b9a81a3b0a0ff0077c71a5a2c78ded6d",
"size": "1861",
... |
""" Utilities for driving sets of parcel model integration strategies.
Occasionally, a pathological set of input parameters to the parcel model
will really muck up the ODE solver's ability to integrate the model.
In that case, it would be nice to quietly adjust some of the numerical
parameters for the ODE solver and r... | {
"content_hash": "d5ea8bb6ecee8a210f01140b806324b1",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 94,
"avg_line_length": 31.22222222222222,
"alnum_prop": 0.5874428063040162,
"repo_name": "darothen/parcel_model",
"id": "6157074ab645acffa2de2ba44e252838ff7a6015",
"size":... |
from filebeat import BaseTest
import os
import time
"""
Tests for the multiline log messages
"""
class Test(BaseTest):
def test_java_elasticsearch_log(self):
"""
Test that multi lines for java logs works.
It checks that all lines which do not start with [ are append to the last line star... | {
"content_hash": "96fb2cc765d30d8dfab3ba9d5a2c43c7",
"timestamp": "",
"source": "github",
"line_count": 354,
"max_line_length": 300,
"avg_line_length": 31.44632768361582,
"alnum_prop": 0.554796981674452,
"repo_name": "taitan-org/inflog",
"id": "2bf67391f36d2f27e53618ecf725bf24eb38f60f",
"size": "11... |
import argparse
import json
import os
import re
import urllib.request
_REPO_URL = 'https://dl.google.com/dl/android/maven2'
_GROUP_NAME = 'com/android/support'
_MODULE_NAME = 'cardview-v7'
_FILE_EXT = 'aar'
_OVERRIDE_LATEST = None
_PATCH_VERSION = 'cr1'
def do_latest():
if _OVERRIDE_LATEST is not None:
p... | {
"content_hash": "41213d5af9247549d31a80d3498dc0a9",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 79,
"avg_line_length": 31.52857142857143,
"alnum_prop": 0.594019030357952,
"repo_name": "scheib/chromium",
"id": "7be954e2a54027924b05b8fc34ccb38fd3b78927",
"size": "2496",... |
import unittest
import re
import threading
import time
from selenium import webdriver
from app import create_app, db
from app.models import User, Role, Post, Permission
class SeleniumTestCase(unittest.TestCase):
client = None
@classmethod
def setUpClass(cls):
#start Chrome
try:
... | {
"content_hash": "632ac9e263914566b9d339b791aae998",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 136,
"avg_line_length": 32.47945205479452,
"alnum_prop": 0.5845634753268663,
"repo_name": "delitamakanda/socialite",
"id": "fb6744a5d2ba9d535c0a4160a9e2d490058b33db",
"size... |
"""
Cache driver that uses SQLite to store information about cached images
"""
from __future__ import absolute_import
from contextlib import contextmanager
import os
import sqlite3
import stat
import time
from eventlet import sleep
from eventlet import timeout
from oslo_config import cfg
from oslo_log import log as l... | {
"content_hash": "121bf7ee76e5185034ac9417ab31407e",
"timestamp": "",
"source": "github",
"line_count": 474,
"max_line_length": 79,
"avg_line_length": 33.78902953586498,
"alnum_prop": 0.5427072927072927,
"repo_name": "klmitch/glance",
"id": "e30b59efa51cbcb99df37c1dd66f43ebeb8dc8e2",
"size": "16652... |
"""
pycodeexport is a Python package for code generation.
"""
from __future__ import absolute_import, division, print_function
from ._release import __version__
from .dist import PCEExtension, pce_build_ext
| {
"content_hash": "7b72865ca5d08fd178ba2cbba0e133ff",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 64,
"avg_line_length": 29.714285714285715,
"alnum_prop": 0.7548076923076923,
"repo_name": "bjodah/pycodeexport",
"id": "f057ae9f07354f42e3d19eb168ec6f18b1fed964",
"size": "2... |
__author__ = 'techkid6'
""" Allows for modification of requests from proxy clients"""
def handle_request(request):
return None
""" Allows for modification of responses returned to proxy clients"""
def handle_response(response):
return None | {
"content_hash": "ab8243b8be203d38c1b104d545a5a8fe",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 69,
"avg_line_length": 27.666666666666668,
"alnum_prop": 0.7349397590361446,
"repo_name": "techkid6/pyproxy",
"id": "f650b8abe7018f4a9bbaf23d7211c98b2bb80898",
"size": "1365... |
import uuid
from architect.commands import partition
from django.db import migrations, models
def add_partitions(apps, schema_editor):
partition.run({'module': 'casexml.apps.phone.models'})
class Migration(migrations.Migration):
dependencies = [
('phone', '0001_initial'),
]
operations = [... | {
"content_hash": "e239634b8b3e89b75d02cb679e3924ba",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 113,
"avg_line_length": 45.43589743589744,
"alnum_prop": 0.59255079006772,
"repo_name": "dimagi/commcare-hq",
"id": "5d20b11f8a96abbfb702f3d6cf2714870f856915",
"size": "182... |
"""
Tests for dataset creation
"""
import random
import math
import unittest
import os
import numpy as np
import deepchem as dc
try:
import torch # noqa
PYTORCH_IMPORT_FAILED = False
except ImportError:
PYTORCH_IMPORT_FAILED = True
def load_solubility_data():
"""Loads solubility dataset"""
current_dir = o... | {
"content_hash": "f3675e6460b4d5fe20611457d876ea74",
"timestamp": "",
"source": "github",
"line_count": 846,
"max_line_length": 146,
"avg_line_length": 34.45390070921986,
"alnum_prop": 0.6424454508027995,
"repo_name": "lilleswing/deepchem",
"id": "711529e2143ea7618f3e005a559b4f71d078f365",
"size": ... |
import logging
from django.utils import timezone
from quickstats.models import Widget
logger = logging.getLogger(__name__)
def quick_record(owner, value, **kwargs):
labels = kwargs.pop("labels", {})
defaults = kwargs.setdefault("defaults", {})
defaults.setdefault("type", "chart")
defaults.setdefaul... | {
"content_hash": "fb73951745b84979a412a802c0f09c6c",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 85,
"avg_line_length": 32.21212121212121,
"alnum_prop": 0.6698024459078081,
"repo_name": "kfdm/django-simplestats",
"id": "fecaeed496706b2bc426e571ff8629325ff811e2",
"size"... |
""" Demo: `page_a` and `page_b` are rendered into `page_all`.
Note: both `page_a` and `page_b` extend same `master`, inheritance
chains intersect at `content` placeholder.
"""
import unittest
from wheezy.template.engine import Engine
from wheezy.template.ext.core import CoreExtension
from wheezy.template.loa... | {
"content_hash": "7b8484970bb9a2b1d997ea6d806507a7",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 70,
"avg_line_length": 16.03125,
"alnum_prop": 0.6003898635477583,
"repo_name": "ezotrank/wheezy.template",
"id": "43886634f1a2454e5e619390bb2232f885090c27",
"size": "1026"... |
from neo4jrestclient.client import GraphDatabase
import getpass
def flatten_dict(dictToFlatten):
#Pass through for now. Will flatten later (because neo4j doesn't like embedded dictionaries)
return dictToFlatten
class Neo4jLoader(object):
def __init__(self, url, username='neo4j', password=None):
... | {
"content_hash": "136c9bc05f8c7c2790565cf3b56319ab",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 218,
"avg_line_length": 47.03225806451613,
"alnum_prop": 0.6433470507544582,
"repo_name": "chroniccrash/c4rtographer",
"id": "439e3d5d6ccb8306d933439cf1e671f84e659aeb",
"si... |
import gtk
import viewer
reload(viewer)
class Application(gtk.Window):
def __init__(self, appname, size):
gtk.gdk.threads_init()
super(Application, self).__init__()
self.appname = appname
self.size = size
self.extensions = {}
def parse_framework(self, parent, frm):
... | {
"content_hash": "cf222c062abbf4026495ba6958d0c63e",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 83,
"avg_line_length": 32.87179487179487,
"alnum_prop": 0.6185647425897036,
"repo_name": "2000jedi/WebViewer",
"id": "89442522004139b98f5eff66fe987c70fac99a08",
"size": "12... |
from .grammar import SchemaGrammar
class PostgresSchemaGrammar(SchemaGrammar):
_modifiers = ['increment', 'nullable', 'default']
_serials = ['big_integer', 'integer',
'medium_integer', 'small_integer', 'tiny_integer']
marker = '%s'
def compile_rename_column(self, blueprint, command... | {
"content_hash": "3c04b56082c05ec09216a30236291fc0",
"timestamp": "",
"source": "github",
"line_count": 310,
"max_line_length": 78,
"avg_line_length": 30.838709677419356,
"alnum_prop": 0.5573221757322175,
"repo_name": "Hanaasagi/sorator",
"id": "da873fd969d26b48062d6330d499fa5b2c685ad6",
"size": "9... |
"""
Copyright 2017 Alexander Minyushkin
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, so... | {
"content_hash": "b555fe93fa882acdd225420680611cab",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 147,
"avg_line_length": 33.916666666666664,
"alnum_prop": 0.7125307125307125,
"repo_name": "Alexander-Minyushkin/aistreamer",
"id": "600272475a2d0bd50d3af91238f9e613bb19dd68"... |
from django.db.models import Q
from django.utils import timezone
from treebeard.mp_tree import MP_NodeQuerySet
from cms.publisher.query import PublisherQuerySet
from cms.exceptions import NoHomeFound
class PageQuerySet(PublisherQuerySet):
def on_site(self, site=None):
from cms.utils import get_current_... | {
"content_hash": "404ef677b6858f47773bbebd736f25ed",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 88,
"avg_line_length": 33.61538461538461,
"alnum_prop": 0.6210526315789474,
"repo_name": "benzkji/django-cms",
"id": "fd5494ab00893b80f6c27b5e9489f877033aed35",
"size": "22... |
import torch # for torch.cat and torch.zeros
import torch.nn as nn
import torch.utils.model_zoo as model_zoo
from nhwc.conv import Conv2d_NHWC
from nhwc.batch_norm import BatchNorm2d_NHWC
from nhwc.max_pool import MaxPool2d_NHWC
# Group batch norm
from apex.parallel import SyncBatchNorm as gbn
# Pe... | {
"content_hash": "ca49e8cbdcc1e4dec919ae7bc7e5aec8",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 127,
"avg_line_length": 35.804545454545455,
"alnum_prop": 0.584105623968516,
"repo_name": "mlperf/training_results_v0.7",
"id": "0030d419034e826b4e41b2f0d3cc75e34cb3a57d",
... |
class TestRhsaCveNames(object):
def test_cve_names(self, monkeypatch, mock_post, mock_put, rhsa):
"""Verify that we have CVE names in our advisory (not None)"""
expected = 'CVE-2018-14649'
assert rhsa.cve_names == expected
| {
"content_hash": "55dbb0463335c3d80e49936445ab6024",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 70,
"avg_line_length": 42,
"alnum_prop": 0.6587301587301587,
"repo_name": "red-hat-storage/errata-tool",
"id": "00d942293f49a5168fca148099a4e095f83aa66d",
"size": "252",
"... |
from datetime import timedelta as td
import time
from unittest.mock import patch
from django.core import signing
from django.utils.timezone import now
from hc.test import BaseTestCase
class UnsubscribeReportsTestCase(BaseTestCase):
def test_it_unsubscribes(self):
self.profile.next_report_date = now()
... | {
"content_hash": "093d4939a975be7119d0f62be8416364",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 68,
"avg_line_length": 34.935483870967744,
"alnum_prop": 0.6523545706371191,
"repo_name": "iphoting/healthchecks",
"id": "f4cdb2fec6f4b1bd3b74ba91a0681163e2ceec95",
"size":... |
"""
========
Dispatch
========
Identical to django.dispatch module but adds few more features
"""
import django.dispatch
from celery import shared_task
def async_receiver(signal, sender=None, **kwargs):
"""
Decorator to perform django signal asynchronously using Celery. The function decorated with
this sh... | {
"content_hash": "c27cc02866809e47c4c9fe3e387504fe",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 98,
"avg_line_length": 32.44827586206897,
"alnum_prop": 0.6785334750265675,
"repo_name": "inabhi9/drf-ext",
"id": "9220615708b564058e75a55f667e5a264204e25a",
"size": "1882"... |
import numpy as np
from collections import namedtuple
from pysc2.agents import base_agent
from pysc2.lib import actions
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.autograd as autograd
from torch.autograd import Variable
from torch.utils.data import DataL... | {
"content_hash": "5edf4b83f20f0533709c24b7f12b0085",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 96,
"avg_line_length": 44.25301204819277,
"alnum_prop": 0.5294037571467465,
"repo_name": "ShawnSpooner/starcraft_agents",
"id": "33da285498072eb0cb721d1cbdf2f66dbfce114a",
... |
__author__ = 'alicia.williams'
#Week Three: Pig Latin
#CIS-125 FA 2015
# File: PigLatinAssignment.py
# This program takes English words and translates them to Pig Latin.
def main():
print("This program translates an English word to Pig Latin. \n")
#Prompting the user to enter an English word to translat... | {
"content_hash": "be72406e20a31a2bab78c3b96e90f924",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 80,
"avg_line_length": 29.925925925925927,
"alnum_prop": 0.6683168316831684,
"repo_name": "ajanaew24/Week-Three-Assignment",
"id": "18bf0b6f0e386a0ad1dc8e4c4a7a83e81dac5c31",... |
"""docstring"""
| {
"content_hash": "30c29c2885c71b49b5a9fe1f407e4ba9",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 15,
"avg_line_length": 16,
"alnum_prop": 0.5625,
"repo_name": "Titulacion-Sistemas/PythonTitulacion-EV",
"id": "fb1e2b64861dd3af1f1fa4cad9050569dcc75c11",
"size": "16",
"b... |
"""
This example shows how to use the FedEx RateRequest service.
The variables populated below represents the minimum required values.
You will need to fill all of these, or risk seeing a SchemaValidationError
exception thrown by suds.
TIP: Near the bottom of the module, see how to check the if the destination
is... | {
"content_hash": "f65e376a1b63f0ce269bdc5d40d603d8",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 140,
"avg_line_length": 50.54867256637168,
"alnum_prop": 0.820203081232493,
"repo_name": "AxiaCore/python-fedex",
"id": "0fe7d9746a64a16e99b8b7065bab5ced87d0fa45",
"size":... |
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configurat... | {
"content_hash": "2b286b69b28b68356a8dbc9b566c3c36",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 80,
"avg_line_length": 31.903930131004365,
"alnum_prop": 0.7003832466465918,
"repo_name": "kalail/queen",
"id": "87d0a4036520b91f101d5ebe31e8c4d2d99069e8",
"size": "7722",... |
import unittest
from conans import tools
from conans.test.utils.tools import TestClient, TestServer
from conans.model.ref import ConanFileReference, PackageReference
import os
from conans.paths import EXPORT_SOURCES_TGZ_NAME, EXPORT_TGZ_NAME, EXPORT_SRC_FOLDER
from parameterized.parameterized import parameterized
from... | {
"content_hash": "43bc353bd806db69ce346041df3456bf",
"timestamp": "",
"source": "github",
"line_count": 425,
"max_line_length": 99,
"avg_line_length": 43.510588235294115,
"alnum_prop": 0.6009625784122864,
"repo_name": "birsoyo/conan",
"id": "1145b0059c3b602c0f09fa277b8d723a32f1ec93",
"size": "18492... |
from io import StringIO
from .output import Output
from .section_output import SectionOutput
class BufferedOutput(Output):
def __init__(self, decorated: bool = False, supports_utf8: bool = True) -> None:
super().__init__(decorated=decorated)
self._buffer = StringIO()
self._supports_utf8 ... | {
"content_hash": "91f3f9dab70eeb658d79944eb5fcb463",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 84,
"avg_line_length": 26.291666666666668,
"alnum_prop": 0.5800316957210776,
"repo_name": "sdispater/cleo",
"id": "e0c14bef9ec6395eec893fbf9e3f3d98fcae9e6b",
"size": "1262"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.