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/__init__.py | biubiubiiu/SpamClassification | 0 | 12771451 | from .logger import logger_setup
__all__ = [
'logger_setup'
]
| 1.09375 | 1 |
testing/test_table_api.py | dianfu/pyflink-faq | 14 | 12771452 | ################################################################################
# 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... | 1.796875 | 2 |
scripts/gather/test_gather_browser.py | acutesoftware/rawdata | 10 | 12771453 | <filename>scripts/gather/test_gather_browser.py
#!/usr/bin/python3
# test_gather_browser.py
import unittest
import os
import sys
root_fldr = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'rawdata'))
imp_folder = root_fldr + os.sep + 'gather'
print(imp_folder)
sys.path.insert(1, imp_folder)
import bro... | 2.5625 | 3 |
betterproto/tests/generate.py | boukeversteegh/python-betterproto | 4 | 12771454 | #!/usr/bin/env python
import os
# Force pure-python implementation instead of C++, otherwise imports
# break things because we can't properly reset the symbol database.
os.environ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] = "python"
import importlib
import json
import subprocess
import sys
from typing import Generato... | 2.0625 | 2 |
backend/api/view/RegistrationView.py | forgeno/CMPUT404-group-project | 0 | 12771455 | <filename>backend/api/view/RegistrationView.py<gh_stars>0
from rest_framework import generics, permissions, status
from rest_framework.response import Response
from django.contrib.auth.models import User
from ..models import AuthorProfile
from ..serializers import CreateUserSerializer
from django.db import transaction
... | 2.15625 | 2 |
django/mysite/polls/migrations/0005_auto_20170815_0447.py | vithd/vithd.github.io | 0 | 12771456 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-15 04:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('polls', '0004_auto_20170811_0444'),
]
operations = [
migrations.RemoveField... | 1.75 | 2 |
ranked/datasets/replay.py | Delaunay/Ranked | 0 | 12771457 | import json
from ranked.datasets import Matchup
from ranked.models import Batch, Match
class ReplayMatchup(Matchup):
"""Returns a batch of matchups, each batch have each players once.
The matches are sorted by ascending timestamp.
This means that the first batch represent the first match for each player... | 3.3125 | 3 |
keras-multi-input/mixed_training.py | 26medias/GAN-toolkit | 0 | 12771458 | # USAGE
# python mixed_training.py --dataset Houses-dataset/Houses\ Dataset/
# import the necessary packages
from pyimagesearch import datasets
from pyimagesearch import models
from sklearn.model_selection import train_test_split
from keras.layers.core import Dense
from keras.models import Model
from keras.optimizers ... | 3.28125 | 3 |
Preparation/largesmall.py | jaiswalIT02/pythonprograms | 0 | 12771459 | <filename>Preparation/largesmall.py
l = [4, 3, 5, 4, -3,10,2,33,98,4]
print(l)
min = l[0]
max = l[0]
n = len(l)
for i in range(1, n):
curr = l[i]
if curr < min:
min=curr
if curr>max:
max=curr
print("Min=",min,"Max=",max)
| 3.4375 | 3 |
show_next_error.py | 77QingLiu/SAS-Syntax-and-Theme | 9 | 12771460 | <filename>show_next_error.py
import sublime, sublime_plugin, re
class ShowNextErrorCommand(sublime_plugin.TextCommand):
def run(self, edit):
s = sublime.load_settings('SAS_Package.sublime-settings')
err_regx = s.get('err-regx', "(^(error|warning:)|uninitialized|[^l]remerge|Invalid data for)(?! (the .{4,15} p... | 2.3125 | 2 |
Transynther/x86/process.py | ljhsiun2/medusa | 9 | 12771461 | <gh_stars>1-10
#!/usr/bin/env python3
import sys, os, codecs
from fuzz import MemAddress
def mkdir_if(dir):
if not os.path.exists(dir):
os.mkdir(dir, 0o755)
def leakage_attr(faultyLoad, faultType, leakageHist, previousMem):
ht = st = zero = expected = unknown = _4k = same = False
for k in leakage... | 2.203125 | 2 |
Algo-1/week3/2-Min-Max-Heap/min_max_heap.py | pepincho/Python101-and-Algo1-Courses | 2 | 12771462 | class MinMaxHeap:
# Checks if a binary tree is a min/max heap.
@staticmethod
def is_valid(values, index, level, min_value, max_value):
if index >= len(values):
return True
if (values[index] > min_value and values[index] < max_value) == False:
return False
... | 3.984375 | 4 |
swagger_fuzzer/utils.py | cadesalaberry/swagger-fuzzer | 25 | 12771463 | <reponame>cadesalaberry/swagger-fuzzer<filename>swagger_fuzzer/utils.py
""" Various helpers
"""
import json
from datetime import datetime
class CustomJsonEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, datetime):
return o.isoformat()
return super().default(o)
| 1.859375 | 2 |
poodle/core/profile/__init__.py | danielkauffmann/poodle | 0 | 12771464 | from .get_profile import MoodleProfile
__all__ = ["MoodleProfile"]
| 1.046875 | 1 |
main.py | mcascallares/hand-luggage | 1 | 12771465 | #!/usr/bin/env python
#
# Copyright 2007 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 o... | 2.421875 | 2 |
Python/devtests/openImage.py | TimelabTech/apollo15 | 0 | 12771466 | <filename>Python/devtests/openImage.py<gh_stars>0
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
from astropy.io import fits
hdu_list = fits.open("../../HST/u2c70104t/u2c70104t_c0f.fits")
hdu_list.info()
image_data = hdu_list[0].data
print(type(image_data))... | 2.5 | 2 |
antioch/plugins/ask/plugin.py | philchristensen/antioch | 15 | 12771467 | # antioch
# Copyright (c) 1999-2019 <NAME>
#
#
# See LICENSE for details
"""
Client-side prompt support.
"""
from zope.interface import provider
from antioch import IPlugin
def ask(p, question, callback, *args, **kwargs):
details = dict(
question = question,
)
p.exchange.send_message(p.caller.... | 2.25 | 2 |
python_programming/basics/file_reader.py | JoshuaTPritchett/30DaysCoding | 0 | 12771468 | <filename>python_programming/basics/file_reader.py
'''
Simple file reader object that will teach
me how to properly read files
'''
#hmmm
import json
from os.path import exists
class FileReader(object):
def __init__(self, strings, mfile):
self.strings = strings
self.mfile = mfile
self.cfile ... | 3.9375 | 4 |
tesa/preprocess_annotations.py | clementjumel/master_thesis | 2 | 12771469 | """
Script to preprocess and save the annotated queries and the annotations.
Usages:
tests:
python preprocess_annotations.py --no_save
regular usage:
python preprocess_annotations.py
"""
from database_creation.annotation_task import AnnotationTask
from toolbox.parsers import standard_parser, a... | 2.96875 | 3 |
jaegerserver/apps.py | the-bombers/jaeger | 0 | 12771470 | from django.apps import AppConfig
class JaegerserverConfig(AppConfig):
name = 'jaegerserver'
| 1.125 | 1 |
src/app/main/form.py | YiNNx/OAuth2.0 | 0 | 12771471 | <reponame>YiNNx/OAuth2.0<filename>src/app/main/form.py
' wtf表单 '
__author__ = 'YiNN'
from wtforms.fields import simple,RadioField,IntegerField
from wtforms import Form,validators,widgets
class LoginForm(Form):
'''Form'''
email = simple.StringField(
widget=widgets.TextInput(),
validators=[
... | 2.578125 | 3 |
topicmodel/dataprep/extractbiovectors.py | tedunderwood/biographies | 0 | 12771472 | <filename>topicmodel/dataprep/extractbiovectors.py
chars2get = set()
with open('biofic2take.tsv', encoding = 'utf-8') as f:
for line in f:
fields = line.strip().split('\t')
charid = fields[0]
chars2get.add(charid)
outlines = []
with open('../biofic50/biofic50_doctopics.txt', encoding = 'u... | 2.65625 | 3 |
gifmaker.py | tumaatti/gifmaker | 0 | 12771473 | <reponame>tumaatti/gifmaker<filename>gifmaker.py<gh_stars>0
#!/usr/bin/env python3
import argparse
import os
parser = argparse.ArgumentParser(
description='Simple way to generate .gif-files from videofiles'
)
parser.add_argument('input', metavar='I', type=str, help='specify input file')
parser.add_argument('outpu... | 2.703125 | 3 |
tests/__init__.py | bisguzar/flask-mongoengine | 1 | 12771474 | import unittest
import flask
import mongoengine
class FlaskMongoEngineTestCase(unittest.TestCase):
"""Parent class of all test cases"""
def setUp(self):
self.app = flask.Flask(__name__)
self.app.config['MONGODB_DB'] = 'test_db'
self.app.config['TESTING'] = True
self.ctx = self... | 2.5 | 2 |
test/test_drive.py | albertpatterson/google-api-helpers | 1 | 12771475 | from google_api_helpers import auth
from google_api_helpers import drive
from test.utils import drive as test_drive
from test.utils import auth as test_auth
import pytest
@pytest.fixture(scope="session", autouse=True)
def getTestCredentials():
return test_auth.getTestCredentials()
class TestDrive(test_drive.Wi... | 2.359375 | 2 |
spider/html_downloader.py | pq27120/xgb_spider | 0 | 12771476 | #!/usr/bin/env python2
# -*- coding: UTF-8 -*-
import requests
import html_parser
import urllib2
# from ruokuaicode import RClient
import exceptions
from PIL import Image
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.common.by impor... | 2.296875 | 2 |
sparselt/linear_transform.py | LiamBindle/splint | 0 | 12771477 | <gh_stars>0
import numpy as np
import scipy.sparse
class SparseLinearTransform:
_input_core_shape = None
_input_core_dims = None
_output_core_shape = None
_output_core_dims = None
_matrix = None
_order = None
_vfunc = None
def __init__(self, weights, row_ind, col_ind,
... | 2.234375 | 2 |
desafio_primalidad.py | davagni/PythonPractice | 0 | 12771478 | <reponame>davagni/PythonPractice
import math
def es_primo(numero):
# <NAME> Wilson
num = math.factorial(numero - 1) + 1
if num % numero == 0:
return True
else:
return False
def run():
numero = int(input('Ingresa un numero: '))
if es_primo(numero) and numero != 1:
prin... | 3.921875 | 4 |
main.py | Mo-Shakib/Wordle-Solver | 1 | 12771479 | import words
words_database = words.words()
yellow_letters = []
my_letters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
defaults = ["BRICK","JUMPY","VOZHD","GLENT","WAQFS"]
defaults_2 = [['b','r','i','c','k'],['j','u','m','p','y'],['v','o','z','h','d'],[... | 3.484375 | 3 |
lib/emulator/nn/max_pool.py | amohant4/myFramework | 0 | 12771480 | <filename>lib/emulator/nn/max_pool.py
"""
Created on Tue May 08 17:18:00 2018
@Author: <NAME>, <NAME>
"""
import numpy as np
import emulator as em
from emulator.operation import Operation
class max_pool(Operation):
def __init__(self, i, ksize, strides, padding, name):
super(max_pool,self).__init__([i])
self.ksiz... | 2.578125 | 3 |
dbutils/actions/query.py | Yash-Amin/DbUtils | 0 | 12771481 | """Query mode"""
import os
import re
import csv
import sys
import argparse
from bson import json_util
from dataclasses import dataclass
from pymongo.mongo_client import MongoClient
from typing import Dict, List, Pattern, TextIO
from dbutils import constants
from dbutils.utils import get_comma_separated_fields, str2boo... | 2.9375 | 3 |
account_check/models/account_bank_statement_line.py | odoo-mastercore/odoo-argentina | 1 | 12771482 | <reponame>odoo-mastercore/odoo-argentina
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, _
from ... | 1.953125 | 2 |
Handlers/DataAPIHandler.py | Nuit-De-L-Info-2016-STRI-DL/Backend | 0 | 12771483 | # -*- coding: utf-8 -*-
import os
import tornado.web
from zipfile import ZipFile
from tools import ListingFiles
folder_path = 'data/'
zip_file = './export.zip'
def list_all_export_file():
"""
Make a list of important 'data' files (important files to export).
:return: important file list
"""
tem... | 2.9375 | 3 |
gym_ds3/schedulers/deepsocs/parameter_server.py | EpiSci/SoCRATES | 6 | 12771484 |
import numpy as np
import tensorflow as tf
from gym_ds3.schedulers.deepsocs.average_reward import AveragePerStepReward
from gym_ds3.schedulers.deepsocs.compute_baselines import get_piecewise_linear_fit_baseline
from gym_ds3.schedulers.deepsocs.deepsocs_scheduler import Deepsocs
from gym_ds3.schedulers.models.deepsocs... | 2.078125 | 2 |
deepcontact/layers.py | largelymfs/deepcontact | 27 | 12771485 | #! /usr/bin/env python
#################################################################################
# File Name : ./layer.py
# Created By : yang
# Creation Date : [2017-11-15 12:51]
# Last Modified : [2017-11-15 13:09]
# Description : s... | 2.75 | 3 |
composite_draineli_sed.py | bjweiner/sedfitting | 1 | 12771486 |
# Take two sets of Draine & Li SEDs and add them with varying
# mixes using gamma, according to
# j_nu = (1-gamma)*j_nu[umin,umin] + gamma*j_nu[umin,umax]
# so it's intended that
# sedset1 is the power law distrib of U
# sedset2 is for the diffuse medium and has a single U=Umin
# these are SEDs produced by convert_d... | 2.203125 | 2 |
fastestimator/architecture/cyclegan.py | rajesh1226/fastestimator | 1 | 12771487 | # Copyright 2019 The FastEstimator 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 appl... | 2.5625 | 3 |
data/text/tokenizer.py | anh/TransformerTTS | 894 | 12771488 | from typing import Union
import re
from phonemizer.phonemize import phonemize
from data.text.symbols import all_phonemes, _punctuations
class Tokenizer:
def __init__(self, start_token='>', end_token='<', pad_token='/', add_start_end=True, alphabet=None,
model_breathing=True):
if no... | 3.046875 | 3 |
prez/renderers/spaceprez/spaceprez_feature_collection_renderer.py | surroundaustralia/Prez | 2 | 12771489 | from typing import Dict, Optional, Union
from fastapi.responses import Response, JSONResponse, PlainTextResponse
from rdflib import Graph
from rdflib.namespace import DCAT, DCTERMS, RDFS
from connegp import MEDIATYPE_NAMES
from config import *
from renderers import Renderer
from profiles.spaceprez_profiles import oai... | 2.234375 | 2 |
api/models/unique_file.py | merwane/shield | 0 | 12771490 | from mongoengine import *
import datetime
class UniqueFile(Document):
filename = StringField()
file_size = FloatField(default=0) # megabytes by default
file_type = StringField()
labels = ListField(default=[])
checksum = StringField()
added_at = DateTimeField(default=datetime.datetime.utcnow) | 2.546875 | 3 |
services/dynamic-sidecar/tests/unit/test_docker_utils.py | mrnicegyu11/osparc-simcore | 0 | 12771491 | <reponame>mrnicegyu11/osparc-simcore
# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
from typing import AsyncIterable
import aiodocker
import pytest
from simcore_service_dynamic_sidecar.core.docker_utils import get_volume_by_label
from simcore_service_dynamic_sidecar.core.errors import VolumeN... | 1.867188 | 2 |
tournamentmasters/command_tournament_master.py | jorgeparavicini/FourWins | 1 | 12771492 | <reponame>jorgeparavicini/FourWins<filename>tournamentmasters/command_tournament_master.py<gh_stars>1-10
from bots import BaseBot
from tournamentmasters.tournament_master import TournamentMaster
class CommandTournamentMaster(TournamentMaster):
def __init__(self, bot_1: BaseBot, bot_2: BaseBot, grid_width: int, g... | 2.78125 | 3 |
homework_01/game_of_life.py | zunigjor/BI-PYT | 1 | 12771493 | # Homework 01 - Game of life
#
# Your task is to implement part of the cell automata called
# Game of life. The automata is a 2D simulation where each cell
# on the grid is either dead or alive.
#
# State of each cell is updated in every iteration based state of neighbouring cells.
# Cell neighbours are cells that ar... | 4.25 | 4 |
loader/fis_load.py | gwu-libraries/vivo-load | 2 | 12771494 | from fis_entity import *
from utility import valid_college_name, valid_department_name, xml_result_generator, remove_extra_args
import os
GWU = "The George Washington University"
class Loader:
def __init__(self, filename, data_dir,
gwids=None, entity_class=None, field_to_entity=None, field_renam... | 2.640625 | 3 |
get_snaps.py | mark-bell-tna/webarchive | 0 | 12771495 | #!/home/ec2-user/WEBARCH/env/bin/python3
from bs4 import BeautifulSoup
from urllib.request import urlopen
import re
from time import sleep
prefix = "https://webarchive.nationalarchives.gov.uk/"
#20121204113457/
page = "https://www.gov.uk/government/how-government-works"
def crawl_versions(url,url_file,skip_list = se... | 3.34375 | 3 |
travelist/lib/flickr.py | ibz/travelist | 0 | 12771496 | from datetime import datetime
import time
import traceback
import urllib
import urllib2
from xml.dom import minidom
from django.core import mail
from travelist import utils
import settings
def call(method, **params):
response = urllib2.urlopen("http://flickr.com/services/rest?api_key=%s&method=%s&%s"
... | 2.40625 | 2 |
openelex/tests/test_transform_registry.py | Mpopoma/oe-core | 156 | 12771497 | from unittest import TestCase
from mock import Mock
from openelex.base.transform import registry
class TestTransformRegistry(TestCase):
def test_register_with_validators(self):
mock_transform = Mock(return_value=None)
mock_transform.__name__ = 'mock_transform'
mock_validator1 = Mock(retur... | 2.59375 | 3 |
tests/params/test_param.py | TradDog/pyro | 0 | 12771498 | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
from copy import copy
from unittest import TestCase
import numpy as np
import torch
import torch.optim
from torch import nn as nn
from torch.distributions import constraints
import pyro
from tests.common import assert_equal
cla... | 2.28125 | 2 |
turnovertools/mediaobject.py | morganwl/turnovertools | 0 | 12771499 | #!/usr/bin/env python3
from abc import ABCMeta
import collections.abc
class MediaObject(object):
"""
Parent class for all media objects. Not meant to be instantiated directly.
"""
__wraps_type__ = type(None)
__default_data__ = []
__requires_properties__ = []
@classmethod
def wrap_list... | 3.09375 | 3 |
main.py | doravante/bot-carona-tg | 0 | 12771500 | import sys
import time
import bot
def main():
TOKEN = sys.argv[1]
b = bot.Bot(TOKEN)
print 'Listening ...'
b.notifyOnMessage(run_forever=True)
if __name__ == '__main__':
main();
| 2.0625 | 2 |
pdkit/tremor_processor.py | gkroussos/pdkit | 21 | 12771501 | <reponame>gkroussos/pdkit
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2018 Birkbeck College. All rights reserved.
#
# Licensed under the MIT license. See file LICENSE for details.
#
# Author(s): <NAME>
import sys
import logging
import numpy as np
import pandas as pd
from scipy import interpolate, signa... | 2.8125 | 3 |
src/flickr/boundingbox.py | dballesteros7/master-thesis-2015 | 0 | 12771502 | class BoundingBox:
def __init__(self, top: float, right: float, bottom: float, left: float):
self.top = top
self.right = right
self.bottom = bottom
self.left = left
def to_flickr_bounding_box(self):
return '{self.left}, {self.bottom}, {self.right}, {self.top}'.format(sel... | 3.015625 | 3 |
examples/chalicelib/blueprints/authed.py | cuenca-mx/agave | 3 | 12771503 | <reponame>cuenca-mx/agave
from functools import wraps
from typing import Callable
from chalice import Blueprint
class AuthedBlueprint(Blueprint):
"""
This dummy class is an example of Authentication/Authorization blueprint.
"""
def route(self, path: str, **kwargs):
"""
Builds route ... | 2.875 | 3 |
pyseq/objstage.py | chaichontat/PySeq2500 | 9 | 12771504 | <filename>pyseq/objstage.py
#!/usr/bin/python
"""Illumina HiSeq2500 :: Objective Stage
Uses commands found on `hackteria
<www.hackteria.org/wiki/HiSeq2000_-_Next_Level_Hacking>`_
The objective can move between steps 0 and 65535, where step 0 is
the closest to the stage. Each objective stage step is about ... | 2.796875 | 3 |
dl/_utils.py | jjjkkkjjj/pytorch.dl | 2 | 12771505 | import os, cv2
import torch
from torch import nn
import numpy as np
def weights_path(_file_, _root_num, dirname):
basepath = os.path.dirname(_file_)
backs = [".."]*_root_num
model_dir = os.path.abspath(os.path.join(basepath, *backs, dirname))
return model_dir
def _check_ins(name, val, cls, allow_none... | 2.328125 | 2 |
x7/view/tests/canvas.py | gribbg/x7-view | 0 | 12771506 | <gh_stars>0
import tkinter as tk
root = tk.Tk()
canvas = tk.Canvas(root, width=600, height=400)
canvas.pack()
canvas.create_line((0, 0, 600, 400), fill='blue')
def button():
print('Button pressed, calling "image %s"' % image)
# (self._w, 'scale') + args
canvas.tk.call(canvas._w, 'image', '-foo', '-bar'... | 3.109375 | 3 |
app/helpers/markdown.py | mrakinola/simple-fastapi-blog | 0 | 12771507 | <filename>app/helpers/markdown.py
from fastapi import HTTPException, status
from markdown import markdown
from os.path import join
from typing import Text
def read_markdown(filename: str) -> dict[str, Text]:
path = join("app/page_content", filename)
try:
with open(path, "r", encoding="utf-8") as file_... | 3.125 | 3 |
reaction.py | ricciolino/rs-framework | 0 | 12771508 | #!/usr/bin/python3.6
class Reaction:
# the sets of reactants, inhibitors and products of the reaction
name = None
reactants = set()
inhibitors = set()
products = set()
# the creation of a reaction is made through the called of a function in which all the controls are performed, so we can
... | 4.0625 | 4 |
usaspending_api/references/models/overall_totals.py | g4brielvs/usaspending-api | 217 | 12771509 | from django.db import models
class OverallTotals(models.Model):
id = models.AutoField(primary_key=True)
create_date = models.DateTimeField(auto_now_add=True, blank=True, null=True)
update_date = models.DateTimeField(auto_now=True, null=True)
fiscal_year = models.IntegerField(blank=True, null=True)
... | 1.921875 | 2 |
tests/test_conv.py | DuinoDu/backbone-neck | 0 | 12771510 | <filename>tests/test_conv.py
# -*- coding: utf-8 -*-
from .context import backbone_neck
import unittest
import sys
from backbone_neck.gluon.nn import conv
from backbone_neck.gluon.nn import ConvModule
import numpy as np
import mxnet as mx
def _input(h=128, w=128):
try:
import mxnet.ndarray as nd
exce... | 2.359375 | 2 |
Validation/RecoB/test/validation_customJet_cfg.py | ckamtsikis/cmssw | 852 | 12771511 | from __future__ import print_function
# The following comments couldn't be translated into the new config version:
#! /bin/env cmsRun
import FWCore.ParameterSet.Config as cms
process = cms.Process("validation")
import FWCore.ParameterSet.VarParsing as VarParsing
options = VarParsing.VarParsing ('analysis')
# load th... | 1.6875 | 2 |
Tokenizer/tokenizer.py | lucapascarella/T5_Replication_Package | 3 | 12771512 | import sentencepiece as spm
import argparse
def main():
print("ciao")
parser = argparse.ArgumentParser()
parser.add_argument("-input", "--input", type=str, default="data/train.txt",
help="tokenizer input file")
parser.add_argument("-model_prefix", "--model_prefix", type=str,... | 3.03125 | 3 |
research/tests/models/test_subject.py | ZviBaratz/pylabber | 3 | 12771513 | import pandas as pd
from datetime import date, timedelta
from django.conf import settings
from django.core.exceptions import ValidationError
from django.test import TestCase
from research.models.choices import DominantHand, Sex, Gender
from ..factories import SubjectFactory
class SubjectModelTestCase(TestCase):
... | 2.4375 | 2 |
find_duplicateVocab.py | PhilippPede/StudyApp | 0 | 12771514 | import pandas as pd
filename = "dictionary.csv"
df_vocab = pd.read_csv(filename)
print("Duplicates:")
df_duplicated = df_vocab[df_vocab[["Chinese", "PinYin"]].duplicated(keep=False)][["Chinese", "PinYin"]]
if df_duplicated.shape[0] == 0:
print("===== [OK] No duplicates found =====")
else:
print(df_duplicate... | 3.65625 | 4 |
WEB/login/urls.py | JoseCarlosPa/CECEQ-GO | 1 | 12771515 | <reponame>JoseCarlosPa/CECEQ-GO<filename>WEB/login/urls.py
# Importar la libreria para URLS
from django.urls import path
# Uso del "punto" para referenciar esta libreria e importar el views
from . import views
urlpatterns = [
# primero se pondra el nombre de la ruta a llama
# Se pone el nombre views seguido ... | 2.15625 | 2 |
scrapi/harvesters/opensiuc.py | wearpants/scrapi | 34 | 12771516 | """
Harvester for the OpenSIUC API at Southern Illinois University for the SHARE project
More information available here:
https://github.com/CenterForOpenScience/SHARE/blob/master/providers/edu.siu.opensiuc.md
An example API call: http://opensiuc.lib.siu.edu/do/oai/?verb=ListRecords&metadataPrefix=oai_dc&from=2014-10... | 1.890625 | 2 |
app/routes.py | AbdManian/WebDigiLabel | 0 | 12771517 | from flask import render_template, request
from app import app
@app.route('/', methods=['GET', 'POST'])
@app.route('/index', methods=['GET', 'POST'])
def index():
info = dict(title='DigiLabel')
files = request.files.getlist("file")
for file in files:
print("Content: ", file.filename)
return re... | 2.671875 | 3 |
bin/find_genes.py | Mxrcon/Savio_alignments_nf | 0 | 12771518 | <reponame>Mxrcon/Savio_alignments_nf
#!/usr/bin/env python3
from Bio import SeqIO
import sys
import os
#basic_args
input_file = sys.argv[1]
gene_name = sys.argv[2]
#script
output_name = input_file.split(".")[0]
for seq_record in SeqIO.parse(input_file , 'genbank'):
for feature in seq_record.features:
if ... | 2.71875 | 3 |
fasp/scripts/FASPScript14.py | STRIDES-Codes/Sample-search-based-on-clinical-phenotypic-and-sample-attributes | 4 | 12771519 | ''' Query Search SRA tables for 1K Genomes data, access files via SRA DRS ids'''
# IMPORTS
import sys
from fasp.search import DiscoverySearchClient
def main(argv):
searchClient = DiscoverySearchClient('https://ga4gh-search-adapter-presto-public.prod.dnastack.com', debug=False)
query = """SELECT s.su_submitter_... | 2.484375 | 2 |
python_basics/src/2_data_type/test_list.py | YingVickyCao/testPython | 0 | 12771520 | def create_empty_list():
phone_device_types = []
print(phone_device_types)
return
def access_list_item():
phone_device_types = ["IOS", "Android"]
print(phone_device_types) # ['IOS', 'Android']
print(phone_device_types[0])
print(phone_device_types[0].title())
# -1 = last item. 倒数第一个
... | 4.3125 | 4 |
__init__.py | FangmingXie/mctseq_over_under_splitting | 1 | 12771521 | <reponame>FangmingXie/mctseq_over_under_splitting
import time
import logging
import glob
import os
import numpy as np
import pandas as pd
import collections
# data structures
GC_matrix = collections.namedtuple('GC_matrix', ['gene', 'cell', 'data'])
| 1.882813 | 2 |
urwidDisplay.py | abid-mujtaba/fetchheaders | 1 | 12771522 | <filename>urwidDisplay.py
#!/usr/bin/python
#
# Copyright 2012 <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 ... | 2.828125 | 3 |
base/migrations/0002_auto_20210117_0922.py | shah-deep/Smart-Guidance | 2 | 12771523 | <gh_stars>1-10
# Generated by Django 3.1.2 on 2021-01-17 09:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='topic',
name='entry',
... | 1.75 | 2 |
weather/views.py | RobMilinski/WeatherProj | 0 | 12771524 | from django.shortcuts import render
import urllib.request
import json
from datetime import datetime
from .city_weather import CityWeather
#locations given by Uni assignment
loc1_details = CityWeather("Lake District National Park", "54.4609", "-3.0886")
loc2_details = CityWeather("Corfe Castle", "50.6395", "-2.0566")
l... | 2.640625 | 3 |
answers/api/views/answers_viewsets.py | NicolasMuras/Lookdaluv | 1 | 12771525 | <filename>answers/api/views/answers_viewsets.py<gh_stars>1-10
from answers.api.serializers.answers_serializers import AnswerSerializer
from modules.api.views.general_views import GeneralViewSet
class AnswerViewSet(GeneralViewSet):
serializer_class = AnswerSerializer
model_to_format = AnswerSerializer.Meta.... | 1.359375 | 1 |
case/api_test/conftest.py | lzpsgh/AscTrio | 5 | 12771526 | # import pytest
#
# from case.conftest import api_data
#
#
# @pytest.fixture(scope="function")
# def testcase_data(request):
# testcase_name = request.function.__name__
# return api_data.get(testcase_name)
| 1.984375 | 2 |
digsby/src/tests/testgui/uberdemos/CapabilitiesBarDemo.py | ifwe/digsby | 35 | 12771527 | from DemoApp import App
import wx
import gettext
gettext.install('Digsby', './locale', unicode=True)
from gui.capabilitiesbar import CapabilitiesBar
class Frame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self,None,title='Simple Menu Test')
self.panel=wx.Panel(self)
self.Bind(wx.EVT_... | 2.375 | 2 |
dmt/cechmate_wrap.py | arksch/fuzzy-eureka | 0 | 12771528 | """
Parser for cechmate format of simplicial complex
"""
from itertools import chain, combinations
from cechmate import Cech, Rips, Alpha
import numpy as np
from scipy.sparse import coo_matrix
from dmt.morse_complex import MorseComplex
from dmt.perseus import save_points_perseus_brips, load_points_perseus_brips
def... | 2.34375 | 2 |
venv/Lib/site-packages/flask_codemirror/fields.py | natemellendorf/configpy | 4 | 12771529 | <filename>venv/Lib/site-packages/flask_codemirror/fields.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | 2.6875 | 3 |
vendor/deadline/custom/plugins/MayaPype/DeadlineMayaBatchFunctions.py | kalisp/pype-setup | 5 | 12771530 | from __future__ import print_function
import json
import os
import re
import subprocess
import maya.cmds
import maya.mel
# The version that Redshift fixed the render layer render setup override locking issue
# Prior versions will need to use the workaround in the unlockRenderSetupOverrides function
REDSHIFT_RENDER_S... | 2.0625 | 2 |
mmseg/distillation/distillers/segmentation_distiller.py | pppppM/mmsegmentation-distiller | 35 | 12771531 | <reponame>pppppM/mmsegmentation-distiller
import torch.nn as nn
import torch.nn.functional as F
import torch
from mmseg.core import add_prefix
from mmseg.ops import resize
from mmcv.runner import load_checkpoint
from ..builder import DISTILLER,build_distill_loss
from mmseg.models import build_segmentor
from mmseg.mod... | 1.96875 | 2 |
packages/reporting-server/rest_server/repositories/report/test_fleet_state.py | baviera08/romi-dashboard | 23 | 12771532 | # conflicts with isort because of local non-relative import
# pylint: disable=wrong-import-order
import unittest
from fastapi.testclient import TestClient
from models.tortoise_models.fleet import Fleet, Robot
from models.tortoise_models.fleet_state import FleetState, RobotStateEnum
from rest_server.app import get_app
... | 2.25 | 2 |
train.py | ashok-arjun/simple-super-resolution | 0 | 12771533 | import torch
import torchvision
import torch.nn as nn
import torch.optim as optim
import torch.backends.cudnn as cudnn
from torch.utils.data import DataLoader
from utils import get_most_recent_checkpoint,get_test_set,get_training_set, set_seed
from math import log10
from model.srcnn_upconv7 import Upconv
from model.rdn... | 2.4375 | 2 |
plenum/test/cli/mock_output.py | steptan/indy-plenum | 0 | 12771534 | <reponame>steptan/indy-plenum<gh_stars>0
from prompt_toolkit.output import Output
class MockOutput(Output):
def __init__(self, recorder=None):
self.writes = []
self.recorder = recorder
def fileno(self):
raise NotImplementedError
def cursor_up(self, amount):
raise NotImple... | 2.3125 | 2 |
users/signals.py | swasthikcnayak/sushiksha-website | 0 | 12771535 | <gh_stars>0
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
from users.tasks import send_email
from .models import Profile, Pomodoro, Reward
@receiver(post_save, sender=User)
def create_profile(sender, instance, created, **kwargs):
i... | 2.078125 | 2 |
rate/urls.py | Kennedy-karuri/Awards | 0 | 12771536 | from django.urls import path,include
from . import views
from rate import views as user_views
from django.conf.urls.static import static
from django.conf import settings
from django.conf.urls import url
urlpatterns=[
path('',views.home,name = 'home'),
path('accounts/register/', views.register, name='register')... | 2.03125 | 2 |
2-resources/python-data-generation/generate-random-data-into-dynamodb.py | eengineergz/Lambda | 0 | 12771537 | import boto.dynamodb2
from boto.dynamodb2.table import Table
from boto.dynamodb2.fields import HashKey
from boto.regioninfo import RegionInfo
from boto.dynamodb2.layer1 import DynamoDBConnection
from faker import Factory
import uuid
import time
try:
sessions = Table(
table_name='usertable',
schema=... | 2.328125 | 2 |
dfpipeline/DateTransformer.py | IBM/dataframe-pipeline | 2 | 12771538 | ##############################################################################
# Copyright 2020 IBM Corp. 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
#
# htt... | 2.15625 | 2 |
flyingsim/data/airportrouteloader.py | mavrakis/flyingsim | 0 | 12771539 | <reponame>mavrakis/flyingsim
from google.appengine.ext import bulkload
from google.appengine.api import datastore_types
from google.appengine.ext import search
from google.appengine.ext import db
from google.appengine.api import datastore_entities
from google.appengine.api import datastore
from google.appengine... | 2.140625 | 2 |
frets.py | mariuszlitwin/frets | 0 | 12771540 | <gh_stars>0
#!/usr/bin/python3
from colorama import Fore, Back
class frets:
tuning = list()
max_string_name_len = 0;
frets_count = 0;
strings = dict()
NOTES = ('E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B', 'C', 'C#', 'D', 'D#')
def __init__(self,
tuning=('E', 'A', 'D', 'G')... | 2.8125 | 3 |
DeepSentiment/GetSentiment.py | AbhinavBhatnagar/DeepSentiment | 1 | 12771541 | <gh_stars>1-10
import requests
import json
import subprocess
import os
class DeepSentiment:
def __init__(self):
self.parameter = []
self.text = ""
self.sentiment = ""
self.sentiment_score = 0
self.proc = None
def run_server(self):
call_ = ['nohup','java', '-jar'... | 2.546875 | 3 |
Python/kraken/core/objects/operators/kl_operator.py | goshow-jp/Kraken | 0 | 12771542 | """Kraken - objects.operators.kl_operator module.
Classes:
KLOperator - Splice operator object.
"""
import pprint
import re
from kraken.core.maths import MathObject, Mat44, Xfo, Vec2, Vec3
from kraken.core.objects.object_3d import Object3D
from kraken.core.objects.operators.operator import Operator
from kraken.core... | 2.234375 | 2 |
model/CNN_model/train_script.py | nicolepanek/Thermophile_classification | 0 | 12771543 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import argparse
import torch
import torch.optim as optim
import torch.nn as nn
from torch.autograd import Variable
import os
from torch.utils.data import TensorDataset, DataLoader
from sklearn.model_selection import train_test_split
import thermod... | 2.53125 | 3 |
cm_custom/api/item.py | libermatic/cm_custom | 1 | 12771544 | # -*- coding: utf-8 -*-
import frappe
from toolz.curried import (
compose,
merge,
unique,
concat,
valmap,
groupby,
first,
excepts,
keyfilter,
map,
filter,
)
import html
from erpnext.portal.product_configurator.utils import (
get_products_for_website,
get_product_setti... | 1.757813 | 2 |
qwilt/qsig/__init__.py | Qwilt/Qsig-Token-Python | 1 | 12771545 | <reponame>Qwilt/Qsig-Token-Python<filename>qwilt/qsig/__init__.py
# -*- coding: utf-8 -*-
from .qsig import Qsig, QsigError
__all__ = ['Qsig', 'QsigError'] | 1.453125 | 1 |
misc/zip/Cura-master/plugins/PostProcessingPlugin/Script.py | criscola/G-Gen | 1 | 12771546 | <filename>misc/zip/Cura-master/plugins/PostProcessingPlugin/Script.py
# Copyright (c) 2015 <NAME>
# Copyright (c) 2017 Ultimaker B.V.
# The PostProcessingPlugin is released under the terms of the AGPLv3 or higher.
from UM.Logger import Logger
from UM.Signal import Signal, signalemitter
from UM.i18n import i18nCatalog
... | 1.898438 | 2 |
src/app/entities/hashing_algorithms/sha1.py | dieisabel/cypherman | 0 | 12771547 | """Module for SHA1 hashing algorithm"""
__all__ = ['SHA1HashingAlgorithm']
import hashlib
from entities.hashing_algorithms import IHashingAlgorithm
class SHA1HashingAlgorithm(IHashingAlgorithm):
"""SHA1 hashing algorithm
Attributes:
name: Algorithm name
bits: Amount of checksum bits
... | 3.25 | 3 |
hornet/backend/tasks/apis/api_schema.py | defnngj/test_dev06 | 0 | 12771548 | from projects.models import Project
from ninja import Schema
from typing import List, Any
class TaskIn(Schema):
"""任务入参"""
project: int
name: str
describe: str = None
cases: list
class ResultOut(Schema):
"""测试报告返回"""
name: str
passed: int
error: int
failure: int
skipped: ... | 2.234375 | 2 |
src/baldor/quaternion.py | fsuarez6/baldor | 9 | 12771549 | <filename>src/baldor/quaternion.py
#!/usr/bin/env python
"""
Functions to operate quaternions.
.. important:: Quaternions :math:`w + ix + jy + kz` are represented as :math:`[w, x, y, z]`.
"""
import math
import numpy as np
# Local modules
import baldor as br
def are_equal(q1, q2, rtol=1e-5, atol=1e-8):
"""
R... | 4.21875 | 4 |
bridge.py | kharidiron/DSTcord | 0 | 12771550 | <reponame>kharidiron/DSTcord
#!/usr/bin/env python3
import asyncio
import re
import aiofiles
from discord.ext import commands
import watchgod
import yaml
description = '''
A DST to Discord Bridge.
Relies on some hackery using named pipes when starting the DST server.
I'll document that bit later.
'''
with open(... | 2.453125 | 2 |