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
lite/tests/unittest_py/pass/test_conv_elementwise_fuser_pass.py
714627034/Paddle-Lite
808
16600
<filename>lite/tests/unittest_py/pass/test_conv_elementwise_fuser_pass.py # Copyright (c) 2021 PaddlePaddle Authors. 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 # # ...
1.851563
2
cfn_policy_validator/tests/validation_tests/test_resource_validator.py
awslabs/aws-cloudformation-iam-policy-validator
41
16601
""" Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: MIT-0 """ import boto3 import copy import unittest from botocore.stub import ANY from cfn_policy_validator.tests import account_config, offline_only, only_run_for_end_to_end from cfn_policy_validator.tests.boto_mocks impor...
1.765625
2
HDF4_H5_NETCDF/source2.7/h5py/tests/hl/test_datatype.py
Con-Mi/lambda-packs
31
16602
""" Tests for the h5py.Datatype class. """ from __future__ import absolute_import from itertools import count import numpy as np import h5py from ..common import ut, TestCase class TestVlen(TestCase): """ Check that storage of vlen strings is carried out correctly. """ def assertVlenArrayEq...
2.484375
2
conmon/regex.py
flashdagger/conmon
0
16603
<filename>conmon/regex.py #!/usr/bin/env python # -*- coding: UTF-8 -*- import re from typing import Pattern, Tuple, Iterator, Match, Union, Optional, List, Dict from conmon.conan import storage_path DECOLORIZE_REGEX = re.compile(r"[\u001b]\[\d{1,2}m", re.UNICODE) CONAN_DATA_PATH = re.compile( r"""(?x) (...
2.875
3
src/north/cli/gscli/main.py
falcacicd/goldstone-mgmt
0
16604
<reponame>falcacicd/goldstone-mgmt #!/usr/bin/env python import sysrepo as sr import argparse from prompt_toolkit import PromptSession from prompt_toolkit.key_binding import KeyBindings from prompt_toolkit.completion import Completer import sys import os import logging import asyncio from .base import Object, Inva...
2.109375
2
InsertionSort/selectionSort/selectionsort/selectionSort.py
khaledshishani32/data-structures-and-algorithms-python
0
16605
def selection_sort(my_list): for i in range(len(my_list)): min_index=i for j in range(i+1 , len(my_list)): if my_list[min_index]>my_list[j]: min_index= j my_list[i],my_list[min_index]= my_list[min_index] ,my_list[i] print(my_list) cus_list=[8,4,23,42,16,...
3.84375
4
tests/creditcrawler_test.py
Mivinci/cqupt-piper
3
16606
import requests from bs4 import BeautifulSoup from prettytable import PrettyTable # html = requests.get( # 'http://jwzx.cqu.pt/student/xkxfTj.php', # cookies={'PHPSESSID': 'o2r2fpddrj892dp1ntqddcp2hv'}).text # soup = BeautifulSoup(html, 'html.parser') # for tr in soup.find('table', {'id': 'AxfTjTable'}).find...
2.96875
3
ClassMethod.py
AdarshKvT/python-oop
0
16607
class Person: number_of_people = 0 def __init__(self, name): print("__init__ initiated") self.name = name print("calling add_person()") Person.add_person() @classmethod def num_of_people(cls): print("initiating num_of_person()") return cls.number_of_peo...
3.828125
4
webpack_manifest/templatetags/webpack_manifest_tags.py
temoto/python-webpack-manifest
55
16608
<gh_stars>10-100 from django import template from django.conf import settings from webpack_manifest import webpack_manifest if not hasattr(settings, 'WEBPACK_MANIFEST'): raise webpack_manifest.WebpackManifestConfigError('`WEBPACK_MANIFEST` has not been defined in settings') if 'manifests' not in settings.WEBPACK_...
2.21875
2
utilities/jaccard_utilities.py
jjc2718/netreg
0
16609
import os import itertools as it import pandas as pd def compute_jaccard(v1, v2): v1, v2 = set(v1), set(v2) intersection = v1.intersection(v2) union = v1.union(v2) return ((len(intersection) / len(union) if len(union) != 0 else 0), len(intersection), len(union)) def get_inter_m...
2.375
2
CursoEmVideo/pythonProject/venv/Lib/site-packages/Interface/tests/unitfixtures.py
cassio645/Aprendendo-python
0
16610
<filename>CursoEmVideo/pythonProject/venv/Lib/site-packages/Interface/tests/unitfixtures.py ############################################################################## # # Copyright (c) 2001, 2002 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Pub...
2.140625
2
noise_robust_cobras/noise_robust/datastructures/cycle.py
jonassoenen/noise_robust_cobras
2
16611
<gh_stars>1-10 from collections import defaultdict from noise_robust_cobras.noise_robust.datastructures.constraint import Constraint from noise_robust_cobras.noise_robust.datastructures.constraint_index import ( ConstraintIndex, ) class Cycle: """ A class that represents a valid constraint cycle ...
2.734375
3
python3/hackerrank_leetcode/remove_duplicates_from_sorted_array/test.py
seLain/codesnippets
0
16612
<gh_stars>0 import unittest from main import Solution class TestSolutionMethods(unittest.TestCase): solution = Solution() def test_longestCommonPrefix(self): # leetcode test self.assertEqual(self.solution.removeDuplicates([1,1,2]), 2) # customized test self.assertEqual(self.so...
3.3125
3
7KYU/word_splitter.py
yaznasivasai/python_codewars
4
16613
<filename>7KYU/word_splitter.py SEPARATOR: list = [':', ',', '*', ';', '#', '|', '+', '%', '>', '?', '&', '=', '!'] def word_splitter(string: str) -> list: for i in string: if i in SEPARATOR: string = string.replace(i, ' ') return string.split()
3.671875
4
parsers/sales_order.py
njncalub/logistiko
0
16614
import csv from core.exceptions import InvalidFileException def load_so_item_from_file(path, db_service): with open(path) as csv_file: csv_reader = csv.reader(csv_file) error_msg = 'Missing required header: {}' for i, row in enumerate(csv_reader, 1): data = { ...
3.359375
3
maps.py
BouncyButton/places-simulator
0
16615
<reponame>BouncyButton/places-simulator import googlemaps import secret from datetime import datetime import requests import pickle import time gmaps = googlemaps.Client(key=secret.PLACES_API_KEY) # lat = 45.411400 # lon = 11.887491 coordinates = [ (45.411400, 11.887491), # torre archimede (45.409218, 11.877...
2.96875
3
azure-iot-device/tests/iothub/test_sync_handler_manager.py
dt-boringtao/azure-iot-sdk-python
0
16616
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import log...
1.65625
2
src/python/Chameleon.Faas/demo/helloworld_grpc_client.py
sevenTiny/Seventiny.Cloud.ScriptEngine
2
16617
<filename>src/python/Chameleon.Faas/demo/helloworld_grpc_client.py import grpc import helloworld_pb2 import helloworld_pb2_grpc from grpc.beta import implementations def run(): # 连接 rpc 服务器 # TSL连接方式 >>> with open('G:\\DotNet\\SevenTiny.Cloud.FaaS\\Code\\Python\\SevenTiny.Cloud.FaaS.GRpc\\ca\\client.pem', ...
2.53125
3
tools/pca_outcore.py
escorciav/deep-action-proposals
28
16618
<filename>tools/pca_outcore.py #!/usr/bin/env python """ PCA done via matrix multiplication out-of-core. """ import argparse import time import h5py import hickle as hkl import numpy as np def input_parse(): description = 'Compute PCA with A.T * A computation out of core' p = argparse.ArgumentParser(descri...
2.453125
2
azdev/params.py
marstr/azure-cli-dev-tools
0
16619
<filename>azdev/params.py # ----------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------...
1.96875
2
gamry_parser/cv.py
bcliang/gamry-parser
6
16620
import gamry_parser as parser class CyclicVoltammetry(parser.GamryParser): """Load a Cyclic Voltammetry experiment generated in Gamry EXPLAIN format.""" def get_v_range(self): """retrieve the programmed voltage scan ranges Args: None Returns: tuple, containin...
2.90625
3
comps.py
matthewb66/bdconsole
0
16621
import json import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_components as html import pandas as pd import dash_table def get_comps_data(bd, projverurl): print('Getting components ...') # path = projverurl + "/components?limit=5000" # # custom_headers = {'Acc...
2.515625
3
CursoemVideoPython/Desafio 35.py
Beebruna/Python
0
16622
''' Desenvolva um programa que leia o comprimento de três retas e diga ao usuário se elas podem ou não formar um triângulo. ''' reta1 = float(input('Digite o comprimento da primeira reta: ')) reta2 = float(input('Digite o comprimento da segunda reta: ')) reta3 = float(input('Digite o comprimento da terceira reta: ')) ...
4.34375
4
osprofiler/tests/unit/drivers/test_ceilometer.py
charliebr30/osprofiler
0
16623
# Copyright 2016 Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
1.976563
2
threshold.py
jiep/unicode-similarity
1
16624
from pathlib import Path import numpy as np import pickle import argparse import errno import sys def file_exists(path): return Path(path).is_file() def dir_exists(path): return Path(path).is_dir() def remove_extension(x): return x.split('.')[0] def print_error(type, file): print(FileNotFoundError(e...
3.046875
3
y2019/control_loops/python/wrist.py
Ewpratten/frc_971_mirror
0
16625
#!/usr/bin/python from aos.util.trapezoid_profile import TrapezoidProfile from frc971.control_loops.python import control_loop from frc971.control_loops.python import angular_system from frc971.control_loops.python import controls import copy import numpy import sys from matplotlib import pylab import gflags import gl...
2.5
2
utils/tools.py
alipay/Pyraformer
7
16626
<filename>utils/tools.py from torch.nn.modules import loss import torch import numpy as np def MAE(pred, true): return np.mean(np.abs(pred-true)) def MSE(pred, true): return np.mean((pred-true)**2) def RMSE(pred, true): return np.sqrt(MSE(pred, true)) def MAPE(pred, true): return np.mean(np.abs((pr...
2.3125
2
.venv/lib/python3.8/site-packages/pandas/tests/indexes/timedeltas/test_shift.py
acrucetta/Chicago_COVI_WebApp
115
16627
import pytest from pandas.errors import NullFrequencyError import pandas as pd from pandas import TimedeltaIndex import pandas._testing as tm class TestTimedeltaIndexShift: # ------------------------------------------------------------- # TimedeltaIndex.shift is used by __add__/__sub__ def test_tdi_sh...
2.578125
3
webScraping/Instagram/2a_selenium_corriere.py
PythonBiellaGroup/MaterialeSerate
12
16628
<filename>webScraping/Instagram/2a_selenium_corriere.py # use selenium to scrape headlines from corriere.it # pip install selenium from re import L from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support imp...
3.3125
3
stolos/tests/test_bin.py
sailthru/stolos
121
16629
import os from subprocess import check_output, CalledProcessError from nose import tools as nt from stolos import queue_backend as qb from stolos.testing_tools import ( with_setup, validate_zero_queued_task, validate_one_queued_task, validate_n_queued_task ) def run(cmd, tasks_json_tmpfile, **kwargs): cm...
1.984375
2
senlin/tests/unit/engine/actions/test_create.py
chenyb4/senlin
0
16630
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed unde...
1.648438
2
tests/test_api.py
bh-chaker/wetterdienst
155
16631
# -*- coding: utf-8 -*- # Copyright (c) 2018-2021, earthobservations developers. # Distributed under the MIT License. See LICENSE for more info. import pytest from wetterdienst import Wetterdienst @pytest.mark.remote @pytest.mark.parametrize( "provider,kind,kwargs", [ # German Weather Service (DWD) ...
2.515625
3
examples/sentence_embedding/task_sentence_embedding_sbert_unsupervised_TSDAE.py
Tongjilibo/bert4torch
49
16632
#! -*- coding:utf-8 -*- # 语义相似度任务-无监督:训练集为网上pretrain数据, dev集为sts-b from bert4torch.tokenizers import Tokenizer from bert4torch.models import build_transformer_model, BaseModel from bert4torch.snippets import sequence_padding, Callback, ListDataset import torch.nn as nn import torch import torch.optim as optim from to...
2.0625
2
crowd_anki/export/anki_exporter_wrapper.py
katrinleinweber/CrowdAnki
391
16633
from pathlib import Path from .anki_exporter import AnkiJsonExporter from ..anki.adapters.anki_deck import AnkiDeck from ..config.config_settings import ConfigSettings from ..utils import constants from ..utils.notifier import AnkiModalNotifier, Notifier from ..utils.disambiguate_uuids import disambiguate_note_model_u...
1.929688
2
shadow/apis/item.py
f1uzz/shadow
1
16634
from functools import lru_cache from typing import Optional import requests from .patches import Patches class Item: """ Manipulation of static item data """ ITEM_URL = f"http://ddragon.leagueoflegends.com/cdn/{Patches.get_current_patch()}/data/en_US/item.json" items = requests.get(ITEM_URL).js...
3.03125
3
tests/test_lmdb_eager.py
rjpower/tensorflow-io
0
16635
<reponame>rjpower/tensorflow-io<gh_stars>0 # Copyright 2019 The TensorFlow Authors. 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/license...
1.632813
2
recbole/quick_start/quick_start.py
RuihongQiu/DuoRec
16
16636
# @Time : 2020/10/6 # @Author : <NAME> # @Email : <EMAIL> """ recbole.quick_start ######################## """ import logging from logging import getLogger from recbole.config import Config from recbole.data import create_dataset, data_preparation from recbole.utils import init_logger, get_model, get_trainer, init...
2.4375
2
inferlo/generic/inference/bucket_renormalization.py
InferLO/inferlo
1
16637
<gh_stars>1-10 # Copyright (c) The InferLO authors. All rights reserved. # Licensed under the Apache License, Version 2.0 - see LICENSE. import warnings import numpy as np from sklearn.utils.extmath import randomized_svd from .bucket_elimination import BucketElimination from .factor import Factor, default_fac...
2.234375
2
oldcode/guestbook111013.py
mdreid/dinkylink
1
16638
import os import urllib from google.appengine.api import users from google.appengine.ext import ndb import jinja2 import webapp2 from sys import argv import datetime import pickle import sys sys.path.insert(0, 'libs') import BeautifulSoup from bs4 import BeautifulSoup import requests import json JINJA_ENVIRONM...
2.65625
3
is_core/tests/crawler.py
zzuzzy/django-is-core
0
16639
import json from django.utils.encoding import force_text from germanium.tools import assert_true, assert_not_equal from germanium.test_cases.client import ClientTestCase from germanium.decorators import login from germanium.crawler import Crawler, LinkExtractor, HtmlLinkExtractor as OriginalHtmlLinkExtractor def fl...
2.171875
2
example/geometry/admin.py
emelianovss-yandex-praktikum/07_pyplus_django_2
0
16640
<reponame>emelianovss-yandex-praktikum/07_pyplus_django_2 from django.contrib import admin from geometry.models import Shape @admin.register(Shape) class AdminShape(admin.ModelAdmin): ...
1.390625
1
demo2/demo2_consume2.py
YuYanzy/kafka-python-demo
3
16641
<gh_stars>1-10 # -*- coding: utf-8 -*- # @Author : Ecohnoch(xcy) # @File : demo2_consume.py # @Function : TODO import kafka demo2_config = { 'kafka_host': 'localhost:9092', 'kafka_topic': 'demo2', 'kafka_group_id': 'demo2_group1' } def consume(): consumer = kafka.KafkaConsumer(demo2_config['kaf...
2.46875
2
autoscalingsim/scaling/scaling_model/scaling_model.py
Remit/autoscaling-simulator
6
16642
<reponame>Remit/autoscaling-simulator<gh_stars>1-10 import json import pandas as pd from .application_scaling_model import ApplicationScalingModel from .platform_scaling_model import PlatformScalingModel from autoscalingsim.deltarepr.group_of_services_delta import GroupOfServicesDelta from autoscalingsim.deltarepr.no...
2.140625
2
src/zojax/filefield/copy.py
Zojax/zojax.filefield
0
16643
############################################################################## # # Copyright (c) 2009 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
2.0625
2
verbose.py
lowrey/myjsonstore
1
16644
import sys verbose = False def set_v(v): global verbose verbose = v def print_v(s): if verbose: print(s) def write_v(s): if verbose: sys.stdout.write(s)
2.640625
3
app/component_b/command/services.py
mirevsky/django-grpc-cqrs-kafka-template
2
16645
<reponame>mirevsky/django-grpc-cqrs-kafka-template<filename>app/component_b/command/services.py import grpc from google.protobuf import empty_pb2 from django_grpc_framework.services import Service from component_b.common.serializers import PersonProtoSerializer from component_b.common.models import PersonModel class...
1.9375
2
Lab 5/course_reader.py
kq4hy/CS3240-Lab-Files
0
16646
__author__ = 'kq4hy' import csv import sqlite3 def load_course_database(db_name, csv_filename): conn = sqlite3.connect(db_name) with conn: curs = conn.cursor() with open(csv_filename, 'rU') as csvfile: reader = csv.reader(csvfile) for row in reader: sql...
3.625
4
marshmallow_helpers/__init__.py
hilearn/marsh-enum
0
16647
<reponame>hilearn/marsh-enum from .enum_field import EnumField, RegisteredEnum # noqa from .marsh_schema import attr_with_schema, derive # noqa
1.453125
1
Weather Station using DHT Sensor with Raspberry Pi and ThingSpeak Platform/Weather Station - ThingSpeak - Raspberry Pi.py
MeqdadDev/ai-robotics-cv-iot-mini-projects
0
16648
''' IoT Mini Project Weather Station using DHT Sensor and Raspberry Pi with ThingSpeak Platform Code Sample: Interfacing DHT22 with Raspberry Pi and sending the data to an IoT Platform (ThingSpeak Platform) ''' from time import sleep # import Adafruit_DHT # Not supported library import adafruit_dht from board import *...
3.578125
4
Demo2_PageObjectModel/features/steps/PageObject_Registration.py
imademethink/imademethink_python_selenium_demo
2
16649
#!/usr/bin/python # -*- coding: utf-8 -*- import time from page_objects import PageObject, PageElement from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions from selenium.webdriver.common.by import By delay_mi...
2.71875
3
Tests/TestData/HOSimulation/HOTrialWavefunction/config.py
McCoyGroup/RynLib
1
16650
config = dict( module="HOTrialWavefunction.py" )
1.15625
1
python/ucloud/import_data.py
oldthreefeng/miscellany
1
16651
#!/usr/bin/python2 import sys import os import redis import time import datetime string_keys = [] hash_keys = [] list_keys = [] set_keys = [] zset_keys = [] def import_string(source, dest): print "Begin Import String Type" keys_count = len(string_keys) print "String Key Count is:", keys_count pipeSrc...
2.421875
2
kinlin/core/strategy.py
the-lay/kinlin
0
16652
import torch import torch.nn as nn import numpy as np from enum import Enum from typing import List, Callable, Any from tqdm import tqdm from .model import Model from .dataset import Dataset from .experiment import Experiment from .callback import Callback class TrainingEvents(Enum): START = 'on_start' FINIS...
2.234375
2
tests/test_utils.py
jamesmcclain/pystac
1
16653
import unittest from pystac.utils import (make_relative_href, make_absolute_href, is_absolute_href) class UtilsTest(unittest.TestCase): def test_make_relative_href(self): # Test cases of (source_href, start_href, expected) test_cases = [ ('/a/b/c/d/catalog.js...
2.859375
3
services/web/manage.py
EMBEDDIA/ULR_NER_REST
0
16654
<filename>services/web/manage.py # Copyright (c) 2020 <NAME> # Copyright (c) 2020 <NAME> # Permission is hereby granted, free of charge, to any person obtaining a copy of this # software and associated documentation files (the "Software"), to deal in the Software # without restriction, including without limitation the ...
1.21875
1
GUI/PopUps/ExportPopUp.py
iagerogiannis/Image_to_plot
0
16655
from PyQt5.QtWidgets import QDialog, QPushButton, QVBoxLayout, QComboBox, QGroupBox, QCheckBox, QGridLayout, QMessageBox, QRadioButton from GUI.CustomWidgets.PathFileLineEdit import PathFileLineEdit from GUI.CustomWidgets.InputField import InputField class ExportPopUp(QDialog): def __init__(self, parent): ...
2.328125
2
cwltool/update.py
PlatformedTasks/PLAS-cwl-tes
0
16656
<gh_stars>0 from __future__ import absolute_import import copy import re from typing import (Any, Callable, Dict, List, MutableMapping, MutableSequence, Optional, Tuple, Union) from functools import partial from ruamel.yaml.comments import CommentedMap, CommentedSeq from schema_salad import valid...
1.945313
2
plottify/plottify.py
neutrinoceros/plottify
0
16657
import matplotlib.pyplot as plt from matplotlib import collections from matplotlib.lines import Line2D def autosize(fig=None, figsize=None): ## Take current figure if no figure provided if fig is None: fig = plt.gcf() if figsize is None: ## Get size of figure figsize = fig.get_s...
3.125
3
ocular_algorithm/0x04_BasicRecurrenceAndRecursion.py
DistinctWind/ManimProjects
2
16658
from re import S from manimlib import * import sys import os from tqdm.std import tqdm sys.path.append(os.getcwd()) from utils.imports import * class Opening(Scene): def construct(self): title = Text("基础递推递归", font='msyh') self.play(Write(title), run_time=2) self.wait() self.pla...
2.3125
2
utility.py
Ming-desu/POKEMING
0
16659
<gh_stars>0 # POKEMING - GON'NA CATCH 'EM ALL # -- A simple hack 'n slash game in console # -- This class is handles all utility related things class Utility: # This allows to see important message of the game def pause(message): print(message) input('Press any key to continue.')
2.625
3
gpv2/data/lessons/mil.py
michalsr/gpv2
0
16660
<reponame>michalsr/gpv2<gh_stars>0 import logging import sys from typing import Union, Optional, Dict, Any, List from dataclasses import dataclass, replace from exp.ours import file_paths from exp.ours.boosting import MaskSpec from exp.ours.data.dataset import Dataset, Task from exp.ours.data.gpv_example import GPVEx...
2.4375
2
creel_portal/api/filters/FN024_Filter.py
AdamCottrill/CreelPortal
0
16661
<reponame>AdamCottrill/CreelPortal import django_filters from ...models import FN024 from .filter_utils import NumberInFilter, ValueInFilter class FN024SubFilter(django_filters.FilterSet): """A fitlerset that allows us to select subsets of net set objects by net set attributes.""" prd = ValueInFilter(fi...
2.21875
2
modules/utils.py
PaulLerner/deep_parkinson_handwriting
2
16662
import numpy as np from time import time import matplotlib.pyplot as plt measure2index={"y-coordinate":0,"x-coordinate":1,"timestamp":2, "button_status":3,"tilt":4, "elevation":5,"pressure":6} index2measure=list(measure2index.keys()) task2index={"spiral":0,"l":1,"le":2 ,"les":3,"lektorka" :4,"porovnat":5,"nepopadnout...
2.65625
3
Mundo2/Desafio039.py
Marcoakira/Desafios_Python_do_Curso_Guanabara
0
16663
import datetime datenasc = int(input(f'insert you date of bit ')) atualdate = str(datetime.date.today())[0:4] datestr = int(atualdate) datefinal = datestr - datenasc print(datefinal) if datefinal < 18: print(f'voce esta com {datefinal}Faltam {18-datefinal} pra você se alistar ao exercito hahahah' ) elif datefinal =...
3.78125
4
local_test/test_pullparser.py
rmoskal/e-springpad
1
16664
<filename>local_test/test_pullparser.py __author__ = 'rob' import unittest import logging import evernotebookparser from xml.etree import ElementTree import re class TestNotebookParser(unittest.TestCase): def setUp(self): self.o = evernotebookparser.NotebookParser2("../Quotes.enex") def ...
2.828125
3
test/test_sysroot_compiler.py
prajakta-gokhale/cross_compile
0
16665
# Copyright 2019 Amazon.com, Inc. or its affiliates. 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 require...
1.570313
2
estimate.py
farr/galmassproxy
0
16666
<reponame>farr/galmassproxy<gh_stars>0 #!/usr/bin/env python r"""estimate.py Use to estimate masses based on observed proxy values (and associated errors) from a pre-calibrated generative model for the mass-proxy relationship. The estimates will be returned as samples (fair draws) from the model's posterior on the m...
2.0625
2
scripts/python/printings.py
samk-ai/cmd-tools-course-materials
0
16667
str1 = "Python" str2 = "Python" print("\nMemory location of str1 =", hex(id(str1))) print("Memory location of str2 =", hex(id(str2))) print()
3.171875
3
plots_lib/architecture_config.py
cmimprota/ASL-SIFT
1
16668
config = dict() config['fixed_cpu_frequency'] = "@ 3700 MHz" config['frequency'] = 3.7e9 config['maxflops_sisd'] = 2 config['maxflops_sisd_fma'] = 4 config['maxflops_simd'] = 16 config['maxflops_simd_fma'] = 32 config['roofline_beta'] = 64 # According to WikiChip (Skylake) config['figure_size'] = (20,9) config...
1.484375
1
telemetry_f1_2021/generate_dataset.py
jasperan/f1-telemetry-oracle
4
16669
import cx_Oracle from oracledb import OracleJSONDatabaseConnection import json jsondb = OracleJSONDatabaseConnection() connection = jsondb.get_connection() connection.autocommit = True soda = connection.getSodaDatabase() x_collection = soda.createCollection('f1_2021_weather') all_data = list() for doc in x_collect...
2.71875
3
UserPage.py
muath22/BookStore
9
16670
from Tkinter import * import ttk import BuyBook import BookInformationPage import Message class UserPage(object): def __init__(self, root, color, font, dbConnection, userInfo): for child in root.winfo_children(): child.destroy() self.root = root self.color = color sel...
2.6875
3
migrations/versions/1b57e397deea_initial_migration.py
sicness9/BugHub
0
16671
<reponame>sicness9/BugHub """initial migration Revision ID: 1b57e397deea Revises: Create Date: 2021-12-20 20:57:14.696646 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '1b57e397deea' down_revision = None branch_labels = None depends_on = None def upgrade()...
1.453125
1
app/utility/base_planning_svc.py
scottctaylor12/caldera
0
16672
<reponame>scottctaylor12/caldera<filename>app/utility/base_planning_svc.py import copy import itertools import re from base64 import b64decode from app.utility.base_service import BaseService from app.utility.rule import RuleSet class BasePlanningService(BaseService): async def trim_links(self, operation, links...
2.265625
2
pyclid/__init__.py
Kaundur/pyclid
2
16673
<reponame>Kaundur/pyclid<filename>pyclid/__init__.py import math from pyclid.vector import * from pyclid.matrix import * from pyclid.quaternion import * #from pyclid.vector import vector #from pyclid.quaternion import quaternion #from pyclid.matrix import matrix
1.523438
2
tools/gen_histograms.py
mistajuliax/pbrt-v3-IILE
16
16674
<filename>tools/gen_histograms.py import os rootdir = os.path.abspath(os.path.join(__file__, "..", "..")) mldir = os.path.join(rootdir, "ml") import sys sys.path.append(mldir) import pfm import iispt_transforms import math import plotly import plotly.plotly as py import plotly.graph_objs as go # ==================...
2.390625
2
crownstone_uart/core/uart/UartBridge.py
RicArch97/crownstone-lib-python-uart
0
16675
<filename>crownstone_uart/core/uart/UartBridge.py import logging import sys import threading import serial import serial.tools.list_ports from crownstone_uart.Constants import UART_READ_TIMEOUT, UART_WRITE_TIMEOUT from crownstone_uart.core.UartEventBus import UartEventBus from crownstone_uart.core.uart.UartParser imp...
2.515625
3
data-batch-treatment/test_agg_script/locations.py
coder-baymax/taxi-poc-aws
0
16676
<reponame>coder-baymax/taxi-poc-aws class Location: def __init__(self, location_id, borough, zone, lat, lng): self.location_id = location_id self.borough = borough self.zone = zone self.lat = lat self.lng = lng @property def json(self): return { ...
2.53125
3
main.py
viniciuslimafernandes/interpolation
0
16677
import math from utils import * def main(): showHome() option = chooseOption() handleOption(option) main()
1.8125
2
tests/helper.py
blehers/PyViCare
0
16678
import os import simplejson as json def readJson(fileName): test_filename = os.path.join(os.path.dirname(__file__), fileName) with open(test_filename, mode='rb') as json_file: return json.load(json_file)
2.734375
3
examples/client-example.py
pkalemba/python-warp10client
8
16679
#! /usr/bin/env python # -*- coding: utf-8 -*- import daiquiri from time import time import warp10client LOG = daiquiri.getLogger(__name__) warp10_api_url = '' # Add here backend url where metrics are stored read_token = '' # Add here your metrics read token write_token = '' # Add here your metrics write token #...
2.15625
2
ports/stm32/boards/NUCLEO_WB55/rfcore_makefirmware.py
H-Grobben/micropython
0
16680
<reponame>H-Grobben/micropython #!/usr/bin/env python3 # # This file is part of the MicroPython project, http://micropython.org/ # # The MIT License (MIT) # # Copyright (c) 2020 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files ...
1.8125
2
universal/spiders/universalSpider.py
universalscraper/universal-spider
2
16681
import scrapy import yaml class universalSpider(scrapy.Spider): name = "universal" parameters = None def __init__(self, *args, **kwargs): worker = kwargs.get("worker") if not worker: exit("You must specify worker name : -a worker=name") self.parameters = yaml.load(f...
2.71875
3
environments/IPP_BO_Ypacarai.py
FedePeralta/ASVs_Deep_Reinforcement_Learning_with_CNNs
0
16682
<gh_stars>0 import warnings import gym import matplotlib.pyplot as plt import numpy as np from skopt.acquisition import gaussian_ei from environments.groundtruthgenerator import GroundTruth warnings.simplefilter("ignore", UserWarning) from skopt.learning.gaussian_process import gpr, kernels class ContinuousBO(gym....
2.25
2
utils/metrics.py
0b3d/Image-Map-Embeddings
2
16683
<reponame>0b3d/Image-Map-Embeddings import numpy as np from sklearn.metrics import pairwise_distances import matplotlib.pyplot as plt class NumpyMetrics(): def __init__(self, metric='euclidean'): self.metric = metric def rank(self, x,y, x_labels, y_labels): distances = pairwise_distances(x,y,...
2.828125
3
tests/bugs/test-200908181430.py
eLBati/pyxb
123
16684
# -*- coding: utf-8 -*- import logging if __name__ == '__main__': logging.basicConfig() _log = logging.getLogger(__name__) import pyxb.binding.generate import pyxb.binding.datatypes as xs import pyxb.binding.basis import pyxb.utils.domutils import os.path xsd='''<?xml version="1.0" encoding="UTF-8"?> <xs:schema xm...
2.453125
2
bin/print_data_structure.py
JohanComparat/pyEmerge
0
16685
import sys ii = int(sys.argv[1]) env = sys.argv[2] # python3 print_data_structure.py 22 MD10 import glob import os import numpy as n import EmergeIterate iterate = EmergeIterate.EmergeIterate(ii, env) iterate.open_snapshots() def print_attr(h5item): for attr in h5item: print(attr, h5item[attr]) def print...
2.546875
3
setup.py
ljdursi/mergevcf
25
16686
<reponame>ljdursi/mergevcf # based on https://github.com/pypa/sampleproject from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the relevant file with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-...
1.835938
2
tests/test_coders.py
GlobalFishingWatch/pipe-tools
1
16687
import pytest import six import ujson import apache_beam as beam from apache_beam.testing.test_pipeline import TestPipeline as _TestPipeline from apache_beam.testing.util import assert_that from apache_beam.testing.util import equal_to from apache_beam.coders import typecoders from apache_beam.typehints import Dict, U...
1.96875
2
yeti/core/model/stix/sro.py
yeti-platform/TibetanBrownBear
9
16688
"""Detail Yeti's Entity object structure.""" import json from yeti.core.errors import ValidationError from .base import StixObject class StixSRO(StixObject): def __init__(self, db_from, db_to, attributes): self._db_from = db_from self._db_to = db_to super().__init__(**attributes) @cl...
2.6875
3
netforce_mfg/netforce_mfg/models/barcode_qc.py
nfco/netforce
27
16689
<reponame>nfco/netforce # Copyright (c) 2012-2015 Netforce Co. Ltd. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, c...
1.789063
2
src/data/domain.py
AlexMoreo/pydci
7
16690
<gh_stars>1-10 import pickle from scipy.sparse import lil_matrix import numpy as np class Domain: """ Defines a domain, composed by a labelled set and a unlabeled set. All sets share a common vocabulary. The domain is also characterized by its name and language. """ def __init__(self, X, y, U, voc...
3.015625
3
LeetCode_1304.py
xulu199705/LeetCode
0
16691
from typing import List class Solution: def sumZero(self, n: int) -> List[int]: ans = [x for x in range(-(n//2), n//2 + 1)] if n % 2 == 0: ans.remove(0) return ans
3.328125
3
models/universal_sentence_encoder_multilingual_qa/v1/utils.py
rhangelxs/russian_embeddings
0
16692
<reponame>rhangelxs/russian_embeddings import numpy import tensorflow as tf import tensorflow_hub as hub import tf_sentencepiece class EmbeddingWrapper: def __init__(self): module_url = "https://tfhub.dev/google/universal-sentence-encoder-multilingual-qa/1" # Set up graph. g = tf.Graph() ...
2.515625
3
jade/extensions/demo/create_merge_pred_gdp.py
jgu2/jade
15
16693
#!/usr/bin/env python """Creates the JADE configuration for stage 2 of the demo pipeline.""" import os import sys from jade.models import PipelineConfig from jade.utils.subprocess_manager import run_command from jade.utils.utils import load_data PRED_GDP_COMMANDS_FILE = "pred_gdp_commands.txt" def main(): con...
2.53125
3
hamal/hamal/conf/identity.py
JackDan9/hamal
3
16694
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
1.6875
2
fact/time.py
mackaiver/slowREST
1
16695
<filename>fact/time.py from __future__ import print_function __author__ = 'dneise, mnoethe' """ This file contains some functions to deal with FACT modified modified julian date The time used most of the time in FACT is the number of days since 01.01.1970 So this time is related to unix time, since it has the same ...
3.359375
3
nipype/interfaces/ants/tests/test_auto_ImageMath.py
TRO-HIT/nipype
0
16696
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from ..utils import ImageMath def test_ImageMath_inputs(): input_map = dict( args=dict(argstr="%s",), copy_header=dict(usedefault=True,), dimension=dict(argstr="%d", position=1, usedefault=True,), environ=dict(nohash=True, usede...
2.140625
2
tests/chainerx_tests/unit_tests/routines_tests/test_math.py
tkerola/chainer
0
16697
<filename>tests/chainerx_tests/unit_tests/routines_tests/test_math.py import chainer import numpy import pytest import chainerx import chainerx.testing from chainerx_tests import array_utils from chainerx_tests import dtype_utils from chainerx_tests import math_utils from chainerx_tests import op_utils _in_out_dtyp...
2.09375
2
7.py
flpcan/project_euler
0
16698
# By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. # # What is the 10 001st prime number? primes = [] for i in range(2, 100): if len(primes) == 10001: break x = list(map(lambda y: i % y == 0, range(2,i))) if sum(x) == False: primes.a...
3.78125
4
src/plot_scripts/plot_sigcomm_bars_cellular.py
zxxia/RL-CC
0
16699
<gh_stars>0 import os import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt SAVE_ROOT = '../../figs_sigcomm22' plt.style.use('seaborn-deep') plt.rcParams['font.family'] = 'Arial' # plt.rcParams['font.size'] = 42 # plt.rcParams['axes.labelsize'] = 42 # plt.rcParams['legend.fontsize'] = 42 # plt.rcPa...
1.773438
2