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
venv/lib/python3.6/site-packages/pykalman/unscented.py
QuantTraderEd/vnpy_crypto
34
12776151
''' ========================================= Inference for Non-Linear Gaussian Systems ========================================= This module contains the Unscented Kalman Filter (Wan, <NAME> 2000) for state estimation in systems with non-Gaussian noise and non-linear dynamics ''' from collections import namedtuple i...
3.140625
3
src/cloudwatch/modules/flusher.py
klarna/collectd-cloudwatch
1
12776152
import threading import time import os import math from client.putclient import PutClient from logger.logger import get_logger from metricdata import MetricDataStatistic, MetricDataBuilder class Flusher(object): """ The flusher is responsible for translating Collectd metrics to CloudWatch MetricDataStatistic,...
2.34375
2
scripts/vis_layout.py
d116626/covid
0
12776153
import plotly.graph_objs as go from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot, offline def get_layout(themes, title="", x_name="", y_name="", tipo=None): layout = go.Layout( # automargin=True, margin=dict( l=themes["margin"]["l"], r=themes["m...
2.453125
2
setup.py
callat-qcd/espressodb
8
12776154
# -*- coding: utf-8 -*- """Setup file for EspressoDB """ from espressodb import __version__ __author__ = "@cchang5, @ckoerber" from os import path from setuptools import setup, find_packages CWD = path.abspath(path.dirname(__file__)) with open(path.join(CWD, "README.md"), encoding="utf-8") as inp: LONG_DESCRI...
1.625
2
parsers/Interrupts.py
ondrejholecek/fortimonitor
9
12776155
from EasyParser import EasyParser import re import time # FG1K2D-2 # diag hardware sysinfo interrupts # CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7 # 0: 36 0 0 0 0 0 0 0 IO-APIC-edge tim...
1.75
2
pytorch_yolo_v1/utils/torch_utils.py
ldylab/learning_yolo_family_with_pytorch
0
12776156
<filename>pytorch_yolo_v1/utils/torch_utils.py<gh_stars>0 import torch def load_match_dict(model, model_path): # model: single gpu model, please load dict before warp with nn.DataParallel pretrain_dict = torch.load(model_path) model_dict = model.state_dict() # the pretrain dict may be multi gpus, clea...
2.375
2
rl_algorithms/a2c/agent.py
mshukor/DSACfD
1
12776157
# -*- coding: utf-8 -*- """1-Step Advantage Actor-Critic agent for episodic tasks in OpenAI Gym. - Author: <NAME> - Contact: <EMAIL> """ import argparse from typing import Tuple import gym import numpy as np import torch import wandb from rl_algorithms.common.abstract.agent import Agent from rl_algorithms.common.he...
2.390625
2
simulation/src/launch_tools/scripts/launch_tools/services_timer.py
LeonardII/KitCarFork
0
12776158
<gh_stars>0 #!/usr/bin/env python """Copyright (c) 2013, Systems, Robotics and Vision Group University of the Balearican Islands 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 ...
1.726563
2
ListaDeExercicios/Exercicio12.py
LucasAlmeida0/Estudos
0
12776159
# 12 Tendo como dados de entrada a altura de uma pessoa, construa um algoritmo que calcule seu peso ideal, usando a seguinte fórmula: (72.7*altura) - 58 Altura = float(input("Digite sua altura: ")); PesoIdeal = ( 72.7 * Altura ) - 58; print("Seu peso ideal é {:.2f}".format(PesoIdeal));
3.609375
4
src/autostory/map_generators.py
gustavospiess/2021-1-JD-Eq1
0
12776160
from typing import NamedTuple from random import choice, randint, shuffle __doc___ = ''' This module is used to generate the graph of a game map. The graph is divided in partition in such way that to any two partitions, there are at most one edge between this two. This partitions are linked in a tree structure, inte...
3.90625
4
network/setup.py
splitstrument/training
4
12776161
from setuptools import setup, find_packages setup(name='unmix', version='1.0', packages=find_packages())
1.21875
1
contrib/aws/awsexecutor.py
lachnerm/benchexec
0
12776162
# BenchExec is a framework for reliable benchmarking. # This file is part of BenchExec. # # Copyright (C) <NAME> # # SPDX-License-Identifier: Apache-2.0 # prepare for Python 3 from __future__ import absolute_import, division, print_function, unicode_literals import collections import io import json import logging imp...
1.992188
2
tests/fork/conftest.py
AqualisDAO/curve-dao-contracts
217
12776163
<gh_stars>100-1000 import pytest from brownie_tokens import MintableForkToken class _MintableTestToken(MintableForkToken): def __init__(self, address): super().__init__(address) @pytest.fixture(scope="session") def MintableTestToken(): yield _MintableTestToken @pytest.fixture(scope="module") def U...
1.867188
2
src/haydi/base/permutations.py
Kobzol/haydi
5
12776164
from .domain import Domain from math import factorial import itertools import random class Permutations(Domain): def __init__(self, domain, name=None): super(Permutations, self).__init__(name) self._set_flags_from_domain(domain) self.step_jumps = False # not implemented yet self...
3
3
tests/timetools_test.py
ziotom78/stripsim
0
12776165
<reponame>ziotom78/stripsim #!/usr/bin/env python3 # -*- encoding: utf-8 -*- import unittest as ut import os.path import stripeline.timetools as tt import numpy as np class TestTimeTools(ut.TestCase): def testSplitTimeRangeSimple(self): '''Test split_time_range against a very simple input''' re...
2.5
2
Python/loop4.py
AungWinnHtut/CStutorial
0
12776166
<filename>Python/loop4.py # loop3 userinput = input("Enter a letter in the range A - C : ") while (userinput != "A") and (userinput != "a") and (userinput != "B") and (userinput != "b") and (userinput != "C") and (userinput != "c"): userinput = input("Enter a letter in the range A-C : ")
3.78125
4
bleurt/score_test.py
yongchanghao/bleurt
416
12776167
<reponame>yongchanghao/bleurt # coding=utf-8 # Copyright 2018 The Google AI Language Team 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/LICEN...
2.1875
2
qa/rpc-tests/preciousblock.py
jeffontenot/bitcoin
0
12776168
#!/usr/bin/env python2 # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test PreciousBlock code # from test_framework.test_framework import BitcoinTestFramework from test_framew...
2.375
2
pyTMD/model.py
tsutterley/pyTMD
47
12776169
#!/usr/bin/env python u""" model.py Written by <NAME> (09/2021) Retrieves tide model parameters for named tide models and from model definition files UPDATE HISTORY: Written 09/2021 """ import os import re import io import copy class model: """Retrieves tide model parameters for named models or from a...
2.796875
3
src/normalisr/normalisr.py
lingfeiwang/normalisr
9
12776170
#!/usr/bin/python3 from .qc import qc_reads, qc_outlier from .lcpm import lcpm, scaling_factor from .norm import normcov, compute_var, normvar from .de import de from .coex import coex from .binnet import binnet from .gocovt import gotop, pccovt assert __name__ != "__main__"
1.195313
1
src/hyphenator.py
AntiCompositeNumber/maplink-generator
2
12776171
#!/usr/bin/env python3 # coding: utf-8 # SPDX-License-Identifier: Apache-2.0 # Copyright 2021 AntiCompositeNumber # 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/l...
2.5
2
Scripts/1. Data collection/4.1_tag_count.py
NAIST-SE/Package_management_system
1
12776172
# -*- coding: utf-8 -*- """ Created on Tue Jan 28 15:53:15 2020 @author: syful """ import xml.etree.ElementTree as et import re import pandas as pd from datetime import datetime start = datetime.now() from tqdm.auto import tqdm import numpy as np from collections import Counter import os #Please specify your dataset...
2.65625
3
thefarm/daylight/daylight.py
harmsm/thefarm
0
12776173
<gh_stars>0 __description__ = \ """ To change servers, make a subclass of DaylightServer and re-define the _grab_from_server method. """ __date__ = "2017-04-12" __author__ = "<NAME> (<EMAIL>)" import urllib.request, json from datetime import datetime import logging, os class DaylightException(Exception): """ ...
2.984375
3
pwtools/test/test_extend_array.py
elcorto/pwtools
41
12776174
import numpy as np import os from pwtools import num, common rand = np.random.rand def equal(a,b): assert (a == b).all() def test_extend_array(): arr = rand(3,3) nrep = 5 a0 = num.extend_array(arr, nrep, axis=0) a1 = num.extend_array(arr, nrep, axis=1) a2 = num.extend_array(arr, nrep, axis=2) ...
2.953125
3
docs/GNIB.py
naitao/SEProject_Group18
0
12776175
<gh_stars>0 #!/usr/bin/python from selenium import webdriver from selenium.webdriver.common.by import By from selenium.common.exceptions import TimeoutException from selenium.webdriver.support.ui import WebDriverWait # available since 2.4.0 from selenium.webdriver.support import expected_conditions as EC # available si...
2.421875
2
courses/python/cursoemvideo/exercicios/ex046.py
bdpcampos/public
3
12776176
import time for i in range(10, -1, -1): print(i) time.sleep(1) print('FOGOSSSSSSSSS!!!!!!!!! \o/ \o/ \o/ \o/ ')
2.9375
3
main/urls.py
rajeshgupta14/pathscriptfinal
0
12776177
<gh_stars>0 """mysite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home...
2.625
3
Day-6/problem1.py
sanjusci/10-Days-of-Statistics
1
12776178
# Day 6: The Central Limit Theorem I # Enter your code here. Read input from STDIN. Print output to STDOUT __author__ = "<NAME>" __email__ = "<EMAIL>" __copyright__ = "Copyright 2019" import math class Day6(object): e = 2.71829 def __init__(self): pass # Define functions def the_central...
3.71875
4
keras_text_cls/embedding/word2vec_embedder.py
titicaca/keras-text-cls
3
12776179
import logging import numpy as np from keras_text_cls.embedding.base_embedder import BaseEmbedder from keras_text_cls.vocab import Vocabulary, SYMBOL_PADDING, SYMBOL_UNKNOWN from gensim.models.word2vec import Word2Vec class Word2vecEmbedder(BaseEmbedder): """ Word2vec Embedder is a wrapper of gensim word2vec ...
3.171875
3
net/pacemaker1/files/extra-patch-cts_remote.py
egypcio/freebsd-ports
7
12776180
--- cts/remote.py.orig 2020-02-07 14:06:22 UTC +++ cts/remote.py @@ -125,7 +125,7 @@ class RemoteExec: ''' def __init__(self, rsh, silent=False): - self.async = [] + self.async_calls = [] self.rsh = rsh self.silent = silent self.logger = LogFactory()
1.570313
2
bridges/data_src_dependent/song.py
krs-world/bridges-python
1
12776181
class Song: """ @brief A Song object, used along with the Songs data source. This is a convenience class provided for users who wish to use this data source as part of their application. It provides an API that makes it easy to access the attributes of this data set. This object is generally...
3.4375
3
references/nlp_dicts.py
derpyninja/nlp4cciwr
0
12776182
<gh_stars>0 # -*- coding: utf-8 -*- from collections import OrderedDict # set: unordered collections of unique elements (no duplicates possible) stopwords_bbc_monitoring = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", ...
2.171875
2
app/ui/files_list_dialog.py
Deteriorator/GUI-YouGet
85
12776183
<filename>app/ui/files_list_dialog.py<gh_stars>10-100 # !/usr/bin/env python3 # -*- coding: utf-8 -*- from PyQt5.QtGui import QIcon from app.ui.ui_files_list_dialog import Ui_FilesListDialog from app import mlog, mconfig from app.util import status from app.util.download_thread import DownloadThread from PyQt5.QtWidge...
2.28125
2
titanic/titanic.py
cjporteo/kaggle-competitions
0
12776184
<filename>titanic/titanic.py import warnings warnings.filterwarnings('ignore') import pandas as pd import numpy as np pd.set_option('display.max_rows', 5000) pd.set_option('display.max_columns', 5000) from collections import Counter, defaultdict from scipy.stats import skew from scipy.special import boxcox1p from...
3.296875
3
examples/10-customer-payment-history.py
bryanwills/mollie-api-python
95
12776185
<filename>examples/10-customer-payment-history.py<gh_stars>10-100 # Example: Retrieving the payment history for a customer # import os import flask from mollie.api.client import Client from mollie.api.error import Error def main(): try: # # Initialize the Mollie API library with your API key. ...
3.046875
3
src/final_work/image_converter.py
mi-sts/spbu_python_homeworks
0
12776186
import typing import torch import torchvision import numpy as np from PIL import Image from torch.autograd import Variable from src.final_work.transformer import Transformer from enum import Enum class ModelType(Enum): HOSODA = "hosoda_mamoru" KON = "kon_satoshi" MIYAZAKI = "miyazaki_hayao" SHINKAI = ...
2.578125
3
midastools/misc/create_mip.py
lab-midas/toolbox
3
12776187
<gh_stars>1-10 import SimpleITK as sitk import argparse from pathlib import Path import matplotlib.pyplot as plt def main(): print("NIFI-image information") parser = argparse.ArgumentParser() parser.add_argument('--nii', help='image .nii file') args = parser.parse_args() nii_file = vars(args)['ni...
2.65625
3
save/MacroFuegoRunsList.py
tbird20d/fserver
0
12776188
<reponame>tbird20d/fserver """ MacroFuegoRunList - show a list of test runs """ import os def main(req, args=""): full_dirlist = os.listdir(req.config.files_dir+os.sep+"runs") full_dirlist.sort() # each run is it's own directory dirlist = full_dirlist # FIXTHIS - look for test run json file if not dirl...
2.46875
2
alphamind/portfolio/meanvariancebuilder.py
rongliang-tech/alpha-mind
186
12776189
# -*- coding: utf-8 -*- """ Created on 2017-6-27 @author: cheng.li """ from typing import Dict from typing import Optional from typing import Tuple from typing import Union import numpy as np from alphamind.portfolio.optimizers import ( QuadraticOptimizer, TargetVolOptimizer ) from alphamind.exceptions.excep...
2.375
2
run.py
icdlvru2021/project1-ai
0
12776190
import pacman import autograder """ run.py runs things that look like command-line arguments for Berkeley Python. Leave the 'python pacman.py' part at the beginning, just like running from the command line. You should comment out all lines in the file except the one you wan to run! """ #pacman.main('python pacman.py...
2.8125
3
src/dataset/vctk_dataset.py
antic11d/neural-compression
0
12776191
<reponame>antic11d/neural-compression<gh_stars>0 from torch.utils.data import Dataset import pickle import os import numpy as np class VCTKFeaturesDataset(Dataset): def __init__( self, vctk_path, subdirectory, normalizer=None, features_path="features" ): self._vctk_path = vctk_path sel...
2.359375
2
tests/unit/test_ikonos_image.py
DigitalGlobe/gbdxtools
81
12776192
<gh_stars>10-100 ''' Authors: <NAME>, <NAME> Contact: <EMAIL> Unit tests for the gbdxtools.Idaho class ''' from gbdxtools import IkonosImage, CatalogImage import vcr import unittest from helpers import mockable_interface, gbdx_vcr class GE01ImageTest(unittest.TestCase): @classmethod def setUpClass(cls): ...
1.9375
2
deep-insight/deepinsight/topo.py
opennetworkinglab/sdfabric-utils
2
12776193
# SPDX-FileCopyrightText: Copyright 2021-present Open Networking Foundation. # SPDX-License-Identifier: Apache-2.0 import ipaddress import logging import re from collections import Counter, defaultdict import kubernetes as k8s import requests from netaddr import IPAddress log = logging.getLogger("DeepInsightTopoUtil...
2.40625
2
ressources/constant.py
Jouca/Horse-Game
0
12776194
<gh_stars>0 COLOR = { 'ORANGE': (255, 121, 0), 'LIGHT_YELLOW': (255, 230, 130), 'YELLOW': (255, 204, 0), 'LIGHT_BLUE': (148, 228, 228), 'BLUE': (51, 204, 204), 'LIGHT_RED': (255, 136, 106), 'RED': (255, 51, 0), 'LIGHT_GREEN': (206, 255, 60), 'GREEN': (153, 204, 0), 'CYAN': (0, 15...
1.8125
2
dash_echarts/examples/line_race.py
Covarians/dash-echarts
28
12776195
import json import datetime, time from os import path import dash import dash_echarts import dash_html_components as html import dash_core_components as dcc import dash_bootstrap_components as dbc from dash.dependencies import Input, Output, State from dash.exceptions import PreventUpdate basepath = path.dirname(__fil...
2.453125
2
src/promotion/register_model.py
AHaryanto/azure-automl-mlops
16
12776196
import os import sys from azureml.core.model import Model sys.path.append(os.getcwd()) import config as f # noqa: E402 model_name = f.params["registered_model_name"] if f.params['remote_run'] is True: model_path = os.environ['MODEL_PATH'] elif f.params['remote_run'] is False: model_path = os.path.join('mod...
2.28125
2
test/unit/test_resource_manager_v2.py
gmzcarlos/platform-services-python-sdk
0
12776197
<reponame>gmzcarlos/platform-services-python-sdk<filename>test/unit/test_resource_manager_v2.py<gh_stars>0 # -*- coding: utf-8 -*- # (C) Copyright IBM Corp. 2020. # # 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 cop...
2.09375
2
code_sender/rstudio/__init__.py
fredcallaway/SendCode
177
12776198
import sublime import os from ..clipboard import clipboard plat = sublime.platform() if plat == "osx": from ..applescript import osascript RSTUDIOAPPLESCRIPT = os.path.join(os.path.dirname(__file__), "rstudio.applescript") def send_to_rstudio(cmd): osascript(RSTUDIOAPPLESCRIPT, cmd) elif plat =...
2.40625
2
webvep/webvep_api/urls.py
IanVermes/vep_api
0
12776199
from django.urls import path, include from rest_framework.urlpatterns import format_suffix_patterns from webvep_api.views import ping_view, vcf_view, vep_view urlpatterns = [path("ping/", ping_view), path("vcf/", vcf_view), path("vep/", vep_view)] urlpatterns = format_suffix_patterns(urlpatterns)
1.890625
2
leetcode/0944_delete_columns_to_make_sorted.py
jacquerie/leetcode
3
12776200
# -*- coding: utf-8 -*- class Solution: def minDeletionSize(self, A): return len([col for col in zip(*A) if col != tuple(sorted(col))]) if __name__ == '__main__': solution = Solution() assert 1 == solution.minDeletionSize(['cba', 'daf', 'ghi']) assert 0 == solution.minDeletionSize(['a', 'b'...
2.9375
3
Experiments/partialopt.py
robot0321/learnit_exp
0
12776201
<filename>Experiments/partialopt.py import os os.environ['CUDA_VISIBLE_DEVICES'] = '5' os.environ['XLA_PYTHON_CLIENT_PREALLOCATE'] = 'false' checkpoint_dir = 'checkpoints/checkpoints_shapene/' from functools import partial import jax # jax==0.1.67 / jaxlib==0.1.55 from jax import random, grad, jit, vmap, flatten_util,...
1.78125
2
opensdraw/lcad_language/lexerParser.py
HazenBabcock/openldraw
9
12776202
<gh_stars>1-10 #!/usr/bin/env python # # Lexer, Parser and abstract syntax tree model for lcad. Much of # inspiration for this comes from the lexer / parser in the hy # project: # # https://github.com/hylang/hy/tree/master/hy/lex # # Hazen 07/14 # from functools import wraps # Lexer. from rply import LexerGenerator ...
2.71875
3
plugins/tests/papermilltests/test_spark_notebook.py
slai/flytekit
1
12776203
import os from flytekitplugins.papermill import NotebookTask from flytekitplugins.spark import Spark from flytekit import kwtypes from flytekit.types.schema import FlyteSchema def _get_nb_path(name: str, suffix: str = "", abs: bool = True, ext: str = ".ipynb") -> str: """ Creates a correct path no matter wh...
2
2
docker/api/swarm.py
rsumner31/docker-py
0
12776204
import logging from six.moves import http_client from .. import utils log = logging.getLogger(__name__) class SwarmApiMixin(object): def create_swarm_spec(self, *args, **kwargs): return utils.SwarmSpec(*args, **kwargs) @utils.minimum_version('1.24') def init_swarm(self, advertise_addr=None, list...
2.046875
2
rel-eng/custom/custom.py
ehelms/foreman-packaging
0
12776205
<reponame>ehelms/foreman-packaging # Copyright (c) 2008-2014 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPO...
2.109375
2
scripts/launch_image.py
rf972/lisa-qemu
2
12776206
<reponame>rf972/lisa-qemu<filename>scripts/launch_image.py # # Copyright 2020 Linaro # # Launches an image created via build_image.py. # import build_image if __name__ == "__main__": inst_obj = build_image.BuildImage(ssh=True) inst_obj.run()
1.546875
2
custom_auth/custom_login/my_user_manager.py
farhadmpr/DjangoMobileLogin
0
12776207
<reponame>farhadmpr/DjangoMobileLogin<filename>custom_auth/custom_login/my_user_manager.py from django.contrib.auth.base_user import BaseUserManager class MyUserManager(BaseUserManager): def create_user(self, mobile, password=<PASSWORD>, **other_fields): if not mobile: raise ValueError('mobile...
2.421875
2
test/test_products.py
sdtaylor/pyUpackQA
2
12776208
import pytest import numpy as np from unpackqa import (unpack_to_array, unpack_to_dict, list_products, list_qa_flags, list_sensors, ) from unpackqa.tools.validation import (product_info_has_require...
2.578125
3
DESAFIO-012.py
Lukones/Evolution-Projetos-Python
0
12776209
# Um programa que resolve a hipotenusa # from math import hypot co = float(input('Comprimento do cateto opsoto: ')) ca = float(input('Comprimento do cateto adjacente: ')) print(f'A hipotenusa vai medir: {hypot(co, ca):.2f}')
3.703125
4
cryptography/the_var/__init__.py
JASTYN/pythonmaster
3
12776210
def the_var(var): n = [ord(i) - 96 for i in var.split("+")] return sum(n)
2.65625
3
view/web.py
jvpersuhn/Certo
0
12776211
import sys sys.path.append("C:/Users/900143/Desktop/Certo") from controller.squad_controller import BackController, FrontController,SGBDController , SquadController, BackEnd, FrontEnd, SGBD, Squad from flask import Flask, render_template, request, redirect app = Flask(__name__) bc = BackController() fc = FrontContro...
2.28125
2
numerical/splines/__init__.py
shaxov/scikit-numerical
3
12776212
<gh_stars>1-10 from .definitions import ( linear, schoenberg, ) __all__ = ['linear', 'schoenberg']
1.0625
1
collipa/controllers/reply.py
ywmmmw/collipa
99
12776213
<reponame>ywmmmw/collipa # coding: utf-8 import tornado.web from ._base import BaseHandler from pony import orm from .user import EmailMixin from collipa.models import Topic, Reply from collipa.forms import ReplyForm from collipa.libs.decorators import require_permission from collipa import config class HomeHandle...
2
2
src/main/python/monocyte/handler/rds2.py
claytonbrown/aws-monocyte
20
12776214
<gh_stars>10-100 # Monocyte - Search and Destroy unwanted AWS Resources relentlessly. # Copyright 2015 Immobilien Scout GmbH # # 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....
2.015625
2
server/main.py
gtluu/timsconvert
3
12776215
# main.py from app import app import views if __name__ == '__main__': app.run(host='0.0.0.0',port='5000')
1.578125
2
lino/core/site.py
khchine5/lino
1
12776216
# -*- coding: UTF-8 -*- # Copyright 2009-2018 <NAME>. # License: BSD, see LICENSE for more details. # doctest lino/core/site.py """ Defines the :class:`Site` class. For an overview see :doc:`/dev/site` and :doc:`/dev/plugins`. .. doctest init: >>> import lino >>> lino.startup('lino.projects.std.settings_test...
2.046875
2
tools/generate-readme.py
adamsqi/python-scripts
1
12776217
__author__ = '[<NAME>](https://github.com/adamsqi)' __date__ = '2020.06.21' """ This is a script for auto generation of README.md content. The script parses all .py script files within the repository and creates a README.md file. Inspired by: [<NAME>](https://github.com/bamos/python-scripts/blob/master/README.md) ""...
2.203125
2
ch06/ch0602_recurrent_neural_network.py
zhuyuanxiang/deep-learning-with-python-notebooks
6
12776218
# -*- encoding: utf-8 -*- """ @Author : zYx.Tom @Contact : <EMAIL> @site : https://zhuyuanxiang.github.io --------------------------- @Software : PyCharm @Project : deep-learning-with-python-notebooks @File : ch0602_recurrent_neural_network.py @Version : v0.1 @Time : ...
2.21875
2
Problems/String/71. Simplify Path.py
BYJRK/LeetCode-Solutions
0
12776219
# https://leetcode.com/problems/simplify-path/ class Solution: def simplifyPath(self, path: str) -> str: stack = [] for d in path.split('/'): if d == '..': if len(stack) > 0: stack.pop() elif d == '.' or d == '': continue ...
3.671875
4
autodrp/utils.py
rcj0003/django-autodrp
1
12776220
<filename>autodrp/utils.py from django.db.models.signals import class_prepared from django.dispatch import receiver ALWAYS_TRUE = lambda *args, **kwargs: True class CheckPermissions: def __init__(self, *checks): self.checks = checks def __call__(self, request): for permission in self.chec...
2.234375
2
Classes/QAData.py
usgsdsm/qrevpy
0
12776221
import numpy as np from Classes.Uncertainty import Uncertainty from Classes.QComp import QComp class QAData(object): """Evaluates and stores quality assurance characteristics and messages. Attributes ---------- q_run_threshold_caution: int Caution threshold for interpolated discharge for a ru...
2.75
3
readimc/_txt_file.py
BodenmillerGroup/readimc
0
12776222
<filename>readimc/_txt_file.py import numpy as np import pandas as pd import re from os import PathLike from typing import BinaryIO, List, Optional, Sequence, Tuple, Union from ._imc_file import IMCFile from .data import AcquisitionBase class TXTFile(IMCFile, AcquisitionBase): _CHANNEL_REGEX = re.compile( ...
2.640625
3
src/video_player_test.py
Joao-Nogueira-gh/video-compressin
0
12776223
## @brief # Module for testing of the VideoPlayer class # from VideoPlayer import * import sys if __name__ == "__main__": if len(sys.argv)!=2: print('\nUsage: python3 video_player_test.py <frameNumber>\n\nframeNumber->Number of video frames to play OR \'all\' for all frames in video\n\nWarning: Higher nu...
3.25
3
migrations/sqlite_versions/2020-07-10_b7fc1ab24c92_add_checkconstraints_for_non_nullable_.py
debrief/pepys-import
4
12776224
"""Add CheckConstraints for non-nullable string cols Revision ID: b7fc1ab24c92 Revises: <PASSWORD> Create Date: 2020-07-10 13:24:56.007611 """ from datetime import datetime from uuid import uuid4 from alembic import op from geoalchemy2 import Geometry from sqlalchemy import DATE, Column, DateTime, ForeignKey, Intege...
1.867188
2
castellan/common/objects/key.py
vakwetu/castellan
0
12776225
# Copyright (c) 2015 The Johns Hopkins University/Applied Physics Laboratory # 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/...
3.015625
3
play.py
davidschulte/alpha-thesis
0
12776226
from utils import * from chinese_checkers.TinyChineseCheckersGame import ChineseCheckersGame from chinese_checkers.tensorflow.ResNet import NNetWrapper as nn from chinese_checkers.Evaluator import Evaluator from MCTS import MCTS from chinese_checkers.InitializeAgent import InitializeAgent from chinese_checkers.GreedyAg...
2
2
utils/load_custom_datasets.py
chansoopark98/MobileNet-SSD
2
12776227
from tensorflow.keras.utils import Sequence import os import pandas as pd import random import numpy as np class DataGenerator(Sequence): def __init__(self, path_args, batch_size: int, shuffle: bool, mode: str): self.x_img_path = './train...
2.796875
3
evennia_extensions/character_extensions/storage_wrappers.py
dvoraen/arxcode
42
12776228
from evennia_extensions.object_extensions.storage_wrappers import StorageWrapper class RosterEntryWrapper(StorageWrapper): def get_storage(self, instance): return instance.obj.roster def create_new_storage(self, instance): raise AttributeError("This object does not have a RosterEntry to store...
2.6875
3
tests/unit/test_translator.py
flatironhealth/aws-remediation-framework
22
12776229
import sys import os from importlib import reload from nose.tools import assert_equal, assert_true, assert_false from unittest import TestCase, mock from unittest.mock import MagicMock from resources.event_translator.main import translate_event class TestTranslator(TestCase): def test_sqs_SetQueueAttributes_tra...
2.28125
2
blog/views/user.py
maxis1314/pyutils
2
12776230
# coding: utf-8 from flask import Flask,request,session,g,redirect,url_for,Blueprint from flask import abort,render_template,flash from helpers import getAvatar import config #from .base import BaseHandler import base config = config.rec() user = Blueprint('user', __name__) #class LoginHandler(BaseHandler): @user....
2.3125
2
lesson16n3_projects/wcsc/auto_gen/code/states1/reply_agree.py
muzudho/py-state-machine-practice
0
12776231
class ReplyAgreeState(): def update(self, req): # TODO 入力 msg = "" # 分岐 if msg == 'start': return ['Game'] else: raise ValueError("Unexpected condition")
2.609375
3
display-patterns/Hierarchies/Pruebas/A62Tree_Map_Matplotlib.py
cimat/data-visualization-patterns
9
12776232
<reponame>cimat/data-visualization-patterns<gh_stars>1-10 import pylab import random import matplotlib.pyplot as plt from matplotlib.patches import Rectangle class Treemap: def __init__(self, tree, iter_method, size_method, color_method): self.ax = pylab.subplot(111,aspect='equal') pylab.su...
3.03125
3
service2/application/routes.py
K1610174/Multi-service-QA-SFIA2
0
12776233
<reponame>K1610174/Multi-service-QA-SFIA2 from flask import redirect, url_for, Response, request from application import app import requests import random @app.route('/') @app.route('/color', methods=['GET']) def color(): color_list=["red","orange","yellow","green","blue","indigo","violet","ivory","gray","black","...
2.796875
3
Python/ad63.py
AungWinnHtut/CStutorial
0
12776234
# Guess password and output the score chocolate = 2 playerlives = 1 playername = "Aung" # this loop clears the screen for i in range(1, 35): print() bonus = 0 numbercorrect = 0 # the player must try to guess the password print("Now you must ener each letter that you remember ") print("You will be given 3 times")...
4.125
4
startleft/config/paths.py
iriusrisk/startleft
9
12776235
import os default_cf_mapping_files = [os.path.dirname(__file__) + '/default-cloudformation-mapping.yaml']
1.304688
1
2_writeups/3_robot_exploitation/tutorial7/example5.py
araujorayza/robot_hacking_manual
141
12776236
#!/usr/bin/env python from pwn import * import os # Exploiting vulnerable code narnia1.c: # # #include <stdio.h> # # int main(){ # int (*ret)(); # # if(getenv("EGG")==NULL){ # printf("Give me something to execute at the env-variable EGG\n"); # exit(1); # } # # printf("Trying to execute EGG!\n"); # ret = geten...
2.84375
3
utils/georeferencer.py
DominikSpiljak/gis-backend
0
12776237
from geopy.geocoders import ArcGIS import pyproj class Georeferencer: def __init__(self, crs): self.georeferencer = ArcGIS() self.transformer = pyproj.Transformer.from_crs("EPSG:4326", f"EPSG:{crs}") def georeference(self, addresses): result = {} for address in addresses: ...
3.171875
3
metaflow/plugins/aws/aws_utils.py
Netflix/metaflow
5,821
12776238
<gh_stars>1000+ import re def get_docker_registry(image_uri): """ Explanation: (.+?(?:[:.].+?)\/)? - [GROUP 0] REGISTRY .+? - A registry must start with at least one character (?:[:.].+?)\/ - A registry must have ":" or "." and end with "/" ? ...
2.90625
3
tests/test_hashlib_scrypt.py
isabella232/pynacl
0
12776239
# Copyright 2013 <NAME> and individual contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
1.625
2
textx/scoping/__init__.py
stanislaw/textX
346
12776240
<reponame>stanislaw/textX ####################################################################### # Name: scoping.__init__.py # Purpose: Meta-model / scope providers. # Author: <NAME> # License: MIT License ####################################################################### import glob import os import errno from ...
2.3125
2
python/runtime/pai/cluster_conf.py
lhw362950217/sqlflow
2
12776241
<gh_stars>1-10 # Copyright 2020 The SQLFlow 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/licenses/LICENSE-2.0 # # Unless required by a...
2.015625
2
tests/integration/client_test.py
superdosh/betterreads
0
12776242
"""Client is the primary interface for interacting with the Goodreads API. This integration test makes live API calls and affirms that the correct objects are being returned. For a more comprehensive test that each of the interface objects is created and functions properly when given the correct inputs, check the unit ...
2.625
3
src/services/middleware/workers_io.py
www439198341/V2RayCloudSpider
0
12776243
# -*- coding: utf-8 -*- # Time : 2021/12/22 16:15 # Author : QIN2DIM # Github : https://github.com/QIN2DIM # Description: import ast from datetime import timedelta, datetime from typing import List, Optional, Union from redis.exceptions import ConnectionError, ResponseError from services.middleware.stre...
2.359375
2
datahub/core/test/test_reversion.py
Staberinde/data-hub-api
6
12776244
<filename>datahub/core/test/test_reversion.py<gh_stars>1-10 from unittest import mock import pytest from datahub.core.reversion import EXCLUDED_BASE_MODEL_FIELDS, register_base_model class TestRegisterBaseModel: """Tests for the `register_base_model` decorator.""" @mock.patch('datahub.core.reversion.revers...
2.75
3
backend/base/urls/order_urls.py
sasan-sohrabi/proshop-DjangoReact
0
12776245
from django.urls import path from base.views import order_views as views urlpatterns = [ ]
1.179688
1
knap_spo_relax.py
Patyrn/Divide-and-Learn
0
12776246
from Experiments import test_knapsack_SPO_unit, test_knapsack_SPO """ Example SPO-Relax experiments for knapsack benchmarks. Dependencies: gcc/8.3.0 openmpi/3.1.4 python/3.7.4 scikit-learn/0.23.1-python-3.7.4 gurobi/9.0.0 numpy/1.17.3-python-3.7.4 matplotlib/3.2.1-python-3.7.4 """ capacities = [12,24,48,72,96,120,144,...
2.109375
2
OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/NV/transform_feedback.py
JE-Chen/je_old_repo
0
12776247
<gh_stars>0 '''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GL import _types as _cs # End users want this... from OpenGL.raw.GL._types import * from OpenGL.raw.GL import _errors from OpenGL.constant import Constant as ...
1.398438
1
tests/conftest.py
f213/richtypo.py
9
12776248
<gh_stars>1-10 def pytest_generate_tests(metafunc): """ Generate tests for ruledefs in yaml files according to their specs defined in-place """ if 'rule_name' in metafunc.fixturenames: from richtypo.rules import load_from_file rules = [] for ruledef in ['generic', 'ru', 'en']: ...
2.34375
2
datasets/__init__.py
jonasvj/TFDE
0
12776249
root = 'data/' import numpy as np from ffjord.datasets.power import POWER from ffjord.datasets.gas import GAS from ffjord.datasets.hepmass import HEPMASS from ffjord.datasets.miniboone import MINIBOONE from ffjord.datasets.bsds300 import BSDS300 from .synthetic import EightGaussians from .synthetic import Checkerboard...
2.109375
2
museos/webapp/migrations/0001_initial.py
LopezAlonsoVictor/X-Serv-Practica-Museos
0
12776250
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.utils.timezone import utc import datetime from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL...
1.757813
2