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
ga4ghtest/controllers/plugins_controller.py
ga4gh/workflow-interop
5
26600
import connexion import six from ga4ghtest.models import Plugin # noqa: E501 from ga4ghtest import util from ga4ghtest.core.controllers import plugins_controller as controller def create_plugin( body ): # noqa: E501 """Create a test plugin Add a plugin for testing functionality of an API. # noqa: E501...
2.328125
2
web/settings/__init__.py
EasySport/easysport
1
26601
import os from split_settings.tools import include, optional ENVIRONMENT = os.getenv('DJANGO_ENV') or 'development' include( # Load environment settings 'base/env.py', optional('local/env.py'), # We can "patch" any settings from local folder env.py file. # Here we should have the order because of de...
2.015625
2
selfdrive/car/hyundai/values.py
agegold/OPKR080
0
26602
<gh_stars>0 # flake8: noqa from cereal import car from selfdrive.car import dbc_dict from common.params import Params Ecu = car.CarParams.Ecu # Steer torque limits class SteerLimitParams: params = Params() STEER_MAX = int(params.get('SteerMaxAdj')) # 409 is the max, 255 is stock STEER_DELTA_UP = int(params.ge...
2.59375
3
builder/utils/util_dict.py
My-Novel-Management/storybuilderunite
1
26603
# -*- coding: utf-8 -*- ''' Utility methods for dictionary ============================== ''' __all__ = ( 'calling_dict_from', 'combine_dict', 'dict_sorted') from itertools import chain from typing import Tuple from builder.utils import assertion def calling_dict_from(calling: (str, dict), n...
3.34375
3
scripts/hdfs_store.py
coastrock/CEBD1261-2019-fall-group-project
1
26604
<gh_stars>1-10 try: from zipfile import ZipFile from pyspark import SparkContext, SparkConf from pyspark.sql import SparkSession import pyspark.sql.functions as f import os except Exception as e: print(e) ## http://www.hongyusu.com/imt/technology/spark-via-python-basic-setup-count-lines-and-wor...
2.65625
3
examples/simple_bot.py
GeoffreyWesthoff/imgen-client.py
1
26605
<gh_stars>1-10 """ DANK MEMER IMGEN API CLIENT --------------------------- Copyright: Copyright 2019 Melms Media LLC License: MIT """ from discord import Client from imgen import AsyncClient bot = Client() memegen = AsyncClient(token='<PASSWORD>') @bot.event async def on_ready(): print('Logged in as %s' % bot...
2.40625
2
src/UQpy/surrogates/kriging/correlation_models/baseclass/__init__.py
SURGroup/UncertaintyQuantification
0
26606
from UQpy.surrogates.kriging.correlation_models.baseclass.Correlation import Correlation
1.132813
1
discrete_ppo/ppo_goalgrid.py
sen-pai/pygame2gym
1
26607
<filename>discrete_ppo/ppo_goalgrid.py import torch import torch.nn.functional as F from torch.utils import tensorboard import argparse import numpy as np import os from statistics import mean, stdev from tqdm import tqdm import json import gym import simple_discrete_game from models.cnn_agent import cnn_value_net, ...
2.171875
2
tinder/__init__.py
mzdravkov/elsys-ci-flask-example
2
26608
from flask import Flask from flask_socketio import SocketIO from flask_sqlalchemy import SQLAlchemy UPLOAD_FOLDER = 'uploads' ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'gif'} app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/dev.db' app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER app.secret_...
1.992188
2
pose/excerciseClass.py
San-B-09/BeFit
0
26609
<filename>pose/excerciseClass.py from pose.poseClass import pose from pose import helpers class dumbbell_lateral_raises(pose): angles={ ('left_hip','left_shoulder','left_elbow'):None, ('right_hip','right_shoulder','right_elbow'):None, ('left_shoulder','left_elbow','left_wrist'):None, ...
2.734375
3
pyMIDICapSense.py
midilab/pyMIDICapSense
2
26610
<filename>pyMIDICapSense.py import wiringpi2 import rtmidi from defines import * from config import * #import config # config.TIMEOUT def Setup(outPin, inPin, ledPin): # set Send Pin Register wiringpi2.pinMode(outPin, OUTPUT) # set receivePin Register low to make sure pullups are off wiringpi2.pinMode(inPin, O...
3.125
3
src/losses.py
saman-codes/dldojo
0
26611
import numpy as np class Loss(): def output_gradient(self): return class MSE(Loss): def __call__(self, predicted, labels): return 0.5 * np.square(predicted - labels) def output_gradient(self, predicted, labels): return predicted - labels class BinaryCrossEntropy(Loss): def _...
3.171875
3
cape_privacy/pandas/transformations/test_utils.py
vismaya-Kalaiselvan/cape-python
144
26612
<gh_stars>100-1000 import pandas as pd class PlusN: """A sample transform that adds n to a specific field. Attributes: field: The field that this transform will be applied to. n: The value to add to the field. """ identifier = "plusN" type_signature = "col->col" def __init__...
3.140625
3
Redmash/redmash.py
zatherz/reddit
4
26613
<filename>Redmash/redmash.py #/u/GoldenSights import praw # simple interface to the reddit API, also handles rate limiting of requests import time import datetime import traceback import pickle '''USER CONFIGURATION''' APP_ID = "" APP_SECRET = "" APP_URI = "" APP_REFRESH = "" # https://www.reddit.com/comments/3cm1p8/...
2.84375
3
src/pynadc/scia/db.py
rmvanhees/pynadc
1
26614
""" This file is part of pynadc https://github.com/rmvanhees/pynadc Methods to query the NADC Sciamachy SQLite database Copyright (c) 2012-2021 SRON - Netherlands Institute for Space Research All Rights Reserved License: BSD-3-Clause """ from pathlib import Path import sqlite3 # ------------------------------...
3.015625
3
project_1_2017/program/flatland.py
pveierland/permve-ntnu-it3708
0
26615
<reponame>pveierland/permve-ntnu-it3708 #!/usr/bin/env python3 import argparse import collections import enum import itertools import numpy as np import pickle import random import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtSvg import * from PyQt5.QtWidgets import * from PyQt5.QtPrintSuppor...
2.46875
2
cogs/Data.py
AmashiSenpai/AmashiDiscordBot
0
26616
from pycord.discord.ext import commands import pycord.discord as discord from pycord.discord import Embed import requests import json from discord import Embed class Data(commands.Cog): def __init__(self, bot) -> None: self.bot: commands.Bot = bot @commands.command() async def ping(self, ctx): await ctx...
2.78125
3
scripts/Run.py
ekg/shasta
0
26617
#!/usr/bin/python3 from SetupRunDirectory import verifyDirectoryFiles, setupRunDirectory from CleanupRunDirectory import cleanUpRunDirectory from RunAssembly import verifyConfigFiles, verifyFastaFiles, runAssembly, initializeAssembler from SaveRun import saveRun import configparser from datetime import datetime from ...
2.515625
3
prestring/output.py
podhmo/prestring
8
26618
<filename>prestring/output.py<gh_stars>1-10 import typing as t import typing_extensions as tx import sys import logging import os.path import dataclasses import filecmp from io import StringIO from .minifs import MiniFS, File, T, DefaultT from .utils import reify logger = logging.getLogger(__name__) ActionType = tx.Li...
2.109375
2
demo.py
Yijun-Mao/CGenerator
9
26619
<filename>demo.py #!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals from itertools import repeat import os import numpy as np import json from flask import Flask,render_template,url_for,request import joblib import traceback import requests from bs4 import BeautifulSoup import re f...
2.5
2
w02-calling-functions/team-discount/teach_stretch.py
carloswm85/2021-cs111-programming-with-functions
0
26620
""" You work for a retail store that wants to increase sales on Tuesday and Wednesday, which are the store's slowest sales days. On Tuesday and Wednesday, if a customer's subtotal is greater than $50, the store will discount the customer's purchase by 10%. """ # Import the datatime module so that # it can be used in t...
4.28125
4
online assessment interview/SE Big Data role/mongoTest1.py
NirmalSilwal/Python-
32
26621
<reponame>NirmalSilwal/Python-<gh_stars>10-100 import pymongo connection = pymongo.MongoClient("localhost", 27017) database = connection['mydb_01'] collection = database['mycol_01'] data = {'Name' : "Akshay"} collection.insert_one(data)
3.046875
3
training/loss/styleganV.py
maua-maua-maua/nvGAN
0
26622
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
1.929688
2
spec/__init__.py
deep-spin/spec-blackboxnlp
2
26623
<gh_stars>1-10 """ SpEC ~~~~~~~~~~~~~~~~~~~ Sparsity, Explainability, and Communication :copyright: (c) 2019 by <NAME> :licence: MIT, see LICENSE for more details """ # Generate your own AsciiArt at: # patorjk.com/software/taag/#f=Calvin%20S&t=SpEC __banner__ = """ _____ _____ _____ | __|___| __| | |__ ...
1.070313
1
BurstPaperWallet/initialize.py
MrPilotMan/BurstPaperWallet
5
26624
from BurstPaperWallet.api import brs_api from BurstPaperWallet.api import passphrase_url_transform as transform def initialize(account, old_passphrase, fee=735000): url = "sendMoney&recipient={}&secretPhrase={}&amountNQT=1&feeNQT={}&recipientPublicKey={}&deadline=1440"\ .format(account["reed solomon"], tr...
2.78125
3
planning/data/__init__.py
XinyuHua/pair-emnlp2020
20
26625
from .dictionary import BertDictionary from .text_planning_dataset import TextPlanningDataset __all__ = [ 'BertDictionary', 'TextPlanningDataset', ]
1.1875
1
vaemodel.py
iakash2604/Music-AI-IIT_Delhi
1
26626
import numpy as np import os import keras from keras import regularizers, losses from keras.models import Sequential, Model from keras.layers import Lambda, Input, Dense, Dropout, Reshape, BatchNormalization, Softmax, Concatenate from keras.utils import plot_model import keras.backend as K class multiVAE: def __init_...
2.28125
2
PycharmProjects/untitled1/printGraph.py
jiankangliu/baseOfPython
0
26627
<reponame>jiankangliu/baseOfPython # 第一行一个*,第二行两个*........ 共十行 # 打印乘法口诀 n = 1 while n <= 10: n1 = n while n1: print("*", end = "") n1 -= 1 print() n += 1 n2 = 1 n3 = 1 while n2 < 10: while n3 <= n2: print(f"{n3}*{n2}={n3*n2}",end="\t") n3 += 1 p...
3.5625
4
src/models/exif_sc/__init__.py
lemonwaffle/nisemono
7
26628
from .exif_sc import EXIF_SC from .networks import EXIF_Net
0.949219
1
tests/fixtures.py
luisfmcalado/coinoxr
2
26629
import pytest from tests.stub_client import StubHttpClient from coinoxr.requestor import Requestor from coinoxr.response import Response def content(file): return StubHttpClient.json(file)["content"] @pytest.fixture def client(): client = StubHttpClient() client.add_app_id("fake_app_id") client.add...
2.234375
2
CPJIntroduction/CPJIntroduction/app.py
zhaishuai/CPJIntroduction
0
26630
#!flask/bin/python # coding=utf-8 from flask import Flask, jsonify app = Flask(__name__) tasks = { "event_id" : "1.9", "introductions" : [ { "title" : "情怀", "details" : "各种无敌, 各种牛人, 各种挑战, 等你来战", "image" : "hello.png", "background_image" : "backgroundImage.png" }, { "title...
2.609375
3
hcpre/duke_siemens/util_dicom_siemens.py
beOn/hcpre
10
26631
""" Routines for extracting data from Siemens DICOM files. The simplest way to read a file is to call read(filename). If you like you can also call lower level functions like read_data(). Except for the map of internal data types to numpy type strings (which doesn't require an import of numpy), this code is deliberat...
3.046875
3
lib/nbrun.py
etalab/run-nb
0
26632
# Copyright (c) 2015-2017 <NAME> # License: MIT """ nbrun - Run an Jupyter/IPython notebook, optionally passing arguments. USAGE ----- Copy this file in the folder containing the master notebook used to execute the other notebooks. Then use `run_notebook()` to execute notebooks. """ import time from pathlib import P...
3.046875
3
Beginner/Day6/utilitiesmodule.py
vishipayyallore/LearningPython_2019
0
26633
def banner(message, length, header='=', footer='*'): print() print(header * length) print((' ' * (length//2 - len(message)//2)), message) print(footer * length) def banner_v2(length, footer='-'): print(footer * length) print()
3.125
3
src/nninst/plot/heatmap_alexnet_imagenet_inter_class_similarity_frequency.py
uchuhimo/Ptolemy
15
26634
import numpy as np import pandas as pd import seaborn as sns from nninst.backend.tensorflow.model import AlexNet from nninst.backend.tensorflow.trace.alexnet_imagenet_inter_class_similarity import ( alexnet_imagenet_inter_class_similarity_frequency, ) from nninst.op import Conv2dOp, DenseOp np.random.seed(0) sns....
2.296875
2
spec/repositories/test_person.py
dooma/Events
0
26635
<gh_stars>0 __author__ = '<NAME>' import unittest from utils.IO import IO from events.repositories.person import PersonRepository from events.models.person import Person class TestPersonRepository(unittest.TestCase): def test_initialization(self): io = IO('test.json') io.set([]) repositor...
2.5625
3
AGD_ST/search/util_visual/draw_histogram.py
Erfun76/AGD
52
26636
<gh_stars>10-100 import numpy as np from skimage.io import imread, imsave import os import sys import matplotlib.pyplot as plt def draw_hist(fname, save_folder): img = imread(fname) img_flat = np.reshape(np.array(img),[-1]) plt.clf() plt.hist(img_flat) plt.title('Color Distribution His...
2.6875
3
instrument_plugins/EGandG_Model5209.py
sourav-majumder/qtlab
0
26637
# EGandG_Model5209.py class, to perform the communication between the Wrapper and the device # <NAME> <<EMAIL>>, 2010 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the Li...
2.09375
2
scripts/addons/keentools_facebuilder/utils/materials.py
Tilapiatsu/blender-custom_conf
2
26638
<filename>scripts/addons/keentools_facebuilder/utils/materials.py # ##### BEGIN GPL LICENSE BLOCK ##### # KeenTools for blender is a blender addon for using KeenTools in Blender. # Copyright (C) 2019 KeenTools # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Gener...
1.726563
2
scripts/item/consume_2434951.py
Snewmy/swordie
0
26639
# Soft-serve Damage Skin success = sm.addDamageSkin(2434951) if success: sm.chat("The Soft-serve Damage Skin has been added to your account's damage skin collection.")
1.179688
1
ext/testlib/suite.py
mandaltj/gem5_chips
135
26640
<gh_stars>100-1000 # Copyright (c) 2017 <NAME> and <NAME> # 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 code must retain the above copyright # notice, this list of co...
1.484375
1
src/downloaders/video.py
s0hvaperuna/playlist-checker
0
26641
<gh_stars>0 import io import logging import os import re import subprocess import time from dataclasses import dataclass from random import uniform import yt_dlp from yt_dlp.utils import replace_extension, Popen, PostProcessingError from src.config import MinMax from src.config import get_yt_dlp_options from src.db i...
2.15625
2
nol/KNNFeatures.py
tlarock/nol
0
26642
<gh_stars>0 import numpy as np def set_egonets(self, nodes = None): """ Updates the self.egonets data structure, which is a dictionary indexed by node pointing to the induced subgraph on the node and its neighbors. Also updates the egonet_edgecounts for each node, used in a calculation later. ""...
3.21875
3
crossvalidation_pipeline.py
ktian08/6784-drugs
1
26643
# -*- coding: utf-8 -*- """ <NAME> Computational Biologist Target Sciences GSK <EMAIL> """ import sys import get_generalizable_features import get_merged_features import get_useful_features def main(validation_rep=0, validation_fold=0): print('VALIDATION_REP: {0!s}, VALIDATION_FOLD:{1!s}'.format(validation_r...
2.203125
2
locations/spiders/kona_grill.py
mfjackson/alltheplaces
0
26644
<filename>locations/spiders/kona_grill.py # -*- coding: utf-8 -*- import json import scrapy from locations.items import GeojsonPointItem from locations.hours import OpeningHours STATES = [ "AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "ID",...
2.765625
3
test/login.py
hongren798911/haha
0
26645
<reponame>hongren798911/haha num1 = 100 num2 = 200 num3 = 300 num4 = 400 num5 = 500 mum6 = 600 num7 = 700 num8 = 800
1.578125
2
darling_ansible/python_venv/lib/python3.7/site-packages/oci/waas/models/health_check.py
revnav/sandbox
0
26646
<reponame>revnav/sandbox<gh_stars>0 # coding: utf-8 # Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache...
2.03125
2
misc/appveyor_filter.py
ppwwyyxx/taichi
2
26647
<reponame>ppwwyyxx/taichi import sys import os msg = os.environ["APPVEYOR_REPO_COMMIT_MESSAGE"] if msg.startswith('[release]') or sys.version_info[1] == 6: exit( 0 ) # Build for this configuration (starts with '[release]', or python version is 3.6) else: print( f'[appveyor_filer] Not build...
1.742188
2
mysite/SocialApp/migrations/0003_delete_remotefollow.py
asmao7/Cmput404W2021
3
26648
# Generated by Django 3.1.6 on 2021-04-12 08:45 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('SocialApp', '0002_auto_20210411_2237'), ] operations = [ migrations.DeleteModel( name='RemoteFollow', ), ]
1.304688
1
api/tests/opentrons/protocol_runner/test_thread_async_queue.py
anuwrag/opentrons
2
26649
"""Tests for thread_async_queue.""" from __future__ import annotations import asyncio from concurrent.futures import ThreadPoolExecutor from itertools import chain from typing import List, NamedTuple import pytest from opentrons.protocol_runner.thread_async_queue import ( ThreadAsyncQueue, QueueClosed, ) ...
2.859375
3
courses/data_analysis/deepdive/composer-exercises/subdag_example_solution.py
pranaynanda/training-data-analyst
0
26650
"""Solution for subdag_example.py. Uses a factory function to return a DAG that can be used as the subdag argument to SubDagOperator. Notice that: 1) the SubDAG's dag_id is formatted as parent_dag_id.subdag_task_id 2) the start_date and schedule_interval of the SubDAG are copied from the parent DAG. """ from airflo...
2.734375
3
src/export_blueprints.py
nutanixdev/export_blueprints
0
26651
#!/usr/bin/env python3.8 """ export_blueprints.py Connect to a Nutanix Prism Central instance, grab all Calm blueprints and export them to JSON files. You would need to *heavily* modify this script for use in a production environment so that it contains appropriate error-checking and exception handling....
2.40625
2
public_ssl_drown_scanner/pyx509/pkcs7/asn1_models/X509_certificate.py
csadsl/poc_exp
11
26652
#* pyx509 - Python library for parsing X.509 #* Copyright (C) 2009-2010 CZ.NIC, z.s.p.o. (http://www.nic.cz) #* #* This library is free software; you can redistribute it and/or #* modify it under the terms of the GNU Library General Public #* License as published by the Free Software Foundation; either...
2.3125
2
Codewars/you're a square/you're a square.py
adoreblvnk/code_solutions
0
26653
from math import isqrt is_square = lambda n: isqrt(n) ** 2 == n if n >= 0 else False def is_square_soln(n): pass print(is_square(-1))
3.578125
4
change_name.py
agk2000/catalyst_project
2
26654
<gh_stars>1-10 # The function to change the name of a list of folders # 2021.06.07 Ben wants to change a list of folder names that is too long for plotting import numpy as np import os import shutil name_change_dir_list = ['/scratch/sr365/Catalyst_data/every_10m/{}0m/images/save_root'.format(i) for i in range(5, 13)...
3.515625
4
test/unit/__init__.py
comtravo/grafana-dashboards
8
26655
<gh_stars>1-10 """ tests module """ import os import sys import sure ROOT_DIR = os.path.join(os.path.dirname(__file__), "../..") sys.path.append(ROOT_DIR)
1.757813
2
genda/formats/__init__.py
jeffhsu3/genda
5
26656
""" Formats submodule contains classes and functions to parse various formats into pandas dataframes as well as lookup utilities to various formats """ from .gene_utils import * from .panVCF import VCF
1.257813
1
src/api/bkuser_core/categories/plugins/plugin.py
Chace-wang/bk-user
0
26657
# -*- coding: utf-8 -*- """ TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the Lic...
1.554688
2
blog/templatetags/markdownify.py
darkLord19/blog
12
26658
from django import template import mistune register = template.Library() @register.filter def markdown(value): markdown = mistune.Markdown() return markdown(value)
1.585938
2
hummingbot/connector/exchange/k2/k2_in_flight_order.py
d3alek/hummingbot
0
26659
<reponame>d3alek/hummingbot<filename>hummingbot/connector/exchange/k2/k2_in_flight_order.py<gh_stars>0 import asyncio from decimal import Decimal from typing import ( Any, Dict, Optional, ) from hummingbot.connector.exchange.k2.k2_utils import convert_from_exchange_trading_pair from hummingbot.connector.i...
2.15625
2
finite/storage/factom/__init__.py
FactomProject/finite
0
26660
import json from finite.storage import new_uuid class Unimplemented(Exception): pass class RoleFail(Exception): pass SUPERUSER = '*' """ role used to bypass all permission checks """ ROOT_UUID = '00000000-0000-0000-0000-000000000000' """ parent UUID used to initialize a stream """ DEFAULT_SCHEMA = 'base...
2.578125
3
bin/notify.py
nfischer/dotfiles
4
26661
<gh_stars>1-10 #!/usr/bin/python import dbus import sys DEFAULT_TIMEOUT = 4000 def notify(summary, body='', app_name='', app_icon='', timeout=DEFAULT_TIMEOUT, actions=[], hints=[], replaces_id=0): _bus_name = 'org.freedesktop.Notifications' _object_path = '/org/freedesktop/Notifications' _interfac...
2.109375
2
code/exampleStrats/gradualtft.py
protonlaser91/PrisonersDilemmaTournament
0
26662
<filename>code/exampleStrats/gradualtft.py import numpy as np from random import random def strategy(history, memory): currentCount,defector,hasDefected = (0,0,False) if memory is None else memory choice = 1 if currentCount > 0: choice = 0 currentCount -= 1 return choice, (current...
3.078125
3
indico/modules/oauth/provider_test.py
uxmaster/indico
1
26663
# This file is part of Indico. # Copyright (C) 2002 - 2019 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from datetime import datetime, timedelta from uuid import uuid4 import pytest from flask import session f...
1.96875
2
2019/Python/Day_6/__init__.py
airstandley/AdventofCode
0
26664
<filename>2019/Python/Day_6/__init__.py<gh_stars>0 """ Day 6: Universal Orbit Map (https://adventofcode.com/2019/day/6) """
1.109375
1
tests/service/test_log_cloudwatch.py
wenhaizhu/FBPCS
0
26665
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import unittest from unittest.mock import MagicMock, patch from fbpcs.service.log_cloudwatch import CloudWatchLogServi...
2.1875
2
build/ARM/arch/arm/ArmSemihosting.py
zhoushuxin/impl_of_HPCA2018
5
26666
<filename>build/ARM/arch/arm/ArmSemihosting.py version https://git-lfs.github.com/spec/v1 oid sha256:60c08155c02f8c1321979a81a67a2ef5a0bc292b2d26a9e5be7e6e1cb484e248 size 2756
1.085938
1
cqi_cpp/src/wrapper/discrete.py
AMR-/Conservative-Q-Improvement
0
26667
<filename>cqi_cpp/src/wrapper/discrete.py<gh_stars>0 import numpy as np from .space import Space class Discrete(Space): r"""A discrete space in :math:`\{ 0, 1, \\dots, n-1 \}`. Example:: >>> Discrete(2) """ def __init__(self, n): assert n >= 0 self.n = n super(Discret...
3.140625
3
lab02/eurocv/apps.py
vascoalramos/tpw
0
26668
<gh_stars>0 from django.apps import AppConfig class EurocvConfig(AppConfig): name = 'eurocv'
1.179688
1
2020/13/solution2.py
mitchellrj/adventofcode
0
26669
<filename>2020/13/solution2.py<gh_stars>0 import functools import math import operator import sys import time def get_factors(n): i = 2 factors = set() while i * i <= n: if n % i: i += 1 else: n //= i factors.add(i) if n > 1: factors.add(n) ...
3.265625
3
pyrosetta/models/_overrides.py
blockjoe/rosetta-api-client-python
0
26670
<reponame>blockjoe/rosetta-api-client-python from textwrap import indent from ._models import * def str_SubNetworkIdentifier(self : SubNetworkIdentifier) -> str: sn = "Subnetwork: {}".format(self.network) if self.metadata: md_h = "Additional Metadata:" md = "\n".join(["- {}: {}".format(key, va...
2.421875
2
src/lockstep/models/arheaderinfomodel.py
sfwatanabe/lockstep-sdk-python
1
26671
<gh_stars>1-10 # # Lockstep Software Development Kit for Python # # (c) 2021-2022 Lockstep, Inc. # # For the full copyright and license information, please view the LICENSE # file that was distributed with this source code. # # @author <NAME> <<EMAIL>> # @copyright 2021-2022 Lockstep, Inc. # @version 2022.4 # @...
1.875
2
aae/server.py
ez-corp/easy
0
26672
<filename>aae/server.py # coding=utf-8 import time from flask import Flask from flask import jsonify from flask import request from werkzeug.exceptions import BadRequest from containers import grade_submission, RunStatus # TODO: move to conf file TIME_EXCEEDED_MESSAGE = "Programmi kontrollimine ületas lubatud käivi...
2.703125
3
code03[efficient].py
inaxia/face_recognition_in_image
1
26673
<reponame>inaxia/face_recognition_in_image # THIS IS A SHORTENED CODE # WE ARE COMPARING ONE IMAGE WITH ALL IMAGES IN 'ASSETS' FOLDER # ALSO CHECKS THE TOTAL TIME TAKEN # HERE, IMAGES ARE NOT SHOWN from cv2 import cv2 import face_recognition import os import time # FOR CHECKING THE CPU TIME startTimer = time.process_...
2.96875
3
scripts/media_to_wp.py
benjaminaschultz/pypress
2
26674
<reponame>benjaminaschultz/pypress #!/usr/bin/env python import os,re,sys import mimetypes as mt import argparse import wordpress_xmlrpc as wp from pypress import * def main(argv,client=None): parser = argparse.ArgumentParser() parser.add_argument('-b','--blog', help='url of wordpress blog to which you want to pos...
2.6875
3
GOKOTAI/commands/Meteor/entry.py
kantoku-code/Fusion360_GOKOTAI
1
26675
import adsk.core import adsk.fusion import os from ...lib import fusion360utils as futil from ... import config import math app = adsk.core.Application.get() ui = app.userInterface # TODO *** コマンドのID情報を指定します。 *** CMD_ID = f'{config.COMPANY_NAME}_{config.ADDIN_NAME}_Meteor' CMD_NAME = 'メテオ' CMD_Descript...
1.796875
2
tp/log/es.py
chinapnr/agbot
2
26676
import re import time from datetime import datetime from enum import Enum from fishbase.fish_logger import logger from .elk_connector import Es from ..base.tp_base import TpBase, TestStatus, Conf, VerticalContext from ..base.tp_base import get_params_dict # LogTestPoint class LogESTestPoint(TpBase): # 类的初始化过程 ...
2.015625
2
main.py
nmanzini/flashcardipy
0
26677
<reponame>nmanzini/flashcardipy import sqlite3, random, os import time name = 'test01.db' filename = "grelist.txt" conn = sqlite3.connect(name) c = conn.cursor() '''word, definition, example, history, time, seen, right, wrong, streak, reported''' class Word(object): def __init__(self, row_id): """ ...
3.859375
4
shit.py
rangehow/TransformerForMT
0
26678
import math from typing import List import numpy as np import torch a = torch.randn(4, 3,2) print(a) print(torch.argmax(a, -1))
3
3
tcr/status.py
kris-76/thecardroom
5
26679
<reponame>kris-76/thecardroom<filename>tcr/status.py # # Copyright 2021 <NAME> # # MIT License: # # 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 limita...
2.109375
2
aws/ec2/manage.py
amaga38/discord_bot
0
26680
import sys import json import boto3 from botocore.exceptions import ClientError from . import config def status_instance(instance_id, dry_run=False): ec2 = boto3.client('ec2', region_name='ap-northeast-1', aws_access_key_id=config.AWS_ACCESS_KEY_ID, ...
2.296875
2
submissions/templatetags/auth_extras.py
lesves/acceptor
1
26681
from django import template register = template.Library() @register.filter def has_group(user, name): return user.groups.filter(name=name).exists()
2.140625
2
python_modules/dagster-graphql/dagster_graphql/implementation/fetch_pipelines.py
zzztimbo/dagster
0
26682
<reponame>zzztimbo/dagster import sys from dagster_graphql.schema.pipelines import DauphinPipeline, DauphinPipelineSnapshot from graphql.execution.base import ResolveInfo from dagster import check from dagster.core.definitions.pipeline import ExecutionSelector from dagster.core.errors import DagsterInvalidDefinitionE...
1.757813
2
tests/snippets/index_overflow.py
khg0712/RustPython
3
26683
import sys def expect_cannot_fit_index_error(s, index): try: s[index] except IndexError: pass # TODO: Replace current except block with commented # after solving https://github.com/RustPython/RustPython/issues/322 # except IndexError as error: # assert str(error) == "cannot...
3.0625
3
src/spn/experiments/FPGA/RunNative.py
QueensGambit/SPFlow
0
26684
<gh_stars>0 """ Created on March 26, 2018 @author: <NAME> """ import glob import os import platform import subprocess from collections import OrderedDict import numpy as np from natsort import natsorted from spn.algorithms.Inference import likelihood from spn.experiments.FPGA.GenerateSPNs import load_spn_from_file, ...
1.757813
2
api/views.py
AktanKasymaliev/django_blog_site_fullstack
1
26685
<reponame>AktanKasymaliev/django_blog_site_fullstack from rest_framework import generics from blogs.models import Comments from .serializers import CommentsSerializer, UsersSerializers from rest_framework.permissions import AllowAny, IsAuthenticated, IsAdminUser from customUsers.models import User class CommentsView(g...
1.96875
2
client/__init__.py
mycelium-ethereum/punk-offerbook
0
26686
<gh_stars>0 from dotenv import load_dotenv load_dotenv(); import os import json import settings from web3 import Web3 from client.Mongo import Mongo from client.Webhook import webhook from client.Opensea import Opensea def get_raw_abis(abi_paths): raw_abis = {} for abi_key, abi_path in abi_paths.items(): ...
2.03125
2
src/indexer.py
HypoChloremic/fcsan
0
26687
<reponame>HypoChloremic/fcsan from analyze import Analyze import argparse # ap = argparse.ArgumentParser() # ap.addargument("-f", "--folder") # opts = ap.parse_args() run = Analyze() run.read() files = run.files def indexer(): with open("FACS_INDEX.txt", "w") as file: for i in files: run.read(i) meta = run....
3.0625
3
Leetcode Practice/strStr.py
falconcode16/pythonprogramming
2
26688
<gh_stars>1-10 # Link - https://leetcode.com/problems/implement-strstr/ """ 28. Implement strStr() Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Clarification: What should we return when needle is an empty string? This is a great questio...
3.78125
4
skaio/scheduler.py
cipriantarta/skaio
0
26689
import importlib.util import inspect from skaio import log from skaio.core.publisher import Publisher from skaio.core.base.task import BaseTask from skaio.utils.common import get_loop tasks = ['samples.simple_tasks'] class Scheduler: def start(self): publisher = Publisher() loop = get_loop() ...
2.0625
2
rotkehlchen/accounting/export/csv.py
rotkehlchenio/rotkehlchen
137
26690
<reponame>rotkehlchenio/rotkehlchen import json import logging from csv import DictWriter from pathlib import Path from tempfile import mkdtemp from typing import TYPE_CHECKING, Any, Dict, List, Literal, Tuple from zipfile import ZIP_DEFLATED, ZipFile from rotkehlchen.accounting.pnl import PnlTotals from rotkehlchen.c...
2.359375
2
tests/ut/bq_test_kit/interpolators/test_shell_interpolator.py
tiboun/python-bigquery-test-kit
31
26691
# Copyright (c) 2020 <NAME> # # This software is released under the MIT License. # https://opensource.org/licenses/MIT from bq_test_kit.interpolators.shell_interpolator import ShellInterpolator def test_interpolate(): si = ShellInterpolator({"LOCAL_KEY": "VALUE"}) result = si.interpolate("Local key has value...
2.421875
2
Analytics_Deployment/amls/model_deployment/download_model.py
dciborow/Azure-Synapse-Retail-Recommender-Solution-Accelerator
12
26692
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import os, uuid, sys, pickle, shutil, io, logging from azure.storage.filedatalake import DataLakeServiceClient from azure.core._match_conditions import MatchConditions from azure.storage.filedatalake._models import ContentSet...
1.921875
2
tests/server/test_storage.py
ecoen66/imcsdk
31
26693
# Copyright 2016 Cisco Systems, 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 writing...
1.0625
1
parsers/demoty.py
discord-advertiser/api
18
26694
from parsel import Selector from utils import ( download, remove_big_whitespaces_selector, find_id_in_url, catch_errors, get_last_part_url, ) from data import VideoContent, GalleryContent, ImageContent, Meme, Author, Page import re ROOT = "https://m.demotywatory.pl" def scrap(url): html = do...
2.90625
3
evaluate_sklearn.py
syenn2896/batik-recommendation
0
26695
<filename>evaluate_sklearn.py import sys import tables import numpy as np import argparse import pickle from sklearn.metrics import accuracy_score, confusion_matrix from sklearn.model_selection import cross_val_score from sklearn.preprocessing import StandardScaler from sklearn.tree import DecisionTreeClassifie...
2.828125
3
01-DesenvolvimentoDeSistemas/02-LinguagensDeProgramacao/01-Python/01-ListaDeExercicios/02-Aluno/Roberto/exc0019.py
moacirsouza/nadas
1
26696
<gh_stars>1-10 print('[-- Um professor quer sortear um dos seus quatro alunos para apagar o quadro. Faça um programa que ajude ele, lendo o nome deles e escrevendo o nome do escolhido. --]\n') from random import choice nome01 = input('Digite o nome do primeiro aluno: ') nome02 = input('Digite o nome do segundo aluno: ...
3.796875
4
setup.py
swdream/flyfingers
2
26697
<reponame>swdream/flyfingers #!/usr/bin/env python2 # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup import flyfingers requisites = [] setup( name='flyfingers', version=flyfingers.__version__, description='Learn to type 10 fingers', ...
1.375
1
kivy_modules/widget/slider.py
VictorManhani/polingua
0
26698
__all__ = ('FlexSlider', ) import os import sys root = os.path.abspath( os.path.dirname( os.path.dirname( os.path.dirname(os.path.realpath(__file__))))) sys.path.insert(0,root) from kivy.lang import Builder from kivy_modules.widget.widget import Widget from kivy.properties import (NumericPrope...
2.328125
2
tests/conftest.py
tohanss/repobee-sanitizer
0
26699
<filename>tests/conftest.py """Global fixtures and setup code for the test suite.""" import sys import pathlib import pytest import repobee sys.path.append(str(pathlib.Path(__file__).parent / "helpers")) @pytest.fixture(autouse=True) def unregister_plugins(): """Fixture that automatically unregisters all plugins...
2.078125
2