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
component.py
oxford-pcs/zSpec
1
43800
import numpy as np import pylab as plt import pyzdde.zdde as pyz class Component(object): def __init__(self, zmx_file, zcontroller, lumultiplier=1e-3, wumultiplier=1e6): ''' Initialise a component. [lumultiplier] is used to move from Zemax lens units to another physical dimension. By default, ...
2.5
2
test_contour.py
skywills/id-card-detector
0
43801
<filename>test_contour.py from utils import img_util from utils import hed_util import numpy as np import cv2 import os MODEL_NAME = 'model' HED_NAME = 'HED' # Grab path to current working directory CWD_PATH = os.getcwd() IMAGE_NAME = 'test_images/001461.jpeg' PATH_TO_IMAGE = os.path.join(CWD_PATH,IMAGE_NAME) HED_PROT...
2.703125
3
sources/breakout/breakout03.py
kantel/python-schulung
0
43802
import tkinter as tk from gameworld03 import World if __name__ == "__main__": root = tk.Tk() root.title("Hello, Pong!") world = World(root) world.mainloop()
2.96875
3
webinspect.py
YTAngryFox/Webinspect
0
43803
import requests import os import sys import inspect def start(): print(""" ░██╗░░░░░░░██╗███████╗██████╗░██╗███╗░░██╗░██████╗██████╗░███████╗░█████╗░████████╗ ░██║░░██╗░░██║██╔════╝██╔══██╗██║████╗░██║██╔════╝██╔══██╗██╔════╝██╔══██╗╚══██╔══╝ ░╚██╗████╗██╔╝█████╗░░██████╦╝██║██╔██╗██║╚█████╗░██████╔╝█████╗░░█...
3.296875
3
pythia/pyre/inventory/pcs/CodecConfigSheet.py
willic3/pythia
1
43804
<reponame>willic3/pythia #!/usr/bin/env python # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # California Institute of Technology # (C) 2009 All Rights Reserved # # {LicenseText} # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
2.15625
2
nlu/components/chunkers/default_chunker/default_chunker.py
UPbook-innovations/nlu
1
43805
<reponame>UPbook-innovations/nlu import nlu.pipe_components from sparknlp.annotator import * class DefaultChunker: @staticmethod def get_default_model(): return Chunker() \ .setInputCols(["document", "pos"]) \ .setOutputCol("chunk") \ .setRegexParsers(["<NN>+", "<PP>...
2.390625
2
processor.py
GPrathap/OpenBCIPython
1
43806
<gh_stars>1-10 import pydub import os import seaborn as sb from manager import FeatureManager from features.energy import Energy from features.fft import FFT from features.mean import Mean from features.mfcc import MFCC from features.zcr import ZCR from utils.Audio import Audio sb.set(style="white", palette="muted...
2.203125
2
text_based_rpg/combat_entity/other_properties.py
satoshit1/python-text-based-rpg
23
43807
<reponame>satoshit1/python-text-based-rpg """ This module contains miscellaneous property instances for use with the CombatEntity class. """ from .data import DATA @property def evasion(entity): value = entity.dexterity + entity.composure if entity.stamina <= entity.maximum_stamina / 10: value /= 2 ...
3.015625
3
django/reviewApp/migrations/0008_artist_background_image.py
Akasiek/scorethatlp
5
43808
<filename>django/reviewApp/migrations/0008_artist_background_image.py # Generated by Django 4.0.2 on 2022-02-21 17:23 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('reviewApp', '0007_artist_image'), ] operations = [ migrations.AddField...
1.40625
1
tsvhandler.py
andrzej-malina/German-Sentiment-Analysis---AirBNB-example
23
43809
<gh_stars>10-100 import csv import pathlib import random def splitTweetsTsv(): with open('tweets.tsv', encoding="utf-8") as tsvfile, open('tweets_positive.tsv', 'w', encoding="utf-8") as tsvout, open('tweets_negative.tsv', 'w', encoding="utf-8") as tsvneg, open('tweets_neutral.tsv', 'w', encoding="utf-8") as tsvne...
2.953125
3
file_builder/test/__init__.py
btrekkie/file-builder
1
43810
from .args_test import ArgsTest from .arithmetic_test import ArithmeticTest from .build_dirs_test import BuildDirsTest from .build_file_test import BuildFileTest from .bundle_tags_test import BundleTagsTest from .caching_test import CachingTest from .case_test import CaseTest from .clean_test import CleanTest from .cre...
1.484375
1
emotion.py
Kukanani/emotion_game
0
43811
#!/usr/bin/env python import cv2 import sys import numpy import requests import time import operator import math import random api_key = None with open("api.txt") as file: api_key = file.read() if api_key is None: print("error, api.txt not found") exit() emotions = { "neutral": "neutral", "happin...
2.984375
3
main.py
cpressland/bingo
0
43812
from random import choice from flask import Flask, redirect app = Flask(__name__) words = { "1": "One Direction", "2": "Dr Who", "3": "Cup of herbal tea", "4": "Knock at the door", "5": "Johnny's Alive", "6": "Little Mix", "7": "<NAME>", "8": "Golden Gate", "9": "Selfie Time", ...
2.984375
3
Robotix/apps/participant/utils.py
Robotix/rbtxportal
0
43813
YEAR_CHOICES = ( (1,'First'), (2,'Second'), (3,'Third'), (4,'Fourth'), (5,'Fifth'), )
1.679688
2
Python/problem0050.py
1050669722/LeetCode-Answers
0
43814
# -*- coding: utf-8 -*- """ Created on Fri May 31 10:11:51 2019 @author: Administrator """ class Solution: def myPow(self, x: float, n: int) -> float: # if n == 1: # return x # if x!=0 and n == 0: # return 1 # if x == 0 and n <= 0: # return None # if n>...
3.3125
3
earkweb/decorators.py
E-ARK-Software/earkweb
4
43815
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import os from eatb.utils.datetime import ts_date from config.configuration import config_path_work from functools import wraps import logging def requires_parameters(*required_params): """ Decorator function to check if required parameters are avai...
2.28125
2
dit/other/__init__.py
chebee7i/dit
0
43816
<reponame>chebee7i/dit """ Esoteric measures of information, typically fairly divorced from Shannon's measures. """ from .cumulative_residual_entropy import * from .extropy import extropy from .perplexity import perplexity from .renyi_entropy import renyi_entropy from .tsallis_entropy import tsallis_entropy
0.832031
1
problem_5.py
m-yuhas/project_euler
0
43817
<gh_stars>0 #!/usr/bin/python from math import ceil, sqrt def find_prime_factors(n): """ Returns an array of the prime factors on n Loops from 2 to sqrt(n) to pull off a prime factor Recursively computes factors until the remaining number is prime """ for i in range(2,ceil(sqrt(n))+1):...
4.125
4
main.py
rp-bot/Instagram-DM-bot1
0
43818
<filename>main.py # run this file import notification_alert as notif import reply if __name__ == '__main__': away = True while away: notif.checkstatus() reply.bot_init()
1.734375
2
resultadoOperaciones/apps.py
jaimevz001/profiles-rest-api
0
43819
from django.apps import AppConfig class ResultadooperacionesConfig(AppConfig): name = 'resultadoOperaciones'
1.0625
1
flexi/xml/serializer_registry.py
netaneld122/flexi
0
43820
import lxml.etree from flexi.xml.exceptions import UnsupportedElementException from flexi.xml.exceptions import UnsupportedPythonTypeException # Utility functions for xml elements filtering def lower_dict(d): return dict((key.lower(), d[key].lower()) for key in d) def attributes_subset_of(attributes_a, attri...
2.46875
2
gd/config.py
josenavas/glowing-dangerzone
0
43821
<reponame>josenavas/glowing-dangerzone<filename>gd/config.py<gh_stars>0 # ----------------------------------------------------------------------------- # Copyright (c) 2014--, The biocore Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distribu...
2.234375
2
run_tu.py
muhanzhang/NestedGNN
21
43822
<gh_stars>10-100 import os.path as osp import os, sys import time from shutil import copy, rmtree from itertools import product import pdb import argparse import random import torch import numpy as np from kernel.datasets import get_dataset from kernel.train_eval import cross_validation_with_val_set from kernel.train_e...
1.796875
2
utilities/add_language.py
caleb531/youversion-suggest-data
2
43823
<filename>utilities/add_language.py #!/usr/bin/env python # coding=utf-8 # This language utility adds support for a language to YouVersion Suggest by # gathering and parsing data from the YouVersion website to create all needed # language files; this utility can also be used to update any Bible data for an # already-s...
3.109375
3
src/dataset/__init__.py
renyi-ai/drfrankenstein
4
43824
<filename>src/dataset/__init__.py import os import torch import torchvision from dotmap import DotMap from torch.utils.data import DataLoader import warnings warnings.filterwarnings("ignore", category=UserWarning) # suppress deprecation warning coming from torchvision from torchvision import transforms as T from src...
2.140625
2
sqlpuzzle/_queries/query.py
Dundee/python-sqlpuzzle
8
43825
<filename>sqlpuzzle/_queries/query.py from collections import OrderedDict from sqlpuzzle._common import Object, force_text __all__ = ('Query',) class Query(Object): _queryparts = {} _query_template = '' def __init__(self): super().__init__() # Keep sorted query parts for comparison in `...
2.578125
3
src/model/rfdn_old.py
yamengxi/EDSR-PyTorch
0
43826
from math import gcd import torch import torch.nn as nn import torch.nn.functional as F from model import common def make_model(args, parent=False): return RFDN(args) def generate_masks(num): masks = [] for i in range(num): now = list(range(2 ** num)) length = 2 ** (num - i) fo...
2.46875
2
tests/test_versions.py
uilianries/bintray-python
4
43827
<filename>tests/test_versions.py import datetime import pytest from bintray.bintray import Bintray PACKAGE_VERSION = None @pytest.fixture def create_version(): global PACKAGE_VERSION bintray = Bintray() now = datetime.datetime.now() PACKAGE_VERSION = now.strftime("%Y%m%d%H%M%S%f") released = now....
2.046875
2
mlsurvey/sl/workflows/tasks/split_data.py
jlaumonier/mlsurvey
0
43828
<reponame>jlaumonier/mlsurvey<gh_stars>0 from kedro.pipeline import node from mlsurvey.workflows.tasks import BaseTask class SplitDataTask(BaseTask): """ split data from prepared data (train/test) """ @classmethod def get_node(cls): return node(SplitDataTask.split_data, ...
2.21875
2
examples/translation/utils.py
TomerRonen34/fairseq-mcrerank
0
43829
<gh_stars>0 from multiprocessing.pool import ThreadPool, Pool from typing import Any, List, Callable, Sequence, TypeVar, Optional, Iterable from functools import partial from tqdm import tqdm T = TypeVar('T') def apply_map(func: Callable[[T], Any], sequence: Sequence[T], parallelism: Optional[str], sh...
2.53125
3
ludus/neural_net/hello_world/by_torch.py
hiryou/MLPractice
0
43830
from datetime import datetime as dt import torch import torch.nn as nn """ Inspired by https://medium.com/dair-ai/a-simple-neural-network-from-scratch-with-pytorch-and-google-colab-c7f3830618e0 """ class NeuralNet(nn.Module): GPU_AVAIL = torch.cuda.is_available() DEVICE = torch.device("cuda:0" if torch.cuda...
2.953125
3
simtrain/run_sim_ab.py
jamesmcinerney/accordion
2
43831
import os import numpy as np import pandas as pd from scipy import sparse as sp from typing import Callable, List, Tuple, Dict from os.path import join from . import utils, process_dat from . import SETTINGS_POLIMI as SETTINGS os.environ['NUMEXPR_MAX_THREADS'] = str(SETTINGS.hyp['cores']) pd.options.mode.chained_ass...
2.1875
2
pysmore/test_optimizer.py
RainBoltz/pySmore
0
43832
<gh_stars>0 from libs.optimizer import get_dotproduct_loss import numpy as np a = np.array([0.1,0.2,0.3]) b = np.array([0,0.2,0]) L = get_dotproduct_loss(a, b, 1.0) print(L)
2.1875
2
hackathon/migrations/0040_auto_20210225_1656.py
auxfuse/ci-hackathon-app
11
43833
<reponame>auxfuse/ci-hackathon-app<filename>hackathon/migrations/0040_auto_20210225_1656.py<gh_stars>10-100 # Generated by Django 3.1.3 on 2021-02-25 16:56 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('hackathon', '0039_auto_20210224_1850'), ] ...
1.59375
2
lume_model/variables.py
jacquelinegarrahan/lume-model
1
43834
""" This module contains definitions of lume-model variables for use with lume tools. The variables are divided into input and outputs, each with different minimal requirements. Initiating any variable without the minimum requirements will result in an error. Two types of variables are currently defined: Scalar and Im...
2.125
2
elavonvtpv/Request.py
jros99/elavontpv
0
43835
from xml.etree import ElementTree as Etree from xml.dom import minidom from elavonvtpv.enum import RequestType from elavonvtpv.Response import Response import datetime import hashlib import requests class Request: def __init__(self, secret, request_type, merchant_id, order_id, currency=None, amount=None, card=Non...
2.859375
3
qal/transformation/tests/test_transformation.py
OptimalBPM/qal
3
43836
<filename>qal/transformation/tests/test_transformation.py import json import os from jsonschema.validators import Draft4Validator from qal.transformation import generate_schema __author__ = 'nibo' import unittest Test_Script_Dir = os.path.dirname(__file__) Test_Resource_Dir = os.path.join(Test_Script_Dir, 'resources...
2.390625
2
tools/send_notification.py
Gruntrexpewrus/qiskit-app-benchmarks
0
43837
<reponame>Gruntrexpewrus/qiskit-app-benchmarks<filename>tools/send_notification.py #!/usr/bin/env python3 # This code is part of Qiskit. # # (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of...
1.984375
2
custom_model_metrics_visualize.py
Miso-K/DDCW
1
43838
<reponame>Miso-K/DDCW<gh_stars>1-10 import pickle """Run visualization of internal metrics of DDCW model after evaluation (read saved evaluation object)""" evaluator = pickle.load(open("evaluatorobject", "rb")) # Plotting internal model metrics (for DDCW model) from utils import plot_custom_model_metrics as pc pc.plot...
2.4375
2
tests/http/conftest.py
cuenca-mx/facturapi-python
1
43839
<reponame>cuenca-mx/facturapi-python import pytest @pytest.fixture def facturapi_creds(monkeypatch) -> None: monkeypatch.setenv('FACTURAPI_KEY', 'some_api_key')
1.320313
1
rmnd_lca/data_collection.py
xiaoshir/rmnd-lca
2
43840
from . import DATA_DIR import pandas as pd import xarray as xr import numpy as np from pathlib import Path import csv REMIND_ELEC_MARKETS = (DATA_DIR / "remind_electricity_markets.csv") REMIND_ELEC_EFFICIENCIES = (DATA_DIR / "remind_electricity_efficiencies.csv") REMIND_ELEC_EMISSIONS = (DATA_DIR / "remind_electricity...
3.109375
3
runtests.py
imposeren/django-loginas
0
43841
<filename>runtests.py #!/usr/bin/env python import os import sys from django.conf import settings if not settings.configured: settings.configure(**{ 'ROOT_URLCONF': 'loginas.tests.urls', 'INSTALLED_APPS': ( 'django.contrib.contenttypes', 'django.contrib.sessions', ...
1.882813
2
verification/alembic/versions/398d6252cdce_baseline.py
DhivakharVenkatachalam/snet-marketplace-service
14
43842
"""baseline Revision ID: 398d6252cdce Revises: Create Date: 2020-03-12 10:10:15.689958 """ import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = '398d6252cdce' down_revision = None branch_labels = None depends_on = None def upgrade...
1.960938
2
11 - Attention Mechanism/deployment/german_to_english.py
shan18/EVA4-Phase-2
0
43843
import pickle import torch import numpy as np from attention import make_model SRC_STOI = None TARGET_ITOS = None TRG_EOS_TOKEN = None TRG_SOS_TOKEN = None def load_metadata(meta_path): global SRC_STOI, TARGET_ITOS, TRG_EOS_TOKEN, TRG_SOS_TOKEN with open(meta_path, 'rb') as f: metadata = pickle.lo...
2.203125
2
dvrip/cmd/log.py
alexshpilkin/xmeye
34
43844
from datetime import datetime from getopt import GetoptError, getopt from socket import AF_INET, SOCK_STREAM, socket as Socket from sys import stderr from typing import List, NoReturn from ..io import DVRIPClient from ..message import EPOCH from . import EX_USAGE, guard, prog_connect def usage() -> NoReturn: print('...
2.25
2
scripts/dockerize.py
allenai/twentyquestions
9
43845
"""Create the docker image for running twentyquestions. See ``python dockerize.py --help`` for more information. """ import logging import subprocess import click from backend import settings logger = logging.getLogger(__name__) @click.command( context_settings={ 'help_option_names': ['-h', '--help'...
2.6875
3
brainex/misc.py
ebuntel/BrainExTemp
1
43846
import numpy as np def pr_red(skk): print("\033[91m {}\033[00m" .format(skk)) def prYellow(skk): print("\033[93m {}\033[00m" .format(skk)) def merge_dict(dicts: list): merged_dict = dict() merged_len = 0 for d in dicts: merged_len += len(d) merged_dict = {**merged_dict, **d} # ...
2.578125
3
day6.py
robbyblum/adventofcode2020
0
43847
# day 6... # count distinct questions or whatever # parse forms from input file. Split by group! def parse_forms(file): raw = file.read() # Ths smushes each group's responses together, to better facilitate part 1. # I'm sure I'll regret this in part 2. # grouplist = ["".join(p.splitlines()) for p in r...
3.625
4
danceschool/core/classreg.py
benjwrdill/django-danceschool
0
43848
from django.core.urlresolvers import reverse from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.contrib import messages from django.db.models import Q from django.http import HttpResponseRedirect, Http404 from django.views.generic import FormView, RedirectView, TemplateView from django.u...
1.960938
2
back/account/api/email.py
LEEJ0NGWAN/FreeChart
0
43849
<filename>back/account/api/email.py import json from datetime import datetime from django.core.mail import send_mail from django.contrib.auth import ( login, logout, update_session_auth_hash ) from django.template import loader from django.http import JsonResponse from django.views.decorators.csrf import csrf_exemp...
2.0625
2
uhecr_model/legacy/fit_model.py
uhecr-project/uhecr_model
0
43850
''' Python script of the fitting process in the notebook run_simulation.ipynb. This is made so that this can be run on command line as a bash script. ''' import os from fancy import Data, Model, Analysis import argparse # paths to important files path_to_this_file = os.path.abspath(os.path.dirname(__file__)) stan_pa...
2.53125
3
src/STATS_VALLBLS_FROMDATA.py
IBMPredictiveAnalytics/STATS_VALLBLS_FROMDATA
0
43851
#/*********************************************************************** # * Licensed Materials - Property of IBM # * # * IBM SPSS Products: Statistics Common # * # * (C) Copyright IBM Corp. 1989, 2020 # * # * US Government Users Restricted Rights - Use, duplication or disclosure # * restricted by GSA ADP Schedule Co...
2.34375
2
grb/model/torch/gcn.py
Stanislas0/grb
0
43852
import torch import torch.nn as nn import torch.nn.functional as F class GCNConv(nn.Module): """ Simple GCN layer, similar to https://arxiv.org/abs/1609.02907 """ def __init__(self, in_features, out_features, activation=None, dropout=False): super(GCNConv, self).__init__() self.in_fea...
2.875
3
graph_helper/graph_helper/graph_tools.py
mepland/steam_ana
0
43853
import pandas as pd import networkx as nx import collections from operator import itemgetter def clean_game_titles(t_names, g_names): t_names_inverse = collections.defaultdict(list) for k,v in t_names.items(): t_names_inverse[v].append(k) to_merge = {} for k,v in t_names_inverse.items(): if len(v) > 1...
2.46875
2
test/test_modify_contact.py
EkaterinaPentjuhina/python_training
1
43854
<reponame>EkaterinaPentjuhina/python_training<filename>test/test_modify_contact.py from model.contact_properties import Contact import random import allure def test_edit_contact(app, db, check_ui): with allure.step('Given a non-empty contact list'): if len(db.get_contact_list()) == 0: app.cont...
3.109375
3
gnuradio-3.7.13.4/gr-digital/python/digital/gmsk.py
v1259397/cosmic-gnuradio
1
43855
<gh_stars>1-10 # # GMSK modulation and demodulation. # # # Copyright 2005-2007,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Found...
2.1875
2
CS1/0270_while_loop_projects/shape_drawing_answers/00turtle_triangle.py
nealholt/python_programming_curricula
7
43856
''' Start by reading and running the following code to see what it does. 1. Then rewrite this code so that it uses a for loop. Challenge yourself to make the rewrite as short as possible. 2. Modify your code to draw a square instead of a triangle. 3. Modify your code to draw a pentagon. (You should Google what angles ...
4.84375
5
app/core/tests/test_models.py
samkahunga65/recipe-app
0
43857
from django.test import TestCase from django.contrib.auth import get_user_model class ModelTests(TestCase): def test_create_user_succesful(self): """test thst creating a new ussful""" email = "<EMAIL>" password = "<PASSWORD>" user = get_user_model().objects.create_user( ...
3.03125
3
seg_vgg19_all/dataloader.py
dingmyu/Pytorch-Topology-Aware-Delineation
32
43858
import torch.utils.data as data import os import numpy as np import cv2 #/mnt/lustre/share/dingmingyu/new_list_lane.txt class MyDataset(data.Dataset): def __init__(self, file, dir_path, new_width, new_height, label_width, label_height): imgs = [] fw = open(file, 'r') lines = fw.readlines() ...
2.59375
3
setup.py
eldridgea/workdown
18
43859
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="workdown", version="0.0.4", author="<NAME>", author_email="<EMAIL>", description="Write Markdown and have it published and hosted on Cloudflare Workers", long_description=long_descript...
1.539063
2
transport/views.py
ezekielkibiego/Store_Center
6
43860
from django.conf import settings from django.shortcuts import redirect, render from transport.models import * from transport.forms import * from django.contrib.auth.decorators import login_required import requests,json from django.template.loader import render_to_string, get_template from django.core.mail import Email...
2.140625
2
gui/loadobservations_widget.py
Varnani/pywd2015-qt5
7
43861
<reponame>Varnani/pywd2015-qt5<filename>gui/loadobservations_widget.py # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'loadobservations_widget.ui' # # Created by: PyQt5 UI code generator 5.11.3 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWi...
1.757813
2
configs/parameter.py
THU-luvision/SurRF
3
43862
import numpy as np import os import torch import math class Params(object): def __init__(self): self.exp_id = '0207/exp1' self.root_params() self.network_params() self.train_params() self.load_params() self.reconstruct_params() def change_node_num(self, node_n...
2.3125
2
beatcrunch/beatUrlTest.py
iero/BeatCrunch
0
43863
<reponame>iero/BeatCrunch import sys, os import traceback import gensim import pickle import utils import Statistics import Article # Grep articles from services and extract informations # Used to debug services if __name__ == "__main__": if len(sys.argv) < 4 : print("Please use # python beattest.py services.xml...
2.3125
2
scripts/Discord-Scraper/SimpleRequests/SimpleRequestsPy3.py
kyle-rgb/Discord_Project
1
43864
<reponame>kyle-rgb/Discord_Project # Give us access to http.client functions for network requests. from http.client import HTTPConnection, HTTPSConnection, HTTPException # Give us access to the OS module functions. from os import makedirs, path # Give us access to our basic SimpleRequests functions. from .Simp...
3.484375
3
setup.py
RafaelCenzano/backer
0
43865
#from setuptools import setup, find_packages #from os import getcwd, path import os import sys import json import config #currentDir = getcwd() ''' # Get Readme text with open(path.join(currentDir, 'README.md'), encoding='utf-8') as fR: readme = fR.read() ''' # Run setup ''' setup( # Project's name name...
1.515625
2
smida/models.py
dchaplinsky/ragoogle
3
43866
<reponame>dchaplinsky/ragoogle import logging from django.db import models from django.urls import reverse from abstract.models import AbstractDataset from names_translator.name_utils import ( generate_all_names, autocomplete_suggestions, concat_name, ) from abstract.tools.countries import COUNTRIES from ...
2.140625
2
codenames/messages.py
dieret/codenames
0
43867
#!/usr/bin/env python3 # std from typing import List, Optional # ours from codenames.users import User class Message: def __init__(self, message: str, user: Optional[User] = None): self.user = user # type: Optional[User] self.message = message def to_html(self): if self.user: ...
3.1875
3
data/contacts.py
MikhailDr/python_training
0
43868
<filename>data/contacts.py from model.contact import Contact testdata = [ Contact(firstname="Mikhail", lastname="Kennett"), Contact(firstname="Lily", lastname="Watson") ]
2.015625
2
Scripts/Gnuplot/add_values.py
ciaid-colombia/InsFEM
1
43869
<reponame>ciaid-colombia/InsFEM from __future__ import division import pylab as pl import numpy as np import os,re,sys,getopt import numpy.ma as MA #Arguments data_file = sys.argv[1] #Folder name: file.gid var_x = sys.argv[2] #Variable: variable to add value to add_val = sys.argv[3] #Variable: value to add col...
2.3125
2
src/model.py
beamimc/tcr-pmhc
0
43870
<gh_stars>0 import glob import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn import metrics from sklearn.metrics import f1_score, accuracy_score from sklearn.metrics import roc_curve, confusion_matrix import torch import torch.nn as nn # All neural network modules, nn.Linear, nn.Conv2d,...
2.21875
2
tagger/data/__init__.py
XMUNLP/Tagger
335
43871
<reponame>XMUNLP/Tagger<filename>tagger/data/__init__.py<gh_stars>100-1000 from tagger.data.dataset import get_dataset from tagger.data.vocab import load_vocabulary, lookup from tagger.data.embedding import load_glove_embedding
1.289063
1
api/tacticalrmm/winupdate/tasks.py
steroberts89/tacticalrmm
0
43872
<gh_stars>0 from time import sleep from django.utils import timezone as djangotime from django.conf import settings import datetime as dt import pytz from loguru import logger from agents.models import Agent from .models import WinUpdate from tacticalrmm.celery import app logger.configure(**settings.LOG_CONFIG) @ap...
2.140625
2
obsolete/reports/pipeline_chipseq/trackers/Motifs.py
kevinrue/cgat-flow
49
43873
from ChipseqReport import * import xml.etree.ElementTree import Glam2 def computeMastCurve(evalues): '''compute a MAST curve. see http://www.nature.com/nbt/journal/v26/n12/extref/nbt.1508-S1.pdf returns a tuple of arrays (evalues, with_motifs, explained ) ''' if len(evalues) == 0: rais...
2.890625
3
tests/unit_tests/test_tethys_config/test_apps.py
msouff/tethys
79
43874
import unittest from django.apps import apps from tethys_config.apps import TethysPortalConfig class TethysConfigAppsTest(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_TethysPortalConfig(self): app_config = apps.get_app_config('tethys_config') ...
2.59375
3
main.py
SameerSahu007/Street-Fighter-in-Pygame
1
43875
import pygame import math from pygame import mixer import os pygame.init() WIDTH, HEIGHT = 800, 600 #create the screen screen = pygame.display.set_mode((WIDTH , HEIGHT)) # Title and Icon pygame.display.set_caption("Space Fighter") icon = pygame.image.load(os.path.join('assets', 'icon.png')) pygame.di...
2.828125
3
reframechecks/memory/gpu_memory/single_node_gpu_memory_nvidia.py
reframe-hpc/hpctools
3
43876
import reframe as rfm import reframe.utility.sanity as sn @rfm.simple_test class np_max_test(rfm.RunOnlyRegressionTest): omp_threads = parameter([12]) # mpi_rks = parameter([1, 2]) np_per_c = parameter([ 1.8e6, 2.0e6, 2.2e6, 2.4e6, 2.6e6, 2.8e6, 3.0e6, 3.2e6, 3.4e6, 3.6e6, 3.8e6, ...
1.914063
2
icc/main.py
jinhopark8345/ICC
0
43877
<reponame>jinhopark8345/ICC<filename>icc/main.py<gh_stars>0 from flask import Flask, render_template app = Flask(__name__) from iccjson.jconnect import * from recommend.compare_recipe import * from recommend.recommend_recipe import * from iccdb.db_manage import * from gui.main_gui import * def main_t(): icc_db = ...
2.140625
2
tests/test_data.py
ig248/livehistoryplot
1
43878
from kerashistoryplot.data import (get_metrics, _get_batch_metric_vs_epoch, get_metric_vs_epoch) HISTORY = { 'batches': [ { 'batch': [0, 1], 'size': [300, 200], 'loss': [0.4, 0.3], 'mean_ab...
2.5
2
source/layers.py
kjm1559/vit
0
43879
import tensorflow as tf from tensorflow.keras.layers import Dense, LayerNormalization, Reshape, Permute, Dropout, GlobalAveragePooling1D, Embedding from tensorflow.keras.activations import softmax, linear import tensorflow.keras.backend as K import numpy as np def gelu(x): return 0.5*x*(1+tf.tanh(np.sqrt(2/np.pi)*...
2.71875
3
controller.py
kdschlosser/micropython_fastled
10
43880
<filename>controller.py # @file controller.h # base definitions used by led controllers for writing out led data from . import * from .led_sysdefs import * from .pixeltypes import * from .color import * from .lib8tion import * from . import NO_DITHERING, FASTLED_SCALE8_FIXED, NO_CORRECTION def RO(RGB_ORDER, X): ...
3.203125
3
digani/attr_func/state.py
ZwEin27/dig-attribute-name-identification
0
43881
# -*- coding: utf-8 -*- # @Author: ZwEin # @Date: 2016-07-08 13:48:24 # @Last Modified by: ZwEin # @Last Modified time: 2016-07-08 13:48:34 def attr_func_state(attr_vals): pass
1.132813
1
test/test_credit_calculator_full.py
Verstuk/pyton_for_testers
0
43882
<reponame>Verstuk/pyton_for_testers<filename>test/test_credit_calculator_full.py from model.group import Group def test_calculator_2(app): app.credit_form_case_2(Group(loan = '100000', payment='50000', term='12')) app.session.submit()
1.734375
2
Python-client.py
zanda8893/Python-client-server
1
43883
from time import sleep from threading import Thread import socket import datetime as datetime from tkinter import * #global varaibles global run global message global gui run=True class client(): def __init__(self): self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.count = 0 ...
3
3
harness/python/ext/__init__.py
tonyfast/tidy-harness
4
43884
<filename>harness/python/ext/__init__.py<gh_stars>1-10 # coding: utf-8 # In[3]: try: from .base import HarnessExtension except: from harness.python.ext.base import HarnessExtension __all__ = ['HarnessExtension']
1.078125
1
dash-asynchronous.py
cswarth/dash-recipes
0
43885
import dash from dash.dependencies import Input, Output import dash_core_components as dcc import dash_html_components as html import logging import datetime import time class Semaphore: def __init__(self, filename='semaphore.txt'): self.filename = filename with open(self.filename, 'w') as f: ...
2.484375
2
irco/countries.py
GaretJax/irco
0
43886
import pycountry from irco import logging _cache = {} log = logging.get_logger() NAMES = {c.name.lower(): c for c in pycountry.countries.objects} SUBDIVISIONS = {s.name.lower(): s for s in pycountry.subdivisions.objects} PREFIXES = set([ 'Republic of', ]) REPLACEMENTS = { 'South Korea': 'Korea, Republic of...
2.484375
2
nerds/test/test_crf_ner_model.py
elsevierlabs-os/nerds
19
43887
<filename>nerds/test/test_crf_ner_model.py from nose.tools import assert_equal from nerds.core.model.input.annotation import Annotation from nerds.core.model.input.document import Document, AnnotatedDocument from nerds.core.model.ner.crf import CRF def test_crf(): content = b"The quick brown fox jumps over the l...
2.40625
2
rooms/urls.py
nahidsaikat/reservation
0
43888
from django.urls import include, path from rest_framework.routers import DefaultRouter from rooms import views # Create a router and register our viewsets with it. router = DefaultRouter() router.register(r"room", views.RoomViewSet, basename="room") # The API URLs are now determined automatically by the router. urlp...
2.171875
2
hyperion/bin/keras-eval-pdda-1vs1.py
jsalt2019-diadet/hyperion
9
43889
#!/usr/bin/env python """ Copyright 2018 Johns Hopkins University (Author: <NAME>) Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) """ """ Evals PDDA LLR """ from __future__ import absolute_import from __future__ import print_function from __future__ import division from six.moves import xrange import sys ...
1.945313
2
main.py
PomeloWang/opensearch-index-rotate
0
43890
import re import typing import logging import argparse from opensearchpy import OpenSearch from datetime import datetime _version = "0.0.1" _project_name = "opensearch-index-rotate" logging.basicConfig(level=logging.INFO) logger = logging.getLogger(f"{_project_name}-{_version}") def build_filter_function( unit...
2.90625
3
src/trellisdata/database_query.py
StanfordBioinformatics/trellisdata
0
43891
<reponame>StanfordBioinformatics/trellisdata<filename>src/trellisdata/database_query.py import yaml #import ruamel.yaml class DatabaseQuery(yaml.YAMLObject): """A parameterized Neo4j query. Use query parameters whenver possible: https://medium.com/neo4j/neo4j-driver-best-practices-dfa70cf5a763 args: name (str):...
2.921875
3
config.sample.py
talyguryn/watcher
0
43892
<reponame>talyguryn/watcher<filename>config.sample.py # Domains list DOMAINS = [ { 'url': 'https://ifmo.su', 'message': '@guryn' } ] # Notifications link from https://t.me/wbhkbot WEBHOOK = ''
1.242188
1
pyscript/apps/temp/old/load_optimizer.py
janiversen/ha_config
0
43893
<gh_stars>0 @state_trigger("sensor.power_meter != '9999'") def load_optimizer(value=None): pass
1.28125
1
billing/tests/test_customer.py
hkhanna/django-stripe-billing
1
43894
<gh_stars>1-10 """Tests related to automatic Customer creation and model constraints.""" # A customer is automatically created if a user does not have one, and it accomplishes this via signals. # We also have some model constraints we want to test. import pytest from datetime import timedelta from django.contrib.auth...
3.015625
3
src/visual.py
rmill040/eda_viewer
0
43895
# -*- coding: utf-8 -*- # Import libraries from api from visual_api import * class MplCanvas(FigureCanvas): """Base MPL widget for plotting Parameters ---------- FigureCanvas : FigureCanvasQTAgg Canvas for plotting Returns ------- None """ def __init__(self, parent=N...
3
3
python/open3d/realsense_pcd_viewer.py
NobuoTsukamoto/realsense_examples
3
43896
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ RealSense PCD Viewer with Open3D. Copyright (c) 2021 <NAME> This software is released under the MIT License. See the LICENSE file in the project root for more information. """ import argparse import json import os import numpy as np import open3d as...
2.25
2
multiplication.py
iAnatoly/multiplication
1
43897
#!/usr/bin/python # # This script is free for use and redistribution in educational purposes. # See https://github.com/iAnatoly/multiplication/ for more info. # # email notification configuration is defined in multiplication.config import random import os import sys import smtplib import ConfigParser from email.mime.t...
3.34375
3
scripts/reformat_unmapped_primers.py
fulcrumgenomics/fg-idprimer
1
43898
<gh_stars>1-10 #!/usr/bin/env python3 from pathlib import Path import defopt def main(*, in_primers: Path, out_primers: Path, forward_names: List[str] = ['SP1', '1'], reverse_names: List[str] = ['SP2', '-1']) -> None: '''Reformats unmapped primers for use with fgbio's IdentifyPrime...
3.40625
3
jenkins.py
shoy160/python-tools
0
43899
<filename>jenkins.py import requests import sys import getopt import time requests.adapters.DEFAULT_RETRIES = 5 # 增加重连次数 HOST = 'http://jenkins.local' CRUMB = 'a0854aedfb3062b192f80d648b9d2b45' COOKIE = 'jenkins-timestamper-offset=-28800000; ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE=c2hheToxNTkyMzg0MjU0NTE2OmNmZTk0YmR...
2.40625
2