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
nihars.com/server.py
niharokz/website_archive
0
12796351
<reponame>niharokz/website_archive #!/bin/python # # ███╗░░██╗██╗██╗░░██╗░█████╗░██████╗░░█████╗░██╗░░██╗███████╗ # ████╗░██║██║██║░░██║██╔══██╗██╔══██╗██╔══██╗██║░██╔╝╚════██║ # ██╔██╗██║██║███████║███████║██████╔╝██║░░██║█████═╝░░░███╔═╝ # ██║╚████║██║██╔══██║██╔══██║██╔══██╗██║░░██║██╔═██╗░█...
2.546875
3
catkin_ws/src/aruco_intercept/src/grab_object.py
filesmuggler/ur3e-ird435-rg2
1
12796352
#!/usr/bin/env python import sys import copy import rospy import moveit_commander import moveit_msgs.msg import geometry_msgs.msg from math import pi from std_msgs.msg import String from moveit_commander.conversions import pose_to_list import tf def all_close(goal, actual, tolerance): """ Convenience method...
2.75
3
LLDBagility/lldbagility.py
killvxk/LLDBagility
1
12796353
#!/usr/bin/env python2 # -*- coding: utf-8 -*- from __future__ import print_function import argparse import functools import re import shlex import threading import time import traceback import kdpserver import lldb import lldbagilityutils import stubvm vm = None def _exec_cmd(debugger, command, capture_output=Fal...
2.203125
2
pytglib/api/functions/write_generated_file_part.py
iTeam-co/pytglib
6
12796354
from ..utils import Object class WriteGeneratedFilePart(Object): """ Writes a part of a generated file. This method is intended to be used only if the client has no direct access to TDLib's file system, because it is usually slower than a direct write to the destination file Attributes: ID (:ob...
3.140625
3
Month 03/Week 04/Day 03/c.py
KevinKnott/Coding-Review
0
12796355
<filename>Month 03/Week 04/Day 03/c.py # Merge k Sorted Lists: https://leetcode.com/problems/merge-k-sorted-lists/ # You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. # Merge all the linked-lists into one sorted linked-list and return it. from types import List, Optional ...
3.828125
4
pset6/crack.py
holodon/CS50
0
12796356
<reponame>holodon/CS50 ## # Cracks up to 4 letter alphabetical passwords by bruteforce ## import sys import crypt import itertools def main(): # check if called with exactly one argument if len(sys.argv) != 2: show_usage() exit(1) # all possible characters aA = "abcdefghijklmnopqrst...
3.03125
3
awards/signals.py
Sundaybrian/prodev
0
12796357
#signal fired after an obj is saved in this cas when a user is created from django.db.models.signals import post_save #post to sende the signal from .models import Post #reciever of the signal from django.dispatch import receiver from .models import Review @receiver(post_save,sender=Post) def create_review(sender,i...
2.5
2
sparse_matrices/sparse_gauss.py
j-adamczyk/Matrix_algorithms
1
12796358
<gh_stars>1-10 from copy import deepcopy from typing import Union import numpy as np from .sparse_matrices import CoordinateSparseMatrix, CSRMatrix def sparse_gauss_elimination_row(A: Union[CoordinateSparseMatrix, CSRMatrix]) \ -> Union[CoordinateSparseMatrix, CSRMatrix]: """ Performs Gaussian elimi...
2.625
3
setup.py
kim-younghan/MultiResUNet
23
12796359
from setuptools import setup, find_packages setup( name = 'multiresunet', version = '0.1', description = 'MultiResUNet implementation in PyTorch; MultiResUNet: Rethinking the U-Net Architecture for Multimodal', author = '<NAME>', author_email = '<EMAIL>', inst...
1.195313
1
generate.py
chteuchteu/Material-Colors-SCSS-Variables
0
12796360
<reponame>chteuchteu/Material-Colors-SCSS-Variables #!/usr/bin/python3 # -*- coding: utf-8 -*- import urllib.request from bs4 import BeautifulSoup import re material_guidelines_url = 'http://www.google.com/design/spec/style/color.html#color-color-palette' output_file = 'dist/_material-colors.scss' foreground_color_l...
2.75
3
buy_stuff.py
learning-python/testing
0
12796361
<filename>buy_stuff.py import calc class Pocket: def __init__(self, settings): self.money = settings['money'] self.apples = settings['apples'] self.price = settings['price'] def buy_apples(self, num_apples): needed = calc.multiply(self.price, num_apples) would_be_left =...
3.640625
4
programming_lesson5/make_coin_sorter_version5.py
zhazhijibaba/zhazhijibaba_programming_lessons
0
12796362
<gh_stars>0 from vector import * import openmesh as om import numpy as np # version3 slope 15 degree theta = np.pi / 12.0 # https://en.wikipedia.org/wiki/Coins_of_the_Canadian_dollar # create mesh for coin sorter # Nickel 5 cents 21.2mm (1.76mm) # Dime 10 cents 18.03mm (1.22mm) # Quatoer 25 cents 23.88mm (1.58mm) # Lo...
2.3125
2
examples/image/plot_dataset_mtf.py
Pandinosaurus/pyts
1,217
12796363
""" ==================================== Data set of Markov transition fields ==================================== A Markov transition field is an image obtained from a time series, representing a field of transition probabilities for a discretized time series. Different strategies can be used to bin time series. It i...
3.046875
3
vprocess/older/yolo_detection_face_reco.py
rezeck/itelicam
0
12796364
#!/usr/bin/env python3.5 import os import dlib import numpy as np import cv2 import time import darknet from ctypes import * import math import random class YOLO_NN: def __init__(self, yoloDataFolder): self.configPath = yoloDataFolder + "/cfg/yolov3-tiny.cfg" self.weightPath = yoloDataFolder + "/...
2.359375
2
color_guess.py
Software-Cat/Python-Graphics-Project
0
12796365
# import all the required python libaries: graphics and random from graphics import * import random # create the graphics window and set background colour win = GraphWin("Colour Guessing Game", 1000, 500) win.setBackground('#232323') # create a title for your game titleBg = Rectangle(Point(0, 0), Point(1000, 135)) ti...
3.875
4
utils/scripts/OOOlevelGen/src/levels/Release_The_Cheese.py
fullscreennl/monkeyswipe
0
12796366
<gh_stars>0 import LevelBuilder from sprites import * def render(name,bg): lb = LevelBuilder.LevelBuilder(name+".plist",background=bg) lb.addObject(Beam.BeamSprite(x=217, y=83,width=167,height=36,angle='90' ,restitution=0.2,static='false',friction=0.5,density=20 )) lb.addObject(Wizard.WizardSprite(x=409,y=6...
2.171875
2
example.py
papamoose/nvidia-ml-py
0
12796367
#!/usr/bin/python3 import nvidia_smi import json mydict = nvidia_smi.JsonDeviceQuery() # Example print JSON print(json.dumps(mydict, indent=2))
2.390625
2
utests/cfg_up.py
georgsp/mdmTerminal2
24
12796368
<gh_stars>10-100 import json import unittest import run from lib.tools import config_updater def dummy(*_, **__): pass def new_updater(): return config_updater.ConfigUpdater(CFG(), dummy) def CFG(): return run.get_cfg() class ConfigUpdater(unittest.TestCase): ADD_5 = {'ip_server': '', 'ip': 1, ...
2.546875
3
Dirt.py
damianStrojek/Python-GameOfLife
4
12796369
<gh_stars>1-10 # OOP PG WETI PROJECT NR 2 # <NAME> s184407 2021 IT/CS # @ Copyright 2021, <NAME>, All rights reserved. import os, pygame from Organism import Organism class Dirt(Organism): # Default block that makes our world def __init__(self, _currentWorld, _positionX, _positionY): super(Dir...
2.9375
3
agora_analytica/analytics/dummy.py
Kyrmy/prototyyppi
0
12796370
<reponame>Kyrmy/prototyyppi<filename>agora_analytica/analytics/dummy.py """ Dummy module for generating fixed - or random - distances. """ from numpy.random import randint from numpy import abs, int import pandas as pd def distance(source: pd.Series, target: pd.Series, answers: pd.DataFrame, answer_scale=5, answer_s...
2.78125
3
nr_common/fs_utils/fs_utils.py
nitred/nr-common
0
12796371
<reponame>nitred/nr-common<gh_stars>0 """Simple file system utils.""" import os def makedirs(path, is_file, to_abs=False): """Make directory from path (filename or directory) if it doesn't already exist. Args: path (str): Absolute path of directory or filename. is_file (bool): Whether the pat...
3.671875
4
tony-setanddict.py
tonythott/tonnewcode
0
12796372
<filename>tony-setanddict.py ''' #set is a container that stores a collection of unique values #Union , intersection , substraction for sets #Substruction means remove elements from intersection of a and b list =[] #empty list setN = {} #error setN = set() #empty set cast = {"tony","preetha","luke"} if luke ...
4.21875
4
moanna/model/Autoencoder.py
rlupat/moanna
2
12796373
<gh_stars>1-10 # Libraries import torch import torch.nn as nn import numpy as np import pandas as pd from tensorboardX import SummaryWriter import torch.nn.functional as F import pdb import seaborn as sns import matplotlib.pyplot as plt from livelossplot import PlotLosses #Encoder class LayerBlockEncode(nn.Module): ...
2.53125
3
project/face_api_server/proxy/redis_function.py
1step6thswmaestro/29
0
12796374
import datetime import json import redis redis_device_key = 'redis_device_key' device_expire_second = 60 class RedisProxy(object): def __init__(self, host='127.0.0.1', port=6379): self.redis_pool = redis.ConnectionPool(host=host, port=port, db=0) def connect(self): return redis.Redis(connect...
2.5
2
fungit/style/cursor.py
zlj-zz/pyzgit
0
12796375
<reponame>zlj-zz/pyzgit class Cursor: """Class with collection of cursor movement functions: .t[o](line, column) | .r[ight](columns) | .l[eft](columns) | .u[p](lines) | .d[own](lines) | .save() | .restore()""" @staticmethod def to(line: int, col: int) -> str: # * Move cursor to line, column ...
3.109375
3
src/cors.py
danztensai/covid-19-api
53
12796376
from flask_cors import CORS cors = CORS(resources={r"/maskmap/*": {"origins": "*"}}) def init_app(app): cors.init_app(app)
1.757813
2
day08.py
Yalfoosh/Advent-of-Code-2019
0
12796377
import numpy as np image_dimensions = (25, 6) def load(image_dims, path: str = "input/08.txt"): with open(path) as file: return np.array([c for c in file.read()]).reshape((-1, image_dims[0] * image_dims[1])) def number_of_values_in_layer(layer, value): return np.count_nonzero(layer == value) def ...
3
3
Robotix/apps/miscellaneous/models.py
Robotix/rbtxportal
0
12796378
<filename>Robotix/apps/miscellaneous/models.py<gh_stars>0 from django.db import models class Country(models.Model): name = models.CharField(max_length=20) class Meta: verbose_name_plural = 'Countries' def __str__(self): return self.name class State(models.Model): name = models.C...
2.484375
2
senet/keras_fn/se_resnet_test.py
AI-Huang/SENet
1
12796379
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Date : Jan-02-21 20:43 # @Author : <NAME> (<EMAIL>) import tensorflow as tf from tensorflow.python.keras import keras_parameterized from tensorflow.python.platform import test from tensorflow.keras.utils import plot_model from senet.keras_fn.se_resnet import SE_Re...
2.578125
3
stage_data/main.py
shermanflan/clinical-data-architecture
0
12796380
""" Usage: - From Spark 3.1.1 base container with Python bindings: docker run --rm -it --name test_pyspark spark-ingest:latest /bin/bash ./bin/spark-submit spark-ingest/main.py --filepath ./examples/src/main/python/pi.py - From binaries: ./pyspark --packages io.delta:delta-core_2.12:1.0.0 \ --conf "spark.sql.extens...
1.765625
2
src/runner/views.py
OpenROAD-Cloud/flow-runner
0
12796381
from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status from runner.tasks import start_flow_task class RunnerStartFlow(APIView): def post(self, request): flow_uuid = request.POST.get('flow_uuid', None) flow_repo_url = request.POST.get...
2.15625
2
libp2p/network/connection/raw_connection.py
ChihChengLiang/py-libp2p
0
12796382
from .raw_connection_interface import IRawConnection class RawConnection(IRawConnection): def __init__(self, ip, port, reader, writer, initiator): # pylint: disable=too-many-arguments self.conn_ip = ip self.conn_port = port self.reader = reader self.writer = writer ...
2.9375
3
app.py
porcelainruler/Image-Search-Engine
1
12796383
<reponame>porcelainruler/Image-Search-Engine import os from flask import Flask, render_template, request, jsonify import numpy as np import cv2 from Searcher import Searcher from ColorDescriptor import ColorDescriptor app = Flask(__name__) INDEX = os.path.join(os.path.dirname(__file__), 'index.csv') cd = ColorDescrip...
2.546875
3
sdk/python/pulumi_gcp/compute/get_default_service_account.py
23doors/pulumi-gcp
1
12796384
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import json import warnings import pulumi import pulumi.runtime from typing import Union from .. import utilities, tables class GetDef...
1.960938
2
data_visualization/chp15_GeneratingData/plottingSquares.py
sergejsm/pythonCrashCourseProjects
0
12796385
<reponame>sergejsm/pythonCrashCourseProjects import matplotlib.pyplot as plt x_values = list(range(1, 1001)) y_values = [x**2 for x in x_values] plt.title("Square Numbers", fontsize=24) plt.xlabel("Value", fontsize=14) plt.ylabel("Square of Value", fontsize=14) # Set size of tick labels. plt.tick_params(axis='both',...
3.578125
4
power_sizing.py
ThyagoFRTS/power-eletric
1
12796386
import math def calculate_power_luminance(ambient_area): #area in m^2 potency = 0 if ambient_area <= 6: print('Lighting Potency: '+ str(100) +' (VA)') potency = 100 else: print('extra potency: ' + str((ambient_area - 6))) potency = 100 + 60 * int((ambient_area - 6)/4) print('Lighting Poten...
3.671875
4
lab3/index.py
xiong35/HUST-BigData
0
12796387
import pandas as pd SUPPORT = 0.005 CONF = 0.5 def csv2list(): df = pd.read_csv("./实验三/数据/Groceries.csv") itemsets = [] for itemset_str in df["items"]: itemsets.append(set(itemset_str[1:-1].split(","))) return itemsets itemsets = csv2list() itemsets_len = itemsets.__len__() def build1d...
3.171875
3
core/src/autogluon/core/searcher/bayesopt/tuning_algorithms/defaults.py
zhiqiangdon/autogluon
4,462
12796388
<gh_stars>1000+ from .bo_algorithm_components import LBFGSOptimizeAcquisition from ..models.meanstd_acqfunc_impl import EIAcquisitionFunction DEFAULT_ACQUISITION_FUNCTION = EIAcquisitionFunction DEFAULT_LOCAL_OPTIMIZER_CLASS = LBFGSOptimizeAcquisition DEFAULT_NUM_INITIAL_CANDIDATES = 250 DEFAULT_NUM_INITIAL_RANDOM_EV...
1.203125
1
analysis/study_definition.py
orlamac/Antidepressants-in-LD-A
0
12796389
<filename>analysis/study_definition.py<gh_stars>0 from cohortextractor import StudyDefinition, patients, codelist, codelist_from_csv, filter_codes_by_category, combine_codelists, Measure # NOQA # Import codelists from codelist.py folder from codelists import SSRI_codes, LD_codes, Autism_codes # Define Study time var...
2.359375
2
app/models/Address.py
winlongit/shop_pc_server
1
12796390
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ------------------------------------------------- @ Author : pengj @ date : 2019/12/10 15:45 @ IDE : PyCharm @ GitHub : https://github.com/JackyPJB @ Contact : <EMAIL> --------------------------------...
2.390625
2
src/allennlp/fortex/allennlp/__init__.py
Piyush13y/forte-wrappers
3
12796391
from fortex.allennlp.allennlp_processors import AllenNLPProcessor
1.0625
1
tensorflow/27.pyflink-kafka/notebooks/tensorflow_predict.py
huseinzol05/Gather-Tensorflow-Serving
267
12796392
from pyflink.datastream import StreamExecutionEnvironment, TimeCharacteristic from pyflink.table import StreamTableEnvironment, DataTypes, EnvironmentSettings from pyflink.table.descriptors import ( Schema, Kafka, Json, Rowtime, OldCsv, FileSystem, ) from pyflink.table.udf import udf s_env = St...
1.960938
2
example/servers/migrations/0004_auto_20170524_0707.py
jayvdb/django-test-tools
9
12796393
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-05-24 12:07 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('servers', '0003_auto_20170523_1409'), ] operations =...
1.53125
2
src/datasets.py
vidalt/BA-Trees
45
12796394
<filename>src/datasets.py<gh_stars>10-100 # MIT License # Copyright(c) 2020 <NAME> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files(the "Software"), to deal # in the Software without restriction, including without limitation the right...
1.992188
2
py/py_0558_irrational_base.py
lcsm29/project-euler
0
12796395
# Solution of; # Project Euler Problem 558: Irrational base # https://projecteuler.net/problem=558 # # Let r be the real root of the equation x3 = x2 + 1. Every positive integer # can be written as the sum of distinct increasing powers of r. If we require # the number of terms to be finite and the difference between...
3.375
3
pyoptools/raytrace/__init__.py
fcichos/pyoptools
1
12796396
<reponame>fcichos/pyoptools<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2007, 2008, 2009,2010 <NAME> # <<EMAIL>>, # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions ...
1.289063
1
tests/test_legacy_version.py
GamzeUnlu95/message_ix
0
12796397
<reponame>GamzeUnlu95/message_ix import numpy as np from message_ix import Scenario msg_args = ('canning problem (MESSAGE scheme)', 'standard') msg_multiyear_args = ('canning problem (MESSAGE scheme)', 'multi-year') def test_solve_legacy_scenario(test_legacy_mp): scen = Scenario(test_legacy_mp, *msg_args) ex...
2.296875
2
src/cogs/moderation.py
Necrozma200/Zeron
1
12796398
<gh_stars>1-10 import nextcord from nextcord.channel import CategoryChannel,DMChannel from nextcord.colour import Color from nextcord.components import Button from nextcord.embeds import Embed from nextcord.ext import commands from nextcord.ext.commands.cooldowns import BucketType from nextcord.ui.view import View from...
1.921875
2
apps/discovery_pyre/uniflex_app_discovery_pyre/pyre_discovery_master_module.py
danieldUKIM/uniflex_wishrem
0
12796399
from pyre import Pyre from pyre import zhelper import threading import zmq import logging import json import time from uniflex.core import modules __author__ = "<NAME>" __copyright__ = "Copyright (c) 2015, Technische Universitat Berlin" __version__ = "0.1.0" __email__ = <EMAIL>" class PyreDiscoveryMasterModule(modu...
2.078125
2
spire/wsgi/upload.py
siq/spire
0
12796400
<filename>spire/wsgi/upload.py import os, json from scheme import Json, Text from werkzeug.exceptions import MethodNotAllowed from werkzeug.formparser import parse_form_data from werkzeug.utils import secure_filename from spire.core import Configuration, Unit, Dependency from spire.util import uniqid from spire.wsgi....
2.03125
2
pythonProject/venv/Desafio 34.py
lucasjlgc/Aulas-de-Python-
0
12796401
# Pergunte salario e calcule aumento, maior que 1250 é 10%, menor é 15%. salario = int(input('Qual o valor do seu salário? ')) salario1= (1250*0.1)+salario salario2=(1250*0.15)+salario if salario>=1250: print('Você teve aumento de 10% e agora receberá {}'.format(salario1)) else: print('Você teve aumento de 15%...
3.703125
4
frds/mktstructure/measures/__init__.py
mgao6767/wrds
1
12796402
<reponame>mgao6767/wrds<gh_stars>1-10 from . import bidask_spread, effective_spread, realized_spread, price_impact
1.046875
1
analyzer/benchmark_analyzer.py
alexirae/benchmark-analyzer-visualizer
0
12796403
import argparse import numpy as np from benchmark_statistics import Statistics from benchmark_containers import BenchmarkResultsContainer ############################################################################## def createBenchmarkResults(benchmark_samples, operation): benchmark_results = BenchmarkResults...
2.578125
3
running_modes/enums/__init__.py
marco-foscato/Lib-INVENT
26
12796404
from running_modes.enums.diversity_filter_enum import DiversityFilterEnum from running_modes.enums.learning_strategy_enum import LearningStrategyEnum from running_modes.enums.logging_mode_enum import LoggingModeEnum from running_modes.enums.running_mode_enum import RunningModeEnum from running_modes.enums.generative_mo...
1.226563
1
code/dataloaders/__init__.py
ShawnCheung/Attention-depth
87
12796405
from .nyu_dataloader import NYUDataset from .kitti_dataloader import KITTIDataset from .dataloader import MyDataloader from .transforms import Resize, Rotate, RandomCrop, CenterCrop, \ ColorJitter, HorizontalFlip, ToTensor, \ Compose, Crop from .get_datasets import create...
1.476563
1
uri/iniciante/1037.py
AllefLobo/AlgorithmsProblemsSolution
2
12796406
valor = float(input()) if valor >= 0 and valor <= 25: print "Intervalo [0,25]" elif valor >= 0 and valor <= 50: print "Intervalo (25,50]" elif valor >= 0 and valor <= 75: print "Intervalo (50, 75]" elif valor >= 0 and valor <= 100: print "Intervalo (75,100]" else: print "Fora de intervalo"
3.890625
4
csv_cleaner.py
jing-viz/radiohead
1
12796407
<reponame>jing-viz/radiohead import csv k_frame_count = 2101 k_skip_frame = 5 for idx in range(1, k_frame_count, k_skip_frame): org_filename = 'data/csv_org/%s.csv' % idx new_filename = 'data/csv/%s.csv' % idx with open(org_filename) as input_csv: with open(new_filename, 'w') as output_csv: ...
2.6875
3
brains/namelist/models.py
crisisking/udbraaains
1
12796408
<gh_stars>1-10 import datetime from django.db import models class Category(models.Model): class Meta: verbose_name_plural = 'categories' name = models.CharField(max_length=25, null=False, blank=False) color_code = models.CharField(max_length=7, null=False, blank=False) def __unicode__(self)...
2.375
2
prog/stepik_course/lab_2/task5.py
phen0menon/university-tasks
0
12796409
from collections import Counter def find_occurrencies(): text = str(input()) num_inputs = input().split(" ") k = int(num_inputs[0]) L = int(num_inputs[1]) t = int(num_inputs[2]) curr_pos = 0 occur = set() for curr_pos, i in enumerate(range(len(text) - L), 0): curr_str = text[...
3.953125
4
hashdist/spec/hook_api.py
krafczyk/hashdist
67
12796410
<filename>hashdist/spec/hook_api.py """ The API exported to Python hook files that are part of stack descriptions. A significant portion of the package building logic should eventually find its way into here. Hook files are re-loaded for every package build, and so decorators etc. are run again. The machinery used to ...
2.359375
2
COT/vm_description/ovf/hardware.py
morneaup/cot
81
12796411
#!/usr/bin/env python # # hardware.py - OVFHardware class # # June 2016, <NAME> # Copyright (c) 2013-2016, 2019 the COT project developers. # See the COPYRIGHT.txt file at the top-level directory of this distribution # and at https://github.com/glennmatthews/cot/blob/master/COPYRIGHT.txt. # # This file is part of the C...
2.328125
2
myjson.py
phattarin-kitbumrung/basic-python
0
12796412
import json #Convert from JSON to Python # some JSON: x = '{ "name":"John", "age":30, "city":"New York"}' # parse x: y = json.loads(x) # the result is a Python dictionary: print(y["name"]) #Convert from Python to JSON # a Python object (dict): x = { "name": "John", "age": 30, "city": "New York" } # convert in...
3.9375
4
clispy/macro/system_macro.py
takahish/lispy
4
12796413
<filename>clispy/macro/system_macro.py # Copyright 2019 <NAME>. 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 # # Unl...
1.929688
2
examples/calendar_widget.py
whitegreyblack/PyWin
0
12796414
"""Calendar_widget.py""" import re import curses import random import calendar import itertools import source.config as config from collections import namedtuple date = namedtuple("Date", "Year Month Day") def iter_months_years(startDate: object, endDate: object) -> tuple: """Returns years and months based on giv...
3.84375
4
python/tvm/autotvm/tuner/sampler.py
ryujaehun/chameleon
1
12796415
<filename>python/tvm/autotvm/tuner/sampler.py # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License...
2.1875
2
templates/includes/loader.py
angeal185/flask-jinja-greensock-portfolio-webapp
0
12796416
 <script id="sf" type="x-shader/x-fragment"> precision highp float; uniform float time; uniform vec2 mouse; uniform vec2 resolution; float ball(vec2 p, float k, float d) { vec2 r = vec2(p.x - cos(time * k) * d, p.y + sin(time * k) * d); return smoothstep(0.0, 1.0, 0.03 / length(r)); } void main(void...
1.710938
2
webservice/api/others/func_d.py
galenothiago/switch-automation
0
12796417
from flask import Flask, Request, Response, request import json def devices(): dict_device = request.get_data(as_text=True) dados_device = json.loads(dict_device)
2.203125
2
python/tests/test_openfermion_integration.py
ausbin/qcor
59
12796418
<reponame>ausbin/qcor import faulthandler faulthandler.enable() import unittest from qcor import * try: from openfermion.ops import FermionOperator as FOp from openfermion.ops import QubitOperator as QOp from openfermion.transforms import reverse_jordan_wigner, jordan_wigner class TestOpenFermion(...
2.328125
2
posts/nano/dog-breed-classifier/dog_scratch_model.py
necromuralist/Neurotic-Networking
0
12796419
<reponame>necromuralist/Neurotic-Networking # python from functools import partial import argparse import os # pypi from dotenv import load_dotenv from PIL import Image, ImageFile from torchvision import datasets import numpy import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as opt...
2.484375
2
tests/test_public_datasets.py
scaleapi/nucleus-python-client
13
12796420
from nucleus.dataset import Dataset PANDASET_ID = "ds_bwhjbyfb8mjj0ykagxf0" def test_get_pandaset_items(CLIENT): dataset: Dataset = CLIENT.get_dataset(PANDASET_ID) items = dataset.items items_and_annotations = dataset.items_and_annotations() target_item = items[0] assert {_["item"].reference_id ...
2.5
2
work/NCS/test_files/test_wtih_restraints.py
youdar/work
0
12796421
<gh_stars>0 from __future__ import division import mmtbx.monomer_library.pdb_interpretation from mmtbx import monomer_library import mmtbx.monomer_library.server import getpass import sys import os def run(file_name): pdb_processed_file = monomer_library.pdb_interpretation.run(args=[file_name], assume_hydrogens_...
1.882813
2
protocol/__init__.py
KESHAmambo/IEEE_802_11ad_beamforming_simulation
0
12796422
settings = { 'log': True, 'verbosity': False, 'vcolored': True, 'time_precision': 1e-10 }
1.242188
1
model/MinionType.py
waniz/russian_ai_cup
0
12796423
<gh_stars>0 class MinionType: ORC_WOODCUTTER = 0 FETISH_BLOWDART = 1
1.1875
1
main.py
zeek0x/common
0
12796424
import sys from urllib import request, parse, error from multiprocessing import Process urls = [ 'https://github.com/', 'https://twitter.com/', 'https://hub.docker.com/v2/users/' ] def inspect_status_code(url): try: response = request.urlopen(url) return response.code except error...
2.703125
3
data_loader/data_loaders.py
Hhhhhhhhhhao/I2T2I
0
12796425
import torch import numpy as np from torch.utils.data import DataLoader from torchvision import transforms from data_loader.datasets_custom import TextImageDataset, COCOTextImageDataset from base import BaseDataLoader def text_image_collate_fn(data): collate_data = {} # Sort a data list by right caption lengt...
2.578125
3
tests/orm/test_app_user.py
KoalicjaOtwartyKrakow/backend
0
12796426
import pytest from sqlalchemy.exc import ProgrammingError from sqlalchemy_continuum.utils import count_versions from kokon.orm import Guest from kokon.utils.db import DB from tests.helpers import admin_session def test_app_user(): with admin_session() as session: session.execute("TRUNCATE guests_version...
2.125
2
bandc/settings.py
crccheck/atx-bandc
0
12796427
<reponame>crccheck/atx-bandc # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os import dj_database_url from project_runpy import env BASE_DIR = os.path.dirname(__file__) SECRET_KEY = env.get("SECRET_KEY", "Rotom") DEBUG = env.get("DEBUG", False) ALLOWED_HOSTS = ["*"] INSTALLED_APPS ...
1.976563
2
algorithms_keeper/api.py
hfz1337/algorithms-keeper
0
12796428
<filename>algorithms_keeper/api.py from typing import Mapping, Tuple from gidgethub.abc import UTF_8_CHARSET from gidgethub.aiohttp import GitHubAPI as BaseGitHubAPI from .log import STATUS_OK, inject_status_color, logger TOKEN_ENDPOINT = "access_tokens" class GitHubAPI(BaseGitHubAPI): # pragma: no cover LOG...
2.390625
2
pymecompress/codecs.py
python-microscopy/pymecompress
0
12796429
<filename>pymecompress/codecs.py """ numcodecs compatible compression and quantization codecs. """ from . import bcl import numcodecs from numcodecs.abc import Codec class Huffman(Codec): codec_id='pymecompress.huffman' def encode(self, buf): return bcl.huffman_compress_buffer(buf) def d...
2.578125
3
payflowpro/__init__.py
pelotoncycle/python-payflowpro
18
12796430
VERSION = (0, 3, 'pre',)
1.257813
1
test.py
narumiruna/pytorch-cpp-extension-example
1
12796431
<filename>test.py import torch from cppexample import normalize, gaussian def main(): x = torch.tensor([1, 2, 3], dtype=torch.float) y = normalize(x) print(y) x = gaussian(x, 0.0, 1.0, 1.0) print(x) if __name__ == '__main__': main()
2.640625
3
randaugment.py
Hayoung93/UDA
0
12796432
import torch import torch.nn as nn from torchvision import transforms as ttf class RandAugment(nn.Module): def __init__(self, N, M): super().__init__() """ rotate shear x shear y translate y translate x autoContrast sharpness identity...
2.390625
2
sipy/test.py
riikkano/protopaja2018
0
12796433
<reponame>riikkano/protopaja2018<gh_stars>0 #Aja konsolissa: py -m unittest test.py import unittest from lib.mittaus import * from lib.classes import load from main import * #Testaa funktiot pääohjelmasta class TestMain(unittest.TestCase): def test_openLoads(self): #Testi tähän pass def test_...
2.78125
3
ikats/manager/timeseries_mgr_.py
IKATS/ikats_api
0
12796434
# -*- coding: utf-8 -*- """ Copyright 2019 CS Systèmes d'Information 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...
1.78125
2
roc.py
dmitryduev/deep-asteroids
8
12796435
import os os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # see issue #152 os.environ["CUDA_VISIBLE_DEVICES"] = "1" import tensorflow as tf from keras.models import model_from_json import json from sklearn.metrics import roc_curve, auc, confusion_matrix import numpy as np import pandas as pd from copy import deepcop...
1.898438
2
test_field.py
pwcberry/footy-simulator-python
0
12796436
<gh_stars>0 import unittest from field import * from data import Team, Skills from status import BallStatus, FieldZone, LateralDirection, Possession class TestField(unittest.TestCase): def setUp(self): self.team_a = Team( # name "AAA", # forwards Skills(0.5...
2.96875
3
trustpayments/models/subscription_version.py
TrustPayments/python-sdk
2
12796437
# coding: utf-8 import pprint import six from enum import Enum class SubscriptionVersion: swagger_types = { 'activated_on': 'datetime', 'billing_currency': 'str', 'component_configurations': 'list[SubscriptionComponentConfiguration]', 'created_on': 'datetime', 'expec...
1.695313
2
Janeiro/008-Digitos-Pares.py
brenodt/Desafio-365-dias-programando
0
12796438
"""Exercício 8: Escreva uma função que receba dois números inteiros (a e b), e retorne uma lista contendo todos os números inteiros cujos dígitos são todos pares (a e b inclusos)""" def digitos_pares(valor_inicial: int = 0, valor_final: int = 1000): saida = [] # usando (valor final + 1) pois a função range n...
3.96875
4
trefoil/examples/csv_pivot.py
icpac-igad/trefoil
9
12796439
""" Example to demonstrate creating a pivot table from the output of zonal stats CLI """ import time import pandas # Return a pipe-delimited combination of value from every column up through zone def get_key(row): key_parts = [] for col in row.keys(): if col == 'zone': return...
3.296875
3
day18/test/test_main.py
JoseTomasTocino/AdventOfCode2020
0
12796440
<filename>day18/test/test_main.py import logging import os.path from day18.code.main import evaluate_expression logger = logging.getLogger(__name__) local_path = os.path.abspath(os.path.dirname(__file__)) sample_input = None def test_sample_input(caplog): # caplog.set_level(logging.INFO) assert evaluate_e...
2.609375
3
210.py
wilbertgeng/LeetCode_exercise
0
12796441
<filename>210.py """210. Course Schedule II""" class Solution(object): def findOrder(self, numCourses, prerequisites): """ :type numCourses: int :type prerequisites: List[List[int]] :rtype: List[int] """ ## Practice: graph = collections.defaultdict(list) ...
3.546875
4
fastapi_sso/sso/kakao.py
thdwoqor/fastapi-sso
0
12796442
<reponame>thdwoqor/fastapi-sso import os from typing import Dict from fastapi_sso.sso.base import OpenID, SSOBase class KakaoSSO(SSOBase): provider = "kakao" scope = ["openid"] version = "v2" async def get_discovery_document(self) -> Dict[str, str]: return { "authorization_endpoi...
2.53125
3
aio_background/job.py
anna-money/aio-background
7
12796443
import abc import asyncio from typing import Collection class Job(abc.ABC): __slots__ = () @property @abc.abstractmethod def is_running(self) -> bool: ... @abc.abstractmethod async def close(self, *, timeout: float = 0.5) -> bool: ... class SingleTaskJob(Job): __slots__...
2.734375
3
ulmo.py
simusid/ulmo
0
12796444
# provide status of all jobs import ulmodb dbname = "ulmodb.db" db = ulmodb.UlmoDB(dbname)
1.25
1
docs/code/snippet_nmf_fro.py
askerdb/nimfa
325
12796445
import numpy as np import nimfa V = np.random.rand(40, 100) nmf = nimfa.Nmf(V, seed="nndsvd", rank=10, max_iter=12, update='euclidean', objective='fro') nmf_fit = nmf()
1.992188
2
ether/qparser.py
alexin-ivan/ether
0
12796446
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- # ############################################################################## from PyQt4 import QtCore import logging ############################################################################## class QParser(QtCore.QThread): def __init__(self, f, pa...
2.265625
2
04_chat/client.py
pymug/ARJ_SpoonfeedingSockets_APR2021
0
12796447
<filename>04_chat/client.py<gh_stars>0 ''' Modified by <NAME> <EMAIL> ''' import socket, threading def handle_messages(connection: socket.socket): ''' Receive messages sent by the server and display them to user ''' while True: try: msg = connection.recv(1024) # If...
3.328125
3
bin/config-get.py
chrisbrierley/jaspy-manager
0
12796448
#!/usr/bin/env python import os import json import sys import argparse def _find_config_file(): config = 'etc/minicondas.json' while not os.path.isfile(config): config = '../{}'.format(config) if len(config) > 70: raise Exception('Cannot locate config file "etc/minicondas.json"...
2.734375
3
tokenizer.py
datares/recipe-gpt
2
12796449
from transformers import GPT2Tokenizer tokenizer = GPT2Tokenizer.from_pretrained('gpt2', bos_token='<|startoftext|>', eos_token='<|endoftext|>', pad_token='<|pad|>') tokenizer.pad_token = tokenizer.eos_token
2.25
2
ete_component/EteComponent.py
marco-mariotti/treedex
0
12796450
# AUTO GENERATED FILE - DO NOT EDIT from dash.development.base_component import Component, _explicitize_args class EteComponent(Component): """An EteComponent component. Keyword arguments: - id (string; required): The ID used to identify this component in Dash callbacks. - activeClades (list of dicts; op...
2.046875
2