max_stars_repo_path
stringlengths
3
269
max_stars_repo_name
stringlengths
4
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.05M
score
float64
0.23
5.13
int_score
int64
0
5
benchmarks/SimResults/combinations_spec_mylocality/oldstuff/cmp_soplexmcfcalculixgcc/power.py
TugberkArkose/MLScheduler
0
10200
<filename>benchmarks/SimResults/combinations_spec_mylocality/oldstuff/cmp_soplexmcfcalculixgcc/power.py power = {'BUSES': {'Area': 1.33155, 'Bus/Area': 1.33155, 'Bus/Gate Leakage': 0.00662954, 'Bus/Peak Dynamic': 0.0, 'Bus/Runtime Dynamic': 0.0, 'Bus/Subthreshold L...
1.289063
1
packages/gtmcore/gtmcore/environment/conda.py
gigabackup/gigantum-client
60
10201
from typing import List, Dict import json from gtmcore.http import ConcurrentRequestManager, ConcurrentRequest from gtmcore.environment.packagemanager import PackageManager, PackageResult, PackageMetadata from gtmcore.container import container_for_context from gtmcore.labbook import LabBook from gtmcore.logging impor...
2.359375
2
netchos/io/io_mpl_to_px.py
brainets/netchos
11
10202
<gh_stars>10-100 """Conversion of Matplotlib / Seaborn inputs to plotly.""" import os.path as op from pkg_resources import resource_filename import json def mpl_to_px_inputs(inputs, plt_types=None): """Convert typical matplotlib inputs to plotly to simplify API. Parameters ---------- inputs : dict ...
3.046875
3
fizzbuzz_for_02.py
toastyxen/FizzBuzz
0
10203
"""Fizzbuzz for loop variant 3""" for x in range(1, 101): OUTPUT = "" if x % 3 == 0: OUTPUT += "Fizz" if x % 5 == 0: OUTPUT += "Buzz" print(OUTPUT or x)
3.890625
4
cnn/struct/layer/parse_tensor_module.py
hslee1539/GIS_GANs
0
10204
from tensor.main_module import Tensor import numpy as np def getTensor(value): if type(value) is np.ndarray: return Tensor.numpy2Tensor(value) elif type(value) is Tensor: return value else: raise Exception
2.84375
3
openstack_dashboard/dashboards/admin/volume_types/qos_specs/forms.py
hemantsonawane95/horizon-apelby
0
10205
<reponame>hemantsonawane95/horizon-apelby<filename>openstack_dashboard/dashboards/admin/volume_types/qos_specs/forms.py # 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.apach...
1.921875
2
data_structure/const_tree.py
alipay/StructuredLM_RTDT
42
10206
<reponame>alipay/StructuredLM_RTDT # coding=utf-8 # Copyright (c) 2021 <NAME> import sys LABEL_SEP = '@' INDENT_STRING1 = '│   ' INDENT_STRING2 = '├──' EMPTY_TOKEN = '___EMPTY___' def print_tree(const_tree, indent=0, out=sys.stdout): for i in range(indent - 1): out.write(INDENT_STRING1) if indent >...
2.78125
3
tests/test_minimize.py
The-Ludwig/iminuit
0
10207
<filename>tests/test_minimize.py import pytest from iminuit import minimize import numpy as np from numpy.testing import assert_allclose, assert_equal opt = pytest.importorskip("scipy.optimize") def func(x, *args): c = args[0] if args else 1 return c + x[0] ** 2 + (x[1] - 1) ** 2 + (x[2] - 2) ** 2 def grad...
2.4375
2
murtanto/parsing.py
amandatv20/botfb
1
10208
<filename>murtanto/parsing.py # coded by: salism3 # 23 - 05 - 2020 23:18 (<NAME>) from bs4 import BeautifulSoup as parser from . import sorting import re def to_bs4(html): return parser(html, "html.parser") def refsrc(html): return True if re.search(r'http.+\Wrefsrc', html) else False def parsing_hre...
2.859375
3
test/test_watchdog_status.py
ike709/tgs4-api-pyclient
0
10209
# coding: utf-8 """ TGS API A production scale tool for BYOND server management # noqa: E501 OpenAPI spec version: 9.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import swagger_client from swagger_client.model...
1.75
2
setup.py
joesan/housing-classification-example
0
10210
from setuptools import find_packages, setup setup( name='src', packages=find_packages(), version='0.1.0', description='Python codebase for the housing classification ML problem', author='Joesan', license='', )
1.054688
1
tests/test_models/test_backbones/test_sr_backbones/test_edvr_net.py
wangruohui/mmediting
45
10211
# Copyright (c) OpenMMLab. All rights reserved. import pytest import torch from mmedit.models.backbones.sr_backbones.edvr_net import (EDVRNet, PCDAlignment, TSAFusion) def test_pcd_alignment(): "...
2.109375
2
mat2py/core/datastoreio.py
mat2py/mat2py
0
10212
# type: ignore __all__ = [ "readDatastoreImage", "datastore", ] def readDatastoreImage(*args): raise NotImplementedError("readDatastoreImage") def datastore(*args): raise NotImplementedError("datastore")
1.804688
2
enjoliver-api/tests/test_generate_groups.py
netturpin/enjoliver
11
10213
import os from shutil import rmtree from tempfile import mkdtemp from unittest import TestCase from enjoliver import generator class GenerateGroupTestCase(TestCase): api_uri = None test_matchbox_path = None test_resources_path = None tests_path = None @classmethod def setUpClass(cls): ...
2.375
2
HackerRank/Calendar Module/solution.py
nikku1234/Code-Practise
9
10214
# Enter your code here. Read input from STDIN. Print output to STDOUT import calendar mm,dd,yyyy = map(int,input().split()) day = ["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"] val = int (calendar.weekday(yyyy,mm,dd)) print(day[val])
3.8125
4
scale/trigger/models.py
stevevarner/scale
0
10215
"""Defines the models for trigger rules and events""" from __future__ import unicode_literals import django.contrib.postgres.fields from django.db import models, transaction from django.utils.timezone import now class TriggerEventManager(models.Manager): """Provides additional methods for handling trigger events...
2.765625
3
leetcode/0506_relative_ranks.py
chaosWsF/Python-Practice
0
10216
""" Given scores of N athletes, find their relative ranks and the people with the top three highest scores, who will be awarded medals: "Gold Medal", "Silver Medal" and "Bronze Medal". Example 1: Input: [5, 4, 3, 2, 1] Output: ["Gold Medal", "Silver Medal", "Bronze Medal", "4", "5"] Explanation: The fir...
4.09375
4
barriers/models/history/assessments/economic_impact.py
felix781/market-access-python-frontend
1
10217
from ..base import BaseHistoryItem, GenericHistoryItem from ..utils import PolymorphicBase class ArchivedHistoryItem(BaseHistoryItem): field = "archived" field_name = "Valuation assessment: Archived" def get_value(self, value): if value is True: return "Archived" elif value is...
2.703125
3
link_prob_show.py
Rheinwalt/spatial-effects-networks
3
10218
<filename>link_prob_show.py import sys import numpy as np from sern import * ids, lon, lat = np.loadtxt('nodes', unpack = True) links = np.loadtxt('links', dtype = 'int') A, b = AdjacencyMatrix(ids, links) lon, lat = lon[b], lat[b] n = A.shape[0] # LinkProbability expects A as triu A = A[np.triu_indices(n, 1)] # pla...
2.421875
2
controller/components/app.py
isabella232/flight-lab
15
10219
# Copyright 2018 Flight Lab authors. # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
2.21875
2
botorch/acquisition/__init__.py
jmren168/botorch
1
10220
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved from .acquisition import AcquisitionFunction from .analytic import ( AnalyticAcquisitionFunction, ConstrainedExpectedImprovement, ExpectedImprovement, NoisyExpectedImprovement, PosteriorMean, Probabil...
1.335938
1
examples/pybullet/gym/pybullet_envs/minitaur/envs/env_randomizers/minitaur_alternating_legs_env_randomizer.py
felipeek/bullet3
9,136
10221
"""Randomize the minitaur_gym_alternating_leg_env when reset() is called. The randomization include swing_offset, extension_offset of all legs that mimics bent legs, desired_pitch from user input, battery voltage and motor damping. """ import os, inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(in...
2.703125
3
pygsti/modelmembers/states/tensorprodstate.py
pyGSTi-Developers/pyGSTi
73
10222
""" The TensorProductState class and supporting functionality. """ #*************************************************************************************************** # Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS). # Under the terms of Contract DE-NA0003525 with NTESS, the U....
1.8125
2
edivorce/apps/core/views/graphql.py
gerritvdm/eDivorce
6
10223
<filename>edivorce/apps/core/views/graphql.py import graphene import graphene_django from django.http import HttpResponseForbidden from graphene_django.views import GraphQLView from graphql import GraphQLError from edivorce.apps.core.models import Document class PrivateGraphQLView(GraphQLView): def dispatch(self...
2.25
2
amazing/maze.py
danieloconell/maze-solver
0
10224
from .exceptions import MazeNotSolved, AlgorithmNotFound from .dijkstra import Dijkstra from .astar import Astar from functools import wraps import warnings from daedalus import Maze as _maze from PIL import Image warnings.simplefilter("once", UserWarning) class Maze: """ Create a maze and solve it. A...
3.359375
3
config.py
FarbodFarhangfar/midi_player_python
0
10225
<reponame>FarbodFarhangfar/midi_player_python import os def get_note_dic(): _note_dic = {'C': 0, 'C#': 1, 'Db': 1, 'D': 2, 'D#': 3, 'Eb': 3, 'E': 4, 'F': 5, 'F#': 6, 'Gb': 6, 'G': 7, 'G#': 8, 'Ab': 8, 'A': 9, 'A#': 10, 'Bb': 10, 'B': 11} return _note_dic def get_value_list(...
2.546875
3
roles/openshift_health_checker/library/ocutil.py
shgriffi/openshift-ansible
164
10226
#!/usr/bin/python """Interface to OpenShift oc command""" import os import shlex import shutil import subprocess from ansible.module_utils.basic import AnsibleModule ADDITIONAL_PATH_LOOKUPS = ['/usr/local/bin', os.path.expanduser('~/bin')] def locate_oc_binary(): """Find and return oc binary file""" # htt...
2.46875
2
code/network/__init__.py
michalochman/complex-networks
0
10227
import fractions class Network(object): def __init__(self, network): self.network = network def degree(self, link_type, key): return len(self.network.get(link_type).get(key)) def average_degree(self, link_type): degree = 0 for link in self.network.get(link_type).itervalue...
3.34375
3
invoke_ansible.py
samvarankashyap/ansible_api_usage
0
10228
import ansible import pprint from ansible import utils from jinja2 import Environment, PackageLoader from collections import namedtuple from ansible import utils from ansible.parsing.dataloader import DataLoader from ansible.vars import VariableManager from ansible.inventory import Inventory from ansible.executor.playb...
2.03125
2
bin/python/csv2es.py
reid-wagner/proteomics-pipelines
2
10229
#!/usr/bin/env python3 import itertools import string from elasticsearch import Elasticsearch,helpers import sys import os from glob import glob import pandas as pd import json host = sys.argv[1] port = int(sys.argv[2]) alias = sys.argv[3] print(host) print(port) print(alias) es = Elasticsearch([{'host':...
2.796875
3
main/src/preparation/parsers/tree-sitter-python/examples/crlf-line-endings.py
jason424217/Artificial-Code-Gen
0
10230
<filename>main/src/preparation/parsers/tree-sitter-python/examples/crlf-line-endings.py<gh_stars>0 print a if b: if c: d e
1.835938
2
Src/main.py
DukeA/DAT02X-19-03-MachineLearning-Starcraft2
0
10231
from absl import app from mainLoop import main if __name__ == '__main__': app.run(main)
1.25
1
bos_sarcat_scraper/__main__.py
hysds/bos_sarcat_scraper
1
10232
<gh_stars>1-10 from __future__ import absolute_import from builtins import str from builtins import input import sys import argparse from . import bosart_scrape import datetime import json def valid_date(s): try: try: date = datetime.datetime.strptime(s, "%Y-%m-%dT%H:%M:%S.%fZ") except...
3
3
vgm2electron.py
simondotm/vgm2electron
2
10233
#!/usr/bin/env python # vgm2electron.py # Tool for converting SN76489-based PSG VGM data to Acorn Electron # By <NAME> (https://github.com/simondotm/) # See https://github.com/simondotm/vgm-packer # # Copyright (c) 2019 <NAME>. All rights reserved. # # "MIT License": # Permission is hereby granted, free of charge, to a...
1.6875
2
twitter_sent.py
rthorst/TwitterSentiment
6
10234
<gh_stars>1-10 import webapp2 import tweepy import json import csv import os import statistics import bokeh from bokeh.io import show, output_file from bokeh.plotting import figure from bokeh.models import HoverTool, ColumnDataSource from bokeh.embed import components, json_item from bokeh.resources import INLINE from ...
3
3
tests/testcgatools.py
ereide/pyga-camcal
5
10235
<reponame>ereide/pyga-camcal<gh_stars>1-10 import unittest import clifford as cl from clifford import g3c from numpy import pi, e import numpy as np from scipy.sparse.linalg.matfuncs import _sinch as sinch from clifford import MultiVector from pygacal.common.cgatools import ( Sandwich, Dilator, Translator, Reflec...
1.921875
2
router/posts.py
DiegoLing33/prestij.xyz-api
0
10236
# ██╗░░░░░██╗███╗░░██╗░██████╗░░░░██████╗░██╗░░░░░░█████╗░░█████╗░██╗░░██╗ # ██║░░░░░██║████╗░██║██╔════╝░░░░██╔══██╗██║░░░░░██╔══██╗██╔══██╗██║░██╔╝ # ██║░░░░░██║██╔██╗██║██║░░██╗░░░░██████╦╝██║░░░░░███████║██║░░╚═╝█████═╝░ # ██║░░░░░██║██║╚████║██║░░╚██╗░░░██╔══██╗██║░░░░░██╔══██║██║░░██╗██╔═██╗░ # ███████╗██║██...
2.171875
2
toontown/catalog/CatalogChatBalloon.py
CrankySupertoon01/Toontown-2
1
10237
<filename>toontown/catalog/CatalogChatBalloon.py from pandac.PandaModules import * class CatalogChatBalloon: TEXT_SHIFT = (0.1, -0.05, 1.1) TEXT_SHIFT_REVERSED = -0.05 TEXT_SHIFT_PROP = 0.08 NATIVE_WIDTH = 10.0 MIN_WIDTH = 2.5 MIN_HEIGHT = 1 BUBBLE_PADDING = 0.3 BUBBLE_PADDING_PROP = 0....
2.796875
3
TTS/vocoder/tf/utils/io.py
mightmay/Mien-TTS
0
10238
import datetime import pickle import tensorflow as tf def save_checkpoint(model, current_step, epoch, output_path, **kwargs): """ Save TF Vocoder model """ state = { 'model': model.weights, 'step': current_step, 'epoch': epoch, 'date': datetime.date.today().strftime("%B %d, %Y"...
2.46875
2
tests/test_path_choice.py
jataware/flee
3
10239
<reponame>jataware/flee from flee import flee """ Generation 1 code. Incorporates only distance, travel always takes one day. """ def test_path_choice(): print("Testing basic data handling and simulation kernel.") flee.SimulationSettings.MinMoveSpeed = 5000.0 flee.SimulationSettings.MaxMoveSpeed = 5000....
3.015625
3
archive/old_plots/plot_supplemental_divergence_correlations.py
garudlab/mother_infant
2
10240
<reponame>garudlab/mother_infant<filename>archive/old_plots/plot_supplemental_divergence_correlations.py import matplotlib matplotlib.use('Agg') import config import parse_midas_data import parse_HMP_data import os.path import pylab import sys import numpy import diversity_utils import gene_diversity_utils import c...
1.703125
2
multivis/plotFeatures.py
brettChapman/cimcb_vis
1
10241
import sys import copy import matplotlib import matplotlib.pyplot as plt import seaborn as sns from collections import Counter from .utils import * import numpy as np import pandas as pd class plotFeatures: usage = """Produces different feature plots given a data table and peak table. Initial_Paramete...
3.1875
3
core/data/DataWriter.py
berendkleinhaneveld/Registrationshop
25
10242
<reponame>berendkleinhaneveld/Registrationshop<gh_stars>10-100 """ DataWriter.py """ from DataController import DataController from DataReader import DataReader from vtk import vtkMetaImageWriter from vtk import vtkXMLImageDataWriter class DataWriter(DataController): """ DataWriter writes an image data object to ...
2.5
2
parkings/models/permit.py
klemmari1/parkkihubi
12
10243
from itertools import chain from django.conf import settings from django.contrib.gis.db import models as gis_models from django.db import models, router, transaction from django.utils import timezone from django.utils.translation import gettext_lazy as _ from ..fields import CleaningJsonField from ..validators import...
1.984375
2
poi_mining/biz/LSA/logEntropy.py
yummydeli/machine_learning
1
10244
<filename>poi_mining/biz/LSA/logEntropy.py #!/usr/bin/env python # encoding:utf-8 # ############################################################################## # The MIT License (MIT) # # Copyright (c) [2015] [baidu.com] # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this soft...
1.210938
1
Python/swap_numbers.py
saurabhcommand/Hello-world
1,428
10245
a = 5 b = 7 a,b = b,a print a print b
2.328125
2
algorithms/tests/test_unionfind.py
tommyod/PythonAlgorithms
1
10246
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Tests for the union find data structure. """ try: from ..unionfind import UnionFind except ValueError: pass def test_unionfind_basics(): """ Test the basic properties of unionfind. """ u = UnionFind([1, 2, 3]) assert u.in_same_set(1,...
3.46875
3
a3/ga.py
mishless/LearningSystems
1
10247
<filename>a3/ga.py # Genetic Algorithm for solving the Traveling Salesman problem # Authors: <NAME>, <NAME> # Includes import configparser import math import matplotlib.pyplot as plt import numpy import random import sys from operator import itemgetter #Global variables(yay!) # Configuration variables(read from co...
2.9375
3
products/migrations/0010_remove_product_updated_at.py
UB-ES-2021-A1/wannasell-backend
0
10248
# Generated by Django 3.2.8 on 2021-11-25 17:50 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('products', '0009_auto_20211125_1846'), ] operations = [ migrations.RemoveField( model_name='product', name='updated_at', ...
1.296875
1
ResumeAnalyser/apps.py
samyakj2307/recruitai_resume_backend
0
10249
<gh_stars>0 from django.apps import AppConfig class ResumeanalyserConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'ResumeAnalyser'
1.28125
1
plugins/core/player_manager_plugin/__init__.py
StarryPy/StarryPy-Historic
38
10250
<filename>plugins/core/player_manager_plugin/__init__.py<gh_stars>10-100 from plugins.core.player_manager_plugin.plugin import PlayerManagerPlugin from plugins.core.player_manager_plugin.manager import ( Banned, UserLevels, permissions, PlayerManager )
1.210938
1
src/config/svc-monitor/svc_monitor/services/loadbalancer/drivers/ha_proxy/custom_attributes/haproxy_validator.py
jnpr-pranav/contrail-controller
37
10251
from builtins import str from builtins import range from builtins import object import logging import inspect import os class CustomAttr(object): """This type handles non-flat data-types like int, str, bool. """ def __init__(self, key, value): self._value = value self._key = key ...
2.96875
3
python/janitor/typecache.py
monkeyman79/janitor
2
10252
import gdb class TypeCache(object): def __init__(self): self.cache = {} self.intptr_type = False def clear(self): self.cache = {} self.intptr_type = False def get_type(self, typename): if typename in self.cache: return self.cache[typename] ...
2.453125
2
key_phrase.py
Santara/autoSLR
1
10253
import os import sys directory = sys.argv[1] outfile = open("key_phrases.csv","w") files = {} for filename in os.listdir(directory): text=[] with open(os.path.join(directory, filename)) as f: text=[l.strip() for l in f if len(l.strip())>2] data='' for t in text: if len(t.split()) > 1: data = data+'. '+t.s...
2.65625
3
tests/test_utils.py
aced-differentiate/dft-input-gen
1
10254
"""Unit tests for helper utilities in :mod:`dftinputgen.utils`.""" import os import pytest from ase import io as ase_io from dftinputgen.utils import get_elem_symbol from dftinputgen.utils import read_crystal_structure from dftinputgen.utils import get_kpoint_grid_from_spacing from dftinputgen.utils import DftInputG...
2.515625
3
core/models.py
nforesperance/Django-Channels-ChatApp
2
10255
from django.contrib.auth.models import User from django.db.models import (Model, TextField, DateTimeField, ForeignKey, CASCADE) from asgiref.sync import async_to_sync from channels.layers import get_channel_layer from django.db import models import json class MessageModel(Model): ""...
2.328125
2
backup/model.py
jsikyoon/ASNP-RMR
8
10256
<reponame>jsikyoon/ASNP-RMR import tensorflow as tf import numpy as np # utility methods def batch_mlp(input, output_sizes, variable_scope): """Apply MLP to the final axis of a 3D tensor (reusing already defined MLPs). Args: input: input tensor of shape [B,n,d_in]. output_sizes: An iterable containing t...
2.65625
3
minotaur/_minotaur.py
giannitedesco/minotaur
172
10257
<filename>minotaur/_minotaur.py from typing import Dict, Tuple, Optional from pathlib import Path import asyncio from ._mask import Mask from ._event import Event from ._base import InotifyBase __all__ = ('Minotaur',) class Notification: __slots__ = ( '_path', '_type', '_isdir', ...
2.34375
2
pyclustering/container/examples/__init__.py
JosephChataignon/pyclustering
1,013
10258
<reponame>JosephChataignon/pyclustering """! @brief Collection of examples devoted to containers. @authors <NAME> (<EMAIL>) @date 2014-2020 @copyright BSD-3-Clause """
1.054688
1
novelty-detection/train_wood_vgg19.py
matherm/python-data-science
1
10259
<reponame>matherm/python-data-science import argparse import sys import torch import numpy as np import torch.nn as nn from torch.utils.data import DataLoader from torchvision.datasets import MNIST from torchvision.datasets import CIFAR10 import torchvision.transforms as transforms import matplotlib.pyplot as plt pars...
2.546875
3
sample_architectures/cnn.py
hvarS/PyTorch-Refer
0
10260
# -*- coding: utf-8 -*- """CNN.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1Tq6HUya2PrC0SmyOIFo2c_eVtguRED2q """ import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from torch.utils.data import DataL...
3.125
3
aispace/layers/callbacks/qa_evaluators.py
SmileGoat/AiSpace
32
10261
<reponame>SmileGoat/AiSpace # -*- coding: utf-8 -*- # @Time : 2020-07-30 15:06 # @Author : yingyuankai # @Email : <EMAIL> # @File : qa_evaluators.py import os import logging import numpy as np import tensorflow as tf import json from pprint import pprint from collections import defaultdict from aispace.util...
2.15625
2
tests/conftest.py
junjunjunk/torchgpipe
532
10262
<reponame>junjunjunk/torchgpipe import pytest import torch @pytest.fixture(autouse=True) def manual_seed_zero(): torch.manual_seed(0) @pytest.fixture(scope='session') def cuda_sleep(): # Warm-up CUDA. torch.empty(1, device='cuda') # From test/test_cuda.py in PyTorch. start = torch.cuda.Event(en...
2.1875
2
lib/python/treadmill/scheduler/__init__.py
drienyov/treadmill
0
10263
"""Treadmill hierarchical scheduler. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import abc import collections import datetime import heapq import itertools import logging import operator import sys import tim...
2.3125
2
banners/bannerRan.py
gothyyy/AIDungeon
1
10264
<filename>banners/bannerRan.py import random import sys import time import json import os import warnings import numpy as np import glob, os stat_mini = 1 stat_max = 0 listBanners = [] #HOW TO USE IT: #1 copy the opening.txt #2 remove the graphic (but do keep top logo for consistency) #3 add ASCII art that i...
3.1875
3
BondMarket/app/theme_lib.py
Meith0717/BondMarket
0
10265
<reponame>Meith0717/BondMarket<filename>BondMarket/app/theme_lib.py from dataclasses import dataclass @dataclass class theme: name : str bg_color : str fg_color : str lb_color : str ttk_theme : str LIGHT = theme( name='LIGHT', bg_color=None, ...
2.265625
2
run.py
rimijoker/CA-MTL
1
10266
import os import sys import re import json import logging import torch from transformers import ( HfArgumentParser, set_seed, AutoTokenizer, AutoConfig, EvalPrediction, ) from src.model.ca_mtl import CaMtl, CaMtlArguments from src.utils.misc import MultiTaskDataArguments, Split from src.mtl_traine...
1.851563
2
examples/readWebsocket.py
uadlq/PhyPiDAQ-PiOS11
0
10267
#!/usr/bin/env python3 """Read data in CSV format from websocket """ import sys import asyncio import websockets # read url from command line if len(sys.argv) >= 2: uri = sys.argv[1] else: # host url and port uri = "ws://localhost:8314" print("*==* ", sys.argv[0], " Lese Daten von url ", uri) async def ...
3.171875
3
settings/__init__.py
arcana261/python-grpc-boilerplate
0
10268
<gh_stars>0 import os import sys import itertools import json _NONE = object() class SettingManager: _sentry = object() def __init__(self): self.env = os.getenv('ENV', 'prd') try: self._default = __import__('settings.default', fromlist=['*']) except ModuleNotFoundError: ...
2.3125
2
roblox/partials/partialgroup.py
speer-kinjo/ro.py
28
10269
""" This file contains partial objects related to Roblox groups. """ from __future__ import annotations from typing import TYPE_CHECKING from ..bases.basegroup import BaseGroup from ..bases.baseuser import BaseUser if TYPE_CHECKING: from ..client import Client class AssetPartialGroup(BaseGroup): """ R...
2.921875
3
services/UserService.py
erginbalta/FarmChain
1
10270
<filename>services/UserService.py import mysql.connector import socket from contextlib import closing import json import random packetType= ["INF","TRN","USR"] database = mysql.connector.connect( host="localhost", user="root", port="3307", passwd="<PASSWORD>", database="farmchain" ) def userIdCrea...
2.484375
2
tests/blackbox/access_settings/test_bb_access_settings.py
csanders-git/waflz
1
10271
#!/usr/bin/python '''Test WAF Access settings''' #TODO: make so waflz_server only runs once and then can post to it # ------------------------------------------------------------------------------ # Imports # ------------------------------------------------------------------------------ import pytest import subprocess...
1.789063
2
cosmosis/runtime/analytics.py
ktanidis2/Modified_CosmoSIS_for_galaxy_number_count_angular_power_spectra
1
10272
<gh_stars>1-10 #coding: utf-8 from __future__ import print_function from builtins import zip from builtins import object from cosmosis import output as output_module import numpy as np import sys import os class Analytics(object): def __init__(self, params, pool=None): self.params = params self.p...
2.453125
2
sdcc2elf.py
Vector35/llil_transpiler
14
10273
<filename>sdcc2elf.py #!/usr/bin/env python # # convert SDCC .rel files to 32-bit ELF relocatable # # resulting file is simple: # # ------------------------ # ELF header # ------------------------ # .text section # .shstrtab section # .strtab section # .symtab section # ------------------------ # NULL elf32_shdr # .tex...
2.546875
3
eval.py
nikinsta/deep-siamese-text-similarity-on-python-3
0
10274
#! /usr/bin/env python import tensorflow as tf import numpy as np import os import time import datetime from tensorflow.contrib import learn from input_helpers import InputHelper # Parameters # ================================================== # Eval Parameters tf.flags.DEFINE_integer("batch_size", 64, "Batch Size (...
2.296875
2
accounts/views.py
nikhiljohn10/django-auth
0
10275
<gh_stars>0 from django.urls import reverse from django.conf import settings from django.contrib import messages from django.shortcuts import render, redirect from django.core.mail import send_mail from django.contrib.auth import login, logout, views, authenticate from django.views.generic.edit import CreateView from d...
2.09375
2
python/testData/intentions/PyAnnotateVariableTypeIntentionTest/annotationTupleType.py
truthiswill/intellij-community
2
10276
v<caret>ar = (1, 'foo', None)
1.304688
1
bot/venv/lib/python3.7/site-packages/scipy/version.py
manaccac/sc2_bot
76
10277
<gh_stars>10-100 # THIS FILE IS GENERATED FROM SCIPY SETUP.PY short_version = '1.5.4' version = '1.5.4' full_version = '1.5.4' git_revision = '19acfed431060aafaa963f7e530c95e70cd4b85c' release = True if not release: version = full_version
1.023438
1
emrichen/input/__init__.py
jbek7/emrichen
0
10278
<reponame>jbek7/emrichen from typing import TextIO, Union from .json import load_json from .yaml import load_yaml PARSERS = { 'yaml': load_yaml, 'json': load_json, } def parse(data: Union[TextIO, str], format: str): if format in PARSERS: return PARSERS[format](data) else: raise Value...
2.8125
3
sdk/python/pulumi_aws_native/workspaces/get_workspace.py
pulumi/pulumi-aws-native
29
10279
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from...
1.828125
2
testtools/__init__.py
afy2103/spambayes-9-10-Frozen
0
10280
__author__ = 'AlexYang'
0.953125
1
tests/test_distance.py
mkclairhong/quail
1
10281
<reponame>mkclairhong/quail # -*- coding: utf-8 -*- from quail.distance import * import numpy as np import pytest from scipy.spatial.distance import cdist def test_match(): a = 'A' b = 'B' assert np.equal(match(a, b), 1) def test_euclidean_list(): a = [0, 1, 0] b = [0, 1, 0] assert np.equal(e...
2.515625
3
utils/manisfestManager.py
ovitrac/pizza3
1
10282
#!/usr/bin/env python ############################################################################### # # # manifestManager.py # # ...
1.484375
1
temperature.py
rhwlr/TEST_PRELIM_SKILLS_EXAM
0
10283
class Temperature: def __init__(self, kelvin=None, celsius=None, fahrenheit=None): values = [x for x in [kelvin, celsius, fahrenheit] if x] if len(values) < 1: raise ValueError('Need argument') if len(values) > 1: raise ValueError('Only one argument') if ce...
3.671875
4
af/shovel/test_canning.py
mimi89999/pipeline
0
10284
<gh_stars>0 #!/usr/bin/env python2.7 import unittest import canning class TestNop(unittest.TestCase): def test_nop(self): canning.NopTeeFd.write("asdf") class TestSlice(unittest.TestCase): REPORT = "20130505T065614Z-VN-AS24173-dns_consistency-no_report_id-0.1.0-probe.yaml" @staticmethod d...
2.53125
3
Exercicios/ex061.py
jlsmirandela/Curso_Python
0
10285
<reponame>jlsmirandela/Curso_Python print('-+-' *10) print(' <NAME> PA') print('+-+' * 10) c = 1 ter = int(input('Insira o primeiro termo - ')) rz = int(input('Insira a razão - ')) while c <= 10: print(ter, ' → ', end=' ') ter += rz c += 1 print('FIM')
3.671875
4
gpytorch/models/approximate_gp.py
phumm/gpytorch
1
10286
<reponame>phumm/gpytorch #!/usr/bin/env python3 from .gp import GP from .pyro import _PyroMixin # This will only contain functions if Pyro is installed class ApproximateGP(GP, _PyroMixin): def __init__(self, variational_strategy): super().__init__() self.variational_strategy = variational_strate...
2.390625
2
tests/test_ping.py
d-wysocki/flask-resty
86
10287
import pytest from flask_resty import Api from flask_resty.testing import assert_response # ----------------------------------------------------------------------------- @pytest.fixture(autouse=True) def routes(app): api = Api(app, "/api") api.add_ping("/ping") # ------------------------------------------...
2.453125
2
tests/test_vetters.py
pllim/exovetter
0
10288
<filename>tests/test_vetters.py from numpy.testing import assert_allclose from astropy.io import ascii from astropy import units as u import lightkurve as lk from exovetter import const as exo_const from exovetter import vetters from exovetter.tce import Tce from astropy.utils.data import get_pkg_data_filename def ...
2.234375
2
pyqtgraph/dockarea/DockDrop.py
hishizuka/pyqtgraph
2,762
10289
<reponame>hishizuka/pyqtgraph # -*- coding: utf-8 -*- from ..Qt import QtCore, QtGui class DockDrop(object): """Provides dock-dropping methods""" def __init__(self, allowedAreas=None): object.__init__(self) if allowedAreas is None: allowedAreas = ['center', 'right', 'left', 'top', '...
2.890625
3
data/download.py
pyaf/google-ai-open-images-object-detection-track
0
10290
import os from subprocess import call files = ['000002b66c9c498e.jpg', '000002b97e5471a0.jpg', '000002c707c9895e.jpg', '0000048549557964.jpg', '000004f4400f6ec5.jpg', '0000071d71a0a6f6.jpg', '000013ba71c12506.jpg', '000018acd19b4ad3.jpg', '00001bc2c4027449.jpg', '00001bcc92282a38.jpg', '0000201cd362f303.jpg', '0000207...
2.21875
2
cisco-ios-xr/ydk/models/cisco_ios_xr/SNMP_FRAMEWORK_MIB.py
bopopescu/ACI
0
10291
""" SNMP_FRAMEWORK_MIB """ from collections import OrderedDict from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64 from ydk.filters import YFilter from ydk.errors import YError, YModelError from ydk.errors.error_handler import handle_type_er...
2.09375
2
handlers/redirects.py
Bainky/Ventify
6
10292
from aiogram.utils.markdown import hide_link from aiogram.types import CallbackQuery from loader import dp from utils import ( get_object, get_attributes_of_object ) from keyboards import ( anime_choose_safe_category, anime_sfw_categories, anime_nsfw_categories, animals_categories, ...
2.765625
3
1stRound/Medium/322-Coin Change/DP.py
ericchen12377/Leetcode-Algorithm-Python
2
10293
class Solution: def coinChange(self, coins: List[int], amount: int) -> int: M = float('inf') # dynamic programming dp = [0] + [M] * amount for i in range(1, amount+1): dp[i] = 1 + min([dp[i-c] for c in coins if i >= c] or [M]) return dp[-1] if dp[-1] < M else -1
3.28125
3
segmentation_test/Scripts/medpy_graphcut_voxel.py
rominashirazi/SpineSegmentation
0
10294
#!c:\users\hooma\documents\github\spinesegmentation\segmentation_test\scripts\python.exe """ Execute a graph cut on a voxel image based on some foreground and background markers. Copyright (C) 2013 <NAME> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Publi...
3.015625
3
_notes/book/conf.py
AstroMatt/astronaut-training-en
1
10295
author = '<NAME>' email = '<EMAIL>' project = 'Astronaut Training Program' description = 'Astronaut Training Program' extensions = [ 'sphinx.ext.todo', 'sphinx.ext.imgmath', ] todo_emit_warnings = False todo_include_todos = True exclude_patterns = [] # --------------------------------------------------------...
1.46875
1
tutorial_application/forms.py
yamasakih/django_rdkit_tutorial
2
10296
from django_rdkit import models from django.forms.models import ModelForm from .models import Compound class SubstructureSearchForm(ModelForm): class Meta: model = Compound fields = ('molecule', )
1.476563
1
data_structures/trees/tree.py
onyonkaclifford/data-structures-and-algorithms
0
10297
from abc import ABC, abstractmethod from typing import Any, Generator, Iterable, List, Union class Empty(Exception): pass class Tree(ABC): """A tree is a hierarchical collection of nodes containing items, with each node having a unique parent and zero, one or many children items. The topmost element in ...
4
4
nodes/audio.py
sddhrthrt/COVFEFE
0
10298
<filename>nodes/audio.py from abc import ABC, abstractmethod import os import logging from nodes.helper import FileOutputNode from utils import file_utils from utils import signal_processing as sp from utils.shell_run import shell_run from config import OPENSMILE_HOME class Mp3ToWav(FileOutputNode): def run(self...
2.453125
2
texar/torch/modules/pretrained/gpt2.py
VegB/VLN-Transformer
19
10299
<reponame>VegB/VLN-Transformer # Copyright 2019 The Texar 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/licenses/LICENSE-2.0 # #...
1.773438
2