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 |
|---|---|---|---|---|---|---|
chibi_command/lxc/lxc.py | dem4ply/chibi_command | 0 | 33600 | from chibi.atlas import Chibi_atlas
from chibi_command import Command, Command_result
from chibi_hybrid.chibi_hybrid import Chibi_hybrid
__all__ = [ 'Create', 'Start', 'Stop', 'Attach', 'Info', 'Destroy' ]
class Info_result( Command_result ):
def parse_result( self ):
if not self:
return
... | 2.21875 | 2 |
SeagateSenseCodes.py | ssmore98/siod | 0 | 33601 | <reponame>ssmore98/siod
seagate_sense_codes = {0: {0: {0: {0: 'No error.', 'L1': 'No Sense', 'L2': 'No Sense'},
31: {0: 'No Specific FRU code.',
'L1': 'No Sense',
'L2': 'Logical unit transitioning to another power con... | 1.671875 | 2 |
kuwala/common/python_utils/src/time_utils.py | bmahmoudyan/kuwala | 381 | 33602 | import time
from time import sleep
def print_elapsed_time(exit_event):
start_time = time.time()
while True:
if exit_event.is_set():
break
print(f'Running for {round(time.time() - start_time)} s', end='\r')
sleep(1)
| 3.375 | 3 |
adapted/adapt_cli.py | GoodTown/IDeAS-ADAPT-Client-GUI | 0 | 33603 | """ Adapt Server
This module contains all the functionality necessary to
setup an Adapt Server node (not really).
Example
-------
python3 adapt_server.py -v ingest -s testfile.txt
"""
import filesystem
from filesystem import FSOperationError
import sys
import os
import argparse
import logging
from general import... | 2.859375 | 3 |
app/classes.py | lightness/EmploymentAgency | 1 | 33604 | from django.core.urlresolvers import reverse, reverse_lazy
ALERT_TYPES = ("alert-success", "alert-info", "alert-warning", "alert-danger",)
BUTTON_TYPES = ("btn-default", "btn-primary", "btn-success", "btn-warning", "btn-danger", "btn-info", "btn-link",)
DEFAULT_ALERT_TYPE = ALERT_TYPES[0]
DEFAULT_BUTTON_TYPE = BUTTON... | 2.0625 | 2 |
classes/__init__.py | OmarThinks/MoRG | 0 | 33605 | <filename>classes/__init__.py
"""
try:
from .NotReceived import NotReceived
from .errors import *
from .classreader import *
from .checkpoint import Checkpoint
except Exception as e:
from NotReceived import NotReceived
from errors import *
from classreader import *
from checkpoint import Checkpoint
"""
"""
imp... | 1.992188 | 2 |
project_name/project_name/settings/dev.py | aexeagmbh/django-project-template | 0 | 33606 | <filename>project_name/project_name/settings/dev.py
# coding=utf-8
"""Development settings and globals."""
from .base import *
# ######### DEBUG CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = True
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-debug
TEMPLA... | 1.820313 | 2 |
examples/unlock_antidotes.py | astitva22/Pixelate-22-Sample-Arena | 1 | 33607 | import gym
import pixelate_arena
import time
import pybullet as p
import os
if __name__ == "__main__":
parent_path = os.path.dirname(os.getcwd())
os.chdir(parent_path)
env = gym.make("pixelate_arena-v0")
x=0
while True:
p.stepSimulation()
if x==10000:
env.unlock_antidote... | 2.015625 | 2 |
web_service/src/__init__.py | leckijakub/hipotap | 0 | 33608 | from flask import Flask
def create_app():
app = Flask(__name__)
app.config["SECRET_KEY"] = "secret-key-goes-here"
# blueprint for auth routes in our app
from .blue_prints.auth import auth as auth_blueprint
app.register_blueprint(auth_blueprint)
# blueprint for non-auth parts of app
from... | 1.992188 | 2 |
BertLibrary/models/BertModel.py | PinkDraconian/Bert-as-a-Library | 13 | 33609 | import os
import tensorflow as tf
from BertLibrary.bert_predictor import BertPredictor
from BertLibrary.bert_trainer import BertTrainer
from BertLibrary.bert_evaluator import BertEvaluator
from tensorflow.estimator import Estimator
from tensorflow.estimator import RunConfig
from BertLibrary.bert.run_classifier import... | 2.3125 | 2 |
neuroscout/tasks/utils.py | effigies/BLiMP | 0 | 33610 | <gh_stars>0
""" utils """
import json
import tarfile
from ..utils.db import put_record, dump_pe
from ..models import Analysis, PredictorEvent
from ..schemas.analysis import AnalysisFullSchema, AnalysisResourcesSchema
def update_record(model, exception=None, **fields):
if exception is not None:
if 'traceba... | 2.265625 | 2 |
test/priors/test_half_cauchy_prior.py | noamsgl/gpytorch | 188 | 33611 | #!/usr/bin/env python3
import unittest
import torch
from torch.distributions import HalfCauchy
from gpytorch.priors import HalfCauchyPrior
from gpytorch.test.utils import least_used_cuda_device
class TestHalfCauchyPrior(unittest.TestCase):
def test_half_cauchy_prior_to_gpu(self):
if torch.cuda.is_avail... | 2.421875 | 2 |
Tools/decrypt_ulog.py | lgarciaos/Firmware | 4,224 | 33612 | #!/usr/bin/env python3
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP
from Crypto.Cipher import ChaCha20
from Crypto.Hash import SHA256
import binascii
import argparse
#from pathlib import Path
import sys
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="""CLI tool t... | 2.890625 | 3 |
modules/math-codes/modules/algebra/linear-equations/src/test_slope.py | drigols/Studies | 1 | 33613 | <filename>modules/math-codes/modules/algebra/linear-equations/src/test_slope.py
from matplotlib import pyplot as plt
import pandas as pd
df = pd.DataFrame ({'x': range(-10, 10+1)})
df['y'] = (3*df['x'] - 4) / 2
plt.figure(figsize=(10, 10))
plt.plot(df.x, df.y, color="grey", marker = "o")
plt.xlabel('x')
plt.ylabel('y... | 4.34375 | 4 |
website/message/admin.py | m3alamin/message-system | 1 | 33614 | from django.contrib import admin
from .models import Message, Reply, Reader
# Register your models here.
admin.site.register(Message)
admin.site.register(Reply)
admin.site.register(Reader)
| 1.453125 | 1 |
Authors' code/Few_shot_learning/models/selector.py | onicolini/zero-shot_knowledge_transfer | 0 | 33615 | from models.lenet import *
from models.wresnet import *
import os
def select_model(dataset,
model_name,
pretrained=False,
pretrained_models_path=None):
if dataset in ['SVHN', 'CIFAR10', 'CINIC10', 'CIFAR100']:
n_classes = 100 if dataset == 'CIFAR100' else... | 2.265625 | 2 |
navigator/auth/handlers.py | phenobarbital/navigator-api | 10 | 33616 | # -*- coding: utf-8 -*-
#!/usr/bin/env python3
import asyncio
import base64
import json
import os
import sys
from aiohttp import web
from navigator.conf import (
DEBUG,
SESSION_PREFIX,
SESSION_URL,
SESSION_KEY,
config
)
from navigator.handlers import nav_exception_handler
from navigator.exception... | 2.40625 | 2 |
images.py | krutika-bhalla/Web-Scraping | 0 | 33617 | from bs4 import BeautifulSoup
from PIL import Image
from io import BytesIO
import requests
import os
def start_search():
search = input("Enter Search Item: ")
params = {"q": search}
dir_name = search.replace(" ", "_").lower()
if not os.path.isdir(dir_name):
os.makedirs(dir_name)
r = req... | 3.140625 | 3 |
repeat_cook_funcs.py | byu-imaal/dns-cookies-pam21 | 0 | 33618 | <reponame>byu-imaal/dns-cookies-pam21
"""
Collection of functions for analyzing repeat cookie data
Designed to run a single function via CLI
"""
import argparse
import inspect
import json
import math
import subprocess
import sys
from collections import Counter
from collections import defaultdict
from shared.colors im... | 2.265625 | 2 |
data/count_office31.py | mo6zes/Reproducing-Deep-Fair-Clustering | 4 | 33619 | from office31 import office31
from office31 import download_and_extract_office31
from pathlib import Path
import os
#Hacky script to count how many images are in each folder/cluster in both sources
out_name = "./data/office31/office31_count.txt"
def count_items(src="amazon"):
file_open=open(out_name, "a")
labe... | 2.890625 | 3 |
mm2s5/mm2s5.py | scottkirkwood/mm2s5 | 0 | 33620 | <gh_stars>0
#!/usr/bin/env python
# -*- encoding: latin1 -*-
#
# Copyright 2010 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... | 2.09375 | 2 |
covid19sweden/__init__.py | martinbenes1996/covid19sweden | 1 | 33621 | # -*- coding: utf-8 -*-
"""Webscraper for Swedish data.
Reference: https://www.scb.se/hitta-statistik/statistik-efter-amne/befolkning/befolkningens-sammansattning/befolkningsstatistik/pong/tabell-och-diagram/preliminar-statistik-over-doda/
Todo:
* caching
"""
import pkg_resources
from .main import *
from . impo... | 1.328125 | 1 |
public/ViPER/modules/head.py | severnake/ViPER | 23 | 33622 | <gh_stars>10-100
import requests
from termcolor.termcolor import colored, cprint
class header:
"""
Class for extracting headers
"""
def __init__(self):
pass
def get_headers(self, target):
req = requests.head(target)
req = req.headers
... | 2.859375 | 3 |
src/airflow_actionproject/callables/action.py | actionprojecteu/airflow-actionproject | 0 | 33623 | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------
# Copyright (c) 2021
#
# See the LICENSE file for details
# see the AUTHORS file for authors
# ----------------------------------------------------------------------
#--------------------
# System wide imports
# ----------... | 2.078125 | 2 |
stp_raet/test/test_communication.py | ArtObr/indy-plenum | 0 | 33624 | from ioflo.base.consoling import getConsole
from stp_core.crypto.nacl_wrappers import Signer as NaclSigner, Privateer
from raet.raeting import AutoMode, Acceptance
from raet.road.estating import RemoteEstate
from raet.road.stacking import RoadStack
from stp_raet.test.helper import handshake, sendMsgs, cleanup, getRemo... | 1.835938 | 2 |
RedYoshiBot/server/CTGP7ServerDatabase.py | mariohackandglitch/RedYoshiBot | 4 | 33625 | import threading
import sqlite3
from enum import Enum
import time
import datetime
from ..CTGP7Defines import CTGP7Defines
current_time_min = lambda: int(round(time.time() / 60))
class ConsoleMessageType(Enum):
SINGLE_MESSAGE = 0
TIMED_MESSAGE = 1
SINGLE_KICKMESSAGE = 2
TIMED_KICKMESSAGE = 3
class CT... | 2.6875 | 3 |
autographql/apps.py | ehsu0407/django-autographql | 1 | 33626 | from django.apps import AppConfig
class AutographqlConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'autographql'
def ready(self):
import autographql.converters
import autographql.filters.converters
import autographql.monkeypatch
| 1.679688 | 2 |
FD_wave_example.py | miaoziemm/Seismic_Forward_Engine | 1 | 33627 | import taichi as ti
from FD_wave.wave_module_2d4d import wave
from FD_wave.receiver_module import receiver
import Visualization.SFE_visual as vis
ti.init(arch=ti.gpu)
frame = 1
c = ti.field(dtype=ti.f32, shape=(600,600))
c_s = ti.field(dtype=ti.f32, shape=(1000, 1000))
wave_cs = wave(300, 400, 600, 600, 10.0, 10.0, 1... | 2.09375 | 2 |
ENGR 102.py | jemmypotter/Python | 0 | 33628 | critics={'<NAME>': {'Lady in the Water': 2.5, 'Snakes on a Plane': 3.5, 'Just My Luck': 3.0, 'Superman Returns': 3.5, 'You, Me and Dupree': 2.5, 'The Night Listener': 3.0},
'<NAME>': {'Lady in the Water': 3.0, 'Snakes on a Plane': 3.5, 'Just My Luck': 1.5, 'Superman Returns': 5.0, 'The Night Listener': 3.0, 'Y... | 3.25 | 3 |
src/applications/core/admin.py | sleonvaz/rindus-task | 0 | 33629 | from django.contrib import admin
from applications.core.models import Clients
admin.site.register(Clients)
| 1.25 | 1 |
api/newsCategory/apps.py | jhonatantft/ckl | 0 | 33630 | from django.apps import AppConfig
class NewscategoryConfig(AppConfig):
name = 'newsCategory'
| 1.164063 | 1 |
cfdm/data/data.py | NCAS-CMS/cfdm | 22 | 33631 | import itertools
import logging
import netCDF4
import numpy
from .. import core
from ..constants import masked as cfdm_masked
from ..decorators import (
_inplace_enabled,
_inplace_enabled_define_and_cleanup,
_manage_log_level_via_verbosity,
)
from ..functions import abspath
from ..mixin.container import C... | 2.203125 | 2 |
alipay/aop/api/domain/ArInvoiceReceiptQueryOpenApiDTO.py | antopen/alipay-sdk-python-all | 213 | 33632 | <gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.MultiCurrencyMoneyOpenApi import MultiCurrencyMoneyOpenApi
from alipay.aop.api.domain.MultiCurrencyMoneyOpenApi import MultiCurrencyMoneyOpenApi
from alipay.aop.a... | 1.804688 | 2 |
Model/lookalike-model/tests/pipeline/test_main_clean.py | rangaswamymr/blue-marlin | 0 | 33633 | # 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"); you may... | 2.28125 | 2 |
src/nemo/datasets.py | thomasjo/nemo-redux | 0 | 33634 | <reponame>thomasjo/nemo-redux
import json
from pathlib import Path
import numpy as np
import torch
import torchvision as vision
import yaml
from PIL import Image
from sklearn.model_selection import train_test_split
from torch.utils.data import DataLoader, Dataset, SubsetRandomSampler
from torch.utils.data.dataset im... | 2.25 | 2 |
ever2text/converter.py | nicholaskuechler/ever2text | 13 | 33635 | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import open
from builtins import str
import json
import os
import sys
from dateutil.parser import parse
from html2text import HTML2Te... | 2.5 | 2 |
randomopgavergui.pyw | jensjacobt/randomopgaver | 0 | 33636 | <filename>randomopgavergui.pyw<gh_stars>0
# The GUI of Randomopgaver
# -*- coding: utf-8 -*-
import os
import tkinter
from tkinter import *
from tkinter import scrolledtext
from tkinter import messagebox
from tkinter.filedialog import askopenfilename
from tkinter.filedialog import askdirectory
from filegenerator import... | 2.796875 | 3 |
reb/plain.py | workingenius/reb | 1 | 33637 | <reponame>workingenius/reb
"""Reb plain Implementation"""
from typing import Iterator, List, Optional
from functools import singledispatch
from .parse_tree import PTNode, VirtualPTNode
from .pattern import (
Finder,
Pattern,
PText, PAnyChar, PTag, PNotInChars, PInChars,
PAny, PRepeat, PAdjacent,
P... | 2.8125 | 3 |
AdversarialAttack/SST/gen_pos.py | thunlp/DictSKB | 2 | 33638 | <filename>AdversarialAttack/SST/gen_pos.py
import pickle
with open('./aux_files/dataset_13837.pkl','rb') as fp:
dataset=pickle.load(fp)
from nltk.tag import StanfordPOSTagger
jar = 'stanford-postagger-full-2018-10-16/stanford-postagger.jar'
model = 'stanford-postagger-full-2018-10-16/models/english-left3words-dis... | 2.203125 | 2 |
PiCam/picam.py | alexwtz/pciam | 0 | 33639 | import serial
import time
import atexit
from functools import wraps
from flask import Flask, render_template, request, Response
app = Flask(__name__)
def check_auth(username, password):
"""This function is called to check if a username /
password combination is valid.
"""
return username == 'admin' and... | 2.90625 | 3 |
simplemfa/helpers.py | mwhawkins/django-simple-mfa | 3 | 33640 | <filename>simplemfa/helpers.py
from django import template
from django.core.mail import send_mail
from django.template.loader import get_template
from django.conf import settings
from django.shortcuts import reverse
from twilio.twiml.voice_response import VoiceResponse, Say
from twilio.rest import Client
from django.ut... | 2.09375 | 2 |
wsgi/djkatta/cabshare/urls.py | ashishnitinpatil/mukatta | 0 | 33641 | from django.conf.urls import patterns, url
# App specific URL patterns
urlpatterns = patterns("djkatta.cabshare.views",
# post new req
url(r'new_post/$', 'new_post', name='new_post'),
# view posts by the user
url(r'my_posts/$', 'my_posts', name='my_posts'),
# modify old req
url(r'(?P<post_id... | 2.109375 | 2 |
GANs/WGAN/train.py | sushant097/Deep-Learning-Paper-Scratch-Implementation | 4 | 33642 | <reponame>sushant097/Deep-Learning-Paper-Scratch-Implementation<filename>GANs/WGAN/train.py
import torch
from torchvision.utils import save_image
from torchvision import datasets
from torchvision.transforms import transforms
import os
from model import Generator, Discriminator, init_weights, denorm_image
from config i... | 2.46875 | 2 |
examples/mpi_based_distributed_execution/MODIS_Aggregation_MPI.py | big-data-lab-umbc/MODIS_Aggregation | 3 | 33643 | #!/usr/bin/env python
# coding:utf8
# -*- coding: utf-8 -*-
"""
Main Program: Run MODIS AGGREGATION IN MPI WITH FLEXIBLE STATISTICS
Created on 2020
@author: <NAME> (Email: <EMAIL>)
"""
import os
import sys
import h5py
import timeit
import random
import calendar
import numpy as np
import pandas as pd
from mpi4py impo... | 2.203125 | 2 |
repack_img.py | Illidanz/VampireTranslation | 3 | 33644 | <filename>repack_img.py<gh_stars>1-10
import os
from hacktools import common, nitro
import images
def run(data):
infolder = data + "extract_BMP/"
outfolder = data + "repack_BMP/"
workfolder = data + "work_IMG/"
common.logMessage("Repacking IMG from", workfolder, "...")
files = common.getFiles(inf... | 2.421875 | 2 |
src/waffle/downloader.py | JasonMWhite/congenial-waffle | 0 | 33645 | import typing
from lxml import html
import requests
from dataclasses import dataclass
from waffle.logger import LOG
from waffle.law_url import LawUrl
@dataclass
class _FollowResults:
path: LawUrl
links: typing.List[LawUrl]
@dataclass
class DownloadResults:
path: LawUrl
content: str
class Downloade... | 2.625 | 3 |
ozone-framework-python-server/people/urls.py | aamduka/ozone | 6 | 33646 | from django.urls import path
from rest_framework import routers
from .administration.views import AdministrationOfUserAPIView
from .views import PersonDetailView, PersonDashboardsWidgetsView, PersonWidgetDefinitionViewSet, PersonStackViewset
router = routers.SimpleRouter()
router.register(r'admin/users', Administrati... | 1.867188 | 2 |
00_CoinMarketCap_PullCryptoStats.py | prajwal-skdlove/CryptoCurrencyAnalysis | 1 | 33647 | # -*- coding: utf-8 -*-
'''This code pulls all coins from Conmarketcap.com
It stores it in a pandas dataframe'''
from bs4 import BeautifulSoup
import requests
import pandas as pd
import json
import collections
def coinmarketcap_coins(n):
'''This function pulls all the cryptocurrencies and its relat... | 3.765625 | 4 |
api/views/logs/resources.py | bdeprez/machinaris | 0 | 33648 | import json
import re
import traceback
from flask import request, make_response, abort
from flask.views import MethodView
from api import app
from api.extensions.api import Blueprint
from api.commands import log_parser
blp = Blueprint(
'Log',
__name__,
url_prefix='/logs',
description="Operations on ... | 2.328125 | 2 |
train_hg_seqnet.py | middleprince/fashionAi | 316 | 33649 | <filename>train_hg_seqnet.py
# Copyright 2018 <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 a... | 1.96875 | 2 |
W_conv.py | jeongjuns/Control_yolact | 0 | 33650 | <reponame>jeongjuns/Control_yolact
import math
import warnings
import torch
from torch import Tensor
from torch.nn.parameter import Parameter
import torch.nn.functional as F
import torch.nn.init as init
from torch.nn.modules.module import Module
from torch.nn.modules.utils import _single, _pair, _triple, _reverse_rep... | 1.8125 | 2 |
instapyper.py | rriehle/instapyper | 1 | 33651 | # encoding: utf-8
import requests
from requests_oauthlib import OAuth1
class Instapyper:
# Not sure this dict is necessary or even useful
status_codes = {
200: "Ok",
201: "URL successfully added",
400: "Bad Request",
401: "Unauthorized",
403: "Invalid username or pass... | 2.859375 | 3 |
tests/parser/test_mamanger.py | Sungup/sungup-utils | 0 | 33652 | import os
import re
import string
from collections import namedtuple, defaultdict
from tests import utils
from tests.parser import ParserTestCase
from sglove.parser.exception import *
from sglove.parser import _OptionManager
class TestOptionManager(ParserTestCase):
__TEST_COUNT = 50
def __test_invalid_nami... | 2.671875 | 3 |
gitea_api/models/internal_tracker.py | awalker125/gitea-api | 0 | 33653 | # coding: utf-8
"""
Gitea API.
This documentation describes the Gitea API. # noqa: E501
OpenAPI spec version: 1.15.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from gitea_api.configuration import Configuration
clas... | 1.6875 | 2 |
tests/unit/flow/test_flow_except.py | gvvynplaine/jina | 1 | 33654 | import unittest
from jina.executors.crafters import BaseCrafter
from jina.flow import Flow
from jina.proto import jina_pb2
from tests import JinaTestCase
class DummyCrafter(BaseCrafter):
def craft(self, *args, **kwargs):
return 1 / 0
class FlowExceptTestCase(JinaTestCase):
def test_bad_flow(self):... | 2.4375 | 2 |
Operator/server.py | ale9412/Operator | 0 | 33655 | <filename>Operator/server.py
import socketserver
import multiprocessing as mp
from shunting_yard_algorithm import evaluate
class MyTCPHandler(socketserver.BaseRequestHandler):
"""
The request handler class for our server.
It is instantiated once per connection to the server, and must
override the han... | 3.203125 | 3 |
cbh.py | jensengroup/fragreact | 2 | 33656 | <reponame>jensengroup/fragreact<gh_stars>1-10
#!/usr/bin/env python
import numpy as np
import re
from rdkit import Chem
from rdkit.Chem import rdMolDescriptors
from itertools import combinations
import copy
def print_smiles(smiles_list, human=False):
smiles_dict = count_smiles(smiles_list)
keys = smiles_dic... | 3.078125 | 3 |
dlchord2/parser/accidentals_parser.py | anime-song/DLChord-2 | 0 | 33657 | from enum import Enum
from dlchord2.const import ACCIDENTALS_SHARP, ACCIDENTALS_FLAT
from dlchord2.exceptions.accidentals_exceptions import AccidentalsParseError
class AccidentalsType(Enum):
"""
調号の種類を表す列挙体
"""
NONE = 0
SHARP = 1
FLAT = 2
class AccidentalsParseData(object):
"""
調号を解... | 2.90625 | 3 |
tests/unit/utils/test_instantiate.py | schiotz/nequip | 153 | 33658 | import pytest
import yaml
from nequip.utils import instantiate
simple_default = {"b": 1, "d": 31}
class SimpleExample:
def __init__(self, a, b=simple_default["b"], d=simple_default["d"]):
self.a = a
self.b = b
self.d = d
nested_default = {"d": 37}
class NestedExample:
def __init... | 2.625 | 3 |
models/wct2.py | momenator/spine_uda | 1 | 33659 | import torch
import torch.nn as nn
import os
import torch.optim as optim
import torch.optim.lr_scheduler as lr_scheduler
from .modules import WavePool, WaveUnpool, ImagePool, NLayerDiscriminator
from utils.metrics import compute_dice_metric
from utils.losses import DiceLoss
import numpy as np
class WaveEncoder(nn.Mod... | 2.453125 | 2 |
api/public/urls.py | marinimau/wayne_django_rest | 0 | 33660 | #
# copyright © 2020 - all rights reserved
# Created at: 03/11/20
# By: mauromarini
# License: MIT
# Repository: https://github.com/marinimau/wayne_django_rest
# Credits: @marinimau (https://github.com/marinimau)
#
from django.urls import path
from api.user import views as user_views
from api.social impor... | 2.046875 | 2 |
mentoring_app/migrations/0007_mentoringprogram_is_published.py | ShouravAhmed/Luminar | 0 | 33661 | <reponame>ShouravAhmed/Luminar
# Generated by Django 3.2.7 on 2021-12-28 05:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mentoring_app', '0006_mentoringprogram_is_archived'),
]
operations = [
migrations.AddField(
model... | 1.390625 | 1 |
csdaily/data.py | qytz/cn_stock_daily | 1 | 33662 | # -*- coding: utf-8 -*-
# This file is part of CSDaily.
# Copyright (C) 2018-present qytz <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LIC... | 2.28125 | 2 |
RecordSpider/beian.py | wjcIvan/oschinaLearning | 1 | 33663 | <reponame>wjcIvan/oschinaLearning
# coding:utf-8
import sys
from PyQt5 import QtWidgets
import window
import recordSpider
class MainWindow(object):
def __init__(self):
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
self.ui = window.Ui_MainWindow()
sel... | 2.40625 | 2 |
querybook/server/datasources_socketio/connect.py | shivammmmm/querybook | 1,144 | 33664 | <filename>querybook/server/datasources_socketio/connect.py
from flask_login import current_user
from flask_socketio import ConnectionRefusedError
from app.flask_app import socketio
from const.data_doc import DATA_DOC_NAMESPACE
from const.query_execution import QUERY_EXECUTION_NAMESPACE
def connect():
if not curr... | 2.359375 | 2 |
python/alibiexplainer/tests/utils.py | owennewo/kfserving | 2 | 33665 | import kfserving
from typing import List, Union
import numpy as np
class Predictor(): # pylint:disable=too-few-public-methods
def __init__(self, clf: kfserving.KFModel):
self.clf = clf
def predict_fn(self, arr: Union[np.ndarray, List]) -> np.ndarray:
instances = []
for req_data in arr... | 2.6875 | 3 |
relations/views.py | Mansouroopi/DRF | 0 | 33666 | <filename>relations/views.py<gh_stars>0
from snippets.permissions import IsOwnerOrReadOnly
from rest_framework import permissions
from rest_framework import viewsets
from .models import Album, Track, Student, Module
from .serializers import AlbumSerializer, StudentSerializer, ModuleSerializer, TrackSerializer
from re... | 2.21875 | 2 |
venv/lib/python3.7/site-packages/torch/testing/_internal/common_methods_invocations.py | GOOGLE-M/SGC | 0 | 33667 | <reponame>GOOGLE-M/SGC<gh_stars>0
from functools import reduce, wraps, partial
from itertools import product
from operator import mul, itemgetter
import collections
import operator
import torch
import numpy as np
from torch._six import inf, istuple
from torch.autograd import Variable
import collections.abc
from typin... | 1.703125 | 2 |
examples/python/numpy_functions.py | benedicteb/FYS2140-Resources | 0 | 33668 | <filename>examples/python/numpy_functions.py
#!/usr/bin/env python
"""
Created on Mon 2 Dec 2013
Script viser import av funksjoner fra numpy og bruk av noen.
@author <NAME>
"""
from numpy import *
print 'e^1 =', exp( 1 ) # Eksponentialfunksjonen
print 'cos(pi) =', cos( pi ) # Cosin... | 3.09375 | 3 |
homeassistant/components/automation/sun.py | instantchow/home-assistant | 0 | 33669 | <filename>homeassistant/components/automation/sun.py
"""
Offer sun based automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/components/automation/#sun-trigger
"""
import logging
from datetime import timedelta
import homeassistant.util.dt as dt... | 2.625 | 3 |
docs/source/conf.py | tanlin2013/Tensor-Network | 1 | 33670 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 1.4375 | 1 |
tests/modules/organizations/test_models.py | karenc/houston | 0 | 33671 | <gh_stars>0
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name,missing-docstring
import sqlalchemy
import logging
def test_Organization_add_members(db, temp_user): # pylint: disable=unused-argument
from app.modules.organizations.models import (
Organization,
OrganizationUserMembershipEnroll... | 2.28125 | 2 |
Chapter 12/ch12_r03.py | PacktPublishing/Modern-Python-Cookbook | 107 | 33672 | <gh_stars>100-1000
"""
{
"swagger": "2.0",
"info": {
"title": "Python Cookbook\\nChapter 12, recipe 3.",
"version": "1.0"
},
"schemes": "http",
"host": "127.0.0.1:5000",
"basePath": "/dealer",
"consumes": "application/json",
"produces": "application/json",
"paths": {
... | 2.25 | 2 |
Desafios/desafio053.py | josivantarcio/Desafios-em-Python | 0 | 33673 | <reponame>josivantarcio/Desafios-em-Python<gh_stars>0
frase = str(input('Digite a frase: ')).strip().upper()
palavras = frase.split()
juntarPalavras = ''.join(palavras)
trocar = juntarPalavras[::-1]
print(trocar) | 3.828125 | 4 |
python/examples/test_tds.py | dmillard/autogen | 33 | 33674 | <reponame>dmillard/autogen
import pytinydiffsim_ad as dp
import autogen as ag
import numpy as np
import math
TIME_STEPS = 20
def func(input_tau):
world = dp.TinyWorld()
world.friction = dp.ADScalar(1.0)
urdf_parser = dp.TinyUrdfParser()
urdf_data = urdf_parser.load_urdf("/root/tiny-differentiable-simulator/d... | 2.421875 | 2 |
tf_rl/examples/NerveNet/network/ggnn.py | Rowing0914/TF2_RL | 8 | 33675 | <reponame>Rowing0914/TF2_RL
import tensorflow as tf
import tensorflow_probability as tfp
XAVIER_INIT = tf.contrib.layers.xavier_initializer()
class GRU_cell(tf.keras.Model):
def __init__(self, hidden_unit, output_nodes):
super(GRU_cell, self).__init__()
self.i_to_r = tf.keras.layers.Dense(hidden_... | 2.609375 | 3 |
docsie_universal_importer/providers/google_drive/__init__.py | Zarif99/test-universal | 0 | 33676 | default_app_config = 'docsie_universal_importer.providers.google_drive.apps.GoogleDriveAppConfig'
| 1.171875 | 1 |
agent/h42backup/h42backup/container.py | gilles67/h42-backup | 0 | 33677 | import docker, json
VALID_PROFILE = ['volume', 'mariadb']
def backup_list():
client = docker.DockerClient(base_url='unix://var/run/docker.sock')
bck = {}
for ct in client.containers.list(all=True):
is_backup = False
error = []
if 'one.h42.backup.enable' in ct.labels:
if... | 2.46875 | 2 |
testarch/unet/runs.py | weihao94/deepdyn | 42 | 33678 | <filename>testarch/unet/runs.py
import copy
import os
import random
import numpy as np
sep = os.sep
####################### GLOBAL PARAMETERS ##################################################
############################################################################################
Params = {
'num_channels': ... | 1.921875 | 2 |
mysql_table_generator.py | zed31/mongo_vs_mysql | 0 | 33679 | <reponame>zed31/mongo_vs_mysql<filename>mysql_table_generator.py
#!/usr/bin/python3
import MySQLdb
from sys import argv, exit
from random import choice
arr_prefix = [
"sit",
"eiusmod",
"nulla",
"tempor",
"exercitation",
"Lorem",
"consectetur",
"qui",
"aute",
"laborum",
"culpa",
"sunt",
"sunt... | 2.125 | 2 |
tests/test_database.py | rahulg/mongorm | 4 | 33680 | <filename>tests/test_database.py<gh_stars>1-10
import unittest
from mongorm import Database
class DatabaseTestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.db = Database(uri='mongodb://localhost:27017/orm_test')
cls.db2 = Database(host='localhost', port=27017, db='orm_test2'... | 2.75 | 3 |
heap/binary_heap_test.py | dyc-it/algorithm | 0 | 33681 | <reponame>dyc-it/algorithm<filename>heap/binary_heap_test.py
import unittest
import random
from binary_heap import BinaryHeap
class TestBinaryHeap(unittest.TestCase):
def setUp(self):
size = 8
self.random_list = random.sample(range(0, size), size)
print "random list generated: " + str(sel... | 3.265625 | 3 |
src/alfred3/element/action.py | mate-code/alfred | 9 | 33682 | <gh_stars>1-10
"""
Provides elements that make stuff happen.
.. moduleauthor: <NAME> <<EMAIL>>
"""
from typing import Union
from typing import List
from uuid import uuid4
import cmarkgfm
from cmarkgfm.cmark import Options as cmarkgfmOptions
from emoji import emojize
from ..exceptions import AlfredError
from .._help... | 2.421875 | 2 |
models/loss/vae_loss.py | PeterJaq/optical_film_toolbox | 4 | 33683 | <filename>models/loss/vae_loss.py
def log_normal_pdf(sample, mean, logvar, raxis=1):
log2pi = tf.math.log(2. * np.pi)
return tf.reduce_sum(
-.5 * ((sample - mean) ** 2. * tf.exp(-logvar) + logvar + log2pi),
axis=raxis)
def compute_loss(model, x):
mean, logvar = model.encode(x)
z = model.reparamete... | 2.28125 | 2 |
agent/main_runner.py | velteyn/agent57 | 48 | 33684 | <reponame>velteyn/agent57
import gym
from keras.optimizers import Adam
import traceback
import os
from .dqn import DQN
from .agent57 import Agent57
from .model import InputType, DQNImageModel, LstmType
from .policy import AnnealingEpsilonGreedy
from .memory import PERRankBaseMemory, PERProportionalMemory
from .env_pl... | 1.921875 | 2 |
Fred/7_Gestures/Reactions.py | ProjectHewitt/Fred_Inmoov | 6 | 33685 | <filename>Fred/7_Gestures/Reactions.py
##############################################################
# Program Code for <NAME> #
# Of the Cyber_One YouTube Channel #
# https://www.youtube.com/cyber_one #
# ... | 2.765625 | 3 |
StormPyTwitter/src/main/multilang/resources/python/twitter_storm/twitter_components.py | juanrh/data42 | 1 | 33686 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Based on storm.py module from https://github.com/nathanmarz/storm/blob/master/storm-core/src/multilang/py/storm.py, and the examples from https://github.com/apache/incubator-storm/blob/master/examples/storm-starter/multilang/resources/splitsentence.py and http://storm.... | 2.015625 | 2 |
nuremberg/core/urls.py | emmalemma/nuremberg | 0 | 33687 | <gh_stars>0
from django.conf.urls import include, url
from django.contrib import admin
from httpproxy.views import HttpProxy
from django.views.generic.base import RedirectView
from django.http import HttpResponse
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^transcripts/', include('nuremberg.transcr... | 2 | 2 |
signin/jd_job/common.py | nujabse/simpleSignin | 11 | 33688 | #!/usr/bin/env python
# encoding: utf-8
# author: Vincent
# refer: https://github.com/vc5
import re
import time
from requests import Response
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.touch_actions import TouchActions
from ..chrome import mobile_emulation
from lib.se... | 2.15625 | 2 |
tests/test_parse.py | adamrp/emperor | 0 | 33689 | #!/usr/bin/env python
from __future__ import division
__author__ = "<NAME>"
__copyright__ = "Copyright 2013, The Emperor Project"
__credits__ = ["<NAME>"]
__license__ = "BSD"
__version__ = "0.9.3-dev"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"
from unittest import TestCase, main
from ... | 2.328125 | 2 |
Nmapscript.py | WhiteRedTHT/port-scann | 0 | 33690 | <gh_stars>0
# -*- coding: utf-8 -*-
import os
import vulners
print("---------------------------------------------------------------")
print(""" P4RS Script Hoş Geldiniz
Programı kullanmak için sadece IP adresini yazmanız yeterlidir.
Programı çalıştırmak için; Medusa araçları, searcsploit ve brutespray uygulamaları... | 2.609375 | 3 |
portal/migrations/versions/a031e26dc1bd_.py | ivan-c/truenth-portal | 3 | 33691 | from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
"""empty message
Revision ID: <KEY>
Revises: <PASSWORD>
Create Date: 2018-08-06 16:03:36.820890
"""
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '8efa45d83a3b'
def upgrade():
# ### commands auto generated by ... | 1.789063 | 2 |
gui/main_window/reservations/add_reservations/gui.py | Just-Moh-it/HotinGo | 14 | 33692 | from pathlib import Path
from tkinter import Frame, Canvas, Entry, Text, Button, PhotoImage, messagebox
import controller as db_controller
OUTPUT_PATH = Path(__file__).parent
ASSETS_PATH = OUTPUT_PATH / Path("./assets")
def relative_to_assets(path: str) -> Path:
return ASSETS_PATH / Path(path)
def add_reserva... | 2.796875 | 3 |
lib/util/ImageProcessing/homopgrahy.py | Thukor/MazeSolver | 5 | 33693 | import cv2
import numpy as np
import imutils
from collections import defaultdict
# mouse callback function
def define_points(target_img):
corners = []
refPt = []
def draw_circle(event,x,y,flags,param):
global refPt
if event == cv2.EVENT_LBUTTONDBLCLK:
cv2.circle(param,(x,y),5,(... | 2.828125 | 3 |
chime.py | alexklapheke/chime | 0 | 33694 | import argparse
import configparser
import os
import pathlib
import platform
import random
import subprocess as sp
import sys
import typing
import warnings
if platform.system() == 'Windows':
import winsound
try:
from IPython.core import magic
IPYTHON_INSTALLED = True
except ImportError:
IPYTHON_INSTAL... | 2.40625 | 2 |
tests/Omega/test_Omega_ligand_preparation.py | niladell/DockStream | 34 | 33695 | <reponame>niladell/DockStream<gh_stars>10-100
import unittest
import os
from dockstream.core.OpenEyeHybrid.Omega_ligand_preparator import OmegaLigandPreparator
from dockstream.core.ligand.ligand_input_parser import LigandInputParser
from dockstream.utils.enums.docking_enum import DockingConfigurationEnum
from dockst... | 2.09375 | 2 |
tests/test_blog/test_post_search.py | florimondmanca/personal-api | 4 | 33696 | <filename>tests/test_blog/test_post_search.py
"""Test searching the list of blog posts."""
from typing import List
from rest_framework.test import APITestCase
from blog.factories import PostFactory
from tests.decorators import authenticated
@authenticated
class PostSearchListTest(APITestCase):
"""Test searchin... | 3.09375 | 3 |
yo/schema.py | RailCoin/yo | 10 | 33697 | # coding=utf-8
from enum import IntEnum
class NotificationType(IntEnum):
power_down = 1
power_up = 2
resteem = 3
feed = 4
reward = 5
send = 6
mention = 7
follow = 8
vote = 9
comment_reply = 10
post_reply = 11
account_update = 12
message = 13
receive = 14
class ... | 2.09375 | 2 |
iu_mongo/session.py | intelligenceunion/mongo-driver | 0 | 33698 | from pymongo.read_concern import ReadConcern
from pymongo.read_preferences import ReadPreference
from pymongo.write_concern import WriteConcern
from pymongo.errors import InvalidOperation
from iu_mongo.errors import TransactionError
__all__ = ['Session', 'TransactionContext']
DEFAULT_READ_CONCERN = ReadConcern('major... | 2.203125 | 2 |
bin/ingredient_phrase_tagger/training/cli.py | Deekshith1994/Recipes | 0 | 33699 | <filename>bin/ingredient_phrase_tagger/training/cli.py
import re
import decimal
import optparse
import pandas as pd
from ingredient_phrase_tagger.training import utils
class Cli(object):
def __init__(self, argv):
self.opts = self._parse_args(argv)
self._upstream_cursor = None
def run(self):
... | 2.828125 | 3 |