text
stringlengths
4
1.02M
meta
dict
from __future__ import unicode_literals import os import sys import pbr.version sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))) # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the d...
{ "content_hash": "9de35ac16b41a3179afcb33bb16ba2bc", "timestamp": "", "source": "github", "line_count": 216, "max_line_length": 79, "avg_line_length": 32.101851851851855, "alnum_prop": 0.6988751081626766, "repo_name": "citrix-openstack-build/keystoneauth", "id": "bc6a5c42fcfc8b1e71be00c0a6bb04444ca80...
import re import json import os from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request, HtmlResponse from scrapy.utils.response import get_base_url from scrapy.utils.url import urljoin_rfc from product_spiders.items import Product, ProductLoaderWithNameStrip...
{ "content_hash": "710335177b5d4f7be84e250957ba36e6", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 114, "avg_line_length": 37.056603773584904, "alnum_prop": 0.6242362525458248, "repo_name": "0--key/lib", "id": "02f3c81dcae4d7b861f800709a46de57c01548e6", "size": "1964", ...
import os import csv import random import collections from builtins import len import datasets from tflearn.data_utils import to_categorical class Acner(): def __init__(self, train_validate_split=None, test_split=None, use_defaults=False, shuffle=True): self.construct() self.lo...
{ "content_hash": "70234b295585d0adbdbd15ad0203219e", "timestamp": "", "source": "github", "line_count": 317, "max_line_length": 89, "avg_line_length": 40.74447949526814, "alnum_prop": 0.5556673892846082, "repo_name": "mindgarage/Ovation", "id": "74ee3b9906d8a9c3bdb75af00e20c5981b5f4918", "size": "1...
import subprocess import os def convertWavToFlac(filename='SendClip.wav'): # Delete if filename exists lastindex = filename.rfind('.') newname = filename[0 : lastindex] + '.flac' os.path.exists(newname) and os.remove(newname) output = subprocess.Popen(["flac", "--keep-foreign-metadata", filename])...
{ "content_hash": "42bcaf625a1d9f9bfe738f7210377bf1", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 93, "avg_line_length": 32.36363636363637, "alnum_prop": 0.6966292134831461, "repo_name": "decebel/gspeech-py", "id": "12ea53bc17cd205187648305172017ff4f9709f4", "size": "35...
import kivy kivy.require('1.9.0') from kivy.app import App from kivy.uix.floatlayout import FloatLayout from kivy.uix.behaviors import ToggleButtonBehavior from kivy.uix.actionbar import ActionPrevious from kivy.animation import Animation from kivy.lang import Builder import videocontroller Builder.load_file('actio...
{ "content_hash": "4fd3937dae49fedab11b03c97dba3d4e", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 61, "avg_line_length": 25.764705882352942, "alnum_prop": 0.6552511415525114, "repo_name": "pimier15/PyGUI", "id": "54d9afc9858c32498819dd60bb6718565aba193b", "size": "1341"...
"""Tool for uploading diffs from a version control system to the codereview app. Usage summary: upload.py [options] [-- diff_options] [path...] Diff options are passed to the diff command of the underlying system. Supported version control systems: Git Mercurial Subversion Perforce CVS It is important for...
{ "content_hash": "1023fa8dc81ff19db6759db16883e76f", "timestamp": "", "source": "github", "line_count": 2314, "max_line_length": 111, "avg_line_length": 36.9304235090752, "alnum_prop": 0.624957581005652, "repo_name": "nareshboddepalli/touchites-test", "id": "c7478a09053c7eb7866e4438eff94d7032c35773",...
""" Copyright 2010-2012 Asidev s.r.l. 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, soft...
{ "content_hash": "8482cbeff14eea212af268b492afe5b8", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 77, "avg_line_length": 36.275510204081634, "alnum_prop": 0.6559774964838256, "repo_name": "asidev/aybu-controlpanel", "id": "590f16b8e96d8a2b2bcb8a488a9931bfa565f5e9", "siz...
import json from urllib import urlencode from urlparse import urljoin from error import build_api_error from datetime import datetime from http import http_request # @todo Sandboxing? # @todo "Single Request Call" def require_access_token(func): def inner_func(self, *args, **kwargs): if not self.access_to...
{ "content_hash": "8512b99fef4e8f1437d586e3291a64fe", "timestamp": "", "source": "github", "line_count": 564, "max_line_length": 164, "avg_line_length": 32.4113475177305, "alnum_prop": 0.5299234135667396, "repo_name": "LawnmowerIO/plaid-python", "id": "20128cf75a950aa939c4049d6fec661c266abc9f", "siz...
import unittest from datetime import datetime from unittest import mock from urllib.parse import parse_qs from bs4 import BeautifulSoup from parameterized import parameterized from airflow.www import utils from tests.test_utils.config import conf_vars class TestUtils(unittest.TestCase): def test_empty_variable_...
{ "content_hash": "5d26f658089b2fcddd9bc24dddef5a75", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 93, "avg_line_length": 38.19591836734694, "alnum_prop": 0.5727719598204745, "repo_name": "Fokko/incubator-airflow", "id": "3d196b33261d8db66fe3100812f1b5b14a24d654", "size...
"""The cookie plugins manager object.""" from __future__ import unicode_literals # pylint: disable=redundant-returns-doc class CookiePluginsManager(object): """Class that implements the cookie plugins manager.""" _plugin_classes = {} @classmethod def DeregisterPlugin(cls, plugin_class): """Deregisters...
{ "content_hash": "945ebf40c38e3ccb31bbcf535236b681", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 76, "avg_line_length": 27.767123287671232, "alnum_prop": 0.6822890971879625, "repo_name": "rgayon/plaso", "id": "bb6465f72fe5b80e6bb6f2c44539d0564ccc093c", "size": "2051", ...
import collections class Solution: def removeDuplicateLetters(self, s: str) -> str: table = collections.Counter(s) visited = set() result = [] for c in s: table[c] -= 1 if c in visited: continue while result and c <...
{ "content_hash": "52819c7c674e5a3c23ff9abf6c734621", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 70, "avg_line_length": 28.842105263157894, "alnum_prop": 0.45072992700729925, "repo_name": "jiadaizhao/LeetCode", "id": "245a0e866a551d4a5ab7b1b20ad551fc6d7f73bb", "size": ...
from __future__ import unicode_literals import collections import copy import datetime import decimal import inspect import re import uuid from collections import OrderedDict from django.conf import settings from django.core.exceptions import ValidationError as DjangoValidationError from django.core.exceptions import...
{ "content_hash": "a7678f354618628908026ff99621896d", "timestamp": "", "source": "github", "line_count": 1846, "max_line_length": 127, "avg_line_length": 36.02329360780065, "alnum_prop": 0.5919788267492744, "repo_name": "ossanna16/django-rest-framework", "id": "7a79ae93cbf978807d28d2461cb64f861242778b...
""" Exception definitions. """ class UnsupportedVersion(Exception): """Indicates that the user is trying to use an unsupported version of the API. """ pass class InvalidAPIVersion(Exception): pass class CommandError(Exception): pass class AuthorizationFailure(Exception): pass class...
{ "content_hash": "420e8d49f46c91873f6d43baed3ca221", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 79, "avg_line_length": 25.386243386243386, "alnum_prop": 0.6196331804918717, "repo_name": "scottdangelo/cinderclient-api-microversions", "id": "8399e607943f3c3f0df6df7531d6e...
""" Support for getting the state of a Thermoworks Smoke Thermometer. Requires Smoke Gateway Wifi with an internet connection. """ from __future__ import annotations import logging from requests import RequestException from requests.exceptions import HTTPError from stringcase import camelcase, snakecase import therm...
{ "content_hash": "e2ab0fb96dfb53af3693f6cf0527c1de", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 88, "avg_line_length": 32.84705882352941, "alnum_prop": 0.6060171919770774, "repo_name": "rohitranjan1991/home-assistant", "id": "72be9a055192a2bc43de338385e5d5c9ceb00581", ...
import abc import json import logging from pathlib import Path import networkx logger = logging.getLogger(__name__) class ProtocolException(Exception): pass class BaseRepository(abc.ABC): def __init__(self, absolute_path: Path): if not absolute_path.exists(): logger.error("repository p...
{ "content_hash": "695c1a804da824c9ef9a48d5993cfeb0", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 100, "avg_line_length": 26.279411764705884, "alnum_prop": 0.634023503077784, "repo_name": "Brutus5000/BiReUS", "id": "cc0f9bf919215f0c1a911dfbccd339c604169d4b", "size": "18...
"""The Greplin root package.""" import pkg_resources pkg_resources.declare_namespace('greplin')
{ "content_hash": "9fa8228ff218d4c4b1657614cd021f32", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 42, "avg_line_length": 24.25, "alnum_prop": 0.7628865979381443, "repo_name": "alex/scales", "id": "f522ad0909205e2e6ecf3e060b770c20f70bdf50", "size": "681", "binary": fals...
"""Base classes for our unit tests. Allows overriding of config for use of fakes, and some black magic for inline callbacks. """ import eventlet eventlet.monkey_patch(os=False) import os import shutil import sys import fixtures import mox import stubout import testtools from oslo.config import cfg from tuskar.db...
{ "content_hash": "5005309abf652f85790cfdb7e0c0040a", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 77, "avg_line_length": 32.83980582524272, "alnum_prop": 0.6140428677014043, "repo_name": "tuskar/tuskar", "id": "092a116a811ffd96c5a659f63e152c16ea16a900", "size": "7542",...
""" """ def parallel_process(array, function, n_jobs=16, use_kwargs=False, front_num=3): """ A parallel version of the map function with a progress bar. From : http://danshiebler.com/2016-09-14-parallel-progress-bar/ Args: array (array-like): An array to iterate over. ...
{ "content_hash": "4784e04d1d1210c642a14cea06c37b33", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 117, "avg_line_length": 34, "alnum_prop": 0.6042780748663101, "repo_name": "sdrdl/sdipylib", "id": "93eb06b386ae3c1cf11e51503e181488b5ce7e96", "size": "2407", "binary": f...
from __future__ import unicode_literals from ..enums import IncrementalSearchDirection, InputMode from ..keys import Keys from ..line import ClipboardData, ClipboardDataType, SelectionType, indent, unindent from ..selection import SelectionType from .basic import basic_bindings from .utils import create_handle_decorat...
{ "content_hash": "e7bf69006ffc4f2389ca7af08d0d3157", "timestamp": "", "source": "github", "line_count": 973, "max_line_length": 128, "avg_line_length": 34.87872559095581, "alnum_prop": 0.5826384182455727, "repo_name": "Carreau/python-prompt-toolkit", "id": "05e9224ca03b38591665dd67902190c1fc82ad7e", ...
#!/usr/bin/python # -*- coding: utf-8 -*- # BY: رضا (User:reza1615 on fa.wikipedia) # Distributed under the terms of the CC-BY-SA 3.0. import wikipedia import pagegenerators,query,sys import fa_cosmetic_changes import re, os, codecs, catlib,login wikipedia.config.put_throttle = 0 wikipedia.put_throttle.setDelay() ...
{ "content_hash": "8487d106f42f1ef52cc33afc3189655e", "timestamp": "", "source": "github", "line_count": 435, "max_line_length": 354, "avg_line_length": 48.836781609195405, "alnum_prop": 0.49322161551496896, "repo_name": "PersianWikipedia/fawikibot", "id": "842c1d2f4a9399d3100d24842fad790f396bd6b0", ...
import sys import re import os from stat import * import getopt err = sys.stderr.write dbg = err rep = sys.stdout.write new_interpreter = None preserve_timestamps = False create_backup = True keep_flags = False add_flags = b'' def main(): global new_interpreter global preserve_timestamps global create_b...
{ "content_hash": "886866bf397e36d5bf922ebb5589c417", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 81, "avg_line_length": 27.8989898989899, "alnum_prop": 0.5454380883417813, "repo_name": "batermj/algorithm-challenger", "id": "d252321a21a172a9cb6a483e3ad0573298f5c52a", "...
""" test parquet compat """ import pytest import datetime from distutils.version import LooseVersion from warnings import catch_warnings import numpy as np import pandas as pd from pandas.compat import PY3, is_platform_windows, is_platform_mac from pandas.io.parquet import (to_parquet, read_parquet, get_engine, ...
{ "content_hash": "0bcb15284205bcd5d594e9bb41dadd52", "timestamp": "", "source": "github", "line_count": 521, "max_line_length": 79, "avg_line_length": 34.53934740882917, "alnum_prop": 0.5583773270352875, "repo_name": "harisbal/pandas", "id": "3b3e7f757bf60dc81cfd8ad34c95943aede5c30e", "size": "1799...
from __future__ import absolute_import, print_function # noinspection PyPackageRequirements,PyUnresolvedReferences from six.moves.urllib.parse import urlsplit __author__ = 'Tyler Butler <tyler@tylerbutler.com>' try: # noinspection PyPackageRequirements,PyUnresolvedReferences from flask import request, url_fo...
{ "content_hash": "54a3f334b342f2b247feeff3720d022d", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 63, "avg_line_length": 29.583333333333332, "alnum_prop": 0.7464788732394366, "repo_name": "tylerbutler/propane", "id": "17922b44f805283d58627957e74e65b1dec20c7c", "size": "...
"""Tests for the PVOutput config flow.""" from unittest.mock import AsyncMock, MagicMock from pvo import PVOutputAuthenticationError, PVOutputConnectionError from homeassistant.components.pvoutput.const import CONF_SYSTEM_ID, DOMAIN from homeassistant.config_entries import SOURCE_REAUTH, SOURCE_USER from homeassista...
{ "content_hash": "2a798e71400c8c523f942acdd2edac36", "timestamp": "", "source": "github", "line_count": 282, "max_line_length": 81, "avg_line_length": 31.77304964539007, "alnum_prop": 0.6466517857142857, "repo_name": "toddeye/home-assistant", "id": "444a35565f69faaa525ed7267888ce7695d451fe", "size"...
r"""HTTP cookie handling for web clients. This module has (now fairly distant) origins in Gisle Aas' Perl module HTTP::Cookies, from the libwww-perl library. Docstrings, comments and debug strings in this code refer to the attributes of the HTTP cookie system as cookie-attributes, to distinguish them clearly from Pyt...
{ "content_hash": "559998a8add628988658911617f859c8", "timestamp": "", "source": "github", "line_count": 2091, "max_line_length": 83, "avg_line_length": 36.324725011956005, "alnum_prop": 0.5385425580936081, "repo_name": "timm/timmnix", "id": "9fcd4c6f462e47f869f7cf67d496da38d7faf527", "size": "75955...
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django_extensions.db.fields class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ...
{ "content_hash": "519abe63588a1415df2376931854d02d", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 143, "avg_line_length": 41.333333333333336, "alnum_prop": 0.6151026392961877, "repo_name": "letsmeet-click/letsmeet.click", "id": "346e06db9506f71dfb017939e7977f96ad6d3566", ...
import time from xserverpy.utils.porgress import Progress from xserverpy.utils.config import * from xserverpy.utils import config class IntegrationWatcher(): def __init__(self, integrations_service, integration, interval): self.integration = integration self.integrations_service = integrations_se...
{ "content_hash": "00cb5edf14699bf74a5a62d05b612275", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 97, "avg_line_length": 35.40909090909091, "alnum_prop": 0.5882541720154044, "repo_name": "oarrabi/xserverpy", "id": "9bc14eb2651a45ee5df7b2b188fc2af55bfec71d", "size": "311...
import os from perfkitbenchmarker import errors from perfkitbenchmarker import flags from perfkitbenchmarker import linux_packages from perfkitbenchmarker import object_storage_service from perfkitbenchmarker import providers from perfkitbenchmarker import vm_util flags.DEFINE_boolean('openstack_swift_insecure', Fals...
{ "content_hash": "80b38fe9d242507fa26c645c3a6e718f", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 75, "avg_line_length": 34.29113924050633, "alnum_prop": 0.6670358065706903, "repo_name": "meteorfox/PerfKitBenchmarker", "id": "60e346c2e793bf69f23c497780e35c3affa8878b", "...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Bot', fields=[ ('i...
{ "content_hash": "efb1a81597af61dfac8688a685f3339b", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 137, "avg_line_length": 38.98039215686274, "alnum_prop": 0.5372233400402414, "repo_name": "nmalaguti/mini-halite", "id": "6e7437a067eee6118d60453e23813af3bd11ebf5", "size":...
from utils import * from model import * class Handler(BaseHandler): repo_required = False def get(self): self.env.robots_ok = True self.render('start.html', cache_seconds=0, get_vars=self.get_vars) def get_vars(self): # Round off the count so people don't expect it to change ever...
{ "content_hash": "e783168a75b36145e4df7e843ef54f41", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 76, "avg_line_length": 33.5, "alnum_prop": 0.5808457711442786, "repo_name": "kspviswa/personfinder", "id": "cf19fc7b59b63f88ef2cf48449c1abcfe2137df7", "size": "1402", "bi...
import copy import json import urlparse import requests from keystoneclient import exceptions from keystoneclient.v2_0 import tenants from tests import utils class TenantTests(utils.TestCase): def setUp(self): super(TenantTests, self).setUp() self.TEST_REQUEST_HEADERS = { 'X-Auth-Tok...
{ "content_hash": "1e8a8ff5c1b618c3336c560419ac8228", "timestamp": "", "source": "github", "line_count": 411, "max_line_length": 78, "avg_line_length": 34.98053527980535, "alnum_prop": 0.4771510050775544, "repo_name": "tylertian/Openstack", "id": "bf87e3509f2f762324265ad2966b077fc703787f", "size": "...
from setuptools import setup, find_packages from sys import version_info from pysendpulse import ( __author__, __author_email__, __version__ ) install_requires = ['python3-memcached', ] if version_info.major == 2: install_requires = ['python-memcached', 'requests', 'simplejson'] with open("README.md"...
{ "content_hash": "39fb7764a7f48a1356a55e43cae0d02f", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 80, "avg_line_length": 28.321428571428573, "alnum_prop": 0.6847414880201765, "repo_name": "sendpulse/sendpulse-rest-api-python", "id": "55f4505417dbbf272afafbda48cb756685f643...
import os import mock import tempfile from smtLayer import smt from zvmsdk import config from zvmsdk import database from zvmsdk import exception from zvmsdk import smtclient from zvmsdk import utils as zvmutils from zvmsdk.tests.unit import base CONF = config.CONF class SDKSMTClientTestCases(base.SDKTestCase): ...
{ "content_hash": "dda6c3126df98ca97f8b00402f3e4163", "timestamp": "", "source": "github", "line_count": 2756, "max_line_length": 79, "avg_line_length": 50.16727140783745, "alnum_prop": 0.5318925799755535, "repo_name": "mfcloud/python-zvm-sdk", "id": "011c0f994abb16d4d7f9577b4ed2183f8d5782d4", "size...
import datetime import rmc.models as m import rmc.test.lib as testlib class SimpleCourseAlert(m.BaseCourseAlert): def send_alert(self, sections): return True class BaseCourseAlertTest(testlib.FixturesTestCase): def tearDown(self): # Clear DB for other tests SimpleCourseAlert.objects...
{ "content_hash": "61320ede57ffa19249a4009b8b53d4f2", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 74, "avg_line_length": 32.626506024096386, "alnum_prop": 0.6240768094534712, "repo_name": "sachdevs/rmc", "id": "ff9fe7092656f18110ef0af5dff3fb2e637fe671", "size": "2708", ...
import mechanize import requests import os import argparse import csv # Sample for getting Spring Semester of 2015: # python scraper.py -c true -ft 1 -fy 2015 -lt 1 -ly 2015 # 1 is Spring, 4 is Summer, 7 is Fall parser = argparse.ArgumentParser() #if we want to do conversion parser.add_argument('-c', '--convert', n...
{ "content_hash": "ba947933d7dbccef6d1497475f9fcccc", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 571, "avg_line_length": 44.84, "alnum_prop": 0.6504608980077312, "repo_name": "antsankov/cufcq", "id": "675818b22f4db483153c5d551b63a7a3844ef439", "size": "6862", "binar...
import hashlib, inspect, os, random, sys # Gets the secret token provided by OpenShift # or generates one (this is slightly less secure, but good enough for now) def get_openshift_secret_token(): token = os.getenv('OPENSHIFT_SECRET_TOKEN') name = os.getenv('OPENSHIFT_APP_NAME') uuid = os.getenv('OPENSHIF...
{ "content_hash": "5c3c5dc42e1521fe4481269ea1e0472b", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 138, "avg_line_length": 37.01176470588236, "alnum_prop": 0.647488874761602, "repo_name": "cansoftinc/bmprototype", "id": "a75be1830a73c2d455cf43b014026eda6904a15f", "size":...
import aggravator import yaml from click.testing import CliRunner def test_list(): runner = CliRunner() result = runner.invoke(aggravator.cli, [ '--vault-password-file=/dev/null', '--uri=example/config.yml', '--env=prod', '--list' ]) assert result.exit_code == 0 data...
{ "content_hash": "b34482943e9248178649ee0cfdc63a80", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 57, "avg_line_length": 28.77777777777778, "alnum_prop": 0.61003861003861, "repo_name": "petercb/aggravator", "id": "5ea7feb2626e99c2829bfceafcaa91e573603528", "size": "518"...
import os.path import sys APP_PATH = os.path.dirname(os.path.abspath(__file__)) PROJECT_PATH = os.path.dirname(APP_PATH) sys.path.append(APP_PATH) for p in os.listdir(os.path.join(PROJECT_PATH, "env/lib/")): python_lib = os.path.join(PROJECT_PATH, "env/lib/%s/site-packages" % p) sys.path.append(python_lib)
{ "content_hash": "fec3b0b5707763c0695fe8a05eca62e8", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 75, "avg_line_length": 31.8, "alnum_prop": 0.7012578616352201, "repo_name": "nyodas/enjoliver", "id": "a1d4e2d48f419145fca19e2acb482591d34b7c2e", "size": "318", "binary":...
"Test replace, coverage 78%." from idlelib.replace import ReplaceDialog import unittest from test.support import requires requires('gui') from tkinter import Tk, Text from unittest.mock import Mock from idlelib.idle_test.mock_tk import Mbox import idlelib.searchengine as se orig_mbox = se.tkMessageBox showerror = Mb...
{ "content_hash": "7288ef06a40d06586a45c7b131bdeb97", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 70, "avg_line_length": 28.24829931972789, "alnum_prop": 0.5403973509933775, "repo_name": "batermj/algorithm-challenger", "id": "c3c5d2eeb94998bdfb643eaabdf8e8eec213ce98", ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function # no unicode literals import WatchmanTestCase import tempfile import os import os.path class TestSince(WatchmanTestCase.WatchmanTestCase): def test_sinceIssue1(self): root = self.mkdtemp() ...
{ "content_hash": "ea15b8c81993997105c8fc2162d36057", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 75, "avg_line_length": 36.944, "alnum_prop": 0.545257687310524, "repo_name": "dhruvsinghal/watchman", "id": "a5d8a75e201692d42f49b2c059af019bd3a91d49", "size": "9346", "...
from time import strftime, gmtime, localtime import sys from os.path import dirname, abspath from inspect import getfile, currentframe currentdir = dirname(abspath(getfile(currentframe()))) parentdir = dirname(currentdir) sys.path.insert(0, parentdir) from sippy.Math.recfilter import recfilter from sippy.Time.clock_dt...
{ "content_hash": "f4e6452b4956560d3675e39dad60d869", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 101, "avg_line_length": 30.677884615384617, "alnum_prop": 0.5361228647547407, "repo_name": "dsanders11/rtpproxy", "id": "cfc5325cddf867840be394e87477555116b524a1", "size":...
"""PRAW Integration test suite.""" import pytest from betamax import Betamax from praw import Reddit class IntegrationTest(object): """Base class for PRAW integration tests.""" def setup(self): """Setup runs before all test cases.""" self.setup_reddit() self.setup_betamax() def s...
{ "content_hash": "8b3593be652c5c8ccb365c81899eca83", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 77, "avg_line_length": 36.03125, "alnum_prop": 0.6244579358196011, "repo_name": "RGood/praw", "id": "8ec5b389e62d3f903709b23d75c4691a0527752c", "size": "1153", "binary": ...
from dotmailer import Base from dotmailer.constants import constants from dotmailer.connection import connection from dotmailer.address_books import AddressBook class ContactScore(Base): """ Scoring information about a specific contact. """ contact_id = None email = None date_modified = N...
{ "content_hash": "bb9e2401e1bc8db14f92d2b4a2e8876a", "timestamp": "", "source": "github", "line_count": 849, "max_line_length": 129, "avg_line_length": 33.4640753828033, "alnum_prop": 0.548695927633663, "repo_name": "Mr-F/dotmailer", "id": "9e8188b6958b68c8c05a0a1caeafe35479752465", "size": "28411"...
"""Deprecation helpers for Home Assistant.""" import functools import inspect import logging from typing import Any, Callable, Dict, Optional from ..helpers.frame import MissingIntegrationFrame, get_integration_frame def deprecated_substitute(substitute_name: str) -> Callable[..., Callable]: """Help migrate prop...
{ "content_hash": "3db92df6ad2ab804524e826929c9a41d", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 139, "avg_line_length": 39.13559322033898, "alnum_prop": 0.5493720225205717, "repo_name": "turbokongen/home-assistant", "id": "7478a7fede98ede1a4e3c532505de7ed9b2173b3", "...
import struct import socket import time from trackpy.vendors.redis import redis class Torrent(object): def __init__(self, info_hash): self.info = redis.hgetall(info_hash) self.info_hash = info_hash def can_announce(self, peer_id): timestamp = int(redis.get("%s_%s" % (self.info_hash, peer_id)) or 0) ...
{ "content_hash": "7b5d293a122144847a08f24ef8c9a069", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 72, "avg_line_length": 24.32, "alnum_prop": 0.6332236842105263, "repo_name": "vtemian/university_projects", "id": "89380c6ec050f1f2d7f04948ca97c9c11bb3b2e2", "size": "1216"...
""" """ # from activations import * from activations import LinearActivation, ReluActivation, SoftmaxActivation, \ IdentityActivation, TanhActivation, SequenceSoftmaxActivation from attrs import ExtraAttr from default_decorators import wrap_name_default, wrap_act_default, \ wrap_param_default, wrap_bias_attr_d...
{ "content_hash": "bdc915f5482c6cbce7c2e85c01a38f8a", "timestamp": "", "source": "github", "line_count": 1478, "max_line_length": 82, "avg_line_length": 34.971583220568334, "alnum_prop": 0.5747368828354744, "repo_name": "cxysteven/Paddle", "id": "fb533a47e0b0585be6f0e019086993f8b3aa7f38", "size": "5...
import unittest import test_collective_api_base as test_base class TestCollectiveReduceScatterAPI(test_base.TestDistBase): def _setup_config(self): pass def test_reduce_scatter_nccl_dygraph(self): dtypes_to_test = [ "float16", "float32", "float64", ...
{ "content_hash": "4c5497619ee49f4aef566532f3e5af7a", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 61, "avg_line_length": 25, "alnum_prop": 0.4860606060606061, "repo_name": "luotao1/Paddle", "id": "26dfbd2fe13bbc73ac193d708ef4263c0ad201d0", "size": "1436", "binary": fa...
"""Test client utility functions.""" import exceptions import imp import os import sys import tempfile import time import mox from grr.client import client_utils_common from grr.client import client_utils_linux from grr.client import client_utils_osx from grr.lib import flags from grr.lib import rdfvalue from grr.li...
{ "content_hash": "0168e60bb26de940bbd4076d696a2117", "timestamp": "", "source": "github", "line_count": 252, "max_line_length": 80, "avg_line_length": 33.46031746031746, "alnum_prop": 0.6731499051233396, "repo_name": "simsong/grr-insider", "id": "c63952b22a5f3d76b207590eb2e03dba68b84409", "size": "...
__author__ = 'Sidath' from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy import Quiz app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db' db = SQLAlchemy(app) class Quiz(): id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(8...
{ "content_hash": "42a5ccca07d2fb09621814a874132528", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 64, "avg_line_length": 29.842105263157894, "alnum_prop": 0.6278659611992945, "repo_name": "SGCreations/kdumooc", "id": "264932d37aab69dde45356856ae72e87a7a33cea", "size": "...
from flexmock import EXACTLY from flexmock import AT_LEAST from flexmock import AT_MOST from flexmock import UPDATED_ATTRS from flexmock import Mock from flexmock import MockBuiltinError from flexmock import FlexmockContainer from flexmock import FlexmockError from flexmock import MethodSignatureError from flexmock imp...
{ "content_hash": "b41bdd342e2fd2770eb82cfcdca1e493", "timestamp": "", "source": "github", "line_count": 1664, "max_line_length": 86, "avg_line_length": 34.85396634615385, "alnum_prop": 0.6578098867182786, "repo_name": "has207/flexmock", "id": "cc58ed30cdbf242ddacbf13772a703c5f30e0a9d", "size": "580...
import functools import os import routes import webob.dec import webob.exc import nova.api.openstack from nova.api.openstack import wsgi from nova.api.openstack import xmlutil from nova import exception from nova import flags from nova import log as logging import nova.policy from nova import utils from nova import w...
{ "content_hash": "b14fc62646e8a8f4ffa74f7328bf6fe2", "timestamp": "", "source": "github", "line_count": 377, "max_line_length": 78, "avg_line_length": 31.50397877984085, "alnum_prop": 0.5924896859476299, "repo_name": "russellb/nova", "id": "8d04b017f7da3de4ab4a16b4d8247ce5d34f18ec", "size": "12590"...
from datetime import datetime now = datetime.now() # 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....
{ "content_hash": "a03826181dfda4ba8222a848f032dd0c", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 80, "avg_line_length": 31.80081300813008, "alnum_prop": 0.6850313179087306, "repo_name": "trungdong/cookiecutter-django", "id": "b53e6a7e78c81bd69ae2e446bed80be46357bde2", ...
from django.contrib import admin from .models import Book admin.site.register(Book)
{ "content_hash": "fa71a799e4b54cce2f545c994c2d08c0", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 32, "avg_line_length": 17.2, "alnum_prop": 0.8023255813953488, "repo_name": "dlab-projects/equal-read-interface", "id": "af94c1dabfd1eb2300f844f584dfebfba014d91d", "size": "...
import pbr.version __version__ = pbr.version.VersionInfo( 'osccloud').version_string()
{ "content_hash": "8d2fe51501cce4e802be2da6869fc214", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 38, "avg_line_length": 18.6, "alnum_prop": 0.6989247311827957, "repo_name": "dtroyer/osc-cloud", "id": "276279850ff29599bffb6f63a5c3865e69d6bdd0", "size": "664", "binary":...
from setuptools import find_packages from distutils.core import setup setup( author=u'Matt Cowger & Magnus Nilson', author_email='matt@cowger.us', name='PythonScale', description='Python interface to ScaleIO 1.3 REST API', version="0.1", url='https://github.com/swevm/scaleio_sdk/', license=...
{ "content_hash": "b9a1fe05c985aa14dbc1ba3316b7995b", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 71, "avg_line_length": 32.083333333333336, "alnum_prop": 0.638961038961039, "repo_name": "swevm/scaleio_sdk", "id": "1c9d642e5fd0a10a53edc241fe7fdbbec1657a26", "size": "816...
from pysys.constants import * from xpybuild.xpybuild_basetest import XpybuildBaseTest class PySysTest(XpybuildBaseTest): def execute(self): msg = self.xpybuild(shouldFail=False) self.xpybuild(stdouterr='xpybuild-options', args=['--options']) def validate(self): self.assertDiff('build-output/defaults.txt', 'd...
{ "content_hash": "03d035690bd44fb043689af9d1ec62ec", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 180, "avg_line_length": 64.15384615384616, "alnum_prop": 0.781374900079936, "repo_name": "xpybuild/xpybuild", "id": "85465e7adc91a3ac31da986fada4c33cde2ab28e", "size": "250...
class OpenStackEnvException(Exception): pass class UnsupportedResourceTypeException(OpenStackEnvException): def __init__(self, resource_type): super(UnsupportedResourceTypeException, self).__init__() self.resource_type = resource_type class ResourceAlreadyExistsException(OpenStackEnvExceptio...
{ "content_hash": "7bd4abb526448a63f878726cfba240f8", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 77, "avg_line_length": 32, "alnum_prop": 0.7164351851851852, "repo_name": "smithsane/openstack-env", "id": "e77ae8954212c1bc6408252bd4857c24f223fb00", "size": "1694", "bi...
from setuptools import find_packages, setup def get_install_required(): with open("./requirements.txt", "r") as reqs: requirements = reqs.readlines() return [r.rstrip() for r in requirements] setup( name='PyFolding', version='1.0', description='PyFolding is a simple Python based framework ...
{ "content_hash": "f3306b61fa726422579a5bc027862710", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 75, "avg_line_length": 34.666666666666664, "alnum_prop": 0.6909340659340659, "repo_name": "quantumjot/PyFolding", "id": "5f4b236ea46b1d560144ec5c0ccdd561afb1f92b", "size": ...
""" General-purpose Part-related objects """ from pptx.opc.packuri import PackURI from pptx.util import Collection class PartCollection(Collection): """ Sequence of parts. Sensitive to partname index when ordering parts added via _loadpart(), e.g. ``/ppt/slide/slide2.xml`` appears before ``/ppt/slide...
{ "content_hash": "3d621b0066392c705d56fdd43963a3d4", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 76, "avg_line_length": 32.46666666666667, "alnum_prop": 0.6293634496919918, "repo_name": "Hitachi-Data-Systems/org-chart-builder", "id": "3174795124604ec9c9a42e954ba50e868ce9...
from datetime import date from django.contrib.gis.db import models as gis from django.db import models from django.utils import timezone from myvoice.core.validators import validate_year class Region(gis.Model): """Geographical regions""" TYPE_CHIOCES = ( ('country', 'Country'), ('state', 'S...
{ "content_hash": "7c5092f4ed1c5b0efc4a830ab1e0a9ff", "timestamp": "", "source": "github", "line_count": 267, "max_line_length": 94, "avg_line_length": 33.49438202247191, "alnum_prop": 0.6724812702672481, "repo_name": "myvoice-nigeria/myvoice", "id": "957e6e9c2208718f08de851c4202f24a76617c3b", "size...
"""Implementation of image ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.pyth...
{ "content_hash": "cb916c6e794acd100b47d0a6b95f0bb3", "timestamp": "", "source": "github", "line_count": 1326, "max_line_length": 141, "avg_line_length": 36.984162895927604, "alnum_prop": 0.6662384535388757, "repo_name": "jjas0nn/solvem", "id": "7d185a81376e4996ecdcc0e6a08d27bbe5490e47", "size": "49...
import time import lib.stm32 import lib.stlinkex # Stm32 L0 and L1 programming class Flash(): PECR_OFFSET = 4 PEKEYR_OFFSET = 0x0c PRGKEYR_OFFSET = 0x10 OPTKEYR_OFFSET = 0x14 SR_OFFSET = 0x18 STM32L0_NVM_PHY = 0x40022000 STM32L1_NVM_PHY = 0x40023c00 STM32_...
{ "content_hash": "2b33314c6c0a3d7013594b2ac6e8d8ed", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 80, "avg_line_length": 41.12682926829268, "alnum_prop": 0.5327956351559721, "repo_name": "pavelrevak/pystlink", "id": "093c5a6d39781efd8fe3f22c9640fee4ead7ff56", "size": "...
from sqlalchemy import Column, String, INTEGER, DATETIME, FLOAT, Text from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import UniqueConstraint from sqlalchemy.orm import class_mapper Base = declarative_base() class ImageMeta(Base): __tablename__ = 'tbl_images' id = Column(INTEGER, pri...
{ "content_hash": "adc8349a643f1431c014df957938f70a", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 86, "avg_line_length": 29.0561797752809, "alnum_prop": 0.6384377416860015, "repo_name": "wrenchzc/photomanager", "id": "e8ba4df28410d40ec3cd683758abc90741f449fe", "size": "...
"""Pretty print a byte stream suspected to be UTF-8 text. This should work with most versions of Python on Posix systems. In particular it works with CPython 2.6, CPython 2.7, and CPython 3.3+, on Linux and Darwin, with narrow (16 bits per character) and wide (21 or more bits per character) Unicode strings, and with t...
{ "content_hash": "ff1530d78cdafb2e538f6c197dd89a57", "timestamp": "", "source": "github", "line_count": 363, "max_line_length": 80, "avg_line_length": 28.72176308539945, "alnum_prop": 0.625071935545751, "repo_name": "google/language-resources", "id": "89d3d081a188d947ce387a7f777c492056ae6459", "siz...
"""Test Google Smart Home.""" from homeassistant.core import State from homeassistant.const import ( ATTR_SUPPORTED_FEATURES, ATTR_UNIT_OF_MEASUREMENT, TEMP_CELSIUS) from homeassistant.setup import async_setup_component from homeassistant.components import climate from homeassistant.components.google_assistant impo...
{ "content_hash": "5afa0d3b17fcfd7991a27edf50e798df", "timestamp": "", "source": "github", "line_count": 314, "max_line_length": 74, "avg_line_length": 28.863057324840764, "alnum_prop": 0.4519474787597926, "repo_name": "persandstrom/home-assistant", "id": "66e7747e06a776498e34af548b63f4148d95ace4", ...
import pytari2600.memory.cartridge as cartridge import unittest import pkg_resources class TestCartridge(unittest.TestCase): def test_cartridge(self): cart = cartridge.GenericCartridge(pkg_resources.resource_filename(__name__, 'dummy_rom.bin'), 4, 0x1000, 0xFF9, 0x0) # Write should do nothing ...
{ "content_hash": "6b06708ed93b197b43a7e65e7a86a4ff", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 126, "avg_line_length": 35.625, "alnum_prop": 0.6514619883040935, "repo_name": "ajgrah2000/pytari2600", "id": "422453266d1ce6d300e0d6223648ce2ac3457ec2", "size": "855", "...
from django.http import Http404, HttpResponse from django.core.exceptions import PermissionDenied from corehq.apps.domain.decorators import login_and_domain_required, domain_specific_login_redirect from functools import wraps from corehq.apps.users.models import CouchUser, CommCareUser from django.utils.translation imp...
{ "content_hash": "2532c4d9e172ba83c1496805bc53ae92", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 131, "avg_line_length": 43.33, "alnum_prop": 0.6473574890376183, "repo_name": "qedsoftware/commcare-hq", "id": "1ba17692a35f696a776cc7be4dfb1c600ea2352c", "size": "4333", ...
import heron.explorer.src.python.args as args from heron.common.src.python.color import Log from tabulate import tabulate import heron.common.src.python.utils as utils def create_parser(subparsers): parser = subparsers.add_parser( 'topologies', help='Display running topologies', usage="%(prog)s cluster/...
{ "content_hash": "1a450163a28b12d5e8274a4a65ae52bb", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 86, "avg_line_length": 30.03030303030303, "alnum_prop": 0.6619576185671039, "repo_name": "cliffyg/heron", "id": "703b7529308a07b1b613be5a1b74c89989a710fd", "size": "3566", ...
""" Demonstrate how to use major and minor tickers. The two relevant userland classes are Locators and Formatters. Locators determine where the ticks are and formatters control the formatting of ticks. Minor ticks are off by default (NullLocator and NullFormatter). You can turn minor ticks on w/o labels by setting t...
{ "content_hash": "8b4e6bbc1e09fdf6ddbc5d241c0dcd28", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 71, "avg_line_length": 32, "alnum_prop": 0.7735849056603774, "repo_name": "yavalvas/yav_com", "id": "ec9db46734142324aabc6f1d22d68b2f70ce61e0", "size": "1718", "binary": ...
from __future__ import annotations import typing as T from .baseobjects import MesonInterpreterObject if T.TYPE_CHECKING: from .baseobjects import TYPE_var, TYPE_kwargs class Disabler(MesonInterpreterObject): def method_call(self, method_name: str, args: T.List[TYPE_var], kwargs: TYPE_kwargs) -> TYPE_var: ...
{ "content_hash": "3406aafa0bbf4813c55ec2362298d604", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 101, "avg_line_length": 27.875, "alnum_prop": 0.6188340807174888, "repo_name": "pexip/meson", "id": "182bb625ccc358c2dc7af9a478befb761241bec9", "size": "1484", "binary": ...
import json from urllib2 import Request as request import urllib2 import ast # get the bus lines from the website and parse it to a list def get_list(start): # url = 'http://widgets.vvo-online.de/abfahrtsmonitor/Abfahrten.do?ort=Dresden&hst=CasparDavidFriedrichStra%C3%9Fe' url = 'http://widgets.vvo-online.de/ab...
{ "content_hash": "5bea35e0b31ba90c6f133c7c525080c2", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 118, "avg_line_length": 34.25925925925926, "alnum_prop": 0.6994594594594594, "repo_name": "NWuensche/TimetableBus", "id": "00b8c2a7f460d5c61c1ac7ac6e935f72a5f7fdf0", "size"...
import os from optparse import make_option from django.core.management.base import BaseCommand, CommandError from database_files.models import File class Command(BaseCommand): option_list = BaseCommand.option_list + ( # make_option('-w', '--overwrite', action='store_true', # dest='overwrite', d...
{ "content_hash": "ae74b0ae1813a706916c8cc05560a92d", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 79, "avg_line_length": 33.35, "alnum_prop": 0.6611694152923538, "repo_name": "rhunwicks/django-database-files", "id": "36534c9b859c81109d67fe49652227fe7d50b37e", "size": "6...
from babel import dates, core, Locale from website import mails from website import models as website_models from website.notifications import constants from website.notifications import utils from website.notifications.model import NotificationDigest from website.notifications.model import NotificationSubscription fr...
{ "content_hash": "57041d9ae86882c8dcc2e2c3706d300c", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 115, "avg_line_length": 40.239263803680984, "alnum_prop": 0.6686994968745236, "repo_name": "haoyuchen1992/osf.io", "id": "f6d0e88869c521f828162f59dd22eb004bdbe833", "size"...
""" rpc中间件,可以监控rpc的一些状态或者做一些tracelog记录 """ import random, hashlib, gevent class ClientMiddleware: def __init__(self): self.called = True def client_before_request(self, event): self.method = event.name def client_after_request(self, req_event, rep_event, exception): pass ...
{ "content_hash": "7e162063b86fb5ef44a1074e0c9a2518", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 85, "avg_line_length": 31.08955223880597, "alnum_prop": 0.600096015362458, "repo_name": "openslack/openslack-api", "id": "4561e4fca6fbd233c2f0cfc4f40785c32f7f1d65", "size":...
""" Unit tests for Neutron base agent. """ import mock from neutron.agent import rpc as agent_rpc from networking_hyperv.neutron.agent import base as agent_base from networking_hyperv.tests import base as test_base class _BaseAgent(agent_base.BaseAgent): def _get_agent_configurations(self): pass d...
{ "content_hash": "c31f7cc2e605003a2fb2f7aff2b8eb50", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 78, "avg_line_length": 30.38157894736842, "alnum_prop": 0.6271113035946297, "repo_name": "stackforge/networking-hyperv", "id": "9f4908c1d52f7d4220cf3c840a89994a85bc4655", "...
from __future__ import print_function import pytest from datetime import datetime from numpy import random import numpy as np from pandas.compat import lrange, lzip, u from pandas import (compat, DataFrame, Series, Index, MultiIndex, date_range, isnull) import pandas as pd from pandas.util.test...
{ "content_hash": "5cb240af7df13e3e1bd92c265260f173", "timestamp": "", "source": "github", "line_count": 932, "max_line_length": 79, "avg_line_length": 37.87339055793991, "alnum_prop": 0.5386424160009066, "repo_name": "ammarkhann/FinalSeniorCode", "id": "a6326083c1beeb36eeda14860e346b35c505945d", "s...
while True: s = raw_input('Enter something:') if s == 'quit': break if len(s) < 3: continue print 'Input is of sufficient length'
{ "content_hash": "6defc51caedb7c3f6b55fd7f582dceb7", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 41, "avg_line_length": 23.142857142857142, "alnum_prop": 0.5493827160493827, "repo_name": "xingchaoma/github-python-study", "id": "ff67bb7ce1c9af54477e3377636cbc68b390786b", ...
""" Datastore utility functions """ from oslo_log import log as logging from oslo_vmware import exceptions as vexc from oslo_vmware.objects import datastore as ds_obj from oslo_vmware import pbm from oslo_vmware import vim_util as vutil from nova import exception from nova.i18n import _, _LE, _LI from nova.virt.vmwar...
{ "content_hash": "566c6949d0f94ca0a6c0f9ef8001c025", "timestamp": "", "source": "github", "line_count": 424, "max_line_length": 78, "avg_line_length": 40.176886792452834, "alnum_prop": 0.608981508658644, "repo_name": "j-carpentier/nova", "id": "c8755d54ee86b79f4e162c4f4666f8328e746839", "size": "17...
""":" work_dir=$(dirname $0) base_name=$(basename $0) cd $work_dir if [ $HOD_PYTHON_HOME ]; then exec $HOD_PYTHON_HOME -OO -u $base_name ${1+"$@"} elif [ -e /usr/bin/python ]; then exec /usr/bin/python -OO -u $base_name ${1+"$@"} elif [ -e /usr/local/bin/python ]; then exec /usr/local/bin/python -OO -u $base_name ${1+...
{ "content_hash": "96b5d88ef89ff363ddc5b6c28939bb64", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 145, "avg_line_length": 32.36923076923077, "alnum_prop": 0.5741444866920152, "repo_name": "CodingCat/LongTermFairScheduler", "id": "5017203ce2ab360d09ada78f5bb36419fcea89ef"...
import RPi.GPIO as GPIO, time, os #Constants NUM_TESTS = 3 NUM_TESTS_PER_VALUE = 5 def readResistance(RCpin): ''' Read the resistance with the pin stated in the input, returns an integer with the number of clock cycles passed ''' #Discharge the pins and capacitor GPIO.setup(RCpin...
{ "content_hash": "8176cff226c7c1912781ff39f308eb0f", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 174, "avg_line_length": 30.685185185185187, "alnum_prop": 0.5386240193120096, "repo_name": "basimkhajwal/RaspberryPi", "id": "548877ef3514c2118857fe74608adc8a35a04f75", "s...
''' @author: Sana Dev Team Created on May 12, 2011 ''' from __future__ import with_statement import logging import urllib try: import json except ImportError: import simplejson as json from django.conf import settings from django.core.mail import send_mail from piston.handler import BaseHandler from pist...
{ "content_hash": "d0a67a341915889fb79b15a5578414b2", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 105, "avg_line_length": 33.08771929824562, "alnum_prop": 0.6166489925768823, "repo_name": "satvikdhandhania/vit-11", "id": "da541dba442c854c1351b5bc922009326c1bb137", "size...
from twisted.trial import unittest from axiom import store from xmantissa import ixmantissa, endpoint class MantissaQ2Q(unittest.TestCase): def testInstallation(self): d = self.mktemp() s = store.Store(unicode(d)) q = endpoint.UniversalEndpointService(store=s) q.installOn(s) ...
{ "content_hash": "08a497cfb456b4a77f4ea7c01d008f61", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 58, "avg_line_length": 28.76923076923077, "alnum_prop": 0.7058823529411765, "repo_name": "twisted/mantissa", "id": "03161e10d3d974bfa2d6db87f4024e151c71efd9", "size": "375"...
from django.contrib import admin from dbparti import backend from dbparti.backends.exceptions import PartitionColumnError, PartitionFilterError class PartitionableAdmin(admin.ModelAdmin): partition_show = 'all' def __init__(self, *args, **kwargs): super(PartitionableAdmin, self).__init__(*args, **kwa...
{ "content_hash": "b76f9335600e30528a6d6b50ca17b82e", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 106, "avg_line_length": 40.44736842105263, "alnum_prop": 0.6148340923877684, "repo_name": "maxtepkeev/django-db-parti", "id": "b8bf867988cdfc7b2c180919e93859cbf1b45bf1", "s...
from __future__ import print_function, division import imgaug as ia from imgaug import augmenters as iaa from scipy import misc, ndimage import numpy as np from skimage import data import cv2 TIME_PER_STEP = 10000 def main(): image = data.astronaut() print("image shape:", image.shape) print("Press any key...
{ "content_hash": "660deaf8160d252346b90247085ed68d", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 112, "avg_line_length": 29.764705882352942, "alnum_prop": 0.5718050065876152, "repo_name": "nektor211/imgaug", "id": "8b83e092c1a53371f52224644fce7bec2ba98865", "size": "15...
from django.utils.translation import ugettext_lazy as _ # noqa from horizon import exceptions from horizon import forms from horizon.utils import fields from horizon.utils import validators from horizon import workflows from openstack_dashboard import api port_validator = validators.validate_port_or_colon_separated...
{ "content_hash": "92a34439ae42b15b07655003e021b63f", "timestamp": "", "source": "github", "line_count": 299, "max_line_length": 78, "avg_line_length": 37.424749163879596, "alnum_prop": 0.5699731903485254, "repo_name": "ikargis/horizon_fod", "id": "d54bec57c292153d982144876bcf967079a63811", "size": ...
import os import shutil from subprocess import Popen from vex.tests import path_type, str_type class TempVenv(object): def __init__(self, parent, name, args): assert isinstance(parent, path_type) assert isinstance(name, str_type) assert os.path.abspath(parent) == parent self.parent...
{ "content_hash": "de2f77c9a2854f4a2120687268d6eac0", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 63, "avg_line_length": 30.53846153846154, "alnum_prop": 0.5969773299748111, "repo_name": "sashahart/vex", "id": "70d2860dfc3263c6252364784f407b3a3af43513", "size": "1191", ...
from matplotlib import pyplot as plt from ..core.status import Status class PlotBase(object): def __init__(self, analysis): self.analysis = analysis def plot_by(self, by, variable, df, gridLines = False): ax = df.plot(kind='scatter',x=by ,y=variable,title=variable+" By " +by,alpha=0.6,legend...
{ "content_hash": "159001302c9de407d14af78ad9e47ba7", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 101, "avg_line_length": 26.15, "alnum_prop": 0.5812619502868069, "repo_name": "peterdougstuart/PCWG", "id": "f27787631f793d0cd426970efab262f90c7690f7", "size": "524", "bi...
import os import itertools from setuptools import setup, find_packages with open(os.path.join(os.path.dirname(__file__), "sentinels", "__version__.py")) as version_file: exec(version_file.read()) setup(name="sentinels", classifiers = [ "Development Status :: 4 - Beta", "Intended Audience...
{ "content_hash": "2334f2b447b9dafa39aa3f874388d580", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 98, "avg_line_length": 34.2962962962963, "alnum_prop": 0.5950323974082073, "repo_name": "vmalloc/sentinels", "id": "9abc46039f6fc78f5de2d4f7985b3c452cb82178", "size": "927"...
"""The test for the sql sensor platform.""" import unittest import pytest import voluptuous as vol from homeassistant.components.sql.sensor import validate_sql_select from homeassistant.const import STATE_UNKNOWN from homeassistant.setup import setup_component from tests.common import get_test_home_assistant class...
{ "content_hash": "ae3315118f981e76bb92a20351f5b232", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 70, "avg_line_length": 29.35211267605634, "alnum_prop": 0.5038387715930902, "repo_name": "mKeRix/home-assistant", "id": "8b8bca5e37c9b994ffc29f26bb6f591052fadf13", "size": ...
import time # For sleeping between sensoract transfers import sys, os # For importing from project directory from DataSink import DataSink from SensorAct.SensorActUploader import SensorActUploader from SensorAct.SensorActDeviceRegisterer import SensorActDevic...
{ "content_hash": "8857a6a4737ebd109657738ac6cc94f6", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 88, "avg_line_length": 39.74074074074074, "alnum_prop": 0.5632183908045977, "repo_name": "nesl/LabSense", "id": "28cbce64afe32fb5e42fb80c327c793ae11b4626", "size": "3219", ...
import itertools from copy import deepcopy from django.utils.hashcompat import md5_constructor from django.utils.safestring import mark_safe from mypage.widgets.models import Widget, RenderedWidget from mypage.widgets.models import get_object from mypage.widgets.templatetags.splitobjectlist import split_list from myp...
{ "content_hash": "49fe3511ece3a19757a5f3a546067b56", "timestamp": "", "source": "github", "line_count": 279, "max_line_length": 215, "avg_line_length": 33.27956989247312, "alnum_prop": 0.6150780829294561, "repo_name": "ella/mypage", "id": "cc6d33da13e690666332dac12cc6908b0b7e160a", "size": "9285", ...
from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('Movies', '0002_auto_20161108_0054'), ] operations = [ migrations.AddField( model_name='movie', ...
{ "content_hash": "25fd678bda8ec3b44d47146a6d32c489", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 122, "avg_line_length": 30.057142857142857, "alnum_prop": 0.564638783269962, "repo_name": "odty101/MediaCollector", "id": "27ba20f254db637cbff7a814d2cc7906e0dce1ac", "size"...
from django.core.exceptions import PermissionDenied from django.utils.encoding import force_text from django.utils.html import escape class LookupChannel(object): """ Subclass this, setting the model and implementing methods to taste. Attributes: model (Model): The Django Model that this lookup ...
{ "content_hash": "8666d6e5d5b626d1147d3db8969ac69a", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 119, "avg_line_length": 36.26119402985075, "alnum_prop": 0.6342868903066474, "repo_name": "roberzguerra/rover", "id": "11adc72e65e57aa9533718d14f30df6a66449597", "size": "...
import ast import sys import os #################################################################################################################################################################################################################################### ##########################################################...
{ "content_hash": "804e02238c9ba072f44144c0caf8d086", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 228, "avg_line_length": 63.451219512195124, "alnum_prop": 0.37353449932731114, "repo_name": "dimtion/jml", "id": "81327bac3dc0c1c3e4b3afcda1cd593ef13e5982", "size": "11241...
"""Our models structure.""" from sqlalchemy import ( Column, Index, Integer, Unicode, Float, ForeignKey ) from .meta import Base class User(Base): """Model for our users.""" __tablename__ = 'users' id = Column(Integer, primary_key=True) username = Column(Unicode, unique=True...
{ "content_hash": "281ef712dc6646485311651c9a408aed", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 69, "avg_line_length": 21.21875, "alnum_prop": 0.6480117820324006, "repo_name": "Bonanashelby/MoodBot", "id": "5d4cea6f8d307804df78d467e5b5ca4266f611e7", "size": "679", "...
from pandac.PandaModules import Vec4, BitMask32, Quat, Point3, NodePath from pandac.PandaModules import OdePlaneGeom, OdeBody, OdeSphereGeom, OdeMass, OdeUtil, OdeBoxGeom from direct.directnotify import DirectNotifyGlobal from toontown.minigame import DistributedMinigamePhysicsWorld from toontown.minigame import IceGam...
{ "content_hash": "8884846985d32945500458d4d6596e32", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 168, "avg_line_length": 48.294444444444444, "alnum_prop": 0.6896353387783274, "repo_name": "linktlh/Toontown-journey", "id": "d48600369690eb7af3c37e207768f209e624499b", "s...
''' resource API wrapper @author: Youyk ''' import os import sys import traceback import time import apibinding.api_actions as api_actions import apibinding.inventory as inventory import account_operations # Define default get resource method. default is using searchAPI, it can also be ListAPI. SEARCH_RESOURCE_MET...
{ "content_hash": "02b99ebc82138426c92f65d58b6ef304", "timestamp": "", "source": "github", "line_count": 429, "max_line_length": 120, "avg_line_length": 35.97435897435897, "alnum_prop": 0.676861271301756, "repo_name": "live4thee/zstack-utility", "id": "b135bdf7634e70b383548e8f3e6b3703656ae62f", "siz...
import json import scrapy # Most AJAX based websites can be scraped by reproducing the API calls made # by the browser, as we do in this simple example that scrapes # a website paginated via infinite scrolling (quotes.toscrape.com/scroll) class ToScrapeInfiniteScrollingSpider(scrapy.Spider): name = 'toscrape-infi...
{ "content_hash": "fae1a962dbf219500f504d23a99852e5", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 78, "avg_line_length": 38.22222222222222, "alnum_prop": 0.686046511627907, "repo_name": "fpldataspiders/SPIDERS", "id": "a5492a8ce0320056ba209e3c5a2bac0ee7e60866", "size": ...
import mock from oslo_config import cfg from neutron.common import config as neutron_config from neutron.plugins.ml2 import config as ml2_config from neutron.tests import base UCSM_IP_ADDRESS_1 = '1.1.1.1' UCSM_USERNAME_1 = 'username1' UCSM_PASSWORD_1 = 'password1' UCSM_IP_ADDRESS_2 = '2.2.2.2' UCSM_USERNAME_2 = 'us...
{ "content_hash": "c2c81003da0948857af3214c9050aa9c", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 78, "avg_line_length": 30.358490566037737, "alnum_prop": 0.5997513983840895, "repo_name": "CiscoSystems/networking-cisco", "id": "6357e2de86c5c6f96bb2c219be4061ae0bb65235", ...
import os import tempfile import vtk import wx # get the slice3dVWR marked by the user sv = devideApp.ModuleManager.getMarkedModule('slice3dVWR') mc = devideApp.ModuleManager.getMarkedModule('marchingCubes') if sv and mc: # bring the window to the front sv.view() # make sure it actually happens wx.Yie...
{ "content_hash": "b283735fc84e534773fef0e7aa047902", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 76, "avg_line_length": 27.794871794871796, "alnum_prop": 0.6688191881918819, "repo_name": "chrisidefix/devide", "id": "5058af8bbc840b83923e1ed54164e000c68631bf", "size": "1...