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
response_model/python/population_subunits/coarse/analysis/few_cells_tf_analyse_all.py
googlearchive/rgc-models
1
11500
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
1.890625
2
wagtail/admin/views/pages/unpublish.py
brownaa/wagtail
8,851
11501
<reponame>brownaa/wagtail<gh_stars>1000+ from django.core.exceptions import PermissionDenied from django.shortcuts import get_object_or_404, redirect from django.template.response import TemplateResponse from django.urls import reverse from django.utils.translation import gettext as _ from wagtail.admin import message...
1.945313
2
bcipy/display/rsvp/display.py
mberkanbicer/BciPy
32
11502
import logging import os.path as path from typing import List, Optional, Tuple from psychopy import core, visual from bcipy.acquisition.marker_writer import NullMarkerWriter, MarkerWriter from bcipy.helpers.task import SPACE_CHAR from bcipy.helpers.stimuli import resize_image from bcipy.helpers.system_utils import ge...
1.929688
2
cloud/db/db.py
bother3000/Smart-IoT-Planting-System
171
11503
#!/usr/bin/env python import pymysql #Python3 db = pymysql.connect("localhost","sips","root","zaijian" ) cursor = db.cursor() cursor.execute("SELECT VERSION()") data = cursor.fetchone() print ("Database version : %s " % data) db.close() def create_table(): db = pymysql.connect("localhost","sips","root","zaijian"...
3.28125
3
sdk/python/pulumi_aws_native/amplify/_inputs.py
AaronFriel/pulumi-aws-native
29
11504
<gh_stars>10-100 # 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 .. impor...
1.5625
2
awsecommerceservice/models/item_lookup_request.py
nidaizamir/Test-PY
0
11505
# -*- coding: utf-8 -*- """ awsecommerceservice This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). """ class ItemLookupRequest(object): """Implementation of the 'ItemLookupRequest' model. TODO: type model description here. Attributes: condition (ConditionE...
2.046875
2
data.py
zhaoyun630/R-NET-in-Keras
207
11506
<filename>data.py from __future__ import absolute_import from __future__ import print_function from __future__ import division import numpy as np import cPickle as pickle from keras import backend as K from keras.utils import np_utils from keras.preprocessing import sequence from random import shuffle import itertoo...
2.703125
3
algoritmos/ajuste-curvas/caso-linear/Teste.py
mauriciomoccelin/metodos-numericos
3
11507
<gh_stars>1-10 from RegressaoLinear import RegressaoLinear planoCartesiano = { 0.5: 4.4, 2.8: 1.8, 4.2: 1.0, 6.7: 0.4, 8.3: 0.2 } regressaoLinear = RegressaoLinear(planoCartesiano) print(regressaoLinear.gerar_equacao())
2.078125
2
src/app.py
UBC-MDS/dsci_532_group19
0
11508
<gh_stars>0 import dash from dash import html from dash import dcc import dash_bootstrap_components as dbc from dash.dependencies import Input, Output from .layout import * from .plot import * # from layout import * # from plot import * app = dash.Dash( __name__, external_stylesheets=[dbc.themes.BOOTSTRAP, "/css...
2.328125
2
jaeger-cli/rpc.py
shwsun/jaeger-cli
0
11509
# Copyright 2018 MassOpenCloud. # # 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 agr...
1.3125
1
data_structure/tree/test_binarytree.py
lp1225/my_algorithm
1
11510
<reponame>lp1225/my_algorithm # 搜索二叉树 from queue import Queue class Node(object): """节点""" def __init__(self, data): self.data = data self.node_left = None self.node_right = None class BinaryTree(object): def __init__(self): self.root = None def insert(tree, node...
4.15625
4
Python-desenvolvimento/ex036.py
MarcosMaciel-MMRS/Desenvolvimento-python
0
11511
<gh_stars>0 #empréstimos bancários. pegue o valor da casa, o salario da pessoa e em quanto tempo ela quer pagar. #se as parcelas ficarem acima de 30% do salario, negue o imprestimo. casa = float(input('Informe o valor da casa: R$')) salario = float(input('informe seu salario: R$')) tempo = int(input('Em quanto te...
3.828125
4
UDEMY-Learn Python Programming Masterclass/Section 3-Stepping into the World of Python/exercise4.py
Sanjay9921/Python
0
11512
#Integer division #You have a shop selling buns for $2.40 each. A customer comes in with $15, and would like to buy as many buns as possible. #Complete the code to calculate how many buns the customer can afford. #Note: Your customer won't be happy if you try to sell them part of a bun. #Print only the result, any o...
3.984375
4
scripts/test_maths.py
paulscottrobson/Basic65816
0
11513
# ******************************************************************************************* # ******************************************************************************************* # # Name : test_maths.py # Purpose : Create lots of variables/arrays and arithmetic/bitwise. # Date : 10th June 2019 # Author...
3.25
3
qa/char_analyze.py
JinkelaCrops/t2t-learning
5
11514
<gh_stars>1-10 # 所有的unicode字符 from collections import Counter import qa.regex_utils as regutil import re resource_path = "/media/tmxmall/a36811aa-0e87-4ba1-b14f-370134452449/data/medicine.txt" with open(resource_path, "r", encoding="utf8") as f: char_stream = f.read() char_dictionary = Counter(list(char_stream))...
2.625
3
challenges/largest_product_array/test_largest_product.py
jayadams011/data-structures-and-algorithms
0
11515
from largest_product.py import largest_product import pytest def test_product_returns(): """test if return is a single product """ assert largest_product.largest([[2, 2]]) is 4 def test_returns_largest(): """ test if return is the largest of longer array """ assert largest_product.largest([[1, 3], [6...
2.875
3
examples/transformer/model.py
namin/dm-haiku
0
11516
# Copyright 2020 DeepMind Technologies Limited. 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 by ...
2.265625
2
face.py
shwang95/Intelligence-Surveillance-System
1
11517
#!/usr/bin/env python import boto3 import cv2 import numpy import os import base64 import gspread from email.mime.base import MIMEBase from email.mime.image import MIMEImage from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from httplib2 import Http from time import localtime, strftim...
2.203125
2
unpythonic/syntax/autoref.py
aisha-w/unpythonic
0
11518
# -*- coding: utf-8 -*- """Implicitly reference attributes of an object.""" from ast import Name, Assign, Load, Call, Lambda, With, Str, arg, \ Attribute, Subscript, Store, Del from macropy.core.quotes import macros, q, u, name, ast_literal from macropy.core.hquotes import macros, hq from macropy.core...
2.390625
2
doit/exceptions.py
m4ta1l/doit
1,390
11519
<reponame>m4ta1l/doit """Handle exceptions generated from 'user' code""" import sys import traceback class InvalidCommand(Exception): """Invalid command line argument.""" def __init__(self, *args, **kwargs): self.not_found = kwargs.pop('not_found', None) super(InvalidCommand, self).__init__(*...
3.0625
3
python/redmonster/tools/plot_fits.py
timahutchinson/redmonster
5
11520
<reponame>timahutchinson/redmonster # GUI used for quickly plotting BOSS spectra. Also allows overplotting of best-fit template as # determined by redmonster pipeline. Sort of a redmonster version of plotspec.pro, though currently # with less bells and whistles. # # <NAME>, University of Utah, April 2014 # Signifcant...
2.1875
2
QueueReconstruction.py
yashpatel0369/PythonDataStructures
0
11521
<filename>QueueReconstruction.py # An algorithm to reconstruct the queue. # Suppose you have a random list of people standing in a queue. # Each person is described by a pair of integers (h,k), where h is the height of the person and k is the number of people in front of this person who have a height greater than or eq...
4
4
passagens/models/classe_viagem.py
carlosrjhoe/Aplicacao_Formulario_com_Django
0
11522
<reponame>carlosrjhoe/Aplicacao_Formulario_com_Django<gh_stars>0 from django.db import models from django.utils.translation import gettext_lazy as _ class ClasseViagem(models.TextChoices): ECONOMICA = 'ECO', _('Econômica') EXECUTIVA = 'EXE', _('Executiva') PRIMEIRA_CLASSE = 'PRI', _('Primeira')
1.960938
2
tests/unit/test_HashlistsByAlgLoaderThread.py
AntonKuzminRussia/hbs-cli
5
11523
# -*- coding: utf-8 -*- """ This is part of HashBruteStation software Docs EN: http://hack4sec.pro/wiki/index.php/Hash_Brute_Station_en Docs RU: http://hack4sec.pro/wiki/index.php/Hash_Brute_Station License: MIT Copyright (c) <NAME> <http://anton-kuzmin.ru> (ru) <http://anton-kuzmin.pro> (en) Integration tests for Has...
2.265625
2
simple_ddl_parser/tokens.py
burakuyar/simple-ddl-parser
46
11524
# statements that used at the start of defenition or in statements without columns defenition_statements = { "DROP": "DROP", "CREATE": "CREATE", "TABLE": "TABLE", "DATABASE": "DATABASE", "SCHEMA": "SCHEMA", "ALTER": "ALTER", "TYPE": "TYPE", "DOMAIN": "DOMAIN", "REPLACE": "REPLACE", ...
2.21875
2
rmexp/worker.py
junjuew/scalable-edge-native-applications
1
11525
from __future__ import absolute_import, division, print_function import json import logging import os import time import importlib import multiprocessing import cv2 import fire import logzero from logzero import logger import numpy as np from rmexp import config, cvutils, dbutils, gabriel_pb2, client from rmexp.sche...
2.1875
2
app/requests/users.py
codingedward/book-a-meal-api
0
11526
from .base import JsonRequest class PostRequest(JsonRequest): @staticmethod def rules(): return { 'email': 'required|email|unique:User,email', 'password': '<PASSWORD>', 'username': 'required|alpha|least_string:3', 'role': 'integer|positive|found_in:1,2',...
2.578125
3
kmp.py
mutux/kmp
3
11527
<gh_stars>1-10 def kmp(P, T): # Compute the start position (number of chars) of the longest suffix that matches a prefix, # and store them into list K, the first element of K is set to be -1, the second # K = [] # K[t] store the value that when mismatch happens at t, should move Pattern P K[t] characte...
3.265625
3
weeklypedia/publish.py
Nintendofan885/weeklypedia
0
11528
<reponame>Nintendofan885/weeklypedia<filename>weeklypedia/publish.py # -*- coding: utf-8 -*- import os import json from os.path import dirname from argparse import ArgumentParser from clastic.render import AshesRenderFactory from common import DEBUG, DEBUG_LIST_ID, SENDKEY from web import (comma_int, ...
2.25
2
scripts/words_gen.py
andybui01/Bloom
0
11529
import random import sys # usage: python3 words_gen.py > list.txt N = int(sys.argv[1]) # how many words should be in the resulting list with open("scripts/words.txt", "r") as f: words = f.readlines() for i in range(N): print(words[random.randint(0, 466550 - 1)].rstrip())
3.328125
3
testing/test_input.py
arunumd/Rover
1
11530
import unittest from modules.Input import * class CommandInputTest(unittest.TestCase): def setUp(self): self.field_a_locations = ["gOtOFieldAroW8", " go to fieLDA RoW 18 ", "gOTOfield A rOW88"] self.field_b_locations = ["gOtOFie...
3.640625
4
rmgpy/kinetics/chebyshevTest.py
pm15ma/RMG-Py
1
11531
<gh_stars>1-10 #!/usr/bin/env python3 ############################################################################### # # # RMG - Reaction Mechanism Generator # # ...
1.570313
2
SceneDistribution_Blender/Source/__init__.py
FilmakademieRnd/v-p-e-t
62
11532
""" ----------------------------------------------------------------------------- This source file is part of VPET - Virtual Production Editing Tools http://vpet.research.animationsinstitut.de/ http://github.com/FilmakademieRnd/VPET Copyright (c) 2021 <NAME>, Animationsinstitut R&D Lab This project has been initiated...
1.15625
1
defences/CIFAR10/standard_training.py
calinbiberea/imperial-individual-project
0
11533
# Unlike the other datasets, CIFAR-10 uses ResNet and suffers from # a variety of problems, including exploding gradients import torch import torch.nn as nn from tqdm.notebook import tnrange, tqdm # For loading model sanely import os.path import sys # This here actually adds the path sys.path.append("../../") import ...
2.8125
3
src/romt/manifest.py
hehaoqian/romt
29
11534
<reponame>hehaoqian/romt<filename>src/romt/manifest.py #!/usr/bin/env python3 # coding=utf-8 import copy from pathlib import Path from typing import ( Any, Generator, Iterable, List, MutableMapping, Optional, ) import toml from romt import error def target_matches_any(target: str, expected_...
2.296875
2
examples/unread_sms.py
MikeRixWolfe/pygooglevoice
1
11535
<reponame>MikeRixWolfe/pygooglevoice from googlevoice import Voice voice = Voice() voice.login() for message in voice.sms().messages: #if not message.isRead: print(message.id, message.phoneNumber, message.messageText) #message.mark(1)
2.53125
3
libra/handlers/user.py
pitomba/libra
2
11536
# coding: utf-8 from tornado.web import RequestHandler from libra.handlers.base import authenticated class UserHandler(RequestHandler): @authenticated def post(self, user, **kwargs): self.write({"msg": "Success"})
2.078125
2
plextraktsync/commands/unmatched.py
RoyXiang/PlexTraktSync
0
11537
<filename>plextraktsync/commands/unmatched.py import click from plextraktsync.commands.login import ensure_login from plextraktsync.factory import factory from plextraktsync.walker import WalkConfig, Walker def unmatched(no_progress_bar: bool, local: bool): config = factory.run_config().update(progressbar=not no...
2.609375
3
montepython/likelihoods/covfefe/__init__.py
Maquiner/Monte_Python_2CCL
1
11538
import os import numpy as np from montepython.likelihood_class import Likelihood import montepython.io_mp as io_mp import warnings import ccl_tools as tools import pyccl as ccl class covfefe(Likelihood): # initialization routine def __init__(self, path, data, command_line): Likelihood.__init__(sel...
2.1875
2
tests/integration/web3/conftest.py
cducrest/eth-tester-rpc
3
11539
<filename>tests/integration/web3/conftest.py from eth_utils import ( to_bytes, ) from eth_utils.toolz import ( identity, ) import pytest from web3._utils.module_testing.emitter_contract import ( CONTRACT_EMITTER_ABI, CONTRACT_EMITTER_CODE, ) from web3._utils.module_testing.math_contract import ( MAT...
1.632813
2
planning/domains/depth/depthGenerator.py
xlbandy/fape
14
11540
from __future__ import division import itertools import json import math import os import random import shutil import subprocess import sys durationA = str(5) durationB = str(4) durationC = str(1) def main(): if len(sys.argv) > 1: nbDepth = int(sys.argv[1]) if nbDepth < 2 : nbDept...
2.4375
2
idc/settings.py
fedorov/IDC-WebApp
0
11541
### # Copyright 2015-2020, Institute for Systems Biology # # 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 la...
1.984375
2
examples/fixed_play.py
wwxFromTju/malib
6
11542
<gh_stars>1-10 # Created by yingwen at 2019-03-16 from multiprocessing import Process from malib.agents.agent_factory import * from malib.environments import DifferentialGame from malib.logger.utils import set_logger from malib.samplers.sampler import MASampler from malib.trainers import MATrainer from malib.utils.ran...
1.992188
2
hypha/apply/projects/templatetags/payment_request_tools.py
maxpearl/hypha
16
11543
import decimal from django import template register = template.Library() @register.simple_tag def can_change_status(payment_request, user): return payment_request.can_user_change_status(user) @register.simple_tag def can_delete(payment_request, user): return payment_request.can_user_delete(user) @regist...
2.390625
2
pylabnet/hardware/counter/swabian_instruments/qudi/slow_ctr.py
wi11dey/pylabnet
10
11544
""" pylabnet measurement and service classes for Swabian Instruments TimeTagger which implements qudi's SlowCounter interface. This file contains pylabnet wrapper and service classes to allow qudi to access Swabian Instruments TT through pylabnet network as SlowCounter. Steps: - instantiate TimeTagger - instantiate p...
2.25
2
dev0s/classes/defaults/files.py
vandenberghinc/dev0s
1
11545
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Must still be recoded with some cleaner code. """ # imports. from dev0s.classes.config import * from dev0s.classes import utils from dev0s.classes.defaults.color import color, symbol from dev0s.classes import console from dev0s.classes.defaults.exceptions import Excep...
2.6875
3
object_torus.py
KeerthanBhat/pygame-Search-the-Key
0
11546
import pygame from pygame.locals import * from OpenGL.GL import * from OpenGL.GLU import * from OpenGL.GLUT import * def main(): pygame.init() glutInit() display = (800,600) pygame.display.set_mode(display, DOUBLEBUF|OPENGL) gluPerspective(45, (display[0]/display[1]), 0.1, 50.0) glTranslatef(0.0, 0.0, -5) w...
3.015625
3
samples/snippets/translate_v3_batch_translate_text_with_glossary_and_model.py
renovate-bot/python-translate
70
11547
<gh_stars>10-100 # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
2.15625
2
movo_common/movo_third_party/executive_smach/smach_ros/test/concurrence.py
zkytony/kinova-movo
2
11548
<filename>movo_common/movo_third_party/executive_smach/smach_ros/test/concurrence.py #!/usr/bin/env python import roslib; roslib.load_manifest('smach_ros') import rospy import rostest import unittest from actionlib import * from actionlib.msg import * from smach import * from smach_ros import * from smach_msgs.msg...
1.914063
2
KaratAPP/models.py
MHuiG/Karat-Django-Backend
0
11549
from django.db import models # Create your models here. ########################################################################## #投票 class Vote(models.Model): data=models.CharField(max_length=255) ##########################################################################
2.421875
2
arguments.py
nudles/a2c
0
11550
import argparse import torch def get_args(): parser = argparse.ArgumentParser(description='RL') parser.add_argument('--algo', default='a2c', help='algorithm to use: a2c | ppo ') parser.add_argument('--lr', type=float, default=7e-5, help='learning rate (defau...
2.46875
2
vega/algorithms/nas/__init__.py
wnov/vega
6
11551
from .backbone_nas import * from .adelaide_ea import * from .sr_ea import * from .esr_ea import * from .darts_cnn import * from .cars import * from .fis import * from .auto_lane import * from .mfkd import *
1
1
ai.py
s18mbbustorff/AI_Hanabi_Assignment
0
11552
<filename>ai.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Mar 9 12:27:15 2021 @author: kuba """ import copy import numpy as np w = {"H0": {"H0":0.2,"H1": 0.2, "P0": 0.5, "P1": 0.1}, "H1": {"H0":0.2,"H1": 0.2, "P0": 0.1, "P1": 0.5}, "P0": {"H0":0.3,"H1": 0.3, "P0": 0.2, "P1": 0.2},...
3.3125
3
(19.12.06) Culminating/sprites.py
bly852/ICS3U1
0
11553
# course: ICS3U1 2019 # exercise: Culminating Activity # date: 2019-12-06 # student number: 340926187 # name: <NAME> # description: Two players (Mr Chun & Mr Pileggi) running around the school # collecting food for the food drive. # sprite classes import pygame imp...
3.640625
4
app/schemas/usage_logs.py
wiki-yu/fastapi-algorithm-library
0
11554
<gh_stars>0 from typing import Optional, List from pydantic import BaseModel class UsageLog(BaseModel): api_key: str is_active: bool never_expire: bool expiration_date: str latest_query_date: Optional[str] total_queries: int class UsageLogs(BaseModel): logs: List[UsageLog]
2.21875
2
dstf/core.py
anthonydugois/dstf
0
11555
from abc import ABCMeta, abstractmethod from collections import OrderedDict from math import inf from typing import Iterator, Any, List, Dict, Type, Optional EPSILON = 1e-4 class Error(Exception): pass class ConstraintError(Error): pass class Constraint(metaclass=ABCMeta): @abstractmethod def isv...
3.015625
3
2018/2018_06a.py
davidxiao93/Advent-of-Code
0
11556
input = """154, 159 172, 84 235, 204 181, 122 161, 337 305, 104 128, 298 176, 328 146, 71 210, 87 341, 195 50, 96 225, 151 86, 171 239, 68 79, 50 191, 284 200, 122 282, 240 224, 282 327, 74 158, 289 331, 244 154, 327 317, 110 272, 179 173, 175 187, 104 44, 194 202, 332 249, 197 244, 225 52, 127 299, 198 123, 198 349, 7...
3.375
3
tests/test_backup.py
KonstantinPankratov/Backupy
1
11557
<gh_stars>1-10 import os from Backupy import Backupy def test_backup(): backup = Backupy() backup.add_directory('./') backup.start() assert os.path.exists(backup.filename) os.remove(backup.filename)
2.34375
2
tweetf0rm/process/crawler_process.py
amaurywalbert/mytweetf0rm
1
11558
#!/usr/bin/python # -*- coding: utf-8 -*- # import logging logger = logging.getLogger(__name__) import multiprocessing as mp import tweetf0rm.handler from tweetf0rm.redis_helper import CrawlerQueue #MAX_QUEUE_SIZE = 32767 class CrawlerProcess(mp.Process): def __init__(self, node_id, crawler_id, redis_config, ha...
2.5
2
cloudify_aws/ec2/resources/dhcp.py
marrowne/cloudify-aws-plugin
0
11559
# Copyright (c) 2018 Cloudify Platform Ltd. 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 by ap...
1.953125
2
tests/testing_support/sample_applications.py
douglasfarinelli/newrelic-python-agent
1
11560
# Copyright 2010 New Relic, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
2.046875
2
spydrnet_tmr/transformation/replication/nmr.py
byuccl/spydrnet-tmr
0
11561
from spydrnet.ir import Port, Instance, InnerPin from spydrnet_tmr.transformation.util import add_suffix_to_name IN = Port.Direction.IN OUT = Port.Direction.OUT INOUT = Port.Direction.INOUT def apply_nmr(ports_and_instances_to_replicate, degree, name_suffix='NMR', rename_original=True): """ Replicate the sele...
2.703125
3
pyspark/example/spark_core/4.7_spark_prog.py
chiliangpi/hellobi
53
11562
<reponame>chiliangpi/hellobi import os import numpy as np import sys import logging LOG_PATH = os.environ['log'] spark_home = os.environ['SPARK_HOME'] sys.path.insert(0, os.path.join(spark_home, 'python')) sys.path.insert(0, os.path.join(spark_home, 'python/lib/py4j-0.10.4-src.zip')) from pyspark.sql import SparkSess...
2.4375
2
infra_macros/fbcode_macros/tests/shell_test.py
xw285cornell/buckit
0
11563
# Copyright 2016-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. from __future__ import absol...
2.40625
2
bash/src/_func_storage.py
BillGatesCat/yf
19
11564
class _FuncStorage: def __init__(self): self._function_map = {} def insert_function(self, name, function): self._function_map[name] = function def get_all_functions(self): return self._function_map
2.390625
2
tests/unit/core/SubdomainTest.py
edgargmartinez/OpenPNM
3
11565
import openpnm as op import scipy as sp import pytest class SubdomainTest: def setup_class(self): ws = op.Workspace() ws.settings['local_data'] = True self.net = op.network.Cubic(shape=[3, 3, 3]) self.geo = op.geometry.GenericGeometry(network=self.net, ...
2.078125
2
loci/io.py
SLIPO-EU/loci
3
11566
import pandas as pd from shapely.geometry import Point import geopandas as gpd import math import osmnx import requests from io import BytesIO from zipfile import ZipFile def read_poi_csv(input_file, col_id='id', col_name='name', col_lon='lon', col_lat='lat', col_kwds='kwds', col_sep=';', kwds_sep=',...
3.15625
3
src/roles/wolf.py
timson622222/lykos
0
11567
import re import random from collections import defaultdict import src.settings as var from src.utilities import * from src import debuglog, errlog, plog from src.decorators import cmd, event_listener from src.messages import messages from src.events import Event KILLS = {} # type: Dict[str, List[str]] @cmd("kill", ...
2.34375
2
BOG.py
punyajoy/biosbias
0
11568
<filename>BOG.py # -*- coding: utf-8 -*- """ Created on Fri Feb 28 13:52:20 2020 @author: midas """ import os import glob import pandas as pd import numpy as np all_filenames=['Data/Train.csv', 'Data/Test.csv'] combined_csv = pd.concat([pd.read_csv(f) for f in all_filenames ]) combined_csv.to_c...
2.578125
3
src/ploomber/jupyter/manager.py
idomic/ploomber
0
11569
<reponame>idomic/ploomber """ Module for the jupyter extension """ import sys import datetime import os import contextlib from pprint import pprint from pathlib import Path from jupytext.contentsmanager import TextFileContentsManager from ploomber.sources.notebooksource import (_cleanup_rendered_nb, inject_cell) from...
1.921875
2
quake_reporter/quake_datafeed.py
shandozer/quake_reporter
0
11570
<filename>quake_reporter/quake_datafeed.py #!/usr/bin/env python """ __author__ = <NAME>, 10/8/16 Python 2.7.x """ import json import urllib2 import datetime import argparse VERSION = '0.2.1' def get_parser(): parser = argparse.ArgumentParser() parser.add_argument('-m', '--magnitude', action="store", typ...
3.1875
3
tests/visualization/data_sources/test_satellite.py
openclimatefix/nowcasting_utils
2
11571
<reponame>openclimatefix/nowcasting_utils<gh_stars>1-10 """ Tests to plot satellite data """ import os import plotly.graph_objects as go from nowcasting_dataset.data_sources.fake.batch import satellite_fake from nowcasting_dataset.geospatial import osgb_to_lat_lon from nowcasting_utils.visualization.data_sources.plot...
2.25
2
owtf/__main__.py
Udbhavbisarya23/owtf
1,514
11572
<gh_stars>1000+ """ owtf.__main__ ~~~~~~~~~~~~~ A __main__ method for OWTF so that internal services can be called as Python modules. """ import sys from owtf.core import main if __name__ == "__main__": main()
1.453125
1
sympyosis/logger.py
ZechCodes/sympyosis
0
11573
<filename>sympyosis/logger.py from enum import IntEnum from typing import Type, TypeVar import logging T = TypeVar("T") class LogLevel(IntEnum): DEBUG = logging.DEBUG INFO = logging.INFO WARNING = logging.WARNING ERROR = logging.ERROR CRITICAL = logging.CRITICAL @classmethod def get(cls...
2.703125
3
peframe/modules/apialert.py
ki1556ki/MJUOpenSource
0
11574
# -*- coding: utf-8 -*- # json 형식 사용을 위한 임폴트 import json # get함수, 각각의 반복문을 통해 apialert_found안에 문자열 삽입후 리스트형식으로 정렬하여 리턴값 반환. def get(pe, strings_match): alerts = strings_match['apialert'] apialert_found = [] # pe에 DIRECTORY_ENTRY_IMPORT라는 변수가 있는지 확인하여 있으면 참 없으면 거짓. if hasattr(pe, 'DIRECTORY_ENTRY_IMPORT'):...
2.28125
2
tests/conftest.py
Ninjagod1251/ape
0
11575
import shutil from pathlib import Path from tempfile import mkdtemp import pytest from click.testing import CliRunner import ape # NOTE: Ensure that we don't use local paths for these ape.config.DATA_FOLDER = Path(mkdtemp()).resolve() ape.config.PROJECT_FOLDER = Path(mkdtemp()).resolve() @pytest.fixture(scope="ses...
2.078125
2
recipes/Python/576543_Prime_Number_Generator_Checker/recipe-576543.py
tdiprima/code
2,023
11576
<reponame>tdiprima/code<gh_stars>1000+ # # prime number generator # This program gets two number as input # and prints # Prime numbers in the range # Actual number of primes in the range # and Estimation based on formula # n # pi(n)= ------- # log(n) # ...
3.8125
4
Practica 1 E4.py
pardo13/python
0
11577
<gh_stars>0 A=int(input("dame int")) B=int(input("dame int")) if(A>B): print("A es mayor") else: print("B es mayor")
3.65625
4
selenium_driver_updater/_phantomJS.py
Svinokur/selenium_driver_updater
8
11578
#pylint: disable=logging-fstring-interpolation #Standart library imports import shutil import os import time from typing import Tuple from pathlib import Path import re from shutil import copyfile import wget # Local imports from selenium_driver_updater.util.logger import logger from selenium_driver_updater.util.excep...
2.125
2
src/ychaos/settings.py
vanderh0ff/ychaos
8
11579
# Copyright 2021, Yahoo # Licensed under the terms of the Apache 2.0 license. See the LICENSE file in the project root for terms from pathlib import Path from typing import Optional, Union from pydantic import BaseModel class ApplicationSettings(BaseModel): """ Defines the Global Settings that are consiste...
2.1875
2
tests/func/test_pipeline.py
kacmak7/dvc
0
11580
<gh_stars>0 import logging from dvc.main import main from tests.basic_env import TestDvc from tests.func.test_repro import TestRepro from tests.func.test_repro import TestReproChangedDeepData class TestPipelineShowSingle(TestDvc): def setUp(self): super().setUp() self.stage = "foo.dvc" re...
2.359375
2
my_modes/ChaseLoop.py
mjocean/T2Game
0
11581
<reponame>mjocean/T2Game<filename>my_modes/ChaseLoop.py import procgame.game from procgame.game import AdvancedMode import logging class ChaseLoop(procgame.game.AdvancedMode): """ Example of T2 "Chase Loop" functionality (described in the rules PDF on page J) TODO: Sound effects, other visual feedback...
2.5625
3
app/dists/admin.py
ariashahverdi/Backend
0
11582
from django.contrib import admin from .models import Distribution admin.site.register(Distribution) # Register your models here.
1.234375
1
examples_ltnw/binary_classifier.py
gilbeckers/logictensornetworks
0
11583
<filename>examples_ltnw/binary_classifier.py # -*- coding: utf-8 -*- import logging; logging.basicConfig(level=logging.INFO) import numpy as np import matplotlib.pyplot as plt import logictensornetworks_wrapper as ltnw nr_samples=500 data=np.random.uniform([0,0],[1.,1.],(nr_samples,2)).astype(np.float32) data_A=dat...
2.75
3
leetcode/0015_3Sum/result.py
theck17/notes
0
11584
<reponame>theck17/notes # !/usr/bin/env python3 # Author: C.K # Email: <EMAIL> # DateTime:2021-03-15 00:07:14 # Description: class Solution: def threeSum(self, nums: List[int]) -> List[List[int]]: result = set() for i in range(0, len(nums) - 1): # Reduce the problem to two sum(0) ...
3.828125
4
customer/views.py
lautarianoo/django_shop
0
11585
from django.contrib.auth import authenticate, login from django.shortcuts import render, redirect from cart.models import Cart from django.views import View from .forms import LoginForm, RegistrationForm, CreateCompanyForm from customer.models import Customer, ShippingAddress from src.utils.mixins import CustomerMixin ...
2.171875
2
kickstarter/app.py
Annapurnaj91/kickstarter3
0
11586
from flask import Flask, render_template, request # from .recommendation import * # import pickle import pandas as pd import numpy as np # import keras # from keras.models import load_model import pickle def create_app(): # initializes our app APP = Flask(__name__) @APP.route('/') def form(): ...
2.75
3
src/apiron/service/discoverable.py
tushar-deepsource/apiron
109
11587
from typing import List, Type from apiron.service.base import ServiceBase class DiscoverableService(ServiceBase): """ A Service whose hosts are determined via a host resolver. A host resolver is any class with a :func:`resolve` method that takes a service name as its sole argument and returns a l...
2.96875
3
src/plotman/plot_util.py
rafaelsteil/plotman
0
11588
<filename>src/plotman/plot_util.py import math import os import re import shutil from plotman import job GB = 1_000_000_000 def df_b(d): 'Return free space for directory (in bytes)' usage = shutil.disk_usage(d) return usage.free def get_k32_plotsize(): return 108 * GB def is_valid_plot_dst(d, sched...
2.609375
3
src/config.py
forkedbranch/femm-opt
1
11589
<filename>src/config.py # (c) Copyright 2016 forkedbranch (http://forkedbranch.eu/) # Licensed under the Apache License, Version 2.0 import configparser config = configparser.ConfigParser() config.read('config.ini') def get_input_folder(): return config['DEFAULT']['InputFolder'] def get_output_folder(): ...
1.726563
2
vespene/workers/registration.py
Conan-Kudo/vespene
680
11590
# Copyright 2018, <NAME> LLC # License: Apache License Version 2.0 # ------------------------------------------------------------------------- # registration.py - updates the database to say who is building something # and what the current settings are, which is used by the file serving # code to see if it is ok ...
2.046875
2
tests/test_db_mathes_ui.py
AlexRovan/Python_training
0
11591
<filename>tests/test_db_mathes_ui.py from model.group import Group from model.contact import Contact def test_group_list(app,db): ui_group = app.group.get_groups_list() def clean(group): return Group(id=group.id, name=group.name.strip()) bd_group = map(clean,db.get_group_list()) assert sorted(u...
2.5
2
10 Days of Statistics/Day 5 - Normal Distribution I.py
sohammanjrekar/HackerRank
0
11592
<reponame>sohammanjrekar/HackerRank<filename>10 Days of Statistics/Day 5 - Normal Distribution I.py """ Day 5: Normal Distribution I In certain plant, the time taken to assemble a car is a random variable, X having a normal distribution with a mean of 20 hours and a standard deviation of 2 hours. What is the proba...
3.578125
4
11024/11024.py3.py
isac322/BOJ
14
11593
for _ in range(int(input())): print(sum(map(int, input().split())))
2.9375
3
tests/test_contact_form.py
LaudateCorpus1/apostello
69
11594
import pytest from apostello import models @pytest.mark.slow @pytest.mark.django_db class TestContactForm: """Test the sending of SMS.""" def test_number_permissions_staff_exception(self, recipients, users): """Test sending a message now.""" calvin = recipients["calvin"] # check good...
2.296875
2
tests/unit/records/format_hints.py
cwegrzyn/records-mover
36
11595
<reponame>cwegrzyn/records-mover bluelabs_format_hints = { 'field-delimiter': ',', 'record-terminator': "\n", 'compression': 'GZIP', 'quoting': None, 'quotechar': '"', 'doublequote': False, 'escape': '\\', 'encoding': 'UTF8', 'dateformat': 'YYYY-MM-DD', 'timeonlyformat': 'HH24:MI...
1.75
2
CONST.py
Bobobert/DQN-Vanilla
0
11596
# FROM THE OP PAPER-ISH MINI_BATCH_SIZE = 32 MEMORY_SIZE = 10**6 BUFFER_SIZE = 100 LHIST = 4 GAMMA = 0.99 UPDATE_FREQ_ONlINE = 4 UPDATE_TARGET = 2500 # This was 10**4 but is measured in actor steps, so it's divided update_freq_online TEST_FREQ = 5*10**4 # Measure in updates TEST_STEPS = 10**4 LEARNING_RATE = 0.00025 G_...
1.335938
1
milieu/paper/methods/milieu.py
seyuboglu/milieu
1
11597
import os import json import logging from collections import defaultdict import numpy as np import networkx as nx import torch from torch.utils.data import DataLoader from torch.optim import Adam from tqdm import tqdm from milieu.util.util import place_on_cpu, place_on_gpu from milieu.paper.methods.method import D...
2.125
2
scripts/telegram_bot.py
luigi311/ArBluna
18
11598
<filename>scripts/telegram_bot.py<gh_stars>10-100 import os import distutils.util from telegram import Update from telegram.ext import Updater, CommandHandler, Filters, CallbackContext from dotenv import load_dotenv from scripts.get_info import get_ratio from scripts.terra import get_balances, execute_swap load_dote...
2.46875
2
envs/mujoco/utils/download_meshes.py
hzm2016/assistive-gym-robosuite
1
11599
<reponame>hzm2016/assistive-gym-robosuite import os import zipfile import requests def check_and_download(name, google_id, files=None, force_download=False): """ Checks if the meshes folder exists in the xml directory If not it will ask the user if they want to download them to be able to proceed Parameters --...
3.234375
3