text
stringlengths
4
1.02M
meta
dict
from __future__ import absolute_import from django.db import IntegrityError, transaction from rest_framework import serializers, status from rest_framework.response import Response from sentry.api.base import DocSection from sentry.api.bases.team import TeamEndpoint, TeamPermission from sentry.api.serializers import ...
{ "content_hash": "7adf7e1322a163a3368c9b638494f469", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 81, "avg_line_length": 36.30434782608695, "alnum_prop": 0.6025948103792416, "repo_name": "zenefits/sentry", "id": "b707d4be64b477dcb7900722f5881a325060d2a1", "size": "5010...
import re from nova import exception from nova.i18n import _ # Define the minimum and maximum version of the API across all of the # REST API. The format of the version is: # X.Y where: # # - X will only be changed if a significant backwards incompatible API # change is made which affects the API as whole. That is, s...
{ "content_hash": "b16d8be4129d85a6fb00aaaf64883b29", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 79, "avg_line_length": 41.4061135371179, "alnum_prop": 0.6568234549673064, "repo_name": "cloudbase/nova", "id": "6a3865f96796fa137d06698bd7f83485e83082f3", "size": "10084"...
from base import Ref, QuickbooksManagedObject class Item(QuickbooksManagedObject): """ QBO definition: An item is a thing that your company buys, sells, or re-sells, such as products and services. An item is shown as a line on an invoice or other sales form. The Item.Type attribute, which specifies how ...
{ "content_hash": "e2db13490d0bc9b346bc18478d7a76b3", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 119, "avg_line_length": 34.083333333333336, "alnum_prop": 0.6491442542787286, "repo_name": "ferdiaz/python-quickbooks", "id": "d81a7c77ff3437c14136c1902ac9466a3eecc3cd", "s...
from __future__ import print_function from os import environ from twisted.internet.defer import inlineCallbacks from autobahn.wamp.types import PublishOptions from autobahn.twisted.util import sleep from autobahn.twisted.wamp import ApplicationSession, ApplicationRunner class Component(ApplicationSession): """ ...
{ "content_hash": "063b037de7e8567492b63bf6a6531329", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 76, "avg_line_length": 29.53061224489796, "alnum_prop": 0.6067726330338632, "repo_name": "inirudebwoy/AutobahnPython", "id": "35e8df5def61eef9fa3d38461eb4df24f847a531", "si...
from __future__ import division, absolute_import, print_function import os import re import sys import copy import glob import atexit import tempfile import subprocess import shutil import distutils from distutils.errors import DistutilsError try: from threading import local as tlocal except ImportError: from...
{ "content_hash": "b34b58190b53058f893c7dde3e26b10e", "timestamp": "", "source": "github", "line_count": 2306, "max_line_length": 102, "avg_line_length": 35.41803989592368, "alnum_prop": 0.54127384479761, "repo_name": "ryfeus/lambda-packs", "id": "0359063033829646a286462dfacc72ab27917db4", "size": "...
import mock from nova import test from nova_powervm.virt.powervm import exception as p_exc from nova_powervm.virt.powervm import slot from pypowervm import exceptions as pvm_exc class TestNovaSlotManager(test.NoDBTestCase): def setUp(self): super(TestNovaSlotManager, self).setUp() self.store_ap...
{ "content_hash": "2d9384c9ce66d3ec0283473e31ca5c56", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 79, "avg_line_length": 41.14935064935065, "alnum_prop": 0.6026510967334701, "repo_name": "stackforge/nova-powervm", "id": "5a2f2830cbe0219003fb0536d25ffad30e2038a4", "size...
from flask import request, current_app, redirect from mediacrush.config import _cfg from mediacrush.network import is_tor def tor_redirect(path): if is_tor(): return redirect(_cfg("tor_domain") + '/' + path) return redirect(path)
{ "content_hash": "054cd61ca3e46540e4131f784838e930", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 56, "avg_line_length": 30.875, "alnum_prop": 0.7044534412955465, "repo_name": "roderickm/MediaCrush", "id": "f3c1a4c944062069cb2e2dece7d36b1987323353", "size": "247", "bin...
"""The Integration integration.""" from __future__ import annotations from homeassistant.config_entries import ConfigEntry from homeassistant.const import Platform from homeassistant.core import HomeAssistant async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up Integration from...
{ "content_hash": "534daf6cd31a41ca2040d042bebdf211", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 88, "avg_line_length": 41.34782608695652, "alnum_prop": 0.7592008412197687, "repo_name": "nkgilley/home-assistant", "id": "f482f4e41e87790b121fffc6179f78b472cf850b", "size"...
from ornithology import * # # Setup a personal condor with just a schedd - no need for anything else # @standup def condor(test_dir): with Condor( local_dir=test_dir / "condor", config={ "DAEMON_LIST": "SCHEDD MASTER", "USE_SHARED_PORT": False } ) as condor: ...
{ "content_hash": "3312d9b62ac110a6b958c1322c434448", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 96, "avg_line_length": 31.544117647058822, "alnum_prop": 0.6335664335664336, "repo_name": "htcondor/htcondor", "id": "6917b9b3866064be35a509e161593286cf2fe8e9", "size": "24...
"""A simple Wi-Fi mobility manager.""" from empower_core.app import EVERY from empower.managers.ranmanager.lvapp.wifiapp import EWiFiApp class WiFiMobilityManager(EWiFiApp): """A simple Wi-Fi mobility manager. This app will peridodically handover every LVAP in the network to the interface with the high...
{ "content_hash": "9aa61bb3eb664e58a4c13be39787a2d4", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 75, "avg_line_length": 28.829268292682926, "alnum_prop": 0.6125211505922166, "repo_name": "5g-empower/empower-runtime", "id": "9e67c0f2ea91104780342950e0da8ae0fc91b09a", "s...
__author__ = 'Tom Schaul, tom@idsia.ch' from random import choice from gomokuplayer import GomokuPlayer class RandomGomokuPlayer(GomokuPlayer): """ do random moves in Go-Moku""" def getAction(self): return [self.color, choice(self.game.getLegals(self.color))]
{ "content_hash": "7dfdbb6ceed0bae4369588ae1cd08367", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 68, "avg_line_length": 23.333333333333332, "alnum_prop": 0.7142857142857143, "repo_name": "arnaudsj/pybrain", "id": "cf8fc034012fcfbb56d657f6f9ce3dcf697563c7", "size": "280...
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response from nssrc.com.citrix.netscaler.nitro.service.options import options from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_...
{ "content_hash": "3dcb1c2c6f40107f7d51bf5f30ae9b08", "timestamp": "", "source": "github", "line_count": 355, "max_line_length": 216, "avg_line_length": 29.4, "alnum_prop": 0.7101657564434224, "repo_name": "atopuzov/nitro-python", "id": "ee8a451fc60a2a51071422de13ac4f179f6635db", "size": "11051", ...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('climatemodels', '0016_auto_20160420_1411'), ] operations = [ migrations.RemoveField( model_name='output...
{ "content_hash": "c3fe08546770c5985d94a79f62bc68b6", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 133, "avg_line_length": 28.0625, "alnum_prop": 0.589086859688196, "repo_name": "bruecksen/isimip", "id": "046d615f3b015c18cfbfbc7cdc3030f1f9b065fb", "size": "970", "binar...
from __future__ import print_function import atexit import ctypes as ct import fcntl import json import os import re import errno import sys import platform from .libbcc import lib, bcc_symbol, bcc_symbol_option, bcc_stacktrace_build_id, _SYM_CB_TYPE from .table import Table, PerfEventArray, RingBuf, BPF_MAP_TYPE_QUEU...
{ "content_hash": "9deea862e420e2ffcb859208baab086e", "timestamp": "", "source": "github", "line_count": 1755, "max_line_length": 110, "avg_line_length": 37.54188034188034, "alnum_prop": 0.5650214006010381, "repo_name": "brendangregg/bcc", "id": "2ff5cf020470aa58b1bedc0b52f1bf8e4851644b", "size": "6...
"""Tools for working with the host system""" # Copyright 2012 Canonical Ltd. # # Authors: # Nick Moffitt <nick.moffitt@canonical.com> # Matthew Wedgwood <matthew.wedgwood@canonical.com> import os import re import pwd import grp import random import string import subprocess import hashlib from contextlib import conte...
{ "content_hash": "8550ff427210d308ab7191b809982ac0", "timestamp": "", "source": "github", "line_count": 430, "max_line_length": 79, "avg_line_length": 29.983720930232558, "alnum_prop": 0.5991623361514, "repo_name": "mbirru/midonet-charms", "id": "cf2cbe14ec08acfe1b846db4972a3d95e05444ea", "size": "...
"""Operations for linear algebra.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.ops import array_ops from tensorflow.p...
{ "content_hash": "f163b617545ef88a9916ae38fa2a617a", "timestamp": "", "source": "github", "line_count": 561, "max_line_length": 80, "avg_line_length": 41.666666666666664, "alnum_prop": 0.6479144385026738, "repo_name": "rabipanda/tensorflow", "id": "9803eed6aefe072cbe0841dff2de3f640a440dd5", "size":...
import datetime import requests from math import log10 """ To access the data, corresponding numbers: des = 0 orbit_id = 1 jd = 2 cd = 3 dist = 4 dist_min = 5 dist_max = 6 v_rel = 7 v_inf = 8 t_signma_F = 9 h = 10 """ def diameter_calc(log_value, mag): #formula for diamter calculation return 10**(0.5*(6.259...
{ "content_hash": "250a4a86a9e1b7a1a79c43a1d44dba71", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 100, "avg_line_length": 21.22641509433962, "alnum_prop": 0.6062222222222222, "repo_name": "FXelix/space_facts_bot", "id": "d08e64b3c05fd74d2e179db9fb9eea15a69bbc62", "size"...
"""Tests for initializers in init_ops_v2.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.framework import tenso...
{ "content_hash": "7584794744e2b1de83dab3184e2d2d96", "timestamp": "", "source": "github", "line_count": 580, "max_line_length": 80, "avg_line_length": 34.18103448275862, "alnum_prop": 0.6587137452711224, "repo_name": "cxxgtxy/tensorflow", "id": "2de636c2f8df6ab5c023d03ac9b76f5c2c51cd5e", "size": "2...
""" Unit tests for standard_names pacakge. """
{ "content_hash": "21ddecbef07af51d651a634383641037", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 38, "avg_line_length": 15.666666666666666, "alnum_prop": 0.6808510638297872, "repo_name": "csdms/standard_names", "id": "15615c3c4c417ff3148c3ee84f927a8f8c7c7e16", "size": "...
"""Deployment script for CWV in GA4 solution. Deploys the SQL tables and scripts needed to collect CWVs according to the standard set in https://web.dev/vitals-ga4/ as well as a cloud run function for alerting. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in co...
{ "content_hash": "2f455838b13cba407337675654217da7", "timestamp": "", "source": "github", "line_count": 706, "max_line_length": 100, "avg_line_length": 40.42492917847026, "alnum_prop": 0.6130343377715487, "repo_name": "google/cwv_in_ga4", "id": "8710ced67307e436270257fb9439ea01f472c9bc", "size": "2...
""" Server so nltk doesn't initialize for every meme request. Author: Jack Romo <sharrackor@gmail.com> """ from flask import Flask, request from main import DogeGen class DogeServer(object): """ Server to generate Doge images. """ app = Flask(__name__) dogegen = None @staticmethod def ...
{ "content_hash": "1619d02667d6a12ae209dd21823089a0", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 70, "avg_line_length": 25.64516129032258, "alnum_prop": 0.5836477987421383, "repo_name": "MemeTrash/DogeGen", "id": "d1e3566418e2e32c2057cb4dd166f0919c1b1b27", "size": "159...
from schematics.models import Model from schematics.types import StringType from .models import Route class DirectionsResponse(object): """ The Directions Response class represents a response. The two attributes include: 1. Status - Represents the status of the request 2. Routes - Represents an array of rout...
{ "content_hash": "7f911e87dd4da8c977cf05c8b44b6b57", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 70, "avg_line_length": 22.096774193548388, "alnum_prop": 0.7299270072992701, "repo_name": "apranav19/pydirections", "id": "9522f7d1f858cbcc2383a0b8d51f87d34de52732", "size"...
""" Test suite for SocketServer.py. """ import contextlib import imp import os import select import signal import socket import tempfile import unittest import SocketServer import test.test_support from test.test_support import reap_children, reap_threads, verbose try: import threading except Im...
{ "content_hash": "b40d83c1f5bb6485178c94fbae001237", "timestamp": "", "source": "github", "line_count": 284, "max_line_length": 76, "avg_line_length": 35.08098591549296, "alnum_prop": 0.5463213891398173, "repo_name": "google/google-ctf", "id": "cd7a70919e09658de38abd89f80a5dc95c8b8d96", "size": "99...
import functools import json import re from django.conf import settings from django.contrib.admindocs.views import simplify_regex from django.core.exceptions import ViewDoesNotExist from django.core.management.base import BaseCommand, CommandError try: from django.urls import RegexURLPattern, RegexURLResolver, Loc...
{ "content_hash": "ad047e7c9b358cf551015fea99474fb3", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 135, "avg_line_length": 42.19457013574661, "alnum_prop": 0.5376943699731903, "repo_name": "vicky2135/lucious", "id": "94382a602e67e65147c422f4e22fb7296d8a19ca", "size": "9...
from twisted.python import versions version = versions.Version(__name__[:__name__.rfind('.')], 0, 3, 0)
{ "content_hash": "004abcb83267ae93cda6a89e00a10355", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 67, "avg_line_length": 52, "alnum_prop": 0.6634615384615384, "repo_name": "twisted/sine", "id": "6200cac911ff854915bb836bcddd432a970f2bf2", "size": "175", "binary": false,...
from django.db import models from thing.models.constellation import Constellation class System(models.Model): id = models.IntegerField(primary_key=True) name = models.CharField(max_length=32) constellation = models.ForeignKey(Constellation) class Meta: app_label = 'thing' ordering =...
{ "content_hash": "eb31f02121baa7423b9705d0cd6ba010", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 52, "avg_line_length": 22.58823529411765, "alnum_prop": 0.6796875, "repo_name": "Gillingham/evething", "id": "e1de60da4a73291a1d3ffd55e0734368f43b5705", "size": "1904", "...
from __future__ import unicode_literals import logging import os import six import yaml from django.conf import settings from django.contrib.contenttypes.fields import GenericRelation from django.db import models from django_extensions.db.models import ( TimeStampedModel, TitleSlugDescriptionModel, ) from sal...
{ "content_hash": "ce8ada8e54256e6a1a099ef4157e76fb", "timestamp": "", "source": "github", "line_count": 494, "max_line_length": 100, "avg_line_length": 31.62348178137652, "alnum_prop": 0.6373703751120215, "repo_name": "clarkperkins/stackdio", "id": "86f5f53495e74cd0ea0b2746162ca3b14ca027e7", "size"...
""" Extension of chart parsing implementation to handle grammars with feature structures as nodes. """ import yaml from api import * from chart import * from nltk.featstruct import FeatStruct, unify, FeatStructParser from nltk.sem.logic import SubstituteBindingsI, unique_variable from nltk import cfg, defaultdict from...
{ "content_hash": "e1d6e0b2c37b392aba69d1e577e96599", "timestamp": "", "source": "github", "line_count": 503, "max_line_length": 78, "avg_line_length": 40.636182902584494, "alnum_prop": 0.5936399217221136, "repo_name": "hectormartinez/rougexstem", "id": "38f1390771599ab5afccf60e66d7bd4b22ac4c7b", "s...
import os, sys, time, struct, uuid, re from . import root, ThriftTester from . import thrift_client as client from thrift.Thrift import TApplicationException from ttypes import * from constants import VERSION def _i64(n): return struct.pack('>q', n) # big endian = network order _SIMPLE_COLUMNS = [Column('c1', ...
{ "content_hash": "55b3fb7517698156b844ce6defb08ae2", "timestamp": "", "source": "github", "line_count": 1966, "max_line_length": 623, "avg_line_length": 51.45269582909461, "alnum_prop": 0.6208035114081221, "repo_name": "nunezro2/cassandra_cs597", "id": "8fecd2997aa14ee68892c235f02c5d3acf7c0b65", "s...
""" desispec.scripts.average_fiberflat ================================== """ from __future__ import absolute_import, division import time import numpy as np from desiutil.log import get_logger from desispec.io import read_fiberflat,write_fiberflat from desispec.fiberflat import average_fiberflat import argparse de...
{ "content_hash": "68649322ae55c0e22818c54883a97eb5", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 94, "avg_line_length": 31.717391304347824, "alnum_prop": 0.6511309115832762, "repo_name": "desihub/desispec", "id": "f6b42aae90572f7c666addc4393b3383aa76d977", "size": "145...
from test_framework.test_framework import KoreTestFramework from test_framework.util import * class WalletTest (KoreTestFramework): def check_fee_amount(self, curr_balance, balance_with_fee, fee_per_byte, tx_size): """Return curr_balance after asserting the fee was in range""" fee = balance_with_f...
{ "content_hash": "25bc6ac6d3b86a155e9fd85989dd286e", "timestamp": "", "source": "github", "line_count": 328, "max_line_length": 164, "avg_line_length": 44.22256097560975, "alnum_prop": 0.6181316787314719, "repo_name": "Kore-Core/kore", "id": "f81c3cdfc4c0cda3e0b74c4cbd0f1cc33727a212", "size": "1471...
"""Support for ESPHome fans.""" from __future__ import annotations import math from aioesphomeapi import FanDirection, FanInfo, FanSpeed, FanState from homeassistant.components.fan import ( DIRECTION_FORWARD, DIRECTION_REVERSE, SUPPORT_DIRECTION, SUPPORT_OSCILLATE, SUPPORT_SET_SPEED, FanEntit...
{ "content_hash": "48d5546ba7142a82a5ce375c8c9fbe1d", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 85, "avg_line_length": 30.931428571428572, "alnum_prop": 0.6155551450212452, "repo_name": "adrienbrault/home-assistant", "id": "5d7cf24f2c518366e8bdd684b7219a5b8a438758", ...
from os import path import mock import six import yaml from cinder.volume.drivers.dell_emc.vnx import client from cinder.volume.drivers.dell_emc.vnx import common patch_sleep = mock.patch('time.sleep') patch_vnxsystem = mock.patch('storops.VNXSystem') def load_yaml(file_name): yaml_file = '{}/{}'.format(pat...
{ "content_hash": "7a365d8fc711e2de734a8c2d10a68cbd", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 76, "avg_line_length": 27.63768115942029, "alnum_prop": 0.6465652857891977, "repo_name": "ge0rgi/cinder", "id": "f771f99d64425506fb839c3cbd1632afc39184e7", "size": "2522", ...
from setuptools import setup import django_sha2 setup( name='django-sha2', version=django_sha2.__version__, description='Enable strong password hashes (bcrypt+hmac or SHA-2) in Django by default.', long_description=open('README.md').read(), author='Fred Wenzel', author_email='fwenzel@mozilla....
{ "content_hash": "08c12dba8dabd4863031d3ddbe83c03b", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 93, "avg_line_length": 32, "alnum_prop": 0.6302083333333334, "repo_name": "brianloveswords/django-sha2", "id": "3532ed238e1d73e41013dfb786c29e5a57bd7c7f", "size": "960", ...
from __future__ import unicode_literals from .config import * from .wrappers import DictWrapper, Wrapper class Networks(DictWrapper): def __init__(self, resource, client, populate=False): super(Networks, self).__init__(resource, client, populate=populate) def wrap(self, network): return Net...
{ "content_hash": "eec9cbe6c7c86e0cf02616f5bd945bbf", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 75, "avg_line_length": 22.956521739130434, "alnum_prop": 0.6856060606060606, "repo_name": "GemHQ/round-py", "id": "dfaace36447663bcbd972283b0ff39dda315db51", "size": "614",...
""" Copyright [Participants AERIUS Masterclass: Marco Duiker, Peer vd Sande, Alex Bouthoorn, Laurens vd Burgt, Rik Zegers, Lotte Dijk, Kaj Fabri, Esther Kokmeyer, Christa Blokhuis, Anneke Donkersloot, Japer Harbers, Roy Laurijsse, Luc Meegens, Marike Aalbers] Licensed under the Apache License, Version 2.0 (the "Licens...
{ "content_hash": "d7e6f4880ab0a11295e610fe11f1486e", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 255, "avg_line_length": 43.706896551724135, "alnum_prop": 0.6418145956607495, "repo_name": "aerius/aerius-imaer-templates", "id": "0b81037806a9afb35ab380955614054203a8af93", ...
"""Productions settings""" from __future__ import absolute_import from os import environ from .base import * # adding exception for improper configured settings from django.core.exceptions import ImproperlyConfigured def get_env_setting(setting): try: return environ[setting] except KeyError: ...
{ "content_hash": "2c08e67d725a6ac0fc8e1f88e6ccef71", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 55, "avg_line_length": 23, "alnum_prop": 0.6549789621318373, "repo_name": "kamar42/merdeka-backend", "id": "619ec8edb0b4518c24ad35abdb50d10cde21422c", "size": "713", "bin...
""" @package mi.dataset.driver.fuelcell_eng.dcl @file mi-dataset/mi/dataset/driver/fuelcell_eng/dcl/fuelcell_eng_dcl_recovered_driver.py @author Chris Goodrich @brief Recovered driver for the fuelcell_eng_dcl instrument Release notes: Initial Release """ from mi.dataset.dataset_driver import SimpleDatasetDriver from...
{ "content_hash": "665c3c185f04ced99b1f6a6d6ec078d2", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 115, "avg_line_length": 36.66101694915254, "alnum_prop": 0.729079981507166, "repo_name": "JeffRoy/mi-dataset", "id": "ac1dcd0f133afed6e21e8fc18e2b58a962f16a3c", "size": "21...
""" Unit test for EC2 ipa. """ import unittest import mock from treadmill.infra.setup.ipa import IPA from treadmill.infra import constants class IPATest(unittest.TestCase): """Tests EC2 ipa setup.""" @mock.patch('time.time', mock.Mock(return_value=1000)) @mock.patch('treadmill.infra.subnet.Subnet') ...
{ "content_hash": "0d5aed82c5f36f01da16e4f142a68af2", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 75, "avg_line_length": 34.0125786163522, "alnum_prop": 0.5536242603550295, "repo_name": "bretttegart/treadmill", "id": "c1ea9262c9e85b91fc4ffa5d2a440667f789895e", "size": ...
from datetime import datetime, timedelta from os import path, unlink from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.db import close_old_connections import olympia.core.logger from olympia import amo from olympia.addons.models import Addon from olympia.f...
{ "content_hash": "8293625c7ab3336bf3f44dc41094a2b5", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 79, "avg_line_length": 37.952153110047846, "alnum_prop": 0.5753908219868885, "repo_name": "kumar303/addons-server", "id": "842b468510ce1f499fc4be77bfee639b0d2f9a62", "size...
"""Support for SwitchBot sensors.""" from __future__ import annotations from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, SensorEntityDescription, ) from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( CONF_MAC, CONF_NAME, PERCENTAG...
{ "content_hash": "c141ed96f61c00edd71ba19c00e53b41", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 84, "avg_line_length": 30.74736842105263, "alnum_prop": 0.6603902773022937, "repo_name": "toddeye/home-assistant", "id": "1ee0276b7ee4ceeccac865c7fefd3e68f7e54df3", "size":...
import serial import time ser = serial.Serial('/dev/serial0', 9600, timeout=0) time.sleep(5) print('ready') while True: print(ser.readline()) time.sleep(1)
{ "content_hash": "aac6f06b1c54d8a601e8a7d04d10b49e", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 52, "avg_line_length": 15.181818181818182, "alnum_prop": 0.6826347305389222, "repo_name": "embeddedemily/ember-agaricglow", "id": "364049df20c0788c50e737a4ea6a80f535ad6647", ...
import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configurat...
{ "content_hash": "3efded3ec1b1337de006bcf6f4c9f0ae", "timestamp": "", "source": "github", "line_count": 238, "max_line_length": 112, "avg_line_length": 32.88655462184874, "alnum_prop": 0.702823559473617, "repo_name": "probcomp/crosscat", "id": "36340c676de2d97dbab98fac944d59979482663f", "size": "90...
from django.http import HttpResponse from gm_pr import settings, proj_repo from bot import tasks, slackauth @slackauth.isFromSlack def index(request): project, repos = proj_repo.proj_repo(request) if repos != None: tasks.slack(settings.TOP_LEVEL_URL, settings.ORG, ...
{ "content_hash": "3cf1d67f582dc845a21d2c69eeb6187e", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 68, "avg_line_length": 36.1764705882353, "alnum_prop": 0.5934959349593496, "repo_name": "Genymobile/gm_pr", "id": "7509ae5d77b20a441633a57e6fec90f638a22259", "size": "1192"...
import math import paddle.v2 as paddle def network_conf(hidden_size, embed_size, dict_size, is_train=True): first_word = paddle.layer.data( name='firstw', type=paddle.data_type.integer_value(dict_size)) second_word = paddle.layer.data( name='secondw', type=paddle.data_type.integer_value(dict_s...
{ "content_hash": "1c9f7b38a50fd3b3299a5f08700f85bb", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 80, "avg_line_length": 42.68421052631579, "alnum_prop": 0.6407727085902178, "repo_name": "Canpio/models", "id": "be6b7462a1487e906278fa2682d65add256aaa2d", "size": "2480", ...
"""Tests for the pvpc_hourly_pricing sensor component.""" from datetime import datetime, timedelta import logging from pytz import timezone from homeassistant.components.pvpc_hourly_pricing import ATTR_TARIFF, DOMAIN from homeassistant.const import CONF_NAME from homeassistant.core import ATTR_NOW, EVENT_TIME_CHANGED...
{ "content_hash": "9a284e6d029d4dc5090654d12369c8b7", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 87, "avg_line_length": 41.75, "alnum_prop": 0.6608600979858464, "repo_name": "pschmitt/home-assistant", "id": "57861b8b72be37846d7b166c1bd3f638898f8dc6", "size": "3674", ...
from django.db import transaction import pytest @pytest.fixture(scope='session', autouse=True) def patch_on_commit_hook(): old_on_commit = transaction.on_commit transaction.on_commit = lambda func, *args, **kwargs: func() yield transaction.on_commit = old_on_commit @pytest.fixture(autouse=True) def ...
{ "content_hash": "0149b808053bffed2f658a2e0630e8f7", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 64, "avg_line_length": 24.428571428571427, "alnum_prop": 0.7095516569200779, "repo_name": "sergeii/swat4stats.com", "id": "2547fdb7663618fd1c003d5a575bbdf71a0b1b8b", "size"...
from __future__ import unicode_literals, division, absolute_import from django.contrib import admin from django.utils.safestring import mark_safe from pygments import highlight from pygments.formatters.html import HtmlFormatter from pygments.lexers.data import JsonLexer from . import models class _PrettyResponseMi...
{ "content_hash": "1ea16f01ca96a0b2ee7b269f3efd35e0", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 112, "avg_line_length": 42.30434782608695, "alnum_prop": 0.6952723535457348, "repo_name": "silverfix/django-ribbon", "id": "c92501551bf0ac89834917b499af7069f91eb043", "size...
from django.contrib.sessions.base_session import AbstractBaseSession, BaseSessionManager class SessionManager(BaseSessionManager): use_in_migrations = True class Session(AbstractBaseSession): """ Django provides full support for anonymous sessions. The session framework lets you store and retrieve a...
{ "content_hash": "4dd5e62c0ee4acbae19f8c9567def9ff", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 88, "avg_line_length": 35.714285714285715, "alnum_prop": 0.744, "repo_name": "auvipy/django", "id": "e786ab4eac4262a5e4b628e3e39dad4e224a546a", "size": "1250", "binary": ...
from django.utils.translation import ugettext_lazy as _ from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from .models import MarkitUpPluginModel class MarkItUpPlugin(CMSPluginBase): name = _(u'MarkItUp') model = MarkitUpPluginModel render_template = 'djangocms_markitup/m...
{ "content_hash": "3bff0862242f3ad389d9b88f6ddd5d77", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 56, "avg_line_length": 27.071428571428573, "alnum_prop": 0.7915567282321899, "repo_name": "nephila/djangocms-markitup", "id": "b9b3be22f2f05b883a1a969a9b03f6d452fc305f", "s...
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_sullustan_male.iff" result.attribute_template_id = 9 result.stfName("npc_name","sullustan_base_male") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "caa942947b89f64b2cdff6efff93e56b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 60, "avg_line_length": 22.923076923076923, "alnum_prop": 0.6946308724832215, "repo_name": "anhstudios/swganh", "id": "2c28682476b98eff916dba95004c32f77ff6109f", "size": "44...
'''perform automatic newline conversion (DEPRECATED) Deprecation: The win32text extension requires each user to configure the extension again and again for each clone since the configuration is not copied when cloning. We have therefore made the ``eol`` as an alternative. The ``eol`` uses a version controll...
{ "content_hash": "f82fb9ea0bb2235666c863242b9f78a9", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 80, "avg_line_length": 28.899543378995435, "alnum_prop": 0.597882761889714, "repo_name": "mdaniel/intellij-community", "id": "30dd8eb7f2d3e5f5184fd80e8cfe93a668fb8afd", "s...
import sensor, image, time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QQVGA) # or sensor.QVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. clock = time.clock() # Tracks FPS. while(True): clock....
{ "content_hash": "cd298f3bafd2e4d344690793ceda5e8b", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 76, "avg_line_length": 48.72727272727273, "alnum_prop": 0.7024253731343284, "repo_name": "openmv/openmv", "id": "ee9ab5d94004aa1ba9d5b0c444f60040f9511831", "size": "1258", ...
from cStringIO import StringIO from decimal import Decimal from transit.writer import Writer from transit.reader import Reader from transit_helpers import DecimalWriteHandler, DecimalReadHandler # ============================================================================== def serialize(data): io = StringIO() wr...
{ "content_hash": "91924bd7a6f76d5b5cedbfe67cfa063a", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 80, "avg_line_length": 28.85, "alnum_prop": 0.5701906412478336, "repo_name": "ryanwersal/python-serialization-comparison", "id": "0a0a26c342c86cce38bcd97706f7a5032dcd39a2", ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('database', '0019_auto_20170821_0842'), ] operations = [ migrations.AlterField( model_name='profile', name='rate', ...
{ "content_hash": "3256447603e206a0272c6ff054aea082", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 144, "avg_line_length": 26.22222222222222, "alnum_prop": 0.6207627118644068, "repo_name": "ACLARKNET/aclarknet-database", "id": "b3af59615a494321be8c31169823e9b815a8d2b4", ...
"""Property type (attribute) package. """ __version__ = "$Revision: #1 $" #=========================================================================== from .Alias import Alias from .Boolean import Boolean from .Enum import Enum from .Float import Float from .Instance import Instance from .Integer import Integer from ...
{ "content_hash": "514c8d290844d442974b8d1df5314f9b", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 76, "avg_line_length": 30.736842105263158, "alnum_prop": 0.4623287671232877, "repo_name": "nasa/mplStyle", "id": "bbdde8061c97fea50f424ffcf2d54fa53dc26f6d", "size": "2386",...
import cx_Oracle # the connection must be in PRELIM_AUTH mode connection = cx_Oracle.connect("/", mode = cx_Oracle.SYSDBA | cx_Oracle.PRELIM_AUTH) connection.startup() # the following statements must be issued in normal SYSDBA mode connection = cx_Oracle.connect("/", mode = cx_Oracle.SYSDBA) cursor = connecti...
{ "content_hash": "8aa04d41bb7f51dfb5ad5171e1fb3994", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 63, "avg_line_length": 31.53846153846154, "alnum_prop": 0.7439024390243902, "repo_name": "cloudera/hue", "id": "05fdfdcb6c72b9654e9a168dcdc1f077d39c5d72", "size": "1272", ...
"""Functions for fitting the model, etc. """ # from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np def initial_period(N=100, logTmin=2, logTmax=5): """Return a vector of initial frequencies, evenly spaced in log *period*. Parameters ...
{ "content_hash": "f9222d463ca031dec96c612a4c83a230", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 77, "avg_line_length": 31.39344262295082, "alnum_prop": 0.5953002610966057, "repo_name": "weaverba137/rv", "id": "208fe6a95febc2f13f59f4c621588746805d5bdf", "size": "2003",...
__all__ = [ "AR", "ARDL", "ARIMA", "ArmaProcess", "AutoReg", "DynamicFactor", "DynamicFactorMQ", "ETSModel", "ExponentialSmoothing", "Holt", "MarkovAutoregression", "MarkovRegression", "SARIMAX", "STL", "STLForecast", "SVAR", "SimpleExpSmoothing", ...
{ "content_hash": "3430954a83a6e92cf49d707797d483bc", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 72, "avg_line_length": 24.568807339449542, "alnum_prop": 0.6755041075429425, "repo_name": "bashtage/statsmodels", "id": "a802379c6f018ba552a7f9c989253c364f15f98e", "size":...
""" This shows an example of the "fivethirtyeight" styling, which tries to replicate the styles from FiveThirtyEight.com. """ from matplotlib import pyplot as plt import numpy as np x = np.linspace(0, 10) with plt.style.context('fivethirtyeight'): plt.plot(x, np.sin(x) + x + np.random.randn(50)) plt.plot(x...
{ "content_hash": "acf9bdf28cc027dc6bb1d6c7e7ee2836", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 62, "avg_line_length": 24.166666666666668, "alnum_prop": 0.6689655172413793, "repo_name": "yavalvas/yav_com", "id": "4bed0a5d2ddebd7ad35afbad99456c8356bc4438", "size": "435...
""" MiniVC - a small and simple, mvc library for python. it doesn't do much. thats a feature. mvc, so if nothing else, we can throw the laundry that is our code into three different piles. inspired by puremvc python by Toby de Havilland <toby.de.havilland@puremvc.org> """ # Forked from nathants from collections impor...
{ "content_hash": "21dcde9bc1860785ff7a0edcfe7285f9", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 109, "avg_line_length": 30.93452380952381, "alnum_prop": 0.6159322686165095, "repo_name": "Yoriz/minivc", "id": "784073bd54d309fd432a01406fd296008186746e", "size": "5197",...
import json from glob import glob import os.path as osp name = 'jlab_mock_consumer' HERE = osp.abspath(osp.dirname(__file__)) with open(osp.join(HERE, 'package.json')) as fid: data = json.load(fid) from setuptools import setup js_name = data['name'] setup(name=name, version=data['version'], py_modu...
{ "content_hash": "8910a719bc6c4850542683e9c4f3ee09", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 82, "avg_line_length": 25.047619047619047, "alnum_prop": 0.6501901140684411, "repo_name": "jupyter/jupyterlab", "id": "05af57ecec5b58ea0dbb2d3337068cef8cbfb656", "size": "5...
from tests.base import TestCase from vilya.models.linecomment import CommitLineComment, PullLineComment from vilya.models.consts import ( LINECOMMENT_TYPE_COMMIT, LINECOMMENT_TYPE_PULL) TARGET_ID = 123 FROM_SHA = '2a200e45b0e223d13477e' TO_SHA = '2a200e45b0e223d13477e' OLD_PATH = 'testfolder/testfile.py' NEW_PATH...
{ "content_hash": "41e3cdafc84235c16d3bf062d79ca21d", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 74, "avg_line_length": 41.338345864661655, "alnum_prop": 0.5542015278283012, "repo_name": "xtao/code", "id": "73811de49e54aabe4133449cd3ad49354bec2aef", "size": "5531", ...
from django.conf.urls import patterns, url urlpatterns = patterns('', url(r'^connect/$', 'django_loginradius.views.connect', name='lr_connect'), )
{ "content_hash": "42d7a04bef8d47a8980ce553d842e8e3", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 78, "avg_line_length": 30.4, "alnum_prop": 0.7039473684210527, "repo_name": "LoginRadius/social-login-django", "id": "0bd6bf8302f32ac592dec4bc51a28f018688b3a5", "size": "152...
import itk import itk.support.types as itkt from sys import argv, version_info import warnings if version_info >= (3, 8): from typing import Sequence, TypeVar, get_type_hints, get_args, get_origin, Union else: from typing import Sequence, TypeVar, Union try: from numpy.typing import ArrayLike except Impo...
{ "content_hash": "5132f319f4a754c2230ad07cab33b714", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 88, "avg_line_length": 34.135416666666664, "alnum_prop": 0.7339029600244126, "repo_name": "Kitware/ITK", "id": "267a880038fcc20cb6f5a669cb454eddf9334fa9", "size": "4085", ...
import chainer from chainer import backend class GradientLARS(object): """Optimizer/UpdateRule hook function for layer wise adaptive rate scaling. See: `Large Batch Training of Convolutional Networks <https://arxiv.org/abs/1708.03888>`_. See: `Convergence Analysis of Gradient Descent Algorithms ...
{ "content_hash": "0ace8673566c9fef0e614d5b15267e14", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 79, "avg_line_length": 40.189189189189186, "alnum_prop": 0.528805200627662, "repo_name": "hvy/chainer", "id": "4ed7a8826dd214669d71c1adb4e52329dcc7fd30", "size": "4461", ...
from load import main as main_load from scrape import main as main_scrape from transform import main as main_transform def entrypoints(): return { 'scrape': main_scrape, 'transform': main_transform, 'load': main_load }
{ "content_hash": "05510a2a615b79d46ac1edc27dadb7aa", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 44, "avg_line_length": 25.2, "alnum_prop": 0.6666666666666666, "repo_name": "nhsengland/publish-o-matic", "id": "acae94580f02d5f492e1c21857e2fa60d359ef10", "size": "252", ...
CATKIN_PACKAGE_PREFIX = "" PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else [] PROJECT_CATKIN_DEPENDS = "".replace(';', ' ') PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else [] PROJECT_NAME = "my_pcl_tutorial" PROJECT_SPACE_DIR = "/home/xuzhe/study/recogition/pourwater/install" PROJECT_...
{ "content_hash": "ba0735ff56cbca2e5a4eaa72248fd31e", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 68, "avg_line_length": 48.285714285714285, "alnum_prop": 0.6479289940828402, "repo_name": "YinYangOfDao/ComputerVision", "id": "f16ed0e8a1065b7451a6ed20da8650d45c31d311", "s...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('landing', '0078_auto_20200215_1909'), ] operations = [ migrations.AlterField( model_name='section', name='template', field=models.CharField(choices=[('st...
{ "content_hash": "e52d758c3a07d02ef7fde58e5df22ee0", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 182, "avg_line_length": 29.5, "alnum_prop": 0.6165254237288136, "repo_name": "flavoi/diventi", "id": "d85a68046299dd8b76f851e1157494274efd585e", "size": "522", "binary": ...
from django.core.urlresolvers import reverse from django.shortcuts import redirect, get_object_or_404 from django.contrib.auth import authenticate, login, REDIRECT_FIELD_NAME from django.contrib.auth.forms import PasswordChangeForm from django.contrib.auth.views import logout as Signout from django.views.generic import...
{ "content_hash": "53890d71e074b00162a0b84fa62c3183", "timestamp": "", "source": "github", "line_count": 650, "max_line_length": 102, "avg_line_length": 36.13230769230769, "alnum_prop": 0.6268841011666525, "repo_name": "ff0000/scarlet", "id": "15cd0a17184f438ea11b94390e7f7db4eeb76447", "size": "2348...
from django.conf import settings from open511_server.utils.exceptions import BadRequest class APIPaginator(object): """ Largely cribbed from django-tastypie. """ def __init__(self, request, objects, limit=None, offset=0, max_limit=500): """ Instantiates the ``Paginator`` and allows for...
{ "content_hash": "35ea30cf9cd6f65ba82f900f8bf4c7f3", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 110, "avg_line_length": 32.846715328467155, "alnum_prop": 0.5802222222222222, "repo_name": "Open511/open511-server", "id": "57e7a41cebeb0115747634533a76d359874de401", "siz...
from licant.modules import submodule from licant.cxx_modules import application from licant.scripter import scriptq import licant scriptq.execute("../../gxx.g.py") application("target", sources = ["main.c"], include_paths = ["../.."], modules = [ submodule("gxx.c_only"), submodule("gxx.dprint", "stdout"), ], ...
{ "content_hash": "726d3f6062099eba9aa548a4c4fa97e9", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 42, "avg_line_length": 20.176470588235293, "alnum_prop": 0.685131195335277, "repo_name": "Mirmik/gxx", "id": "9d3a12b8a4f8577844ea0b3c6d84fa3937759082", "size": "382", "b...
""" Hammer projection (http://en.wikipedia.org/wiki/Hammer_projection) """ from glumpy import library from . transform import Transform class HammerProjection(Transform): """ Hammer projection """ aliases = { } def __init__(self, *args, **kwargs): """ Initialize the transform. N...
{ "content_hash": "79cdaeb44bb8498e21a1b42467d48cdf", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 66, "avg_line_length": 22.06896551724138, "alnum_prop": 0.5828125, "repo_name": "glumpy/glumpy", "id": "15923a5b3215979238c864326ac77a1447fc74a4", "size": "910", "binary"...
"""Module for Client for kripo web service""" from __future__ import absolute_import import requests from rdkit.Chem.AllChem import MolFromMolBlock from requests import HTTPError class Incomplete(Exception): def __init__(self, message, absent_identifiers): super(Incomplete, self).__init__(message) ...
{ "content_hash": "91db6dd65ab5521f19b31e2e07ae0cf5", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 104, "avg_line_length": 39.43225806451613, "alnum_prop": 0.6223821989528796, "repo_name": "3D-e-Chem/python-modified-tanimoto", "id": "d378e47dc249ba85df58d81620a82453a7dc65...
from girder.constants import AccessType from girder.models.assetstore import Assetstore from girder.models.collection import Collection from girder.models.folder import Folder from girder.models.group import Group from girder.models.setting import Setting from girder.settings import SettingKey from girder_large_image.c...
{ "content_hash": "91f017683b14771128b4690247f8ff8a", "timestamp": "", "source": "github", "line_count": 234, "max_line_length": 97, "avg_line_length": 33.69230769230769, "alnum_prop": 0.6433282597666159, "repo_name": "ImageMarkup/isic-archive", "id": "6b320db8f3850326bc6c592a9e304cc18954add0", "siz...
import pytest from Cauldron.utils.helpers import _Setting, api_not_required from Cauldron.exc import CauldronAPINotImplemented def test_setting_inverse(): """Make a setting and test inverse setting.""" setting = _Setting("TESTSETTING", False) inv = setting.inverse assert not setting assert inv ...
{ "content_hash": "f808e0a92306e75da060a0d01c4e8924", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 115, "avg_line_length": 28.325581395348838, "alnum_prop": 0.6576354679802956, "repo_name": "alexrudy/Cauldron", "id": "97d9d2845302658e9139335b6e95a30617e22c58", "size": "1...
import subprocess import unittest import testbase import default_cluster import util import os import constant import config import time import telnetlib import signal class TestBasicOp(unittest.TestCase): cluster = config.clusters[2] @classmethod def setUpClass(cls): return 0 @classmethod ...
{ "content_hash": "1bfa89e8840f7b2720df64148ae069c5", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 96, "avg_line_length": 28.73913043478261, "alnum_prop": 0.5697428139183056, "repo_name": "cl9200/nbase-arc", "id": "9a7772a524302402c24dd2f1485d5fbd55e5a2d0", "size": "388...
from skbeam.fluorescence import * # noqa: F401, F403
{ "content_hash": "2771c13be9d36f87ee4a12da33f6ced9", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 53, "avg_line_length": 54, "alnum_prop": 0.7407407407407407, "repo_name": "Nikea/scikit-xray", "id": "6f8506f998ce77fa06fcd2ec862b6d01b021611d", "size": "93", "binary": fa...
from django.db import models, migrations import django.contrib.gis.db.models.fields class Migration(migrations.Migration): dependencies = [] operations = [ migrations.CreateModel( name="Council", fields=[ ( "council_id", ...
{ "content_hash": "d8d7922050cb2e43e84cf1a96831c30e", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 88, "avg_line_length": 37.5609756097561, "alnum_prop": 0.4831168831168831, "repo_name": "DemocracyClub/UK-Polling-Stations", "id": "3e1bac8f67cfa6f88c8920b067b013028a6ea89b",...
import cProfile import json import scipy import numpy as np import icgauge from icgauge import experiment_frameworks print "Punctuation test framework:" print " =================================== " print " First test: dataset with punctuation" print " =================================== " print " Data: practic...
{ "content_hash": "338378ef8a3b8f306899f6d05d81f28e", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 87, "avg_line_length": 29.903614457831324, "alnum_prop": 0.6772763900080581, "repo_name": "ptoman/icgauge", "id": "7bbcf00e0a2b273db913b12b45da1c4980a75a90", "size": "2911"...
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 AVAILABLE_PROTOCOLS = ('HTTP', 'HTTPS', 'TCP') AVAILABLE_ME...
{ "content_hash": "0f6824e3af41feec88bc74355bbae826", "timestamp": "", "source": "github", "line_count": 625, "max_line_length": 79, "avg_line_length": 39.2672, "alnum_prop": 0.5511775731399234, "repo_name": "Havate/havate-openstack", "id": "356eb84aa693e8281673cdfdbc238db82390d4e6", "size": "25209"...
from __future__ import absolute_import, division, print_function, unicode_literals import json from botocore.exceptions import ClientError from c7n.actions import ActionRegistry, AutoTagUser, BaseAction from c7n.filters import CrossAccountAccessFilter, FilterRegistry, ValueFilter import c7n.filters.vpc as net_filters...
{ "content_hash": "fa6a60adae0352b19ebbf45324a3738c", "timestamp": "", "source": "github", "line_count": 303, "max_line_length": 82, "avg_line_length": 31.70957095709571, "alnum_prop": 0.5868026644462948, "repo_name": "VeritasOS/cloud-custodian", "id": "1f178f7238979553dd15dd2dfd0b80df73c6b00a", "si...
from sqlobject import * from sqlobject.tests.dbtest import * ######################################## ## String ID test ######################################## class SOStringID(SQLObject): class sqlmeta(sqlmeta): table = 'so_string_id' idType = str val = StringCol(alternateID=True) mysq...
{ "content_hash": "cd941ddd426c863f3bc619b583be45ac", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 45, "avg_line_length": 20.842105263157894, "alnum_prop": 0.5587121212121212, "repo_name": "lightcode/SeriesWatcher", "id": "05891adc233202ae6d7b3870d7f0f659895afd37", "size...
"""Tests for API client and approvals-related API calls.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import threading import time from absl import app from grr_response_core.lib.util import compatibility from grr_response_server.gui import api_aut...
{ "content_hash": "e14b13363504fb4a55ef62c6a6d5e7c4", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 78, "avg_line_length": 31.017543859649123, "alnum_prop": 0.7010746606334841, "repo_name": "dunkhong/grr", "id": "7eee8358b8e1b75c71f1e125f7047ebc21c83991", "size": "3558",...
import time import socket from heat.openstack.common import log as logging import heat.engine.resources.cloudmanager.util.conf_util as conf_util from heat.engine.resources.cloudmanager.util.subnet_manager import SubnetManager from heat.engine.resources.cloudmanager.exception import * from heat.engine.resources.cloudma...
{ "content_hash": "98128a51974b3f1388d837c52fec53b9", "timestamp": "", "source": "github", "line_count": 631, "max_line_length": 128, "avg_line_length": 44.378763866877975, "alnum_prop": 0.5765096596793201, "repo_name": "Hybrid-Cloud/cloud_manager", "id": "1f139cabfac3264decf363795b9dff4d74660568", ...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('taxbrain', '0013_auto_20141021_1346'), ] operations = [ migrations.CreateModel( name='AdjustmentsInputs', fields=[ ...
{ "content_hash": "98e674c86c68267d9d4525a6f3f89215", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 114, "avg_line_length": 31.55056179775281, "alnum_prop": 0.49572649572649574, "repo_name": "PeterDSteinberg/webapp-public", "id": "6aef41e12b337d32626c66327d77e1b5ddd333b9", ...
"""List of checks for crosswind sweeps.""" from makani.analysis.checks.collection import score_checks from makani.analysis.crosswind_batch_sims import batch_sim_params class CrosswindSweepChecks(score_checks.ScoreChecks): """The list of checks for crosswind sweep.""" def __init__(self, for_log, wing_model): ...
{ "content_hash": "d1ef3a45db8fe69b29db5c319440aa27", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 73, "avg_line_length": 39.93333333333333, "alnum_prop": 0.7362270450751253, "repo_name": "google/makani", "id": "d340eb4168494a1eec119e014d938f7ac9fe6751", "size": "1188", ...
""" Sales integration with Events module """ from maker.sales.models import Opportunity from maker.core.models import Object from maker.events.rendering import EventRenderer from django.db.models import Q import datetime, time def get_events(request): "Return a list of EventRenderers from available Sales" ev...
{ "content_hash": "8c2056a669f46e308908ae6eef5848f8", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 187, "avg_line_length": 36.541666666666664, "alnum_prop": 0.7251995438996579, "repo_name": "alejo8591/maker", "id": "e9347439e0b07098119db81519fc9d7b21341583", "size": "929...
import os from django.core.management import BaseCommand from django.contrib.gis.utils import LayerMapping from mfl_gis.models import WorldBorder WORLD_SHAPEFILE = os.path.join( os.path.dirname( os.path.dirname( os.path.dirname(__file__) # Folder with this file i.e 'commands' ) # Pa...
{ "content_hash": "c2a11b230618489e715e066d44be95c8", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 77, "avg_line_length": 28.642857142857142, "alnum_prop": 0.6084788029925187, "repo_name": "MasterFacilityList/mfl_api", "id": "c323656c0500c5571471c19df4af4aea00318d98", "s...
from django.conf.urls import url, patterns from django.utils.translation import ugettext from django.views.generic import RedirectView from models import Vote, Bill from views import ( VoteListView, VoteCsvView, VoteDetailView, VoteTagsView, BillListView, BillCsvView, BillDetailView, BillTagsView, bill_unbi...
{ "content_hash": "eac46c824b23f1d32384c641aab40e22", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 78, "avg_line_length": 49.220338983050844, "alnum_prop": 0.6070936639118457, "repo_name": "navotsil/Open-Knesset", "id": "f1198608fd20936545d856636af5cf3e796ab274", "size":...
import datetime import pagerange import re from django import forms from django.db import transaction from django.forms.models import BaseModelFormSet, modelformset_factory from django.utils.encoding import force_text from django.utils.html import format_html from django.utils.safestring import mark_safe from django.c...
{ "content_hash": "1c2f497c7feefe252e0536a615453f22", "timestamp": "", "source": "github", "line_count": 555, "max_line_length": 95, "avg_line_length": 35.33873873873874, "alnum_prop": 0.5849181665222046, "repo_name": "bihealth/flowcelltool", "id": "5e5cadd5445ca3a5387c18408e391c4acd654292", "size":...
"""Django settings for use within the docker container.""" from os import environ import dj_database_url from .production import * # Disable debug mode DEBUG = False SECRET_KEY = environ.get('SECRET_KEY') or 'please-change-me' PROJECT_ROOT = ( environ.get('PROJECT_ROOT') or dirname(dirname(abspath(__file__))...
{ "content_hash": "f654d7fb178284e4499c2f726daa9d0e", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 71, "avg_line_length": 24.666666666666668, "alnum_prop": 0.6855855855855856, "repo_name": "Mitso/springstertestapp", "id": "4db62d7c1c1c365b967f5e2692deca22a8ff57f7", "size...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/wearables/robe/shared_robe_s05.iff" result.attribute_template_id = 11 result.stfName("wearables_name","robe_s05") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "a518acea63c3537316783a41ffb45d18", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 71, "avg_line_length": 23.46153846153846, "alnum_prop": 0.6983606557377049, "repo_name": "obi-two/Rebelion", "id": "a81182fdafe355406368fa964b27a89cae9f2da6", "size": "450"...
from django.conf.urls import url from .views import ( MovieCreateAPIView, MovieDeleteAPIView, MovieDetailAPIView, MovieListAPIView, ) urlpatterns = [ url(r'^$', MovieListAPIView.as_view(), name='list'), url(r'^create/$', MovieCreateAPIView.as_view(), name='create'), url(r'^(?P<pk>\d+)...
{ "content_hash": "cefe5015313fbd4bb3b0fbb85c433df3", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 79, "avg_line_length": 28.25, "alnum_prop": 0.6438053097345132, "repo_name": "CyriusG/frontpage_backend", "id": "b6ac2ab3de5f0f3ac46e3859c590a6fe8cee794f", "size": "452", ...
from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from tapi_server.models.base_model_ import Model from tapi_server.models.tapi_common_forwarding_direction import TapiCommonForwardingDirection # noqa: F401,E501 from tapi_server.models...
{ "content_hash": "07cc665b04130f805226ba04eeabc6ed", "timestamp": "", "source": "github", "line_count": 348, "max_line_length": 599, "avg_line_length": 44.91379310344828, "alnum_prop": 0.6920665387076136, "repo_name": "OpenNetworkingFoundation/ONFOpenTransport", "id": "8a2fdef5b4be53d206ba7891ceddcf7...
from __future__ import unicode_literals import mock from mopidy_emby import library, playback from mopidy_emby.backend import EmbyBackend @mock.patch('mopidy_emby.backend.EmbyHandler', autospec=True) def test_backend(embyhander_mock, config): backend = EmbyBackend(config, mock.Mock()) assert backend.uri_sc...
{ "content_hash": "076eb5bdcaf1395c72515fdd86a4e844", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 70, "avg_line_length": 30.235294117647058, "alnum_prop": 0.77431906614786, "repo_name": "xsteadfastx/mopidy-emby", "id": "892dbc54f22c72c38780afff397a21d61dcdbc48", "size":...
"""Deleting resource tag(s)""" from baseCmd import * from baseResponse import * class deleteTagsCmd (baseCmd): typeInfo = {} def __init__(self): self.isAsync = "true" """Delete tags for resource id(s)""" """Required""" self.resourceids = [] self.typeInfo['resourceids']...
{ "content_hash": "f634f944bbfd449e31542ff5b68b3be1", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 61, "avg_line_length": 28.742857142857144, "alnum_prop": 0.5825049701789264, "repo_name": "MissionCriticalCloud/marvin", "id": "c87e73d5f66d8785b12375be71e4265dfb34892d", "...
from collections import defaultdict from itertools import starmap from telemetry.core import util from telemetry.page import legacy_page_test from telemetry.value import scalar from measurements import timeline_controller import py_utils class BlinkStyle(legacy_page_test.LegacyPageTest): def __init__(self): s...
{ "content_hash": "a0f1a1b906ecd2425c7cdb9c3f321af9", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 79, "avg_line_length": 37.892857142857146, "alnum_prop": 0.6216776625824694, "repo_name": "Samsung/ChromiumGStreamerBackend", "id": "dae97c74cf8044df1892dda356579e3c9605d728...
""" Parser for N42 ascii files -------------------------- File format description: https://www.nist.gov/programs-projects/ansiieee-n4242-standard """ import numpy as np def parse_n42(fname, header_length=36, footer_length=4, to_energy=True): """Parse a N42 file Parameters ---------- - fname : str ...
{ "content_hash": "d27e71aa23b10741df7d3fddabd004d1", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 81, "avg_line_length": 26.6734693877551, "alnum_prop": 0.5990818668706962, "repo_name": "maurov/xraysloth", "id": "f8410944a05b90d26eedf65ef7b99adcde34e148", "size": "1353"...
import doctest if __name__ == '__main__': doctest.testfile('doctest_in_help.txt')
{ "content_hash": "297c964683fd776e668839d91c13d832", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 43, "avg_line_length": 21.5, "alnum_prop": 0.627906976744186, "repo_name": "gaufung/PythonStandardLibrary", "id": "abb05301edd04f2073f9e80d8709d0ad64a17033", "size": "86", ...