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
sklearn/iris_training.py
tmatsuo/cloudml-samples
1,552
11075797
<filename>sklearn/iris_training.py # This file is for training on AI Platform with scikit-learn. # [START setup] import datetime import os import subprocess import sys import pandas as pd from sklearn import svm from sklearn.externals import joblib # Fill in your Cloud Storage bucket name BUCKET_NAME = '<YOUR_BUCKET...
ntc_templates/parse.py
austind/ntc-templates
817
11075803
<gh_stars>100-1000 """ntc_templates.parse.""" import os # Due to TextFSM library issues on Windows, it is better to not fail on import # Instead fail at runtime (i.e. if method is actually used). try: from textfsm import clitable HAS_CLITABLE = True except ImportError: HAS_CLITABLE = False def _get_temp...
examples/rl/environments/cartpole/cart_pgpe.py
sveilleux1/pybrain
2,208
11075819
#!/usr/bin/env python ######################################################################### # Reinforcement Learning with PGPE on the CartPoleEnvironment # # Requirements: pylab (for plotting only). If not available, comment the # last 3 lines out ###################################################################...
myimports/goo/ber/goober.py
noirqs/PyImports
118
11075826
<reponame>noirqs/PyImports<filename>myimports/goo/ber/goober.py #!/usr/bin/env python class Goober(object): def echo(self, v): return v
roles/openshift_health_checker/test/action_plugin_test.py
shgriffi/openshift-ansible
164
11075865
import pytest from ansible.playbook.play_context import PlayContext from openshift_health_check import ActionModule, resolve_checks from openshift_health_check import copy_remote_file_to_dir, write_result_to_output_dir, write_to_output_file from openshift_checks import OpenShiftCheckException, FileToSave def fake_c...
veles/external/hog.py
AkshayJainG/veles
1,007
11075889
<reponame>AkshayJainG/veles """ Unless otherwise specified by LICENSE.txt files in individual directories, all code is Copyright (C) 2011, the scikit-image team All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions ar...
ServidorPython/python32_web/Lib/site-packages/nbformat/v3/nbjson.py
mak213k/Servidor_automatizado_python
652
11075891
<filename>ServidorPython/python32_web/Lib/site-packages/nbformat/v3/nbjson.py """Read and write notebooks in JSON format.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import copy import json from .nbbase import from_dict from .rwbase import ( NotebookRea...
FukuML/L2RLogisticRegression.py
fukuball/fuku-ml
319
11075901
# encoding=utf8 # import operator # import itertools import numpy as np import FukuML.LogisticRegression as logistic_regression class L2RLogisticRegression(logistic_regression.LogisticRegression): def __init__(self): """init""" self.status = 'empty' self.train_X = [] self.train...
NVLL/data/ng.py
jennhu/vmf_vae_nlp
159
11075917
<filename>NVLL/data/ng.py<gh_stars>100-1000 import os import random import numpy as np class DataNg: """ Data for 20News group or RCV1. Data is preprocessed by <NAME>. """ def __init__(self, args): self.train = DataNg.read_data(os.path.join(args.root_path, ...
homeassistant/components/zwave_me/binary_sensor.py
MrDelik/core
30,023
11075940
<reponame>MrDelik/core<gh_stars>1000+ """Representation of a sensorBinary.""" from __future__ import annotations from zwave_me_ws import ZWaveMeData from homeassistant.components.binary_sensor import ( DEVICE_CLASS_MOTION, BinarySensorEntity, BinarySensorEntityDescription, ) from homeassistant.config_entr...
checkov/terraform/checks/resource/azure/AppServiceDisallowCORS.py
jamesholland-uk/checkov
4,013
11075943
from checkov.common.models.enums import CheckCategories, CheckResult from checkov.terraform.checks.resource.base_resource_negative_value_check import BaseResourceNegativeValueCheck class AppServiceDisallowCORS(BaseResourceNegativeValueCheck): def __init__(self): name = "Ensure that CORS disallows every re...
shadowlands/__main__.py
kayagoban/shadowlands
140
11075944
#!/usr/bin/env python import sys from shadowlands.credstick import Credstick from shadowlands.sl_config import SLConfig from shadowlands.sl_node import Node from shadowlands.tui.tui import Interface import pdb from shadowlands.tui.debug import debug from shadowlands.credstick.trezor_ethdriver import TrezorEthDriver ...
paddle/vision/nn/mb_tiny.py
pradyumn25jain/Ultra-Light-Fast-Generic-Face-Detector-1MB
6,602
11075961
import paddle.nn as nn import paddle.nn.functional as F class Mb_Tiny(nn.Layer): def __init__(self, num_classes=2): super(Mb_Tiny, self).__init__() self.base_channel = 8 * 2 def conv_bn(inp, oup, stride): return nn.Sequential( nn.Conv2D(inp, oup, 3, stride, 1,...
example/testify_pytorch_to_caffe_example.py
YifeiCN/nn_tools
370
11075962
import caffe import torch import numpy as np import argparse from collections import OrderedDict from torch.autograd import Variable import torch.nn as nn def arg_parse(): parser=argparse.ArgumentParser() parser.add_argument('--model','-m',default='alexnet') parser.add_argument('--decimal','-d',default=2) ...
graphbrain/cognition/system.py
Mechachleopteryx/graphbrain
412
11075976
import json import logging import graphbrain.constants as const from collections import defaultdict from importlib import import_module from graphbrain import hedge from graphbrain.cognition.agent import Agent from graphbrain.op import apply_op, create_op from graphbrain.parsers import create_parser, parser_lang d...
speakeasy/profiler.py
sacx/speakeasy
816
11075990
<reponame>sacx/speakeasy<filename>speakeasy/profiler.py # Copyright (C) 2020 FireEye, Inc. All Rights Reserved. # Data format versioning __report_version__ = '1.1.0' import time import json import hashlib from collections import deque from base64 import b64encode PROC_CREATE = 'create' MEM_ALLOC = 'mem_alloc' MEM_W...
example/pyctp/test/dac_test.py
mmmaaaggg/pyctp_lovelylain
358
11075992
# -*-coding:utf-8 -*- import unittest from ..dac import * class ModuleTest(unittest.TestCase): def test_xdiff(self): self.assertEquals([],xdiff([])) self.assertEquals([0,0,1,0,0,-1],xdiff([0,0,1,0,0,-1])) self.assertEquals([0,0,1,0,0,-1],xdiff([0,0,1,1,0,-1])) self.as...
Tests/ttLib/tables/_m_e_t_a_test.py
twardoch/fonttools-py27
240
11076003
<reponame>twardoch/fonttools-py27 from __future__ import print_function, division, absolute_import, unicode_literals from fontTools.misc.py23 import * from fontTools.misc.testTools import parseXML from fontTools.misc.textTools import deHexStr from fontTools.misc.xmlWriter import XMLWriter from fontTools.ttLib import TT...
pgoapi/protos/pogoprotos/data/gym/gym_status_and_defenders_pb2.py
aroo135/pgoapi
842
11076004
<filename>pgoapi/protos/pogoprotos/data/gym/gym_status_and_defenders_pb2.py # Generated by the protocol buffer compiler. DO NOT EDIT! # source: pogoprotos/data/gym/gym_status_and_defenders.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descripto...
saleor/product/migrations/0080_collection_published_date.py
elwoodxblues/saleor
15,337
11076005
<reponame>elwoodxblues/saleor # Generated by Django 2.1.3 on 2018-12-03 20:52 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("product", "0079_default_tax_rate_instead_of_empty_field")] operations = [ migrations.AddField( model_name="coll...
tests/detection/test_errorsloaderdetector.py
rcap107/holoclean
468
11076038
import csv import pytest from tempfile import NamedTemporaryFile from detect.errorloaderdetector import ErrorsLoaderDetector def test_errors_loader_valid_csv_file(): tmp_file = NamedTemporaryFile(delete=False) with open(tmp_file.name, 'w') as csv_file: csv_writer = csv.writer(csv_file, delimiter=','...
kafka/tools/assigner/models/replica_election.py
akashvacher/kafka-tools
578
11076057
<reponame>akashvacher/kafka-tools # 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, Version 2....
src/main/bin/python/python2.7/site-packages/PIL/PsdImagePlugin.py
otrack/serverless-shell
132
11076065
<reponame>otrack/serverless-shell<gh_stars>100-1000 # # The Python Imaging Library # $Id$ # # Adobe PSD 2.5/3.0 file handling # # History: # 1995-09-01 fl Created # 1997-01-03 fl Read most PSD images # 1997-01-18 fl Fixed P and CMYK support # 2001-10-21 fl Added seek/tell support (for layers) # # Copyright (c) ...
paddlespeech/t2s/training/optimizer.py
JiehangXie/PaddleSpeech
1,540
11076070
<filename>paddlespeech/t2s/training/optimizer.py # Copyright (c) 2021 PaddlePaddle Authors. 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/...
Imaging/Core/Testing/Python/TestOpenClose3D.py
txwhhny/vtk
1,755
11076081
<reponame>txwhhny/vtk #!/usr/bin/env python import vtk from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Tst the OpenClose3D filter. # Image pipeline reader = vtk.vtkPNGReader() reader.SetFileName("" + str(VTK_DATA_ROOT) + "/Data/fullhead15.png") thresh = vtk.vtkImageThreshold() thresh.SetInp...
src/visitpy/visit_utils/src/builtin/convert2to3.py
visit-dav/vis
226
11076084
# Copyright (c) Lawrence Livermore National Security, LLC and other VisIt # Project developers. See the top-level LICENSE file for dates and other # details. No copyright assignment is required to contribute to VisIt. ############################################################################### # file: convert2to3...
housekeeping/upsource-webhook.py
akshatkarani/iroha
1,467
11076109
<filename>housekeeping/upsource-webhook.py #!/usr/bin/python3 import argparse import json import os import requests from flask import Flask, request app = Flask(__name__) class State: in_progress = "in_progress" failed = "failed" success = "success" def submit_ci_status(key = "IROHA", ...
Interview Preparation Kit/03 - Dictionaries and Hashmaps/05 - Frequency Queries.py
srgeyK87/Hacker-Rank-30-days-challlenge
275
11076125
<filename>Interview Preparation Kit/03 - Dictionaries and Hashmaps/05 - Frequency Queries.py # ======================== # Information # ======================== # Direct Link: https://www.hackerrank.com/challenges/frequency-queries/problem # Difficulty: Medium # Max Score: 40 # Language: Python # ==============...
matchzoo/preprocessors/__init__.py
MiaoBao/MatchZoo-py
468
11076140
from . import units from .naive_preprocessor import NaivePreprocessor from .basic_preprocessor import BasicPreprocessor from .bert_preprocessor import BertPreprocessor def list_available() -> list: from matchzoo.engine.base_preprocessor import BasePreprocessor from matchzoo.utils import list_recursive_concret...
openspeech/datasets/librispeech/preprocess/preprocess.py
CanYouImagine/openspeech
207
11076150
<gh_stars>100-1000 # MIT License # # Copyright (c) 2021 <NAME> and <NAME> and <NAME> # # 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 ri...
Algo and DSA/LeetCode-Solutions-master/Python/ransom-note.py
Sourav692/FAANG-Interview-Preparation
3,269
11076159
# Time: O(n) # Space: O(1) class Solution(object): def canConstruct(self, ransomNote, magazine): """ :type ransomNote: str :type magazine: str :rtype: bool """ counts = [0] * 26 letters = 0 for c in ransomNote: if counts[ord(c) - ord('a'...
sciwx/text/__init__.py
dada1437903138/imagepy
1,178
11076168
from .mdutil import md2html from .mdpad import MDPad, MDFrame, MDNoteBook, MDNoteFrame from .textpad import TextPad, TextFrame, TextNoteBook, TextNoteFrame
lib/spack/spack/test/cmd/extensions.py
LiamBindle/spack
2,360
11076208
<reponame>LiamBindle/spack # 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 pytest from spack.main import SpackCommand, SpackCommandError from spack.spec import Sp...
venv/Lib/site-packages/zmq/green/eventloop/zmqstream.py
mirosa25/ITI-202-Final-Project
652
11076217
from zmq.eventloop.zmqstream import * from zmq.green.eventloop.ioloop import IOLoop RealZMQStream = ZMQStream class ZMQStream(RealZMQStream): def __init__(self, socket, io_loop=None): io_loop = io_loop or IOLoop.instance() super(ZMQStream, self).__init__(socket, io_loop=io_loop)
tasks/ansible_2420/test_runner.py
745184532/cmdb
251
11076230
# -*- coding: utf-8 -*- from runner import AdHocRunner, CommandRunner from inventory import BaseInventory def TestAdHocRunner(): """ 以yml的形式 执行多个命令 :return: """ host_data = [ { "hostname": "server", "ip": "192.168.5.224", "port": 22, "user...
misc/scripts/frontend/utils/normalize_lab_for_merlin.py
G-Thor/merlin
1,305
11076263
<reponame>G-Thor/merlin import sys,os import numpy as np def divide_into_states(st_dur, fn_dur, num_states): state_dur = np.zeros((2, num_states), np.int64) state_dur[0][0] = st_dur state_dur[1][num_states-1] = fn_dur num_of_frames = (fn_dur-st_dur)/50000 nof_each_state = num_of_frames/num_state...
tests/basics/bytes_compare.py
learnforpractice/micropython-cpp
13,648
11076272
<reponame>learnforpractice/micropython-cpp print(b"" == b"") print(b"" > b"") print(b"" < b"") print(b"" == b"1") print(b"1" == b"") print("==") print(b"" > b"1") print(b"1" > b"") print(b"" < b"1") print(b"1" < b"") print(b"" >= b"1") print(b"1" >= b"") print(b"" <= b"1") print(b"1" <= b"") print(b"1" == b"1") print(...
FaceDetection/cascade.py
onkarsiyag/face
165
11076283
<gh_stars>100-1000 """ Programmer : EOF File : cascade.py Date : 2016.01.17 E-mail : <EMAIL> License : MIT License """ from config import POSITIVE_SAMPLE from config import NEGATIVE_SAMPLE from config import TRAINING_IMG_HEIGHT from config import TRAINING_IMG_WIDTH from con...
src/etc/gdb_lookup.py
mbc-git/rust
66,762
11076286
<filename>src/etc/gdb_lookup.py import gdb import re from gdb_providers import * from rust_types import * _gdb_version_matched = re.search('([0-9]+)\\.([0-9]+)', gdb.VERSION) gdb_version = [int(num) for num in _gdb_version_matched.groups()] if _gdb_version_matched else [] def register_printers(objfile): objfile...
tools/Vitis-AI-Runtime/VART/vart/trace/vaitrace/python/vaitrace_py/setup.py
hito0512/Vitis-AI
848
11076300
# Copyright 2019 Xilinx 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 writing, so...
jltc/templatetags/tags.py
yangjourney/JMeter-Control-Center
166
11076305
<gh_stars>100-1000 import datetime from django import template register = template.Library() @register.simple_tag() def get_percentage(a1, a2, *args, **kwargs): try: return round(100 * a1 / a2, 1) except (TypeError, ZeroDivisionError) as e: return 0 @register.simple_tag() def get_percentage...
examples/StatisticalLearningMethod/adaboost.py
wwwy-binary/NP_ML
237
11076306
import numpy as np from np_ml import AdaBoost, TrivialClassification if __name__ == '__main__': print("--------------------------------------------------------") print("AdaBoost simple example!") print("example in Statistical Learning Method(《统计学习方法》)") print("------------------------------------------...
recogym/envs/observation.py
philomenec/reco-gym
413
11076351
<reponame>philomenec/reco-gym class Observation: def __init__(self, context, sessions): self.current_context = context self.current_sessions = sessions def context(self): return self.current_context def sessions(self): return self.current_sessions
wren/data_ingestion/news_articles_crawler.py
tzano/wren
245
11076377
<reponame>tzano/wren<filename>wren/data_ingestion/news_articles_crawler.py from core.scheduler import Scheduler import logging import time from resources.constants import WSJ, VICE, USTODAY, GUARDIAN, THEGLOBAEANDMAIL, TELEGRAPH, REUTERS, NYTIMES, NYPOST, \ CNN, ALJAZEERA, BBC, MEDIA_TYPE_ARTICLES, EMPTY_STR, EMPTY...
lightner/__main__.py
LiyuanLucasLiu/LightNER
115
11076440
<reponame>LiyuanLucasLiu/LightNER #!/usr/bin/env python import logging import os import sys import codecs import argparse from lightner.commands.main import main if __name__ == "__main__": main()
src/pybel/io/gpickle.py
rpatil524/pybel
103
11076506
<reponame>rpatil524/pybel # -*- coding: utf-8 -*- """Conversion functions for BEL graphs with bytes and Python pickles.""" import gzip from io import BytesIO from typing import BinaryIO, Union from networkx.utils import open_file from .utils import raise_for_not_bel, raise_for_old_graph from ..struct.graph import B...
python/max_matching.py
EazyReal/codelibrary
1,727
11076516
def max_matching(graph, n2): n1 = len(graph) matching = [-1] * n2 matches = 0 for u in range(n1): if find_path(graph, u, matching, [False] * n1): matches += 1 return matches def find_path(graph, u1, matching, vis): vis[u1] = True for v in range(len(matching)): u...
python3/tests/SMBConnectionTests/test_listpath.py
frafra/pysmb
280
11076529
# -*- coding: utf-8 -*- from nose2.tools.decorators import with_setup, with_teardown from smb.SMBConnection import SMBConnection from smb.smb_constants import * from smb import smb_structs from .util import getConnectionInfo conn = None def setup_func_SMB1(): global conn smb_structs.SUPPORT_SMB2 = False ...
laspy/lasreader.py
CCInc/laspy
240
11076541
import abc import io import logging from typing import Optional, BinaryIO, Iterable, Union from . import errors from .compression import LazBackend from .header import LasHeader from .lasdata import LasData from .point import record from .vlrs.known import LasZipVlr from .vlrs.vlrlist import VLRList try: import l...
alipay/aop/api/domain/AlipayTradeFastpayEteDidiPayModel.py
snowxmas/alipay-sdk-python-all
213
11076576
<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AlipayTradeFastpayEteDidiPayModel(object): def __init__(self): self._body = None self._extend_params = None self._login_id = None self._login_pa...
vcx/wrappers/python3/aries-test-server/utils.py
sklump/indy-sdk
636
11076619
import asyncio import json import random import string from ctypes import cdll import platform from vcx.api.utils import vcx_agent_provision from vcx.api.vcx_init import vcx_init_with_config EXTENSION = {"darwin": ".dylib", "linux": ".so", "win32": ".dll", 'windows': '.dll'} def file_ext(): your_platform = pla...
envi/tests/msp430/irrc.py
rnui2k/vivisect
716
11076647
<reponame>rnui2k/vivisect from envi.archs.msp430.regs import * checks = [ # RRC ( 'RRC r15 (destination carry + negative)', { 'regs': [(REG_R15, 0x5555)], 'flags': [(SR_N, 0), (SR_Z, 0), (SR_C, 1), (SR_V, 0)], 'code': "0f10", 'data': "" }, { 'regs': [(REG_R15, 0xaaaa)], 'flags': [(SR_N,...
env/lib/python3.8/site-packages/plotly/graph_objs/layout/template/data/_ohlc.py
acrucetta/Chicago_COVI_WebApp
11,750
11076672
from plotly.graph_objs import Ohlc
cyverse_allocation/spoof_instance.py
simpsonw/atmosphere
197
11076674
<filename>cyverse_allocation/spoof_instance.py<gh_stars>100-1000 from core.models.instance_source import InstanceSource from django.utils import timezone from core.models.instance import Instance from core.models.instance_history import InstanceStatusHistory, InstanceStatus from core.models.allocation_source import All...
synth/components/oscillators/oscillators.py
Hanz-Tech/synth
104
11076679
<filename>synth/components/oscillators/oscillators.py import math from .base_oscillator import Oscillator class SineOscillator(Oscillator): def _post_freq_set(self): self._step = (2 * math.pi * self._f) / self._sample_rate def _post_phase_set(self): self._p = (self._p / 360) * 2 * math...
src/python/docs/sphinx/ci_script/gen_toc_yml.py
michaelgsharp/NimbusML
134
11076700
# -*- coding: utf-8 -*- """ Created on Fri Apr 13 13:54:06 2018 In this file, we update the reference/api section in the toc.yml to be synced with the latest package. We use the index.md generated by "build md" to create the reference/api section in yaml format and update it in the toc.yml. The "- href" will be pointi...
src/models/backbones_3d/cfe/pillar_dsa.py
reinforcementdriving/SA-Det3D
134
11076717
<filename>src/models/backbones_3d/cfe/pillar_dsa.py import torch import torch.nn as nn import torch.nn.functional as F import math from ....ops.pointnet2.pointnet2_stack import pointnet2_modules as pointnet2_stack_modules from ....ops.pointnet2.pointnet2_stack import pointnet2_utils as pointnet2_stack_utils from pcde...
trader/binance_future_trader.py
xmrio/binance_grid_trader
351
11076721
<reponame>xmrio/binance_grid_trader """ 币安推荐码: 返佣10% https://www.binancezh.pro/cn/register?ref=AIR1GC70 币安合约推荐码: 返佣10% https://www.binancezh.com/cn/futures/ref/51bitquant if you don't have a binance account, you can use the invitation link to register one: https://www.binancezh.com/cn/futures...
test/programytest/storage/stores/sql/store/test_learnf.py
cdoebler1/AIML2
345
11076722
<reponame>cdoebler1/AIML2 import unittest import programytest.storage.engines as Engines from programy.storage.stores.sql.config import SQLStorageConfiguration from programy.storage.stores.sql.engine import SQLStorageEngine from programy.storage.stores.sql.store.learnf import SQLLearnfStore from programytest.storage.a...
pypy/module/micronumpy/nditer.py
nanjekyejoannah/pypy
381
11076726
from rpython.rlib import jit from pypy.interpreter.baseobjspace import W_Root from pypy.interpreter.typedef import TypeDef, GetSetProperty from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault from pypy.interpreter.error import OperationError, oefmt from pypy.module.micronumpy import support, con...
tests/layers/test_convolution.py
FrostByte266/neupy
801
11076727
import random from itertools import product from collections import namedtuple import numpy as np import tensorflow as tf from neupy import layers from neupy.utils import asfloat, shape_to_tuple from neupy.layers.convolutions import conv_output_shape, deconv_output_shape from neupy.exceptions import LayerConnectionEr...
code/run_example.py
binbin-xu/DeeperInverseCompositionalAlgorithm
154
11076736
""" An extremely simple example to show how to run the algorithm @author: <NAME> @date: May 2019 """ import argparse import torch import torch.nn as nn import torch.nn.functional as func import models.LeastSquareTracking as ICtracking from tqdm import tqdm from torch.utils.data import DataLoader from train_utils ...
tests/network/contract/test_verification.py
ActorForth/brownie
122
11076739
from pathlib import Path import pytest import solcx from brownie.project import load, new from brownie.project.compiler.solidity import find_best_solc_version sources = [ ( "contracts/Foo.sol", """ contract Foo { uint256 value_; function value() external view returns(uint256) { re...
pypy/module/micronumpy/test/test_scalar.py
nanjekyejoannah/pypy
381
11076773
<gh_stars>100-1000 # -*- encoding:utf-8 -*- from pypy.module.micronumpy.test.test_base import BaseNumpyAppTest class AppTestScalar(BaseNumpyAppTest): spaceconfig = dict(usemodules=["micronumpy", "binascii", "struct"]) def test_integer_types(self): import numpy as np _32BIT = np.dtype('int').it...
bnpy/allocmodel/topics/HDPTopicRestrictedLocalStep2.py
raphael-group/bnpy
184
11076784
<filename>bnpy/allocmodel/topics/HDPTopicRestrictedLocalStep2.py import numpy as np from scipy.special import digamma, gammaln from bnpy.util import NumericUtil from bnpy.allocmodel import make_xPiVec_and_emptyPi def calcDocTopicCountCorrelationFromTargetToAbsorbingSet( DocTopicMat, ktarget, kabsorbList, MIN...
FastSimulation/Tracking/python/electronCkfTrackCandidates_cff.py
ckamtsikis/cmssw
852
11076795
import FWCore.ParameterSet.Config as cms import FastSimulation.Tracking.TrackCandidateProducer_cfi electronCkfTrackCandidates = FastSimulation.Tracking.TrackCandidateProducer_cfi.trackCandidateProducer.clone( src = cms.InputTag("electronMergedSeeds"), MinNumberOfCrossedLayers = 5, OverlapCleaning = True ...
tests/test_template.py
mkohler/hovercraft
1,089
11076800
import os import unittest from lxml import etree from hovercraft.template import ( Template, CSS_RESOURCE, JS_RESOURCE, JS_POSITION_BODY, JS_POSITION_HEADER, ) TEST_DATA = os.path.join(os.path.split(__file__)[0], "test_data") class TemplateInfoTests(unittest.TestCase): """Tests that template...
python/mxnet_benchmarks/models/resnet.py
joehandzik/dlcookbook-dlbs
123
11076804
<filename>python/mxnet_benchmarks/models/resnet.py # (c) Copyright [2017] Hewlett Packard Enterprise Development LP # # 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.or...
mlcomp/server/back/create_dags/copy.py
lightforever/kaggler
166
11076827
import hashlib import re from mlcomp.utils.config import merge_dicts_smart from mlcomp.utils.io import yaml_load, yaml_dump from mlcomp.db.core import Session from mlcomp.db.enums import ComponentType, TaskStatus from mlcomp.db.models import Dag, Task, TaskDependence, DagStorage, File from mlcomp.db.providers import...
suite/synctools/register.py
akihikodaki/libcapstone
127
11076838
#!/usr/bin/python # print out all registers from LLVM GenRegisterInfo.inc for Capstone disassembler. # NOTE: the list then must be filtered, manually. # by <NAME>, 2019 import sys if len(sys.argv) == 1: print("Syntax: %s <GenRegisterInfo.inc> <architecture>" %sys.argv[0]) sys.exit(1) f = open(sys.argv[1]) li...
scripts/data_extractor.py
GarfieldTheLightning/Dynamic-Pokemon-Expansion
139
11076856
<reponame>GarfieldTheLightning/Dynamic-Pokemon-Expansion #!/usr/bin/env python3 import os ############ #Options go here. ############ ROM_NAME = "BPRE0.gba" #the name of your rom NumberOfPokemon = 440 #Change to total number of species in original rom OutputFolder = os.getcwd() + "/extracted/" SpeciesDefines = os...
replies/factories.py
bllli/Django-China-API
187
11076870
<reponame>bllli/Django-China-API<gh_stars>100-1000 import factory from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from posts.factories import PostFactory from replies.models import Reply from users.factories import UserFactory class SiteFactory(factory.DjangoMo...
698 Partition to K Equal Sum Subsets.py
krishna13052001/LeetCode
872
11076878
<reponame>krishna13052001/LeetCode #!/usr/bin/python3 """ Given an array of integers nums and a positive integer k, find whether it's possible to divide this array into k non-empty subsets whose sums are all equal. Example 1: Input: nums = [4, 3, 2, 3, 5, 2, 1], k = 4 Output: True Explanation: It's possible to divide...
common_utils.py
b01901143/DeepMatchVO
211
11076886
""" <NAME>, HKUST, 2018 Common utility functions """ import os import numpy as np from preprocess_matches import read_feature_repo, read_match_repo, get_inlier_image_coords, compute_fmat_error def complete_batch_size(input_list, batch_size): left = len(input_list) % batch_size if left != 0: for _ in ra...
python/tvm/relay/analysis/sparse_dense.py
XiaoSong9905/tvm
4,640
11076896
# 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, Version 2.0 (the # "License"); you may not u...
pyjswidgets/pyjamas/ui/ClickDelegatePanel.py
takipsizad/pyjs
739
11076926
<reponame>takipsizad/pyjs<filename>pyjswidgets/pyjamas/ui/ClickDelegatePanel.py # Copyright 2006 <NAME> and contributors # Copyright (C) 2009 <NAME> <<EMAIL>> # # 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...
pigar/tests/imports_example/subbar/bar.py
yasirroni/pigar
959
11076937
from subfoo.foo import foo def bar(): foo()
plan.py
qkhy/poetry-seq2seq
186
11076964
#! /usr/bin/env python #-*- coding:utf-8 -*- import os import jieba from gensim import models from random import shuffle, random, randint from utils import uprintln, uprint, DATA_PROCESSED_DIR, split_sentences from data_utils import get_kw_train_data from segment import Segmenter from quatrains import get_quatrains ...
pointer.py
ikostrikov/TensorFlow-Pointer-Networks
223
11076973
<reponame>ikostrikov/TensorFlow-Pointer-Networks # Copyright 2015 Google Inc. 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/LICEN...
tests/test_model_v2_EdmStructTypeSerializer.py
daughterlycare/python-pyodata
142
11076976
"""Tests of OData Model: class VariableDeclaration""" import pytest import datetime from pyodata.v2.model import EdmStructTypeSerializer, Types, StructType, StructTypeProperty from pyodata.exceptions import PyODataException @pytest.fixture def complex_type_property_declarations(): return { 'TestString': ...
pandas/core/computation/api.py
CJL89/pandas
28,899
11076995
<reponame>CJL89/pandas # flake8: noqa from pandas.core.computation.eval import eval
homeassistant/components/recorder/pool.py
andersop91/core
22,481
11077050
<gh_stars>1000+ """A pool for sqlite connections.""" import threading from sqlalchemy.pool import NullPool, StaticPool class RecorderPool(StaticPool, NullPool): """A hybird of NullPool and StaticPool. When called from the creating thread acts like StaticPool When called from any other thread, acts like ...
mindinsight/common/hook/datavisual.py
mindspore-ai/mindinsight
216
11077057
<gh_stars>100-1000 # Copyright 2020 Huawei Technologies Co., Ltd # # 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 ...
bark/pip_package.py
RdecKa/bark
174
11077080
#from core import core #__all__ = ["core"]
trackstats/tests/models.py
keranno/django-trackstats
369
11077086
<reponame>keranno/django-trackstats from django.db import models from django.utils import timezone class Comment(models.Model): user = models.ForeignKey('auth.User', on_delete=models.CASCADE) timestamp = models.DateTimeField(default=timezone.now)
icloudpd/email_notifications.py
mkirkland4874/icloud_photos_downloader
1,514
11077100
"""Send an email notification when 2SA is expired""" import smtplib import datetime from icloudpd.logger import setup_logger # pylint: disable-msg=too-many-arguments def send_2sa_notification( smtp_email, smtp_password, smtp_host, smtp_port, smtp_no_tls, to_addr ): """Send an email notification when 2SA...
blogs/migrations/0037_blog_lang.py
daaawx/bearblog
657
11077126
<reponame>daaawx/bearblog # Generated by Django 3.0.7 on 2021-06-29 17:00 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('blogs', '0036_blog_challenge'), ] operations = [ migrations.AddField( model_name='blog', n...
src/onedrivesdk/model/shared_collection_page.py
meson800/onedrive-sdk-python
912
11077133
<reponame>meson800/onedrive-sdk-python<gh_stars>100-1000 # -*- coding: utf-8 -*- ''' # Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. # # This file was generated and any changes will be overwritten. ''' from __fut...
python/base_agent/ttad/ttad_transformer_model/recombine_data.py
yjernite/craftassist
626
11077166
import argparse import ast import copy import json import os import random from recombine_data_utils import * from typing import * def create_train_valid_split(chunk_index: int, k: int, data_dir: str, output_dir: str): """Create partitions for k fold Cross Validation Given a chunk index for the valid set, cr...
spafe/features/mfcc.py
SuperKogito/cautious-palm-tree
205
11077178
<gh_stars>100-1000 import numpy as np from ..utils.spectral import rfft, dct from ..utils.cepstral import cms, cmvn, lifter_ceps from ..utils.exceptions import ParameterError, ErrorMsgs from ..utils.spectral import power_spectrum, audspec, postaud, invpostaud from ..fbanks.mel_fbanks import inverse_mel_filter_banks, me...
srgan/predict.py
xwshi/GAN-keras
197
11077209
<gh_stars>100-1000 from keras_contrib.layers.normalization.instancenormalization import InstanceNormalization from keras.layers import Input, Dense, Reshape, Flatten, Dropout, Concatenate from keras.layers import BatchNormalization, Activation, ZeroPadding2D, Add from keras.layers.advanced_activations import PReLU, ...
setup.py
Rosuav/vdf
110
11077235
<reponame>Rosuav/vdf #!/usr/bin/env python from setuptools import setup from codecs import open from os import path import vdf here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='vdf', version=vdf.__version_...
SpiderKeeper/app/schedulers/common.py
fakegit/SpiderKeeper
2,758
11077248
import threading import time from SpiderKeeper.app import scheduler, app, agent, db from SpiderKeeper.app.spider.model import Project, JobInstance, SpiderInstance def sync_job_execution_status_job(): ''' sync job execution running status :return: ''' for project in Project.query.all(): ag...
tutorials/13-joint_inversion/plot_inv_3_cross_gradient_pf.py
Prithwijit-Chak/simpeg
358
11077267
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Cross-gradient Joint Inversion of Gravity and Magnetic Anomaly Data =================================================================== Here we simultaneously invert gravity and magentic data using cross-gradient constraint. The recovered density and susceptibility m...
hooks/install.py
guiled/Acktie-Mobile-Android-Barcode
130
11077269
<filename>hooks/install.py #!/usr/bin/env python # # This is the module install hook that will be # called when your module is first installed # import os, sys def main(args,argc): # TODO: write your install hook here (optional) # exit sys.exit(0) if __name__ == '__main__': main(sys.argv,len(sys.argv))...
aztk/client/cluster/helpers/list.py
Geims83/aztk
161
11077297
<filename>aztk/client/cluster/helpers/list.py from aztk import models from aztk.utils import constants def list_clusters(cluster_client, software_metadata_key): """ List all the cluster on your account. """ pools = cluster_client.batch_client.pool.list() software_metadata = (constants.AZTK_SOF...
azure-iot-device/tests/iothub/pipeline/test_config.py
danewalton/azure-iot-sdk-python
366
11077314
<gh_stars>100-1000 # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ------------------------------------------------------------------...
venv/Lib/site-packages/isapi/simple.py
ajayiagbebaku/NFL-Model
150
11077325
"""Simple base-classes for extensions and filters. None of the filter and extension functions are considered 'optional' by the framework. These base-classes provide simple implementations for the Initialize and Terminate functions, allowing you to omit them, It is not necessary to use these base-classes - but if you...
solthiruthi/solthiruthi.py
aathi2002/open-tamil
218
11077359
## -*- coding: utf-8 -*- ## (C) 2015 <NAME>, ## from __future__ import print_function import argparse import sys import tamil # from pprint import pprint PYTHON3 = sys.version[0] == "3" class Solthiruthi: @staticmethod def get_CLI_options(do_parse=True, DEBUG=False): # Ref: ArgParse doc - https://...
mint/utils/inputs_util.py
wqliu657/mint
241
11077366
# Copyright 2021, 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...