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
main.py
kornaev/spirograph
0
12764151
<filename>main.py # -*- coding: utf-8 -*- """ Created on Sat Apr 25 17:48:47 2020 @author: crazY """ import sys from time import sleep from PyQt5 import QtGui, QtWidgets import mainwindow from spirograph import spirograph M = 3 # scale multiplyer pen_outer = QtGui.QPen(QtGui.QColor('red')) pen_inner = QtGui.QPen(Q...
2.3125
2
switch.py
yangchuansheng/WSL-Distribution-Switcher
1,917
12764152
#!/usr/bin/env python3 # coding=utf-8 import glob import sys import os.path import subprocess from utils import Fore, parse_image_arg, probe_wsl, get_label, path_trans, handle_sigint # handle arguments handle_sigint() if len(sys.argv) < 2: # print usage information print('usage: ./switch.py image[:tag]') # che...
2.40625
2
Networking/Packets/Incoming/PingPacket.py
henriquelino/pyrelay
26
12764153
<gh_stars>10-100 class PingPacket: def __init__(self): self.type = "PING" self.serial = 0 def read(self, reader): self.serial = reader.readInt32()
2.375
2
Torrents/migrations/0005_auto_20200607_1345.py
tabish-ali/torrent_site
1
12764154
# Generated by Django 3.0.7 on 2020-06-07 13:45 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('Torrents', '0004_auto_20200607_1344'), ] operations = [ migrations.AlterField( model_name='uploadtorrents', name='up...
1.375
1
test/mitmproxy/test_platform_pf.py
dolfly/mitmproxy
9
12764155
import sys from mitmproxy.platform import pf from . import tutils class TestLookup: def test_simple(self): if sys.platform == "freebsd10": p = tutils.test_data.path("data/pf02") d = open(p, "rb").read() else: p = tutils.test_data.path("data/pf01") d...
2.390625
2
python/plugins/processing/gui/ListMultiselectWidget.py
dyna-mis/Hilabeling
0
12764156
<reponame>dyna-mis/Hilabeling # -*- coding: utf-8 -*- """ *************************************************************************** ListMultiSelectWidget.py --------------------- Date : June 2016 Copyright : (C) 2016 by <NAME> Email : marco at opengis.ch ...
1.273438
1
2020-11-07/laercio.py
pufe/programa
2
12764157
n = int(input()) for teste in range(n): m = int(input()) lista = [int(x) for x in input().split()] impares = [] for x in lista: if x%2 == 1: impares.append(x) impares.sort() laercio = [] while len(impares) > 0: laercio.append(impares.pop()) i...
3.171875
3
pheweb/serve/components/chip/service.py
stellakeppo/pheweb
0
12764158
<reponame>stellakeppo/pheweb # -*- coding: utf-8 -*- """ Endpoint for chip data. Methods for flask blueprints. """ import typing from flask import ( Blueprint, jsonify, current_app as app, abort, Response, ) from .model import ChipDAO, JeevesContext chip = Blueprint("pheweb_chip", __name__) deve...
2.328125
2
compss/programming_model/bindings/python/src/pycompss/tests/util/test_warning_modules.py
eflows4hpc/compss
0
12764159
#!/usr/bin/python # # Copyright 2002-2021 Barcelona Supercomputing Center (www.bsc.es) # # 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 ...
2.1875
2
scripts/experimenting/dataset/core/base.py
miracleyoo/lifting_events_to_3d_hpe
0
12764160
import os from abc import ABC, abstractmethod from typing import Tuple import numpy as np import torch from scipy import io from experimenting.utils import Skeleton class BaseCore(ABC): """ Base class for dataset cores. Each core should implement get_frame_info and load_frame_from_id for base functional...
2.390625
2
diplomacy_research/players/benchmarks/rl_neurips2019/dataset_builder.py
wwongkamjan/dipnet_press
39
12764161
# ============================================================================== # Copyright 2019 - <NAME> # # NOTICE: 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, ...
1.453125
1
Challenge_1/members/martin_game.py
joeherold/weekly_coding_challenge_fwkwkw_python
1
12764162
<gh_stars>1-10 # Erstellung eines Spiels mit pygame # pygame ist eine Library, welche die einfache Erstellung von Spielen ermöglicht. # Nachfolgend wird die Erstellung eines einfachen Spiels mit Pygame dargestellt. # Was bringt diese Kenntnis für FH Schüler? Während langweiligen wirtschaftsfächern kann sich die Zeit ...
3.125
3
main/forms.py
mailfish/helena
0
12764163
<reponame>mailfish/helena from .models import User from django import forms from django.contrib.auth.forms import UserChangeForm, UserCreationForm class AdminUserAddForm(UserCreationForm): class Meta: model = User def clean_username(self): # Since User.username is unique, this chec...
2.546875
3
cinema_environment/server_monolith/server_app/migrations/0010_auto_20200113_1616.py
AndrewMalitchuk/cinema-server-monolith
0
12764164
# Generated by Django 3.0.2 on 2020-01-13 14:16 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('server_app', '0009_auto_20200113_1606'), ] operations = [ migrations.AlterField( model_name='film', name='pic_url', ...
1.445313
1
counts.py
nickgerend/EyeintheSky
0
12764165
<filename>counts.py # Written by: <NAME>, @dataoutsider # Viz: "Eye in the Sky", enjoy! import pandas as pd import os df = pd.read_csv(os.path.dirname(__file__) + '/UCS-Satellite-Database-8-1-2020_Clean.csv') # mask = df.applymap(type) != bool # d = {True: 'TRUE', False: 'FALSE'} # df = df.where(mask, df.replace(d)) ...
2.671875
3
setup.py
fraser-langton/Quandoo
1
12764166
"""A setuptools based setup module. See: https://packaging.python.org/guides/distributing-packages-using-setuptools/ https://github.com/pypa/sampleproject """ from os import path from setuptools import setup, find_packages with open(path.join(path.abspath(path.dirname(__file__)), 'README.md'), encoding='utf-8') as f...
1.484375
1
ironic/tests/unit/api/test_acl.py
zhouhao3/ironic
1
12764167
<reponame>zhouhao3/ironic # -*- encoding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
1.71875
2
python-web/FORM/form_workshop/form_workshop/create_form/urls.py
yosif88/SoftUni
0
12764168
from django.urls import path from form_workshop.create_form.views import show_form_data urlpatterns = [ path('', show_form_data, name='show form') ]
1.601563
2
etl_day_ahead_forecasting/pipeline/_defined/__init__.py
KamilMaziarz/etl-day-ahead-forecasting
0
12764169
<reponame>KamilMaziarz/etl-day-ahead-forecasting from .pse import ( cross_border_pipeline, eua_price_pipeline, renewables_generation_pipeline, system_operation_data_pipeline, units_generation_pipeline, units_outages_pipeline, ) __all__ = [ 'cross_border_pipeline', 'eua_price_pipeline',...
1.09375
1
Day-03_Binary-Diagnostic/tests/test_day_03.py
richardangell/advent-of-code-2021
0
12764170
<filename>Day-03_Binary-Diagnostic/tests/test_day_03.py import puzzle_1 import puzzle_2 def test_puzzle_1(): input_1 = puzzle_1.helpers.load_input("tests/input_1.txt", remove_lines_breaks=True) assert puzzle_1.calculate_gamma_and_epsilon(input_1) == (22, 9) def test_puzzle_2(): input_1 = puzzle_2.hel...
2.296875
2
azure_functions_devops_build/project/models/project_failed.py
coolgeeck/delwar1
16
12764171
<reponame>coolgeeck/delwar1<gh_stars>10-100 # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # ------------------------...
2.265625
2
store/functions.py
tosbala/flink-statefun-bookstore
2
12764172
################################################################################ # 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...
1.875
2
rpython/memory/gc/test/test_rawrefcount.py
wdv4758h/mu-client-pypy
0
12764173
import py from rpython.rtyper.lltypesystem import lltype, llmemory from rpython.memory.gc.incminimark import IncrementalMiniMarkGC from rpython.memory.gc.test.test_direct import BaseDirectGCTest from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY from rpython.rlib.rawrefcount import REFCNT_FROM_PYPY_LIGHT PYOBJ_HDR ...
1.765625
2
app_chat/urls.py
wastedideas/django_chat_project
0
12764174
<reponame>wastedideas/django_chat_project from django.urls import path from app_chat.views import chats_list_view, new_message_view, dialog_view urlpatterns = [ path( '', chats_list_view, name='chats_list', ), path( 'new_chat/<str:new_chat_with>', new_message_view, ...
1.953125
2
stlearn/plotting/gene_plot.py
duypham2108/stLearn
0
12764175
from matplotlib import pyplot as plt from PIL import Image import pandas as pd import matplotlib import numpy as np from typing import Optional, Union, Mapping # Special from typing import Sequence, Iterable # ABCs from typing import Tuple # Classes from anndata import AnnData import warnings from stlearn.plottin...
2.234375
2
src/utils.py
caijh33/I3D_CTC
0
12764176
import csv import numpy as np import torch import time class Timer(object): """ docstring for Timer """ def __init__(self): super(Timer, self).__init__() self.total_time = 0.0 self.calls = 0 self.start_time = 0.0 self.diff = 0.0 self.average_time = 0.0 def tic(self): self.start_time = time.time() ...
2.828125
3
audioPlayer.py
Razpudding/rpi-duckling
0
12764177
import pygame pygame.mixer.init() pygame.mixer.music.load("myFile.wav") pygame.mixer.music.play() while pygame.mixer.music.get_busy() == True: continue
2.578125
3
app/main/views.py
Maryan23/News-On-The-Go
0
12764178
from flask import render_template from . import main from ..requests import get_sources, get_articles #Views @main.route('/') def index(): ''' View root page function that returns the index page and its data ''' #Getting news sources sources = get_sources() title = 'News OTG' return rende...
2.6875
3
tests/izmat_zdecomp.py
rsoren/limetr
0
12764179
# check utils zdecomp def izmat_zdecomp(): import numpy as np from limetr.special_mat import izmat ok = True tol = 1e-10 # setup problem # ------------------------------------------------------------------------- k = 3 n = [5, 2, 4] z_list = [] tr_u_list = [] tr_s_list = ...
2.234375
2
airq/aq_dashboard.py
maximematerno/Sprint-challenge
0
12764180
"""OpenAQ Air Quality Dashboard with Flask.""" from datetime import datetime from flask import Flask, render_template from flask_sqlalchemy import SQLAlchemy import openaq APP = Flask(__name__) APP.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db.sqlite3' DB = SQLAlchemy(APP) class Record(DB.Model): id = DB.Col...
2.734375
3
PKRL/ts_data.py
pkmtum/Probabilistic_Koopman_Learning
3
12764181
''' Created on 13 Aug 2020 @author: <NAME> ''' from .ts_util import * import numpy as np from typing import List, Tuple class ts_data(object): def __init__(self, ts: np.array, prop_train: float =0.75, has_time:bool = True, delta_t:float = 1.0): ''' Utility object for time series data. ...
2.421875
2
container/pyf/schemas/event.py
Pompino/react-components-23KB
2
12764182
from pydantic import BaseModel as BaseSchema from typing import List, Optional from simpleschemas import UserGetSimpleSchema, GroupGetSimpleSchema, EventGetSimpleSchema, ClassRoomGetSimpleSchema class EventGetSchema(EventGetSimpleSchema): users: List[UserGetSimpleSchema] groups: List[GroupGetSimpleSchema] ...
2.171875
2
examples/control/tracking.py
ajthor/socks
0
12764183
# %% [markdown] """ # Target Tracking This example demonstrates the kernel-based stochastic optimal control algorithm and the dynamic programming algorithm. By default, it uses a nonholonomic vehicle system (unicycle dynamics), and seeks to track a v-shaped trajectory. To run the example, use the following command: ...
3.28125
3
python/kwiver/vital/tests/test_rotation.py
mwoehlke-kitware/kwiver
0
12764184
""" ckwg +31 Copyright 2016-2020 by Kitware, Inc. 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 conditions and...
1.5625
2
landing/urls.py
gauravuttarkar/SoftwareEngineering
0
12764185
<filename>landing/urls.py from django.urls import path from . import views from events import urls as events_urls from django.urls import path, include from donations import urls as donations_urls urlpatterns = [ path('', views.home), path('events/', include(events_urls)), path('donations/', inclu...
2.046875
2
part-2/1-sequence/5-custom_sequence-polygon.py
boconlonton/python-deep-dive
0
12764186
""" Polygon exercises: - __len__ - __getitem__ (retrieve) - __add__ - __iadd__ - __mul__ - __imul__ - append() - insert() - extend() - __setitem__ (assignment) - __delitem__ """ import numbers class Point: """""" def __init__(self, x, y): if isinstance(x, n...
3.703125
4
api/backoffice/models.py
ideabosque/DataWald-AWS
0
12764187
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function __author__ = 'bibow' import json, uuid, os from datetime import datetime, date from decimal import Decimal import logging logger = logging.getLogger() logger.setLevel(eval(os.environ["LOGGINGLEVEL"])) import boto3 from boto3.dynamodb.con...
2.1875
2
manage.py
stenvix/lpschedule
7
12764188
from flask_script import Manager from schedule import frontend, api from werkzeug.wsgi import DispatcherMiddleware from werkzeug.serving import run_simple from schedule.core import db manager = Manager(frontend.create_app()) @manager.command def runserver(): app = DispatcherMiddleware(frontend.create_app(), {'/a...
1.875
2
xcamserver/socket_server.py
Moskari/xcamserver
0
12764189
''' Created on 28.12.2016 @author: sapejura ''' import threading import socket import select import queue from xcamserver.framebuffer import FrameQueue # from xcamserver import worker_ctx, dummy_worker class SocketServer(): def __init__(self): self.stop_event = threading.Event() self.thread = th...
2.625
3
funcx_sdk/funcx/sdk/executor.py
sirosen/funcX
0
12764190
<filename>funcx_sdk/funcx/sdk/executor.py import time import threading import os import uuid import sys from concurrent.futures import Future import concurrent import logging import asyncio import websockets import json import dill from websockets.exceptions import InvalidHandshake import multiprocessing as mp import a...
2.640625
3
2015/02/fc_2015_02_07.py
mfwarren/FreeCoding
0
12764191
#!/usr/bin/env python3 # imports go here from xmlrpc.server import SimpleXMLRPCServer import xmlrpc.client from threading import Thread # # Free Coding session for 2015-02-07 # Written by <NAME> # def run_server(): server = SimpleXMLRPCServer(('localhost', 9000)) server.register_function(pow) server.regi...
2.78125
3
grizzly/__init__.py
dbis-ilm/grizzly
28
12764192
<reponame>dbis-ilm/grizzly<filename>grizzly/__init__.py<gh_stars>10-100 from .dataframes.frame import Table from .dataframes.frame import ExternalTable from .generator import GrizzlyGenerator def use(backend): GrizzlyGenerator._backend = backend def close(): GrizzlyGenerator.close() def read_table(tableName, ind...
2.078125
2
xen/xen-4.2.2/tools/xm-test/tests/network/12_network_domU_tcp_pos.py
zhiming-shen/Xen-Blanket-NG
1
12764193
#!/usr/bin/python # Copyright (C) International Business Machines Corp., 2006 # Author: <<EMAIL>> # TCP tests to domU interface # - creates two guest domains # - sets up a single NIC on each on same subnet # - conducts tcp tests to the domU IP address. # hping2 $domU_IP -c 1 -d $size # where $size = 1, 48, 6...
2.4375
2
src/rosdiscover/interpreter/interpreter.py
rosqual/rosdiscover
2
12764194
<gh_stars>1-10 # -*- coding: utf-8 -*- from typing import Dict, Iterator, Optional import contextlib import types import typing as t from loguru import logger import roswire from roswire import AppInstance, ROSVersion from roswire.common.launch.config import NodeConfig from roswire.ros1.launch.reader import ROS1Launch...
2.09375
2
sdss/dr8.py
juandesant/astrometry.net
460
12764195
# This file is part of the Astrometry.net suite. # Licensed under a 3-clause BSD style license - see LICENSE from __future__ import print_function from __future__ import absolute_import import os from astrometry.util.fits import fits_table import numpy as np import logging import tempfile import sys py3 = (sys.version...
2.03125
2
app.py
ace-spadez/btp-app
0
12764196
import base64 import json import sys import wave from flask import Flask, jsonify, request from flask_cors import CORS import parselmouth import pandas as pd from scipy.signal import find_peaks import numpy as np import matplotlib.pyplot as plt app = Flask(__name__) app_config = {"host": "0.0.0.0", "port": sys.argv[1...
2.609375
3
lib/SurfacingAlgorithms/huji-rich-Elad3DFast/analytic/afd.py
GalaxyHunters/Vivid
0
12764197
<reponame>GalaxyHunters/Vivid import numpy import cmath def sgn(x): if x==0: return 0 else: return x/abs(x) def single_mode(x,t,k,omega,v,g0,dx,xi): return cmath.exp(1j*k*x)*g0*dx*xi*\ (cmath.exp(1j*omega*t)-\ (1-(1-cmath.exp(-1j*k*dx))*xi)**(t*v/xi/dx))/\ ...
2.203125
2
taskwarrior_timecrimes/cmdline.py
coddingtonbear/taskwarrior-timecrimes
1
12764198
<filename>taskwarrior_timecrimes/cmdline.py from __future__ import print_function import datetime from pytz import utc from .undo_reader import UndoReader def cmdline(): # No options for now since = ( datetime.datetime.utcnow().replace(tzinfo=utc) - datetime.timedelta(hours=24) ) re...
2.78125
3
claf/config/factory/tokens.py
clovaai/claf
10
12764199
from overrides import overrides from claf.config.registry import Registry from claf.config.utils import convert_config2dict from claf.tokens import tokenizer from .base import Factory def make_tokenizer(tokenizer_cls, tokenizer_config, parent_tokenizers={}): if tokenizer_config is None or "name" not in tokeniz...
2.28125
2
sensai_dataset/generator/__main__.py
holodata/sensai-dataset
0
12764200
import argparse from sensai_dataset.generator.commands import generate_dataset from sensai_dataset.generator.constants import DATASET_DIR, DATASET_SOURCE_DIR if __name__ == '__main__': parser = argparse.ArgumentParser(description='dataset generator') parser.add_argument('-m', '--matcher', type=str, default='c...
2.28125
2
trove/tests/unittests/guestagent/test_dbaas.py
zhujzhuo/openstack-trove
0
12764201
<filename>trove/tests/unittests/guestagent/test_dbaas.py<gh_stars>0 # Copyright 2012 OpenStack Foundation # # 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.ap...
1.578125
2
lingvo/tasks/car/tools/export_kitti_detection.py
zh794390558/lingvo
1
12764202
# Lint as: python2, python3 # Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
1.851563
2
scripts/train.py
CrhistyanSilva/localbitsback
0
12764203
# !/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import argparse import datetime import json import math import os import random import time import numpy as np import torch import torch.optim as optim import torch.utils.data import compression from compression.utils import load_i...
2.28125
2
alley/alley_cli.py
xperscore/alley
13
12764204
import logging import click from alley import MongoMigrations @click.group() @click.argument('path', type=click.Path(exists=True, file_okay=False, writable=True, resolve_path=True)) @click.option('--database', '-db') @click.option('--username', '-u') @click.option('--password', <PASSWORD>') @click.option('--host', ...
2.171875
2
cli/BitSrunCore/core.py
fangli-li/bit-srun-cli
5
12764205
import logging import requests import re import json from .encryption.srun_md5 import * from .encryption.srun_sha1 import * from .encryption.srun_base64 import * from .encryption.srun_xencode import * # logging.basicConfig(level=logging.INFO) class Core(object): BASE_URL = 'http://10.0.0.55' CHALLENGE = "/cg...
2.078125
2
todolist/todos/migrations/0001_initial.py
abdu1aziz/todo-list-app
0
12764206
<reponame>abdu1aziz/todo-list-app # Generated by Django 3.1 on 2020-09-21 00:59 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='workList', fields=[ ...
1.867188
2
base-freq-histogram/test.py
kyclark/python_bioinformatics
14
12764207
#!/usr/bin/env python3 """tests for histy.py""" import os import random import re import string from subprocess import getstatusoutput prg = './histy.py' # -------------------------------------------------- def test_usage(): """usage""" for flag in ['', '-h', '--help']: rv, out = getstatusoutput('{...
2.515625
3
03-plotting-decisions/plotter.py
moos-tutorials/python-moos-tutorials
3
12764208
#!/usr/bin/env python3 from pymoos import pymoos import time import matplotlib.pyplot as plt import numpy as np import threading fig, ax = plt.subplots(subplot_kw=dict(polar=True)) ax.set_theta_direction(-1) ax.set_theta_zero_location('N') nav_line, des_line, = ax.plot([], [], 'r', [], [], 'b') nav_line.set_label('NAV...
2.703125
3
dependencies.bzl
todaypp/bazel-template
0
12764209
<filename>dependencies.bzl<gh_stars>0 """Define nodejs and yarn dependencies""" load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", sha256 = "a09edc4ba3931a856a5ac6836f248c302d55055d35d36e390a0549799c33145b", urls = ["https://github.com/baz...
1.1875
1
windows/run.py
IT-Manufactory/DataGit
1
12764210
import os import configparser import logging import cx_Oracle import sqlparse import sys log = logging.getLogger() log.setLevel(logging.INFO) SCRIPTS_FOLDER_BASE = "../db/" INIT_FOLDER_PATH = SCRIPTS_FOLDER_BASE + "init/" ADDITIONS_FOLDER_PATH = SCRIPTS_FOLDER_BASE + "additions/" CONFIG_FILE_PATH = "../connection.ini...
2.9375
3
migrations/alembic/versions/2a8981379eba_add_locales_table.py
bonomali/parrot
143
12764211
<filename>migrations/alembic/versions/2a8981379eba_add_locales_table.py """add locales table Revision ID: 2a8981379eba Revises: 438b950c4c9a Create Date: 2018-01-10 16:21:39.595957 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '2a8981379eba' down_revision = '...
1.390625
1
gyun/gomestor/acl.py
gyun-gome/gyun-sdk-python
0
12764212
# encoding: utf-8 # ========================================================================= # ©2017-2018 北京国美云服科技有限公司 # ------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this work except in compliance with the ...
2.265625
2
STL_plotter.py
kerembg0/STL-plotter
0
12764213
<gh_stars>0 import re import numpy as np import matplotlib.pyplot as plt # cleaning data f = open("<ASCII_file_name>.stl", "r") f_text = f.read() text = f_text.splitlines() verticies = [] for i in range(len(text)): text[i] = text[i].strip() for item in text: if (re.search("^vertex", item)...
2.546875
3
path.py
RC-Dynamics/de_pid_angle
0
12764214
import numpy as np from random import random import math class Path: def __init__(self, r): self.radius = r self.path = [] def circleDiscretization(self, qtd_poits = 40): self.path = [] angle_diff = 2 * math.pi / qtd_poits for i in range(qtd_poits): point...
3.15625
3
matrix.py
romanstrazanec/algorithms
0
12764215
class Matrix: def __init__(self, *args, **kwargs): if len(args) > 0: if isinstance(args[0], Matrix): m = args[0].copy() else: m = {'vals': [], 'w': 0, 'h': 0} self.vals = m.vals self.w = m.w self.h = m.h def copy(self): new_m = Matrix() for i in self.vals: new...
3.3125
3
src/Grid_world/policyiteration/environment.py
aliasgar-m/Reinforcement-Learning
0
12764216
#! /usr/bin/env python import random import numpy as np class Environment: def __init__(self, size=[3,4], start=(0,0), end=(2,3), block=[(1,1)], false_end=(1,3)): self.size = size self.state = np.zeros(self.size) self.action_space = self.generate_action_space() self.state_space = s...
2.890625
3
zmq_pub.py
abhi-mazu/time_series_framework
0
12764217
<gh_stars>0 import zmq import time import random import json import logging import numpy as np # ZeroMQ Context context = zmq.Context() # Define the socket using the "Context" sock = context.socket(zmq.PUB) sock.bind("tcp://127.0.0.1:5680") class GenerateSignal(object): def __init__(self): self.device =...
2.609375
3
src/agc_optims/optim/rmsprop_agc.py
Skyy93/agc_optims
1
12764218
import torch from torch.optim.optimizer import Optimizer, required from torch import optim, nn import torch.optim._functional as F from agc_optims.utils import agc class RMSprop_AGC(Optimizer): r"""Implements RMSprop algorithm with adaptive gradient clipping (AGC). .. math:: \begin{aligned} ...
2.40625
2
idaes/core/tests/test_components.py
dangunter/idaes-pse
0
12764219
<reponame>dangunter/idaes-pse ################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES), and is copyright ...
1.828125
2
solutions/0067.add-binary/add-binary.py
cocobear/LeetCode-in-Python
0
12764220
<reponame>cocobear/LeetCode-in-Python # # @lc app=leetcode id=67 lang=python3 # # [67] Add Binary # # @lc code=start class Solution: def addBinary(self, a: str, b: str) -> str: m = len(a) n = len(b) i = m - 1 j = n - 1 extra = 0 res = '' while i >=0 or j >= 0...
3.5625
4
bin/best_model_inference.py
jingxuanyang/Shopee-Product-Matching
13
12764221
import sys sys.path.insert(0,'../input/shopee-competition-utils') from config import CFG from run_test import run_bert_test # choose which cuda to load model on CFG.DEVICE = 'cuda:0' CFG.BATCH_SIZE = 16 # choose which model with what hyperparameters to use CFG.BERT_MODEL_NAME = CFG.BERT_MODEL_NAMES[3] CFG.MARGIN = C...
1.75
2
test/programytest/storage/stores/sql/dao/test_category.py
motazsaad/fit-bot-fb-clt
5
12764222
<filename>test/programytest/storage/stores/sql/dao/test_category.py import unittest from programy.storage.stores.sql.dao.category import Category class CategoryTests(unittest.TestCase): def test_init(self): category1 = Category(groupid='groupid', userid='userid', topic='topic', that='that', pattern='pa...
2.703125
3
vidyo/video.py
parafoxia/vidyo
0
12764223
<filename>vidyo/video.py import datetime as dt import io import logging import re import requests from PIL import Image from vidyo.channel import PartialChannel from vidyo.errors import ResponseNotOK DUR_REGEX = re.compile( r"P([0-9]{1,2}D)?T?([0-9]{1,2}H)?([0-9]{1,2}M)?([0-9]{1,2}S)?" ) DUR_MUL = (86400, 3600, ...
2.625
3
taw/sshlike.py
mkasa/taw
3
12764224
#!/usr/bin/env python3 from __future__ import print_function from __future__ import absolute_import import os, click import subprocess from taw.util import * from taw.taw import * # commands/subcommands # ============== # SSH COMMAND # ============== @taw.command("ssh") @click.argument('hostname', metavar='<host n...
2.421875
2
ryu/app/controller_heart_packet_check.py
wwmm1/MC
3
12764225
<gh_stars>1-10 import schedule import time from multiple_Controller import SimpleSwitch13 s = SimpleSwitch13() s time.sleep(20) s.send_heartbeat_packet()
1.4375
1
models/dto/LimitModifier.py
muhammetbolat/pythondataintegrator
0
12764226
<reponame>muhammetbolat/pythondataintegrator from infrastructor.multi_processing.ParallelMultiProcessing import ProcessBaseData class LimitModifier(ProcessBaseData): def __init__(self, Id: int = None, TopLimit: int = None, SubLimit: int = None, )...
2.359375
2
test/test_del_group.py
spirit-87/python_training
0
12764227
# -*- coding: utf-8 -*- from model.group import Group import random import re def test_delete_some_group(app, db, check_ui): if len(db.get_group_list()) == 0: app.group.create(Group(name = "test")) old_groups = db.get_group_list() group = random.choice(old_groups) app.group.delete_group_by_id(g...
2.421875
2
ticketrelation/select_ticket.py
CaulyKan/TracTicketRelationPlugin
0
12764228
import json from trac.core import * from trac.web.api import IRequestHandler, ITemplateStreamFilter from trac.web.chrome import ITemplateProvider, add_script from trac.ticket.query import Query, QueryModule from trac.ticket.model import Ticket from genshi.builder import tag from genshi.filters import Transformer from ...
2.015625
2
src/models/pytorch/metrics.py
AntonioGUJ/AirwaySegmentation_Keras
15
12764229
<filename>src/models/pytorch/metrics.py<gh_stars>10-100 from typing import Tuple import torch.nn as nn import torch from models.metrics import MetricBase _EPS = 1e-7 _SMOOTH = 1.0 LIST_AVAIL_METRICS = ['MeanSquaredError', 'MeanSquaredErrorLogarithmic', 'BinaryCrossEntrop...
2.1875
2
src/direpack/__init__.py
zedian/direpack
0
12764230
<reponame>zedian/direpack #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jul 22 12:17:17 2018 @author: <NAME>, Ponalytics """ __name__ = "direpack" __author__ = "<NAME>" __license__ = "MIT" __version__ = "1.0.0" __date__ = "2020-20-18" from .preprocessing.robcent import VersatileScaler, versatile_...
1.195313
1
Module 3/Chapter 4/ch4_30.py
PacktPublishing/Natural-Language-Processing-Python-and-NLTK
50
12764231
<reponame>PacktPublishing/Natural-Language-Processing-Python-and-NLTK import nltk noun1=[("financial","NN"),("year","NN"),("account","NN"),("summary","NN")] gram="NP:{<NN>+}" find = nltk.RegexpParser(gram) print(find.parse(noun1)) x=find.parse(noun1) x.draw()
3.28125
3
058-bmp-stegano/taski_zrodla/mapofbits/level0/testlevel0.py
gynvael/stream
152
12764232
<gh_stars>100-1000 #!/usr/bin/python import os, sys from struct import pack, unpack PATH = os.path.dirname(os.path.realpath(__file__)) sys.path.append(PATH) import settings def rb(d, off): return d[off] def rw(d, off): return unpack("<H", str(d[off:off+2]))[0] def rd(d, off): return unpack("<I"...
2.125
2
algorithm/py3/p136-single-number.py
yuechuanx/LeetCode
3
12764233
# # @lc app=leetcode id=136 lang=python3 # # [136] Single Number # # https://leetcode.com/problems/single-number/description/ # # algorithms # Easy (60.26%) # Likes: 3294 # Dislikes: 128 # Total Accepted: 600.9K # Total Submissions: 961.2K # Testcase Example: '[2,2,1]' # # Given a non-empty array of integers, ev...
3.4375
3
news/urls.py
m3brown/collab-news
3
12764234
from django.conf.urls import patterns, url urlpatterns = patterns('news.views', url(r'^$', 'news_list', name='list'), url(r'^feed/(?P<slug>.*)/$', 'news_list', name='feed'), url(r'^(?P<slug>.*)/$', 'news_item', name='item'...
1.84375
2
hic3defdr/plotting/histograms.py
thomasgilgenast/hic3defdr
0
12764235
import numpy as np import matplotlib.pyplot as plt from lib5c.util.plotting import plotter @plotter def plot_pvalue_histogram(data, xlabel='pvalue', **kwargs): """ Plots a p-value or q-value distribution. Parameters ---------- data : np.ndarray The p-values or q-values to plot. kwarg...
3.28125
3
python-backend/app/api/search/namespace/search.py
ActionAnalytics/mds
0
12764236
from flask_restplus import Namespace from ..search.resources.search import SearchResource, SearchOptionsResource from app.api.search.search.resources.simple_search import SimpleSearchResource api = Namespace('search', description='Search related operations') api.add_resource(SearchResource, '') api.add_resource(Sear...
1.953125
2
opnsense_cli/tests/factories/test_json_type.py
jan-win1993/opn-cli
13
12764237
<reponame>jan-win1993/opn-cli<filename>opnsense_cli/tests/factories/test_json_type.py import unittest from opnsense_cli.factories.json_type import JsonTypeFactory, JsonObj, JsonArray, JsonObjNested class TestJsonTypeFactory(unittest.TestCase): def setUp(self): self._factory = JsonTypeFactory() sel...
2.125
2
exercises/test_02_01.py
DayMath82/www.warmups.dev
5
12764238
<gh_stars>1-10 def test(): # if an assertion fails, the message will be displayed # --> must have the output in a comment assert "Mean: 5.0" in __solution__, "Did you record the correct program output as a comment?" # --> must have the output in a comment assert "Mean: 4.0" in __solution__, "Did you...
3.375
3
2_UNIXCommands/Exercise17.py
takeyoshinitta/NLP-100-Exercise
3
12764239
# 17. Distinct strings in the first column # Find distinct strings (a set of strings) of the first column of the file. Confirm the result by using cut, sort, and uniq commands. def removeDuplicates(list): newList = [] for i in list: if not(i in newList): newList.append(i) return...
3.578125
4
_analyze.py
RunzheStat/TROPE
8
12764240
from _util import * ############################################################################################################################################################################################################################################################################################################...
2.390625
2
madrona/openid/tests/__init__.py
movermeyer/madrona
9
12764241
<reponame>movermeyer/madrona import unittest def suite(): suite = unittest.TestSuite() for name in ['test_store']: mod = __import__('%s.%s' % (__name__, name), {}, {}, ['suite']) suite.addTest(mod.suite()) return suite
2.046875
2
scripts/plot_torus.py
lanl/phoebus
3
12764242
#PHDF_PATH = '/home/brryan/rpm/phoebus/external/parthenon/scripts/python/' #PHDF_PATH = '/home/brryan/github/phoebus/external/parthenon/scripts/python/' #DUMP_NAMES = '/home/brryan/builds/phoebus/torus.out1.*.phdf' DUMP_NAMES = 'torus.out1.*.phdf' import argparse import numpy as np import sys import matplotlib.pyplot ...
2.125
2
jcasts/podcasts/migrations/0098_remove_podcast_podcastindex.py
danjac/jcasts
13
12764243
# Generated by Django 3.2.9 on 2021-11-18 11:12 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("podcasts", "0097_rename_schedule_modifier_podcast_frequency_modifier"), ] operations = [ migrations.RemoveField( model_name="podcast", ...
1.367188
1
madlib5.py
Leorodr501/Mad-Libs
0
12764244
<reponame>Leorodr501/Mad-Libs name = input("Enter your name: ") date = input("Enter a date: ") adjective = input("Enter an adjective: ") noun = input("Enter a noun: ") verb = input("Enter a verb in past tense: ") adverb = input("Enter an adverb: ") adjective = input("Enter another adjective: ") noun = input("Enter anot...
3.484375
3
BOJ2178.py
INYEONGKIM/BOJ
2
12764245
<filename>BOJ2178.py input=__import__('sys').stdin.readline n,m=map(int,input().split());g=[list(input()) for _ in range(n)];c=[[0]*m for _ in range(n)] q=__import__('collections').deque();q.append((0,0));c[0][0]=1 while q: x,y=q.popleft() for nx,ny in (x+1,y),(x-1,y),(x,y+1),(x,y-1): if 0<=nx<n and 0<=...
2.515625
3
nicehash.py
wrigjl/nice-scripts
0
12764246
import json import hmac import hashlib import requests import datetime import uuid from requests.auth import AuthBase class NiceHashAuth(AuthBase): def __init__(self, fname = None, api_secret = None, api_key = None, org_id = None): if fname is not None: with open(fname) as f: ...
2.765625
3
binary_search.py
VishwaasHegde/E2ERaga
0
12764247
import numpy as np # Python3 program to find element # closet to given target. # Returns element closest to target in arr[] def findClosest(arr, n, target): # Corner cases if (target <= arr[0][0]): return 0 if (target >= arr[n - 1][0]): return n - 1 # Doing binary search i = 0 ...
3.71875
4
py_algo/number_theory/competition/monk_and_fredo.py
Sk0uF/Algorithms
1
12764248
""" Codemonk link: https://www.hackerearth.com/problem/algorithm/monk-and-fredo-cm-number-theory-97942213/ Given two weights of a and b units, in how many different ways you can achieve a weight of d units using only the given weights? Any of the given weights can be used any number of times (including 0 number of tim...
3.984375
4
analysis/analysis.py
kernsuite-debian/integration
0
12764249
<reponame>kernsuite-debian/integration #!/usr/bin/env python # Copyright 2015 <NAME> <<EMAIL>> # # 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...
2.03125
2
layers/water_connection.py
JinIgarashi/postgis2qfield
2
12764250
<reponame>JinIgarashi/postgis2qfield from layers.layer_base import LayerBase class WaterConnection(LayerBase): def __init__(self): super().__init__("water_connection") self.parse_dates = ['input_date', 'meter_installation_date', 'connection_date', 'disconnection_date']
2.421875
2