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
Exercicios/Mundo 2/ex044.py
EdsonRomao/CursoEmVideo
0
28000
""" Elabore um programa que calcule o valor a ser pago por um produto, considerando o seu PREÇO NORMAL e CONDIÇÃO DE PAGAMENTO: - À vista dinheiro/cheque: 10% de desconto - À vista no cartão: 5% de desconto - Em até 2x no cartão: Preço normal - 3x ou mais no cartão: 20% de JUROS """ preco = float(input('Qual o valor d...
3.78125
4
Sampling/gp/GPy_wrapper.py
josephhic/AutoDot
7
28001
import numpy as np import GPy from .GP_interface import GPInterface, convert_lengthscale, convert_2D_format class GPyWrapper(GPInterface): def __init__(self): # GPy settings GPy.plotting.change_plotting_library("matplotlib") # use matpoltlib for drawing super().__init__() self.cen...
2.203125
2
Deploying_Models/deploying_sentiment_classifier/SAGunicorn.py
oke-aditya/Machine_Learning
15
28002
<reponame>oke-aditya/Machine_Learning from flask_adv_deploy import app # Note Gunicorn is not supported in Windows machine. if __name__ == "__main__": app.run()
0.996094
1
12/12.py
Hegemege/advent-of-code-2018
0
28003
class Node: def __init__(self, value, index, next, previous): self.value = value self.next_value = value self.index = index self.next = next self.previous = previous def main(): input_data = read_input() initial_row = input_data.pop(0) # Extract the initial state...
3.546875
4
vissl/models/heads/__init__.py
blazejdolicki/vissl
2,512
28004
<gh_stars>1000+ # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from pathlib import Path from typing import Callable from classy_vision.generic.registry_utils import import_all_modules FIL...
2.078125
2
users/tests.py
tonyguthiga/instagram
0
28005
<filename>users/tests.py from django.test import TestCase # Create your tests here. from django.test import TestCase from django.contrib.auth.models import User from .models import Profile class ProfileTestClass(TestCase): ''' test class for Profile model ''' def setUp(self): self.user = User...
2.703125
3
tests/strangenames.py
DasSkelett/AVC-VersionFileValidator
2
28006
import os from pathlib import Path from unittest import TestCase import validator.validator as validator from .test_utils import schema, build_map class TestStrangeNames(TestCase): old_cwd = os.getcwd() @classmethod def setUpClass(cls): os.chdir('./tests/workspaces/strange-names') @classmet...
2.578125
3
Chap 1/Class-List-(project2).py
dwhickox/NCHS-Programming-1-Python-Programs
0
28007
# <NAME> # Jan 12 17 # HickoxProject2 # Displayes name and classes # prints my name and classes in columns and waits for the user to hit enter to end the program print("<NAME>") print() print("1st Band") print("2nd Programming") print("3rd Ap Pysics C") print("4th Lunch") print("5th Ap Lang") print("6t...
3.71875
4
easy_tokenizer/tokenizer.py
tilaboy/easy-tokenizer
1
28008
'''Tokenizer Class''' # -*- encoding: utf-8 -*- import re from .token_with_pos import TokenWithPos from .patterns import Patterns class Tokenizer(): ''' A basic Tokenizer class to tokenize strings and patterns Parameters: - regexp: regexp used to tokenize the string ''' def __init__(self,...
3.78125
4
rev/desmos-pro/solve-maze.py
nanzggits/sdctf-2021
6
28009
<reponame>nanzggits/sdctf-2021 from typing import List, Optional, Tuple import mazegen from mazegen import M, WALL # In desmos coordinates (x,y), with y=0 being the bottom row # CARDINAL_DELTAS = [(0, 1), (1, 0), (0, -1), (-1, 0)] # In array coordinates (y,x), with y=0 being the top row CARDINAL_DELTAS = [(-1, 0), (0,...
2.828125
3
solvent/run.py
shlomimatichin/solvent
0
28010
<reponame>shlomimatichin/solvent import subprocess import logging def run(command, cwd=None): try: return subprocess.check_output( command, cwd=cwd, stderr=subprocess.STDOUT, stdin=open("/dev/null"), close_fds=True) except subprocess.CalledProcessError as e: logging.err...
2.25
2
util/approximate/embedding_interpolator/old/v1_numpy.py
tchlux/util
4
28011
from numpy import zeros, ones, dot, sum, abs, max, argmax, clip, \ random, prod, asarray, set_printoptions, unravel_index # Generate a random uniform number (array) in range [0,1]. def zero(*shape): return zeros(shape) def randnorm(*shape): return random.normal(size=shape) def randuni(*shape): return random.ran...
2.71875
3
sample-apps/data-loader/app.py
jkylling/fdb-kubernetes-operator
0
28012
<reponame>jkylling/fdb-kubernetes-operator #! /usr/bin/python ''' This file provides a sample app for loading data into FDB. To use it to load data into one of the sample clusters in this repo, you can build the image by running `docker build -t fdb-data-loader sample-apps/data-loader`, and then run the data loader b...
2.453125
2
data_files/PROGRAMS/MEDIUM/0018_4Sum.py
sudhirrd007/LeetCode-scraper
0
28013
<reponame>sudhirrd007/LeetCode-scraper # ID : 18 # Title : 4Sum # Difficulty : MEDIUM # Acceptance_rate : 35.2% # Runtime : 72 ms # Memory : 12.7 MB # Tags : Array , Hash Table , Two Pointers # Language : python3 # Problem_link : https://leetcode.com/problems/4sum # Premium : 0 # Notes : - ### def fourSum(self, nu...
2.96875
3
dentalvision/asm/fit.py
DreamSki/dentalvision
7
28014
''' Algorithm for matching the model to image points. Based on (Cootes et al. 2000, p.9) and (Blanz et al., p.4). ''' import numpy as np from utils.structure import Shape from utils.align import Aligner class Fitter(object): def __init__(self, pdmodel): self.pdmodel = pdmodel self.aligner = Align...
2.859375
3
bank_ddd_es_cqrs/accounts/app.py
Hyaxia/Bank-DDD-CQRS-ES
8
28015
from flask import Flask from flask_cors import CORS # type: ignore from .api import account_blueprint from .event_handlers import register_event_handlers from .infrastructure import event_store_db from .composition_root import event_manager def account_app_factory(db_string: str): app = Flask(__name__) CORS(...
1.75
2
Fase II/team04/storageManager.py
estrada-usac/EDD20DIC-PROYECTO
0
28016
# Package: Storage Manager # License: Released under MIT License # Notice: Copyright (c) 2020 TytusDB Team # Developers: <NAME> from storage.avl import avlMode from storage.b import BMode from storage.bplus import BPlusMode from storage.hash import HashMode from storage.isam import ISAMMode ...
1.921875
2
pdf_downloader.py
mniac810/RPA_Challenge
1
28017
from RPA.Browser.Selenium import Selenium from RPA.FileSystem import FileSystem import datetime import os class PDFDownloader: def __init__(self, page_urls, names): self.browser = Selenium() self.files = FileSystem() self._dir = f'{os.getcwd()}/output' self._urls = page_urls ...
2.875
3
tests/TestFiles/fodder.py
ComposableAnalytics/ComposaPy
0
28018
<filename>tests/TestFiles/fodder.py # Add this test back later, unfortunately casting errors and no time to deal with them. # @pytest.mark.parametrize("dataflow_object", ["external_input_int.json"], indirect=True) # def test_external_input_int(dataflow_object: DataFlowObject, dataflow: DataFlow): # dataflow_rs = da...
2.1875
2
django/store/views.py
brickfaced/django-ecommerce
24
28019
<filename>django/store/views.py<gh_stars>10-100 from django.shortcuts import render from rest_framework import generics from . import models from .models import Category, Product from .serializers import CategorySerializer, ProductSerializer class ProductListView(generics.ListAPIView): queryset = Product.objects...
1.976563
2
6. Algorithms - Graph Traversal/3 - GraphTraversal-DFS.py
PacktPublishing/Data-Structures-and-Algorithms-The-Complete-Masterclass
25
28020
class Node(): def __init__(self, value): self.value = value self.adjacentlist = [] self.visited = False class Graph(): def DFS(self, node, traversal): node.visited = True traversal.append(node.value) for element in node.adjacentlist: if element...
3.875
4
blender/arm/logicnode/array/LN_array_loop_node.py
niacdoial/armory
0
28021
from arm.logicnode.arm_nodes import * class ArrayLoopNode(ArmLogicTreeNode): """Loops through each item of the given array.""" bl_idname = 'LNArrayLoopNode' bl_label = 'Array Loop' arm_version = 1 def init(self, context): super(ArrayLoopNode, self).init(context) self.add_input('Ar...
2.734375
3
streamalert_cli/terraform/cloudwatch_events.py
Meliairon/streamalert
1
28022
<reponame>Meliairon/streamalert """ Copyright 2017-present Airbnb, 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 ...
1.546875
2
EvolutionaryAlgorithm/evolution.py
stepan-krivanek/evolutionary-algorithm
0
28023
<reponame>stepan-krivanek/evolutionary-algorithm import numpy as np from LocalSearch.local_search import * from EvolutionAlgorithm import EvolutionAlgorithm as EA def init_real_chromosome(size, variation=2): return np.random.normal(0, variation, size) def init_bin_chromosome(size): return np.random.binomi...
2.984375
3
tests/tests/dummy.py
cjhall1283/pylint_runner
16
28024
""" Dummy file for testing """
1.007813
1
src/kids/test/__init__.py
0k/kids.test
0
28025
<reponame>0k/kids.test<filename>src/kids/test/__init__.py # -*- encoding: utf-8 -*- from __future__ import unicode_literals from __future__ import print_function import os import tempfile import unittest import re import shutil class Test(unittest.TestCase): ## XXXvlab: it seems it's already there in PY3 and m...
2.609375
3
homeassistant/components/ridwell/const.py
MrDelik/core
30,023
28026
"""Constants for the Ridwell integration.""" import logging DOMAIN = "ridwell" LOGGER = logging.getLogger(__package__) DATA_ACCOUNT = "account" DATA_COORDINATOR = "coordinator" SENSOR_TYPE_NEXT_PICKUP = "next_pickup"
1.34375
1
src/py/test/IntegrationTest/Main.py
AdamPesci/diveR
0
28027
<filename>src/py/test/IntegrationTest/Main.py """ Authors: <NAME>, <NAME>, <NAME> This class will act as the control centre for the backend components: Calculations.py FileLoader.py """ import os import sys import csv from datetime import datetime import json import rpy2.robjects.packages as rpackages from rp...
2.578125
3
exussum/fs.py
exussum/exussum
0
28028
import subprocess import fnmatch from pathlib import Path import os import re def all_files(src): regex_include = re.compile("|".join((fnmatch.translate(e) for e in src.included_files))) regex_exclude = re.compile("|".join((fnmatch.translate(e) for e in src.excluded_files))) for root, dirs, files in os.w...
2.484375
2
click_example/utils.py
captainCapitalism/typer-oo-example
2
28029
import click class command: def __init__(self, name=None, cls=click.Command, **attrs): self.name = name self.cls = cls self.attrs = attrs def __call__(self, method): def __command__(this): def wrapper(*args, **kwargs): return method(this, *args, **k...
2.984375
3
neuron_simulator_service/SAC_network/stimulus.py
jpm343/RetinaX
2
28030
from __future__ import division import numpy as np # Set bar stimuli speed def update_bar_speed(BPsyn, delay, width, speed, d_init, synapse_type="alphaCSyn", angle=0): print "Updating bar speed to: %f mm/s" % speed angrad = angle * np.pi / 180.0 angcos = np.cos(angrad) angsin = np...
2.625
3
test_prime_numbers.py
zekedran/python_tdd_ci_tutorial
0
28031
<reponame>zekedran/python_tdd_ci_tutorial from prime_numbers import is_prime def test_is_prime(): assert is_prime(-1) is False assert is_prime(0) is False assert is_prime(4) is False assert is_prime(6) is False assert is_prime(8) is False assert is_prime(9) is False assert is_prime(10) is...
3.84375
4
main.py
white-undo/scientific-calc
0
28032
<reponame>white-undo/scientific-calc #====================== # # Scientific Plotting Calculator # #---------------------- # # <NAME> # # Artificial Intelligence, ICL # #====================== # # Usefull modules and tools from tkinter import BOTTOM, BOTH, TOP, Label...
2.953125
3
client/tests/test_up_args.py
gefyrahq/gefyra
41
28033
<filename>client/tests/test_up_args.py from gefyra.__main__ import up_parser, up_command from gefyra.configuration import ClientConfiguration, __VERSION__ REGISTRY_URL = "my-reg.io/gefyra" QUAY_REGISTRY_URL = "quay.io/gefyra" STOWAWAY_LATEST = "my-reg.io/gefyra/stowaway:latest" CARGO_LATEST = "my-reg.io/gefyra/cargo:...
2.484375
2
Experiments/Fully Assembled Actutor Module/RASH_example_trajectory.py
kevinAlfsen/RASH-Bachelor-Thesis
0
28034
<filename>Experiments/Fully Assembled Actutor Module/RASH_example_trajectory.py # coding: utf8 import argparse import math import os import sys from time import clock import libmaster_board_sdk_pywrap as mbs from Trajectory import trajectory from Plotter import overlay_plot def example_script(name_interface): ...
2.8125
3
main_mini.py
idosharon/Leechy-Prototype-Spectrum-Analyzer
0
28035
# Leechy Prototype Spectrum Analyzer. # Important: MAKE SURE KEYBOARD IS ON ENGLISH AND CAPSLOCK IS NOT ON! import cv2,pickle,xlsxwriter,time,datetime,os, os.path from imutils import rotate_bound import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import Button from PIL import Image, Im...
2.25
2
models/__init__.py
dudtjakdl/OpenNMT-Korean-To-English
1,491
28036
from .EncoderRNN import EncoderRNN from .DecoderRNN import DecoderRNN from .TopKDecoder import TopKDecoder from .seq2seq import Seq2seq
0.960938
1
panel/layout/spacer.py
sthagen/holoviz-panel
601
28037
""" Spacer components to add horizontal or vertical space to a layout. """ import param from bokeh.models import Div as BkDiv, Spacer as BkSpacer from ..reactive import Reactive class Spacer(Reactive): """ The `Spacer` layout is a very versatile component which makes it easy to put fixed or responsive ...
3.296875
3
reddit2telegram/channels/r_gentlemanboners/app.py
mainyordle/reddit2telegram
187
28038
<gh_stars>100-1000 #encoding:utf-8 from utils import weighted_random_subreddit subreddit = weighted_random_subreddit({ 'BeautifulFemales': 0.25, 'cutegirlgifs': 0.25, 'gentlemanboners': 0.25, 'gentlemanbonersgifs': 0.25 }) t_channel = '@r_gentlemanboners' def send_post(submission, r2t): return ...
2
2
efficientEigensolvers/Page_Rank_Application.py
ICERM-Efficient-Eigensolvers-2020/Implimentation
0
28039
<reponame>ICERM-Efficient-Eigensolvers-2020/Implimentation import sys, os import Page_Rank_Utils as pru from Power_Iteration import PowerMethod from QR_Algorithm import qr_Algorithm_HH, qr_Algorithm_GS, shiftedQR_Algorithm from Inverse_Iteration import InverseMethod from Inverse_Iteration_w_shift import InverseShift im...
2.15625
2
04-ClassMembers/member.py
bakhshalipour/boost-python3-mac
0
28040
#!/usr/bin/env python3 import member m1 = member.SomeClass("Pavel") print ("name =",m1.name) m1.name = "Gunther" print ("name =",m1.name) m1.number = 7.3 print ("number =",m1.number)
3.40625
3
valispace/__init__.py
singleit-tech/ValispacePythonAPI
9
28041
#!/usr/bin/env python # -*- coding: utf-8 -*- import getpass import json import requests import sys import six import re class API: """ Defines REST API endpoints for Valispace. """ _writable_vali_fields = [ 'reference', 'margin_plus', 'margin_minus', 'unit', 'formula', 'description...
2.765625
3
setup.py
khuong507/bluemix-cloudbase-init
3
28042
from distutils.core import setup setup(name='Bluemix', version='0.1', description='A bluemix datasource to be used with cloudbase-init', packages=['bluemix', 'bluemix.conf'])
1.265625
1
giant/relative_opnav/estimators/ellipse_matching.py
nasa/giant
5
28043
<reponame>nasa/giant # Copyright 2021 United States Government as represented by the Administrator of the National Aeronautics and Space # Administration. No copyright is claimed in the United States under Title 17, U.S. Code. All Other Rights Reserved. r""" This module provides the capability to locate the relative...
2.375
2
pytorch/probability/distributions_.py
NunoEdgarGFlowHub/autoregressive-energy-machines
83
28044
<reponame>NunoEdgarGFlowHub/autoregressive-energy-machines import math import sys import torch from numbers import Number from torch import distributions from torch.distributions import constraints from torch.distributions.exp_family import ExponentialFamily from torch.distributions.utils import _standard_normal, broa...
2.796875
3
basicplot.py
sirgogo/docker-meep
2
28045
import matplotlib matplotlib.use('Agg') # this lets us do some headless stuff import matplotlib.pylab as plt import numpy as np x = np.asarray([0,5,2]) y = np.asarray([0,1,3]) f = plt.figure() ax = f.add_subplot(111) ax.plot(x,y) #plt.show() # we have a headless display, can't do this! f.savefig('basicplot.eps',format...
2.9375
3
py-practice/py-practice-hackerrank/Algorithms/Implementation/utopian_tree.py
beenorgone-notebook/python-notebook
0
28046
# https://www.hackerrank.com/challenges/utopian-tree def tree_height(tree, N, start): if not N: return tree if start == 'spring': for i in range(N // 2): tree = tree * 2 + 1 if N % 2: return tree * 2 else: return tree elif start == 'summer...
4.125
4
piodispatch/__init__.py
Kiruse/PioDispatch
0
28047
<reponame>Kiruse/PioDispatch<filename>piodispatch/__init__.py from .piodispatch import dispatch, ascoroutine, shutdown
1.125
1
Algorithms/Maximum_Number_of_Coins_You_Can_Get/main.py
ugurcan-sonmez-95/LeetCode
1
28048
### Maximum Number of Coins You Can Get - Solution class Solution: def maxCoins(self, piles: List[int]) -> int: piles.sort() max_coin, n = 0, len(piles) for i in range(n//3, n, 2): max_coin += piles[i] return max_coin
3.734375
4
learner2/pupil/migrations/0012_sessiondata.py
Arunkumar99/learners
3
28049
<reponame>Arunkumar99/learners # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('pupil', '0011_questions_set_id'), ] operations = [ migrations.CreateModel( name='...
1.835938
2
mediapipe_utils.py
brightereyeslynxes/corpusLabe_prototype
0
28050
<gh_stars>0 import cv2 import numpy as np from collections import namedtuple from math import ceil, sqrt, exp, pi, floor, sin, cos, atan2, gcd import time from collections import deque, namedtuple # Dictionary that maps from joint names to keypoint indices. KEYPOINT_DICT = { "nose": 0, "left_eye_inner": 1, ...
2.453125
2
examples/fixture.no_background/features/steps/use_steplib_behave4cmd.py
wombat70/behave
13
28051
# -*- coding: utf-8 -*- """ Use behave4cmd0 step library (predecessor of behave4cmd). """ from __future__ import absolute_import # -- REGISTER-STEPS FROM STEP-LIBRARY: # import behave4cmd0.__all_steps__ # import behave4cmd0.failing_steps import behave4cmd0.passing_steps import behave4cmd0.note_steps
1.179688
1
build/python/modules/assembly/package_manifest.py
fabio-d/fuchsia-stardock
5
28052
<reponame>fabio-d/fuchsia-stardock # Copyright 2022 The Fuchsia Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from dataclasses import dataclass from typing import Dict, List, Optional from serialization import serialize_fields_as __...
2.234375
2
annotation/black_action/test/move_ry.py
windfall-shogi/feature-annotation
0
28053
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os from itertools import product from pathlib import Path import numpy as np import tensorflow as tf from dotenv import load_dotenv from annotation.direction import (Direction, get_diagonal_directions, get_cross_directions) from ...
2.21875
2
assignments/assignment2/solutions/Nkarnaud/devhub-0.1.0/src/account/forms.py
Nkarnaud/python-mentorship
1
28054
<filename>assignments/assignment2/solutions/Nkarnaud/devhub-0.1.0/src/account/forms.py from django import forms from django.contrib.auth.forms import UserCreationForm, UserChangeForm from django.contrib.auth.models import User from account.models import Account class AccountCreateForm(UserCreationForm): first_nam...
2.515625
3
palsbet/migrations/0003_auto_20180323_0018.py
denis254/palsbetc
0
28055
# Generated by Django 2.0.2 on 2018-03-22 21:18 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('palsbet', '0002_viptipsgames'), ] operations = [ migrations.AlterField( model_name='viptipsgames', name='cathegory',...
1.398438
1
Environment.py
mxrcfdez/TrafficLightsAutomation
0
28056
import gym from gym import spaces import numpy as np import learning_data from Simulation import Simulation def get_value_or_delimiter(value, delimiter): return min(delimiter[1], max(delimiter[0], value)) class Environment(gym.Env): def __init__(self, simulation, training): super(Environment, self)...
3.171875
3
test.py
nerdingitout/STT--
0
28057
<gh_stars>0 import pandas as pd import json import csv # importing the module import json # Opening JSON file with open('response.json') as json_file: data = json.load(json_file) # for reading nested data [0] represents # the index value of the list print(data['results'][0]['alternatives...
3.46875
3
loldib/getratings/models/NA/na_sivir/na_sivir_bot.py
koliupy/loldib
0
28058
from getratings.models.ratings import Ratings class NA_Sivir_Bot_Aatrox(Ratings): pass class NA_Sivir_Bot_Ahri(Ratings): pass class NA_Sivir_Bot_Akali(Ratings): pass class NA_Sivir_Bot_Alistar(Ratings): pass class NA_Sivir_Bot_Amumu(Ratings): pass class NA_Sivir_Bot_Anivia(Ratings): pass ...
1.367188
1
policy2tosca/build/lib.linux-x86_64-2.7/policy2tosca/del_type.py
Tosca-Projects/parser
1
28059
<filename>policy2tosca/build/lib.linux-x86_64-2.7/policy2tosca/del_type.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.apache.org/licenses/LICENSE-2.0 # # Unless required ...
2.03125
2
build_start.py
sanman00/SpongeSkills
0
28060
<filename>build_start.py from build import replace_text, version replace_text("@{version}", version)
1.359375
1
cuppa/cpp/create_version_file_cpp.py
pwj58/cuppa
25
28061
# Copyright <NAME> 2011-2017 # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) #------------------------------------------------------------------------------- # CreateVersionFileCpp #--------...
2.03125
2
enthought/mayavi/components/implicit_plane.py
enthought/etsproxy
3
28062
# proxy module from __future__ import absolute_import from mayavi.components.implicit_plane import *
1.046875
1
Learning/python_data_analysis11.py
VictoriaGuXY/MCO-Menu-Checker-Online
0
28063
import pandas as pd from scipy.stats import ttest_rel """ output """ # Note: some output is shortened to save spaces. # This file discusses statistical analysis (Part II). # ------------------------------------------------------------------------------ # Data stored in form of xlsx with contents: """ group data...
3.15625
3
pytorch_ares/third_party/free_adv_train/multi_restart_pgd_attack.py
thu-ml/realsafe
107
28064
<reponame>thu-ml/realsafe """ Implementation of attack methods. Running this file as a program will evaluate the model and get the validation accuracy and then apply the attack to the model specified by the config file and store the examples in an .npy file. """ from __future__ import absolute_import from __futu...
2.875
3
run.py
envy7/project-dream-team-three
0
28065
<reponame>envy7/project-dream-team-three<gh_stars>0 import os from app import create_app config_name = os.getenv('FLASK_CONFIG') app = create_app('development') if __name__ == '__main__': app.run(host='0.0.0.0')
1.414063
1
tests/test_utils.py
jbradberry/universe
0
28066
<gh_stars>0 import unittest from universe import components, engine, utils class PlanetProductionTestCase(unittest.TestCase): def test_values(self): manager = engine.Manager() manager.register_entity_type('species', [ components.SpeciesProductionComponent(), ]) manager...
2.671875
3
models/model_search.py
WZzhaoyi/TF-NAS
62
28067
import random import torch import torch.nn as nn import torch.nn.functional as F from .layers import * PRIMITIVES = [ 'MBI_k3_e3', 'MBI_k3_e6', 'MBI_k5_e3', 'MBI_k5_e6', 'MBI_k3_e3_se', 'MBI_k3_e6_se', 'MBI_k5_e3_se', 'MBI_k5_e6_se', # 'skip', ] OPS = { 'MBI_k3_e3' : lambda ic, mc, oc, s, aff, act: MBInvert...
2.171875
2
code/decision.py
preethi2205/RND_SearchAndSampleReturn
0
28068
import numpy as np import random as random def move_to_sample(Rover): delX = 0; delY = 0; if len(Rover.rock_angles) > 0: dist_to_rock = np.mean(np.abs(Rover.rock_dist)) angle_to_rock = np.mean(Rover.rock_angles); Rover.steer = np.clip(angle_to_rock* 180/np.pi, -15, 15) if Rove...
2.546875
3
ch17/yunqiCrawl/yunqiCrawl/scrapy_redis/connection.py
AaronZhengkk/SpiderBook
990
28069
<gh_stars>100-1000 import redis # Default values. REDIS_URL = None REDIS_HOST = 'localhost' REDIS_PORT = 6379 FILTER_URL = None FILTER_HOST = 'localhost' FILTER_PORT = 6379 FILTER_DB = 0 def from_settings(settings): url = settings.get('REDIS_URL', REDIS_URL) host = settings.get('REDIS_HOST', REDIS_HOST) ...
2.515625
3
odoo-14.0/addons/hr_holidays/tests/test_automatic_leave_dates.py
Yomy1996/P1
0
28070
# -*- coding: utf-8 -*- from datetime import date, datetime from odoo.tests.common import Form from odoo.addons.hr_holidays.tests.common import TestHrHolidaysCommon from odoo.exceptions import ValidationError class TestAutomaticLeaveDates(TestHrHolidaysCommon): def setUp(self): super(TestAutomaticLeaveD...
2.359375
2
oface/model/base.py
007gzs/oface
2
28071
# encoding: utf-8 from __future__ import absolute_import, unicode_literals import onnxruntime class ONNXModel: def __init__(self, model_file=None, session=None, task_name=''): self.model_file = model_file self.session = session self.task_name = task_name if self.session is None: ...
2.234375
2
fabrun/views.py
agepoly/azimut-gestion
0
28072
# -*- coding: utf-8 -*- from django.shortcuts import get_object_or_404, render_to_response, redirect from django.template import RequestContext from django.core.context_processors import csrf from django.views.decorators.csrf import csrf_exempt from django.http import Http404, HttpResponse, HttpResponseForbidden, Http...
1.890625
2
psets/set1/perceptron_helper.py
ichakraborty/CS155-iniproject
14
28073
######################################## # CS/CNS/EE 155 2018 # Problem Set 1 # # Author: <NAME> # Description: Set 1 Perceptron helper ######################################## import numpy as np import matplotlib.pyplot as plt def predict(x, w, b): ''' The method takes the weight vector and bias of a...
3.625
4
1D_2D_arrays/1D_2D_arrays.py
Speedy905/ICS4U-Scripts
0
28074
#<NAME> #ICS4U-01 #November 24 2016 #1D_2D_arrays.py #Creates 1D arrays, for the variables to be placed in characteristics = [] num = [] #Creates a percentage value for the numbers to be calculated with base = 20 percentage = 100 #2d Arrays #Ugly Arrays ugly_one_D = [] ugly_one_D_two = [] ugly_two_D = [] #Nice Arra...
3.53125
4
gym_viewshed/envs/__init__.py
baimukashev/gym-viewshed
0
28075
# from gym_viewshed.envs.viewshed_env import ViewshedEnv # from gym_viewshed.envs.viewshed_basic_env import ViewshedBasicEnv # from gym_viewshed.envs.viewshed_random_env import ViewshedRandomEnv # from gym_viewshed.envs.viewshed_greedy_env import ViewshedGreedyEnv # from gym_viewshed.envs.viewshed_coverage_env import V...
1.242188
1
syn/base/b/tests/test_wrapper.py
mbodenhamer/syn
1
28076
<filename>syn/base/b/tests/test_wrapper.py import collections from copy import deepcopy from nose.tools import assert_raises from syn.base.b import ListWrapper, Attr from syn.base.b.tests.test_base import check_idempotence from syn.types.a import generate from syn.type.a import Schema from syn.schema.b.sequence import ...
2.09375
2
code_dense_hmm/experiment.py
fraunhofer-iais/dense-hmm
0
28077
from models import StandardHMM, DenseHMM, HMMLoggingMonitor from utils import prepare_data, check_random_state, create_directories, dict_get, Timer, timestamp_msg, check_dir, is_multinomial, compute_stationary, check_sequences from data import penntreebank_tag_sequences, protein_sequences, train_test_split from datet...
2.4375
2
jetson/ballrunner.py
Reslix/Lohbot
1
28078
<reponame>Reslix/Lohbot from newcamera import TrackingCameraRunner from serial_io import SerialIO from show import imshow import cv2 import math print("Initializing serial connection with Arduino") ard = SerialIO() ard.start() print("Initializing camera") c = TrackingCameraRunner(0) print("Tracking Ball...") tcenterx...
2.8125
3
simple_rl/tasks/taxi/TaxiOOMDPClass.py
KorlaMarch/simple_rl
10
28079
''' TaxiMDPClass.py: Contains the TaxiMDP class. From: Dietterich, <NAME>. "Hierarchical reinforcement learning with the MAXQ value function decomposition." J. Artif. Intell. Res.(JAIR) 13 (2000): 227-303. Author: <NAME> (cs.brown.edu/~dabel/) ''' # Python imports. from __future__ import print_function i...
2.453125
2
tests/bugs/core_2923_test.py
FirebirdSQL/firebird-qa
1
28080
#coding:utf-8 # # id: bugs.core_2923 # title: Problem with dependencies between a procedure and a view using that procedure # decription: # tracker_id: CORE-2923 # min_versions: ['2.5.0'] # versions: 3.0 # qmid: None import pytest from firebird.qa import db_factory, isql_act, Action ...
1.460938
1
day_09.py
bob-white/advent_2018
1
28081
<gh_stars>1-10 """ --- Day 9: <NAME> --- You talk to the Elves while you wait for your navigation system to initialize. To pass the time, they introduce you to their favorite marble game. The Elves play this game by taking turns arranging the marbles in a circle according to very particular rules. The marbles are num...
3.671875
4
problems/test_ic_1_stock_prices.py
gregdferrell/algo
0
28082
from .ic_1_stock_prices import stock_prices_1_brute_force, stock_prices_2_greedy def test_stock_price_algorithms_lose(): stock_prices = [10, 9, 7] assert stock_prices_1_brute_force(stock_prices) == -1 assert stock_prices_2_greedy(stock_prices) == -1 def test_stock_price_algorithms_no_gain(): stock_prices = [2, ...
2.640625
3
qctrl_api/control_api/models.py
bibek-Neupane/back-end-challenge
0
28083
from django.db import models from django.core.validators import MinValueValidator, MaxValueValidator class Control(models.Model): objects=models.Manager() TYPE_CHOICES=( ('Primitive','Primitive'), ('Corpse','CORPSE'), ('Gaussian','Gaussian'), ('CinBB','CinBB'), ) #pk i....
2.46875
2
pyNastran/bdf/mesh_utils/mesh.py
numenic/pyNastran
0
28084
<reponame>numenic/pyNastran import numpy as np from pyNastran.bdf.cards.aero.utils import ( points_elements_from_quad_points, create_axisymmetric_body) def create_structured_cquad4s(model, pid, p1, p2, p3, p4, nx, ny, nid=1, eid=1, theta_mcid=0.): """ Parameters ----------...
2.484375
2
trtools/dumpSTR/tests/test_filters.py
Kulivox/TRTools
14
28085
<reponame>Kulivox/TRTools import argparse import os,sys import pytest from ..dumpSTR import * from ..filters import * def base_argparse(tmpdir): args = argparse.ArgumentParser() args.vcf = None args.vcftype = "auto" args.out = str(tmpdir / "test") args.min_locus_callrate = None args.min_locus_...
2.171875
2
src/tower.py
stove41/screeps
0
28086
<gh_stars>0 from defs import * __pragma__('noalias', 'name') __pragma__('noalias', 'undefined') __pragma__('noalias', 'Infinity') __pragma__('noalias', 'keys') __pragma__('noalias', 'get') __pragma__('noalias', 'set') __pragma__('noalias', 'type') __pragma__('noalias', 'update') class Tower: def __init__(self, t...
2.75
3
code/crawling/glowpick.py
DataNetworkAnalysis/OliveYoung_for_Man
6
28087
''' 실행 방법 : 아나콘다 프롬프트에서 main.py가 있는 폴더 경로에 아래 명령어 입력 python glowpick.py 데이터 목록 1. Category 2. Brand_Name 3. Product_Name 4. volume 5. price 6. Sales Rank 7. rate 8. nb_reviews 7. product_number ''' from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdrive...
3.171875
3
engine/engine.py
farouqzaib/Personify
1
28088
<reponame>farouqzaib/Personify from algorithms.factorization_machine import FactorizationMachine from algorithms.latent_dirichlet_allocation import LatentDirichletAllocation from app.config import db from app.config.config import engine import datetime import numpy as np import pandas as pd import pickle class Engine:...
2.40625
2
tests/test_parse_string.py
zalmane/copybook
12
28089
<reponame>zalmane/copybook<gh_stars>10-100 import pytest # Reader imports import copybook # # Tests # tests = { "extra header text":""" 10 IDENTIFICATION DIVISION. PROGRAM-ID. 8-REPORT. AUTHOR. DDT. MODIFIED BY OREN. DATE WRITTEN. 10/13/2010. DATE COMPILED. 10/13/2010. 01 WORK-BOOK. ...
2.203125
2
decorators.py
ir0nfelix/async_fileserver
1
28090
<filename>decorators.py from werkzeug import exceptions import settings from utils import get_class_by_path def authenticate(f): def decorator(request): try: authentication_backend = get_class_by_path(settings.AUTHENTICATION_BACKEND) authenticator = authentication_backend() ...
2.484375
2
quadboost/data_preprocessing/mean_haar.py
jsleb333/quadboost
1
28091
<reponame>jsleb333/quadboost<gh_stars>1-10 import numpy as np import matplotlib.pyplot as plt import skimage.transform as skit import sys, os sys.path.append(os.getcwd()) from quadboost.datasets import MNISTDataset from quadboost.utils import * from haar_preprocessing import * def plot_images(images, titles): fi...
2.34375
2
gpgraph/pyplot/utils.py
lperezmo/gpgraph
0
28092
<filename>gpgraph/pyplot/utils.py<gh_stars>0 import numpy as np import matplotlib.colors as colors import matplotlib.pyplot as plt def despine(ax=None): """Despine axes.""" ax.spines['right'].set_visible(False) ax.spines['left'].set_visible(False) ax.spines['top'].set_visible(False) ax.spines['bot...
2.8125
3
plugin.video.saltsrd.lite/scrapers/rlssource_scraper.py
TheWardoctor/wardoctors-repo
1
28093
""" SALTS XBMC Addon Copyright (C) 2014 tknorris This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. T...
2
2
visualization/experiments/plot_calibration_curves.py
silasbrack/special-course
0
28094
<gh_stars>0 from typing import List import numpy as np import pandas as pd from matplotlib import pyplot as plt from visualization.helper_functions import ( FIGURE_FOLDER, TYPE_DICT, calibration_curves, ) from visualization.load_results import load_results, save_results_to_table def plot_calibration_cur...
2.5
2
project/exact_distributions_covariance/exact_distributions_covariance_tools.py
juanhenao21/exact_distributions_financial
2
28095
<gh_stars>1-10 """Exact distributions covariance tools module. The functions in the module do small repetitive tasks, that are used along the whole implementation. These tools improve the way the tasks are standardized in the modules that use them. This script requires the following modules: * os * pickle ...
2.328125
2
Mission_to_Mars/Flask Application/scrape_mars.py
bigoshunane/Web-Scraping-Challenge-HM-10
0
28096
<filename>Mission_to_Mars/Flask Application/scrape_mars.py<gh_stars>0 # Import Dependencies import pandas as pd from splinter import Browser from bs4 import BeautifulSoup as bs from webdriver_manager.chrome import ChromeDriverManager def scrape(): # Featured Image scrape executable_path = {'executable_path': ...
3.078125
3
Snake.py
RodneyTheProgrammer/snkgame
0
28097
#!/usr/bin/env python import curses import time import random from operator import getitem,attrgetter stdscr = curses.initscr() L,W= stdscr.getmaxyx() curses.start_color() curses.noecho() curses.cbreak() curses.curs_set(0) stdscr.keypad(1) L,W = stdscr.getmaxyx() normal,infiltrate,get2goal,runaway=0,1,2,3 def start_pag...
3.140625
3
Jawaban/4.py
Rakhid16/pibiti-himatifa-2020
0
28098
kamus = {"elephant" : "gajah", "zebra" : "zebra", "dog" : "anjing", "camel" : "unta"} kata = input("Masukan kata berbahasa inggris : ") if kata in kamus: print("Terjemahan dari " + kata + " adalah " + kamus[kata]) else: print("Kata tersebt belum ada di kamus")
4.0625
4
pureskillgg_dsdk/tome/reader_fs.py
pureskillgg/dsdk
0
28099
<gh_stars>0 import pandas as pd import structlog import rapidjson from .constants import ( get_page_key_fs, get_tome_manifest_key_fs, get_tome_path_fs, ) class TomeReaderFs: def __init__(self, *, root_path, prefix=None, tome_name, log=None, has_header=True): self._log = log if log is not None ...
2.25
2