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
python/GafferUI/ScriptEditor.py
PaulDoessel/gaffer-play
0
9800
########################################################################## # # Copyright (c) 2011-2012, <NAME>. All rights reserved. # Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided ...
0.835938
1
03/triangle.py
machinelearningdeveloper/aoc_2016
0
9801
<reponame>machinelearningdeveloper/aoc_2016<filename>03/triangle.py """Test whether putative triangles, specified as triples of side lengths, in fact are possible.""" def load_triangles(filename): """Load triangles from filename.""" triangles = [] with open(filename) as f: for line in f: ...
4.21875
4
ExerciciosdePython/ex049.py
aleksandromelo/Exercicios
0
9802
num = int(input('Digite um número para ver sua tabuada: ')) for i in range(1, 11): print('{} x {:2} = {}'.format(num, i, num * i))
4
4
ebmeta/actions/version.py
bkidwell/ebmeta-old
1
9803
<gh_stars>1-10 """Print ebmeta version number.""" import sys import ebmeta def run(): print "{} {}".format(ebmeta.PROGRAM_NAME, ebmeta.VERSION) sys.exit(0)
1.648438
2
backend/api/tests/mixins/credit_trade_relationship.py
amichard/tfrs
18
9804
<gh_stars>10-100 # -*- coding: utf-8 -*- # pylint: disable=no-member,invalid-name,duplicate-code """ REST API Documentation for the NRS TFRS Credit Trading Application The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accorda...
2.0625
2
superset/superset_config.py
panchohumeres/dynamo-covid
4
9805
import os SERVER_NAME = os.getenv('DOMAIN_SUPERSET') PUBLIC_ROLE_LIKE_GAMMA = True SESSION_COOKIE_SAMESITE = None # One of [None, 'Lax', 'Strict'] SESSION_COOKIE_HTTPONLY = False MAPBOX_API_KEY = os.getenv('MAPBOX_API_KEY', '') POSTGRES_DB=os.getenv('POSTGRES_DB') POSTGRES_PASSWORD=os.getenv('POSTGRES_PASSWORD') POSTG...
1.875
2
mybot.py
johnnyboiii3020/matchmaking-bot
0
9806
<reponame>johnnyboiii3020/matchmaking-bot import discord import json import random import os from discord.ext import commands TOKEN = "" client = commands.Bot(command_prefix = '--') os.chdir(r'D:\Programming\Projects\Discord bot\jsonFiles') SoloCounter = 30 SolominCounter = 10 Queueiter = 1 T_Queueiter =...
2.640625
3
conversation.py
markemus/economy
2
9807
import database as d import numpy as np import random from transitions import Machine #Conversations are markov chains. Works as follows: a column vector for each CURRENT state j, a row vector for each TARGET state i. #Each entry i,j = the probability of moving to state i from state j. #target state D = end of convers...
3.1875
3
src/createData.py
saijananiganesan/SimPathFinder
0
9808
from __init__ import ExtractUnlabeledData, SampleUnlabeledData, ExtractLabeledData E = ExtractLabeledData(data_dir='../labeldata/') E.get_pathways() E.get_pathway_names() E.get_classes_dict() E.create_df_all_labels()
1.65625
2
blog/views.py
farman99ahmed/diyblog
0
9809
from django.shortcuts import render, redirect from .forms import AuthorForm, BlogForm, NewUserForm from .models import Author, Blog from django.contrib.auth import login, authenticate, logout from django.contrib import messages from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.decorator...
2.265625
2
tests/conftest.py
SolomidHero/speech-regeneration-enhancer
8
9810
<filename>tests/conftest.py # here we make fixtures of toy data # real parameters are stored and accessed from config import pytest import librosa import os import numpy as np from hydra.experimental import compose, initialize @pytest.fixture(scope="session") def cfg(): with initialize(config_path="../", job_nam...
1.976563
2
dataclassses_howto.py
CvanderStoep/VideosSampleCode
285
9811
<gh_stars>100-1000 import dataclasses import inspect from dataclasses import dataclass, field from pprint import pprint import attr class ManualComment: def __init__(self, id: int, text: str): self.id: int = id self.text: str = text def __repr__(self): return "{}(id={}, text={})".for...
3
3
downloadMusic/main.py
yaosir0317/my_first
0
9812
<reponame>yaosir0317/my_first from enum import Enum import requests class MusicAPP(Enum): qq = "qq" wy = "netease" PRE_URL = "http://www.musictool.top/" headers = {"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36"} def...
3.09375
3
app/api/serializers.py
michelmarcondes/django-study-with-docker
0
9813
<filename>app/api/serializers.py from rest_framework import serializers from projects.models import Project, Tag, Review from users.models import Profile class ReviewSerializer(serializers.ModelSerializer): class Meta: model = Review fields = '__all__' class ProfileSerializer(serializers.ModelSe...
2.328125
2
corehq/apps/domain/views.py
johan--/commcare-hq
0
9814
import copy import datetime from decimal import Decimal import logging import uuid import json import cStringIO from couchdbkit import ResourceNotFound import dateutil from django.core.paginator import Paginator from django.views.generic import View from django.db.models import Sum from django.conf import settings fro...
1.25
1
src/anmi/T2/funcs_met_iters.py
alexmascension/ANMI
1
9815
<filename>src/anmi/T2/funcs_met_iters.py from sympy import simplify, zeros from sympy import Matrix as mat import numpy as np from ..genericas import print_verbose, matriz_inversa def criterio_radio_espectral(H, verbose=True): eigs = [simplify(i) for i in list(H.eigenvals().keys())] print_verbose("||Criteri...
2.640625
3
{{cookiecutter.project_hyphen}}/{{cookiecutter.project_slug}}/__init__.py
zhangxianbing/cookiecutter-pypackage
1
9816
"""{{ cookiecutter.project_name }} - {{ cookiecutter.project_short_description }}""" __version__ = "{{ cookiecutter.project_version }}" __author__ = """{{ cookiecutter.author_name }}""" __email__ = "{{ cookiecutter.author_email }}" prog_name = "{{ cookiecutter.project_hyphen }}"
1.1875
1
services/osparc-gateway-server/tests/integration/_dask_helpers.py
mguidon/osparc-dask-gateway
1
9817
from typing import NamedTuple from dask_gateway_server.app import DaskGateway class DaskGatewayServer(NamedTuple): address: str proxy_address: str password: str server: DaskGateway
1.671875
2
rdkit/ML/InfoTheory/BitRank.py
kazuyaujihara/rdkit
1,609
9818
<filename>rdkit/ML/InfoTheory/BitRank.py # # Copyright (C) 2001,2002,2003 <NAME> and Rational Discovery LLC # """ Functionality for ranking bits using info gains **Definitions used in this module** - *sequence*: an object capable of containing other objects which supports __getitem__() and __len__(). Ex...
2.6875
3
trainer/dataset.py
vinay-swamy/gMVP
2
9819
import tensorflow as tf import os import pickle import numpy as np from constant_params import input_feature_dim, window_size def build_dataset(input_tfrecord_files, batch_size): drop_remainder = False feature_description = { 'label': tf.io.FixedLenFeature([], tf.int64), 'ref_aa': tf.io.Fixe...
2.296875
2
layers/eight_mile/pytorch/layers.py
dpressel/baseline
241
9820
<gh_stars>100-1000 import copy import math import logging from typing import Dict, List, Optional, Tuple, Union import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.jit as jit import torch.autograd import contextlib import glob from eight_mile.utils import listify...
2.375
2
setup.py
flother/pdf-search
5
9821
<filename>setup.py<gh_stars>1-10 from setuptools import setup setup( name='espdf', version='0.1.0-dev', url='https://github.com/flother/pdf-search', py_modules=( 'espdf', ), install_requires=( 'certifi', 'elasticsearch-dsl', ), entry_points={ 'console_sc...
1.390625
1
pywallet/network.py
martexcoin/pywallet
1
9822
<filename>pywallet/network.py class BitcoinGoldMainNet(object): """Bitcoin Gold MainNet version bytes. """ NAME = "Bitcoin Gold Main Net" COIN = "BTG" SCRIPT_ADDRESS = 0x17 # int(0x17) = 23 PUBKEY_ADDRESS = 0x26 # int(0x26) = 38 # Used to create payment addresses SECRET_KEY = 0x80 # int(...
2.875
3
conanfile.py
sintef-ocean/conan-clapack
0
9823
#!/usr/bin/env python # -*- coding: utf-8 -*- from conans import ConanFile, CMake, tools import shutil class ClapackConan(ConanFile): name = "clapack" version = "3.2.1" license = "BSD 3-Clause" # BSD-3-Clause-Clear url = "https://github.com/sintef-ocean/conan-clapack" author = "<NAME>" ho...
1.789063
2
yacos/algorithm/metaheuristics.py
ComputerSystemsLaboratory/YaCoS
8
9824
""" Copyright 2021 <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 distribute...
2.5
2
lab_03/main.py
solnishko-pvs/Modeling_BMSTU
0
9825
import tkinter as tk from scipy.stats import chi2, chisquare COLOR = '#dddddd' COLUMNS_COLOR = '#ffffff' MAX_SIZE = 10 WIDGET_WIDTH = 25 class LinearCongruent: m = 2**32 a = 1664525 c = 1013904223 _cur = 1 def next(self): self._cur = (self.a * self._cur + self.c) % self.m return s...
2.765625
3
VacationPy/api_keys.py
tylermneher/python-api-challenge
0
9826
# OpenWeatherMap API Key weather_api_key = "MyOpenWeatherMapAPIKey" # Google API Key g_key = "MyGoogleKey"
1.273438
1
aries_cloudagent/protocols/actionmenu/v1_0/messages/menu_request.py
panickervinod/aries-cloudagent-python
0
9827
"""Represents a request for an action menu.""" from .....messaging.agent_message import AgentMessage, AgentMessageSchema from ..message_types import MENU_REQUEST, PROTOCOL_PACKAGE HANDLER_CLASS = f"{PROTOCOL_PACKAGE}.handlers.menu_request_handler.MenuRequestHandler" class MenuRequest(AgentMessage): """Class re...
2.203125
2
porthole/management/commands/brocade.py
jsayles/Porthole
0
9828
<filename>porthole/management/commands/brocade.py from django.core.management.base import BaseCommand, CommandError from django.conf import settings from porthole import models, brocade class Command(BaseCommand): help = "Command the Brocade switch stacks" args = "" requires_system_checks = False de...
2.109375
2
joulia/unit_conversions_test.py
willjschmitt/joulia-webserver
0
9829
"""Tests joulia.unit_conversions. """ from django.test import TestCase from joulia import unit_conversions class GramsToPoundsTest(TestCase): def test_grams_to_pounds(self): self.assertEquals(unit_conversions.grams_to_pounds(1000.0), 2.20462) class GramsToOuncesTest(TestCase): def test_grams_to_ou...
2.34375
2
Django/blog/tests.py
zarif007/Blog-site
1
9830
<filename>Django/blog/tests.py<gh_stars>1-10 from django.contrib.auth.models import User from django.test import TestCase from blog.models import Category, Post class Test_Create_Post(TestCase): @classmethod def setUpTestData(cls): test_category = Category.objects.create(name='django') testu...
2.40625
2
scripts/train_presets/beads.py
kreshuklab/hylfm-net
8
9831
from pathlib import Path from hylfm.hylfm_types import ( CriterionChoice, DatasetChoice, LRSchedThresMode, LRSchedulerChoice, MetricChoice, OptimizerChoice, PeriodUnit, ) from hylfm.model import HyLFM_Net from hylfm.train import train if __name__ == "__main__": train( dataset=...
1.851563
2
TrainingPreprocess/filtered_to_dataset.py
CsekM8/LVH-THESIS
0
9832
import os import pickle from PIL import Image class PatientToImageFolder: def __init__(self, sourceFolder): self.sourceFolder = sourceFolder # How many patient with contrast SA for each pathology (used for classification) self.contrastSApathologyDict = {} # How many patient with c...
2.6875
3
scripts/pipeline/a06a_submission.py
Iolaum/Phi1337
0
9833
import pandas as pd import numpy as np import pickle from sklearn.cross_validation import train_test_split from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_squared_error from math import sqrt from sklearn.svm import SVR from sklearn.svm import LinearSVR from sklearn.preprocessing imp...
2.671875
3
Data Gathering/PythonPlottingScript.py
Carter-eng/SeniorDesign
0
9834
import numpy as np import serial import time import matplotlib.pyplot as plt def getData(): ser = serial.Serial('/dev/ttyACM7', 9600) sensorReadings = [] start = time.time() current = time.time() while current - start < 10: data =ser.readline() sensorReadings.append(floa...
2.796875
3
Examples/Rich_Message_Example.py
robinvoogt/text-sdk-python
2
9835
from CMText.TextClient import TextClient # Message to be send message = 'Examples message to be send' # Media to be send media = { "mediaName": "conversational-commerce", "mediaUri": "https://www.cm.com/cdn/cm/cm.png", "mimeType": "image/png" } # AllowedChannels in this ca...
2.59375
3
client/audio.py
Dmitry450/asynciogame
0
9836
<filename>client/audio.py import pygame from pygame.math import Vector2 class Sound: def __init__(self, manager, snd, volume=1.0): self.manager = manager self.snd = pygame.mixer.Sound(snd) self.snd.set_volume(1.0) self.ttl = snd.get_length() self.play...
3.0625
3
bot/ganjoor/category_choose.py
MmeK/ganjoor-telegram-bot
0
9837
# Copyright 2021 <NAME> <<EMAIL>>. # SPDX-License-Identifier: MIT # Telegram API framework core imports from collections import namedtuple from functools import partial from ganjoor.ganjoor import Ganjoor from telegram.ext import Dispatcher, CallbackContext from telegram import Update # Helper methods import from util...
2.125
2
python/util/md_utils.py
walterfan/snippets
1
9838
<filename>python/util/md_utils.py<gh_stars>1-10 import os import sys import struct import re import logging logging.basicConfig(stream=sys.stderr, level=logging.DEBUG) logger = logging.getLogger(__name__) def list_to_md(str_list): output = "" for str in str_list: output = output + "* %s \n" % str ...
2.953125
3
board/main.py
Josverl/micropython-stubber
96
9839
import uos as os import time def countdown(): for i in range(5, 0, -1): print("start stubbing in {}...".format(i)) time.sleep(1) import createstubs # import stub_lvgl try: # only run import if no stubs yet os.listdir("stubs") print("stub folder was found, stubbing is not aut...
2.34375
2
third_party/blink/tools/blinkpy/web_tests/breakpad/dump_reader_multipart_unittest.py
zipated/src
2,151
9840
# Copyright (C) 2013 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
1.296875
1
scripts/emoji-to-scl.py
SilverWingedSeraph/sws-dotfiles
3
9841
#!/usr/bin/python3 # -*- coding: utf-8 -*- from subprocess import Popen, PIPE emojis="""⛑🏻 Helmet With White Cross, Type-1-2 ⛑🏼 Helmet With White Cross, Type-3 ⛑🏽 Helmet With White Cross, Type-4 ⛑🏾 Helmet With White Cross, Type-5 ⛑🏿 Helmet With White Cross, Type-6 💏🏻 Kiss, Type-1-2 💏🏼 Kiss, Type-3 💏🏽 Kiss,...
2.265625
2
src/ngc/main.py
HubTou/ngc
0
9842
#!/usr/bin/env python """ ngc - n-grams count License: 3-clause BSD (see https://opensource.org/licenses/BSD-3-Clause) Author: <NAME> """ import getopt import logging import os import re import string import sys import unicode2ascii # Version string used by the what(1) and ident(1) commands: ID = "@(#) $Id: ngc - n-...
2.28125
2
openquake.hazardlib/openquake/hazardlib/tests/gsim/campbell_2003_test.py
rainzhop/ConvNetQuake
0
9843
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2012-2016 GEM Foundation # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the Licen...
1.828125
2
sktime/regression/interval_based/_tsf.py
khrapovs/sktime
1
9844
<gh_stars>1-10 # -*- coding: utf-8 -*- """Time Series Forest Regressor (TSF).""" __author__ = ["<NAME>", "kkoziara", "luiszugasti", "kanand77", "<NAME>"] __all__ = ["TimeSeriesForestRegressor"] import numpy as np from joblib import Parallel, delayed from sklearn.ensemble._forest import ForestRegressor from sklearn.tr...
2.890625
3
vectorc2/vectorc2/settings.py
sebastiankruk/vectorc2
11
9845
<filename>vectorc2/vectorc2/settings.py<gh_stars>10-100 """ Django settings for vectorc2 project. Copyright 2019 <NAME> <<EMAIL>> 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://w...
1.632813
2
datahandlers/wgisd.py
mikewoodson/ssl-transfer
0
9846
<filename>datahandlers/wgisd.py from torchvision.datasets.folder import pil_loader, accimage_loader, default_loader from torch import Tensor from pathlib import Path from enum import Enum from collections import namedtuple from torchvision import transforms as T import os import numpy as np import pdb import functools...
2.640625
3
SimpleCV/MachineLearning/query_imgs/get_imgs_geo_gps_search.py
nikhilgk/SimpleCV
2
9847
<reponame>nikhilgk/SimpleCV<filename>SimpleCV/MachineLearning/query_imgs/get_imgs_geo_gps_search.py #!/usr/bin/python # # So this script is in a bit of a hack state right now. # This script reads # # # # Graciously copied and modified from: # http://graphics.cs.cmu.edu/projects/im2gps/flickr_code.html #Image queryi...
2.609375
3
Chapter04/python/2.0.0/com/sparksamples/util.py
quguiliang/Machine-Learning-with-Spark-Second-Edition
112
9848
<gh_stars>100-1000 import os import sys from pyspark.sql.types import * PATH = "/home/ubuntu/work/ml-resources/spark-ml/data" SPARK_HOME = "/home/ubuntu/work/spark-2.0.0-bin-hadoop2.7/" os.environ['SPARK_HOME'] = SPARK_HOME sys.path.append(SPARK_HOME + "/python") from pyspark import SparkContext from pyspark import S...
2.765625
3
safemasks/resources/rest/router.py
Safemasks/safemasks-app
1
9849
""" """ from rest_framework import routers from safemasks.resources.rest.serializers import SupplierViewSet, TrustedSupplierViewSet # Routers provide an easy way of automatically determining the URL conf. ROUTER = routers.DefaultRouter() ROUTER.register(r"suppliers", SupplierViewSet, "suppliers") ROUTER.register(r"s...
1.867188
2
src/zope/testrunner/formatter.py
jamesjer/zope.testrunner
1
9850
<reponame>jamesjer/zope.testrunner<filename>src/zope/testrunner/formatter.py ############################################################################## # # Copyright (c) 2004-2008 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Ve...
1.882813
2
waterApp/migrations/0011_auto_20210911_1043.py
csisarep/groundwater_dashboard
0
9851
<reponame>csisarep/groundwater_dashboard # Generated by Django 2.2 on 2021-09-11 04:58 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('waterApp', '0010_auto_20210911_1041'), ] operations = [ migrations.AlterField( model_name...
1.398438
1
geomstats/geometry/stratified/__init__.py
shubhamtalbar96/geomstats
0
9852
"""The Stratified Space Geometry Package."""
0.871094
1
src/exporter/management/commands/test_export.py
xmdy/h9eNi8F5Ut
0
9853
from django.core.management import BaseCommand import logging # These two lines enable debugging at httplib level (requests->urllib3->http.client) # You will see the REQUEST, including HEADERS and DATA, and RESPONSE with HEADERS but without DATA. # The only thing missing will be the response.body which is not logged. ...
2.15625
2
dask/tests/test_highgraph.py
ianthomas23/dask
0
9854
from functools import partial import os import pytest import dask import dask.array as da from dask.utils_test import inc from dask.highlevelgraph import HighLevelGraph, BasicLayer, Layer from dask.blockwise import Blockwise from dask.array.utils import assert_eq def test_visualize(tmpdir): pytest.importorskip(...
2.171875
2
transference.py
webpwnized/cryptography
13
9855
# Requires pip install bitarray from bitarray import bitarray import argparse, math def derive_transfer_function(pTransferFunctionString: str) -> list: lTransferFunction = list(map(int, pTransferFunctionString.split(','))) lTransferFunctionValid = True lLengthTransferFunction = len(lTransferFunction) ...
2.859375
3
tests/test_client.py
mjcaley/spamc
0
9856
import pytest from aiospamc.client import Client from aiospamc.exceptions import ( BadResponse, UsageException, DataErrorException, NoInputException, NoUserException, NoHostException, UnavailableException, InternalSoftwareException, OSErrorException, OSFileException, CantCre...
2.171875
2
sunpy/conftest.py
tacaswell/sunpy
0
9857
<reponame>tacaswell/sunpy import os import tempfile import importlib import pytest import astropy import astropy.config.paths # Force MPL to use non-gui backends for testing. try: import matplotlib except ImportError: pass else: matplotlib.use('Agg') # Don't actually import pytest_remotedata because tha...
2.03125
2
qtcalendar/models.py
asmateus/PyQtCalendar
7
9858
''' Models for QtWidgets ''' from collections import deque from math import ceil import datetime as dt import calendar class EventInCalendar__Model: class Text: @staticmethod def getDefault(): return EventInCalendar__Model.Text() def __init__(self, event=None, overflow=Fal...
2.71875
3
python/orca/src/bigdl/orca/data/tf/data.py
Forest216/BigDL
0
9859
# # Copyright 2016 The BigDL Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
2.09375
2
tools/generate_serialization_header.py
StableCoder/vulkan-mini-libs-2
1
9860
<gh_stars>1-10 #!/usr/bin/env python3 import sys import getopt import xml.etree.ElementTree as ET def processVendors(outFile, vendors): outFile.writelines(["\nconstexpr std::array<std::string_view, ", str( len(vendors)), "> vendors = {{\n"]) for vendor in vendors: outFile.writelines([' \"', ...
2.4375
2
ampel/cli/AbsStockCommand.py
AmpelProject/Ampel-core
5
9861
#!/usr/bin/env python # -*- coding: utf-8 -*- # File : Ampel-core/ampel/cli/AbsStockCommand.py # License : BSD-3-Clause # Author : vb <<EMAIL>> # Date : 25.03.2021 # Last Modified Date: 25.03.2021 # Last Modified By : vb <<EMAIL>> from typing import Dict, Any, Optional, ...
1.960938
2
programmers/lv2/42888.py
KLumy/Basic-Algorithm
1
9862
from typing import List def solution(records: List[str]): logger = [] id_name = dict() message = {"Enter": "님이 들어왔습니다.", "Leave": "님이 나갔습니다."} for record in records: op, id, *name = record.split() if name: id_name[id] = name[0] if op in message: logger....
3.421875
3
app/nets.py
bobosoft/intrepyd
2
9863
<reponame>bobosoft/intrepyd """ Implementation of REST API for nets creation """ from flask import Blueprint, request from .utils import typename_to_type from .contexts import contexts nr = Blueprint('nets', __name__) def _create_bool_constant(func): context = request.get_json()['context'] if context is None:...
2.515625
3
tensorflow_addons/image/utils.py
Soroosh129/addons
1
9864
<gh_stars>1-10 # Copyright 2019 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 requ...
2.359375
2
tests/test_charge.py
fossabot/MolVS
1
9865
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for charge.py""" from __future__ import print_function from __future__ import unicode_literals from __future__ import division import logging from rdkit import Chem from molvs.standardize import Standardizer, standardize_smiles from molvs.charge i...
2.21875
2
backend/users/views.py
jochanmin/Blog
11
9866
<reponame>jochanmin/Blog from django.shortcuts import render from django.core import serializers from .models import User from django.forms.models import model_to_dict from rest_framework import status from rest_framework.response import Response from rest_framework.decorators import api_view, permission_classes from r...
2.078125
2
src/test/test_Location.py
MrRollyPanda/astral
0
9867
# -*- coding: utf-8 -*- from pytest import raises from astral import Astral, AstralError, Location import datetime import pytz def datetime_almost_equal(datetime1, datetime2, seconds=60): dd = datetime1 - datetime2 sd = (dd.days * 24 * 60 * 60) + dd.seconds return abs(sd) <= seconds def test_Location_N...
2.46875
2
__init__.py
minjunli/jsonc
2
9868
from .jsonc import load, loads, dump, dumps
1.078125
1
specs/d3d9caps.py
prahal/apitrace
1
9869
########################################################################## # # Copyright 2008-2009 VMware, Inc. # All Rights Reserved. # # 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 withou...
1.351563
1
miika_nlu/venv/Lib/site-packages/tqdm/_dist_ver.py
NimBuzz01/Project-Miika_SDGP
0
9870
<reponame>NimBuzz01/Project-Miika_SDGP<filename>miika_nlu/venv/Lib/site-packages/tqdm/_dist_ver.py<gh_stars>0 __version__ = '4.64.0'
0.996094
1
gym_flock/envs/old/mapping.py
katetolstaya/gym-flock
19
9871
import gym from gym import spaces, error, utils from gym.utils import seeding import numpy as np import configparser from os import path import matplotlib.pyplot as plt from matplotlib.pyplot import gca font = {'family': 'sans-serif', 'weight': 'bold', 'size': 14} class MappingEnv(gym.Env): def ...
2.34375
2
tensorflow/python/kernel_tests/lu_op_test.py
PaulWang1905/tensorflow
36
9872
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
2.03125
2
aligner/features/processing.py
zhouyangnk/Montreal-Forced-Aligner
1
9873
import multiprocessing as mp import subprocess import shutil import os from ..helper import make_path_safe, thirdparty_binary, filter_scp from ..exceptions import CorpusError def mfcc_func(directory, job_name, mfcc_config_path): # pragma: no cover log_directory = os.path.join(directory, 'log') raw_mfcc_path...
2.140625
2
ffai/util/bothelper.py
tysen2k/ffai
0
9874
""" A number of static methods for interpretting the state of the fantasy football pitch that aren't required directly by the client """ from ffai.core import Game, Action, ActionType from ffai.core.procedure import * from ffai.util.pathfinding import * from typing import Optional, List, Dict class ActionSequence: ...
3.359375
3
sb_backend/cli/cli.py
DmitriyGrigoriev/sb-fastapi
0
9875
# -*- coding: utf-8 -*- """sb-fastapi CLI root.""" import logging import click from sb_backend.cli.commands.serve import serve @click.group() @click.option( "-v", "--verbose", help="Enable verbose logging.", is_flag=True, default=False, ) def cli(**options): """sb-fastapi CLI root.""" if ...
2.078125
2
1-Chapter/htmlcomponents.py
DSandovalFlavio/Dashboards-Plotly-Dash
0
9876
import dash from dash import html app = dash.Dash(__name__) app.layout = html.Div(children=[html.H1('Data Science', style = {'textAlign': 'center', 'color': '#0FD08D', 'font-size': '...
2.765625
3
baadalinstallation/baadal/modules/vm_helper.py
iitd-plos/baadal2.0
8
9877
# -*- coding: utf-8 -*- ################################################################################### from gluon import current from helper import get_constant, execute_remote_cmd, config, get_datetime, \ log_exception, is_pingable, get_context_path from libvirt import * # @UnusedWildImport from log_handler ...
2.015625
2
third_party/webrtc/src/chromium/src/build/android/devil/android/sdk/aapt.py
bopopescu/webrtc-streaming-node
8
9878
<reponame>bopopescu/webrtc-streaming-node # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """This module wraps the Android Asset Packaging Tool.""" import os from devil.utils import cmd_helper from pylib...
2.078125
2
examples/Tests/Misc/Resources/PythonFile/basic.py
esayui/mworks
0
9879
<reponame>esayui/mworks setvar('nsamples', getvar('a') + getvar('b'))
0.945313
1
quacc/recipes/psi4/core.py
arosen93/HT-ASE
9
9880
<filename>quacc/recipes/psi4/core.py """Core recipes for Psi4""" from __future__ import annotations from dataclasses import dataclass from typing import Any, Dict from ase.atoms import Atoms from ase.calculators.psi4 import Psi4 from jobflow import Maker, job from monty.dev import requires try: import psi4 excep...
2.078125
2
UAS/UAS 11 & 12/main.py
Archedar/UAS
0
9881
#Main Program from Class import Barang import Menu histori = list() listBarang = [ Barang('Rinso', 5000, 20), Barang('Sabun', 3000, 20), Barang('Pulpen', 2500, 20), Barang('Tisu', 10000, 20), Barang('Penggaris', 1000, 20) ] while True: print(''' Menu 1. Tampilkan Barang 2. Tambahkan Barang 3. Ta...
3.734375
4
original/baselines/train/JointE+ONE.py
thunlp/JointNRE
186
9882
#coding:utf-8 import numpy as np import tensorflow as tf import os import time import datetime import ctypes import threading import json ll1 = ctypes.cdll.LoadLibrary lib_cnn = ll1("./init_cnn.so") ll2 = ctypes.cdll.LoadLibrary lib_kg = ll2("./init_know.so") class Config(object): def __init__(self): self.in...
2.171875
2
i2vec_cli/__main__.py
rachmadaniHaryono/i2vec_cli
0
9883
#!/usr/bin/env python3 """get tag from http://demo.illustration2vec.net/.""" # note: # - error 'ERROR: Request Entity Too Large' for file 1.1 mb # <span style="color:red;">ERROR: Request Entity Too Large</span> from collections import OrderedDict from pathlib import Path from pprint import pformat import imghdr import ...
2.609375
3
cherrypy/lib/cptools.py
debrando/cherrypy
2
9884
"""Functions for builtin CherryPy tools.""" import logging import re from hashlib import md5 import six from six.moves import urllib import cherrypy from cherrypy._cpcompat import text_or_bytes from cherrypy.lib import httputil as _httputil from cherrypy.lib import is_iterator # Conditional HTT...
2.390625
2
pyiomica/utilityFunctions.py
benstear/pyiomica
0
9885
'''Utility functions''' import multiprocessing from .globalVariables import * def readMathIOmicaData(fileName): '''Read text files exported by MathIOmica and convert to Python data Parameters: fileName: str Path of directories and name of the file containing data ...
2.953125
3
CRNitschke/get_sextract_thresholds.py
deapplegate/wtgpipeline
1
9886
<reponame>deapplegate/wtgpipeline #! /usr/bin/env python #adam-does# runs SeeingClearly to get the seeing and rms of the image, then uses those to get sextractor thresholds for CR detection #adam-use# use with CRNitschke pipeline #adam-call_example# call it like ./get_sextract_thresholds.py /path/flname.fits output_fil...
2.09375
2
python/labbox/api/_session.py
flatironinstitute/labbox
1
9887
<filename>python/labbox/api/_session.py import time import multiprocessing class Session: def __init__(self, *, labbox_config, default_feed_name: str): self._labbox_config = labbox_config pipe_to_parent, pipe_to_child = multiprocessing.Pipe() self._worker_process = multiprocessing.Process...
2.46875
2
aldryn_newsblog/tests/test_reversion.py
GabrielDumbrava/aldryn-newsblog
0
9888
# -*- coding: utf-8 -*- from __future__ import unicode_literals from unittest import skipIf try: from django.core.urlresolvers import reverse except ModuleNotFoundError: from django.urls import reverse from django.db import transaction from aldryn_reversion.core import create_revision as aldryn_create_revisio...
2.25
2
network/network.py
VirtualEmbryo/lumen_network
1
9889
# Library for the dynamics of a lumen network # The lumen are 2 dimensional and symmetric and connected with 1 dimensional tubes # # Created by <NAME>, 2018 # Modified by <NAME>--Serandour on 8/04/2019 """ network.py conf.init Defines the class network and associated functions Imports -------...
2.9375
3
scripts/upsampling_demo.py
always-newbie161/pyprobml
2
9890
# Illustrate upsampling in 2d # Code from <NAME> # https://machinelearningmastery.com/generative_adversarial_networks/ import tensorflow as tf from tensorflow import keras from numpy import asarray #from keras.models import Sequential from tensorflow.keras.models import Sequential #from keras.layers import UpSampl...
3.25
3
V2RaycSpider1225/src/BusinessCentralLayer/scaffold.py
njchj/V2RayCloudSpider
1
9891
<gh_stars>1-10 __all__ = ['scaffold', 'command_set'] from gevent import monkey monkey.patch_all() import csv import os import sys import time import shutil from typing import List import gevent from src.BusinessCentralLayer.setting import logger, DEFAULT_POWER, CHROMEDRIVER_PATH, \ REDIS_MASTER, SERVER_DIR_DAT...
1.65625
2
python/swap_header.py
daniestevez/gr-csp
19
9892
<reponame>daniestevez/gr-csp<gh_stars>10-100 #!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2016 <NAME> <<EMAIL>>. # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source co...
1.609375
2
start.py
gleenn/dfplayer
0
9893
<gh_stars>0 #!/usr/bin/python # # Start dfplayer. import argparse import os import shutil import subprocess import sys import time _PROJ_DIR = os.path.dirname(__file__) def main(): os.chdir(_PROJ_DIR) os.environ['LD_LIBRARY_PATH'] = '/lib:/usr/lib:/usr/local/lib' arg_parser = argparse.ArgumentParser(descr...
2.140625
2
Game_Mechanics.py
Finnder/Console-Based-Story-Game
0
9894
<gh_stars>0 def attack(): pass def defend(): pass def pass_turn(): pass def use_ability_One(kit): pass def use_ability_Two(kit): pass def end_Of_Battle(): pass
1.21875
1
AIY/voice/cloudspeech_demo.py
Pougnator/Prometheus
0
9895
#!/usr/bin/env python3 # Copyright 2017 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...
2.34375
2
options/base_option.py
lime-j/YTMT-Strategy-1
26
9896
<reponame>lime-j/YTMT-Strategy-1 import argparse import models model_names = sorted(name for name in models.__dict__ if name.islower() and not name.startswith("__") and callable(models.__dict__[name])) class BaseOptions(): def __init__(self): self.parser = argpar...
2.40625
2
bookstore/__init__.py
JanhaviSoni/Book-Recommendation-Analysis
23
9897
from flask import Flask, Response from flask_basicauth import BasicAuth from flask_cors import CORS, cross_origin import os #from flask_admin import Admin,AdminIndexView #from flask_admin.contrib.sqla import ModelView from flask_sqlalchemy import SQLAlchemy as _BaseSQLAlchemy from flask_migrate import Migrate, Migr...
2.515625
3
cobl/lexicon/management/commands/stats236.py
Bibiko/CoBL-public
0
9898
<reponame>Bibiko/CoBL-public<filename>cobl/lexicon/management/commands/stats236.py # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core.management import BaseCommand from cobl.lexicon.models import LanguageList, \ MeaningList, \ ...
1.992188
2
collation/test2.py
enabling-languages/dinka
1
9899
<filename>collation/test2.py<gh_stars>1-10 import pandas as pd from icu import Collator, Locale, RuleBasedCollator ddf = pd.read_csv("../word_frequency/unilex/din.txt", sep='\t', skiprows = range(2,5)) collator = Collator.createInstance(Locale('en_AU.UTF-8')) # https://stackoverflow.com/questions/13838405/custom-sor...
2.90625
3