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
scripts/warp/warp.py
lfmontesanto/WoloxAndroidBootsrap
9
36000
#!/usr/bin/python import os, glob, hashlib, pickle, argparse, shutil, ntpath import os, glob, hashlib, pickle, argparse, shutil, multiprocessing, signal, sys from multiprocessing import Pool from functools import partial ######################### Classes ############################## class AndroidDensity: def __i...
2.28125
2
moviecritic/models.py
mdameenh/elysia
0
36001
<reponame>mdameenh/elysia<filename>moviecritic/models.py from django.db import models from django.contrib.postgres.fields import ArrayField # Create your models here. class Movie_Details(models.Model): name = models.CharField(max_length=100) year = models.IntegerField(default=0) boxoffice = models.BigInteg...
2.375
2
djangular/tests/utils.py
jianglb-alibaba/djangular-0.2.7
145
36002
import os from djangular import utils from django.test import SimpleTestCase class SiteAndPathUtilsTest(SimpleTestCase): site_utils = utils.SiteAndPathUtils() def test_djangular_root(self): current_dir = os.path.dirname(os.path.abspath(__file__)) djangular_dir = os.path.dirname(current_dir)...
2.40625
2
BA1E.py
tyleryasaka/rosalind-solutions
0
36003
<reponame>tyleryasaka/rosalind-solutions datasetFile = open("datasets/rosalind_ba1e.txt", "r") genome = datasetFile.readline().strip() otherArgs = datasetFile.readline().strip() k, L, t = map(lambda x: int(x), otherArgs.split(" ")) def findClumps(genome, k, L, t): kmerIndex = {} clumpedKmers = set() for i ...
3.03125
3
src/wee/urls.py
dipkakwani/wee_app
2
36004
from django.conf.urls import patterns, include, url from django.contrib import admin from django.conf.urls.static import static from userModule.views import home from userModule.views import userSettings from userModule.views import logout from groupModule.views import createGroup from groupModule.views import group fr...
1.96875
2
src/encoded/searches/responses.py
procha2/encoded
102
36005
from encoded.searches.mixins import CartAggsToFacetsMixin from snosearch.responses import BasicQueryResponseWithFacets from snosearch.responses import BasicMatrixResponseWithFacets class CartQueryResponseWithFacets(CartAggsToFacetsMixin, BasicQueryResponseWithFacets): ''' Like BasicQueryResponseWithFacets but...
2.25
2
unit-tests/live/frames/test-t2ff-sensor.py
ksvbka/librealsense
6,457
36006
# License: Apache 2.0. See LICENSE file in root directory. # Copyright(c) 2021 Intel Corporation. All Rights Reserved. # test:device L500* # test:device D400* import pyrealsense2 as rs from rspy.stopwatch import Stopwatch from rspy import test, log import time import platform # Start depth + color streams and measur...
2.375
2
test_apps/python_app/tests/_shared/for_proc.py
Origen-SDK/o2
0
36007
<filename>test_apps/python_app/tests/_shared/for_proc.py def setenv(config_root, config_name=None, bypass_config_lookup=None): import os, inspect, pathlib, sys if bypass_config_lookup: os.environ['origen_bypass_config_lookup'] = "1" if config_name is None: config_name = inspect.stack()[1].fu...
1.976563
2
example/serializers.py
divipayhq/drf_model_pusher
5
36008
<filename>example/serializers.py from rest_framework import serializers from example.models import MyPublicModel, MyPrivateModel, MyPresenceModel class MyPublicModelSerializer(serializers.ModelSerializer): class Meta: model = MyPublicModel fields = ("name",) class MyPrivateModelSerializer(seria...
2.375
2
src/analyzer/token.py
betoSolares/minicomp
1
36009
class Token: def __init__(self, word, line, start, finish, category, reason=None): self.__word__ = word self.__line__ = line self.__start__ = start self.__finish__ = finish self.__category__ = category self.__reason__ = reason @property def word(self): ...
3.078125
3
spektral/layers/convolutional/graph_conv.py
msaroufim/spektral
1
36010
from tensorflow.keras import activations, initializers, regularizers, constraints from tensorflow.keras import backend as K from tensorflow.keras.layers import Layer from spektral.layers import ops from spektral.utils import localpooling_filter class GraphConv(Layer): r""" A graph convolutional layer (GCN) a...
2.875
3
test.py
s-rohil/infrastructure-as-a-code
0
36011
<reponame>s-rohil/infrastructure-as-a-code Test Dummy code to make commit
0.773438
1
pyBirdcagebuilder.py
umcu7tcoillab/pyBirdcagebuilder
0
36012
<gh_stars>0 #!/usr/bin/env python3 """ Description: pyBirdcagebuilder is a program that calculates ideal capacitor values for birdcage coil designs. This program is based on the original Birdcage Builder program provided by PennState Health. (https://research.med.psu.edu/departments/center-for-nmr-research/sof...
3.046875
3
tests/semver/constraints/test_multi_constraint.py
batisteo/poetry
0
36013
<filename>tests/semver/constraints/test_multi_constraint.py<gh_stars>0 from poetry.semver.constraints.constraint import Constraint from poetry.semver.constraints.multi_constraint import MultiConstraint def test_multi_version_match_succeeds(): require_start = Constraint('>', '1.0') require_end = Constraint('<'...
1.9375
2
epuap_watchdog/institutions/serializers.py
ad-m/epuap-watchdog
2
36014
<filename>epuap_watchdog/institutions/serializers.py from rest_framework import serializers from teryt_tree.rest_framework_ext.serializers import JednostkaAdministracyjnaSerializer from .models import RESP, REGONError, REGON, JSTConnection, Institution, ESP class RESPSerializer(serializers.HyperlinkedModelSerializer...
2
2
ross/fluid_flow/fluid_flow_coefficients.py
hiagopinacio/ross
1
36015
<gh_stars>1-10 import warnings from math import isnan import numpy as np from scipy import integrate from ross.fluid_flow.fluid_flow_geometry import move_rotor_center def calculate_oil_film_force(fluid_flow_object, force_type=None): """This function calculates the forces of the oil film in the N and T direction...
3.140625
3
dashboard/admin.py
AliBigdeli/Django-Metric-Monitoring-App
0
36016
from django.contrib import admin from .models import Device,Metric class DeviceAdmin(admin.ModelAdmin): list_display = ["name", "token","user", "created_date"] search_fields = ["name", "token"] list_filter = ("user",) class MetricAdmin(admin.ModelAdmin): list_display = ["device","temperature", "humid...
1.8125
2
tryTimer.py
Timaos123/maintian_PlatoUtils
0
36017
<filename>tryTimer.py import time import numpy as np import gc a=[] start=time.time() for i in range(10000000): a.extend([[i,i+1,i+2]]) end=time.time() print(end-start) a=[] start=time.time() for i in range(10000000): a.append([i,i+1,i+2]) end=time.time() print(end-start) a=[] start=time.time() gc.disable() ...
2.921875
3
migrations/versions/a45942d815f_added_upload_table.py
green-mercury/SampleManagerWeb
4
36018
<filename>migrations/versions/a45942d815f_added_upload_table.py """added upload table Revision ID: a45942d815f Revises: <PASSWORD> Create Date: 2016-03-07 12:00:50.283535 """ # revision identifiers, used by Alembic. revision = 'a45942d815f' down_revision = '<PASSWORD>' from alembic import op import sqlalchemy as sa...
1.625
2
core/tests/test_views.py
honno/ascii-forever
0
36019
from django.urls import reverse from pytest import mark from core.models import * urls = [reverse(name) for name in ["core:index", "core:arts"]] @mark.parametrize("url", urls) @mark.django_db def test_nsfw_filter(url, django_user_model, client): target = django_user_model.objects.create(username="bob", password...
2.28125
2
constants/nodetype.py
vladzaharia/meshnet
1
36020
# Node types TYPE_NODE = b'\x10' TYPE_NODE_NR = b'\x11' # Gateway types TYPE_GATEWAY = b'\x20' TYPE_GATEWAY_TIME = b'\x21' # Special types TYPE_PROVISIONING = b'\xFF'
1.125
1
commissioning/log2cases/parselog.py
dobos/pysynphot
24
36021
"""This script *replaces* the processlog.csh shell script. It has more sophisticated logic to add the etc test name to the pysynphot command as another keyword-value pair. Modified to parse the modified line, then write a dictionary that will be read by the gencases tool. """ import sys,re, pickle from pysynphot impo...
2.453125
2
src/hypergraph_nets/reducers.py
yutian-zhao/STRIPS-HGN
0
36022
<reponame>yutian-zhao/STRIPS-HGN import torch # import time # from torch_scatter import scatter # Maybe see if this is good: https://github.com/rusty1s/pytorch_scatter # My implementation is quite suboptimal # def time_fun(f, iter, *args): # start_time = time.perf_counter() # start = time.time() # for i i...
2.265625
2
examples/button.py
Akuli/tkinder
23
36023
import teek def on_click(): print("You clicked me!") window = teek.Window() button = teek.Button(window, "Click me", command=on_click) button.pack() window.on_delete_window.connect(teek.quit) teek.run()
2.90625
3
docarray/array/mixins/find.py
fastflair/docarray
0
36024
import abc from typing import overload, Optional, Union, Dict, List, Tuple, Callable, TYPE_CHECKING import numpy as np from ...math import ndarray from ...score import NamedScore if TYPE_CHECKING: from ...types import T, ArrayType from ... import Document, DocumentArray class FindMixin: """A mixin tha...
2.421875
2
zgres/systemd.py
jinty/zgres
12
36025
<reponame>jinty/zgres import os from subprocess import check_call, call def write_service(service_name, contents): """Write a service file in a "safe" manner. If the contents of the file are the same as what is desired to be written, do nothing. First writes to a temporary file in the same direct...
2.9375
3
native/java/lang/double.py
wonderyue/TinyJVM
0
36026
<gh_stars>0 import struct def double_to_raw_long_bits(frame): """ public static native long doubleToRawLongBits(double value); """ value = frame.get_local_double(0) b = struct.pack("d", value) i = struct.unpack("l", b)[0] frame.push_operand_long(i) def long_bits_to_double(frame): """...
2.640625
3
materiais/admin.py
lucgbrl/ecossistema-django
0
36027
<filename>materiais/admin.py from django.contrib import admin from .models import Post, Material, Video, Section # Register your models here. admin.site.register(Post) admin.site.register(Section) admin.site.register(Material) admin.site.register(Video)
1.484375
1
utils.py
ericqian1/poker_sim
0
36028
# -*- coding: utf-8 -*- """ Created on Wed Dec 4 13:54:27 2019 @author: eric.qian """ from collections import Counter from itertools import combinations # Numeric hand rankings, higher integer value is stronger hand HAND_RANKINGS = {0: 'High Card', 1: 'One Pair', 2: 'T...
3.625
4
tests/types/test_boolean.py
arthurazs/py61850
3
36029
<gh_stars>1-10 from pytest import fixture, raises from py61850.types import Boolean @fixture def true(): return Boolean(True) # === DECODE === def test_byte_true_min_raw_value(): assert Boolean(b'\x01').raw_value == b'\x01' def test_byte_true_min_value(): assert Boolean(b'\x01').value is True def ...
2.328125
2
demo/cat.py
zbentley/useful-bash
5
36030
<filename>demo/cat.py #!/usr/bin/env python import sys with open(sys.argv[1], 'r') as f: for line in f.readlines(): sys.stdout.write(line)
2.5625
3
orgediting.py
waynezhang/orgextended
0
36031
import sublime import sublime_plugin import datetime import re from pathlib import Path import os import fnmatch import OrgExtended.orgparse.loader as loader import OrgExtended.orgparse.node as node import OrgExtended.orgparse.date as orgdate from OrgExtended.orgparse.sublimenode import * import OrgExtended.orgutil....
1.84375
2
examples/verilator/main.py
splhack/mantle
33
36032
<filename>examples/verilator/main.py from magma import * from magma.verilator.verilator import compile as compileverilator from mantle.verilog.gates import And, XOr def f(a, b, c): return (a & b) ^ c #main = DefineCircuit('main', "a", In(Bit), "b", In(Bit), "c", In(Bit), "d", Out(Bit), 'CLK', In(Bit)) main = Defi...
2.5
2
models/model.py
andersro93/School.ICT441.TextGenerator
0
36033
from nt import DirEntry import os import self as self from keras import Model as KerasModel class Model(object): """ Base class for the different models in this project """ _files: dict = {} """ The files that is used to parse the model """ _raw_content: str = '' """ The files contents ...
3.171875
3
GmailWrapper_JE/venv/Lib/site-packages/requests_oauthlib/compliance_fixes/fitbit.py
JE-Chen/je_old_repo
0
36034
<filename>GmailWrapper_JE/venv/Lib/site-packages/requests_oauthlib/compliance_fixes/fitbit.py """ The Fitbit API breaks from the OAuth2 RFC standard by returning an "errors" object list, rather than a single "error" string. This puts hooks in place so that oauthlib can process an error in the results from access tok...
2.328125
2
merge_intervals.py
KevinLuo41/LeetCodeInPython
19
36035
<gh_stars>10-100 #!/usr/bin/env python # encoding: utf-8 """ merge_intervals.py Created by Shengwei on 2014-07-07. """ # https://oj.leetcode.com/problems/merge-intervals/ # tags: medium, array, interval """ Given a collection of intervals, merge all overlapping intervals. For example, Given [1,3],[2,6],[8,10],[15,1...
3.671875
4
pesto-orm/pesto_orm/dialect/mysql/domain.py
Dreampie/pesto
13
36036
# coding=utf-8 import re import traceback from pesto_common.config.configer import Configer from pesto_common.log.logger_factory import LoggerFactory from pesto_orm.core.base import db_config from pesto_orm.core.executor import ExecutorFactory from pesto_orm.core.model import BaseModel from pesto_orm.core.repository i...
2.109375
2
surround/tests/experiment_reader_test.py
ScottyB/surround
0
36037
import os import re import unittest import shutil import subprocess import logging import zipfile from io import BytesIO from ..experiment.file_storage_driver import FileStorageDriver from ..experiment.experiment_reader import ExperimentReader from ..experiment.experiment_writer import ExperimentWriter class Experim...
2.421875
2
quickmail/commands/clear.py
avikumar15/quick-mail-cli
7
36038
from __future__ import print_function import os from argparse import ArgumentParser, Namespace from zope.interface import implementer from quickmail.commands import ICommand from quickmail.utils.misc import quick_mail_dir, heavy_tick, quick_mail_template_dir @implementer(ICommand) class ClearCommand: def add_arg...
2.5
2
python/int_questions/intersection.py
kellyjovan/algoholics-anon
17
36039
class Node: def __init__(self, value): self.value = value self.next = None # Have no idea how to do this # import sys # sys.path.insert(0, '../../data_structures') # import node def intersection(l1: Node, l2: Node) -> Node: l1_end, len1 = get_tail(l1) l2_end, len2 = get_tail(l2) if l...
3.921875
4
bank_bot/tests/conftest.py
Tengro/larp_bankbot
3
36040
import os import pytest from bank_bot.banking_system import Database class MockMessage(object): def __init__(self, from_who, chat_id, message_text): self.json = {"from": {"id": from_who}, "chat": {"id": chat_id}} self.text = message_text @pytest.fixture def database(): test_file_path = "test_d...
2.390625
2
django/users/migrations/0004_auto_20160408_1032.py
BD2KGenomics/brca-website
5
36041
<filename>django/users/migrations/0004_auto_20160408_1032.py # -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-04-08 10:32 from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('use...
1.59375
2
src/page_object_pattern/test_template.py
paulbodean88/automation-design-patterns
14
36042
<reponame>paulbodean88/automation-design-patterns """ Description: - Test Template class. Methods: - test setup - test teardown - test implementation @author: <NAME> @date: 26/12/2017 """ import unittest from selenium import webdriver class TestTemplate(unittest.TestCase): def setUp(self): ...
2.96875
3
gmacpyutil/gmacpyutil/profiles_test.py
rgayon/macops
758
36043
<gh_stars>100-1000 """Tests for profiles module.""" import mock from google.apputils import basetest import profiles class ProfilesModuleTest(basetest.TestCase): def testGenerateUUID(self): self.assertIsInstance(profiles.GenerateUUID('a'), str) self.assertTrue(profiles.GenerateUUID('a').isupper()) s...
2.40625
2
Hackerearth Set/NaviAndMath.py
Siddharth2016/PYTHON3_prog
2
36044
<gh_stars>1-10 # NAVI AND MATH def power(base, exp): res = 1 while exp>0: if exp&1: res = (res*base)%1000000007 exp = exp>>1 base = (base*base)%1000000007 return res%1000000007 mod = 1000000007 for i in range(int(input().strip())): ans = "Case #" + str(i+1) + ': ' ...
3.015625
3
hw2/stud/models/absa_classifier.py
LeonardoEmili/Aspect-Based-Sentiment-Analysis
6
36045
from typing import * from dataclasses import asdict from transformers import BertModel from torch.nn.utils.rnn import pad_sequence from stud.models.ner_classifier import NERClassifier from stud.models.polarity_classifier import PolarityClassifier from stud.constants import LOGGER_TRAIN_LOSS, LOGGER_VALID_LOSS, LOGGER_T...
2.359375
2
license_plate_images_generator.py
aboerzel/ANPR-keras
6
36046
import argparse import json import os.path import random import re import time import cv2 import numpy as np import requests from PIL import Image from config import config class GermanLicensePlateImagesGenerator: def __init__(self, output): self.output = output self.COUNTRY_MARKS = np.asarray([...
2.5
2
SUIBE_DID_Data_Manager/weidentity/localweid.py
SUIBE-Blockchain/SUIBE_DID_Data_Manager
0
36047
# -*- coding:utf8 -*- import os from eth_account import Account import sha3 import base64 import hashlib from ecdsa import SigningKey, SECP256k1 DID_TYPE = ["weid"] def create_privkey(): return os.urandom(32) def create_ecdsa_privkey(): return SigningKey.generate(curve=SECP256k1) def create_random_weid(): ...
2.734375
3
poco/commands/start.py
gaborkolarovics/poco
52
36048
import os from .abstract_command import AbstractCommand from ..services.state_utils import StateUtils from ..services.state import StateHolder from ..services.command_handler import CommandHandler from ..services.console_logger import ColorPrint class Start(AbstractCommand): command = ["start", "up"] args = ...
2.328125
2
last_stone_weight.py
spencercjh/sync-leetcode-today-problem-python3-example
0
36049
<gh_stars>0 class LastStoneWeight: """ https://leetcode-cn.com/problems/last-stone-weight/ """ def lastStoneWeight(self, stones: List[int]) -> int:
2.25
2
netguardmitm/netguardmitm.py
RTN-Team/netguard-mitm
0
36050
from netfilterqueue import NetfilterQueue import socket from os import system import scapy.all as scapy import scapy_http.http from urllib.parse import urlparse, parse_qs REQUEST_LOGIN = 0 REQUEST_PROTECT = 1 class NetGuardMITM: def __init__(self, ip, queue_number=1): self.ip = ip self.queue_nu...
2.828125
3
wdra_extender/settings.py
Southampton-RSG/wdra-extender
0
36051
"""Config options for WDRAX. Gets settings from environment variables or .env/settings.ini file. """ import pathlib from decouple import AutoConfig BASE_DIR = pathlib.Path(__name__).absolute().parent config = AutoConfig(search_path=str(BASE_DIR)) # pylint: disable=invalid-name LOG_LEVEL = config('LOG_LEVEL', defa...
2.234375
2
tests/contrib/zerorpc/zeropc_tests.py
trancee/apm-agent-python
1
36052
# BSD 3-Clause License # # Copyright (c) 2019, Elasticsearch BV # 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, t...
1.148438
1
pyFAI/gui/calibration/RingCalibration.py
vallsv/pyFAI
0
36053
<filename>pyFAI/gui/calibration/RingCalibration.py # coding: utf-8 # /*########################################################################## # # Copyright (c) 2016 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associa...
1.320313
1
metrics_layer/core/parse/manifest.py
Zenlytic/metrics_layer
5
36054
class Manifest: def __init__(self, definition: dict): self._definition = definition def exists(self): return self._definition is not None and self._definition != {} def _resolve_node(self, name: str): key = next((k for k in self._definition["nodes"].keys() if name == k.split(".")[-...
2.453125
2
desafio/desafio051.py
henriquekirchheck/Curso-em-video-Python
0
36055
<reponame>henriquekirchheck/Curso-em-video-Python print('=====================') print(' 10 Termos de um PA') print('=====================') p = int(input('Primeiro Termo: ')) r = int(input('Razão: ')) for loop in range(p, ((r * 10) + p), r): print('{} ->' .format(loop), end=' ') print('Acabou')
3.625
4
push.py
mikofski/dulwichPorcelain
4
36056
<filename>push.py from dulwich.repo import Repo from dulwich.client import get_transport_and_path import sys def push(remote_url, repo_path='.'): """ Push to a remote repository :param remote_url: <str> url of remote repository :param repo_path: <str> path of local repository :return refs: <dict> ...
2.59375
3
test/test_regularization.py
rentainhe/glasses
271
36057
<filename>test/test_regularization.py import torch from glasses.nn.regularization import DropBlock, StochasticDepth def test_drop_block(): drop = DropBlock() x = torch.ones((1, 3, 28, 28)) x_drop = drop(x) assert not torch.equal(x, x_drop) assert drop.training drop = drop.eval() x_drop =...
2.453125
2
dD_plots_lon_runbin.py
HannahSus/MercuryPolarCratersDepthDiameter
0
36058
<reponame>HannahSus/MercuryPolarCratersDepthDiameter<gh_stars>0 #! /Users/susorhc1/anaconda/bin/python ## ## ## # Program: dD_plots_lon_runbin # Author: <NAME> # Date Created: 2020-03-03 # # Purpose: To compare depth/diameter measurements in overlapping longitude bins # Used in study # # Required Inputs: .csv of dat...
2.109375
2
docassemble/michildsupport/misc.py
jpylephilalegal/docassemble-michildsupport
0
36059
from bs4 import BeautifulSoup as Soup import re import json import sys import shutil import tempfile import os import subprocess from pathlib import Path from docassemble.base.util import log, path_and_mimetype, validation_error, DADict, DAList, Individual, value, force_ask, space_to_underscore __all__ = ['run_automa...
2.421875
2
graphenetools/gt_c_one_third_commensurate_command_plot.py
nscottnichols/graphenetools-py
0
36060
#! /usr/bin/env python3 import sys import argparse from graphenetools import gt def create_parser(): parser = argparse.ArgumentParser(description="Plot graphene lattice and C1/3 phase corresponding to printed command line arguments for uniaxially strained graphene (for use with QMC software located at https://code...
2.71875
3
profiles/admin.py
cotebarrientos/4th-milestone-project-your-argentine-shop
0
36061
<filename>profiles/admin.py<gh_stars>0 from django.contrib import admin from .models import UserProfile class ProfileAdmin(admin.ModelAdmin): """Display the user profiles created in the Admin panel.""" list_display = ( 'user', 'default_full_name', 'default_email', 'default_coun...
2.046875
2
django_flex_user/models/user.py
ebenh/django-flex-user
1
36062
from django.db import models from django.db.models.signals import pre_save, post_save from django.dispatch import receiver from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager from django.contrib.auth.models import PermissionsMixin from django.utils import timezone from django.utils.translation i...
2.109375
2
wiki_search/dataset/__init__.py
WikiMegrez/wikisearch
0
36063
from .dataset import Dataset, Document
1.054688
1
MedTAG_Dockerized/MedTAG_sket_dock_App/utils_upload_files.py
MedTAG/medtag-core
6
36064
import psycopg2 import re import json from MedTAG_sket_dock_App.models import * import os import pandas as pd import numpy from psycopg2.extensions import register_adapter, AsIs def addapt_numpy_float64(numpy_float64): return AsIs(numpy_float64) def addapt_numpy_int64(numpy_int64): return AsIs(numpy_int64) regi...
2.5625
3
main.py
yang-233/mmsa
1
36065
import sys sys.path.append("/home/ly/workspace/mmsa") seed = 1938 import numpy as np import torch from torch import nn from torch import optim np.random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed(seed) torch.cuda.manual_seed_all(seed) from models.bigru_rcnn_gate import * from utils.train import * from t...
2
2
back-end/www/model/timeception/core/const.py
yenchiah/deep-smoke-machine
88
36066
#!/usr/bin/env python # -*- coding: UTF-8 -*- ######################################################################## # GNU General Public License v3.0 # GNU GPLv3 # Copyright (c) 2019, <NAME> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Licen...
1.921875
2
Exercicios/ex012.py
KaioPlandel/Estudos-Python-3
0
36067
#mostre quando a pessoa vai pagar com o desconto de 5% preco = float(input('Digite o Preço do Produto R$: ')) desconto = preco * 0.05 print(f'O preço do Produto é de R${preco:.2f} com o Desconto de R${desconto:.2f} \nO Total vai ficar R$:{preco - desconto:.2f}')
3.625
4
shahryar_webscrapping_nlp2_WebCrawling.py
ShahryarZaidi/Web-Crawler-and-NLP-
0
36068
<gh_stars>0 #!/usr/bin/env python # coding: utf-8 # In[65]: from sklearn.feature_extraction.text import CountVectorizer,TfidfVectorizer from sklearn.naive_bayes import BernoulliNB, MultinomialNB from sklearn import metrics from sklearn.metrics import roc_auc_score, accuracy_score import requests from bs4 import Beau...
2.65625
3
src/model_generation/modeling.py
klingj3/subreddit_suggestor
8
36069
import json import numpy as np import os import tensorflow as tf from keras.models import Sequential from keras.layers import Dense, Dropout, Embedding, Flatten, Activation, BatchNormalization from sklearn.model_selection import train_test_split class SuggestionModeler(object): """ A collection of functions ...
2.65625
3
Curso_em_video/Mundo_1/exercicios/ex012.py
TCGamer123/python
1
36070
<filename>Curso_em_video/Mundo_1/exercicios/ex012.py preço = float(input('Digite o preço do produto: R$')) d = preço * 0.05 vD = preço - d print('Valor original R${:.2f}, desconto de 5% é igual à R${:.2f}, seu novo preço é R${:.2f}'.format(preço, d, vD))
3.359375
3
service/licensing.py
profesormig/quimica3a
0
36071
<filename>service/licensing.py """ Logic related to License, PatternMatch, etc. for atmosphere. """ from django.core.validators import URLValidator from django.core.exceptions import ValidationError from core.models.license import License, LicenseType from core.models.match import PatternMatch, MatchType from core...
2.296875
2
articles/imp/genfigs/tuning.py
parrt/stratx
54
36072
<gh_stars>10-100 import support support.tune_all(pairs_to_tune=support.pairs, verbose=1)
1.132813
1
reliefparser/models/pointer_net.py
XuezheMax/ReLiefParser
6
36073
import numpy as np import tensorflow as tf from encoder import Encoder from decoder import Decoder, TreeDecoder import bisect from time import time class PointerNet(object): def __init__(self, vsize, esize, hsize, asize, buckets, **kwargs): super(PointerNet, self).__init__() self.name = kwargs....
2.28125
2
perceiver_io/flow_perceiver.py
JOBR0/PerceiverIO_Pytorch
2
36074
<reponame>JOBR0/PerceiverIO_Pytorch import itertools from typing import Sequence import torch.nn as nn import torch from perceiver_io.io_processors.preprocessors import ImagePreprocessor from perceiver_io.io_processors.processor_utils import patches_for_flow from perceiver_io.output_queries import FlowQuery from perc...
2.109375
2
third_party/commons_fileupload.bzl
wix-playground/rules_maven_third_party
0
36075
load(":import_external.bzl", import_external = "import_external") def dependencies(): import_external( name = "commons_fileupload_commons_fileupload", artifact = "commons-fileupload:commons-fileupload:1.4", artifact_sha256 = "a4ec02336f49253ea50405698b79232b8c5cbf02cb60df3a674d77a749a1def7"...
1.492188
1
old/old/model_tests.py
avigad/boole
16
36076
################################################## # # Tests for model.py # # # # # # # # # # # ################################################## from boole.core.model import * from boole.core.language import clear_default_language from nose.tools import * def is_prime(x): if x == 0 or x == 1: return Fa...
2.890625
3
sniffer.py
meecash/rf4ce-tools
0
36077
<reponame>meecash/rf4ce-tools<gh_stars>0 #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Sniffs RF4CE packets. Supports encryption. """ from __future__ import (absolute_import, print_function, unicode_literals) from builtins import * import argparse from datetime import datetime import bina...
2.15625
2
plugins/plot/__init__.py
DeStream-dev/electrum-destream
26
36078
<reponame>DeStream-dev/electrum-destream # from electrum_stratis.i18n import _ # fullname = 'Plot History' # description = _("Ability to plot transaction history in graphical mode.") # requires = [('matplotlib', 'matplotlib')] # available_for = ['qt']
1.0625
1
setup.py
mrsantos321/customhead
3
36079
#!/usr/bin/env python3 """ Host the setup function. """ import pathlib import setuptools from cushead import info def setup() -> None: """ Execute the setup. """ assets_path = pathlib.Path(info.PACKAGE_NAME) / "console" / "assets" / "images" templates_path = pathlib.Path(info.PACKAGE_NAME) / "ge...
2.171875
2
firmware/camera.py
iasapomeavoc1/bike-computer
0
36080
<reponame>iasapomeavoc1/bike-computer<gh_stars>0 #!~/bike-computer/.venv/bin python import picamera import datetime path = '/home/pi/bike-computer/data/' with picamera.PiCamera(resolution=(1640,1232),framerate=30) as camera: try: while True: #start_time = datetime.datetime.now().timestamp() for filename...
2.8125
3
tests/test_chars_duplicates.py
xv44586/pdfplumber
0
36081
<gh_stars>0 #!/usr/bin/env python import unittest import pytest import sys, os import logging import pdfplumber from pdfplumber import table from pdfplumber.utils import Decimal logging.disable(logging.ERROR) HERE = os.path.abspath(os.path.dirname(__file__)) class Test(unittest.TestCase): @classmethod de...
2.4375
2
project_1_1/src/model.py
jonassoebro/Deep-Learning-in-Computer-Vision
0
36082
<gh_stars>0 import torchvision.models as models from torch.nn import Module, Sequential, Linear class Model(Module): def __init__(self, pretrained: bool = False, in_dim: int = 2048, out_dim: int = 256): super(Model, self).__init__() self.resnet = Sequential(*list(models.resnet50(pretrained=pretra...
3.03125
3
load_data.py
UrbanInstitute/nccs-public
7
36083
import os, sys import re import zipfile import requests import warnings import logging import pandas as pd import numpy as np from stat import S_IREAD, S_IRGRP, S_IROTH import getpass import pymysql # Code by <NAME> (<EMAIL>), 2016-2017 class LoadData(): """ This class is inherited by the Data class, and cont...
2.59375
3
functions/finalize-lambda/finalize.py
aws-samples/aws-elemental-mediaconvert-visual-narrations
4
36084
<filename>functions/finalize-lambda/finalize.py import boto3 import os import json from botocore.exceptions import ClientError try: POLLY_METADATA_STORE = os.environ['POLLY_METADATA_STORE'] except KeyError as e: print(f"Missing env variable: {e}") exit(1) dynamo = boto3.resource("dynamodb") polly_metadata...
2.171875
2
src/Phidget22/Encoding.py
MikaSoftware/mikathing
1
36085
<reponame>MikaSoftware/mikathing<filename>src/Phidget22/Encoding.py<gh_stars>1-10 import sys import ctypes class Encoding: # Unknown - the default value IR_ENCODING_UNKNOWN = 1 # Space encoding, or Pulse Distance Modulation IR_ENCODING_SPACE = 2 # Pulse encoding, or Pulse Width Modulation IR_ENCODING_PULSE = 3 #...
2.171875
2
PedSimulation/gui/panel.py
HDL951236874/PedSimulation
1
36086
<gh_stars>1-10 from PedSimulation.scene import * from PedSimulation.gui.ui.mainwindow_main import Ui_MainWindow_Main from PedSimulation.gui.ui.mainwindow_setting import Ui_MainWindow_Setting, Dragebutton from PedSimulation.gui.drawer.drawer_register import SceneDrawerRegister from PyQt5 import QtCore from PyQt5.QtWidge...
2.0625
2
emLam/corpus/component.py
DavidNemeskey/emLam
2
36087
<gh_stars>1-10 #!/usr/bin/env python3 """An instantiable component. See the docstring for the class.""" from __future__ import absolute_import, division, print_function from future.utils import with_metaclass import logging import inspect class NamedClass(type): """ A read-only name property for classes. See...
2.734375
3
kws/bin/export_onnx.py
ishine/wenet-kws
81
36088
# Copyright (c) 2021 <NAME>(<EMAIL>) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
2.125
2
omtk/core/className.py
renaudll/omtk
20
36089
from maya import cmds import copy # TODO: Find a way to have different naming for different production. # Maybe handle it in the rig directly? class BaseName(object): """ This class handle the naming of object. Store a name as a list of 'tokens' When resolved, the tokens are joinned using a 'separator...
2.5625
3
qcp/algorithms/abstract_algorithm.py
RiddhiYadav/https-github.com-Tiernan8r-quantum_computing_project
0
36090
# Copyright 2022 Tiernan8r # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
3.15625
3
code/tests/core/test_train_utils.py
ashesh-0/MultiZoomGaze
1
36091
import math import numpy as np import torch from mock import patch from core.train_utils import compute_angular_error, compute_angular_error_xyz_arr, spherical2cartesial def test_spherical2cartesial(): spherical = torch.Tensor([ [0, 0], [math.pi / 2, 0], [-math.pi / 2, 0], [0, ma...
2.25
2
scripts/serializers.py
sul-cidr/scriptchart-backend
1
36092
from rest_framework import serializers from scripts.models import Manuscript from scripts.models import Page from scripts.models import Coordinates class ManuscriptSerializer(serializers.ModelSerializer): class Meta: model = Manuscript fields = ('id', 'slug', 'shelfmark', 'date', 'manifest') cla...
2.34375
2
test/generators/utils.py
yanqd0/LeetCode
0
36093
import csv import re from os import makedirs from os.path import abspath, basename, dirname, isdir, join def generate_csv(path, fields, rows, quote_empty=False): path = abspath(path) name = basename(path) name = re.sub('py$', 'csv', name) cases = join(dirname(dirname(path)), 'cases') if not isdir(...
3.203125
3
fig/backends/aws/__init__.py
LaudateCorpus1/falcon-integration-gateway
10
36094
from datetime import datetime import traceback import boto3 from botocore.exceptions import ClientError from ...config import config from ...log import log class Submitter(): def __init__(self, event): self.event = event def find_instance(self, instance_id, mac_address): # pylint: disable=R0201 ...
2.1875
2
src/plugin.py
saitho/galaxy_blizzard_plugin
0
36095
<reponame>saitho/galaxy_blizzard_plugin import asyncio import json import os import sys import multiprocessing import webbrowser import requests import requests.cookies import logging as log import subprocess import time from galaxy.api.consts import LocalGameState, Platform from galaxy.api.plugin import Plugin, crea...
1.835938
2
buyer/tests/test_serializers.py
uktrade/directory-api
2
36096
import pytest from buyer import serializers @pytest.mark.django_db def test_buyer_deserialization(): data = { 'email': '<EMAIL>', 'name': '<NAME>', 'sector': 'AEROSPACE', 'company_name': 'Example corp', 'country': 'China', } serializer = serializers.BuyerSerialize...
2.5
2
moai/utils/arguments/__init__.py
tzole1155/moai
0
36097
from moai.utils.arguments.common import ( assert_numeric, assert_non_negative, assert_negative, ) from moai.utils.arguments.choices import ( assert_choices, ensure_choices, ) from moai.utils.arguments.list import ( ensure_numeric_list, ensure_string_list, assert_sequence_size, ) from moa...
1.5625
2
tools/harness/tests/aos_tests.py
Frankie8472/advanced-operating-systems
5
36098
<gh_stars>1-10 ########################################################################## # Copyright (c) 2009, ETH Zurich. # All rights reserved. # # This file is distributed under the terms in the attached LICENSE file. # If you do not find this file, copies can be found by writing to: # ETH Zurich D-INFK, Universita...
2.109375
2
examples/one_d_test.py
jamesvuc/autograd-mcmc
0
36099
#1d_tests.py import autograd.numpy as np import autograd.scipy.stats.norm as norm from copy import copy import datetime as dt from matplotlib import pyplot as plt import seaborn as sns import sys; sys.path.append('..') from mcmc import langevin, MALA, RK_langevin, RWMH, HMC def bimodal_logprob(z): return (np.log(n...
2.015625
2