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
plots/plottingcompare.py
HPQC-LABS/Quantum-Graph-Spectra
1
29400
<gh_stars>1-10 ''' @author: <NAME> Description: For creating multiple overlaid charts ''' from mpl_toolkits.axes_grid1 import host_subplot import mpl_toolkits.axisartist as AA import matplotlib.pyplot as plt import numpy as np ### Get values from performance.py, input here ### x = [4, 5, 8, 9, 16, 32, 64] lst = [(...
2.015625
2
pulse2percept/datasets/__init__.py
pulse2percept/pulse2percept
40
29401
<reponame>pulse2percept/pulse2percept """Utilities to download and import datasets. * **Dataset loaders** can be used to load small datasets that come pre-packaged with the pulse2percept software. * **Dataset fetchers** can be used to download larger datasets from a given URL and directly import them into puls...
1.765625
2
pipeline/mk_all_level1_fsf_bbr.py
lbconner/openfMRI
33
29402
#!/usr/bin/env python """ mk_all_level1_fsf.py - make fsf files for all subjects USAGE: python mk_all_level1_fsf_bbr.py <name of dataset> <modelnum> <basedir - default is staged> <nonlinear - default=1> <smoothing - default=0> <tasknum - default to all> """ ## Copyright 2011, <NAME>. All rights reserved. ## Redistr...
1.820313
2
gettweets.py
ketankokane94/twitter-analysis
0
29403
import tweepy import csv class dealWithTwitter: def __init__(self): self.access_token = "" self.access_token_secret = "" self.consumer_key = "" self.consumer_secret = "" self.api = "" def loadTokens(self): tokens = [] with open('pwd.txt') as pwd_file: ...
3.3125
3
main.py
Swaraj-Deep/UAV-GRN-DRN
1
29404
<gh_stars>1-10 import json import random import numpy as np import os import time import os.path import networkx as nx import users_endpoint.users import grn_endpoint.grn_info import move_endpoint.movement import reward_endpoint.rewards import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPage...
2.28125
2
tests/work_with_gdscript/test_native_call.py
curradium/godot-python
0
29405
# TODO: # - allow inheritance from GDScript class # - overload native method ? import pytest from godot.bindings import ResourceLoader, GDScript, PluginScript def test_native_method(node): original_name = node.get_name() try: node.set_name("foo") name = node.get_name() ass...
1.90625
2
tests/python/unittest/test_arith_stmt_simplify.py
ndl/tvm
15
29406
# 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...
1.828125
2
worker/worker.py
cshenton/neuroevolution
45
29407
"""The Worker class, which manages running policy evaluations.""" import datetime import grpc import gym import os from google.protobuf import empty_pb2 from proto.neuroevolution_pb2 import Evaluation, Individual from proto.neuroevolution_pb2_grpc import NeuroStub from worker.policy import Policy ENVIRONMENT = os.ge...
2.828125
3
CAP4-Case study_interface design/docstring.py
falble/mythinkpython2
1
29408
<filename>CAP4-Case study_interface design/docstring.py # -*- coding: utf-8 -*- """ Created on Sat Feb 16 17:05:36 2019 @author: Utente """ #Chapter 4 #docstring import turtle import math bob = turtle.Turtle() print(bob) def polyline(t, n, lenght, angle): #documentation string---> """Draw...
3.46875
3
Day02/part2.py
JavierRizzoA/AoC2021
0
29409
x = 0 y = 0 aim = 0 with open('input') as f: for line in f: direction = line.split()[0] magnitude = int(line.split()[1]) if direction == 'forward': x += magnitude y += aim * magnitude elif direction == 'down': aim += magnitude elif directio...
3.84375
4
ddd_domain_driven_design/application/dto/generalisation/dtometa.py
pidevops/py-domain-driven-design
2
29410
<filename>ddd_domain_driven_design/application/dto/generalisation/dtometa.py from . import type_checker from .dtodescriptor import DTODescriptor class DTOMeta(type): def __init__(cls, name, bases, namespace, partial: bool = False): super().__init__(name, bases, namespace) def __new__(cls, name, bases...
2.359375
2
model.py
r-or/cnn-eyetrack
0
29411
#!/usr/bin/python3 import json import pprint import sys import os import numpy as np import traceback import random import argparse import json import tensorflow import keras from keras import optimizers from keras.models import Sequential from keras.models import load_model from keras.layers import Conv2D, MaxPooling...
2.28125
2
ec2driver.py
venumurthy/ec2-driver
0
29412
<reponame>venumurthy/ec2-driver<filename>ec2driver.py # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2014 Thoughtworks. # # 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 # # ...
1.65625
2
output/models/ms_data/additional/isdefault072_xsd/isdefault072.py
tefra/xsdata-w3c-tests
1
29413
from dataclasses import dataclass, field from typing import List from xml.etree.ElementTree import QName __NAMESPACE__ = "http://schemas.microsoft.com/2003/10/Serialization/" @dataclass class Array: class Meta: namespace = "http://schemas.microsoft.com/2003/10/Serialization/" item: List[object] = fi...
2.625
3
simpleference/inference/util.py
neptunes5thmoon/simpleference
0
29414
from __future__ import print_function try: import h5py WITH_H5PY = True except ImportError: WITH_H5PY = False try: import zarr WITH_ZARR = True from .io import IoZarr except ImportError: WITH_ZARR = False try: import z5py WITH_Z5PY = True from .io import IoN5 except ImportError: ...
1.765625
2
python/ds/MinDiffList.py
unhingedporter/DataStructureMustKnow
3
29415
<reponame>unhingedporter/DataStructureMustKnow class MinDiffList: # def __init__(self): # self.diff = sys.maxint def findMinDiff(self, arr): arr.sort() self.diff = arr[len(arr) - 1] for iter in range(len(arr)): adjacentDiff = abs(arr[iter + 1]) - abs(arr[iter]) ...
3.078125
3
ncbi/patric_add_taxonomy.py
johned0/EdwardsLab
0
29416
""" Add the taxonomy to the patric metadata file """ import os import sys import argparse from taxon import get_taxonomy_db, get_taxonomy c = get_taxonomy_db() if __name__ == '__main__': parser = argparse.ArgumentParser(description="Append taxonomy to the patric metadata file. This adds it at column 67") par...
2.890625
3
project/save_FlowFile_BPFormat.py
wesleybowman/karsten
1
29417
<gh_stars>1-10 from __future__ import division import numpy as np from rawADCPclass import rawADCP from datetime import datetime from datetime import timedelta import scipy.io as sio import scipy.interpolate as sip import matplotlib.pyplot as plt import seaborn def date2py(matlab_datenum): python_datetime = dateti...
2.25
2
Module1/Day06/module1_day06_lists.py
datsaloglou/100DaysPython
1
29418
""" Author: CaptCorpMURICA Project: 100DaysPython File: module1_day06_lists.py Creation Date: 6/2/2019, 8:55 AM Description: Learn the basic of lists in python. """ list_1 = [] list_2 = list() print("List 1 Type: {}\nList 2 Type: {}".format(type(list_1), type(list_2))) ...
4.4375
4
magicdice/__init__.py
emre/magicdice
5
29419
class MagicDice: def __init__(self, account, active_key): self.account = account self.active_key = active_key
2.21875
2
Interview Preparation Kit/01 - Warm-up Challenges/04 - Repeated String.py
srgeyK87/Hacker-Rank-30-days-challlenge
275
29420
# ======================== # Information # ======================== # Direct Link: https://www.hackerrank.com/challenges/repeated-string/problem # Difficulty: Easy # Max Score: 20 # Language: Python # ======================== # Solution # ======================== import os # Complete the repeatedStrin...
3.9375
4
regress/PORT_ME_TESTS/tests-glen.py
fp7-ofelia/VeRTIGO
2
29421
#!/usr/bin/python from fvregress import * import string # really? you have to do this? if len(sys.argv) > 1 : wantPause = True timeout=9999999 valgrindArgs= [] else: wantPause = False timeout=5 valgrindArgs= None # start up a flowvisor with 1 switch (default) and two guests #h= HyperTest(guests=[('localhost'...
1.953125
2
pseudo/__init__.py
pniedzwiedzinski/pseudo
5
29422
""" Writing actual code might be hard to understand for new-learners. Pseudocode is a tool for writing algorithms without knowing how to code. This module contains classes and methods for parsing pseudocode to AST and then evaluating it. Example: If you installed this module with pip you can run pseudocode from fi...
4.21875
4
adabru_talon/code/deep_sleep.py
adabru/speech
0
29423
<filename>adabru_talon/code/deep_sleep.py from talon import ( Module, Context, ) mod = Module() mod.tag("deep_sleep", desc="Enable deep sleep") ctx = Context() @mod.action_class class Actions: def enable_deep_sleep(): """???""" ctx.tags = ["user.deep_sleep"] def disable_deep_sleep()...
1.90625
2
stubs/esp32_1_10_0/upip_utarfile.py
jmannau/micropython-stubber
0
29424
<reponame>jmannau/micropython-stubber "Module 'upip_utarfile' on firmware 'v1.10-247-g0fb15fc3f on 2019-03-29'" DIRTYPE = 'dir' class FileSection(): ... def read(): pass def readinto(): pass def skip(): pass REGTYPE = 'file' TAR_HEADER = None class TarFile(): ... def extract...
1.929688
2
core/src/zeit/content/author/browser/interfaces.py
rickdg/vivi
5
29425
<filename>core/src/zeit/content/author/browser/interfaces.py from zeit.cms.i18n import MessageFactory as _ import zope.formlib.interfaces import zope.interface @zope.interface.implementer(zope.formlib.interfaces.IWidgetInputError) class DuplicateAuthorWarning(Exception): def doc(self): return _( ...
2.046875
2
Skyhero-admin/Day 29/exp8_3.py
adityajoshi-08/100-Days-of-Code
33
29426
def countWord(word): count = 0 with open('test.txt') as file: for line in file: if word in line: count += line.count(word) return count word = input('Enter word: ') count = countWord(word) print(word, '- occurence: ', count)
4.125
4
utils.py
khangt1k25/Clustering-Segmentation
0
29427
import random import os import logging import pickle import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.backends.cudnn as cudnn # import faiss ################################################################################ # General-...
2.25
2
rif_template.py
EngRaff92/RDL_REG_GEN
2
29428
<filename>rif_template.py header = """/* Icebreaker and IceSugar RSMB5 project - RV32I for Lattice iCE40 With complete open-source toolchain flow using: -> yosys -> icarus verilog -> icestorm project Tests are written in several languages -> Systemverilog Pure Testbench (Vivado) -> UVM testbench (Vivado) -> ...
1.453125
1
reader.py
Asylumrunner/FeedingFrenzy
1
29429
import feedparser def read_rss_feed(feed_url): feed = feedparser.parse(feed_url) return [trim_entry(entry) for entry in feed.entries] def trim_entry(entry): return { 'date': "{}/{}/{}".format(entry.published_parsed.tm_year, entry.published_parsed.tm_mon, entry.published_parsed.tm_mday), 't...
3.015625
3
modmail/config.py
fossabot/modmail-1
0
29430
import asyncio import datetime import json import logging import os import sys import typing from pathlib import Path from typing import Any, Dict, Optional, Tuple import discord import toml from discord.ext.commands import BadArgument from pydantic import BaseModel from pydantic import BaseSettings as PydanticBaseSet...
2.234375
2
turnip/prots.py
RuthAngus/turnip
0
29431
<gh_stars>0 # plot rotation period vs orbital period import os import numpy as np import matplotlib.pyplot as plt import pandas as pd import glob import re from gyro import gyro_age import teff_bv as tbv import scipy.stats as sps from calc_completeness import calc_comp # np.set_printoptions(threshold=np.nan, linewidth...
2.234375
2
proper_mod/prop_dm.py
RupertDodkins/medis
1
29432
# Copyright 2016, 2017 California Institute of Technology # Users must agree to abide by the restrictions listed in the # file "LegalStuff.txt" in the PROPER library directory. # # PROPER developed at Jet Propulsion Laboratory/California Inst. Technology # Original IDL version by <NAME> # Python translation...
2.28125
2
asap-tools/experiments/depricated/handler/comparative.py
project-asap/Profiler
3
29433
__author__ = 'cmantas' from tools import * # Kmeans mahout vs spark m_q = """select mahout_kmeans_text.documents/1000, mahout_kmeans_text.time/1000 from mahout_tfidf inner join mahout_kmeans_text ON mahout_tfidf.documents=mahout_kmeans_text.documents AND mahout_tfidf.dimensions=mahout_kmeans_text.dimensions where ...
2.5
2
docs/sample_code/debugging_info/src/dataset.py
mindspore-ai/docs
288
29434
# Copyright 2021 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 applicable law or agreed to...
2.59375
3
exercise/venv/lib/python3.7/site-packages/sqreen/sdk/events.py
assuzzanne/my-sqreen
0
29435
# -*- coding: utf-8 -*- # Copyright (c) 2016, 2017, 2018, 2019 Sqreen. All rights reserved. # Please refer to our terms for more information: # # https://www.sqreen.io/terms.html # import logging import traceback from datetime import datetime from ..runtime_storage import runtime from ..utils import is_string LO...
2.140625
2
roona/roona/doctype/roona_app_setting/test_roona_app_setting.py
mohsinalimat/roona
1
29436
# Copyright (c) 2021, Roona and Contributors # See license.txt # import frappe import unittest class TestRoonaAppSetting(unittest.TestCase): pass
1.148438
1
workspace/module/maya-python-2.7/LxMaya/command/maShdr.py
no7hings/Lynxi
2
29437
<reponame>no7hings/Lynxi # coding=utf-8 # noinspection PyUnresolvedReferences import maya.cmds as cmds from LxBasic import bscMtdCore, bscObjects, bscMethods # from LxPreset import prsConfigure, prsOutputs # from LxCore.config import appCfg # from LxCore.preset.prod import assetPr # from LxDatabase import dtbMtdCore #...
1.703125
2
db/Service.py
hamedsh/healthCheck
0
29438
import json class Service(object): id: int = None name: str = None type: int = None type_name: str = None repeat_period: int = 5 # repeat period by second metadata = {} def __init__(self, arr: list): self.id = arr[0] self.name = arr[1] self.type = arr[2] ...
2.859375
3
nbpipeline/rules.py
krassowski/nbpipeline
16
29439
import json import pickle import re from copy import copy, deepcopy from functools import lru_cache from json import JSONDecodeError from os import system, walk, sep from abc import ABC, abstractmethod from pathlib import Path import time from subprocess import check_output from tempfile import NamedTemporaryFile from ...
2.703125
3
analyse_images.py
aalto-ui/SemanticCollage
0
29440
<filename>analyse_images.py<gh_stars>0 # encoding=utf8 from load_to_db import * save_list = [] import random import string def randomString(url, stringLength=20): """Generate a random string of fixed length """ Letters = string.ascii_lowercase + string.ascii_uppercase + string.digits url_split = url.spli...
3.140625
3
Eolymp_DSAWeek1_Solns/Digits.py
sulphatet/MiniProjectsndCodingProbs
1
29441
num = int(input()) x = 0 if num == 0: print(1) exit() while num != 0: x +=1 num = num//10 print(x)
3.6875
4
stable_baselines_model_based_rl/wrapper/gym_step_handlers/continuous_mountain_car.py
micheltokic/stable_baselines_model_based_rl
1
29442
import math from stable_baselines_model_based_rl.wrapper.step_handler import StepRewardDoneHandler class ContinuousMountainCarStepHandler(StepRewardDoneHandler): goal_position = 0.45 goal_velocity = 0 def get_done(self, step: int) -> bool: s = self.observation.to_value_list() ...
2.75
3
src/mod_stats_by_aircraft/background_jobs/background_job.py
FGlazov/IL2Stats_ByAircraftMod
0
29443
<filename>src/mod_stats_by_aircraft/background_jobs/background_job.py from django.core.exceptions import FieldError from django.db import ProgrammingError from stats.models import Tour, Sortie from django.db.models import Max import config RETRO_COMPUTE_FOR_LAST_TOURS = config.get_conf()['stats'].getint('retro_compute...
2.21875
2
peakinvestigator/actions/run.py
jct197/PeakInvestigator-Python-SDK
0
29444
<reponame>jct197/PeakInvestigator-Python-SDK ## -*- coding: utf-8 -*- # # Copyright (c) 2016, Veritomyx, Inc. # # This file is part of the Python SDK for PeakInvestigator # (http://veritomyx.com) and is distributed under the terms # of the BSD 3-Clause license. from .base import BaseAction class RunAction(BaseAction)...
2.390625
2
.setup/bin/input_forum_data.py
zeez2030/Submitty
411
29445
#!/usr/bin/env python3 import os import sys import json from datetime import datetime from submitty_utils import dateutils def generatePossibleDatabases(): current = dateutils.get_current_semester() pre = 'submitty_' + current + '_' path = "/var/local/submitty/courses/" + current return [pre + name for name in ...
2.78125
3
edbdeploy/spec/__init__.py
mw2q/postgres-deployment
0
29446
<filename>edbdeploy/spec/__init__.py class SpecValidator: def __init__(self, type=None, default=None, choices=[], min=None, max=None): self.type = type self.default = default self.choices = choices self.min = min self.max = max
1.796875
2
levelpy/async/__init__.py
rch/levelpy
4
29447
<reponame>rch/levelpy<filename>levelpy/async/__init__.py # # levelpy/async/__init__.py # import asyncio
1.304688
1
app/domain/messaging/tests/test_models.py
anthon-alindada/sanic_messaging
1
29448
# -*- coding: utf-8 # Models from ..models import Channel, ChannelUser, Message async def test_channel_model(channel_data): channel = Channel( owner_id=1, name='General') channel = await channel.create() assert repr(channel) == "<Channel: 'General'>" async def test_channel_user_model(c...
2.59375
3
aiosnow/models/__init__.py
michaeldcanady/aiosnow
38
29449
<reponame>michaeldcanady/aiosnow from ._base import BaseModel, BaseModelMeta, BaseTableModel from ._schema import BaseField, ModelSchema, ModelSchemaMeta, Pluck, fields from .attachment import AttachmentModel from .table import TableModel
0.96875
1
examples/providers/factory_aggregate/prototype.py
kinow/python-dependency-injector
0
29450
"""FactoryAggregate provider prototype.""" class FactoryAggregate: """FactoryAggregate provider prototype.""" def __init__(self, **factories): """Initialize instance.""" self.factories = factories def __call__(self, factory_name, *args, **kwargs): """Create object.""" ret...
2.703125
3
test_cnlunardate.py
YuBPan/cnlunardate
0
29451
<gh_stars>0 """Test cnlunardate.""" import unittest import pickle from cnlunardate import cnlunardate from cnlunardate import MIN_YEAR, MAX_YEAR from datetime import timedelta pickle_loads = {pickle.loads, pickle._loads} pickle_choices = [(pickle, pickle, proto) for proto in range(pickle.HIGHEST_P...
2.46875
2
sloc_report/sloc_time.py
depop/sloc_report
1
29452
<filename>sloc_report/sloc_time.py # -*- coding: utf-8 -*- import time def time_now(): """returns current unix time as an integer""" return int(time.time()) def get_day_times(num_days=1, end_time=time_now()): """returns a list of tuples, where each tuple contains the start and end times (in unix tim...
3.890625
4
tests/home_platform/test_env.py
LuCeHe/home-platform
1
29453
# Copyright (c) 2017, IGLU consortium # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, # this list of conditions and...
1.289063
1
slack_sdk/oauth/installation_store/sqlite3/__init__.py
timgates42/python-slack-sdk
0
29454
<gh_stars>0 import logging import sqlite3 from logging import Logger from sqlite3 import Connection from typing import Optional from slack_sdk.oauth.installation_store.async_installation_store import ( AsyncInstallationStore, ) from slack_sdk.oauth.installation_store.installation_store import InstallationStore fro...
2.34375
2
address/admin.py
City-of-Helsinki/geo-search
0
29455
<reponame>City-of-Helsinki/geo-search from django.contrib import admin from parler.admin import TranslatableAdmin from .models import Address, Municipality, Street @admin.register(Municipality) class MunicipalityAdmin(TranslatableAdmin): pass @admin.register(Street) class StreetAdmin(TranslatableAdmin): pa...
1.828125
2
src/pynwb/core.py
q0j0p/pynwb
0
29456
<filename>src/pynwb/core.py from collections import Iterable from h5py import RegionReference from .form.utils import docval, getargs, ExtenderMeta, call_docval_func, popargs from .form import Container, Data, DataRegion, get_region_slicer from . import CORE_NAMESPACE, register_class from six import with_metaclass ...
1.898438
2
tests/test_get_google_streetview.py
AQ-AI/open-geo-engine
0
29457
<filename>tests/test_get_google_streetview.py import os import pandas as pd from open_geo_engine.src.get_google_streetview import GetGoogleStreetView def test_get_google_streetview(): size = "600x300" heading = "151.78" pitch = "-0.76" key = os.environ.get("GOOGLE_DEV_API_KEY") image_folder = "te...
2.5
2
src/cirrus/selfupdate.py
Maxsparrow/cirrus
12
29458
#!/usr/bin/env python """ _selfupdate_ Util command for updating the cirrus install itself Supports getting a spefified branch or tag, or defaults to looking up the latest release and using that instead. """ import sys import argparse import arrow import os import requests import inspect import contextlib from cirru...
2.296875
2
util.py
DrD1esel/GoWDiscordTeamBot
0
29459
from base_bot import log def atoi(text): return int(text) if text.isdigit() else text def bool_to_emoticon(value): return value and "✅" or "❌" # https://stackoverflow.com/questions/7204805/how-to-merge-dictionaries-of-dictionaries # merges b into a def merge(a, b, path=None): if path is None: path = [...
2.828125
3
jsgf_tags.py
onchiptech/pyjsgf
0
29460
from jsgf import parse_grammar_string def main(args): # Parse input grammar file. with open(args.input_file_path, "r") as fp: text = fp.read() print("\ninput grammar: ") print(text) grammar = parse_grammar_string(text) # Print it. print("\noutput grammar: ") text = ...
2.84375
3
webspider/utils/log.py
chem2099/webspider
256
29461
# coding: utf-8 import os import logging.config from webspider import setting LOG_FILE_PATH = os.path.join(setting.BASE_DIR, 'log', 'spider_log.txt') LOGGING_CONFIG = { 'version': 1, 'disable_existing_loggers': True, 'formatters': { 'default': { 'format': '%(asctime)s- %(module)s:%(l...
2.3125
2
manila/tests/share/drivers/hitachi/hnas/test_driver.py
kpawar89/manila
1
29462
<filename>manila/tests/share/drivers/hitachi/hnas/test_driver.py # Copyright (c) 2015 Hitachi Data Systems, 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 a...
1.59375
2
sloth/test/dummy_data.py
maurov/xraysloth
4
29463
#!/usr/bin/env python # -*- coding: utf-8 -*- """Generate dummy data for tests/examples """ import numpy as np def dummy_gauss_image(x=None, y=None, xhalfrng=1.5, yhalfrng=None, xcen=0.5, ycen=0.9, xnpts=1024, ynpts=None, xsigma=0.55, ysigma=0.25, nois...
3.265625
3
approximate_equilibrium/optimize/__init__.py
NREL/EMISApproximateEquilibrium.jl
1
29464
<reponame>NREL/EMISApproximateEquilibrium.jl<filename>approximate_equilibrium/optimize/__init__.py from approximate_equilibrium.optimize.optimization import de_optimizer, objective_function, brute_force_optimizer, objective_function_iccn, gradient_optimizer
1.195313
1
dynatrace/environment_v2/networkzones.py
hashmibilaldt/api-client-python
0
29465
""" Copyright 2021 Dynatrace LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software ...
2.234375
2
tools/scruffy/checkers/orgs.py
paultag/pupa
0
29466
from .. import Check from .common import common_checks def check(db): for org in db.organizations.find({"classification": "legislature"}): for check in common_checks(org, 'organization', 'organizations'): yield check jid = org.get('jurisdiction_id') if jid is None: ...
2.578125
3
ip_allow_lists/ip_compare.py
PaloAltoNetworks/pcs-migration-management
1
29467
<gh_stars>1-10 from sdk.color_print import c_print from tqdm import tqdm #Migrate def compare_trusted_networks(source_networks, clone_networks): ''' Accepts the source trusted alert network list and a clone trusted alert network list. Compares the source tenants network list to a clone tenant networks lis...
2.28125
2
lib/surface/source/captures/upload.py
bopopescu/SDK
0
29468
<reponame>bopopescu/SDK # 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/LICENSE-2.0 # # Unless required...
1.78125
2
pyk/src/pyk/tests/test_kcfg.py
runtimeverification/k
23
29469
<filename>pyk/src/pyk/tests/test_kcfg.py from typing import Any, Dict, List, Tuple from unittest import TestCase from ..cterm import CTerm from ..kast import TRUE, KApply, KInner, KVariable from ..kcfg import KCFG from ..prelude import token def nid(i: int) -> str: return node(i).id # over 10 is variables def ...
2.390625
2
tests/test_unit/test_graph/test_tesserae.py
karljohanw/cortexpy
0
29470
<reponame>karljohanw/cortexpy from cortexpy.tesserae import Tesserae class TestTesserae: def test_mosaic_alignment_on_short_query_and_two_templates(self): # given query = "GTAGGCGAGATGACGCCAT" targets = ["GTAGGCGAGTCCCGTTTATA", "CCACAGAAGATGACGCCATT"] # when t = Tesserae()...
2.578125
3
napari_bb_annotations/__init__.py
czbiohub/napari-bb-annotation
3
29471
<filename>napari_bb_annotations/__init__.py<gh_stars>1-10 try: from ._version import version as __version__ except ImportError: __version__ = "unknown" from . import _key_bindings del _key_bindings
1.125
1
tests/l_layer/backward.py
felix990302/nnlib
1
29472
import numpy as np from numpy.random import RandomState from numpy.testing import assert_allclose from nnlib.l_layer.backward import linear_backward, linear_backward_activation, model_backward from nnlib.utils.derivative import sigmoid_backward, relu_backward from nnlib.utils.activation import sigmoid, relu def test...
2.6875
3
src/news_lk/upload_data.py
nuuuwan/news_lk
0
29473
"""Uploaded data to nuuuwan/news_lk:data branch.""" from news_lk import scrape if __name__ == '__main__': scrape.scrape_and_dump()
1.453125
1
deli_counter/http/mounts/root/routes/v1/validation_models/regions.py
sandwichcloud/deli-counter
1
29474
from schematics import Model from schematics.types import IntType, UUIDType, StringType, BooleanType from ingredients_db.models.region import RegionState, Region from ingredients_http.schematics.types import ArrowType, EnumType class RequestCreateRegion(Model): name = StringType(required=True, min_length=3) ...
2.21875
2
winremoteenum.py
simondotsh/WinRemoteEnum
2
29475
#!/usr/bin/env python3 from src.cli import Cli from src.core import Orchestrator def main(): config, args = Cli.parse_and_validate() Orchestrator.launch_modules(config, args.modules, args.targets, args.audit) if __name__ == '__main__': main()
1.59375
2
setup.py
easyScience/easyCore
2
29476
<filename>setup.py # -*- coding: utf-8 -*- # DO NOT EDIT THIS FILE! # This file has been autogenerated by dephell <3 # https://github.com/dephell/dephell try: from setuptools import setup except ImportError: from distutils.core import setup import os.path readme = '' here = os.path.abspath(os.path.dirname...
1.492188
1
submit_scripts/mizuRoute/mizuRoute_wrapper.py
BrisClimate/flood-cascade
0
29477
#!/cm/shared/languages/python-3.3.2/bin/python # submit script for submission of mizuRoute simualtions # <NAME> Oct 29 2019 # # call this script from 'run_mizuRoute_templated_mswep050calib.py which creates a qsub job to submit to the HPC queue # This script is actually called from 'call_pythonscript.sh' (which is need...
2.171875
2
txml.py
jdelgit/txml
0
29478
<reponame>jdelgit/txml<filename>txml.py from xml.etree.ElementTree import iterparse, ParseError from io import StringIO from os.path import isfile from re import findall class XmlParser: def __init__(self, source=""): self.source = source self.proces_file = False self.use_io = False ...
2.921875
3
app/orders.py
Gabkings/fast-food-api1
0
29479
<filename>app/orders.py from flask import Flask, request from flask_restful import Resource from .models import Order, orders class OrderDetals(Resource): def get(self, id): order = Order().get_order_by_id(id) if not order: return {"message":"Order not found"}, 404 ...
2.828125
3
python/storyboard/bias_optimizer.py
stanford-futuredata/sketchstore
5
29480
from typing import Mapping, Any, Sequence import numpy as np import heapq import math from tqdm import tqdm import scipy.optimize import cvxpy as cvx def n_bias(x_count: np.ndarray, bias: float): # return np.sum(x_count[x_count >= bias]) clipped = np.clip(x_count - bias, a_min=0, a_max=None) return n...
2.3125
2
config/conf.d/04-spawner-common.py
possiblyMikeB/davidson-jupyter
0
29481
import json, os ## base spawner config try: c.Spawner.cmd = \ json.loads(os.environ['SPAWNER_CMD']) except KeyError: c.Spawner.cmd = [ 'jupyterhub-singleuser', # OAuth wrapped jupyter instance server '--KernelManager.transport=ipc', # -- all kernel comms over UNIX sockets '--Ma...
1.914063
2
datasets/__init__.py
radarsat1/latentspace
0
29482
__all__ = ['get_dataset'] def get_dataset(params): if params['name'] == 'multimodal_points': from datasets.multimodal_gaussian_2d import Dataset return Dataset(params) elif params['name'] == 'kicks': from datasets.kicks import Dataset return Dataset(params) assert False and...
2.578125
3
memsource_cli/models/async_request_dto.py
unofficial-memsource/memsource-cli-client
16
29483
# coding: utf-8 """ Memsource REST API Welcome to Memsource's API documentation. To view our legacy APIs please [visit our documentation](https://wiki.memsource.com/wiki/Memsource_API) and for more information about our new APIs, [visit our blog](https://www.memsource.com/blog/2017/10/24/introducing-rest-apis...
1.421875
1
python/p.py
gmasching/project-euler
2
29484
<reponame>gmasching/project-euler def f(x): #return 1*x**3 + 5*x**2 - 2*x - 24 #return 1*x**4 - 4*x**3 - 2*x**2 + 12*x - 3 return 82*x + 6*x**2 - 0.67*x**3 print(f(2)-f(1)) #print((f(3.5) - f(0.5)) / -3) #print(f(0.5))
2.984375
3
Inference_Model.py
CODEJIN/WaveRNN
1
29485
<reponame>CODEJIN/WaveRNN from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import functools import itertools import threading import numpy as np from six.moves import zip # pylint: disable=redefined-builtin from google.protobuf import js...
1.421875
1
tests/test_net_sender_proxy.py
nicoddemus/aioworkers
45
29486
<reponame>nicoddemus/aioworkers import pytest @pytest.fixture def config_yaml(): return """ local_sender: cls: aioworkers.net.sender.proxy.Facade queue: queue1 queue1: cls: aioworkers.queue.base.Queue worker: cls: aioworkers.net.sender.proxy.Worker autorun: tr...
2.078125
2
train.py
olavosamp/kaggle_isic_2020
0
29487
<filename>train.py import torch import torchvision import numpy as np import lib.model from lib.model import MetadataModel, train_model import lib.dataset import lib.dirs as dirs import lib.utils as utils import lib.vis_utils as vutils import lib.defines as defs if __name__ == "__main__": data_pat...
2.4375
2
src/owncloud_rename.py
pzia/keepmydatas
1
29488
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- """Parse tree and find files matching owncloud forbidden characters. Rename in place or move into a specific folder """ import KmdCmd import KmdFiles import os, re import logging class KmdOwncloudRename(KmdCmd.KmdCommand): regexp = r'[\*:"?><|]+' d...
2.71875
3
gym_tetris/board.py
michielcx/Tetris-DQN
13
29489
import random def get_random_bag(): """Returns a bag with unique pieces. (Bag randomizer)""" random_shapes = list(SHAPES) random.shuffle(random_shapes) return [Piece(0, 0, shape) for shape in random_shapes] class Shape: def __init__(self, code, blueprints): self.code = code self....
3.578125
4
03. DP/2xn tile 2.py
KLumy/Basic-Algorithm
1
29490
<gh_stars>1-10 import sys input = sys.stdin.readline n = int(input()) if n < 2: print(n) exit(0) d = [0] * (n+1) d[1] = 1 d[2] = 3 for i in range(n+1): if i < 3: continue d[i] = (d[i-1] % 10007 + (d[i-2]*2) % 10007) % 10007 print(d[n])
2.75
3
menu.py
dadiletta/Saber
0
29491
<gh_stars>0 import Light __author__ = 'adilettad' print("---------------") print("----Welcome----") print("------to-------") print("-----Saber-----") print("---------------") sab = Light.Saber() while True: command = raw_input('Your command:') if command == "blink": sab.demoLED() elif command ...
2.484375
2
a10/build/lib/a10/asvr/types.py
THS-on/AttestationEngine
0
29492
# Copyright 2021 Nokia # Licensed under the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause import a10.structures.constants import a10.structures.identity import a10.structures.returncode import a10.asvr.db.core import a10.asvr.db.announce import a10.asvr.elements def getTypes(): """Gets a list of...
2.109375
2
packages/migrations/0004_auto_20210416_1013.py
dandeduck/package-tracking-web
1
29493
<filename>packages/migrations/0004_auto_20210416_1013.py # Generated by Django 2.2.12 on 2021-04-16 10:13 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('packages', '0003_auto_20210416_1007'), ] operations = [ migrations.AlterField( ...
1.265625
1
website/music/views.py
mrsmartpants/DjangoTutorial-Beginners
0
29494
from django.shortcuts import render # Python functions - user is going to request an url # Create your views here. from django.http import HttpResponse def index(request): return HttpResponse("<h1> This is the music app homepage</h1>")
2.546875
3
LeafNATS/modules/embedding/position_embedding.py
dumpmemory/AspDecSSCL
23
29495
''' @author <NAME> Please contact <EMAIL> ''' import math import torch class PositionalEmbedding(torch.nn.Module): ''' Implementation of Positional Embedding. ''' def __init__(self, hidden_size, device=torch.device("cpu")): super().__init__() self.hidden_size = hidden_size s...
2.84375
3
tests/tensor/sum_test.py
kbrodt/tor4
0
29496
from tor4 import tensor def test_tensor_sum(): a = tensor(data=[-1, 1, 2]) a_sum = a.sum() assert a_sum.tolist() == 2 assert not a_sum.requires_grad def test_tensor_sum_backward(): a = tensor(data=[-1, 1, 2.0], requires_grad=True) a_sum = a.sum() a_sum.backward() assert a_sum.tolis...
2.9375
3
Excite.py
JohnDoe2576/MyPythonCodes
0
29497
<filename>Excite.py import numpy as np import matplotlib.pyplot as plt def aprbs(**parms): # Generate an Amplitude modulated Pseudo-Random Binary Sequence (APRBS) # # The Pseudo-Random Binary Sequence (PRBS) is extensively used as an # excitation signal for System Identification of linear system...
3.609375
4
model.py
andriikushch/CarND-Behavioral-Cloning-P3
1
29498
<gh_stars>1-10 import csv from math import ceil import cv2 import numpy as np from sklearn.model_selection import train_test_split import sklearn from keras.models import Sequential from keras.layers import Flatten, Dense, Lambda, BatchNormalization, Dropout, Cropping2D from keras.layers.convolutional import Convoluti...
2.515625
3
src/natcap/invest/__init__.py
dcdenu4/invest
0
29499
"""init module for natcap.invest.""" import dataclasses import logging import os import sys import pkg_resources LOGGER = logging.getLogger('natcap.invest') LOGGER.addHandler(logging.NullHandler()) __all__ = ['local_dir', ] try: __version__ = pkg_resources.get_distribution(__name__).version except pkg_resources...
2.015625
2