text
stringlengths
4
1.02M
meta
dict
''' This is a framework for a Bot configured for Twitch Using this will require some knowledge of Python since there are no commands to begin with, once the username, channels and oauth has been filled out. The program will just print out the chat of the channels it connects to. You can send a message by using the fo...
{ "content_hash": "15d269d3be712b71cb70431910a76363", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 137, "avg_line_length": 31.561728395061728, "alnum_prop": 0.5579894386857032, "repo_name": "RubbixCube/Twitch-Chat-Bot-V2", "id": "fe47cf2f67f7892a9a8554a33c9218309b84d848",...
from sklearn2sql_heroku.tests.classification import generic as class_gen class_gen.test_model("DummyClassifier" , "BinaryClass_500" , "postgresql")
{ "content_hash": "476821bb6f1c1d795dbaf9be544fd933", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 74, "avg_line_length": 37.5, "alnum_prop": 0.7933333333333333, "repo_name": "antoinecarme/sklearn2sql_heroku", "id": "065badaab9c5afea9bcc732b38431f1b415ed0eb", "size": "150...
import sublime import sublime_plugin from ..anaconda_lib.worker import Worker from ..anaconda_lib.typing import Dict, Any from ..anaconda_lib.callback import Callback from ..anaconda_lib.helpers import get_settings class AnacondaMcCabe(sublime_plugin.WindowCommand): """Execute McCabe complexity checker """ ...
{ "content_hash": "844ed38d112493262c951b53c434363b", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 74, "avg_line_length": 31.68831168831169, "alnum_prop": 0.5733606557377049, "repo_name": "danalec/dotfiles", "id": "5e7b919b6d6b3b662a603809943c0d9fd024e122", "size": "2569...
from oslo_config import fixture as fixture_config from nova import test from nova.virt import driver class DriverMethodTestCase(test.NoDBTestCase): def setUp(self): super(DriverMethodTestCase, self).setUp() self.CONF = self.useFixture(fixture_config.Config()).conf def test_is_xenapi_true(se...
{ "content_hash": "7114619679ffdc77538ea84510f9d02e", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 74, "avg_line_length": 36.08695652173913, "alnum_prop": 0.6578313253012048, "repo_name": "rahulunair/nova", "id": "716fa6e8371f2c8728eadb6ed4f4c8c9a7b4245c", "size": "1485"...
from xml.dom.minidom import parse, parseString, Element from os import path import re class CypressParser: patient_section_templateIds = ['2.16.840.1.113883.10.20.17.2.4', '2.16.840.1.113883.10.20.24.2.1'] # patient_id_root='2.16.840.1.113883.4.572' patient_id_root="2.16.840.1.113883.3.1257" def parseP...
{ "content_hash": "79a6e994ec2d153cc0a708bd0653a17f", "timestamp": "", "source": "github", "line_count": 430, "max_line_length": 135, "avg_line_length": 40.6953488372093, "alnum_prop": 0.5878050174295674, "repo_name": "pSCANNER/USC-source-code", "id": "97da81e6527ba9e19ddf5d79f3322b7c69e67221", "siz...
from setuptools import setup setup(name='enzynet', description='EnzyNet: enzyme classification using 3D convolutional neural networks on spatial representation', author='Afshine Amidi and Shervine Amidi', author_email='<author1-lastname>@mit.edu, <author2-firstname>@stanford.edu', license='MIT'...
{ "content_hash": "7c72d72371a4037a93f2bbc966041f5e", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 116, "avg_line_length": 43.75, "alnum_prop": 0.7257142857142858, "repo_name": "shervinea/enzynet", "id": "ae6288463604622950f3794eb87ca0d1c58b5571", "size": "350", "binary...
"""Full mock of the builtin 'os' module for blazing-fast unit-testing.""" # pylint: disable=import-self from fakeos import FakeOS from filesystem import (FakeFilesystem, FakeDirectory, FakeFile, FakeFilesystemWithPermissions) from environment import FakeEnvironment from device import FakeDevice ...
{ "content_hash": "4bb7b63077d446753c402fa0ae4b793e", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 73, "avg_line_length": 45.22222222222222, "alnum_prop": 0.7813267813267813, "repo_name": "rinslow/fakeos", "id": "20f677f6235b95439809140b6f00930c2e42395f", "size": "407", ...
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 model 'GithubCommentsConfig' db.create_table(u'ghcomments_githubcommentsconfig', ( (u'datacollectorconfig_ptr',...
{ "content_hash": "4c6cc8343b68f11f1b16db1edea097f7", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 214, "avg_line_length": 70.48529411764706, "alnum_prop": 0.5916962236595035, "repo_name": "GaretJax/csat", "id": "a590b5ffc7fe5e06f80ac0886318c59597686352", "size": "4817",...
from steamworks import * import time #------------------------------------------------ # Initialize Steam #------------------------------------------------ Steam.Init() #------------------------------------------------ # Test Steam Apps functions def appsTest(): print("\n#----------------------------------------------...
{ "content_hash": "88cd802b6291f7ded2c732de9844e003", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 143, "avg_line_length": 47.05555555555556, "alnum_prop": 0.5834317197953561, "repo_name": "Gramps/SteamworksForPython", "id": "4bd3c22d35ef61f732a5f643dde2c8cc83c52f62", "...
from django.contrib import admin from hq.models import * from django.contrib.auth.models import Group, User from reporters.models import Reporter from locations.models import Location from resources.models import * ''' ''' class ResourceAdmin(admin.ModelAdmin): list_display = ('name', 'code', 'category','domain') ...
{ "content_hash": "d73c0fefd7f7e6773faccecca1d8534d", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 69, "avg_line_length": 36.34375, "alnum_prop": 0.7343078245915735, "repo_name": "icomms/wqmanager", "id": "06b45753e608e662c74a76e6383285a33e030ba9", "size": "1163", "bin...
''' ''' # 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");...
{ "content_hash": "13d8a1594caa918a4e3ea57d3e56c6a0", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 80, "avg_line_length": 31, "alnum_prop": 0.6495352651722253, "repo_name": "bryancall/trafficserver", "id": "47fb4b4639ebab584e613382196c4e3da462e76c", "size": "1829", "bi...
import os import sys from buildsupport.GlobalSettings import g_compiler from buildsupport.GlobalSettings import g_platformSettings from buildsupport.GlobalSettings import g_sourceDir from buildsupport.GlobalSettings import g_targetOsName, g_targetProcArch from buildsupport.GlobalSettings import g_verbose from buildsu...
{ "content_hash": "aa5d90b2ab76bacf407e6bc9da445ef7", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 90, "avg_line_length": 34.732283464566926, "alnum_prop": 0.574699614599864, "repo_name": "rodyakin/chilly-build", "id": "58347e73db810b7ad89fcdccf028b88ff99da4d6", "size":...
from django.shortcuts import render_to_response from django import newforms as forms from citeweb.citeimport import models import re import hashlib import logging import random random.seed() import htmlentitydefs class ImportForm(forms.Form): url_field = forms.CharField(widget=forms.Textarea(attrs={'cols':'100...
{ "content_hash": "002efd019f7314d22e7b73ce0ee80848", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 125, "avg_line_length": 28.72972972972973, "alnum_prop": 0.5647538413295704, "repo_name": "mkuhn/cite-web", "id": "235c8b2ec8d3d52a832e38fa0fd52b1392a37b1d", "size": "3216...
""" Boilerplate functions used in defining binary operations. """ from __future__ import annotations from functools import wraps from typing import Callable from pandas._libs.lib import item_from_zerodim from pandas._libs.missing import is_matching_na from pandas._typing import F from pandas.core.dtypes.generic impo...
{ "content_hash": "96a4f5bef802f66c37dd417413f6a9c8", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 82, "avg_line_length": 23.62676056338028, "alnum_prop": 0.5767511177347243, "repo_name": "datapythonista/pandas", "id": "f0e6aa3750cee5f5c25bd5d9d58a19e929f3569a", "size":...
''' Freetype structured types ------------------------- FT_Library: A handle to a FreeType library instance. FT_Vector: A simple structure used to store a 2D vector. FT_BBox: A structure used to hold an outline's bounding box. FT_Matrix: A simple structure used to store a 2x2 matrix. FT_UnitVector: A simple struct...
{ "content_hash": "53365e7bc5afca82e794c6f430e180d0", "timestamp": "", "source": "github", "line_count": 936, "max_line_length": 81, "avg_line_length": 37.7724358974359, "alnum_prop": 0.6002828454249752, "repo_name": "pbfy0/visvis", "id": "ec9b96fdc33ada93b8b78cc87634ba38b95471fd", "size": "35690", ...
from unittest import TestCase from cate.util.im.cmaps import get_cmaps class CmapsTest(TestCase): def test_get_cmaps_returns_singleton(self): cmaps = get_cmaps() self.assertIs(cmaps, get_cmaps()) self.assertIs(cmaps, get_cmaps()) def test_get_cmaps_retruns_equal_size_recs(self): ...
{ "content_hash": "966fcce834e557ef4e40a6214513111f", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 380, "avg_line_length": 38.10112359550562, "alnum_prop": 0.5903863167207314, "repo_name": "CCI-Tools/ect-core", "id": "9cc8a462feb9bf696e16bd50923d9011ab81e5e7", "size": "3...
"""Module to run Applescript internally with Foundation class.""" import logging import platform try: import Foundation # pylint: disable=import-error,g-import-not-at-top except ImportError: # hack to make unit tests work if not platform.platform().startswith('Linux-'): raise class Error(Exception): """...
{ "content_hash": "bd05be664c7e61f0ec5ad7821c5762fd", "timestamp": "", "source": "github", "line_count": 271, "max_line_length": 80, "avg_line_length": 30.583025830258304, "alnum_prop": 0.653957528957529, "repo_name": "jflinter/macops", "id": "5c416e144f2f5495e54d6f57f4e826b9986b9c6a", "size": "8288...
import pytest # Local imports from uplink.clients.io import interfaces, state, transitions @pytest.fixture def request_execution_mock(mocker): return mocker.Mock(spec=interfaces.RequestExecution) @pytest.fixture def request_state_mock(mocker): return mocker.Mock(spec=interfaces.RequestState) class BasicS...
{ "content_hash": "3a99a88bbd5cb0ba6c099d95791cb345", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 78, "avg_line_length": 31.484848484848484, "alnum_prop": 0.6802694898941289, "repo_name": "prkumar/uplink", "id": "c0e6ae4888422adbb4df91f356375eeade882240", "size": "5217...
''' Created on Aug 21, 2014 @author: moloyc ''' import re import os import yaml import platform import datetime import shutil from netaddr import IPNetwork import netifaces import logging.config from crypt import Cryptic #__all__ = ['getPortNamesForDeviceFamily', 'expandPortName'] configLocation = os.path.join(os.pa...
{ "content_hash": "0005edc5adb416fcf19c0170c3e1e948", "timestamp": "", "source": "github", "line_count": 420, "max_line_length": 137, "avg_line_length": 32.333333333333336, "alnum_prop": 0.6092047128129602, "repo_name": "plucena24/OpenClos", "id": "26fbd0426bea54a811c77685110af3569dbd442d", "size": ...
import mock import six from rally import osclients from rally.plugins.openstack.scenarios.fuel import utils from tests.unit import test UTILS = "rally.plugins.openstack.scenarios.fuel.utils." class ModuleTestCase(test.TestCase): @mock.patch(UTILS + "six") @mock.patch(UTILS + "FuelClient", return_value="fu...
{ "content_hash": "aa8984204d608b1e922d7ebb709b20ab", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 79, "avg_line_length": 42.87362637362637, "alnum_prop": 0.5918236575676022, "repo_name": "aplanas/rally", "id": "7a2ad4be724e8fe9df813ba3920f72d31ed17f03", "size": "8401",...
""" This module tests the test API. These are high-level integration tests. """ import os import pytest from conda_build import api from .utils import metadata_dir @pytest.mark.sanity def test_recipe_test(testing_workdir, testing_config): """Test calling conda build -t <recipe dir>""" recipe = os.path.joi...
{ "content_hash": "778dc783a3a7ded28924ccae989bb157", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 98, "avg_line_length": 39.85, "alnum_prop": 0.7252195734002509, "repo_name": "pelson/conda-build", "id": "22f7b789a47c33ea3ae305603724c78f9c17abd7", "size": "2391", "bina...
import atexit import logging import os import cherrypy import ifcfg import requests from django.conf import settings from kolibri.content.utils import paths from .system import kill_pid, pid_exists logger = logging.getLogger(__name__) # Status codes for kolibri STATUS_RUNNING = 0 STATUS_STOPPED = 1 STATUS_STARTING_...
{ "content_hash": "6e4875e381ac34b3277a0779fff629de", "timestamp": "", "source": "github", "line_count": 279, "max_line_length": 78, "avg_line_length": 32.007168458781365, "alnum_prop": 0.6427771556550952, "repo_name": "MingDai/kolibri", "id": "436c5745886658692cd6a2df1ff5cce4e8844ec1", "size": "893...
"""Class to hold all alarm control panel accessories.""" import logging from pyhap.const import CATEGORY_ALARM_SYSTEM from homeassistant.components.alarm_control_panel import DOMAIN from homeassistant.const import ( ATTR_CODE, ATTR_ENTITY_ID, SERVICE_ALARM_ARM_AWAY, SERVICE_ALARM_ARM_HOME, SERVICE...
{ "content_hash": "029a9eb53f9874fa1d7852c0f2912373", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 88, "avg_line_length": 33.463157894736845, "alnum_prop": 0.6502044668134633, "repo_name": "postlund/home-assistant", "id": "345709eb7daac0a17e2a619eca426a0af743a33c", "size...
"""Test max width of table in a terminal without wrapping.""" from textwrap import dedent import pytest from terminaltables import AsciiTable, UnixTable from terminaltables.terminal_io import terminal_size def test_terminal_width_height(): """Test terminal width/height functions.""" assert (80, 24) == term...
{ "content_hash": "6ace01ca0f48ece5585ec659aefe2a85", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 114, "avg_line_length": 32.00854700854701, "alnum_prop": 0.6299065420560748, "repo_name": "rtulke/terminaltables", "id": "21363f3fb0cd1000b9671e38ec47c70bb3d6095c", "size"...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = """ --- module: ce_facts version_added: "2.4" author: "wangdezhuang (@QijunPan)" short_description: Gets facts about HUAWEI CloudEngine switches. description: - C...
{ "content_hash": "03536af0cfb8022c894a72ba02a54d53", "timestamp": "", "source": "github", "line_count": 385, "max_line_length": 99, "avg_line_length": 27.106493506493507, "alnum_prop": 0.6156573399770027, "repo_name": "SergeyCherepanov/ansible", "id": "ea8f15d96749886c06772491a872283d2dcfaf7d", "si...
from collections import defaultdict class Query(object): '''A representation of the stucture of a SQL query. Only the select_clause and from_clause are required for a valid query. ''' def __init__(self, select_clause, from_clause): self.with_clause = None self.select_clause = select_clause sel...
{ "content_hash": "c0af438c8c481d2685befd5debfd62a4", "timestamp": "", "source": "github", "line_count": 727, "max_line_length": 88, "avg_line_length": 24.382393397524073, "alnum_prop": 0.6555342434841476, "repo_name": "sql-zuiwanyuan/Impala", "id": "d1ead7a32f4b506d1a36d6711a4146e749a31f99", "size"...
from django.db import models from django.conf import settings class Event(models.Model): who = models.ForeignKey(settings.AUTH_USER_MODEL, null=True, blank=True) recorded_time = models.DateTimeField(auto_now_add=True) when = models.DateTimeField(null=True, blank=True) category = models.CharField(max_le...
{ "content_hash": "66c5617f81eff0456572be471f2ca061", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 76, "avg_line_length": 42.76923076923077, "alnum_prop": 0.7392086330935251, "repo_name": "alexlovelltroy/django-telemetry", "id": "a660bec95c3c5b375cbaa7ee92acd64774b91d2e", ...
from bs4 import BeautifulSoup from argparse import ArgumentParser from os import path from zipfile import ZipFile, ZIP_DEFLATED import hashlib import sys TEMPLATE_FILE = path.join(path.realpath(__file__), 'templates', 'addon.xml') AVD_PATH = path.expanduser('~/.android/avd') if sys.platform == 'macosx': SDK_PATH =...
{ "content_hash": "388459a931ef070386784c44ae3c0d66", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 185, "avg_line_length": 41.575, "alnum_prop": 0.6269793545800761, "repo_name": "SecurityCompass/AVDClone", "id": "94c787dd2ba2471fa4c58032ce4edc474f1ea2c1", "size": "4989"...
from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name=...
{ "content_hash": "17091aae6bf5252422d1ae5d389c91fa", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 114, "avg_line_length": 33.69230769230769, "alnum_prop": 0.6004566210045662, "repo_name": "torchbox/django-registration", "id": "9253e3c6359d45f17bc416bd6665a4ac4f962b10", ...
from nose.tools import * # flake8: noqa from website.models import Node from tests.base import ApiTestCase from api.base.settings.defaults import API_BASE from tests.factories import UserFactory, ProjectFactory, FolderFactory, DashboardFactory class TestUsers(ApiTestCase): def setUp(self): super(TestUs...
{ "content_hash": "7531ede793782af352dc00c3655347bb", "timestamp": "", "source": "github", "line_count": 337, "max_line_length": 144, "avg_line_length": 44.596439169139465, "alnum_prop": 0.6011045312396034, "repo_name": "cldershem/osf.io", "id": "ab1fe3bef7ed9a30b3baac2214ee52316938c012", "size": "1...
""" common utilities """ import itertools import numpy as np from pandas import ( DataFrame, MultiIndex, Series, date_range, ) import pandas._testing as tm from pandas.core.api import ( Float64Index, UInt64Index, ) def _mklbl(prefix, n): return [f"{prefix}{i}" for i in range(n)] def _a...
{ "content_hash": "1c786eea921178c1c3a109e19f7e37c8", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 88, "avg_line_length": 27.88421052631579, "alnum_prop": 0.5096262740656852, "repo_name": "dsm054/pandas", "id": "f8db005583bd8b177f252b898e0a52f7fde893a4", "size": "5298",...
from __future__ import absolute_import import inspect import os import sys import lit.Test import lit.formats import lit.TestingConfig import lit.util # LitConfig must be a new style class for properties to work class LitConfig(object): """LitConfig - Configuration data for a 'lit' test runner instance, shared ...
{ "content_hash": "fbd270a77ca83165ce152b3fab462897", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 97, "avg_line_length": 37.03680981595092, "alnum_prop": 0.589862514493954, "repo_name": "endlessm/chromium-browser", "id": "e8fb1533a86147f75806a419a2f83fda9bdb6668", "siz...
"""HMAC (Keyed-Hashing for Message Authentication) Python module. Implements the HMAC algorithm as described by RFC 2104. """ import warnings as _warnings from _operator import _compare_digest as compare_digest try: import _hashlib as _hashopenssl except ImportError: _hashopenssl = None _openssl_md_meths ...
{ "content_hash": "78459280db799b0ec049b2925422df6e", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 96, "avg_line_length": 34.66489361702128, "alnum_prop": 0.60196409390824, "repo_name": "zooba/PTVS", "id": "43b7212976372c4945b1718f16a0c6de00b88a83", "size": "6517", "b...
__author__ = 'tonycastronova' class POSTGRESQL(): def __init__(self): pass def map_data_type(self,type): type = self._fixTypeNames(type.lower()) type = self._mapPostgresDataTypes(type.lower()) return type def _fixTypeNames(self, type): fixNames = { 'in...
{ "content_hash": "cd81b51f8f4e9666f27a470e7337d491", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 56, "avg_line_length": 26.053097345132745, "alnum_prop": 0.43766983695652173, "repo_name": "miguelcleon/ODM2", "id": "5c0bc8d146b208d70e22ba0ef4a98627ebbc7d95", "size": "5...
from google.cloud import pubsub # pylint:disable=import-error def test_pubsub_is_blank(pubsub_client: pubsub.Client) -> None: topic = pubsub_client.topic('topic') assert not topic.exists() topic.create() sub = topic.subscription('my_sub') assert not sub.exists() sub.create() assert sub.p...
{ "content_hash": "fcfb309cddfdf2459633c0f7cba36bdd", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 69, "avg_line_length": 28.94871794871795, "alnum_prop": 0.6430469441984057, "repo_name": "JasonMWhite/gitlawca-runner", "id": "c9efd45bfbfcda5506d562129b6c51e410d6a5d3", "s...
""" This module provides Highcharts class, which is a thin wrapper around Highcharts JS library. """ from json import dumps as json from collections import defaultdict from collections.abc import MutableMapping, Mapping, Set, Sequence, Iterable from os.path import join, dirname from urllib.parse import urljoin from u...
{ "content_hash": "c85c8e02e21ceb5480ee58a28583dd8b", "timestamp": "", "source": "github", "line_count": 346, "max_line_length": 90, "avg_line_length": 35.77167630057804, "alnum_prop": 0.5818857558374404, "repo_name": "qPCR4vir/orange3", "id": "0f0942a2d829ce63b1f0ac7e7610fafecee19bd9", "size": "123...
# -*- coding: utf-8 -*- import colander import mock import uuid import unittest from pyramid.response import Response from kinto.core.views.batch import BatchPayloadSchema, batch as batch_service from kinto.core.testing import DummyRequest from kinto.core.utils import json from .support import BaseWebTest class Ba...
{ "content_hash": "f1c38c6de72d59845db09f75a76543b4", "timestamp": "", "source": "github", "line_count": 414, "max_line_length": 79, "avg_line_length": 41.632850241545896, "alnum_prop": 0.5942794151775354, "repo_name": "monikagrabowska/osf.io", "id": "7f536f228f4b300e9493cba567220e82413f9f08", "size...
#!/usr/bin/python2 # # Copyright 2017 The ANGLE Project Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # # generate_entry_points.py: # Generates the OpenGL bindings and entry point layers for ANGLE. # NOTE: don't run this script di...
{ "content_hash": "36f89f5514fff27ecb4baeded89ae64d", "timestamp": "", "source": "github", "line_count": 2156, "max_line_length": 185, "avg_line_length": 36.833487940630796, "alnum_prop": 0.6323272008361351, "repo_name": "youtube/cobalt", "id": "8fdffd74d24cf250f5bf2bf1a49ce218304d036f", "size": "79...
""" requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import os.path import socket # noqa: F401 from urllib3.exceptions import ClosedPoolError, ConnectTimeoutError from urllib3.exceptions import HTTPError as _HTTPError from url...
{ "content_hash": "fb21f603a8cfc80f560cbe16e02c2ec7", "timestamp": "", "source": "github", "line_count": 584, "max_line_length": 97, "avg_line_length": 36.45034246575342, "alnum_prop": 0.5967961666744962, "repo_name": "psf/requests", "id": "d3b2d5bb1e56f1293f79f70af4df2d429a347a21", "size": "21287",...
import unittest import jenkins from airflow.contrib.operators.jenkins_job_trigger_operator \ import JenkinsJobTriggerOperator from airflow.contrib.hooks.jenkins_hook import JenkinsHook from airflow.exceptions import AirflowException try: from unittest import mock except ImportError: try: import ...
{ "content_hash": "07e1d5cd572cbd5a5cadca0413803f43", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 90, "avg_line_length": 43.91472868217054, "alnum_prop": 0.5862312444836717, "repo_name": "adamhaney/airflow", "id": "23e0bcb66fd975a075257ad6404f1495e53bc300", "size": "64...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('eventlog', '0010_auto_20170619_1404'), ] operations = [ migrations.AlterField( model_name='fieldsightlog', name='type', ...
{ "content_hash": "6e8b93614db4229b402b1d4a2a572a05", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 216, "avg_line_length": 30.555555555555557, "alnum_prop": 0.5818181818181818, "repo_name": "awemulya/fieldsight-kobocat", "id": "4e46349111c50c63210fad57032528e9b0123dde", ...
import math, time from twisted.protocols import basic class CollectingLineReceiver(basic.LineReceiver): def __init__(self): self.lines = [] self.lineReceived = self.lines.append def deliver(proto, chunks): map(proto.dataReceived, chunks) def benchmark(chunkSize, lineLength, numLines): by...
{ "content_hash": "0a75f8cd018d6f91941abc110c406c00", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 71, "avg_line_length": 27.80851063829787, "alnum_prop": 0.6212700841622035, "repo_name": "movmov/cc", "id": "7f552919e375878cf742da037a7950596c8852d2", "size": "1307", "b...
import grpc import kv_pb2 as kv__pb2 class KVStub(object): def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.Get = channel.unary_unary( '/proto.KV/Get', request_serializer=kv__pb2.GetRequest.SerializeToString, response_deserializer=...
{ "content_hash": "5e4c242dac2ec9c94ef589943c7ccc95", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 68, "avg_line_length": 30.12962962962963, "alnum_prop": 0.6760909649661955, "repo_name": "mattatcha/terraform-provider-convox", "id": "cc331c85651ca2c721cca4872720bd98fd1cc1b...
"""Expression Intrinsics and math functions in TVM.""" # pylint: disable=redefined-builtin from __future__ import absolute_import as _abs from ._ffi.function import register_func as _register_func from . import make as _make from .api import convert, const from .expr import Call as _Call from .schedule import Buffer a...
{ "content_hash": "38819f1ab76c5670dd690f34c8ad1a01", "timestamp": "", "source": "github", "line_count": 582, "max_line_length": 87, "avg_line_length": 21.774914089347078, "alnum_prop": 0.5873116073542176, "repo_name": "mlperf/training_results_v0.7", "id": "df854e270e9de1ce3c104c0d1249f01935ae711d", ...
from __future__ import print_function import os import sys v = sys.version_info if v[:2] < (3,3): error = "ERROR: Jupyter Hub requires Python version 3.3 or above." print(error, file=sys.stderr) sys.exit(1) if os.name in ('nt', 'dos'): error = "ERROR: Windows is not supported" print(error, file=...
{ "content_hash": "a1a9a07d056cdb4708cee76bbb1c4fe1", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 80, "avg_line_length": 29.074626865671643, "alnum_prop": 0.5728952772073922, "repo_name": "anaderi/dockerspawner", "id": "83423376567f5d631a9ae3e4955b61dfb750b5c5", "size":...
from traitsui.view import View # ============= enthought library imports ======================= # ============= standard library imports ======================== # ============= local library imports ========================== from pychron.core.helpers.strtools import ps from pychron.experiment.conditional.condition...
{ "content_hash": "57c2f0aba0396dd862a8a6c9ca936cbe", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 86, "avg_line_length": 35.29113924050633, "alnum_prop": 0.5749641319942611, "repo_name": "NMGRL/pychron", "id": "0b310da5cd135674c6648aaa6e46b1e6868327f0", "size": "3521", ...
"""Controllers for the admin view.""" import logging import jinja2 from core import jobs from core import jobs_registry from core.controllers import base from core.controllers import editor from core.domain import collection_services from core.domain import config_domain from core.domain import config_services from ...
{ "content_hash": "734ac99c40717eaf4c74cf29a9286a97", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 79, "avg_line_length": 43.08755760368663, "alnum_prop": 0.5922994652406417, "repo_name": "michaelWagner/oppia", "id": "dad98ed9454d92e2a28af7f8983c7119a70348e3", "size": "...
"""Generic module is the parent module of all other module""" import os import shutil import io import base64 from jinja2 import Environment, PackageLoader # from reports import HTMLTable from sequana.utils import config import colorlog logger = colorlog.getLogger(__name__) __all__ = ["SequanaBaseModule"] class ...
{ "content_hash": "4af8f19ca5e95054d68b613cf923fdf3", "timestamp": "", "source": "github", "line_count": 273, "max_line_length": 106, "avg_line_length": 34.16483516483517, "alnum_prop": 0.5588077624102069, "repo_name": "sequana/sequana", "id": "ed24533d8f5b1fa527a8f18a0f61f60762fae006", "size": "988...
''' ''' # 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");...
{ "content_hash": "29a97eeb3927dbcf6d1dcbf1e7c6874a", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 332, "avg_line_length": 53.71153846153846, "alnum_prop": 0.7373194891991884, "repo_name": "dyrock/trafficserver", "id": "e141fd44d06017d9128974e35032d85e888517e8", "size":...
from __future__ import unicode_literals from six import binary_type, text_type def to_unicode(s): if isinstance(s, binary_type): return s.decode('ascii') return s def to_bytes(s, charset='ascii'): if isinstance(s, text_type): return s.encode(charset) return s
{ "content_hash": "4ecc61add009e56a02195924b2632bd5", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 39, "avg_line_length": 19.8, "alnum_prop": 0.6531986531986532, "repo_name": "bechtoldt/imapclient", "id": "923961cd5172def706d51e7dd8d98990c43a9996", "size": "429", "bina...
''' Created on Jul 2, 2014 @author: yury ''' from bboxcoverage import BBoxCoverage from interfaces.adb_interface import * from interfaces.apktool_interface import * from interfaces.dex2jar_interface import * from interfaces.dx_interface import * from interfaces.emma_interface import * from utils.android_manifest impo...
{ "content_hash": "c99401c6dceb6603e8d95c9a090428f7", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 298, "avg_line_length": 51.54545454545455, "alnum_prop": 0.7721340388007054, "repo_name": "zyrikby/BBoxTester", "id": "7f91bcca376c2116de3f953adcbfdcabd7f11bc6", "size": "2...
""" Dummy node for bee.segments.modifier in the GUI """ class modifier(object): guiparams = dict( __beename__="modifier", antennas=dict( trigger=("push", "trigger"), ), outputs=dict( on_trigger=("push", "trigger"), pre_trigger=("push", "trigger")...
{ "content_hash": "993069b8fccc5afb245e67e4234316a9", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 47, "avg_line_length": 21.27777777777778, "alnum_prop": 0.5013054830287206, "repo_name": "agoose77/hivesystem", "id": "22c7d9420450e4e6282164a98e98450d33a93509", "size": "3...
from __future__ import absolute_import import os import nox LOCAL_DEPS = ( os.path.join('..', 'api_core'), ) def default(session): """Default unit test session. This is intended to be run **without** an interpreter set, so that the current ``python`` (on the ``PATH``) or the version of Python c...
{ "content_hash": "cd0166bf687ef22b30f795320b25d7f8", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 77, "avg_line_length": 30.26388888888889, "alnum_prop": 0.6126663607159247, "repo_name": "jonparrott/gcloud-python", "id": "37ad9c7cbad17cd33607e8cd6a17d7709fb324aa", "size...
""" Tests for L{twisted.conch.checkers}. """ try: import crypt except ImportError: cryptSkip = 'cannot run without crypt module' else: cryptSkip = None import os, base64 from twisted.python import util from twisted.python.failure import Failure from twisted.trial.unittest import TestCase from twisted.pyt...
{ "content_hash": "ba651c928810ee4207616fd93ef7711c", "timestamp": "", "source": "github", "line_count": 606, "max_line_length": 80, "avg_line_length": 36.83993399339934, "alnum_prop": 0.6388801791713326, "repo_name": "nlloyd/SubliminalCollaborator", "id": "9c85050bc137c592915377822417069cff8a996f", ...
print ("project Euler problem 2: find the sum of the even valued terms of the fibonacci sequence") total=1 dunnoyet=2 m=1 n=2 while total < 4000000: total=m+n m= n n= total #print ("fibonnaci", total) if n%2==0: dunnoyet= dunnoyet + n #print ("sum", dunnoyet) continue else: continue print (dunnoyet)...
{ "content_hash": "9c847ef2940002e94b6649b15b3c6a33", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 98, "avg_line_length": 17.88888888888889, "alnum_prop": 0.6770186335403726, "repo_name": "Greh/Project-Euler", "id": "92f2979dfb4bdcdf07fc4748e8495fa44f93ef82", "size": "32...
import zlib import datetime import calendar import os import logging try: # py2 from cStringIO import StringIO except ImportError: try: # py2 on some platform without cStringIO from StringIO import StringIO except ImportError: # py3k from io import StringIO class class...
{ "content_hash": "56544a7d982a36831ff4b684ae2de1e5", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 89, "avg_line_length": 23.47457627118644, "alnum_prop": 0.6584837545126354, "repo_name": "aheadley/python-naabal", "id": "dd0efba8bd41db979942ed3d1cce3f03680a56be", "size":...
from tincan.serializable_base import SerializableBase from tincan.version import Version from tincan.extensions import Extensions class About(SerializableBase): """Stores info about this installation of `tincan`. :param version: The versions supported. This attribute is required. :type version: list of u...
{ "content_hash": "1e58e69456eb05012d754a7578207787", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 110, "avg_line_length": 32.94690265486726, "alnum_prop": 0.5508998119795864, "repo_name": "RusticiSoftware/TinCanPython", "id": "6f3c0154b55e4f3031cf0407be2e42e40f194412", ...
from django.conf.urls import patterns, include, url from django.views.generic import TemplateView, ListView from django.views.generic.dates import ArchiveIndexView # BLOG from .rssfeeds import LatestBlogFeed from .models import BlogItem, Theme from .views import ( blog_category_view, BlogItemDetailView, B...
{ "content_hash": "9b013c6a658e9003769ff92e7360e2be", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 86, "avg_line_length": 37.9344262295082, "alnum_prop": 0.5933448573898013, "repo_name": "valuesandvalue/valuesandvalue", "id": "2b9e6824965fb8bd9e2de8c6e49e169a5661dfd3", "...
import tornado.escape import tornado.ioloop import tornado.options import tornado.web import tornado.websocket import os.path import torndb, redis from tornado.options import define, options import pickle from session import RedisRecommendationSessionHandler from engine import LinRelRecommender, QueryBasedRecommender...
{ "content_hash": "f27ad7013cc99dc1933b1e3d732000d0", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 155, "avg_line_length": 45.20652173913044, "alnum_prop": 0.5973791776869439, "repo_name": "xiaohan2012/rl-search", "id": "1fb1fab3d7d1ced7d8872501386ce0be0587f89f", "size"...
""" Swaggy Jenkins Jenkins API clients generated from Swagger / Open API specification # noqa: E501 The version of the OpenAPI document: 1.5.1-pre.0 Contact: blah@cliffano.com Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 from swaggyjenkins.m...
{ "content_hash": "8cc6668a1c718d81696c12ba6149d84c", "timestamp": "", "source": "github", "line_count": 380, "max_line_length": 121, "avg_line_length": 47.69736842105263, "alnum_prop": 0.5451586206896551, "repo_name": "cliffano/swaggy-jenkins", "id": "d1caac7c11645c2f2ff1bf3e8b402bcd5e790d88", "siz...
from .test import test_name from .collect import collect_tests from .run import TestDispatcher from .report import generate_known_failures, load_known_failures from .prepare import prepare
{ "content_hash": "5ea7f1d2aa771a5f229e4ee67084f3bd", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 64, "avg_line_length": 37.8, "alnum_prop": 0.8253968253968254, "repo_name": "Sean-Der/thrift", "id": "584cc070fbd3eda766f1e121b3ed1b103d6666e5", "size": "975", "binary": f...
"""For reading and writing TFRecords files.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python import pywrap_tensorflow from tensorflow.python.framework import errors from tensorflow.python.util import compat from tensorflow.python.ut...
{ "content_hash": "69759c411d23e8ccb92a24c7a12b4f2d", "timestamp": "", "source": "github", "line_count": 231, "max_line_length": 117, "avg_line_length": 35.16017316017316, "alnum_prop": 0.688869736518099, "repo_name": "asimshankar/tensorflow", "id": "43086ab18d7774f54be2b393deccec6be180801f", "size"...
from migrate.changeset import UniqueConstraint from migrate import ForeignKeyConstraint from oslo_log import log as logging from sqlalchemy import Boolean, BigInteger, Column, DateTime, Enum, Float from sqlalchemy import dialects from sqlalchemy import ForeignKey, Index, Integer, MetaData, String, Table from sqlalchemy...
{ "content_hash": "125db7ad331f637facf787fcd8919f85", "timestamp": "", "source": "github", "line_count": 1566, "max_line_length": 79, "avg_line_length": 40.76372924648787, "alnum_prop": 0.5907325020364684, "repo_name": "HybridF5/jacket", "id": "25f3afb31ae3c8317b3c2e0e72c248149f150ff7", "size": "644...
import os import re from django.http import HttpResponseRedirect, HttpResponse, Http404 from django.contrib.auth.decorators import login_required from localflavor.us.us_states import US_STATES from django.contrib import messages from django.template.loader import get_template as django_get_template from django.template...
{ "content_hash": "d8a9ffae5af9448c61887e357e1d6e5e", "timestamp": "", "source": "github", "line_count": 2019, "max_line_length": 411, "avg_line_length": 54.65676077265973, "alnum_prop": 0.560760113092649, "repo_name": "solarpermit/solarpermit", "id": "2d5266950863b4662f6ccb168abc7f7bc9286fdf", "siz...
from flask import Markup from itertools import product import random import genetic geneSize = 10; numPolygons = 125 numVertices = 3 canvasSize = 200 # maps strings to dictionaries def domains(): # use same domain for something to make it easier params = {} for x in xrange(0, numPolygons): for y i...
{ "content_hash": "a4ffdb274ce740cc5d551b8fbd7d0e0d", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 135, "avg_line_length": 35.13414634146341, "alnum_prop": 0.5671641791044776, "repo_name": "techx/hackmit-evolution-chamber", "id": "bce385430b3fc6329990b32f96cc048904eefac7",...
import base64 import json import os import re import dill from airflow.contrib.hooks.gcs_hook import GoogleCloudStorageHook from airflow.contrib.operators.mlengine_operator import MLEngineBatchPredictionOperator from airflow.contrib.operators.dataflow_operator import DataFlowPythonOperator from airflow.exceptions imp...
{ "content_hash": "3f95f99dd7dbd786b777564b4588780f", "timestamp": "", "source": "github", "line_count": 230, "max_line_length": 87, "avg_line_length": 44.04782608695652, "alnum_prop": 0.6639028723719278, "repo_name": "r39132/airflow", "id": "e1682ef45ade0b554234a9af1bc35ce0ec746b1f", "size": "10914...
import mock from nova import test from nova.tests import fixtures as nova_fixtures from nova.tests.functional import fixtures as func_fixtures from nova.tests.functional import integrated_helpers from nova.tests.unit.image import fake as fake_image from nova.tests.unit import policy_fixture class HypervisorError(Exc...
{ "content_hash": "e3cc5ee2fc2047ea9677963aeb9ff350", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 79, "avg_line_length": 48.32, "alnum_prop": 0.6556291390728477, "repo_name": "rahulunair/nova", "id": "80e998d466af7cf05bec1d28f436e546507af9a0", "size": "5378", "binary...
"""Module to find the latest green build from Pulse. This module locates the latest green build from Pulse for download. """ import xmlrpclib def GetLatest(server_url, project_name, username, password, command, name, filename, stage): """Get the latest version of an artifact from Pulse. Args: ...
{ "content_hash": "bb51cbea1c023cc8bfafa27094025109", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 77, "avg_line_length": 35.925925925925924, "alnum_prop": 0.6649484536082474, "repo_name": "asacamano/keyczar", "id": "7ff06c3772279f5d528acaf3e293637f54896bc9", "size": "34...
from supriya.tools.systemtools.SupriyaValueObject import SupriyaValueObject class MidiFile(SupriyaValueObject): r'''MIDI file. ''' ### CLASS VARIABLES ### __slots__ = ( '_midi_tracks', ) ### INITIALIZER ### def __init__(self, midi_tracks=None): from supriya.tools im...
{ "content_hash": "28cc2bcfdcfd48fc59c496bc6dcea993", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 75, "avg_line_length": 24.2, "alnum_prop": 0.59366391184573, "repo_name": "andrewyoung1991/supriya", "id": "549ac986e44449406b7f30950f744f3e7c4cc5b9", "size": "752", "bin...
""" gRPC client meant to connect to a gRPC server endpoint, and query the end-point's schema by calling SchemaService.Schema(Empty) and all of its semantics are derived from the recovered schema. """ from __future__ import absolute_import import os import sys import time from random import randint from zlib import dec...
{ "content_hash": "248a21cbdbda68b53ac457f82fb1a7e8", "timestamp": "", "source": "github", "line_count": 314, "max_line_length": 112, "avg_line_length": 37.031847133757964, "alnum_prop": 0.5701754385964912, "repo_name": "open-cloud/xos", "id": "2b2d1e0d8290f30e3641dc22e73bdbe1533c31d1", "size": "122...
"""Reads logs from an Azure subscription.""" import json import tempfile from typing import Optional from azure.mgmt import monitor as az_monitor from azure.core import exceptions as az_exceptions from libcloudforensics import errors as lcf_errors from libcloudforensics.providers.azure.internal import common as lcf_c...
{ "content_hash": "4538e4ab6f92eca121b44a9a4b99e987", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 123, "avg_line_length": 37.345454545454544, "alnum_prop": 0.6879259980525804, "repo_name": "log2timeline/dftimewolf", "id": "91f5a045a6ced5286451f92e48da5d3f7bddcdca", "si...
"""Remove Nth Node From End of List Given a linked list, remove the n-th node from the end of list and return its head. Example: Given linked list: 1 -> 2 -> 3 -> 4 -> 5, and n = 2. After removing the second node from the end, the linked list becomes 1 -> 2 -> 3 ->5 Note: Given n will always be valid. Refer http...
{ "content_hash": "8c90b88e9f16079923596807034edeeb", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 84, "avg_line_length": 24.28048780487805, "alnum_prop": 0.5479658463083877, "repo_name": "aiden0z/snippets", "id": "f49021cbc65e682d1f6cf0e455b59a1e76e9a6f2", "size": "2045...
from puzzle.utils import (get_most_severe_consequence, get_cytoband_coord, get_omim_number, get_gene_info) def test_get_gene_info(): # test with HGNC symbol genes = list(get_gene_info(hgnc_symbols=['CHAT'])) assert len(genes) == 1 assert genes[0].symbol == 'CHAT' assert g...
{ "content_hash": "aa8d091f9f84e84038f251e5c94cbbc7", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 81, "avg_line_length": 36.51948051948052, "alnum_prop": 0.6717638691322901, "repo_name": "robinandeer/puzzle", "id": "2c870ad7ad7211dd18b56951b2b89a3b98ac62aa", "size": "28...
'''stuff we test: * "hello" should work with all enabled schedulers and link against all single-scheduler libraries. * "sleep" should sleep "quickly" with all enabled schedulers (partitioning test) * random checker should find bugs. * valgrind checker should find bugs. * various stuff - like find, sort and accumulate. ...
{ "content_hash": "d6f1d4bfb5bf45fc29199b9e0eaa50db", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 98, "avg_line_length": 31.34090909090909, "alnum_prop": 0.6776649746192893, "repo_name": "jinxuan/checkedthreads", "id": "d99423241fad147641820062d2822145e0964169", "size":...
from __future__ import unicode_literals from django.apps import AppConfig class CustomersConfig(AppConfig): name = 'customers'
{ "content_hash": "9788e908e652dfb52d75700afaebe2af", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 39, "avg_line_length": 19.142857142857142, "alnum_prop": 0.7611940298507462, "repo_name": "rtorres90/learning-python-package-system", "id": "62e59285b0846620e91844c9131ad38592...
pytest_plugins = "pytester"
{ "content_hash": "9cedcd7de2105f000ceed005528d8062", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 27, "avg_line_length": 28, "alnum_prop": 0.75, "repo_name": "pytest-dev/pytest-subtests", "id": "694d7d58d440c236ea8ddcfece9eb605427f7be9", "size": "28", "binary": false, ...
from msrest.serialization import Model class TroubleshootingResult(Model): """Troubleshooting information gained from specified resource. :param start_time: The start time of the troubleshooting. :type start_time: datetime :param end_time: The end time of the troubleshooting. :type end_time: date...
{ "content_hash": "f591896c883e568356e4364d00b051d1", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 80, "avg_line_length": 36.5, "alnum_prop": 0.639269406392694, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "62625db5e1845a2cb0a5aa0fab4d9265462c6464", "size": "156...
from django.dispatch import Signal # The signal which is fired on order status changes. # You should handle this signal to create the payment Source records in Oscar. order_status_changed = Signal(providing_args=["order", "old_status", "new_status"]) payment_updated = Signal(providing_args=['order', 'payment']) pay...
{ "content_hash": "51a7090d58d62ba239e0634847e960a1", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 83, "avg_line_length": 37.785714285714285, "alnum_prop": 0.7391304347826086, "repo_name": "edoburu/django-oscar-docdata", "id": "dcfb22f9cc3f45e40d54fca6fdf06bf69c79fa4d", ...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from twisted.python import components from zope.interface import implements, Interface def foo(): return 2 class X: def __init__(self, x): self.x = x def do(self): #print 'X',self.x,'doing!' ...
{ "content_hash": "0af692f4f712ea7ac121b9943f9d1322", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 48, "avg_line_length": 17.029411764705884, "alnum_prop": 0.6044905008635578, "repo_name": "timkrentz/SunTracker", "id": "3eebc8e6156229c53a3f36bed15534b35a5fd040", "size": ...
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WH...
{ "content_hash": "5046e1bba3c799f6594869b367c94946", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 89, "avg_line_length": 35.1958762886598, "alnum_prop": 0.6707674282366726, "repo_name": "jeremiedecock/snippets", "id": "9a430d952915bdb8b6a02c0a8a2c25f36e2afabd", "size": ...
from tools.load import LoadMatrix lm = LoadMatrix() fm_train_real = lm.load_numbers('../data/fm_train_real.dat') fm_test_real = lm.load_numbers('../data/fm_test_real.dat') label_train_multiclass = lm.load_labels('../data/label_train_multiclass.dat') parameter_list=[ [ fm_train_real, fm_test_real, label_train_multicl...
{ "content_hash": "e3af60bf163e29333fa48ad70f90ce32", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 88, "avg_line_length": 33.03174603174603, "alnum_prop": 0.7385872176838059, "repo_name": "karlnapf/shogun", "id": "b1e85821dd1f0458390421519ad8c9bc4f0fac2a", "size": "2103"...
from rest_framework.parsers import DataAndFiles, MultiPartParser class MultiPartParser(MultiPartParser): """ Parser for multipart form data, which may include file data. Lifted from https://github.com/tomchristie/django-rest-framework/pull/4026/ to work around request.data being empty when multipart/...
{ "content_hash": "663a69d607aa506b782d713879074c19", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 79, "avg_line_length": 41.06896551724138, "alnum_prop": 0.6817800167926112, "repo_name": "harikishen/addons-server", "id": "b0797a6254f4cbe9bb804b9fe1f48f068de06305", "size...
from Adafruit_Nokia_LCD.PCD8544 import *
{ "content_hash": "476c0970e349da6593e4e58ee5a7e681", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 40, "avg_line_length": 41, "alnum_prop": 0.8048780487804879, "repo_name": "adafruit/Adafruit_Nokia_LCD", "id": "b70432833f941faec451433f52cfa31b827f6075", "size": "41", "b...
import urllib2 import json import tarfile import re import os from datetime import datetime from flask import Flask from flask import render_template from flask import request app = Flask(__name__) app.debug = True registry_url = "localhost" if "REGURL" in os.environ: registry_url = os.environ['REGURL'] pri...
{ "content_hash": "beec686ac9b1cad21d080cffdb7f98b2", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 85, "avg_line_length": 29.69924812030075, "alnum_prop": 0.5855696202531645, "repo_name": "nextrevision/docker-registry-ui", "id": "4fdac9b83ec0ad4d98f7d7f0cc4ceb16d3720f81",...
"""The tests for the USGS Earthquake Hazards Program Feed platform.""" import datetime from unittest.mock import MagicMock, call, patch from homeassistant.components import geo_location from homeassistant.components.geo_location import ATTR_SOURCE from homeassistant.components.usgs_earthquakes_feed.geo_location import...
{ "content_hash": "fa5dad3a02e191444d485b6be6d1f723", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 85, "avg_line_length": 34.67213114754098, "alnum_prop": 0.5715130023640662, "repo_name": "Teagan42/home-assistant", "id": "646878c97bdee125aeea16092142f87639eedea0", "size...
"""Models.""" # Suppress pylint invalid import order # pylint: disable-msg=C6203 import logging import settings from django.utils import translation from google.appengine.api import users from google.appengine.ext import db import pytz from ragendja import dbutils from ragendja.auth import google_models # Invalid...
{ "content_hash": "1d8a52af5c8198d744a18e11419cc0f6", "timestamp": "", "source": "github", "line_count": 1193, "max_line_length": 80, "avg_line_length": 36.37300922045264, "alnum_prop": 0.7085705067637638, "repo_name": "Chase235/cloudcourse", "id": "533e8c105c74243d22a426c35e9aba0948bf730e", "size":...
import os from tempfile import NamedTemporaryFile from mock import patch from test_inischema import SAMPLE_CONFIGURATION from test_inischema import SAMPLE_SCHEMA SAMPLE_CONFIGURATION += """ [env] somekey = somevalue """ class TestCommand(object): with NamedTemporaryFile(delete=False) as config_file: ...
{ "content_hash": "9d22d194c65163689547bc6631090d21", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 67, "avg_line_length": 26.30851063829787, "alnum_prop": 0.5564092195713708, "repo_name": "rajegannathan/grasp-lift-eeg-cat-dog-solution-updated", "id": "29fd7e5853044ed052b65...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/lair/bageraset/shared_lair_bageraset.iff" result.attribute_template_id = -1 result.stfName("lair_n","bageraset") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "57f4b19d51394a76340550edd7721e44", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 77, "avg_line_length": 23.384615384615383, "alnum_prop": 0.6973684210526315, "repo_name": "obi-two/Rebelion", "id": "74df982b9d9bc3945b9feb7639e4e8a026dfd6bb", "size": "449...
from sts.entities.sts_entities import * from sts.entities.controllers import * from sts.entities.hosts import *
{ "content_hash": "e1a47d15021809340b9717952f1f3bc0", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 39, "avg_line_length": 37.333333333333336, "alnum_prop": 0.8035714285714286, "repo_name": "jmiserez/sts", "id": "d6d5fcebc39a1809de947c39aad0a44fed4a737f", "size": "694", ...
import requests url = "https://maps.googleapis.com/maps/api/directions/json?origin=place_id%3AChIJ685WIFYViEgRHlHvBbiD5nE&destination=place_id%3AChIJA01I-8YVhkgRGJb0fW4UX7Y&key=YOUR_API_KEY" payload={} headers = {} response = requests.request("GET", url, headers=headers, data=payload) print(response.text) # [END m...
{ "content_hash": "c0ffd70dba152a216da07cd803b23503", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 174, "avg_line_length": 29.083333333333332, "alnum_prop": 0.7851002865329513, "repo_name": "googlemaps/openapi-specification", "id": "7f5591ebb7ebb09c9a875f9a47040a686b4e6ffc...
"""Test the BlueMaestro sensors.""" from homeassistant.components.bluemaestro.const import DOMAIN from homeassistant.components.sensor import ATTR_STATE_CLASS from homeassistant.const import ATTR_FRIENDLY_NAME, ATTR_UNIT_OF_MEASUREMENT from . import BLUEMAESTRO_SERVICE_INFO from tests.common import MockConfigEntry ...
{ "content_hash": "452070232f708a22e4f4da7a3ef251d9", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 86, "avg_line_length": 36.81578947368421, "alnum_prop": 0.7333809864188706, "repo_name": "nkgilley/home-assistant", "id": "e1c7b27673c3560eb890fcb19b11371b41019c90", "size"...
""" Animated Snap 3D ================ An extension to Nuke's "snap" options for animated 3D objects. Based on a selection of vertices, this allows for objects to match the position, rotation and scale of that selection over a specified frame range. ## Usage As the name suggests, this adds "animated" options to the ...
{ "content_hash": "e102417220d7ce1ba385e003c40fdb72", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 80, "avg_line_length": 33.721804511278194, "alnum_prop": 0.6015607580824972, "repo_name": "ThoriumGroup/thorium", "id": "1844c6ae2a8e9b6f4c43b5c75d21f7cc69047292", "size":...
from msrest.serialization import Model class VerificationIPFlowResult(Model): """Results of IP flow verification on the target resource. :param access: Indicates whether the traffic is allowed or denied. Possible values include: 'Allow', 'Deny' :type access: str or ~azure.mgmt.network.v2016_12_01.mo...
{ "content_hash": "3fb211f54daa548512b1f8d5f67eab6c", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 75, "avg_line_length": 35.869565217391305, "alnum_prop": 0.6424242424242425, "repo_name": "lmazuel/azure-sdk-for-python", "id": "19f43d9e528f2d01376349876bda3e7470011baf", ...
import numpy import chainer from chainer import backend from chainer.backends import cuda from chainer.functions.activation import lstm from chainer.functions.array import reshape from chainer.functions.array import stack from chainer.functions.connection import linear from chainer.functions.connection import n_step_r...
{ "content_hash": "0e1e202d4a04053c6aabc9db79a72fc1", "timestamp": "", "source": "github", "line_count": 441, "max_line_length": 79, "avg_line_length": 44.07936507936508, "alnum_prop": 0.544009465507485, "repo_name": "jnishi/chainer", "id": "85a6b9c1182600203c5145cf80588c7c3e09d16b", "size": "19439"...
from graphscale.utils import execute_sql, param_check def create_kvetch_objects_table_sql(): return """CREATE TABLE IF NOT EXISTS kvetch_objects ( row_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, obj_id BINARY(16) NOT NULL, type_id INT NOT NULL, created DATETIME NOT NULL, updated DATETIME NOT NU...
{ "content_hash": "9f71bcb1e39c644085b3e3da2064aff9", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 91, "avg_line_length": 34.73684210526316, "alnum_prop": 0.6768939393939394, "repo_name": "schrockntemp/graphscaletemp", "id": "a6796bebd2eeab971caf25f5dce2a831da9b94e7", "s...
from application import app app.run(debug=True, host="0.0.0.0", port=5003)
{ "content_hash": "df20a4f143a91b5bb3227e952a70a4d7", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 46, "avg_line_length": 19.25, "alnum_prop": 0.7142857142857143, "repo_name": "LandRegistry/register-metadata", "id": "c818a92ba97d3da54996d566de341154236bc0d3", "size": "77"...
from runner.koan import * class AboutLists(Koan): def test_creating_lists(self): empty_list = list() self.assertEqual(list, type(empty_list)) self.assertEqual(0, len(empty_list)) def test_list_literals(self): nums = list() self.assertEqual([], nums) nums[0:] =...
{ "content_hash": "c6c3ec6c75d1adc9410fcd3f9fa652a0", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 79, "avg_line_length": 32.19191919191919, "alnum_prop": 0.5622842798870411, "repo_name": "codetestcode/pyintdemo", "id": "139dddab533074c5b82235a08a8c44a588d0195b", "size":...
from circuits.web import Controller from .helpers import urlencode, urlopen class Root(Controller): def index(self, *args, **kwargs): args = tuple(( x.encode("utf-8") if type(x) != str else x for x in args )) return "{0}\n{1}".format(repr(args), repr(kwargs)) de...
{ "content_hash": "0af5b8681c2fc9a18f070ca76ba40322", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 61, "avg_line_length": 26.458333333333332, "alnum_prop": 0.5559055118110237, "repo_name": "nizox/circuits", "id": "1d7ac2a8baefe9d0a011485b2c76cac668efb0f7", "size": "658",...
"""Network units used in the Dozat and Manning (2017) biaffine parser.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from dragnn.python import digraph_ops from dragnn.python import network_units from syntaxnet.util import check...
{ "content_hash": "ba0c3f953f8dd8dfc63867348e7dc199", "timestamp": "", "source": "github", "line_count": 240, "max_line_length": 80, "avg_line_length": 40.895833333333336, "alnum_prop": 0.6629648497198166, "repo_name": "fx2003/tensorflow-study", "id": "c34a2ed6a3c6dfb7117d8f8299dffdb757c0b469", "siz...
""" Run a package found with qibuild find. """ from __future__ import absolute_import from __future__ import unicode_literals from __future__ import print_function import qisys.parsers import qisys.command import qisys.envsetter import qibuild.run import qibuild.find import qibuild.parsers def configure_parser(parse...
{ "content_hash": "308fefc8c6ce9433db764d56e35389c1", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 78, "avg_line_length": 37.5, "alnum_prop": 0.6808888888888889, "repo_name": "aldebaran/qibuild", "id": "7e44063aa25b52bf963672b78a51834cbb898b07", "size": "1322", "binary...