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
pdiffcopy/hashing.py
xolox/python-pdiffcopy
5
6100
# Fast large file synchronization inspired by rsync. # # Author: <NAME> <<EMAIL>> # Last Change: March 6, 2020 # URL: https://pdiffcopy.readthedocs.io """Parallel hashing of files using :mod:`multiprocessing` and :mod:`pdiffcopy.mp`.""" # Standard library modules. import functools import hashlib import os # External...
2.671875
3
pyscf/nao/test/test_0003_na2_nao.py
robert-anderson/pyscf
3
6101
<filename>pyscf/nao/test/test_0003_na2_nao.py # Copyright 2014-2018 The PySCF Developers. 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/li...
2.015625
2
tests/moz_library/rental_books_test.py
mozkzki/moz-library
0
6102
import pytest from moz_library.rental_books import RentalBooks class TestRentalBooks: @pytest.fixture() def books1(self): return RentalBooks() def test_can_extend_period_1(self, books1): assert books1._can_extend_period("延長できません") is False def test_can_extend_period_2(self, books1): ...
2.671875
3
examples/src/Charts/MultiCategoryChart.py
aspose-slides/Aspose.Slides-for-Python-via-.NET
0
6103
<gh_stars>0 import aspose.pydrawing as drawing import aspose.slides as slides def charts_multi_category_chart(): #ExStart:MultiCategoryChart # The path to the documents directory. outDir = "./examples/out/" with slides.Presentation() as pres: slide = pres.slides[0] ch = pres.slides[0...
2.671875
3
netbox/extras/forms/filtersets.py
cybarox/netbox
0
6104
<reponame>cybarox/netbox<gh_stars>0 from django import forms from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.utils.translation import gettext as _ from dcim.models import DeviceRole, DeviceType, Platform, Region, Site, SiteGroup from extras.choices imp...
1.859375
2
bin/write2cly.py
docdiesel/smartmetertools
1
6105
#!/usr/bin/python3 ## write2cly.py - reads json (generated by sml_reader.py) from stdin ## - writes values to Corlysis time series InfluxDB ## ## Writes data from smart meter to time series database (InfluxDB) ## at Corlysis.com [1]. You need to configure your database and token ## in the config secti...
2.671875
3
dns/rdtypes/ANY/__init__.py
Ashiq5/dnspython
0
6106
<reponame>Ashiq5/dnspython # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the ...
1.421875
1
01_test.py
KhubbatulinMark/DCase2020-Task-2-on-Wigner-Ville-transform
3
6107
<gh_stars>1-10 """ @file 01_test.py @brief Script for test @author <NAME>, <NAME>, and <NAME> (Hitachi Ltd.) Copyright (C) 2020 Hitachi, Ltd. All right reserved. """ ######################################################################## # import default python-library #########################################...
2.109375
2
src/text_split/split.py
i1123581321/word_split
0
6108
<reponame>i1123581321/word_split import argparse import os parser = argparse.ArgumentParser(description="a simple parser") parser.add_argument("filename", type=str) parser.add_argument("lineno", nargs="+", type=int) parser.add_argument("--same_length", action=argparse.BooleanOptionalAction) def main(): args = p...
2.859375
3
src/sentry/models/event.py
Ali-Tahir/sentry
0
6109
<reponame>Ali-Tahir/sentry from __future__ import absolute_import import six import string import warnings import pytz from collections import OrderedDict from dateutil.parser import parse as parse_date from django.db import models from django.utils import timezone from django.utils.translation import ugettext_lazy a...
2.046875
2
Assignment3/src/data/make_nowcast_dataset.py
shikashyam/BigDataSystemsCoursework
0
6110
<gh_stars>0 """ Makes training and test dataset for nowcasting model using SEVIR """ # -*- coding: utf-8 -*- import argparse import logging import os import h5py os.environ["HDF5_USE_FILE_LOCKING"]='FALSE' import sys import numpy as np import tensorflow as tf from nowcast_generator import get_nowcast_test_generator ...
2.234375
2
blender-plugin/import_cast.py
rtasan/ApexCastImporter
0
6111
<filename>blender-plugin/import_cast.py # The Original importer was created by Nick # Copyright (c) 2020 Nick import bpy import bmesh import os import array import math from mathutils import * from bpy_extras.image_utils import load_image from .cast import Cast, Model, Animation, Curve, NotificationTrack, Mesh, Skele...
2.015625
2
study/migrations/0003_auto_20200224_2316.py
hpathipati/Quick-Tutor
0
6112
<gh_stars>0 # Generated by Django 3.0.2 on 2020-02-24 23:16 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('study', '0002_student'), ] operations = [ migrations.AlterField( model_name='student', name='bio', ...
1.484375
1
tests/unit/resources/test_resource.py
gzecchi/oneview-python
0
6113
<reponame>gzecchi/oneview-python<filename>tests/unit/resources/test_resource.py # -*- coding: utf-8 -*- ### # (C) Copyright [2019] Hewlett Packard Enterprise Development LP # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may ob...
1.953125
2
workalendar/usa/colorado.py
vanadium23/workalendar
0
6114
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) from .core import UnitedStates class Colorado(UnitedStates): """Colorado""" # Colorado has only federal state holidays. # NOTE: <NAME> is an optional holiday
1.765625
2
dataloaders/augmentation.py
thierrypin/gei-pool
0
6115
#!/usr/bin/env python # -*- coding: utf-8 -*- import random import numpy as np # Generic data augmentation class Augmenter: """ Generic data augmentation class with chained operations """ def __init__(self, ops=[]): if not isinstance(ops, list): print("Error: ops must be a list of fu...
3.0625
3
cigeo/admin.py
CzechInvest/ciis
1
6116
<reponame>CzechInvest/ciis from django.contrib import admin from django.contrib.gis import geos from leaflet.admin import LeafletGeoAdmin, LeafletGeoAdminMixin from .models import Lau1 from .models import Nuts3 from .models import Airport from .models import Road from .models import PublicTransportStop from .models imp...
2.015625
2
umbra/monitor/main.py
RafaelAPB/umbra
0
6117
import logging import json import asyncio from google.protobuf import json_format from umbra.common.protobuf.umbra_grpc import MonitorBase from umbra.common.protobuf.umbra_pb2 import Instruction, Snapshot from umbra.monitor.tools import Tools logger = logging.getLogger(__name__) logging.getLogger("hpack").setLevel(...
1.960938
2
pycs/spells/hunters_mark.py
dwagon/pycs
0
6118
<filename>pycs/spells/hunters_mark.py """https://www.dndbeyond.com/spells/hunters-mark""" from unittest.mock import patch import dice from pycs.constant import ActionCategory from pycs.constant import SpellType from pycs.creature import Creature from pycs.effect import Effect from pycs.gear import Shortbow from pycs.s...
2.5625
3
utilities.py
armandok/pySLAM-D
10
6119
import numpy as np def rot_to_angle(rot): return np.arccos(0.5*np.trace(rot)-0.5) def rot_to_heading(rot): # This function calculates the heading angle of the rot matrix w.r.t. the y-axis new_rot = rot[0:3:2, 0:3:2] # remove the mid row and column corresponding to the y-axis new_rot = new_rot/np.li...
3.15625
3
robosuite/models/grippers/__init__.py
kyungjaelee/robosuite
397
6120
<reponame>kyungjaelee/robosuite<gh_stars>100-1000 from .gripper_model import GripperModel from .gripper_factory import gripper_factory from .gripper_tester import GripperTester from .panda_gripper import PandaGripper from .rethink_gripper import RethinkGripper from .robotiq_85_gripper import Robotiq85Gripper from .rob...
1.921875
2
src/pose/visualizations/visualizations.py
Idein/chainer-hand-pose
11
6121
import logging logger = logging.getLogger(__name__) import random import chainercv import numpy as np from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D # NOQA from pose.hand_dataset.geometry_utils import normalize_joint_zyx from pose.hand_dataset.image_utils import normalize_depth # Dec...
2.25
2
publication-erdf/flask_service.py
ticapix/automated-tasks
0
6122
<reponame>ticapix/automated-tasks<gh_stars>0 #!/usr/bin/env python3 from flask import Flask app = Flask(__name__) @app.route('/process-email') def process_email(): return "Hello World!" if __name__ == "__main__": app.run()
1.703125
2
tools/nn/speaker.py
mikiec84/speaking_detection
0
6123
import os import skimage.io from torch.nn import Module import torch.nn from torchvision.models import resnet18 from nn.speaker_dataset import Dataset # @UnusedImport os.environ['TORCH_MODEL_ZOO'] = '../data/' VIDTIMIT_PATH = '../data/vidtimit/' skimage.io.use_plugin('pil') class Net(Module): def __init__(s...
2.4375
2
tensorflow_model_analysis/util_test.py
mdreves/model-analysis
0
6124
<reponame>mdreves/model-analysis # Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
2.109375
2
laia/data/transforms/vision/random_beta_morphology.py
eivtho/PyLaia
89
6125
from typing import List, Tuple, Union import numpy as np import scipy.special from PIL import Image, ImageFilter class RandomBetaMorphology: def __init__( self, filter_size_min: int, filter_size_max: int, alpha: float, beta: float ) -> None: assert filter_size_min % 2 != 0, "Filter size must ...
2.5625
3
hemp/internal/utils.py
Addvilz/hemp
1
6126
<gh_stars>1-10 import sys from fabric.utils import error, puts from git import RemoteProgress def print_err(message, func=None, exception=None, stdout=None, stderr=None): error('[Hemp] ' + message, func, exception, stdout, stderr) def print_info(text, show_prefix=None, end="\n", flush=True): puts('[Hemp] '...
2.578125
3
backend/links/sentence.py
dla1635/hyLink
1
6127
<reponame>dla1635/hyLink<gh_stars>1-10 # -*- coding: utf-8 -*- from collections import Counter from konlpy.tag import Okt class Sentence(object): okt = Okt() def __init__(self, text, index=0): self.index = index self.text = text.strip() self.tokens = self.okt.phrases(self.text) ...
2.765625
3
tests/arch/x86/test_x86parser.py
IMULMUL/barf-project
1,395
6128
# Copyright (c) 2014, Fundacion Dr. <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: # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and...
1.695313
2
Concurrency/codeSample/Part4_Thread_Synchronuzation_Primitives/sema_signal.py
Chyi341152/pyConPaper
1
6129
<reponame>Chyi341152/pyConPaper #!/usr/bin/env python3 # -*- coding:utf-8 -*- # sema_signal.py # # An example of using a semaphore for signaling between threads import threading import time done = threading.Semaphore(0) # Resource control. item = None def producer(): global item print("I'm the pro...
4.5625
5
temp_wc_analysis/analysis.py
KarrLab/wc_sim
8
6130
'''Analysis utility functions. :Author: <NAME> <<EMAIL>> :Date: 2016-03-26 :Copyright: 2016-2018, Karr Lab :License: MIT ''' # TODO(Arthur): IMPORTANT: refactor and replace from matplotlib import pyplot from matplotlib import ticker from wc_lang import Model, Submodel from scipy.constants import Avogadro import nump...
2.171875
2
setup.py
bstuddard/bonsai
26
6131
<gh_stars>10-100 from setuptools import setup, find_packages with open("README.md", "r") as readme_file: readme = readme_file.read() requirements = [ 'xgboost>=0.90', 'catboost>=0.26', 'bayesian-optimization>=1.2.0', 'numpy>=1.19.5', 'pandas>=1.1.5', 'matplotlib>=3.2.2', 'seaborn>=0.11...
1.320313
1
_scripts/increment_version.py
clockhart/pathogen
0
6132
<gh_stars>0 """ increment_version.py written in Python3 author: <NAME> <<EMAIL>> """ import yaml # Read in version with open('version.yml', 'r') as f: version = yaml.safe_load(f.read()) # Strip "dev" out of micro version['micro'] = int(str(version['micro']).replace('dev', '')) # Update patch version['micro'] +...
2.265625
2
holoviews/core/data/ibis.py
TheoMathurin/holoviews
1
6133
<gh_stars>1-10 import sys import numpy try: from collections.abc import Iterable except ImportError: from collections import Iterable from .. import util from ..element import Element from ..ndmapping import NdMapping, item_check, sorted_context from .interface import Interface from . import pandas from .util...
1.953125
2
chess/models/tournament.py
S0Imyr/Projet-4
0
6134
# -*- coding: utf-8 -*- """ Handles the tournament logic """ import datetime from chess.utils.utils import get_new_id from chess.models.actors import Player from chess.models.round import Round TOURNAMENT_ID_WIDTH = 8 NB_ROUND = 4 NB_PLAYERS = 8 NB_MATCH = 4 class Tournament: """ The class Tournament is t...
3.1875
3
set-config.py
astubenazy/vrops-metric-collection
2
6135
# !/usr/bin python """ # # set-config - a small python program to setup the configuration environment for data-collect.py # data-collect.py contain the python program to gather Metrics from vROps # Author <NAME> <<EMAIL>> # """ # Importing the required modules import json import base64 import os,sys # Getting the ...
2.609375
3
tests/test_app.py
inmanta/inmanta-core
6
6136
<reponame>inmanta/inmanta-core """ Copyright 2018 Inmanta 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.242188
1
AtC_Beg_Con_021-030/ABC027/C.py
yosho-18/AtCoder
0
6137
n = int(input()) row = 0 for i in range(100): if 2 ** i <= n <= 2 ** (i + 1) - 1: row = i break def seki(k, n): for _ in range(n): k = 4 * k + 2 return k k = 0 if row % 2 != 0: k = 2 cri = seki(k, row // 2) if n < cri: print("Aoki") else: print("Ta...
3.078125
3
extplugins/codvote.py
Desi-Boyz/cod4x-server-B3-configs
1
6138
# CoDVote plugin for BigBrotherBot(B3) (www.bigbrotherbot.net) # Copyright (C) 2015 ph03n1x # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your optio...
2.03125
2
utils.py
bianan/cfl
4
6139
<gh_stars>1-10 # Copyright 2018 Google 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...
2.0625
2
unittest/scripts/py_devapi/scripts/mysqlx_collection_remove.py
mueller/mysql-shell
119
6140
# Assumptions: validate_crud_functions available # Assumes __uripwd is defined as <user>:<pwd>@<host>:<plugin_port> from __future__ import print_function from mysqlsh import mysqlx mySession = mysqlx.get_session(__uripwd) ensure_schema_does_not_exist(mySession, 'js_shell_test') schema = mySession.create_schema('js_s...
2.171875
2
indian-flag.py
aditya270520/indian-flag
0
6141
<gh_stars>0 import turtle turtle.bgcolor('black') wn=turtle.Screen() tr=turtle.Turtle() move=1 tr.speed("fastest") for i in range (360): tr.write("ADITYA",'false','center',font=('Showcard gothic',50)) tr.penup() tr.goto(-200,100) tr.pendown() tr.color("orange") tr.right(move) tr.forward...
3.109375
3
leaf/rbac/model/__init__.py
guiqiqi/leaf
119
6142
"""用户, 组, 及相关认证数据库模型""" from .group import Group from .user import User from .user import UserIndex from .auth import Authentication from .accesspoint import AccessPoint
1.4375
1
programacao basica/7.py
m-brito/Neps-Academy
0
6143
bino = int(input()) cino = int(input()) if (bino+cino)%2==0: print("Bino") else: print("Cino")
3.8125
4
update_readme.py
CalmScout/LeetCode
0
6144
""" Script updates `README.md` with respect to files at ./easy and ./medium folders. """ import os curr_dir = os.path.dirname(__file__) with open(os.path.join(curr_dir, "README.md"), 'w') as readme: readme.write("# LeetCode\nDeliberate practice in coding.\n") langs = [l for l in os.listdir(curr_dir) if os.path...
2.703125
3
scripts/biotimesql.py
Jay-Iam/retriever
0
6145
# -*- coding: utf-8 -*- #retriever import csv from pkg_resources import parse_version from retriever.lib.models import Table from retriever.lib.templates import Script try: from retriever.lib.defaults import VERSION try: from retriever.lib.tools import open_fr, open_fw, open_csvw except ImportEr...
2.25
2
alipay/aop/api/domain/KbAdvertSettleBillResponse.py
snowxmas/alipay-sdk-python-all
213
6146
<filename>alipay/aop/api/domain/KbAdvertSettleBillResponse.py #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class KbAdvertSettleBillResponse(object): def __init__(self): self._download_url = None self._paid_date = None @proper...
2.234375
2
day5.py
PLCoster/adventofcode2019
1
6147
# -*- coding: utf-8 -*- """ Created on Mon Dec 2 11:06:59 2019 @author: Paul """ def read_data(filename): """ Reads csv file into a list, and converts to ints """ data = [] f = open(filename, 'r') for line in f: data += line.strip('\n').split(',') ...
3.734375
4
textvis/textprizm/models.py
scclab/textvisdrg-prototype
0
6148
from django.db import models # Create your models here. class Schema(models.Model): name = models.CharField(max_length=200) description = models.TextField() class Code(models.Model): name = models.CharField(max_length=200) description = models.TextField() active_instances = models.Posit...
2.609375
3
test/test_purchasing.py
jacob22/accounting
0
6149
<gh_stars>0 # -*- coding: utf-8 -*- # Copyright 2019 Open End AB # # 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 appl...
1.992188
2
iot/downstream/fog_processes.py
SENERGY-Platform/senergy-connector
0
6150
""" Copyright 2020 InfAI (CC SES) 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...
1.804688
2
django_project/user_profile/migrations/0003_order_payment_method.py
aliyaandabekova/DJANGO_PROJECT
0
6151
# Generated by Django 3.2.3 on 2021-05-27 13:34 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('user_profile', '0002_auto_20210526_1747'), ] operations = [ migrations.AddField( model_name='order', name='payment_m...
1.882813
2
day07/test.py
mpirnat/aoc2016
0
6152
<reponame>mpirnat/aoc2016 #!/usr/bin/env python import unittest from day07 import has_abba, get_abba_allowed_strings, get_abba_disallowed_strings from day07 import supports_tls, count_tls_addresses from day07 import find_abas, supports_ssl, count_ssl_addresses class TestFindingABBASequences(unittest.TestCase): c...
2.359375
2
rlnets/PG.py
HTRPOCODES/HTRPO-v2
7
6153
<reponame>HTRPOCODES/HTRPO-v2<gh_stars>1-10 import torch import numpy as np import torch.nn.functional as F from torch.autograd import Variable from basenets.MLP import MLP from basenets.Conv import Conv from torch import nn class FCPG_Gaussian(MLP): def __init__(self, n_inputfeats, ...
1.992188
2
tensorflow/python/kernel_tests/sparse_tensors_map_ops_test.py
m4rkl1u/tensorflow
2
6154
# Copyright 2015 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...
1.8125
2
cloudroast/objectstorage/smoke/object_smoke.py
RULCSoft/cloudroast
0
6155
<filename>cloudroast/objectstorage/smoke/object_smoke.py """ Copyright 2015 Rackspace 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...
1.828125
2
ceph/tests/conftest.py
remicalixte/integrations-core
1
6156
<reponame>remicalixte/integrations-core # (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import os import pytest from datadog_checks.dev import docker_run from datadog_checks.dev.conditions import CheckDockerLogs from datadog_checks.dev.subprocess imp...
1.65625
2
federation/hostmeta/fetchers.py
weex/federation
93
6157
import json from typing import Dict, Optional import requests from federation.hostmeta.parsers import ( parse_nodeinfo_document, parse_nodeinfo2_document, parse_statisticsjson_document, parse_mastodon_document, parse_matrix_document, parse_misskey_document) from federation.utils.network import fetch_document ...
2.421875
2
features/analysis_features.py
iag0g0mes/t2_fis_driving_style
5
6158
<gh_stars>1-10 import numpy as np from typing import Any, Dict, List, Tuple, NoReturn import argparse import os def parse_arguments() -> Any: """Parse command line arguments.""" parser = argparse.ArgumentParser() parser.add_argument( "--data_dir", default="", type=str, help="Directory where the feature...
2.515625
3
python-watcher-2.0.0/watcher/tests/notifications/test_service_notifications.py
scottwedge/OpenStack-Stein
0
6159
# -*- encoding: utf-8 -*- # Copyright (c) 2017 Servionica # # 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 l...
1.804688
2
leetcode/medium/best-time-to-buy-and-sell-stock-ii.py
rainzhop/cumulus-tank
0
6160
# https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/ # # Say you have an array for which the ith element is the price of a given stock on day i. # # Design an algorithm to find the maximum profit. # You may complete as many transactions as you like (ie, buy one and sell one share of the stock multiple ti...
3.859375
4
django_loci/tests/base/test_admin.py
yashikajotwani12/django-loci
205
6161
<filename>django_loci/tests/base/test_admin.py import json import os import responses from django.urls import reverse from .. import TestAdminMixin, TestLociMixin class BaseTestAdmin(TestAdminMixin, TestLociMixin): geocode_url = 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/' def tes...
2.34375
2
dca_models/deform_offsets_module.py
vatsalag99/Deformable-Channel-Attention
1
6162
import torch from torch import nn from torch.nn.parameter import Parameter from einops import rearrange, reduce, repeat class dca_offsets_layer(nn.Module): """Constructs a Offset Generation module. """ def __init__(self, channel, n_offsets): super(dca_offsets_layer, self).__init__() self....
2.453125
2
tests/__init__.py
egor43/PyImageComparsion
0
6163
from . import test_helpers from . import test_image_opener from . import test_image_metrick from . import test_compare_tools from . import test_compare_api
0.980469
1
core/urls.py
donnellan0007/blog
0
6164
<filename>core/urls.py from django.contrib import admin from django.urls import path from .views import index, email, post_detail, posts, hot_takes, take_detail from . import views app_name = "core" urlpatterns = [ path('',views.index,name="index"), path('email/',views.email,name="email"), path('post/<slu...
1.765625
2
griddy/__init__.py
pgolding/pandas-grid
1
6165
<reponame>pgolding/pandas-grid from .grid import render_table
1.164063
1
utils/dbconn.py
iamvishnuks/Xmigrate
4
6166
from mongoengine import * from dotenv import load_dotenv from os import getenv from cassandra.cluster import Cluster from cassandra.auth import PlainTextAuthProvider from cassandra.cqlengine import connection from cassandra.cqlengine.management import sync_table from cassandra.query import ordered_dict_factory from mod...
2.140625
2
src/syft/lib/__init__.py
godormad/PySyft
0
6167
<reponame>godormad/PySyft # stdlib import importlib import sys from typing import Any from typing import Any as TypeAny from typing import Dict as TypeDict from typing import Optional # third party from packaging import version # syft relative from ..ast.globals import Globals from ..lib.python import create_python_a...
1.984375
2
scripts/griffin_GC_counts.py
GavinHaLab/Griffin
1
6168
#!/usr/bin/env python # coding: utf-8 # In[ ]: import pysam import os import pandas as pd import numpy as np import time import argparse import sys from multiprocessing import Pool # In[ ]: # ##arguments for testing # bam_file_path = '/fh/scratch/delete90/ha_g/realigned_bams/cfDNA_MBC_ULP_hg38/realign_bam_pa...
1.898438
2
task2/04-task2-upload-dim-tables.py
canovasjm/InterviewProject_JuanCanovas
0
6169
<reponame>canovasjm/InterviewProject_JuanCanovas #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Mar 1 18:17:07 2021 @author: jm """ # %% required libraries import numpy as np import pandas as pd from sqlalchemy import create_engine # %% connect to DB # create connection using pymssql engine = cr...
2.828125
3
cogs/server.py
vikasbaghel1001/Kanna-Chan
5
6170
import discord from discord.ext import commands arrow = "<a:right:877425183839891496>" kwee = "<:kannawee:877036162122924072>" kdance = "<a:kanna_dance:877038778798207016>" kbored = "<:kanna_bored:877036162827583538>" ksmug = "<:kanna_smug:877038777896427560>" heart = "<a:explosion_heart:877426228775227392>" class Se...
2.5625
3
test/run/t344.py
timmartin/skulpt
2,671
6171
for ch in "Hello world!": d = ord(ch) h = hex(d) o = oct(d) b = bin(d) print ch, d, h, o, b
3.390625
3
paho/mqtt/subscribe.py
RandomGamer342/TTM4115-plantsensor
8
6172
<gh_stars>1-10 # Copyright (c) 2016 <NAME> <<EMAIL>> # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # and Eclipse Distribution License v1.0 which accompany this distribution. # # The Eclipse Public License is available at # ...
2.5
2
py/2017/day24/aoc_day_24.py
cs-cordero/advent-of-code
0
6173
<gh_stars>0 from collections import defaultdict def solution(): starting_components = d[0] best_scores = [] for component in starting_components: n_a, n_b = get_ports(component) nxt_port = n_a if n_b == 0 else n_b best_scores.append(recurse(component, set(), nxt_port, 0)) print...
2.640625
3
scratchnet/scratchnet.py
Gr1m3y/scratchnet
0
6174
import numpy as np import network def main(): x = np.array([2, 3]) nw = network.NeuralNetwork() print(nw.feedforward(x)) if __name__ == "__main__": main()
3.140625
3
live-plotting.py
rmhsawyer/EC601-Final-Project-Mapping_User_Face_To_Emoji
0
6175
<reponame>rmhsawyer/EC601-Final-Project-Mapping_User_Face_To_Emoji #draw the predictions from real-time.py import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib import style style.use('fivethirtyeight') fig = plt.figure() ax1 = fig.add_subplot(1,1,1) def animate(i): graph_data ...
3.21875
3
code/run_policy.py
kirk86/ARS
0
6176
<reponame>kirk86/ARS """ Code to load a policy and generate rollout data. Adapted from https://github.com/berkeleydeeprlcourse. Example usage: python run_policy.py ../trained_policies/Humanoid-v1/policy_reward_11600/lin_policy_plus.npz Humanoid-v1 --render \ --num_rollouts 20 """ import numpy as np imp...
2.9375
3
src/poliastro/plotting/tisserand.py
TreshUp/poliastro
0
6177
""" Generates Tisserand plots """ from enum import Enum import numpy as np from astropy import units as u from matplotlib import pyplot as plt from poliastro.plotting._base import BODY_COLORS from poliastro.twobody.mean_elements import get_mean_elements from poliastro.util import norm class TisserandKind(Enum): ...
2.953125
3
libs/Rack.py
jlin/inventory
22
6178
from KeyValueTree import KeyValueTree from truth.models import KeyValue as TruthKeyValue, Truth from systems.models import KeyValue as KeyValue from django.test.client import RequestFactory from api_v2.keyvalue_handler import KeyValueHandler import json factory = RequestFactory() class Rack: rack_name = None ...
2.203125
2
r2c_isg/functions/__init__.py
returntocorp/inputset-generator
3
6179
from .trim import trim from .sample import sample from .sort import sort function_map = { 'trim': trim, 'sample': sample, 'sort': sort }
1.664063
2
__init__.py
csalyk/nirspec
0
6180
from .nirspec import divspec from .nirspec import gluespec
0.9375
1
poem.py
xcollantes/poetry-generator
0
6181
from __future__ import absolute_import from __future__ import print_function import datetime import os import random import sys import uuid import base64 import yaml import re try: import en except: print("DOWNLOD NODECUBE") print("""wget https://www.nodebox.net/code/data/media/linguistics.zip unzip lingui...
2.625
3
openstack/tests/unit/block_storage/v2/test_proxy.py
infonova/openstacksdk
0
6182
# 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 writing, software # distributed under t...
1.9375
2
src/ncstyler/console.py
starofrainnight/ncstyler
0
6183
<reponame>starofrainnight/ncstyler<gh_stars>0 #!/usr/bin/env python import argparse import CppHeaderParser import re import sys import yaml import copy import six import os.path import traceback class CppDefine(dict): def __init__(self): self["name"] = None self["parameters"] = [] self["li...
2.640625
3
theone/wsgi/server.py
laozijiaojiangnan/TheOne
0
6184
<gh_stars>0 import typing as t from http.server import HTTPServer, BaseHTTPRequestHandler from . import response as resp class WsgiServer(HTTPServer): pass class WsgiHandel(BaseHTTPRequestHandler): def handle(self) -> None: handle_response = SimpleHandler(self.wfile) handle_response.send()...
2.75
3
pytorch_translate/attention/multihead_attention.py
dzhulgakov/translate
1
6185
<filename>pytorch_translate/attention/multihead_attention.py #!/usr/bin/env python3 from fairseq.modules import multihead_attention as fair_multihead from pytorch_translate.attention import ( BaseAttention, attention_utils, register_attention, ) @register_attention("multihead") class MultiheadAttention(...
2.625
3
custom_components/purrsong/__init__.py
RobertD502/home-assistant-lavviebot
3
6186
"""Support for Purrsong LavvieBot S""" import asyncio import logging import voluptuous as vol from lavviebot import LavvieBotApi import homeassistant.helpers.config_validation as cv from homeassistant import config_entries from homeassistant.const import EVENT_HOMEASSISTANT_STOP from homeassistant.exceptions import Co...
2.125
2
MathPainting_OOP/shapes.py
matbocz/kurs-python-udemy
0
6187
class Rectangle: """A rectangle shape that can be drawn on a Canvas object""" def __init__(self, x, y, width, height, color): self.x = x self.y = y self.width = width self.height = height self.color = color def draw(self, canvas): """Draws itself into the Ca...
4.09375
4
problems/Kelvin_Helmholtz/problem.py
sddyates/mars
1
6188
from mars import main_loop import numpy as np from mars.settings import * class Problem: """ Synopsis -------- User class for the Kelvin-Helmholtz instability Args ---- None Methods ------- initialise Set all variables in each cell to initialise the simulation. i...
2.703125
3
pythainlp/util/thai.py
korkeatw/pythainlp
0
6189
# -*- coding: utf-8 -*- """ Check if it is Thai text """ import string _DEFAULT_IGNORE_CHARS = string.whitespace + string.digits + string.punctuation def isthaichar(ch: str) -> bool: """ Check if a character is Thai เป็นอักษรไทยหรือไม่ :param str ch: input character :return: True or False "...
4.1875
4
Numpy/tempCodeRunnerFile.py
zharmedia386/Data-Science-Stuff
0
6190
<reponame>zharmedia386/Data-Science-Stuff print(b) print(c) print(d) print(e) print(f) print(g)
1.304688
1
Python/Filter.py
KilroyWasHere-cs-j/savitzky-golay
0
6191
import numpy as np from scipy.signal import savgol_filter import matplotlib.pyplot as plt import MadDog x = [] y = [] def generate(): # Generate random data base = np.linspace(0, 5, 11) # base = np.random.randint(0, 10, 5) outliers = np.random.randint(10, 20, 2) data = np.concatenate((base, outli...
2.765625
3
examples/adwords/v201406/advanced_operations/add_ad_customizer.py
dietrichc/streamline-ppc-reports
0
6192
#!/usr/bin/python # # Copyright 2014 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 b...
2.4375
2
tests/test_minhash.py
azachar/pyminhash
0
6193
import pytest from pyminhash import MinHash from pyminhash.datasets import load_data def test__sparse_vector(): df = load_data() myMinHasher = MinHash(10) res = myMinHasher._sparse_vectorize(df, 'name') assert res.columns.tolist() == ['name', 'sparse_vector'] assert res['sparse_vector'].dtype == ...
2.3125
2
settings.py
danylo-dudok/youtube-rss
0
6194
from datetime import datetime, timedelta from typing import final from tools import localize_time RSS_URL_PREFIX: final = 'https://www.youtube.com/feeds/videos.xml?channel_id={0}' LOCATION_ARGUMENT_PREFIX: final = '--location=' CHANNEL_ARGUMENT_PREFIX: final = '--channels=' LAST_CHECK_ARGUMENT_PREFIX: final = '--last...
2.390625
2
openpicle/caravel.py
DX-MON/OpenPICle
0
6195
# SPDX-License-Identifier: BSD-3-Clause from amaranth import Elaboratable, Module, Signal, ResetInserter, EnableInserter __all__ = ( 'PIC16Caravel', ) class PIC16Caravel(Elaboratable): def elaborate(self, platform): from .pic16 import PIC16 from .soc.busses.qspi import QSPIBus m = Module() reset = Signal() ...
2.0625
2
cogs/stats.py
est73/raid-shack
0
6196
<reponame>est73/raid-shack<gh_stars>0 from discord.ext import commands import discord class Stats(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command() @commands.has_permissions(manage_channels=True) async def stats(self, ctx): members = await ctx.guild.fetch_mem...
2.328125
2
tests/bucket/test_bucket.py
WillChilds-Klein/mistress-mapreduce
2
6197
from mrs.bucket import WriteBucket from mrs import BinWriter, HexWriter def test_writebucket(): b = WriteBucket(0, 0) b.addpair((4, 'test')) b.collect([(3, 'a'), (1, 'This'), (2, 'is')]) values = ' '.join(value for key, value in b) assert values == 'test a This is' b.sort() values = ' '.j...
2.15625
2
inquire/agents/dempref.py
HARPLab/inquire
0
6198
<reponame>HARPLab/inquire """ An agent which uses demonstrations and preferences. Code adapted from Learning Reward Functions by Integrating Human Demonstrations and Preferences. """ import itertools import os import time from pathlib import Path from typing import Dict, List import arviz as az from inquire.agents.a...
2.703125
3
coba/learners/__init__.py
mrucker/banditbenchmark
1
6199
<reponame>mrucker/banditbenchmark<gh_stars>1-10 """This module contains all public learners and learner interfaces.""" from coba.learners.primitives import Learner, SafeLearner from coba.learners.bandit import EpsilonBanditLearner, UcbBanditLearner, FixedLearner, RandomLearner from coba.learners.corral import ...
1.460938
1