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 |
|---|---|---|---|---|---|---|
opti.py | ingwarr/tinypack | 0 | 34000 | <reponame>ingwarr/tinypack<filename>opti.py
#!/usr/bin/env python
import urllib2
package_list = ['wget.tcz', 'python-pip.tcz', 'unzip.tcz', 'sudo.tcz',
'mksquashfs.tcz', 'gawk.tcz', 'genisoimage.tcz', 'qemu.tcz',
'pidgin.tcz']
serv_url = "http://distro.ibiblio.org/tinycorelinux/2.x/tcz/... | 2.421875 | 2 |
tests/test_04_dxf_high_level_structs/test_411_acds_data.py | jpsantos-mf/ezdxf | 1 | 34001 | <reponame>jpsantos-mf/ezdxf
# Copyright (c) 2014-2019, <NAME>
# License: MIT License
import pytest
from ezdxf.sections.acdsdata import AcDsDataSection
from ezdxf import DXFKeyError
from ezdxf.lldxf.tags import internal_tag_compiler, group_tags
from ezdxf.lldxf.tagwriter import TagCollector, basic_tags_from_text
@pyt... | 2.21875 | 2 |
test_app.py | WindfallLabs/tkit | 0 | 34002 | # -*- coding: utf-8 -*-
"""
app_test.py
Tests the tkit.App class.
Author: <NAME>; Oct 2017
License: MIT
"""
import tkit
if __name__ == "__main__":
# Create app
test_app = tkit.App("Test App", 250, 100)
# Create and customize menubar
menubar = tkit.Menubar()
menubar.add_menu("File")
#test_men... | 2.375 | 2 |
services/storage/src/simcore_service_storage/models.py | oetiker/osparc-simcore | 0 | 34003 | """ Database models
"""
from typing import Tuple
import attr
import sqlalchemy as sa
from .settings import DATCORE_STR, SIMCORE_S3_ID, SIMCORE_S3_STR
#FIXME: W0611:Unused UUID imported from sqlalchemy.dialects.postgresql
#from sqlalchemy.dialects.postgresql import UUID
#FIXME: R0902: Too many instance attributes (... | 2.296875 | 2 |
fairtools/utils.py | cmougan/FairShift | 0 | 34004 | import pandas as pd
from sklearn.pipeline import Pipeline
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.metrics import confusion_matrix, roc_auc_score
from category_encoders import MEstimateEncoder
import numpy as np
from collections import defaultdict
import os
from sklearn.metrics import roc_au... | 2.71875 | 3 |
py/py_0527_randomized_binary_search.py | lcsm29/project-euler | 0 | 34005 | # Solution of;
# Project Euler Problem 527: Randomized Binary Search
# https://projecteuler.net/problem=527
#
# A secret integer t is selected at random within the range 1 ≤ t ≤ n. The
# goal is to guess the value of t by making repeated guesses, via integer g.
# After a guess is made, there are three possible outco... | 3.53125 | 4 |
NOV_17_2020/quiz2.py | refeed/PAlgoritmaTRPLA | 0 | 34006 | <filename>NOV_17_2020/quiz2.py
'''
No 2. Buatlah fungsi tanpa pengembalian nilai, yaitu fungsi segitigabintang.
Misal, jika dipanggil dg segitigabintang(4), keluarannya :
*
**
***
****
'''
def segitigabintang(baris):
for i in range(baris):
print('*' * (i+1))
| 2.890625 | 3 |
simple/game_loop_process.py | loyalgarlic/snakepit-game | 124 | 34007 | import asyncio
from aiohttp import web
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
from multiprocessing import Queue, Process
import os
from time import sleep
async def handle(request):
index = open("index.html", 'rb')
content = index.read()
return web.Response(body=content, co... | 3.078125 | 3 |
elex/api/models.py | adamsimp/elex | 0 | 34008 | <reponame>adamsimp/elex
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import ujson as json
import datetime
from elex.api import maps
from elex.api import utils
from collections import OrderedDict
from dateutil import parser as dateutil_parser
PCT_PRECISION = 6
class APElection(utils.UnicodeMixin):
... | 2.15625 | 2 |
Python/dataset_info.py | ashwinvis/augieretal_jfm_2019_shallow_water | 1 | 34009 | <gh_stars>1-10
# coding: utf-8
"""Preview dataset content without extracting."""
import os
import itertools
from pathlib import Path
from zipfile import ZipFile
from concurrent.futures import ThreadPoolExecutor as Pool
import hashlib
cwd = Path(__file__).parent / "dataset"
ls = lambda pattern: sorted(cwd.glob(pattern... | 2.453125 | 2 |
tests/test_reference.py | momojohobo/wecs | 0 | 34010 | import pytest
from fixtures import world
from wecs.core import UID
from wecs.core import NoSuchUID
from wecs.core import Component
@Component()
class Reference:
uid: UID
def test_user_defined_names(world):
entity = world.create_entity(name="foo")
assert entity._uid.name == "foo"
def test_automatic_n... | 2.328125 | 2 |
vizsgaremek/test_conduit_logged_in.py | femese/conduit | 0 | 34011 | from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager
from pages.home_page import HomePage
from pages.profile_page import ProfilePage
from pages.login_page import LoginPage
from pages.registration_page import RegistrationPage
from p... | 2.546875 | 3 |
tests/data.py | MathMagique/azure-cost-mon | 65 | 34012 | api_output_for_empty_months = """"Usage Data Extract",
"",
"AccountOwnerId","Account Name","ServiceAdministratorId","SubscriptionId","SubscriptionGuid","Subscription Name","Date","Month","Day","Year","Product","Meter ID","Meter Category","Meter Sub-Category","Meter Region","Meter Name","Consumed Quantity","Reso... | 1.710938 | 2 |
python lab 5 & 6/l5q3.py | gonewithharshwinds/itt-lab | 1 | 34013 | #!/usr/bin/python3
m1 = int(input("Enter no. of rows : \t"))
n1 = int(input("Enter no. of columns : \t"))
a = []
print("Enter Matrix 1:\n")
for i in range(n1):
row = list(map(int, input().split()))
a.append(row)
print(a)
m2 = int(n1)
print("\n Your Matrix 2 must have",n1,"rows and",m1,"columns \n")
n2 ... | 3.703125 | 4 |
ifitwala_ed/hr/doctype/training_feedback/training_feedback.py | mohsinalimat/ifitwala_ed | 13 | 34014 | <reponame>mohsinalimat/ifitwala_ed
# Copyright (c) 2021, ifitwala and contributors
# For license information, please see license.txt
import frappe
from frappe.model.document import Document
from frappe import _
class TrainingFeedback(Document):
def validate(self):
training_event = frappe.get_doc("Training Event", ... | 1.984375 | 2 |
classo/compact_func.py | muellsen/classo | 20 | 34015 | import numpy as np
import numpy.linalg as LA
from .solve_R1 import problem_R1, Classo_R1, pathlasso_R1
from .solve_R2 import problem_R2, Classo_R2, pathlasso_R2
from .solve_R3 import problem_R3, Classo_R3, pathlasso_R3
from .solve_R4 import problem_R4, Classo_R4, pathlasso_R4
from .path_alg import solve_path, pathalgo... | 2.765625 | 3 |
python/eggroll/core/datastructure/__init__.py | liszekei/eggroll | 209 | 34016 | <gh_stars>100-1000
# Copyright (c) 2019 - now, Eggroll 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
#
... | 2.078125 | 2 |
install/TexGen/Python/Scripts/cotton.py | dalexa10/puma | 14 | 34017 | # =============================================================================
# TexGen: Geometric textile modeller.
# Copyright (C) 2015 <NAME>
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation;... | 1.695313 | 2 |
glove.py | 2014mchidamb/TorchGlove | 96 | 34018 | <gh_stars>10-100
from nltk.tokenize import word_tokenize
from torch.autograd import Variable
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.optim as optim
# Set parameters
context_size = 3
embed_size = 2
xmax = 2
alpha = 0.75
batch_size = 20
l_rate ... | 2.78125 | 3 |
tests/python/tblink_rpc_smoke.py | tblink-rpc/tblink-rpc-core | 1 | 34019 | <gh_stars>1-10
'''
Created on Jul 5, 2021
@author: mballance
'''
from tblink_rpc_testcase import TblinkRpcTestcase
import sys
from tblink_rpc_core.json.json_transport import JsonTransport
import asyncio
from tblink_rpc_core.param_val_map import ParamValMap
from tblink_rpc_core.endpoint import Endpoint
class TblinkRpc... | 2.0625 | 2 |
backend/utils/management/commands/createsu.py | stasfilin/rss_portal | 0 | 34020 | <gh_stars>0
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""
Command for creating default superuser
"""
def handle(self, *args, **options):
if not User.objects.filter(username="admin").exists():
User.ob... | 2.5 | 2 |
addition_module/DSDG/DUM/train.py | weihaoxie/FaceX-Zoo | 1 | 34021 | <gh_stars>1-10
from __future__ import print_function, division
import torch
import matplotlib.pyplot as plt
import argparse, os
import numpy as np
from torch.utils.data import DataLoader
from torchvision import transforms
from models.CDCNs_u import Conv2d_cd, CDCN_u
from Load_OULUNPUcrop_train import Spoofi... | 1.78125 | 2 |
examples/test_python_folder_classify.py | TensorPy/TensorPy | 45 | 34022 | from tensorpy import image_base
classifications = image_base.classify_folder_images('./images')
print("*** Displaying Image Classification Results as a list: ***")
for classification in classifications:
print(classification)
| 2.65625 | 3 |
deep_audio_features/bin/basic_test.py | tyiannak/deep_audio_features | 40 | 34023 | import argparse
import torch
from torch.utils.data import DataLoader
import sys, os
sys.path.insert(0, os.path.join(
os.path.dirname(os.path.realpath(__file__)), "../../"))
from deep_audio_features.dataloading.dataloading import FeatureExtractorDataset
from deep_audio_features.models.cnn import load_cnn
from deep_a... | 2.34375 | 2 |
RoboticsLanguage/Tools/Exceptions.py | robotcaresystems/roboticslanguage | 64 | 34024 | <reponame>robotcaresystems/roboticslanguage<gh_stars>10-100
#
# This is the Robotics Language compiler
#
# ErrorHandling.py: Implements Error Handling functions
#
# Created on: June 22, 2017
# Author: <NAME>
# Licence: Apache 2.0
# Copyright: 2014-2017 Robot Care Systems BV, The Hague, The Netherlan... | 2.53125 | 3 |
idMatching_windowcards.py | CarnegieHall/metadata-matching | 4 | 34025 | <filename>idMatching_windowcards.py
# !/usr/local/bin/python3.4.2
# ----Copyright (c) 2016 <NAME> | The MIT License (MIT)----
# ----For the full license terms, please visit https://github.com/CarnegieHall/quality-control/blob/master/LICENSE----
# run script with 5 arguments:
# argument 0 is the script name
# argument 1... | 2.453125 | 2 |
data_input/__init__.py | carlosvin/pricecalculator | 0 | 34026 | <gh_stars>0
# -*- coding: utf8 -*-
from urllib.request import Request, urlopen
import logging
import parsing
__author__ = 'carlos'
class Downloader(object):
def __init__(self, url):
self.url = url
def read(self):
request = Request( self.url )
request.add_header('Accept-e... | 2.875 | 3 |
ursina/string_utilities.py | jtiai/ursina | 1 | 34027 | import re
import traceback
from textwrap import dedent
def camel_to_snake(value):
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', value)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
def snake_to_camel(value):
camel = ''
words = value.split('_')
for w in words:
camel += w.title()
... | 3.84375 | 4 |
catkin_ws/src/00-infrastructure/easy_regression/include/easy_regression/processors/__init__.py | yxiao1996/dev | 2 | 34028 | <reponame>yxiao1996/dev<filename>catkin_ws/src/00-infrastructure/easy_regression/include/easy_regression/processors/__init__.py
from .identity import * | 0.992188 | 1 |
setup.py | whipper-team/morituri-eaclogger | 9 | 34029 | <gh_stars>1-10
from setuptools import setup
from eaclogger import __version__ as plugin_version
setup(
name="whipper-plugin-eaclogger",
version=plugin_version,
description="A plugin for whipper which provides EAC style log reports",
author="JoeLametta, supermanvelo",
maintainer="JoeLametta",
li... | 1.34375 | 1 |
main.py | cankut/image-to-prime | 0 | 34030 | <gh_stars>0
from PrimeSearcher import PrimeSearcher
###
ps = PrimeSearcher("./images/euler.jpg")
ps.rescale(60*60, fit_to_original=True)
ps.search(max_iterations=1000, noise_count=1, break_on_find=False)
| 2.21875 | 2 |
Phyton/sinavKontrol.py | huseyinozdem/programlamaninTemelleri | 0 | 34031 | import sys
import os
import random
klasorAdi = os.path.dirname(sys.argv[0])
dosyaIsmi = klasorAdi + "/test.txt"
soruSayisi = 40
ogrenciSayisi = 60
d = {}
dogruSayisi = {}
yalisSayisi = {}
bosSayisi = {}
puan = {}
def sinavHazirla():
for j in range(1, soruSayisi + 1):
r1 = random.randint(1, 5)
d[0, j] = chr(... | 2.8125 | 3 |
heufybot/modules/commands/time_command.py | Heufneutje/PyHeufyBot | 3 | 34032 | from twisted.plugin import IPlugin
from heufybot.moduleinterface import IBotModule
from heufybot.modules.commandinterface import BotCommand
from heufybot.utils.timeutils import now, timestamp
from zope.interface import implements
from datetime import datetime
class TimeCommand(BotCommand):
implements(IPlugin, IBo... | 2.421875 | 2 |
problem11.py | Scitator/fivt_bioinfo17 | 0 | 34033 | import pandas as pd
import click
import collections
def kmer_suffix(kmer):
return kmer[1:]
def kmer_prefix(kmer):
return kmer[:-1]
def chunks(l, n):
"""Yield successive n-sized chunks from l."""
for i in range(0, len(l), n):
yield l[i:i + n]
def build_graph(kmers):
graph = collection... | 3.140625 | 3 |
ch22/import_test.py | eroicaleo/LearningPython | 1 | 34034 | #!/usr/bin/env python3
import sys
import re
import time
import datetime
import os
for module in sorted(sys.modules):
print("%-20s : %s" % (module, sys.modules[module]))
print('USER : ', os.environ['USER'])
print('PWD : ', os.environ['PWD'])
print('PYTHONPATH: ', os.environ.get('PYTHONPATH'))
print(sy... | 2.328125 | 2 |
tests/infrastructure/test_bpelearner.py | maximzubkov/codeprep | 33 | 34035 | # SPDX-FileCopyrightText: 2020 <NAME> <<EMAIL>>
#
# SPDX-License-Identifier: Apache-2.0
from unittest import mock
import pytest
from codeprep.bpepkg.bpe_config import BpeConfig, BpeParam, BpeConfigNotSupported
from codeprep.pipeline.bpelearner import run
@mock.patch('codeprep.pipeline.bpelearner.Dataset', autospec... | 1.945313 | 2 |
tcheck.py | zcm/tcheck | 0 | 34036 | #!/usr/bin/env python3
import torrent_parser as tp
import asyncio
import contextlib
import pathlib
import argparse
import pprint
import hashlib
import concurrent.futures
import os.path
import logging
import tqdm
class TorrentChecker(object):
def __init__(self, datadir=pathlib.Path('.'), data_file_globs=["**"],
... | 2.390625 | 2 |
segmentation_tools/__init__.py | shiwei23/ImageAnalysis3 | 3 | 34037 | # Functions to segment chromosomes
from . import chromosome
from . import cell | 1.054688 | 1 |
kha/scraper.py | claui/kommtheuteaktenzeichen | 2 | 34038 | <reponame>claui/kommtheuteaktenzeichen
"""Scrape episodes from online sources."""
from datetime import datetime
import re
from typing import Dict, Iterable, Match, Optional, Tuple
import requests
from .episode import Episode
from .settings \
import WUNSCHLISTE_IMPLIED_TIMEZONE, \
WUNSCHLISTE_QUERY_PARAMETERS... | 3.078125 | 3 |
locust/locustfile.py | FannySundlofSopra/locust-on-azure | 0 | 34039 | <reponame>FannySundlofSopra/locust-on-azure
from locust import HttpUser, task, between
from locust.contrib.fasthttp import FastHttpUser
class TestUser(FastHttpUser):
@task
def viewPage(self):
self.client.get('/insamlingar/varldshjalte')
self.client.get('/webpack-runtime-72a2735cd8a1a24911... | 1.960938 | 2 |
lino_book/projects/lydia/tests/dumps/18.12.0/invoicing_plan.py | lino-framework/lino_book | 3 | 34040 | # -*- coding: UTF-8 -*-
logger.info("Loading 1 objects to table invoicing_plan...")
# fields: id, user, today, journal, max_date, partner, course
loader.save(create_invoicing_plan(1,6,date(2015,3,1),1,None,None,None))
loader.flush_deferred_objects()
| 1.773438 | 2 |
PyYADL/redis_lock.py | PawelJ-PL/PyYADL | 2 | 34041 | <gh_stars>1-10
from time import time
from json import dumps, loads
from redis import StrictRedis, ConnectionPool, WatchError
from PyYADL.distributed_lock import AbstractDistributedLock
class RedisLock(AbstractDistributedLock):
def __init__(self, name, prefix=None, ttl=-1, existing_connection_pool=None, redis_hos... | 2.3125 | 2 |
benchmarks/SimResults/_bigLittle_hrrs_spec_tugberk_rr/cmp_leslie3d/power.py | TugberkArkose/MLScheduler | 0 | 34042 | <filename>benchmarks/SimResults/_bigLittle_hrrs_spec_tugberk_rr/cmp_leslie3d/power.py
power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322... | 1.414063 | 1 |
ros/devel/lib/python2.7/dist-packages/darknet_ros_msgs/msg/_CheckForObjectsAction.py | wutianze/ComP | 3 | 34043 | <gh_stars>1-10
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from darknet_ros_msgs/CheckForObjectsAction.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import darknet_ros_msgs.msg
import sensor_msgs.msg
import genpy
... | 1.828125 | 2 |
datalabframework/paths.py | Quyenna/datalabframework | 0 | 34044 | import os
_rootdir = os.getcwd()
def find_rootdir(filenames = ('__main__.py', 'main.ipynb')):
path = os.getcwd()
while os.path.isdir(path):
ls = os.listdir(path)
if any([f in ls for f in filenames]):
return os.path.abspath(path)
else:
path += '/..'
# nothi... | 3.015625 | 3 |
python/dailycodingproblems/problem0003.py | smhnr27/code | 0 | 34045 | <reponame>smhnr27/code<filename>python/dailycodingproblems/problem0003.py<gh_stars>0
# Given the root to a binary tree, implement serialize(root), which serializes the tree into a string, and deserialize(s), which deserializes the string back into the tree.
#
# For example, given the following Node class:
class Node:
... | 3.875 | 4 |
test.py | ndwuhuangwei/py-radio-autoencoder | 0 | 34046 | import math
import random
import numpy as np
# 先生成一个随机的信源
def random_sources():
random_sources = random.randint(0, 16)
print('这个随机数是', random_sources)
return hanming(random_sources)
# return bin(int(random_sources)... | 3.3125 | 3 |
backend/app/bug_killer_app/test/api/test_bug.py | SeanFitzpatrick0/BugKiller | 0 | 34047 | <gh_stars>0
import json
from unittest import TestCase
from unittest.mock import patch
from bug_killer_api_interface.schemas.entities.bug import BugResolution
from bug_killer_api_interface.schemas.request.bug import CreateBugPayload, UpdateBugPayload
from bug_killer_api_interface.schemas.request.project import CreatePr... | 2.046875 | 2 |
Module3/notes/imshow_example.py | FernanOrtega/DAT210x | 0 | 34048 | <reponame>FernanOrtega/DAT210x
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 21 13:15:22 2017
@author: fernando
"""
import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
matplotlib.style.use('ggplot') # Look Pretty
# If the above line throws an error, use plt.style.use('ggplot'... | 2.84375 | 3 |
api/models.py | AnuragTimilsina/SchoolSystemAPI | 0 | 34049 | from django.db import models
from users.models import User
class Assignment(models.Model):
title = models.CharField(max_length=50)
teacher = models.ForeignKey(User, on_delete=models.CASCADE)
def __str__(self):
return self.title
class GradedAssignment(models.Model):
student = models.ForeignK... | 2.46875 | 2 |
src/main/functions/poisson_regression.py | far2raf/method-optimization-resit | 0 | 34050 | <gh_stars>0
import numpy as np
import scipy.sparse
from src.main.functions.interface_function import InterfaceFunction
class PoissonRegression(InterfaceFunction):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# В формулах в задании и на вики почему-то максимизирует loss
... | 2.359375 | 2 |
fastapi version/src/fastapp/__init__.py | abhiWriteCode/TextSummarization | 0 | 34051 | from fastapi import FastAPI
from . import api
app = FastAPI(debug=True)
app.include_router(api.router) | 1.414063 | 1 |
Onaeri/timekeeper.py | Lakitna/Onaeri | 0 | 34052 | <reponame>Lakitna/Onaeri<gh_stars>0
import time
import math
from . import settings
class TimeKeeper:
"""
Handles timekeeping in timecodes
"""
def __init__(self, minpertimecode=None,
runtime=0, update=True, latestcode=None):
self._minPerTimeCode = minpertimecode or settings.Glo... | 3.0625 | 3 |
storm_analysis/L1H/cs_analysis.py | bintulab/storm-analysis | 0 | 34053 | #!/usr/bin/env python
"""
Perform compressed sensing analysis on a dax file using the
homotopy approach. Return the results in hres image format and
as a list of object locations.
Hazen 09/12
"""
import numpy
import storm_analysis.sa_library.datareader as datareader
import storm_analysis.sa_library.parameters as par... | 2.65625 | 3 |
ism/dal/sqlite3_dao.py | kaliklipper/python_state_machine | 1 | 34054 | """
Methods for handling DB creation and CRUD operations in Sqlite3.
"""
# Standard library imports
import logging
import sqlite3
# Local application imports
from ism.exceptions.exceptions import UnrecognisedParameterisationCharacter
from ism.interfaces.dao_interface import DAOInterface
class Sqlite3DAO(DAOInterfac... | 3.390625 | 3 |
src/content_selection/old_lda.py | elenakhas/summarization_system | 0 | 34055 | <gh_stars>0
import os
import json
import argparse
from gensim import corpora
from gensim.utils import simple_preprocess
from gensim.models import LdaModel
# reaad json file
def parseJson(json_file):
'''
parsing the JSON file from the pre-processing pipeline
:param json_file
:return: dictionary with do... | 2.859375 | 3 |
uva/247.py | btjanaka/competitive-programming-solutions | 3 | 34056 | # Author: btjanaka (<NAME>)
# Problem: (UVa) 247
import sys
from collections import defaultdict
def kosaraju(g, g_rev):
order = []
visited = set()
def visit(u):
visited.add(u)
for v in g[u]:
if v not in visited:
visit(v)
order.append(u)
for u in g... | 3.15625 | 3 |
lib/dataset/utils.py | decisionforce/mmTransformer | 199 | 34057 | <reponame>decisionforce/mmTransformer<filename>lib/dataset/utils.py
import math
import numpy as np
from sklearn.linear_model import LinearRegression
def get_heading_angle(traj: np.ndarray):
"""
get the heading angle
traj: [N,2] N>=6
"""
# length == 6
# sort position
_traj = traj.c... | 2.84375 | 3 |
src/utils/schema/jobserver/migrations/0013_migrate_job_completion.py | gravitationalwavedc/gwcloud_job_server | 0 | 34058 | <reponame>gravitationalwavedc/gwcloud_job_server<gh_stars>0
# Generated by Django 3.0.4 on 2020-05-17 22:34
from django.db import migrations, models
from django.utils import timezone
def migrate_job_completion(apps, schema_editor):
Job = apps.get_model("jobserver", "Job")
JobHistory = apps.get_model("jobserv... | 2.234375 | 2 |
tests/test.py | limited/Superior-Cache-ANalyzer | 0 | 34059 | <reponame>limited/Superior-Cache-ANalyzer
#!/usr/bin/env python3
# Copyright 2018 Comcast Cable Communications Management, LLC
# 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.953125 | 2 |
ansible/venv/lib/python2.7/site-packages/ansible/modules/cloud/vmware/vmware_host_powermgmt_policy.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 17 | 34060 | <reponame>gvashchenkolineate/gvashchenkolineate_infra_trytravis<gh_stars>10-100
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, <NAME> <<EMAIL>>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_funct... | 1.484375 | 1 |
drizzlepac/run_hla_flag_filter.py | srodney/drizzlepac | 2 | 34061 | <gh_stars>1-10
#!/usr/bin/env python
"""This script simply calls drizzlepac/hlautils/hla_flag_filter.py for test purposes"""
import json
import glob
import os
import pdb
import sys
from astropy.table import Table
import drizzlepac
from drizzlepac.hlautils import config_utils
from drizzlepac.hlautils import poller_uti... | 2.359375 | 2 |
get_position.py | Zerschleuniger/fracture_mechanics-automate_franc2d | 0 | 34062 | import pyautogui
import time
time.sleep(3)
print(pyautogui.position()) | 2.046875 | 2 |
tests/test_concatenated_brain_lstm.py | Dranero/NeuroEvolution-CTRNN_new | 0 | 34063 | <gh_stars>0
from tools.configurations import ConcatenatedBrainLSTMCfg
from brains.concatenated_brains import ConcatenatedLSTM
from brains.lstm import LSTMNumPy
from brains.ffnn import FeedForwardNumPy
import numpy as np
from gym.spaces import Box
class TestConcatenatedLSTM:
def test_concatenated_lstm_output(sel... | 2.59375 | 3 |
tests/pfmsoft/util/file/conftest.py | DonalChilde/Pfm-Util | 1 | 34064 | <reponame>DonalChilde/Pfm-Util
import json
from pathlib import Path
import pytest
@pytest.fixture(scope="module")
def test_path_root(tmp_path_factory):
file_test_root = tmp_path_factory.mktemp("file_util")
return file_test_root
@pytest.fixture(scope="module")
def json_data():
data = {"key1": "value1", ... | 2.171875 | 2 |
shell/core/help.py | dromero1452/shellsploit-framework | 2 | 34065 | <reponame>dromero1452/shellsploit-framework<filename>shell/core/help.py
# ------------------Bombermans Team---------------------------------#
# Author : B3mB4m
# Concat : <EMAIL>
# Project : https://github.com/b3mb4m/Shellsploit
# LICENSE : https://github.com/b3mb4m/Shellsploit/blob/master/LICENSE
# -----------------... | 1.945313 | 2 |
django_vcr/management/commands/download_tapes.py | areedtomlinson/django-vcr | 0 | 34066 | <filename>django_vcr/management/commands/download_tapes.py
import os
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
args = 'url'
help = 'Download VCR tapes from remote server'
option_list = BaseCommand.option_list + (
... | 2.5 | 2 |
common/src/stack/command/stack/commands/dump/plugin_bootaction.py | shivanshs9/stacki | 0 | 34067 | <filename>common/src/stack/command/stack/commands/dump/plugin_bootaction.py
# @copyright@
# Copyright (c) 2006 - 2018 Teradata
# All rights reserved. Stacki(r) v5.x stacki.com
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt
# @copyright@
import stack.commands
class Plugin(stack.commands.Plugin):
def pr... | 2.078125 | 2 |
swcms_social/faq/migrations/0005_auto_20180419_1001.py | ivanff/swcms | 0 | 34068 | <gh_stars>0
# Generated by Django 2.0.3 on 2018-04-19 07:01
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('faq', '0004_auto_20180322_1330'),
]
operations = [
migrations.AlterModelOptions(
name='faq',
options={'ordering'... | 1.53125 | 2 |
Missing Numbers.py | Shaikh-Nabeel/HackerRankAlgorithms | 0 | 34069 | """
Problem Statement
Numeros, The Artist, had two lists A and B, such that, B was a permutation of A. Numeros was very proud of these lists.
Unfortunately, while transporting them from one exhibition to another, some numbers from List A got left out. Can you
find out the numbers missing from A?
"""
__author__ = 'Dany... | 3.65625 | 4 |
jmap/account/imap/mailbox.py | filiphanes/jmap-proxy-python | 14 | 34070 | from jmap.account.imap.imap_utf7 import imap_utf7_decode, imap_utf7_encode
KNOWN_SPECIALS = set('\\HasChildren \\HasNoChildren \\NoSelect \\NoInferiors \\UnMarked \\Subscribed'.lower().split())
# special use or name magic
ROLE_MAP = {
'inbox': 'inbox',
'drafts': 'drafts',
'draft': 'drafts',
'draft messages':... | 2.046875 | 2 |
pyieee1905/multiap_msg.py | evanslai/pyieee1905 | 3 | 34071 | from pyieee1905.ieee1905_tlv import IEEE1905_TLV
from scapy.packet import Packet, bind_layers
from scapy.fields import BitField, XByteField, XShortField, XShortEnumField
from scapy.layers.l2 import Ether
IEEE1905_MCAST = "01:80:c2:00:00:13"
ieee1905_msg_type = {
0x0000:"TOPOLOGY_DISCOVERY_MESSAGE",
0x0001:... | 1.859375 | 2 |
daily_practice/tools/GetMem.py | joakimzhang/qa_study | 0 | 34072 | <gh_stars>0
# coding:utf8
'''
Created on 2016��8��30��
@author: zhangq
'''
from serial import Serial
import re
from threading import Thread
import time
import datetime
import pygal
import os
class FilterMem(object):
def __init__(self, port, baudrate):
self.serial_obj = Serial()
self.serial_obj.por... | 2.34375 | 2 |
worky/server.py | asuol/worky | 0 | 34073 | <reponame>asuol/worky
"""
MIT License
Copyright (c) 2020 <NAME> <<EMAIL>.lousa.<EMAIL>ques at gmail.com>
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 lim... | 1.703125 | 2 |
main.py | tyleralgigi/NCAA-NN | 3 | 34074 | <gh_stars>1-10
#files
import schedule
import test
import ATS
import editGameList
import getGames
import getData
#libs
import pathlib
import time
if __name__ == '__main__':
path = pathlib.Path(__file__).parent.absolute()
getData.getData()
print('1/6')
time.sleep(2)
getGames.start(path)
print('2/... | 1.875 | 2 |
waffle/tests/test_management.py | theunraveler/django-waffle | 1 | 34075 | <filename>waffle/tests/test_management.py
from __future__ import unicode_literals
import six
from django.core.management import call_command, CommandError
from django.contrib.auth.models import Group, User
from waffle import get_waffle_flag_model
from waffle.models import Sample, Switch
from waffle.tests.base import ... | 2.28125 | 2 |
cdma.py | SouppuoS/CDMA | 7 | 34076 | <filename>cdma.py
"""
Implement of Circular Differential Microphone Arrays (CDMA)
Reference:
[1] Benesty, Jacob, <NAME>, and <NAME>. Design of circular differential microphone arrays. Vol. 12. Berlin, Germany:: Springer, 2015.
"""
import numpy as np
c = 340
class circular_microphone_arrays():
def __init__(sel... | 2.890625 | 3 |
iteebot/manage.py | enkwolf/ITEE-discord-bot | 0 | 34077 | """
Command line management utilities for ITEEBot. This module's command line
interface will act as the bot's entry point when installed.
"""
import click
from . import configurator as conf
from . import database as db
from .bot import ITEEBot
@click.group()
def cli():
pass
@click.command("init-config")
@click.a... | 3.078125 | 3 |
accounts/models.py | sulembutproton/morphicsys | 0 | 34078 | <gh_stars>0
import random
from django.core.exceptions import ValidationError
from django.db import models
from django.conf import settings
class AuthToggle(models.Model):
enable_protection = models.BooleanField(default=False)
def __str__(self):
return "Options"
class PassPhrase(models.Model):
pass... | 2.109375 | 2 |
corehq/apps/translations/integrations/transifex/project_migrator.py | dimagilg/commcare-hq | 471 | 34079 | <filename>corehq/apps/translations/integrations/transifex/project_migrator.py<gh_stars>100-1000
import copy
import datetime
import tempfile
from collections import OrderedDict
from django.utils.functional import cached_property
from django.utils.translation import ugettext as _
import polib
from memoized import memoi... | 1.960938 | 2 |
project3-mlops/Includes/Common-Notebooks/Common-Test.py | LiuxyEric/dscc202-402-spring2022 | 0 | 34080 | # Databricks notebook source
# MAGIC
# MAGIC %md
# MAGIC # Integration Tests
# MAGIC The purpose of this notebook is to faciliate testing of our systems.
# COMMAND ----------
import os
spark.conf.set("com.databricks.training.module-name", "common-notebooks")
currentVersion = os.environ["DATABRICKS_RUNTIME_VERSION"... | 1.84375 | 2 |
py/test_runner.py | radanalyticsio/tensorflow-k8s | 4 | 34081 | <reponame>radanalyticsio/tensorflow-k8s
"""Test runner runs a TfJob test."""
import argparse
import logging
import os
import time
import uuid
import jinja2
from kubernetes import client as k8s_client
from py import test_util
from py import util
from py import tf_job_client
from google.cloud import storage # pylint: ... | 2.109375 | 2 |
deepspeech/io/collator.py | iclementine/DeepSpeech | 1 | 34082 | # Copyright (c) 2021 PaddlePaddle 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
#
# Unless required by appli... | 2.546875 | 3 |
launch/test.py | a-tharva/LaunchEnv | 1 | 34083 | #import subprocess
#
#subprocess.Popen(f'C:\Windows\system32\calc.exe')
#
#
#
#
#
#
#
#\ is a escape character. You have three options.
#
#1) use /. This, as a bonus works for linux as well:
# 'D:/xxx/xxxx/asd/asd.exe'
#
#2) escape the backslash
# 'D:\\xxx\\xxxx\\asd\\asd.exe'
#
#3) use raw strings:
#r'D:\xxx\xxxx\as... | 2.59375 | 3 |
struct2seq/__init__.py | amorehead/neurips19-graph-protein-design | 0 | 34084 | <reponame>amorehead/neurips19-graph-protein-design<gh_stars>0
__all__ = ['data', 'noam_opt', 'protein_features', 'self_attention', 'struct2seq', 'seq_model']
| 0.957031 | 1 |
p1bsl_formatter.py | WonderMr/Linter1 | 0 | 34085 | <gh_stars>0
# -*- coding: utf-8 -*-
import os
import sys
import re
from collections import namedtuple
import subprocess
from typing import NewType
class p1parser:
def __init__(self):
self.rule = namedtuple("Rule" , ["Text" , "SubExp"])
self.directive = name... | 2.640625 | 3 |
server/__init__.py | jbcurtin/datsu-panic | 0 | 34086 | import asyncio
import logging
import time
from functools import partial
from signal import SIGINT, SIGTERM
from panic import \
datatypes as panic_datatypes
logger = logging.getLogger(__name__)
current_time = None
def update_current_time(loop):
"""
Caches the current time, since it is needed
at the e... | 2.484375 | 2 |
analysis/scripts/gmm.py | sbooeshaghi/azucar | 0 | 34087 | <reponame>sbooeshaghi/azucar
# this file contains _base.py and _gaussian_mixture.py
# @title sklearn/mixture/_base.py
"""Base class for mixture models."""
# sklearn/mixture/_base.py
# Author: <NAME> <<EMAIL>>
# Modified by <NAME> <<EMAIL>>
# License: BSD 3 clause
import warnings
from abc import ABCMeta, abstractme... | 2.328125 | 2 |
main.py | scottyplunkett/crayket | 1 | 34088 | from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.widget import Widget
from kivy.uix.button import Button, Label
from kivy.properties import ListProperty, ObjectProperty
from game import Game
from player import Player
from helpers import new_targe... | 2.640625 | 3 |
src/modular/funcion1.py | GokoshiJr/algoritmos2-py | 0 | 34089 | # 16. Evalúe la siguiente función matemática: f(a,b,c,d,e) = ((a! + b! + c!) / d!) + e^c / e!
# Ejemplo: Si a = 5, b = 1, c= 4 , d = 3, e = 2 → despliega: 32,17
def factorial(numero):
fact = 1
for i in range (1, numero+1):
fact *= i
return (fact)
def formula(a, b, c, d, e):
termino1 ... | 3.796875 | 4 |
setup.py | Fragalli/brFinance | 1 | 34090 | <filename>setup.py
from setuptools import setup, find_packages
setup(
name='brfinance',
version='0.1',
packages=find_packages(exclude=['tests*']),
license='MIT',
description='A Python package for webscraping financial data brazilian sources such as CVM, Banco Central, B3, ANBIMA, etc.',
long_de... | 1.40625 | 1 |
model/DeepLabv3plus2.py | THU-CVlab/JMedSeg | 26 | 34091 | import jittor as jt
from jittor import nn
from jittor import Module
from jittor import init
from jittor.contrib import concat
from model.backbone import resnet50, resnet101
from model.backbone import res2net101
Backbone_List = ['resnet50', 'resnet101', 'res2net101']
class DeepLab(Module):
def __init__(self, outp... | 2.1875 | 2 |
snakeoil/migrations/0001_initial.py | wbcsmarteezgithub/django-snakeoil | 1 | 34092 | # Generated by Django 2.2 on 2020-03-30 15:03
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='SeoUrl',
fields=[
('head_title', models.CharF... | 1.882813 | 2 |
appswag/tests/test_codec.py | atchoum31/appswag | 0 | 34093 | <reponame>atchoum31/appswag
from __future__ import absolute_import
from appswag.primitives import MimeCodec
import unittest
class CodecTestCase(unittest.TestCase):
def test_register_unregister(self):
mime_codec = MimeCodec()
mime = 'test'
dummy_codec = {}
self.assertEqual... | 2.5 | 2 |
mediafeed/databases/files.py | media-feed/mediafeed | 0 | 34094 | import os
from shutil import rmtree
from ..settings import DATA_PATH
class Thumbnail(object):
def __init__(self, model):
self.model = model
self.module = model.module
self.filename = os.path.join('thumbnails', model.__tablename__, self.module.id, model.id)
self.full_filename = os.... | 2.46875 | 2 |
src/alipay/payment.py | davidrepos/py3alipay | 0 | 34095 | from hashlib import md5
from urllib.parse import urlencode
from .exceptions import AlipayExcepton,ParameterValueErrorException,MissingParameterException,TokenAuthorizationErrorException
class Alipay(object):
GATEWAY_URL = 'https://mapi.alipay.com/gateway.do'
NOTIFY_GATEWAY_URL = 'https://mapi.alipay.com/gatew... | 2.5625 | 3 |
src/robusta/core/triggers/error_event_trigger.py | Rutam21/robusta | 0 | 34096 | from ..discovery.top_service_resolver import TopServiceResolver
from ...core.playbooks.base_trigger import TriggerEvent
from ...integrations.kubernetes.autogenerated.triggers import EventAllChangesTrigger, EventChangeEvent
from ...integrations.kubernetes.base_triggers import K8sTriggerEvent
from ...utils.rate_limiter i... | 1.734375 | 2 |
photoman/rename.py | maciejgaleja/good-content | 0 | 34097 | <reponame>maciejgaleja/good-content<filename>photoman/rename.py
import logging
import exifread # type: ignore
from datetime import datetime
import pathlib
import os
import shutil
import filecmp
import subprocess
from typing import Tuple, List
exifread.logger.disabled = True
date_str_default = "1970:01:01 00:00:00"
... | 2.5625 | 3 |
scripts/yaml2rdf_module.py | opencultureagency/Training.Module.Template | 0 | 34098 | <filename>scripts/yaml2rdf_module.py
'''
Converts ASKotec training module meta-data
(from module.yaml) into an RDF/Turtle.
'''
import glob
import os
from rdflib.namespace import DC, DCTERMS, DOAP, FOAF, SKOS, OWL, RDF, RDFS, VOID, XMLNS, XSD
import wget
from yaml2rdf_shared import *
from yaml2rdf import convert
KEY_R... | 2.609375 | 3 |
bot/handlers/poll_handler.py | rednas174/Whatsapp_bot | 3 | 34099 | # -*- coding: utf-8 -*-
"""
Created on Fri Jan 15 11:43:21 2021
@author: Sander
"""
import random
# TODO: '/poll vote 88' has no output
# : invalid poll id gives no output
# Poll datastructure
#
# {
# "number or name of person":
# {
# "__id" : unique id for every poll
# "__name... | 3.109375 | 3 |