text
stringlengths
4
1.02M
meta
dict
"""Test the onboarding views.""" import asyncio import os from unittest.mock import patch import pytest from homeassistant.components import onboarding from homeassistant.components.onboarding import const, views from homeassistant.const import HTTP_FORBIDDEN from homeassistant.helpers import area_registry as ar from...
{ "content_hash": "8931c2f7511b3d22ec093cdf168599df", "timestamp": "", "source": "github", "line_count": 482, "max_line_length": 88, "avg_line_length": 30.66804979253112, "alnum_prop": 0.6319848464348532, "repo_name": "lukas-hetzenecker/home-assistant", "id": "582ad5a436b0b074f8dc1988082f2a1112cf9083"...
''' Created on 18 sept. 2015 @author: arxit ''' import os.path from collections import OrderedDict from pyspatialite import dbapi2 as db from qgis.core import * from PyQt4.QtCore import QFileInfo, QVariant, QObject, pyqtSignal, QSettings from PyQt4.QtGui import QMessageBox import main from PagLuxembourg.schema impo...
{ "content_hash": "e031683d31ae101083f33b584e260083", "timestamp": "", "source": "github", "line_count": 679, "max_line_length": 165, "avg_line_length": 32.27098674521355, "alnum_prop": 0.5432639649507119, "repo_name": "Geoportail-Luxembourg/qgis-pag-plugin", "id": "937f98812d092c800d4ce0788dce6ffd89e...
""" Component to interface with garage doors that can be controlled remotely. For more details about this component, please refer to the documentation at https://home-assistant.io/components/garage_door/ """ import logging import os import voluptuous as vol from homeassistant.config import load_yaml_config_file from...
{ "content_hash": "56be940c3a7fdecf03daf271daf311ef", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 78, "avg_line_length": 33.21621621621622, "alnum_prop": 0.6653105505831299, "repo_name": "varunr047/homefile", "id": "c5576b1da844c915791abf7a7c5f298c5641ec8d", "size": "3...
""" Common functions used by different CLI interfaces. """ from __future__ import print_function import argparse import traceback from oslo_log import log as logging import six import nova.conf import nova.db.api from nova import exception from nova.i18n import _, _LE from nova import utils CONF = nova.conf.CO...
{ "content_hash": "40e640531ded4a0a5b3f8e5b073ed90f", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 79, "avg_line_length": 31.986301369863014, "alnum_prop": 0.6079229122055675, "repo_name": "cloudbase/nova", "id": "cd15a2252961b344d0ff60d7e2aad4bda06f60a6", "size": "5309...
from datetime import timedelta as td import json from unittest.mock import patch from django.core import mail from django.utils.timezone import now from hc.api.models import Channel, Check, Notification from hc.test import BaseTestCase class NotifyWhatsAppTestCase(BaseTestCase): def _setup_data(self, notify_up=T...
{ "content_hash": "9aa6a09f2d32535301643c7d7f8a7d20", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 83, "avg_line_length": 33.45977011494253, "alnum_prop": 0.6489178976296806, "repo_name": "iphoting/healthchecks", "id": "5245be29459c9e6aefdf9d92d4cb2841880aaa76", "size": ...
import tempfile from django.conf import settings from django.core.files.uploadedfile import InMemoryUploadedFile # noqa from django.core.urlresolvers import reverse from django.forms.widgets import HiddenInput # noqa from django import http from django.test.utils import override_settings from mox3.mox import IsA #...
{ "content_hash": "00c604d9ac86b1bf4cc9f103996e830d", "timestamp": "", "source": "github", "line_count": 408, "max_line_length": 79, "avg_line_length": 39.6764705882353, "alnum_prop": 0.5607857672349889, "repo_name": "Tesora/tesora-horizon", "id": "002ea76bff44034c94e5714413d0aa69db39e332", "size": ...
#! /bin/env python import os thisdir = os.path.abspath(os.path.dirname(__file__)) sourcedir = os.path.join(thisdir,'source') libdir = os.path.join(thisdir,'lib') __version__ = '1.3' def build(sources,libs,out,minified_out,header=None): sources = [os.path.join(sourcedir,s) for s in sources] libs = [os.path.j...
{ "content_hash": "dbace7dced6c578600bcb7924a44a03a", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 91, "avg_line_length": 27.324324324324323, "alnum_prop": 0.552917903066271, "repo_name": "pylover/joop", "id": "2e022282deca91e7e15df4102cce0510580d75f9", "size": "2022", ...
import xcffib import struct import io _events = {} _errors = {} class ClientMessageData(xcffib.Union): def __init__(self, unpacker): if isinstance(unpacker, xcffib.Protobj): unpacker = xcffib.MemoryUnpacker(unpacker.pack()) xcffib.Union.__init__(self, unpacker) self.data8 = xcffi...
{ "content_hash": "5058c11325145ad1ad7b327df2c90315", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 61, "avg_line_length": 36.5, "alnum_prop": 0.6270928462709284, "repo_name": "tych0/xcffib", "id": "d07b49261889b7719f3d99d104628471e41fc788", "size": "657", "binary": fal...
import json from django.contrib.auth.decorators import user_passes_test from django.core.urlresolvers import reverse from django.http import HttpResponse from django.shortcuts import render, redirect from django.template.loader import render_to_string from django.utils.translation import ugettext as _ from django_qbe...
{ "content_hash": "79e84e05f34a3c747b2a6be3535d725d", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 89, "avg_line_length": 36.90731707317073, "alnum_prop": 0.6086439333862014, "repo_name": "versae/qbe", "id": "d0736042a5c52e2fe9b2b03f5f20c1c45f495f9c", "size": "7590", ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('lexicon', '0008_auto_20151202_1146'), ] operations = [ migrations.CreateModel( name='LanguageBranches', fields=[ ...
{ "content_hash": "912ed6fcf4bf9e7c28d67f9fad5a8e02", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 78, "avg_line_length": 30.625, "alnum_prop": 0.5346938775510204, "repo_name": "lingdb/CoBL-public", "id": "15d7cbb511a75563d242cb93c608081e5584f075", "size": "759", "bina...
from __future__ import absolute_import import os import platform from . import option_list if 'DIGITS_SERVER_NAME' in os.environ: value = os.environ['DIGITS_SERVER_NAME'] else: value = platform.node() option_list['server_name'] = value
{ "content_hash": "ed818b237e52334a6dd5e6811e77bdd3", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 44, "avg_line_length": 19.076923076923077, "alnum_prop": 0.7137096774193549, "repo_name": "ethantang95/DIGITS-GAN", "id": "16946588304089dc400d9582e33688aff0935cb1", "size"...
from msrest.serialization import Model class Provider(Model): """Resource provider information. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: The provider ID. :vartype id: str :param namespace: The namespace of the resource provider. :t...
{ "content_hash": "32a06c999d71fbf73a35bf94c60f67c4", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 85, "avg_line_length": 33.94736842105263, "alnum_prop": 0.6364341085271318, "repo_name": "v-iam/azure-sdk-for-python", "id": "6f24dc41953bfa71aecdd9322fe320d5fa2d08eb", "si...
from cookies.resources.helpers import makeCookieHeader, setNoCacheAndCORSHeaders from wptserve.utils import isomorphic_encode def main(request, response): """Respond to `/cookies/resources/setSameSiteNone.py?{value}` by setting two cookies: 1. `samesite_none_insecure={value};SameSite=None;path=/` 2. `same...
{ "content_hash": "a2950cd4aef93318c34d15052e3feea9", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 120, "avg_line_length": 47.9375, "alnum_prop": 0.7249022164276402, "repo_name": "ric2b/Vivaldi-browser", "id": "446c75eb44735f328d13982d943fa6b1046e2fe8", "size": "767", ...
from pysnmp.proto.secmod.rfc3826.priv import aes from pysnmp.proto.secmod.rfc3414.auth import hmacmd5, hmacsha from pysnmp.proto.secmod.rfc3414 import localkey class Aes256(aes.Aes): serviceID = (1, 3, 6, 1, 4, 1, 9, 12, 6, 1, 2) # cusmAESCfb256PrivProtocol keySize = 32 # 3.1.2.1 def localizeKey(self...
{ "content_hash": "c6f37eb25f9f26b711cab3af0026f42d", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 79, "avg_line_length": 41.56, "alnum_prop": 0.6361886429258903, "repo_name": "xfguo/pysnmp", "id": "874c83a58f2ac0d0be4d3f91e44dc3f1d433caaf", "size": "1142", "binary": f...
""" @file copy_make_border.py @brief Sample code that shows the functionality of copyMakeBorder """ import sys from random import randint import cv2 as cv def main(argv): ## [variables] # First we declare the variables we are going to use borderType = cv.BORDER_CONSTANT window_name = "copyMakeBorder D...
{ "content_hash": "488130a1cfac70dc35cc87545b8fb845", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 87, "avg_line_length": 30.231884057971016, "alnum_prop": 0.5556088207094918, "repo_name": "opencv/opencv", "id": "ff1f3669c7472d2bfe707a03f94345eb1874f5ce", "size": "2086",...
"""General implementation of walking commits and their contents.""" from collections import defaultdict import collections import heapq from itertools import chain from dulwich.diff_tree import ( RENAME_CHANGE_TYPES, tree_changes, tree_changes_for_merge, RenameDetector, ) from dulwich.errors imp...
{ "content_hash": "83eca600c0318c552c0e69946851e38e", "timestamp": "", "source": "github", "line_count": 354, "max_line_length": 81, "avg_line_length": 37.41242937853107, "alnum_prop": 0.5738447598912715, "repo_name": "KaranToor/MA450", "id": "b5997db75a32c820107ce517c9ab1103dcac0d17", "size": "1405...
from os import fstat from datetime import datetime from os.path import join, exists, abspath from six.moves.urllib.parse import unquote from tornado.concurrent import return_future from thumbor.loaders import LoaderResult @return_future def load(context, path, callback): file_path = join( context.config...
{ "content_hash": "c393d0666f456c40852b35f12967b2f4", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 75, "avg_line_length": 28.52173913043478, "alnum_prop": 0.6516768292682927, "repo_name": "okor/thumbor", "id": "88bc5e1db0bcd764e3a3ee1907a95f8874b74246", "size": "1564", ...
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineRes...
{ "content_hash": "cc40fbbb394910ad498f55648b9734be", "timestamp": "", "source": "github", "line_count": 838, "max_line_length": 297, "avg_line_length": 46.68615751789976, "alnum_prop": 0.6471896326968791, "repo_name": "Azure/azure-sdk-for-python", "id": "b5571bdd111c157681d305fc49d16082c327ffd3", "...
"""Utilities to setup a mingw based build setup for Python projects.""" # Author: Olivier Grisel <olivier.grisel@ensta.org> # License: MIT from __future__ import print_function import os.path as op import os import sys from subprocess import check_output import time import tarfile import shutil try: from urllib.req...
{ "content_hash": "5e321c03b443d97d9ef60e95bb7a0ea8", "timestamp": "", "source": "github", "line_count": 364, "max_line_length": 79, "avg_line_length": 40.49175824175824, "alnum_prop": 0.6174095935952235, "repo_name": "ogrisel/python-winbuilder", "id": "933c56746b03f1cb47b326e720f8a114e09afc03", "si...
from __future__ import annotations from dataclasses import dataclass from pathlib import Path from simple_parsing import ArgumentParser, subgroups @dataclass class ModelConfig: ... @dataclass class DatasetConfig: ... @dataclass class ModelAConfig(ModelConfig): lr: float = 3e-4 optimizer: str = "...
{ "content_hash": "43f935f3a78ae1092f1406b1e0881b9f", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 167, "avg_line_length": 26.58252427184466, "alnum_prop": 0.6322132943754566, "repo_name": "lebrice/SimpleParsing", "id": "a5c75d576abce410cf30f4febd0f5a103e519e60", "size"...
import pytest import sys # no graphtool on win32 and no available package for osx built with python2 if (sys.platform != 'win32') and (sys.platform != 'darwin' and sys.version_info[0] == 2): from skmultilearn.cluster import GraphToolLabelGraphClusterer from skmultilearn.cluster.base import LabelCooccurrenceGra...
{ "content_hash": "dd56e2f7f996c5ffef6bac01880e8ebe", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 112, "avg_line_length": 52.98360655737705, "alnum_prop": 0.614480198019802, "repo_name": "scikit-multilearn/scikit-multilearn", "id": "41db9b58504b86073a900efc933c855dd2f65bc...
from inits import * import tensorflow as tf flags = tf.app.flags FLAGS = flags.FLAGS # global unique layer ID dictionary for layer name assignment _LAYER_UIDS = {} def get_layer_uid(layer_name=''): """Helper function, assigns unique layer IDs.""" if layer_name not in _LAYER_UIDS: _LAYER_UIDS[layer_n...
{ "content_hash": "a84768518644417d165673b9c555f934", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 92, "avg_line_length": 31.28723404255319, "alnum_prop": 0.5583134988099286, "repo_name": "yashchandak/GNN", "id": "0035cbbc5085ae301594a6a64d5a01e3daf37eb7", "size": "5882...
import unittest class UnitsTestCase(unittest.TestCase): def test_create_destroy(self): from libcellml import Units x = Units() del x y = Units("mine") self.assertEqual("mine", y.name()) del y def test_inheritance(self): import libcellml from ...
{ "content_hash": "90f074c6841c8979509a9e8891fd8d27", "timestamp": "", "source": "github", "line_count": 345, "max_line_length": 87, "avg_line_length": 32.08985507246377, "alnum_prop": 0.5928100442597778, "repo_name": "hsorby/libcellml", "id": "79d93f22bbeb3fc35f3ec58a1938ae277ffe9405", "size": "111...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'network'} DOCUMENTATION = """ --- module: checkpoint_access_rule_facts short_description: Get access ...
{ "content_hash": "a9ac01928057d9bb0851ddff2d3cc1e9", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 108, "avg_line_length": 26, "alnum_prop": 0.6630244755244755, "repo_name": "SergeyCherepanov/ansible", "id": "fa8c4c2f669e59dd4931ee9e660ddfd5c6bd752a", "size": "2964", "...
import _plotly_utils.basevalidators class TitleValidator(_plotly_utils.basevalidators.TitleValidator): def __init__( self, plotly_name="title", parent_name="scatterpolar.marker.colorbar", **kwargs ): super(TitleValidator, self).__init__( plotly_name=plotly_name, parent_...
{ "content_hash": "694441e52b4b98dda562a1a75bf1e21d", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 87, "avg_line_length": 38.121212121212125, "alnum_prop": 0.5405405405405406, "repo_name": "plotly/python-api", "id": "3ef83a4a52c6546973c52ddd8acb3040153687f2", "size": "12...
"""Test for snapshoter""" import collections from ggrc import db import ggrc.models as models from ggrc.snapshotter.rules import Types from integration.ggrc.snapshotter import SnapshotterBaseTestCase from integration.ggrc.snapshotter import snapshot_identity class TestSnapshoting(SnapshotterBaseTestCase): """Tes...
{ "content_hash": "b91186ca9c819e01a0b63e01076de16e", "timestamp": "", "source": "github", "line_count": 630, "max_line_length": 80, "avg_line_length": 32.7047619047619, "alnum_prop": 0.6276451174529217, "repo_name": "josthkko/ggrc-core", "id": "7fcdca7d2063ff4b1e9c9672f32e74ddf1d7f540", "size": "20...
from __future__ import unicode_literals from django.test import SimpleTestCase from localflavor.cz.forms import (CZPostalCodeField, CZRegionSelect, CZBirthNumberField, CZICNumberField) class CZLocalFlavorTests(SimpleTestCase): def test_CZRegionSelect(self): f = CZRegion...
{ "content_hash": "863f1affe0294d77a3745882477cf072", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 88, "avg_line_length": 35.55696202531646, "alnum_prop": 0.5941616233535066, "repo_name": "M157q/django-localflavor", "id": "7738ed577f392ed137845f3004f5621a3e5afa47", "size...
from argparse import ArgumentParser import os from docutils import nodes from docutils.statemachine import StringList from docutils.parsers.rst.directives import flag, unchanged from sphinx.util.compat import Directive from sphinx.util.nodes import nested_parse_with_titles from sphinxarg.parser import parse_parser, p...
{ "content_hash": "86a633864b337ce0485fa5c2efa848ab", "timestamp": "", "source": "github", "line_count": 371, "max_line_length": 97, "avg_line_length": 41.509433962264154, "alnum_prop": 0.5423376623376623, "repo_name": "aarontuor/antk", "id": "6b7fc4d23eeba155b97fd4c3cdc2dbc4173cd283", "size": "1540...
class Config: BUNDLE_ERRORS = True # see: http://flask-restful-cn.readthedocs.org/en/0.3.4/reqparse.html#error-handling @classmethod def init_app(cls, app): pass
{ "content_hash": "0a3402e827fb6c59ada3520ad6a50355", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 88, "avg_line_length": 26.714285714285715, "alnum_prop": 0.6577540106951871, "repo_name": "py-in-the-sky/gae-flask-redux-react-starter-kit", "id": "cd6dcd49965cf3d6e3b6ccb4bdb...
""" Django settings for shadowsocks project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ......
{ "content_hash": "21d9f43a141327bb08e7c7d2b85b79d3", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 71, "avg_line_length": 24.988505747126435, "alnum_prop": 0.7221711131554738, "repo_name": "imlonghao/ShadowSocks.NET", "id": "68fa42cf4f66b1aab4dd540c07b4d93955778b5d", "si...
from requests.structures import CaseInsensitiveDict from opentelemetry.propagators.aws.aws_xray_propagator import ( TRACE_HEADER_KEY, AwsXRayPropagator, ) XRAY_PROPAGATOR = AwsXRayPropagator() def test_extract_single_header(benchmark): benchmark( XRAY_PROPAGATOR.extract, { TR...
{ "content_hash": "206a5f48195671ff5ebcbb6c49bb6760", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 97, "avg_line_length": 24.391304347826086, "alnum_prop": 0.714795008912656, "repo_name": "open-telemetry/opentelemetry-python-contrib", "id": "485dd253ac0fa941abf15d83579e10e...
from DefineSyntax import * from GetAllClass import * #A function for storing user's tags def DefineCreat(US,FS,DictHash,DefineSyntaxPath='DefineSyntax'): """ Creat all definitions """ Cls=GetAllClass(DefineSyntaxPath,DefineSyntax) for c in Cls: obj=c() DictHash=obj.Creat(obj.GetFlag(),US,FS,DictHash) return ...
{ "content_hash": "915f9f7d3ed98f498f110699ad4f14e4", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 64, "avg_line_length": 25.23076923076923, "alnum_prop": 0.7652439024390244, "repo_name": "dtysky/Gal2Renpy", "id": "3f9660196fa13714092f4fc419c3bf43fa41b9c5", "size": "436"...
import urllib3 from sdklib.compat import cache # noqa: F401 def disable_warnings(): urllib3.disable_warnings()
{ "content_hash": "d880b95f17cfb0c348670d7cb77496be", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 45, "avg_line_length": 19.666666666666668, "alnum_prop": 0.7457627118644068, "repo_name": "ivanprjcts/sdklib", "id": "a8217ec0b80585c5cf2534906c0fe75aa8372424", "size": "118...
""" Django settings for avapi project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) impo...
{ "content_hash": "03504cbef693d353e87576d94c5d1407", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 76, "avg_line_length": 25.5531914893617, "alnum_prop": 0.7148209825145712, "repo_name": "kahnjw/avapi", "id": "2b5d3cc83a726db3224b98b15473c877fa0469b2", "size": "2402", ...
class Solution: def maxProfit(self, inventory: List[int], orders: int) -> int: inventory=sorted(inventory, reverse=True) inventory.append(0) answer=0 for i in range(1, len(inventory)): if orders==0 or inventory[i-1]==0: return answer%1000000007 ...
{ "content_hash": "7e017b1cec3f8ae428e9726283ec174e", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 67, "avg_line_length": 39.3, "alnum_prop": 0.49236641221374045, "repo_name": "Magic07/online-judge-solutions", "id": "22d502aa6212d17adcb217d5f63d96b8493cfbdf", "size": "78...
""" Benchmark for SGD regression Compares SGD regression against coordinate descent and Ridge on synthetik data. """ print __doc__ # Author: Peter Prettenhofer <peter.prettenhofer@gmail.com> # License: BSD Style. import numpy as np import pylab as pl import gc from time import time from sklearn.linear_model impo...
{ "content_hash": "f9387dd7f3435ad89976535d5025243f", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 76, "avg_line_length": 34.61538461538461, "alnum_prop": 0.5106666666666667, "repo_name": "joshbohde/scikit-learn", "id": "df84c2d1aa90455fbad69a393705779c4ce83c7c", "size"...
""" A simple python representation for AMQP content. """ def default(val, defval): if val == None: return defval else: return val class Content: def __init__(self, body = "", children = None, properties = None): self.body = body self.children = default(children, []) self.properties = defaul...
{ "content_hash": "698bffd0ba780f155330afc0f699c030", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 68, "avg_line_length": 22.846153846153847, "alnum_prop": 0.5802469135802469, "repo_name": "SVADemoAPP/AmqpCode", "id": "9391f4f1a8064cdcbd6c95f4e8a67ca5d03f605b", "size": "...
"""Tests for string_split_op.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf class StringSplitOpTest(tf.test.TestCase): def testStringSplit(self): strings = ["pigs on the wing", "animals"] with sel...
{ "content_hash": "a186b2386c197405ce71e31a72301b89", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 80, "avg_line_length": 38.822429906542055, "alnum_prop": 0.6037554164660568, "repo_name": "ppries/tensorflow", "id": "5aa1390a9ac9458d291f7e2a20acc53c25620afe", "size": "4...
import json from django.conf import settings from django.http import Http404 from . import models from accounts.models import UserSettings from accounts.payment_plans import FEATURE_MIN_COMMENT_BOX, FEATURE_MIN_SITE_FAVICON, minimum from podcasts.models import Podcast, PodcastEpisode from pinecast.helpers import get_...
{ "content_hash": "115a440bdad810dfc45fb3ae559ab8c8", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 96, "avg_line_length": 33.452991452991455, "alnum_prop": 0.5955544200306592, "repo_name": "AlmostBetterNetwork/pinecast", "id": "bd4ccfe95b5183f5082dc157e21b25bacb17c5d7", ...
from __future__ import unicode_literals, absolute_import, division from armet.connectors.flask.http import Request, Response __all__ = [ 'Request', 'Response' ]
{ "content_hash": "e7879786bfb7cf901d0ad0c0b880f2d1", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 66, "avg_line_length": 24.285714285714285, "alnum_prop": 0.7058823529411765, "repo_name": "concordusapps/alchemist-armet", "id": "58961fda1fb56d31604c52d7477838193638b979", ...
class TypeRegistry(object): def __init__(self): self._registry = {} self._registry_types = () def Register(self, base_type, registered): if base_type in self._registry: return self._registry[base_type] = registered self._registry_types += (base_type,) def LookUp(self, instance): fo...
{ "content_hash": "faa169299dadb062077c657a92e53f19", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 56, "avg_line_length": 29.61111111111111, "alnum_prop": 0.6697936210131332, "repo_name": "chainreactionmfg/cara", "id": "6f6527c90d992a9efa63766e74dd677f00a2bb52", "size": ...
import os import pickle from flask import Flask, render_template, request from google.cloud import ndb import redis app = Flask(__name__) ds_client = ndb.Client() HOUR = 3600 REDIS_HOST = os.environ.get('REDIS_HOST', 'localhost') REDIS_PORT = os.environ.get('REDIS_PORT', 6379) REDIS = redis.Redis(host=REDIS_HOST, port...
{ "content_hash": "9be0fc0058bd280162c0aab2b86c3329", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 69, "avg_line_length": 33, "alnum_prop": 0.6804407713498623, "repo_name": "googlecodelabs/migrate-python2-appengine", "id": "fb567e836ec60d5c212c4df4c7d2f80ba5595b2f", "siz...
import os from yaffsfs import * import sys import ctypes dir_in_snapshot=[] files_in_snapshot=[] symlinks_in_snapshot=[] unknown_in_snapshot=[] is_mount_in_snapshot=[] def check_for_yaffs_errors(output): if output<0: ##error has happened error=ctypes.c_int() error=yaffs_get_error() ...
{ "content_hash": "88b0729983ac1a36e6a468bcb6ddd95c", "timestamp": "", "source": "github", "line_count": 424, "max_line_length": 220, "avg_line_length": 43.57783018867924, "alnum_prop": 0.6104345943605564, "repo_name": "One-ders/CEC-gw", "id": "86f65e996930543312fd8ca5911c6e86a181e83a", "size": "188...
import sys import pytest def pytest_addoption(parser): parser.addoption("--with-speedups", action="store_true", default=False, help="Run tests with speedups.") def pytest_runtest_setup(item): if item.config.getoption("--with-speedups"): import shapely.speedups if not shapely.speedups....
{ "content_hash": "113ed743535d3fe3db87cc4b8c516fce", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 75, "avg_line_length": 32, "alnum_prop": 0.66015625, "repo_name": "johanvdw/python-shapely", "id": "3fe9d4ecbc774ba97b446518fff2792971553a2a", "size": "512", "binary": fa...
import smtplib import os class Emailer: def __init__(self, email_address): self.FROM_EMAIL = "websitepolling@gmail.com" self.PASSWORD = "ipollyoursites" self.email_address = email_address self.init_server() def init_server(self): self.server = smtplib.SMTP("smtp.gmail.com", 587) self.server.starttls() ...
{ "content_hash": "1705f8f42e3e4e626db9e2d7c88f0f0a", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 79, "avg_line_length": 32.23076923076923, "alnum_prop": 0.6778042959427207, "repo_name": "varunrau/WebsitePolling", "id": "179e36a22b2461c11accff5ff286bfe99d8849e9", "size"...
import settings import importlib class BotManager: def __init__(self): self.bots = [] registered_bots = self.load_registered_bots() self.initialize_bots(registered_bots) self.current_active_bot_id = None def load_registered_bots(self): registered_bots = settings.REGIST...
{ "content_hash": "f7a3140227ce3ce8d629cddea2728723", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 65, "avg_line_length": 32.86842105263158, "alnum_prop": 0.5156124899919936, "repo_name": "brainbots/assistant", "id": "82204ccab714b9243af6e813fc14180554eeea45", "size": "2...
from gamecology.app import create_app from gamecology.settings import ProdConfig, DevConfig def test_production_config(): app = create_app(ProdConfig) assert app.config['ENV'] == 'prod' assert app.config['DEBUG'] is False assert app.config['DEBUG_TB_ENABLED'] is False assert app.config['ASSETS_DEBU...
{ "content_hash": "77c5de9b9412318095734f3480ccb5bc", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 53, "avg_line_length": 32, "alnum_prop": 0.69921875, "repo_name": "karimtabet/gamecology", "id": "d9b0497a35f0a1ce3860d647d097dfa2f4638b2a", "size": "536", "binary": fals...
from django.core.urlresolvers import reverse from django import http from django.utils.http import urlencode from mox3.mox import IsA import six from openstack_dashboard import api from openstack_dashboard.test import helpers as test from openstack_dashboard.usage import quotas from horizon.workflows import views ...
{ "content_hash": "78d0fd4a0dde6b5f2dee353158b94ed5", "timestamp": "", "source": "github", "line_count": 418, "max_line_length": 78, "avg_line_length": 47.66028708133971, "alnum_prop": 0.5658066459190845, "repo_name": "kogotko/carburetor", "id": "5ae49f825d267a514f7143e565966425ecd62cea", "size": "2...
"""Test CppProperties flags generation.""" import imp import platform from os import path, environ from unittest import TestCase from EasyClangComplete.plugin.flags_sources import CppProperties from EasyClangComplete.plugin.utils import tools from EasyClangComplete.plugin.utils import flag from EasyClangComplete.plugi...
{ "content_hash": "a49bc9e64f6ad55a0a06a89f9c5f3ebb", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 77, "avg_line_length": 32.81481481481482, "alnum_prop": 0.6610233258088789, "repo_name": "niosus/EasyClangComplete", "id": "4d9e5709b642e4112742b358388abe1fcda263f8", "size...
"""!stock <search term> return a stock photo for <search term>""" from random import shuffle import re try: from urllib import quote except ImportError: from urllib.request import quote import requests from bs4 import BeautifulSoup def stock(searchterm): searchterm = quote(searchterm) url = "http://w...
{ "content_hash": "096acbbd6214c77d98b0fa5190c75414", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 156, "avg_line_length": 27.774193548387096, "alnum_prop": 0.6840882694541232, "repo_name": "TetraEtc/limbo", "id": "aa701a80f5fcf8f1645cb8cfff84b0222dabf1de", "size": "861"...
"""Tests for tfx.dsl.compiler.node_inputs_compiler.""" from typing import List, Type import tensorflow as tf from tfx import types from tfx.dsl.compiler import compiler_context from tfx.dsl.compiler import node_inputs_compiler from tfx.dsl.components.base import base_component from tfx.dsl.components.base import base...
{ "content_hash": "980054e7d9c0c7df87168c99f2684c87", "timestamp": "", "source": "github", "line_count": 402, "max_line_length": 102, "avg_line_length": 32.08457711442786, "alnum_prop": 0.6421150565979221, "repo_name": "tensorflow/tfx", "id": "037a9fdbc4e6920768306ad1d7b3975f8ad0dd04", "size": "1349...
from daemon.tests.base_test import TestCase from daemon import settings, create_app from daemon.database import db from daemon.models import Threshold from daemon.utils import generate_threshold_config class UtilitiesTestCase(TestCase): """ This class performs testing upon `utils.py` module containing: ...
{ "content_hash": "abe84c0998d275a360c83252d3fd59c0", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 77, "avg_line_length": 39.206896551724135, "alnum_prop": 0.6292875989445911, "repo_name": "pbanaszkiewicz/collectd-webdaemon", "id": "b78220393e2274867e595e0c3599afc11612cf32...
"""Unit tests for datastore_utils.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import datetime import itertools import math import mock from six.moves import range from google.appengine.api import datastore_errors from google.appengine.ext impor...
{ "content_hash": "0dcc2fb0f4c9b55a737067981ccf9679", "timestamp": "", "source": "github", "line_count": 712, "max_line_length": 80, "avg_line_length": 25.323033707865168, "alnum_prop": 0.658014420410427, "repo_name": "google/upvote_py2", "id": "d0b7d747b9c74b2dc5e77c52003b569f60e577c6", "size": "18...
""" Commands for pipsi-tool Module defines helpers for searching for commands and aliases for them. """ from .upgrade_all import UpgradeAll from .reinstall_all import ReinstallAll COMMANDS = { 'upgrade-all': (UpgradeAll, 'upgradeall', ), 'reinstall-all': (ReinstallAll, 'reinstallall', ), } COMMAND_MAPPER = {}...
{ "content_hash": "65a22d20a7562a9611b37987d9445813", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 72, "avg_line_length": 22.717391304347824, "alnum_prop": 0.6593301435406699, "repo_name": "msztolcman/pipsi-tool", "id": "d2e9830fe4dcd6090fd302fc448d4619d45bb6d0", "size":...
from numba.core import types, errors, ir, sigutils, ir_utils from numba.core.typing.typeof import typeof_impl from numba.core.transforms import find_region_inout_vars class WithContext(object): """A dummy object for use as contextmanager. This can be used as a contextmanager. """ is_callable = False ...
{ "content_hash": "dde1396f9a4a0a839bcaf5785147600d", "timestamp": "", "source": "github", "line_count": 344, "max_line_length": 79, "avg_line_length": 33.122093023255815, "alnum_prop": 0.6007547832192381, "repo_name": "sklam/numba", "id": "5a21ab57afe5a40eefe25393a025dafacb1e6716", "size": "11394",...
from django.contrib import admin from .models import Tag admin.site.register(Tag)
{ "content_hash": "49ceb0a0a5afa6041e422cdee1696925", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 32, "avg_line_length": 14.166666666666666, "alnum_prop": 0.788235294117647, "repo_name": "hellsgate1001/waypoints", "id": "85ae0d72f3135b2d541ab3afc4b8f61e53f06b6f", "size":...
""" Django settings for GoogleNews_Scraper project. Generated by 'django-admin startproject' using Django 1.11.6. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """...
{ "content_hash": "e9b823bd6d65942ed26825f2346f8ca6", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 91, "avg_line_length": 25.977099236641223, "alnum_prop": 0.6758742286218042, "repo_name": "andresmtz98/GoogleNews_Scraper_Django", "id": "b476250f1143cca21d901d793c8ec810bd4...
import kivy kivy.require('1.9.0') import math from kivy.uix.togglebutton import ToggleButton from kivy.graphics import Line, Color from comicwidgets import StickMan, DraggableWidget class ToolButton(ToggleButton): def on_touch_down(self, touch): ds = self.parent.drawing_space if self.state == 'down...
{ "content_hash": "db92ec67cd41aa3b9833134274b8d883", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 79, "avg_line_length": 34.70238095238095, "alnum_prop": 0.6229845626072041, "repo_name": "pimier15/PyGUI", "id": "308002505275c9d1d08643d9031cdc22f0283cf6", "size": "2939",...
import MySQLdb with open('input.txt', 'r') as f: lines = f.readlines() primeCustomers = [] for line in lines: words = line.split() primeCustomers.append({"id": int(words[0]), "newRep": words[1]}) try: db = MySQLdb.connect('localhost', 'root', '', 'sports2000') cur = db.cursor() # Get a list...
{ "content_hash": "09e42f00072f22c9bce9115f8cba2365", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 78, "avg_line_length": 30.358974358974358, "alnum_prop": 0.6110641891891891, "repo_name": "progress/WhyABL", "id": "4251102144b637b96ff97a1929de20927efc62b2", "size": "2477...
"""Tests for learned_optimizers.tasks.fixed.vit.""" from absl.testing import absltest from absl.testing import parameterized from learned_optimization.tasks import test_utils from learned_optimization.tasks.fixed import mlp_mixer tasks = [ 'MLPMixer_Cifar100_bs256_tiny16', 'MLPMixer_Cifar100_small16', 'ML...
{ "content_hash": "86cadbdbc1cd1d6ce471644a84a837b9", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 54, "avg_line_length": 26.933333333333334, "alnum_prop": 0.7252475247524752, "repo_name": "google/learned_optimization", "id": "96e0e265917146cc5fd5de6236b1749063f48cc7", "...
from __future__ import absolute_import from __future__ import print_function import re import operator import six from six.moves import range from collections import Counter debug = False test = False def is_number(s): try: float(s) if '.' in s else int(s) return True except ValueError: ...
{ "content_hash": "903c3ab6d4b8db6555f41ae4c2a464a2", "timestamp": "", "source": "github", "line_count": 283, "max_line_length": 580, "avg_line_length": 42.26855123674912, "alnum_prop": 0.6444574485871928, "repo_name": "zelandiya/RAKE-tutorial", "id": "4e047e0257dd7cdde9147d227954cac033695ef7", "siz...
import math import numpy as np from scipy.stats import norm from . import common_args from ..util import read_param_file, ResultDict def analyze( problem, Y, M=4, num_resamples=100, conf_level=0.95, print_to_console=False, seed=None, ): """Perform extended Fourier Amplitude Sensitivit...
{ "content_hash": "d5b29dba60a59fc3f6b25fc26e164a17", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 84, "avg_line_length": 26.871134020618555, "alnum_prop": 0.574717053520046, "repo_name": "SALib/SALib", "id": "c37a690009c7c72798774bcfb153d1f0c6aab6dd", "size": "5214", ...
"""Performs (incremental) backups of activities for a given Garmin Connect account. The activities are stored in a local directory on the user's computer. The backups are incremental, meaning that only activities that aren't already stored in the backup directory will be downloaded. """ import argparse import getpass f...
{ "content_hash": "a793fae6917338f6a86244b58fecce08", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 108, "avg_line_length": 40.111111111111114, "alnum_prop": 0.6168051708217913, "repo_name": "dlenski/garminexport", "id": "b8512805458ddeb4beb38c1966b7982cf42dfa3a", "size"...
__author__ = 'xsank' import json class BaseData(object): def __init__(self, data=""): self.from_json(data) def from_json(self, data=""): self.__dict__ = json.loads(data) def to_json(self): return json.dumps(self) def get_type(self): return self.tp class ClientDat...
{ "content_hash": "ae8e6533b882a93bf329fe3a2cf91317", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 46, "avg_line_length": 17.096774193548388, "alnum_prop": 0.5584905660377358, "repo_name": "Saberlion/docker-webssh", "id": "aad3d238f6ec3305f699424623238f31996f3d3b", "size...
from models import Employee def create_employee( username='johndoe', department='Engineering', first_name='John', last_name='Doe', photo_url=None, office=None, ): if photo_url is None: photo_url = 'http://example.com/photos/{0}.jpg'.format(username) return Employee.create_fro...
{ "content_hash": "f502823334712e18c1eb5ae80596fcd0", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 72, "avg_line_length": 22.782608695652176, "alnum_prop": 0.5935114503816794, "repo_name": "Yelp/love", "id": "6d5611365a64276e265fe93e5863ed9892752195", "size": "548", "b...
""" """ from __future__ import division, print_function __author__ = "adrn <adrn@astro.columbia.edu>" # Third-party import numpy as np from numpy import cos, sin import astropy.coordinates as coord import astropy.units as u from astropy.coordinates.angles import rotation_matrix from astropy.coordinates.builtin_fram...
{ "content_hash": "a229387fb657a284d8a900cdf256c209", "timestamp": "", "source": "github", "line_count": 353, "max_line_length": 151, "avg_line_length": 39.39660056657224, "alnum_prop": 0.6293233623355144, "repo_name": "abonaca/gary", "id": "e041121215c0df5c83cdeb17e304b9de2a407b06", "size": "13924"...
from migen import * from migen.genlib.resetsync import AsyncResetSynchronizer from litex.gen import LiteXModule from litex.build.io import DDROutput from litex_boards.platforms import mist from litex.soc.cores.clock import CycloneIVPLL from litex.soc.integration.soc import SoCRegion from litex.soc.integration.soc_c...
{ "content_hash": "8ed94483d46083974241f22286b3bda5", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 118, "avg_line_length": 39.82178217821782, "alnum_prop": 0.5181501740427648, "repo_name": "litex-hub/litex-boards", "id": "b985caf09ba5b5bd0677ae0950d2b9994ad13e43", "size...
from django.test import TestCase from caffe.models import Caffe from employees.models import Employee from .forms import CashReportForm, CompanyForm, ExpenseForm, FullExpenseForm from .models import Company, Expense class CompanyFormTest(TestCase): """Tests Company form.""" def setUp(self): """Test...
{ "content_hash": "5d77c616a420c52f55378ab495e10bf0", "timestamp": "", "source": "github", "line_count": 353, "max_line_length": 76, "avg_line_length": 27.362606232294617, "alnum_prop": 0.5051247541153329, "repo_name": "VirrageS/io-kawiarnie", "id": "d93e5080f81d2231a73da837a41fcb71c3ee9e9f", "size"...
from matplotlib.backend_bases import FigureCanvasBase from matplotlib.backend_bases import RendererBase from matplotlib.testing.decorators import image_comparison, cleanup import matplotlib.pyplot as plt import matplotlib.transforms as transforms import matplotlib.path as path from nose.tools import assert_equal imp...
{ "content_hash": "0dc7fcddf71de7b20391266ffec7abc6", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 78, "avg_line_length": 36.32222222222222, "alnum_prop": 0.6072193331293974, "repo_name": "yuanagain/seniorthesis", "id": "780c34335891de3df2672f94d0e138d909cfa422", "size":...
import fudge from contextlib import contextmanager from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.test import TestCase, Client from nose.plugins.skip import SkipTest from ignite.tests.decorators import ignite_skip def get_users(filter_f=None): users = User....
{ "content_hash": "6334a068f4c01ca999673293bd4e4b71", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 79, "avg_line_length": 36.785714285714285, "alnum_prop": 0.6021844660194174, "repo_name": "mozilla/mozilla-ignite", "id": "729ca0a375004dcc42db213c77c0d4c29a86dbb5", "size...
import sys from django.core.management.base import BaseCommand from apps.bulk.models import SovereigntyHolder, Sovereignty from utils import connection # execute api tasks class Command(BaseCommand): #handle is what actualy will be executed def handle(self, *args, **options): systems = connection.ap...
{ "content_hash": "545cfb51a23492592d764a4022a05546", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 71, "avg_line_length": 34.38, "alnum_prop": 0.5567190226876091, "repo_name": "Sult/evetool", "id": "097493b12a9cf54fc836389d0b6a5990244e7f6e", "size": "1719", "binary": f...
""" ============================================= Compute MxNE with time-frequency sparse prior ============================================= The TF-MxNE solver is a distributed inverse method (like dSPM or sLORETA) that promotes focal (sparse) sources (such as dipole fitting techniques) [1]_ [2]_. The benefit of this...
{ "content_hash": "114d4569ebe06d79d43cd4d66b977563", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 79, "avg_line_length": 41.95804195804196, "alnum_prop": 0.6366666666666667, "repo_name": "mne-tools/mne-tools.github.io", "id": "80be86f0c3eda3c0dd965acd2af82918f7fe2779", ...
from BaseHTTPServer import BaseHTTPRequestHandler import cgi import json import httplib class HttpMsgHandler(BaseHTTPRequestHandler): m_data = [] def do_GET(self): try: print(self.path) print(self.headers.headers[0]) message = json.dumps(self.m_data) sel...
{ "content_hash": "2516d31410f5d50d798f0735c027d7a5", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 107, "avg_line_length": 34.41379310344828, "alnum_prop": 0.5420841683366734, "repo_name": "lyx003288/python_test", "id": "353cbd505c43332d186f865de83bddcaff7c4239", "size":...
""" XSLT processing engine """ import os, sys, operator, cStringIO, warnings from gettext import gettext as _ DEFAULT_ENCODING = 'UTF-8' #from amara import DEFAULT_ENCODING from amara import ReaderError, tree from amara.lib import iri, inputsource from amara.xpath import XPathError from amara.xslt import XsltError fro...
{ "content_hash": "8bf72d7e8d9d7d728b76c8b82a9db162", "timestamp": "", "source": "github", "line_count": 728, "max_line_length": 94, "avg_line_length": 41.01510989010989, "alnum_prop": 0.6267122140728089, "repo_name": "zepheira/amara", "id": "785ee799ed42402ae80e6ac80e20f73c050d02f8", "size": "29958...
import unittest from unittest import TestSuite def get_test_suite_from_test_cases(test_cases): suite = TestSuite() for test_class in test_cases: tests = unittest.TestLoader().loadTestsFromTestCase(test_class) suite.addTests(tests) return suite def get_test_suite_from_test_suites(suites):...
{ "content_hash": "daf29d9b9e2bb35b7aa5646affb03036", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 71, "avg_line_length": 25.642857142857142, "alnum_prop": 0.7270194986072424, "repo_name": "marcoprado17/flask-bone", "id": "e1c18e5fbd22a5cc0488f26fcae7964b15bf72e9", "size...
from __future__ import print_function import abc import logging import os import sys from optparse import OptionGroup from optparse import OptionParser from uge.config.config_manager import ConfigManager from uge.exceptions.invalid_argument import InvalidArgument from uge.exceptions.qconf_exception import QconfExcepti...
{ "content_hash": "d01547e51e9e0daee8a95e8ffb59b218", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 118, "avg_line_length": 32.38308457711443, "alnum_prop": 0.5667537256106929, "repo_name": "gridengine/config-api", "id": "d0977050cc49e89d275e03b49f311d4c629109c6", "size"...
from __future__ import with_statement from datetime import datetime import copy import decimal import logging import os import re import threading import time import warnings try: import sqlite3 except ImportError: sqlite3 = None try: import psycopg2 except ImportError: psycopg2 = None try: impor...
{ "content_hash": "20746062f313ab31182d77313cd8b082", "timestamp": "", "source": "github", "line_count": 2587, "max_line_length": 112, "avg_line_length": 32.345187475840746, "alnum_prop": 0.560739510259689, "repo_name": "giserh/peewee", "id": "f0690bb3ec1196e6707314dc1efada696b9c1838", "size": "8382...
from pecan import hooks from neutron.api import api_common from neutron import manager from neutron.pecan_wsgi.hooks import policy_enforcement from neutron.pecan_wsgi.hooks import utils # TODO(blogan): ideally it'd be nice to get the pagination and sorting # helpers from the controller but since the controllers are ...
{ "content_hash": "0a9b2d392eb04540e10c5af36edeed75", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 79, "avg_line_length": 43.33576642335766, "alnum_prop": 0.6523496715512885, "repo_name": "huntxu/neutron", "id": "800aa6ccde051acb52df4ff26e4db2f4cf37ecf3", "size": "6510"...
import mock from cinder.compute import nova from cinder import context from cinder import test class NovaClientTestCase(test.TestCase): def setUp(self): super(NovaClientTestCase, self).setUp() self.ctx = context.RequestContext('regularuser', 'e3f0833dc08b4cea', ...
{ "content_hash": "ef35afbe03ff03acad4d988a5ab03e89", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 77, "avg_line_length": 41.75438596491228, "alnum_prop": 0.6130252100840337, "repo_name": "petrutlucian94/cinder", "id": "4521fdd011f1e52132959f68f0963fab7ed743cb", "size":...
""" WSGI config for theo_site project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SET...
{ "content_hash": "d0d749424675170ccfda84b823503bee", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 24.6875, "alnum_prop": 0.7670886075949367, "repo_name": "theonaun/theo_site", "id": "d04ee53c01a054831e94d1b28c3cf5e463309f54", "size": "395", "bin...
""" Baseline cases ============== This script generates a list of all subject that have a valid baseline. Usage: python baseline_cases.py """ from __future__ import print_function import os import pandas import redcap def get_project(args): # First REDCap connection for the Summary project (this is where we put ...
{ "content_hash": "68d35e486871ecb6bb57a2f63fe7c602", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 114, "avg_line_length": 40.69444444444444, "alnum_prop": 0.5941979522184301, "repo_name": "sibis-platform/ncanda-data-integration", "id": "3e50f792598b080b7ebd2782475dcf70453...
''' ''' # 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": "398b23ffd36476e0a0818bde0553e926", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 159, "avg_line_length": 37.40909090909091, "alnum_prop": 0.7245848521668692, "repo_name": "davidbz/trafficserver", "id": "b93f614200d10321c0ca109325a0cd70096b2dc9", "size":...
import re text = open('mybooks.xml').read() found = re.findall('<title>(.*)</title>', text) for title in found: print(title)
{ "content_hash": "419ca2c855471ad651e614ae1e62c9e6", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 47, "avg_line_length": 31.5, "alnum_prop": 0.6587301587301587, "repo_name": "dreadrel/UWF_2014_spring_COP3990C-2507", "id": "2b8ee9f37c7137d56480c685839d226cae090ee0", "size...
""" Tests For CellsManager """ import copy import datetime from oslo.config import cfg from nova.cells import messaging from nova.cells import utils as cells_utils from nova import context from nova.openstack.common import timeutils from nova import test from nova.tests.cells import fakes from nova.tests import fake_...
{ "content_hash": "9302bd4b6fbf54c7fac6be4191b59833", "timestamp": "", "source": "github", "line_count": 784, "max_line_length": 79, "avg_line_length": 46.75892857142857, "alnum_prop": 0.5682915518699364, "repo_name": "devoid/nova", "id": "adf804da1e0089d0a9afedf9579bd34809a3a779", "size": "37295", ...
import webob from nova.api.openstack import wsgi from nova.api.openstack import xmlutil from nova.api.openstack import extensions from nova import db from nova import exception from nova import quota authorize = extensions.extension_authorizer('compute', 'quotas') class QuotaTemplate(xmlutil.TemplateBuilder): ...
{ "content_hash": "b84cfd26f65e9d04eab62f6938691c25", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 79, "avg_line_length": 32.93103448275862, "alnum_prop": 0.6139616055846422, "repo_name": "gyang/nova", "id": "0738fb81be22279fa49c5ac1554d5c1c29baf53d", "size": "3540", "...
import threading import time from unittest import mock from multiple_database.routers import TestRouter from django.core.exceptions import FieldError from django.db import ( DatabaseError, NotSupportedError, connection, connections, router, transaction, ) from django.test import ( TransactionTestCase, ove...
{ "content_hash": "7b2dc35464e95ab125ac4ffdb71f48e3", "timestamp": "", "source": "github", "line_count": 506, "max_line_length": 117, "avg_line_length": 43.46442687747036, "alnum_prop": 0.6224253171463647, "repo_name": "simonw/django", "id": "0bb21972d10b51e53bb59fc2fc794c167a5f540b", "size": "21993...
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 'Question' db.create_table(u'questionnaire_question', ( (u'id', self.gf('django.db.models.fields.AutoFiel...
{ "content_hash": "67b9f0fa0d6f14be721b76690b39ef76", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 188, "avg_line_length": 67.8913043478261, "alnum_prop": 0.5734870317002881, "repo_name": "testvidya11/ejrf", "id": "fa487df072a9e6ca186ad88a742e9ed46b7d8537", "size": "6270...
__author__ = 'Guorong Xu<g1xu@ucsd.edu>' import os import sys import subprocess from multiprocessing import Pool def upload_file(input_file): print input_file s3_location = "" subprocess.call(["aws", "s3", "cp", input_file, s3_location]) if __name__ == '__main__': work_dir = sys.argv[1] file_ex...
{ "content_hash": "d2f8993366c83548a97d4c2d91ee4aa0", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 65, "avg_line_length": 23.5, "alnum_prop": 0.6156028368794326, "repo_name": "ucsd-ccbb/jupyter-genomics", "id": "ef8d0e693720d7a63138df2ed5b68559e6358b2c", "size": "705", ...
import time import datetime import oauth2 as oauth from provider import scope as oauth2_provider_scope from rest_framework.test import APIClient from rest_framework_oauth.authentication import ( oauth2_provider, OAuthAuthentication, OAuth2Authentication ) from rest_framework import status, permissions from ...
{ "content_hash": "6ee57519d85eb19de4b35049a075c994", "timestamp": "", "source": "github", "line_count": 412, "max_line_length": 111, "avg_line_length": 46.60679611650485, "alnum_prop": 0.6643578793875637, "repo_name": "jlafon/django-rest-framework-oauth", "id": "ad88c6a03a1a33de13e57a9242b850ca40e2cc...
__version__ = "1.2.1" __all__ = "Proxy", try: import copy_reg as copyreg except ImportError: import copyreg from .utils import identity copyreg.constructor(identity) try: from .cext import Proxy from .cext import identity except ImportError: from .slots import Proxy else: copyreg.constructo...
{ "content_hash": "0c6231ee57a755a7b9b19b04b4e1baf0", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 33, "avg_line_length": 16.6, "alnum_prop": 0.7018072289156626, "repo_name": "mith1979/ansible_automation", "id": "2ff10af529f0a5b660a4d21da475414d766f803b", "size": "332", ...
from __future__ import print_function from pprint import pformat from twisted.internet import reactor from twisted.internet.defer import Deferred from twisted.internet.protocol import Protocol from twisted.web.client import Agent from twisted.web.http_headers import Headers class BeginningPrinter(Protocol): def ...
{ "content_hash": "ab56431aa6475d5d49ed67422b2c7dea", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 67, "avg_line_length": 28.428571428571427, "alnum_prop": 0.6920315865039484, "repo_name": "EricMuller/mywebmarks-backend", "id": "aee0962a10f7f8492a4017473285572371db8390", ...
import os import mock from oslo_config import cfg from oslo_config import fixture as config_fixture from oslo_middleware import request_id from oslo_policy import opts as policy_opts from oslo_utils import importutils import webob from heat.common import context from heat.common import exception from heat.tests impor...
{ "content_hash": "e3b324e39f195f60ce1f5fd6be337479", "timestamp": "", "source": "github", "line_count": 371, "max_line_length": 79, "avg_line_length": 41.15094339622642, "alnum_prop": 0.5300975961223554, "repo_name": "cwolferh/heat-scratch", "id": "661b965dcc419d76062279048b517a17eba6c7b8", "size":...
import warnings from functools import partial from typing import Any, Callable, List, Optional, Sequence import torch from torch import nn, Tensor # from .._internally_replaced_utils import load_state_dict_from_url from .misc_torch import ConvNormActivation, SqueezeExcitation as SElayer from ._utils import _make_divi...
{ "content_hash": "61fd874e69f2288fc130488395f66261", "timestamp": "", "source": "github", "line_count": 340, "max_line_length": 120, "avg_line_length": 38.85, "alnum_prop": 0.5588613823907942, "repo_name": "PaddlePaddle/models", "id": "ae2863c73cbedcbbec1a62d65e1a63b6ab9733a4", "size": "13209", "...
"""Tests for the Spotify config flow.""" from unittest.mock import patch from spotipy import SpotifyException from homeassistant import data_entry_flow, setup from homeassistant.components.spotify.const import DOMAIN from homeassistant.config_entries import SOURCE_REAUTH, SOURCE_USER, SOURCE_ZEROCONF from homeassista...
{ "content_hash": "85bab5d16caee18d6e495158bce87203", "timestamp": "", "source": "github", "line_count": 285, "max_line_length": 94, "avg_line_length": 33.40350877192982, "alnum_prop": 0.617436974789916, "repo_name": "Danielhiversen/home-assistant", "id": "0d0d4a50a3dadf115d18ace17d8ae585c4613242", ...
import pytest import requests from pyrestcli.exceptions import NotFoundException from carto.maps import NamedMap, NamedMapManager, AnonymousMap from secret import NAMED_MAP_DEFINITION, NAMED_MAP_AUTH_TOKEN, \ NAMED_MAP_INSTANTIATION, ANONYMOUS_MAP_DEFINITION @pytest.fixture(scope="module") def named_map_manager...
{ "content_hash": "31c83de0ee49e5c3d57779f99d6d40cb", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 78, "avg_line_length": 29.233333333333334, "alnum_prop": 0.7054351957430635, "repo_name": "CartoDB/carto-python", "id": "d81f54ff1b61914f4c840af5fb96c2bb4df3f3a8", "size": ...
"""This module contains the general information for MailRecipient ManagedObject.""" from ...imcmo import ManagedObject from ...imccoremeta import MoPropertyMeta, MoMeta from ...imcmeta import VersionMeta class MailRecipientConsts: ADMIN_ACTION_CLEAR = "clear" ADMIN_ACTION_SEND_TEST_MAIL = "send-test-mail" ...
{ "content_hash": "e4c594277fc5dc69d8b15f8982204274", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 304, "avg_line_length": 56.298850574712645, "alnum_prop": 0.5624744793793385, "repo_name": "ragupta-git/ImcSdk", "id": "10bf11bc0043337bac476ac4cde8d5e8bee8b872", "size": "...
from inspect import Parameter import threading from .exceptions import InvalidAnnotation, MissingDependencyDeclaration, BindingAlreadyExists, AnnotationAlreadyExists ANNOTATION_FORMAT = '{name}:{annotation}' """Standard binding key format for name/annotation pairs """ def get_key(name, annotation=None): """ ...
{ "content_hash": "97d23db0579b85c57b48f5019de673bd", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 120, "avg_line_length": 34.507462686567166, "alnum_prop": 0.6425173010380623, "repo_name": "lukasbuenger/python-di", "id": "b60c645a008b823dddf46449d79fc9714f36aa1d", "siz...
node = S(input, "application/json") childNode = node.prop("orderDetails") property1 = node.prop("order") property2 = childNode.prop("price") property3 = node.prop("active") stringValue = property1.stringValue() numberValue = property2.numberValue() boolValue = property3.boolValue()
{ "content_hash": "41a973e8e061163266720556d5606e54", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 37, "avg_line_length": 28.5, "alnum_prop": 0.7543859649122807, "repo_name": "escardin/camunda-spin", "id": "99aa103361be99c04aef780db986862f8c2895cb", "size": "285", "bin...
from common.des_tool import get_decode_num, get_encode_num from django import template register = template.Library() @register.filter(name='get_encode_id') def get_encode_id(id): return get_encode_num(id) @register.filter(name='get_decode_id') def get_decode_id(encode_str): return get_decode_num(encode_str)
{ "content_hash": "de6c724cd793583c18dccd5a811601fd", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 58, "avg_line_length": 26.583333333333332, "alnum_prop": 0.7460815047021944, "repo_name": "garrickvan/xfuture_blog", "id": "04f0316c6a90f45740890968527938dc80049780", "size...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("django_dbq", "0003_auto_20180713_1000"), ] operations = [ migrations.AlterField( model_name="job", name="state", field=models.CharField( ...
{ "content_hash": "283ec66c3c69150a3ffde06a27598568", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 50, "avg_line_length": 26.15625, "alnum_prop": 0.4241338112305854, "repo_name": "dabapps/django-db-queue", "id": "b62ab02c5348ec90d5b48fafa2541b31c8806044", "size": "887", ...