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
pythia/antlr4/PythiaFunctionCallListener.py
5sigmapoint2/pythiaparser
0
12798851
<filename>pythia/antlr4/PythiaFunctionCallListener.py # Generated from /Users/enrique/workspace/other/frontline/pythia/PythiaFunctionCall.g4 by ANTLR 4.5.3 from antlr4 import * if __name__ is not None and "." in __name__: from .PythiaFunctionCallParser import PythiaFunctionCallParser else: from PythiaFunctionC...
2.203125
2
src/ci/model/agent.py
dreicefield/ci-runner
1
12798852
#!/usr/bin/env python3 import logging import subprocess from typing import Dict class Agent: name: str image: str environment: Dict[str, str] def __init__(self, name: str, image: str, environment: Dict[str, str]) -> None: self.name = name self.image = image self.environment =...
2.46875
2
eit/elliptic_solver.py
Forgotten/EIT
1
12798853
class EllipticSolver: def __init__(self, v_h): self.v_h = v_h def update_matrices(self, sigma_vec): vol_idx = v_h.mesh.vol_idx bdy_idx = v_h.mesh.bdy_idx self.S = stiffness_matrix(self.v_h, sigma_vec) def build_matrices self.Mass = mass_matrix(self.v_h) ...
2.421875
2
tests/tests/urls_converters/tests.py
ChanTsune/Django-Boost
25
12798854
<reponame>ChanTsune/Django-Boost<gh_stars>10-100 import os from django.test import override_settings from django.urls import reverse from django_boost.test import TestCase ROOT_PATH = os.path.dirname(__file__) @override_settings( ROOT_URLCONF='tests.tests.urls_converters.urls', TEMPLATES=[{ 'BACKEN...
2.328125
2
tests/unit/TestValidation.py
rakhimov/rtk
0
12798855
<reponame>rakhimov/rtk #!/usr/bin/env python -O """ This is the test class for testing Validation module algorithms and models. """ # -*- coding: utf-8 -*- # # tests.unit.TestValidation.py is part of The RTK Project # # All rights reserved. # Copyright 2007 - 2017 <NAME> <EMAIL>rew.rowland <AT> reliaqual <DOT> c...
1.773438
2
chapter4-function/exercise7.py
MyLanPangzi/py4e
0
12798856
<reponame>MyLanPangzi/py4e # Exercise 7: Rewrite the grade program from the previous chapter using a function called computegrade # that takes a score as its parameter and returns a grade as a string. def computegrade(score): if score < 0 or score > 1: return "score out of range" elif score >= 0.9: ...
3.9375
4
All_Source_Code/ClassificationOverview/ClassificationOverview_5.py
APMonitor/pds
11
12798857
<filename>All_Source_Code/ClassificationOverview/ClassificationOverview_5.py from sklearn import datasets, svm, metrics from sklearn.model_selection import train_test_split import matplotlib.pyplot as plt import numpy as np # The digits dataset digits = datasets.load_digits() # Flatten the image to apply classifier n...
2.734375
3
src/service.library.video/resources/lib/artwork.py
sebastian-steinmann/kodi-repo
0
12798858
# -*- coding: utf-8 -*- ################################################################################################# import logging import urllib import requests from resources.lib.util import JSONRPC ################################################################################################## log = log...
2.28125
2
python_scripts/binary2Array.py
ingle/ultrasound-simulation
15
12798859
<gh_stars>10-100 def makeMultiFrameSimFile(fname, numFrames): '''Read in multiple files with the name fname + number + .dat. Save all those frames to a single file with one header. ''' import numpy as np import struct newFile = open(fname + 'allFrames.dat', 'wb') #Read in the first file and use this one to writ...
3.1875
3
linux-distro/package/nuxleus/Source/Vendor/Microsoft/IronPython-2.0.1/Lib/Kamaelia/Support/Particles/ParticleSystem.py
mdavid/nuxleus
1
12798860
#!/usr/bin/env python # Copyright (C) 2004 British Broadcasting Corporation and Kamaelia Contributors(1) # All Rights Reserved. # # You may only modify and redistribute this under the terms of any of the # following licenses(2): Mozilla Public License, V1.1, GNU General # Public License, V2.0, GNU Lesser Ge...
2.6875
3
libpysal/cg/shapes.py
Kanahiro/dbf-df-translator
0
12798861
<reponame>Kanahiro/dbf-df-translator """ Computational geometry code for PySAL: Python Spatial Analysis Library. """ __author__ = "<NAME>, <NAME>, <NAME>, <NAME>, <NAME>" import math from .sphere import arcdist from typing import Union __all__ = [ "Point", "LineSegment", "Line", "Ray", "Chain",...
2.625
3
pronebo_dj/main/migrations/0004_faq.py
vlsh1n/pronebo
0
12798862
<filename>pronebo_dj/main/migrations/0004_faq.py # Generated by Django 3.2.4 on 2021-06-07 14:51 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0003_item_price'), ] operations = [ migrations.CreateModel( name='Faq',...
1.78125
2
pollicino/core/views.py
inmagik/pollicino
2
12798863
from rest_framework import parsers, renderers from rest_framework.authtoken.models import Token from rest_framework.authtoken.serializers import AuthTokenSerializer from rest_framework.response import Response from rest_framework.views import APIView from .serializers import ClientTokenSerializer from .models import C...
1.976563
2
3 - Lists/dbl_linkedlist.py
codyveladev/ds-alg-practice
0
12798864
class Node: def __init__(self, value): self.value = value self.next = None self.prev = None class DoublyLinkedList: def __init__(self, value): new_node = Node(value) self.head = new_node self.tail = new_node self.length = 1 def append(self, value)...
3.890625
4
website/drawquest/apps/twitter/tests.py
bopopescu/drawquest-web
61
12798865
<gh_stars>10-100 from drawquest.tests.tests_helpers import (CanvasTestCase, create_content, create_user, create_group, create_comment, create_staff, create_quest, create_quest_comment) from services import Services, override_service class TestSimpleThing(CanvasTestCase): ...
1.921875
2
generator/itertool_groupby.py
sherlockliu/pythonic
0
12798866
# !/usr/bin/python from itertools import groupby def compress(data): return ((len(list(group)), name) for name, group in groupby(data)) def decompress(data): return (car * size for size, car in data) my_data = 'get uuuuuuuuuuuuuuuup' print(list(my_data)) compressed = compress(my_data) print(''.join(deco...
3.90625
4
tests/unit/lms/views/basic_lti_launch_test.py
robertknight/lms
0
12798867
<reponame>robertknight/lms from unittest import mock import pytest from lms.resources import LTILaunchResource from lms.resources._js_config import JSConfig from lms.views.basic_lti_launch import BasicLTILaunchViews from tests import factories def canvas_file_basic_lti_launch_caller(context, pyramid_request): "...
2.21875
2
uploader/custom_auth/middleware.py
stfc/cvmfs-stratum-uploader
0
12798868
<reponame>stfc/cvmfs-stratum-uploader from django.core.urlresolvers import reverse from django.http import HttpResponsePermanentRedirect class NoLoginAdminRedirectMiddleware: """ This middleware forbids to access admin page for unauthorized but authenticated users. """ def process_request(self, reques...
2.1875
2
Source Separation/Archive/spleeter_test.py
elliottwaissbluth/tensor-hero
1
12798869
<gh_stars>1-10 from spleeter.separator import Separator # Use audio loader explicitly for loading audio waveform : from spleeter.audio.adapter import AudioAdapter from scipy.io.wavfile import write from pydub import AudioSegment separator = Separator('spleeter:2stems') #separator.separate_to_file('/path/to/audio', ...
2.796875
3
tests/test_grids.py
knaidoo29/magpie
0
12798870
import numpy as np import magpie # check cartesian def test_get_xedges(): xedges = magpie.grids.get_xedges(1., 2) xedges = np.round(xedges, decimals=2) assert len(xedges) == 3, "Length of xedges is incorrect." assert xedges[-1] - xedges[0] == 1., "xedges range is incorrect." xedges = magpie.grids...
2.59375
3
testing/chat/chatclient.py
FinleyDavies/super-pygame-bomberman
0
12798871
from communication import * import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((socket.gethostname(), 1123)) while True: m = receive_message(s) if m: print(m, "\n") ping(s) print(s.getsockname()) print(socket.gethostbyname(socket.gethostname())) print(socket.get)
3.015625
3
test/simple_log/quick_start.py
lesteve/tensorwatch
3,453
12798872
<reponame>lesteve/tensorwatch<gh_stars>1000+ import tensorwatch as tw import time w = tw.Watcher(filename='test.log') s = w.create_stream(name='my_metric') #w.make_notebook() for i in range(1000): s.write((i, i*i)) time.sleep(1)
2.03125
2
insights/parsers/dmsetup.py
mglantz/insights-core
1
12798873
""" dmsetup commands - Command ``dmsetup`` ====================================== Parsers for parsing and extracting data from output of commands related to ``dmsetup``. Parsers contained in this module are: DmsetupInfo - command ``dmsetup info -C`` ----------------------------------------- """ from insights import...
1.78125
2
code.py
theyoungkwon/mastering_scikit
0
12798874
import sys, os, random import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import Normalize from matplotlib.colors import ListedColormap from sklearn.model_selection import train_test_split, GridSearchCV from sklearn.model_selection import StratifiedShuffleSplit from sklearn.preprocessing i...
2.21875
2
maxixe/tests/__init__.py
tswicegood/maxixe
1
12798875
import unittest import maxixe from maxixe.tests import decorators from maxixe.tests import loader from maxixe.tests import parser from maxixe.tests import utils suite = unittest.TestSuite() suite.addTests(unittest.TestLoader().loadTestsFromModule(decorators)) suite.addTests(unittest.TestLoader().loadTestsFromModule(l...
1.6875
2
app.py
swapno-ahmed/CoursePicker
3
12798876
<reponame>swapno-ahmed/CoursePicker import pandas as pd import tkinter.messagebox from utils import get_unlocked_course, reset_completed from tkinter import * from tkinter import filedialog df = pd.read_csv('course.csv') df = df.fillna('') df.set_index('Course', inplace=True) completed_course = None filepath = None ...
3.296875
3
_celery/djusecelery/app/blog/models.py
yc19890920/ap
1
12798877
from django.db import models class Blog(models.Model): title = models.CharField("标题", unique=True, max_length=200) class Meta: db_table = 'blog' verbose_name = '文章'
2.21875
2
wormer/graber.py
tyrantqiao/PythonGraber
0
12798878
from wormer.tools import manager, downloader from wormer.data import strategy import re class Graber: synopsis_pattern = '''(?=lemma-summary")(.*?)(?<=config) ''' text_pattern = '>\s*?([^\&\b\n\[\]]*?)<' href_pattern = '<a target=_blank href="(/item/[\w\d%]*?)">' def __init__(self): self.urlM...
2.515625
3
30 Days of Code/Day 2 - Operators/solution.py
matheuscordeiro/HackerRank
0
12798879
#!/usr/local/bin/python3 """Task Given the meal price (base cost of a meal), tip percent (the percentage of the meal price being added as tip), and tax percent (the percentage of the meal price being added as tax) for a meal, find and print the meal's total cost. Note: Be sure to use precise values for your calcul...
4.03125
4
argus/unit_tests/backends/tempest/test_tempest_backend.py
mateimicu/cloudbase-init-ci
6
12798880
<reponame>mateimicu/cloudbase-init-ci # Copyright 2016 Cloudbase Solutions Srl # 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.or...
1.789063
2
scripts/click.py
liujordan/TestYourTech
0
12798881
class Click(ActionBase): def _execute(self): try: element = WebDriverWait(browser1, 10).until( EC.presence_of_element_located((By.XPATH, selector1)) ) element.click() return True except: print("timedout", function, selector1, value1)...
2.609375
3
keras_frcnn/simple_parser.py
Heyjuke58/frcnn-wind-turbine-detection
0
12798882
<filename>keras_frcnn/simple_parser.py import cv2 import os def get_data(input_path: str, test_only: bool = False): found_bg = False all_imgs = {} classes_count = {} class_mapping = {} with open(input_path, 'r') as f: print('Parsing annotation files') for line in f: filename, x1, y1, x2, ...
2.875
3
athumb/__init__.py
tahy/django-athumb
10
12798883
<reponame>tahy/django-athumb VERSION = '2.4.1'
0.941406
1
example/test.py
flaviolsousa/ping-pong-ia
0
12798884
<reponame>flaviolsousa/ping-pong-ia import pygame from pygame.locals import * def main(): pygame.init() screen = pygame.display.set_mode( (200, 200), HWSURFACE | DOUBLEBUF | RESIZABLE) fake_screen = screen.copy() pic = pygame.surface.Surface((50, 50)) pic.fill((255, 100, 200)) while True: for e...
3.109375
3
Exercicios - Mundo1/Ex014.py
BrianMath/ExerciciosPythonCeV
0
12798885
# Ex. 014 c = float(input("Digite uma temperatura em °C: ")) print(f"{c}°C = {((9*c)/5)+32:.1f}°F")
3.96875
4
apps/node/urls.py
dongdawang/ssrmgmt
0
12798886
<reponame>dongdawang/ssrmgmt from django.urls import path from .views import NodeShow, NodeDetail, SelectNode urlpatterns = [ path('node/', NodeShow.as_view(), name='node-show'), path('node/detail/<int:n_id>', NodeDetail.as_view(), name='node-detail'), path('node/select/', SelectNode.as_view(), name='node...
1.960938
2
Kubera/Controllers/dividend_summary.py
santhoshraje/kubera
5
12798887
from telegram.ext import ConversationHandler from telegram.ext import MessageHandler from telegram.ext import Filters from telegram.ext import CallbackQueryHandler from Model.share import Share import Controllers.global_states as states from Utils.logging import get_logger as log import pandas as pd import datetime G...
2.46875
2
scripts/KMerFreq.py
chrisquince/BayesPaths
3
12798888
import gzip import sys import argparse import re import logging import numpy as np import pandas as p from itertools import product, tee from collections import Counter, OrderedDict from Bio import SeqIO def generate_feature_mapping(kmer_len): BASE_COMPLEMENT = {"A":"T","T":"A","G":"C","C":"G"} kmer_hash = ...
2.28125
2
hw4/hw3_farmer.py
farmerjm/PHYS38600
0
12798889
# -*- coding: utf-8 -*- ''' <NAME> 1. a. Frequentist confidence intervals do not respect the physical limitations imposed on a system, ie non-negativity of a mass. b. Typically, that the probability to be found outside the interval on both sides of the distribution is 16% (or (100-CL)/2 %). Of...
3.15625
3
Lib/rcjktools/buildVarC.py
BlackFoundryCom/rcjk-tools
1
12798890
from fontTools.misc.fixedTools import floatToFixed from fontTools.ttLib import TTFont, newTable, registerCustomTableClass from fontTools.varLib.models import VariationModel, allEqual from fontTools.varLib.varStore import OnlineVarStoreBuilder from rcjktools.varco import VarCoFont from rcjktools.table_VarC import ( ...
1.804688
2
unifi/objects/device.py
BastiG/unifi-py
0
12798891
from unifi.objects.base import UnifiBaseObject from unifi.helper import find_by_attr, json_print class UnifiDeviceObject(UnifiBaseObject): def get_port_profile(self, **filter_kwargs): port = find_by_attr(self.port_table, **filter_kwargs) port_override = find_by_attr(self.port_overrides, port_idx=...
2.40625
2
2008/round-1b/mousetrap/script.py
iamFIREcracker/google-code-jam
0
12798892
from collections import deque for case in xrange(input()): cards = input() indexes = map(int, raw_input().split()) deck = [0 for i in xrange(cards)] index = -1 for i in xrange(1, cards + 1): while True: index = (index + 1)%cards if deck[index] == 0: break for j in xrange(i - 1): ...
3.140625
3
lifx_rest.py
rsilveira79/Utils-python
0
12798893
<reponame>rsilveira79/Utils-python<filename>lifx_rest.py import requests from time import sleep token = "<KEY>" # ID da minha lampada: # "id": "d0<PASSWORD>502164d", # "uuid": "021063bb-1cae-416b-bbff-3dbe5cc22a35", headers = { "Authorization": "Bearer %s" % token, } state_off ={ "power": "off", "color...
2.796875
3
dmlab2d/dmlab2d_test.py
Robert-Held/lab2d
377
12798894
# Copyright 2019 The DMLab2D Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
1.976563
2
molpy/data/__init__.py
yonghui-cc/molpy
0
12798895
<reponame>yonghui-cc/molpy<filename>molpy/data/__init__.py<gh_stars>0 from .reader import look_and_say, get_molecule from .read_xyz_files import open_xyz
1.429688
1
clavier/sh.py
nrser/clavier
0
12798896
<gh_stars>0 from typing import * import os from os.path import isabs, basename import subprocess from pathlib import Path import json from shutil import rmtree import shlex from functools import wraps import splatlog as logging from .cfg import CFG from .io import OUT, ERR, fmt, fmt_cmd TOpts = Mapping[Any, Any] TOpt...
2.171875
2
cmdb-compliance/biz/ds/ds_uncom_vpc_peering.py
zjj1002/aws-cloud-cmdb-system
0
12798897
<reponame>zjj1002/aws-cloud-cmdb-system<gh_stars>0 from libs.db_context import DBContext from models.uncom_vpc_peering import UncomVpcPeering from models.vpc_peering import VpcPeering, model_to_dict from models.owner_list import OwnerList from models.owner_list import model_to_dict as owner_model_to_list # 获取不合规的vpc ...
2.296875
2
2021/day02.py
iKevinY/advent
11
12798898
<reponame>iKevinY/advent import fileinput pos = 0 aim = 0 part_1_depth = 0 part_2_depth = 0 for line in fileinput.input(): ins, num = line.split() num = int(num) if ins == 'forward': pos += num part_2_depth += (aim * num) elif ins == 'down': part_1_depth += num aim += ...
3.671875
4
PythonClients/service_add_command_raw.py
naporium/Cisco_Web_Services-master
0
12798899
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from json import dumps, loads # for python 2 # from httplib import HTTPConnection # for python 3 from http.client import HTTPConnection # connect with REST server connection = HTTPConnection('127.0.0.1', 80) connection.connect() data = {"ip": "192...
2.8125
3
cryptography/generate_hash_512.py
dgengtek/scripts
0
12798900
<reponame>dgengtek/scripts #!/usr/bin/env python3 # generate password mac for dovecot import sys import os import getopt from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes import base64 import binascii def usage(): h="usage:\t"+sys.argv[0] h+=" [-s salt]...
2.421875
2
docs/fa/docs_src/set_commands/set_commands.py
AliRn76/rubika-bot
1
12798901
<gh_stars>1-10 import requests data = { "bot_commands": [ { "command": "command1", "description": "description1" }, { "command": "command2", "description": "description2" }, ] } url = f'https://messengerg2b1.iranlms.ir/v3/{token}/s...
2.4375
2
services/dts/src/oci_cli_dts/nfs_dataset_client_proxy.py
honzajavorek/oci-cli
0
12798902
# coding: utf-8 # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. """ NOTE: This class should always comply to the API definition of NfsDatasetClient present in services/dts/src/oci_cli_dts/physical_appliance_control_plane/client/nfs_dataset_client.py """ from oci_cli import cli_util fr...
1.882813
2
source/ui/ui_message.py
alexander-l-stone/RogueSpace
0
12798903
<gh_stars>0 class UIMessage: def __init__(self, parent, x, y, message, color): self.x = parent.x + x self.y = parent.y + y self.message = message self.color = color self.visible = True self.priority = 2 def draw(self, root_console, tick_count) -> None: ...
2.53125
3
worker_template.py
rampeer/Spreaduler
15
12798904
from spreaduler import ParamsSheet from train_attention import train from options import get_parser class YourParamsSheet(ParamsSheet): """ Your model Params Sheet class """ params_sheet_id = '...' client_credentials = { "type": "service_account", "project_id": "....", "pr...
2.25
2
friday_5pm_helper/replicon_services/__init__.py
kyhau/friday-5pm-helper
3
12798905
<reponame>kyhau/friday-5pm-helper # Define constants # HEADERS = {'content-type': 'application/json'} SWIMLANE_FINDER_URL = 'https://global.replicon.com/DiscoveryService1.svc/GetTenantEndpointDetails'
0.957031
1
test.py
proto-n/listdiff-py
0
12798906
<filename>test.py import listdiff import numpy as np import pandas as pd reclist = pd.DataFrame({ 'pid': [1,1,1,2,2,2,3,3,3], 'song_id': [4,5,6,4,5,6,4,5,12], 'pos': [1,2,3,1,2,3,3,2,1] }) gt = pd.DataFrame({ 'pid': [1,1,1,2,2,2,2], 'song_id': [1,5,9,4,5,12,9], 'pos': [1,2,3,4,3,2,1] }) complement = pd.DataF...
2.59375
3
c3bottles/views/api.py
lfuelling/c3bottles
0
12798907
<gh_stars>0 import json from datetime import datetime from flask import request, Response, Blueprint, jsonify from flask_login import current_user from c3bottles import app, db from c3bottles.model.drop_point import DropPoint from c3bottles.model.report import Report from c3bottles.model.visit import Visit bp = Blu...
1.976563
2
solutions/codeforces/617A.py
forxhunter/ComputingIntro
1
12798908
''' greedy algorithm An elephant decided to visit his friend. It turned out that the elephant's house is located at point 0 and his friend's house is located at point x(x > 0) of the coordinate line. In one step the elephant can move 1, 2, 3, 4 or 5 positions forward. Determine, what is the minimum number of steps he n...
4.09375
4
third-party/corenlp/third-party/stanza/stanza/text/dataset.py
arunchaganty/odd-nails
5
12798909
<gh_stars>1-10 """ Dataset module for managing text datasets. """ __author__ = 'victor' from collections import OrderedDict import random import numpy as np class InvalidFieldsException(Exception): pass class Dataset(object): """ Generic Dataset object that encapsulates a list of instances. The dat...
3.4375
3
SETTINGS.py
nsxsnx/py-tgbot-twitter-timeline
1
12798910
# Twitter AUTH: APP_KEY = 'APP_KEY_HERE' APP_SECRET = 'APP_SECRET_HERE' OAUTH_TOKEN = 'TOKEN_HERE' OAUTH_TOKEN_SECRET = 'TOKEN_SECRET_HERE' # Telegram options: TELEGRAM_CHANNEL = 'CHANNEL_NAME_HERE' TELEGRAM_TOKEN = 'TOKEN_HERE' # Misc: TWITTER_USER_NAME = 'USER_NAME_HERE' MSG = '<b>{NAME}</b>:\n{TEXT}\n\n<a href="...
2.03125
2
ada_aug/train.py
jamestszhim/adaptive_augment
3
12798911
import os import sys import time import torch import utils import logging import argparse import torch.nn as nn import torch.utils from adaptive_augmentor import AdaAug from networks import get_model from networks.projection import Projection from dataset import get_num_class, get_dataloaders, get_label_name, get_data...
1.976563
2
Hana.py
dungpoke/dungpoke
0
12798912
### Hi there 👋 <!-- **dungpoke/dungpoke** is a ✨ _special_ ✨ repository because its `README.md` (this file) appears on your GitHub profile. Here are some ideas to get you started: - 🔭 I’m currently working on ... - 🌱 I’m currently learning ... - 👯 I’m looking to collaborate on ... - 🤔 I’m looking for help with ...
1.1875
1
test.py
dongxzhang/TensorflowCookbookLearning
1
12798913
import tensorflow as tf sess = tf.Session() #在名字为foo的命名空间内创建名字为v的变量 with tf.variable_scope("foo"): #创建一个常量为1的v v= tf.get_variable('v1',[1],initializer = tf.constant_initializer(1.0)) #因为在foo空间已经创建v的变量,所以下面的代码会报错 #with tf.variable_scope("foo"): # v= tf.get_variable('v',[1]) #在生成上下文管理器时,将参数reuse设置为True。这样tf.g...
3.234375
3
test/utils/test_utils_audio.py
FabianGroeger96/deep-embedded-music
10
12798914
<reponame>FabianGroeger96/deep-embedded-music import tensorflow as tf from src.utils.utils_audio import AudioUtils class TestUtilsAudio(tf.test.TestCase): def setUp(self): self.audio_file_path = "/tf/test_environment/audio/DevNode1_ex1_1.wav" def test_audio_loading_mono(self): expected_shap...
2.703125
3
setup.py
philipwfowler/jitter
1
12798915
<gh_stars>1-10 from setuptools import setup setup( install_requires=[ "numpy >= 1.13" ], name='jitter', scripts=['bin/jitter.py'], version='0.1.0', url='https://github.com/philipwfowler/jitter', author='<NAME>', packages=['jitter'], license='MIT', long_description=open('...
1.109375
1
day06/day6_lib.py
el-hult/adventofcode2019
0
12798916
from collections import namedtuple from typing import Dict, List, Callable Node = namedtuple('Node', 'name parent children data') def make_tree_from_adj_list(adj_list): root = 'COM' nodes: Dict['str', Node] = {root: Node(root, None, [], {})} for parent, child in adj_list: node = Node(child, pare...
3.6875
4
Courses/Semester01/DSADAssignment/DSADAssignment01_UnitTest.py
KalpeshChavan12/BITS-DSE
0
12798917
<gh_stars>0 import unittest import random import DSADAssignment01V4 def add_childs_to_leaf(root, num): if root is None: return if(len(root.children) == 0 ): for i in range(num): root.append_child(DSADAssignment01V4.TreeNode("child{0}".format(TestStringMethods.count))) ...
3.140625
3
MillerArrays/millerArray2Dictionary.py
MooersLab/jupyterlabcctbxsnips
0
12798918
from iotbx import mtz mtz_obj = mtz.object(file_name="3nd4.mtz") # Only works with mtz.object. # Does not work if mtz is read in with iotbx.file_reader. miller_arrays_dict = mtz_obj.as_miller_arrays_dict()
1.789063
2
pytorch_toolkit/nncf/nncf/quantization/layers.py
aalborov/openvino_training_extensions
1
12798919
""" Copyright (c) 2019 Intel Corporation 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 writin...
1.726563
2
answers/VanshBaijal/Day3/Question2.py
arc03/30-DaysOfCode-March-2021
22
12798920
n=int(input("Enter the number:")) s={} a=0 c=0 while(n!=0): r=n%10 n=int(n/10) s[a]=r for i in range (a): if(r==s[i]): c+=1 break a+=1 if (c==0): print("It is a unique number") else: print("It is not a unique number")
3.546875
4
gradio_infer.py
test-dan-run/SpeakerProfiling
0
12798921
<filename>gradio_infer.py import gradio as gr import numpy as np import librosa import torch from NISP.lightning_model import LightningModel from config import TestNISPConfig as cfg INFERENCE_COUNT = 0 # load model checkpoint model = LightningModel.load_from_checkpoint(cfg.model_checkpoint, csv_path=cfg.csv_path) mo...
2.09375
2
raspberry_car_PCA/motor.py
otaniemen-lukio/projects
1
12798922
import curses, sys, os #Servo controller connected to IC2 import Adafruit_PCA9685 pwm = Adafruit_PCA9685.PCA9685() pwm.set_pwm_freq(60) from time import sleep #ESC Brushles motor states: direction, on/off toggleState = 400 throttle = 450 delta = 20 print("toggleState1") pwm.set_pwm(2,0,toggleState) sleep(0.2) for i...
2.765625
3
tests/inputs/if-branching/outputs/15-builtin-functions-join-store.py
helq/pytropos
4
12798923
import pytropos.internals.values as pv from pytropos.internals.values.builtin_values import * from pytropos.internals.values.python_values.builtin_mutvalues import * from pytropos.internals.values.python_values.wrappers import * from pytropos.internals.values.python_values.python_values import PythonValue, PT exitcode...
2.140625
2
setup.py
guoli-lyu/document-scanner
2
12798924
import re import setuptools def find_version(fname): """Attempts to find the version number in the file names fname. Raises RuntimeError if not found. """ version = '' with open(fname, 'r') as fp: reg = re.compile(r'__version__ = [\'"]([^\'"]*)[\'"]') for line in fp: m ...
2.09375
2
paraVerComoFuncionaAlgumasCoisas/01-coisas-E-Estudos/0diritories0to9/09keyboard.py
jonasht/pythonEstudos
0
12798925
<reponame>jonasht/pythonEstudos import keyboard print('\napertando A ') qtd_apertos = 0 while True: if keyboard.is_pressed('a'): qtd_apertos += 1 print('A foi apertado ', qtd_apertos) if keyboard.is_pressed('s'): print('\nfim de programa') break
3.75
4
eor_updater.py
segfaultx/ffxiv_eor_member_updater
1
12798926
#!/usr/bin/python3 import os.path import openpyxl import requests import json import argparse BASE_URL_XIV_API_CHARACTER: str = "https://xivapi.com/character/" GERMAN_TO_ENGLISH_CLASS_DICT: dict = {} SUB_30_MAPPING_DICT: dict = {} CONFIG_LOCATION = os.getcwd() DEBUG_ENABLED = False def main(filepath): """main ...
3.234375
3
quickbuild/endpoints/configurations.py
pbelskiy/quickbuild
7
12798927
import datetime from functools import partial from typing import List, Optional, Union from quickbuild.helpers import ContentType, response2py class Configurations: def __init__(self, quickbuild): self.quickbuild = quickbuild def _get(self, params: dict) -> List[dict]: return self.quickbui...
2.34375
2
leetcode/easy/Arrays and Strings/TwoSum.py
cheshtaaagarrwal/DS-Algos
0
12798928
# Given an array of integers, return indices of the two numbers such that they add up to a specific target. # You may assume that each input would have exactly one solution, and you may not use the same element twice. # Example: # Given nums = [2, 7, 11, 15], target = 9, # Because nums[0] + nums[1] = 2 + 7 = 9, # r...
3.734375
4
simple_vatic/server/web_app.py
happyharrycn/vatic_fpv
6
12798929
<gh_stars>1-10 """A simple web server for video annotation""" # parsing args import argparse # encoding / decoding import json # time / logging import time #import logging #import traceback # flask import flask from flask_cors import CORS, cross_origin import tornado.wsgi import tornado.httpserver # database impor...
2.5625
3
test/test_normalizer.py
simonpf/qrnn
0
12798930
<gh_stars>0 import numpy as np from quantnn.normalizer import Normalizer, MinMaxNormalizer def test_normalizer_2d(): """ Checks that all feature indices that are not excluded have zero mean and unit std. dev. """ x = np.random.normal(size=(100000, 10)) + np.arange(10).reshape(1, -1) normalizer ...
2.578125
3
src/cool_chip/utils/io.py
leoank/cool_chip
0
12798931
from os import path from pathlib import Path def curr_file_path() -> Path: """Get cuurent file path.""" return Path(__file__).absolute() def out_folder_path() -> Path: """Get output folder path.""" return curr_file_path().parents[3].joinpath("out").absolute() def out_geom_path() -> Path: """Ge...
2.453125
2
oppertions/09.py
mallimuondu/python-practice
0
12798932
i = 1 while i < 6: print(i) if (i == 3): break i += 1
3.546875
4
pyarubaoss/anycli.py
HPENetworking/pyarubaoss
8
12798933
#!/usr/bin/env python # -*- coding: utf-8 -*- import requests, json, base64 def post_cli(auth, command): url_cli = "http://" + auth.ipaddr + "/rest/" + auth.version + "/cli" command_dict = {"cmd": command} try: post_command = requests.post(url_cli, headers=auth.cookie, data=json.dumps(command_dict...
2.65625
3
src/Archive_info_generate_charts.py
adeckert23/soccer-proj
0
12798934
#Saved information for generating plots: #------------------------------------------------------------------------------- # #Figure # fig.clear() # fig = plt.figure(figsize=(10, 10)) #Name to appear on each axis for offensive categories # titles = ['Rating', 'Goals', 'Assists', 'SpG', 'Drb', 'KeyP','PS%', # 'Cr...
2.28125
2
fixture/group.py
Budanovvv/pythin_trainig
1
12798935
from model.group import Group class GroupHelper: def __init__(self, app): self.app = app def create(self, group): wd = self.app.wd self.go_to_group_page() wd.find_element_by_name("new").click() self.fill_form_group(group) # Submit group creation wd.fin...
2.578125
3
examples/idioms/programs/024.0664-assign-to-string-the-japanese-word-.py
laowantong/paroxython
31
12798936
"""Assign to string the japanese word ネコ. Declare a new string _s and initialize it with the literal value "ネコ" (which means "cat" in japanese) Source: programming-idioms.org """ # Implementation author: cym13 # Created on 2015-11-30T12:37:27.133314Z # Last modified on 2015-11-30T12:37:27.133314Z # Version 1 s = "ネ...
2.78125
3
workflow/urls.py
ChalkLab/SciFlow
1
12798937
<reponame>ChalkLab/SciFlow<filename>workflow/urls.py """ urls for the workflow app """ from django.urls import path from workflow import views urlpatterns = [ path('logs', views.logs, name='logs'), path('logs/<lid>', views.viewlog, name='viewlog'), ]
1.851563
2
005/5.py
dkaisers/Project-Euler
0
12798938
import math def sieve(n): primes = list(range(2, n+1)) i = 0 while i < len(primes): no = primes[i] m = 2 while (no * m) <= max(primes): if primes.count(no * m) > 0: primes.remove(no * m) m+=1 i+=1 return primes def maxPower(n, ...
3.90625
4
saleor/graphql/payment/resolvers.py
valcome-analytics/saleor
0
12798939
import stripe from ...payment.gateways.stripe.plugin import StripeGatewayPlugin from ...plugins import manager from ... import settings from ...payment import gateway as payment_gateway, models from ...payment.utils import fetch_customer_id from ..utils.filters import filter_by_query_param PAYMENT_SEARCH_FIELDS = ["i...
1.851563
2
sorting.py
joaovitorle/AnotacoesCoursera2
0
12798940
print('='*15,'#1','='*15) #Sort function - Vai organizar do menos para o maior valor em lista L1 = [1, 7, 4, -2, 3] L2 = ["Cherry", "Apple", "Blueberry"] L1.sort() print(L1) L2.sort() print(L2) print('='*15,'#2','='*15) #Sorted L2= ["Cherry", "Apple", "Blueberry"] L3= sorted(L2) print(L3) print(sorted(L2)) print(L2...
4.28125
4
scripts/vista_pallet.py
agrc/vista
0
12798941
<reponame>agrc/vista #!/usr/bin/env python # * coding: utf8 * ''' vista_pallet.py A module that contains a forklift pallet definition for the vista project. ''' from forklift.models import Pallet from os.path import join class VistaPallet(Pallet): def __init__(self): super(VistaPallet, self).__init__() ...
1.953125
2
python_exercises/22TrocaDeCartas.py
Matheus-IT/lang-python-related
0
12798942
from os import system def ler_qtd(n, msg): n = int(input(msg)) while (n < 1) or (n > 10000): n = int(input(f' - Entrada invalida!{msg}')) return n def preencher_set_cartas(cartas, qtd, p): """ set de cartas, qtd de cartas, p de pessoa """ from time import sleep print()...
3.390625
3
wpcv/utils/data_aug/det_aug/pil_aug.py
Peiiii/wpcv
0
12798943
import numpy as np import random import numbers import cv2 from PIL import Image import wpcv from wpcv.utils.ops import pil_ops, polygon_ops from wpcv.utils.data_aug.base import Compose, Zip from wpcv.utils.data_aug import img_aug class ToPILImage(object): def __init__(self): self.to = img_aug.ToPILImage(...
2.40625
2
kvtest.py
termistotel/kvTest
0
12798944
<gh_stars>0 import kivy kivy.require('1.10.0') # replace with your current kivy version ! from kivy.app import App from kivy.uix.label import Label from kivy.uix.boxlayout import BoxLayout from kivy.uix.button import Button from kivy.uix.textinput import TextInput from kivy.uix.behaviors.codenavigation impor...
2.484375
2
netapp/santricity/models/symbol/ib_ioc_profile.py
NetApp/santricity-webapi-pythonsdk
5
12798945
# coding: utf-8 """ IbIocProfile.py The Clear BSD License Copyright (c) – 2016, NetApp, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met: *...
1.382813
1
yandex_tracker_client/uriutils.py
TurboKach/yandex_tracker_client
17
12798946
<filename>yandex_tracker_client/uriutils.py<gh_stars>10-100 # coding: utf-8 import re VARIABLE = re.compile(r'{([\w\d\-_\.]+)}') class Matcher(object): def __init__(self): self._patterns = [] def add(self, uri, resource, priority=0): parts = uri.strip('/').split('/') pattern_parts...
2.703125
3
pokepay/response/bulk_transaction.py
pokepay/pokepay-partner-python-sdk
0
12798947
# DO NOT EDIT: File is generated by code generator. from pokepay_partner_python_sdk.pokepay.response.response import PokepayResponse class BulkTransaction(PokepayResponse): def __init__(self, response, response_body): super().__init__(response, response_body) self.id = response_body['id'] ...
2.171875
2
python/main.py
M507/CellTower
3
12798948
from flask import Flask, request import sys, requests, json from multiprocessing import Process app = Flask(__name__) @app.after_request def add_headers(response): response.headers.add('Access-Control-Allow-Origin', '*') response.headers.add('Access-Control-Allow-Headers', 'Content-Type,Authorization') ret...
2.515625
3
setup.py
jackz314/PyEEGLAB
1
12798949
<filename>setup.py import setuptools import os with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() version = None with open(os.path.join('eeglabio', '_version.py'), 'r') as fid: for line in (line.strip() for line in fid): if line.startswith('__version__'): ver...
1.632813
2
scripts/steepestDescentDemo.py
nappaillav/pyprobml
0
12798950
<reponame>nappaillav/pyprobml<filename>scripts/steepestDescentDemo.py # Author: <NAME> import numpy as np import matplotlib.pyplot as plt from scipy.optimize import minimize, line_search def aokiFn(x): """ F(x,y) = 0.5 x (x^2 - y)^2 + 0.5 x (x-1)^2 """ f = 0.5 * np.square(np.square(x[:][...
2.90625
3