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
utils/nlp.py
splovyt/SFPython-Project-Night
1
6500
import ssl import nltk from textblob import TextBlob from nltk.corpus import stopwords # set SSL try: _create_unverified_https_context = ssl._create_unverified_context except AttributeError: pass else: ssl._create_default_https_context = _create_unverified_https_context # download noun data (if required...
3.390625
3
toolbox/core/management/commands/celery_beat_resource_scraper.py
akshedu/toolbox
0
6501
from django_celery_beat.models import PeriodicTask, IntervalSchedule from django.core.management.base import BaseCommand from django.db import IntegrityError class Command(BaseCommand): def handle(self, *args, **options): try: schedule_channel, created = IntervalSchedule.objects.get_or_create...
2.21875
2
ppcls/data/preprocess/__init__.py
zhusonghe/PaddleClas-1
3,763
6502
<filename>ppcls/data/preprocess/__init__.py # Copyright (c) 2021 PaddlePaddle 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/licen...
1.421875
1
src/scalar_net/visualisations.py
scheeloong/lindaedynamics_icml2018
1
6503
# required modules import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from matplotlib import cm from matplotlib.colors import Normalize from mpl_toolkits.mplot3d import Axes3D from matplotlib.animation import FuncAnimation # two-dimesional version def plot_mse_loss_surface_2d(fi...
2.59375
3
tests/qconvolutional_test.py
kshithijiyer/qkeras
0
6504
# Copyright 2019 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
1.71875
2
discord/ext/ui/select.py
Lapis256/discord-ext-ui
0
6505
from typing import Optional, List, TypeVar, Generic, Callable import discord.ui from .item import Item from .select_option import SelectOption from .custom import CustomSelect def _default_check(_: discord.Interaction) -> bool: return True C = TypeVar("C", bound=discord.ui.Select) class Select(Item, Generic...
2.4375
2
ucscsdk/mometa/storage/StorageScsiLunRef.py
parag-may4/ucscsdk
9
6506
"""This module contains the general information for StorageScsiLunRef ManagedObject.""" from ...ucscmo import ManagedObject from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta from ...ucscmeta import VersionMeta class StorageScsiLunRefConsts(): pass class StorageScsiLunRef(ManagedObject): """Th...
1.984375
2
saxstools/fullsaxs.py
latrocinia/saxstools
0
6507
<filename>saxstools/fullsaxs.py from __future__ import print_function, absolute_import, division from sys import stdout as _stdout from time import time as _time import numpy as np try: import pyfftw pyfftw.interfaces.cache.enable() pyfftw.interfaces.cache.set_keepalive_time(10) rfftn = pyfftw.interfa...
1.78125
2
lib/generate_random_obs.py
zehuilu/Learning-from-Sparse-Demonstrations
8
6508
#!/usr/bin/env python3 import os import sys import time sys.path.append(os.getcwd()+'/lib') import random from dataclasses import dataclass, field from ObsInfo import ObsInfo def generate_random_obs(num_obs: int, size_list: list, config_data): """ config_file_name = "config.json" json_file = open(config_f...
2.546875
3
userbot/helper_funcs/misc.py
Abucuyy/Uciha
0
6509
<filename>userbot/helper_funcs/misc.py # TG-UserBot - A modular Telegram UserBot script for Python. # Copyright (C) 2019 Kandarp <https://github.com/kandnub> # # TG-UserBot 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 Sof...
2.140625
2
gym-multilayerthinfilm/utils.py
HarryTheBird/gym-multilayerthinfilm
10
6510
<filename>gym-multilayerthinfilm/utils.py import numpy as np def get_n_from_txt(filepath, points=None, lambda_min=400, lambda_max=700, complex_n=True): ntxt = np.loadtxt(filepath) if np.min(np.abs(ntxt[:, 0] - lambda_min)) > 25 or np.min(np.abs(ntxt[:, 0] - lambda_max)) > 25: print('No measurement data...
2.421875
2
pyrocco/__init__.py
joaopalmeiro/pyrocco
0
6511
__package_name__ = "pyrocco" __version__ = "0.1.0" __author__ = "<NAME>" __author_email__ = "<EMAIL>" __description__ = "A Python CLI to add the Party Parrot to a custom background image." __url__ = "https://github.com/joaopalmeiro/pyrocco"
1.023438
1
2020/day08/machine.py
ingjrs01/adventofcode
0
6512
<reponame>ingjrs01/adventofcode<gh_stars>0 class Machine(): def __init__(self): self.pointer = 0 self.accum = 0 self.visited = [] def run(self,program): salir = False while (salir == False): if (self.pointer in self.visited): return False...
3.296875
3
EduData/Task/__init__.py
BAOOOOOM/EduData
98
6513
# coding: utf-8 # 2019/8/23 @ tongshiwei
0.824219
1
010-round.py
richardvecsey/python-basics
3
6514
<filename>010-round.py """ Round a number -------------- Input (float) A floating point number (int) Number of decimals Default value is: 0 Output (float) Rounded number (int) Whether using the default decimals value, the return number ...
4.4375
4
service.py
Kleist/MusicPlayer
1
6515
<filename>service.py #!/usr/bin/env python3 import RPi.GPIO as GPIO from mfrc522 import SimpleMFRC522 import play import time class TagPlayer(object): def __init__(self): self._current = None self.reader = SimpleMFRC522() self._failed = 0 def step(self): id, text = self.read...
2.890625
3
mypy/defaults.py
ckanesan/mypy
0
6516
<gh_stars>0 import os MYPY = False if MYPY: from typing_extensions import Final PYTHON2_VERSION = (2, 7) # type: Final PYTHON3_VERSION = (3, 6) # type: Final PYTHON3_VERSION_MIN = (3, 4) # type: Final CACHE_DIR = '.mypy_cache' # type: Final CONFIG_FILE = 'mypy.ini' # type: Final SHARED_CONFIG_FILES = ['setup...
1.8125
2
skcriteria/preprocessing/push_negatives.py
elcolie/scikit-criteria
0
6517
#!/usr/bin/env python # -*- coding: utf-8 -*- # License: BSD-3 (https://tldrlegal.com/license/bsd-3-clause-license-(revised)) # Copyright (c) 2016-2021, <NAME>; Luczywo, Nadia # All rights reserved. # ============================================================================= # DOCS # ===============================...
2.03125
2
ingenico/direct/sdk/domain/customer_token.py
Ingenico/direct-sdk-python3
0
6518
# -*- coding: utf-8 -*- # # This class was auto-generated from the API references found at # https://support.direct.ingenico.com/documentation/api/reference/ # from ingenico.direct.sdk.data_object import DataObject from ingenico.direct.sdk.domain.address import Address from ingenico.direct.sdk.domain.company_informatio...
2.265625
2
inserter.py
pirate/macOS-global-autocomplete
23
6519
import time import pykeyboard # TODO: Replace following two lines with the code that activate the application. print('Activate the application 3 seconds.') time.sleep(3) k = pykeyboard.PyKeyboard() k.press_key(k.left_key) time.sleep(1) # Hold down left key for 1 second. k.release_key(k.left_key)
3.015625
3
tools/corpora.py
EleutherAI/megatron-3d
3
6520
import os import tarfile from abc import ABC, abstractmethod from glob import glob import shutil import random import zstandard """ This registry is for automatically downloading and extracting datasets. To register a class you need to inherit the DataDownloader class, provide name, filetype and url attributes, and (...
3.359375
3
othello_rl/qlearning/qlearning.py
aka256/othello-rl
0
6521
<filename>othello_rl/qlearning/qlearning.py from logging import getLogger logger = getLogger(__name__) class QLearning: """ Q-Learning用のクラス Attributes ---------- alpha : float 学習率α gamma : float 割引率γ data : dict Q-Learningでの学習結果の保存用辞書 init_value : float dataの初期値 """ def __init__(s...
3.109375
3
SearchService/test/unit/test_solr_interface.py
loftwah/appscale
790
6522
<gh_stars>100-1000 #!/usr/bin/env python import os import json import sys import unittest import urllib2 from flexmock import flexmock sys.path.append(os.path.join(os.path.dirname(__file__), "../../")) import solr_interface import search_exceptions class FakeSolrDoc(): def __init__(self): self.fields = [] cl...
2.578125
3
payabbhi/error.py
ppm-avinder/payabbhi-python
1
6523
class PayabbhiError(Exception): def __init__(self, description=None, http_status=None, field=None): self.description = description self.http_status = http_status self.field = field self._message = self.error_message() super(PayabbhiError, self).__init__(self...
2.75
3
src/mpu/__init__.py
TsinghuaAI/CPM-2-Pretrain
54
6524
# coding=utf-8 # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
1.1875
1
djangosige/apps/cadastro/models/empresa.py
MateusMolina/lunoERP
0
6525
# -*- coding: utf-8 -*- import os from django.db import models from django.db.models.signals import post_delete from django.dispatch import receiver from .base import Pessoa from djangosige.apps.login.models import Usuario from djangosige.configs.settings import MEDIA_ROOT def logo_directory_path(inst...
1.882813
2
WDJN/eval/eval.py
silverriver/Stylized_Dialog
21
6526
import os from nltk.translate.bleu_score import corpus_bleu from nltk.translate.bleu_score import SmoothingFunction import json from tqdm import tqdm, trange from random import sample import numpy as np import pickle import argparse import bert_eval_acc import svm_eval_acc smooth = SmoothingFunction() def eval_bleu...
2.765625
3
homeassistant/components/unifi/const.py
olbjan/home-assistant-1
7
6527
"""Constants for the UniFi component.""" import logging LOGGER = logging.getLogger(__package__) DOMAIN = "unifi" CONTROLLER_ID = "{host}-{site}" CONF_CONTROLLER = "controller" CONF_SITE_ID = "site" UNIFI_WIRELESS_CLIENTS = "unifi_wireless_clients" CONF_ALLOW_BANDWIDTH_SENSORS = "allow_bandwidth_sensors" CONF_BLOCK...
1.78125
2
coding_intereview/1656. Design an Ordered Stream.py
Jahidul007/Python-Bootcamp
2
6528
<reponame>Jahidul007/Python-Bootcamp<filename>coding_intereview/1656. Design an Ordered Stream.py class OrderedStream: def __init__(self, n: int): self.data = [None]*n self.ptr = 0 def insert(self, id: int, value: str) -> List[str]: id -= 1 self.data[id] = value if id...
3.90625
4
python/test/test_tree_dp.py
EQt/treelas
3
6529
import numpy as np from treelas import post_order, TreeInstance def test_demo_3x7_postord(): parent = np.array([0, 4, 5, 0, 3, 4, 7, 8, 5, 6, 7, 8, 9, 14, 17, 12, 15, 16, 19, 16, 17]) po = post_order(parent, include_root=True) expect = np.array([12, 11, 19, 20, 21, 14, 15, 18, 17, 1...
2.296875
2
lista01/rpc/ex01_cl.py
SD-CC-UFG/leonardo.fleury
0
6530
<reponame>SD-CC-UFG/leonardo.fleury<gh_stars>0 import xmlrpc.client def main(): s = xmlrpc.client.ServerProxy('http://localhost:9991') nome = input("Nome: ") cargo = input("Cargo (programador, operador): ") salario = float(input("Salário: ")) print("\n\n{}".format(s.atualiza_salario(nome, cargo...
2.796875
3
autocomplete/migrations/0001_initial.py
openshift-eng/art-dashboard-server
1
6531
<gh_stars>1-10 # Generated by Django 3.0.7 on 2020-07-27 19:23 import build.models from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='AutoCompleteRecord', fie...
1.96875
2
unet3d/config.py
fcollman/pytorch-3dunet
0
6532
import argparse import os import torch import yaml DEFAULT_DEVICE = 'cuda:0' def load_config(): parser = argparse.ArgumentParser(description='UNet3D training') parser.add_argument('--config', type=str, help='Path to the YAML config file', required=True) args = parser.parse_args() config = _load_conf...
2.578125
3
src/graph_transpiler/webdnn/backend/webgl/optimize_rules/simplify_channel_mode_conversion/simplify_channel_mode_conversion.py
gunpowder78/webdnn
1
6533
<filename>src/graph_transpiler/webdnn/backend/webgl/optimize_rules/simplify_channel_mode_conversion/simplify_channel_mode_conversion.py<gh_stars>1-10 from webdnn.backend.webgl.optimize_rules.simplify_channel_mode_conversion.simplify_nonsense_channel_mode_conversion import \ SimplifyNonsenseChannelModeConversion fro...
1.546875
2
script.video.F4mProxy/lib/flvlib/constants.py
akuala/REPO.KUALA
105
6534
<filename>script.video.F4mProxy/lib/flvlib/constants.py """ The constants used in FLV files and their meanings. """ # Tag type (TAG_TYPE_AUDIO, TAG_TYPE_VIDEO, TAG_TYPE_SCRIPT) = (8, 9, 18) # Sound format (SOUND_FORMAT_PCM_PLATFORM_ENDIAN, SOUND_FORMAT_ADPCM, SOUND_FORMAT_MP3, SOUND_FORMAT_PCM_LITTLE_ENDIAN, SOU...
2.09375
2
A2/semcor_chunk.py
Rogerwlk/Natural-Language-Processing
0
6535
<filename>A2/semcor_chunk.py from nltk.corpus import semcor class semcor_chunk: def __init__(self, chunk): self.chunk = chunk #returns the synset if applicable, otherwise returns None def get_syn_set(self): try: synset = self.chunk.label().synset() return synset except AttributeError: try: syns...
3.015625
3
gnn_model.py
thoang3/graph_neural_network_benchmark
0
6536
import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers from load_cora import load_cora from baseline_model import create_ffn from utils import run_experiment from utils import display_learning_curves # Graph convolution layer class GraphConvLayer(layers.Layer): def __init__( ...
2.546875
3
deps/lib/python3.5/site-packages/netdisco/discoverables/samsung_tv.py
jfarmer08/hassio
78
6537
"""Discover Samsung Smart TV services.""" from . import SSDPDiscoverable from ..const import ATTR_NAME # For some models, Samsung forces a [TV] prefix to the user-specified name. FORCED_NAME_PREFIX = '[TV]' class Discoverable(SSDPDiscoverable): """Add support for discovering Samsung Smart TV services.""" de...
3.21875
3
pyecsca/sca/re/__init__.py
scrambler-crypto/pyecsca
24
6538
<filename>pyecsca/sca/re/__init__.py<gh_stars>10-100 """Package for reverse-engineering.""" from .rpa import *
1.210938
1
sapmi/employees/migrations/0002_remove_employee_phone_alt.py
Juhanostby/django-apotek-sapmi
1
6539
<reponame>Juhanostby/django-apotek-sapmi # Generated by Django 3.2.5 on 2021-12-21 19:42 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('employees', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='employee', ...
1.429688
1
src/model/exception/emote_fetch_error.py
konrad2508/kokomi-discord-bot
2
6540
class EmoteFetchError(Exception): '''Exception stating that there was a problem while fetching emotes from a source.'''
2.03125
2
src/sim/basicExample/main.py
andremtsilva/dissertacao
0
6541
<gh_stars>0 """ This is the most simple scenario with a basic topology, some users and a set of apps with only one service. @author: <NAME> """ import os import time import json import random import logging.config import networkx as nx import numpy as np from pathlib import Path from yafs.core import Sim fro...
2.625
3
Backend/models/risklayerPrognosis.py
dbvis-ukon/coronavis
15
6542
from db import db class RisklayerPrognosis(db.Model): __tablename__ = 'risklayer_prognosis' datenbestand = db.Column(db.TIMESTAMP, primary_key=True, nullable=False) prognosis = db.Column(db.Float, nullable=False) # class RisklayerPrognosisSchema(SQLAlchemyAutoSchema): # class Meta: # strict ...
2.375
2
tests.py
smartfile/django-secureform
12
6543
<reponame>smartfile/django-secureform import os import unittest os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' import django if django.VERSION >= (1, 7): django.setup() from django import forms from django.db import models from django.forms.forms import NON_FIELD_ERRORS from django_secureform.forms import Secu...
2.578125
3
opencv/resizing.py
hackerman-101/Hacktoberfest-2022
1
6544
<gh_stars>1-10 import cv2 as cv import numpy as np cap = cv.VideoCapture(1) print(cap.get(cv.CAP_PROP_FRAME_WIDTH)) print(cap.get(cv.CAP_PROP_FRAME_HEIGHT)) cap.set(3,3000) cap.set(4,3000) print(cap.get(cv.CAP_PROP_FRAME_WIDTH)) print(cap.get(cv.CAP_PROP_FRAME_HEIGHT)) while (cap.isOpened()): ret , frame = cap...
2.546875
3
minibenchmarks/go.py
kevinxucs/pyston
1
6545
<reponame>kevinxucs/pyston # from pypy-benchmarks/own/chaos.py, with some minor modifications # (more output, took out the benchmark harness) # import random, math, sys, time SIZE = 9 GAMES = 200 KOMI = 7.5 EMPTY, WHITE, BLACK = 0, 1, 2 SHOW = {EMPTY: '.', WHITE: 'o', BLACK: 'x'} PASS = -1 MAXMOVES = SIZE*SIZE*3 TIME...
2.71875
3
tools/gen_usb_descriptor.py
BrianPugh/circuitpython
1
6546
# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # # SPDX-License-Identifier: MIT import argparse import os import sys sys.path.append("../../tools/usb_descriptor") from adafruit_usb_descriptor import audio, audio10, cdc, hid, mi...
2.4375
2
bclstm/train_meld.py
Columbine21/THUIAR-ERC
1
6547
from tqdm import tqdm import pandas as pd import numpy as np, argparse, time, pickle, random, os, datetime import torch import torch.optim as optim from model import MaskedNLLLoss, BC_LSTM from dataloader import MELDDataLoader from sklearn.metrics import f1_score, confusion_matrix, accuracy_score, classification_re...
2.171875
2
bin/p3starcoordcheck.py
emkailu/PAT3DEM
0
6548
<reponame>emkailu/PAT3DEM #!/usr/bin/env python import os import sys import argparse import pat3dem.star as p3s import math def main(): progname = os.path.basename(sys.argv[0]) usage = progname + """ [options] <coord star files> Output the coord star files after deleting duplicate particles """ args_def = {'mi...
3.109375
3
src/review_scraper.py
ryankirkland/voice-of-the-customer
0
6549
<filename>src/review_scraper.py from bs4 import BeautifulSoup import pandas as pd import requests import time import sys def reviews_scraper(asin_list, filename): ''' Takes a list of asins, retrieves html for reviews page, and parses out key data points Parameters ---------- List of ASINs (list of...
3.203125
3
lumberdata/metadata.py
cglumberjack/lumber_metadata
0
6550
# noinspection PyUnresolvedReferences import os import re # TODO I'm going to need to make a dictionary for my big list of stuff i care about and what's needed for # every file type.... RAF = ['EXIF:LensModel', 'MakerNotes:RawImageHeight', 'MakerNotes:RawImageWidth', 'EXIF:CreateDate', 'EXIF:ModifyDate', 'EXI...
2.3125
2
rlbench/task_environment.py
robfiras/RLBench
0
6551
import logging from typing import List, Callable import numpy as np from pyquaternion import Quaternion from pyrep import PyRep from pyrep.errors import IKError from pyrep.objects import Dummy, Object from rlbench import utils from rlbench.action_modes import ArmActionMode, ActionMode from rlbench.backend.exceptions ...
2.046875
2
tests/generic_relations/test_forms.py
Yoann-Vie/esgi-hearthstone
0
6552
from django import forms from django.contrib.contenttypes.forms import generic_inlineformset_factory from django.contrib.contenttypes.models import ContentType from django.db import models from django.test import TestCase from django.test.utils import isolate_apps from .models import ( Animal, ForProxyMode...
2.03125
2
src/sage/rings/polynomial/pbori/fglm.py
tamnguyen135/sage
1
6553
from .PyPolyBoRi import (BooleSet, Polynomial, BoolePolynomialVector, FGLMStrategy) def _fglm(I, from_ring, to_ring): r""" Unchecked variant of fglm """ vec = BoolePolynomialVector(I) return FGLMStrategy(from_ring, to_ring, vec).main() def fglm(I, from_ring, to_ring): ...
2.09375
2
ferry/embed/umap_reduce.py
coursetable/ferry
4
6554
<gh_stars>1-10 """ Uses UMAP (https://umap-learn.readthedocs.io/en/latest/index.html) to reduce course embeddings to two dimensions for visualization. """ import pandas as pd import umap from sklearn.preprocessing import StandardScaler from ferry import config courses = pd.read_csv( config.DATA_DIR / "course_embe...
2.609375
3
flora_fauna.py
zhumakova/ClassProject
0
6555
<reponame>zhumakova/ClassProject<filename>flora_fauna.py import inheritance class Flora: def __init__(self, name, lifespan, habitat, plant_type): self.name = name self.lifespan = lifespan self.habitat = habitat self.plant_type = plant_type self.plant_size = 0 class Fauna...
3.84375
4
jug/subcommands/demo.py
rdenham/jug
309
6556
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2017, <NAME> <<EMAIL>> # vim: set ts=4 sts=4 sw=4 expandtab smartindent: # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without ...
2.171875
2
search/controllers/simple/tests.py
ID2797370/arxiv-search
35
6557
<reponame>ID2797370/arxiv-search<filename>search/controllers/simple/tests.py """Tests for simple search controller, :mod:`search.controllers.simple`.""" from http import HTTPStatus from unittest import TestCase, mock from werkzeug.datastructures import MultiDict from werkzeug.exceptions import InternalServerError, No...
2.53125
3
kuri_wandering_robot/scripts/kuri_wandering_robot_executive_node.py
hcrlab/kuri_wandering_robot
0
6558
#!/usr/bin/env python # ROS Libraries import actionlib from actionlib_msgs.msg import GoalStatus from control_msgs.msg import JointTrajectoryControllerState, FollowJointTrajectoryAction, FollowJointTrajectoryGoal from kuri_wandering_robot.msg import Power from wandering_behavior.msg import WanderAction, WanderGoal impo...
2.40625
2
src/python/nimbusml/internal/entrypoints/trainers_lightgbmbinaryclassifier.py
montehoover/NimbusML
134
6559
# - Generated by tools/entrypoint_compiler.py: do not edit by hand """ Trainers.LightGbmBinaryClassifier """ import numbers from ..utils.entrypoints import EntryPoint from ..utils.utils import try_set, unlist def trainers_lightgbmbinaryclassifier( training_data, predictor_model=None, number_...
2.078125
2
Job Portal with Automated Resume Screening/gensim-4.1.2/gensim/test/test_rpmodel.py
Candida18/Job-Portal-with-Automated-Resume-Screening
3
6560
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 <NAME> <<EMAIL>> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Automated tests for checking transformation algorithms (the models package). """ import logging import unittest import numpy as np from gensim.corpora...
2.4375
2
playground/tianhaoz95/gan_getting_started/cgan_model.py
tianhaoz95/mangekyo
0
6561
import tensorflow as tf from tensorflow import keras class CondGeneratorModel(keras.Model): def __init__(self): super(CondGeneratorModel, self).__init__() # Expand 7*7*128 features into a (7,7,128) tensor self.dense_1 = keras.layers.Dense(7*7*256) self.reshape_1 = keras.layers.Resh...
2.734375
3
ahd2fhir/utils/resource_handler.py
miracum/ahd2fhir
3
6562
<reponame>miracum/ahd2fhir<filename>ahd2fhir/utils/resource_handler.py import base64 import datetime import logging import os import time from typing import List, Tuple import structlog import tenacity from averbis import Pipeline from fhir.resources.bundle import Bundle from fhir.resources.codeableconcept import Code...
1.929688
2
maestros/lookups.py
Infinityloopsistemas/SIVA
0
6563
# -*- coding: utf-8 -*- from selectable.decorators import login_required from maestros.models import TiposMedidasActuacion, TiposLimitesCriticos, TiposMedidasVigilancia, TiposTemperaturas, TiposFrecuencias, Zonas, Terceros, CatalogoEquipos, Personal, Consumibles, ParametrosAnalisis, Actividades, Etapas, Peligros, Tipos...
1.929688
2
julynter/oldcmd.py
dew-uff/julynter
9
6564
"""Define commands for Python 2.7""" import argparse import traceback from . import util from .cmd import run from .cmd import extractpipenv def main(): """Main function""" print("This version is not supported! It has limitted analysis features") parser = argparse.ArgumentParser(description='Analyze Jupyt...
2.515625
3
gpMgmt/bin/gppylib/test/unit/test_unit_gpcrondump.py
nurikk/gpdb
0
6565
<filename>gpMgmt/bin/gppylib/test/unit/test_unit_gpcrondump.py #!/usr/bin/env python import os import imp gpcrondump_path = os.path.abspath('gpcrondump') gpcrondump = imp.load_source('gpcrondump', gpcrondump_path) import unittest2 as unittest from datetime import datetime from gppylib import gplog from gpcrondump impo...
2.125
2
ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py
vsosrc/ambari
0
6566
#!/usr/bin/env python ''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License")...
1.617188
2
test/linux/gyptest-ldflags-from-environment.py
chlorm-forks/gyp
77
6567
<reponame>chlorm-forks/gyp #!/usr/bin/env python # Copyright (c) 2017 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies the use of linker flags in environment variables. In this test, gyp and build both run in same loca...
1.960938
2
tests/test_advanced.py
dhaitz/python-package-template
0
6568
<gh_stars>0 # -*- coding: utf-8 -*- from .context import sample def test_thoughts(): assert(sample.hmm() is None)
1.640625
2
binary_tree/m_post_order_traversal.py
dhrubach/python-code-recipes
0
6569
###################################################################### # LeetCode Problem Number : 145 # Difficulty Level : Medium # URL : https://leetcode.com/problems/binary-tree-postorder-traversal/ ###################################################################### from binary_search_tree.tree_node import TreeNo...
3.890625
4
dokuwiki.py
luminisward/python-dokuwiki
0
6570
# -*- coding: utf-8 -*- """This python module aims to manage `DokuWiki <https://www.dokuwiki.org/dokuwiki>`_ wikis by using the provided `XML-RPC API <https://www.dokuwiki.org/devel:xmlrpc>`_. It is compatible with python2.7 and python3+. Installation ------------ It is on `PyPi <https://pypi.python.org/pypi/dokuwik...
2.53125
3
setup.py
lvgig/test-aide
2
6571
import setuptools import re with open("README.md", "r") as fh: long_description = fh.read() # get version from _version.py file, from below # https://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package VERSION_FILE = "test_aide/_version.py" version_file_str = open(VERSION_FILE, "r...
2.015625
2
examples/pylab_examples/matshow.py
jbbrokaw/matplotlib
16
6572
"""Simple matshow() example.""" from matplotlib.pylab import * def samplemat(dims): """Make a matrix with all zeros and increasing elements on the diagonal""" aa = zeros(dims) for i in range(min(dims)): aa[i, i] = i return aa # Display 2 matrices of different sizes dimlist = [(12, 12), (15, ...
3.765625
4
setup.py
HeyLifeHD/rp-bp
6
6573
#! /usr/bin/env python3 import importlib import logging import os import subprocess from setuptools import setup from setuptools.command.install import install as install from setuptools.command.develop import develop as develop logger = logging.getLogger(__name__) stan_model_files = [ os.path.join("nonperiod...
1.90625
2
utils/data_utils.py
BorisMansencal/quickNAT_pytorch
0
6574
import os import h5py import nibabel as nb import numpy as np import torch import torch.utils.data as data from torchvision import transforms import utils.preprocessor as preprocessor # transform_train = transforms.Compose([ # transforms.RandomCrop(200, padding=56), # transforms.ToTensor(), # ]) class Imdb...
2.375
2
lib/common/app.py
auho/python-ETL
0
6575
<filename>lib/common/app.py import argparse import yaml import sys from .conf import MysqlConf from lib.db import mysql parser = argparse.ArgumentParser() parser.add_argument("--config", help="config file name", type=str, required=False, default='office') input_args = parser.parse_args() class PartConfig: def __...
2.5
2
design.py
StrangeArcturus/QtAndRequestParser-Project
0
6576
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'design.ui' # # Created by: PyQt5 UI code generator 5.15.4 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. from PyQt5 import QtC...
1.984375
2
EP_2019/py_impl/main.py
Alisa-lisa/conferences
5
6577
from simulation.car import spawn_drivers from simulation.passenger import spawn_passengers from simulation.core import World, Clock conf = { "x": 100, "y": 100, "drivers": 200, "users": 1000, "start": "2019-07-08T00:00:00", "end": "2019-07-08T00:01:00" } clock = Clock(conf["start"], conf["end"...
2.484375
2
Python/reverse_with_swap.py
avulaankith/Python
0
6578
<gh_stars>0 #!/bin/python3 import math import os import random import re import sys # # Complete the 'reverse_words_order_and_swap_cases' function below. # # The function is expected to return a STRING. # The function accepts STRING sentence as parameter. # def reverse_words_order_and_swap_cases(sentence): # Wr...
4.0625
4
playground/check_equal.py
INK-USC/hypter
11
6579
import json d1 = {} with open("/home/qinyuan/zs/out/bart-large-with-description-grouped-1e-5-outerbsz4-innerbsz32-adapterdim4-unfreeze-dec29/test_predictions.jsonl") as fin: for line in fin: d = json.loads(line) d1[d["id"]] = d["output"][0]["answer"] d2 = {} dq = {} with open("/home/qinyuan/zs/out...
2.59375
3
creeds/static/api1.py
MaayanLab/creeds
2
6580
<gh_stars>1-10 import json, requests from pprint import pprint CREEDS_URL = 'http://amp.pharm.mssm.edu/CREEDS/' response = requests.get(CREEDS_URL + 'search', params={'q':'STAT3'}) if response.status_code == 200: pprint(response.json()) json.dump(response.json(), open('api1_result.json', 'wb'), indent=4)
2.828125
3
admin/migrations/0041_course_color.py
rodlukas/UP-admin
4
6581
<reponame>rodlukas/UP-admin<filename>admin/migrations/0041_course_color.py # Generated by Django 2.2.3 on 2019-07-31 13:54 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("admin", "0040_auto_20190718_0938")] operations = [ migrations.AddField( ...
1.570313
2
exercicios-Python/ex083.py
pedrosimoes-programmer/exercicios-python
0
6582
# Forma sem bugs expressao = (str(input('Digite a expressão: '))) pilhaParenteses = [] for v in expressao: if v == '(': pilhaParenteses.append('(') elif v == ')': if len(pilhaParenteses) > 0: pilhaParenteses.pop() else: pilhaParenteses.append(')') bre...
3.890625
4
src/inspectortodo/todo.py
code-acrobat/InspectorTodo
8
6583
# Copyright 2018 TNG Technology Consulting GmbH, Unterföhring, Germany # Licensed under the Apache License, Version 2.0 - see LICENSE.md in project root directory import logging from xml.sax.saxutils import escape log = logging.getLogger() class Todo: def __init__(self, file_path, line_number, content): ...
2.53125
3
generators.py
FabLabUTFSM/fusm_usage_report
0
6584
import dash_core_components as dcc import dash_html_components as html import plotly.graph_objs as go import plotly.express as px from plotly.subplots import make_subplots import pandas as pd import math from datetime import datetime, time from utils import MONTH_NAMES, month_range def section(title, content, gray=Fa...
2.671875
3
gengine/app/tests_old/test_groups.py
greck2908/gamification-engine
347
6585
# -*- coding: utf-8 -*- from gengine.app.tests.base import BaseDBTest from gengine.app.tests.helpers import create_user, update_user, delete_user, get_or_create_language from gengine.metadata import DBSession from gengine.app.model import AuthUser class TestUserCreation(BaseDBTest): def test_user_creation(self):...
2.3125
2
Lib/fontTools/designspaceLib/__init__.py
guorenxi/fonttools
0
6586
from __future__ import annotations import collections import copy import itertools import math import os import posixpath from io import BytesIO, StringIO from textwrap import indent from typing import Any, Dict, List, MutableMapping, Optional, Tuple, Union from fontTools.misc import etree as ET from fontTools.misc i...
2.25
2
ax/models/torch/posterior_mean.py
dme65/Ax
1
6587
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from typing import Any, Optional, Tuple import torch from botorch.acquisition.acquisition import AcquisitionFunction ...
1.84375
2
src/drivers/velodyne_nodes/test/velodyne_node.test.py
fanyu2021/fyAutowareAuto
0
6588
# Copyright 2018 the Autoware Foundation # # 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 ...
1.914063
2
example.py
manhcuogntin4/Color-transfer
0
6589
# USAGE # python example.py --source images/ocean_sunset.jpg --target images/ocean_day.jpg # import the necessary packages from color_transfer import color_transfer import numpy as np import argparse import cv2 def show_image(title, image, width = 300): # resize the image to have a constant width, just to # make di...
3.40625
3
scripts/registration_pipeline.py
heethesh/Argoverse-HDMap-Update
0
6590
import copy import numpy as np import open3d as o3d from tqdm import tqdm from scipy import stats import utils_o3d as utils def remove_ground_plane(pcd, z_thresh=-2.7): cropped = copy.deepcopy(pcd) cropped_points = np.array(cropped.points) cropped_points = cropped_points[cropped_points[:, -1] > z_thresh...
2.34375
2
neo4j/aio/__init__.py
michaelcraige/neo4j-python-driver
1
6591
<filename>neo4j/aio/__init__.py #!/usr/bin/env python # -*- encoding: utf-8 -*- # Copyright (c) 2002-2019 "Neo4j," # Neo4j Sweden AB [http://neo4j.com] # # This file is part of Neo4j. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. ...
1.84375
2
python/setup.py
bubriks/feature-store-api
49
6592
import os import imp from setuptools import setup, find_packages __version__ = imp.load_source( "hsfs.version", os.path.join("hsfs", "version.py") ).__version__ def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name="hsfs", version=__version__, install_...
1.546875
2
src/server_py3/aps/src/wes/api/v1/users/__init__.py
kfrime/yonder
0
6593
#!/usr/bin/env python3 from . import signup, signin, signout, update, info, detail
1.0625
1
hubconf.py
jamesmcclain/pytorch-multi-class-focal-loss
81
6594
<reponame>jamesmcclain/pytorch-multi-class-focal-loss # Optional list of dependencies required by the package dependencies = ['torch'] from focal_loss import FocalLoss, focal_loss
1.539063
2
autotest/ogr/ogr_gpx.py
HongqiangWei/gdal
3
6595
<reponame>HongqiangWei/gdal #!/usr/bin/env python ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test GPX driver functionality. # Author: <NAME> <even dot rouault at mines dash paris dot org> # #####################################...
1.515625
2
mwp_solver/models/sausolver.py
max-stack/MWP-SS-Metrics
0
6596
# Code Taken from https://github.com/LYH-YF/MWPToolkit # -*- encoding: utf-8 -*- # @Author: <NAME> # @Time: 2021/08/21 04:59:55 # @File: sausolver.py import random import torch from torch import nn import copy from module.Encoder.rnn_encoder import BasicRNNEncoder from module.Embedder.basic_embedder import BasicEmbed...
2.203125
2
rosetta/tests/test_parallel.py
rafacarrascosa/rosetta
1
6597
<filename>rosetta/tests/test_parallel.py import unittest from functools import partial import pandas as pd from pandas.util.testing import assert_frame_equal, assert_series_equal import numpy as np import threading from StringIO import StringIO from rosetta.parallel import parallel_easy, pandas_easy from rosetta.para...
2.765625
3
modules/helper/subtitles/subtitles.py
sdelcore/video-event-notifier-old
0
6598
import time import srt import re import datetime from mqtthandler import MQTTHandler INIT_STATUS={ "video": { "title": None, "series_title": None, "season": None, "episode": None }, "time": None, "events": None } class SubtitleHandler: subtitles = [] phrases = ...
2.890625
3
thecsvparser.py
rbago/CEBD1160_Class4_hwk
0
6599
#!/usr/bin/env python import os import numpy as np import pandas as pd os.getcwd() # Request for the filename # Current version of this script works only with TSV type files mainFilename = input('Input your file name (diabetes.tab.txt or housing.data.txt): ') print() # To create proper dataframe, transforming it wi...
3.640625
4