max_stars_repo_path
string
max_stars_repo_name
string
max_stars_count
int64
id
string
content
string
add_param_types
int64
add_return_types
int64
add_class_field_types
int64
add_instance_field_types
int64
add_total
int64
add_error
int64
scripts/to-cleanup/deploy_protocol.py
DryptoBZX/contractsV2
177
1614566
<gh_stars>100-1000 #!/usr/bin/python3 from brownie import * from brownie.network.contract import InterfaceContainer from brownie.network.state import _add_contract, _remove_contract import shared from munch import Munch deploys = Munch.fromDict({ "bZxProtocol": True, "PriceFeeds": True, "SwapsImpl": True...
0
0
0
0
0
0
examples/plot_feature_importance.py
ktanishqk/py-earth
360
1614569
""" =========================== Plotting feature importance =========================== A simple example showing how to compute and display feature importances, it is also compared with the feature importances obtained using random forests. Feature importance is a measure of the effect of the features on the outputs....
0
0
0
0
0
0
projects/data_generation/synthetic_multi_view_facial_image_generation/algorithm/Rotate_and_Render/models/networks/__init__.py
ESOGU-SRLAB/opendr
217
1614609
<filename>projects/data_generation/synthetic_multi_view_facial_image_generation/algorithm/Rotate_and_Render/models/networks/__init__.py import torch from algorithm.Rotate_and_Render.models.networks.base_network import BaseNetwork from algorithm.Rotate_and_Render.models.networks import loss from algorithm.Rotate_and_Ren...
0
0
0
0
0
0
scripts/preprocess_ef.py
Irlirion/ocp
242
1614613
<gh_stars>100-1000 """ Creates LMDB files with extracted graph features from provided *.extxyz files for the S2EF task. """ import argparse import glob import multiprocessing as mp import os import pickle import random import sys import ase.io import lmdb import numpy as np import torch from tqdm import tqdm from oc...
0
0
0
0
0
0
tools/metrics/histograms/validate_obsolete_histograms.py
Ron423c/chromium
575
1614620
#!/usr/bin/env python # Copyright 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Verifies that all the histograms in obsolete histograms XML are obsolete.""" import logging import os import sys import xml.dom.mini...
0
1
0
0
1
0
test.py
RiCrypto/devpy-i3-py
255
1614629
<filename>test.py import i3 import unittest import platform py3 = platform.python_version_tuple() > ('3',) class ParseTest(unittest.TestCase): def setUp(self): self.msg_types = ['get_tree', 4, '4'] self.event_types = ['output', 1, '1'] def test_msg_parse(self): msg_types = [] ...
0
0
0
0
0
0
scripts/automation/trex_control_plane/interactive/trex/wireless/services/ap/ap_service.py
timgates42/trex-core
956
1614634
<gh_stars>100-1000 import simpy import threading import time import struct from wireless.services.trex_wireless_device_service import WirelessDeviceService from wireless.utils.utils import SynchronizedStore from scapy.contrib.capwap import CAPWAP_PKTS, capwap_result_codes class APService(WirelessDeviceService): "...
0
0
0
0
0
0
deprecated/dataloaders/deprecated_examples/multimedia/avmnist_MVAE_mixed.py
kapikantzari/MultiBench
148
1614635
from objective_functions.recon import elbo_loss, sigmloss1dcentercrop from unimodals.MVAE import LeNetEncoder, DeLeNet from training_structures.MVAE_mixed import train_MVAE, test_MVAE from datasets.avmnist.get_data import get_dataloader import torch from torch import nn from unimodals.common_models import MLP from fusi...
0
0
0
0
0
0
modules/audio_processing/test/py_quality_assessment/quality_assessment/simulation.py
gaoxiaoyang/webrtc
851
1614647
<filename>modules/audio_processing/test/py_quality_assessment/quality_assessment/simulation.py # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional inte...
0
0
0
0
0
0
akshare/charity/__init__.py
lisong996/akshare
4,202
1614656
# -*- coding:utf-8 -*- #!/usr/bin/env python """ Date: 2020/2/21 16:03 Desc: """
0
0
0
0
0
0
algorithms/momentum_2d.py
Gautam-J/ML-Sklearn
415
1614658
from .gradient_descent_2d import GradientDescent2D class Momentum2D(GradientDescent2D): def __init__(self, alpha: float=3e-2, max_iterations: int=150, start_point: float=1.0, epsilon: float=1e-3, momentum: float=0.3, random: bool=False): self.momentum = momentum super().__init_...
6
0
0
0
6
0
tests/components/fireservicerota/__init__.py
tbarbette/core
30,023
1614661
<filename>tests/components/fireservicerota/__init__.py """Tests for the FireServiceRota integration."""
0
0
0
0
0
0
preprocessing/generate_landmarks.py
huangjiadidi/dfdc_deepfake_challenge
499
1614671
import argparse import os from functools import partial from multiprocessing.pool import Pool os.environ["MKL_NUM_THREADS"] = "1" os.environ["NUMEXPR_NUM_THREADS"] = "1" os.environ["OMP_NUM_THREADS"] = "1" from tqdm import tqdm import cv2 cv2.ocl.setUseOpenCL(False) cv2.setNumThreads(0) from preprocessing.utils ...
0
1
0
0
1
0
src/warp/yul/VariableInliner.py
sambarnes/warp
414
1614672
from __future__ import annotations from typing import Dict, List, Optional, Tuple, Union import warp.yul.ast as ast from warp.yul.AstMapper import AstMapper Scope = Dict[str, Optional[ast.Literal]] class VariableInliner(AstMapper): """This class inlines the value of variables by tracking their values acros...
9
7
0
1
17
0
netbox/dcim/tables/sites.py
salvapinyol/netbox
4,994
1614682
<gh_stars>1000+ import django_tables2 as tables from dcim.models import Location, Region, Site, SiteGroup from tenancy.tables import TenantColumn from utilities.tables import ( BaseTable, ButtonsColumn, ChoiceFieldColumn, LinkedCountColumn, MarkdownColumn, MPTTColumn, TagColumn, ToggleColumn, ) from .template_code...
0
0
0
0
0
0
tests/risk/test_risk_period.py
lv-cha/zipline-chinese
606
1614685
# # Copyright 2013 Quantopian, 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 or agreed to in wr...
0
1
0
0
1
0
examples/pitch_plots/plot_lines.py
ThomasSeidl/mplsoccer
157
1614686
""" ===================== Pass plot using lines ===================== This example shows how to plot all passes from a team in a match as lines. """ import matplotlib.pyplot as plt from matplotlib import rcParams from mplsoccer import Pitch, VerticalPitch, FontManager from mplsoccer.statsbomb import read_event, EVEN...
0
0
0
0
0
0
setup.py
HarshTrivedi/tnt
120
1614694
<gh_stars>100-1000 #!/usr/bin/env python import os import shutil import sys from setuptools import setup, find_packages VERSION = '0.0.4' long_description = "Simple tools for logging and visualizing, loading and training" setup_info = dict( # Metadata name='torchnet', version=VERSION, author='PyTorch...
0
0
0
0
0
0
integrations/fastapi/test_project_fastapi.py
apjanco/projects
823
1614715
import pytest from spacy.cli.project.run import project_run from spacy.cli.project.assets import project_assets from pathlib import Path @pytest.mark.skip(reason="Import currently fails") def test_fastapi_project(): root = Path(__file__).parent project_assets(root) project_run(root, "install", capture=Tru...
0
0
0
0
0
0
pynes/tests/movingsprite_translated_test.py
timgates42/pyNES
1,046
1614726
<reponame>timgates42/pyNES from pynes.tests import HexTestCase from pynes.compiler import lexical, syntax, semantic from pynes.cartridge import Cartridge ''' from pynes.examples.movingsprite_translated import game class MovingSpriteTranslatedTest(HexTestCase): def __init__(self, testname): super(MovingS...
0
0
0
0
0
0
source/lark/ast_utils.py
evandrocoan/pushdown
2,653
1614757
""" Module of utilities for transforming a lark.Tree into a custom Abstract Syntax Tree """ import inspect, re import types from typing import Optional, Callable from lark import Transformer, v_args class Ast: """Abstract class Subclasses will be collected by `create_transformer()` """ pass cla...
3
2
0
0
5
0
yawast/main.py
Prodject/yawast
200
1614771
<gh_stars>100-1000 # Copyright (c) 2013 - 2020 <NAME> and Contributors. # This file is part of YAWAST which is released under the MIT license. # See the LICENSE file or go to https://yawast.org/license/ for full license details. import gc import locale import platform import signal import ssl import sys import thre...
0
0
0
0
0
0
lib/python/treadmill/trace/app/events.py
bretttegartms/treadmill
133
1614796
<gh_stars>100-1000 """App trace events. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import abc import enum # pylint: disable=wrong-import-order import logging from .. import _events _LOGGER = logging.getLog...
0
0
0
0
0
0
esphome/components/mpu6886/sensor.py
OttoWinter/esphomeyaml
249
1614799
import esphome.codegen as cg import esphome.config_validation as cv from esphome.components import i2c, sensor from esphome.const import ( CONF_ID, CONF_TEMPERATURE, DEVICE_CLASS_TEMPERATURE, ICON_BRIEFCASE_DOWNLOAD, STATE_CLASS_MEASUREMENT, UNIT_METER_PER_SECOND_SQUARED, ICON_SCREEN_ROTATIO...
0
0
0
0
0
0
meraki/api/batch/__init__.py
GameMaster47/dashboard-api-python
236
1614804
from .organizations import ActionBatchOrganizations from .networks import ActionBatchNetworks from .devices import ActionBatchDevices from .appliance import ActionBatchAppliance from .camera import ActionBatchCamera from .cellularGateway import ActionBatchCellularGateway from .insight import ActionBatchInsight f...
0
0
0
0
0
0
utils/lit/tests/xunit-output.py
GoSSIP-SJTU/TripleDoggy
171
1614829
<gh_stars>100-1000 # Check xunit output # RUN: %{lit} --xunit-xml-output %t.xunit.xml %{inputs}/test-data # RUN: FileCheck < %t.xunit.xml %s # CHECK: <?xml version="1.0" encoding="UTF-8" ?> # CHECK: <testsuites> # CHECK: <testsuite name='test-data' tests='1' failures='0'> # CHECK: <testcase classname='test-data.test-d...
0
0
0
0
0
0
pypy/module/_minimal_curses/fficurses.py
nanjekyejoannah/pypy
333
1614850
<filename>pypy/module/_minimal_curses/fficurses.py """ The ffi for rpython """ from rpython.rtyper.lltypesystem import rffi, lltype from rpython.rtyper.tool import rffi_platform from rpython.translator.tool.cbuild import ExternalCompilationInfo def try_cflags(): yield ExternalCompilationInfo(includes=['curses.h',...
0
0
0
0
0
0
generate/lib/run-firefox/cuddlefish/bunch.py
flamencist/browser-extensions
102
1614858
<filename>generate/lib/run-firefox/cuddlefish/bunch.py # Taken from Paver's paver.options module. class Bunch(dict): """A dictionary that provides attribute-style access.""" def __repr__(self): keys = self.keys() keys.sort() args = ', '.join(['%s=%r' % (key, self[key]) for key in keys]...
0
0
0
0
0
0
yyets/management/ui.py
kuyacai/YYeTsBot
9,250
1614861
<filename>yyets/management/ui.py<gh_stars>1000+ #!/usr/local/bin/python3 # coding: utf-8 # YYeTsBot - ui.py # 2/8/21 17:55 # __author__ = "Benny <<EMAIL>>" import json import time import PySimpleGUI as sg # All the stuff inside your window. channel_map = { "movie": "电影", "tv": "电视剧" } complete = { "st...
0
0
0
0
0
0
ichnaea/api/config.py
mikiec84/ichnaea
348
1614864
<gh_stars>100-1000 """ API related view configuration. """ def configure_api(config): """Configure API related views and set up routes.""" from ichnaea.api.locate.views import LocateV1View, RegionV1View from ichnaea.api.submit.views import SubmitV0View, SubmitV1View, SubmitV2View LocateV1View.configu...
0
0
0
0
0
0
example.py
www516717402/Minimal-IK
213
1614891
from solver import * from armatures import * from models import * import numpy as np import config np.random.seed(20160923) pose_glb = np.zeros([1, 3]) # global rotation ########################## mano settings ######################### n_pose = 12 # number of pose pca coefficients, in mano the maximum is 45 n_shap...
0
0
0
0
0
0
dataset/DeepFakes/faceswap-master/lib/gui/display_graph.py
MrThiago/FaceForensics
1,930
1614909
#!/usr/bin python3 """ Graph functions for Display Frame of the Faceswap GUI """ import datetime import os import tkinter as tk from tkinter import ttk from math import ceil, floor import matplotlib matplotlib.use("TkAgg") import matplotlib.animation as animation from matplotlib import pyplot as plt, style from matpl...
2
6
0
4
12
0
tests/orders_test.py
zhangted/tda-api
986
1614927
import unittest from tda.orders.common import * from tda.orders.equities import * from .utils import has_diff, no_duplicates import imp from unittest.mock import patch class EquityOrderBuilderLegacy(unittest.TestCase): def test_import_EquityOrderBuilder(self): import sys assert sys.version_info...
0
0
0
0
0
0
migrations/versions/29097876c7e6_.py
majdal/tasking-manager
421
1614939
"""empty message Revision ID: 29097876c7e6 Revises: f26a7c36eb65 Create Date: 2019-12-04 11:21:42.622908 """ from alembic import op # revision identifiers, used by Alembic. revision = "29097876c7e6" down_revision = "f26a7c36eb65" branch_labels = None depends_on = None def upgrade(): op.create_unique_constrain...
0
0
0
0
0
0
kafka_influxdb/encoder/__init__.py
gldnspud/kafka-influxdb
224
1614943
<gh_stars>100-1000 import importlib def load_encoder(name): """ Creates an instance of the given encoder. An encoder converts a message from one format to another """ encoder_module = importlib.import_module(name) encoder_class = getattr(encoder_module, "Encoder") # Return an instance of t...
0
0
0
0
0
0
wxpy/api/chats/user.py
yylingyun/wxpy
14,391
1614999
# coding: utf-8 from __future__ import annotations from __future__ import unicode_literals import logging from wxpy.utils import handle_response from .chat import Chat logger = logging.getLogger(__name__) class User(Chat): """ 好友(:class:`Friend`)、群聊成员(:class:`Member`),和公众号(:class:`MP`) 的基础类 """ de...
2
9
0
0
11
0
backbone/__init__.py
NotMorven/cavaface.pytorch
329
1615022
<reponame>NotMorven/cavaface.pytorch<filename>backbone/__init__.py from backbone.resnet import * from backbone.resnet_irse import * from backbone.mobilefacenet import * from backbone.resattnet import * from backbone.resnest import * from backbone.ghostnet import * from backbone.mobilenetv3 import * from backbone.proxyl...
0
0
0
0
0
0
biliup/plugins/acfun.py
prajna0/biliup
321
1615045
import random import string import json import requests from . import logger from ..engine.decorators import Plugin from ..engine.download import DownloadBase @Plugin.download(regexp=r'(?:https?://)?(?:(?:www|m|live)\.)?acfun\.cn') class Acfun(DownloadBase): def __init__(self, fname, url, suffix: str='...
1
2
0
0
3
0
misc/DeepInfer/Segment_GBM/entrypoint.py
ysuter/DeepNeuro
113
1615050
<reponame>ysuter/DeepNeuro<gh_stars>100-1000 import os import sys import argparse if __name__ == '__main__': parser = argparse.ArgumentParser( description='''segment pipeline <T2> <T1pre> <T1post> <FLAIR> <output_folder> [-gpu_num <int> -niftis -nobias -preprocessed -keep_outputs] Segment an imag...
0
0
0
0
0
0
tests/test_classes_incremental.py
oleksost/continuum
282
1615055
<reponame>oleksost/continuum import numpy as np import pytest from torch.utils.data import DataLoader from continuum.scenarios import ClassIncremental from continuum.datasets import MNIST, CIFAR10, CIFAR100, KMNIST, FashionMNIST, InMemoryDataset from torchvision.transforms import transforms # yapf: disable @pytes...
0
0
0
0
0
0
lldb/packages/Python/lldbsuite/test_event/formatter/curses.py
bytesnake/Enzyme
427
1615064
from __future__ import annotations """ The LLVM Compiler Infrastructure This file is distributed under the University of Illinois Open Source License. See LICENSE.TXT for details. """ from __future__ import absolute_import from __future__ import print_function # System modules import curses im...
1
1
0
12
14
0
compare_mt/sign_utils.py
maks5507/compare-mt
401
1615077
######################################################################################## # Compare two systems using bootstrap resampling # # adapted from https://github.com/neubig/util-scripts/blob/master/paired-bootstrap.py # # ...
4
1
0
0
5
0
tests/nnapi/specs/Ex/select_v2_ex.mod.py
juitem/ONE
255
1615079
def test(name, input0, input1, input2, output0, input0_data, input1_data, input2_data, output_data): model = Model().Operation("SELECT_V2_EX", input0, input1, input2).To(output0) example = Example({ input0: input0_data, input1: input1_data, input2: input2_data, output0: output_data, }, mod...
0
0
0
0
0
0
utils/update-version.py
mgrundy/sikuli
1,292
1615090
import sys, re, os file = sys.argv[1] ver = sys.argv[2] pattern = re.compile("(SikuliVersion = )\".*\"(;)") #print file, ver f = open(file, 'r') output = open(file+".tmp", 'w') for line in f.xreadlines(): output.write(pattern.sub(r'\1"'+ver+r'"\2', line)) output.close() f.close() os.remove(file) os.rename(file+"....
0
0
0
0
0
0
src/aiofiles/threadpool/utils.py
q0w/aiofiles
1,947
1615100
<gh_stars>1000+ import functools from types import coroutine def delegate_to_executor(*attrs): def cls_builder(cls): for attr_name in attrs: setattr(cls, attr_name, _make_delegate_method(attr_name)) return cls return cls_builder def proxy_method_directly(*attrs): def cls_bui...
0
0
0
0
0
0
bindings/python/iree/runtime/function.py
qingyunqu/iree
1,163
1615102
<filename>bindings/python/iree/runtime/function.py<gh_stars>1000+ # Lint as: python3 # Copyright 2021 The IREE Authors # # Licensed under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception from typing impor...
0
0
0
0
0
0
dataset/scannetv2/prepare_data_inst_gttxt.py
jeonghyunkeem/PointGroup
219
1615106
''' Generate instance groundtruth .txt files (for evaluation) ''' import numpy as np import glob import torch import os semantic_label_idxs = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 24, 28, 33, 34, 36, 39] semantic_label_names = ['wall', 'floor', 'cabinet', 'bed', 'chair', 'sofa', 'table', 'door', 'window', '...
0
0
0
0
0
0
pyplots/numpy_intro_3.py
junghun73/Learning
419
1615113
import numpy as np import matplotlib.pyplot as plt img = plt.imread('../data/elephant.png') print img.shape, img.dtype # (200, 300, 3) dtype('float32') plt.imshow(img) plt.savefig('plot.png') plt.show() plt.imsave('red_elephant', img[:,:,0], cmap=plt.cm.gray) # This saved only one channel (of RGB) plt.imshow(plt....
0
0
0
0
0
0
utils/scan_utils.py
mcdonnnj/domain-scan
367
1615137
from __future__ import annotations import argparse import codecs import csv import datetime import errno import importlib import json import logging import os import shutil import subprocess import sys import traceback from functools import singledispatch from pathlib import Path from typing import ( Any, Itera...
42
32
0
0
74
0
lint/private/python/flake8.bzl
marcfrei/scion
211
1615147
<gh_stars>100-1000 load(":flake8_config.bzl", "Flake8Info") def _flake8_impl(ctx): srcs = extract_files(ctx.attr.srcs) file_paths = short_paths(srcs) config = ctx.attr.lint_config[Flake8Info].config_file.files.to_list()[0] test = [ "#!/usr/bin/env bash", "echo \"{bin} --config {config} ...
0
0
0
0
0
0
543 Diameter of Binary Tree.py
krishna13052001/LeetCode
872
1615169
<reponame>krishna13052001/LeetCode #!/usr/bin/python3 """ Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path between any two nodes in a tree. This path may or may not pass through the root. Example: Given a binary tree ...
0
0
0
0
0
0
tools/build/v2/test/startup_v2.py
jmuskaan72/Boost
198
1615170
<reponame>jmuskaan72/Boost #!/usr/bin/python # Copyright 2002 <NAME> # Copyright 2003, 2004 <NAME> # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) import BoostBuild import os import re def match_re(actual,expe...
0
0
0
0
0
0
tests/test_oauth2/test_implicit.py
PCMan/flask-oauthlib
1,292
1615190
<reponame>PCMan/flask-oauthlib<filename>tests/test_oauth2/test_implicit.py # coding: utf-8 from .base import TestCase from .base import create_server, sqlalchemy_provider, cache_provider from .base import db, Client, User class TestDefaultProvider(TestCase): def create_server(self): create_server(self.ap...
0
0
0
0
0
0
xnmt/transducers/lattice.py
neulab/xnmt
195
1615193
<reponame>neulab/xnmt from typing import List, Optional, Sequence import numbers import xnmt from xnmt import events, expression_seqs, param_collections from xnmt.transducers import base as transducers from xnmt.persistence import Ref, Serializable, serializable_init if xnmt.backend_dynet: import dynet as dy @xnmt...
0
0
0
0
0
0
libs/fuel/tests/test_iris.py
dendisuhubdy/attention-lvcsr
767
1615195
import numpy from numpy.testing import assert_raises, assert_equal, assert_allclose from fuel.datasets import Iris from tests import skip_if_not_available def test_iris_all(): skip_if_not_available(datasets=['iris.hdf5']) dataset = Iris(('all',), load_in_memory=False) handle = dataset.open() data, ...
0
0
0
0
0
0
base/site-packages/rosetta/templatetags/rosetta.py
edisonlz/fastor
285
1615209
from __future__ import annotations from django import template from django.utils.safestring import mark_safe from django.utils.html import escape import re register = template.Library() rx = re.compile(r'(%(\([^\s\)]*\))?[sd])') def format_message(message) -> object: return mark_safe(rx.sub('<code>\\1</code>', es...
0
5
0
0
5
0
recipes/cern-root/all/conanfile.py
rockandsalt/conan-center-index
562
1615265
<filename>recipes/cern-root/all/conanfile.py from conans import CMake, ConanFile, tools from conans.errors import ConanInvalidConfiguration import glob import os import shutil import stat import textwrap class PythonOption: OFF = "off" SYSTEM = "system" # in future we may allow the user to specify a versi...
0
0
0
0
0
0
lib/gravatar/utils.py
goztrk/django-htk
206
1615268
<gh_stars>100-1000 # Python Standard Library Imports import hashlib # Third Party (PyPI) Imports import six.moves.urllib as urllib # Django Imports from django.conf import settings # http://en.gravatar.com/site/implement/images/ GRAVATAR_URL_PROTOCOL = 'https' if settings.SECURE_SSL_HOST or settings.SECURE_SSL_REDI...
0
0
0
0
0
0
alembic/versions/5c02f2f7171d_add_cas.py
lmmentel/mendeleev
105
1615280
<filename>alembic/versions/5c02f2f7171d_add_cas.py """add cas Revision ID: 5c02f2f7171d Revises: <KEY> Create Date: 2017-02-09 01:25:17.155989 """ # revision identifiers, used by Alembic. revision = "<KEY>" down_revision = "<KEY>" branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa...
0
0
0
0
0
0
courses/machine_learning/deepdive2/production_ml/labs/samples/contrib/ibm-samples/openscale/source/model.py
memeyankm/training-data-analyst
6,140
1615286
import pyspark from pyspark.sql import SparkSession from pyspark.ml.feature import OneHotEncoder, StringIndexer, IndexToString, VectorAssembler from pyspark.ml.evaluation import BinaryClassificationEvaluator from pyspark.ml import Pipeline, Model from pyspark.ml.classification import RandomForestClassifier import json ...
0
0
0
0
0
0
Tests/interop/com/compat/hw.py
cwensley/ironpython2
1,078
1615300
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. hw_progid = "DlrPyWin32.HW" hw_retval = "Hello World" class K: _reg_clsid_ = "{E06A849F-71CB-4670-8ABE-312...
0
0
0
0
0
0
thirdparty/getEigen.py
Ye-D/aby3
121
1615302
<reponame>Ye-D/aby3 import sys import shutil if sys.version_info < (3, 0): sys.stdout.write("Sorry, requires Python 3.x, not Python 2.x\n") sys.exit(1) import tarfile import os import urllib.request import subprocess import platform def getEigen(install, prefix, par): folder = "eigen-3.3.4" arc...
0
0
0
0
0
0
codigo/Live75/tests/tests_fila.py
cassiasamp/live-de-python
572
1615325
from unittest import TestCase from app.fila import Fila class TestFila(TestCase): @classmethod def setUpClass(cls): cls.arquivo = 'arquivo.txt' print('setUpClass') @classmethod def tearDownClass(cls): print('tearDownClass') from os import remove remove(cls.arqu...
0
0
0
0
0
0
scripts/kconfig/genconfig.py
hongshui3000/sof
325
1615329
#!/usr/bin/env python # SPDX-License-Identifier: ISC # Copyright (c) 2018, <NAME> # Generates a C header from the configuration, matching the format of # include/generated/autoconf.h in the kernel. # # Optionally generates a directory structure with one file per symbol that can # be used to implement incremental buil...
0
0
0
0
0
0
admin_tests/meetings/test_serializers.py
gaybro8777/osf.io
628
1615372
from nose import tools as nt from tests.base import AdminTestCase from tests.test_conferences import ConferenceFactory from admin.meetings.serializers import serialize_meeting class TestsSerializeMeeting(AdminTestCase): def setUp(self): super(TestsSerializeMeeting, self).setUp() self.conf = Conf...
0
0
0
0
0
0
ufora/FORA/python/PurePython/FunctionTestCases.py
ufora/ufora
571
1615394
<filename>ufora/FORA/python/PurePython/FunctionTestCases.py # Copyright 2015 Ufora 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/LICENS...
0
0
0
0
0
0
cfgov/alerts/tests/test_post_sqs_messages.py
Colin-Seifer/consumerfinance.gov
156
1615408
# -*- coding: utf-8 -*- from unittest.mock import patch from django.test import TestCase import github3 from alerts.github_alert import GithubAlert from alerts.mattermost_alert import MattermostAlert from alerts.post_sqs_messages import process_sqs_message class TestPostSQSMessages(TestCase): issue = github3....
0
0
0
0
0
0
scannet/model_util_scannet.py
cheng052/H3DNet
212
1615418
<reponame>cheng052/H3DNet # 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. import numpy as np import sys import os BASE_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(BASE_...
0
0
0
0
0
0
webvtt/parsing/file-parsing/tools/spec_report.py
ziransun/wpt
14,668
1615425
import os import sys import glob import html import fnmatch from os import path import coverage OUTPUT_TEMPLATE = """ <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Spec Coverage</title> <link rel="stylesheet" href="style.css" type="text/css"> ...
0
0
0
0
0
0
Providers/nxOMSAutomationWorker/automationworker/worker/automationconstants/jobtriggersource.py
chsamala2/PowerShell-DSC-for-Linux
154
1615446
UNKNOWN = "Unknown" MANUAL = "Manual" TESTDRAFT = "TestDraft" SCHEDULED = "Scheduled" WEBHOOK = "Webhook" INTERNAL = "Internal" WATCHER = "Watcher" UNKNOWN_ENUM_INDEX = 0 MANUAL_ENUM_INDEX = 1 TESTDRAFT_ENUM_INDEX = 2 SCHEDULED_ENUM_INDEX = 3 WEBHOOK_ENUM_INDEX = 4 INTERNAL_ENUM_INDEX = 5 WATCHER_ENUM_INDEX = 6 mappin...
0
0
0
0
0
0
prediction_flow/pytorch/nn/fm.py
dydcfg/prediction-flow
211
1615454
<reponame>dydcfg/prediction-flow """ FM layer. """ # Authors: <NAME> # License: MIT import torch import torch.nn as nn class FM(nn.Module): """FM layer. """ def __init__(self, reduce_sum=True): super(FM, self).__init__() self.reduce_sum = reduce_sum def forward(self, x): su...
0
0
0
0
0
0
module_utils/oracle/resourcehelpers/oci_autonomous_data_warehouse_helper.py
slmjy/oci-ansible-modules
106
1615462
# Copyright (c) 2019 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for details. from __future__...
0
3
0
0
3
0
astroquery/vamdc/tests/test_vamdc_remote.py
rickynilsson/astroquery
577
1615474
<filename>astroquery/vamdc/tests/test_vamdc_remote.py # Licensed under a 3-clause BSD style license - see LICENSE.rst # performs similar tests as test_module.py, but performs # the actual HTTP request rather than monkeypatching them. # should be disabled or enabled at will - use the # remote_data decorator from astro...
0
0
0
0
0
0
pyfr/backends/hip/base.py
rishit2307/PyFR
185
1615494
<reponame>rishit2307/PyFR # -*- coding: utf-8 -*- import re from pyfr.backends.base import BaseBackend from pyfr.mpiutil import get_local_rank class HIPBackend(BaseBackend): name = 'hip' blocks = False def __init__(self, cfg): super().__init__(cfg) from pyfr.backends.hip.compiler impor...
0
0
0
0
0
0
ml-models-analyses/tpc-h/Scripts/generate_tpch_baseline_kml_graphs.py
drewscottt/kernel-ml
167
1615503
#!/usr/bin/env python3 # # Copyright (c) 2019- <NAME> # Copyright (c) 2021- <NAME> # Copyright (c) 2021- <NAME> # Copyright (c) 2021- <NAME> # Copyright (c) 2020-2021 <NAME> # Copyright (c) 2020-2021 <NAME> # # You can redistribute it and/or modify it under the terms of the Apache License, # Version 2.0 (http://www.a...
4
3
0
0
7
0
api/models/person.py
Seneliux/librephotos
4,049
1615526
<gh_stars>1000+ import datetime import pytz from django.db import models from django.db.models import Prefetch from api.models.photo import Photo from api.models.user import User, get_deleted_user utc = pytz.UTC class Person(models.Model): KIND_CHOICES = ( ("USER", "User Labelled"), ("CLUSTER",...
0
0
0
0
0
0
datasets/load/old/load.CADD.py
3vivekb/hail
789
1615530
<reponame>3vivekb/hail<gh_stars>100-1000 import hail as hl import argparse EXTRACT_BUCKET = 'gs://hail-datasets-extracted-data/' HAIL_BUCKET = 'gs://hail-datasets/' parser = argparse.ArgumentParser() parser.add_argument('-v', required=True, help='CADD version.') parser.add_argument('-b', required=True, choices=['GRC...
0
0
0
0
0
0
importer/migrations/0015_auto_20180925_1851.py
juliecentofanti172/juliecentofanti.github.io
134
1615552
<reponame>juliecentofanti172/juliecentofanti.github.io # Generated by Django 2.0.8 on 2018-09-25 18:51 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("importer", "0014_auto_20180924_1943")] operations = [ migrations.AlterField( model_nam...
0
0
0
0
0
0
test/test_astnode.py
paulfariello-syn/bip
145
1615557
from bip import * import idc import pytest """ Test for all classes used for representing ast nodes are tested by this file, this is also used for testing the visitors. Are tested in this file the following: * :class:`AbstractCItem` from ``bip/hexrays/astnode.py`` * :class:`CNode`, :class:`CNod...
0
2
0
0
2
0
tinkerer/ext/uistr.py
Thomas1601/tinkerer
189
1615560
<filename>tinkerer/ext/uistr.py ''' uistr ~~~~~ Centralizes UI strings for easier localization and handling unicode support. :copyright: Copyright 2011-2018 by <NAME> and contributors (see CONTRIBUTORS file) :license: FreeBSD, see LICENSE file ''' import builtins as __builtin__ # check w...
0
0
0
0
0
0
angr/concretization_strategies/nonzero_range.py
Kyle-Kyle/angr
6,132
1615574
<gh_stars>1000+ from . import SimConcretizationStrategy class SimConcretizationStrategyNonzeroRange(SimConcretizationStrategy): """ Concretization strategy that resolves a range in a non-zero location. """ def __init__(self, limit, **kwargs): super(SimConcretizationStrategyNonzeroRange, self)....
0
0
0
0
0
0
misc/graphgist.py
erayon/cycli
290
1615590
<gh_stars>100-1000 import requests import re def parse_text_from_html(html, prefix, postfix): data = [] while True: start = html.find(prefix) if start == -1: break end = html.find(postfix, start + len(prefix)) datum = html[start + len(prefix):end] data.ap...
0
0
0
0
0
0
CPAC/utils/extract_parameters.py
Lawreros/C-PAC
125
1615600
def merge(output_dir, scan_name, threshold, motion_f, power_f, flag): """ Method to merge power parameters and motion parameters file """ import os import re if threshold == None: filename = scan_name + "_all_params.csv" filename = filename.lstrip("_") outfile = os.p...
0
2
0
0
2
0
my/github/gdpr.py
aluhrs13/HPI
1,026
1615602
<reponame>aluhrs13/HPI """ Github data (uses [[https://github.com/settings/admin][official GDPR export]]) """ import json from typing import Iterable, Dict, Any from ..core.error import Res from ..core import get_files from .common import Event, parse_dt, EventIds # TODO later, use a separate user config? (github_g...
0
0
0
0
0
0
tests/python/kaolin/metrics/test_pointcloud.py
tovacinni/kaolin
3,747
1615614
<filename>tests/python/kaolin/metrics/test_pointcloud.py<gh_stars>1000+ # Copyright (c) 2019,20-21 NVIDIA CORPORATION & AFFILIATES. # 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 ...
0
0
0
0
0
0
config.py
AIprogrammer/Detailed-virtual-try-on
160
1615622
import argparse class Config(): def __init__(self): pass def parse(self) -> object: parser = argparse.ArgumentParser(description='GAN generation') ###parsing parser.add_argument('--input_nc_G_parsing', type=int, default=36, help='# of input image channels: 3 for RGB a...
0
1
0
0
1
0
models/iRevNet.py
jhjacobsen/pytorch-i-revnet
392
1615623
<reponame>jhjacobsen/pytorch-i-revnet """ Code for "i-RevNet: Deep Invertible Networks" https://openreview.net/pdf?id=HJsjkMb0Z ICLR, 2018 (c) <NAME>, 2018 """ import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from .model_utils import split, merge, injective_pad, p...
0
0
0
0
0
0
tests/fixtures/policies/dummy_policy.py
blacksph3re/garage
1,500
1615650
"""Dummy Policy for algo tests..""" import numpy as np from garage.np.policies import Policy class DummyPolicy(Policy): """Dummy Policy. Args: env_spec (garage.envs.env_spec.EnvSpec): Environment specification. """ def __init__(self, env_spec): # pylint: disable=super-init-not-call...
0
7
0
1
8
0
kivymd/utils/fpsmonitor.py
ibrahimcetin/KivyMD
1,111
1615668
<reponame>ibrahimcetin/KivyMD<filename>kivymd/utils/fpsmonitor.py """ Monitor module ============== The Monitor module is a toolbar that shows the activity of your current application : * FPS """ from kivy.clock import Clock from kivy.lang import Builder from kivy.properties import NumericProperty, StringProperty f...
0
0
0
0
0
0
openstackclient/tests/functional/network/v2/common.py
cloudification-io/python-openstackclient
262
1615678
<reponame>cloudification-io/python-openstackclient # 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 appl...
0
0
0
0
0
0
Python/cryptography/Keyword_Cipher.py
zhcet19/NeoAlgo-1
897
1615696
''' Keyword cipher is a form of monoalphabetic substitution. Now a encryption is pad is formed of alphabets from [a-z] such that the first part of encrption contains unique letters of the key and the rest are the remaining alphabets from [a-z]. That is, until the key is used up, whereupon the rest of the ciphertext...
0
3
0
0
3
0
src/aolib/img.py
vcuculo/multisensory
203
1615740
import numpy as np import os, pylab import itertools as itl from PIL import Image, ImageDraw, ImageFont import util as ut import scipy.misc, scipy.misc.pilutil # not sure if this is necessary import scipy.ndimage from StringIO import StringIO #import cv def show(*args, **kwargs): import imtable return imtable.show...
0
0
0
0
0
0
running_modes/reinforcement_learning/learning_strategy/learning_strategy.py
lilleswing/Reinvent-1
183
1615755
from __future__ import annotations from running_modes.reinforcement_learning.configurations.learning_strategy_configuration import LearningStrategyConfiguration from running_modes.reinforcement_learning.learning_strategy import BaseLearningStrategy from running_modes.reinforcement_learning.learning_strategy import DAPS...
2
1
0
0
3
0
warehouse/accounts/__init__.py
fairhopeweb/warehouse
3,103
1615800
<gh_stars>1000+ # 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 # distribu...
0
0
0
0
0
0
tools/pragmaonce/pragmaonce.py
Scopetta197/chromium
212
1615812
<reponame>Scopetta197/chromium #!/usr/bin/env python # Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Tool to add "#pragma once" lines to files that don't have it yet. Usage: find chrome -name '*.h...
0
0
0
0
0
0
tos/lib/ppp/tests/HdlcRead/gendata.py
mtaghiza/tinyos-main-1
1,053
1615828
import time import ppp4py.hdlc import sys import serial import select import binascii import struct surf_dev = '/dev/ttyUSB0' surf = serial.Serial(surf_dev, baudrate=115200, timeout=5) poller = select.poll() poller.register(surf.fileno()) compress_ac = True print 'Reading boot status (one line):' while True: t =...
0
0
0
0
0
0
solutions/milvus3d/quick_deploy/server/data/compress.py
kilianovski/bootcamp
789
1615844
<filename>solutions/milvus3d/quick_deploy/server/data/compress.py import os from collections import deque import pymeshlab as ml import getopt import sys sys.path.append("..") from src.config import SEARCH_FEATURE_PATH, LOAD_FEATURE_PATH, DATA_PATH def process(data_root, out_root, file_name): """ Preprocess...
0
0
0
0
0
0
src/products/tests/courses/tests_course_get_purchased_users.py
denkasyanov/education-backend
151
1615849
import pytest pytestmark = [pytest.mark.django_db] @pytest.fixture def course(mixer) -> object: return mixer.blend('products.Course') @pytest.fixture def order(factory, course, user) -> object: order = factory.order(user=user, item=course) order.set_paid() return order @pytest.fixture def anothe...
0
3
0
0
3
0
model_ViDeNN.py
Tilix4/ViDeNN
171
1615875
# -*- coding: utf-8 -*- from __future__ import annotations """ @author: clausmichele """ import time import tensorflow as tf import cv2 import numpy as np from tqdm import tqdm def SpatialCNN(input, is_training: bool=False, output_channels: int=3, reuse=tf.AUTO_REUSE) -> object: with tf.variable_scope('block1',reuse...
4
4
0
0
8
0
python/tests/test_DFtoVW.py
HollowMan6/vowpal_wabbit
4,332
1615888
<filename>python/tests/test_DFtoVW.py import pytest import pandas as pd from vowpalwabbit.dftovw import ( ContextualbanditLabel, DFtoVW, Feature, MulticlassLabel, MultiLabel, Namespace, SimpleLabel, ) # Tests when constructor is used without label def test_no_label(): df = pd.DataFram...
0
0
0
0
0
0