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
EMeRGE/dssmetrics/constants.py
NREL/EMeRGE
6
1500
<reponame>NREL/EMeRGE """ Default values : DO NOT CHANGE !!!""" LOG_FORMAT = "%(asctime)s: %(levelname)s: %(message)s" DATE_FORMAT = "%Y-%m-%d %H:%M:%S" MAXITERATIONS = 100 LIFE_PARAMETERS = {"theta_i":30,"theta_fl":36,"theta_gfl":28.6, "R":4.87,"n":1,"tau":3.5,"m":1,"A":-13.391, ...
1.289063
1
minesweeper/game.py
MathisFederico/Minesweeper
1
1501
try: import importlib.resources as pkg_resources except ImportError: # Try backported to PY<37 `importlib_resources`. import importlib_resources as pkg_resources from . import images from gym import Env, spaces from time import time import numpy as np from copy import copy import colorsys import pygame f...
2.34375
2
tests/python/gaia-ui-tests/gaiatest/tests/functional/lockscreen/test_lockscreen_unlock_to_camera_with_passcode.py
BReduardokramer/gaia
1
1502
<filename>tests/python/gaia-ui-tests/gaiatest/tests/functional/lockscreen/test_lockscreen_unlock_to_camera_with_passcode.py # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0...
2.34375
2
models/layers/mesh_conv.py
CallumMcMahon/MeshCNN
2
1503
<filename>models/layers/mesh_conv.py import torch import torch.nn as nn import torch.nn.functional as F class MeshConv(nn.Module): """ Computes convolution between edges and 4 incident (1-ring) edge neighbors in the forward pass takes: x: edge features (Batch x Features x Edges) mesh: list of mesh data...
2.75
3
code/0-input/create_hdf5/check_hdf5.py
AvinWangZH/3D-convolutional-speaker-recognition
1
1504
import tables import numpy as np import matplotlib.pyplot as plt # Reading the file. fileh = tables.open_file('development.hdf5', mode='r') # Dimentionality of the data structure. print(fileh.root.utterance_test.shape) print(fileh.root.utterance_train.shape) print(fileh.root.label_train.shape) print(fileh.root.label_...
2.546875
3
qtask/utils/testing.py
LinkTsang/qtask-legacy-python
0
1505
<reponame>LinkTsang/qtask-legacy-python import asyncio import traceback import unittest def async_test(f): def wrapper(test_case: unittest.TestCase, *args, **kwargs): loop = asyncio.get_event_loop() task = loop.create_task(f(test_case, *args, **kwargs)) try: loop.run_until_comp...
2.484375
2
landing/views.py
theflatladder/kyrsovaya
0
1506
<reponame>theflatladder/kyrsovaya from django.shortcuts import render, render_to_response, redirect from django.contrib import auth from django.contrib.auth.forms import UserCreationForm from django.template.context_processors import csrf from django.http import HttpResponseRedirect def login(request): args = {} ...
2.28125
2
FPRun11.py
yecfly/DEPRESSIONEST
0
1507
<gh_stars>0 from Facepatchindependenttrain import runPatch import sys if len(sys.argv)==6: runPatch(GPU_Device_ID=1, FacePatchID=int(sys.argv[1]), trainpklID=int(sys.argv[2]), testpklID=int(sys.argv[3]), NetworkType=int(sys.argv[4]), runs=int(sys...
2.125
2
vendor/packages/translate-toolkit/translate/convert/test_po2tmx.py
jgmize/kitsune
2
1508
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- from translate.convert import po2tmx from translate.convert import test_convert from translate.misc import wStringIO from translate.storage import tmx from translate.storage import lisa class TestPO2TMX: def po2tmx(self, posource, sourcelanguage='en', ...
2.34375
2
plugin.video.yatp/libs/client/commands.py
mesabib/kodi.yatp
54
1509
<filename>plugin.video.yatp/libs/client/commands.py<gh_stars>10-100 # coding: utf-8 # Module: commands # Created on: 28.07.2015 # Author: <NAME> aka <NAME>. (<EMAIL>) # Licence: GPL v.3: http://www.gnu.org/copyleft/gpl.html """ Context menu commands """ import sys import xbmc import xbmcgui import json_requests as jso...
2.296875
2
setup.py
GeorgeDittmar/MarkovTextGenerator
1
1510
#!/usr/bin/env python from distutils.core import setup setup(name='Mimik', version='1.0', description='Python framework for markov models', author='<NAME>', author_email='<EMAIL>', url='https://www.python.org/sigs/distutils-sig/', packages=['distutils', 'distutils.command'], ...
1.132813
1
pipeline/scripts/package.py
deplatformr/open-images
2
1511
import os import shutil import sqlite3 import tarfile from datetime import datetime import bagit def create_package(images, batch_dir): package_threshold = 838860800 # 800 Mib to the next power of 2 = 1GiB print("Package threshold: " + get_human_readable_file_size(package_threshold)) abs_path = os.getc...
2.828125
3
app/search/hot_eval/hl_reportable.py
don4apaev/anfisa
0
1512
def evalRec(env, rec): """hl_reportable""" return (len(set(rec.Genes) & { 'ABHD12', 'ACTG1', 'ADGRV1', 'AIFM1', 'ATP6V1B1', 'BCS1L', 'BSND', 'CABP2', 'CACNA1D', 'CDC14A', '...
1.570313
2
eval/util/metrics.py
fau-is/grm
5
1513
import sklearn import pandas import seaborn as sns import matplotlib.pyplot as pyplot from functools import reduce # import numpy as np def metrics_from_prediction_and_label(labels, predictions, verbose=False): measures = { "accuracy": sklearn.metrics.accuracy_score(labels, predictions), "balance...
2.671875
3
dpgs_sandbox/tests/test_bug_migrations_in_base_models.py
gabrielpiassetta/django-pgschemas
0
1514
import warnings from unittest.mock import patch from django.apps import apps from django.core import management from django.core.management.base import CommandError from django.db import models from django.db.utils import ProgrammingError from django.test import TransactionTestCase, tag from django_pgschemas.checks i...
2.078125
2
tfx/components/transform/component.py
pingsutw/tfx
0
1515
<filename>tfx/components/transform/component.py # Lint as: python2, python3 # Copyright 2019 Google LLC. 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://ww...
1.882813
2
objects/GitIndexEntry.py
anderslatif/alg
0
1516
# https://github.com/git/git/blob/master/Documentation/technical/index-format.txt class GitIndexEntry(object): # The last time a file's metadata changed. This is a tuple (seconds, nanoseconds) ctime = None # The last time a file's data changed. This is a tuple (seconds, nanoseconds) mtime = None #...
2.3125
2
matdgl/layers/partitionpaddinglayer.py
huzongxiang/CrystalNetwork
6
1517
# -*- coding: utf-8 -*- """ Created on Wed Oct 13 14:47:13 2021 @author: huzongxiang """ import tensorflow as tf from tensorflow.keras import layers class PartitionPadding(layers.Layer): def __init__(self, batch_size, **kwargs): super().__init__(**kwargs) self.batch_size = batch_size def ...
2.546875
3
lino_book/projects/min9/settings/memory.py
khchine5/book
1
1518
<gh_stars>1-10 from .demo import * SITE.verbose_name = SITE.verbose_name + " (:memory:)" # SITE = Site(globals(), title=Site.title+" (:memory:)") DATABASES['default']['NAME'] = ':memory:'
1.625
2
reservation/urls.py
aryamanak10/diner-restaurant-website
1
1519
from django.urls import path from . import views app_name = 'reservation' urlpatterns = [ path('', views.reserve_table, name = 'reserve_table'), ]
1.53125
2
chainer/_version.py
yumetov/chainer
3,705
1520
__version__ = '7.8.0' _optional_dependencies = [ { 'name': 'CuPy', 'packages': [ 'cupy-cuda120', 'cupy-cuda114', 'cupy-cuda113', 'cupy-cuda112', 'cupy-cuda111', 'cupy-cuda110', 'cupy-cuda102', 'cupy-cud...
1.085938
1
image_aug.py
qwerasdf887/image_augmentation
0
1521
<filename>image_aug.py # coding=UTF-8 # This Python file uses the following encoding: utf-8 import cv2 import numpy as np import xml.etree.cElementTree as ET from random import sample #default args: default_args = {'noise_prob': 0.1, 'gasuss_mean': 0, 'gasuss_var': 0.001, ...
2.625
3
03_picnic/picnic.py
intimanipuchi/tiny_python_projects
0
1522
#!/usr/bin/env python3 """ Author : <NAME> <<EMAIL>> Date : 2021-12-15 Purpose: Working with lists """ import argparse # -------------------------------------------------- def get_args(): """Get command-line arguments""" parser = argparse.ArgumentParser( description="Working with lists", f...
4.21875
4
triangle.py
montyshyama/python-basics
0
1523
<filename>triangle.py side_a=int(input("Enter the first side(a):")) side_b=int(input("Enter the second side(b):")) side_c=int(input("Enter the third side(c):")) if side_a==side_b and side_a==side_c: print("The triangle is an equilateral triangle.") elif side_a==side_b or side_a==side_c or side_b==side_c: ...
4.1875
4
david/modules/artist/view.py
ktmud/david
2
1524
<reponame>ktmud/david # -*- coding: utf-8 -*- from flask import Blueprint, request from david.lib.template import st from .model import Artist bp = Blueprint('artist', __name__) @bp.app_template_global('artists') def artists(): return Artist.query.all() @bp.route('/artist/<uid>/') def intro(uid): artist = Ar...
2.203125
2
Volume Estimation/volume.py
JessieRamaux/Food-Volume-Estimation
10
1525
import numpy as np import cv2 import os import json import glob from PIL import Image, ImageDraw plate_diameter = 25 #cm plate_depth = 1.5 #cm plate_thickness = 0.2 #cm def Max(x, y): if (x >= y): return x else: return y def polygons_to_mask(img_shape, polygons): mask = np.zeros(img_shape...
2.5
2
t2k/bin/cmttags.py
tianluyuan/pyutils
1
1526
#!/usr/bin/env python """ A script to create tags for CMT managed packages. Call from within cmt/ directory """ import subprocess import sys import os from optparse import OptionParser __author__ = '<NAME>' __email__ = 't<EMAIL>uan [at] colorado.edu' # Ignore large external packages for now IGNORES = ['CMT', 'EXTE...
2.359375
2
salt/daemons/masterapi.py
rickh563/salt
0
1527
# -*- coding: utf-8 -*- ''' This module contains all of the routines needed to set up a master server, this involves preparing the three listeners and the workers needed by the master. ''' from __future__ import absolute_import # Import python libs import fnmatch import logging import os import re import time import s...
1.984375
2
core/domain/role_services_test.py
Mohitbalwani26/oppia
0
1528
<gh_stars>0 # coding: utf-8 # # Copyright 2017 The Oppia 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.953125
2
deep_learning/keras/keras/backend/cntk_backend.py
xpennec/applications
21
1529
from __future__ import absolute_import from __future__ import division from __future__ import print_function import cntk as C import numpy as np from .common import floatx, epsilon, image_dim_ordering, image_data_format from collections import defaultdict from contextlib import contextmanager import warnings C.set_g...
2.28125
2
Project Files/Prebuilt tools/twitter/Twitter/pylib/oauthlib/oauth1/rfc5849/endpoints/resource.py
nVoid/Yale-TouchDesigner-April2016
39
1530
# -*- coding: utf-8 -*- """ oauthlib.oauth1.rfc5849.endpoints.resource ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of the resource protection provider logic of OAuth 1.0 RFC 5849. """ from __future__ import absolute_import, unicode_literals from oauthlib.common import log from .base i...
2.609375
3
python/ex_1.py
AymenSe/Geometric-operations-DIP
0
1531
<filename>python/ex_1.py #################################################### # # @ Authors : <NAME> # <NAME> # # @ Hint: you have to install all requirements # from requirements.txt # #################################################### import numpy as np import cv2 as cv import matp...
3.375
3
utils/hit_rate_utils.py
h-zcc/ref-nms
19
1532
<gh_stars>10-100 from utils.misc import calculate_iou, xywh_to_xyxy __all__ = ['NewHitRateEvaluator', 'CtxHitRateEvaluator'] class NewHitRateEvaluator: def __init__(self, refer, top_N=None, threshold=0.5): """Evaluate refexp-based hit rate. Args: refdb: `refdb` dict. sp...
2.296875
2
LeetCode_ReorderDataLogFiles.py
amukher3/Problem_solutions
1
1533
# -*- coding: utf-8 -*- """ Created on Sat Aug 22 19:07:30 2020 @author: <NAME> """ class Solution: def reorderLogFiles(self, logs: List[str]) -> List[str]: letLog=[] digLog=[] for i in range(len(logs)): temp=[] temp=logs[i].split(' ...
3.265625
3
saleor/core/transactions.py
fairhopeweb/saleor
15,337
1534
from contextlib import contextmanager from django.db import DatabaseError from ..core.tracing import traced_atomic_transaction @contextmanager def transaction_with_commit_on_errors(): """Perform transaction and raise an error in any occurred.""" error = None with traced_atomic_transaction(): try...
2.359375
2
src/command_modules/azure-cli-policyinsights/azure/cli/command_modules/policyinsights/tests/latest/test_policyinsights_scenario.py
diberry/azure-cli
1
1535
<reponame>diberry/azure-cli # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # ----------------------------------------...
1.804688
2
tests/prep_post/test.py
Aslic/rmats_turbo_4.1.0
0
1536
<reponame>Aslic/rmats_turbo_4.1.0 import glob import os.path import subprocess import sys import unittest import tests.bam import tests.base_test import tests.gtf import tests.output_parser as output_parser import tests.test_config import tests.util class Test(tests.base_test.BaseTest): def setUp(self): ...
2.046875
2
nltk/align/util.py
kruskod/nltk
1
1537
# Natural Language Toolkit: Aligner Utilities # # Copyright (C) 2001-2015 NLTK Project # Author: <NAME> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT from nltk.align.api import Alignment def pharaohtext2tuples(pharaoh_text): """ Converts pharaoh text format into an Alignment object ...
3.8125
4
grr/server/grr_response_server/databases/db_yara_test_lib.py
khanhgithead/grr
4,238
1538
<gh_stars>1000+ #!/usr/bin/env python # -*- encoding: utf-8 -*- """A module with test cases for the YARA database method.""" import os from grr_response_server.databases import db from grr_response_server.rdfvalues import objects as rdf_objects class DatabaseTestYaraMixin(object): """A mixin class for testing YAR...
2.328125
2
gpytorch/kernels/inducing_point_kernel.py
4aHxKzD/gpytorch
1
1539
#!/usr/bin/env python3 import copy import math import torch from ..distributions import MultivariateNormal from ..lazy import DiagLazyTensor, LowRankRootAddedDiagLazyTensor, LowRankRootLazyTensor, MatmulLazyTensor, delazify from ..mlls import InducingPointKernelAddedLossTerm from ..models import exact_prediction_str...
2.03125
2
app/__init__.py
Jotasenpai/DigitalMediaStoreRESTfull
0
1540
import logging import os from flask import Flask from flask_cors import CORS from app.extensions import api from app.extensions.database import db from app.extensions.schema import ma from app.views import albums, artists, hello, tracks def create_app(config, **kwargs): logging.basicConfig(level=logging.INFO) ...
1.890625
2
app.py
SASHA-PAIS/A-Flask-web-app-for-inventory-management
0
1541
<gh_stars>0 from flask import Flask, url_for, request, redirect from flask import render_template as render from flask_mysqldb import MySQL import yaml import json import MySQLdb import decimal class Encoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, decimal.Decimal): retu...
2.65625
3
python/paddle/fluid/tests/unittests/ir/inference/test_trt_reduce_mean_op.py
zmxdream/Paddle
8
1542
<gh_stars>1-10 # 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 re...
1.875
2
configs/vinbig/detectors_resnext.py
SeHwanJoo/mmdetection_vinbig
2
1543
_base_ = [ '../_base_/models/cascade_rcnn_r50_fpn.py', './dataset_base.py', './scheduler_base.py', '../_base_/default_runtime.py' ] model = dict( pretrained='open-mmlab://resnext101_32x4d', backbone=dict( type='DetectoRS_ResNeXt', pretrained='open-mmlab://resnext101_32x4d', ...
1.382813
1
skbio/draw/tests/test_distributions.py
johnchase/scikit-bio
0
1544
<gh_stars>0 # ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------------------...
2.25
2
packages/gtmapi/lmsrvcore/api/interfaces/__init__.py
jjwatts/gigantum-client
60
1545
<gh_stars>10-100 from lmsrvcore.api.interfaces.user import User from lmsrvcore.api.interfaces.git import GitCommit, GitRef, GitRepository
1.125
1
tensorflow_probability/python/bijectors/invert_test.py
matthieucoquet/probability
0
1546
# Copyright 2018 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
1.8125
2
dayu_widgets/alert.py
ZSD-tim/dayu_widgets
0
1547
#!/usr/bin/env python # -*- coding: utf-8 -*- ################################################################### # Author: <NAME> # Date : 2019.2 # Email : <EMAIL> ################################################################### """ MAlert class. """ import six import functools from dayu_widgets.avatar import MAv...
1.960938
2
week03/code05.py
byeongal/KMUCP
0
1548
<gh_stars>0 input_str = input("문자열을 입력해 주세요. >> ") print("입력받은 문자열의 길이는", len(input_str), "입니다.")
2.65625
3
jobs/SCH/JB_SALES_HIERARCHY_FLAG_N_SR.py
bibinvasudev/EBI_Project
0
1549
<reponame>bibinvasudev/EBI_Project # SCH1101.sh --> JB_SALES_HIERARCHY_FLAG_N_SR.py #************************************************************************************************************** # # Created by : bibin # Version : 1.0 # # Description : # 1. This script will load the data into 'S...
1.882813
2
myth/util.py
amanbhandari2002/mythproto
1
1550
def decodeLongLong(lst): high = int(lst[0]) << 32 low = int(lst[1]) if low < 0: low += 4294967296 if high < 0: high += 4294967296 return high + low def encodeLongLong(i): high = int(i / 4294967296) low = i - high return high, low def parseOk(str): if str == 'ok': return True else: return False def ...
3.1875
3
scripts/tator_tracker.py
openem-team/openem
10
1551
<reponame>openem-team/openem #!/usr/bin/env python3 import argparse import openem import os import cv2 import numpy as np from openem.tracking import * import json import sys import datetime import tator from pprint import pprint from collections import defaultdict import yaml import math import subprocess import sy...
2.15625
2
hypergan/losses/multi_loss.py
Darkar25/HyperGAN
1
1552
import tensorflow as tf import numpy as np import hyperchamber as hc from hypergan.losses.base_loss import BaseLoss from hypergan.multi_component import MultiComponent TINY=1e-8 class MultiLoss(BaseLoss): """Takes multiple distributions and does an additional approximator""" def _create(self, d_real, d_fake):...
2.09375
2
src/fidesops/api/v1/endpoints/policy_endpoints.py
mohan-pogala/fidesops
0
1553
import logging from typing import Any, Dict, List from fastapi import APIRouter, Body, Depends, Security from fastapi_pagination import ( Page, Params, ) from fastapi_pagination.bases import AbstractPage from fastapi_pagination.ext.sqlalchemy import paginate from fidesops.schemas.shared_schemas import FidesOp...
1.828125
2
engage-analytics/sentiment_analysis/src/report/interface_report.py
oliveriopt/mood-analytics
0
1554
<gh_stars>0 import emoji import sentiment_analysis.src.report.cons_report as cons import sentiment_analysis.src.constants as global_cons from utils.data_connection.api_data_manager import APISourcesFetcher from utils.utilities import read_json_file, CUSTOM_YEAR_WEEK_AGG, extract_dimension, extract_question from sentim...
2.1875
2
dwh_analytic/dags/data_warehouse_prod/schema/dim_process.py
dnguyenngoc/analytic
0
1555
resource ='human ad machime' class DimProcess: def __init__( self, *kwargs, process_key: int, module: str, type: str, step: str, sub_step: str, resource: str = 'human', ): def step(self): return ['qc', 'auto_qc', 'apr_qc', 'ke...
2.25
2
lino/modlib/gfks/mixins.py
NewRGB/lino
1
1556
# -*- coding: UTF-8 -*- # Copyright 2010-2018 Rumma & Ko Ltd # License: BSD (see file COPYING for details) from builtins import object from django.contrib.contenttypes.models import * from django.conf import settings from django.utils.translation import ugettext_lazy as _ from django.utils.text import format_lazy ...
2.078125
2
optical_form_reader/main.py
1enes/optical_form_reader
0
1557
<filename>optical_form_reader/main.py<gh_stars>0 import cv2 import numpy as np from imutils import contours from imutils.perspective import four_point_transform import imutils import cv2 import matplotlib.pyplot as plt import numpy as np from imutils import contours from imutils.perspective import four_point_t...
2.203125
2
service.py
Tigge/script.filmtipset-grade
1
1558
# Copyright (c) 2013, <NAME> # 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 the foll...
1.640625
2
test/testMatrix.py
turkeydonkey/nzmath3
1
1559
<reponame>turkeydonkey/nzmath3 import unittest from nzmath.matrix import * import nzmath.vector as vector import nzmath.rational as rational import nzmath.poly.uniutil as uniutil Ra = rational.Rational Poly = uniutil.polynomial Int = rational.theIntegerRing # sub test try: from test.testMatrixFiniteField import ...
2.40625
2
python/test-nose-3.py
li-ma/homework
0
1560
<gh_stars>0 # Module Level def setUp(): print 'test setup' def tearDown(): print 'test teardown' # Function Level def func_1_setup(): print 'test_func_1 setup' def func_1_teardown(): print 'test_func_1_teardown' # Target Func def test_func_1(): print 'test_func_1 run' assert True test_func...
2.0625
2
lib/reindex/reporting.py
scality/utapi
13
1561
import requests import redis import json import ast import sys import time import urllib import re import sys from threading import Thread from concurrent.futures import ThreadPoolExecutor import argparse def get_options(): parser = argparse.ArgumentParser() parser.add_argument("-i", "--sentinel-ip", default=...
2.625
3
src/skim/modeling/skim_attention/modeling_skim.py
recitalAI/skim-attention
4
1562
<reponame>recitalAI/skim-attention<gh_stars>1-10 from collections import namedtuple import logging from dataclasses import dataclass from typing import Optional, Tuple import math import torch from torch import nn from torch.nn import CrossEntropyLoss, LayerNorm from torch.autograd.function import Function from tran...
2.140625
2
api/routers/dashboard.py
xming521/coco_API
0
1563
import time import psutil import pymysql from fastapi import APIRouter from api.utils import response_code router = APIRouter() @router.get('/dashboard/getinfo') def getinfo(): from init_global import g res = {} db = g.db_pool.connection() cur = db.cursor() cur.execute(f'select count(app_name) ...
2.234375
2
retargeting/models/Kinematics.py
yujiatay/deep-motion-editing
1
1564
import torch import torch.nn as nn import numpy as np import math class ForwardKinematics: def __init__(self, args, edges): self.topology = [-1] * (len(edges) + 1) self.rotation_map = [] for i, edge in enumerate(edges): self.topology[edge[1]] = edge[0] self.rotation...
2.375
2
tests/operators/test_hive_operator.py
Ryan-Miao/airflow
0
1565
<reponame>Ryan-Miao/airflow<gh_stars>0 # -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under...
1.992188
2
main.py
OrionDark7/Alakajam12
0
1566
import pygame, math from game import map, ui window = pygame.display.set_mode([800, 600]) ui.window = window screen = "game" s = {"fullscreen": False} running = True gamedata = {"level": 0, "coal": 0, "iron": 1, "copper":0} tiles = pygame.sprite.Group() rails = pygame.sprite.Group() carts = pygame.sprite.Group() inter...
2.875
3
Code/extract_method3.py
AbdullahNoori/CS-2.1-Trees-Sorting
0
1567
<gh_stars>0 # Written by <NAME> # Example for Compose Methods: Extract Method. import math def get_distance(xc1=5, xc2=7.25, yc1=22, yc2=-4.84): # Calculate the distance between the two circle return math.sqrt((xc1-xc2)**2 + (yc1 - yc2)**2) print('distance', get_distance()) # *** somewhere else in your pr...
3.375
3
sympy/integrals/prde.py
Abhi58/sympy
2
1568
""" Algorithms for solving Parametric Risch Differential Equations. The methods used for solving Parametric Risch Differential Equations parallel those for solving Risch Differential Equations. See the outline in the docstring of rde.py for more information. The Parametric Risch Differential Equation problem is, giv...
3.03125
3
ssh_telnet/netmiko/ex07_netmiko_command_mult_prompts.py
levs72/pyneng-examples
11
1569
from pprint import pprint import yaml import netmiko import paramiko def send_cmd_with_prompt(device, command, *, wait_for, confirmation): if type(wait_for) == str: wait_for = [wait_for] if type(confirmation) == str: confirmation = [confirmation] with netmiko.Netmiko(**device) as ssh: ...
2.84375
3
mppi/Utilities/AttributeDict.py
marcodalessandro76/MPPI
1
1570
<filename>mppi/Utilities/AttributeDict.py<gh_stars>1-10 class AttributeDict(object): """ A class to convert a nested Dictionary into an object with key-values accessibly using attribute notation (AttributeDict.attribute) instead of key notation (Dict["key"]). This class recursively sets Dicts to objects...
3.5
4
LightTestLoop.py
Growing-Beyond-Earth/GettingStarted
0
1571
# GROWNG BEYOND EARTH CONTROL BOX Traning # RASPBERRY PI PICO / MICROPYTHON # FAIRCHILD TROPICAL BOTANIC GARDEN, Oct 18, 2021 # The Growing Beyond Earth (GBE) control box is a device that controls # the LED lights and fan in a GBE growth chamber. It can also control # accessories including a 12v water pump and enviro...
3.453125
3
core/known_bugs_utils.py
nicolasbock/hotsos
0
1572
<gh_stars>0 import os import yaml from core import plugintools from core import constants from core.searchtools import SearchDef from core.issues.issue_utils import IssueEntry LAUNCHPAD = "launchpad" MASTER_YAML_KNOWN_BUGS_KEY = "bugs-detected" KNOWN_BUGS = {MASTER_YAML_KNOWN_BUGS_KEY: []} class BugSearchDef(Search...
2.28125
2
examples/xml-rpc/echoserver.py
keobox/yap101
0
1573
import SimpleXMLRPCServer as xmls def echo(msg): print 'Got', msg return msg class echoserver(xmls.SimpleXMLRPCServer): allow_reuse_address = True server = echoserver(('127.0.0.1', 8001)) server.register_function(echo, 'echo') print 'Listening on port 8001' try: server.serve_forever() except: ser...
2.953125
3
tf_pose/slim/nets/mobilenet/mobilenet_v2_test.py
gpspelle/pose-estimation
862
1574
# Copyright 2018 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 # # Unless required by applica...
2.0625
2
firebase-gist.py
darwin/firebase-gist
1
1575
from firebase import firebase import os import datetime import json import logging from boto.s3.connection import S3Connection from boto.s3.key import Key from github3 import login firebase_url = os.environ['FIREBASE_DB'] firebase_secret = os.environ['FIREBASE_SECRET'] firebase_path = os.environ['FIREBASE_PATH'] fireb...
2.421875
2
practice/2008/qualification/C-Fly_swatter/c.py
victorWeiFreelancer/CodeJam
0
1576
import sys sys.dont_write_bytecode = True def hitP(f, R, t, r, g): if f>=g/2 : return 0.0 missArea = 0.0 gridL = g+2*r nGrids = (R - t) // gridL missGridSideLength = g - 2*f print("gridL %.12f; nGrids %d" %(gridL, nGrids) ) indentSquareLength = nGrids*gridL remain = (R - t) - in...
2.9375
3
synapse/notifier.py
rkfg/synapse
1
1577
<gh_stars>1-10 # -*- coding: utf-8 -*- # Copyright 2014 - 2016 OpenMarket Ltd # # 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 req...
1.640625
2
saleor/checkout/tests/test_base_calculations.py
nestfiy/saleor
0
1578
<reponame>nestfiy/saleor<gh_stars>0 from decimal import Decimal from prices import Money, TaxedMoney from ...discount import DiscountValueType, VoucherType from ...discount.utils import get_product_discount_on_sale from ..base_calculations import ( base_checkout_total, base_tax_rate, calculate_base_line_t...
2.1875
2
tests/test_date.py
andy-z/ged4py
10
1579
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for `ged4py.date` module.""" import unittest from ged4py.calendar import ( CalendarType, CalendarDate, FrenchDate, GregorianDate, HebrewDate, JulianDate, CalendarDateVisitor ) from ged4py.date import ( DateValue, DateValueAbout, DateValueAfter, DateV...
3
3
src/quart/local.py
Dunkledore/quart
3
1580
<reponame>Dunkledore/quart<gh_stars>1-10 from __future__ import annotations import asyncio import copy from contextvars import ContextVar # noqa # contextvars not understood as stdlib from typing import Any # noqa # contextvars not understood as stdlib from typing import Callable, Dict, Optional class TaskLocal: ...
2.375
2
pytorch3dunet/unet3d/predictor.py
searobbersduck/pytorch-3dunet
0
1581
import time import h5py import hdbscan import numpy as np import torch from sklearn.cluster import MeanShift from pytorch3dunet.datasets.hdf5 import SliceBuilder from pytorch3dunet.unet3d.utils import get_logger from pytorch3dunet.unet3d.utils import unpad logger = get_logger('UNet3DPredictor') class _AbstractPred...
2.3125
2
var/spack/repos/builtin/packages/visionary-dev-tools/package.py
electronicvisions/spack
2
1582
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os.path as osp class VisionaryDevTools(Package): """Developer convenience packages common to all visionary ...
1.492188
1
extra/convertBAMtoPILFER.py
MartaLoBalastegui/XICRA
3
1583
#usr/bin/env python ## useful imports import time import io import os import re import sys from sys import argv import subprocess ## ARGV if len (sys.argv) < 5: print ("\nUsage:") print ("python3 %s bam_file folder bedtools_bin samtools_bin logfile\n" %os.path.realpath(__file__)) exit() bam_file = os.path.abspath...
2.40625
2
day7/main5list.py
nikhilsamninan/python-files
0
1584
a="<NAME>ought a butter the butter was bitter so betty bought a better butter which was not bitter" v=[a[-1] for a in a.split() if(len(a)%2==0)] print(v)
3.515625
4
app/reader.py
lcarnevale/proxy-mqtt2influx
0
1585
<reponame>lcarnevale/proxy-mqtt2influx<filename>app/reader.py<gh_stars>0 # -*- coding: utf-8 -*- #!/usr/bin/env python """Writer class based on InfluxDB This implementation does its best to follow the Robert Martin's Clean code guidelines. The comments follows the Google Python Style Guide: https://github.com/goo...
2.46875
2
example_problems/tutorial/tiling_mxn-boards_with_1x2-boards/services/tell_if_tilable/tell_if_tilable_server.py
DottaPaperella/TALight
0
1586
#!/usr/bin/env python3 from sys import stderr, exit, argv from random import randrange #from TALinputs import TALinput from multilanguage import Env, Lang, TALcolors # METADATA OF THIS TAL_SERVICE: problem="tiling_mxn-boards_with_1x2-boards" service="is_tilable" args_list = [ ('m',int), ('n',int), ('my_co...
2.875
3
tests/unit/peapods/runtimes/remote/ssh/test_ssh_remote.py
yk/jina
1
1587
import pytest from jina.enums import RemoteAccessType from jina.flow import Flow from jina.parser import set_pea_parser, set_pod_parser from jina.peapods.pods import BasePod from jina.peapods.runtimes.remote.ssh import SSHRuntime from jina.proto import jina_pb2 @pytest.mark.skip('works locally, but until I findout h...
2.015625
2
waio/factory/models/basic.py
dotX12/waio
24
1588
from dataclasses import dataclass @dataclass class PayloadSender: phone: int name: str @dataclass class PayloadBaseModel: sender: PayloadSender payload_id: str
2.1875
2
Uber/validExpression.py
Nithanaroy/random_scripts
0
1589
def main(expr): openingParams = '({[' closingParams = ')}]' stack = [] for c in expr: if c in openingParams: stack.append(c) elif c in closingParams: topOfStack = stack.pop() openingIndex = openingParams.find(topOfStack) closingIndex = clos...
3.46875
3
sgains/tool.py
KrasnitzLab/sgains
1
1590
import os import sys from copy import deepcopy import traceback import functools from collections import defaultdict import yaml from argparse import ArgumentParser,\ RawDescriptionHelpFormatter, ArgumentDefaultsHelpFormatter from sgains.configuration.parser import SgainsValidator, Config from sgains.configurat...
1.953125
2
lib/modeling/VGG16.py
rsumner31/Detectron
429
1591
# Copyright (c) 2017-present, Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
1.695313
2
setup.py
yangjing1127/xmind2testcase
537
1592
#!/usr/env/bin python # -*- coding: utf-8 -*- import io import os import sys from shutil import rmtree from setuptools import setup, find_packages, Command about = {} here = os.path.abspath(os.path.dirname(__file__)) with io.open(os.path.join(here, 'xmind2testcase', '__about__.py'), encoding='utf-8') as f: # custom ...
2.03125
2
skultrafast/styles.py
Tillsten/skultrafast
10
1593
<reponame>Tillsten/skultrafast # -*- coding: utf-8 -*- """ Created on Thu Sep 17 21:33:24 2015 @author: Tillsten """ import matplotlib import matplotlib.pyplot as plt import numpy as np tableau20 = [(31, 119, 180), (174, 199, 232), (255, 127, 14), (255, 187, 120), (44, 160, 44), (152, 223, 138...
1.882813
2
src/oci/devops/models/github_build_run_source.py
ezequielramos/oci-python-sdk
3
1594
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
2.03125
2
aiida_fleur/tests/tools/test_common_fleur_wf.py
anoopkcn/aiida-fleur
0
1595
<filename>aiida_fleur/tests/tools/test_common_fleur_wf.py<gh_stars>0 from __future__ import absolute_import import pytest import os # is_code def test_is_code_interface(fixture_code): from aiida_fleur.tools.common_fleur_wf import is_code assert is_code('random_string') is None assert is_code('fleur.inpGU...
2.140625
2
src/probnum/random_variables/_random_variable.py
admdev8/probnum
0
1596
""" Random Variables. This module implements random variables. Random variables are the main in- and outputs of probabilistic numerical methods. """ from typing import Any, Callable, Dict, Generic, Optional, Tuple, TypeVar, Union import numpy as np from probnum import utils as _utils from probnum.type import ( ...
3.5
4
platform/gcutil/lib/google_compute_engine/gcutil_lib/address_cmds_test.py
IsaacHuang/google-cloud-sdk
0
1597
# Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
2.15625
2
vote/migrations/0005_auto_20210204_1900.py
jnegrete2005/JuradoFMS
2
1598
<filename>vote/migrations/0005_auto_20210204_1900.py<gh_stars>1-10 # Generated by Django 3.1.5 on 2021-02-05 00:00 import django.contrib.postgres.fields from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('vote', '0004_auto_20210131_1621'), ] operat...
1.367188
1
tools/wasm-sourcemap.py
ngzhian/emscripten
1
1599
#!/usr/bin/env python # Copyright 2018 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. """Utility tools that extracts DWARF informatio...
2.3125
2