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
navitia_client/departures.py
leonardbinet/navitia-python
9
12770651
""" Departures http://doc.navitia.io/#departures Also known as /departures service. This endpoint retrieves a list of departures from a specific datetime of a selected object. Departures are ordered chronologically in ascending order as: url Result /coverage/{region_i...
3.015625
3
molecule/debian/tests/test_default.py
hspaans/ansible-role-certificates
2
12770652
<reponame>hspaans/ansible-role-certificates """Role testing files using testinfra.""" import pytest @pytest.mark.parametrize("pkg", ["openssl"]) def test_pkg_installed(host, pkg): """Test if package installed.""" package = host.package(pkg) assert package.is_installed @pytest.mark.parametrize("directo...
2.484375
2
tools/project_gen/proj/handlego.py
qsock/qim
0
12770653
<filename>tools/project_gen/proj/handlego.py content = '''package main import ( "context" "github.com/qsock/qim/lib/proto/ret" ) type Server struct{} func (*Server) Ping(ctx context.Context, req *ret.NoArgs) (*ret.NoArgs, error) { return new(ret.NoArgs), nil }''' def gen(name, srv_dir) : with open(srv_dir+"...
1.914063
2
tests/components/vera/test_init.py
tbarbette/core
4
12770654
"""Vera tests.""" from unittest.mock import MagicMock import pytest import pyvera as pv from requests.exceptions import RequestException from homeassistant.components.vera import ( CONF_CONTROLLER, CONF_EXCLUDE, CONF_LIGHTS, DOMAIN, ) from homeassistant.config_entries import ENTRY_STATE_NOT_LOADED fro...
2.0625
2
repo_utils/coverage_maker.py
ACEnglish/truvari
16
12770655
<filename>repo_utils/coverage_maker.py """ Utility to run pylint and update the badge """ import re import sys import json from io import StringIO import anybadge # Get the score data = json.load(open(sys.argv[1], 'r')) coverage_pct = round(data['totals']['percent_covered']) # Define thresholds: <2=red, <4=orange <8=...
2.5
2
test/helpers/music/test_queue.py
alejandrodlsp/grogu-bot
1
12770656
import unittest from frozendict import frozendict from src.helpers.music.queue import Queue, QueueIsEmptyError, RemoveOutOfIndexError class QueueTest(unittest.TestCase): queue1 = [ frozendict({ 'name' : 'song1' }), frozendict({ 'name' : 'song2' }), frozendict({ 'name' : 'song3' }) ] ...
2.890625
3
django/stock/repository_pattern.py
nah990/StockF
0
12770657
<reponame>nah990/StockF<filename>django/stock/repository_pattern.py from .models import StockByDate, StockInfo, SourceInfo from abc import ABCMeta, abstractmethod from .db_manager import DBConfigManager class abstractclassmethod(classmethod): __slots__ = () def __init__(self, function): super(abstract...
2.296875
2
src/lab/dynamic_sql.py
john-james-sf/predict-fda
0
12770658
<gh_stars>0 #!/usr/bin/env python3 # -*- coding:utf-8 -*- # =========================================================================== # # Project : Drug Approval Analytics # # Version : 0.1.0 # # File : \src\lab\...
1.421875
1
Problemset/cong-shang-dao-xia-da-yin-er-cha-shu-iii-lcof/cong-shang-dao-xia-da-yin-er-cha-shu-iii-lcof.py
worldwonderer/algorithm
1
12770659
<gh_stars>1-10 # @Title: 从上到下打印二叉树 III (从上到下打印二叉树 III LCOF) # @Author: 18015528893 # @Date: 2021-01-20 21:44:16 # @Runtime: 44 ms # @Memory: 15.3 MB # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None from co...
3.34375
3
build_data_scripts/load_report_histograms.py
thisismattmiller/swib-2020-resources
1
12770660
<gh_stars>1-10 import glob from pathlib import Path import xml.etree.ElementTree as ET from datetime import datetime import csv reports_dir = f"{str(Path.home())}/data/swib_data/load_reports/" viz_data_dir = f"{str(Path.home())}/data/swib_data/viz_data_source/" all_reports = {} for file in glob.glob(f"{reports_dir}*...
2.265625
2
pylabnet/launchers/servers/dio_breakout.py
wi11dey/pylabnet
10
12770661
from pyvisa import ResourceManager, VisaIOError from pylabnet.hardware.awg.dio_breakout import Driver from pylabnet.utils.helper_methods import get_ip, load_device_config from pylabnet.network.client_server.dio_breakout import Service, Client from pylabnet.network.core.generic_server import GenericServer def launch(*...
2.140625
2
elephunk/records/activity.py
pitluga/elephunk
0
12770662
from elephunk.database import Row class Activity(Row): @property def formatted_xact_start(self): if self.xact_start == None: return "" return self.xact_start.isoformat()
2.15625
2
tests/breezometer/pollen/models/test_pollen_index_forecast.py
clintecker/supercell
0
12770663
# Standard Library import datetime # Third Party Code from dateutil.tz import tzutc # Supercell Code from supercell.breezometer.pollen.models.pollen_index import PollenIndex from supercell.breezometer.pollen.models.pollen_index_forecast import ( PollenIndexForecast, ) from supercell.breezometer.pollen.models.poll...
2.015625
2
cloudeebus/cloudeebus.py
intel/cloudeebus
5
12770664
#!/usr/bin/env python # Cloudeebus # # Copyright 2012 Intel Corporation. # # 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...
1.734375
2
core/urls.py
damiso15/location_api
0
12770665
from django.conf import settings from django.conf.urls.static import static from django.contrib import admin from django.urls import path, include from rest_framework.documentation import include_docs_urls from drf_yasg.views import get_schema_view from drf_yasg import openapi from rest_framework import permissi...
1.867188
2
src/camera_controller.py
OscarGTH/communal-plant
1
12770666
from pathlib import Path from datetime import datetime import time from subprocess import call import os from logzero import logger import picamera # Video file path VIDEO_PATH = str(Path().resolve()) + "/videos/" IMAGE_PATH = str(Path().resolve()) + "/images/" class CameraController: def __init__(self) -> Non...
2.96875
3
plugins/opsgenie/unit_test/test_create_alert.py
lukaszlaszuk/insightconnect-plugins
0
12770667
<reponame>lukaszlaszuk/insightconnect-plugins import os import sys from parameterized import parameterized sys.path.append(os.path.abspath("../")) import logging from unittest import TestCase from icon_opsgenie.actions.create_alert import CreateAlert from icon_opsgenie.actions.create_alert.schema import Output from ...
2.109375
2
snpdb/models_admin_forms.py
SACGF/variantgrid
5
12770668
<reponame>SACGF/variantgrid import re from django.contrib import admin from unidecode import unidecode from snpdb.admin_utils import ModelAdminBasics from snpdb.models import Organization, Lab def make_code_friendly(text: str) -> str: """ convert accented characters to non-accented counterparts lower ca...
1.96875
2
helpingnetwork/organization/forms.py
neopentane/Techathon_19
0
12770669
from django import forms from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm from .models import Organization,OrganizationImages from evelist.models import Event,EventImages class OrganizationRegisterForm(UserCreationForm): name=forms.CharField(required=True, label="Org...
2.171875
2
tests/unit/test_readHelper.py
woshiange/python-lambda
1,441
12770670
<filename>tests/unit/test_readHelper.py import os import unittest import yaml from aws_lambda.helpers import read class TestReadHelper(unittest.TestCase): TEST_FILE = "readTmp.txt" def setUp(self): with open(TestReadHelper.TEST_FILE, "w") as tmp_file: tmp_file.write("testYaml: testing"...
2.78125
3
cards.py
ashbc/pybreak
0
12770671
<gh_stars>0 from enum import Enum # TODO: turn to dict bleh RunnerFactions = Enum('RunnerFactions', 'Neutral Shaper Anarch Criminal SunnyLebeau Adam Apex') CorpFactions = Enum('CorpFactions', 'Neutral Jinteki HaasBioroid NBN Weyland CorpMiniFactionsWhenFFGPls') # The Breaker and Ice classes represent "Generic" base b...
2.78125
3
PythonExercicios/ex042.py
Lucas-ns/Python-3-Curso-Em-Video
0
12770672
a = float(input('Primeiro Segmento: ')) b = float(input('Segundo Segmento: ')) c = float(input('Terceiro Segmento: ')) if (a + b) > c and (a + c) > b and (b + c) > a: print('Os segmentos acima PODEM FORMAR um triângulo', end=' ') if a == b == c: print('EQUILÁTERO!') elif a == b or a == c or c == b: ...
4.0625
4
setup.py
treeverse/boto-s3-router
14
12770673
""" Boto S3 Router install script """ from setuptools import setup, find_packages from pathlib import Path import os NAME = "boto-s3-router" this_directory = Path(__file__).parent LONG_DESCRIPTION = (this_directory / "README.md").read_text() # To install the library, run the following # # python setup.py install ...
2.25
2
Array/Gas_Station.py
shua2018ti/Google
87
12770674
<reponame>shua2018ti/Google<gh_stars>10-100 ''' There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to its next station (i+1). You begin the journey with an empty tank at one of t...
3.515625
4
python/destinations/slack-notifications/main.py
SteveQuixDemo/quix-library
7
12770675
<reponame>SteveQuixDemo/quix-library from quixstreaming import QuixStreamingClient, StreamReader from quixstreaming.app import App from quix_function import QuixFunction import os # Quix injects credentials automatically to the client. Alternatively, you can always pass an SDK token manually as an argument. client = ...
2.53125
3
aliceplex/schema/schema/base.py
aliceplex/schema
0
12770676
<reponame>aliceplex/schema<filename>aliceplex/schema/schema/base.py from dataclasses import Field, asdict, fields, is_dataclass from typing import Any, Dict, List, Optional from marshmallow import Schema, post_load, pre_dump, pre_load __all__ = ["DataClassSchema"] class DataClassSchema(Schema): @pre_dump d...
2.25
2
lab3-Crawler2/code/crawler_sample_thread.py
MadCreeper/SJTU_ICE2602
0
12770677
# SJTU EE208 import threading import queue import time def get_page(page): print('downloading page %s' % page) time.sleep(0.5) return g.get(page, []) def get_all_links(content): return content def working(): while True: print("getting","left:",q.qsize()) page = q.get() ...
2.796875
3
tests/unit/cfngin/hooks/awslambda/models/test_responses.py
ITProKyle/runway-hook-awslambda
1
12770678
"""Test runway.cfngin.hooks.awslambda.models.responses.""" # pylint: disable=no-self-use,protected-access from __future__ import annotations import pytest from pydantic import ValidationError from awslambda.models.responses import AwsLambdaHookDeployResponse class TestAwsLambdaHookDeployResponse: """Test AwsLam...
2.421875
2
sana_pchr/reporting/run_reporting.py
SanaMobile/sana.pchr.oss-web
0
12770679
from sana_pchr.reporting.recommender import * from datetime import timedelta, date from dateutil import rrule import csv calcs = [DIABETES_CALCULATOR, HYPERTENSION_CALCULATOR, DYSLIPIDEMIA_CALCULATOR] clinics = [clinic for clinic in Clinic.objects.all() if "Test" not in clinic.name ] start_date = date(2016,2,14) end_...
2.4375
2
boboleetcode/Play-Leetcode-master/0101-Symmetric-Tree/py-0101/Solution1.py
mcuallen/CodeLrn2019
2
12770680
# Source : https://leetcode.com/problems/symmetric-tree/ # Author : penpenps # Time : 2019-07-09 # Revert right node firstly, then compare with left node # Time Complexity: O(n) # Space Complexity: O(n) # Definition for a binary tree node. class TreeNode: def __init__(self, x): self.val = x self...
4.0625
4
public/templates/_default.py
WinterTechForum/amazebot
0
12770681
from time import sleep from org.jointheleague.ecolban.rpirobot import SimpleIRobot, Sonar robot = SimpleIRobot() sonar = Sonar() def setup(): # Initialization code here pass def loop(): # Repeating code here return True def shutdown(): robot.reset() robot.stop() robot.closeConnection() setup() while loop...
2.234375
2
Workshop6/1b.py
Camiloasc1/OptimizationUNAL
0
12770682
from Workshop6.Graph import * C = {} makeDLinkW(C, '1', '4', 10) makeDLinkW(C, '1', '2', 5) makeDLinkW(C, '2', '5', 1) makeDLinkW(C, '2', '3', 7) makeDLinkW(C, '3', '6', 4) makeDLinkW(C, '4', '7', 11) makeDLinkW(C, '4', '5', 3) makeDLinkW(C, '5', '8', 7) makeDLinkW(C, '5', '6', 3) makeDLinkW(C, '6', '9', 5) make...
2.859375
3
Chapter07/0702.py
0201shj/Python-OpenCV
0
12770683
# 0702.py import cv2 import numpy as np src = cv2.imread('./data/rect.jpg') gray = cv2.cvtColor(src, cv2.COLOR_BGR2GRAY) edges = cv2.Canny(gray, 50, 100) lines = cv2.HoughLines(edges, rho = 1, theta = np.pi/180.0, threshold = 100) print('lines.shape = ', lines.shape) for line in lines: rho, theta = l...
2.921875
3
distribulator/engine/data/Environment.py
adace74/test
0
12770684
<filename>distribulator/engine/data/Environment.py ###################################################################### # # $Id$ # # (c) Copyright 2004 Orbitz, Inc. All Rights Reserved. # Please see the accompanying LICENSE file for license information. # #############################################################...
2.328125
2
examples/cw/cw_users.py
neurospin/pycaravel
0
12770685
""" CubicWeb instance request (user mode) ===================================== Credit: <NAME> pycaravel is a Python package that enables you to parse various source of data. In this tutorial you will learn how to parse and search in a CubicWeb instance. First checks ------------ In order to test if pycaravel packa...
2.828125
3
gatlin/core/flowPipeline.py
kokomal/GATLIN
1
12770686
# coding = utf-8 import copy import json import gatlin.infra.commonUtils as util import gatlin.infra.print as pt import gatlin.nodes.parserSelector as ps # 读取需要进行测试的flow全集 def launch_flows_config(location): flow_json_file = location with open(flow_json_file) as fl: flows_config = json.loads(fl.read()...
2.203125
2
fuzzware_pipeline/util/genconfig.py
mo-bl/fuzzware-pipeline
0
12770687
import os import pathlib import string import subprocess from elftools.elf.constants import SH_FLAGS from elftools.elf.elffile import ELFFile from elftools.elf.sections import SymbolTableSection from fuzzware_harness.util import bytes2int from fuzzware_pipeline.logging_handler import logging_handler logger = logging_...
2.03125
2
python/scroll.py
robotlightsyou/test
2
12770688
from bibliopixel.animation import BaseAnimation from bibliopixel import colors # This is using the default 32x32 simpixel display - # so this is a list of 16 * 64 = 1024 colors. BASE = [ colors.Black, colors.Black, colors.Black, colors.Black, colors.Green, colors.Green, colors.Green, colors.Green, colors.B...
3.265625
3
0x0A-python-inheritance/1-my_list.py
BennettDixon/holbertonschool-higher_level_programming
1
12770689
#!/usr/bin/python3 class MyList(list): """extended version of list """ def print_sorted(self): """prints the list in ascending order """ copy = self[:] copy.sort() print(copy)
3.609375
4
tests/http_provider_hosted_test.py
ilblackdragon/studio
397
12770690
import unittest import os import tempfile import uuid from studio import model from model_test import get_test_experiment # We are not currently working with HTTP providers. @unittest.skip class HTTPProviderHostedTest(unittest.TestCase): def get_db_provider(self, config_name): config_file = os.path.join(...
2.609375
3
Ex011.py
leonardoDelefrate/Curso-de-Python
0
12770691
<reponame>leonardoDelefrate/Curso-de-Python altura= float(input('Quanto de altura a parede possui?')) largura= float(input('Quanto de largura a parede possui?')) area= largura * altura litros= area/2 print('Sua parede possui uma área de {},portanto, você precisará de {}litros de tinta para pinta-la'.format(area,litros)...
3.625
4
nornir_f5/plugins/tasks/bigip/__init__.py
kpressouyre/nornir_f5
1
12770692
<reponame>kpressouyre/nornir_f5 """Nornir F5 BIG-IP tasks."""
0.914063
1
wrappers/arlexecute/calibration/pointing.py
ska-telescope/algorithm-reference-library
22
12770693
""" Functions for calibration, including creation of pointingtables, application of pointingtables, and merging pointingtables. """ from processing_components.calibration.pointing import create_pointingtable_from_blockvisibility from processing_components.calibration.pointing import create_pointingtable_from_rows fro...
1.601563
2
keyword_preprocess.py
w-garcia/BugClustering
3
12770694
from util import cwd import util from jira import * import DBModel def get_full_description(j, line): begin_key = line.find('[') + 1 end_key = line.find(']') - 1 issue_id = line[begin_key: end_key + 1] try: issue = j.issue(issue_id) except JIRAError: print JIRAError.message ...
2.421875
2
deep_qa/contrib/layers/__init__.py
mrbot-ai/deep_qa
2
12770695
from .knowledge_backed_lstm import KnowledgeBackedLSTM from .tree_composition_lstm import TreeCompositionLSTM
1.046875
1
davarocr/davarocr/davar_common/datasets/builder.py
CuteyThyme/MultiModal_IE
0
12770696
""" ################################################################################################## # Copyright Info : Copyright (c) Davar Lab @ Hikvision Research Institute. All rights reserved. # Filename : builder.py # Abstract : # Current Version: 1.0.0 # Date : 2020-05-31 ####...
1.976563
2
Ex087.py
dpsaraiva/Exercicios_Python
0
12770697
#Desafio: Aprimore o desafio anterior, mostrando no final: # A) A soma de todos os valores pares digitados. # B) A soma dos valores da terceira coluna. # C) O maior valor da segunda linha. matriz = [[], [], []] par = soma = maior = 0 for n in range(0, 3): for i in range(0, 3): num = int(input(f'Digite um ...
3.953125
4
saticl/preproc/utils.py
edornd/multimodal-icl
6
12770698
import os from typing import Dict, Union import numpy as np def lenient_makedirs(path: str) -> None: """Simple wrapper around makedirs that first checks for existence. Args: path (str): path to be created """ if not os.path.exists(path): os.makedirs(path) def tile_overlapped(image:...
2.953125
3
scripts/practice/FB/LowestCommonAncestor.py
bhimeshchauhan/competitive_programming
0
12770699
<reponame>bhimeshchauhan/competitive_programming """ """ # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'TreeNod...
3.625
4
Examples/python_server/openapi_server/com/h21lab/TS29573_N32_Handshake/handler/__init__.py
H21lab/5GC_build
12
12770700
<reponame>H21lab/5GC_build<filename>Examples/python_server/openapi_server/com/h21lab/TS29573_N32_Handshake/handler/__init__.py # coding: utf-8 # flake8: noqa from __future__ import absolute_import # import models into model package from openapi_server.com.h21lab.TS29573_N32_Handshake.handler.api_ie_mapping import ApiI...
1.445313
1
app/recipe/tests/test_recipe_api.py
pprasha2/python-api
0
12770701
from django.contrib.auth import get_user_model from django.test import TestCase from django.urls import reverse from rest_framework import status from rest_framework.test import APIClient from core.models import Recipe, Tag, Ingredient from recipe.serializers import RecipeSerializer, RecipeDetailSerializer RECIPES_...
2.578125
3
dataloader.py
Haiyang-W/DTI-GRAPH
6
12770702
import json import torch import numpy as np import random import torch.nn.functional as F import functools def cmp_time(a, b): a_num = int(a.split('_')[1]) b_num = int(b.split('_')[1]) return a_num - b_num def pad_tensor(vec, pad): """ pad tensor to fixed length :parameter vec: tensor...
2.3125
2
backend/api/tests/routes/test_auth.py
damo-da/bars-and-grills
45
12770703
# Test cases for /login and /signup import unittest from rest_framework.test import APIClient from api.models import User, Group class LoginTestCase(unittest.TestCase): def setUp(self) -> None: self.username = 'testuser' self.password = '<PASSWORD>' self.client = APIClient() se...
3.25
3
UnityEngine/CameraType/__init__.py
Grim-es/udon-pie-auto-completion
0
12770704
<reponame>Grim-es/udon-pie-auto-completion<filename>UnityEngine/CameraType/__init__.py<gh_stars>0 from UdonPie import UnityEngine from UdonPie.Undefined import * class CameraType: def __new__(cls, arg1=None): ''' :returns: CameraType :rtype: UnityEngine.CameraType ''' pass
1.757813
2
ipycode/A00-fileSplit.py
wangzhongtian/ConTractMngToolSrc
0
12770705
#!/usr/bin/python3 #-*- coding: UTF-8 import fileSplit fileSplit.合并()
1.367188
1
conans/client/conan_api.py
zomeck/conan
0
12770706
import hashlib import os import sys from collections import defaultdict, OrderedDict import requests import conans from conans import __version__ as CLIENT_VERSION, tools from conans.client.client_cache import ClientCache from conans.client.conf import MIN_SERVER_COMPATIBLE_VERSION, ConanClientConfigParser from conan...
1.523438
2
flixbus/flixbus/models.py
kamotos/flixbus-homework
0
12770707
from django.db import models class Segment(models.Model): from_stop = models.IntegerField() to_stop = models.IntegerField() distance = models.DecimalField(max_digits=6, decimal_places=2) class Route(models.Model): segments = models.ManyToManyField(Segment, through='RouteSegment') class RouteSegmen...
2.109375
2
hw1/test/tree/__init__.py
LePotatoChef/CS583-Machine-Learning
1
12770708
from .dtnode import * from .dtree import *
0.960938
1
core/objs/xml_modelo_106.py
aanacleto/erp-
0
12770709
<reponame>aanacleto/erp- # !/usr/bin/env python # -*- encoding: utf-8 -*- """ ERP+ """ __author__ = '<NAME>' __credits__ = [] __version__ = "1.0" __maintainer__ = "<NAME>" __status__ = "Development" __model_name__ = 'xml_modelo_106.XMLModelo106' import auth, base_models from orm import * from form import * import erp_...
1.796875
2
export_resized_android_app_icons.py
Tubbebubbe/gimp-plugins
4
12770710
<filename>export_resized_android_app_icons.py #!/usr/bin/env python """ export_resized_android_app_icons Gimp plugin to export app icons for an Android app Author: ------- <NAME>, Techne Development AB <<EMAIL>> Installation: ------------- (Mac OS X) Run make: > make install or copy this file to ~/Library/Appl...
2.25
2
tests/results/040_medium_complex_multiple_hook_test2.py
CowboyTim/python-storable
8
12770711
<reponame>CowboyTim/python-storable result = [ {0: 0, 1: 'var 1'}, {0: 0, 1: 'var 2'} ]
1.632813
2
EspFitting/ProbePlacers/Water.py
jacob-litman/fittingScripts
0
12770712
import sys import numpy as np import math from JMLUtils import dist2, eprint from StructureXYZ import StructXYZ from typing import Sequence TRIANGLE_TOL = 1E-4 Y_DENOM = 1.0 / math.sqrt(3) def water(infile: str = 'QM_REF.xyz', delta=4.0): delta = float(delta) xyzfi = StructXYZ(infile) assert len(xyzfi...
2.734375
3
.idea/VirtualEnvironment/Lib/site-packages/tests/outcomes/imports/test_import_absolute_error_circular/main2.py
Vladpetr/NewsPortal
0
12770713
<filename>.idea/VirtualEnvironment/Lib/site-packages/tests/outcomes/imports/test_import_absolute_error_circular/main2.py import main x = 1040
1.328125
1
muz/main.py
Akaricchi/muz
9
12770714
#!/usr/bin/env python2 # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import division from __future__ import unicode_literals import os, sys, logging, argparse from itertools import ifilter as filter import muz import muz.frontend import muz.vfs a...
2.15625
2
components/model/bert/bert_pipeline/kubeflow_dag_runner.py
googleforgames/clean-chat
9
12770715
<filename>components/model/bert/bert_pipeline/kubeflow_dag_runner.py ################################################################################################################ # # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in co...
1.609375
2
CODES/20. Loop for/loops.py
eltechno/python_course
4
12770716
<reponame>eltechno/python_course result = 0 """ i = 0 while i < 4: nr = int(input("Please give me the number: ")) result += nr i += 1 print("The result of adding numbers is: ", result) """ for i in range(1000): if (i%2 == 0): print(i, " is even number") print("The res...
3.84375
4
chamfer_pytorch/test_chamfer.py
jiyeonkim127/PSI
138
12770717
<filename>chamfer_pytorch/test_chamfer.py import torch import dist_chamfer as ext distChamfer = ext.chamferDist() from torch.autograd import Variable def pairwise_dist(x, y): xx, yy, zz = torch.mm(x, x.t()), torch.mm(y, y.t()), torch.mm(x, y.t()) rx = xx.diag().unsqueeze(0).expand_as(xx) ry = yy.diag().u...
2.34375
2
annotations/gtf.py
don4apaev/anfisa
0
12770718
import bisect from annotations.db_connect import Connection class GTF(Connection): TABLE = "GTF" GENE_BUCKET_SIZE = 1000000 COLUMNS = [ "chromosome", "source", "feature", "start", "end", "score", "strand", "frame", "attribute", ...
2.71875
3
hpat/io/pio.py
AlexanderKalistratov/hpat
1
12770719
<gh_stars>1-10 from __future__ import print_function, division, absolute_import import types as pytypes # avoid confusion with numba.types import numba from numba import ir, analysis, types, config, numpy_support from numba.ir_utils import (mk_unique_var, replace_vars_inner, find_topo_order, ...
2.328125
2
py/buck/zip/append_with_copy.py
thelvis4/buck
1
12770720
#!/usr/bin/env python # Copyright 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 applica...
2.34375
2
python/graphs/shortest_path.py
tachyonsoftware/algorithms
17
12770721
def get_shortest_path(in_nodes, start, dest): shortest_paths = {start: (0, [start])} def _get_shortest(dest, shortest_paths=shortest_paths): if dest not in shortest_paths: incoming_edges = in_nodes[dest] shortest_path, shortest_cost = None, None for in_node, cost i...
3.890625
4
2017/round_1a/alphabet_cake.py
laichunpongben/CodeJam
0
12770722
#!/usr/bin/env python # Google Code Jam # Google Code Jam 2017 # Round 1A 2017 # Problem A. Alphabet Cake # Solve all test sets from __future__ import print_function def make_cake(r, c, cake): assert isinstance(cake, list) filled_cake = [] for row in cake: first_cell = '?' last_cell = '...
3.015625
3
venv/lib/python2.7/site-packages/boxsdk/util/compat.py
LockScreen/Backend
1
12770723
<filename>venv/lib/python2.7/site-packages/boxsdk/util/compat.py<gh_stars>1-10 # coding: utf-8 from __future__ import division, unicode_literals from datetime import timedelta if not hasattr(timedelta, 'total_seconds'): def total_seconds(delta): """ Return the total number of seconds represented...
2.703125
3
unit_test/model/sklearn_like_model/AE/test_AE.py
demetoir/MLtools
0
12770724
from script.data_handler.DatasetPackLoader import DatasetPackLoader from script.model.sklearn_like_model.AE.AE import AE data_pack = DatasetPackLoader().load_dataset("MNIST") dataset = data_pack['train'] Xs, Ys = dataset.full_batch(['Xs', 'Ys']) sample_X = Xs[:2] sample_Y = Ys[:2] def AE_total_execute(mode...
2.5
2
src/zsl/application/modules/task_router.py
AtteqCom/zsl
2
12770725
<filename>src/zsl/application/modules/task_router.py """ :mod:`zsl.application.modules.task_router_module` ------------------------------------------------- """ from __future__ import absolute_import, division, print_function, unicode_literals from builtins import * from injector import ClassProvider, Module, provide...
2.296875
2
wordmarker/data/formatter.py
lostblackknight/wordmarker
2
12770726
<reponame>lostblackknight/wordmarker from abc import ABCMeta, abstractmethod class Formatter(metaclass=ABCMeta): """ :: 格式化的抽象类 """ @abstractmethod def format(self, *args): """ .. note:: 格式化数据 :param args: 数据 :return: - 格式化后的数据 """ ...
2.984375
3
examples/strategies/double_ma.py
mcFore/ctpbee
461
12770727
<filename>examples/strategies/double_ma.py from ctpbee import CtpbeeApi, CtpBee from ctpbee.constant import Offset, TradeData, Direction from ctpbee.indicator.ta_lib import ArrayManager class DoubleMaStrategy(CtpbeeApi): def __init__(self, name): super().__init__(name) self.manager = ArrayManager(...
2.65625
3
shhicparking/ui/PictureViewerDlg.py
sqf-ice/ParkTerminalUnitDevelopManage
0
12770728
#encoding:utf-8 ''' Created on 2015-8-27 图片查看窗口 @author: user ''' from PyQt4 import QtGui, QtCore, uic from PyQt4.Qt import pyqtSlot from PyQt4.QtGui import QMessageBox from shhicparking.server import TSStub from shhicparking.util import dateutil import base64 class PictureViewerDlg(QtGui.QDialog): def __init__(se...
2
2
doc2vec_model.py
woctezuma/steam-descriptions
1
12770729
# Objective: learn a Doc2Vec model import logging import multiprocessing import random from time import time import numpy as np from gensim.models import doc2vec from benchmark_utils import load_benchmarked_app_ids, print_ranking from sentence_models import print_most_similar_sentences from universal_sentence_encode...
2.65625
3
desafios/Mundo 2/Ex052.py
duartecgustavo/Python---Estudos-
6
12770730
<filename>desafios/Mundo 2/Ex052.py # Desafio 52 - Aula 13 : Programa que leia um numero e diga se é um numero PRIMO. conta = 0 primo = int(input('Me diga um numero: ')) for c in range(1, primo+1): if primo % c == 0 : print('\033[34m', end='') conta += 1 else: print('\033[m', end='') ...
3.734375
4
automlk/doc.py
pierre-chaville/automlk
16
12770731
import os import sys import glob import zipfile import pandas as pd import numpy as np from .context import get_dataset_folder from .results import * from automlk.worker import get_search_rounds from .print import * import jinja2 import subprocess jinja_globals = {'print_list': print_list, 'print_sco...
2.359375
2
dq0/sdk/pipeline/pipeline.py
gradientzero/dq0-sdk
2
12770732
# -*- coding: utf-8 -*- """ Copyright 2021, Gradient Zero All rights reserved """ import logging from dq0.sdk.errors.errors import fatal_error from dq0.sdk.pipeline import pipeline_config import pandas as pd from sklearn import pipeline logger = logging.getLogger(__name__) class Pipeline(): def __init__(sel...
2.625
3
source/sam_spot_bot_create_job/iam_helper.py
liangfu/spot-tagging-bot-for-digital-assets
19
12770733
import json import boto3 class IamHelper: def __init__(self): self.client = boto3.client("iam") self.ssm_client = boto3.client('ssm') def create_or_get_ecs_role(self) -> str: self.role_name = "spot-bot-ecs-service-role" print("Check role exist") try: res...
2.171875
2
tests/nn/test_inference.py
Tyelab/sleap
0
12770734
<filename>tests/nn/test_inference.py import pytest import numpy as np import tensorflow as tf import sleap from numpy.testing import assert_array_equal, assert_allclose from sleap.nn.data.confidence_maps import ( make_confmaps, make_grid_vectors, make_multi_confmaps, ) from sleap.nn.inference import ( ...
2.03125
2
week4/w4e1.py
melphick/pybasics
0
12770735
#!/usr/bin/env python import sys valid = False reason = [] while valid == False: valid = True ip_addr = raw_input("please enter an IP: ") print "The IP is now: %s" % ip_addr ip_list = ip_addr.split('.') if len (ip_list) != 4: valid = False reason.append('IP Address does not have 4 octets') if (int(ip_li...
3.765625
4
utils/status.py
loribonna/CSSL
3
12770736
# Copyright 2021-present, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>. # All rights reserved. # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from datetime import datetime import sys from time import time from typing import Union def progress_bar(i: ...
3.015625
3
src/chathamhouse/chathamhousedata.py
OCHA-DAP/hdx-scraper-chathamhouse
0
12770737
#!/usr/bin/python # -*- coding: utf-8 -*- """ Chatham House Data ------------------ Collects input data for Chatham House. """ import logging from hdx.data.dataset import Dataset from hdx.data.resource import Resource from hdx.data.showcase import Showcase from hdx.utilities.dictandlist import integer_value_convert ...
2.40625
2
impact/elements/element.py
jacquelinegarrahan/lume-impact
1
12770738
<reponame>jacquelinegarrahan/lume-impact from impact import parsers class ImpactEle: """ """ def __init__(self, L=0, type='drift'): pass
1.5
2
lecture_11_advanced_topics/additional_materials/code_samples_from_lecture/lazy_property.py
DKudrik/epam_python_autumn_2020
37
12770739
# https://github.com/lord63-forks/python-patterns/blob/patch-3/lazy_evaluation.py def lazy_property(fn): """Decorator that makes a property lazy-evaluated.""" attr_name = '_lazy_' + fn.__name__ @property def _lazy_property(self): if not hasattr(self, attr_name): setattr(self, attr_...
3.5
4
cas.py
anawwy/tornado-cas-oauth2
0
12770740
#!/usr/bin/env python # -*- coding:utf-8 -*- import json from tornado import gen from http_client import AAsyncHTTPClient, get_url class CASHelper(AAsyncHTTPClient): CA_CERT_PATH = 'XXXXX' @classmethod def _base_url(cls): '''cas server url prefix''' return 'https://cas.te...
2.03125
2
nicos_mlz/mira/setups/memograph.py
ebadkamil/nicos
0
12770741
<gh_stars>0 description = 'memograph readout' group = 'optional' devices = dict( t_in_fak40 = device('nicos_mlz.devices.memograph.MemographValue', hostname = 'memograph02.care.frm2', group = 1, valuename = 'T_in MIRA', description = 'inlet temperature memograph', fmtstr = '...
1.476563
1
15A-175/HI/imaging/match_and_split.py
Astroua/LocalGroup-VLA
1
12770742
<gh_stars>1-10 ''' Match and split the re-weighted HI MSs The 14B frequency range includes 2000 channels. That same range in the 17B data is 2006 channels. So we first regrid and split the data over the same velocity range. The original channels are -206 and change m/s. Regrid to something common like -210 m/s. UPDATE...
2.0625
2
docs/userguide/processing/smoothing.py
spectrochempy/spectrochempy
44
12770743
<filename>docs/userguide/processing/smoothing.py<gh_stars>10-100 # -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # cell_metadata_filter: title,-all # formats: ipynb,py:percent # notebook_metadata_filter: all # text_representation: # extension: .py # format_name: percent # format...
2.84375
3
varsom_avalanche_client/models/avalanche_problem.py
NVE/python-varsom-avalanche-client
0
12770744
# coding: utf-8 """ Snøskredvarsel API No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: v5.0.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 imp...
1.398438
1
Level-3/bomb_baby/bomb-baby.py
FeLiNa22/google-foobar
1
12770745
import random def solution(x, y): m, f, gen = int(x), int(y), 0 while(True): if(m == 1 and f == 1): return str(gen); elif(m < 1 or f < 1 or m==f): return "impossible" elif(m == 1 or f == 1): return str(gen + f * m - 1) elif(m > f): ...
3.53125
4
src/api/v1/node_api.py
glimsil/orch
0
12770746
from flask import jsonify from api import api import socket @api.route('/v1/node/who/i/am', methods=['GET']) def node_who_i_am(): return jsonify({'node_name':str(socket.gethostname())}) @api.route('/v1/node/sync', methods=['POST']) def node_sync(): return jsonify({'node_name':str(socket.gethostname())}) @api...
2.40625
2
tests/test_forms.py
azmeuk/webtest
239
12770747
<gh_stars>100-1000 import cgi import os.path import struct import sys import webtest from webob import Request from webtest.debugapp import DebugApp from webtest.compat import to_bytes from webtest.forms import NoValue, Submit, Upload from tests.compat import unittest from tests.compat import u class TestForms(unitt...
2.078125
2
Backspace String Compare.py
ngdeva99/Fulcrum
0
12770748
class Solution: def backspaceCompare(self, S: str, T: str) -> bool: print(S[0]) stack = [] for i in S: if i=="#": if len(stack)==0: continue stack.pop() else: s...
3.640625
4
gpMgmt/bin/gppylib/system/info.py
henglabs/gpdb
0
12770749
<reponame>henglabs/gpdb<gh_stars>0 #! /usr/bin/env python2 import psutil import os import resource PERCENTAGE_OF_AVAIL_MEM_USED_FOR_THREADS = 0.8 # allow 20% of memory to remain for parent process MB = 1024 * 1024 class SystemInfo(): def __init__(self, logger=None): self.logger = logger self.pid...
2.875
3
lib/modeling/roi_heads/relation_network.py
SimeonZhang/detectron2_tensorflow
3
12770750
<filename>lib/modeling/roi_heads/relation_network.py import tensorflow as tf from .fast_rcnn import FastRCNNOutputLayers, FastRCNNOutputs from .box_head import ROI_BOX_HEAD_REGISTRY, FastRCNNConvFCHead, build_box_head from .roi_heads import ROI_HEADS_REGISTRY, StandardROIHeads from ...layers import Linear, ShapeSpec, ...
2.21875
2