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
datastructures/binarytree.py
tkaleas/python-sandbox
0
29900
class Node(object): def __init__(self, value): self.value = value self.left = None self.right = None #Binary Tree class BinaryTree(object): def __init__(self, root): self.root = Node(root) def search(self, find_val): """Return True if the value is in the tre...
4.21875
4
cs15211/StoneGame.py
JulyKikuAkita/PythonPrac
1
29901
<gh_stars>1-10 __source__ = 'https://leetcode.com/problems/stone-game/' # Time: O() # Space: O() # # Description: Leetcode # 877. Stone Game # # Alex and Lee play a game with piles of stones. # There are an even number of piles arranged in a row, # and each pile has a positive integer number of stones piles[i]. # # Th...
3.75
4
project_pawz/sponsorships/apps.py
rlaneyjr/project_pawz
0
29902
from django.apps import AppConfig class SponsorshipsAppConfig(AppConfig): name = 'project_pawz.sponsorships' verbose_name = "Sponsorships"
1.164063
1
assignment_solutions/6/is_all_upper.py
dannymeijer/level-up-with-python
0
29903
<reponame>dannymeijer/level-up-with-python import re only_letters = re.compile("[a-zA-Z]") def is_all_upper(text: str) -> bool: # check if text has actual content has_no_content = len(only_letters.findall(text)) == 0 return False if has_no_content else text.upper() == text if __name__ == '__main__': ...
4.3125
4
osm/GeoFabrikSpider.py
TheGreatRefrigerator/openpoiservice
0
29904
<gh_stars>0 # sudo scrapy runspider GeoFabrikSpider.py import scrapy import os import urlparse from scrapy.selector import Selector import subprocess from time import sleep class GeoFabrikSpider(scrapy.Spider): name = "geofabrik_spider" start_urls = ['https://download.geofabrik.de/'] def parse(self, res...
2.6875
3
tests/basic.py
mkindahl/mysql-replicant-python
0
29905
# Copyright (c) 2010, <NAME>, <NAME>, and <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # notice, this lis...
1.492188
1
routa/test_levenshtein.py
piglaker/SpecialEdition
2
29906
<filename>routa/test_levenshtein.py def iterative_levenshtein(string, target, costs=(1, 1, 1)): """ piglaker modified version : return edits iterative_levenshtein(s, t) -> ldist ldist is the Levenshtein distance between the strings s and t. For all i and j, di...
3.65625
4
loggo2/__init__.py
bitpanda-labs/loggo2
6
29907
from ._loggo2 import JsonLogFormatter, LocalLogFormatter, Loggo # noqa: F401 __version__ = "10.1.2" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT
1.28125
1
aoc/day11/__init__.py
scorphus/advent-of-code-2020
9
29908
<filename>aoc/day11/__init__.py #!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of Advent of Code 2020 # https://github.com/scorphus/advent-of-code-2020 # Licensed under the BSD-3-Clause license: # https://opensource.org/licenses/BSD-3-Clause # Copyright (c) 2020, <NAME> <<EMAIL>> from aoc import s...
2.796875
3
analyses/ParamAnalyzer.py
ThinkNaive/Matrix-Vector-Multiplication
0
29909
<reponame>ThinkNaive/Matrix-Vector-Multiplication<gh_stars>0 # coding=utf-8 import matplotlib.pyplot as plt import numpy as np if __name__ == '__main__': rows = [10000] col = 10000 iteration = 10 params = [ {'id': '01', 'strategy': 'rep', 'p': 10, 'repNum': 1}, {'id': '02', 'strategy': ...
2.28125
2
MsgRoute/myBackend.py
zhouli1014/OurGame
3
29910
#!/usr/bin/env python import sys, time from backend import daemon import itchat import time from ipcqueue import posixmq import logging import datetime as dt import threading import time logFileDir = "/opt/crontab/IpcToItchat/" nowDateTime = dt.datetime.now().strftime('%Y%m%d%H%M%S') pyFilename = sys.argv[0].split('/...
2.1875
2
mlbgame/data/people.py
trevor-viljoen/mlbgame3
6
29911
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """mlbgame functions for the people API endpoints. This module's functions gets the JSON payloads for the mlb.com games API endpoints. .. _Google Python Style Guide: http://google.github.io/styleguide/pyguide.html """ from mlbgame.data import request def get_person...
2.90625
3
src/swadr.py
ericpruitt/swadr
2
29912
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import csv import getopt import io import itertools import logging import numbers import os import re import sqlite3 import string import sys import textwrap import time try: import readline except ImportError: pass try: ...
2.609375
3
django_analyses/filters/output/output_definition.py
TheLabbingProject/django_analyses
1
29913
""" Definition of an :class:`~django_analyses.filters.output.output_definition.OutputDefinitionFilter` for the :class:`~django_analyses.models.output.definitions.OutputDefinition` model. """ from django_analyses.models.output.definitions.output_definition import \ OutputDefinition from django_filters import rest_f...
1.851563
2
mypage/apps.py
shotastage/neco-sys
2
29914
<reponame>shotastage/neco-sys from django.apps import AppConfig class MypageConfig(AppConfig): name = 'mypage'
1.335938
1
additional.py
NatName/BD_2
0
29915
<reponame>NatName/BD_2 import psycopg2 class Additional(object): @staticmethod def findExistRow(connection, tableName): cursor = connection.cursor() cursor.execute("""SELECT "{}Id" FROM public."{}" OFFSET floor(random()) LIMIT 1;""" .format(tableName, tableName)) ...
2.953125
3
hanoi_window.py
SirIsaacNeutron/tower_of_hanoi
0
29916
""" Created on Mar 12, 2018 @author: SirIsaacNeutron """ import tkinter import tkinter.messagebox import hanoi DEFAULT_FONT = ('Helvetica', 14) class DiskDialog: """A dialog window meant to get the number of Disks per Tower for the Tower of Hanoi puzzle. """ def __init__(self): self._dialog...
3.90625
4
parser.py
PouletFreak/mailparser
1
29917
<gh_stars>1-10 import email, json, os, re import magic import ssdeep import hashlib import datetime def md5(fname): hash_md5 = hashlib.md5() with open(fname, "rb") as f: for chunk in iter(lambda: f.read(4096), b""): hash_md5.update(chunk) return hash_md5.hexdigest() def sha1(fname): ...
2.65625
3
analysis_vis/scripts/CovarEpi.py
arubenstein/deep_seq
0
29918
<reponame>arubenstein/deep_seq<gh_stars>0 #!/usr/bin/env python """Create edges and nodes from a list of sequences that are a given hamming distance apart""" import itertools import sys import operator import numpy as np import argparse from general_seq import conv from general_seq import seq_IO from plot import conv ...
3
3
Modules/DirectoryIndex.py
spanoselias/LazyReplicationTool
0
29919
import os import pickle from Utils import DirectoryUtils, IOUtils, LoggingUtils # Write to the disk the structure such that will be # persistent. from Utils.FilesUtils import readConfigFile def writePersistentStructure(filename, structure): try: writeSerializer = open(filename, "wb") pickle.dum...
2.875
3
perslay/utils.py
YuryUoL/perslay
0
29920
<filename>perslay/utils.py """Module :mod:`perslay.utils` provide utils functions.""" # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # License: MIT from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np impor...
2.140625
2
fabric/exceptions.py
lin-zh-cn/fabric
1
29921
# TODO: this may want to move to Invoke if we can find a use for it there too? # Or make it _more_ narrowly focused and stay here? class NothingToDo(Exception): pass class GroupException(Exception): """ Lightweight exception wrapper for `.GroupResult` when one contains errors. .. versionadded:: 2.0 ...
1.976563
2
baselines/utils/agent_can_choose_helper.py
ClemenceLanfranchi/Flatland_project
0
29922
import matplotlib.pyplot as plt import numpy as np from flatland.core.grid.grid4_utils import get_new_position from flatland.envs.agent_utils import TrainState from flatland.utils.rendertools import RenderTool, AgentRenderVariant from utils.fast_methods import fast_count_nonzero, fast_argmax class AgentCanChooseHelp...
2
2
server/app/api/weather/resources.py
WagnerJM/home_pod
0
29923
<filename>server/app/api/weather/resources.py from flask import request from flask_restful import Resource from flask_jwt_extended import get_jwt_claims, get_jwt_identity, jwt_required from app.cache import redis_client
1.46875
1
demo/buf.py
uldisa/tuxedo-python
4
29924
#!/usr/bin/env python3 import tuxedo as t if __name__ == '__main__': buf = {'TA_CLASS': ['T_SVCGRP'], 'TA_OPERATION': ['GET']} assert t.tpimport(t.tpexport(buf)) == buf assert t.tpimport(t.tpexport(buf, t.TPEX_STRING), t.TPEX_STRING) == buf assert t.Fname32(t.Fldid32('TA_OPERATION')) == 'TA_OPERATIO...
2.078125
2
src/term/api/serializers.py
eeriksp/e-dhamma-backend
1
29925
from rest_framework import serializers from ..models import Term, Meaning, Comment, Example class CommentSerializer(serializers.ModelSerializer): class Meta: model = Comment fields = '__all__' # class TranslatorsChatSerializer(serializers.ModelSerializer): # class Meta: # model = Tra...
2.4375
2
archive/2017/week12/tasks/more_list_tasks/tail.py
YAtOff/python0
6
29926
def tail(xs): """ Напишете функция в Python, която взима списък и връща нов списък, който се състои от всички елементи **без първия** от първоначалния списъка. **Не се грижете, ако списъка е празен** >>> tail([1, 2, 3]) [2, 3] >>> tail(["Python"]) [] """ pass
3.3125
3
pool_automation/roles/aws_manage/library/stateful_set.py
Rob-S/indy-node
627
29927
<gh_stars>100-1000 #!/usr/bin/python import re from itertools import cycle from collections import namedtuple, defaultdict, OrderedDict import boto3 from ansible.module_utils.basic import AnsibleModule # import logging # boto3.set_stream_logger('', logging.DEBUG) HostInfo = namedtuple('HostInfo', 'tag_id public_ip u...
2.015625
2
backend/hqlib/domain/measurement/metric.py
ICTU/quality-report
25
29928
""" Copyright 2012-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 in writing, software di...
1.992188
2
examples/decrypt.py
joke325/Pyrop
0
29929
<filename>examples/decrypt.py #!/usr/bin/env python # Copyright (c) 2020 Janky <<EMAIL>> # All right 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...
2.03125
2
squealy/urls.py
vaibhav-singh/squealy
0
29930
from __future__ import absolute_import from django.conf.urls import url from django.contrib.auth.decorators import login_required from . import views urlpatterns = [ url(r'^swagger.json/$',views.swagger_json_api), url(r'^swagger/$', login_required(views.swagger)), url(r'charts/$', login_required(views.Char...
1.90625
2
src/jomiel_kore/version.py
guendto/jomiel-kore
0
29931
<filename>src/jomiel_kore/version.py # # jomiel-kore # # Copyright # 2019-2020 <NAME> # # # SPDX-License-Identifier: Apache-2.0 # """TODO.""" try: # py38+ from importlib.metadata import version as metadata_version from importlib.metadata import PackageNotFoundError except ModuleNotFoundError: from import...
2.09375
2
gpdist/tanh_saturate.py
saalfeldlab/gunpowder-distances
0
29932
import logging import numpy as np from gunpowder.nodes.batch_filter import BatchFilter logger = logging.getLogger(__name__) class TanhSaturate(BatchFilter): '''Saturate the values of an array to be floats between -1 and 1 by applying the tanh function. Args: array (:class:`ArrayKey`): ...
2.921875
3
app/api/users/views.py
msoedov/hackit
0
29933
<filename>app/api/users/views.py import os from django.conf import settings from django.http.response import HttpResponse from django.shortcuts import get_object_or_404 from rest_framework.generics import ListAPIView, RetrieveUpdateAPIView, RetrieveAPIView from rest_framework.pagination import PageNumberPagination from...
2.375
2
main.py
azerpas/OFFSPRING_RAFFLE_NIKE_OW
3
29934
import requests, json, time, random, datetime, threading, pickle from termcolor import colored sitekey = "<KEY>" def log(event): d = datetime.datetime.now().strftime("%H:%M:%S") print("Raffle OFF-S by Azerpas :: " + str(d) + " :: " + event) class Raffle(object): def __init__(self): self.s = requests.session(...
2.890625
3
my_site/objects.py
mequetrefe-do-subtroco/web_constel_cont_ext
1
29935
<filename>my_site/objects.py class Button(object): def __init__(self, url, label, get=''): self.url = url self.label = label self.get = get
2.234375
2
HSTB/shared/settings.py
noaa-ocs-hydrography/shared
0
29936
<reponame>noaa-ocs-hydrography/shared from sys import platform if 'win' in platform: from .winreg import * elif 'linux' in platform: from posixreg import * import posixreg posixreg.__init__()
1.242188
1
src/skdh/features/core.py
PfizerRD/scikit-digital-health
1
29937
""" Core functionality for feature computation <NAME> Copyright (c) 2021. Pfizer Inc. All rights reserved. """ from abc import ABC, abstractmethod from collections.abc import Iterator, Sequence import json from warnings import warn from pandas import DataFrame from numpy import float_, asarray, zeros, sum, moveaxis ...
2.59375
3
src/bin/shipyard_airflow/tests/unit/control/test_actions_validations_id_api.py
openvdro/airship-shipyard
12
29938
# Copyright 2017 AT&T Intellectual Property. All other 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...
1.84375
2
tests/test_lccv.py
fmohr/llcv
3
29939
<filename>tests/test_lccv.py import logging import lccv import numpy as np import sklearn.datasets from sklearn import * import unittest from parameterized import parameterized import itertools as it import time from sklearn.experimental import enable_hist_gradient_boosting # noqa import openml import pandas as pd de...
2.546875
3
plaso/formatters/firefox.py
cvandeplas/plaso
3
29940
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2013 The Plaso Project Authors. # Please see the AUTHORS file for details on individual authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the L...
2.015625
2
LeetCode/Unique Email Addresses.py
UtkarshPathrabe/Competitive-Coding
13
29941
class Solution: def getFormattedEMail(self, email): userName, domain = email.split('@') if '+' in userName: userName = userName.split('+')[0] if '.' in userName: userName = ''.join(userName.split('.')) return userName + '@' + domain def numUniqueEmail...
3.296875
3
algorithms/prims.py
karensuzue/Maze
0
29942
import random from grid import Grid from grid import Cell class Prim(): def grid_to_list(self, grid): """ Place all cells from grid matrix into a list :param grid: a Grid object :return: a list of all cells contained in the grid """ list = [] for r in range(g...
3.671875
4
secfs/fs.py
quinnmagendanz/vFileSystem
0
29943
# This file implements file system operations at the level of inodes. import time import secfs.crypto import secfs.tables import secfs.access import secfs.store.tree import secfs.store.block from secfs.store.inode import Inode from secfs.store.tree import Directory from cryptography.fernet import Fernet from secfs.typ...
2.609375
3
neurons/feynman/visualization.py
unconst/SimpleWord2Vec
9
29944
from __future__ import division import io import matplotlib as mpl import matplotlib.pyplot as plt import networkx as nx import numpy import os import tensorflow as tf def figure_to_buff(figure): """Converts the matplotlib plot specified by 'figure' to a PNG image and returns it. The supplied figure is closed a...
2.703125
3
signalwire/relay/messaging/send_result.py
ramarketing/signalwire-python
23
29945
class SendResult: def __init__(self, result={}): self.successful = result.get('code', None) == '200' self.message_id = result.get('message_id', None)
2.109375
2
harvester/letsdoit/discovery/sublist3r.py
Average-stu/osint
2
29946
<gh_stars>1-10 from typing import Type from letsdoit.lib.core import * class SearchSublist3r: def __init__(self, word): self.word = word self.totalhosts = list self.proxy = False async def do_search(self): url = f'https://api.sublist3r.com/search.php?domain={self.word}' ...
2.671875
3
src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/spinnman/messages/eieio/data_messages/eieio_16bit_with_payload/eieio_16bit_with_payload_timed_data_message.py
Roboy/LSM_SpiNNaker_MyoArm
2
29947
<filename>src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/spinnman/messages/eieio/data_messages/eieio_16bit_with_payload/eieio_16bit_with_payload_timed_data_message.py from spinnman.messages.eieio.eieio_type import EIEIOType from spinnman.messages.eieio.data_messages.eieio_with_payload_data_message\ import E...
2.25
2
reliability/tasks/Apps.py
RH-ematysek/svt
115
29948
from .GlobalData import global_data from .utils.oc import oc import requests import time import logging class App: def __init__(self, deployment, project, template, build_config,route=""): self.project = project self.template = template self.deployment = deployment self.build_conf...
2.34375
2
recognize.py
aerdem4/rock-paper-scissors
0
29949
import cv2 import numpy as np from keras.models import load_model bg = None def run_avg(image, acc_weight): global bg if bg is None: bg = image.copy().astype("float") return cv2.accumulateWeighted(image, bg, acc_weight) def segment(image, threshold=10): global bg diff = cv2.absdif...
2.640625
3
src/extract-data.py
SMTG-UCL/singlet-fission-screening
0
29950
#!/usr/bin/env python from __future__ import unicode_literals import os import sys import tarfile import shutil import tempfile from contextlib import contextmanager from pymatgen.io.gaussian import GaussianInput, GaussianOutput from tinydb import TinyDB @contextmanager def cd(run_path, cleanup=lambda: True): ...
2.296875
2
src/pyprocessing/shapes.py
agarwalnaimish/pyprocessing
3
29951
<filename>src/pyprocessing/shapes.py # coding: utf-8 # ************************ # SHAPE STUFF # ************************ import ctypes from pyglet.gl import * from .globs import * from .constants import * from .pvector import * from .primitives import _smoothFixHackBegin, _smoothFixHackEnd from math import * __all...
2.765625
3
ptpy/transports/usb.py
komodo108/sequoia-ptpy
0
29952
<filename>ptpy/transports/usb.py '''This module implements the USB transport layer for PTP. It exports the PTPUSB class. Both the transport layer and the basic PTP implementation are Vendor agnostic. Vendor extensions should extend these to support more operations. ''' from __future__ import absolute_import import ate...
2.640625
3
cablegate/cable/models.py
h3/django-cablegate
1
29953
<filename>cablegate/cable/models.py import re from operator import itemgetter from django.conf import settings from django.utils import simplejson from django.db import models from nltk.tokenize.simple import SpaceTokenizer from nltk.stem import LancasterStemmer WORDS_IGNORED = ( 'after', 'that', 'with', 'which'...
2.34375
2
ztools/Fs/__init__.py
ItsCinnabar/Mass_Custom_XCIs
6
29954
<gh_stars>1-10 from Fs.Xci import Xci from Fs.pXci import uXci from Fs.pXci import nXci from Fs.Nca import Nca from Fs.Nsp import Nsp from Fs.Rom import Rom from Fs.Nacp import Nacp from Fs.Pfs0 import Pfs0 from Fs.Hfs0 import Hfs0 from Fs.Ticket import Ticket from Fs.File import File def factory(name): if name.endsw...
2.046875
2
Days/Day 5 - Doesn't He Have Intern-Elves For This/Part 2.py
jamesjiang52/Advent-of-Code-2015
0
29955
<reponame>jamesjiang52/Advent-of-Code-2015<filename>Days/Day 5 - Doesn't He Have Intern-Elves For This/Part 2.py # -*- coding: utf-8 -*- """ Created on Wed Jan 3 10:27:50 2018 @author: <NAME> """ all_lines = [line.rstrip('\n') for line in open('Data.txt')] def has_two_pairs(string): for i in range(len(string) -...
3.1875
3
loggerBot.py
jskrist/channelLogger
0
29956
<reponame>jskrist/channelLogger import asyncio, discord, json from discord.ext.commands import Bot from discord.ext import commands from tinydb import TinyDB, Query from tinydb.operations import delete, increment ''' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SETUP - - - - - - - - - - - - -...
2.65625
3
roomBasedLightControl/roomBasedLightControl.py
pippyn/appdaemon-scripts
0
29957
import appdaemon.plugins.hass.hassapi as hass import datetime import globals # # App which turns on the light based on the room the user is currently in # # # Args: # room_sensor: the sensor which shows the room the user is in. example: sensor.mqtt_room_user_one # entity: The entity which gets turned on by alexa/snips....
2.40625
2
Platypus StableSwap/emissions_rate.py
MattAHarrington/protocol-analysis
0
29958
#!/usr/bin/env python ''' Calculating the emissions from deposits in Platypus stable accounts ''' import numpy as np import matplotlib.pyplot as plt from matplotlib import cm from matplotlib.ticker import LinearLocator, EngFormatter, PercentFormatter from strategy_const import * from const import * def boosted_pool_...
2.84375
3
Tests/test_management_client.py
acronis/acronis-cyber-platform-python-samples
16
29959
<filename>Tests/test_management_client.py """ @date 30.08.2019 @author Anna.Shavrina<EMAIL> @details :copyright: 2003–2019 Acronis International GmbH, Rheinweg 9, 8200 Schaffhausen, Switzerland. All rights reserved. """ from ManagementAPI.ManagementClient.how_to_create_client import create_client from ManagementAPI.M...
1.992188
2
holide1/src_test/unittests/test_school_holidays.py
SmartDataInnovationLab/holide-library
1
29960
<filename>holide1/src_test/unittests/test_school_holidays.py #!/usr/bin/env python3 import os, sys, inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) parentdir = os.path.dirname(parentdir) sys.path.insert(0, parentdir) import unittes...
2.640625
3
migrations/migrate.py
MJJojo97/openslides-backend
0
29961
<gh_stars>0 import pkgutil import sys from argparse import ArgumentParser from importlib import import_module from typing import Any, List, Type from datastore.migrations import BaseMigration, MigrationException, PrintFunction, setup class BadMigrationModule(MigrationException): pass class InvalidMigrationComm...
2.265625
2
src/refactor/parallel.py
luislorenzom/b33th0v3n
0
29962
from types import FunctionType import numpy as np import pandas as pd from functools import partial from multiprocessing import Pool, cpu_count def get_levenshtein_distance(str1: str, str2: str) -> float: """ Computes the Levenshtein distance between two strings :param str1: first string :param str...
3.078125
3
pygbif/caching.py
bartaelterman/pygbif
37
29963
import requests_cache import os.path import tempfile try: from requests_cache import remove_expired_responses except ModuleNotFoundError: from requests_cache.core import remove_expired_responses def caching( cache=False, name=None, backend="sqlite", expire_after=86400, allowable_codes=(200...
2.65625
3
mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/types.py
MochalovaAn/llvm
0
29964
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception """Facility for symbolically referencing type variables. Type variables are instances of the TypeVar class, which is u...
2.71875
3
run_exp/run_theory.py
andeyeluguo/AI_physicist
25
29965
import os, sys exp_id=[ "exp1.0", ] env_source=[ "file", ] exp_mode = [ "continuous", #"newb", #"base", ] num_theories_init=[ 4, ] pred_nets_neurons=[ 8, ] pred_nets_activation=[ "linear", # "leakyRelu", ] domain_net_neurons=[ 8, ] domain_pred_mode=[ "onehot", ] mse_amp=[ 1e-7, ] simplify_criteria=[ '\("DLs",...
1.570313
2
lib/dataset/cao_cifar.py
jrcai/ACE
18
29966
<filename>lib/dataset/cao_cifar.py # To ensure fairness, we use the same code in LDAM (https://github.com/kaidic/LDAM-DRW) to produce long-tailed CIFAR datasets. import torchvision import torchvision.transforms as transforms import numpy as np from PIL import Image import random import os import cv2 import time import...
2.5625
3
fs.py
titouanc/docfub
1
29967
import os import errno import stat import logging from io import BytesIO from time import time, mktime, strptime from fuse import FuseOSError, Operations, LoggingMixIn logger = logging.getLogger('dochub_fs') def wrap_errno(func): """ @brief Transform Exceptions happening inside func into meaningful ...
2.40625
2
algolab_class_API/migrations/0011_auto_20190110_1307.py
KMU-algolab/algolab_class
1
29968
# Generated by Django 2.1.4 on 2019-01-10 04:07 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('algolab_class_API', '0010_submithistory'), ] operations = [ migrations.Rem...
1.671875
2
spiderpy/spiderapi.py
peternijssen/python-itho-daalderop-api
0
29969
""" Python wrapper for the Spider API """ from __future__ import annotations import json import logging import time from datetime import datetime, timedelta from typing import Any, Dict, ValuesView from urllib.parse import unquote import requests from spiderpy.devices.powerplug import SpiderPowerPlug from spiderpy.d...
2.765625
3
http_nudger/persister.py
askolosov/http-nudger
0
29970
<reponame>askolosov/http-nudger """ Persister module contains part of the http-nudger which consumes records from Kafka and stores them into the database """ import json import logging from pathlib import Path from typing import List import aiokafka import asyncpg from .helpers import create_kafka_consumer, create_po...
2.65625
3
var/spack/repos/builtin/packages/liblzf/package.py
BenWibking/spack
2,360
29971
<gh_stars>1000+ # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Liblzf(AutotoolsPackage): """LibLZF is a very small data compression libra...
1.335938
1
blaze/compute/tests/test_elwise_eval.py
talumbau/blaze
1
29972
<gh_stars>1-10 from __future__ import absolute_import, division, print_function import unittest import numpy as np from numpy.testing import assert_array_equal, assert_allclose from dynd import nd, ndt import blaze import unittest import tempfile import os, os.path import glob import shutil import blaze # Useful ...
2.265625
2
torch3d/models/pointnet2.py
zhangmozhe/torch3d
0
29973
import torch import torch.nn as nn from torch3d.nn import SetAbstraction class PointNetSSG(nn.Module): """ PointNet++ single-scale grouping architecture from the `"PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space" <https://arxiv.org/abs/1706.02413>`_ paper. Args: in_...
2.75
3
tests/test_engine.py
znhv/winsio
0
29974
<gh_stars>0 import unittest.mock as mock import pytest from brainstorm.scripts import engine from brainstorm.games import calc # def test_player_ready(monkeypatch): # with monkeypatch.context() as m: # m.setattr('builtins.input', lambda prompt="": "y") # result = engine.player_ready() # asser...
2.375
2
Day01.py
peiliming007/PythonByJoker
0
29975
<reponame>peiliming007/PythonByJoker #1 celsius=float(input("请输入一个摄氏度:>>")) fahrenheit=(9 / 5) *celsius + 32 print("华氏温度为:%.1f" % fahrenheit) #2 radius=float(input("请输入圆柱体的半径:>>")) length=float(input("请输入圆柱体的高:>>")) area= radius*radius*3.14159265 volume=area*length print("The area is %.4f" % area ) print(...
4.1875
4
botx/bots/bots.py
ExpressApp/pybotx
13
29976
<reponame>ExpressApp/pybotx """Implementation for bot classes.""" import asyncio from dataclasses import InitVar, field from typing import Any, Callable, Dict, List from weakref import WeakSet from loguru import logger from pydantic.dataclasses import dataclass from botx import concurrency, exception_handlers, excep...
2.109375
2
orka_inventory.py
jeff-vincent/orka-ansible-dynamic-inventory
0
29977
#!/usr/bin/python3 import argparse import json import os import subprocess class OrkaAnsibleInventory: def __init__(self): self.vm_data = None self.filtered_data = None self.inventory = { 'group': {'hosts': []}, 'vars': [], '_meta': { '...
2.4375
2
tests/test_release_summary.py
kids-first/kf-task-release-reports
0
29978
import boto3 import datetime import requests import pytest from unittest.mock import patch from reports.reporting import release_summary from collections import Counter from functools import partial ENTITIES = [ 'participants', 'biospecimens', 'phenotypes', 'genomic-files', 'study-files', 'rea...
2.171875
2
apps/payroll/models/employee.py
youssriaboelseod/pyerp
115
29979
<filename>apps/payroll/models/employee.py # Django Library from django.contrib.auth.models import User from django.db import models from django.urls import reverse from django.utils.translation import ugettext_lazy as _ # Thirdparty Library from apps.base.models import PyFather # Tabla de Empleados class PyEmployee(...
2.1875
2
apps/players/apps.py
xeroz/admin-django
12
29980
from django.apps import AppConfig class PlayersConfig(AppConfig): name = 'players'
1.226563
1
tas/__main__.py
lispsil/tas
1
29981
import os import signal import atexit import json import time from pathlib import Path import subprocess import argparse import pprint from distutils.util import strtobool children_pid = [] @atexit.register def kill_child(): for child_pid in children_pid: os.kill(child_pid, signal.SIGTERM) cmd_parser = ...
2.09375
2
1._metis_models_and_data_2019-12-16b/METIS source code/Indicators/kpis/Transmission usage.py
tamas-borbath/METIS
1
29982
<gh_stars>1-10 ######################################################## # Copyright (c) 2015-2017 by European Commission. # # All Rights Reserved. # ######################################################## extends("BaseKPI.py") """ Transmission usage (%) ---------------------- In...
2.609375
3
apps/bloguser/migrations/0003_auto_20180505_1717.py
dryprojects/MyBlog
2
29983
<reponame>dryprojects/MyBlog # Generated by Django 2.0.3 on 2018-05-05 17:17 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('bloguser', '0002_auto_20180504_1808'), ] operations = [ migrations.AddField( model_name='userprofil...
1.765625
2
qrcodescanner.py
globophobe/pygame-qrcode-demo
3
29984
# -*- coding: utf-8 -*- import os import datetime import logging import requests import numpy import cv2 import zbar from Queue import Queue from threading import Thread from PIL import Image logger = logging.getLogger(__name__) TEMP_DIR = os.path.join(os.getcwd(), 'temp') def get_temp_dir(): """Create TEMP_DIR ...
2.796875
3
rescape_region/schema_models/settings/settings_schema.py
calocan/rescape-region
1
29985
<reponame>calocan/rescape-region<filename>rescape_region/schema_models/settings/settings_schema.py import graphene from django.db import transaction from graphene import InputObjectType, Mutation, Field, ObjectType from graphene_django.types import DjangoObjectType from graphql_jwt.decorators import login_required from...
1.742188
2
juju/client/_client8.py
wallyworld/python-libjuju
0
29986
<gh_stars>0 # DO NOT CHANGE THIS FILE! This file is auto-generated by facade.py. # Changes will be overwritten/lost when the file is regenerated. from juju.client.facade import Type, ReturnMapping from juju.client._definitions import * class ApplicationFacade(Type): name = 'Application' version = 8 schem...
1.671875
2
dectate/app.py
morepath/dectate
23
29987
<filename>dectate/app.py import sys from .config import Configurable, Directive, commit, create_code_info class Config: """The object that contains the configurations. The configurations are specified by the :attr:`Action.config` class attribute of :class:`Action`. """ pass class AppMeta(type)...
2.671875
3
app/user/serializers.py
falleng0d/medicar-backend
0
29988
from collections import OrderedDict from django.contrib.auth import get_user_model # If used custom user model from rest_framework import serializers UserModel = get_user_model() class UserSerializer(serializers.ModelSerializer): password = serializers.CharField(write_only=True) def create(self, validated...
2.765625
3
easy-receptive-fields-pytorch/receptivefield/tests/test_pytorch.py
Swinsie/cv-rep-fork
0
29989
<filename>easy-receptive-fields-pytorch/receptivefield/tests/test_pytorch.py import pytest import torch.nn as nn from numpy.testing import assert_allclose from receptivefield.pytorch import PytorchReceptiveField from receptivefield.image import get_default_image from receptivefield.types import ImageShape class Linea...
2.84375
3
KSFGHAction/__init__.py
KOLANICH-GHActions/KSFGHAction.py
0
29990
#!/usr/bin/env python3 import typing from .utils import ClassDictMeta from .issueParser import * from .linter import * from miniGHAPI.GitHubAPI import * from miniGHAPI.GHActionsEnv import *
1.1875
1
model_zoo/jag_utils/python/build_inclusive_from_exclusive.py
jonesholger/lbann
194
29991
import sys if len(sys.argv) != 4 : print 'usage:', sys.argv[0], 'index_fn id_mapping_fn output_fn' exit(9) a = open(sys.argv[1]) a.readline() header = a.readline() dir = a.readline() #build map: filename -> set of bad samples mp = {} mp_good = {} mp_bad = {} for line in a : t = line.split() mp[t[0]] = set() ...
2.328125
2
app/tests/functional/test_user.py
sun-fengcai/flask_template
3
29992
<gh_stars>1-10 import json from app import utils def test_add_user(test_app, test_database): client = test_app.test_client() response = client.post( "/users", data=json.dumps( {"username": "onlinejudge95", "email": "<EMAIL>",} ), content_type="application/json", ...
2.671875
3
MultiAV/MultiAV.py
Virag007/Multi-Malware-Detection-Engine-based-on-Blockchain
2
29993
from threading import * from tkinter import * from tkinter.filedialog import askopenfilename import tkinter, tkinter.scrolledtext import os import sys import urllib.request import glob import time import hashlib import quarantaene from vta import vtapi import argparse os_name = sys.platform terminations = [] if "win"...
2.6875
3
model.py
ishine/Speaker_Verification
337
29994
import tensorflow as tf import numpy as np import os import time from utils import random_batch, normalize, similarity, loss_cal, optim from configuration import get_config from tensorflow.contrib import rnn config = get_config() def train(path): tf.reset_default_graph() # reset graph # dra...
2.515625
3
server/swagger_server/test/test_statements_controller.py
lhannest/pharos-beacon
0
29995
<filename>server/swagger_server/test/test_statements_controller.py # coding: utf-8 from __future__ import absolute_import from flask import json from six import BytesIO from swagger_server.models.beacon_annotation import BeaconAnnotation # noqa: E501 from swagger_server.models.beacon_statement import BeaconStatemen...
2.265625
2
mailmerge/smtp_dummy.py
Denzeldeveloper/Python-Auto-MailMerge-
0
29996
"""Dummy SMTP API.""" class SMTP_dummy(object): # pylint: disable=useless-object-inheritance # pylint: disable=invalid-name, no-self-use """Dummy SMTP API.""" # Class variables track member function calls for later checking. msg_from = None msg_to = None msg = None def login(self, login...
2.8125
3
steepshot_bot/steepshot_api.py
weyoume/wetelegrambot
0
29997
<gh_stars>0 import json import logging import requests from requests.exceptions import RequestException from steepshot_bot import settings from steepshot_bot.exceptions import SteepshotServerError from steepshot_bot.steem import get_signed_transaction logger = logging.getLogger(__name__) API_URLS = { 'posts_re...
2.21875
2
kernelized_correlation_filter.py
ElnuraMusaoglu/KernelizedCorrelationFilter
0
29998
''' <NAME> 2021 ''' import numpy as np import cv2 from numpy.fft import fftn, ifftn, fft2, ifft2, fftshift from numpy import conj, real from utils import gaussian2d_rolled_labels, cos_window from hog_cpp.fhog.get_hog import get_hog vgg_path = 'model/imagenet-vgg-verydeep-19.mat' def create_model(): from scipy ...
2.359375
2
sketches/demo_02a/editor.py
heerdyes/raspi-art
1
29999
<filename>sketches/demo_02a/editor.py from arch import * from wnds import * from helper import * import os class Ed(Wnd,Pub): def __init__(self,x,y,w,h,nm): Wnd.__init__(self,x,y,w,h,nm) Pub.__init__(self) self.txt=[''] self.r=0 self.c=0 self.mt=24 def rende...
2.59375
3