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 |
|---|---|---|---|---|---|---|
Fund.py | jacobgarder/FundInfo-Python | 0 | 49200 | <reponame>jacobgarder/FundInfo-Python
from TAA import TAA
class Fund:
def __init__(self, id, name):
self.id = id
self.name = name
self.NAV = TAA.getNAV(id)
self.MA6 = TAA.getMA(id, 120)
self.MA10 = TAA.getMA(id, 200)
self.oneMonth = TAA.getChangePercent(id, "month"... | 2.53125 | 3 |
message_models.py | stefanSuYiGuo/FlaskAPI | 0 | 49201 | <filename>message_models.py<gh_stars>0
from flask_sqlalchemy import SQLAlchemy
from flask import Flask
from datetime import datetime
app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///" + "E:/Moses/College_Life/Year3_2/Software_Development_Workshop_III/Code/practice1/second.db"
app.config["SQLAL... | 2.4375 | 2 |
YandexLanguage.py | klepik1990/yandexTestUI | 0 | 49202 | <reponame>klepik1990/yandexTestUI<filename>YandexLanguage.py<gh_stars>0
from Page import CustomSeleniumLib
class YandexLanguage(CustomSeleniumLib):
ROBOT_LIBRARY_SCOPE = 'GLOBAL'
locators = {"MAIN_PAGE_LANGUAGE_BUTTON": "css=div[class='dropdown2 dropdown2_switcher_link i-bem']",
"MAIN_PAGE_MO... | 2.65625 | 3 |
Step10_test_ensemble.py | lyoshiwo/resume_job_matching | 37 | 49203 | # encoding=utf8
import numpy as np
from sklearn import cross_validation
import pandas as pd
import os
import time
from keras.models import Sequential, model_from_json
import util
def score_lists(list_1, list_2):
count = 0
total = len(list_1)
print total
for i in range(total):
if list_1[i] == l... | 2.328125 | 2 |
target_decisioning_engine/tests/test_request_provider.py | adobe/target-python-sdk | 3 | 49204 | <reponame>adobe/target-python-sdk
# Copyright 2021 Adobe. All rights reserved.
# This file is licensed to you 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
# ... | 2.078125 | 2 |
model/networkmodel.py | boti996/szdoga | 0 | 49205 | from abc import ABC, abstractmethod
class NetworkModel(ABC):
@abstractmethod
def get_model(self):
pass
| 2.703125 | 3 |
test.py | JettChenT/Encrypto | 4 | 49206 | <reponame>JettChenT/Encrypto
import random
import pprint
from fastapi.testclient import TestClient
from app import app
client = TestClient(app)
def getRandLetter():
return chr(random.randint(ord("a"), ord("z")))
def getRandWord():
wlen = 10
wlst = [getRandLetter() for _ in range(wlen)]
word = "".joi... | 2.59375 | 3 |
ejercicio 19.py | Davidpadilla1234/taller_estructura-secuencial | 0 | 49207 | """
Entradas:
Cantidad de naranjas ---> int ---> X
precio por docena--->float--->Y
valor venta--->float--->K
Salidas:
numero de docenas--->float--->docena
costo--->float--->precio
ganancia--->float--->ganancia
porcentaje ganancia--->float--->porcentaje
"""
X = int ( input ( "Numero de naranjas: " ))
Y = float ( input (... | 3.859375 | 4 |
src/third_party/wiredtiger/test/suite/test_rollback_to_stable24.py | benety/mongo | 0 | 49208 | #!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# 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 code form or as a com... | 1.3125 | 1 |
onmt/Utils.py | KTH1234/deep_summ | 0 | 49209 | <filename>onmt/Utils.py<gh_stars>0
import torch
from torch.autograd import Variable
def aeq(*args):
"""
Assert all arguments have the same value
"""
arguments = (arg for arg in args)
first = next(arguments)
assert all(arg == first for arg in arguments), \
"Not all arguments have the sam... | 2.515625 | 3 |
traitcuration/traits/datasources/zooma.py | joj0s/trait-curation | 2 | 49210 | <filename>traitcuration/traits/datasources/zooma.py
"""
This module contains all the functionality that uses ZOOMA to retrieve mapping suggestions and create the suggested
terms in the app's database.
"""
import requests
import logging
from django.db import transaction
from django_admin_conf_vars.global_vars import co... | 2.09375 | 2 |
pyaz/cosmosdb/mongodb/restorable_database/__init__.py | py-az-cli/py-az-cli | 0 | 49211 | from .... pyaz_utils import _call_az
def list(instance_id, location):
'''
List all the versions of all the mongodb databases that were created / modified / deleted in the given restorable account.
Required Parameters:
- instance_id -- InstanceId of the Account
- location -- Location
'''
re... | 2.328125 | 2 |
2021/2/2.py | JoseFilipeFerreira/AdventOfCode | 0 | 49212 | with open('input', 'r') as file:
aim = 0
horizontal = 0
depth = 0
simple_depth=0
for line in file:
[com, n] = line.split(' ')
n = int(n)
if com == 'forward':
horizontal += n
depth += aim * n
elif com == 'down':
aim += n
... | 3.46875 | 3 |
fastapi_helpers/routes/routers/RouterGenerator.py | finalsa/fastapi-helpers | 2 | 49213 | from fastapi import APIRouter
from ormar import Model
from typing import Type, Dict, NewType
from pydantic import BaseModel
from fastapi_helpers.crud import BaseCrud
from typing import (
List, Dict, Optional, Union, TypeVar
)
from fastapi import (
APIRouter, Request, Depends,
)
from fastapi_helpers.crud import ... | 2.265625 | 2 |
gala/potential/frame/core.py | akeemlh/gala | 86 | 49214 | <gh_stars>10-100
__all__ = ['FrameBase']
# This package
from ..common import CommonBase
class FrameBase(CommonBase):
ndim = 3
def __init__(self, *args, units=None, **kwargs):
parameter_values = self._parse_parameter_values(*args, **kwargs)
self._setup_frame(parameters=parameter_values,
... | 1.953125 | 2 |
helper/markup.py | sushi-irc/nigiri | 1 | 49215 | <gh_stars>1-10
def get_occurances(haystack,needle,l=[],start=0,end=-1):
""" return a list with all indices of needle in haystack """
i = haystack.find(needle,start)
if i == -1: return l
return get_occurances(haystack,needle,l+[i],i+1)
def tuple_to_list(t):
""" Convert a markup tuple:
(text,[(color,pos),...])... | 3 | 3 |
0557_ReverseWordsInAString(3).py | yingzhuo1994/LeetCode | 0 | 49216 | class Solution:
# 1st solution
# O(n) time | O(n) space
def reverseWords(self, s: str) -> str:
lst = []
start = 0
for i in range(len(s)):
if s[i] == " ":
self.reverse(lst, start, i - 1)
start = i + 1
lst.append(s[i])
sel... | 3.484375 | 3 |
setup.py | tuunit/cobry | 2 | 49217 | <gh_stars>1-10
from setuptools import setup
with open('README.md', 'r') as f:
long_description = f.read()
setup(
name='cobry',
version = '0.1.1',
author = '<NAME>',
author_email = '<EMAIL>',
license='BSD 3-Clause License',
url='https://github.com/tuunit/cobry',
description='Yet another... | 1.3125 | 1 |
alipay/aop/api/domain/AlipayMarketingActivityBatchqueryModel.py | antopen/alipay-sdk-python-all | 0 | 49218 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayMarketingActivityBatchqueryModel(object):
def __init__(self):
self._activity_status = None
self._merchant_id = None
self._page_num = None
self._page_size = N... | 1.929688 | 2 |
nats_messenger/tests/test_durable_messenger.py | tombenke/py-msgp | 1 | 49219 | <filename>nats_messenger/tests/test_durable_messenger.py
"""Test the messenger module"""
import unittest
import asyncio
from loguru import logger
from nats_messenger.messenger import Messenger
from nats_messenger.tests.config_test import (
URL,
CREDENTIALS,
CLUSTER_ID,
CLIENT_ID,
TEST_PAYLOAD,
... | 2.546875 | 3 |
test/test_ames.py | camille-chanel/ames | 0 | 49220 | <filename>test/test_ames.py
"""
Tests for `ames` module.
"""
import pytest
from ames import ames
class TestAmes(object):
@classmethod
def setup_class(cls):
pass
def test_something(self):
pass
@classmethod
def teardown_class(cls):
pass
| 1.664063 | 2 |
UE4Parse/Provider/Vfs/DirectoryStorageProvider.py | zbx911/pyUE4Parse | 13 | 49221 | <filename>UE4Parse/Provider/Vfs/DirectoryStorageProvider.py<gh_stars>10-100
from functools import singledispatchmethod
from typing import Union, TYPE_CHECKING, List, Dict, Optional, Tuple
from .DirectoryStorage import DirectoryStorage
from ..Common import GameFile
from ...IoObjects.FImportedPackage import FPackageId
... | 2.3125 | 2 |
AppImageBuilder/app_dir/bundlers/factory.py | gouchi/appimage-builder | 0 | 49222 | <reponame>gouchi/appimage-builder<filename>AppImageBuilder/app_dir/bundlers/factory.py
# Copyright 2020 <NAME>
#
# 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 restriction, incl... | 2 | 2 |
almoxarifado/migrations/0013_auto_20171009_1843.py | rvmoura96/projeto-almoxarifado | 1 | 49223 | <filename>almoxarifado/migrations/0013_auto_20171009_1843.py<gh_stars>1-10
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-09 21:43
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('almoxar... | 1.617188 | 2 |
playground/auto_sharding_solver/test_sharding_spec.py | yf225/alpa | 114 | 49224 | from hlo import ShardingSpec, ShardingSpecType
from cluster_env import ClusterEnvironment
from common import compute_bytes
def test_tile():
cluster_env = ClusterEnvironment([[0, 1, 2], [3, 4, 5]], [1,1], [1,1], None)
sharding = ShardingSpec.tile((12, 12), [0, 1], [0, 1], cluster_env)
assert sharding.tile... | 2.109375 | 2 |
read_plate.py | LengyHELL/ALPR | 0 | 49225 | #!/usr/bin/env python3
import sys
import numpy as np
import cv2
import time
def get_time(start_time):
return int((time.time() - start_time) * 1000)
def is_inside(inside, outside, limit_val=-1):
point_limit = limit_val * len(inside)
if limit_val < 0:
point_limit = 1
in_point = 0;
for i in ... | 2.84375 | 3 |
PaddleSpeech/DeepVoice3/compute_timestamp_ratio.py | ziyuli/models | 1 | 49226 | # Part of code was adpated from https://github.com/r9y9/deepvoice3_pytorch/tree/master/compute_timestamp_ratio.py
# Copyright (c) 2017: <NAME>.
import argparse
import sys
import numpy as np
from hparams import hparams, hparams_debug_string
from deepvoice3_paddle.data import TextDataSource, MelSpecDataSource
from nnmnk... | 2.125 | 2 |
erede/Document.py | collabo-br/erede-python | 4 | 49227 | from .RedeSerializable import RedeSerializable
class Document(RedeSerializable):
def __init__(self, document_type, number):
self.type = document_type
self.number = number
| 2.265625 | 2 |
import_files.py | ravielakshmanan/arcgis | 0 | 49228 | from google.cloud import storage
import os
client = storage.Client()
bucket = client.get_bucket('noah-water.appspot.com')
blobs = bucket.list_blobs(prefix='trends3/Part6')
os.system("gsutil acl ch -u <EMAIL>:W gs://noah-water.appspot.com")
for blob in blobs:
print(blob.name)
file_read_perm = "gsutil acl ch -u <E... | 2.75 | 3 |
tests/test_sqlalchemy.py | kisspy/abcms | 0 | 49229 | from sqlalchemy import create_engine
from sqlalchemy import func
from sqlalchemy import Column, Integer, String, DateTime, Boolean
from sqlalchemy import Text, ForeignKey
from sqlalchemy import INTEGER
from sqlalchemy.orm import relationship, backref
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalch... | 2.578125 | 3 |
heroku_py/__init__.py | AnthonyAniobi/heroku-py | 5 | 49230 | <gh_stars>1-10
from .heroku_client import HerokuClient
__version__ = "1.2.0"
__all__ = ["HerokuClient"]
| 1.078125 | 1 |
teraserver/python/opentera/forms/TeraDeviceTypeForm.py | introlab/opentera | 10 | 49231 | <reponame>introlab/opentera<gh_stars>1-10
from opentera.forms.TeraForm import *
from modules.DatabaseModule.DBManagerTeraUserAccess import DBManagerTeraUserAccess
from flask_babel import gettext
class TeraDeviceTypeForm:
@staticmethod
def get_device_type_form(user_access: DBManagerTeraUserAccess):
f... | 2.328125 | 2 |
taiwanpeaks/peaks/models.py | bhomnick/taiwanpeaks | 1 | 49232 | <reponame>bhomnick/taiwanpeaks
from django.db import models
from common import constants
class Peak(models.Model):
name = models.CharField(max_length=255)
slug = models.SlugField(unique=True)
name_zh = models.CharField(max_length=255, verbose_name='Name (中文)', help_text=(
"This peak's Chinese nam... | 2.390625 | 2 |
src/collect_results_mutable_bitmap.py | jermp/mutable_rank_select | 22 | 49233 | <filename>src/collect_results_mutable_bitmap.py
import sys, os
output_filename = sys.argv[1]
types = [
"avx2_256_a",
"avx512_256_a",
"avx2_256_b",
"avx512_256_b",
"avx2_512_a",
"avx512_512_a",
"avx2_512_b",
"avx512_512_b",
"avx2_256_c",
"avx512_256_c"]
for t in types:
os.system("./perf_mutable_bitmap " + t + " ... | 2.515625 | 3 |
petstagram/petstagram/main/admin.py | DimOps/Django-demo-2022 | 0 | 49234 | <reponame>DimOps/Django-demo-2022
from django.contrib import admin
from petstagram.main.models import Profile, Pet, PetPhoto
@admin.register(Profile)
class UserAdmin(admin.ModelAdmin):
pass
@admin.register(Pet)
class UserAdmin(admin.ModelAdmin):
pass
@admin.register(PetPhoto)
class UserAdmin(admin.ModelAdm... | 1.53125 | 2 |
bot.py | Viannedi/tgstatus | 0 | 49235 | <gh_stars>0
import telethon
from telethon import TelegramClient, events
import asyncio
from time import sleep
from telethon.tl.functions.account import UpdateProfileRequest
from datetime import datetime
from random import randint
api_id = 0
api_hash = ''
client = TelegramClient('name', api_id, api_hash)
async def pro... | 2.640625 | 3 |
Flask_security/flask_1.py | SAVE-POlNT/Flask_shared_auth | 2 | 49236 | <reponame>SAVE-POlNT/Flask_shared_auth
from flask import Flask, redirect, url_for, render_template, request, session, url_for, flash
from captchacreater import create_image_captcha
from sendmail_func import sendMail, validMail
from TokenGenerator import getTokenUser, setToken, ChangeTokenUser
from mysqlhostedwithpy... | 2.578125 | 3 |
app/dataAccess.py | yeahlow-ch/yeahlow-backend | 1 | 49237 | from math import sin, cos, sqrt, atan2, radians
from random import *
from datetime import *
from dateutil.parser import parse
from enum import Enum
import csv
class DataAccess:
DOWNVOTE = 0
UPVOTE = 1
Type = Enum('Type', 'sport party animal hackathon culture food')
def __init__(self):
self.... | 3.09375 | 3 |
fewbit/fft_test.py | SkoltechAI/fewbit | 30 | 49238 | <reponame>SkoltechAI/fewbit<filename>fewbit/fft_test.py
import numpy as np
import scipy as sp
import scipy.fft
import torch as T
from itertools import product
from unittest import TestCase
from fewbit.fft import dct, idct
class TestDCT(TestCase):
def _test_impl(self, lhs, rhs, delta=1e-5):
norms = ('bac... | 2.25 | 2 |
lib/utils/error_util.py | mpawlow/github-search | 1 | 49239 | """
Copyright 2020 <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 w... | 2.03125 | 2 |
shims/SeeedStudios/grove_py/counterfit_shims_grove/grove_relay.py | CallumTarttelin/CounterFit | 86 | 49240 | <filename>shims/SeeedStudios/grove_py/counterfit_shims_grove/grove_relay.py
'''
This is the code for
- `Grove - Relay <https://www.seeedstudio.com/s/Grove-Relay-p-769.html>`_
Examples:
.. code-block:: python
import time
from counterfit_connection import CounterFitConnection
from count... | 2.71875 | 3 |
scripts/run_jobs.py | Darklanx/rl-baselines3-zoo | 591 | 49241 | <reponame>Darklanx/rl-baselines3-zoo
"""
Run multiple experiments on a single machine.
"""
import subprocess
import numpy as np
ALGOS = ["sac"]
ENVS = ["MountainCarContinuous-v0"]
N_SEEDS = 10
EVAL_FREQ = 5000
N_EVAL_EPISODES = 10
LOG_STD_INIT = [-6, -5, -4, -3, -2, -1, 0, 1]
for algo in ALGOS:
for env_id in ENV... | 2.046875 | 2 |
vocabs/filters.py | csae8092/vocabseditor | 9 | 49242 | <reponame>csae8092/vocabseditor<gh_stars>1-10
import django_filters
from dal import autocomplete
from .models import SkosConcept, SkosConceptScheme, SkosCollection
django_filters.filters.LOOKUP_TYPES = [
('', '---------'),
('exact', 'Is equal to'),
('iexact', 'Is equal to (case insensitive)'),
('not_e... | 2.25 | 2 |
tripcore/inventory/migrations/0002_fixture_source.py | robotlightsyou/trip | 0 | 49243 | <gh_stars>0
# Generated by Django 3.1.1 on 2020-09-17 20:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('inventory', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='fixture',
name='source',
... | 1.695313 | 2 |
examples/miniapps/flask-blueprints/githubnavigator/blueprints/__init__.py | whysage/python-dependency-injector | 1,997 | 49244 | """Blueprints package."""
| 1.015625 | 1 |
chen-et-al-2017/LSTM.py | apsdehal/nli-batch-optimizations | 4 | 49245 | from torch.autograd import Variable
import torch
import torch.nn as nn
import torch.nn.functional as F
class LSTM(nn.Module):
def __init__(self, nin, hidden_size):
super(LSTM, self).__init__()
if torch.cuda.is_available():
self.linear_f = nn.Linear(nin + hidden_size, hidden_size).cuda()
... | 2.53125 | 3 |
processing/router.py | uncharted-distil/distil-auto-ml | 2 | 49246 | <filename>processing/router.py
#!/usr/bin/env python
"""
distil/router.py
"""
import logging
import sys
from copy import deepcopy
from typing import Sequence, Tuple
from d3m.metadata import problem as _problem
logger = logging.getLogger(__name__)
SMALL_DATASET_THRESH = 2000
# --
# Detect semantic problem typ... | 2.09375 | 2 |
python/version.py | tied/rest-api-samples | 1 | 49247 | <gh_stars>1-10
VERSION = '3.14'
| 1.015625 | 1 |
voice_verification/src/contrastive_train.py | ngocphucck/zalo-ai-challange-2020 | 3 | 49248 | import torch
from torch import nn
from torch.utils.data import DataLoader
from tqdm.notebook import tqdm
from torch.optim import Adam
import torch.nn.functional as F
from voice_verification.src.models.vggvox import VGGVox
from voice_verification.src.losses.contrastive_loss import ContrastiveLoss
from datasets import ... | 2.328125 | 2 |
app/api/database.py | EljakimHerrewijnen/Project_5-6 | 0 | 49249 | import sqlite3
import json
import sys
import os
class Database(object):
# Contructior opens database
def __init__(self, databasePath = "app/data.db"):
self.databasePath = databasePath
self.select = ""
self.froms = ""
self.joins = ""
self.wheres = ""
self.groupBy = ""
self.orderBy = ""
def open_conn(... | 3.125 | 3 |
05_eval.py | babarosa08/BaiduXJ | 1 | 49250 | from keras.models import Model, load_model
from keras.preprocessing.image import ImageDataGenerator
from keras.optimizers import SGD
import numpy as np
import os
def preprocess_input(x):
x /= 127.5
x -= 1.
return x
test_gen = ImageDataGenerator(
preprocessing_function=preprocess_input
)
test_genera... | 2.6875 | 3 |
Equirec2Perspec2.py | CSTC-WTCB-BBRI/Equirec2Perspec | 0 | 49251 | import os
import sys
import cv2
import numpy as np
class Equirectangular:
def __init__(self, img):
self._img = img
#self._img = cv2.imread(img_name, cv2.IMREAD_COLOR)
[self._height, self._width, _] = self._img.shape
print(self._img.shape)
def GetPerspective(self, FOV, THET... | 2.46875 | 2 |
alembic/versions/7b75fd399c5e_change_the_foreign_key_constraints_on_.py | czbiohub/opencell-portal-pub | 2 | 49252 | <filename>alembic/versions/7b75fd399c5e_change_the_foreign_key_constraints_on_.py<gh_stars>1-10
"""change the foreign-key constraints on the crispr_design table
Revision ID: 7b75fd399c5e
Revises: <KEY>
Create Date: 2022-02-22 14:51:16.178065
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers,... | 1.257813 | 1 |
src/morion/model_decorators.py | UofG-CSP3/morion | 0 | 49253 | """
This module contains decorators that can be used in model implementation to relate them to each other.
For example, getting dies from a wafer.
"""
from functools import wraps
from typing import Callable, Type
from .mongomodel import MongoModel
def forward_link_one(model_get: Callable[[], Type[MongoModel]]):
... | 3.390625 | 3 |
hydralit_components/InfoCard/__init__.py | eluzhnica/hydralit_components | 0 | 49254 | import os
import streamlit as st
import uuid
import streamlit.components.v1 as components
from hydralit_components import IS_RELEASE
if IS_RELEASE:
absolute_path = os.path.dirname(os.path.abspath(__file__))
build_path = os.path.join(absolute_path, "frontend/build")
_component_func = components.declare_com... | 2.703125 | 3 |
polling_bot/__init__.py | balemessenger/poll_bot | 0 | 49255 | import os
MAIN_DIRECTORY = os.path.dirname(os.path.realpath(__file__))
| 1.367188 | 1 |
project_name/settings/prod.py | ar4s/django-good-settings-template | 3 | 49256 | <reponame>ar4s/django-good-settings-template<gh_stars>1-10
from {{ project_name }}.settings.base import * # noqa
DEBUG = False
ALLOWED_HOSTS = ['{{ project_name }}.local']
ROOT_URLCONF = '{{ project_name }}.urls'
CSRF_COOKIE_SECURE = True
CSRF_COOKIE_HTTPONLY = True
X_FRAME_OPTIONS = 'DENY'
SECURE_SSL_REDIRECT = T... | 1.28125 | 1 |
tests/models/test_matching_models.py | mberr/ea-active-learning | 4 | 49257 | import unittest
from typing import Any, Mapping, Optional, Type
import torch
from kgm.data import KnowledgeGraphAlignmentDataset, get_erdos_renyi
from kgm.data.knowledge_graph import sub_graph_alignment
from kgm.models import GCNAlign, get_matching_model_by_name
from kgm.models.matching.base import KGMatchingModel
fr... | 2.265625 | 2 |
pagapp/service_pages/forms.py | eugeneandrienko/PyArtistsGallery | 0 | 49258 | <filename>pagapp/service_pages/forms.py
"""Forms, which using in "first run" page."""
from flask_wtf import Form
from wtforms import SubmitField, StringField, PasswordField, TextAreaField
from wtforms.validators import DataRequired, EqualTo
class FirstRunForm(Form):
"""First-run form.
Form, which using in w... | 2.65625 | 3 |
ai4good/tests/cm/test_initialise_parameters.py | macapakaz/model-server | 0 | 49259 | import os
import unittest
import pandas as pd
from ai4good.runner.facade import Facade
from ai4good.models.model_registry import get_models, create_params
class InitialiseParameters(unittest.TestCase):
def setUp(self) -> None:
self.facade = Facade.simple()
self.mdl = get_models()['compartmental-mo... | 2.421875 | 2 |
217.py | RafaelHuang87/Leet-Code-Practice | 0 | 49260 | class Solution:
def containsDuplicate(self, nums: [int]) -> bool:
return len(nums) != len(set(nums))
s = Solution()
print(s.containsDuplicate([1,2,3,1])) | 3.4375 | 3 |
Python/PyCharm/03.Logical checks/14.Time + 15 Minutes.py | YaniLozanov/Software-University | 0 | 49261 | # Problem:
# Write a program that introduces hours and minutes of 24 hours a day and calculates how much time it will take
# after 15 minutes. The result is printed in hh: mm format.
# Hours are always between 0 and 23 minutes are always between 0 and 59.
# Hours are written in one or two digits. Minutes are always wri... | 4.09375 | 4 |
pymc3/plots/compareplot.py | acolombi/pymc3 | 1 | 49262 | import numpy as np
try:
import matplotlib.pyplot as plt
except ImportError: # mpl is optional
pass
def compareplot(comp_df, insample_dev=True, se=True, dse=True, ax=None,
plot_kwargs=None):
"""
Model comparison summary plot in the style of the one used in the book
Statistical Reth... | 2.640625 | 3 |
CLI.py | Cryptoc1/CMS | 1 | 49263 | <gh_stars>1-10
#!/usr/bin/env python
from CMS import CMS
import sys
import os
# Initiate the CMS Class
manager = CMS(hostname="localhost", username="test", password="<PASSWORD>", db="CMS")
# Misc strings
tchar = ": "
working = tchar + "Working..."
# Checks if user input is an in-program command
def verify_input(cmd)... | 2.78125 | 3 |
edutorch/nn/spatial_batchnorm.py | TylerYep/edutorch | 3 | 49264 | from __future__ import annotations
from edutorch.typing import NPArray
from .batchnorm import BatchNorm
class SpatialBatchNorm(BatchNorm):
def forward(self, x: NPArray) -> NPArray:
"""
Computes the forward pass for spatial batch normalization.
Inputs:
- x: Input data of shape (N... | 3.328125 | 3 |
writeups/2020/midnight-sun/pybonhash/solve.py | welchbj/ctf | 65 | 49265 | #!/usr/bin/env python3
import binascii
import itertools
from Crypto.Cipher import AES
HASH_LEN = 32
DATA_LEN = 204
KEY_LEN = 42
FIB_OFFSET = 4919
def fib_seq(n):
out = [0, 1]
for i in range(2, n):
out.append(out[(i - 1)] + out[(i - 2)])
return out
def gen_keys():
keys = []
for a, b i... | 3.21875 | 3 |
src/fsb_upload_operator.py | funisaki/FuniShaderBox | 0 | 49266 | <reponame>funisaki/FuniShaderBox
import bpy
import webbrowser
import requests
import base64
import os
from . import rna_xml_alt
import json
PREVIEW_SCENE_PATH = os.path.join(os.path.dirname(__file__), "preview.blend","Scene")
UPLOAD_URL = 'https://tools.funisaki.com/api/shaderbox/upload'
class FSBUploadOperator(bpy.t... | 2.171875 | 2 |
boards/migrations/0002_board_category.py | AxioDL/axiodl-www | 0 | 49267 | # Generated by Django 2.2.3 on 2019-07-09 17:10
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('boards', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='board',
... | 1.515625 | 2 |
design.py | ilyxych96/ScanEP | 2 | 49268 | <filename>design.py
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'design.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(s... | 1.828125 | 2 |
tests/fraction_tests/test_truediv.py | davideguidobene/cfractions | 3 | 49269 | <reponame>davideguidobene/cfractions<filename>tests/fraction_tests/test_truediv.py
import math
import sys
from numbers import Real
import pytest
from hypothesis import given
from cfractions import Fraction
from tests.utils import (equivalence,
implication,
is_fraction... | 2.578125 | 3 |
data/lib/utils/__init__.py | Synell/PERT-Maker | 0 | 49270 | #----------------------------------------------------------------------
# Libraries
from .byte import Byte
from .color import Color
from .stringUtils import StringUtils
#----------------------------------------------------------------------
| 1.609375 | 2 |
main.py | steviezhang/COG403-Project | 0 | 49271 | import numpy as np
import re
from nltk import Tree
from nltk import induce_pcfg
from nltk import Nonterminal
from nltk.parse.generate import generate
epsilon = 1e-20
class corpus:
# stores all sentence forms in data
def __init__(self):
self.sentence_forms = {}
for i in range(6): # init si... | 2.484375 | 2 |
scripts/load_csv.py | bilalelhoudaigui/books-finder | 0 | 49272 | from elasticsearch import helpers, Elasticsearch
import csv
def read_mapping():
try:
with open('books-mapping.json', 'r') as file:
mapping = file.read().replace('\n', '')
return mapping
except Exception as e:
print(e)
es = Elasticsearch()
index_name = 'books'
mapping = re... | 2.796875 | 3 |
src/format.py | dockimbel/RGB | 0 | 49273 | <reponame>dockimbel/RGB<filename>src/format.py
"""
MIT License
Copyright (c) 2018 <NAME>
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 restriction, including without limitation the righ... | 2.40625 | 2 |
Blender/TestBlenderScript02.py | archu2020/python-2 | 48 | 49274 | import bpy
import numpy as np
from PIL import Image
class CarModelViewToImage():
# def __init__:
# self.camera_ = None
# self.image_folder_ = None
# self.car_width_ = 0
# self.car_length_ = 0
# self.viewport_width_ = 0
# self.viewport_height_ = 0
# self.stri... | 2.6875 | 3 |
Editor/pini/ATL.py | RangHo/pini-engine | 0 | 49275 | <reponame>RangHo/pini-engine
# -*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
import math
M_PI_2 = math.pi/2.0
M_PI = math.pi
def interpolation(t,o1,o2):
return round(( 1 - t )*o1 + t*o2,2)
def linear(time) :
return time
def sineEaseIn(time):
return -1 * math.cos(time * M_PI_2) + 1... | 2.234375 | 2 |
ambiente_virtual/Lib/site-packages/alembic/util/editor.py | PI-UNIVESP-Penapolis/PRODEA | 1,324 | 49276 | import os
from os.path import exists
from os.path import join
from os.path import splitext
from subprocess import check_call
from typing import Dict
from typing import List
from typing import Mapping
from typing import Optional
from .compat import is_posix
from .exc import CommandError
def open_in_editor(
filena... | 2.828125 | 3 |
src/processTypes/bind.py | Razikus/TotallyDockerVolumeBackuper | 0 | 49277 | <gh_stars>0
from docker.types import Mount
import datetime
def processMount(mount):
result = dict()
result["type"] = mount["Type"]
result["source"] = mount["Source"]
return result
def getMountType(mount, target):
return Mount(type=mount["type"], source=mount["source"], target=target)
def getBacku... | 2.40625 | 2 |
2-AES_Encyption.py | dhairyaostwal/Python-Security | 6 | 49278 | <reponame>dhairyaostwal/Python-Security
# AES Encryption
"""
https://www.youtube.com/watch?v=artGrUA4SPY&list=PLFCG67nCTUMHHJ-LDUnOsLxA2l_Eu5RMY&index=6
"""
# Remark: Key & Message both must be 16, 24 or 32 bit long
from Crypto.Cipher import AES
key = '0123456789012345'
string_input = input()
cipher = AES.new(key)
c... | 3.09375 | 3 |
setup.py | stweil/tensorflow_gpu_to_tensorflow | 2 | 49279 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Dummy Python package for tensorflow-gpu
"""
import codecs
import setuptools
setuptools.setup(
name='tensorflow_gpu',
version='1.15.2',
description='dummy for tensorflow-gpu',
long_description=codecs.open('README.md', encoding='utf-8').read(),
long_descrip... | 1.421875 | 1 |
ohjelma/migrations/0008_track_track_danceability.py | katrii/ohsiha | 0 | 49280 | <filename>ohjelma/migrations/0008_track_track_danceability.py
# Generated by Django 3.0.2 on 2020-04-11 18:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ohjelma', '0007_track_track_id'),
]
operations = [
migrations.AddField(
... | 1.421875 | 1 |
gogolook/models/task.py | chenjr0719/Gogolook-Exercise | 0 | 49281 | <filename>gogolook/models/task.py
from enum import IntEnum
from typing import Optional
from pydantic import Field
from sqlalchemy import Column, Enum, String
from gogolook.models import Base, BaseSchema
class TaskStatus(IntEnum):
Incomplete = 0
Complete = 1
class Task(Base):
name = Column(String(lengt... | 2.546875 | 3 |
api/applications/views/applications.py | uktrade/lite-ap | 3 | 49282 | from copy import deepcopy
from uuid import UUID
from django.db import transaction
from django.db.models import F
from django.http import JsonResponse
from django.utils import timezone
from django.utils.timezone import now
from rest_framework import status
from rest_framework.exceptions import PermissionDenied, Validat... | 1.414063 | 1 |
ex1.py | keerthana1502/python_practice | 0 | 49283 | <gh_stars>0
for i in range(5):
for j in range (5):
if(i==j):
print("1",end=" ")
elif(i=-j):
print()
| 3.296875 | 3 |
astroutils/writer_module.py | nithyanandan/AstroUtils | 1 | 49284 | from blessings import Terminal
term = Terminal()
class Writer(object):
"""
---------------------------------------------------------------------------
Create an object with a write method that writes to a
specific place on the screen, defined at instantiation.
This is the glue between blessings ... | 3.390625 | 3 |
1201-1300/1215-Magical String/1215-Magical String.py | jiadaizhao/LintCode | 77 | 49285 | <filename>1201-1300/1215-Magical String/1215-Magical String.py
class Solution:
"""
@param n: an integer
@return: the number of '1's in the first N number in the magical string S
"""
def magicalString(self, n):
# write your code here
if n == 0:
return 0
seed = lis... | 3.59375 | 4 |
minibench/benchmark.py | noirbizarre/minibench | 4 | 49286 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
import sys
from collections import namedtuple
from .utils import humanize
DEFAULT_TIMES = 5
if sys.platform == "win32":
# On Windows, the best timer is time.clock()
timer = time.clock
else:
# On most other platf... | 2.46875 | 2 |
Ishtar/Ishtar/scripts/objects.py | rsc-dev/ishtar | 15 | 49287 | import clr
clr.AddReferenceToFile('ObjectUtils.dll')
import ObjectUtils
print '[+] Added ObjectUtils'
| 1.296875 | 1 |
messageops.py | Pshemas/Fablabpts_discordbot | 0 | 49288 | from errors import *
import discord
def extractdata(message):
''' extracts data for Google Sheets from message,
removes command used to invoke bot. Returns dict.'''
withoutprefix = message.clean_content
cleaned = withoutprefix.split(' ', 2)
if len(cleaned) == 3:
try:
cleaned[1... | 2.734375 | 3 |
task_scripts/merge_seginfo.py | ZettaAI/Synaptor | 7 | 49289 | """
Segment Info Merging Wrapper Script
- Takes an id mapping across segments as input
- Merges the segment info dataframes into one for the entire dataset
"""
import synaptor as s
import argparse
parser = argparse.ArgumentParser()
# Inputs & Outputs
parser.add_argument("storagestr")
parser.add_argument("hashval", ... | 2.59375 | 3 |
sockets/experiment/platforms/common.py | edersondisouza/linux-tsn-eval | 6 | 49290 | # Copyright (c) 2021, Intel Corporation
#
# SPDX-License-Identifier: BSD-3-Clause
import subprocess
import os
import time
from . import tools
from syslog import syslog
from util import util
class CommonPlatform:
def __init__(self, configuration):
self.conf = configuration
self.teardown_list = []
... | 2.015625 | 2 |
part_map/__init__.py | jdpatt/bga_color_map | 2 | 49291 | <filename>part_map/__init__.py
"""Part Visualizer"""
from .cli import map
| 1.140625 | 1 |
myp/pip/__init__.py | YunisDEV/py-scripts | 2 | 49292 | from .commands import (
install_command,
freeze_command
) | 1.054688 | 1 |
torch_kalman/process/processes/season/discrete.py | Suhwan-Dev/torch-kalman | 0 | 49293 | <gh_stars>0
from typing import Optional, Union, Tuple, Sequence
import numpy as np
import torch
from torch.nn import ParameterDict
from torch_kalman.process import Process
from torch_kalman.process.base import InitialState
from torch_kalman.process.utils.bounded import Bounded
from torch_kalman.internals.utils impor... | 2.359375 | 2 |
UDPFlood.py | ausaafnabi/Security-Utilities | 0 | 49294 | import socket
import random
from onionBrowser import *
ab = onionBrowser(proxies = [],\
user_agents=[('User-agents','superSecretBrowser')])
sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
bytes = random._urandom(1024)
ip = input('Target IP: ')
port = input('Target Port: ')
port = int(port)
sent = 1
while... | 2.5625 | 3 |
bili_kits/api/user.py | LonelySteve/Bili-Kits | 0 | 49295 | <gh_stars>0
from . import _BASE_WEB_INTERFACE,_BASE_API_BILIBILI_COM_X,_BASE_API_BILIBILI_COM,_BASE_API_BILIBILI_COM_X_V2
CARD="%s/card" % _BASE_WEB_INTERFACE
NAV="%s/nav" % _BASE_WEB_INTERFACE
RELATION_STAT="%s/relation/stat" % _BASE_API_BILIBILI_COM_X
FAV_FOLDER="%s/fav/folder" % _BASE_API_BILIBILI_COM_X_V2 | 0.960938 | 1 |
diffsim_torch3d/pysim/exp_cloth_fold.py | priyasundaresan/kaolin | 0 | 49296 | import torch
import arcsim
import gc
import time
import json
import sys
import gc
import os
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
now = datetime.now()
timestamp = datetime.now().strftime('%Y-%m-%d_%H:%M:%S')
#steps = 30
#epochs= 10
steps = 40
epochs= 20
#handles = [25, 60, 30... | 1.960938 | 2 |
MBook/app/models.py | orzbhbdsb/gitlab3 | 0 | 49297 | """
Definition of models.
"""
from django.db import models
# Create your models here.
class Author(models.Model):
AuthorID = models.CharField(max_length = 10, blank = False, primary_key = True)
Name = models.CharField(max_length = 20, blank = False)
Age = models.CharField(max_length = 3, blank = True)
... | 3.3125 | 3 |
gen.py | RavenApp/Vanity-Address-Generator | 1 | 49298 | <filename>gen.py
from ravenrpc import Ravencoin # pip install ravenrpc
import sys
import os
import time
def valid_base58(s):
for c in ('0', 'O', 'l', '1'):
if c in s:
print(f'Cannot use charachter "{c}" in prefix!!')
exit()
def success_odds(prefix, ignore_case):
odds = 1
fo... | 2.4375 | 2 |
extract_mel_mu.py | NTT123/wavegru-vocoder | 0 | 49299 | <filename>extract_mel_mu.py
"""
Extract mel-spectrogram features and mu-law encoded waveforms from wav files
"""
import os
from argparse import ArgumentParser
from pathlib import Path
import jax
import librosa
import numpy as np
from tqdm.cli import tqdm
from dsp import MelFilter
from utils import load_config
def ... | 2.578125 | 3 |