max_stars_repo_path
stringlengths
4
245
max_stars_repo_name
stringlengths
7
115
max_stars_count
int64
101
368k
id
stringlengths
2
8
content
stringlengths
6
1.03M
corehq/motech/repeaters/exceptions.py
akashkj/commcare-hq
471
81207
<reponame>akashkj/commcare-hq class RequestConnectionError(Exception): pass class ReferralError(Exception): pass class DataRegistryCaseUpdateError(Exception): pass
Validation/EcalRecHits/test/EcalFullValid_cfg.py
ckamtsikis/cmssw
852
81215
<filename>Validation/EcalRecHits/test/EcalFullValid_cfg.py # The following comments couldn't be translated into the new config version: # services import FWCore.ParameterSet.Config as cms process = cms.Process("EcalFullValid") # initialize MessageLogger process.load("FWCore.MessageLogger.MessageLogger_cfi") # init...
src/babi-lstm.py
Asteur/qa
261
81217
<reponame>Asteur/qa # -*- coding: utf-8 -*- from __future__ import division, print_function from keras.layers import Dense, Merge, Dropout, RepeatVector from keras.layers.embeddings import Embedding from keras.layers.recurrent import LSTM from keras.models import Sequential import os import babi BABI_DIR = "../data/b...
codegen_sources/model/src/model/__init__.py
AlexShypula/CodeGen
241
81224
<gh_stars>100-1000 # Copyright (c) 2019-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import math import os import sys from logging import getLogger import torch from .pretrain import load_embe...
server_python/reptile/classify.py
dkvirus/py-novel
145
81238
<filename>server_python/reptile/classify.py import requests from lxml import etree from db import Db class Classify(object): ''' 爬取首页分类数据 ''' def reptileIndexClassify(self): print('爬取首页分类数据:开始:(classify/reptileIndexClassify)...') target_url = 'https://www.biquge5200.com/modules/article/...
sightpy/materials/emissive.py
ulises1229/Python-Raytracer
326
81243
from ..utils.constants import * from ..utils.vector3 import vec3, rgb, extract from functools import reduce as reduce from ..ray import Ray, get_raycolor from .. import lights import numpy as np from . import Material from ..textures import * class Emissive(Material): def __init__(self, color, **kwargs)...
nlpaug/util/text/part_of_speech.py
techthiyanes/nlpaug
3,121
81245
<gh_stars>1000+ class PartOfSpeech: NOUN = 'noun' VERB = 'verb' ADJECTIVE = 'adjective' ADVERB = 'adverb' pos2con = { 'n': [ 'NN', 'NNS', 'NNP', 'NNPS', # from WordNet 'NP' # from PPDB ], 'v': [ 'VB', 'VBD', 'VBG', 'VBN', 'VBZ', # from ...
tests/pybaseball/test_team_batting.py
reddigari/pybaseball
650
81252
<filename>tests/pybaseball/test_team_batting.py from typing import Callable import pandas as pd import pytest import requests from pybaseball.team_batting import team_batting @pytest.fixture(name="sample_html") def _sample_html(get_data_file_contents: Callable) -> str: return get_data_file_contents('team_battin...
recipes/Python/218485_super_tuples/recipe-218485.py
tdiprima/code
2,023
81271
<filename>recipes/Python/218485_super_tuples/recipe-218485.py def superTuple(name, attributes): """Creates a Super Tuple class.""" dct = {} #Create __new__. nargs = len(attributes) def _new_(cls, *args): if len(args) != nargs: raise TypeError("%s takes %d arguments (%d given)." %...
music21/figuredBass/examples.py
cuthbertLab/music21
1,449
81284
<filename>music21/figuredBass/examples.py # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # Name: examples.py # Purpose: music21 class which allows running of test cases # Authors: <NAME> # # Copyright: Copyright © 2010-2011 <NAME> and the mu...
kuwala/pipelines/google-poi/src/pipeline/SearchScraper.py
bmahmoudyan/kuwala
381
81301
import moment import os import pandas import pyarrow as pa import pyarrow.parquet as pq import requests from func_timeout import func_set_timeout, FunctionTimedOut from pandas import DataFrame from pathlib import Path from pyspark.sql import SparkSession from pyspark.sql.functions import col, lit from pyspark.sql.types...
examples/pytorch/AxHyperOptimizationPTL/ax_hpo_mnist.py
PeterSulcs/mlflow
10,351
81368
<filename>examples/pytorch/AxHyperOptimizationPTL/ax_hpo_mnist.py import argparse import mlflow from ax.service.ax_client import AxClient from iris import IrisClassification from iris_data_module import IrisDataModule import pytorch_lightning as pl def train_evaluate(params, max_epochs=100): model = IrisClassific...
riko/modules/fetchtext.py
nerevu/riko
1,716
81378
# -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ riko.modules.fetchtext ~~~~~~~~~~~~~~~~~~~~~~ Provides functions for fetching text data sources. Accesses and extracts data from text sources on the web. This data can then be merged with other data in your Pipe. Examples: basic usage:: >>> from riko...
pyvex/lifting/util/vex_helper.py
osogi/pyvex
261
81382
<gh_stars>100-1000 import re import copy from ...const import ty_to_const_class, vex_int_class, get_type_size from ...expr import Const, RdTmp, Unop, Binop, Load, CCall, Get, ITE from ...stmt import WrTmp, Put, IMark, Store, NoOp, Exit from ...enums import IRCallee from future.utils import with_metaclass class JumpKi...
db/migrations/migration7.py
oktoshi/OpenBazaar-Server
723
81390
<reponame>oktoshi/OpenBazaar-Server import sqlite3 def migrate(database_path): print "migrating to db version 7" conn = sqlite3.connect(database_path) conn.text_factory = str cursor = conn.cursor() # create new table cursor.execute('''CREATE TABLE IF NOT EXISTS audit_shopping ( audit_sh...
src/structlog/_utils.py
bbeattie-phxlabs/structlog
1,751
81416
<reponame>bbeattie-phxlabs/structlog<filename>src/structlog/_utils.py # SPDX-License-Identifier: MIT OR Apache-2.0 # This file is dual licensed under the terms of the Apache License, Version # 2.0, and the MIT License. See the LICENSE file in the root of this # repository for complete details. """ Generic utilities. ...
learn2learn/gym/envs/particles/particles_2d.py
Brikwerk/learn2learn
1,774
81418
#!/usr/bin/env python3 import numpy as np from gym import spaces from gym.utils import seeding from learn2learn.gym.envs.meta_env import MetaEnv class Particles2DEnv(MetaEnv): """ [[Source]](https://github.com/learnables/learn2learn/blob/master/learn2learn/gym/envs/particles/particles_2d.py) **Descript...
tests/dispatcher/popart/convnet_test.py
gglin001/poptorch
128
81425
<gh_stars>100-1000 #!/usr/bin/env python3 # Copyright (c) 2021 Graphcore Ltd. All rights reserved. import torch import torch.nn as nn import poptorch import helpers def test_mnist(): # A helper block to build convolution-pool-relu blocks. class Block(nn.Module): def __init__(self, in_channels, num_fil...
changes/models/artifact.py
vault-the/changes
443
81456
<reponame>vault-the/changes from __future__ import absolute_import import uuid from datetime import datetime from sqlalchemy import Column, String, DateTime, ForeignKey from sqlalchemy.orm import relationship, backref from sqlalchemy.schema import UniqueConstraint, Index from changes.config import db from changes.db...
enaml/qt/docking/dock_resources.py
xtuzy/enaml
1,080
81476
# -*- coding: utf-8 -*- # Resource object code # # Created: Tue Jul 2 13:23:21 2013 # by: The Resource Compiler for PyQt (Qt v4.8.3) # # WARNING! All changes made in this file will be lost! # this line manually edited from enaml.qt import QtCore qt_resource_data = b"\ \x00\x00\x02\x61\ \x89\ \x50\x4e\x47\x0d\x0...
rpmvenv/rpmbuild.py
oleynikandrey/rpmvenv
150
81490
<filename>rpmvenv/rpmbuild.py """Functions for running the rpm build commands.""" from __future__ import division from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import glob import os import shlex import shutil import subprocess import sys import te...
myia/utils/variables.py
strint/myia
222
81497
"""Define variables for use in patterns all over Myia.""" from ..ir import Graph from .misc import Namespace from .unify import SVar, Var, var def constvar(cls=object): """Return a variable matching a Constant of the given type.""" def _is_c(n): return n.is_constant(cls) return var(_is_c) ###...
vta/python/vta/top/nnvm_graphpack.py
mingwayzhang/tvm
286
81534
<reponame>mingwayzhang/tvm<gh_stars>100-1000 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License,...
src/pythae/samplers/vamp_sampler/vamp_sampler_config.py
clementchadebec/benchmark_VAE
143
81544
from pydantic.dataclasses import dataclass from ...samplers import BaseSamplerConfig @dataclass class VAMPSamplerConfig(BaseSamplerConfig): """This is the VAMP prior sampler configuration instance deriving from :class:`BaseSamplerConfig`. """ pass
th_github/models.py
Leopere/django-th
1,069
81583
# coding: utf-8 from django.db import models from django_th.models.services import Services from django_th.models import TriggerService class Github(Services): """ github model to be adapted for the new service """ # put whatever you need here # eg title = models.CharField(max_length=80) ...
Python/met_brewer/__init__.py
vitusbenson/MetBrewer
570
81585
from met_brewer.palettes import ( MET_PALETTES, COLORBLIND_PALETTES_NAMES, COLORBLIND_PALETTES, met_brew, export, is_colorblind_friendly ) MET_PALETTES COLORBLIND_PALETTES_NAMES COLORBLIND_PALETTES met_brew export is_colorblind_friendly
recipes/Python/578103_Singleton_parameter_based/recipe-578103.py
tdiprima/code
2,023
81591
<reponame>tdiprima/code<gh_stars>1000+ def singleton(theClass): """ decorator for a class to make a singleton out of it """ classInstances = {} def getInstance(*args, **kwargs): """ creating or just return the one and only class instance. The singleton depends on the parameters used in ...
parsifal/apps/invites/tests/test_manage_access_view.py
ShivamPytho/parsifal
342
81610
<reponame>ShivamPytho/parsifal from django.core import mail from django.test.testcases import TestCase from django.urls import reverse from parsifal.apps.activities.constants import ActivityTypes from parsifal.apps.activities.models import Activity from parsifal.apps.authentication.tests.factories import UserFactory f...
django_extensions/management/commands/list_signals.py
KazakovDenis/django-extensions
4,057
81651
# -*- coding: utf-8 -*- # Based on https://gist.github.com/voldmar/1264102 # and https://gist.github.com/runekaagaard/2eecf0a8367959dc634b7866694daf2c import gc import inspect import weakref from collections import defaultdict from django.apps import apps from django.core.management.base import BaseCommand from djang...
python_modules/libraries/dagster-aws/dagster_aws/s3/solids.py
rpatil524/dagster
4,606
81672
# pylint: disable=unused-import # Keep module for legacy backcompat from .ops import S3Coordinate, file_handle_to_s3
setup.py
sighingnow/delocate
175
81693
<reponame>sighingnow/delocate<gh_stars>100-1000 #!/usr/bin/env python """ setup script for delocate package """ import codecs from os.path import join as pjoin import versioneer from setuptools import find_packages, setup setup( name="delocate", version=versioneer.get_version(), cmdclass=versioneer.get_cm...
pyxl/codec/html_tokenizer.py
adamserafini/pyxl
366
81708
<gh_stars>100-1000 """ A naive but strict HTML tokenizer. Based directly on http://www.w3.org/TR/2011/WD-html5-20110525/tokenization.html In the ATTRIBUTE_VALUE and BEFORE_ATTRIBUTE_VALUE states, python tokens are accepted. """ import sys from collections import OrderedDict class State(object): DATA = 1 # un...
src/pytest_recording/exceptions.py
kiwicom/pytest-recording
186
81715
<reponame>kiwicom/pytest-recording class UsageError(Exception): """Error in plugin usage.""" __module__ = "builtins"
preql/__main__.py
erezsh/Preql
522
81734
<reponame>erezsh/Preql import json import argparse from pathlib import Path from itertools import chain import time from . import Preql, __version__, Signal from . import settings parser = argparse.ArgumentParser(description='Preql command-line interface (aka REPL)') parser.add_argument('-i', '--interactive', action=...
test/test_neg_examples.py
michael-harris/zincbase
298
81748
<reponame>michael-harris/zincbase """Test negative examples using Countries. The main idea here is that if we explicitly enter some false facts (signalling to the KB that they are false, it should make less-wrong predictions for them, versus just going by its own synthetic negative examples.) It may have the side eff...
Basic/Check if A String is Palindrome or Not/SolutionByIshleen.py
rajethanm4/Programmers-Community
261
81773
# program checks if the string is palindrome or not. def function(string): if(string == string[:: - 1]): print("This is a Palindrome String") else: print("This is Not a Palindrome String") string = input("Please enter your own String : ") function(string)
pyvisa/ctwrapper/types.py
jpsecher/pyvisa
393
81786
# -*- coding: utf-8 -*- """VISA VPP-4.3 data types (VPP-4.3.2 spec, section 3) using ctypes constants. This file is part of PyVISA. All data types that are defined by VPP-4.3.2. The module exports all data types including the pointer and array types. This means "ViUInt32" and such. :copyright: 2014-2020 by PyVISA ...
src/dispatch/plugins/dispatch_test/storage.py
roor0/dispatch
3,417
81791
from dispatch.plugins.bases import StoragePlugin class TestStoragePlugin(StoragePlugin): title = "Dispatch Test Plugin - Storage" slug = "test-storage" def get(self, **kwargs): return def create(self, items, **kwargs): return def update(self, items, **kwargs): return ...
homeassistant/components/hp_ilo/__init__.py
domwillcode/home-assistant
30,023
81801
<reponame>domwillcode/home-assistant<filename>homeassistant/components/hp_ilo/__init__.py<gh_stars>1000+ """The HP Integrated Lights-Out (iLO) component."""
examples/pytorch/fx/object_detection/maskrcnn/pytorch/maskrcnn_benchmark/utils/collect_env.py
intelkevinputnam/lpot-docs
567
81822
<reponame>intelkevinputnam/lpot-docs<gh_stars>100-1000 # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # 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...
qiskit/algorithms/phase_estimators/ipe.py
t-imamichi/qiskit-core
1,456
81823
<reponame>t-imamichi/qiskit-core # This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # A...
django_dynamic_fixture/tests/test_django_helper.py
Kaniabi/django-dynamic-fixture
190
81834
# -*- coding: utf-8 -*- from django.test import TestCase from django.db import models import pytest from django_dynamic_fixture import N, G from django_dynamic_fixture.models_test import * from django_dynamic_fixture.django_helper import * class DjangoHelperAppsTest(TestCase): def test_get_apps_must_return_all_...
src/pymap3d/__init__.py
scivision/pymap3d
108
81849
""" PyMap3D provides coordinate transforms and geodesy functions with a similar API to the Matlab Mapping Toolbox, but was of course independently derived. For all functions, the default units are: distance : float METERS angles : float DEGREES time : datetime.datetime UTC time of observation These funct...
tests/storage/test_local.py
operatorai/modelstore
151
81856
# Copyright 2020 <NAME> # # 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...
test/test_pyiter.py
ssameerr/pytubes
166
81869
import itertools import pytest import tubes def test_static_tube_takes_a_list(): tube = tubes.Each([1, 2, 3]) assert list(tube) == [1, 2, 3] def test_static_tube_takes_an_iter(): tube = tubes.Each(itertools.count(10)).first(3) assert list(tube) == [10, 11, 12] def test_static_tube_with_strings()...
Server/integrations/privacyidea/privacyidea.py
premeau/oxAuth
380
81870
<reponame>premeau/oxAuth # -*- coding: utf-8 -*- # # privacyIDEA is a Multi-Factor-Management system that supports # a wide variety of different tokentypes like smartphone apps, key fob tokens, # yubikeys, u2f, fido2, email, sms... # The administrator of an organization can manage the 2nd factors of the # users central...
ztag/annotations/FtpSharp.py
justinbastress/ztag
107
81875
<filename>ztag/annotations/FtpSharp.py import re from ztag.annotation import Annotation from ztag.annotation import OperatingSystem from ztag.annotation import Type from ztag.annotation import Manufacturer from ztag import protocols import ztag.test class FtpSharp(Annotation): protocol = protocols.FTP subprot...
043_face_landmark/lib/helper/init.py
IgiArdiyanto/PINTO_model_zoo
1,529
81884
<filename>043_face_landmark/lib/helper/init.py import tensorflow as tf def init(*args): if len(args)==1: use_pb=True pb_path=args[0] else: use_pb=False meta_path=args[0] restore_model_path=args[1] def ini_ckpt(): graph = tf.Graph() graph.as_default...
test/example-jit.py
KennethNielsen/llvmpy
140
81903
<reponame>KennethNielsen/llvmpy<filename>test/example-jit.py #!/usr/bin/env python # Import the llvm-py modules. from llvm import * from llvm.core import * from llvm.ee import * # new import: ee = Execution Engine import logging import unittest class TestExampleJIT(unittest.TestCase): def test_example_...
tests/test_match.py
themadsens/qfc
600
81908
<filename>tests/test_match.py<gh_stars>100-1000 import sys import os sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)),'..')) from qfc.core import filter_files, get_weight def _equals(marks_list1, marks_list2): l1 = sorted(marks_list1) l2 = sorted(marks_list2) if len(l1) != len(l2): return F...
release/stubs/System/Windows/Forms/VisualStyles.py
htlcnn/ironpython-stubs
182
81910
# encoding: utf-8 # module System.Windows.Forms.VisualStyles calls itself VisualStyles # from System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 # by generator 1.145 """ NamespaceTracker represent a CLS namespace. """ # no imports # no functions # classes class Backgroun...
sleepypuppy/collector/views.py
soffensive/sleepy-puppy
952
81912
# Copyright 2015 Netflix, 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 the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
src/amuse/community/ph4/util/initialize_system.py
rknop/amuse
131
81914
<gh_stars>100-1000 import collections import getopt import numpy import os import random import sys import unittest import pickle from time import clock from time import gmtime from time import mktime from amuse.community.ph4.interface import ph4 as grav from amuse.community.smalln.interface import SmallN from amuse....
packages/pyright-internal/src/tests/samples/memberAccess17.py
Jasha10/pyright
3,934
81932
# This sample tests the case where a __getattr__ method override # differentiates based on the name of the accessed member. from typing import Any, overload, Literal class Obj: @overload def __getattr__(self, name: Literal["foo"]) -> int: ... @overload def __getattr__(self, name: Literal["ba...
extstats/utils/elastic.py
bakl/chrome-extensions-archive
408
81984
from datetime import datetime from elasticsearch_dsl import DocType, String, Date, Integer, Float from elasticsearch_dsl.connections import connections # Define a default Elasticsearch client connections.create_connection(hosts=['localhost']) class Extension(DocType): name = String() url = String() descri...
spikeinterface/widgets/depthamplitude.py
JuliaSprenger/spikeinterface
116
81987
<filename>spikeinterface/widgets/depthamplitude.py import numpy as np from matplotlib import pyplot as plt from .basewidget import BaseWidget from ..toolkit import get_template_extremum_channel, get_template_extremum_amplitude from .utils import get_unit_colors class UnitsDepthAmplitudeWidget(BaseWidget): def _...
dnachisel/DnaOptimizationProblem/__init__.py
simone-pignotti/DnaChisel
124
81988
<reponame>simone-pignotti/DnaChisel from .NoSolutionError import NoSolutionError from .DnaOptimizationProblem import DnaOptimizationProblem from .CircularDnaOptimizationProblem import CircularDnaOptimizationProblem __all__ = [ "NoSolutionError", "DnaOptimizationProblem", "CircularDnaOptimizationProblem" ]
parlai/tasks/msc/constants.py
twstewart42/ParlAI
9,228
81992
<reponame>twstewart42/ParlAI #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. INITIAL_DATA_TO_COMPLETE = [ 'valid_0', 'valid_1', 'valid_10', 'valid_100'...
1-XD_XD/code/v9s.py
sethahrenbach/BuildingDetectors_Round2
196
82017
# -*- coding: utf-8 -*- """ v9s model * Input: v5_im Author: Kohei <<EMAIL>> """ from logging import getLogger, Formatter, StreamHandler, INFO, FileHandler from pathlib import Path import subprocess import argparse import math import glob import sys import json import re import warnings import scipy import tqdm impo...
sfaira/models/made.py
johnmous/sfaira
110
82034
from random import randint import numpy as np try: import tensorflow as tf except ImportError: tf = None # ToDo: we are using a lot of tf.keras.backend modules below, can we use tf core instead? class MaskingDense(tf.keras.layers.Layer): """ Just copied code from keras Dense layer and added masking and ...
Clients/PythonCatalyst/Testing/package_test/__init__.py
xj361685640/ParaView
815
82042
<gh_stars>100-1000 # filename: __init__.py # used to test that Catalyst can load Packages # correctly. from paraview.simple import * from paraview import print_info # print start marker print_info("begin '%s'", __name__) tracker = {} def count(f): def wrapper(*args, **kwargs): global tracker c = ...
bindings/kepler.gl-jupyter/setup.py
Rikuoja/kepler.gl
4,297
82097
from __future__ import print_function from distutils import log from setuptools import setup, find_packages import os from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, combine_commands, get_version, skip_if_exists ) # Name of the project name = 'keplergl' here = os...
var/spack/repos/builtin/packages/py-dm-tree/package.py
LiamBindle/spack
2,360
82115
<gh_stars>1000+ # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import tempfile class PyDmTree(PythonPackage): """tree is a library for working with nested data str...
tests/test_reweighting.py
JannikWirtz/importance-sampling-diagnostics
289
82118
<filename>tests/test_reweighting.py # # Copyright (c) 2017 Idiap Research Institute, http://www.idiap.ch/ # Written by <NAME> <<EMAIL>> # import unittest from keras.layers import Input from keras.models import Model import numpy as np from importance_sampling.reweighting import BiasedReweightingPolicy, \ NoRewei...
src/nginx/config/headers/uwsgi_param.py
sixninetynine/nginx-config-builder
149
82122
<filename>src/nginx/config/headers/uwsgi_param.py # Generic uwsgi_param headers CONTENT_LENGTH = 'CONTENT_LENGTH' CONTENT_TYPE = 'CONTENT_TYPE' DOCUMENT_ROOT = 'DOCUMENT_ROOT' QUERY_STRING = 'QUERY_STRING' PATH_INFO = 'PATH_INFO' REMOTE_ADDR = 'REMOTE_ADDR' REMOTE_PORT = 'REMOTE_PORT' REQUEST_METHOD = 'REQUEST_METHOD'...
DataProcessor/Feature/em_dependency_feature.py
Milozms/feedforward-RE
156
82126
<reponame>Milozms/feedforward-RE __author__ = 'wenqihe' from abstract_feature import AbstractFeature from em_token_feature import EMHeadFeature, get_lemma class EMDependencyFeature(AbstractFeature): accepted_deps=[ "nn", "agent", "dobj", "nsubj", "amod", "nsubjpass", "poss", "appos"] """ Universal Depen...
examples/finished/kmedian.py
gasse/PySCIPOpt
311
82129
##@file kmedian.py #@brief model for solving the k-median problem. """ minimize the total (weighted) travel cost for servicing a set of customers from k facilities. Copyright (c) by <NAME> and <NAME>, 2012 """ import math import random from pyscipopt import Model, quicksum, multidict def kmedian(I,J,c,k): """kmed...
pyeda/parsing/dimacs.py
ivotimev/pyeda
196
82148
<filename>pyeda/parsing/dimacs.py<gh_stars>100-1000 """ DIMACS For more information on the input formats, see "Satisfiability Suggested Format", published May 1993 by the Rutgers Center for Discrete Mathematics (DIMACS). Also, see the proceedings of the International SAT Competition (http://www.satcompetition.org) fo...
modules/exploitation/kingphisher.py
decidedlygray/ptf
4,391
82160
<gh_stars>1000+ #!/usr/bin/env python ###################################### # Installation module for King Phisher ###################################### # AUTHOR OF MODULE NAME AUTHOR="<NAME> (@zeroSteiner)" # DESCRIPTION OF THE MODULE DESCRIPTION="This module will install/update the King Phisher phishing campaign ...
sktime/transformations/series/compose.py
marcio55afr/sktime
5,349
82164
<reponame>marcio55afr/sktime<filename>sktime/transformations/series/compose.py #!/usr/bin/env python3 -u # -*- coding: utf-8 -*- # copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Meta-transformers for building composite transformers.""" import pandas as pd from sktime.transformations.base impo...
lvsr/ops.py
Fatman003/Actor
178
82169
from __future__ import print_function import math import numpy import theano import itertools from theano import tensor, Op from theano.gradient import disconnected_type from fuel.utils import do_not_pickle_attributes from picklable_itertools.extras import equizip from collections import defaultdict, deque from toposo...
tools/autograd/nested_dict.py
wenhaopeter/read_pytorch_code
206
82178
# TODO: refactor nested_dict into common library with ATen class nested_dict(object): """ A nested dict is a dictionary with a parent. If key lookup fails, it recursively continues into the parent. Writes always happen to the top level dict. """ def __init__(self, base, parent): self....
lightautoml/automl/base.py
kobylkinks/LightAutoML
766
82183
"""Base AutoML class.""" import logging from typing import Any from typing import Dict from typing import Iterable from typing import List from typing import Optional from typing import Sequence from ..dataset.base import LAMLDataset from ..dataset.utils import concatenate from ..pipelines.ml.base import MLPipeline ...
WebMirror/management/rss_parser_funcs/feed_parse_extractBersekerTranslations.py
fake-name/ReadableWebProxy
193
82278
def extractBersekerTranslations(item): """ """ vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if 'Because the world has changed into a death game is funny' in item['tags'] and (chp or vol or 'Prologue' in postfix): return buildReleaseMessageWithType(item, 'Sekai ga death game ni natta ...
tests/unit/test_utils.py
Avi-Labs/taurus
1,743
82282
<filename>tests/unit/test_utils.py # coding=utf-8 """ unit test """ import os import sys import logging from psutil import Popen from os.path import join from bzt import TaurusNetworkError from bzt.utils import log_std_streams, get_uniq_name, JavaVM, ToolError, is_windows, HTTPClient, BetterDict from bzt.utils import...
workloads/examples/k8s/kubeflow-pipeline-deploy/triton.py
mkunin-nvidia/deepops
748
82320
#!/usr/bin/env python3 ''' Kubeflow documentation: https://kubeflow-pipelines.readthedocs.io/en/latest/_modules/kfp/dsl/_container_op.html K8S documentation: https://github.com/kubernetes-client/python/blob/02ef5be4ecead787961037b236ae498944040b43/kubernetes/docs/V1Container.md Example Triton Inference Server Mod...
tencentcloud/asr/v20190614/errorcodes.py
PlasticMem/tencentcloud-sdk-python
465
82323
# -*- coding: utf8 -*- # Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. All Rights Reserved. # # 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...
lstm_classifier/combined/utils.py
undeadyequ/ser_model
217
82358
<reponame>undeadyequ/ser_model import torch import pickle import numpy as np import pandas as pd from config import model_config as config from sklearn.metrics import confusion_matrix, accuracy_score, f1_score, precision_score, recall_score import itertools import matplotlib.pyplot as plt def load_data(batched=True...
promgen/migrations/0011_notifier_counts.py
kackey0-1/promgen
913
82384
<reponame>kackey0-1/promgen # Generated by Django 2.2.4 on 2019-11-28 02:21 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('promgen', '0010_app_label_migration'), ] operations = [ migrations.AddField( ...
examples/initialization_schemes/gaussian.py
uaca/deepy
260
82385
<reponame>uaca/deepy #!/usr/bin/env python # -*- coding: utf-8 -*- import os from util import run from deepy.utils import GaussianInitializer model_path = os.path.join(os.path.dirname(__file__), "models", "gaussian1.gz") if __name__ == '__main__': # I have to set std to be 0.1 in this case, or it will not conver...
tests/unit/test_parse.py
joye1503/cocrawler
166
82395
<reponame>joye1503/cocrawler from bs4 import BeautifulSoup import cocrawler.parse as parse from cocrawler.urls import URL test_html = ''' <html> <head><title>Foo</title><link href='link.html'></link></head> <body> <a href = "foo1.html">Anchor 1</a> <a href = foo2.htm>Anchor 2</a> <a href='foo3.html '>Anchor 3</a> <...
pyez/load_temp_conf.py
rsmekala/junosautomation
117
82459
<filename>pyez/load_temp_conf.py<gh_stars>100-1000 from jnpr.junos import Device from jnpr.junos.utils.config import Config import yaml dev = Device(host='xxxx', user='demo', password='<PASSWORD>', gather_facts=False) dev.open() data = yaml.load(open('protocol_data.yml')) cu = Config(dev) cu.load(template_path='pro...
alphamind/data/winsorize.py
rongliang-tech/alpha-mind
186
82466
<reponame>rongliang-tech/alpha-mind # -*- coding: utf-8 -*- """ Created on 2017-4-25 @author: cheng.li """ import numba as nb import numpy as np from alphamind.utilities import aggregate from alphamind.utilities import array_index from alphamind.utilities import group_mapping from alphamind.utilities import simple_m...
tracardi/process_engine/action/v1/metrics/key_counter/model/configuration.py
bytepl/tracardi
153
82476
<gh_stars>100-1000 from typing import Union, List from pydantic import BaseModel class Configuration(BaseModel): key: Union[str, List[str]] save_in: str
pygears/typing/array.py
bogdanvuk/pygears
120
82478
<filename>pygears/typing/array.py from .base import EnumerableGenericMeta, typeof, is_type, TemplateArgumentsError from .base import class_and_instance_method # TODO: Check why array is specified when no length is specified class ArrayType(EnumerableGenericMeta): def __new__(cls, name, bases, namespace, args=Non...
models/convfc.py
bhairavmehta95/dnn-mode-connectivity
182
82482
<gh_stars>100-1000 import math import torch.nn as nn import curves __all__ = [ 'ConvFC', ] class ConvFCBase(nn.Module): def __init__(self, num_classes): super(ConvFCBase, self).__init__() self.conv_part = nn.Sequential( nn.Conv2d(3, 32, kernel_size=5, padding=2), nn....
zilencer/migrations/0014_cleanup_pushdevicetoken.py
TylerPham2000/zulip
17,004
82485
# Generated by Django 1.11.14 on 2018-10-10 22:52 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("zilencer", "0013_remove_customer_billing_user"), ] operations = [ migrations.AlterUniqueTogether( name="remotepushdevicetoken", ...
examples/showcase/src/demos_widgets/fileUpload.py
takipsizad/pyjs
739
82547
<gh_stars>100-1000 """ The ``ui.FileUpload`` class implements a file uploader widget. The FileUpload widget must be inside a ``ui.FormPanel`` which is used to submit the HTML form to the server. Note that you must set the form encoding and method like this: self.form.setEncoding(FormPanel.ENCODING_MULTIPART)...
tools/pydev/movifier.py
xdr1000/https-github.com-intercept-intercept
166
82549
<filename>tools/pydev/movifier.py # ****************************************************************************************************************** # **************************************************** movefier **************************************************** # ********************************************...
python-scipy-cluster-optimize/cluster_sms_spam.py
syberflea/materials
3,682
82553
<reponame>syberflea/materials """ Clustering example using an SMS spam dataset with SciPy. Associated with the Real Python article Scientific Python: Using SciPy for Optimization Available at: https://realpython.com/python-scipy-cluster-optimize/ """ from pathlib import Path import numpy as np from scipy.cluster.vq im...
challenge_1/python/sysek/src/reverse.py
rchicoli/2017-challenges
271
82556
def reverse(string): return string[::-1] print('Gimmie some word') s = input() print(reverse(s))
nova/keymgr/conf_key_mgr.py
zjzh/nova
1,874
82577
<reponame>zjzh/nova<filename>nova/keymgr/conf_key_mgr.py # Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory # All Rights Reserved. # # 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 ...
Giveme5W1H/extractor/tools/file/writer.py
bkrrr/Giveme5W
410
82600
<reponame>bkrrr/Giveme5W import json import pickle import os from Giveme5W1H.extractor.candidate import Candidate from Giveme5W1H.extractor.configuration import Configuration as Config class Writer: """ Helper to write prickles and json representations of documents There is no way to convert a json back...
import/elftools/dwarf/aranges.py
seemoo-lab/polypyus_pdom
1,358
82606
<gh_stars>1000+ #------------------------------------------------------------------------------- # elftools: dwarf/aranges.py # # DWARF aranges section decoding (.debug_aranges) # # <NAME> (<EMAIL>) # This code is in the public domain #------------------------------------------------------------------------------- impo...
src/sage/interfaces/tachyon.py
UCD4IDS/sage
1,742
82619
<filename>src/sage/interfaces/tachyon.py r""" The Tachyon Ray Tracer AUTHOR: - <NAME> """ #***************************************************************************** # Copyright (C) 2006 <NAME> # # Distributed under the terms of the GNU General Public License (GPL) # as published by the Free Software Foun...
Trakttv.bundle/Contents/Libraries/Shared/plugin/scrobbler/methods/__init__.py
disrupted/Trakttv.bundle
1,346
82638
from plugin.scrobbler.methods.s_logging import Logging from plugin.scrobbler.methods.s_websocket import WebSocket __all__ = ['Logging', 'WebSocket']
pyjswidgets/pyjamas/ui/TextBoxBase.mshtml.py
takipsizad/pyjs
739
82651
<gh_stars>100-1000 class TextBoxBase(FocusWidget): def getCursorPos(self): try : elem = self.getElement() tr = elem.document.selection.createRange() if tr.parentElement().uniqueID != elem.uniqueID: return -1 return -tr.move("character", -65535)...
simdeblur/dataset/__init__.py
ljzycmd/SimDeblur
190
82671
from .dvd import DVD from .gopro import GOPRO from .reds import REDS # from .build import build_dataset, list_datasets __all__ = [k for k in globals().keys() if not k.startswith("_")]
downstream/Up-Down_VC/scripts/hdf5_2_bufile.py
alfred100p/VC-R-CNN
344
82682
import h5py import numpy as np file = h5py.File('/data2/wt/openimages/vc_feature/1coco_train_all_bu_2.hdf5', 'r') for keys in file: feature = file[keys]['feature'][:] np.save('/data2/wt/openimages/vc_feature/coco_vc_all_bu/'+keys+'.npy', feature)
Kerning/New Tab with Overkerns.py
justanotherfoundry/Glyphs-Scripts
283
82686
<filename>Kerning/New Tab with Overkerns.py #MenuTitle: New Tab with Overkerned Pairs # -*- coding: utf-8 -*- from __future__ import division, print_function, unicode_literals __doc__=""" Asks a threshold percentage, and opens a new tab with all kern pairs going beyond the width threshold. """ import vanilla class Fi...