text
stringlengths
4
1.02M
meta
dict
""" flask_security.cli ~~~~~~~~~~~~~~~~~~ Command Line Interface for managing accounts and roles. :copyright: (c) 2016 by CERN. :license: MIT, see LICENSE for more details. """ from __future__ import absolute_import, print_function from functools import wraps import click from flask import curr...
{ "content_hash": "a3341cb7f2bcd11e72d41f74d4f9e2f5", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 78, "avg_line_length": 28.387096774193548, "alnum_prop": 0.6427272727272727, "repo_name": "morreene/tradenews", "id": "f085265b9e401fba87bedfdd6b972600da5f8d2e", "size": "...
from django.contrib.auth.models import User, Group from rest_framework import viewsets from quickstart.serializers import UserSerializer, GroupSerializer class UserViewSet(viewsets.ModelViewSet): """ 允许查看和编辑user 的 API endpoint """ queryset = User.objects.all() serializer_class = UserSerializer c...
{ "content_hash": "3024eb0e493ca06831d20b4751712997", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 66, "avg_line_length": 25.42105263157895, "alnum_prop": 0.7391304347826086, "repo_name": "fqc/django_rest_test", "id": "8edb62ba317ba14cef739a1cc65a5bcd95c0008f", "size": "...
'''Some helper functions for PyTorch, including: - get_mean_and_std: calculate the mean and std value of dataset. - msr_init: net parameter initialization. - progress_bar: progress bar mimic xlua.progress. ''' import os import sys import time import math import torch _, term_width = os.popen('stty size', '...
{ "content_hash": "74af8927837dc635bf28efa4c2ba08a4", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 88, "avg_line_length": 26.931506849315067, "alnum_prop": 0.5521363173957273, "repo_name": "roatienza/Deep-Learning-Experiments", "id": "13c4a8f3f0ffd920a2b8e112c94e8e645ecc8...
import itertools import requests from bs4 import BeautifulSoup from data import Database from stackoverflow import SalaryCalculator salcalc = SalaryCalculator() (pos, exp, skl, cnt) = salcalc.get_mainstats() (cur, cnt) = salcalc.get_currencies_and_countries([int(c[0]) for c in cnt]) with Database('debug.db') as db: ...
{ "content_hash": "c498a94da1395c166e7420c69851a3c2", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 75, "avg_line_length": 26.12121212121212, "alnum_prop": 0.6473317865429234, "repo_name": "treischl/so-sal-calc", "id": "996c8fc869809b1ac52f1397f1e17037f600125f", "size": "...
from __future__ import unicode_literals import copy import sys from functools import update_wrapper import warnings from django.apps import apps from django.apps.config import MODELS_MODULE_NAME import django.db.models.manager # NOQA: Imported to register signal handler. from django.conf import settings from django....
{ "content_hash": "68863969b4867f371b3772a24f4cf23b", "timestamp": "", "source": "github", "line_count": 1473, "max_line_length": 166, "avg_line_length": 41.54446707399864, "alnum_prop": 0.5443908816079746, "repo_name": "deployed/django", "id": "6270e35b37ffd85eb89438e33f12c837140078ac", "size": "61...
from .proxy_only_resource import ProxyOnlyResource class VnetValidationTestFailure(ProxyOnlyResource): """A class that describes a test that failed during NSG and UDR validation. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Resource Id. :varty...
{ "content_hash": "fe29e2e7806fe974c0f9c1ba51b61cae", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 79, "avg_line_length": 32.27906976744186, "alnum_prop": 0.590057636887608, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "c0d453c1b53a3a221e205c4c94b148663b89e64d", ...
import os, sys from distutils.core import setup, Command from distutils.extension import Extension from unittest import TextTestRunner, TestLoader from glob import glob from os.path import splitext, basename, join as pjoin, walk #----------------------------------------------------------------------------- # Extra ...
{ "content_hash": "0e87ebf23c5716be79f099d979e72315", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 78, "avg_line_length": 29.65686274509804, "alnum_prop": 0.49785123966942146, "repo_name": "Nichol4s/PyHead", "id": "dc1f23204385bf1dbe2bc87a92d602a01dc7bdcb", "size": "434...
"""Forms related to accounts management.""" from collections import OrderedDict from django import forms from django.core.urlresolvers import reverse from django.http import QueryDict from django.utils.translation import ugettext as _, ugettext_lazy from modoboa.core.models import User from modoboa.lib import events...
{ "content_hash": "940f00ae6c4a5994f6a212d1fc498d0e", "timestamp": "", "source": "github", "line_count": 478, "max_line_length": 79, "avg_line_length": 37.10041841004184, "alnum_prop": 0.5707116273824292, "repo_name": "disko/modoboa-admin", "id": "d73337dcd00bffaa858d3b6ce165ae85f0406e16", "size": "...
import os from setuptools import setup, find_packages, Command import sys from gunicorn import __version__ CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Environment :: Other Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: MacOS ...
{ "content_hash": "ce0c5e8158654d3c33e75ba7b6cac2c4", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 71, "avg_line_length": 27.9247311827957, "alnum_prop": 0.6241817481709665, "repo_name": "DataDog/gunicorn", "id": "be54106f6582dfeb69e90cffd4995efb93ee76e9", "size": "2726"...
import os try: __IPYTHON__ import sys del sys.argv[1:] except: pass import srwl_bl import srwlib import srwlpy import srwl_uti_smp def set_optics(v=None): el = [] pp = [] names = ['M1', 'M1_Grating', 'Grating', 'GA', 'GA_M3A', 'M3A', 'M3', 'M3_SSA', 'SSA', 'SSA_KBAperture', 'KBAperture',...
{ "content_hash": "df183b2cc66372d155ada5d1c3ebbfc4", "timestamp": "", "source": "github", "line_count": 560, "max_line_length": 440, "avg_line_length": 60.198214285714286, "alnum_prop": 0.5943163952419092, "repo_name": "mrakitin/sirepo", "id": "0a9930b68c1383fd9e0be6272a7b67f150e5de59", "size": "33...
from __future__ import unicode_literals from django.conf import settings import django.contrib.auth.models import django.contrib.postgres.fields.jsonb from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import uuid class Migration(migrations.Migration): initial...
{ "content_hash": "9986e55799416440cff13224b7704542", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 203, "avg_line_length": 59.96470588235294, "alnum_prop": 0.6156562683931724, "repo_name": "mailme/mailme", "id": "e88809b19a66936b2fa7cae1bb7150d06da51047", "size": "5169",...
import numpy as np import unittest import sys sys.path.append('..') from op_test import OpTest import paddle.fluid as fluid import paddle paddle.enable_static() class TestStackOpBase(OpTest): def initDefaultParameters(self): self.num_inputs = 4 self.input_dim = (5, 6, 7) self.axis = 0 ...
{ "content_hash": "8790d8ecdf49fac353e676434630ad21", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 77, "avg_line_length": 29.79245283018868, "alnum_prop": 0.5938357610301879, "repo_name": "PaddlePaddle/Paddle", "id": "eefe1d7d691fcdc2325637d38349a50dc58f6c08", "size": "...
import gevent from gevent import monkey monkey.patch_all() import ConfigParser import bottle import time import base64 try: from keystoneclient.middleware import auth_token except Exception: pass from pysandesh.gen_py.sandesh.ttypes import SandeshLevel # Open port for access to API server for trouble shootin...
{ "content_hash": "90125e8945ee83a77ee6d64377e9ac97", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 78, "avg_line_length": 33.6425702811245, "alnum_prop": 0.5776530977676972, "repo_name": "cloudwatt/contrail-controller", "id": "b4e15f9c0a5624001f2afa3104fa11fa76db71c3", ...
"""\ =========================== Simple Pygame drawing board =========================== A simple drawing board for the pygame display service. Use your left mouse button to draw to the board and the right to erase your artwork. """ import pygame import Axon from Axon.Ipc import producerFinished from Kamaelia.UI.Py...
{ "content_hash": "4f4d727096eb2a89c54c7545a85bffc6", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 116, "avg_line_length": 34.701863354037265, "alnum_prop": 0.5462681224270628, "repo_name": "bbc/kamaelia", "id": "ee62730ca0a7b0770304ae9dfeb6e99546076bc1", "size": "6493"...
from __future__ import print_function from Tkinter import TclError class WidgetRedirector: """Support for redirecting arbitrary widget subcommands. Some Tk operations don't normally pass through tkinter. For example, if a character is inserted into a Text widget by pressing a key, a default Tk bindin...
{ "content_hash": "189c3969c457dcd6cbac88ada5c58d12", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 79, "avg_line_length": 39.462857142857146, "alnum_prop": 0.6397335650159282, "repo_name": "tequa/ammisoft", "id": "54431f7382536bb91fdc6022d30e3e7027590de5", "size": "6906...
import sys import Queue class Link(): ''' No repeat link ''' def __init__(self): self.map = {} self.tail = "head" self.map["head"] = {"stat": 0, "next": "null"} def __contains__(self, key): return key in self.map def __len__(self): return len(self.map) - 1 ...
{ "content_hash": "271636d431d9b8953c4030f1639ee35c", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 112, "avg_line_length": 26.26595744680851, "alnum_prop": 0.5180234912920211, "repo_name": "turnyouon/Inforobot", "id": "2e3c572f8dd66e6476d44946d4d1e40e38ce5297", "size": "...
from calvin.actor.actor import Actor, manage, condition import time # NEVER DO THIS OUTSIDE OF TEST class Burn(Actor): """ forward a token unchanged and Burns cycles Inputs: token : a token Outputs: token : the same token """ @manage(['dump', 'last', 'duration']) def init(self,...
{ "content_hash": "edb1e978a603961c8fbde1c93c1281d6", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 83, "avg_line_length": 27.25, "alnum_prop": 0.5387823185988324, "repo_name": "EricssonResearch/calvin-base", "id": "cc5055a84f790df0c9215746353f96875f41f129", "size": "1804...
from ._azure_dev_ops_connector_operations import AzureDevOpsConnectorOperations from ._azure_dev_ops_repo_operations import AzureDevOpsRepoOperations from ._azure_dev_ops_connector_stats_operations import AzureDevOpsConnectorStatsOperations from ._azure_dev_ops_org_operations import AzureDevOpsOrgOperations from ._azur...
{ "content_hash": "d28cf3565a3b339c8302a134baf69328", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 90, "avg_line_length": 43.86206896551724, "alnum_prop": 0.7932389937106918, "repo_name": "Azure/azure-sdk-for-python", "id": "4d9878888d0b0585c4a662fc18f7a93cd8c46b62", "si...
import json import re from multiprocessing.pool import Pool import requests __author__ = '[email protected]' # This script iterates an index and issues a PUT request for an empty string to force a reindex of the entity index_url_template = 'http://elasticsearch013wo:9200/{index_name}/_search?size={size}&from={from...
{ "content_hash": "75fc51a482b7f003872cb8fb933e6a8a", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 109, "avg_line_length": 25.10091743119266, "alnum_prop": 0.5515350877192983, "repo_name": "mdunker/usergrid", "id": "101fa980ee923bf8c8c36847b0301d243f6cf634", "size": "35...
"""Python module for generating .ninja files. Note that this is emphatically not a required piece of Ninja; it's just a helpful utility for build-file-generation systems that already use Python. """ import textwrap def escape_path(word): return word.replace("$ ", "$$ ").replace(" ", "$ ").replace(":", "$:") c...
{ "content_hash": "60cda58c1eaa9e4af189f52ac01781f7", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 88, "avg_line_length": 32.40588235294118, "alnum_prop": 0.5340352151025595, "repo_name": "nodegit/node-gyp", "id": "14212358082a622e7a49f187c338a502f952ce6d", "size": "565...
''' The MIT License (MIT) Copyright (c) 2015-present Badoo Trading Limited. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy...
{ "content_hash": "bca58c8040c5c71fb21ae8d282d10ddd", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 80, "avg_line_length": 45.627906976744185, "alnum_prop": 0.7629969418960245, "repo_name": "badoo/objective-c-style-guide", "id": "ef70ea66581f0d28fdff3918f53c4f1ff50ef3f6", ...
from __future__ import absolute_import from .job import ImageInferenceJob
{ "content_hash": "dece3638f024c744b37f5d60d6e95477", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 38, "avg_line_length": 25, "alnum_prop": 0.8, "repo_name": "TimZaman/DIGITS", "id": "72cba967087695f2afdf197ee55443204d4fcc76", "size": "139", "binary": false, "copies":...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("fluent_contents", "0001_initial")] operations = [ migrations.CreateModel( name="DisqusCommentsAreaItem", fields=[ ( ...
{ "content_hash": "2c20fc25403fd09de84953f1cf8f2e6c", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 79, "avg_line_length": 32, "alnum_prop": 0.45032051282051283, "repo_name": "edoburu/django-fluent-contents", "id": "649bcfbd34e8fbd41c72ae51d8ef18a42677cb4e", "size": "1272...
from typing import Optional # third party from nacl.signing import VerifyKey # relative from ... import UID from ......logger import info from ....abstract.node import AbstractNode from .simple_messages import NodeRunnableMessageWithReply class DoesObjectExistMessage(NodeRunnableMessageWithReply): __attr_allow...
{ "content_hash": "b8bddfdeb8e79813857647b1e14ad4ef", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 93, "avg_line_length": 29.28, "alnum_prop": 0.674863387978142, "repo_name": "OpenMined/PySyft", "id": "74625d6305b3ad1055db48cb0559b595dd0505af", "size": "741", "binary":...
"""empty message Revision ID: 4fa66a99c1dd Revises: 39939c989fb1 Create Date: 2013-11-08 00:02:57.894562 """ # revision identifiers, used by Alembic. revision = '4fa66a99c1dd' down_revision = '39939c989fb1' from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql def upgrade(): ...
{ "content_hash": "c1ba7cc32a46463b71396acd60966180", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 101, "avg_line_length": 30.103448275862068, "alnum_prop": 0.697594501718213, "repo_name": "SevereOverfl0w/MCDirectory", "id": "0ccfbab558c411266f14473dad542fed4f777cb8", "s...
import unittest import torch import numpy as np import os import math import uuid import tempfile import pyprob from pyprob import util from pyprob.distributions import Empirical, Normal, Categorical, Uniform, Poisson, Beta, Mixture, TruncatedNormal empirical_samples = 25000 class DistributionsTestCase(unittest.Te...
{ "content_hash": "ee983fb9b3ec16e39a3eb1b8e6345f57", "timestamp": "", "source": "github", "line_count": 1465, "max_line_length": 510, "avg_line_length": 63.03686006825939, "alnum_prop": 0.6784913751096384, "repo_name": "probprog/pyprob", "id": "9ededafd789be98b0fec5175fe6438ef5a6f5356", "size": "92...
import glob from distutils.core import setup , run_setup import sys import os keyw = """\ Pyjamas, GUI, Compiler, AJAX, Widget Set """ datadir = os.path.join("share", "pyjamas") bp_data_files = glob.glob(os.path.join("builder", "boilerplate", "*")) test_files = glob.glob(os.path.join("pyjs", "tests", "*")) stub_fil...
{ "content_hash": "6e998c77429751fc957748712bb55ba7", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 77, "avg_line_length": 31.259615384615383, "alnum_prop": 0.5770532143955706, "repo_name": "certik/pyjamas", "id": "026e0fb7b63bb96093c91776442f2d5969b2ad7f", "size": "3390...
from __future__ import unicode_literals import unittest import os from pymatgen import Element, Composition from pymatgen.phasediagram.entries import PDEntryIO, PDEntry from pymatgen.phasediagram.pdmaker import PhaseDiagram, \ GrandPotentialPhaseDiagram, CompoundPhaseDiagram, PhaseDiagramError from pymatgen.phase...
{ "content_hash": "cd60393373b1a132e3aeb9a2159886fe", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 79, "avg_line_length": 43.87116564417178, "alnum_prop": 0.5403440078310726, "repo_name": "sonium0/pymatgen", "id": "22dba3e0c8acf2a41c29f205ecca3d8bade20373", "size": "726...
"""Generate Macro-ized C++ code for wrapping detach functions. This works by iterating over all functions, and for each function, visiting the types of its arguments and return value. Type visitors are transitive. Eventually, all reachable types are visited. Visitors of certain kinds of types will emit type wrappers i...
{ "content_hash": "abb6b3eea781ff2bab03e0339a18b3cc", "timestamp": "", "source": "github", "line_count": 417, "max_line_length": 104, "avg_line_length": 25.49400479616307, "alnum_prop": 0.6240240805192362, "repo_name": "Granary/granary", "id": "7c18c397449345c5437712a581c31b3de70af2a4", "size": "106...
from licant.modules import submodule from licant.cxx_modules import application import licant from licant.scripter import scriptq scriptq.execute("../../gxx.g.py") application("target", sources = ["main.cpp"], include_paths = ["../.."], modules = [ submodule("gxx", "posix"), submodule("gxx.dprint", "cout"), ...
{ "content_hash": "cb0c4ce743e24312db4093f8a16b6549", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 42, "avg_line_length": 21, "alnum_prop": 0.6772486772486772, "repo_name": "Mirmik/gxx", "id": "c3f1b07ae5743706f18e263349c1b217d2e84f66", "size": "417", "binary": false, ...
import json, re, sys, urllib ## osu!apy Methods ## build_request - Returns the full API request URL using the provided base URL and parameters. ## list_params - The list of parameters to add to the end of the request URL. ## URL - The base API request URL to append the list of parameters to. def build_request(list_...
{ "content_hash": "19493cdeb69a234c492a34e7e25ba70b", "timestamp": "", "source": "github", "line_count": 228, "max_line_length": 112, "avg_line_length": 39.6359649122807, "alnum_prop": 0.6411419718933274, "repo_name": "albinohat/osu-apy", "id": "bccca801c8d99d67c3ecd8c640c567d1fb1d4028", "size": "10...
import unittest from telemetry.core import wpr_modes from telemetry.core.backends.chrome import chrome_browser_backend class FakePlatformBackend(object): def __init__(self, wpr_http_device_port, wpr_https_device_port, is_host_platform): self.wpr_http_device_port = wpr_http_device_port self.w...
{ "content_hash": "e08268bb36a7655356f58200f1a4b35b", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 80, "avg_line_length": 37.111111111111114, "alnum_prop": 0.7007984031936128, "repo_name": "dednal/chromium.src", "id": "baed6512530a51c37d3cbca37886bf8b958b6fb4", "size": ...
from django.views.generic import TemplateView class AgendaView(TemplateView): template_name = "opconsole_agenda.html"
{ "content_hash": "079e24a441451914e7e57b891b9637ea", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 45, "avg_line_length": 30.5, "alnum_prop": 0.8032786885245902, "repo_name": "baalkor/timetracking", "id": "aec0fdbc63293346307b5ede35f23d4dff4a9946", "size": "122", "binar...
import datetime import json import logging from multiprocessing import Pool import os import re import requests from db import RssDB, Thread ROOT_PATH = os.path.dirname(os.path.realpath(__file__)) + os.sep + '..' + os.sep l = logging.getLogger(__name__) def download_mp(p, save_path, http_session): # Create nece...
{ "content_hash": "7efe6238ae502c0cdd538f52d4d79de2", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 100, "avg_line_length": 35.91724137931035, "alnum_prop": 0.4650537634408602, "repo_name": "nicolasmartinelli/4chan-download", "id": "d588caf5866456f97f9b83c33d68234a002e988f...
import os import datetime as dt import time from astropy.io import fits as pyfits import matplotlib matplotlib.use('Agg') import pylab as pl import numpy as np from scipy import stats from AllSky340 import AllSky340 cam = AllSky340(port="/dev/ttyUSB0", baudrate=460800, timeout=0.1) cam...
{ "content_hash": "a8add78c64b7423089699051e08edff2", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 86, "avg_line_length": 31.115384615384617, "alnum_prop": 0.5754017305315204, "repo_name": "saltastro/skycam", "id": "f5267613a0e6a122247f359b4ed52db63c15a5ee", "size": "32...
''' Test correctness of matvec for various cases. ''' import dynamite_test_runner as dtr import numpy as np import hamiltonians from dynamite import config from dynamite.msc_tools import msc_dtype from dynamite.operators import identity, sigmax, sigmay, index_sum, index_product from dynamite.subspaces import Full, Pa...
{ "content_hash": "1f355d86716e590df93142f90085b542", "timestamp": "", "source": "github", "line_count": 308, "max_line_length": 97, "avg_line_length": 33.66558441558441, "alnum_prop": 0.5835663998456939, "repo_name": "GregDMeyer/dynamite", "id": "adafd5ac7276431cdf0382567d7a05068a80afe7", "size": "...
import glob import os.path import pkgutil import re import sys import tempfile import zipfile __version__ = '${python.version}' PACKAGE_EXTENSIONS = {'.zip', '.egg', '.jar'} PACKAGE_DEV = re.compile("[.]dev[0-9]*$") def configure(jars=[], packages=[], files=[], spark_home=None, spark_master='yarn', tmp_path=None):...
{ "content_hash": "7444687feab975144d37ece1168a99b0", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 121, "avg_line_length": 38.66086956521739, "alnum_prop": 0.6396761133603239, "repo_name": "elahrvivaz/geomesa", "id": "2ba865adbd3a7dbdb9bf74326da7caa864de4059", "size": "...
from .resource import Resource class LocalNetworkGateway(Resource): """A common class for general resource information. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :ivar name: Resource name. :vartype name: ...
{ "content_hash": "03d2f828546bca28900b2ee87bbb835b", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 167, "avg_line_length": 42.492537313432834, "alnum_prop": 0.644538110291535, "repo_name": "v-iam/azure-sdk-for-python", "id": "be374ae921394ea23683b749f0b604495824b806", "s...
from ccxt.base.exchange import Exchange from ccxt.base.errors import ExchangeError class _1broker (Exchange): def describe(self): return self.deep_extend(super(_1broker, self).describe(), { 'id': '_1broker', 'name': '1Broker', 'countries': 'US', 'rateLimit'...
{ "content_hash": "39323b903d6d5c2d4ae77de0d24b1ccc", "timestamp": "", "source": "github", "line_count": 239, "max_line_length": 126, "avg_line_length": 36.69874476987448, "alnum_prop": 0.4749743472808118, "repo_name": "tritoanst/ccxt", "id": "f1168727a8cd2150b628d9f142b77067a9bbd727", "size": "8796...
from django.shortcuts import render_to_response from django.http import HttpResponseRedirect, HttpResponse from django.template import RequestContext from django.utils.translation import ugettext_lazy as _ from instance.models import Host from dashboard.views import sort_host from webvirtmgr.server import ConnServer fr...
{ "content_hash": "9b98bba7e441e08e3cef99d9eef4703e", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 123, "avg_line_length": 34.98425196850393, "alnum_prop": 0.5320729237002025, "repo_name": "selboo/starl-mangle", "id": "8a10011a0dcc5a3fd2bb29f4f151237440c3417e", "size": ...
from flask import Flask, Markup from flask import redirect, url_for, request from flask import session, g, render_template from pymongo import Connection # from pymongo import ASCENDING, DESCENDING from bson.objectid import ObjectId import markdown from mcsession import McSessionInterface app = Flask(__name__) app...
{ "content_hash": "046cf5eb9458e208f1db2fde07b79cf9", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 97, "avg_line_length": 30.15463917525773, "alnum_prop": 0.5955555555555555, "repo_name": "arand/pawiki", "id": "e225f6daedb93a3ae9122d6de5367d39461da66a", "size": "3016", ...
from LRR import Hook as HookBase class MyAmazingDataClass: def __init__(self): self.my_truth = False self.courts_in_english = [] class Hook(HookBase): def __init__(self): HookBase.__init__(self, Data=MyAmazingDataClass) self.opt.jurisdiction = "jp" def court(se...
{ "content_hash": "23d21a877b090e94bf97cca79e19c029", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 61, "avg_line_length": 25.21875, "alnum_prop": 0.5861214374225526, "repo_name": "fbennett/legal-resource-registry", "id": "a346ab07a0352690ec34d621db040700f45f6811", "size"...
"""nrvr.diskimage.isoimage - Clone and modify an .iso disk image The main class provided by this module is IsoImage. Implemented subclasses of IsoImageModification are * IsoImageModificationFromString * IsoImageModificationFromPath * IsoImageModificationByReplacement * IsoImageModificationFromByteRange As implemente...
{ "content_hash": "6397fa7d3363b6536a245c4aa547107f", "timestamp": "", "source": "github", "line_count": 477, "max_line_length": 140, "avg_line_length": 49.339622641509436, "alnum_prop": 0.6383683875079669, "repo_name": "srguiwiz/nrvr-commander", "id": "be4f7b19f38fa02af27e30f103eb37c088f42863", "si...
""" Created on Mon Apr 1 18:19:38 2013 @author: matz """ import sys import cvtype import datatype import document import generator import package import test # abbreviations DT = test.Default() # mean1DWrapper dcl = document.Document() dclIncludes = ["<opencv2/core/core.hpp>"] dcl.text( """ double mean(const cv::...
{ "content_hash": "3f97a1356eb9ead93316ef37276d6220", "timestamp": "", "source": "github", "line_count": 470, "max_line_length": 142, "avg_line_length": 29.22340425531915, "alnum_prop": 0.6398980706224973, "repo_name": "uboot/stromx-opencv", "id": "57923618628db4899a26411d9b5bc600ff6e8a03", "size": ...
import pandas as pd import numpy as np ## The path here is the .csv file path in HDFS pdata = sqlContext.read.format('csv').load("/FileStore/tables/[file name in HDFS]", index_col="ID", header =True).toPandas() ...
{ "content_hash": "c6b0a92bcd449d0e00df707c13dc5402", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 125, "avg_line_length": 34.56578947368421, "alnum_prop": 0.6764370003806623, "repo_name": "hanhanwu/Hanhan_Data_Science_Practice", "id": "4976b8ab038b370854bf554bf136ee686c43...
import pyxb_114.binding.generate import pyxb_114.utils.domutils import os.path from pyxb_114.exceptions_ import * import unittest class TestIncludeDD (unittest.TestCase): def testDefault (self): schema_path = '%s/../schemas/test-include-ad.xsd' % (os.path.dirname(__file__),) self.assertRaises(py...
{ "content_hash": "4c2a999b114bfff185c30dc569f4eb98", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 128, "avg_line_length": 27.88235294117647, "alnum_prop": 0.7088607594936709, "repo_name": "msherry/PyXB-1.1.4", "id": "c3b12582a94af6356a7fc3131c4e7242eeef1f49", "size": "4...
""" Copyright 2020 Google LLC. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software dis...
{ "content_hash": "c91b1c7b8ccb8b63124f8fb459c21c64", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 110, "avg_line_length": 36.56976744186046, "alnum_prop": 0.6260731319554849, "repo_name": "googleinterns/smart-news-query-embeddings", "id": "59d246e0099fd6b25c0917223721c8f8...
import os, re, requests, random, json import config """ YTS Bot class, the brain of the bot """ class YTSBot: """ Initialize the bot """ def __init__(self): self.user = None self.awaiting_choice = {} """ Respond to a channel message params: userid of user who is talking, message that was sent return: th...
{ "content_hash": "acb35cd5498f7fd9c0a584633b67fc7a", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 188, "avg_line_length": 31.48148148148148, "alnum_prop": 0.66, "repo_name": "opcecco/yts-slack", "id": "51b27b945fcb54f14dc16af2768cd61c3de3968f", "size": "3532", "binar...
"""Handles NSWorkspace notifications from crankd.""" __author__ = '[email protected] (Clay Caviness)' from ApplicationUsage import ApplicationUsage # from FirefoxPreferenceManager import FirefoxPreferenceManager class NSWorkspaceHandler(object): """Handles NSWorkspace events from crankd. Unusable outsid...
{ "content_hash": "5b9bcbd329b8db193063dd72c1358e43", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 75, "avg_line_length": 31.56, "alnum_prop": 0.6996197718631179, "repo_name": "google/macops", "id": "ad2a26e6f3f4c10e29b279d03da18fa813b03c69", "size": "1426", "binary": ...
"""Tests for PrecisionOp.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.python.platform import numpy as np import tensorflow as tf class InTopKTest(tf.test.TestCase): def _validateInTopK(self, predictions, target, k, expected): ...
{ "content_hash": "283b8efc9a41c5c4b45dbb7d407830cc", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 65, "avg_line_length": 29.575, "alnum_prop": 0.6356720202874049, "repo_name": "arunhotra/tensorflow", "id": "c27cfd34f83253aa97e105c0f6477cd47c7ed9cb", "size": "1183", "b...
from rest_framework import permissions from rest_framework.throttling import UserRateThrottle, AnonRateThrottle, SimpleRateThrottle import logging from api.base import settings logger = logging.getLogger(__name__) class BaseThrottle(SimpleRateThrottle): def get_ident(self, request): if request.META.get...
{ "content_hash": "58a6ed28c3f070f3d49b643712ac939a", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 92, "avg_line_length": 28.18320610687023, "alnum_prop": 0.6738894907908992, "repo_name": "brianjgeiger/osf.io", "id": "86aa01b1377f38429b42a97922e0407f52ac9b50", "size": "...
import __builtin__ __builtin__.process = 'client' # Temporary hack patch: __builtin__.__dict__.update(__import__('pandac.PandaModules', fromlist=['*']).__dict__) from direct.extensions_native import HTTPChannel_extensions from direct.extensions_native import Mat3_extensions from direct.extensions_native import VBas...
{ "content_hash": "b84dd56b62f5cd369c766b3774605968", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 112, "avg_line_length": 35.411764705882355, "alnum_prop": 0.76698882512836, "repo_name": "Spiderlover/Toontown", "id": "5fda86ea96d147ebc5136abcd46127a2e2de3028", "size": ...
__all__ = ['assert_assigned_type_and_shape_match'] import jax from objax.typing import JaxArray TRACER_TYPES = (jax.interpreters.partial_eval.JaxprTracer, jax.interpreters.partial_eval.DynamicJaxprTracer) def split_shape_and_device(array): if isinstance(array, jax.interpreters.pxla.ShardedDevi...
{ "content_hash": "a4990d6b32a189872193464fbf485d8c", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 116, "avg_line_length": 45.71052631578947, "alnum_prop": 0.6937248128957973, "repo_name": "google/objax", "id": "5cb43e4ff2ed4865c8806ed7dddd128bd673db13", "size": "2313", ...
from Queue import Empty from contextlib import contextmanager from multiprocessing import Process, Queue import os import signal import time import traceback from . import command def setup_testing(): """For testing only: Use threading under the hood instead of multiprocessing to make coverage work. """ glob...
{ "content_hash": "7bde0f317c28404107790bb3a1dbfa4d", "timestamp": "", "source": "github", "line_count": 276, "max_line_length": 79, "avg_line_length": 31.902173913043477, "alnum_prop": 0.6549687677455991, "repo_name": "MTASZTAKI/ApertusVR", "id": "7c9a250bc383919b2bbde26ef16b28aa18c0d1d3", "size": ...
from typing import Optional from parlai.core.params import ParlaiParser from parlai.core.opt import Opt from parlai.core.message import Message from parlai.core.teachers import FixedDialogTeacher from parlai.utils.io import PathManager import parlai.tasks.md_gender.utils as gend_utils import parlai.utils.logging as log...
{ "content_hash": "a95655693ff2c79ece915608c42de119", "timestamp": "", "source": "github", "line_count": 225, "max_line_length": 113, "avg_line_length": 38.76, "alnum_prop": 0.4709322325421397, "repo_name": "facebookresearch/ParlAI", "id": "fd9a6114fa32e7490d79e1ccd35ce1756abf1b19", "size": "8921", ...
from __future__ import absolute_import, division, print_function, unicode_literals def prepare_dependencies(self): self.add_to_build_file('a', 'java_library(name="a")') self.add_to_build_file('b', 'java_library(name="b", dependencies=["a:a"])') self.add_to_build_file('c', 'java_library(name="c", dependencies=["...
{ "content_hash": "882e1a4a8c08278f0ccfde4111c2d94f", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 82, "avg_line_length": 47.06666666666667, "alnum_prop": 0.6458923512747875, "repo_name": "twitter/pants", "id": "5654e02de0a46b3829d9ba38e8fe72c8cf720539", "size": "853", ...
import os from unittest import mock import flask import markupsafe import pytest from airflow.dag_processing.processor import DagFileProcessor from airflow.security import permissions from airflow.utils.session import create_session from airflow.utils.state import State from airflow.www.utils import UIAlert from airf...
{ "content_hash": "720f0fe0b13641211d2d4ac08717deb2", "timestamp": "", "source": "github", "line_count": 230, "max_line_length": 108, "avg_line_length": 38.11739130434783, "alnum_prop": 0.6625983802897228, "repo_name": "mistercrunch/airflow", "id": "9b16acea84fd2ec0d72a8f2592742786dfc6d82a", "size":...
import random, os from flask import * import names # set up flask constants DEBUG = False SECRET_KEY = "donotcare" USERNAME = "donotcare" PASSWORD = "donotcare" INDEX_NAME = "nameindex.txt" INDEX_SIZE = 1000 # create app app = Flask(__name__) app.config.from_object(__name__) minAdj = len(names.adjectives)...
{ "content_hash": "01d028573a63333f67f27eeb60ae12f8", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 87, "avg_line_length": 19.341463414634145, "alnum_prop": 0.5813366960907944, "repo_name": "MatthewJWalls/nomenclature", "id": "2f92770c70373227bff26550e86dbe112fd8fc94", "s...
from __future__ import absolute_import from django.utils import timezone from sentry.testutils import AcceptanceTestCase class ProjectOverviewTest(AcceptanceTestCase): def setUp(self): super(ProjectOverviewTest, self).setUp() self.user = self.create_user('[email protected]') self.org = sel...
{ "content_hash": "7bbd04e1822a75ba0b6416d98f5b1752", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 65, "avg_line_length": 35.523809523809526, "alnum_prop": 0.6260053619302949, "repo_name": "ifduyue/sentry", "id": "77101f5b15dc8006ab53f90abd8241d788a6d69d", "size": "1492"...
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['None'] , ['PolyTrend'] , ['BestCycle'] , ['NoAR'] );
{ "content_hash": "8efa9ae9a7ab02c1a371c2753f8137f5", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 75, "avg_line_length": 37, "alnum_prop": 0.6959459459459459, "repo_name": "antoinecarme/pyaf", "id": "69503bcdd4ac1b8a1e483e217abecf1c3a2f001e", "size": "148", "binary": f...
class easyconfig(objekt) def __init__(self, filepath, seperator=":", encode = "utf-8"): self._encode = encode self.__filepath = filepath self.__seperator = seperator def __del__(self): def newconf(self, key, value): with open(self.filepath, "a", encoding = self.encode) as ...
{ "content_hash": "d20e7f61822b2dc63a886e48df854e71", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 80, "avg_line_length": 36.68181818181818, "alnum_prop": 0.49008674101610905, "repo_name": "nam3less/Snippets", "id": "189b4c42ac0279a5360f204f247b0edf6add63d2", "size": "16...
__author__ = '[email protected]' from infer import infer
{ "content_hash": "dd884e2312239b91b0a58013a9acc224", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 49, "avg_line_length": 25, "alnum_prop": 0.76, "repo_name": "jeffreystarr/dateinfer", "id": "50b674e594df923c3344edb1e36d2f53cd031ad4", "size": "75", "binary": false, "c...
from actions import *
{ "content_hash": "84ab28d4fdf16aeb96e49e67f819f4e8", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 21, "avg_line_length": 21, "alnum_prop": 0.8095238095238095, "repo_name": "python-acoustics/Sea", "id": "06b967f676d7d412ac146f1e9958c5546d02d673", "size": "23", "binary":...
"""HTTP proxy for opening RPC connection to dashd. AuthServiceProxy has the following improvements over python-jsonrpc's ServiceProxy class: - HTTP connections persist for the life of the AuthServiceProxy object (if server supports HTTP/1.1) - sends protocol 'version', per JSON-RPC 1.1 - sends proper, incrementing ...
{ "content_hash": "27b6e000d48815b0d2636d1106bcc3df", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 155, "avg_line_length": 43.4207650273224, "alnum_prop": 0.6042033727661716, "repo_name": "dashpay/dash", "id": "3252780e1484f2171be3d196ca5bc136656dbb6e", "size": "8838", ...
__version__=''' $Id$ ''' """Tests performed on all Python source files of the ReportLab distribution. """ from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, SecureTestCase, GlobDirectoryWalker, outputfile, printLocation setOutDir(__name__) import os, sys, string, fnmatch, re import unittest from reportl...
{ "content_hash": "1a686d183117bee32a93819c52024945", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 129, "avg_line_length": 31.733333333333334, "alnum_prop": 0.5869747899159664, "repo_name": "MatthewWilkes/reportlab", "id": "d3fc904642e99eb0c5e0a1a1c8739606c62175e0", "si...
import unittest from knowru_markdown import markdown_to_html class KnowruMarkdownUnitTestTestCase(unittest.TestCase): def test_paragraph(self): result = markdown_to_html('this is a paragraph.') self.assertEqual(result, '<p>this is a paragraph.</p>') def test_header(self): result = mark...
{ "content_hash": "3561930480a0cd01152716498d674437", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 328, "avg_line_length": 46.52173913043478, "alnum_prop": 0.6669781931464175, "repo_name": "jeffjaehoyang/knowru_markdown", "id": "2c14def96b885d6399eba9d96b14429874c788d9", ...
from keras.models import Sequential, load_model from keras.layers.core import Dense, Reshape, Flatten, Dropout from keras.layers.convolutional import Conv1D, Conv2D from keras.layers.normalization import BatchNormalization from keras.activations import softmax from keras.losses import binary_crossentropy from keras.opt...
{ "content_hash": "195ffffcaa5095de3e362e496e2ff9d8", "timestamp": "", "source": "github", "line_count": 218, "max_line_length": 123, "avg_line_length": 41.03211009174312, "alnum_prop": 0.5936277249860257, "repo_name": "waelkht/Onto.KOM", "id": "926499dac1a1dfd2f114c87958a12f00a7a20531", "size": "89...
import syslog from commands import getoutput from pUtil import tolog def sysLog(message): """ Write message to syslog """ status = False try: if message != "": syslog.syslog(syslog.LOG_ERR, message) else: tolog("!!WARNING!!4444!! Will not write empty message to sys...
{ "content_hash": "52d27cbea2a307037004281481cadb89", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 77, "avg_line_length": 22.58490566037736, "alnum_prop": 0.543859649122807, "repo_name": "PanDAWMS/pilot", "id": "17daca92553d4d30e87671f84cc9329892e1e7fc", "size": "1197", ...
""" The :class:`LocalResponseNormalization2DLayer <lasagne.layers.LocalResponseNormalization2DLayer>` implementation contains code from `pylearn2 <http://github.com/lisa-lab/pylearn2>`_, which is covered by the following license: Copyright (c) 2011--2014, Université de Montréal All rights reserved. Redistribution an...
{ "content_hash": "456e52b8d6bc1bcccd75e718dcfb816a", "timestamp": "", "source": "github", "line_count": 366, "max_line_length": 79, "avg_line_length": 44.59016393442623, "alnum_prop": 0.6525735294117647, "repo_name": "VCG/gp", "id": "4477269ac3184131d1e54af87dcf5f0cd50facc3", "size": "16347", "bi...
import os from oslo_log import log as logging from tacker.sol_refactored.common import exceptions as sol_ex from tacker.sol_refactored.common import vnf_instance_utils as inst_utils from tacker.sol_refactored.infra_drivers.kubernetes import kubernetes_common from tacker.sol_refactored.infra_drivers.kubernetes import ...
{ "content_hash": "9a2c1da84b959876cd27f5d56fb5be7c", "timestamp": "", "source": "github", "line_count": 337, "max_line_length": 79, "avg_line_length": 43.931750741839764, "alnum_prop": 0.5925700776764606, "repo_name": "openstack/tacker", "id": "d81bfc17ee6a0c02bab11692dd48056674e66e79", "size": "15...
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="barpolar.selected.marker", **kwargs ): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent_name...
{ "content_hash": "5ee8854b66ad4ef6ed8d341ecfd9c1ff", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 83, "avg_line_length": 32.46153846153846, "alnum_prop": 0.6066350710900474, "repo_name": "plotly/plotly.py", "id": "5e0113d377f692dcb2f74496b790e25d003eec03", "size": "422"...
""" WSGI config for smt project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "smt.settings") from django.core.wsgi impo...
{ "content_hash": "88567f7d0996f335d31436a65db7a2fb", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 27.214285714285715, "alnum_prop": 0.7690288713910761, "repo_name": "ilya-yurtaev/smt", "id": "2888077951dfb1bc44aaeb0c0abb2c61658daa31", "size": "381...
"""Task design containers.""" import numpy import random import pprint __all__ = ['Design', 'Block', 'Trial', 'Array'] class Design(list): """Top-level task design container. The :class:`Design` is a list of :class:`Block` objects, which themselves are lists of :class:`Trial` objects. """ def ...
{ "content_hash": "a45eb10a96b5fcfac0b072bce6d2d767", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 79, "avg_line_length": 30.14720812182741, "alnum_prop": 0.6039737329516753, "repo_name": "ucdrascal/hcibench", "id": "5edf3af665fcc0876226bbf3fc230fbe40b61ced", "size": "5...
""" Install the packages you have listed in the requirements file you input as first argument. """ from __future__ import (absolute_import, division, print_function, unicode_literals) try: from fabric.api import task, local except: from invoke import task from invoke import run as local import o...
{ "content_hash": "590897f5e53ab6ca864741a3b87b97df", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 89, "avg_line_length": 23.53886010362694, "alnum_prop": 0.6332819722650231, "repo_name": "Neurita/boyle", "id": "ca396d41e41f0a08881f65ae03c34b963f3545fe", "size": "4566",...
from __future__ import (absolute_import, division, print_function) from .wcsBase import WCSBase, WCSCapabilitiesReader, ServiceException from bcube_owslib.util import openURL, testXMLValue, xmltag_split from urllib import urlencode from bcube_owslib.crs import Crs import logging from owslib.util import log def ns(t...
{ "content_hash": "2911555c82b867fddc40532c9c93c7ba", "timestamp": "", "source": "github", "line_count": 422, "max_line_length": 119, "avg_line_length": 38.19668246445497, "alnum_prop": 0.5729263601960419, "repo_name": "b-cube/pipeline-demo", "id": "0c92838ab1b31cba9a22d4f8787c5e129e3cb00a", "size":...
from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/clothing/shared_clothing_armor_zam_boots.iff" result.attribute_template_id = -1 result.stfName("string_id_table","") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "074e271a5cdcad4d1138b75ed37f8268", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 88, "avg_line_length": 24.384615384615383, "alnum_prop": 0.7003154574132492, "repo_name": "obi-two/Rebelion", "id": "612d14b8cc7311d88869b51d5abff62dbdf02c88", "size": "462...
import unittest from unittest.mock import MagicMock, patch from alarmlistener.alarm_notification_handler import AlarmNotificationHandler from alarmlistener.event_controller import EventController class TestAlarmNotificationHandler(unittest.TestCase): def test_handle_method_triggers_alarm_event_on_controller(sel...
{ "content_hash": "e46a382d33a06908c60e831cf8ddce0d", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 136, "avg_line_length": 45.15625, "alnum_prop": 0.7432525951557093, "repo_name": "mdonkers/AlarmListener", "id": "9db34ecb098e7884f430eb3986a8dc91605e0bb8", "size": "1445",...
import vstruct from vstruct.primitives import * KPROCESS_STATE = v_enum() KPROCESS_STATE.ProcessInMemory = 0 KPROCESS_STATE.ProcessOutOfMemory = 1 KPROCESS_STATE.ProcessInTransition = 2 KPROCESS_STATE.ProcessOutTransition = 3 KPROCESS_STATE.ProcessInSwap = 4 KPROCESS_STATE.ProcessOutSwap = 5 KPROCESS_STATE.P...
{ "content_hash": "809560fc7ad680acdebb6a4c93825be2", "timestamp": "", "source": "github", "line_count": 5137, "max_line_length": 94, "avg_line_length": 34.36791901888262, "alnum_prop": 0.6159514692888053, "repo_name": "columbia/libtrack", "id": "33ce5524eabedce821ef8e479f5075bebcef00ac", "size": "1...
from typing import List class Solution: def longestCommonPrefix(self, strs: List[str]) -> str: if len(strs) == 0: return "" if len(strs) == 1: return strs[0] common_prefix = strs[0] l_common_prefix = len(common_prefix) s_idx = 1 while s_idx < ...
{ "content_hash": "de2c2961e857900e8625fe5b56ac7969", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 63, "avg_line_length": 31.454545454545453, "alnum_prop": 0.4869942196531792, "repo_name": "y-usuzumi/survive-the-course", "id": "ff45817097c92498292d71358d09fa2c8953bbdb", ...
from numpy.random import RandomState import numpy as np __all__ = [ 'assert_is_type', 'assert_valid_percent', 'get_random_state' ] def assert_is_type(x, t): if not isinstance(x, t): raise TypeError('expected %r but got type=%s' % (t, type(x))) return x def assert_...
{ "content_hash": "8a4f9f5b8fa9e3cee2f377173d47f620", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 67, "avg_line_length": 32.714285714285715, "alnum_prop": 0.5684133915574964, "repo_name": "mbernico/snape", "id": "1983a155afac6d27373125f4cb21f0a21c6ce51e", "size": "1375"...
import sys, random, time, base64 import getopt from array import array from crypto import slowaes from crypto import rsa def _decrypt(data, pri): """ Decrypt the encrypted data collected and sent from bot Two blocks: len + enc(keyinfo) + sym_enc(data) format: 0-3 len 4 sym key type 5- key info """ ...
{ "content_hash": "643cceece240cc840f2fd019989bbd5f", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 149, "avg_line_length": 26.78787878787879, "alnum_prop": 0.6515837104072398, "repo_name": "sfluo/Mr.Bot", "id": "096ddf3507ca35eea4dd865b239fbffce179d0c3", "size": "4525",...
import os import sys import cgi from urllib2 import quote, unquote import urlparse from cStringIO import StringIO from ConfigParser import SafeConfigParser from pycsw.core.etree import etree from pycsw import oaipmh, opensearch, sru from pycsw.plugins.profiles import profile as pprofile import pycsw.plugins.outputschem...
{ "content_hash": "7144c6498d1c75ac52d0a428af05e6d5", "timestamp": "", "source": "github", "line_count": 1930, "max_line_length": 219, "avg_line_length": 46.21709844559585, "alnum_prop": 0.5569457056693461, "repo_name": "benhowell/pycsw", "id": "64e47f4525fbc646efbde6c261661a77af358920", "size": "90...
import pytest from asphalt.core.context import Context from asphalt.templating.api import TemplateRenderer from asphalt.templating.component import TemplatingComponent from asphalt.templating.renderers.jinja2 import Jinja2Renderer @pytest.mark.asyncio async def test_single_renderer(): async with Context() as ctx...
{ "content_hash": "4e1845f5d81be4e37af8869d7fb4642b", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 67, "avg_line_length": 33.36363636363637, "alnum_prop": 0.7084468664850136, "repo_name": "asphalt-framework/asphalt-templating", "id": "62f3bd0414dcdd2b87bdf0062f2bbee5d06963...
from .utils import str_list class SignalFunctionType(object): def __init__(self, type_name, signal_inputs, signal_outputs): self.type_name = type_name self.signal_inputs = set(signal_inputs) self.signal_inputs_multiple = set(s for s in signal_inputs if SignalFunctionType.is_signal_list(s)...
{ "content_hash": "396ef0fc40f218865a4d06d4bda224e2", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 111, "avg_line_length": 30.193548387096776, "alnum_prop": 0.6538461538461539, "repo_name": "CurryBoy/ProtoML-Deprecated", "id": "af42203888c2c8487acdc9512e732cc0e178167b", ...
from setuptools import setup, find_packages # see https://github.com/GaretJax/i18n-utils/blob/master/setup.py # and https://github.com/elastic/curator/blob/master/setup.py setup( name='polyglot', version='0.1', url='https://github.com/polyrabbit/polyglot', license='MIT', author='poly', author_e...
{ "content_hash": "3fdf148cfe4cb451e2bdee933717a89e", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 67, "avg_line_length": 31.956521739130434, "alnum_prop": 0.6666666666666666, "repo_name": "polyrabbit/polyglot", "id": "03cfcbd557f099aba858fdacb372ad405d449e68", "size": "...
import testtools from openstack.network.v2 import load_balancer IDENTIFIER = 'IDENTIFIER' EXAMPLE = { 'admin_state_up': True, 'description': '2', 'id': IDENTIFIER, 'listeners': '4', 'name': '5', 'operating_status': '6', 'provisioning_status': '7', 'tenant_id': '8', 'vip_address': '...
{ "content_hash": "adfdf95d07fac85b90f666f3d2433992", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 75, "avg_line_length": 36.65217391304348, "alnum_prop": 0.6518386714116251, "repo_name": "sjsucohort6/openstack", "id": "7f1dc6a0c9fa6323e1e2fe75fc8b9a15633d67c0", "size": ...
from sympycore import Algebra, Verbatim def test_basic(): a = Algebra('a') assert str(a)=='a' assert repr(a)=="Algebra('a')",`repr(a)` assert bool(a)==True assert a.as_algebra(Algebra)==a assert a.as_algebra(Verbatim)==Verbatim('a') assert Verbatim('a').as_algebra(Algebra)==a
{ "content_hash": "17e136f013f56804153a03ca82855e76", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 48, "avg_line_length": 30.6, "alnum_prop": 0.6339869281045751, "repo_name": "pearu/sympycore", "id": "1ef1206484a3bb35f348191666a12af81c70e1f8", "size": "307", "binary": ...
from T.tings.models.models_collections import TCollection from T.tings.models.models_subscriptions import TSubscription from T.tings.models.models_tings import TTing
{ "content_hash": "8b342d0374c13e4de51a72038817297f", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 61, "avg_line_length": 55, "alnum_prop": 0.8606060606060606, "repo_name": "allynt/tings", "id": "3a393ecfaef66c985ec26c35e8e335b0b4f5dedb", "size": "165", "binary": false,...
"""This code example updates content metadata key hierarchies. To determine which content metadata key hierarchies exist, run get_all_content_metadata_key_hierarchies.py. This feature is only available to Video Solutions publishers. The LoadFromStorage method is pulling credentials and properties from a "googleads.y...
{ "content_hash": "bad5d41c2e79326e25fdfa77ad1e3814", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 79, "avg_line_length": 39.3974358974359, "alnum_prop": 0.7103807354376831, "repo_name": "Aloomaio/googleads-python-lib", "id": "96f131ac7fd1ddb13e679ecc697173bee78d9262", "...
import os import sys from taran import (__title__, __version__, __author__, __copyright__) sys.path.insert(0, os.path.abspath('../lib')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add ...
{ "content_hash": "f179cb06a1dc175f065ae8b95907b707", "timestamp": "", "source": "github", "line_count": 330, "max_line_length": 80, "avg_line_length": 28.40909090909091, "alnum_prop": 0.68512, "repo_name": "jonhadfield/taran", "id": "cf73bc1374a12da222c74de9fd1dbf99e7a51703", "size": "10033", "bi...
from asyncio import coroutine from .viewset import ObjectViewSet class Ticket(ObjectViewSet): name = 'Ticket' uri_prefix = 'org.fetsy' new_object_timestamp = True new_object_schema = { "$schema": "http://json-schema.org/draft-04/schema#", "title": "New ticket", "description": ...
{ "content_hash": "e6f19be61f4e753c1b07bef28cf1f5f8", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 79, "avg_line_length": 33.205357142857146, "alnum_prop": 0.47163215918257595, "repo_name": "normanjaeckel/FeTSy", "id": "1dbeb55e4f2f8f2efd4cb8d97c94b8639ad86938", "size":...
import pytest from .. import mockhttp from ... import di, Story def test_get_mockhttp_as_dep(): story = Story() story.use(mockhttp.MockHttpInterface()) with di.child_scope(): @di.desc() class OneClass: @di.inject() def deps(self, http): self.http = ...
{ "content_hash": "f4f49eae0c3fa78ef0568f794d8b22f2", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 88, "avg_line_length": 24.41176470588235, "alnum_prop": 0.6, "repo_name": "botstory/botstory", "id": "d97efe2ff15634ad79365bca28ef764ca25d8eff", "size": "415", "binary": ...
from ggrc.models import Policy from ggrc.models import Relationship from ggrc.converters import errors from integration.ggrc.converters import TestCase from integration.ggrc.generator import ObjectGenerator class TestUnmappings(TestCase): def setUp(self): TestCase.setUp(self) self.generator = ObjectGenerat...
{ "content_hash": "8b7ce3fad4b418f4aab4e2bacbd7bc23", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 72, "avg_line_length": 32.09090909090909, "alnum_prop": 0.7662889518413598, "repo_name": "prasannav7/ggrc-core", "id": "cb7a673a4a4df4126d5212950e7681a947c212ef", "size": "...
import os import sys # internal imports import numpy as np import tensorflow as tf import ntpath import librosa from magenta.models.nsynth import utils FLAGS = tf.app.flags.FLAGS tf.app.flags.DEFINE_string("expdir", "", "The log directory for this experiment. Required if " ...
{ "content_hash": "c85eaa5a3a8da1b09958a8f8a433a4b8", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 87, "avg_line_length": 36.054054054054056, "alnum_prop": 0.6506746626686657, "repo_name": "bda2017-shallowermind/MusTGAN", "id": "1d7b2c92c7e30183bc2a1290008e0cb2da7a6aee", ...
from selenium.webdriver import Firefox from selenium.webdriver.firefox.firefox_profile import FirefoxProfile from splinter.driver.webdriver import BaseWebDriver, WebDriverElement as BaseWebDriverElement from splinter.driver.webdriver.cookie_manager import CookieManager class WebDriver(BaseWebDriver): driver_name...
{ "content_hash": "cc8dc867230386fa188e323d704cadf6", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 110, "avg_line_length": 32.88235294117647, "alnum_prop": 0.6881335718545021, "repo_name": "moorwu/CloudDataHIveSublime", "id": "be7e99d3db1ac745759d3c30b765764f4d8e1811", "...
import wx #--------------------------------------------------------------------------- class TestPanel(wx.Panel): def __init__(self, parent, log): self.log = log wx.Panel.__init__(self, parent, -1) b = wx.Button(self, -1, "Create and Show a TextEntryDialog", (50,50)) self.Bind(wx...
{ "content_hash": "dc473c647677f3c289529c156e062e1c", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 83, "avg_line_length": 27.072727272727274, "alnum_prop": 0.5271994627266622, "repo_name": "dnxbjyj/python-basic", "id": "384ed0e6e80550d9d3d5b0c33881ad58102730cb", "size": ...
from rpc import RPC, RPCReply from ncclient.xml_ import * from lxml import etree import util class GetReply(RPCReply): """Adds attributes for the *data* element to `RPCReply`.""" def _parsing_hook(self, root): self._data = None if not self._errors: self._data = root.find(qualify...
{ "content_hash": "ad2a4e66526bc98bf71440168c5522d3", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 129, "avg_line_length": 29.108843537414966, "alnum_prop": 0.6111240944145828, "repo_name": "mith1979/ansible_automation", "id": "b7d2b69257d80bff247909c23c1bcd40c60416f6", ...
import django.contrib.messages as django_messages from django.contrib.messages.storage import default_storage from django.http import HttpRequest from nose.tools import eq_ from tower import ugettext as _ from amo.messages import _make_message, info def test_xss(): title = "<script>alert(1)</script>" messa...
{ "content_hash": "47e24346bad7dc441eca017c89c43b9c", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 66, "avg_line_length": 31.714285714285715, "alnum_prop": 0.6630630630630631, "repo_name": "jinankjain/zamboni", "id": "f8060c83e2e4d61e16a51f51f8a65419427b5230", "size": "2...
from setuptools import setup, find_packages setup( name="procgen_build", packages=find_packages(), version="0.0.1", install_requires=[ # rather than rely on system cmake, install it here "cmake==3.21.3", # this is required by procgen/build.py "gym3==0.3.0", ], )
{ "content_hash": "f955a77beb68d8558fa8a033da7e2670", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 59, "avg_line_length": 22.642857142857142, "alnum_prop": 0.5962145110410094, "repo_name": "openai/procgen", "id": "efbb93ee660f9a9781813430adf9e27d4684a5b6", "size": "317",...
from naglib.config.base import * """ A representation of a nagios host""" class Host(BaseObject): TYPE = 'host' TEMPLATE_CLASS = 'host.HostTemplate' PARAMS = ( 'use', '2d_coords', '3d_coords', 'action_url', 'active_checks_enabled', 'address', 'alias'...
{ "content_hash": "c9d42f0dc7cfa737f953daedf58d7e88", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 80, "avg_line_length": 26.787037037037038, "alnum_prop": 0.5416522640857242, "repo_name": "johnskopis/naglib", "id": "db8178d9e01814225898e27739dd7e7a4f2f69af", "size": "2...