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 |
|---|---|---|---|---|---|---|
scripts/build/builders/qpg.py | mrninhvn/matter | 4 | 36200 | # Copyright (c) 2021 Project CHIP Authors
#
# 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 ... | 2.0625 | 2 |
Start.py | mn3711698/singlecoin | 33 | 36201 | # -*- coding: utf-8 -*-
##############################################################################
# Author:QQ173782910
##############################################################################
import logging
from apscheduler.schedulers.background import BlockingScheduler
from RunUse import TradeRun
format ... | 2.734375 | 3 |
statinf/ml/activations.py | florianfelice/pleas | 6 | 36202 | <reponame>florianfelice/pleas
import numpy as np
import jax.numpy as jnp
from jax import lax
from jax.scipy.special import expit
# Default activation functions
def sigmoid(x):
"""Sigmoid activation function.
:param x: Input value
:type x: :obj:`float` or :obj:`numpy.array`
:return: Sigmoid activated... | 2.828125 | 3 |
tools/mytools/ARIA/src/py/aria/Network.py | fmareuil/Galaxy_test_pasteur | 0 | 36203 | <reponame>fmareuil/Galaxy_test_pasteur<filename>tools/mytools/ARIA/src/py/aria/Network.py
"""
Authors: <NAME>
Institut Pasteur, Paris
IBPC, Paris
Copyright (C) 2005 <NAME>,
<NAME> and <NAME>
No warranty implied or expressed.
All rights reserved.
$Author: b... | 1.9375 | 2 |
website/wiki/plugins/images/migrations/0002_auto_20151118_1811.py | Bournvita1998/serc | 0 | 36204 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wiki_images', '0001_initial'),
]
operations = [
migrations.AlterModelTable(
name='image',
table='wik... | 1.304688 | 1 |
xls/contrib/xlscc/build_rules/xlscc_rules.bzl | RobSpringer/xls | 0 | 36205 | <reponame>RobSpringer/xls<filename>xls/contrib/xlscc/build_rules/xlscc_rules.bzl
# Copyright 2021 The XLS Authors
#
# 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.or... | 1.421875 | 1 |
Wasteland/api/save_and_load.py | Tonysun1/Explore-Z-Wasteland | 1 | 36206 | <filename>Wasteland/api/save_and_load.py<gh_stars>1-10
from api.class_declaration import Profile, Storage, Base, Bag
# TODO: This S/L api uses txt files for the time being, should use databases in the future
# questions: what's in the save_file?
# save_file is a dictionary contains the following keys:
# profile, bag... | 3.09375 | 3 |
learning/run_learning.py | lmzintgraf/MultiMAuS | 14 | 36207 | <gh_stars>10-100
import numpy as np
import os
from datetime import datetime
from pytz import timezone
import matplotlib.pyplot as plt
from agent_qlean import QLearnAgent
from agent_bandit import BanditAgent
from environment import Environment
from simulator import parameters
from simulator.transaction_model import Tran... | 2.3125 | 2 |
ex095a.py | emerfelippini/Curso_em_video-Aulas_Python | 0 | 36208 | <gh_stars>0
print('\033[1;32mANALISANDO DADOS\033[m')
jogador = dict()
gols = list()
jogadores = list()
print('-=' * 50)
while True:
gols.clear()
jogador['nome'] = str(input('Nome do jogador: '))
partidas = int(input('Quantas partidas esse jogador jogou: '))
for cont in range(1, partidas + 1, +1):
... | 3.734375 | 4 |
farmy/modules/led.py | farmy-maker/farmy-py | 1 | 36209 | # coding: utf-8
from modules.controller import Controller
LED_PIN = 23 # pin of led
if __name__ == "__main__":
controller = Controller(LED_PIN)
controller.run(50, 1)
print("Led Start for a second with 50% power")
| 2.453125 | 2 |
docs/conf.py | guillaume-wisniewski/elpis | 118 | 36210 | <filename>docs/conf.py
# 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 ------------------------------------------------... | 1.625 | 2 |
launchkey/factories/service.py | bgroveben/launchkey-python | 1 | 36211 | from .base import BaseFactory
from launchkey import LAUNCHKEY_PRODUCTION
from launchkey.clients import ServiceClient
class ServiceFactory(BaseFactory):
"""Factory for creating clients when representing a LaunchKey Service Profile"""
def __init__(self, service_id, private_key, url=LAUNCHKEY_PRODUCTION, testin... | 2.765625 | 3 |
mvsnet/mvs_data_generation/utils.py | ubiquity6/MVSNet | 7 | 36212 | <gh_stars>1-10
#!/usr/bin/env python
from __future__ import print_function
import os
import errno
import time
import math
import re
import sys
import scipy
import imageio
import cv2
import numpy as np
import json
from random import Random
from tensorflow.python.lib.io import file_io
import logging
from mvsnet.utils i... | 2.234375 | 2 |
kite-python/kite_ml/kite/name_encoder/scope_encoder.py | kiteco/kiteco-public | 17 | 36213 | <gh_stars>10-100
from typing import Dict, Any
import tensorflow as tf
from ..utils.segmented_data import SegmentedIndices, SegmentedIndicesFeed
from ..graph_encoder.embeddings import NodeEmbeddings
class Encoder(object):
def __init__(self, nodes: NodeEmbeddings):
self._nodes = nodes
self._build... | 2.359375 | 2 |
scripts/app.py | ArtellaPipe/artella-launcher | 0 | 36214 | <gh_stars>0
import os
import re
import sys
import json
import time
import psutil
import shutil
import appdirs
import zipfile
import tarfile
import argparse
import platform
import requests
import traceback
import contextlib
import subprocess
import webbrowser
import logging.config
from pathlib2 import Path
from bs4 impo... | 2.03125 | 2 |
acme/tf/variable_utils_test.py | wookayin/acme | 0 | 36215 | <gh_stars>0
# Copyright 2018 DeepMind Technologies Limited. 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 ... | 2.25 | 2 |
auth/views.py | KenMwaura1/zoo_pitch | 2 | 36216 | <reponame>KenMwaura1/zoo_pitch<gh_stars>1-10
from flask import flash, render_template, redirect, request, url_for
from flask_login import login_required, login_user, logout_user
from . import auth
from .forms import UserLoginForm, UserRegForm
from app.commands import db
from app.models import User
from app.send_email i... | 2.53125 | 3 |
python/sys_argv.py | mkanenobu/trashbox | 2 | 36217 | <filename>python/sys_argv.py
import sys
# 引数を変数varに代入してprintで返す
var = sys.argv[1]
print(type(var))
print(var)
| 2.78125 | 3 |
qapi/protocols/cryptography/key_distribution/exceptions.py | seunomonije/quantum-programming-api | 1 | 36218 | <filename>qapi/protocols/cryptography/key_distribution/exceptions.py
class InvalidBitstringError(BaseException):
pass
class InvalidQuantumKeyError(BaseException):
pass
| 1.546875 | 2 |
app/api/controller/user_controller.py | ChegeBryan/black-bandana | 2 | 36219 | """ User api endpoints """
from flask import request
from flask_restplus import Resource
from ..util.dto import UserDto
from ..service.user import save_new_user
api = UserDto.api
_user = UserDto.user
@api.route('/users')
class Users(Resource):
"""
User resource for the API
"""
@api.doc('Create a n... | 3.015625 | 3 |
run.py | danielenricocahall/Rotorcraft-Safety | 0 | 36220 | import os
import zipfile
from typing import List, Tuple, Dict
import numpy as np
import pandas as pd
import requests
import structlog
import matplotlib.pyplot as plt
from sklearn.ensemble import RandomForestClassifier
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.model_selection import train... | 2.84375 | 3 |
src/views/send/target_address_form_view.py | Kevingislason/bitcoin_hardware_wallet_ui | 0 | 36221 | from PyQt6.QtCore import *
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
class TargetAddressForm(QWidget):
def __init__(self):
super().__init__()
self.layout = QHBoxLayout()
self.setLayout(self.layout)
self.target_address_label = QLabel("Pay to:")
self.target_ad... | 2.390625 | 2 |
tests/test_overwrite_store.py | schwa-lab/libschwa-python | 5 | 36222 | # vim: set et nosi ai ts=2 sts=2 sw=2:
# coding: utf-8
from __future__ import absolute_import, print_function, unicode_literals
import unittest
from schwa import dr
class Node(dr.Ann):
label = dr.Field()
class Doc(dr.Doc):
store = dr.Store(Node)
class Test(unittest.TestCase):
def _test_example(self, doc):
... | 2.3125 | 2 |
agents_using_gym/dqn/interactive.py | jarbus/multiagent-particle-envs | 8 | 36223 | #!/usr/bin/env python
import os,sys
sys.path.insert(1, os.path.join(sys.path[0], '..'))
import argparse
from multiagent.environment import MultiAgentEnv
import multiagent.scenarios as scenarios
import numpy as np
import keras.backend.tensorflow_backend as backend
from keras.models import Sequential
from keras.layers i... | 1.984375 | 2 |
generate/web/render.py | traines-source/climate-change-cartograms | 0 | 36224 | <gh_stars>0
import jinja2
import gettext
import markdown
from pathlib import Path
import sys
sys.path.append('../')
import utils
credits_html = ""
with open("credits.md", "r") as file:
credits_html = markdown.markdown(file.read())
env = jinja2.Environment(
extensions=['jinja2.ext.i18n'],
loader=jinja2.Fil... | 2.40625 | 2 |
camper/db/tests/test_registration_form.py | mrtopf/camper | 13 | 36225 | from camper.db import BarcampSchema, Barcamp
import datetime
def test_get_empty_registration_form(barcamps, barcamp):
barcamps.save(barcamp)
barcamp = barcamps.by_slug("barcamp")
assert barcamp.registration_form == []
def test_add_to_registration_form(barcamps, barcamp):
barcamps.save(barcamp)
fie... | 2.5625 | 3 |
source/payment/models.py | codebam/avrod_python_login | 0 | 36226 | <reponame>codebam/avrod_python_login
from django.db import models
from django.contrib.auth.models import User
from django.utils import timezone
import datetime
class Session(models.Model):
session_key = models.CharField(max_length=64)
created_at = models.DateTimeField(auto_now_add=True)
class License(models.... | 2.203125 | 2 |
job/celery_tasks/demo.py | RockFeng0/flask_demo | 0 | 36227 | #! python3
# -*- encoding: utf-8 -*-
from job import celery
@celery.task()
def add(x, y):
return x+y
| 2 | 2 |
config.py | outbreakdm/Dead-Matter-Discord-Bot-Player-Counter | 0 | 36228 | BOT_TOKEN = "<PASSWORD>"
SERVER_ADDRESS = ("192.168.3.11:7797", 27016)
| 1.21875 | 1 |
mykits/mykit.py | mo-han/mo-han-toolbox | 24 | 36229 | <filename>mykits/mykit.py<gh_stars>10-100
#!/usr/bin/env python3
# encoding=utf8
"""This tool heavily depends on `mylib` package, make sure `mylib` folder is in the same path with this tool."""
import cmd
import shlex
from argparse import ArgumentParser, REMAINDER
from collections import defaultdict
from pprint import... | 2.1875 | 2 |
tests/audit_task_test.py | danieldiamond/dbt-sugar | 94 | 36230 | from pathlib import Path
from unittest.mock import call
import pytest
from dbt_sugar.core.clients.dbt import DbtProfile
from dbt_sugar.core.config.config import DbtSugarConfig
from dbt_sugar.core.flags import FlagParser
from dbt_sugar.core.main import parser
from dbt_sugar.core.task.audit import AuditTask
from dbt_su... | 1.835938 | 2 |
src/15-led-compass/plt_mag_calibration.py | Petrus97/discovery | 0 | 36231 | <reponame>Petrus97/discovery
import csv
import math
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import sys
# apply plot style
sns.set()
x = []
y = []
with open(sys.argv[1], 'r') as f:
rows = csv.reader(f, delimiter='\t')
for row in rows:
# discard rows that are missing d... | 2.71875 | 3 |
altair_transform/utils/_evaljs.py | jacobcolbert/altair-transform | 3 | 36232 | """Functionality to evaluate contents of the ast"""
from functools import singledispatch, wraps
import operator
from typing import Any, Union
from altair_transform.utils import ast, Parser
__all__ = ['evaljs']
def evaljs(expression: Union[str, ast.Expr], namespace: dict = None) -> Any:
"""Evaluate a javascript ... | 2.78125 | 3 |
stix/test/common/names_test.py | threatstream/stix11 | 1 | 36233 | <reponame>threatstream/stix11
# Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import unittest
from stix.test import EntityTestCase
from stix.common import Names
class NamesTests(EntityTestCase, unittest.TestCase):
klass = Names
_full_dict = [
"... | 1.9375 | 2 |
server.py | yyc0309/watsonwork-github-issues | 0 | 36234 | <gh_stars>0
from github_app import app
app.run(host='0.0.0.0', port=int(app.config['PORT']), debug=True)
| 1.40625 | 1 |
old_lambda/lambda_function/operations.py | jdkandersson/cloudformation-kubernetes | 0 | 36235 | <reponame>jdkandersson/cloudformation-kubernetes<gh_stars>0
"""Kubernetes operations."""
import typing
import kubernetes
from . import exceptions
from . import helpers
class CreateReturn(typing.NamedTuple):
"""
Structure of the create return value.
Attrs:
status: The status of the operation. I... | 2.609375 | 3 |
opennem/exporter/aws.py | tourdownunder/opennem | 0 | 36236 | <reponame>tourdownunder/opennem
import logging
import os
from smart_open import open
logger = logging.getLogger(__name__)
S3_EXPORT_DEFAULT_BUCKET = "s3://data.opennem.org.au/v3/"
UPLOAD_ARGS = {
"ContentType": "application/json",
}
def write_to_s3(file_path: str, data: str) -> int:
"""
Write data... | 2.359375 | 2 |
Samples/NLPSample.py | Klangoo/MagnetApiClient.Python | 0 | 36237 | #!/usr/bin/env python
# -- coding: UTF-8 --
"""
Magnet API NLP Sample
Copyright 2018, Klangoo Inc.
"""
from klangooclient.MagnetAPIClient import MagnetAPIClient
ENDPOINT = 'https://nlp.klangoo.com/Service.svc'
CALK = 'enter your calk here'
SECRET_KEY = 'enter your secret key here'
client = MagnetAPIClient(END... | 2.59375 | 3 |
15-3SUM/solution.py | alfmunny/leetcode | 0 | 36238 | <gh_stars>0
class Solution:
def threeSum(self, nums: List[int]) -> List[List[int]]:
if len(nums) < 3:
return []
ans = []
nums.sort()
for i in range(0, len(nums)-2):
if nums[i] > 0:
break
if i > 0 and nums[i-1] == nums[i]:
... | 3.21875 | 3 |
bin/validate.py | sooshie/security-content | 0 | 36239 | <reponame>sooshie/security-content<filename>bin/validate.py<gh_stars>0
#!/usr/bin/python
'''
Validates Manifest file under the security-content repo for correctness.
'''
import glob
import json
import jsonschema
import yaml
import sys
import argparse
from os import path
def validate_detection_contentv2(detection, D... | 2.46875 | 2 |
py/sandbox.python.py | schaabs/sandbox | 0 | 36240 | import hashlib
import shutil
import io
import gzip
import platform
import os
import struct
import json
import mmap
class ElfConst:
CLASS_32 = 1
CLASS_64 = 2
DATA_LE = 1
DATA_BE = 2
TYPE_RELOC = 1
TYPE_EXEC = 2
TYPE_SHARED = 3
TYPE_CORE = 4
class Layout:
ElfIdent = b'=4sBBBBBxxxxx... | 2.28125 | 2 |
log_redaction_cli.py | kalaboster/strings | 1 | 36241 | """log_redaction_cli
Usage:
log_redaction_cli.py --tarfile <tarfile> --working-dir <working-dir> --output-dir <output-dir>
log_redaction_cli.py (-h | --help)
log_redaction_cli.py --version
Options:
-h --help Pass in a string: example command: python log_redaction_cli.py --tarfile "test/files/test_output.t... | 2.28125 | 2 |
seq2seq.py | CAMeL-Lab/gender-reinflection | 4 | 36242 | import torch
import torch.nn as nn
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
import numpy as np
import torch.nn.functional as F
from attention import AdditiveAttention
class Encoder(nn.Module):
"""Encoder bi-GRU"""
def __init__(self, input_dim, char_embed_dim,
e... | 2.65625 | 3 |
cowkit/qcow_header.py | Junzki/cowkit | 0 | 36243 | <filename>cowkit/qcow_header.py
# -*- coding:utf-8 -*-
"""
https://people.gnome.org/~markmc/qcow-image-format.html
"""
import dataclasses
import struct
from typing import List
QCOW_HEADER_SIZE = 72
QCOW_MAGIC = b'QFI\xfb'
QCOW_HEADER_GROUP_META = 8
QCOW_HEADER_GROUP_BACKING_FILE = 12
QCOW_HEADER_GROUP_SIZE = 16
QCO... | 2.40625 | 2 |
faddr/cli.py | kido5217/faddr | 1 | 36244 | """CLI entry points of faddr."""
import argparse
import pathlib
import sys
from faddr import logger
from faddr.config import load_config
from faddr.rancid import RancidDir
from faddr.database import Database
def parse_args_db():
"""Parsing CMD keys."""
parser = argparse.ArgumentParser(argument_default=argpa... | 2.796875 | 3 |
features/FeatureExtract.py | wangqiuli0102/Class-Aware-Multi-Window-Adversarial-Lung-Nodule-Synthesis | 0 | 36245 | <reponame>wangqiuli0102/Class-Aware-Multi-Window-Adversarial-Lung-Nodule-Synthesis
'''
Created by <NAME>
2020/5/23
'''
import cv2
import numpy as np
import matplotlib.pyplot as plt
import slic
import rgb_gr
from PIL import Image
from skimage import io, color
from skimage import data, filters
def truncate_hu(image_... | 2.46875 | 2 |
examples/plotting/plotting_real_indexed_by_date.py | krzpiesiewicz/timeseries | 1 | 36246 | import pandas as pd
from matplotlib import dates as mdates
from timeseries import plot_ts
from timeseries.plotting import ax_settings
def main():
# .csv available to download at:
# https://www.investing.com/currencies/gbp-usd-historical-data
gpd_usd_data = pd.read_csv("../data/GBP_USD Historical Data_mon... | 3.109375 | 3 |
tests/tck/conftest.py | tom-chensf/nebula-graph | 0 | 36247 | <reponame>tom-chensf/nebula-graph<gh_stars>0
# Copyright (c) 2020 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License,
# attached with Common Clause Condition 1.0, found in the LICENSES directory.
import functools
import os
import time
import pytest
import io
import csv
import re... | 2.078125 | 2 |
evaluation.py | rdedo099/HonoursProject2021 | 0 | 36248 | from sklearn import metrics
from prettytable import PrettyTable
def evaluate_clustering(name, X, true_labels, pred_labels):
homogeneity = metrics.homogeneity_score(true_labels, pred_labels)
completeness = metrics.completeness_score(true_labels, pred_labels)
v_measure = metrics.v_measure_score(true_labels,... | 2.6875 | 3 |
db_model.py | jose-marquez89/cryptovest | 0 | 36249 | import os
import pymysql
from dotenv import load_dotenv
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import Column, BigInteger, String, Float, ForeignKey
def load_engine():
"""Create the database engine"""
... | 2.765625 | 3 |
P2_studies/theta_plus/Analysis/Mapping/match_mcl_to_leiden.py | chackoge/ERNIE_Plus | 6 | 36250 | <gh_stars>1-10
import pandas as pd
import mapping_module as mm
import multiprocessing as mp
from sqlalchemy import create_engine
from sys import argv
user_name = argv[1]
password = argv[2]
data_type = argv[3]
start_year = int(argv[4])
end_year = int(argv[5])
leiden_input = argv[6] #quality_func_Res --> CPM_R001
schema... | 2.53125 | 3 |
MeanMotionResonance/NbodySimulationUtilities.py | shadden/mean_motion_resonance | 3 | 36251 | <reponame>shadden/mean_motion_resonance
import numpy as np
import rebound as rb
import reboundx as rbx
def set_timestep(sim,dtfactor):
ps=sim.particles[1:]
tperi=np.min([p.P * (1-p.e)**1.5 / np.sqrt(1+p.e) for p in ps])
dt = tperi * dtfactor
sim.dt = dt
def set_min_distance(sim,rhillfac... | 2.328125 | 2 |
spyder/plugins/editor/panels/indentationguides.py | suokunlong/spyder | 3 | 36252 | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
This module contains the indentation guide panel.
"""
# Third party imports
from qtpy.QtCore import Qt
from qtpy.QtGui import QPainter, QColor
from intervaltree i... | 2.359375 | 2 |
lib/DuplicatePairDetector.py | hapsby/deepAPIRevisited | 0 | 36253 | <filename>lib/DuplicatePairDetector.py<gh_stars>0
import hashlib
class DuplicatePairDetector:
def __init__(self):
self.hashes = set()
def add_if_new(self, description, api_calls):
hash_binary = self.get_hash_binary(description, api_calls)
if hash_binary in self.hashes:
re... | 2.6875 | 3 |
beginner/sum-of-all-numbers_ChingLingYeung.py | garvitsharma05/hacktoberithms | 16 | 36254 |
def sum_all(ls):
sum = 0
if(len(ls) != 2):
print("Invalid input")
else:
ls.sort()
start = ls[0]
end = ls[1]
if(start == end):
sum = 2 * start
else:
for i in range(start, end+1):
sum += i
ret... | 3.671875 | 4 |
examples/regression/survival_prediction/extract_patch_feature.py | Starrah/THU-SuperMoon | 64 | 36255 | <filename>examples/regression/survival_prediction/extract_patch_feature.py
import openslide
import torch
from tqdm import tqdm
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms
from SuperMoon.models import ResNetFeature
def extract_ft(slide_dir: str, patch_coors, depth=34, batch_siz... | 2.15625 | 2 |
maldives/technical_analysis/__init__.py | filipecn/maldives | 1 | 36256 | <gh_stars>1-10
import numpy as np
import math
from pandas import DataFrame
def min_rw_index(prices, start, end):
"""
Searches min price index inside window [start,end]
:param prices: in list format
:param start: window start index
:param end: window end index
:return:
"""
matching... | 3.0625 | 3 |
cymepy/export_manager/hooks/JSON_writer.py | GMLC-TDC/cymepy | 1 | 36257 | <gh_stars>1-10
from cymepy.export_manager.base_definations import ExportManager
from cymepy.common import EXPORT_FILENAME
import json
import os
class Writer(ExportManager):
def __init__(self, sim_instance, solver, options, logger, **kwargs):
super(Writer, self).__init__(sim_instance, solver, options, logge... | 2.390625 | 2 |
fenrir/fenrir.py | noperaattori/Trusty-cogs | 0 | 36258 | <reponame>noperaattori/Trusty-cogs
import discord
from redbot.core import Config, checks, commands
listener = getattr(commands.Cog, "listener", None) # red 3.0 backwards compatibility support
if listener is None: # thanks Sinbad
def listener(name=None):
return lambda x: x
class Fenrir(commands.Cog):
... | 2.21875 | 2 |
my_submission/model/__init__.py | abcdcamey/Gobigger-Explore | 1 | 36259 | from .gobigger_structed_simple_model import GoBiggerHybridActionSimpleV3
from .my_gobigger_structed_model_v1 import MyGoBiggerHybridActionV1 | 1.109375 | 1 |
CS307/testbench_log/fileDB/Client.py | ntdgy/python_study | 0 | 36260 | <gh_stars>0
# -*- coding = utf-8 -*-
# @Time: 2022/4/13 19:35
# @Author: Anshang
# @File: Client.py
# @Software: PyCharm
import socket
from multiprocessing import Process, Pipe
def connection(pipe: Pipe, username, password):
ip_bind = ("127.0.0.1", 9900)
c = socket.socket()
c.connect(ip_bind)
login =... | 2.78125 | 3 |
packages/core/minos-microservice-networks/tests/test_networks/test_brokers/test_messages/test_models/test_v1.py | sorasful/minos-python | 247 | 36261 | <reponame>sorasful/minos-python
import unittest
import warnings
from unittest.mock import (
patch,
)
from uuid import (
UUID,
uuid4,
)
from minos.common import (
Model,
)
from minos.networks import (
BrokerMessageV1,
BrokerMessageV1Payload,
BrokerMessageV1Status,
BrokerMessageV1Strategy... | 2.484375 | 2 |
tasks/__init__.py | auto-ndp/faasm-python | 3 | 36262 | from invoke import Collection
from . import (
container,
cpython,
func,
git,
libs,
mxnet,
runtime,
)
ns = Collection(
container,
cpython,
func,
git,
libs,
mxnet,
runtime,
)
| 1.484375 | 1 |
face.py | 1MT3J45/DS-StockAnalysis | 0 | 36263 | <reponame>1MT3J45/DS-StockAnalysis
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
from kivy.app import App
import YP03
import sys
import dfgui
import pandas as pd
Builder.load_string('''
<faceTool>:
num1: num1
result: result
orientation: 'vertical'
BoxLayout:
orientation... | 2.875 | 3 |
src/evaluation.py | Macho000/T5-for-KGQG | 0 | 36264 | <reponame>Macho000/T5-for-KGQG<gh_stars>0
from AdjacencyAttentionWithoutSelfloopTransformers import (
AdamW,
T5ForConditionalGeneration,
T5Tokenizer,
get_linear_schedule_with_warmup
)
from torch.utils.data import DataLoader
from src.dataset import JsonDatasetWQ, JsonDatasetPQ
from datetime import strftime, loc... | 1.898438 | 2 |
microraiden/proxy/resources/paywall_decorator.py | andrevmatos/microraiden | 417 | 36265 | import logging
from flask import Response, make_response, request
from microraiden import HTTPHeaders as header
from flask_restful.utils import unpack
from microraiden.channel_manager import (
ChannelManager,
)
from microraiden.exceptions import (
NoOpenChannel,
InvalidBalanceProof,
InvalidBalanceAmoun... | 2.296875 | 2 |
aiowinreg/filestruct/nk.py | skelsec/aiowinreg | 6 | 36266 | <filename>aiowinreg/filestruct/nk.py
"""
the nk-Record
=============
Offset Size Contents
0x0000 Word ID: ASCII-"nk" = 0x6B6E
0x0002 Word for the root-key: 0x2C, otherwise 0x20
0x0004 Q-Word write-date/time in windows nt notation
0x0010 D-Word Offset of Owner/Parent key
0x0014 D-Word number of sub-Keys
0x001C D-Word... | 2.0625 | 2 |
src/datasets/hanitem.py | Hazoom/han | 25 | 36267 | <reponame>Hazoom/han<filename>src/datasets/hanitem.py
import attr
@attr.s
class HANItem:
sentences = attr.ib()
label = attr.ib()
| 1.3125 | 1 |
omicron/models/valuation.py | evimacs/omicron | 4 | 36268 | <gh_stars>1-10
import datetime
from typing import List, Union
import numpy as np
from sqlalchemy.dialects.postgresql import insert
from sqlalchemy.types import Date, Float, Integer, Numeric, String
import omicron
from omicron import db
from omicron.client.quotes_fetcher import get_valuation
class Valuation(db.Model... | 2.546875 | 3 |
examples/resnet-v1/resnet_v1.py | statisticszhang/Image-classification-caffe-model | 1 | 36269 | import caffe
from caffe import layers as L
from caffe import params as P
def conv_bn_scale_relu(bottom, num_output=64, kernel_size=3, stride=1, pad=0):
conv = L.Convolution(bottom, num_output=num_output, kernel_size=kernel_size, stride=stride, pad=pad,
param=[dict(lr_mult=1, decay_mult=1)... | 2.484375 | 2 |
app/commands/elastic.py | viert/knowledgehub | 8 | 36270 | <reponame>viert/knowledgehub<filename>app/commands/elastic.py<gh_stars>1-10
from datetime import datetime
from glasskit.commands import Command
from glasskit import ctx
from ask.models.post import BasePost
from ask import force_init_app
POST_INDEX_SETTINGS = {
"settings": {
"analysis": {
"no... | 2.171875 | 2 |
PolygonLineTools/Scripts/split_by_area.py | Dan-Patterson/Tools_for_ArcGIS_Pro | 23 | 36271 | # -*- coding: UTF-8 -*-
"""
split_by_area
===========
Script : split_by_area.py
Author : <EMAIL>
Modified: 2018-08-27
Purpose : tools for working with numpy arrays
Notes:
-----
The xs and ys form pairs with the first and last points being identical
The pairs are constructed using n-1 to ensur... | 3.5625 | 4 |
clustering/utils.py | IhabBendidi/IIC-SimCLR-MoCo-clusterer | 12 | 36272 | from scipy import linalg
from sklearn.decomposition import PCA
from scipy.optimize import linear_sum_assignment as linear_assignment
import numpy as np
"""
A function that takes a list of clusters, and a list of centroids for each cluster, and outputs the N max closest images in each cluster to its centroids
"""
def cl... | 3 | 3 |
Prep/bbphone.py | armsky/Algorithms | 0 | 36273 | <gh_stars>0
// This is the text editor interface.
// Anything you type or change here will be seen by the other person in real time.
import java.util.*;
public class HelloWorld {
public static boolean isSentence(String s, HashSet<String> d) {
return false;
}
public static void main(String[] arg... | 3.453125 | 3 |
phantastes/urls.py | santeyio/phantastesproject | 0 | 36274 | from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
from phantastes import views
from django.contrib import admin
urlpatterns = patterns(
"",
url(r"^$", views.index, name="home"),
url... | 1.875 | 2 |
mox/manage.py | abouzek/mox | 0 | 36275 | <filename>mox/manage.py
import os, sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from flask.ext.script import Manager, Server
from app import app
manager = Manager(app)
manager.add_command("runserver", Server(
use_debugger = True,
use_reloader = True,
host = '0.0.0.0')
)
if ... | 1.882813 | 2 |
train.py | sremedios/nifti_image_generator | 6 | 36276 | <reponame>sremedios/nifti_image_generator<gh_stars>1-10
'''
<NAME>
NIH CC CNRM
Train PhiNet to classify MRI modalities
'''
import os
import json
from keras.callbacks import ModelCheckpoint, TensorBoard, ReduceLROnPlateau, EarlyStopping
from keras import backend as K
from keras.models import model_from_json
from models... | 1.804688 | 2 |
rehive/api/resources/company_resources.py | rehive/rehive-python | 8 | 36277 | from .base_resources import Resource, ResourceCollection, ResourceList
class APICompany(Resource, ResourceCollection):
def __init__(self, client, endpoint='', filters=None):
self.resources = (
APIBanks,
APICurrencies,
APIBankAccount,
APIBankAccounts
... | 2.46875 | 2 |
src/randomizer/randomizer/classes.py | DontBaguMe/IoGR | 12 | 36278 | import copy
import time
from datetime import datetime
import binascii
import graphviz
import random
from .models.enums.start_location import StartLocation
from .models.enums.goal import Goal
from .models.enums.statue_req import StatueReq
from .models.enums.entrance_shuffle import EntranceShuffle
from .models.enums.ene... | 2.15625 | 2 |
src/MediaPlayer/Player/VLCPlayer.py | JKorf/MediaPi | 2 | 36279 | import datetime
import os
import time
from enum import Enum
import sys
from MediaPlayer.Player import vlc
from MediaPlayer.Player.vlc import libvlc_get_version, Media, MediaList
from Shared.Events import EventManager, EventType
from Shared.Logger import Logger, LogVerbosity
from Shared.Observable import Observable
fr... | 2.3125 | 2 |
build/buildflag_header.bzl | Lynskylate/chromium-base-bazel | 0 | 36280 | <gh_stars>0
# Primitive reimplementation of the buildflag_header scripts used in the gn build
def _buildflag_header_impl(ctx):
content = "// Generated by build/buildflag_header.bzl\n"
content += '// From "' + ctx.attr.name + '"\n'
content += "\n#ifndef %s_h\n" % ctx.attr.name
content += "#define %s_h\n... | 1.929688 | 2 |
test/test_led_matrix.py | soundmaking/led8x8m | 0 | 36281 | <gh_stars>0
import unittest
from led8x8m import LedMatrix
class TestLedMatrix(unittest.TestCase):
def test_pin_numbers(self):
self.assertEqual(len(LedMatrix.PIN_X), 8)
self.assertEqual(len(LedMatrix.PIN_Y), 8)
set_x = set(LedMatrix.PIN_X)
set_y = set(LedMatrix.PIN_Y)
self.a... | 2.96875 | 3 |
Algorithms/0538_Convert_BST_to_Greater_Tree/Python/Convert_BST_to_Greater_Tree_Solution_1.py | lht19900714/Leetcode_Python | 0 | 36282 | <reponame>lht19900714/Leetcode_Python
# Space: O(n)
# Time: O(n)
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def convertBST(self, root):
if (... | 3.6875 | 4 |
metasploit_gym/action/exploit.py | phreakAI/MetasploitGym | 6 | 36283 | <reponame>phreakAI/MetasploitGym
"""Exploits currently supported
Straightforward to add more following the basic model presented here
"""
from .action import Exploit
import time
def wait_for_job_completion(job_info, client):
if job_info is not None:
if "error" in job_info:
return
jo... | 2.1875 | 2 |
pennylane/templates/tensornetworks/mera.py | therooler/pennylane | 0 | 36284 | <reponame>therooler/pennylane<filename>pennylane/templates/tensornetworks/mera.py
# Copyright 2018-2021 Xanadu Quantum Technologies 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
# ... | 2.53125 | 3 |
paraview/addLinePlotHopefully.py | lindsayad/python | 0 | 36285 | <reponame>lindsayad/python<filename>paraview/addLinePlotHopefully.py<gh_stars>0
try: paraview.simple
except: from paraview.simple import *
paraview.simple._DisableFirstRenderCameraReset()
PlotOverLine6 = GetActiveSource()
PlotOverLine6.Input = []
PlotOverLine6.Source = []
XYChartView1 = GetRenderView()
Delete(PlotOv... | 1.890625 | 2 |
Sprint-Challenge/acme_test.py | martinclehman/DS-Unit-3-Sprint-1-Software-Engineering | 0 | 36286 | <filename>Sprint-Challenge/acme_test.py<gh_stars>0
#!/usr/bin/env python
import unittest
from acme import Product
from acme_report import generate_products, ADJECTIVES, NOUNS
class AcmeProductTests(unittest.TestCase):
"""Making sure Acme products are the tops!"""
def test_default_product_price(self):
... | 3.125 | 3 |
cogs/meta.py | popop098/Teasia-Bot.py | 1 | 36287 | from discord.ext import commands
import discord
from datetime import datetime
from src import util
from tools.checker import Checker,Embed
class Meta(commands.Cog):
"""Commands relating to the bot itself."""
def __init__(self, bot):
self.bot = bot
self.start_time = datetime.now()
bot.r... | 2.546875 | 3 |
sciencebeam_trainer_delft/utils/cloud_support.py | elifesciences/sciencebeam-trainer-delft | 5 | 36288 | <reponame>elifesciences/sciencebeam-trainer-delft
import os
import logging
from contextlib import contextmanager
from tempfile import TemporaryDirectory, mkdtemp
from pathlib import Path
from six import string_types
from sciencebeam_trainer_delft.utils.io import copy_file, path_join
LOGGER = logging.getLogger(__nam... | 2.21875 | 2 |
gitlab/snippets.py | codeEmitter/token-hunter | 35 | 36289 | from logging import warning
from api import gitlab
from utilities import validate, types
gitlab = gitlab.GitLab(types.Arguments().url)
def get_all(projects):
snippets = {}
for project in projects:
for key, value in project.items():
details = gitlab.get_project_snippets(key)
i... | 2.421875 | 2 |
login/weibo_with_known_cookie.py | bobjiangps/python-spider-example | 0 | 36290 | import requests
if __name__ == "__main__":
headers = {
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'Accept-Language': 'zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3',
'User-Agent': 'Mozilla/5.0 (Macintosh; ... | 2.6875 | 3 |
wcpan/watchdog/watcher.py | legnaleurc/wcpan.watchdog | 0 | 36291 | <reponame>legnaleurc/wcpan.watchdog
from __future__ import annotations
__all__ = ('WatcherContext', 'Watcher')
import asyncio
import os
import time
from concurrent.futures import Executor, ThreadPoolExecutor
from contextlib import AsyncExitStack
from functools import partial
from typing import Awaitable, Callable, ... | 2.671875 | 3 |
views/orderbook.py | ZigaMr/borzaKriptovalut-master | 0 | 36292 | import matplotlib.pyplot as plt
import requests
import pandas as pd
import json
data = requests.get(r'https://www.bitstamp.net/api/v2/order_book/ethbtc')
data = data.json()
bids = pd.DataFrame()
bids['quantity'] = [i[1] for i in data['bids']]
bids['price'] = [i[0] for i in data['bids']]
asks = pd.DataFrame()
asks['pr... | 2.921875 | 3 |
ex23.py | PhyuAye/Python_exercises-1 | 0 | 36293 | import sys
script, input_encoding, error = sys.argv
def main(language_file, encoding, errors):
line = language_file.readline()
if line:
print_line(line, encoding, errors)
return main(language_file, encoding, errors)
def print_line(line, encoding, errors):
next_lang = line.strip()
raw_bytes = next_lang.encode(encoding, ... | 3.421875 | 3 |
src/imagedata/formats/__init__.py | erling6232/imagedata | 1 | 36294 | <filename>src/imagedata/formats/__init__.py<gh_stars>1-10
"""This module provides plugins for various imaging formats.
Standard plugins provides support for DICOM and Nifti image file formats.
"""
# Copyright (c) 2013-2018 <NAME>, Haukeland University Hospital, Bergen, Norway
import logging
import sys
import numpy ... | 2.28125 | 2 |
webservice/monitor/autoMarkTimeOutPR.py | Jiangxinz/Paddle-bot | 14 | 36295 | import os
import aiohttp
import asyncio
import json
import time
import datetime
import logging
import gidgethub
import requests
from gidgethub import aiohttp as gh_aiohttp
import sys
import pandas as pd
sys.path.append("..")
from utils.auth import get_jwt, get_installation, get_installation_access_token
from utils.test... | 2.140625 | 2 |
messaging/messaging/client.py | Cornices/example | 1 | 36296 | <gh_stars>1-10
import threading
import urllib2
import json
import time
import curses
_SERVER = 'http://localhost:6543'
def post(message, token):
headers = {'X-Messaging-Token': token}
req = urllib2.Request(_SERVER, headers=headers)
req.get_method = lambda: 'POST'
message = {'text': message}
req.... | 2.765625 | 3 |
datasets/__init__.py | zack466/autoreg-sr | 0 | 36297 | <filename>datasets/__init__.py
from .div2k import *
| 1.007813 | 1 |
costar_models/python/costar_models/trajectory.py | cpaxton/costar_plan | 66 | 36298 | from .abstract import AbstractAgentBasedModel
import keras.backend as K
import numpy as np
from tensorflow import TensorShape
from keras.layers import Dense, Reshape
class TrajectorySamplerNetwork(AbstractAgentBasedModel):
'''
Supervised model. Takes in a set of trajectories from the current state;
lear... | 3.015625 | 3 |
CV0101EN-03-image_Region_of_img.py | reddyprasade/Computer-Vision-with-Python | 0 | 36299 | <reponame>reddyprasade/Computer-Vision-with-Python
# Image ROI(Region of Images)
import cv2 as cv
img = cv.imread('Photes/messi.jpg')
cv.imshow('Orginal Messi_Football',img)
ball = img[280:340, 330:390]
img[273:333, 100:160] = ball
cv.imshow('Change Messi_Football',img)
"""
import matplotlib.pyplot ... | 3.3125 | 3 |