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
robot_con/baxter/baxter_client.py
takuya-ki/wrs
23
13100
<gh_stars>10-100 import robotconn.rpc.baxterrobot.baxter_server_pb2 as bxtsp import robotconn.rpc.baxterrobot.baxter_server_pb2_grpc as bxtspgc import grpc import pickle import numpy as np class BaxterClient(object): def __init__(self, host = "localhost:18300"): channel = grpc.insecure_channel(host) ...
2.203125
2
pw_build/py/pw_build/copy_from_cipd.py
Tiggerlaboratoriet/pigweed
1
13101
<reponame>Tiggerlaboratoriet/pigweed # Copyright 2021 The Pigweed 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
2.4375
2
globomap_api/api/v2/parsers/queries.py
pedrokiefer/globomap-api
15
13102
<reponame>pedrokiefer/globomap-api """ Copyright 2018 Globo.com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by ...
2.046875
2
auto_pull_request/parser.py
Ruth-Seven/Auto-git-request
2
13103
<filename>auto_pull_request/parser.py # -*- encoding: utf-8 -*- # # 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 appli...
2.640625
3
fit1d/common/fit1d.py
michael-amat/fit1d
0
13104
""" fit1d package is designed to provide an organized toolbox for different types of 1D fits that can be performed. It is easy to add new fits and other functionalities """ from abc import ABC, abstractmethod import numpy as np from typing import List,Tuple from fit1d.common.model import Model, ModelMock from fit1d.co...
3.1875
3
ska_skeleton/__init__.py
Vinod-Sathe-Company-Limited/ska-skeleton
0
13105
# -*- coding: utf-8 -*- """Module init code.""" __version__ = '0.0.0' __author__ = '<NAME>' __email__ = '<EMAIL>'
1.03125
1
src/users.py
dtekcth/tvmannen
0
13106
<filename>src/users.py<gh_stars>0 # Blueprint for user management in /admin/users and /admin/users/delete from tv import login_manager, db from flask_login import LoginManager, current_user, login_user, logout_user, login_required from flask import Blueprint, flash, redirect, render_template, request from data import ...
2.6875
3
mxfield/models.py
krescruz/django-mxfield
0
13107
from django.db.models import CharField from django.utils.translation import ugettext_lazy as _ import validators class CURPField(CharField): default_validators = [validators.CURPValidator()] description = _("CURP") def __init__(self, *args, **kwargs): kwargs['max_length'] = 18 super(CURPField, self).__init__(...
2.140625
2
tests/unit/test_crypt.py
oba11/salt
0
13108
<reponame>oba11/salt<filename>tests/unit/test_crypt.py # coding: utf-8 # python libs from __future__ import absolute_import import os # salt testing libs from tests.support.unit import TestCase, skipIf from tests.support.mock import patch, call, mock_open, NO_MOCK, NO_MOCK_REASON, MagicMock # salt libs import salt.u...
1.992188
2
gubbins/tests/utils_tests.py
doismellburning/django-gubbins
0
13109
<filename>gubbins/tests/utils_tests.py import unittest from gubbins.utils import append_params class UtilsTest(unittest.TestCase): def test_append_params(self): url = 'http://www.fish.com/dir/page.html' url = append_params(url, {'a': 1, 'b': 'a i'}) expected = 'http://www.fish.com/dir...
3.21875
3
tests/components/test_power_output.py
Shivam60/j5
0
13110
<reponame>Shivam60/j5<gh_stars>0 """Tests for the power output classes.""" from typing import List, Optional, Type from j5.backends import Backend from j5.boards import Board from j5.components.power_output import PowerOutput, PowerOutputInterface class MockPowerOutputDriver(PowerOutputInterface): """A testing d...
2.515625
3
msg/tools/genmsg/test/test_genmsg_msgs.py
sikuner/Firmware_Marine
17
13111
<reponame>sikuner/Firmware_Marine # Software License Agreement (BSD License) # # Copyright (c) 2009, <NAME>, Inc. # 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...
1.34375
1
custom_components/waste_collection_schedule/waste_collection_schedule/wizard/stadtreinigung_hamburg.py
UBS-P/hacs_waste_collection_schedule
142
13112
#!/usr/bin/env python3 from html.parser import HTMLParser import inquirer import requests # Parser for HTML input class InputParser(HTMLParser): def __init__(self, input_name): super().__init__() self._input_name = input_name self._value = None @property def value(self): ...
3.328125
3
pythonstudy/convert.py
flyonskycn/pythonstudy
0
13113
import chardet import sys import codecs import os def findEncoding(s): file = open(s, mode='rb') buf = file.read() result = chardet.detect(buf) file.close() return result['encoding'] def convertEncoding(s): if os.access(s,os.W_OK): encoding = findEncoding(s) ...
3.1875
3
tests/tests.py
arck1/aio-counter
0
13114
import unittest from asyncio import sleep from async_unittest import TestCase from aio_counter import AioCounter from aio_counter.exceptions import AioCounterException class TestAioCounter(TestCase): TIK = float(0.3) TAK = float(0.6) TTL = int(1) @classmethod def setUpClass(cls) -> None: ...
2.640625
3
dexp/processing/remove_beads/__init__.py
haesleinhuepf/dexp
16
13115
from dexp.processing.remove_beads.beadsremover import BeadsRemover
1.070313
1
venv/lib/python3.8/site-packages/pip/_internal/operations/install/editable_legacy.py
Retraces/UkraineBot
2
13116
<gh_stars>1-10 /home/runner/.cache/pip/pool/6e/30/4e/6df13ab33dd498623bcb8f860a029ad969938275a514553b6fe8b4b10b
0.984375
1
corrector_module/opmon_corrector/corrector_worker.py
nordic-institute/X-Road-Metrics
2
13117
<reponame>nordic-institute/X-Road-Metrics # The MIT License # Copyright (c) 2021- Nordic Institute for Interoperability Solutions (NIIS) # Copyright (c) 2017-2020 Estonian Information System Authority (RIA) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and ass...
1.953125
2
autosa_tests/large/mm_int16/unroll.py
mfkiwl/AutoSA-SystolicArray
102
13118
import math # Modify the parameters here UNROLL_FACTOR = 32 DATA_T = 'unsigned short' # Generate the code data_type = DATA_T level = int(math.log2(UNROLL_FACTOR)) for layer in range(level - 1, -1, -1): pair = int(math.pow(2, layer)) for i in range(pair): # data_t tmp_[layer]_[pair] = tmp_[layer+1]_[pa...
2.53125
3
battlecode-manager/player_plain.py
gruzzlymug/ddg-2018
1
13119
<reponame>gruzzlymug/ddg-2018<gh_stars>1-10 import os import psutil import subprocess import threading import sys from threading import Timer import select from player_abstract import AbstractPlayer class PlainPlayer(AbstractPlayer): def __init__(self, socket_file, working_dir, local_dir=None, p...
2.1875
2
skfda/exploratory/__init__.py
jiduque/scikit-fda
147
13120
from . import depth from . import outliers from . import stats from . import visualization
1.054688
1
jassen/django/project/blog/views.py
cabilangan112/intern-drf-blog
0
13121
from django.shortcuts import render from django.contrib.auth.models import User, Group from rest_framework import viewsets from django.shortcuts import get_object_or_404 from rest_framework.response import Response from rest_framework import viewsets, status from .models import Post,Comment,Category,Tag from .serialize...
2
2
loopchain/rest_server/rest_server_rs.py
ahastudio/loopchain
0
13122
<gh_stars>0 # Copyright 2018 ICON Foundation # # 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...
1.71875
2
ceilometer/tests/storage/test_impl_sqlalchemy.py
aristanetworks/ceilometer
0
13123
<reponame>aristanetworks/ceilometer # # Author: <NAME> <<EMAIL>> # <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...
1.75
2
ProjectManager.py
kojingharang/ManagerKit
0
13124
from collections import namedtuple import datetime import pprint import sys import copy import json def expandStatusValue(v): """ v : string | (string, datetime.date | None) が string だった場合 (string, None) に展開する. """ if isinstance(v, str): v = (v, None) return v def formatDate(d): if not d: return "????-??-?...
2.71875
3
asteroids/whatsobservable.py
mcnowinski/various-and-sundry
2
13125
<filename>asteroids/whatsobservable.py import datetime import ephem import os.path import os import numpy as np import pdb from pandas import DataFrame __version__ = '0.1.2' class Error(Exception): pass def _convert_datetime_to_pyephem_date_string(in_datetime): return in_datetime.strftime('%Y/%m/%d %H:%M:...
2.8125
3
pcdet/models/backbones_3d/vfe/pillar_vfe.py
KPeng9510/OpenPCDet
1
13126
<filename>pcdet/models/backbones_3d/vfe/pillar_vfe.py import torch from torch_geometric.nn import FeaStConv from knn_cuda import KNN from torch_cluster import fps #from ....ops.roiaware_pool3d import roiaware_pool3d_utils import torch.nn as nn import torch.nn.functional as F from .vfe_template import VFETemplate impo...
2
2
chess/pythonchess/docs/conf.py
mahakbansal/ChessAlphaZero
2
13127
<filename>chess/pythonchess/docs/conf.py # -*- coding: utf-8 -*- from __future__ import unicode_literals import sys import os # Import the chess module. sys.path.insert(0, os.path.abspath('..')) import chess # Autodoc. extensions = ["sphinx.ext.autodoc"] autodoc_member_order = 'bysource' # The suffix of source fil...
1.78125
2
python/example.py
msmerlak/aa
0
13128
# min (1/2) x'Q'x - q'x from __future__ import print_function import numpy as np import aa dim = 1000 mems = [5, 10, 20, 50, 100] N = int(1e4) np.random.seed(1234) Q = np.random.randn(dim,dim) Q = Q.T.dot(Q) q = np.random.randn(dim) x_0 = np.random.randn(dim) x_star = np.linalg.solve(Q, q) step = 0.0005 def f(x):...
2.703125
3
MuonAnalysis/MuonAssociators/test/L1MuonMatcher/test.py
ckamtsikis/cmssw
852
13129
<reponame>ckamtsikis/cmssw import FWCore.ParameterSet.Config as cms process = cms.Process("PAT") # initialize MessageLogger and output report process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.cerr.threshold = 'INFO' process.MessageLogger.cerr.INFO = cms.untracked.PSet( default ...
1.46875
1
hydropy/__init__.py
GironsLopez/hydropy
0
13130
<filename>hydropy/__init__.py """ Hydropy ======= Provides functions to work with hydrological processes and equations """
1.320313
1
Desafios Finais Python - Cognizant Data Cloud Engineer #2/Preenchimento de Vetor I.py
italocreator/heros-journey
0
13131
<reponame>italocreator/heros-journey """ Desafio Você recebeu o desafio de ler um valor e criar um programa que coloque o valor lido na primeira posição de um vetor N[10]. Em cada posição subsequente, coloque o dobro do valor da posição anterior. Por exemplo, se o valor lido for 1, os valores do vetor devem ser 1,2,4...
3.78125
4
Home_Work_2_B_Naychuk_Anastasiya/Task1.py
NaychukAnastasiya/goiteens-python3-naychuk
0
13132
# Яке з 3 чисел найбільш наближене до середнього print("Введіть перше число") var1 = float(input()) print("Введіть друге число") var2 = float(input()) print("Введіть третє число") var3 = float(input()) # Avg = (var1+var2+var3)/3 # Варіант розв'язку з порівнянням чисел із середнім арифметичним: if ((var1 > var...
4.03125
4
src/paper_1/curriculum/main.py
ludwigflo/paper1
0
13133
from paper_1.data.data_loader import load_val_data, load_train_data, sequential_data_loader, random_data_loader from paper_1.utils import read_parameter_file, create_experiment_directory from paper_1.evaluation.eval_utils import init_metrics_object from paper_1.baseline.main import train as baseline_train from paper_1....
1.96875
2
sfc/tests/functest/sfc_symmetric_chain.py
pkaralis/sfc
0
13134
#!/usr/bin/env python # # Copyright (c) 2017 Ericsson AB and others. All rights reserved # # This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # # http://www.apache.org/licenses/LICENSE-2.0 # imp...
2.171875
2
site-packages/offshoot/main.py
nanpuhaha/SerpentAI
42
13135
<reponame>nanpuhaha/SerpentAI #!/usr/bin/env python import sys import os import subprocess import offshoot valid_commands = ["init", "install", "uninstall"] def execute(): if len(sys.argv) == 2: command = sys.argv[1] if command not in valid_commands: raise Exception("'%s' is not a ...
2.53125
3
samples/unsharp/unsharp.py
hj424/heterocl
7
13136
import heterocl as hcl from math import sqrt hcl.config.init_dtype = hcl.Float() input_image = hcl.placeholder((480, 640, 3), name = "input") output_image = hcl.placeholder((480, 640, 3), name = "output") def unsharp(input_image, output_image): """ Helper Functions """ def clamp(val, min_, max_): local ...
2.5
2
hatspil/core/utils.py
dodomorandi/hatspil
2
13137
"""A collection of utility function, shared across modules.""" import collections import datetime import gzip as gz import logging import os import re import shutil import subprocess from argparse import ArgumentTypeError from copy import deepcopy from logging import Logger from typing import (Any, Callable, Dict, Gene...
2.6875
3
DistrictData.py
robbierobinette/rcv-tensorflow
0
13138
import csv from typing import List from CombinedPopulation import CombinedPopulation from PopulationGroup import PopulationGroup, Democrats, Republicans, Independents class DistrictVotingRecord: def __init__(self, district: str, incumbent: str, expected_lean: flo...
3.4375
3
urlmiddleware/base.py
dbramwell/django-urlmiddleware
4
13139
<reponame>dbramwell/django-urlmiddleware<filename>urlmiddleware/base.py<gh_stars>1-10 from django.core.urlresolvers import Resolver404 class MiddlewareResolver404(Resolver404): pass
1.273438
1
test.py
ifplusor/actrie
8
13140
# coding=utf-8 from actrie.tests.test_matcher import test if __name__ == "__main__": test()
1.046875
1
warehouse/email/services.py
pradyunsg/warehouse
1
13141
# 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 the Li...
2.015625
2
quickvision/pretrained/_pretrained_weights.py
zlapp/quickvision
47
13142
<reponame>zlapp/quickvision import torch __all__ = ["_load_pretrained_weights"] def _load_pretrained_weights(weights_dict, model_name: str, pretrained: str): state_dict = torch.hub.load_state_dict_from_url(weights_dict[model_name][pretrained], map_location="cpu") return state_dict
2
2
woke/woke/a_config/data_model.py
Ackee-Blockchain/woke
7
13143
from typing import Optional, List from pathlib import Path from dataclasses import astuple import re from pydantic import BaseModel, Field, Extra, validator from pydantic.dataclasses import dataclass from woke.core.enums import EvmVersionEnum from woke.c_regex_parsing.solidity_version import SolidityVersion class W...
2.46875
2
model/rcnn/network.py
da-h/tf-boilerplate
0
13144
import tensorflow as tf import tensorflow.contrib.layers as tfl """Copied from the almighty <NAME>; CECAM/CSM/IRTG School 2018: Machine Learning in Scientific Computing https://github.com/CECAML/school_nierstein_2018/blob/master/Convnet%20TF.ipynb """ def prelu(net): alpha = tf.Variable(0.0, dtype=net.dtype) ...
3.046875
3
app/application.py
dulin/tornado-test
0
13145
#!/usr/bin/env python # -*- coding: utf-8 -*- # -*- mode: python -*- import tornado.web from app.views import HelloWorld from app.ws.communication import CommunicationSocketHandler class Application(tornado.web.Application): def __init__(self, db=None): self.db = db handlers = [ (r"/...
2.125
2
python-fmclient/fmclient/fmclient/common/wrapping_formatters.py
starlingx/fault
2
13146
<gh_stars>1-10 # # Copyright (c) 2018 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # """ Manages WrapperFormatter objects. WrapperFormatter objects can be used for wrapping CLI column celldata in order for the CLI table (using prettyTable) to fit the terminal screen The basic idea is: Once ce...
2.296875
2
simple.py
vaiorabbit/python-glfw
0
13147
<gh_stars>0 # Ref.: https://github.com/vaiorabbit/ruby-opengl/blob/master/sample/simple.rb from ctypes import * from OpenGL.GL import * import GLFW from GLFW import * def key_callback_fn(window_handle, key, scancode, action, mods): if key == GLFW_KEY_ESCAPE and action == GLFW_PRESS: glfwSetWindowShouldClos...
2.140625
2
market_sim/_agents/risk_model.py
quanttrade/rl_trading
247
13148
#!/usr/bin/python # -*- coding: utf-8 -*- """ Implement different methods to hedge positions and measure the risk of a Zero cupon bond portfolio REFERENCE: <NAME>; <NAME>.; <NAME>., "Interest Rate Risk Modeling, the fixed Income Valuation course". Wiley, 2005 @author: ucaiado Created on 12/22/2016 """ import numpy...
3.234375
3
hris/apps/jobs/admin.py
Minedomain/hris_backend
0
13149
<filename>hris/apps/jobs/admin.py<gh_stars>0 from django.contrib import admin from .models import * @admin.register(Job) class JobAdmin(admin.ModelAdmin): list_display = ['job_id', 'job_title', 'duties', 'min_salary', 'max_salary']
1.671875
2
src/arche/readers/schema.py
WinterComes/arche
52
13150
<gh_stars>10-100 from collections import defaultdict from enum import Enum import json import pprint from typing import Dict, List, Union, Any, Set, DefaultDict from arche.tools import s3 import perfect_jsonschema EXTENDED_KEYWORDS = {"tag", "unique", "coverage_percentage"} SchemaObject = Dict[str, Union[str, bool, ...
2.234375
2
tensorflow_probability/python/mcmc/eight_schools_hmc.py
hephaex/probability
4
13151
<filename>tensorflow_probability/python/mcmc/eight_schools_hmc.py # Copyright 2018 The TensorFlow Probability 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.apach...
1.875
2
src/pyspex/dem_io.py
rmvanhees/pyspex
0
13152
<filename>src/pyspex/dem_io.py<gh_stars>0 """ This file is part of pyspex https://github.com/rmvanhees/pyspex.git Python implementation to read SPEXone DEM output Copyright (c) 2019-2021 SRON - Netherlands Institute for Space Research All Rights Reserved License: BSD-3-Clause """ from pathlib import Path impor...
2.078125
2
tests/util/test_parsing_helpers.py
lkattis-signal/SignalSDK
10
13153
<reponame>lkattis-signal/SignalSDK from dataclasses import dataclass, field from datetime import datetime, timezone from typing import Union, Type, List, Optional, Any, Tuple import pytest from signal_ocean.util import parsing_helpers @pytest.mark.parametrize("cap_words, snake_cased", [('Ve...
2.34375
2
density-based/train.py
ramonpeter/UnbinnedMeasurements
0
13154
import tensorflow as tf import pandas as pd import numpy as np import sys import time from cflow import ConditionalFlow from MoINN.modules.subnetworks import DenseSubNet from utils import train_density_estimation, plot_loss, plot_tau_ratio # import data tau1_gen = np.reshape(np.load("../data/tau1s_Pythia_gen.npy"), ...
2.21875
2
assignment5/code/src/decoder.py
jschmidtnj/cs584
0
13155
<reponame>jschmidtnj/cs584 #!/usr/bin/env python3 """ decoder file decoder class """ import tensorflow as tf class BahdanauAttention(tf.keras.layers.Layer): def __init__(self, units): """ attention layer from Bahdanau paper """ super().__init__() self.w1 = tf.keras.layers...
2.5
2
camos/model/inputdata.py
danilexn/camos
1
13156
# -*- coding: utf-8 -*- # Created on Sat Jun 05 2021 # Last modified on Mon Jun 07 2021 # Copyright (c) CaMOS Development Team. All Rights Reserved. # Distributed under a MIT License. See LICENSE for more info. import numpy as np import camos.model.image as img from camos.utils.apptools import getGui class InputData...
3.046875
3
src/compas_fab/backends/ros/messages/services.py
Kathrin3010/compas_fab
0
13157
<reponame>Kathrin3010/compas_fab<filename>src/compas_fab/backends/ros/messages/services.py from __future__ import absolute_import from .geometry_msgs import PoseStamped from .moveit_msgs import Constraints from .moveit_msgs import MoveItErrorCodes from .moveit_msgs import PlannerParams from .moveit_msgs import Plannin...
2.0625
2
PP4E/Examples/PP4E/Ai/ExpertSystem/holmes/holmes2/forward.py
BeacherHou/Python-_Markdown-
0
13158
<filename>PP4E/Examples/PP4E/Ai/ExpertSystem/holmes/holmes2/forward.py # # module forward.py # # forward chaining inference engine # see holmes/forward.py and holmes.doc for more info; # # optimization: uses known fact and rule 'if' indexes to avoid: # a) exhaustive fact list search when matching an 'if' # b) ...
2.46875
2
Photo.py
Matsoy/hashcode2019-qualificationRound
0
13159
class Photo: def __init__(self, lid, tags_list, orientation): """ Constructor :param lid: Photo identifier :param tags_list: List of tags :param orientation: Orientation. "H" for horizontal or "V" for vertical """ self.id = lid self...
3.140625
3
bert/tasks/read_file.py
rschoon/bert
0
13160
import tarfile import tempfile from . import Task, TaskVar class TaskReadFile(Task, name="read-file"): """ Read contents of a file in the image into a variable. """ class Schema: path = TaskVar(help="Container file path to read data from") var = TaskVar(help="Destination variable nam...
2.8125
3
p2m/layers.py
dipaco/single-viewTo3D
0
13161
<filename>p2m/layers.py # Copyright (C) 2019 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, Fudan University # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not...
1.984375
2
models/swarm_algorithm.py
AlexanderKlanovets/swarm_algorithms
9
13162
from abc import ABC, abstractmethod import numpy as np class SwarmAlgorithm(ABC): ''' A base abstract class for different swarm algorithms. Parameters ---------- D : int Search space dimension. N : int Population size. fit_func : callable Fitness (objective) functi...
3.671875
4
Python-3/basic_examples/strings/python_str_to_datetime.py
ghiloufibelgacem/jornaldev
1,139
13163
<filename>Python-3/basic_examples/strings/python_str_to_datetime.py<gh_stars>1000+ from datetime import datetime # string to datetime object datetime_str = '09/19/18 13:55:26' datetime_object = datetime.strptime(datetime_str, '%m/%d/%y %H:%M:%S') print(type(datetime_object)) print(datetime_object) # printed in defa...
3.59375
4
sshspawner/tests/__init__.py
1kastner/SSHSpawner
5
13164
############################################################################### # Copyright (c) 2018, Lawrence Livermore National Security, LLC # Produced at the Lawrence Livermore National Laboratory # Written by <NAME> <EMAIL> # LLNL-CODE-771750 # All rights reserved # # This file is part of SSHSpawner: https://githu...
1.078125
1
vnpy/app/cta_strategy/strategies/tsmyo_bias_accu_strategy.py
TheSuperMyo/vnpy
0
13165
from datetime import time from vnpy.app.cta_strategy import ( CtaTemplate, StopOrder, TickData, BarData, TradeData, OrderData, BarGenerator, ArrayManager ) from vnpy.app.cta_strategy.base import ( EngineType, STOPORDER_PREFIX, StopOrder, StopOrderStatus, ) from vnpy.app.c...
2.21875
2
test/test-beam-dataflow-nlp.py
tarrade/proj_NLP_text_classification_with_GCP
1
13166
<filename>test/test-beam-dataflow-nlp.py import sys import os import pathlib import logging import subprocess import datetime import apache_beam as beam from apache_beam.options.pipeline_options import PipelineOptions from apache_beam.options.pipeline_options import StandardOptions from apache_beam.options.pipeline_opt...
2.3125
2
slixmpp/plugins/xep_0405/mix_pam.py
anirudhrata/slixmpp
86
13167
# Slixmpp: The Slick XMPP Library # Copyright (C) 2020 <NAME> <<EMAIL>> # This file is part of Slixmpp. # See the file LICENSE for copying permission. from typing import ( List, Optional, Set, Tuple, ) from slixmpp import JID, Iq from slixmpp.exceptions import IqError, IqTimeout from slixmpp.plugins im...
1.9375
2
MoraisParkingPython/view/funcoes_areas.py
larissacauane/Morais-Parking-Python
0
13168
from control.controller_veiculos import ControllerVeiculos from control.controller_proprietario import ControllerProprietario from control.controller_area import ControllerAreaEstacionamento from model.constants import * controller_veiculo = ControllerVeiculos() controller_proprietario = ControllerProprietario() cont...
3.015625
3
tests/gold_tests/h2/h2spec.test.py
a-canary/trafficserver
0
13169
<reponame>a-canary/trafficserver ''' Test HTTP/2 with h2spec ''' # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you ...
1.828125
2
examples/02/client.py
cjrh/aiosmartsock
9
13170
import logging import itertools import asyncio import random import aiomsg import aiorun logging.basicConfig(level="DEBUG") async def main(): s = aiomsg.Søcket(send_mode=aiomsg.SendMode.ROUNDROBIN) await s.connect() async def receiver(): while True: msg = await s.recv_string() ...
2.578125
3
data_structures/class_dependency_injection.py
miguelgfierro/pybase
14
13171
# Dependency injection: # Technique where one object (or static method) supplies the dependencies of another object. # The objective is to decouple objects to the extent that no client code has to be changed # simply because an object it depends on needs to be changed to a different one. # Dependency injection is one f...
3.875
4
vcommand/libs/crypto.py
virink/vCommand
7
13172
#!/usr/bin/env python3 # -*- coding:utf-8 -*- """ Author : Virink <<EMAIL>> Date : 2019/04/18, 14:49 """ import string import re L = string.ascii_lowercase U = string.ascii_uppercase A = string.ascii_letters def func_atbash(*args): """埃特巴什码解码""" arg = args[0] arg = arg.lower().replace(' ', 'vv...
3.703125
4
backend/risk_factors/tasks.py
Doctorinna/backend
24
13173
from .utils import (get_prescription, get_attributes, get_group) from .models import Disease, Result, Score, Question, SurveyResponse from .analysis import cardio_risk_group, diabetes_risk_group, stroke_risk_group from statistics import mean from celery import shared_task @shared_task def worker(session_id): df, ...
2.21875
2
augur/routes/__init__.py
Nayan-Das/augur
3
13174
<reponame>Nayan-Das/augur import importlib import os import glob from .user import create_user_routes from .repo import create_repo_routes from .broker import create_broker_routes def create_routes(server): create_user_routes(server) create_repo_routes(server) create_broker_routes(server) # for plugin...
1.679688
2
stests/chain/set_transfer_native.py
goral09/stests
4
13175
import json import random import subprocess from stests.core.logging import log_event from stests.chain.utils import execute_cli from stests.chain.utils import DeployDispatchInfo from stests.core.types.chain import Account from stests.core.types.infra import Network from stests.core.types.infra import Node from stests...
1.945313
2
Binary Search Tree/235. Lowest Common Ancestor of a Binary Search Tree.py
beckswu/Leetcode
138
13176
""" 235. Lowest Common Ancestor of a Binary Search Tree """ # Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def lowestCommonAncestor(self, root, p, q): ...
3.859375
4
waliki/acl.py
sckevmit/waliki
324
13177
from functools import wraps from collections import Iterable from django.conf import settings from django.shortcuts import render from django.core.exceptions import PermissionDenied from django.utils.decorators import available_attrs from django.utils.encoding import force_str from django.utils.six.moves.urllib.parse i...
2.0625
2
2808.py
heltonricardo/URI
6
13178
<filename>2808.py def conv(s): if s[0] == 'a': v = '1' elif s[0] == 'b': v = '2' elif s[0] == 'c': v = '3' elif s[0] == 'd': v = '4' elif s[0] == 'e': v = '5' elif s[0] == 'f': v = '6' elif s[0] == 'g': v = '7' elif s[0] == 'h': v = '8' v += s[1] return v e = str(input()).split(...
3.3125
3
RabiesRefNAAP_CLI.py
jiangweiyao/RabiesRefNAAP
0
13179
<filename>RabiesRefNAAP_CLI.py #!/usr/bin/env python import sys import os import glob import re from datetime import date import argparse import subprocess from pathlib import Path def main(): local_path = os.path.dirname(os.path.realpath(__file__)) #print(local_path) data_path = f"{local_path}" ...
2.25
2
mtp_cashbook/apps/disbursements/tests/test_search.py
uk-gov-mirror/ministryofjustice.money-to-prisoners-cashbook
4
13180
<reponame>uk-gov-mirror/ministryofjustice.money-to-prisoners-cashbook<gh_stars>1-10 import datetime from django.test import SimpleTestCase from django.urls import reverse from django.utils.html import strip_tags import responses from cashbook.tests import MTPBaseTestCase, api_url from disbursements.forms import Search...
2.140625
2
pipelines/pipeline_util/graphite_extract_utility.py
MatMoore/app-performance-summary
0
13181
<gh_stars>0 ''' Utility for extracting data from the graphite API ''' import os from urllib.parse import urlencode import pandas as pd class GraphiteExtractUtility: def __init__(self, default_url): url = os.environ.get('GRAPHITE_URL', default_url) self.render_url = url + '/render/?format=csv' ...
2.96875
3
backend/streetsignup/migrations/0002_auto_20200901_1758.py
nicoepp/the-prayer-walk
0
13182
<gh_stars>0 # Generated by Django 3.1.1 on 2020-09-01 17:58 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('streetsignup', '0001_initial'), ] operations = [ migrations.AlterField( model_name=...
1.476563
1
deepchem/feat/molecule_featurizers/coulomb_matrices.py
deloragaskins/deepchem
3,782
13183
""" Generate coulomb matrices for molecules. See Montavon et al., _New Journal of Physics_ __15__ (2013) 095003. """ import numpy as np from typing import Any, List, Optional from deepchem.utils.typing import RDKitMol from deepchem.utils.data_utils import pad_array from deepchem.feat.base_classes import MolecularFeat...
3.0625
3
edk2toollib/uefi/edk2/fmp_payload_header.py
mikeytdisco/edk2-pytool-library
32
13184
<filename>edk2toollib/uefi/edk2/fmp_payload_header.py<gh_stars>10-100 ## @file # Module that encodes and decodes a FMP_PAYLOAD_HEADER with a payload. # The FMP_PAYLOAD_HEADER is processed by the FmpPayloadHeaderLib in the # FmpDevicePkg. # # Copyright (c) 2018, Intel Corporation. All rights reserved.<BR> # SPDX-License...
2.171875
2
21-fs-ias-lec/15-AudioLink/Testing.py
paultroeger/BACnet
8
13185
<gh_stars>1-10 from Sender import Sender from Receiver import Receiver import scipy import numpy as np import scipy.io import scipy.io.wavfile import matplotlib.pyplot as plt from scipy import signal def readFromFile(path): file = open(path, "rb") data = file.read() file.close() return data def readW...
2.609375
3
suppress.py
j0hntv/suppress
0
13186
"""A simple wrapper around contextlib.suppress""" import contextlib from functools import wraps __version__ = "0.1.1" def suppress(*exceptions): def wrap(func): @wraps(func) def inner(*args, **kwargs): with contextlib.suppress(exceptions): return func(*args, **kwargs...
2.65625
3
anaconda_project/requirements_registry/requirements/conda_env.py
vertingo/Anaconda_Videos_Tutos
0
13187
<reponame>vertingo/Anaconda_Videos_Tutos<filename>anaconda_project/requirements_registry/requirements/conda_env.py # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2016, Anaconda, Inc. All rights reserved. # # Licensed under the terms of the BSD 3-C...
1.992188
2
data_utils/dataset/kodak_dataset.py
hieu1999210/image_compression
0
13188
<filename>data_utils/dataset/kodak_dataset.py<gh_stars>0 # Copyright 2020 <NAME> # # 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 ...
2.265625
2
ohs/domain/create_component.py
codejsha/infrastructure
4
13189
#!/usr/bin/env python domain_home = os.environ['DOMAIN_HOME'] node_manager_name = os.environ['NODE_MANAGER_NAME'] component_name = os.environ['COMPONENT_NAME'] component_admin_listen_address = os.environ['COMPONENT_ADMIN_LISTEN_ADDRESS'] component_admin_listen_port = os.environ['COMPONENT_ADMIN_LISTEN_PORT'] component...
1.898438
2
ironicclient/tests/functional/test_driver.py
sapcc/python-ironicclient
0
13190
# Copyright (c) 2015 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
2.53125
3
hw2/2.3 - list.py
ArtemNikolaev/gb-hw
0
13191
# https://github.com/ArtemNikolaev/gb-hw/issues/18 seasons = [ 'ЗИМА', 'ВЕСНА', 'ЛЕТО', 'ОСЕНЬ' ] month = int(input('Введите номер месяца: ')) if month < 1 or month > 12: print('Месяцев всего 12. Поэтому минимальное значение - 1, а максимальное - 12') else: seasonInt = (month % 12) // 3 p...
3.734375
4
modoboa/admin/signals.py
vinaebizs/modoboa
0
13192
<reponame>vinaebizs/modoboa """Modoboa admin signals.""" import django.dispatch use_external_recipients = django.dispatch.Signal(providing_args=["recipients"]) extra_domain_actions = django.dispatch.Signal( providing_args=["user", "domain"]) extra_domain_dashboard_widgets = django.dispatch.Signal( providing_a...
1.5
2
psono/restapi/tests/health_check.py
psono/psono-fileserver
2
13193
<reponame>psono/psono-fileserver<gh_stars>1-10 from django.urls import reverse from rest_framework import status from .base import APITestCaseExtended from mock import patch from restapi import models class HealthCheckTest(APITestCaseExtended): """ Test for health check """ def test_put_healthcheck...
2.484375
2
conftest.py
elijahr/python-portaudio
0
13194
import asyncio import contextlib import glob import itertools import logging import os import pytest import uvloop try: import tracemalloc tracemalloc.start() except ImportError: # Not available in pypy pass # clear compiled cython tests for path in itertools.chain( glob.glob(os.path.join('...
1.820313
2
tests/test_storage.py
angru/datamodel
2
13195
<gh_stars>1-10 from corm import Entity, Field, Storage, RelationType def test_add_by_primary_key(): class User(Entity): id: int = Field(pk=True) storage = Storage() john = User( data={'id': 1}, storage=storage, ) assert storage.get(User.id, 1) == john def test_make_rela...
2.96875
3
server/test/test_serverInfoAPI.py
rmetcalf9/VirtualPresencePicture
0
13196
<filename>server/test/test_serverInfoAPI.py from TestHelperSuperClass import testHelperAPIClient, env import unittest import json from appObj import appObj import pytz import datetime serverInfoWithoutAnyPictures = { 'Server': { 'Version': env['APIAPP_VERSION'] }, 'Pictures': [] } samplePictu...
2.609375
3
zp_database/make_zp/create_hard_xray_zp.py
sajid-ali-nu/zone_plate_testing
0
13197
#!/usr/bin/env python # coding: utf-8 # This script generates a zone plate pattern (based on partial filling) given the material, energy, grid size and number of zones as input # In[1]: import numpy as np import matplotlib.pyplot as plt from numba import njit from joblib import Parallel, delayed from tqdm import tq...
2.8125
3
model/kubernetes.py
adracus/cc-utils
0
13198
# Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed # under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Licens...
1.75
2
test/test.py
justifyzz/Python-Assignment-1
0
13199
from pycoingecko import CoinGeckoAPI number = int(input('Enter the number of coins: ')) for i in range(length): print(i + 1, ':', listOfNames[i], listOfMarketCaps[i])
3.453125
3