text
stringlengths
4
1.02M
meta
dict
from os import path from gluon import current from gluon.html import * from gluon.storage import Storage from s3.s3crud import S3CRUD from s3.s3filter import S3DateFilter, S3OptionsFilter, S3TextFilter from s3.s3utils import s3_avatar_represent # ======================================================================...
{ "content_hash": "2dd03ebc7423813b1133ac80be40cd14", "timestamp": "", "source": "github", "line_count": 457, "max_line_length": 121, "avg_line_length": 34.04157549234136, "alnum_prop": 0.4302243363116282, "repo_name": "flavour/tldrmp", "id": "7a95d726a58adb4058a96ab9b2fafb34919db3ba", "size": "1558...
"""Logging """ import sys import os import logging from pip._vendor import colorama, pkg_resources def _color_wrap(*colors): def wrapped(inp): return "".join(list(colors) + [inp, colorama.Style.RESET_ALL]) return wrapped def should_color(consumer, environ, std=(sys.stdout, sys.stderr)): real_c...
{ "content_hash": "751c7ff06c7c01d5853990e215fc5815", "timestamp": "", "source": "github", "line_count": 283, "max_line_length": 79, "avg_line_length": 33.69257950530035, "alnum_prop": 0.545883586785527, "repo_name": "EnviroCentre/jython-upgrade", "id": "5a5fd9cdce17426bad33de67bac61579d970bc57", "s...
import warnings from typing import Callable, Dict, Optional, Sequence, Tuple from google.api_core import grpc_helpers from google.api_core import gapic_v1 import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # ty...
{ "content_hash": "48994daefc42c52952568a08cba58aee", "timestamp": "", "source": "github", "line_count": 264, "max_line_length": 112, "avg_line_length": 44.416666666666664, "alnum_prop": 0.6032747740064813, "repo_name": "googleads/google-ads-python", "id": "09cc1f2b7ddf4a4f407b6a48bc7329370c39c975", ...
extensions = [ 'sphinx.ext.mathjax' ] # Add any paths that contain templates here, relative to this directory. # templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'inde...
{ "content_hash": "b7615f67d0d6344dc016b493516280ec", "timestamp": "", "source": "github", "line_count": 224, "max_line_length": 80, "avg_line_length": 30.723214285714285, "alnum_prop": 0.7008137169427492, "repo_name": "RichardKnop/tsuru", "id": "0286a6082072a28ce25b1a3deb78790bdf324447", "size": "7...
from trtools.tools.attrdict import attrdict
{ "content_hash": "5ccd422bd854b93c50719e75e96feb83", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 43, "avg_line_length": 44, "alnum_prop": 0.8636363636363636, "repo_name": "dalejung/trtools", "id": "8bea7cf7b684f96fe638800ec2679a787cd23ca8", "size": "44", "binary": fal...
import numpy as np from pyspark.mllib.common import callMLlibFunc from pyspark.rdd import RDD class KernelDensity(object): """ Estimate probability density at required points given an RDD of samples from the population. >>> kd = KernelDensity() >>> sample = sc.parallelize([0.0, 1.0]) >>> kd....
{ "content_hash": "ecd5a1dc97405ffdb8476f0548d15af4", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 82, "avg_line_length": 31.2972972972973, "alnum_prop": 0.6278065630397237, "repo_name": "wzhfy/spark", "id": "56444c152f0ba0cb1a7df2b6b65976789654a6fc", "size": "1943", "...
from django.conf import settings import django.core.validators from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ('problem', '__first__'), ('account', '0001_initial'), ...
{ "content_hash": "ad49505b030ce2629e9612dbe2ad58c9", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 660, "avg_line_length": 64.93333333333334, "alnum_prop": 0.5739953065415078, "repo_name": "ultmaster/eoj3", "id": "9d77c53b8d30caa65d651472db072b6fa2ec5e1a", "size": "1451...
import base64 import os import random import re import subprocess import tempfile import time import pymongo CHAR_RNN_DIR = '/home/music/char-rnn' ABCM2PS_PATH = '/home/music/abcm2ps/abcm2ps' ABC2MIDI_PATH = '/home/music/abcmidi/abc2midi' PNG_OUTPUT_PATH = '/var/nn/png' DATA_LENGTH = 8192 MONGO_URL = 'mongodb://loc...
{ "content_hash": "bd0e12cdd27973762e0bd62821f9a321", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 80, "avg_line_length": 28.88235294117647, "alnum_prop": 0.6177189409368635, "repo_name": "audiodude/neural-noise", "id": "202ce42296a70710bd3455b22801ea46750a26cc", "size"...
"""This code example gets all content. This feature is only available to DFP video publishers. The LoadFromStorage method is pulling credentials and properties from a "googleads.yaml" file. By default, it looks for this file in your home directory. For more information, see the "Caching authentication information" se...
{ "content_hash": "49ca55fe2bfd2495f83a7ea18580da0a", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 77, "avg_line_length": 31.3953488372093, "alnum_prop": 0.6874074074074074, "repo_name": "wubr2000/googleads-python-lib", "id": "c22cf0bbd34433c0d122100737b9aad2690b95c1", "...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('game', '0009_auto_20161026_0651'), ] operations = [ migrations.AddField( model_name='cheatcode', name='admin_only', ...
{ "content_hash": "926e93eb06af6f9e567335c9a9190b78", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 53, "avg_line_length": 21.27777777777778, "alnum_prop": 0.5953002610966057, "repo_name": "ej2/pixelpuncher", "id": "9f07b18daeed66a1cbfcc998a8d8e9a3947957da", "size": "453"...
from stargazer import StarGazer __all__ = [ StarGazer ]
{ "content_hash": "b5a75f8a79f13d18cc2c08fec574e57d", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 31, "avg_line_length": 19, "alnum_prop": 0.7017543859649122, "repo_name": "personalrobotics/stargazer", "id": "07a760af7af3f60f23f58b79759fe9b4adde2db8", "size": "57", "bi...
import json from django.core.urlresolvers import reverse from rest_framework import serializers import mkt from mkt.access import acl from mkt.api.fields import ReverseChoiceField from mkt.files.models import FileUpload from mkt.webapps.models import Preview, Webapp class AppStatusSerializer(serializers.ModelSeria...
{ "content_hash": "c34a15510bfeb348513df76326d97c0e", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 78, "avg_line_length": 35.96078431372549, "alnum_prop": 0.6706652126499455, "repo_name": "ingenioustechie/zamboni", "id": "8d339cae0098bdc5441308b7259204de967dc0a8", "size...
"""This module contains all functionality on the level of a single audio file. """ import errno import os import re import shutil import traceback from typing import Any, Dict, List, Literal, Optional import phrydy from tmep import Functions, Template from tmep.format import asciify, delchars, deldupchars, replchars ...
{ "content_hash": "ca7d63d6e2d3627dc11e9f6ae3a3e6e9", "timestamp": "", "source": "github", "line_count": 478, "max_line_length": 88, "avg_line_length": 29.62133891213389, "alnum_prop": 0.5689667349389081, "repo_name": "Josef-Friedrich/audiorename", "id": "5e7bcdadd8e48a1de0b77576616d2c4e6885430a", "...
""" ==================== Biadjacency matrices ==================== """ # Copyright (C) 2013-2016 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import itertools from networkx.convert import _prep_create_usin...
{ "content_hash": "a36823ee9754ca77addaec0c02634b4f", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 94, "avg_line_length": 37.45454545454545, "alnum_prop": 0.6401699029126213, "repo_name": "SanketDG/networkx", "id": "496ed21810cd85aefe3eb2536697e4732e607808", "size": "66...
from __future__ import print_function import importlib import androguard.session as session_module from androguard.gui.DataModel import * from androguard.gui.apiwindow import APIWindow from androguard.gui.binwindow import binWidget from androguard.gui.fileloading import FileLoadingThread from androguard.gui.helpers i...
{ "content_hash": "5348ce44df65cc1115135a8f43c0adee", "timestamp": "", "source": "github", "line_count": 397, "max_line_length": 120, "avg_line_length": 36.58186397984887, "alnum_prop": 0.6165392825173862, "repo_name": "huangtao2003/androguard", "id": "2df00959ca8b7b83109c63e72372bb6eca157942", "siz...
from __future__ import unicode_literals import os, sys def replace_code(start, txt1, txt2, extn, search=None, force=False): """replace all txt1 by txt2 in files with extension (extn)""" import webnotes.utils import os, re esc = webnotes.utils.make_esc('[]') if not search: search = esc(txt1) for wt in os.walk(sta...
{ "content_hash": "ba5e0e6095f5f355c4aa6f83b849fc95", "timestamp": "", "source": "github", "line_count": 585, "max_line_length": 118, "avg_line_length": 30.046153846153846, "alnum_prop": 0.684189565909996, "repo_name": "gangadhar-kadam/sapphite_lib", "id": "48c4959491f81ac09644b2c56e51e5678119a077", ...
""" /properties/ /properties/:id/ /properties/groups/ /properties/groups/:id/ /properties/groups/:name/ """ from django.test import TestCase from django.core.urlresolvers import reverse from rest_framework import status from rest_framework.test import APITestCase from ..models import Property, PropertyGroup from ..defa...
{ "content_hash": "36ca1c1b52bb899153c11144655d390b", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 82, "avg_line_length": 41.48148148148148, "alnum_prop": 0.6047619047619047, "repo_name": "baffolobill/mb_test_1", "id": "95a7cabb2d3644b3db2409047f10fec280c548fe", "size": ...
""" This module provides views for the Puppy Shelter project. """ #pylint: disable=import-error,no-member from flask import render_template, url_for, redirect, request, flash from puppy_shelter import app from puppy_shelter.models import Puppy, Shelter from puppy_shelter.database import db_session, get_or_create # ...
{ "content_hash": "887e727745b24eb3ac4a2639ae4e23e2", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 91, "avg_line_length": 39.01129943502825, "alnum_prop": 0.6333091962346126, "repo_name": "hessler/udacity-courses", "id": "7e0cd95f5de689f2a803acef3edb487de1d3371f", "size...
""" Abstract: Given a file of gene or OTU IDs per group, this script will output groups present in each gene or OTU IDs. """ import sys import csv import argparse from collections import defaultdict def handle_program_options(): parser = argparse.ArgumentParser( description=("Given a file of ge...
{ "content_hash": "9a435bd78766a2899c3b3237aa9a173e", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 79, "avg_line_length": 32.3448275862069, "alnum_prop": 0.5692963752665245, "repo_name": "akshayparopkari/kadambari", "id": "a37f195ad30bebe1c1b588ca641f2e98366e33ae", "size...
"""Config file for training NCSN with technique 5 only.""" import ml_collections def get_config(): config = ml_collections.ConfigDict() # training config.training = training = ml_collections.ConfigDict() training.batch_size = 128 training.n_epochs = 500000 training.n_iters = 300001 training.snapshot_fr...
{ "content_hash": "db11d93bef2f59b2058b8bdfa66edd43", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 58, "avg_line_length": 27.333333333333332, "alnum_prop": 0.7017276422764228, "repo_name": "google-research/google-research", "id": "9aca2deb02ac6efba0cded43d58c985b8a364a70",...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('userprofile', '0001_initial'), ] operations = [ migrations.AddField( model_name='userprofile', name='comment_preference', ...
{ "content_hash": "c9e2ca0ddf44a0618584755366f28dc8", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 53, "avg_line_length": 24.217391304347824, "alnum_prop": 0.5870736086175943, "repo_name": "andela/codango", "id": "44d0bccb0429542616567bb0d1a3bb26650b7234", "size": "581",...
import hr_timesheet_invoice_create import hr_timesheet_analytic_profit import hr_timesheet_final_invoice_create # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
{ "content_hash": "9edf0dc6131f66b6911892ced9c4ea8a", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 65, "avg_line_length": 30, "alnum_prop": 0.8333333333333334, "repo_name": "ntiufalara/openerp7", "id": "b718be1acbb529bc570745e550ca768439366428", "size": "1159", "binary"...
""" ============================================================= Compare the effect of different scalers on data with outliers ============================================================= Feature 0 (median income in a block) and feature 5 (number of households) of the `California housing dataset <http://www.dcc.fc.u...
{ "content_hash": "eb90da4d44e8fc5c5b1dcf324519b900", "timestamp": "", "source": "github", "line_count": 327, "max_line_length": 79, "avg_line_length": 38.72782874617737, "alnum_prop": 0.6586386607706886, "repo_name": "wazeerzulfikar/scikit-learn", "id": "677386a00191c84955ba51f35626374635198c47", "...
import warnings import xml from defusedxml.ElementTree import fromstring class ServerInfoItem(object): def __init__(self, product_version, build_number, rest_api_version): self._product_version = product_version self._build_number = build_number self._rest_api_version = rest_api_version ...
{ "content_hash": "b8535ca57c516d8d5bf8c5b4eeef8332", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 89, "avg_line_length": 31.56, "alnum_prop": 0.6153358681875792, "repo_name": "tableau/server-client-python", "id": "350ae3a0de0681c1a02c4f7a1990c1f48c6f2a37", "size": "1578...
HEADER_PROTEIN = 'Protein ID' HEADER_PROTEINS = 'Protein ID(s)' HEADER_GENEID = 'Gene ID' HEADER_GENENAME = 'Gene Name' HEADER_DESCRIPTION = 'Description' HEADER_COVERAGE = 'Coverage' HEADER_NO_PROTEIN = 'Protein count' HEADER_CONTENTPROT = 'Proteins in group' HEADER_NO_UNIPEP = 'Unique peptide count' HEADER_NO_PEPTIDE...
{ "content_hash": "804b48f52f558e0de127f5bf11a89b9b", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 84, "avg_line_length": 34.53846153846154, "alnum_prop": 0.7126948775055679, "repo_name": "glormph/msstitch", "id": "afc8f0030add8323a015b056d9922f5ddff071df", "size": "898"...
from __future__ import print_function import sys import os import tarfile from bsonstream import KeyValueBSONInput def read_languages(sourcedir, outdir): # Read user_langs = {} languages = set() for fname in os.listdir(sourcedir): print("Opening " + fname) f = tarfile.open(sourcedir +...
{ "content_hash": "0389f88ffab5b936051ab9b28e37cb71", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 87, "avg_line_length": 31.263157894736842, "alnum_prop": 0.5134680134680135, "repo_name": "DevMine/devmine-features", "id": "08f31cdc3d33a6903bb2129e93cdef8536f6e513", "siz...
import numpy as np data = np.load('./test/rawdata/doorOpen.npy') np.savetxt('doorOpen1.csv', data, delimiter=',')
{ "content_hash": "eee2275acb6f912c05f1f800722ebc72", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 48, "avg_line_length": 28.75, "alnum_prop": 0.7043478260869566, "repo_name": "IoT-Expedition/Edge-Analytics", "id": "4510779f1d8383b9ac855349ba7bc83c71d49195", "size": "115"...
import functools import chainer class cached_property(object): """Cache a result of computation of Chainer functions Caches are stored for each chainer.config.enable_backprop. The following example calls ``F.sigmoid`` only once. >>> class C(object): ... def __init__(self, x): ... ...
{ "content_hash": "659d463b60d9cdaaef990f5e29dd0f17", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 77, "avg_line_length": 30.982142857142858, "alnum_prop": 0.562536023054755, "repo_name": "pfnet/chainer", "id": "b484ae875fc45525e2c6404f7ca8013dd578606e", "size": "1735", ...
import os import sys root_fldr = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'rawdata')) sys.path.insert(1, root_fldr) import generate op_fldr = generate.dat_fldr + os.sep words = generate.get_list_words() places = generate.get_list_places() # Dairy custom_event = ['Sales Meeting', 'Workshop', 'Tr...
{ "content_hash": "594c6bc113975b6c8ed0194c4035f865", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 129, "avg_line_length": 41.6875, "alnum_prop": 0.6724137931034483, "repo_name": "acutesoftware/rawdata", "id": "746de7d4aafcbd368d856d42e141682c8dca80d7", "size": "1375", ...
import abc import inspect import re from mountapi.core import exceptions class AbstractConverter(metaclass=abc.ABCMeta): param_url: str = None param_regex: str = None @classmethod def path_to_regex(cls, path): return re.sub(cls.param_url, cls.param_regex, path) + '$' class IntConverter(Abs...
{ "content_hash": "9c9d5d3bdf77a252fd86408aabd0397a", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 76, "avg_line_length": 28.61111111111111, "alnum_prop": 0.5712621359223301, "repo_name": "pyQuest/mount-api", "id": "b39a8c2a43f3aa0270642ce5b0751b399c77a283", "size": "257...
from flask import Blueprint, render_template, redirect, request, url_for from flask_jwt_extended import jwt_required from potnanny.core.models import Room from potnanny.core.schemas import RoomSchema from potnanny.crud import CrudInterface from potnanny.extensions import db bp = Blueprint('dashboard', __name__, templ...
{ "content_hash": "02503eada4c428f1637d690ade747172", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 72, "avg_line_length": 26.818181818181817, "alnum_prop": 0.6655367231638418, "repo_name": "jeffleary00/greenery", "id": "b20316e0d2a0dc643226023269fa9fe10adffd8e", "size": ...
"""Run flake8 tests This test goes through all Python files in the specified test_files_dirs directories and runs flake8 <filename> and reports the results Example invocation python -m testing.test_flake8 --test_files_dirs=/kubeflow/application/tests,/kubeflow/common/tests,/kubeflow/jupyter/tests,/kubeflow/iap/tests...
{ "content_hash": "0bfa8eb4236146a54c500a59d76fe3b1", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 313, "avg_line_length": 35.97979797979798, "alnum_prop": 0.6162268388545761, "repo_name": "kubeflow/kubeflow", "id": "59a3ab5d7680a24919f1cea62d2db05d16bc073a", "size": "42...
from six.moves.urllib import parse from mod_pywebsocket import common from mod_pywebsocket import msgutil def web_socket_do_extra_handshake(request): pass def web_socket_transfer_data(request): send_payload = '' r = request.ws_resource.split('?', 1) if len(r) == 2: params = parse.parse_qs(r[...
{ "content_hash": "2b7f6620932bea63ad81b0309b33bbc6", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 131, "avg_line_length": 35.875, "alnum_prop": 0.6358885017421603, "repo_name": "ric2b/Vivaldi-browser", "id": "b9d8c98f264a26e6328f3018938cd6c0c00e728c", "size": "1148", ...
"""Script that will remind developers to run updateApi.""" import argparse import os.path import sys WARNING_COLOR = '\033[33m' END_COLOR = '\033[0m' WARNING_NO_API_FILES = """ {}********************************************************************** You changed library classes, but you have no current.txt changes....
{ "content_hash": "40b3dcc4a5003702c2e001d6df8009e5", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 74, "avg_line_length": 31.724137931034484, "alnum_prop": 0.5407608695652174, "repo_name": "androidx/androidx", "id": "e5395b3aa0d1c5a4d4a0f82359fa10e5d34a578d", "size": "24...
from django.contrib.auth.models import User, Group from django.contrib.contenttypes.models import ContentType from django.test import TestCase from django.contrib.auth.models import Permission from django.core import mail # User from notifier import shortcuts, models #################################################...
{ "content_hash": "b96b40ec2792de3acdd6b79033704522", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 79, "avg_line_length": 35.14795918367347, "alnum_prop": 0.6124256060386123, "repo_name": "scdoshi/django-notifier", "id": "e8b4a19c11539f16b545403de4454d458683acac", "size...
""" Implementation of a GL Program object. This class parses the source code to obtain the names and types of uniforms, attributes, varyings and constants. This information is used to provide the user with a natural way to set variables. Gloo vs GLIR ------------ Done in this class: * Check the data shape given f...
{ "content_hash": "5b9029d94e4e8c6050b041998810a8f2", "timestamp": "", "source": "github", "line_count": 460, "max_line_length": 79, "avg_line_length": 41.969565217391306, "alnum_prop": 0.5254843053972859, "repo_name": "hronoses/vispy", "id": "f594390be05441d96d6ab724220cbc07b9f00d3f", "size": "1963...
import pbr.version __version__ = pbr.version.VersionInfo('python-keystoneclient').version_string() __all__ = [ # Modules 'generic', 'v2_0', 'v3', # Packages 'access', 'client', 'exceptions', 'httpclient', 'service_catalog', ]
{ "content_hash": "c188492e6da8fa76554b246cca6c08ec", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 79, "avg_line_length": 15, "alnum_prop": 0.5666666666666667, "repo_name": "raildo/python-keystoneclient", "id": "ab4f7a1ce5a24c29ce95f74c378211a2696506ce", "size": "906", ...
import sqlite3 import StringIO import pylab from flask import Flask, request, session, g, redirect, url_for, \ abort, render_template, flash, make_response # configuration DATABASE = '/tmp/finance.db' DEBUG = True SECRET_KEY = 'development key' USERNAME = 'admin' PASSWORD = 'default' app = Flask(__name__) app.co...
{ "content_hash": "3f3bbcef53ddb8b5c82a75a8b5b92997", "timestamp": "", "source": "github", "line_count": 315, "max_line_length": 117, "avg_line_length": 33.10793650793651, "alnum_prop": 0.622686738901141, "repo_name": "buggi22/finance_app", "id": "c438e27daa5a29a10cc1adb1d57f79c01c973bcb", "size": "...
""" Tools for generating forms based on mongoengine Document schemas. """ import sys import decimal from bson import ObjectId from operator import itemgetter try: from collections import OrderedDict except ImportError: # Use bson's SON implementation instead from bson import SON as OrderedDict from wtform...
{ "content_hash": "794ac00cf620f39090337cba924d9a03", "timestamp": "", "source": "github", "line_count": 280, "max_line_length": 124, "avg_line_length": 35.496428571428574, "alnum_prop": 0.6260187141563538, "repo_name": "losintikfos/flask-mongoengine", "id": "9cb2beca2b089fef9f746858364a17d75b9894de",...
''' OpenShiftCLI class that wraps the oc commands in a subprocess ''' # pylint: disable=too-many-lines from __future__ import print_function import atexit import copy import fcntl import json import time import os import re import shutil import subprocess import tempfile # pylint: disable=import-error try: impo...
{ "content_hash": "cc7f9c5af3314edd1fe3eb1695c95514", "timestamp": "", "source": "github", "line_count": 1898, "max_line_length": 118, "avg_line_length": 33.94994731296101, "alnum_prop": 0.528190325434145, "repo_name": "joelddiaz/openshift-tools", "id": "ce591db4982dda25ab0fe4a913c47f227f42eeda", "s...
import unittest import mock from google.cloud.tasks_v2.types import Queue, Task from airflow.providers.google.cloud.operators.tasks import ( CloudTasksQueueCreateOperator, CloudTasksQueueDeleteOperator, CloudTasksQueueGetOperator, CloudTasksQueuePauseOperator, CloudTasksQueuePurgeOperator, CloudTasksQueueResu...
{ "content_hash": "7c0cc0f98e42a9a925d94e4184a5e7bc", "timestamp": "", "source": "github", "line_count": 282, "max_line_length": 94, "avg_line_length": 37.91843971631206, "alnum_prop": 0.6417282334237352, "repo_name": "wileeam/airflow", "id": "fde9da1a65cf20718f1294be522ffd62c6d6ec6f", "size": "1148...
from rhum.rhumlogging import get_logger from enum import Enum class ItemType(Enum): SWITCH=0x00 PILOT_SWITCH=0x01 TEMP_SENSOR=0x10 SWITCH_SENSOR=0x11 class Item: '''Item representation of all type of items''' __logger = get_logger('rhum.messages.item.Item') ...
{ "content_hash": "eb261068f56f440b2df27bc3621813be", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 57, "avg_line_length": 20.5625, "alnum_prop": 0.560790273556231, "repo_name": "cvrignaud/rhum", "id": "7922a16046c24fd33661b19026641eeeae1fca66", "size": "658", "binary":...
"""Server startup routines.""" import logging import os import platform from grr.lib import config_lib from grr.lib import local from grr.lib import log from grr.lib import registry from grr.lib import stats # pylint: disable=g-import-not-at-top if platform.system() != "Windows": import pwd # pylint: enable=g-impor...
{ "content_hash": "d5d5cc2c9de9450a6f0ba49c4050181c", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 79, "avg_line_length": 30.01388888888889, "alnum_prop": 0.7006015733456733, "repo_name": "destijl/grr", "id": "6a3ec6b40ef07afb5f8e766399d6d236710c6598", "size": "2183", ...
from flask import request from framework.auth import Auth, decorators from framework.utils import iso8601format from osf.utils.permissions import ADMIN from website.registries import utils from website import util def _view_registries_landing_page(campaign=None, **kwargs): """Landing page for the various registrat...
{ "content_hash": "37130afbbc01630cd4d8904b85a66226", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 120, "avg_line_length": 36.28767123287671, "alnum_prop": 0.6153265383163458, "repo_name": "saradbowman/osf.io", "id": "6af3c09df3338d42fae94fe67715df54653aeb60", "size": "2...
from functools import reduce from typing import NamedTuple, Tuple from . import anndata class ElementRef(NamedTuple): parent: "anndata.AnnData" attrname: str keys: Tuple[str, ...] = () def __str__(self) -> str: return f".{self.attrname}" + "".join(map(lambda x: f"['{x}']", self.keys)) @...
{ "content_hash": "111604a3314ad445a1622ef48193ad18", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 88, "avg_line_length": 27.266666666666666, "alnum_prop": 0.5904645476772616, "repo_name": "theislab/anndata", "id": "7dacaa6dcd75c8f28c458d76b92752942dd1581d", "size": "818...
""" =============== Array Internals =============== Internal organization of numpy arrays ===================================== It helps to understand a bit about how numpy arrays are handled under the covers to help understand numpy better. This section will not go into great detail. Those wishing to understand the ...
{ "content_hash": "3b4922a92f15bb404f23a2cc5cd41556", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 259, "avg_line_length": 59.28395061728395, "alnum_prop": 0.7859225322782174, "repo_name": "WarrenWeckesser/numpy", "id": "6718f1108dc44f15803bada0a223df3dc0b51830", "size"...
import logging import pendulum from pynamodb.attributes import (UnicodeAttribute, UTCDateTimeAttribute) from pynamodb.exceptions import DoesNotExist from pynamodb.models import Model from . import BaseStorage log = logging.getLogger(__name__) class FeedState(Model): class Meta: table_name = 'RSSAl...
{ "content_hash": "718ad137773b0355d8d83563cd90142b", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 72, "avg_line_length": 24.91025641025641, "alnum_prop": 0.5625321667524447, "repo_name": "jwplayer/rssalertbot", "id": "5774d2d304042b2a2395826dd4ac85e3e0a70459", "size": "...
from django.core.management.base import BaseCommand from app.users.serializers import UserSerializer class Command(BaseCommand): def handle(self, *args, **options): users = [ {'username': 'andy', 'email': 'andy.krivovjas@gmail.com', 'first_name': 'Andy', 'last_name': 'Krivovjas', 'password': ...
{ "content_hash": "b811f0f8f85170621e8911a675a09414", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 167, "avg_line_length": 36.94117647058823, "alnum_prop": 0.5780254777070064, "repo_name": "AndyKrivovjas/notes", "id": "9d939d99e76acd643e28216d77e20c6eff81aa93", "size": "...
import numpy as np import pandas as pd import sys import os from sklearn.externals import joblib from sklearn.ensemble import RandomForestClassifier scriptpath = os.path.dirname(os.path.realpath(sys.argv[0])) + '/../' sys.path.append(os.path.abspath(scriptpath)) import utils parameter_str = '_'.join(['top', str(utils...
{ "content_hash": "0e4462cccfe5b910df219b8b07b98eb7", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 106, "avg_line_length": 32.61538461538461, "alnum_prop": 0.7264150943396226, "repo_name": "parkerzf/kaggle-expedia", "id": "56edc963c0082f97ce2a083cc85bf0dc070d7ef6", "size...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('herders', '0028_auto_20210320_1357'), ] operations = [ migrations.AddField( model_name='summoner', name='dark_mode', field=models.BooleanField(blank=True...
{ "content_hash": "0cc07823f4622d194b6dda598bf8044d", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 65, "avg_line_length": 22.1875, "alnum_prop": 0.5830985915492958, "repo_name": "porksmash/swarfarm", "id": "d1b1ec04881c1d88d404e150d3edf4624329fde9", "size": "405", "bin...
"""Utility functions not closely tied to other spec_tools types.""" # Copyright (c) 2018-2019 Collabora, Ltd. # Copyright (c) 2013-2020 The Khronos Group Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of...
{ "content_hash": "0bb949c5702f51ac3c79e735e0c59d65", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 128, "avg_line_length": 39.01470588235294, "alnum_prop": 0.7218243497926875, "repo_name": "endlessm/chromium-browser", "id": "c16ec4d8d39647caccf55bbc2984dbff0a7900c2", "si...
from django.test import TestCase from django.test import Client from django.core.urlresolvers import reverse from .models import Project class ProjectsTests(TestCase): def setUp(self): """ Setup a test project. """ self.testProject = Project(title = "test title", description = "te...
{ "content_hash": "5c59590ae613eeb1e5b14d3afcc345c1", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 90, "avg_line_length": 29.23913043478261, "alnum_prop": 0.6260223048327137, "repo_name": "mariufa/DjangoTesting", "id": "90b5f3aa56af4fbf920b705044191616ea31055f", "size": ...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='TestModel', fields=[ ...
{ "content_hash": "8181870e8b8529fdee048881b3e57d25", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 185, "avg_line_length": 30.434782608695652, "alnum_prop": 0.62, "repo_name": "luzfcb/django-autocomplete-light", "id": "2b0b4741a638816ddb39587a61210cc9132669d0", "size": "...
import threading import time import tensorflow as tf from tensorboard.plugins.debugger_v2 import debug_data_multiplexer mock = tf.compat.v1.test.mock class RunInBackgroundRepeatedlyTest(tf.test.TestCase): def testRunInBackgroundRepeatedlyThreeTimes(self): state = {"counter": 0} def run_three_t...
{ "content_hash": "f1944a10a9d8d983a9b89dd1e641e0a3", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 79, "avg_line_length": 34.220588235294116, "alnum_prop": 0.6214009454232918, "repo_name": "tensorflow/tensorboard", "id": "6fc60b7c02c9615253af505680139cc0088cd92b", "size"...
""" This test script is adopted from: https://github.com/numpy/numpy/blob/main/numpy/tests/test_public_api.py """ import pkgutil import types import importlib import warnings import scipy def check_dir(module, module_name=None): """Returns a mapping of all objects with the wrong __module__ attribute.""" ...
{ "content_hash": "73cec19952d32e8335118cf03f993a72", "timestamp": "", "source": "github", "line_count": 325, "max_line_length": 85, "avg_line_length": 30.54153846153846, "alnum_prop": 0.6345960104775338, "repo_name": "zerothi/scipy", "id": "657ca7e08e4090c7045ddad5b77b57a513f6e895", "size": "9926",...
"""django_demo URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Clas...
{ "content_hash": "21c1e8240ac187bb0943e5866696ba21", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 79, "avg_line_length": 36.333333333333336, "alnum_prop": 0.7011795543905636, "repo_name": "FactoryBoy/factory_boy", "id": "a8b95abbe71c85b69ca3b2573bf7a1ee2d3985d1", "size"...
""" Provides small event framework """ from __future__ import absolute_import, division, unicode_literals import logging log = logging.getLogger('event') _events = {} class Event(object): """Represents one registered event.""" def __init__(self, name, func, priority=128): self.name = name ...
{ "content_hash": "766ad95e61d4a5419db335941282dd36", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 119, "avg_line_length": 28.18867924528302, "alnum_prop": 0.6295180722891566, "repo_name": "cvium/Flexget", "id": "69e0e2db59c06d38e4cae5dff0a2e3bc4d664c94", "size": "2988"...
import DOM class UIObject: def getElement(self): return self.element def setElement(self, element): self.element = element def setStyleName(self, style): DOM.setAttribute(self.element, "className", style) class Widget(UIObject): def setParent(self, parent): self.pa...
{ "content_hash": "7f34f92cbdd8179a708feb26aa2f7e7e", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 70, "avg_line_length": 20.26086956521739, "alnum_prop": 0.6255364806866953, "repo_name": "andreyvit/pyjamas", "id": "d994e4ffea40ee660bd4709a67db32f033efd227", "size": "932...
import math import csv from geopy.geocoders import GoogleV3 def hubeny(p1, p2): a2 = 6378137.0 ** 2 b2 = 6356752.314140 ** 2 e2 = (a2 - b2) / a2 def d2r(deg): return deg * (2 * math.pi) / 360 (lon1, lat1, lon2, lat2) = map(d2r, p1 + p2) w = 1 - e2 * math.sin((lat1 + lat2) / 2) ** 2 ...
{ "content_hash": "5532496f0bb8189cfc6651d8939c72ad", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 93, "avg_line_length": 27.63855421686747, "alnum_prop": 0.6046207497820401, "repo_name": "ytsunetsune/kosen_junkai", "id": "5d9183f255f5e137338ecc195eb92e89d2443ceb", "size...
from msrest.exceptions import ( ClientException, SerializationError, DeserializationError, TokenExpiredError, ClientRequestError, AuthenticationError, HttpOperationError, ) from .api_client import AutoRestSwaggerBATByteService, AutoRestSwaggerBATByteServiceConfiguration __all__ = [ 'Cl...
{ "content_hash": "d6cf55be83b8035b4d9b26133c276bb0", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 97, "avg_line_length": 25.304347826086957, "alnum_prop": 0.7560137457044673, "repo_name": "vulcansteel/autorest", "id": "9beb0be33b845b234182e211470b0d96e8cc240c", "size": ...
""" Error handling using an interactive parser ========================================== This example demonstrates error handling using an interactive parser in LALR When the parser encounters an UnexpectedToken exception, it creates a an interactive parser with the current parse-state, and lets you control how to p...
{ "content_hash": "078bc3f8a5f9bc4e1565948d94338dbc", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 76, "avg_line_length": 30.13888888888889, "alnum_prop": 0.6534562211981567, "repo_name": "lark-parser/lark", "id": "aeaa21b494b9513d7dae4ace37c74bea4d8a4985", "size": "1085...
import unittest from cross2sheet.grid_features import Grid, BackgroundElt, BorderElt, TextElt from cross2sheet.image import ImageGrid from cross2sheet.transforms import autonumber, outside_bars from urllib.request import urlopen from io import StringIO def grid_to_string(g): i = StringIO() oldr=0 for r,_,e...
{ "content_hash": "b23e53d0f94ec4420201f5e713427c32", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 89, "avg_line_length": 36.193548387096776, "alnum_prop": 0.5227272727272727, "repo_name": "dgulotta/cross2sheet", "id": "8871f90cff813e95c3e35279db6eeb6a13d8afdf", "size":...
import unittest from katas.kyu_7.maximum_length_difference import mxdiflg class MaximumLengthDifferenceTestCase(unittest.TestCase): def test_equal_1(self): self.assertEqual(mxdiflg([ 'hoqq', 'bbllkw', 'oox', 'ejjuyyy', 'plmiis', 'xxxzgpsssa', 'xxwwkktt', 'znnnnfqknaz', 'qqquuhii',...
{ "content_hash": "62296a3a578641eec64076a647f6a195", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 71, "avg_line_length": 34.142857142857146, "alnum_prop": 0.6401673640167364, "repo_name": "the-zebulan/CodeWars", "id": "9715ecb7916cf81768cc0b20afef3116987f0371", "size": ...
from mmcv.cnn import build_conv_layer, build_norm_layer from mmcv.runner import BaseModule, Sequential from torch import nn as nn class ResLayer(Sequential): """ResLayer to build ResNet style backbone. Args: block (nn.Module): block used to build ResLayer. inplanes (int): inplanes of block. ...
{ "content_hash": "f448e03b2b0bf29f8bf4dd6c98221245", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 79, "avg_line_length": 33.56613756613756, "alnum_prop": 0.49085750315258514, "repo_name": "open-mmlab/mmdetection", "id": "5c3e89fb035d197cb82173e90659dac89ff07fab", "size...
import _plotly_utils.basevalidators class FeatureidkeyValidator(_plotly_utils.basevalidators.StringValidator): def __init__(self, plotly_name="featureidkey", parent_name="choropleth", **kwargs): super(FeatureidkeyValidator, self).__init__( plotly_name=plotly_name, parent_name=paren...
{ "content_hash": "49572a771addae4af82e6ffcaa13540d", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 87, "avg_line_length": 38.25, "alnum_prop": 0.6230936819172114, "repo_name": "plotly/python-api", "id": "9f680b56b8af1338902d69d553eff3cf4992c3f4", "size": "459", "binary...
from typing import Match from discord import Message from MoMMI import command, MChannel @command("testmerge_dummy", "testmerge") async def testmerge_dummy_command(channel: MChannel, match: Match, message: Message) -> None: await channel.send("Sorry dude you got the wrong MoMMI. <@211414753925398528> is still in ...
{ "content_hash": "1d02d0265d84ff79a42473842b38e0ac", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 118, "avg_line_length": 43.125, "alnum_prop": 0.7710144927536232, "repo_name": "PJB3005/MoMMI", "id": "52fbbbe461de782a2a118a246b4b224e4a9b8c41", "size": "345", "binary": ...
import unittest from mkdocs.utils.babel_stub import Locale, UnknownLocaleError class BabelStubTests(unittest.TestCase): def test_locale_language_only(self): locale = Locale('es') self.assertEqual(locale.language, 'es') self.assertEqual(locale.territory, '') self.assertEqual(str(lo...
{ "content_hash": "0c2b9fcf3e4fabce31f003f2dfb9bd64", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 71, "avg_line_length": 36.92, "alnum_prop": 0.647887323943662, "repo_name": "waylan/mkdocs", "id": "65ac3da4f5f95105e405fb5bb6e7d63508346f5f", "size": "1846", "binary": f...
import discord from discord.ext import commands from commands.util import league_help import requests from secret import LEAGUE_KEY class L_see_stats(): def __init__(self, bot): self.bot = bot @commands.command(description = "Get information about a summoner.") async def l_see_stats(self, summone...
{ "content_hash": "a3842544e74b8a270ea71f6d153b76ea", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 171, "avg_line_length": 40.19607843137255, "alnum_prop": 0.5409756097560976, "repo_name": "bjkoehle/AhriBot", "id": "55f85223af0608e08ccc1cb19773c3ccb67a5152", "size": "205...
import argparse import importlib.util import os import random import matplotlib.pyplot as plt import numpy as np import tensorflow as tf import torch from .test.configs.test_config import CommonConfig SEED_VAL = 42 DNN_LIB = "DNN" # common path for model savings MODEL_PATH_ROOT = os.path.join(CommonConfig().output_d...
{ "content_hash": "3f4ca0d3250795d0771ed7c6820372ae", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 103, "avg_line_length": 33.24183006535948, "alnum_prop": 0.6482500983090838, "repo_name": "opencv/opencv", "id": "cf24dd385b864e3f773c6b230bb6483b11f325a0", "size": "5086"...
''' Created on 1 Sep 2014 @author: Ed ''' from django.core.management.base import BaseCommand, CommandError from quiz.models import * class Command(BaseCommand): args = '' help = 'Prints all badges' def handle(self, *args, **options): print('handler called') self.stdou...
{ "content_hash": "25a29f1b70f246a0ce69d99f48d2b660", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 65, "avg_line_length": 21.875, "alnum_prop": 0.6342857142857142, "repo_name": "edporteous/chronotype", "id": "c77a46cf54d4f1f20d4f63ae047e24e75ab5c5ee", "size": "350", "b...
from __future__ import print_function from builtins import object from builtins import str from lib.common import helpers class Module(object): def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Get-DomainTrustMapping', 'Author': ['@harmj0y'], 'Descri...
{ "content_hash": "b77e75e7d96a59999b16edf8cbb1a462", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 165, "avg_line_length": 37.78709677419355, "alnum_prop": 0.48096295031586134, "repo_name": "byt3bl33d3r/Empire", "id": "a2642e47c78edc0c183321f6691931db9d3d6278", "size": ...
import sys from py4j.java_gateway import get_method from pyflink.java_gateway import get_gateway from pyflink.table.table_schema import TableSchema from pyflink.table.window import GroupWindow from pyflink.util.utils import to_jarray if sys.version > '3': xrange = range __all__ = ['Table', 'GroupedTable', 'Grou...
{ "content_hash": "af9f01489ac5aef9fe3d260285318186", "timestamp": "", "source": "github", "line_count": 744, "max_line_length": 100, "avg_line_length": 34.35752688172043, "alnum_prop": 0.608168374931539, "repo_name": "fhueske/flink", "id": "920a372d5fc3b802f42957a7140c72e22f4a2df5", "size": "26520"...
from __future__ import absolute_import, unicode_literals import json from unittest import skipIf from django.test import TestCase from django.contrib.auth.models import User from haystack.query import SearchQuerySet from rest_framework import status from rest_framework.pagination import PageNumberPagination from re...
{ "content_hash": "3958e1e3b3cc0450a9dd5f275684a013", "timestamp": "", "source": "github", "line_count": 305, "max_line_length": 118, "avg_line_length": 46.05573770491803, "alnum_prop": 0.6670463444151776, "repo_name": "inonit/drf-haystack", "id": "81e7055a3aa0468f4399be7723e671b968fd7cf3", "size": ...
from setuptools import setup from os import path current_dir = path.abspath(path.dirname(__file__)) with open(path.join(current_dir, 'README.rst'), 'r') as f: long_description = f.read() with open(path.join(current_dir, 'requirements.txt'), 'r') as f: install_requires = f.read().split('\n') setup( name...
{ "content_hash": "6c89dfb4511d893c734827c081516a88", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 64, "avg_line_length": 30.818181818181817, "alnum_prop": 0.640117994100295, "repo_name": "befelix/SafeOpt", "id": "0fae0cacfa648ec91111735061cbbc76db4ec9af", "size": "1017"...
import argparse def cloudwatch_dimension(dim_as_str): try: name, val = dim_as_str.split('=', 1) return {'Name': name, 'Value': val} except ValueError: raise argparse.ArgumentTypeError('dimension filter "{0}" must have ' 'form KEY=VALUE'.format(d...
{ "content_hash": "1cc39b4adce306dbf5e13e35f70e852d", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 77, "avg_line_length": 33.2, "alnum_prop": 0.5602409638554217, "repo_name": "jhajek/euca2ools", "id": "a7fdad94d09df71c4ecb216f5e7cad95a75554b4", "size": "1674", "binary"...
""" Person Registry, Controllers @see: U{http://eden.sahanafoundation.org/wiki/BluePrintVITA} """ module = request.controller resourcename = request.function # ----------------------------------------------------------------------------- # Options Menu (available in all Functions' Views) def s3_menu_postp():...
{ "content_hash": "423779a1fdaf7ee18f35fd9a1867ec0d", "timestamp": "", "source": "github", "line_count": 439, "max_line_length": 97, "avg_line_length": 35.85876993166287, "alnum_prop": 0.44657603862279255, "repo_name": "flavour/rgims_as_diff", "id": "cc9b51335e5505b0b28ee0e391fb745211682ddd", "size"...
DEBUG = True TESTING = True PRODUCTION = False HOST = '0.0.0.0' SQLALCHEMY_DATABASE_URI = 'mysql+mysqldb://root:root@localhost/ggrcdev' FULLTEXT_INDEXER = 'ggrc.fulltext.mysql.MysqlIndexer' LOGIN_MANAGER = 'ggrc.login.appengine' #SQLALCHEMY_ECHO = True AUTOBUILD_ASSETS = False ENABLE_JASMINE = False APP_ENGINE = True
{ "content_hash": "f3472f05f870ba59604c2d05c08417b7", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 71, "avg_line_length": 26.666666666666668, "alnum_prop": 0.759375, "repo_name": "plamut/ggrc-core", "id": "e495f61d7caf7d5c4121617889b93a21178f8822", "size": "433", "bina...
ACTIVE = "ACTIVE" INACTIVE = "INACTIVE" STATS_ACTIVE_CONNECTIONS = 'active_connections' STATS_MAX_CONNECTIONS = 'max_connections' STATS_TOTAL_CONNECTIONS = 'total_connections' STATS_CURRENT_SESSIONS = 'current_sessions' STATS_MAX_SESSIONS = 'max_sessions' STATS_TOTAL_SESSIONS = 'total_sessions' STATS_IN_BYTES = 'bytes_...
{ "content_hash": "85530ce97f1507a5f302edae667f3fc1", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 67, "avg_line_length": 33.22222222222222, "alnum_prop": 0.7642140468227425, "repo_name": "jiahaoliang/group-based-policy", "id": "28cbe994fd320db6a3c34f05feda9eb8fbc90181", ...
'''Modules to calculate insolation and orbital variations. These methods now accept and return ``xarray`` objects for easier data manipulation and plotting. '''
{ "content_hash": "1629b82b8689bb8deac79238fb782d85", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 58, "avg_line_length": 32.4, "alnum_prop": 0.7839506172839507, "repo_name": "cjcardinale/climlab", "id": "092928ed7ef42afa372c36c3e9729c3f79901aa8", "size": "162", "binary...
import rospy from tf import TransformListener class TFLatency: def __init__(self, source_frame, target_frame): self.source_frame = source_frame self.target_frame = target_frame self.listener = TransformListener(1, rospy.Duration(0.01)) def run(self): self.listener.waitForTransf...
{ "content_hash": "65c3a746f93dcfaae3fcd157efadad03", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 111, "avg_line_length": 39.21875, "alnum_prop": 0.5888446215139442, "repo_name": "USC-ACTLab/vicon_bridge_test", "id": "5adc3461affb2f20b0ef9039b5b14f14b91c5614", "size": "...
from __future__ import unicode_literals import frappe, sys from frappe import _ from frappe.utils import (cint, flt, now, cstr, strip_html, getdate, get_datetime, to_timedelta, sanitize_html, sanitize_email) from frappe.model import default_fields from frappe.model.naming import set_new_name from frappe.modules import...
{ "content_hash": "cabd62ceadfebfdab004292015f3a9a9", "timestamp": "", "source": "github", "line_count": 738, "max_line_length": 117, "avg_line_length": 30.2289972899729, "alnum_prop": 0.6581648661974988, "repo_name": "ShashaQin/frappe", "id": "e343f946fbc36a55db272260a2aa04f436048bb8", "size": "224...
import os import shutil import time import torch import torch.backends.cudnn as cudnn import torch.nn.parallel import torch.optim import torch.utils.data import torchnet as tnt import torchvision.transforms as transforms from tqdm import tqdm from wildcat.util import AveragePrecisionMeter, Warp class Engine(object)...
{ "content_hash": "944e2f5b1bc9fa7f4c7d8cfd8cef4ca8", "timestamp": "", "source": "github", "line_count": 510, "max_line_length": 143, "avg_line_length": 45.3235294117647, "alnum_prop": 0.554488427428077, "repo_name": "durandtibo/wildcat.pytorch", "id": "f4ef91039801b0e939b445eccd572fe8112aa647", "si...
import _plotly_utils.basevalidators class CmidValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="cmid", parent_name="isosurface", **kwargs): super(CmidValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit...
{ "content_hash": "5dc705a1de3bd9a369e618175b1e7158", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 79, "avg_line_length": 38, "alnum_prop": 0.597165991902834, "repo_name": "plotly/python-api", "id": "5902a12e81054471ea7ec97e8e5c7e58819db114", "size": "494", "binary": f...
from msrest.serialization import Model class DhcpOptions(Model): """DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. Standard DHCP option for a subnet overrides VNET DHCP options. :param dns_servers: The list of DNS servers IP addresses. :type dns_ser...
{ "content_hash": "02edc476ddec622a6e24016e8cfa52f4", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 80, "avg_line_length": 31.157894736842106, "alnum_prop": 0.6469594594594594, "repo_name": "lmazuel/azure-sdk-for-python", "id": "7dc4651973a51a755be031a3e1b800aff876cf6e", ...
"""Test the Vultr switch platform.""" import json import unittest from unittest.mock import patch import requests_mock import pytest import voluptuous as vol from homeassistant.components.switch import vultr from homeassistant.components import vultr as base_vultr from homeassistant.components.vultr import ( ATTR...
{ "content_hash": "eda5641ca73cf9d3483d5f09ee11f443", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 79, "avg_line_length": 34.06532663316583, "alnum_prop": 0.5118749078035109, "repo_name": "HydrelioxGitHub/home-assistant", "id": "f5e94e3e1b12369f9747d0049b0afbbf671857e6", ...
"""Retriever script for Alwyn H. Gentry Forest Transect Dataset""" from builtins import str from builtins import range import os import sys import zipfile import xlrd from retriever.lib.templates import Script from retriever.lib.models import Table from retriever.lib.excel import Excel from pkg_resources import parse...
{ "content_hash": "03e6dbc3160eea4478a56c6be99fb291", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 344, "avg_line_length": 44.78389830508475, "alnum_prop": 0.44952218752956763, "repo_name": "henrykironde/deletedret", "id": "7238b105ef45d49457285d9566cb7855b8854955", "si...
"""models.py Udacity conference server-side Python App Engine data & ProtoRPC models $Id: models.py,v 1.1 2014/05/24 22:01:10 wesc Exp $ created/forked from conferences.py by wesc on 2014 may 24 """ __author__ = 'wesc+api@google.com (Wesley Chun)' import httplib import endpoints from protorpc impo...
{ "content_hash": "0f7290670034069634b3779a8bb18805", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 86, "avg_line_length": 36.72560975609756, "alnum_prop": 0.6609662958658475, "repo_name": "davcs86/fullstack-nanodegree-conference-cloud-app", "id": "aaa10c38621ff1e4011304e6...
from django.core.mail import EmailMessage from django.template import Template, Context from django.utils.safestring import mark_safe from django.conf import settings LOAD_EMAIL_FILTERS = '{% load emailfilters %}' def template_with_email_filters(template_string): """ Create a template that will load our emai...
{ "content_hash": "08fbb3fe3d0031a24112367cc5fa49cd", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 109, "avg_line_length": 41.42307692307692, "alnum_prop": 0.7270194986072424, "repo_name": "Duke-GCB/DukeDSHandoverService", "id": "e76ed43aa07bdb1f2ab61eb0fed4d18e18f9de80", ...
import os.path from setuptools import find_packages from setuptools import setup from okapi import __version__ here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() CHANGES = open(os.path.join(here, 'CHANGES.rst')).read() setup( name='okapi', version=__vers...
{ "content_hash": "f1db5873ad952c00e1f8715a154eb2d4", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 60, "avg_line_length": 26.842105263157894, "alnum_prop": 0.6147058823529412, "repo_name": "scorphus/okapi", "id": "5a4890b73ea8d1e379fa3b130fe39681275c25f0", "size": "1252"...
import json from datetime import timedelta from django.core.management import CommandError from django.utils import timezone import reversion from test_app.models import TestModel from test_app.tests.base import TestBase, TestModelMixin class CreateInitialRevisionsTest(TestModelMixin, TestBase): def testCreateIn...
{ "content_hash": "c10f7b06cb556bec70cdaf4075738338", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 95, "avg_line_length": 38.60287081339713, "alnum_prop": 0.6955875061973228, "repo_name": "etianen/django-reversion", "id": "69edcc4bb53f5a3a7e22c904aaba961c88b8c3de", "siz...
""" State S32 : Exportation """ import pickle from ...util.funcutils import singleton from .StateSCC import StateSCC @singleton class StateS32A(StateSCC): """State S32 : Exportation""" def __init__(self): """Object initialization""" self.buffer = None # Intern buffer def do(self, hand...
{ "content_hash": "5b9ccab4c68001c6c909153e9726cd0e", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 83, "avg_line_length": 39.58119658119658, "alnum_prop": 0.4063917080544159, "repo_name": "thethythy/Mnemopwd", "id": "7b596833d5db8e6dba745dab3167434964e6ef78", "size": "6...
from __future__ import unicode_literals import datetime from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.models import User from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from symposion.m...
{ "content_hash": "ec65950b80d2ddb22ec6ff59722c70f9", "timestamp": "", "source": "github", "line_count": 302, "max_line_length": 116, "avg_line_length": 31.695364238410598, "alnum_prop": 0.6212912661930631, "repo_name": "pyohio/symposion", "id": "1e6855dfd82f57f5d032fdbe8bf2fb9726e8d2df", "size": "9...
import time import socket UDP_IP="127.0.0.1" UDP_PORT=5005 MESSAGE="Hello, World 5005!" print "UDP target IP:", UDP_IP print "UDP target port:", UDP_PORT print "message:", MESSAGE sock = socket.socket( socket.AF_INET, socket.SOCK_DGRAM ) sock.sendto( MESSAGE, (UDP_IP, UDP_PORT) )
{ "content_hash": "1f5d3710d7760000d8b57c57c49ab384", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 57, "avg_line_length": 23.23076923076923, "alnum_prop": 0.6688741721854304, "repo_name": "afronski/LogsLiteViewerCLI", "id": "fb91f418d974fe379648eeb3960676f4149c3266", "si...
from helper import CompatTestCase from validator.compat import FX48_DEFINITION class TestFX48Compat(CompatTestCase): """Test that compatibility tests for Gecko 48 are properly executed.""" VERSION = FX48_DEFINITION def test_nsIIOService_newChannel_deprecated(self): """https://github.com/mozilla/...
{ "content_hash": "7fa8a30f4490c4b9329d6242480044bf", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 96, "avg_line_length": 35.669117647058826, "alnum_prop": 0.6128633271490415, "repo_name": "diox/amo-validator", "id": "2389f985bb668f6e1f5f6180aed5348327f2159d", "size": "...
__file__ = 'QC_v1' __date__ = '6/16/2015' __author__ = 'ABREZNIC' import arcpy, datetime, os output = "C:\\TxDOT\\Scripts\\javascript\\Guardrail\\Snake\\QC" GET = "C:\\TxDOT\\Scripts\\javascript\\Guardrail\\Snake\\QC\\Analysis\\GET_20150629_QC.gdb\\GuardrailEndTreatments" roadways = "Database Connections\\Connection t...
{ "content_hash": "0729f00f636202dd240c3662c8128db3", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 139, "avg_line_length": 35.09090909090909, "alnum_prop": 0.6935603256846781, "repo_name": "adambreznicky/javascript", "id": "d8970cda938efb442b5da9eff4c0851a9e562fb7", "siz...
import os from dateutil.parser import parse import requests from dal.oracle.ae2.ae2_transaction import retrieve_ena_accession from models.sra_xml import submission_api import settings __author__ = 'Ahmed G. Ali' def update_release_date(accession, release_date): release_datetime = parse(release_date) ena_acc ...
{ "content_hash": "6d826ba5924a79293a78ac2f6117eea4", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 118, "avg_line_length": 38.8, "alnum_prop": 0.6559278350515464, "repo_name": "arrayexpress/ae_auto", "id": "01644c72ae52798b5db3f81890498f74e7b4f427", "size": "1552", "bi...
from slick import app app.run(host="0.0.0.0", debug = True)
{ "content_hash": "1c7607a76c60a52f19eca34a082ee9a9", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 37, "avg_line_length": 30, "alnum_prop": 0.6833333333333333, "repo_name": "iblis17/slick", "id": "bacde9508681b45f4d0c523f6a9603c32ca9cd95", "size": "77", "binary": false,...
from __future__ import absolute_import, division, print_function import multiprocessing import utool from vtool.tests import grabdata print, print_, printDBG, rrr, profile = utool.inject(__name__, '[TEST_DELETE_ANNOTATION_CHIPS]') def TEST_DELETE_ANNOTATION_CHIPS(ibs, back): gpath_list = grabdata.get_test_gpaths(...
{ "content_hash": "7b121d31fc2eb8826ed6c8de9bd37ff5", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 96, "avg_line_length": 43.75675675675676, "alnum_prop": 0.6726374305126621, "repo_name": "SU-ECE-17-7/ibeis", "id": "8330e7e19c121869bf135b57e7ddd910a8c73788", "size": "169...
import hashlib import importlib import inspect import logging import math import os import uuid from django.conf import settings from django.contrib.postgres.fields import JSONField from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models from django.db.models import fields ...
{ "content_hash": "1801123a3bb286bbf96246ce07691740", "timestamp": "", "source": "github", "line_count": 567, "max_line_length": 120, "avg_line_length": 37.410934744268076, "alnum_prop": 0.6424665283801622, "repo_name": "harvard-vpal/bridge-adaptivity", "id": "edf5bbd882c97ed8ebc259c032286c0fc2d4bcec"...
"""Test HomeKit util module.""" import pytest import voluptuous as vol from homeassistant.components.homekit.const import ( CONF_FEATURE, CONF_FEATURE_LIST, CONF_LINKED_BATTERY_SENSOR, CONF_LOW_BATTERY_THRESHOLD, DEFAULT_CONFIG_FLOW_PORT, DOMAIN, FEATURE_ON_OFF, FEATURE_PLAY_PAUSE, ...
{ "content_hash": "35478ec6b85f7b454ee4e4c209e0a891", "timestamp": "", "source": "github", "line_count": 327, "max_line_length": 88, "avg_line_length": 34.10703363914373, "alnum_prop": 0.6223437640096835, "repo_name": "tchellomello/home-assistant", "id": "c6845779313cb78ba606f6c6084f4729e4987864", "...