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
yolox/data/datasets/mot.py
ldelzott/ByteTrack
0
5800
import cv2 import numpy as np from pycocotools.coco import COCO import os from ..dataloading import get_yolox_datadir from .datasets_wrapper import Dataset class MOTDataset(Dataset): """ COCO dataset class. """ def __init__( # This function is called in the exps yolox_x_mot17_half.py in this way: ...
2.703125
3
src/poetry/console/commands/remove.py
pkoch/poetry
0
5801
<reponame>pkoch/poetry from __future__ import annotations from typing import Any from cleo.helpers import argument from cleo.helpers import option from tomlkit.toml_document import TOMLDocument try: from poetry.core.packages.dependency_group import MAIN_GROUP except ImportError: MAIN_GROUP = "default" from...
2.109375
2
orrinjelo/aoc2021/day_11.py
orrinjelo/AdventOfCode2021
0
5802
<filename>orrinjelo/aoc2021/day_11.py from orrinjelo.utils.decorators import timeit import numpy as np def parse(lines): return np.array([[int(c) for c in line.strip()] for line in lines]) visited = [] def flash(a, x, y): global visited if (x,y) in visited: return for dx in range(-1,2): ...
2.890625
3
exercise_2/exercise_2.1.py
lukaszbinden/ethz-iacv-2020
0
5803
camera_width = 640 camera_height = 480 film_back_width = 1.417 film_back_height = 0.945 x_center = 320 y_center = 240 P_1 = (-0.023, -0.261, 2.376) p_11 = P_1[0] p_12 = P_1[1] p_13 = P_1[2] P_2 = (0.659, -0.071, 2.082) p_21 = P_2[0] p_22 = P_2[1] p_23 = P_2[2] p_1_prime = (52, 163) x_1 = p_1_prime[0] y_1 = p_1_pr...
1.757813
2
services/train/single.py
paper2code/torch2vec-restful-service
2
5804
<reponame>paper2code/torch2vec-restful-service #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Aug 26 19:15:34 2020 @author: deviantpadam """ import pandas as pd import numpy as np import concurrent.futures import os import tqdm from collections import Counter from torch2vec.data import DataPreparati...
2.6875
3
tests/sources/test_document_oereblex.py
geo-bl-ch/pyramid_oereb
0
5805
<reponame>geo-bl-ch/pyramid_oereb # -*- coding: utf-8 -*- import datetime import pytest import requests_mock from geolink_formatter.entity import Document, File from requests.auth import HTTPBasicAuth from pyramid_oereb.contrib.sources.document import OEREBlexSource from pyramid_oereb.lib.records.documents import Do...
2.125
2
apps/zsh/singletons.py
codecat555/codecat555-fidgetingbits_knausj_talon
4
5806
<reponame>codecat555/codecat555-fidgetingbits_knausj_talon<filename>apps/zsh/singletons.py # A rarely-updated module to assist in writing reload-safe talon modules using # things like threads, which are not normally safe for reloading with talon. # If this file is ever updated, you'll need to restart talon. import lo...
2.375
2
trainNN/run_bichrom.py
yztxwd/Bichrom
3
5807
import argparse import yaml from subprocess import call from train import train_bichrom if __name__ == '__main__': # parsing parser = argparse.ArgumentParser(description='Train and Evaluate Bichrom') parser.add_argument('-training_schema_yaml', required=True, help='YAML file with pa...
2.609375
3
setup.py
Fronius-SED/rapidyaml
0
5808
<reponame>Fronius-SED/rapidyaml #!/usr/bin/env python3 # -*- coding: utf-8 -*- # SPDX-License-Identifier: MIT import os import shutil import sys from pathlib import Path from distutils import log from setuptools import setup from setuptools.command.sdist import sdist as SdistCommand from cmake_build_extension import ...
1.632813
2
litex_boards/targets/digilent_arty_z7.py
machdyne/litex-boards
0
5809
<filename>litex_boards/targets/digilent_arty_z7.py #!/usr/bin/env python3 # # This file is part of LiteX-Boards. # # Copyright (c) 2021 <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-2-Clause import argparse import subprocess from migen import * from litex_boards.platforms import digilent_arty_z7 from litex.build ...
1.710938
2
goose/parsers.py
allmalaysianews/article-extractor
0
5810
# -*- coding: utf-8 -*- """\ This is a python port of "Goose" orignialy licensed to Gravity.com under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Python port was written by <NAME> Gravity.com licenses this file t...
2.15625
2
src/infrastructure/database/postgres/sqlhandler.py
SoyBeansLab/daizu-online-judge-backend
7
5811
<reponame>SoyBeansLab/daizu-online-judge-backend<gh_stars>1-10 from logging import getLogger import os from typing import List, Union import psycopg2 from interface.database.sqlhandler import Cursor as AbsCursor from interface.database.sqlhandler import Result as AbsResult from interface.database.sqlhandler import Sq...
2.390625
2
virtualisation/wrapper/parser/xmlparser.py
CityPulse/CP_Resourcemanagement
2
5812
<reponame>CityPulse/CP_Resourcemanagement from virtualisation.clock.abstractclock import AbstractClock __author__ = '<NAME> (<EMAIL>)' from virtualisation.wrapper.parser.abstractparser import AbstractParser from virtualisation.misc.jsonobject import JSONObject as JOb import datetime as dt class XMLParser(AbstractPa...
2.46875
2
plaso/formatters/interface.py
jonathan-greig/plaso
1,253
5813
<gh_stars>1000+ # -*- coding: utf-8 -*- """This file contains the event formatters interface classes. The l2t_csv and other formats are dependent on a message field, referred to as description_long and description_short in l2t_csv. Plaso no longer stores these field explicitly. A formatter, with a format string defi...
2.703125
3
python_program/condition.py
LiuKaiqiang94/PyStudyExample
5
5814
<reponame>LiuKaiqiang94/PyStudyExample def main(): val=int(input("input a num")) if val<10: print("A") elif val<20: print("B") elif val<30: print("C") else: print("D") main()
3.890625
4
Annotated_video/test/Annotatedvideo_worm.py
Rukaume/LRCN
1
5815
<filename>Annotated_video/test/Annotatedvideo_worm.py # -*- coding: utf-8 -*- """ Created on Fri Sep 4 22:27:11 2020 @author: Miyazaki """ imdir = "C:/Users/Miyazaki/Desktop/hayashi_lab/20200527_lethargus_analysis/renamed_pillar_chamber-N2/chamber3" resultdir= "C:/Users/Miyazaki/Desktop/hayashi_lab/20200527_lethargu...
2.3125
2
emilia/modules/math.py
masterisira/ELIZA_OF-master
0
5816
<gh_stars>0 from typing import List import requests from telegram import Message, Update, Bot, MessageEntity from telegram.ext import CommandHandler, run_async from emilia import dispatcher from emilia.modules.disable import DisableAbleCommandHandler from emilia.modules.helper_funcs.alternate import send_message import...
2.21875
2
services/IAm.py
matteobjornsson/serverless-rock-paper-scissors
0
5817
# # Created on Thu Apr 22 2021 # <NAME> # import boto3 from botocore.exceptions import ClientError import logging logging.basicConfig(filename="rps.log", level=logging.INFO) iam_resource = boto3.resource("iam") sts_client = boto3.client("sts") def create_role( iam_role_name: str, assume_role_policy_json: str, p...
2.65625
3
stograde/common/run_status.py
babatana/stograde
0
5818
<reponame>babatana/stograde from enum import auto, Enum class RunStatus(Enum): SUCCESS = auto() CALLED_PROCESS_ERROR = auto() FILE_NOT_FOUND = auto() PROCESS_LOOKUP_ERROR = auto() TIMEOUT_EXPIRED = auto()
2.25
2
recsys/__init__.py
shenghuiliuu/recsys
50
5819
<reponame>shenghuiliuu/recsys __all__ = ['cross_validation', 'metrics', 'datasets', 'recommender']
1.015625
1
audiomate/annotations/label_list.py
CostanzoPablo/audiomate
133
5820
import collections import copy import intervaltree from .label import Label class LabelList: """ Represents a list of labels which describe an utterance. An utterance can have multiple label-lists. Args: idx (str): An unique identifier for the label-list within a corpus f...
3.15625
3
src/views/age_results_widget.py
RubyMarsden/Crayfish
0
5821
<filename>src/views/age_results_widget.py import matplotlib from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QHBoxLayout, QDialog, QPushButton, QWidget, QVBoxLayout, QLabel matplotlib.use('QT5Agg') import matplotlib.pyplot as plt from models.data_key import DataKey from utils import ui_utils class AgeResults...
2.484375
2
examples/single_run/ocaes_single_run.py
EnergyModels/OCAES
0
5822
import pandas as pd from OCAES import ocaes # ---------------------- # create and run model # ---------------------- data = pd.read_csv('timeseries_inputs_2019.csv') inputs = ocaes.get_default_inputs() # inputs['C_well'] = 5000.0 # inputs['X_well'] = 50.0 # inputs['L_well'] = 50.0 # inputs['X_cmp'] = 0 # inputs['X_exp...
2.765625
3
tests/transformations/local_storage_test.py
am-ivanov/dace
1
5823
import unittest import dace import numpy as np from dace.transformation.dataflow import MapTiling, OutLocalStorage N = dace.symbol('N') @dace.program def arange(): out = np.ndarray([N], np.int32) for i in dace.map[0:N]: with dace.tasklet: o >> out[i] o = i return out cla...
2.453125
2
astropy/io/fits/hdu/streaming.py
jayvdb/astropy
445
5824
<gh_stars>100-1000 # Licensed under a 3-clause BSD style license - see PYFITS.rst import gzip import os from .base import _BaseHDU, BITPIX2DTYPE from .hdulist import HDUList from .image import PrimaryHDU from astropy.io.fits.file import _File from astropy.io.fits.header import _pad_length from astropy.io.fits.util i...
2.703125
3
geoprisma/tests/test_templatetags.py
groupe-conseil-nutshimit-nippour/django-geoprisma
0
5825
import django from django.test import TestCase from django.template import Template, Context class genericObj(object): """ A generic object for testing templatetags """ def __init__(self): self.name = "test" self.status = "ready" def getOption(self, optionName): ...
2.40625
2
src/ggrc_workflows/models/task_group.py
acidburn0zzz/ggrc-core
1
5826
<reponame>acidburn0zzz/ggrc-core # Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """A module containing the workflow TaskGroup model.""" from sqlalchemy import or_ from ggrc import db from ggrc.login import get_current_user from ggrc.models.association...
1.867188
2
src/tests/app_functions/menu/test_change_auto_login.py
DanielNoord/DuolingoPomodoro
0
5827
import pytest import rumps from src.app_functions.menu.change_auto_login import change_auto_login @pytest.fixture(name="basic_app") def create_app(): """Creates a basic app object with some variables to pass to functions Returns: rumps.App: Basic app """ app = rumps.App("TestApp") app.set...
2.515625
3
deepobs/tensorflow/testproblems/cifar100_vgg19.py
H0merJayS1mpson/deepobscustom
0
5828
# -*- coding: utf-8 -*- """VGG 19 architecture for CIFAR-100.""" import tensorflow as tf from ._vgg import _vgg from ..datasets.cifar100 import cifar100 from .testproblem import TestProblem class cifar100_vgg19(TestProblem): """DeepOBS test problem class for the VGG 19 network on Cifar-100. The CIFAR-100 ima...
2.796875
3
write-a-function.py
TheHumanGoogle/Hackerrank-python-solution
1
5829
def is_leap(year): leap=False if year%400==0: leap=True elif year%4==0 and year%100!=0: leap=True else: leap=False return leap year = int(input())
4.09375
4
shortio/utils.py
byshyk/shortio
0
5830
<reponame>byshyk/shortio """Contains utility functions.""" BIN_MODE_ARGS = {'mode', 'buffering', } TEXT_MODE_ARGS = {'mode', 'buffering', 'encoding', 'errors', 'newline'} def split_args(args): """Splits args into two groups: open args and other args. Open args are used by ``open`` function. Other args are u...
3.34375
3
paasta_tools/async_utils.py
sobolevn/paasta
1,711
5831
import asyncio import functools import time import weakref from collections import defaultdict from typing import AsyncIterable from typing import Awaitable from typing import Callable from typing import Dict from typing import List from typing import Optional from typing import TypeVar T = TypeVar("T") # NOTE: thi...
2.4375
2
util/dataset.py
MTI830PyTraders/pytrade
3
5832
#!/usr/bin/python ''' generate dataset ''' import csv import argparse import numpy as np import sklearn.metrics import theanets from sklearn.metrics import accuracy_score import logging from trendStrategy import OptTrendStrategy, TrendStrategy from util import visu def compare(stock, field='orders', strategy="TrendSt...
2.8125
3
examples/scripts/sc/bpdn.py
manvhah/sporco
0
5833
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of the SPORCO package. Details of the copyright # and user license can be found in the 'LICENSE.txt' file distributed # with the package. """ Basis Pursuit DeNoising ======================= This example demonstrates the use of class :class:`.admm.bpdn....
2.9375
3
saleor-env/lib/python3.7/site-packages/snowballstemmer/nepali_stemmer.py
tadartefactorist/mask
0
5834
<filename>saleor-env/lib/python3.7/site-packages/snowballstemmer/nepali_stemmer.py # This file was generated automatically by the Snowball to Python compiler # http://snowballstem.org/ from .basestemmer import BaseStemmer from .among import Among class NepaliStemmer(BaseStemmer): ''' This class was automatic...
2.421875
2
tests/auto_test_class_creation_spec.py
MountainField/uspec
2
5835
<reponame>MountainField/uspec # -*- coding: utf-8 -*- # ================================================================= # uspec # # Copyright (c) 2020 <NAME> # # This software is released under the MIT License. # http://opensource.org/licenses/mit-license.php # =======================================================...
2.84375
3
main.py
Matthewk01/Snake-AI
0
5836
import pygame from game.game_logic.game import Game import matplotlib.pyplot as plt def main(): scores_history = [] GAME_COUNT = 2 for i in range(GAME_COUNT): game = Game(400, "Snake AI") score = game.start() scores_history.append(score) print("Game:", i) plt.ylim(0, 3...
3.890625
4
closed/Intel/code/resnet50/openvino-cpu/src/tools/create_image_list.py
ctuning/inference_results_v1.1
19
5837
import os import sys from glob import glob def create_list(images_dir, output_file, img_ext=".jpg"): ImgList = os.listdir(images_dir) val_list = [] for img in ImgList: img,ext = img.split(".") val_list.append(img) with open(os.path.join(images_dir, output_file),'w') as fid: ...
3.3125
3
AI/others/churn/churn_2.py
honchardev/Fun
0
5838
#!/usr/bin/env python # coding: utf-8 # In[1]: # src: http://datareview.info/article/prognozirovanie-ottoka-klientov-so-scikit-learn/ # In[ ]: # Показатель оттока клиентов – бизнес-термин, описывающий # насколько интенсивно клиенты покидают компанию или # прекращают оплачивать товары или услуги. # Это ключевой ...
2.78125
3
airbyte-integrations/connectors/source-google-sheets/google_sheets_source/models/spreadsheet.py
rajatariya21/airbyte
0
5839
<reponame>rajatariya21/airbyte # MIT License # # Copyright (c) 2020 Airbyte # # 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 limitation the rights # to...
1.90625
2
pytrivia/trivia.py
Dnewman9/Python-Trivia-API
6
5840
<filename>pytrivia/trivia.py """ A simple python api wrapper for https://opentdb.com/ """ from aiohttp import ClientSession from requests import get from pytrivia.__helpers import decode_dict, get_token, make_request from pytrivia.enums import * class Trivia: def __init__(self, with_token: bool): """ ...
3.71875
4
utils.py
py-ranoid/practical-nlp
0
5841
import requests import tarfile import os def download_file(url, directory): local_filename = os.path.join(directory, url.split('/')[-1]) print ("Downloading %s --> %s"%(url, local_filename)) with requests.get(url, stream=True) as r: r.raise_for_status() with open(local_filename, 'wb') as f:...
3.15625
3
spritecss/config.py
yostudios/Spritemapper
49
5842
import shlex from os import path from itertools import imap, ifilter from urlparse import urljoin from .css import CSSParser, iter_events def parse_config_stmt(line, prefix="spritemapper."): line = line.strip() if line.startswith(prefix) and "=" in line: (key, value) = line.split("=", 1) return...
2.65625
3
plotting/make_bar_graph.py
DanielTakeshi/debridement-code
3
5843
""" A bar graph. (c) September 2017 by <NAME> """ import argparse from collections import defaultdict from keras.models import Sequential from keras.layers import Dense, Activation import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import sys np.set_printoptions(suppress=True, ...
2.796875
3
setup.py
tzengerink/groceries-api
0
5844
<filename>setup.py #!/usr/bin/env python from setuptools import find_packages, setup import os import re ROOT = os.path.dirname(__file__) VERSION_RE = re.compile(r'''__version__ = \'([0-9.]+)\'''') def get_version(): init = open(os.path.join(ROOT, 'application', '__init__.py')).read() return VERSION_RE.sear...
1.734375
2
toontown/suit/DistributedLawbotBoss.py
SuperM0use24/TT-CL-Edition
0
5845
from direct.showbase.ShowBase import * from direct.interval.IntervalGlobal import * from toontown.battle.BattleProps import * from direct.distributed.ClockDelta import * from direct.showbase.PythonUtil import Functor from direct.showbase.PythonUtil import StackTrace from direct.gui.DirectGui import * from panda3d.core ...
1.625
2
tests/test_custom_rnncell.py
lightmatter-ai/tensorflow-onnx
0
5846
# SPDX-License-Identifier: Apache-2.0 """Unit Tests for custom rnns.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf from tensorflow.python.ops import init_ops from backend_test_base import Tf2OnnxBackendTest...
1.953125
2
cookie-cutter/src/templates/template.py
noname34/CHARM_Project_Hazard_Perception_I
0
5847
#!/user/bin/env python3 # -*- coding: utf-8 -*- #!/user/bin/env python3 # -*- coding: utf-8 -*- # @Author: <NAME> # @Email: <EMAIL> # @Date: 04.2020 # Context: CHARM PROJECT - Harzard perception """ Module documentation. """ # Imports import sys #import os # Global variables # Class declarations # Function decl...
1.8125
2
utils/gridpeak.py
siwill22/magSA
0
5848
<filename>utils/gridpeak.py import numpy def gridpeak(t, X=None): # GP = GRIDPEAK(...) # gp = gridpeak(t) return gridpeaks based on Blakely # and Simpson method # gp = gridpeak(t,X) optionally remove peak values scoring less than X, # where X can be between 1 and 4....
2.640625
3
Chapter 10/trackbackLog.py
Miillky/automate_the_boring_stuff_with_python
0
5849
<reponame>Miillky/automate_the_boring_stuff_with_python<gh_stars>0 import traceback try: raise Exception('This is the error message.') except: errorFile = open('./Chapter 10/errorInfo.txt', 'w') errorFile.write(traceback.format_exc()) errorFile.close() print('The traceback info was written to errorI...
3
3
Module_III/PySparkNetworkSimilarityClass.py
wuchiehhan/KDD2019-HandsOn-Tutorial
0
5850
# Databricks notebook source from pyspark.sql.types import * from pyspark.sql import functions as F import base64 import array # COMMAND ---------- # s is a base64 encoded float[] with first element being the magnitude def Base64ToFloatArray(s): arr = array.array('f', base64.b64decode(s)) return (arr[0], arr[1:])...
2.8125
3
fizzbuzz.py
vagnes/fizzbuzzgame
0
5851
print("Press q to quit") quit = False while quit is False: in_val = input("Please enter a positive integer.\n > ") if in_val is 'q': quit = True elif int(in_val) % 3 == 0 and int(in_val) % 5 == 0: print("FizzBuzz") elif int(in_val) % 5 == 0: print("Buzz") elif int(in_val) % ...
4.09375
4
lesson10019_projects/pen/data/transition.py
muzudho/py-state-machine-practice
0
5852
from lesson14_projects.pen.data.const import ( A, E_A, E_AN, E_IS, E_OVER, E_PEN, E_PIN, E_THAT, E_THIS, E_WAS, INIT, IS, PEN, THIS, ) pen_transition_doc_v19 = { "title": "This is a pen", "entry_state": INIT, "data": { INIT: { E_OV...
1.648438
2
Animation/Main.py
olesmith/SmtC
0
5853
<filename>Animation/Main.py import gd,os,time from Html import Animation_Html from Iteration import Animation_Iteration from Write import Animation_Write from Base import * from Canvas2 import * from Canvas2 import Canvas2 from Image import Image from HTML import HTML __Canvas__=None class Animation( Animat...
2.984375
3
pytorch_metric_learning/miners/distance_weighted_miner.py
junjungoal/pytorch_metric_learning
1
5854
#! /usr/bin/env python3 from .base_miner import BasePostGradientMiner import torch from ..utils import loss_and_miner_utils as lmu # adapted from # https://github.com/chaoyuaw/incubator-mxnet/blob/master/example/gluon/ # /embedding_learning/model.py class DistanceWeightedMiner(BasePostGradientMiner): def __init_...
2.4375
2
Keywords/__init__.py
cassie01/PumpLibrary
0
5855
<reponame>cassie01/PumpLibrary # -*- coding: utf-8 -*- from .Alarm.alarm import Alarm from .DeliveryView.bolus import Bolus from .DeliveryView.info import Info from .DeliveryView.infusion import Infusion from .DeliveryView.infusion_parameter import InfusionParameter from .DeliveryView.priming import Priming from .Hard...
1.171875
1
src/responsibleai/rai_analyse/constants.py
Azure/automl-devplat2-preview
7
5856
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- class DashboardInfo: MODEL_ID_KEY = "id" # To match Model schema MODEL_INFO_FILENAME = "model_info.json" RAI_INSIGHTS_MODEL_...
1.710938
2
pulsar/apps/data/redis/store.py
goodboy/pulsar
1
5857
from functools import partial from pulsar import Connection, Pool, get_actor from pulsar.utils.pep import to_string from pulsar.apps.data import RemoteStore from pulsar.apps.ds import redis_parser from .client import RedisClient, Pipeline, Consumer, ResponseError from .pubsub import RedisPubSub, RedisChannels class...
2.3125
2
tasks/migrations/0005_auto_20200616_0123.py
tschelbs18/fruitful
0
5858
# Generated by Django 3.0.7 on 2020-06-16 05:23 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('tasks', '0004_auto_20200616_0116'), ] operations = [ migrations.AddField( model_name='userreward', ...
1.835938
2
pcg_libraries/src/pcg_gazebo/parsers/types/vector.py
boschresearch/pcg_gazebo_pkgs
42
5859
<filename>pcg_libraries/src/pcg_gazebo/parsers/types/vector.py # Copyright (c) 2019 - The Procedural Generation for Gazebo authors # For information on the respective copyright owner see the NOTICE file # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance ...
2.609375
3
tests/main/helpers/test_buyers_helpers.py
uk-gov-mirror/alphagov.digitalmarketplace-briefs-frontend
1
5860
<filename>tests/main/helpers/test_buyers_helpers.py import mock import pytest from werkzeug.exceptions import NotFound import app.main.helpers as helpers from dmcontent.content_loader import ContentLoader from dmtestutils.api_model_stubs import BriefStub, FrameworkStub, LotStub content_loader = ContentLoader('tests/...
2.171875
2
Plot/src/test/java/io/deephaven/db/plot/example_plots/PlottingPQ.py
devinrsmith/deephaven-core
0
5861
import deephaven.TableTools as tt import deephaven.Plot as plt t = tt.emptyTable(50)\ .update("X = i + 5", "XLow = X -1", "XHigh = X + 1", "Y = Math.random() * 5", "YLow = Y - 1", "YHigh = Y + 1", "USym = i % 2 == 0 ? `AAPL` : `MSFT`") p = plt.plot("S1", t, "X", "Y").lineColor("black").show() p2 = plt.plot("S1"...
2.25
2
rhoci/test/routes.py
ahmedmagdyawaad/redhat-ci-dashboard
8
5862
# Copyright 2019 <NAME> # # 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 to i...
2.015625
2
mitmproxy/net/http/http1/__init__.py
aarnaut/mitmproxy
0
5863
from .read import ( read_request_head, read_response_head, connection_close, expected_http_body_size, validate_headers, ) from .assemble import ( assemble_request, assemble_request_head, assemble_response, assemble_response_head, assemble_body, ) __all__ = [ "read_request_head", ...
1.28125
1
request_token/migrations/0009_requesttokenerror.py
alex-hutton/django-request-token
0
5864
<filename>request_token/migrations/0009_requesttokenerror.py # -*- coding: utf-8 -*- # Generated by Django 1.10 on 2017-05-21 19:33 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('...
1.84375
2
01-basic-programs/04-lines.py
ncodeitgithub1/python-get-hands-dirty-programs
0
5865
<filename>01-basic-programs/04-lines.py #4 lines: Fibonacci, tuple assignment parents, babies = (1, 1) while babies < 100: print ('This generation has {0} babies'.format(babies)) parents, babies = (babies, parents + babies)
3.734375
4
winter/controller.py
EvgenySmekalin/winter
1
5866
import typing from .core import Component _Controller = typing.TypeVar('_Controller') _ControllerType = typing.Type[_Controller] ControllerFactory = typing.NewType('ControllerFactory', typing.Callable[[typing.Type], object]) _controller_factory: typing.Optional[ControllerFactory] = None def controller(controller_cl...
2.390625
2
go/def.bzl
bobg/rules_go
0
5867
# Copyright 2014 The Bazel 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 applicable la...
1.265625
1
anyway/parsers/united.py
ayalapol/anyway
0
5868
#!/usr/bin/env python # -*- coding: utf-8 -*- import calendar import csv from datetime import datetime import os from flask_sqlalchemy import SQLAlchemy from sqlalchemy import and_ from ..constants import CONST from ..models import AccidentMarker from ..utilities import init_flask, decode_hebrew, open_utf8 from ..imp...
2.09375
2
libact/query_strategies/tests/test_variance_reduction.py
joequant/libact
1
5869
import unittest from numpy.testing import assert_array_equal import numpy as np from libact.base.dataset import Dataset from libact.models import LogisticRegression from libact.query_strategies import VarianceReduction from .utils import run_qs class VarianceReductionTestCase(unittest.TestCase): """Variance red...
2.53125
3
hysds/log_utils.py
fgreg/hysds
0
5870
<reponame>fgreg/hysds<gh_stars>0 from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import open from builtins import str from future import standard_library standard_library.install_aliases() import os impo...
2.109375
2
openstack_dashboard/api/rest/swift.py
CplusShen/aurora-horizon
0
5871
# Copyright 2015, Rackspace, US, 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 to in w...
1.882813
2
datagen.py
kuangliu/pytorch-ssd
124
5872
'''Load image/class/box from a annotation file. The annotation file is organized as: image_name #obj xmin ymin xmax ymax class_index .. ''' from __future__ import print_function import os import sys import os.path import random import numpy as np import torch import torch.utils.data as data import torchvision.t...
2.9375
3
lingvo/core/builder.py
allenwang28/lingvo
2,611
5873
# Lint as: python3 # Copyright 2020 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 ...
1.960938
2
instmakelib/instmake_toolnames.py
gilramir/instmake
0
5874
<filename>instmakelib/instmake_toolnames.py # Copyright (c) 2010 by Cisco Systems, Inc. """ Manage the tool plugins and use them appropriately. """ import os TOOLNAME_PLUGIN_PREFIX = "toolname" class ToolNameManager: """ToolName plugins have to register with this manager the circumstances under which they wis...
2.40625
2
raiden/tests/integration/long_running/test_stress.py
tirkarthi/raiden
2,101
5875
<gh_stars>1000+ import time from http import HTTPStatus from itertools import count from typing import Sequence import gevent import grequests import pytest import structlog from eth_utils import to_canonical_address from flask import url_for from raiden.api.python import RaidenAPI from raiden.api.rest import APIServ...
1.953125
2
pyabsa/utils/preprocess.py
jackie930/PyABSA
0
5876
# -*- coding: utf-8 -*- # file: preprocess.py # author: jackie # Copyright (C) 2021. All Rights Reserved. import os import pandas as pd import argparse import emoji import re from sklearn.model_selection import train_test_split parser = argparse.ArgumentParser() parser.add_argument("--inpath", type=str, required=True...
2.71875
3
apps/06_lolcat_factory/you_try/PRD/cat_service.py
dparito/10Apps-Python_w-Andy
1
5877
import os import shutil import requests def get_cat(folder, name): url = "http://consuming-python-services-api.azurewebsites.net/cats/random" data = get_data_from_url(url) save_image(folder, name, data) def get_data_from_url(url): response = requests.get(url, stream=True) return response.raw ...
3.171875
3
dask/dataframe/io/hdf.py
TryTestspace/dask
1
5878
<filename>dask/dataframe/io/hdf.py from __future__ import absolute_import, division, print_function from fnmatch import fnmatch from glob import glob import os import uuid from warnings import warn import pandas as pd from toolz import merge from .io import _link from ...base import get_scheduler from ..core import ...
2.453125
2
src/charma/media_info/manager.py
mononobi/charma-server
1
5879
# -*- coding: utf-8 -*- """ media info manager module. """ from pyrin.core.mixin import HookMixin from pyrin.core.structs import Manager import pyrin.utils.path as path_utils from charma.media_info import MediaInfoPackage from charma.media_info.interface import AbstractMediaInfoProvider from charma.media_info.except...
2.203125
2
tests/test_parsers.py
FlorisHoogenboom/BoxRec
5
5880
import unittest from boxrec.parsers import FightParser class MockResponse(object): def __init__(self, content, encoding, url): self.content= content self.encoding = encoding self.url = url class TestFightParser(unittest.TestCase): def setUp(self): with open('mock_data/fights/...
3.109375
3
hyperdock/common/workqueue.py
ErikGartner/hyperdock
8
5881
<filename>hyperdock/common/workqueue.py<gh_stars>1-10 from datetime import datetime, timedelta from bson.objectid import ObjectId WORK_TIMEOUT = 600 class WorkQueue: """ A simple MongoDB priority work queue that handles the queue of experiment. """ def __init__(self, mongodb): super()._...
2.5625
3
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/apache_libcloud-0.15.1-py2.7.egg/libcloud/test/test_connection.py
poojavade/Genomics_Docker
1
5882
<gh_stars>1-10 # -*- 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 the Apache License, Version...
2.125
2
igibson/utils/data_utils/ext_object/scripts/step_1_visual_mesh.py
mamadbiabon/iGibson
360
5883
<reponame>mamadbiabon/iGibson<filename>igibson/utils/data_utils/ext_object/scripts/step_1_visual_mesh.py import os import sys import bpy script_dir = os.path.dirname(os.path.abspath(__file__)) utils_dir = os.path.join(script_dir, "../../blender_utils") sys.path.append(utils_dir) from utils import bake_model, clean_u...
1.898438
2
ceilometerclient/common/base.py
mail2nsrajesh/python-ceilometerclient
0
5884
# Copyright 2012 OpenStack Foundation # 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 requ...
2.0625
2
lib/charms/layer/azure.py
freyes/charm-azure-integrator
0
5885
<reponame>freyes/charm-azure-integrator import json import os import re import subprocess from base64 import b64decode from enum import Enum from math import ceil, floor from pathlib import Path from urllib.error import HTTPError from urllib.request import urlopen import yaml from charmhelpers.core import hookenv fro...
1.742188
2
Assignment-1/Code/server3.py
pankajk22/Computer-Networks-Assignments
0
5886
import socket import csv import traceback import threading s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) usrpass={} def openfile(): filename="login_credentials.csv" with open(filename,'r')as csvfile: csv_file = csv.reader(csvfile, delimiter=",") for col in csv_file: usrpas...
2.953125
3
research/utils/_check_pipelines.py
joaopfonseca/research
1
5887
from itertools import product from sklearn.base import clone from sklearn.preprocessing import FunctionTransformer from sklearn.model_selection import ParameterGrid from imblearn.pipeline import Pipeline from rlearn.utils import check_random_states def check_pipelines(objects_list, random_state, n_runs): """Extra...
2.359375
2
mushroom_rl/utils/plots/common_plots.py
PuzeLiu/mushroom-rl
344
5888
from mushroom_rl.utils.plots import PlotItemBuffer, DataBuffer from mushroom_rl.utils.plots.plot_item_buffer import PlotItemBufferLimited class RewardPerStep(PlotItemBuffer): """ Class that represents a plot for the reward at every step. """ def __init__(self, plot_buffer): """ Constr...
2.9375
3
libs/python-daemon-2.2.0/test/test_metadata.py
helion-security/helion
1
5889
<reponame>helion-security/helion # -*- coding: utf-8 -*- # # test/test_metadata.py # Part of ‘python-daemon’, an implementation of PEP 3143. # # This is free software, and you are welcome to redistribute it under # certain conditions; see the end of this file for copyright # information, grant of license, and disclaime...
2.421875
2
objectModel/Python/cdm/persistence/cdmfolder/types/purpose_reference.py
wheatdog/CDM
0
5890
<reponame>wheatdog/CDM # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. from typing import Union, List from .purpose import * from .trait_reference import TraitReference from cdm.utilities import JObject class...
1.984375
2
text_preprocessing/normalizer.py
cyberpunk317/inverted_index
9
5891
<filename>text_preprocessing/normalizer.py import re from typing import Union, List import nltk from bs4 import BeautifulSoup class Normalizer: def __init__(self): self.lemmatizer = nltk.stem.WordNetLemmatizer() def normalize(self, x: Union[list, str]) -> List[str]: """ Acce...
3.078125
3
env/lib/python3.7/site-packages/prompt_toolkit/filters/cli.py
MarcoMancha/BreastCancerDetector
2
5892
""" For backwards-compatibility. keep this file. (Many people are going to have key bindings that rely on this file.) """ from __future__ import unicode_literals from .app import * __all__ = [ # Old names. 'HasArg', 'HasCompletions', 'HasFocus', 'HasSelection', 'HasValidationError', 'IsDon...
1.320313
1
genetic/spaces.py
shilpasayura/bk
4
5893
<filename>genetic/spaces.py<gh_stars>1-10 #spaces.py ''' AlgoHack Genetic Algorithm for University Semaster Planning Version 0.03 2018 <NAME> Sh<EMAIL> ''' import xdb def crt_spaces_table(cursor,drop=False): if (drop): sql="DROP TABLE IF EXISTS spaces;" success, count=xdb.runSQL(cursor...
2.640625
3
threaded_remote_pi_camera.py
hyansuper/flask-video-streaming
7
5894
<reponame>hyansuper/flask-video-streaming import urllib.request import cv2 import numpy as np import time import threading class ThreadedRemotePiCamera: def __init__(self, pi_address, resolution=(320,240), framerate=10, hflip=False, vflip=False): if hflip and vflip: self.flip = -1 elif ...
2.796875
3
scheduler/misc/Ec2SpotCustomScheduler_jan19.py
jalawala/custom-kubernetes-scheduler
4
5895
#! /usr/bin/python3 import time import random import json import os from pprint import pprint from kubernetes.client.rest import ApiException from pint import UnitRegistry from collections import defaultdict from kubernetes import client, config, watch from timeloop import Timeloop from datetime import timedelt...
2.046875
2
local/utils/validate_label_locale.py
DewiBrynJones/docker-deepspeech-cy
3
5896
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from clean_transcript import clean_transcript ALPHABET_FILE_PATH = "/DeepSpeech/bin/bangor_welsh/alphabet.txt" def validate_label(label): clean = clean_transcript(ALPHABET_FILE_PATH) cleaned, transcript = clean.clean(label) if cleaned: return transc...
3.015625
3
src/models/nn/adaptive_softmax.py
dumpmemory/state-spaces
513
5897
# Copyright (c) 2019-2020, NVIDIA CORPORATION. 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...
1.726563
2
the_el/cli.py
CityOfPhiladelphia/the-el
11
5898
import json import csv import sys import os import re import codecs import logging from logging.config import dictConfig import click import yaml from sqlalchemy import create_engine from jsontableschema_sql import Storage from smart_open import smart_open from . import postgres from . import carto csv.field_size_li...
2.296875
2
examples/asr/experimental/speech_to_text_sclite.py
vadam5/NeMo
2
5899
# Copyright (c) 2020, NVIDIA CORPORATION. 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...
1.84375
2