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
azure-mgmt-web/azure/mgmt/web/operations/diagnostics_operations.py
JonathanGailliez/azure-sdk-for-python
1
14900
<reponame>JonathanGailliez/azure-sdk-for-python # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by M...
1.90625
2
Dataset/Leetcode/valid/98/736.py
kkcookies99/UAST
0
14901
<reponame>kkcookies99/UAST class Solution: def XXX(self, root: TreeNode) -> bool: stack = [] cur = root last = float("-inf") while cur or stack: while cur: stack.append(cur) cur = cur.left cur = stack.pop() if cur.v...
3.078125
3
data/ck/check_data.py
jorgimello/meta-learning-fer
4
14902
<reponame>jorgimello/meta-learning-fer<gh_stars>1-10 import numpy as np import os, cv2 imgs = np.load('test_set_ck_extended_no_resize.npy') lbls = np.load('test_labels_ck_extended_no_resize.npy') for i in range(imgs.shape[0]): print (lbls[i]) cv2.imshow('img', imgs[i]) cv2.waitKey(0)
2.515625
3
app/db/schemas/users.py
ergo-pad/paideia-api
0
14903
<filename>app/db/schemas/users.py from pydantic import BaseModel import typing as t ### SCHEMAS FOR USERS ### class UserBase(BaseModel): alias: str primary_wallet_address_id: t.Optional[int] profile_img_url: t.Optional[str] is_active: bool = True is_superuser: bool = False class UserOut(UserBa...
2.484375
2
custom_components/discord_game/sensor.py
Myztillx/discord_game
0
14904
<gh_stars>0 import asyncio import json import logging import re import homeassistant.helpers.config_validation as cv import voluptuous as vol from discord import ActivityType, Spotify, Game, Streaming, CustomActivity, Activity, Member, User from homeassistant.components.notify import PLATFORM_SCHEMA from homeassistant...
2.0625
2
Mundo 1/ex_014.py
Shock3/Python_Exercicios
0
14905
""" Escreva um programa que converta uma temperatura, digitando em graus Celsius e converta para graus Fahrenheit. """ celsius = int(input('Digite a temperatura: ')) fahrenheit = (celsius / 5) * 9 + 32 Kelvin = celsius + 273 print(f'A temperatura {celsius}°C em Fahrenheit é {fahrenheit}°F') print(f'E em Kevin fica {Kel...
4.21875
4
opensecrets/__init__.py
ndanielsen/py-opensecrets
1
14906
<reponame>ndanielsen/py-opensecrets<filename>opensecrets/__init__.py from .crpapi import CRP
1.085938
1
fumblr/services/imgur.py
jonoco/fumblr
2
14907
<gh_stars>1-10 from fumblr.keys import IMGUR_SECRET, IMGUR_ID from imgurpython import ImgurClient, helpers import os import base64 API_URL = 'https://api.imgur.com/3/' def get_client(): """ Get an API client for Imgur Returns: Imgur client if it is available """ try: return Imgur...
2.703125
3
source/src/molecular-unfolding/lambda/AthenaTableLambda/app.py
awslabs/quantum-ready-solution-for-drug-discovery
10
14908
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 import boto3 import botocore import os import logging import time import json import datetime log = logging.getLogger() log.setLevel('INFO') bucket = os.environ['BUCKET'] region = os.environ['AWS_REGION'] solu...
1.765625
2
osf/management/commands/populate_custom_taxonomies.py
gaybro8777/osf.io
628
14909
import json import logging from django.core.management.base import BaseCommand from django.db import transaction from osf.models import AbstractProvider, PreprintProvider, Preprint, Subject from osf.models.provider import rules_to_subjects from scripts import utils as script_utils from osf.models.validators import va...
1.921875
2
examples/animated_rsh.py
sophiaas/e3nn
1
14910
<gh_stars>1-10 # pylint: disable=not-callable, no-member, invalid-name, missing-docstring, line-too-long import math import os import subprocess import argparse import shutil import tqdm import plotly.graph_objs as go import torch from e3nn import o3, rsh def rsh_surface(l, m, scale, tr, rot): n = 50 a = to...
2.09375
2
errores.py
fbzavaleta/DS_Software_Stack
0
14911
# E_LEN = "No es posible operar vectores de diferente módulo"
1.09375
1
dataset.py
gzaraunitn/TA3N
0
14912
import torch.utils.data as data import os import os.path import numpy as np from numpy.random import randint import torch from colorama import init from colorama import Fore, Back, Style import random from os import listdir from os.path import join, splitext import numpy as np import torch import torch.nn.functiona...
2.125
2
edm_web1/middleware/errors.py
zhouli121018/nodejsgm
0
14913
# -*- coding: utf-8 -*- from django.http import HttpResponseForbidden from django.template import loader from django.utils.translation import ugettext_lazy as _ # 普通用户 def _requred_forbid(msg): t = loader.get_template('limit_ip.html') content = t.render({'message': msg }) return HttpResponseForbidden(cont...
1.953125
2
data/windows/dr16/mask.py
dnidever/apogee
5
14914
<filename>data/windows/dr16/mask.py from apogee.aspcap import aspcap from apogee.aspcap import mask els=aspcap.elems() for el in els[0]: mask.mkmask(el,globalmask='mask_v02_aspcap.txt')
2.09375
2
dragonfly/opt/unittest_cp_random_multiobjective_optimiser.py
anonymous-submission000/mobo
1
14915
<reponame>anonymous-submission000/mobo """ Unit tests for Random CP optimiser on Cartesian product domains. -- <EMAIL> """ # pylint: disable=invalid-name # pylint: disable=abstract-class-little-used import os from . import random_multiobjective_optimiser from ..exd.cp_domain_utils import get_raw_point_from_proc...
2
2
corehq/apps/app_manager/app_schemas/casedb_schema.py
dimagilg/commcare-hq
1
14916
<filename>corehq/apps/app_manager/app_schemas/casedb_schema.py from corehq import toggles from corehq.apps.app_manager.app_schemas.case_properties import ( ParentCasePropertyBuilder, get_usercase_properties, ) from corehq.apps.app_manager.const import USERCASE_TYPE from corehq.apps.app_manager.util import is_us...
1.78125
2
python/testData/keywordCompletion/noMatchInCondition.py
06needhamt/intellij-community
0
14917
<gh_stars>0 matches = True if mat<caret>
1.148438
1
bookshelf/bookshelf/model_aerospike.py
fakeskimo/as2bt
0
14918
import math import aerospike from aerospike import predicates as p from aerospike import exception as ex from flask import current_app aerospike_host = current_app.config['AEROSPIKE_HOST'] aerospike_port = current_app.config['AEROSPIKE_PORT'] namespace = current_app.config['AEROSPIKE_NAMESPACE'] set_name = current_...
2.421875
2
examples/EC2.py
nimRobotics/fnirslib
0
14919
""" author: @nimrobotics description: calculates the effective connectivity between regions and plots them """ import numpy as np import scipy.io import glob import sys sys.path.append('../utils') from plots import plotData dir = "./process3/" #directory of the data outdir = 'process3/' #directory to save the plots r...
2.546875
3
feed/models.py
Lisgevan/DJANGO-101-PROJECT-COPY
0
14920
from django.db import models from sorl.thumbnail import ImageField # Create your models here. class Post(models.Model): text = models.CharField(max_length=140, blank=False, null=False) image = ImageField() def __str__(self): return self.text
2.328125
2
gcp/docker/infrastructure/rapids_lib.py
ethem-kinginthenorth/cloud-ml-examples
1
14921
<filename>gcp/docker/infrastructure/rapids_lib.py # os import sys, os, time, logging # CPU DS stack import pandas as pd import numpy as np import sklearn # GPU DS stack [ rapids ] import gcsfs # scaling library import dask # data ingestion [ CPU ] from pyarrow import orc as pyarrow_orc # ML models from sklearn imp...
2.015625
2
docs/making_widgets_from_scratch/line_clock.py
Rahuum/glooey
86
14922
#!/usr/bin/env python3 import pyglet import glooey import autoprop import datetime from pyglet.gl import * from vecrec import Vector, Rect @autoprop class LineClock(glooey.Widget): custom_radius = 50 custom_color = 'green' custom_hour_hand_width = 3 custom_minute_hand_width = 2 custom_second_hand_...
2.421875
2
forms_builder/forms/migrations/0004_auto_20180727_1256.py
maqmigh/django-forms-builder
0
14923
# coding=utf-8 # Generated by Django 2.0.7 on 2018-07-27 10:56 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('forms', '0003_auto_20180522_0820'), ] operations = [ migrations.AlterField( model_name='field', name=...
1.601563
2
scripts/sighan/generate.py
piglaker/SpecialEdition
2
14924
import os import re import sys import json #upper import sys.path.append("../../") from utils import levenshtein from utils.io import load_json, write_to def strQ2B(ustring): """全角转半角""" rstring = "" for uchar in ustring: inside_code=ord(uchar) if inside_code == 12288: ...
2.5625
3
keras_retinanet/backend/__init__.py
mj-haghighi/keras-retinanet
0
14925
<filename>keras_retinanet/backend/__init__.py # from .backend import * # noqa: F401,F403 from .sbackend import *
1.140625
1
docs/_docs/bash/az3166_patch_binary.py
skolbin-ssi/azure-iot-developer-kit
43
14926
<filename>docs/_docs/bash/az3166_patch_binary.py # ---------------------------------------------------------------------------- # Copyright (C) Microsoft. All rights reserved. # Licensed under the MIT license. # ---------------------------------------------------------------------------- import os import binascii im...
2.015625
2
setup.py
FireXStuff/firex-bundle-ci
1
14927
<gh_stars>1-10 import versioneer from setuptools import setup setup(name='firex-bundle-ci', version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), description='FireX CI services', url='https://github.com/FireXStuff/firex-bundle-ci.git', author='<NAME>', author_email='...
1.046875
1
meta_middleware/meta_middleware/middleware.py
kevin-wyx/ProxyFS
0
14928
# Copyright (c) 2016 SwiftStack, 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 w...
1.703125
2
distpy/util/__init__.py
CU-NESS/distpy
0
14929
<reponame>CU-NESS/distpy """ Introduces utilities used throughout the package, including: - interfaces for making objects `distpy.util.Savable.Savable` and `distpy.util.Loadable.Loadable` in binary hdf5 files using h5py - helper methods for using h5py to save and load variables and arrays (`h5py_extensions`) - typ...
2.015625
2
Crypto-hardRSA/flag.py
JSW2020/hsctf-2019-freshmen
16
14930
flag = "flag{b3453333-9da9-49ae-b4ed-0017c392d58e}" e1 = 65537 e2 = 368273
0.917969
1
toast/decorators/__init__.py
joshuaskelly/Toast
0
14931
<gh_stars>0 class call_if(object): def __init__(self, cond): self.condition = cond def __call__(self, func): def inner(*args, **kwargs): if getattr(args[0], self.condition): return func(*args, **kwargs) else: return None return inn...
3.015625
3
drogher/package/fedex.py
thisisnotmyuserid/drogher
13
14932
<filename>drogher/package/fedex.py import itertools from .base import Package class FedEx(Package): shipper = 'FedEx' class FedExExpress(FedEx): barcode_pattern = r'^\d{34}$' @property def tracking_number(self): return self.barcode[20:22].lstrip('0') + self.barcode[22:] @property ...
3.359375
3
nipy/labs/spatial_models/tests/test_bsa_io.py
arokem/nipy
0
14933
from __future__ import with_statement from nose.tools import assert_true from os.path import exists import numpy as np from nibabel import Nifti1Image from numpy.testing import assert_equal from ...utils.simul_multisubject_fmri_dataset import surrogate_3d_dataset from ..bsa_io import make_bsa_image from nibabel.tmpdirs...
2.046875
2
MFSDA/MFSDA_run.py
bpaniagua/MFSDA_Python
3
14934
<reponame>bpaniagua/MFSDA_Python<gh_stars>1-10 #!/usr/bin/env python-real # -*- coding: utf-8 -*- """ Run script: multivariate functional shape data analysis (MFSDA). Author: <NAME> (<EMAIL>) Last update: 2017-08-14 """ import sys,os sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)),os.path.joi...
2.109375
2
modules/mongodb_atlas/mongodb_atlas.py
riddopic/opta
595
14935
<filename>modules/mongodb_atlas/mongodb_atlas.py import os from typing import TYPE_CHECKING from modules.base import ModuleProcessor from opta.core.terraform import get_terraform_outputs from opta.exceptions import UserErrors if TYPE_CHECKING: from opta.layer import Layer from opta.module import Module clas...
2.046875
2
python/tests/testdata/region_HU.py
kevin-brown/python-phonenumbers
1
14936
<reponame>kevin-brown/python-phonenumbers """Auto-generated file, do not edit by hand. HU metadata""" from phonenumbers.phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_HU = PhoneMetadata(id='HU', country_code=36, international_prefix='00', general_desc=PhoneNumberDesc(national_numb...
2.28125
2
lambdas/budget-handler/lambda_handler.py
weAllWeGot/personal_financial_engine
2
14937
<filename>lambdas/budget-handler/lambda_handler.py<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- import boto3 import csv import json import logging from budget_retrieval import get_budget from budget_placement import place_budget def respond(err, res=None): return { 'statusCode': '400' if e...
2.28125
2
src/documenteer/stackdocs/doxygentag.py
lsst-sqre/sphinxkit
3
14938
"""Utilities for working with Doxygen tag files. """ __all__ = ["get_tag_entity_names"] import xml.etree.ElementTree as ET from pathlib import Path from typing import List, Optional, Sequence, Union try: from sphinxcontrib.doxylink import doxylink except ImportError: print( "sphinxcontrib.doxylink is...
2.359375
2
src/gamesbyexample/shellgame.py
skinzor/PythonStdioGames
1
14939
# Shell Game, by <NAME> <EMAIL> # A random gambling game. import random, time, sys print('''SHELL GAME By <NAME> <EMAIL> Try to find the diamond! Press Enter to continue...''') input() CUPS = ['diamond', 'pocket lint', 'nothing'] while True: print() print('Shuffling the cups', end='') random.shuffle(CU...
4.03125
4
main.py
mathew4STAR/GPT-3_based_AI
0
14940
import pyttsx3 import speech_recognition as sr import openai as op import os op.api_key = os.getenv("OPENAI_API_KEY") engine = pyttsx3.init() engine.setProperty('rate', 150) engine.setProperty('volume', 1.0) voices = engine.getProperty('voices') engine.setProperty('voice', voices[1].id) def tell(text): engine.s...
2.859375
3
sdk/python/pulumi_azure_native/compute/v20200930/_inputs.py
polivbr/pulumi-azure-native
0
14941
<filename>sdk/python/pulumi_azure_native/compute/v20200930/_inputs.py # coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mappi...
1.3125
1
bgp_adjacencies/BGP_check_job.py
KamyarZiabari/solutions_examples
59
14942
# To run the job: # pyats run job BGP_check_job.py --testbed-file <testbed_file.yaml> # Description: This job file checks that all BGP neighbors are in Established state import os # All run() must be inside a main function def main(runtime): # Find the location of the script in relation to the job file bgp_tes...
2.125
2
tvae/utils/logging.py
ReallyAnonNeurips2021/TopographicVAE
57
14943
import os def get_dirs(): cwd = os.path.dirname(os.path.realpath(__file__)) local_savedir = cwd local_datadir = cwd local_wandbdir = cwd return local_savedir, local_datadir, local_wandbdir def configure_logging(config, name, model): if config['wandb_on']: import wandb wandb...
2.21875
2
create_lesson_plan/admin.py
rishabhranawat/CrowdPlatform
1
14944
<filename>create_lesson_plan/admin.py from django.contrib import admin from create_lesson_plan.models import * admin.site.register(lesson) admin.site.register(lesson_plan) admin.site.register(Engage_Urls) admin.site.register(Explain_Urls) admin.site.register(Evaluate_Urls) admin.site.register(MCQ) admin.site.register(...
1.585938
2
src/models/modules/visual_bert_classifier.py
inzva/emotion-recognition-drawings
10
14945
import torch from torch import nn from transformers import BertTokenizer, VisualBertModel, VisualBertConfig import numpy as np class VisualBertClassifier(nn.Module): def __init__(self, visual_bert_model, num_classes: int = 8, initial_visual_embedding_dim: int = 9...
2.890625
3
narrative2vec/logging_instance/pose.py
code-iai/narrative2vec
0
14946
from narrative2vec.logging_instance.logging_instance import LoggingInstance, _get_first_rdf_query_result from narrative2vec.logging_instance.reasoning_task import ReasoningTask from narrative2vec.ontology.neemNarrativeDefinitions import QUATERNION from narrative2vec.ontology.ontologyHandler import get_knowrob_uri cla...
2.328125
2
kobra/settings/development.py
karservice/kobra
4
14947
# -*- coding: utf-8 -*- from . import * SECRET_KEY = env.str('KOBRA_SECRET_KEY', 'Unsafe_development_key._Never_use_in_production.') DEBUG = env.bool('KOBRA_DEBUG_MODE', True) DATABASES = { 'default': env.db_url('KOBRA_DATABASE_URL', 'sqlite:///db.sqlite3') }
1.414063
1
foobot_grapher.py
jpwright/foobot-slack
1
14948
<filename>foobot_grapher.py #!/usr/bin/env python from pyfoobot import Foobot import requests import matplotlib matplotlib.use('Agg') import matplotlib.dates import matplotlib.pyplot import datetime from imgurpython import ImgurClient import ConfigParser def getSensorReadings(notify): config = ConfigParser.ConfigPa...
2.53125
3
safexl/__init__.py
ThePoetCoder/safexl
6
14949
<reponame>ThePoetCoder/safexl<gh_stars>1-10 # Copyright (c) 2020 safexl from safexl.toolkit import * import safexl.xl_constants as xl_constants import safexl.colors as colors __author__ = "<NAME>" __email__ = "<EMAIL>" __license__ = "MIT" __version__ = "0.0.7"
0.859375
1
musicdb/restapi/migrations/0001_initial.py
alexebaker/django-music_database
0
14950
<filename>musicdb/restapi/migrations/0001_initial.py # Generated by Django 2.0.4 on 2018-05-01 05:22 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( ...
1.703125
2
ballot_source/sources/migrations/0004_auto_20200824_1444.py
Ballot-Drop/ballot-source
3
14951
<reponame>Ballot-Drop/ballot-source # Generated by Django 3.0.9 on 2020-08-24 20:44 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sources', '0003_sourcedetail_last_pull'), ] operations = [ migrations.AlterField( model_name...
1.242188
1
src/tests/Yi/tests/inner_product_between_lobatto_and_gauss.py
Idate96/Mimetic-Fem
0
14952
# -*- coding: utf-8 -*- """ (SHORT NAME EXPLANATION) >>>DOCTEST COMMANDS (THE TEST ANSWER) @author: <NAME>. Created on Mon Jul 10 20:12:27 2017 Department of Aerodynamics Faculty of Aerospace Engineering TU Delft #SUMMARY---------------- #INPUTS----------------- #ESSENTI...
2.828125
3
src/quality_control/bin/createSpotDetectionQCHTML.py
WoutDavid/ST-nextflow-pipeline
0
14953
<filename>src/quality_control/bin/createSpotDetectionQCHTML.py import json from bs4 import BeautifulSoup import pandas as pd import sys # Argparsing argument_index = 1 template = sys.argv[argument_index] argument_index +=1 recall_json = sys.argv[argument_index] argument_index +=1 recall_plot = sys.argv[argument_inde...
2.734375
3
test/torch/mpc/test_fss.py
NicoSerranoP/PySyft
3
14954
<reponame>NicoSerranoP/PySyft import pytest import torch as th from syft.frameworks.torch.mpc.fss import DPF, DIF, n @pytest.mark.parametrize("op", ["eq", "le"]) def test_fss_class(op): class_ = {"eq": DPF, "le": DIF}[op] th_op = {"eq": th.eq, "le": th.le}[op] gather_op = {"eq": "__add__", "le": "__xor__...
2.140625
2
allennlp/tests/data/tokenizers/pretrained_transformer_tokenizer_test.py
donna-legal/allennlp
1
14955
from allennlp.common.testing import AllenNlpTestCase from allennlp.data.tokenizers import PretrainedTransformerTokenizer class TestPretrainedTransformerTokenizer(AllenNlpTestCase): def test_splits_roberta(self): tokenizer = PretrainedTransformerTokenizer("roberta-base") sentence = "A, <mask> Alle...
2.8125
3
openmdao/api.py
ryanfarr01/blue
0
14956
"""Key OpenMDAO classes can be imported from here.""" # Core from openmdao.core.problem import Problem from openmdao.core.group import Group from openmdao.core.parallel_group import ParallelGroup from openmdao.core.explicitcomponent import ExplicitComponent from openmdao.core.implicitcomponent import ImplicitComponent...
1.320313
1
code-buddy.py
xl3ehindTim/Code-buddy
8
14957
import os from getArgs import getArgs from modules import python, javascript, html, php, bootstrap, cca # from folder import file # code-buddy.py create (file type) (directory name) # Checks for "create" if getArgs(1) == "create": # Checks for which file type projectType = getArgs(2) # Checks for file name ...
2.890625
3
compyle/tests/test_ext_module.py
manish364824/compyle
1
14958
<filename>compyle/tests/test_ext_module.py from contextlib import contextmanager from distutils.sysconfig import get_config_var from io import open as io_open import os from os.path import join, exists import shutil import sys import tempfile from textwrap import dedent from multiprocessing import Pool from unittest im...
2.375
2
tma/collector/xhn.py
hebpmo/TMA
2
14959
# -*- coding: UTF-8 -*- """ collector.xhn - 新华网数据采集 官网:http://www.xinhuanet.com/ 接口分析: 1. 获取文章列表 http://qc.wa.news.cn/nodeart/list?nid=115093&pgnum=1&cnt=10000 新华全媒体头条 http://www.xinhuanet.com/politics/qmtt/index.htm ==================================================================== """ import requests import re...
2.359375
2
tests/test_onetv.py
unlocKing/plugins
2
14960
import unittest from plugins.onetv import OneTV class TestPluginPerviyKanal(unittest.TestCase): def test_can_handle_url(self): regex_test_list = [ "https://media.1tv.ru/embed/ctcmedia/ctc-che.html?start=auto", "https://media.1tv.ru/embed/ctcmedia/ctc-dom.html?start=auto", ...
2.796875
3
tests/test_plugins/pytester_example_dir/test_file_1.py
MORSECorp/snappiershot
27
14961
""" This is a test file used for testing the pytest plugin. """ def test_function_passed(snapshot): """ The snapshot for this function is expected to exist. """ snapshot.assert_match(3 + 4j) def test_function_new(snapshot): """ The snapshot for this function is expected to exist, but only one assertion ...
1.664063
2
src/compas/geometry/pointclouds/pointcloud.py
Sam-Bouten/compas
0
14962
from __future__ import print_function from __future__ import absolute_import from __future__ import division from random import uniform from compas.geometry import transform_points from compas.geometry import centroid_points from compas.geometry import bounding_box from compas.geometry import Primitive from compas.geo...
2.5625
3
oa/regex.py
Worteks/OrangeAssassin
0
14963
"""Handle regex conversions.""" from builtins import object import re import operator from functools import reduce import oa.errors # Map of perl flags and the corresponding re ones. FLAGS = { "i": re.IGNORECASE, "s": re.DOTALL, "m": re.MULTILINE, "x": re.VERBOSE, } DELIMS = { "/": "/", "{"...
2.8125
3
test_data/barometer_kalman.py
theo-brown/ahrs
1
14964
import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import Slider from kalman_filter import KalmanFilter raw_data = np.loadtxt("barometer_data.txt") # Truncate raw data (it's super long) raw_data = raw_data[:raw_data.size//4] raw_data_step = np.loadtxt("barometer_data_step.txt") t1 = np.arange(0...
2.90625
3
number-of-orders-in-the-backlog/number_of_orders_in_the_backlog.py
joaojunior/hackerrank
0
14965
import heapq from typing import List class Solution: def get_number_of_backlog_orders(self, orders: List[List[int]]) -> int: sell_backlog = [] buy_backlog = [] for price, amount, order_type in orders: if order_type == 0: while amount > 0: if ...
3.453125
3
scripts/plotresults.py
rafzi/DeepThings
1
14966
<gh_stars>1-10 import pandas as pd import numpy as np import matplotlib.pyplot as plt # 1: YOLOv2, 2: AlexNet, 3: VGG-16, 4: GoogLeNet model = 4 LINEPLOT = True dfs = pd.read_excel("t.xlsx", sheet_name=None, header=None) if model == 1: ms = "YOLOv2" elif model == 2: ms = "AlexNet" elif model == 3: ms = "VGG-16"...
2.6875
3
setup.py
oubiwann/myriad-worlds
3
14967
<reponame>oubiwann/myriad-worlds<gh_stars>1-10 from setuptools import setup, find_packages from myriad import meta from myriad.util import dist setup( name=meta.display_name, version=meta.version, description=meta.description, long_description=meta.long_description, author=meta.author, author...
1.351563
1
val_resnet.py
AlexKhakhlyuk/fixedconv
1
14968
from subprocess import run # python -u val_resnet.py cuda = 0 # which gpu to use dataset = 'cifar10' logs_path = 'logs_resnet' + '_' + dataset manualSeed = 99 workers = 0 for model in ['resnet20', 'preact_resnet20']: commands = [ 'python', '-u', 'validate_resnet.py', '--dataset=' + dataset, ...
1.921875
2
akagi/data_sources/spreadsheet_data_source.py
pauchan/akagi
26
14969
from akagi.data_source import DataSource from akagi.data_file import DataFile class SpreadsheetDataSource(DataSource): '''SpreadsheetSource replesents a data on Google Spreadsheets ''' def __init__(self, sheet_id, sheet_range='A:Z', no_cache=False): self._sheet_id = sheet_id self._sheet_r...
2.328125
2
stanCode_projects/my_drawing/my_drawing.py
kenhuang1204/stanCode_projects
0
14970
""" File: my_drawing.py Name: 黃科諺 ---------------------- TODO: """ from campy.graphics.gobjects import GOval, GRect, GLine, GLabel, GPolygon, GArc from campy.graphics.gwindow import GWindow def main(): """ Meet Snorlax (卡比獸) of stanCode! He dreams of Python when he sleeps. Be like Snorlax. """ window...
2.875
3
kivy/core/clipboard/clipboard_xsel.py
CharaD7/kivy
2
14971
<reponame>CharaD7/kivy ''' Clipboard xsel: an implementation of the Clipboard using xsel command line tool. ''' __all__ = ('ClipboardXsel', ) from kivy.utils import platform from kivy.core.clipboard._clipboard_ext import ClipboardExternalBase if platform != 'linux': raise SystemError('unsupported platform for xs...
2.59375
3
plugins/hashsum_download/girder_hashsum_download/settings.py
JKitok/girder
395
14972
from girder.exceptions import ValidationException from girder.utility import setting_utilities class PluginSettings: AUTO_COMPUTE = 'hashsum_download.auto_compute' @setting_utilities.default(PluginSettings.AUTO_COMPUTE) def _defaultAutoCompute(): return False @setting_utilities.validator(PluginSettings.AU...
2.421875
2
forager_server/forager_server_api/views.py
jeremyephron/forager
1
14973
from collections import defaultdict, namedtuple from dataclasses import dataclass import distutils.util import functools import itertools import json import math import operator import os import random import uuid import shutil import logging import time from typing import List, Dict, NamedTuple, Optional from django...
1.90625
2
ccmlib/cluster_factory.py
justinchuch/ccm
626
14974
from __future__ import absolute_import import os import yaml from ccmlib import common, extension, repository from ccmlib.cluster import Cluster from ccmlib.dse_cluster import DseCluster from ccmlib.node import Node from distutils.version import LooseVersion #pylint: disable=import-error, no-name-in-module class...
1.945313
2
causalnex/structure/pytorch/dist_type/_base.py
Rishab26/causalnex
1,523
14975
# Copyright 2019-2020 QuantumBlack Visual Analytics Limited # # 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 # # THE SOFTWARE IS PROVIDED "AS IS"...
1.304688
1
src/cmdsh/utils.py
kotfu/cmdsh
0
14976
<gh_stars>0 # # -*- coding: utf-8 -*- # # Copyright (c) 2019 <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 rights # to use, co...
2.4375
2
tensorflow/python/tpu/tpu_outside_compilation_test.py
Arushacked/tensorflow
78
14977
<filename>tensorflow/python/tpu/tpu_outside_compilation_test.py # Copyright 2020 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://ww...
2.03125
2
Source/Oyooni/Text Recognition/server.py
Oyooni5245/Oyooni
0
14978
<gh_stars>0 from flask import Flask, request from flask_restful import Resource, Api from test import get_models, getTextFromImage from testDocument import getText from time import time app = Flask(__name__) api = Api(app) net, refine_net = get_models() class TextRecognizerService(Resource): def post(self): ...
2.421875
2
varats/varats/plots/blame_interaction_graph_plots.py
Kaufi-Jonas/VaRA-Tool-Suite
0
14979
"""Module for BlameInteractionGraph plots.""" import typing as tp from datetime import datetime from pathlib import Path import click import matplotlib.pyplot as plt import networkx as nx import pandas as pd import plotly.offline as offply from matplotlib import style from varats.data.reports.blame_interaction_graph...
2.125
2
Day 7/Day 7.py
Dullstar/Advent-Of-Code-2020
0
14980
import re class Rule: def __init__(self, line): line = line.strip().split(" contain ") line[1] = line[1].strip(".").split(", ") self.contents = {} for item in line[1]: # Grab that number out in front regex = re.compile(r"[0-9]+") # If we didn't f...
3.578125
4
sdk/python/pulumi_aws_native/apigateway/outputs.py
AaronFriel/pulumi-aws-native
29
14981
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from...
1.539063
2
bin/training_data/redmagic_ds_training_data.py
mclaughlin6464/pearce
0
14982
<filename>bin/training_data/redmagic_ds_training_data.py #!/.conda/envs/hodemulator/bin/python from pearce.emulator import make_training_data from pearce.emulator import DEFAULT_PARAMS as ordered_params ordered_params['f_c'] = (0.05, .5) ordered_params['logMmin'] = (11.5, 13.0)#(13.0, 14.5) ordered_params['sigma_logM']...
1.835938
2
src/legohdl/workspace.py
c-rus/legoHDL
6
14983
# ------------------------------------------------------------------------------ # Project: legohdl # Script: workspace.py # Author: <NAME> # Description: # The Workspace class. A Workspace object has a path and a list of available # vendors. This is what the user keeps their work's scope within for a given # "or...
2.65625
3
ev_de.py
avinashmnit30/Electric-Vehicle-Optimal-Charging
7
14984
<gh_stars>1-10 # -*- coding: utf-8 -*- """ Created on Wed Dec 16 18:01:24 2015 @author: Avinash """ import numpy as np from numpy import * import numpy from math import * import ev_charge_schedule_modification1 as ev #import ev_charge_schedule.static as func1 #import ev_charge_schedule.dynamic as fun...
1.929688
2
var/spack/repos/builtin/packages/memaxes/package.py
xiki-tempula/spack
9
14985
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Memaxes(Package): """MemAxes is a visualizer for sampled memory trace data.""" homepa...
1.484375
1
auth/decorators.py
dongboyan77/quay
0
14986
<filename>auth/decorators.py import logging from functools import wraps from flask import request, session from prometheus_client import Counter from auth.basic import validate_basic_auth from auth.oauth import validate_bearer_auth from auth.cookie import validate_session_cookie from auth.signedgrant import validate_...
2.5
2
ddpm_proteins/utils.py
lucidrains/ddpm-proteins
61
14987
import os from PIL import Image import seaborn as sn import matplotlib.pyplot as plt import torch import torch.nn.functional as F from sidechainnet.utils.sequence import ProteinVocabulary from einops import rearrange # general functions def exists(val): return val is not None def default(val, d): return va...
2.28125
2
samples/python/efficientdet/create_onnx.py
L-Net-1992/TensorRT
0
14988
<filename>samples/python/efficientdet/create_onnx.py # # SPDX-FileCopyrightText: Copyright (c) 1993-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with t...
2.34375
2
easy/867-transpose-matrix.py
wanglongjiang/leetcode
2
14989
<reponame>wanglongjiang/leetcode ''' 转置矩阵 给你一个二维整数数组 matrix, 返回 matrix 的 转置矩阵 。 矩阵的 转置 是指将矩阵的主对角线翻转,交换矩阵的行索引与列索引。 ''' from typing import List ''' 思路:简单问题,原矩阵大小为m*n,创建一个n*m大小的新矩阵,按照行列转化的方式将旧矩阵数据复制过去 ''' class Solution: def transpose(self, matrix: List[List[int]]) -> List[List[int]]: m = len(matrix) ...
3.4375
3
adam_visual_perception/head_gaze_estimator.py
isi-vista/adam-visual-perception
1
14990
from adam_visual_perception import LandmarkDetector from adam_visual_perception.utility import * import numpy as np import math import cv2 import os import sys class HeadGazeEstimator: """ A class for estimating gaze ray from facial landmarks """ def __init__(self, write_video=False): # 3D model poin...
3
3
pypoca/cogs/general.py
leandcesar/PyPoca
1
14991
# -*- coding: utf-8 -*- import disnake from disnake.ext import commands from pypoca.config import COLOR, URLS from pypoca.database import Server from pypoca.ext import ALL, DEFAULT, Choice, Option class General(commands.Cog): def __init__(self, bot: commands.Bot): self.bot = bot @commands.slash_comm...
2.140625
2
costor_server/storage/api/views/authcheck.py
rphi/costor
2
14992
<gh_stars>1-10 from rest_framework.decorators import api_view, permission_classes from rest_framework.parsers import MultiPartParser from rest_framework.response import Response from rest_framework import permissions from rest_framework.exceptions import APIException from rest_framework.decorators import parser_classes...
2.234375
2
tensorflow_probability/python/experimental/mcmc/sample_fold.py
rupei/probability
0
14993
<gh_stars>0 # Copyright 2020 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.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
1.773438
2
algos/custom_ppo2.py
Ottawa-Autonomous-Vehicle-Group/learning-to-drive-in-5-minutes
1
14994
import time from collections import deque import gym import numpy as np from stable_baselines import logger, PPO2 from stable_baselines.a2c.utils import total_episode_reward_logger from stable_baselines.common import explained_variance, TensorboardWriter from stable_baselines.common.runners import AbstractEnvRunner fr...
2.046875
2
craw/modules/trail/trails/feeds/urlvir.py
xuluhang/DomainBlockList
19
14995
<filename>craw/modules/trail/trails/feeds/urlvir.py<gh_stars>10-100 #!/usr/bin/env python2 """ Copyright (c) 2014-2019 Maltrail developers (https://github.com/stamparm/maltrail/) See the file 'LICENSE' for copying permission """ from craw.modules.trail.plugins.util import wget_content __url__ = "http://www.urlvir.co...
2.078125
2
tests/continuous_integration.py
kfaRabi/online-judge-tools
0
14996
<filename>tests/continuous_integration.py import os import subprocess import sys import unittest # TODO: these command should be written at once, at only .travis.yml or at only here paths = ['oj', 'onlinejudge', 'setup.py', 'tests'] class ContinuousIntegrationTest(unittest.TestCase): """A dummy test to run the ...
2.28125
2
open-hackathon-client/src/client/config_sample.py
overbest/open-hackathon
0
14997
# -*- coding: utf-8 -*- # # ----------------------------------------------------------------------------------- # Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this softw...
1.132813
1
processing_provider/Rast_fillRasterwithPatches.py
geodourados/lftools
1
14998
# -*- coding: utf-8 -*- """ fillRasterwithPatches.py *************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Gene...
1.460938
1
quantlab/COCO/utils/inference.py
lukasc-ch/QuantLab
6
14999
<filename>quantlab/COCO/utils/inference.py<gh_stars>1-10 import matplotlib.patches as patches import matplotlib.pyplot as plt import numpy as np def view_instance(img, gt_label, pr_label=None): img = img.cpu() # gt_label = gt_label.cpu() # pr_label = pr_label.cpu() # c, h, w = img.shape # with ope...
1.90625
2