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 |
|---|---|---|---|---|---|---|
kinbot/hir.py | rubenvdvijver/KinBot | 0 | 31500 | ###################################################
## ##
## This file is part of the KinBot code v2.0 ##
## ##
## The contents are covered by the terms of the ##
## BSD 3-clause license included in the LICENSE ##
## file,... | 2.109375 | 2 |
data/ffnet.py | starrybouquet/sj-fanfic-recs | 0 | 31501 | import re, requests, bs4, unicodedata
from datetime import timedelta, date, datetime
from time import time
# Constants
root = 'https://www.fanfiction.net'
# REGEX MATCHES
# STORY REGEX
_STORYID_REGEX = r"var\s+storyid\s*=\s*(\d+);"
_CHAPTER_REGEX = r"var\s+chapter\s*=\s*(\d+);"
_CHAPTERS_REGEX = r"Chapters:\s*(\d+)\... | 2.71875 | 3 |
maglearn_back/database.py | maglearn/maglearn-back | 0 | 31502 | <gh_stars>0
import sqlite3
from datetime import datetime
import click
from flask import current_app, g
from flask.cli import with_appcontext
from flask_sqlalchemy import SQLAlchemy, Model
from sqlalchemy import Column, Integer, TIMESTAMP, Boolean
class Base(Model):
# this id implementation does not support inher... | 2.6875 | 3 |
legacy/models/ioc_mlp.py | gsc2001/ConvexNet | 0 | 31503 | import torch.utils.data
from torch.utils.tensorboard import SummaryWriter
from torch import nn
from tqdm import tqdm
import numpy as np
from datasets.preprocess import DatasetWrapper
from utils import AverageMeter
class IOC_MLP(torch.nn.Module):
def __init__(self, input_features, out_classes):
super()._... | 2.453125 | 2 |
Lesson04_CrypoTools_pt1/1_julius/solution.py | Alyoninthecity/Cybersecurity2021UNIPD | 0 | 31504 | import base64
import re
def base64ToString(base64):
reg = "\\x[a-z0-9][a-z0-9]"
base64.b64decode()
message_bytes = message.encode("ascii")
base64_bytes = base64.b64encode(message_bytes)
base64_message = base64_bytes.decode("ascii")
def shiftASCII(string, n):
r = ""
for i in string:
... | 3.03125 | 3 |
freyr_app/core/forms.py | blanchefort/freyrmonitoring | 2 | 31505 | <filename>freyr_app/core/forms.py
from django import forms
class AddUrlForm(forms.Form):
"""Добавляем УРЛ для проверки
"""
url = forms.URLField(initial='https://', label='Введите ссылку для проверки')
class UploadHappinessIndex(forms.Form):
"""Форма для загрузки файла с кастомным индексом счастья
... | 2.34375 | 2 |
src/putil/test/test_timer.py | scionrep/scioncc_new | 2 | 31506 | import time
from math import fabs
import putil.timer
from putil.testing import UtilTest
class TestTimer(UtilTest):
def setUp(self):
self.op1_times = iter([ .01, .02 ])
self.a1 = putil.timer.Accumulator()
self.op2_step1_times = iter([ .005, .015, .005, .005])
self.op2_step2_times ... | 2.703125 | 3 |
google/api/endpoint_pb2.py | LaudateCorpus1/python-api-common-protos | 0 | 31507 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 1.195313 | 1 |
flexget/plugins/filter/imdb_required.py | Konubinix/Flexget | 1 | 31508 | from __future__ import unicode_literals, division, absolute_import
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('imdb_required')
class FilterImdbRequired(object):
"""
Rejects entries without imdb_url or imdb_id.
Makes imdb lookup / search if necessary... | 2.1875 | 2 |
tools/make_folders.py | leonzucchini/recipes | 8 | 31509 | <filename>tools/make_folders.py
import os
import sys
import shutil
import re
def make_output_folder(folder_path, debug=False):
""" Make folder for output, checking for previous results """
# Skip if debug (avoids replace prompt)
if debug:
print "FolderSetup warning: Not creating di... | 3.625 | 4 |
emit_main/workflow/l3_tasks.py | emit-sds/emit-main | 1 | 31510 | """
This code contains tasks for executing EMIT Level 3 PGEs and helper utilities.
Author: <NAME>, <EMAIL>
"""
import datetime
import logging
import os
import luigi
import spectral.io.envi as envi
from emit_main.workflow.output_targets import AcquisitionTarget
from emit_main.workflow.workflow_manager import Workflo... | 2.0625 | 2 |
src/python/backends/py/runtime/graph/copy.py | andyjost/Sprite | 1 | 31511 | '''
Code to copy Curry expressions.
'''
from __future__ import absolute_import
from .....common import T_SETGRD, T_FWD
from copy import copy, deepcopy
from ..... import inspect
from . import node
__all__ = ['copygraph', 'copynode', 'GraphCopier', 'Skipper']
class GraphCopier(object):
'''
Deep-copies an expressio... | 2.875 | 3 |
src/dynamic_programming/python/coins/tests/test_coins.py | djeada/GraphAlgorithms | 2 | 31512 | <filename>src/dynamic_programming/python/coins/tests/test_coins.py
import unittest
import os
import sys
file_dir = os.path.dirname(os.path.dirname(__file__))
sys.path.append(file_dir + "/src")
from coins import coin_change_basic, coin_change_memo, coin_change_tab
class TestCoinChangeBasic(unittest.TestCase):
d... | 3.4375 | 3 |
tutorials/W1D3_MultiLayerPerceptrons/solutions/W1D3_Tutorial1_Solution_d58d2933.py | amita-kapoor/course-content-dl | 473 | 31513 |
"""
At infinite membrane resistance, the Neuron does not leak any current out,
and hence it starts firing with the slightest input current,
This shifts the transfer function towards 0, similar to ReLU activation (centered at 0).
Also, when there is minimal refractory time, the neuron can keep firing
at a high input cu... | 2.890625 | 3 |
clients/listen.py | devstopfix/elixoids | 5 | 31514 | #
# Visualize the audio of an Elixoids game:
#
# pip3 install websocket-client
# python3 clients/listen.py --host example.com
#
import argparse
import sys
import websocket
try:
import thread
except ImportError:
import _thread as thread
import sound_pb2
def on_message(ws, message):
sound = sound_... | 2.484375 | 2 |
find_duplicates.py | dallascard/LN_tools | 1 | 31515 | <filename>find_duplicates.py<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
This script looks through the JSON files created by parse_LN_to_JSON.py and looks
for duplicates using the Jaccard Coefficient f k-grams of the article text (body).
It creates a CSV file with all of the cases listed and duplicates marked, and
opti... | 3.46875 | 3 |
QARealtimeCollector/clients/test.py | dizzy21c/QUANTAXIS_RealtimeCollector | 1 | 31516 | <reponame>dizzy21c/QUANTAXIS_RealtimeCollector
from QAPUBSUB.consumer import subscriber
sub = subscriber(host='192.168.2.116',user='admin', password='<PASSWORD>' ,exchange= 'realtime_60min_rb1910')
sub.start() | 1.6875 | 2 |
artifacttemplates/http%3A%2F%2Fopentosca.org%2Fartifacttemplates/PennyLaneAlgo_DA_AT/files/pennylane_app_algo.py | OpenTOSCA/tosca-definitions-public | 0 | 31517 | import pennylane as qml
import numpy as np
def algo(x, y, z):
qml.RZ(z, wires=[0])
qml.RY(y, wires=[0])
qml.RX(x, wires=[0])
qml.CNOT(wires=[0, 1])
return qml.expval(qml.PauliZ(wires=1))
def run_algo(device, args):
print(args)
circuit = qml.QNode(algo, device)
result = circuit(float(args['X']), float(args['Y'... | 2.640625 | 3 |
baseline/deep_ed_PyTorch/deep_ed_PyTorch/ed/model/model_global.py | yifding/e2e_EL_evaluate | 5 | 31518 | <reponame>yifding/e2e_EL_evaluate<gh_stars>1-10
# **YD** the model to train deep-ed-global for entity disambiguation
import copy
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
from deep_ed_PyTorch.utils import utils
from deep_ed_PyTorch.ed.args import arg_parse
class EntityContex... | 2.515625 | 3 |
11_cnnInceptionMNIST.py | cwangjiang/PyTorch_Basics | 0 | 31519 | <filename>11_cnnInceptionMNIST.py
# this code use cnn with inception unit + softmax to predict handwriting 0-9
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
batch_size = 64
# download t... | 3.171875 | 3 |
LovelyFlask/App/views.py | legendary6666/AxfFlask | 0 | 31520 | <filename>LovelyFlask/App/views.py
from flask import Blueprint, request, render_template, url_for
from LovelyFlask.App.models import HomeWheel, HomeNav, HomeMustBuy, HomeMainShow, HomeShop, FoodTypes, Goods, CartModel
blue = Blueprint("first_blue", __name__, url_prefix="/api/")
def init_first_blue(app):
app.regi... | 2.609375 | 3 |
tests/test_benchmark_config.py | chayim/redisbench-admin | 0 | 31521 | <gh_stars>0
import json
import yaml
from redisbench_admin.utils.benchmark_config import (
results_dict_kpi_check,
check_required_modules,
extract_redis_dbconfig_parameters,
)
def test_results_dict_kpi_check():
return_code = results_dict_kpi_check({}, {}, 0)
assert return_code == 0
return_cod... | 2.15625 | 2 |
thornpy/utilities.py | bthornton191/thorpy | 0 | 31522 | """Miscellaneous tools.
"""
import os
import csv
from typing import Union
from subprocess import Popen
from pathlib import Path
from scipy.io import loadmat
import pandas as pd
def open_in_explorer(path : os.PathLike) -> None:
if Path(path).is_dir():
_ = Popen(f'explorer.exe /root,"{path}"')
elif Pat... | 3.15625 | 3 |
python/paddle/fluid/tests/unittests/test_rnn_cell_api.py | L-Net-1992/Paddle | 11 | 31523 | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 2.046875 | 2 |
pyfsdb/dbheatmap.py | samihaija/pyfsdb | 0 | 31524 | #!/usr/bin/python3
import sys
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter, FileType
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pyfsdb
def parse_args():
parser = ArgumentParser(formatter_class=ArgumentDefaultsHelpFormatter,
desc... | 3 | 3 |
cheatsheeter/extensions/embed_img.py | jorgebg/cheatsheets | 0 | 31525 | <reponame>jorgebg/cheatsheets
import base64
import mimetypes
import os
from urllib.parse import unquote
import xml.etree.ElementTree as etree
from markdown.inlinepatterns import LinkInlineProcessor
from markdown.extensions import Extension
def remove_namespace(doc, namespace):
"""Remove namespace in the passed do... | 2.71875 | 3 |
Lintcode/Ladder_64_G_GC/1398. K Decimal Addition.py | ctc316/algorithm-python | 0 | 31526 | <filename>Lintcode/Ladder_64_G_GC/1398. K Decimal Addition.py
class Solution:
"""
@param k: The k
@param a: The A
@param b: The B
@return: The answer
"""
def addition(self, k, a, b):
result = ""
i = len(a) - 1
j = len(b) - 1
carry = 0
while i >= 0 and ... | 3.28125 | 3 |
algorithm/util.py | Scott-Huang/SemEval-2021-Task-6 | 0 | 31527 | import json
import argparse
def to_output(filepath, outpath):
with open(filepath, encoding='utf-8') as f:
data = json.load(f)
output = []
for d in data:
temp = {}
temp['id'] = d['id']
temp['labels'] = d['pred_labels']
output.append(temp)
with open(outpath, 'w+') ... | 2.765625 | 3 |
pyxlsb2/cell.py | cccs-jh/pyxlsb2 | 16 | 31528 | import sys
if sys.version_info > (3,):
basestring = (str, bytes)
long = int
class DeprecatedCellMixin(object):
"""Deprecated Cell properties to preserve source compatibility with the 1.0.x releases."""
__slots__ = ()
@property
def r(self):
"""The row number of this cell.
..... | 2.90625 | 3 |
2018/vis/simple_test.py | vais-ral/WorkExperience | 0 | 31529 | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 27 13:59:43 2018
@author: ofn77899
"""
import numpy
from ccpi.segmentation.SimpleflexSegmentor import SimpleflexSegmentor
from ccpi.viewer.CILViewer import CILViewer
from ccpi.viewer.CILViewer2D import CILViewer2D, Converter
import vtk
#Text-based input s... | 2.65625 | 3 |
Scripts/day12.py | HarrisonGreen/Advent-of-Code-2015 | 0 | 31530 | import json
def read_input():
file = open("Data/day12.json", "r")
return json.load(file)
def calculate_sum(accounts):
if type(accounts) == str:
return 0
elif type(accounts) == int:
return accounts
elif type(accounts) == list:
return sum(calculate_sum(i... | 3.796875 | 4 |
backend/app/admin/components/__init__.py | griviala/garpix_page | 0 | 31531 | <filename>backend/app/admin/components/__init__.py
from .text_component import TextComponentAdmin # noqa
from .text_description_component import TextDescriptionComponentAdmin # noqa
| 1.1875 | 1 |
portal/pulsar/__init__.py | bbhunter/pulsar | 12 | 31532 | <gh_stars>10-100
from .celeryapp import *
| 1.046875 | 1 |
src/tests/wikipedia.py | alexseitsinger/page-scrapers | 1 | 31533 | <gh_stars>1-10
from page_scrapers.wikipedia.scrapers.film import WikipediaFilmScraper
query_1 = "<NAME>"
scraper_1 = WikipediaFilmScraper(query_1)
scraped_1 = scraper_1.scrape()
filtered_1 = scraper_1.filter()
print(filtered_1)
query_2 = "hellraiser judgement"
scraper_2 = WikipediaFilmScraper(query_2)
scraped_2 = scr... | 2.71875 | 3 |
mobilkit/temporal.py | mindearth/mobilkit | 12 | 31534 | <filename>mobilkit/temporal.py
# Copyright (C) MindEarth <<EMAIL>> @ Mindearth 2020-2021
#
# This file is part of mobilkit.
#
# mobilkit is distributed under the MIT license.
'''Tools and functions to analyze the data in time.
'''
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn a... | 2.234375 | 2 |
tests/test_mat2.py | TovarnovM/easyvec | 1 | 31535 | from easyvec import Mat2, Vec2
import numpy as np
from pytest import approx
def test_constructor1():
m = Mat2(1,2,3,4)
assert m is not None
assert m.m11 == approx(1)
assert m.m12 == approx(2)
assert m.m21 == approx(3)
assert m.m22 == approx(4)
def test_constructor2():
m = Mat2([1,2,3,4])
... | 2.53125 | 3 |
tests/test_static_maze.py | agarwalishika/two-d-nav-gym | 2 | 31536 | import numpy as np
from two_d_nav.envs.static_maze import StaticMazeNavigation
def test_goal():
env = StaticMazeNavigation()
for i in range(60):
obs, reward, done, _ = env.step(np.array([1.0, -0.1]))
env.render()
for i in range(30):
obs, reward, done, _ = env.step(np.array([-1.0... | 2.625 | 3 |
starter_code/api_keys.py | bjouellette/python-api-challenge | 1 | 31537 | # OpenWeatherMap API Key
weather_api_key = "<KEY>"
# Google API Key
g_key = "<KEY>"
| 1.21875 | 1 |
dist-packages/dtk/ui/paned.py | Jianwei-Wang/python2.7_lib | 0 | 31538 | <gh_stars>0
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 ~ 2012 Deepin, Inc.
# 2011 ~ 2012 <NAME>
# 2011 ~ 2012 <NAME>
#
# Author: <NAME> <<EMAIL>>
# Maintainer: <NAME> <<EMAIL>>
#
# This program is free software: you can redistribute it and/or modify
# it under t... | 2.234375 | 2 |
sghymnal/players/tests/test_drf_views.py | shortnd/sghymnal | 0 | 31539 | <reponame>shortnd/sghymnal<filename>sghymnal/players/tests/test_drf_views.py
import pytest
from django.contrib.auth.models import AnonymousUser
from django.test import RequestFactory
from sghymnal.players.api.views import PlayersViewSet
from sghymnal.players.models import Player
pytestmark = pytest.mark.django_db
c... | 2.1875 | 2 |
arviz/plots/backends/matplotlib/separationplot.py | sudojarvis/arviz | 1,159 | 31540 | <reponame>sudojarvis/arviz
"""Matplotlib separation plot."""
import matplotlib.pyplot as plt
import numpy as np
from ...plot_utils import _scale_fig_size
from . import backend_kwarg_defaults, backend_show, create_axes_grid
def plot_separation(
y,
y_hat,
y_hat_line,
label_y_hat,
expected_events,
... | 2.546875 | 3 |
mesonwrap/tools/import_from_hosted.py | Calinou/wrapweb | 0 | 31541 | import argparse
import git
import github
import os.path
from mesonwrap import gitutils
from mesonwrap import tempfile
from mesonwrap import webapi
from mesonwrap import wrap
from mesonwrap.tools import environment
from retrying import retry
class Importer:
def __init__(self):
self._tmp = None
s... | 2.1875 | 2 |
Cogs/GuideCog.py | BloomAutist47/bloom-bo | 1 | 31542 | <filename>Cogs/GuideCog.py
import os
from .Base import *
from discord.ext import commands
class GuideCog(commands.Cog, BaseTools):
def __init__(self, bot):
self.setup()
self.bot = bot
# self.bot.remove_command("help")
self.fotter = "Tip: Use \";g\" to summon a list of all guides.\nT... | 2.46875 | 2 |
eden/modifier/rna/lib_forgi.py | zaidurrehman/EDeN | 0 | 31543 | #!/usr/bin/env python
"""bulge_graph.py: A graph representation of RNA secondary structure based
on its decomposition into primitive structure types: stems, hairpins,
interior loops, multiloops, etc...
for eden and graphlearn we stripped forgi down to this single file.
forgi: https://github.com/pkerpedj... | 2.6875 | 3 |
tools/test_net.py | Willy0919/Evovling_Boxes | 74 | 31544 | #!/usr/bin/env python
import _init_paths
from evb.test import test_net
from evb.config import cfg, cfg_from_file, cfg_from_list
from datasets.factory import get_imdb
import caffe
import argparse
import pprint
import time, os, sys
def parse_args():
"""
Parse input arguments
"""
parser = argparse.Argumen... | 2.1875 | 2 |
GameStore/product/migrations/0001_initial.py | hossein9090/gamestore | 0 | 31545 | # Generated by Django 3.2.6 on 2021-08-24 09:26
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
... | 1.789063 | 2 |
personal_assistant/constants.py | avryhof/personal-assistant | 0 | 31546 | <reponame>avryhof/personal-assistant
RECOGNIZER_SNOWBOY = 'snowboy'
RECOGNIZER_SPHINX = 'sphinx'
RECOGNIZER_WIT = 'wit.ai' | 1.179688 | 1 |
src/content-processor.py | rionaldichandraseta/anti-clickbait | 0 | 31547 | # Processor for kompas-data-contents.txt
MIN_IDX = 100
contentfile = open('../data/kompas-data-contents.txt', 'r')
content_data = []
for line in contentfile:
content_data.append(line)
processed_contentfile = open('../data/kompas-data-contents-processed.txt', 'w+')
for id, content in enumerate(content_data):
... | 2.59375 | 3 |
app/home/routes.py | ajietrid/network-monitoring-using-pysnmp | 0 | 31548 | # -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""
from app.home import blueprint
from flask import render_template, redirect, url_for, request, flash, send_file
from flask_login import login_required, current_user
from app import login_manager
from jinja2 import TemplateNotFound
i... | 1.914063 | 2 |
src/aws_cloudformation_power_switch/rds_cluster.py | binxio/aws-cloudformation-stack-power-off | 1 | 31549 | import logging
from botocore.exceptions import ClientError
from aws_cloudformation_power_switch.power_switch import PowerSwitch
from aws_cloudformation_power_switch.tag import logical_id
class RDSClusterPowerSwitch(PowerSwitch):
def __init__(self):
super(RDSClusterPowerSwitch, self).__init__()
s... | 2.328125 | 2 |
src/organ_match_app/matchapp/migrations/0004_auto_20190509_1708.py | ajmengistu/organmatch | 1 | 31550 | # Generated by Django 2.2.1 on 2019-05-09 21:08
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('matchapp', '0003_available_doctors'),
]
operations = [
... | 1.640625 | 2 |
plugins/minfraud/komand_minfraud/actions/__init__.py | lukaszlaszuk/insightconnect-plugins | 46 | 31551 | # GENERATED BY KOMAND SDK - DO NOT EDIT
from .account_lookup.action import AccountLookup
from .all_lookup.action import AllLookup
from .billing_lookup.action import BillingLookup
from .card_lookup.action import CardLookup
from .cart_lookup.action import CartLookup
from .device_lookup.action import DeviceLookup
from .em... | 1.046875 | 1 |
catkin_ws/src/deep_learning/img_recognition/src/inference_to_reaction.py | CIRCUSPi/ROSKY | 3 | 31552 | #!/usr/bin/env python
import os, sys, argparse, errno, yaml, time, datetime
import rospy, rospkg
import torch, torchvision, cv2
import numpy as np
from rosky_msgs.msg import WheelsCmdStamped, Twist2DStamped
from img_recognition.msg import Inference
from cv_bridge import CvBridge, CvBridgeError
from jetcam_ros.utils imp... | 2.21875 | 2 |
examples/quickstart.py | farbod1277/imitation | 0 | 31553 | """Loads CartPole-v1 demonstrations and trains BC, GAIL, and AIRL models on that data.
"""
import os
import pathlib
import pickle
import tempfile
import seals # noqa: F401
import stable_baselines3 as sb3
from imitation.algorithms import adversarial, bc
from imitation.data import rollout
from imitation.util import ... | 2.421875 | 2 |
tests/integration/resources_permissions/test_epics_resources.py | aavcc/taiga-openshift | 0 | 31554 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 <NAME> <<EMAIL>>
# Copyright (C) 2014-2017 <NAME> <<EMAIL>>
# Copyright (C) 2014-2017 <NAME> <<EMAIL>>
# Copyright (C) 2014-2017 <NAME> <<EMAIL>>
# Copyright (C) 2014-2017 <NAME> <<EMAIL>>
# This program is free software: you can redistribute it and/or modify
# it under... | 1.835938 | 2 |
wmt-etl/config.py | ministryofjustice/hmpps-wmt | 3 | 31555 | import os
DB_SERVER = os.getenv('WMT_DB_SERVER', 'localhost')
DB_NAME = os.getenv('WMT_DB_NAME', 'wmt_db')
DB_USERNAME = os.getenv('WMT_DB_USERNAME', 'wmt')
DB_PASSWORD = os.getenv('WMT_DB_PASSWORD', '<PASSWORD>')
| 1.8125 | 2 |
apps/teacheres/adminx.py | ECNU-Studio/emoc | 1 | 31556 | <filename>apps/teacheres/adminx.py
# _*_ coding:utf-8 _*_
import xadmin
from .models import Teacheres
from courses.models import Courses
class AddCourses(object):
model = Courses
extra = 0
#培训师
class TeacheresAdmin(object):
list_display = ['name', 'username', 'email', 'phone', 'weixin', 'password']
s... | 1.921875 | 2 |
app/jitsi/main.py | RibhiEl-Zaru/jitsi-party | 0 | 31557 | <reponame>RibhiEl-Zaru/jitsi-party<gh_stars>0
import os
import json
from .models import User
from flask import Blueprint, send_from_directory, redirect, url_for, current_app, request, jsonify
main = Blueprint('main', __name__)
@main.route('/join', methods=['GET', 'POST'])
def join():
params = request.get_json()['... | 2.359375 | 2 |
easyai/data_loader/pc_cls/classify_pc_augment.py | lpj0822/image_point_cloud_det | 1 | 31558 | <filename>easyai/data_loader/pc_cls/classify_pc_augment.py
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author:
import numpy as np
class ClassifyPointCloudAugment():
def __init__(self):
self.is_augment_rotate = True
self.is_augment_dropout = True
self.is_augment_scale = True
se... | 3.09375 | 3 |
Examples/Image/Detection/FastRCNN/BrainScript/B3_VisualizeOutputROIs.py | shyamalschandra/CNTK | 17,702 | 31559 | <filename>Examples/Image/Detection/FastRCNN/BrainScript/B3_VisualizeOutputROIs.py
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
f... | 2.09375 | 2 |
src/deepke/name_entity_re/__init__.py | johncolezhang/DeepKE | 710 | 31560 | from .standard import *
from .few_shot import *
| 1.023438 | 1 |
tests/test_momentum.py | DanielDaCosta/optimization-algorithms | 6 | 31561 | <reponame>DanielDaCosta/optimization-algorithms
import unittest
import numpy as np
from gradient_descent.Momentum import Momentum
class TestMomentumClass(unittest.TestCase):
def setUp(self):
"""Setting up requirements for test
Params:
None
Returns:
None
""... | 3.171875 | 3 |
recipes/Python/299133_bubblebabble/recipe-299133.py | tdiprima/code | 2,023 | 31562 | #! /usr/bin/env python
"""Compute a (somewhat more) human readable format for message
digests. This is port of the perl module Digest-BubbleBabble-0.01
(http://search.cpan.org/~btrott/Digest-BubbleBabble-0.01/)
"""
vowels = "aeiouy"
consonants = "bcdfghklmnprstvzx"
def bubblebabble(digest):
"""compute bubblebabb... | 3.296875 | 3 |
jq/jq/schema.py | Thousif-S/J-Q | 0 | 31563 | import graphene
import graphql_jwt
import works.schema
import users.schema
import works.schema_relay
import people.schema
class Query(
users.schema.Query,
works.schema.Query,
works.schema_relay.RelayQuery,
people.schema.Query,
graphene.ObjectType,
):
pass
class Mutation(
users.schema.Mut... | 2.1875 | 2 |
t3f/batch_ops.py | KhrulkovV/t3f | 1 | 31564 | <gh_stars>1-10
import tensorflow as tf
from t3f.tensor_train_base import TensorTrainBase
from t3f.tensor_train_batch import TensorTrainBatch
from t3f import ops
def concat_along_batch_dim(tt_list):
"""Concat all TensorTrainBatch objects along batch dimension.
Args:
tt_list: a list of TensorTrainBatch object... | 2.078125 | 2 |
examples/python/sso/esi_oauth_native.py | Dusty-Meg/esi-docs | 130 | 31565 | <reponame>Dusty-Meg/esi-docs<gh_stars>100-1000
""" Python 3 native (desktop/mobile) OAuth 2.0 example.
This example can be run from the command line and will show you how the
OAuth 2.0 flow should be handled if you are a web based application.
Prerequisites:
* Create an SSO application at developers.eveonli... | 3.015625 | 3 |
queue_services/entity-emailer/tests/unit/email_processors/test_affiliation_notification.py | argush3/lear | 8 | 31566 | <reponame>argush3/lear
# Copyright © 2021 Province of British Columbia
#
# 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 b... | 1.804688 | 2 |
examples/resourcetracking/client.py | brubbel/Pyro4 | 638 | 31567 | <filename>examples/resourcetracking/client.py
from __future__ import print_function
import sys
import random
import Pyro4
if sys.version_info < (3, 0):
input = raw_input
uri = input("Enter the URI of the server object: ")
with Pyro4.Proxy(uri) as proxy:
print("currently allocated resources:", proxy.list())... | 2.5 | 2 |
servicelayerdms/exceptions.py | DimensionDataCBUSydney/servicelayer-dms-python | 0 | 31568 | class DmsRequestError(Exception):
def __init__(self, error_message, status_code):
self.message = "Error requesting DMS API %s with code %s" \
% (error_message, status_code)
super(DmsRequestError, self).__init__(self.message)
| 2.34375 | 2 |
config_manager.py | jbytes1027/notify-mirror | 0 | 31569 | import pathlib
import configparser
class ConfigManager:
DEFAULT_CONFIG_PATH = "~/.config/notify-sync.ini"
SETTING_NOTIFICATION_ICON = "icon"
SETTING_NOTIFICATION_TIMEOUT = "timeout" # in ms
# SETTING_NOTIFICATION_URGENCY = "urgency" # 0,1,2 low, avg, urgent
SETTING_NOTIFICATION_EXEC = "exec_on... | 2.375 | 2 |
ass_tag_parser/draw_struct.py | bubblesub/ass_tag_parser | 10 | 31570 | <reponame>bubblesub/ass_tag_parser
from dataclasses import dataclass
from typing import Optional
from ass_tag_parser.common import Meta
@dataclass
class AssDrawPoint:
x: float
y: float
class AssDrawCmd:
meta: Optional[Meta] = None
@dataclass
class AssDrawCmdMove(AssDrawCmd):
pos: AssDrawPoint
... | 2.53125 | 3 |
scripts/src/keyword.py | Artie18/goto | 0 | 31571 | class Keyword:
def __init__(self, keyword):
if keyword in ['add', 'find']:
self.value = keyword
else:
self.value = 'find'
| 3.3125 | 3 |
feedparser/parsers/json.py | briangedev/feedparser | 1 | 31572 | <filename>feedparser/parsers/json.py<gh_stars>1-10
# The JSON feed parser
# Copyright 2017 <NAME>
# All rights reserved.
#
# This file is a part of feedparser.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redis... | 1.835938 | 2 |
aux/testUnicode.py | AlainLich/logtools | 2 | 31573 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# -*- mode: Python -*-
#
# (C) <NAME>, 2021
#
import os
import sys
import re
import unicodedata
import unittest
from hypothesis import given, assume, settings, HealthCheck
import hypothesis.strategies as st
# using a try block so that this makes sense if exported to l... | 1.976563 | 2 |
pawlytics.py | damjess/ssb-bunnies-page | 0 | 31574 | <reponame>damjess/ssb-bunnies-page
"""
Pawlytics API retreival tool
Author: <EMAIL>
Requires crontab to run tool hourly:
0 * * * * /path/to/python3 /path/to/file/pawlytics.py
"""
from urllib.request import Request
from urllib.request import urlopen
from typing import Dict
from urllib.request import HTTPError
import ... | 2.265625 | 2 |
vault_updater.py | alchem1ster/AddOns-Update-Tool | 8 | 31575 | <filename>vault_updater.py<gh_stars>1-10
"""Vault update CLI"""
import sys
from argparse import ArgumentParser, FileType, _ArgumentGroup
from yaml import safe_load
from utils.log import log
from utils.vault import Vault
parser = ArgumentParser(description="Manual update of repositories Vault")
required: _ArgumentGr... | 2.71875 | 3 |
tf-lstm-crf-batch/model.py | adapt-sjtu/novelner | 8 | 31576 | import os
import numpy as np
import tensorflow as tf
import cPickle
from utils import shared, get_name
from nn import HiddenLayer, EmbeddingLayer, LSTM, forward
class Model(object):
"""
Network architecture.
"""
def __init__(self, parameters=None, models_path=None, model_path=None):
"""
... | 2.828125 | 3 |
revolt/plugins/commands/context.py | ppotatoo/revolt.py | 0 | 31577 | <filename>revolt/plugins/commands/context.py<gh_stars>0
from revolt.types.file import File
from revolt.embed import Embed
from revolt.message import Message
from typing import Optional
class Context:
def __init__(self, message, bot):
self.message = message
self.bot = bot
async def send(self, ... | 2.65625 | 3 |
372_palanced.py | RLeary/rdp_challenges | 0 | 31578 | <reponame>RLeary/rdp_challenges
"""Given a string containing only the characters x and y, find whether there are the same number of xs and ys.
balanced("xxxyyy") => true
balanced("yyyxxx") => true
balanced("xxxyyyy") => false
balanced("yyxyxxyxxyyyyxxxyxyx") => true
balanced("xyxxxxyyyxyxxyxxyy") => false
balan... | 4.03125 | 4 |
src/gnnff/utils/data.py | ken2403/gnnff | 0 | 31579 | import numpy as np
import torch
from torch.utils.data import DataLoader
from torch.utils.data.sampler import RandomSampler
from gnnff.data.keys import Keys
from gnnff.data.split import train_test_split
__all__ = ["get_loader"]
def get_loader(dataset, args, split_path, logging=None):
"""
Parameters
----... | 2.296875 | 2 |
setup.py | canvasslabs/packageurl-python | 0 | 31580 | <reponame>canvasslabs/packageurl-python
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# SPDX-License-Identifier: MIT
from __future__ import absolute_import
from __future__ import print_function
from glob import glob
from os.path import basename
from os.path import splitext
from setuptools import find_packages
fro... | 1.867188 | 2 |
fduser/cms_plugins.py | ForumDev/forumdev-user | 0 | 31581 | from cms.plugin_base import CMSPluginBase
from cms.models.pluginmodel import CMSPlugin
from cms.plugin_pool import plugin_pool
from fduser import models
from django.utils.translation import ugettext as _
from django.contrib.sites.models import Site
class Users(CMSPluginBase):
model = CMSPlugin # Model where data ... | 1.929688 | 2 |
us_pls/_download/download_service.py | drawjk705/us-pls | 0 | 31582 | # pyright: reportUnknownMemberType=false
import logging
import zipfile
from pathlib import Path
from typing import Dict
import requests
from us_pls._config import Config
from us_pls._download.interface import IDownloadService
from us_pls._download.models import DatafileType, DownloadType
from us_pls._logger.interfac... | 2.03125 | 2 |
dlbot/dlbot.py | sergyp/dlbot | 0 | 31583 | #!/usr/bin/env python
from dlbot import default_settings
from flask import Flask
app = Flask(__name__, instance_relative_config=True)
app.config.from_object(default_settings)
app.config.from_pyfile('dlbot.cfg', silent=True)
@app.route('/')
def hello_world():
return 'Hello, World!'
if __name__ == '__main__':
... | 2.15625 | 2 |
sourcecode/pathwaysearch/fingerprint/__init__.py | CC-SXF/PyMiner | 2 | 31584 | <filename>sourcecode/pathwaysearch/fingerprint/__init__.py<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 28 10:15:21 2021
@author: CC-SXF
"""
| 0.953125 | 1 |
lib/pyfrc/sim/robot_controller.py | prensing/pyfrc | 0 | 31585 | <gh_stars>0
from hal_impl import mode_helpers
from hal_impl.data import hal_data
import threading
import time
import wpilib
from ..physics.core import PhysicsInterface
from .sim_manager import SimManager
class RobotController:
'''
This manages the active state of the robot
'''
mode_map = {... | 2.4375 | 2 |
tests/core/engine/test_hybrid.py | halk/recowise | 1 | 31586 | <gh_stars>1-10
import unittest
from core.engine.hybrid import HybridEngine
from core.engine.simple import Engine
from core.taxonomy import Taxonomy
class HybridTestCase(unittest.TestCase):
def setUp(self):
taxonomy = Taxonomy('base', {'key': 'value', 'key2': 'value2'})
component1 = Engine('recommen... | 2.515625 | 3 |
DeepLearning/DeepLearning/02_Deep_ChoTH/deep_learning_7.py | ghost9023/DeepLearningPythonStudy | 1 | 31587 | # CHAPTER 7 합성곱 신경망(CNN)
# 전체구조
# 합성곱계층과 풀링계층이 추가된다.
# 지금까지 본 신경망은 인접하는 계층의 모든 뉴런과 결합되어 있다. 이를 완전연결이라고 하며, 완전히 연결된 계층을 Affine계층이라는 이름으로 구현했다.
##########################################
# 2차원 배열 합성곱 #@#!@#!$!$!@#@!$%!@#!@#
##########################################
import numpy as np
data = np.array(range(0,81)).reshape... | 3.484375 | 3 |
handlers/userProvider.py | saraheisa/RishaCar | 1 | 31588 | <gh_stars>1-10
import json
import logging
from bson import json_util
from handlers.base import BaseHandler
from lib.DBConnection import DriveFunctions
from lib.DBConnection import UserFunctions
logger = logging.getLogger('rishacar.' + __name__)
class UserProviderHandler(BaseHandler):
async def post(self):
if s... | 2.390625 | 2 |
project/settings/general/databases.py | danielbraga/hcap | 0 | 31589 | """
django:
https://docs.djangoproject.com/en/3.0/ref/settings/#databases
"""
from ..env import env
from .paths import SQLITE_PATH
DATABASE_TYPE = env("HCAP__DATABASE_TYPE", default="sqlite")
if DATABASE_TYPE == "sqlite":
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": str(SQLITE_PA... | 2.09375 | 2 |
wbia_cnn/netrun.py | WildMeOrg/wbia-plugin-cnn | 0 | 31590 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
r"""
FIXME:
sometimes you have to chown -R user:user ~/.theano or run with sudo the
first time after roboot, otherwise you get errors
CommandLineHelp:
python -m wbia_cnn --tf netrun <networkmodel>
--dataset, --ds = <dstag>:<subtag>
dstag is the main da... | 2.109375 | 2 |
exerciciosPython/Mundo1GB/ex035.py | gutembergdomingos13/ExerciciosPhyton | 0 | 31591 | # Desenvolva um programa que leia o comprimento de três retas
# e diga ao usuário se elas podem ou não formar um triângulo.
print("-=-" * 15)
print("Vamos analisar um triângulo...")
print('-=-' * 15)
r1 = float(input('Informe o primeiro segmento: '))
r2 = float(input('Informe o segundo seguimento: '))
r3 = float(inpu... | 4.21875 | 4 |
python/test/test_super_multiple_order_api.py | ashwinkp/ksapi | 7 | 31592 | # coding: utf-8
from __future__ import absolute_import
import unittest
import ks_api_client
from ks_api_client.api.super_multiple_order_api import SuperMultipleOrderApi # noqa: E501
from ks_api_client.rest import ApiException
class TestSuperMultipleOrderApi(unittest.TestCase):
"""SuperMultipleOrderApi unit... | 2.390625 | 2 |
examples/img-classifier/main.py | robianmcd/keras-mri | 12 | 31593 | import numpy as np
import os
import os.path as path
from keras.applications import vgg16, inception_v3, resnet50, mobilenet
from keras.preprocessing.image import load_img
from keras.preprocessing.image import img_to_array
import kmri
base_path = path.dirname(path.realpath(__file__))
img_path = path.join(base_path, 'i... | 2.625 | 3 |
tests/test_voting_phase.py | SeanAmmirati/secrethitlergame | 0 | 31594 | import pytest
from secrethitlergame.phase import Phase
from unittest import mock
from secrethitlergame.voting_phase import VotingPhase
def test_initialization():
vp = VotingPhase()
assert isinstance(vp, Phase)
assert vp.chancelor is None
assert vp.president is None
def test_get_previous_government()... | 2.6875 | 3 |
python_handler.py | toddcooke/aws-lambda-function-cold-start-time | 0 | 31595 | # import datetime
# import logging
# logger = logging.getLogger(__name__)
# logger.setLevel(logging.INFO)
def run(event, context):
# current_time = datetime.datetime.now().time()
# name = context.function_name
# logger.info("Your cron function " + name + " ran at " + str(current_time))
return "hello ... | 2.671875 | 3 |
testapp2/admin.py | gabrielbiasi/django-improved-permissions | 12 | 31596 | <filename>testapp2/admin.py<gh_stars>10-100
""" testapp2 admin configs """
from django.contrib import admin
from testapp2.models import Library
admin.site.register(Library)
| 1.414063 | 1 |
tests/unitary/ERC20CRV/test_setters.py | AqualisDAO/curve-dao-contracts | 217 | 31597 | import brownie
def test_set_minter_admin_only(accounts, token):
with brownie.reverts("dev: admin only"):
token.set_minter(accounts[2], {"from": accounts[1]})
def test_set_admin_admin_only(accounts, token):
with brownie.reverts("dev: admin only"):
token.set_admin(accounts[2], {"from": account... | 2.5625 | 3 |
data/data_analysis.py | poch4319/Method-Exploration-Relation-Extraction-Using-BERT | 0 | 31598 | import numpy as np
import json
from collections import Counter
import matplotlib.pyplot as plt
DATASET_DIR = './dataset/tacred/train_mod.json'
with open(DATASET_DIR) as f:
examples = json.load(f)
def plot_counts(data):
counts = Counter(data)
del counts["no_relation"]
labels, values = zip(*counts.it... | 2.875 | 3 |
Lab_4/4.3_rsa_cracking.py | Saif-M-Dhrubo/Crypto-Lab | 2 | 31599 | import sys
from fractions import Fraction as frac
from math import gcd, floor
from isqrt import isqrt
sys.setrecursionlimit(10**4)
# text=int(open("4.3_ciphertext.hex").read())
e=int(open("4.4_public_key.hex").read(),0)
n=int((open("4.5_modulo.hex").read()),0)
p = 0
q = 0
# print(text,"\n",e,"\n",n)
def ... | 2.921875 | 3 |