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
aioamqp/tests/test_recover.py
michael-k/aioamqp
0
12798451
""" Amqp basic tests for recover methods """ import unittest from . import testcase from . import testing class RecoverTestCase(testcase.RabbitTestCase, unittest.TestCase): @testing.coroutine def test_basic_recover_async(self): yield from self.channel.basic_recover_async(requeue=True) @tes...
2.546875
3
applications/physbam/physbam-lib/Scripts/Archives/pd/mon/SERVER.py
schinmayee/nimbus
20
12798452
<reponame>schinmayee/nimbus #!/usr/bin/python from pd.common import CONFIG from pd.common import SOCKET import os import mutex import time import threading import pickle class SERVER: def __init__(self): self.sessions={} self.next_id=1 # Define RPC interface self.mutex=thre...
2.390625
2
problems/daily-temperatures/solution.py
HearyShen/leetcode-cn
1
12798453
<reponame>HearyShen/leetcode-cn import time from typing import List class Solution: def dailyTemperatures(self, T: List[int]) -> List[int]: if not T: return [] deltaDays = [0] * len(T) stack = [] for i in range(len(T)): # print([(i, T[i]) for i in s...
3.296875
3
EasyRecycle/recycle/serializers.py
YuriyLisovskiy/EasyRecycle
0
12798454
from rest_framework import serializers from recycle.models import Location, CommercialRequest, Transaction from recycle.validators import IsGarbageCollectorValidator, IsCommercialValidator, DateIsNotPast class LocationSerializer(serializers.ModelSerializer): id = serializers.ReadOnlyField() open_time = serializers...
2.078125
2
DS-400/Medium/61-Rotate List/OnePointer.py
ericchen12377/Leetcode-Algorithm-Python
2
12798455
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution(object): def rotateRight(self, head, k): """ :type head: ListNode :type k: int :rtype: ListNode """ ...
3.8125
4
ofstest/ofs/doctype/store/test_store.py
keithyang77/ofstest
0
12798456
<reponame>keithyang77/ofstest # Copyright (c) 2021, mds and Contributors # See license.txt # import frappe import unittest class TestStore(unittest.TestCase): pass
1.125
1
steps/oci-database-step-instances-terminate/step.py
Bryxxit/relay-oci-oracleDB
0
12798457
<filename>steps/oci-database-step-instances-terminate/step.py #!/usr/bin/env python import oci config = oci.config.from_file() from oci.config import validate_config validate_config(config) # initialize the DatabaseClient database = oci.database.DatabaseClient(config) db_system_ids = ["dfsdfgsfdsdf","fsdxfgsd"] if...
2.359375
2
superutils/utils.py
cshanxiao/superutils
0
12798458
<reponame>cshanxiao/superutils<filename>superutils/utils.py # -*- coding: utf-8 -*- u''' @summary: @author: cshanxiao @date: 2016-07-18 ''' import time def print_obj(obj, inner=True, full=False): print "\nStart {} {}".format(obj, "=" * 50) print "dir info: {}".format(dir(obj)) for attr i...
2.21875
2
BotMessageSender.py
sharry008/anonymise
1
12798459
<reponame>sharry008/anonymise """ This software has been developed by github user fndh (http://github.com/fndh) You are free to use, modify and redistribute this software as you please, as long as you follow the conditions listed in the LICENSE file of the github repository indicated. I want to thank you for reading t...
2.203125
2
foo/api_image.py
CyberlifeCN/qrcode
1
12798460
#!/usr/bin/env python # _*_ coding: utf-8_*_ # # Copyright 2016-2017 <EMAIL> # <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.0 # # U...
2.0625
2
lectures/slides_tex/example_imports.py
materialsvirtuallab/nano281
38
12798461
<filename>lectures/slides_tex/example_imports.py<gh_stars>10-100 import math z = math.sin(3.14159) # Gives ~0
1.648438
2
scripts/movielens/process_raw.py
NighTurs/discovery-rs
3
12798462
import pickle import pandas as pd import os from os import path from scripts.process_raw import keep_positive_ratings, count_filter from scripts.config import params def process_raw(input_dir, output_dir, movie_users_threshold, user_movies_threshold): ds = pd.read_csv(path.join(input_dir, 'ratings.csv')) prin...
2.640625
3
scripts/model_selection/cross_validate_utils.py
riccardopoiani/recsys_2019
2
12798463
def get_seed_list(): return [6910, 1996, 2019, 153, 12, 5, 1010, 9999, 666, 467] def write_results_on_file(file_path, recommender_name, recommender_fit_parameters, num_folds, seed_list, results): with open(file_path, "w") as f: f.write("Recommender class: {}\n".format(recommender_name)) f.writ...
2.875
3
CircadianDesktops/app.py
Luke943/CircadianDesktops
0
12798464
<reponame>Luke943/CircadianDesktops<gh_stars>0 """ Main script for Circadian Desktops app. Settings file and logo images are stored locally. Contains MainWindow class and script to run app. """ import os import sys from PyQt5 import QtCore, QtGui, QtWidgets import custom_qt import functions from ui_mainwindow import ...
2.15625
2
tw_serverinfo/models/__init__.py
DaRealFreak/Teeworlds-ServerInfo
6
12798465
#!/usr/local/bin/python # coding: utf-8 import abc class Server(abc.ABC): """Server Model Template, containing properties for same attributes of MasterServer and GameServer objects""" _ip: str = '' _port: int = 8300 _response: bool = False _token = b'' _request_token: bytes = b'' def __eq...
3.21875
3
src/dataset/base_face.py
chuanli11/SADRNet
67
12798466
import os import sys import numpy as np import scipy.io as sio from skimage import io import time import math import skimage import src.faceutil from src.faceutil import mesh from src.faceutil.morphable_model import MorphabelModel from src.util.matlabutil import NormDirection from math import sin, cos, asin, acos, atan...
2.15625
2
alipay/aop/api/response/AlipayOpenMiniPlanOperateBatchqueryResponse.py
antopen/alipay-sdk-python-all
213
12798467
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse from alipay.aop.api.domain.PaymentSuccessPagePlanInfo import PaymentSuccessPagePlanInfo class AlipayOpenMiniPlanOperateBatchqueryResponse(AlipayResponse): def __init__(self): super...
2
2
python/wecall/utils/tabix_wrapper.py
dylex/wecall
8
12798468
# All content Copyright (C) 2018 Genomics plc from wecall.genomics.chromosome import standardise_chromosome import pysam class TabixWrapper(object): def __init__(self, tabix_filename): self.__tabix_file = pysam.Tabixfile(tabix_filename, 'r') self.__contig_mapping = {standardise_chromosome( ...
2.6875
3
simplestore/products/admin.py
martinstastny/django-store
36
12798469
<reponame>martinstastny/django-store from django.contrib import admin from simplestore.products.models.category import Category from simplestore.products.models.product import Product class CategoryAdmin(admin.ModelAdmin): prepopulated_fields = {"slug": ('name',)} class ProductAdmin(admin.ModelAdmin): prep...
2.09375
2
command_center.py
sceeter89/HomeCommandCenter
0
12798470
from collections import namedtuple, defaultdict import time import logging from datetime import datetime, timedelta from yapsy.PluginManager import PluginManager from api.exceptions import TerminateApplication from api.sensor import Sensor from api.motor import Motor PluginDetails = namedtuple('PluginInfo', ['name',...
2.109375
2
python/feature_extraction.py
RElbers/strotss-pytorch
0
12798471
from torch import nn from torchvision import models from torchvision.transforms import transforms import util class VGGFeatureExtractor(nn.Module): def __init__(self): super().__init__() self._vgg = models.vgg16(pretrained=True).features self._vgg.eval() for parameter in self._vg...
2.359375
2
app/log.py
barry-ran/werobot
1
12798472
import os import logging from logging import handlers from werkzeug.exceptions import InternalServerError basedir = os.path.abspath(os.path.dirname(__file__)) def handle_error(error): Log.logger().error(error) return error class Log: LOG_PATH = os.path.join(basedir, 'logs') LOG_NAME = os.path.join(LO...
2.5625
3
simulator/services/demand_generation_service.py
marina-haliem/Dynamic-RideSharing-Pooling-Simulator
3
12798473
<reponame>marina-haliem/Dynamic-RideSharing-Pooling-Simulator from simulator.models.customer.customer import Customer from db import Session # import request query = """ SELECT * FROM {table} WHERE request_datetime >= {t1} and request_datetime < {t2}; """ class DemandGenerator(object): def __init__(self, u...
2.890625
3
Assignment3_for_students/Util.py
jay-z007/Natural-Language-Processing
0
12798474
<reponame>jay-z007/Natural-Language-Processing from DependencyTree import DependencyTree def loadConll(inFile): sents = [] trees = [] with open('data/' + inFile, 'rb') as fin: sentenceTokens = [] tree = DependencyTree() for line in fin: line = line.strip() li...
2.390625
2
vimeo/auth/__init__.py
greedo/vimeo.py
0
12798475
<filename>vimeo/auth/__init__.py #! /usr/bin/env python # encoding: utf-8 from __future__ import absolute_import class GrantFailed(Exception): pass
1.117188
1
dwinelle/video/gen_3d.py
oliverodaa/cs184-final-proj
1
12798476
<filename>dwinelle/video/gen_3d.py #!/usr/bin/env python3 # This file is part of dwinelle-tools. # dwinelle-tools is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at you...
1.835938
2
stocksearch.py
mrahman4782/Stock-Strike
0
12798477
from bs4 import BeautifulSoup import requests, smtplib, time from flask import Flask, render_template, request, url_for from threading import Thread app = Flask(__name__) @app.route('/') def progstart(): return render_template("site.html") @app.route('/start_task') def start_task(): def do_work(stockInput, t...
2.96875
3
serverwamp/session.py
JustinTArthur/server_wamp
14
12798478
<filename>serverwamp/session.py import logging from abc import ABC, abstractmethod from typing import Any, Iterable, Iterator from serverwamp.adapters.async_base import AsyncTaskGroup from serverwamp.protocol import (abort_msg, cra_challenge_msg, cra_challenge_string, event_msg, ...
2.015625
2
pv_data.py
kmoy14-stanford/AA222FinalProject
2
12798479
<reponame>kmoy14-stanford/AA222FinalProject """ Some data cleansing for the solar PV data. """ #%% import numpy as np import pandas as pd # 5 years of PV data pvdata = pd.read_csv('solar_PV_15min_kWh.csv') pv = pvdata[:8760*4] pv.set_index(pd.date_range(start='2021-01-01 00:00', periods=35040, freq='15T'), inplace=T...
2.28125
2
keras_classification_test.py
redkfa/PDF_classification
0
12798480
<reponame>redkfa/PDF_classification from keras.preprocessing.image import ImageDataGenerator from keras.layers import Conv2D, MaxPooling2D from keras.layers import Activation, Dropout, Flatten, Dense from keras import backend as K from keras.applications.vgg19 import VGG19 from keras.models import Model from keras.laye...
2.734375
3
tests/test_submission_builder.py
mverteuil/mig3-client
3
12798481
<gh_stars>1-10 # -*- coding: utf-8 -*- import mock from mig3_client import SubmissionBuilder def test_minimum_viable_submission(converted_tests): """Should produce something""" submission = SubmissionBuilder("t", "b", converted_tests).build() assert submission is not None def test_configuration_id(conve...
2.21875
2
src/exabgp/util/od.py
pierky/exabgp
1,560
12798482
<reponame>pierky/exabgp # encoding: utf-8 """ od.py Created by <NAME> on 2009-09-06. Copyright (c) 2009-2017 Exa Networks. All rights reserved. License: 3-clause BSD. (See the COPYRIGHT file) """ def od(value): def spaced(value): even = None for v in value: if even is False: ...
2.28125
2
rfmembers.py
realistforeningen/rf-members
0
12798483
<gh_stars>0 # coding: utf-8 import string from datetime import datetime, timedelta import time from pytz import timezone import pytz from functools import wraps from flask import Flask, render_template, request, redirect, url_for, jsonify, session, g, abort from calendar import month_name from collections import defau...
1.96875
2
buff/trinket/dragon_killer.py
dannl/hunter-sim-classic
0
12798484
from buff import Buff, LastingBuff class DragonKiller(LastingBuff): def __init__(self): super().__init__('dragon_killer', 2 * 60, 20) def equip(self,engine, char_state): char_state.ap += 64 def dequip(self,engine, char_state): char_state.ap -= 64 def perform_impl(self,rotat...
2.421875
2
server/utils/workflow.py
Samsong1991/django-vue-admin
425
12798485
<gh_stars>100-1000 from django.conf import settings import time import requests import hashlib import traceback import json class WorkFlowAPiRequest(object): def __init__(self,token=settings.WORKFLOW_TOKEN, appname=settings.WORKFLOW_APP, username='admin', workflowurl=settings.WORKFLOW_URL): self.token = to...
2.15625
2
cap2/extensions/experimental/strains/strainotyping/cli.py
nanusefue/CAP2-1
9
12798486
<reponame>nanusefue/CAP2-1 import click from .io import write_graph_to_filepath from .api import merge_filter_graphs_from_filepaths @click.group('strainotype') def strainotype_cli(): pass @strainotype_cli.command('merge') @click.option('-m', '--min-weight', default=2) @click.option('-o', '--outfile', type=cli...
2.1875
2
mumoco/mumoco_api.py
disroop/mumoco
3
12798487
import json from pathlib import Path from typing import List import cli_ui as ui import deserialize from conans.client.conan_api import Conan from .conanbuilder.configreader import ConfigReader from .conanbuilder.package import Package from .conanbuilder.runner import Runner from .conanbuilder.signature import Signat...
2.1875
2
kyokigo/migrations/0002_auto_20180405_0755.py
seoworks0/docker_test2
0
12798488
# Generated by Django 2.0.3 on 2018-04-05 07:55 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('kyokigo', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='kyokigo_input', name='ownurl', ...
1.507813
2
data_collection/altdata_service/db/sql/migration_of_db/tweet_migration_big/migration_twitter_to_big.py
kaljuvee/openaltdata
0
12798489
from db.sql.migration_of_db.tweet_migration_big.psql_tweet_mig_queries import psql_connector_twitter_mig from db.sql.migration_of_db.tweet_migration_big.big_queries_sql import big_connector_twitter_mig import data_collection.altdata_service.twitter.object_function.tweet_cleaner as cleaner def migration_tweet_tab...
2.421875
2
rsteg_socket.py
jahosp/rsteg-tcp
1
12798490
<reponame>jahosp/rsteg-tcp<filename>rsteg_socket.py #!/usr/bin/python3 # -*- coding: UTF-8 -*- # Author: <NAME> <<EMAIL>> from rsteg_tcp import RstegTcp from utils import State, retrans_prob import time class RstegSocket: """A wrapper for RstegTcp that offers socket primitives for communicating like Python socke...
3.046875
3
scripts/pughpore/test_1Dpugh.py
jhwnkim/nanopores
8
12798491
# (c) 2016 <NAME> " 1D PNP, modelling reservoirs and membrane far away from pore " import nanopores as nano import solvers geop = nano.Params( R = 35., H = 70., ) physp = nano.Params( bulkcon = 1000., bV = -1., ) geo, pnp = solvers.solve1D(geop, physp) solvers.visualize1D(geo, pnp) nano.showplots()
1.921875
2
sendgrid/helpers/__init__.py
tulikavijay/sendgrid-python
1
12798492
"""v3/mail/send response body builder Builder for assembling emails to be sent with the v3 SendGrid API. Usage example: def build_hello_email(): to_email = from_email = Email("<EMAIL>") subject = "Hello World from the SendGrid Python Library" content = Content("text/plain", "some text here...
2.609375
3
utils.py
jodietrich/wgan_domain_adaptation
4
12798493
<gh_stars>1-10 # Authors: # <NAME> (<EMAIL>) # <NAME> (<EMAIL>) # <NAME> (<EMAIL>) # Useful functions import nibabel as nib import numpy as np import os import glob from importlib.machinery import SourceFileLoader import config.system as sys_config import logging import tensorflow as tf from collections import Counte...
2.28125
2
databases/migrations/2021_12_09_065718_ThirdStorage.py
knguyen111601/test_penguin_project_4_backend
0
12798494
<filename>databases/migrations/2021_12_09_065718_ThirdStorage.py """ThirdStorage Migration.""" from masoniteorm.migrations import Migration class ThirdStorage(Migration): def up(self): """ Run the migrations. """ with self.schema.create("thirdstorages") as table: table...
2.171875
2
examples/e164.py
SaidBySolo/dnspython
0
12798495
#!/usr/bin/env python3 import dns.e164 n = dns.e164.from_e164("+1 555 1212") print(n) print(dns.e164.to_e164(n))
2.078125
2
ServerComponent/DataLayer/DataSetEntry.py
CDU55/FakeNews
0
12798496
<reponame>CDU55/FakeNews class FacebookDataSetEntry: def __init__(self, followers_number, likes_number, comments_number, share_number, grammar_index, subject_relevance, label): self.followers_number = followers_number self.likes_number = likes_number self.comments_number = c...
2.46875
2
pyRFTests.py
softwarespartan/pyStk
0
12798497
import pyRF; import pyStk; import numpy as np; import math from scipy import stats; #print rf.refData.shape #print len(rf.refStnList) # #print rf.npv.shape; #print rf.nvv.shape; #print rf.refEpoch.shape; # #npv = rf.npvForEpoch(2003.50414524) #print npv.shape ts = pyStk.pyTS().initFromMatFile('../data/ts.mat'); r...
2.15625
2
pypro/modulos/migrations/0004_populando_slug.py
wosubtil/curso-django
0
12798498
# Generated by Django 3.1.3 on 2020-11-25 11:09 from django.db import migrations from django.utils.text import slugify def popular_slug(apps, schema_editor): Modulo = apps.get_model('modulos', 'Modulo') for modulo in Modulo.objects.all(): modulo.slug = slugify(modulo.titulo) modulo.save() cl...
2.03125
2
todos/urls.py
sunilsm7/django-htmx
0
12798499
<gh_stars>0 from django.urls import path from .views import index, search, todo_list_view urlpatterns = [ path('', index, name='index'), path('list', todo_list_view, name='list'), path('search/', search, name='search') ]
1.710938
2
bin/submit_samples.py
vmware-samples/tau-clients
2
12798500
#!/usr/bin/env python # Copyright 2021 VMware, Inc. # SPDX-License-Identifier: BSD-2 import argparse import configparser import io import sys import tau_clients import vt from tau_clients import decoders from tau_clients import exceptions from tau_clients import nsx_defender def download_from_vt(client: vt.Client, f...
2.46875
2
robinhood.py
CThax12/Stonk-Tracker
0
12798501
import RobinhoodFunctions as rf email, password = rf.getCredentials() rf.loginToRH(email, password) allPositions = [] allPositions = rf.getAllOptions(allPositions) frequentTickers = rf.getFrequentTickers(allPositions) rf.r.options.write_spinner() rf.r.options.spinning_cursor() optionNames, entryPrices, calls, puts = r...
2.203125
2
src/django_grainy_test/models.py
djeromov/django-grainy
2
12798502
from django.db import models from django_grainy.decorators import grainy_model from django_grainy.models import Permission, PermissionManager from django_grainy.handlers import GrainyMixin # Create your models here. """ These are the models used during the django_grainy unit tests. There is no need to ever install ...
2.28125
2
shippingBot.py
raagn08/Shipping-Info-Telegram-Bot
2
12798503
from telegram.ext import Updater, CallbackContext, CommandHandler, MessageHandler, Filters, Handler from telegram.ext.dispatcher import run_async, DispatcherHandlerStop, Dispatcher from telegram import Update, User, Message, ParseMode from telegram.error import BadRequest import requests_html import requests import jso...
2.234375
2
103. invert_binary_tree.py
chandravenky/puzzles
0
12798504
<gh_stars>0 # Definition for a binary tree node. # class TreeNode(object): # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution(object): def flip(self, node): if not node: return None ...
3.90625
4
statistics_exercises.py
rzamoramx/data_science_exercises
0
12798505
""" Some exercises about statistics """ from matplotlib import pyplot as plt from statistics.central_tendencies import * from statistics.variance import variance, standard_deviation from statistics.correlation import covariance, correlation def main(): num_friends = [500, 50, 25, 30, 5, 6, 7, 8, 9, 10, ...
3.828125
4
wunderkafka/serdes/store.py
severstal-digital/wunderkafka
0
12798506
from typing import Type, Union, Optional from pathlib import Path from wunderkafka.types import TopicName, KeySchemaDescription, ValueSchemaDescription from wunderkafka.serdes.abc import AbstractDescriptionStore from wunderkafka.compat.types import AvroModel from wunderkafka.compat.constants import PY36 from wunderkaf...
2.28125
2
bin/tests/test_design.py
broadinstitute/adapt
12
12798507
<filename>bin/tests/test_design.py """Tests for design.py """ import random import os import copy import tempfile import unittest import logging from collections import OrderedDict from argparse import Namespace from adapt import alignment from adapt.prepare import align, ncbi_neighbors, prepare_alignment from adapt....
2.578125
3
andela/car_park_roof.py
phacic/dsa-py
0
12798508
<filename>andela/car_park_roof.py<gh_stars>0 def carParkingRoof(cars: list, k): cars.sort() to_cover = cars[:k] mx = max(to_cover) mi = min(to_cover) return mx - (mi - 1) def process_file(filename: str) -> tuple: fptr = open(filename, "w") print("file opened") cars_count = int(inpu...
3.515625
4
parser.py
hrb23m/pydifier
0
12798509
<gh_stars>0 import argparse parser = argparse.ArgumentParser( prog = "pydifier", add_help = True) ### File option ### # Input File parser.add_argument('pdf_file_path', action = 'store', type = str, metavar = "PDF_PATH", help = 'Pdf file path to be fixed.' ) # Output File parser.add_argument('-o', '--...
2.75
3
androyara/core/dex_parser.py
BiteFoo/androyara
2
12798510
<reponame>BiteFoo/androyara<filename>androyara/core/dex_parser.py # coding:utf8 ''' @File : dex_parser.py @Author : Loopher @Version : 1.0 @License : (C)Copyright 2020-2021,Loopher @Desc : Dex文件解析 ''' """ 每一个dex都会经过这里的解析处理,目的是建立一个映射表能快速索引和比较 """ from androyara.dex.dex_vm import DexFileVM class DexPa...
1.539063
2
neurobeer/tractography/__init__.py
kaitj/Tractography
2
12798511
""" The package provides a number of modules to be used in the clustering, extraction, and evaluation of white matter tractography. """
0.804688
1
Fullbit.py
Mizogg/Fillbit-Bitcoin-Address
4
12798512
<reponame>Mizogg/Fillbit-Bitcoin-Address #Fullbit.py =====Made by <EMAIL> Donations 3P7PZLbwSt2bqUMsHF9xDsaNKhafiGuWDB ===== from bitcoinaddress import Wallet import random filename ='puzzle.txt' with open(filename) as f: line_count = 0 for line in f: line != "\n" line_count += 1 wi...
2.765625
3
src/pyscripts/mindTrain.py
widmerin/OpenBCI_NodeJS_IP6
0
12798513
## # train eeg data of mind commands # (beta) # ## import json import os import sys import time import pickle import numpy as np from mindFunctions import filterDownsampleData import codecs, json from scipy.signal import butter, lfilter from sklearn import svm, preprocessing, metrics from sklearn.model_selection impo...
2.265625
2
ai/human_console.py
Dratui/AI-Arena
2
12798514
<gh_stars>1-10 from src.games.games import Game def ai_output(board, game): #the ai's output corresponds to the human input output=input(game.move_description) while output not in [str(game.map_move_to_input[i]) for i in game.get_move_effective()]: #intput verification output=input(game.move_descriptio...
3.09375
3
src/cmssh/cms_cmds.py
dmwm/cmssh
2
12798515
#!/usr/bin/env python #-*- coding: ISO-8859-1 -*- #pylint: disable-msg=W0702 """ Set of UNIX commands, e.g. ls, cp, supported in cmssh. """ # system modules import os import re import sys import time import json import glob import shutil import base64 import pprint import mimetypes import traceback import subprocess ...
1.664063
2
abstraction/dist_metrics.py
xoren22/tmp
1
12798516
import torch class ACT_EMD: """ EMD stands for Earth Mover's Distance - Mallows distance or 1st Wasserstein distance between the two distributions, is a measure of the distance between two probability distributions. ACT or Approximate Constrained Transfers is a linear compelixty approximation of the ICT or Ite...
3.4375
3
vyatta/common/utils.py
Brocade-OpenSource/vrouter-plugins
0
12798517
# Copyright 2015 Brocade Communications System, 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 # #...
1.992188
2
modi2_firmware_updater/util/modi_winusb/modi_serialport.py
LUXROBO/-modi2-firmware-updater-
1
12798518
import sys import time import serial import serial.tools.list_ports as stl def list_modi_serialports(): info_list = [] def __is_modi_port(port): return (port.vid == 0x2FDE and port.pid == 0x0003) modi_ports = [port for port in stl.comports() if __is_modi_port(port)] for modi_por...
2.515625
3
addon/pycThermopack/gui/widgets/mpl_canvas.py
SINTEF/Thermopack
28
12798519
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg from matplotlib.figure import Figure from gui.utils import MessageBox import numpy as np class MplCanvas(FigureCanvasQTAgg): """ A canvas for matplotlib plots. Contains all plot functionality for Plot Mode """ def __init__(self, compo...
2.75
3
christmas_tree..py
SmashedFrenzy16/christmas-tree
0
12798520
import turtle s = turtle.Screen() t = turtle.Turtle() s.title("Christmas Tree") s.setup(width=800, height=600) # Title on the window pen = turtle.Turtle() pen.speed(0) pen.color("black") pen.penup() pen.hideturtle() pen.goto(0, 260) pen.write("Christmas Tree", align="center",font=("Arial", 24, "normal")) # Starting...
3.6875
4
pxr/usd/lib/usdGeom/testenv/testUsdGeomMesh.py
YuqiaoZhang/USD
88
12798521
#!/pxrpythonsubst # # Copyright 2017 Pixar # # Licensed under the Apache License, Version 2.0 (the "Apache License") # with the following modification; you may not use this file except in # compliance with the Apache License and the following modification to it: # Section 6. Trademarks. is deleted and replaced with: # ...
2.09375
2
src/TheLanguage/Grammars/v0_0_1/Expressions/MatchValueExpression.py
davidbrownell/DavidBrownell_TheLanguage
0
12798522
<reponame>davidbrownell/DavidBrownell_TheLanguage # ---------------------------------------------------------------------- # | # | MatchValueExpression.py # | # | <NAME> <<EMAIL>> # | 2021-10-12 10:28:57 # | # ---------------------------------------------------------------------- # | # | Copyright <NAM...
2.0625
2
features/support/actions.py
alexgarzao/beeweb
5
12798523
from parse import parse class Actions: def __init__(self): self.actions = {} self.unused = set() self.used = set() # TODO: Refactor: Deveria ter classe Action, e ela deveria ser retornada nesta funcao. def add_action(self, action_name): action_name = action_name.lower() ...
3.21875
3
ws/handler/event/enum/holiday/christmas.py
fabaff/automate-ws
0
12798524
import home from ws.handler.event.enum import Handler as Parent class Handler(Parent): KLASS = home.event.holiday.christmas.Event TEMPLATE = "event/enum.html" LABEL = "Christmas" DAY = "day" EVE = "eve" TIME = "time" OVER = "is over" def _get_str(self, e): if e == home.event...
2.421875
2
ad-hoc/p11496.py
sajjadt/competitive-programming
10
12798525
<filename>ad-hoc/p11496.py from sys import stdin, stdout while True: n = int(input()) if n == 0: break line = list(map(int, stdin.readline().strip().split())) local_extremas = 0 for i in range(1, len(line) - 1): if line[i] > line[i-1] and line[i] > line[i+1]: local_extremas += 1 if line[i...
3.1875
3
test.py
andrey1908/hero_radar_odometry
0
12798526
import argparse import json from time import time import os import shutil import numpy as np import torch from datasets.oxford import get_dataloaders from datasets.boreas import get_dataloaders_boreas from datasets.radiate import get_dataloaders_radiate from networks.under_the_radar import UnderTheRadar from networks....
1.9375
2
Codebase/Deprecated_Codebase_I/circular_magnetic_field.py
psmd-iberutaru/Akamai_Internship
0
12798527
<reponame>psmd-iberutaru/Akamai_Internship import inspect import numpy as np import scipy as sp import scipy.special as sp_spcl import matplotlib.pyplot as plt from Robustness.exception import * import Robustness.validation as valid import gaussian_fitting as gaussfit import bessel_fitting as bessfit import misc_func...
2.53125
3
server/attendance/admin.py
CS305-software-Engineering/vehicle-attendance-system
1
12798528
from django.contrib import admin from .models import * # Register your models here. admin.site.register(Vehicle) admin.site.register(VehicleLogging) admin.site.register(RegisteredUserLogging) admin.site.register(VisitorUserLogging)
1.375
1
expfactory_deploy/experiments/migrations/0013_auto_20211119_2336.py
rwblair/expfactory-deploy
0
12798529
# Generated by Django 3.1.7 on 2021-11-19 23:36 from django.db import migrations import model_utils.fields class Migration(migrations.Migration): dependencies = [ ('experiments', '0012_repoorigin_name'), ] operations = [ migrations.AddField( model_name='battery', ...
1.648438
2
setup.py
TheRockXu/aifin
3
12798530
#!/usr/bin/env python from distutils.core import setup setup(name='aifin', version='1.0.1', description='Python Distribution Utilities', author='<NAME>', author_email='<EMAIL>', url='aitroopers.com', packages=['aifin'], install_requires=[ 'pandas','scipy' ...
1.226563
1
src/quick_sort.py
sean-bai/sort
0
12798531
from typing import List, NoReturn def quick_sort(in_list: List[int], s_idx: int, e_idx: int) -> NoReturn: if e_idx > s_idx: first_idx = s_idx last_idx = e_idx base_idx = int((s_idx + e_idx)/2) base_val = in_list[base_idx] in_list[first_idx], in_list[base_i...
3.515625
4
transmogrify/network.py
natgeosociety/Transmogrify
0
12798532
<reponame>natgeosociety/Transmogrify import os import urlparse class Http404(Exception): pass def get_path(environ): """ Get the path """ from wsgiref import util request_uri = environ.get('REQUEST_URI', environ.get('RAW_URI', '')) if request_uri == '': uri = util.request_uri(env...
2.578125
3
Coordinates/coordinates.py
FelipeLSP/Python
0
12798533
<gh_stars>0 import math def centroid(listCoordinates): xCentroid = 0 yCentroid = 0 listCentroid=[] for i in range(0, len(listCoordinates)): xCentroid += listCoordinates[i][0] yCentroid += listCoordinates[i][1] xCentroid = round(xCentroid / len(listCoordinates), 1) yCentroid = r...
3.1875
3
appengine/components/tests/auth_endpoints_smoke_test.py
pombreda/swarming
0
12798534
#!/usr/bin/env python # Copyright 2014 The Swarming Authors. All rights reserved. # Use of this source code is governed by the Apache v2.0 license that can be # found in the LICENSE file. """Smoke test for Cloud Endpoints support in auth component. It launches app via dev_appserver and queries a bunch of cloud endpoi...
2.09375
2
tp2/src/ASA.py
Qjao02/compiladores
0
12798535
<gh_stars>0 from Token import Token class AST(object): def __init__(self, nome): self.nome = nome; self.children = [] self.tipo = None #tipo do nó. Compound, Assign, ArithOp, etc self.value = None def __str__(self, level=0): ret = "\t"*level+ repr(self) +...
3.359375
3
Day41-55/code/oa/hrs/migrations/0002_auto_20180523_0923.py
xie186/Python-100-Days-EN
6
12798536
# Generated by Django 2.0.5 on 2018-05-23 01:23 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('hrs', '0001_initial'), ] operations = [ migrations.AddField( model_name='dept', name='excellent', field=...
1.648438
2
scripts/mechanics/ammoFind.py
TheNewGuy100/PyxelGameProject
0
12798537
<gh_stars>0 import random import pyxel class ammoSpawner(): probability = 0 ammo_package_list = [] ammo_package_x = 0 ammo_package_y = 0 ammo_package_img = 0 ammo_package_u = 48 ammo_package_v = 0 ammo_package_w = 16 ammo_package_h = 16 ammo_package_color_exclusion = 0 def...
2.65625
3
web3auth/backend.py
sneeu/django-web3-auth
0
12798538
<reponame>sneeu/django-web3-auth from typing import Optional from typing import Optional from django.contrib.auth import get_user_model, backends from django.conf import settings from web3auth.utils import recover_to_addr User = get_user_model() DEFAULT_ADDRESS_FIELD = 'username' class Web3Backend(backends.ModelB...
2.421875
2
tools/telemetry/telemetry/core/timeline/event.py
nagineni/chromium-crosswalk
2
12798539
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. class TimelineEvent(object): """Represents a timeline event.""" def __init__(self, category, name, start, duration, args=None): self.category = c...
2.828125
3
batchglm/models/glm_norm/utils.py
le-ander/batchglm
0
12798540
import logging import numpy as np import scipy.sparse from typing import Union from .external import closedform_glm_mean, closedform_glm_scale logger = logging.getLogger("batchglm") def closedform_norm_glm_mean( x: Union[np.ndarray, scipy.sparse.csr_matrix], design_loc: np.ndarray, constrain...
2.78125
3
optic_store/doc_events/serial_no.py
iptelephony/optic_store
14
12798541
<reponame>iptelephony/optic_store # -*- coding: utf-8 -*- # Copyright (c) 2019, 9T9IT and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe def after_insert(doc, method): is_gift_card = frappe.db.get_value("Item", doc.item_code, "is_gift_card") ...
2.125
2
soc-wk1-cert-Diana-Ilinca.py
dianaproca/toolkitten
0
12798542
<reponame>dianaproca/toolkitten<filename>soc-wk1-cert-Diana-Ilinca.py # # soc-wk1-cert-Diana-Ilinca.py # # Day1 homework # #hours in a year:8760 # print(365*24) # #minutes in a decade: 5256000 # print(60*24*365*10) # #age in seconds:1135296000 # print(60*60*24*365*36) # #days 32-bit system to timeout:497 # print((2**3...
3.328125
3
software/Opal/spud/dxdiff/dxdiff/editscript.py
msc-acse/acse-9-independent-research-project-Wade003
2
12798543
#!/usr/bin/env python # This file is part of dxdiff. # # dxdiff is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ...
2.234375
2
Web/chat/chatserver.py
kasztp/python-lessons
35
12798544
import logging from time import time from flask import Flask, request PLAIN_HEADER = {'Content-Type': 'text/plain; charset=utf-8'} logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)s %(threadName)s %(message)s') log = logging.getLogger('chatserver') app = Flask(__name__) messages = [] @app.rou...
2.625
3
main/path-sum-iii/path-sum-iii.py
EliahKagan/old-practice-snapshot
0
12798545
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def pathSum(self, root, total): """ :type root: TreeNode :type total: int :rtype: int """ ...
3.6875
4
examples/wordcount/lambda_filter.py
dsouzajude/xFlow
13
12798546
<filename>examples/wordcount/lambda_filter.py import json import boto3 import base64 OUTBOUND_EVENT = 'FileFiltered' LETTERS = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' def reword(word): ''' Removes non-letters from word ''' reworded = '' for letter in word: if letter not in LETTERS...
2.765625
3
Uche Clare/Phase 1/Python Basic 1/Day 2/Task-7.py
CodedLadiesInnovateTech/-python-challenge-solutions
6
12798547
<gh_stars>1-10 file = input('Enter the file name: ') file_extsn= file.split(".") print(f"The file extension is {file_extsn[1]}")
3.203125
3
CoachYacc.py
crabster15/Coach_plus_plus_plus
0
12798548
import ply.yacc as yacc from CoachLex import tokens #enviromental variables enviro_vars = {} def p_statement_assign(p): 'statement : VARINT VAR expression' enviro_vars[p[2]] = p[3] def p_statement_expr(p): 'statement : expression' def p_statement_output(p): 'statement : OUTPUT expression' print(...
2.953125
3
recipe/admin.py
wichmannpas/recipemanager
1
12798549
from django.contrib import admin, messages from django.db import transaction from django.db.models import Prefetch from recipe.models import Ingredient, Recipe, RecipeIngredient, RecipeInstance, \ RecipeInstanceImage, Tag admin.site.register(Tag) @admin.register(Ingredient) class IngredientAdmin(admin.ModelAdmi...
2.03125
2
am/ls_importer/management/commands/import_people.py
access-missouri/am-django-project
4
12798550
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Import a folder (~/people) full of person JSON from Legiscan to the database. """ from django.core.management.base import BaseCommand from general.models import Person from ls_importer.models import LSIDPerson import json import os from tqdm import tqdm class Command(...
2.25
2