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
projects/edgeTeleportTest/edgeTeleportTest.py
Aceheliflyer/Computer-Science
0
54200
app.stepsPerSecond = 60 s = 5; d = Circle(200, 200, 25, fill='purple') def onKeyHold(keys): # Movement Control if ('right' in keys): d.centerX += s if ('left' in keys): d.centerX -= s if ('up' in keys): d.centerY -= s if ('down' in keys): d.centerY += s # Edge Movement if (d.left >= app.ri...
3.546875
4
src/slownie/_slownie.py
karpierz/slownie
1
54201
# Copyright (c) 2016-2020 <NAME> # Licensed under the zlib/libpng License # https://opensource.org/licenses/Zlib import math __all__ = ('slownie', 'slownie_zl', 'slownie_zl100gr') ZERO_LITERALLY = "zero" MINUS_LITERALLY = "minus " HUNDREDS_LITERALLY = [ "", "sto ", "dwie\u015Bcie ", "trzysta ", ...
1.703125
2
wordle/config.py
marcotinacci/wordle-solver
1
54202
<gh_stars>1-10 import os import logging from typing import Final from pathlib import Path SYMBOL_MATCH: Final = "X" SYMBOL_MISPLACED: Final = "." SYMBOL_MISS: Final = "_" MAX_ATTEMPTS: Final = 6 DATA_ROOT = Path(__file__).parent.parent / "data" DEBUG = os.environ.get("DEBUG", False) LOG_LEVEL = logging.DEBUG if DEBUG...
2.15625
2
grr/client/grr_response_client/client_actions/windows/pipes_test.py
khanhgithead/grr
4,238
54203
#!/usr/bin/env python import contextlib import os import platform from typing import Iterator from typing import Optional import uuid from absl.testing import absltest from grr_response_client.client_actions.windows import pipes if platform.system() == "Windows": # pylint: disable=g-import-not-at-top # pytype: d...
2.03125
2
final_learn_korean/classes.py
juliapochynok/LearnKorean_project
1
54204
from arrays import DynamicArray import fileinput import random class WordController: ''' Class representation of WordController ''' def __init__(self, fl): ''' Creates new WordController :type fl: str :param fl: user txt file ''' self._file = fl def...
3.75
4
planet/data.py
pvrancx/pytorch
0
54205
<filename>planet/data.py import torch.utils.data as data from PIL import Image import os import os.path import glob import csv import torchvision.transforms as transforms import torch def get_labels(fname): with open(fname,'r') as f: labels = [t.strip() for t in f.read().split(',')] labels2idx = {t:i...
2.734375
3
Materiais/Semana 4/SurfDB.py
renebentes/Python4Zumbis
0
54206
<reponame>renebentes/Python4Zumbis import sqlite3 banco = sqlite3.connect("surfersDB.sdb") banco.row_factory = sqlite3.Row cursor = banco.cursor() cursor.execute('''select name, average from surfers where age > 20 order by average desc''') linhas = cursor.fetch...
3.34375
3
setup.py
testmailqwerty12/fwdform2
6
54207
<filename>setup.py #!/usr/bin/env python3 from app import db db.create_all()
1.109375
1
tools_2/work_flow/test_flow.py
hukefei/chongqing_contest
1
54208
<gh_stars>1-10 #!/usr/bin/env python # encoding:utf-8 """ author: liusili @l@icense: (C) Copyright 2019, Union Big Data Co. Ltd. All rights reserved. @contact: <EMAIL> @software: @file: test_flow @time: 10/18/19 @desc: test the model """ from preprocess.datasets.voc2coco import Voc2Coco from data_explore.category_distr...
2.140625
2
pyleaves/train/csv_datasets_train.py
JacobARose/pyleaves
3
54209
""" Created on Tue Mar 17 03:23:32 2019 script: /pyleaves/pyleaves/train/csv_datasets_train.py @author: JacobARose """ def main(experiment_config, experiment_results_dir): ############################################ #TODO: Moving towards defining most or all run parameters in separate config files ##...
2.125
2
mysite/CustomerApps/migrations/0004_auto_20201207_2301.py
denandreychuk/Django
0
54210
# Generated by Django 3.1.4 on 2020-12-07 21:01 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('CustomerApps', '0003_auto_20201207_1922'), ] operations = [ migrations.RemoveField( model_name='customerapp', name='...
1.445313
1
frameworks/hdfs/tests/test_shakedown.py
akshitjain/dcos-commons_edited
0
54211
import pytest import time import xml.etree.ElementTree as etree import shakedown import sdk_cmd as cmd import sdk_hosts as hosts import sdk_install as install import sdk_marathon as marathon import sdk_plan as plan import sdk_tasks as tasks import sdk_utils as utils from tests.config import * def setup_module(modul...
1.867188
2
python/lib/pushtx_merchant.py
AYCH-Inc/aych.bit-merchant
3
54212
#!/usr/bin/env python # coding: utf-8 # The MIT License (MIT) # # Copyright (c) 2016 BTC.<EMAIL> # # 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 limi...
1.796875
2
policypools/_thread.py
alexanderepstein/PolicyPools
0
54213
<filename>policypools/_thread.py from abc import ABC from threading import Lock, Thread from policypools.base import PolicyPool __all__ = ['DiscardNewestThreadPool', 'DiscardOldestThreadPool', 'DiscardThisThreadPool'] class PolicyThreadPool(PolicyPool, ABC): def __init__(self, max_q_size: int, max_workers: int...
2.765625
3
tests/parser/static/test_instrument_templates/test_instrument_templates.py
ganeshutah/FPChecker
19
54214
import os import pathlib import sys import subprocess sys.path.insert(1, str(pathlib.Path(__file__).parent.absolute())+"/../../../../parser") #sys.path.insert(1, '/usr/workspace/wsa/laguna/fpchecker/FPChecker/parser') from tokenizer import Tokenizer source = "compute_inst.cu" def setup_module(module): THIS_DIR = o...
2.4375
2
declarative/version.py
mccullerlp/python-declarative
6
54215
""" """ from __future__ import division, print_function, unicode_literals version_info = (1, 3, 2) version = '.'.join(str(v) for v in version_info) __version__ = version
2.09375
2
ros/src/waypoint_updater/gt_tl_publisher.py
yasser888/CarND-Capstone
0
54216
#!/usr/bin/env python import rospy from geometry_msgs.msg import PoseStamped from styx_msgs.msg import Lane, TrafficLightArray , TrafficLight from std_msgs.msg import Int32 import numpy as np from threading import Thread, Lock from copy import deepcopy class GT_TL_Pub(object): def __init__(self): rospy.in...
2.3125
2
mdssdk/parsers/interface/show_interface_transceiver_detail.py
akshatha-s13/mdssdk
4
54217
<gh_stars>1-10 import logging import re log = logging.getLogger(__name__) ALL_PAT = [ "^fc\d+\/\d+\s+(?P<sfp_present>.*)", "Name is (?P<name>\S+)", "Manufacturer's part number is (?P<part_number>\S+)", "Cisco extended id is (?P<cisco_id>.*)", "Cisco part number is (?P<cisco_part_number>\S+)", ...
2.671875
3
geoana/kernels/setup.py
simpeg/geoana
11
54218
<gh_stars>10-100 import os def configuration(parent_package="", top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration("kernels", parent_package, top_path) # Conditionally add subpackage if intending to build compiled components if os.environ.get('BUILD_GEOANA_EXT',...
1.921875
2
UServer/script_count_gateway.py
soybean217/lora-python
0
54219
<reponame>soybean217/lora-python<filename>UServer/script_count_gateway.py from database.db2 import db2, ConstDB2 from database.db4 import db4, ConstDB4 import random def count(category): category += '_' keys = db2.keys(category + ConstDB4.GW + '*') for key in keys: id = key.decode().split(':')[1] ...
2.1875
2
society/migrations/0008_auto_20190204_1104.py
JeekStudio/StudentPlatform
4
54220
<filename>society/migrations/0008_auto_20190204_1104.py # Generated by Django 2.1.4 on 2019-02-04 11:04 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('student', '0003_student_password_changed'), ('society', '000...
1.617188
2
medusa/func/keyword_only.py
deadwind4/medusa
0
54221
def foo(a, b, *, bar=True): print(bar) # 直接调用报错 foo(1, 2, 3)
2.390625
2
binary-classification/datasets/clean_data.py
Alex-Lekov/AutoML-Benchmark
34
54222
<gh_stars>10-100 import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import json from category_encoders import OneHotEncoder def preproc_data(data, features): ''' Simple preproc data:* LabelEncoded target * One Hot Encoding cat_fea...
2.953125
3
glint_backup/glintargparse.py
m-conklin/glint
3
54223
''' Created on Nov 20, 2014 @author: ronaldjosephdesmarais ''' import argparse class GlintArgumentParser: parser=None def __init__(self): print "Init GlintArgumentParser" self.parser = argparse.ArgumentParser(description='Glint\'s Backup Argument Parser') def init_restore_arg_parser(...
2.546875
3
venv/lib/python3.6/site-packages/ansible_collections/azure/azcollection/plugins/modules/azure_rm_eventhub.py
usegalaxy-no/usegalaxy
1
54224
<filename>venv/lib/python3.6/site-packages/ansible_collections/azure/azcollection/plugins/modules/azure_rm_eventhub.py #!/usr/bin/python # # Copyright (c) 2021 <NAME>(@praveenghuge) <NAME>(@karldas30) <NAME> (@saurabh3796) # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) f...
1.742188
2
python/process_simulation/src/defender/defender.py
amir-heinisch/snippets
0
54225
<gh_stars>0 """ The is the abstract defender base class. A defender can see all values at the beginning of each simulation round and can try to detect an attack. It is also possible to first let the defender learn before running an attack. """ from abc import ABC, abstractmethod __author__ = '<N...
3.84375
4
allhub/search/__init__.py
srinivasreddy/allhub
2
54226
# flake8: NOQA from .search import ( Order, LabelSort, CodeSort, CommitSort, IssueSort, RepoSort, UserSort, SearchMixin as _SearchMixin, ) from allhub.util import ConflictCheck class SearchMixin(_SearchMixin, metaclass=ConflictCheck): pass
1.328125
1
src/ryba/rotators/_date.py
timheap/ryba
0
54227
import collections import datetime import typing as t import attr from .. import targets from ._base import Rotator, Verdict class _SupportsLessThan(t.Protocol): def __lt__(self, __other: t.Any) -> bool: ... TValue = t.TypeVar("TValue", bound=_SupportsLessThan) Count = t.Union[int, t.Literal["all"]] @attr.s...
2.1875
2
third_party/typ/typ/tests/artifacts_test.py
chandakumari/catapult
0
54228
# Copyright 2019 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
2.25
2
grokking-the-coding-interview/two-heaps/Sliding-Window-Median-(hard).py
huandrew99/LeetCode
36
54229
""" LC 480 Given an array of numbers and a number ‘k’, find the median of all the ‘k’ sized sub-arrays (or windows) of the array. Example 1: Input: nums=[1, 2, -1, 3, 5], k = 2 Output: [1.5, 0.5, 1.0, 4.0] Explanation: Lets consider all windows of size ‘2’: [1, 2, -1, 3, 5] -> median is 1.5 [1, 2, -1, 3, 5] -> media...
3.90625
4
Class 12/Data Structures/data_files_Q1.py
itsezsid/computer-science
0
54230
<filename>Class 12/Data Structures/data_files_Q1.py<gh_stars>0 # Q1 def is_Empty(stack): if stack == []: return True else: return False def pop(stack): if is_Empty(stack): print("Underflow") else: item = stack.pop() print(item, 'is popped') ...
4.0625
4
Code_Plot.py
Chenwithcats/Data-Collection-and-Analysis-of-Rental-Real-Estate-in-Shanghai
0
54231
import pandas as pd import re import matplotlib.pyplot as plt import matplotlib.ticker as ticker #from bokeh.plotting import figure, output_file, show houses = pd.read_csv("out_4.1.csv",index_col=0) houses.sort_values('具体日期',inplace=True) houses = houses.iloc[1:] print(re.search(r"(\d+-\d+)(-\d+)", houses['具体日期...
2.65625
3
bullet.py
Steven-Kha/Space-Invasion
0
54232
<gh_stars>0 import pygame from pygame.sprite import Sprite class Bullet(Sprite): """A class to manage bullets fired from the ship""" # Sprite argument allows us to initialize it using group def __init__(self, ai_settings, screen, ship): """Create a bullet object at the ship's current position.""" ...
4.125
4
linked-list/intersection/intersection.py
jcockbain/daily-coding-problem
0
54233
<reponame>jcockbain/daily-coding-problem class LinkedListNode: def __init__(self, val): self.val = val self.next = None def intersection(a, b): nodes = set() while a is not None: nodes.add(a.val) a = a.next while b is not None: if b.val in nodes: r...
3.78125
4
solarforecastarbiter/io/fetch/tests/test_init.py
dplarson/solarforecastarbiter-core
22
54234
import multiprocessing as mp import os import subprocess import time import pytest from solarforecastarbiter.io import fetch def badfun(): raise ValueError def bad_subprocess(): subprocess.run(['cat', '/nowaythisworks'], check=True, capture_output=True) @pytest.mark.asyncio @pytest.mark.parametrize('ba...
2.25
2
src/fastapi/src/intarface/view/prize.py
ojos/python-devenv
0
54235
from fastapi import APIRouter, Depends from fastapi.responses import ORJSONResponse from di import GetPrizeInteractorFactory from domain.entity import Prize, PrizeResponse, ValidationErrorResponse, now from usecase.interactor import GetPrizeInteractor router = APIRouter() @router.get( "/{user_id}", response...
2.203125
2
main.py
prokan468/googleclassesautobot
1
54236
import webbrowser import pyautogui as magic from datetime import datetime import time import sys import yaml sys.tracebacklimit=0 settings_path="setting.yaml" with open(settings_path) as f: settings = yaml.load(f, Loader=yaml.FullLoader) alltimings = settings['alltimings'] timing = alltimings['s...
2.5
2
examples/operator_matmul.py
igfish/toyvm
0
54237
# TODO class A: def __init__(self, value): self.value = value def __matmul__(self, other): print('__matmul__') return A(self.value * other.value) def __imatmul__(self, other): print('__imatmul__') self.value *= other.value return self a = A(1) b = A(2) p...
3.921875
4
DownloadPlayonRecordings.py
Afisher21/LinuxPlayonDownloader
0
54238
#!/usr/bin/env python3 #-*- coding: utf-8 -*- # # PlayonCloud recorder # # update-alternatives --install /usr/bin/python python /usr/bin/python3.7 2 # sudo apt-get install chromium-chromedriver # sudo apt-get install libxml2-dev libxslt-dev python-dev # which python3 (make sure that path is /usr/bin/python3) # # Fin...
1.921875
2
netharn/util/util_torch.py
angiemsu/netharn
0
54239
import numpy as np import torch class ModuleMixin(object): """ Adds convenince functions to a torch module """ def number_of_parameters(self, trainable=True): return number_of_parameters(self, trainable) def number_of_parameters(model, trainable=True): """ Returns number of trainable...
2.875
3
Proyecto/main.py
leynier/IA-Sim-Com
0
54240
<filename>Proyecto/main.py from sys import path from compilation.tokenizer import Tokenizer from compilation.utils import split_lines from compilation.parser import Parser from simulation.environment import Environment from simulation.track import Track from simulation.rider import Rider from simulation.bike import B...
2.59375
3
flask_chassis/__init__.py
dabarrell/flask-microservice-chassis
2
54241
<reponame>dabarrell/flask-microservice-chassis from .flask_chassis import FlaskChassis from .utils import get_redis, get_db, _get_chassis __version__ = '0.1'
0.917969
1
textSearchApi.py
kamesh27/maps-api-calls
0
54242
# -*- coding: utf-8 -*- """ Created on Mon Jul 16 22:08:33 2018 @author: <NAME> """ import urllib.request import json inputType = 'textquery' endpoint = 'https://maps.googleapis.com/maps/api/place/textsearch/json?' search_key = input('What do you want to search for?: ').replace('','+') api_key=input('Enter your API K...
3.5
4
lib/Parser.py
gabsmoreira/tornado-docs-generator
0
54243
from Tokenizer import Tokenizer from writer import MKDocsWriter import json import jsonutils class Parser: def run(code, file, path): Parser.tokens = Tokenizer(code) Parser.file = file Parser.writer = MKDocsWriter() Parser.path = path ret = Parser.parseDocstring() re...
2.96875
3
scripts/ScrapeScripts/PullFromYoutube2.py
yujerry24/CS348
0
54244
<filename>scripts/ScrapeScripts/PullFromYoutube2.py<gh_stars>0 import json import requests import time from bs4 import BeautifulSoup with open("DATA/ForYT.json", "r") as f: songs = json.load(f) print("ForYT Done") print("SIZE: " + str(len(songs))) with open("DATA/Videos2.json", "r") as f: videos = json.lo...
3.078125
3
Lab02/test.py
edwardfang/SUSTech_CS305_Computer_Networking
2
54245
#!/usr/bin/env python3 ''' test all the class and function ''' import unittest from StudentList import StudentList, StudentList15 from Textprocessor import Textprocessor from NetworkSolution import NetworkSolution class TestStudentList(unittest.TestCase): ''' Test all ''' def test_student_list(self):...
3.265625
3
mps_history/models/input_history.py
slaclab/mps_history
0
54246
<gh_stars>0 from sqlalchemy import Column, Integer, String, DateTime from mps_database.models import Base import datetime class InputHistory(Base): """ InputHistory class (input_history table) Input data collected from the central node All derived data is from the mps_configuration database. Properties:...
2.890625
3
10scrapy/qsbk/start.py
lixiang30/SpiderProject
0
54247
from scrapy import cmdline cmdline.execute("scrapy crawl qsbk_spider".split()) # cmdline.execute(["scrapy","crawl","qsbk_spider"])
1.898438
2
intro/matplotlib/examples/plot_plot_ex.py
jorisvandenbossche/scipy-lecture-notes
3
54248
<reponame>jorisvandenbossche/scipy-lecture-notes import pylab as pl import numpy as np n = 256 X = np.linspace(-np.pi, np.pi, n, endpoint=True) Y = np.sin(2 * X) pl.axes([0.025, 0.025, 0.95, 0.95]) pl.plot(X, Y + 1, color='blue', alpha=1.00) pl.fill_between(X, 1, Y + 1, color='blue', alpha=.25) pl.plot(X, Y - 1, co...
3.390625
3
ros/src/robot_evaluator/src/main.py
jkulhanek/robot-visual-navigation
13
54249
<reponame>jkulhanek/robot-visual-navigation<filename>ros/src/robot_evaluator/src/main.py #!/usr/bin/env python from sensor_msgs.msg import Image from std_msgs.msg import Int32,String from controller import Controller from robot_agent_msgs.msg import ComputeStepRequest from convert import convert_image import rospy imp...
2.5
2
DisNetRNN_2.py
volpepe/DisNet
27
54250
<reponame>volpepe/DisNet import os import cv2 import random import colorsys import numpy as np import keras.backend as k from timeit import time from keras.models import Sequential, Model, load_model from keras.layers import Input, LSTM, Dense, Reshape, Dropout,GRU from sklearn.utils.linear_assignment_ import linear_...
2.015625
2
main/pcse/settings/default_settings.py
jajberni/pcse_web
3
54251
<gh_stars>1-10 # -*- coding: utf-8 -*- # Copyright (c) 2004-2014 Alterra, Wageningen-UR # <NAME> (<EMAIL>), April 2014 """Settings for PCSE Default values will be read from the files 'pcse/settings/default_settings.py' User specific settings are read from '$HOME/.pcse/user_settings.py'. Any settings defined in user se...
2.515625
3
app/users/api/tests.py
DakobedBard/Bookings
0
54252
<reponame>DakobedBard/Bookings import json from django.urls import reverse from rest_framework.authtoken.models import Token from rest_framework.test import APITestCase from rest_framework import status from rooms.models import Room from utils.test_utils.date_seeder import DataSeeder class RoomTestCase(APITestCase): ...
2.234375
2
slack_sdk/web/__init__.py
priya1puresoftware/python-slack-sdk
2,486
54253
<gh_stars>1000+ """The Slack Web API allows you to build applications that interact with Slack in more complex ways than the integrations we provide out of the box.""" from .client import WebClient # noqa from .slack_response import SlackResponse # noqa
1.390625
1
Cryptography/2.Hill Codes New/driver.py
swethapraba/SeniorYearCSElectives
0
54254
ffrom sympy import * # import MatrixCiphers from MatrixCiphers import * from Cryptoalpha import * print("-"*50) print("Testing Hill Codes") code1 = Cryptoalpha("ABCDEFGHIJKLMNOPQRSTUVWXYZ!' ") plaintext = "Don't Mine at Night!" E = Matrix([[4,19],[13,10]]) ciphertext = encrypt(E, plaintext, code1) print("'%s' encodes ...
3.03125
3
A_source_code/core/make_y0.py
vanHoek-dgnm/CARBON-DISC
0
54255
# ****************************************************** ## Revision "$LastChangedDate: 2018-07-08 18:08:17 +0200 (zo, 08 jul 2018) $" ## Date "$LastChangedRevision: 1 $" ## Author "$LastChangedBy: arthurbeusen $" ## URL "$HeadURL: https://pbl.sliksvn.com/dgnm/core/make_y0.py $" ## Copyright 2019, PBL Netherlands Envir...
2.03125
2
TermRelations/anotation/anotacion_patri.py
pmchozas/llod4lion
0
54256
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Sep 16 17:58:56 2020 @author: pmchozas """ import nltk from nltk.stem.snowball import SnowballStemmer f=open('legal_verbs.txt', 'r', encoding='utf-8') file=open('estatuto_es.txt', 'r', encoding='utf-8') read=file.readlines() new=open('estatuto_es...
3.21875
3
parlai/agents/programr/parser/template/nodes/richmedia/list.py
roholazandie/ParlAI
0
54257
from parlai.agents.programr.parser.template.nodes.base import TemplateNode # from parlai.agents.programr.utils.logging.ylogger import YLogger import parlai.utils.logging as logging from parlai.agents.programr.utils.text.text import TextUtils class TemplateListNode(TemplateNode): def __init__(self): super...
2.25
2
examples/Keras_issue_14043.py
Ankuraxz/keras
0
54258
# After tensorflow 2, keras is being used in Backend # comment shows an alternative way to run the command #Documentation:- https://keras.io/api/datasets/cifar10/ # Version for your reference, Downgrade/ Ugrade/ Reinstall Accordingly import keras print(keras.__version__) #2.2.4 in my case from keras.datasets ...
3.1875
3
mutation_list.py
Tierprot/Jpred-Selenium-Firefox-Friendship
0
54259
<reponame>Tierprot/Jpred-Selenium-Firefox-Friendship __author__ = 'Tierprot' class MutGen(): AA_voc = ["G", "A", "V", "L", "I", "P", "F", "Y", "W", "S", "T", "C", "M", "N", "Q", "K", "R", "H", "D", "E"] def __init__(self, input_file, vocabulary=None, positions=None): try: ...
2.421875
2
airdrop/alembic/versions/1468fd5ca2be_addreceiptonregistrationtable.py
anandrgitnirman/airdrop-services
0
54260
"""AddreceiptOnRegistrationTable Revision ID: 1468fd5ca2be Revises: 3dd<PASSWORD>4<PASSWORD> Create Date: 2022-02-24 22:33:14.628454 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '1468fd5ca2be' down_revision = '3dd70974<PASSWORD>' branch_labels = None depends...
1.21875
1
Hardware/ComputedPattern/computedDiffractionPattern.py
MarijnVenderbosch/MScProject
0
54261
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jan 9 15:49:08 2022 Script plots computed pattern from GSW algorithm as well as phasemask that provides it @author: marijn """ #%% Imports from PIL import Image import numpy as np import matplotlib.pyplot as plt from matplotlib import cm from mpl_too...
2.59375
3
standingssync/tests/test_views.py
buahaha/aa-standingssync
0
54262
<filename>standingssync/tests/test_views.py from unittest.mock import Mock, patch from django.contrib.auth.models import User from django.contrib.sessions.middleware import SessionMiddleware from django.test import RequestFactory, TestCase from django.urls import reverse from esi.models import Token from allianceauth...
2.109375
2
aiida_lsmo/workchains/cp2k_multistage_ddec.py
mbercx/aiida-lsmo
2
54263
# -*- coding: utf-8 -*- """Cp2kMultistageDdecWorkChain workchain""" from aiida.plugins import CalculationFactory, DataFactory, WorkflowFactory from aiida.common import AttributeDict from aiida.engine import WorkChain, ToContext from aiida_lsmo.utils import aiida_dict_merge # import sub-workchains Cp2kMultistageWorkCh...
2.03125
2
test_web/test_api.py
Techcable/minecraft-mappings
0
54264
<gh_stars>0 import requests import os TARGETS = [ "spigot2srg", "spigot2srg-onlyobf", "spigot2mcp", "spigot2mcp-onlyobf", "obf2mcp", "mcp2obf" ] BASE_URL = "http://localhost:8000" MCP_VERSION = "snapshot_nodoc_20180925" MINECRAFT_VERSION = "1.13" def main(): request = { "minecraft...
2.4375
2
Scripts/reflect.py
yushroom/FishEngine-ECS
10
54265
<reponame>yushroom/FishEngine-ECS import clang.cindex import sys, os import json if sys.platform == 'darwin': libclang_path = R'/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib' #libclang_path = R'/Users/yushroom/Downloads/llvm-3.9.1.src/build/lib/libclang.dylib' ...
1.796875
2
ibsng/handler/bw/update_interface.py
ParspooyeshFanavar/pyibsng
6
54266
<reponame>ParspooyeshFanavar/pyibsng """Update interface API method.""" from ibsng.handler.handler import Handler class updateInterface(Handler): """Updat interface class.""" def control(self): """Validate inputs after setup method. :return: None :rtype: None """ self...
2.453125
2
geoevents/core/contextprocessors.py
mcenirm/geoevents
25
54267
# This technical data was produced for the U. S. Government under Contract No. W15P7T-13-C-F600, and # is subject to the Rights in Technical Data-Noncommercial Items clause at DFARS 252.227-7013 (FEB 2012) from geoevents.core.models import Setting import json def app_settings(request): """Global values to pass t...
1.859375
2
torchvision/datasets/kinetics.py
hongzhen1/vision
2
54268
from .video_utils import VideoClips from .utils import list_dir from .folder import make_dataset from .vision import VisionDataset class KineticsVideo(VisionDataset): def __init__(self, root, frames_per_clip, step_between_clips=1): super(KineticsVideo, self).__init__(root) extensions = ('avi',) ...
2.375
2
pyvo/dal/tests/test_params.py
tomdonaldson/pyvo
1
54269
#!/usr/bin/env python # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for pyvo.dal.datalink """ from functools import partial from urllib.parse import parse_qsl from pyvo.dal.adhoc import DatalinkResults from pyvo.dal.params import find_param_by_keyword, get_converter from pyvo.dal.exceptions...
2.0625
2
widgets/email_setup_window.py
pihentagyu/fd_replicator
0
54270
<filename>widgets/email_setup_window.py from PyQt5.QtWidgets import * class EmailForm(QWidget): def __init__(self): QWidget.__init__(self) #self.form_widget = QWidget(self) self.form_group_box = QGroupBox('Email Setup') #self.grid = QGridLayout() self.setWindowTitle('Edit ...
2.71875
3
src/gui/video_frame.py
tschalch/pyTray
1
54271
<filename>src/gui/video_frame.py #!/usr/bin/env python import wx from lib.videocapture.VideoCapture import Device from PIL import Image, ImageOps import time from buffered_window import BufferedWindow import os.path class VideoWindow(BufferedWindow): def __init__(self, parent, cam, id = -1): ...
2.859375
3
compose/config/serialize.py
matthieudelaro/dockernut
1
54272
from __future__ import absolute_import from __future__ import unicode_literals import six import yaml from compose.config import types def serialize_config_type(dumper, data): representer = dumper.represent_str if six.PY3 else dumper.represent_unicode return representer(data.repr()) yaml.SafeDumper.add_re...
2.109375
2
DSA Learning Series/Divide and Conquer + Binary Search/Lowest Sum (LOWSUM)/lowest_sum.py
Ekalaivanpj/codechef
4
54273
for _ in range(int(input())): k, q = map(int, input().split()) mot = sorted(list(map(int, input().split()))) sat = sorted(list(map(int, input().split()))) qs = [] for i in range(q): qs.append(int(input())) gen = [mot[i]+sat[j] for i in range(k) for j in range(min(k, 10001//(i+1)))] ...
2.453125
2
Coursera/MIPT_Python/Week02_Task01.py
zakhars/Education
0
54274
import os import sys import tempfile import json if '--key' not in sys.argv or len(sys.argv) < 3: print('No key specified') sys.exit(-1) key_name = sys.argv[2] if sys.argv[1] == '--key' else sys.argv[4] val = None if '--val' in sys.argv: val = sys.argv[2] if sys.argv[1] == '--val' else sys.argv[4] wanna_s...
3.0625
3
Lecture1/euler.py
quao627/AGRI9999-Seminar-in-Python
2
54275
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Estimation methods for the Euler Number""" def series(n_terms=1000): """Estimate e with series: 1/1 + 1/1 + 1/(1*2) + 1/(1*2*3) + ...""" def factorial(n): result = 1 for i in range(1, n+1): result *= i return result prin...
3.78125
4
GOTE/utils/logger.py
Lenferd/ANSYS-OpenFOAM
0
54276
from enum import IntEnum class LogLvl(IntEnum): LOG_ERROR = 0 LOG_INFO = 1 LOG_DEBUG = 2 def to_str(self): return "[" + self.name + "] " class Logger: def __init__(self, log_lvl=LogLvl.LOG_INFO): self.log_lvl = log_lvl def log(self, msg_log_lvl=LogLvl.LOG_INFO, message=""):...
3.046875
3
FEBDAQMULTx2/data_analysis/10_caen_daq_data/plot_totalgain_vs_bias_for_breakdown.py
kaikai581/t2k-mppc-daq
0
54277
#!/usr/bin/env python import uproot class DAQFile: def __init__(self, infpn): ''' Constructor in charge of loading a data file. ''' tr_mppc = uproot.open(infpn)['mppc'] self.df = tr_mppc.arrays(library='pd') # store the input file pathname self.infpn = infp...
2.5625
3
backend/app/__init__.py
tamasf97/Platform
1
54278
<reponame>tamasf97/Platform __all__ = ['models', 'api']
1.054688
1
utils/get_data.py
qu4nt/ragnarok-map-efficiency
0
54279
from pathlib import Path from glob import glob import pickle from dataclasses import dataclass import pandas as pd import numpy as np from tqdm import tqdm from db_models import session, Item @dataclass class ItemData: """Data for Items.""" name: str = "" item_id: int = 0 type: str = "" # Detai...
2.40625
2
pred/webserver/customjob.py
Duke-GCB/PredictionsDB
0
54280
""" Allows manipulation of custom jobs. Jobs include creating predictions or preferences for a custom sequence. """ import uuid import datetime from pred.queries.dbutil import update_database, read_database from pred.webserver.customresult import CustomResultData class JobStatus(object): """ States a job can...
2.75
3
norns/__about__.py
simonvh/norns
0
54281
"""Metadata""" __version__ = '0.1.4' __author__ = "<NAME>"
0.972656
1
Despliegue/server-agentes/traffic_light_agent.py
MarianaS8a/Bright
0
54282
from mesa import Agent,Model import time class TrafficLightAgent(Agent): def __init__(self, unique_id: int, model: Model) -> None: super().__init__(unique_id, model) self.lightColor = False def turnGreen(self): self.lightColor = True def getLight(self): ret...
2.625
3
bot/peripherals/dht/dht.py
kaulketh/greenhouse
8
54283
<gh_stars>1-10 #!/usr/bin/python # -*- coding: utf-8 -*- # dht.py """ [#11] Add and implement the measurement of temperature and humidity author: <NAME>, <EMAIL> """ from __future__ import absolute_import import Adafruit_DHT import conf.greenhouse_config as conf import logger.logger as log logging = log.get_logger() ...
2.5625
3
src/ticket.py
tinlun/Helpdesk-slackbot
0
54284
import string from rt import * from listener import Listener import traceback import pytz from datetime import datetime class Ticket: def __init__(self, client): self.client = client Listener.register(self.on_ready, "on_ready") Listener.register(self.on_message, "on_message") Liste...
2.359375
2
final_project/server.py
tarka-projects/xzceb-flask_eng_fr
0
54285
# -*- coding: utf-8 -*- """ Created on Wed Dec 8 12:16:53 2021 @author: M.Tarka """ from machinetranslation import translator from flask import Flask, render_template, request #import json app = Flask("Web Translator") @app.route("/englishToFrench") def english_to_french(): textToTranslate = r...
3.171875
3
hata/discord/http/headers.py
Multiface24111/hata
173
54286
__all__ = () from ...backend.utils import istr AUDIT_LOG_REASON = istr('X-Audit-Log-Reason') RATE_LIMIT_REMAINING = istr('X-RateLimit-Remaining') RATE_LIMIT_RESET = istr('X-RateLimit-Reset') RATE_LIMIT_RESET_AFTER = istr('X-RateLimit-Reset-After') RATE_LIMIT_LIMIT = istr('X-RateLimit-Limit') # to send RATE_LIMIT_PR...
1.664063
2
kon/__init__.py
TIXhjq/CTR_Function
12
54287
#!/usr/bin/env python # _*_ coding:utf-8 _*_ '''================================= @Author :tix_hjq @Date :2020/7/21 上午9:00 @File :__init__.py.py @email :<EMAIL> or <EMAIL> ================================='''
1.1875
1
sqlpie/controllers/search_controller.py
lessaworld/sqlpie
3
54288
# -*- coding: utf-8 -*- """ SQLpie License (MIT License) Copyright (c) 2011-2016 <NAME>, http://sqlpie.com See LICENSE file. """ from flask import Response import json import sqlpie class SearchController(sqlpie.BaseController): @staticmethod @sqlpie.BaseController.controller_wrapper def service_index(...
2.4375
2
proxyclient/tools/reboot.py
EricRabil/m1n1
1,604
54289
<filename>proxyclient/tools/reboot.py<gh_stars>1000+ #!/usr/bin/env python3 # SPDX-License-Identifier: MIT import sys, pathlib sys.path.append(str(pathlib.Path(__file__).resolve().parents[1])) from m1n1.setup import * p.reboot()
1.4375
1
Tools/Scripts/pycordexer/utilities/rotate.py
taobrienlbl/RegCM
27
54290
import numpy as np __copyright__ = 'Copyright (C) 2018 ICTP' __author__ = '<NAME> <<EMAIL>>' __credits__ = ["<NAME>", "<NAME>"] def get_x(lon, clon, cone): if clon >= 0.0 and lon >= 0.0 or clon < 0.0 and lon < 0.0: return np.radians(clon - lon) * cone elif clon >= 0.0: if abs(clon - lon + 3...
2.609375
3
loafang/parser.py
Adwaith-Rajesh/loafang
3
54291
from typing import Any from typing import Dict from typing import List from typing import Optional from typing import Tuple from typing import Union from ._const import METHODS from ._dataclasses import ExecutionBlock from ._dataclasses import ParserState from ._parsers import BlockParser from .methods import Methods ...
2.140625
2
cifar/models/preact_resnet.py
maximilianigl/rl-iter
10
54292
<gh_stars>1-10 '''Pre-activation ResNet in PyTorch. Reference: [1] <NAME>, <NAME>, <NAME>, <NAME> Identity Mappings in Deep Residual Networks. arXiv:1603.05027 ''' import torch import torch.nn as nn import torch.nn.functional as F from torch.distributions import Normal from torch.distributions.kl import kl_diverge...
2.609375
3
dupgee/create.py
ahmetkotan/dupgee
40
54293
import os import shutil def move_files(files, src_prefix, dst_prefix, app_name): for file_name, attributes in files.items(): file_path = os.path.join(src_prefix, file_name) dest_path = os.path.join(dst_prefix, file_name) if attributes["static"]: shutil.copy(file_path, dest_path...
2.59375
3
setup.py
Osper/keyfree
11
54294
from setuptools import setup, find_packages import os setup_dir = os.path.dirname(__file__) readme_path = os.path.join(setup_dir, 'README.rst') version_path = os.path.join(setup_dir, 'keyfree/version.py') requirements_path = os.path.join(setup_dir, "requirements.txt") requirements_dev_path = os.path.join(setup_dir, "...
1.53125
2
src/schnetpack/datasets/md17.py
nicoliKim/schnetpack
0
54295
import logging import os import shutil import tempfile from urllib import request as request from urllib.error import HTTPError, URLError from ase import Atoms import numpy as np from schnetpack.data import AtomsData from schnetpack.environment import SimpleEnvironmentProvider class MD17(AtomsData): """ MD1...
2.765625
3
pytorch_lightning_spells/__init__.py
veritable-tech/pytorch-lightning-spells
5
54296
import pytorch_lightning as pl from . import callbacks from . import loggers from . import losses from . import optimizers from . import utils from . import lr_schedulers from . import metrics from . import samplers from .version import ( __version__, __docs__, __author__, __author_email__, __licen...
2.171875
2
RPN.py
elbert-xiao/RFCN-Pytorch
11
54297
<reponame>elbert-xiao/RFCN-Pytorch import torch.nn as nn import numpy as np from torch.nn import functional as F from utils.bbox_tools import generate_anchor_base from utils.creator_tool import ProposalCreator def _enumerate_shifted_anchor(anchor_base, feat_stride, height, width): """ Enumerate all shifted a...
2.390625
2
DroneOS/buildroot/system/skeleton/root/mytest.py
TechV/DroneOS
1
54298
#!/usr/bin/python import time from motor import motor from RPIO import PWM PWM.setup() PWM.init_channel(0) #where 17 is GPIO17 = pin 11 # First we specify which gpio pins our motors are on and set our pwm accordingly mymotor1 = motor('m1', 23, simulation=False) mymotor2 = motor('m2', 17, simulation=False) mymotor3 = m...
3.234375
3
junsu/battle_ai_test/WebClientServer.py
GreedyOsori/Chat
0
54299
import tornado.websocket import tornado.ioloop from Room import Room class WebClientServer(tornado.websocket.WebSocketHandler): def initialize(self, web_client_list=set(), battle_ai_list=dict(), player_server=None): self.web_client_list = web_client_list # set() self.battle_ai_list = battle_ai_li...
2.5
2