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 |
|---|---|---|---|---|---|---|
{{ cookiecutter.repo_name }}/{{ cookiecutter.package_name }}/command_line.py | mazzma12/cookiecutter-data-science | 1 | 49300 | import fire
def main():
"""Command line interface."""
pass
if __name__ == "__main__":
fire.Fire(main)
| 1.304688 | 1 |
ElcheapoAIS_manhole/manhole/urls.py | innovationgarage/ElCheapoAIS-manhole | 0 | 49301 | from django.contrib import admin
from django.urls import path
import manhole.views
urlpatterns = [
path('<str:client>', manhole.views.script, name='script'),
path('<str:client>/<int:ordering>', manhole.views.output, name='output')
]
| 1.523438 | 2 |
damageCreator.py | Msegade/test123 | 1 | 49302 | import salome
import SMESH
from salome.geom import geomBuilder
from salome.smesh import smeshBuilder
import sys
import math
import numpy as np
from numpy.linalg import norm
from numpy.random import uniform
from pathlib import Path
from auxiliaryFunctions import clusteringAlgorithm
from auxiliaryFunctions import getTr... | 2.203125 | 2 |
link/items.py | KiriKira/LinkSpider | 1 | 49303 | <filename>link/items.py
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class IndexItem(scrapy.Item):
tag_qiangdan = scrapy.Field()
class DetailItem(scrapy.Item):
tag = scrapy.Field()
p... | 2.15625 | 2 |
diventi/feedbacks/views.py | flavoi/diven | 2 | 49304 | <filename>diventi/feedbacks/views.py
from django.shortcuts import (
render,
redirect,
get_object_or_404,
)
from django.http import Http404
from django.urls import reverse
from django.views.generic import ListView
from django.views.generic.detail import DetailView
from django.views.generic.edit import Creat... | 1.851563 | 2 |
OnDemandPublicationScript.py | muneebmallick/OndemandPublication-pyscript | 0 | 49305 | import getpass
import datetime
import requests
import gzip
import easywebdav
import os
from bs4 import BeautifulSoup as bs
user = raw_input("Username: ")
password = <PASSWORD>()
date = raw_input("As of Date (mmddYYYY): ")
#add URL from where the files are required to be downloaded.
archive_url = 'URL'
def get_file_... | 3.109375 | 3 |
src/python/peanoclaw/__init__.py | unterweg/peanoclaw | 1 | 49306 | <reponame>unterweg/peanoclaw
__all__ = []
__all__.extend(['Solver', 'Solution', 'State', 'SubgridSolver', 'Peano'])
from peanoclaw.peano import Peano
from peanoclaw.solver import Solver
from peanoclaw.solution import Solution
from peanoclaw.subgridsolver import SubgridSolver
from peanoclaw.internalsettings import Inte... | 1.289063 | 1 |
Manteia/Augmentation.py | ym001/Manteia | 4 | 49307 | """
.. module:: Augmentation
:platform: Unix, Windows
:synopsis: A useful module indeed.
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import numpy as np
import random
from nltk.corpus import wordnet
import collections
import math
#import nltk
#nltk.download('wordnet')
class Augmentation:
r"""
This is the clas... | 2.953125 | 3 |
Ace-Your-Python-Coding-Interview/Section 4 Part 4 - Hard Interview Question - Suboptimal Solution.py | IvanDemin3467/Ace-Your-Python-Coding-Interview | 0 | 49308 | class Link:
def __init__(self, val, next=None):
self.val = val
self.next = next
def __repr__(self):
if not self.next:
return f"Link({self.val})"
return f"Link({self.val}, {self.next})"
def merge_k_linked_lists(linked_lists):
'''
Merge k sorted linked lists ... | 3.9375 | 4 |
compute_masks.py | MuhammadHamed/Deep-tracking | 0 | 49309 | <reponame>MuhammadHamed/Deep-tracking
import scipy.io, os
from scipy.misc import imsave
import numpy as np
import cPickle
from PIL import Image
import shutil
import matplotlib.pyplot as plt
# used for producing the image with only the labels when "show masks only" in the annotation tool is pressed
def create_mask_for... | 2.84375 | 3 |
django_dumpslow/utils.py | lamby/django-dumpslow | 11 | 49310 | <gh_stars>10-100
import re
import datetime
def parse_interval(val):
match = re.match(r'^(\d+)([smhdwy])$', val)
if not match:
raise ValueError()
unit = {
's': 'seconds',
'm': 'minutes',
'h': 'hours',
'd': 'days',
'w': 'weeks',
}[match.group(2)]
td =... | 2.875 | 3 |
trainModel/mcRBM.py | davidmam/EEG-sleep-analysis | 1 | 49311 | """
THIS CODE IS UNDER THE BSD 2-Clause LICENSE. YOU CAN FIND THE COMPLETE
FILE AT THE SOURCE DIRECTORY.
Copyright (C) 2017 <NAME> - All rights reserved
@author : <EMAIL>
Publication:
A Novel Unsupervised Analysis of El... | 2 | 2 |
conftest.py | d34dm8/chime | 149 | 49312 | <filename>conftest.py<gh_stars>100-1000
import importlib
import pathlib
import tempfile
import _pytest.monkeypatch
import pytest
import chime
@pytest.fixture(scope='function', autouse=True)
def reload_chime():
importlib.reload(chime)
@pytest.fixture(scope='function', autouse=True)
def mock_pathlib_home(monkey... | 1.835938 | 2 |
atropos/commands/error/reports.py | plijnzaad/atropos | 0 | 49313 | """Report generator for the error command.
TODO: move reporting functionality out of the ErrorEstimator class.
"""
from itertools import repeat
from atropos.commands.reports import BaseReportGenerator
from atropos.io import open_output
from atropos.commands.legacy_report import Printer, TitlePrinter
class ReportGener... | 2.578125 | 3 |
update.py | ti-lei/iphone11 | 0 | 49314 | # from flask import Flask, render_template, flash, redirect, url_for, session, request, logging
# from wtforms import Form, StringField, TextAreaField, PasswordField, validators
# from functools import wraps
import requests
import json
import pandas as pd
import platform
import shutil
import datetime
from module import... | 2.125 | 2 |
scripts/catalog-manager.py | jtheoof/dotfiles | 13 | 49315 | <gh_stars>10-100
#!/usr/bin/python
## @package catalog-manager
# Provides general functions to parse SQ3 files
# and generate SQL code.
#
# Can manage both 3D and MATERIALS (with TEXTURES).
import csv
import fnmatch
import getopt
import logging
import os
import platform
import random
import re
import shutil
import... | 2.328125 | 2 |
mode/examples/Basics/Data/VariableScope/VariableScope.pyde | timgates42/processing.py | 1,224 | 49316 | <filename>mode/examples/Basics/Data/VariableScope/VariableScope.pyde<gh_stars>1000+
"""
Variable Scope.
Variables have a global or local "scope".
For example, variables declared within either the
setup() or draw() functions may be only used in these
functions. Global variables, variables declared outside
of setup() ... | 3.71875 | 4 |
src/quick_sort.py | ChristopherSClosser/python-data-structures | 0 | 49317 | <filename>src/quick_sort.py
"""Implement quick sorting algorithm.
Quicksort is a comparison sort, meaning that it can sort items of any type for
which a "less-than" relation (formally, a total order) is defined. In efficient
implementations it is not a stable sort, meaning that the relative order of
equal sort items i... | 4.1875 | 4 |
pypy/objspace/std/iterobject.py | camillobruni/pygirl | 12 | 49318 | """
Reviewed 03-06-22
Sequence-iteration is correctly implemented, thoroughly
tested, and complete. The only missing feature is support
for function-iteration.
"""
from pypy.objspace.std.objspace import *
class W_AbstractSeqIterObject(W_Object):
from pypy.objspace.std.itertype import iter_typedef as typedef
... | 2.65625 | 3 |
NCC_bot.py | sangmouse2715/babgive | 0 | 49319 | from parsing import get_diet
import discord , asyncio , datetime , sys , os
import parsing
def main():
client = discord.Client()
TOKEN = "<KEY>"
#명령어 목록
Command_list = (
"```css\n"
"[NCC_bot Command List]\n"
"!도움말 - 도움말\n"
... | 1.960938 | 2 |
cttools/__init__.py | nik849/ct-tools | 0 | 49320 | <reponame>nik849/ct-tools
__version__ = '0.0.1'
from .recon import *
from .config import *
from .parse import *
from .utilities import *
| 0.945313 | 1 |
functions/source/onboarding/onboarding.py | aws-quickstart/quickstart-ct-newrelic-one | 1 | 49321 | import boto3, json, time, os, logging, botocore, uuid
from crhelper import CfnResource
from botocore.exceptions import ClientError
logger = logging.getLogger()
logger.setLevel(logging.INFO)
logging.getLogger('boto3').setLevel(logging.CRITICAL)
logging.getLogger('botocore').setLevel(logging.CRITICAL)
session = boto3.Se... | 1.929688 | 2 |
train.py | Luojiahong/Cospy | 8 | 49322 | <gh_stars>1-10
import sys
import os
os.environ["CUDA_VISIBLE_DEVICES"]="0"
from time import localtime, strftime
import argparse
import tensorflow as tf
import numpy as np
import deeplab as model
import common
np.set_printoptions(threshold=np.inf)
flags = tf.app.flags
FLAGS = flags.FLAGS
scale = None
# Settings f... | 1.898438 | 2 |
handlers/load_python_modules.py | gofynd/alb-logs-parser | 2 | 49323 | '''
Load external modules
'''
import os
import sys
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(BASE_DIR, "../python_modules"))
| 2.109375 | 2 |
pipeline/Serverless/04_stream_processor/stream_processor.py | Rkauff/Klayers | 1,096 | 49324 | import json
import os
from datetime import datetime
import boto3
from aws_lambda_powertools.logging import Logger
logger = Logger()
@logger.inject_lambda_context
def main(event, context):
records = event.get("Records", [])
entries = []
stream_label = os.environ["STREAM_LABEL"]
logger.info(
... | 2.171875 | 2 |
fast/video_raspi.py | jmilliaan/mppi_iot | 0 | 49325 | import cv2
import matplotlib.pyplot as plt
import time
from picamera.array import PiRGBArray as pi_rgb
from picamera import PiCamera as picam
confidence_threshold = 0.45 # Threshold to detect object
font = cv2.FONT_HERSHEY_COMPLEX
color = [255, 255, 255]
height = 320
width = 640
focal_length = 500
class P... | 2.4375 | 2 |
pca.py | sadeabiodun/social-ctf | 0 | 49326 | from os.path import join
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.stats import zscore
from sklearn.decomposition import PCA
import pandas as pd
from itertools import combinations
# Load helper function(s) for interacting with CTF dataset
from ctf_dataset.load import create_wr... | 2.234375 | 2 |
models/__init__.py | MilesQLi/Theano-Lights | 313 | 49327 | <filename>models/__init__.py
__all__ = [
"ffn",
"rbfn",
"ffn_bn",
"ffn_ace",
"ffn_lae",
"ffn_bn_vat",
"ffn_vat",
"cnn",
"vae1",
"cvae",
"draw_at_lstm1",
"draw_at_lstm2",
"draw_lstm1",
"draw_sgru1",
"lm_lstm",
"lm_lstm_bn",
"lm_gru",
"lm_draw"... | 1.296875 | 1 |
Homework/HW7.py | Javascript-void0/hxgv | 0 | 49328 | <filename>Homework/HW7.py
'''
num1=1
num2=1
num3=num1+num2
print(num3)
sum=num1+num2+num3
for i in range(1,18,1):
num1=num2
num2=num3
num3=num1+num2
if num3%2==0:
print(num3)
'''
'''
for i in range(1,101):
if 100%i==0:
print(i)
'''
num1=int(input("Please input a number: "))
for i ... | 3.828125 | 4 |
Implementation/python/forms.py | ADA-Inc/autentication-web | 0 | 49329 | from flask_wtf import FlaskForm
from wtforms import *
from wtforms.validators import InputRequired
class LoginForm(FlaskForm):
username = TextField('username',validators=[InputRequired()])
password = PasswordField('password',validators=[InputRequired()]) | 2.625 | 3 |
tools/third_party/importlib_metadata/prepare/example/example/__init__.py | meyerweb/wpt | 2,479 | 49330 | <gh_stars>1000+
def main():
return 'example'
| 1.046875 | 1 |
azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/network_profile.py | JonathanGailliez/azure-sdk-for-python | 1 | 49331 | <reponame>JonathanGailliez/azure-sdk-for-python
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by M... | 2.078125 | 2 |
send_status_report.py | jonathanzong/dmca | 2 | 49332 | from app.controllers.debriefing_controller import *
ENV = os.environ['CS_ENV']
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
CONFIG_DIR = os.path.join(BASE_DIR, "config")
db_engine = DbEngine(CONFIG_DIR + "/{env}.json".format(env=ENV))
sce = DebriefingController(db_engine=db_engine)
sce.send_debriefing_sta... | 1.820313 | 2 |
plugins/modules/files_attributes.py | manala/ansible-roles | 138 | 49333 | <reponame>manala/ansible-roles
#!/usr/bin/python
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This is a virtual module that is entirely implemented as an action plugin and runs on the controller
from __future__ import absolute_import, division, print_function
__metac... | 1.320313 | 1 |
train.py | JackYangzg/pytorch-ddpg | 1 | 49334 | import time
from memory import Memory
from constfile.constkey import *
from constfile.ddpgqueue import fifo, model_queue
from ddpg import DDPG
from utils.configsupport import config
from utils.logsupport import log
class train(object):
def __init__(self):
self.model = DDPG()
self.model.load_weigh... | 2.546875 | 3 |
tests/ui/menus/test_opmenu.py | Hengle/Houdini-Toolbox | 136 | 49335 | <gh_stars>100-1000
"""Tests for ht.ui.menus.opmenu module."""
# =============================================================================
# IMPORTS
# =============================================================================
# Houdini Toolbox
import ht.ui.menus.opmenu
# Houdini
import hou
# =================... | 2.234375 | 2 |
functions/s3_public_block/lambda_handler.py | smoketurner/sam_controltower_api | 3 | 49336 | <reponame>smoketurner/sam_controltower_api
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from typing import Dict, Any
import warnings
from aws_lambda_powertools import Logger, Metrics, Tracer
from aws_lambda_powertools.utilities.typing import LambdaContext
from sts import STS
warnings.filterwarnings("ignore", "No m... | 1.75 | 2 |
Solutions/165_ Compare Version Numbers.py | Jian-jobs/Jian-leetcode_python3 | 3 | 49337 | <reponame>Jian-jobs/Jian-leetcode_python3
'''
165. Compare Version Numbers
https://leetcode.com/problems/compare-version-numbers/
Compare two version numbers version1 and version2.
If version1 > version2 return 1;
if version1 < version2 return -1;
otherwise return 0.
You may assume that the version strings are:
non-... | 3.953125 | 4 |
bgp/apps.py | maznu/peering-manager | 127 | 49338 | <reponame>maznu/peering-manager<filename>bgp/apps.py
from django.apps import AppConfig
class BgpConfig(AppConfig):
name = "bgp"
verbose_name = "BGP"
| 1.210938 | 1 |
src/pygram11/__init__.py | drdavis/pygram11 | 15 | 49339 | """Simple and fast histogramming in Python.
MIT License
Copyright (c) 2021 <NAME>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to ... | 1.6875 | 2 |
lib/googlecloudsdk/command_lib/notebooks/completers.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2 | 49340 | <gh_stars>1-10
# -*- coding: utf-8 -*- #
# Copyright 2020 Google LLC. 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
#
... | 2.0625 | 2 |
src/slam/FactorGraphSolver.py | MarineRoboticsGroup/NF-iSAM | 10 | 49341 | import json
import os
import time
from copy import deepcopy
import TransportMaps.Distributions as dist
import TransportMaps.Likelihoods as like
from typing import List, Dict
from matplotlib import pyplot as plt
from factors.Factors import Factor, ExplicitPriorFactor, ImplicitPriorFactor, \
LikelihoodFactor, Bina... | 2.0625 | 2 |
cogs/tts/aquestalk.py | tuna2134/rt-bot-sdk | 0 | 49342 | <reponame>tuna2134/rt-bot-sdk<filename>cogs/tts/aquestalk.py
# RT TTS - AquesTalk
import asyncio
from .openjtalk import _synthe
SyntheError = type("SyntheError", (Exception,), {})
libs = {}
def load_libs(paths: dict) -> None:
"""AquesTalkのライブラリを読み込みます。
読み込んだライブラリは`libs`に名前と一緒に辞書形式で保存されます。
`synthe`... | 2.34375 | 2 |
scrapy_queue/queue.py | parker-pu/scrapy-queue | 1 | 49343 | <reponame>parker-pu/scrapy-queue
# -*- coding: utf-8 -*-
"""
这个脚本的作用是用来实现 Redis 的队列
"""
import logging
from scrapy_queue import connection
from scrapy_queue.utils import get_index_arr
logger = logging.getLogger(__name__)
class RedisQueue(object):
""" 这个类的作用是用来实现 Redis 的队列的功能
队列左进右出
"""
... | 2.328125 | 2 |
proc/rock_model_demo_latest.py | nisarkhanatwork/rocksample_deeprl | 0 | 49344 | #!/usr/bin/env python
# coding: utf-8
import time
#https://stackoverflow.com/questions/714063/importing-modules-from-parent-folder
import sys
sys.path.insert(0,'../gym')
import numpy as np
from support import *
from model import *
def run_exper(model, steps, get_features, pre_proc_features):
from environment im... | 2.484375 | 2 |
beginner_contest/049/B.py | FGtatsuro/myatcoder | 0 | 49345 | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
h, w = map(int, input().split())
for i in range(h):
c = input().strip()
print(c)
print(c)
| 2.671875 | 3 |
Curso_Em_Video_Python/ex013.py | ThallesTorres/Curso_Em_Video_Python | 0 | 49346 | print('''
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
--Seja bem-vindo!
--Exercício 013
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
''')
salario = float(input('Digite o salário: R$'))
aumento = float(input('Digite a porcentagem do aumento: '))
total = salario * aumento / 100
input(f'Aumento: R${total:.2f} \nAumento + Salár... | 3.96875 | 4 |
adspygoogle/adwords/AdWordsClient.py | nearlyfreeapps/python-googleadwords | 2 | 49347 | <gh_stars>1-10
#!/usr/bin/python
#
# Copyright 2010 Google Inc. 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
#
# Un... | 1.851563 | 2 |
server/app/admin/views_loginlog.py | jamesyangget/WeChat-Mini-Program-Face-Recognition | 19 | 49348 | <reponame>jamesyangget/WeChat-Mini-Program-Face-Recognition
# -*- coding: utf-8 -*-
import pymongo
import tornado.gen
import tornado.concurrent
from app.admin.views_admin import AdminHandler
from bson.objectid import ObjectId
# 授权日志列表
class LoginlogHandler(AdminHandler):
@tornado.gen.coroutine
def get(self, *... | 2.234375 | 2 |
app/commands/footprint.py | BartekSzpak/adversary | 22 | 49349 | from plugins.adversary.app.commands.command import CommandLine
from typing import Callable, Tuple
from plugins.adversary.app.commands import parsers
def files() -> Tuple[CommandLine, Callable[[str], None]]:
command = 'powershell -command "&{$filetype = @(\\"*.docx\\",\\"*.pdf\\",\\"*.xlsx\\"); $startdir = ' \
... | 2.4375 | 2 |
PyLibFTDI/_ftd2xx64.py | paretech/PyLibFTDI | 2 | 49350 | # generated by 'clang2py'
# flags '-c -d -l ftd2xx64.dll ftd2xx.h -vvv -o _ftd2xx64.py'
# -*- coding: utf-8 -*-
#
# TARGET arch is: []
# WORD_SIZE is: 4
# POINTER_SIZE is: 8
# LONGDOUBLE_SIZE is: 8
#
import ctypes
# if local wordsize is same as target, keep ctypes pointer function.
if ctypes.sizeof(ctypes.c_void_p) =... | 2.140625 | 2 |
core/tests/test_models.py | CezarPoeta/Fusion | 0 | 49351 | <filename>core/tests/test_models.py<gh_stars>0
import uuid
from django.test import TestCase
from model_mommy import mommy
from core.models import get_file_path
class GetFilePathTestCase(TestCase):
def setUp(self):
self.filename = f'{uuid.uuid4()}.png'
def test_get_file_path(self):
arquivo = ... | 2.375 | 2 |
main.py | hf-zhu/v2ex-action | 0 | 49352 | <filename>main.py
from actions_toolkit import core
from app.action import Action
if __name__ == '__main__':
try:
input_hook = core.get_input('webhook', required=True)
input_secret = core.get_input('secret')
count_str = core.get_input('count')
input_count = int(count_str) if count_s... | 2.015625 | 2 |
loss_fn.py | aoru45/Deep-Anomaly-Detection-for-Generalized-Face-Anti-Spoofing | 17 | 49353 | import torch
import torch.nn as nn
import torch.nn.functional as F
class TripletLoss(nn.Module):
def __init__(self,margin = 0.2, sigma = 0.3):
super(TripletLoss,self).__init__()
self.margin = margin
self.sigma = sigma
def forward(self,f_anchor,f_positive, f_negative): # (-1,c)
... | 2.390625 | 2 |
nicos/services/daemon/auth/params.py | ebadkamil/nicos | 12 | 49354 | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | 1.679688 | 2 |
ircbot.py | ProgrammingAce/ircbot | 13 | 49355 | <gh_stars>10-100
#! /usr/bin/env python
import os
import ssl
import sys
import bs4
import time
import json
import socket
import urllib2
import requests
import threading
import subprocess
from rottentomatoes import RT
# Setup the IRC connection
irc = socket.socket()
irc = ssl.wrap_socket(irc)
# List of currently act... | 2.578125 | 3 |
cron_callback.py | orzechow/simple_time_tracker | 0 | 49356 | #!/usr/bin/python3
import time
import os
import subprocess
import argparse
# constants
DATE_FORMAT = "%Y-%m-%d %H:%M"
ALERT_STRING = "alerted"
LUNCH_BREAK_DURATION = 1
INFO_WORKING_DURATION = 7
INFO_MESSAGE = "Time to finish open todos"
ALERT_WORKING_DURATION = 8
ALERT_MESSAGE = "Time to go home :-)"
# parse comma... | 2.484375 | 2 |
auto_plot_curve.py | yuxuanwu17/m6A_reader | 3 | 49357 | import numpy as np
import tensorflow as tf
from sklearn.metrics import precision_recall_curve, roc_curve
from sklearn.metrics import average_precision_score, auc
from load_data import load_data
from model import build_model, compileModel, build_model_CNN
from numpy import interp
from itertools import cycle
import matpl... | 2.125 | 2 |
hpo/evals/conll18_eval.py | Dayitva/Parser-v3 | 93 | 49358 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import scripts.conll18_ud_eval as ud_eval
from scripts.reinsert_compounds import reinsert_compounds
def evaluate(gold_filename, sys_filename, metric):
""""""
reinsert_compounds(gold_filename, sys_filena... | 1.960938 | 2 |
Spider/supplement_movie.py | Giyn/DoubanMovieRecommendationSystem | 63 | 49359 | <filename>Spider/supplement_movie.py
# -*- coding: utf-8 -*-
"""
Created on Tue May 12 13:10:23 2020
@author: 许继元
"""
import random
import re
import time
import pandas as pd
import requests
from fake_useragent import UserAgent
from lxml import etree
ua = UserAgent()
def get_html(url):
"""
@功能: 获取页面
@参... | 2.984375 | 3 |
tests/test_doctest.py | allaudet/python-diskcache | 0 | 49360 | <filename>tests/test_doctest.py
import doctest
import shutil
import diskcache.core
import diskcache.djangocache
import diskcache.fanout
import diskcache.memo
import diskcache.persistent
def rmdir(directory):
try:
shutil.rmtree(directory)
except OSError:
pass
def test_core():
rmdir('/tmp... | 2.390625 | 2 |
model_analyzer.py | yigitozgumus/PolimiRecSys2018 | 0 | 49361 | <reponame>yigitozgumus/PolimiRecSys2018<filename>model_analyzer.py
from models.Slim_ElasticNet.SlimElasticNetRecommender import SLIMElasticNetRecommender
from data.PlaylistDataReader import PlaylistDataReader
from utils.logger import Logger
from utils.config import clear, Configurator
import argparse
from utils.Offline... | 1.742188 | 2 |
config/context_processors.py | fbsamples/cp_reference | 2 | 49362 | <reponame>fbsamples/cp_reference
# Copyright 2004-present, Facebook. All Rights Reserved.
from shop.models import Store, MerchantToStores
from django.conf import settings
def app_name(request):
return {"APP_NAME": settings.APP_NAME}
def allStoresContext(request):
stores_data = {}
if request.user.is_auth... | 2.171875 | 2 |
engine/project.py | thegrafico/annoying-app | 0 | 49363 | """
<NAME>
<EMAIL>
App to project managments the project of the CoRe Lab
"""
# TODO: improve task for users
from engine.task import Task
from typing import List
class Project:
tasks: List[Task]
workers: List[int]
project_id: int
def __init__(self, name: str, user_id: int, project_id: int, descript... | 3.3125 | 3 |
OverApp/migrations/0004_auto_20160617_1924.py | sheissage/overnightasiasg | 0 | 49364 | <filename>OverApp/migrations/0004_auto_20160617_1924.py<gh_stars>0
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-06-17 19:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('OverApp', '0003_hotelavail... | 1.40625 | 1 |
mendec/utils.py | biojet1/mendec | 0 | 49365 | <reponame>biojet1/mendec
"""
Copied from Python-RSA
"""
from binascii import hexlify
from struct import pack
from os import urandom
def bytes2int(raw_bytes):
return int(hexlify(raw_bytes), 16)
def byte_size(n):
if n == 0:
return 1
q, r = divmod(n.bit_length(), 8)
return (q + 1) if r else q
... | 3.09375 | 3 |
detect.py | nemero/py_neural | 0 | 49366 | <filename>detect.py<gh_stars>0
# coding: utf8
import numpy as np
from loadsample import *
np.set_printoptions(suppress=True)
def nonlin(x,deriv=False):
if(deriv==True):
return x*(1-x)
return 1/(1+np.exp(-x))
#load sinapse
syn0 = np.load('synapse/syn0.npy')
syn1 = np.load('synapse/syn1.npy')
X = np.arr... | 2.453125 | 2 |
code.py | PRITHVIRAJ1997/reconcile-a-report-using-pandas-2 | 0 | 49367 | # --------------
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# Code starts here
df=pd.read_csv(path)
df["state"]=df["state"].apply(lambda x: x.lower())
df['total']=df['Jan']+df['Feb']+df['Mar']
sum_var={col: df[col].sum() for col in df}
sum_row=pd.DataFrame(sum_var,ind... | 3.328125 | 3 |
scrubby/db/provider/null_provider.py | typerandom/scrubby | 2 | 49368 | from .provider import Provider
class NullProvider(Provider):
def connect(self):
pass
def close(self):
pass
def get_table_columns(self, table_name):
return []
def get_tables(self):
return []
def execute(self, query, **kwargs):
return None
def clear_ta... | 2.0625 | 2 |
xiuhong_ms_hbond_code/Stable-MCCE/bin/verify_ftpl.py | caixiuhong/Develop-MCCE | 0 | 49369 | <reponame>caixiuhong/Develop-MCCE
#!/usr/bin/env python
"""
This program verifies one ftpl file over the ligand pdb file, and writes out the mcce pdb file.
"""
import sys
from pymccelib import *
import logging
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO, format='%(levelname)-s: %(message)s'... | 2.546875 | 3 |
src/api/controllers/connection/CheckConnectionDatabaseResource.py | PythonDataIntegrator/pythondataintegrator | 14 | 49370 | from injector import inject
from domain.connection.CheckDatabaseConnection.CheckDatabaseConnectionCommand import CheckDatabaseConnectionCommand
from domain.connection.CheckDatabaseConnection.CheckDatabaseConnectionRequest import CheckDatabaseConnectionRequest
from infrastructure.api.ResourceBase import ResourceBase
fr... | 2.09375 | 2 |
Python/BasicDataTypes/finding_the_percentage.py | rho2/HackerRank | 0 | 49371 | <filename>Python/BasicDataTypes/finding_the_percentage.py
l = {}
for _ in range(int(input())):
s = input().split()
l[s[0]] = sum([float(a) for a in s[1:]])/(len(s)-1)
print('%.2f' % l[input()]) | 3.515625 | 4 |
pstd/pstd_using_numba.py | FRidh/pstd | 5 | 49372 | <filename>pstd/pstd_using_numba.py
"""
This module contains a Numba-accelerated implementation of the k-space PSTD method.
"""
import numba
from . import pstd
kappa = numba.jit(pstd.kappa)
# abs_exp = numba.jit(pstd.abs_exp)
pressure_abs_exp = numba.jit(pstd.pressure_abs_exp)
velocity_abs_exp = numba.jit(pstd.velocit... | 2.625 | 3 |
setup.py | joseppinilla/qca-tools | 1 | 49373 | <reponame>joseppinilla/qca-tools
#!/usr/bin/env python
from setuptools import setup
packages = ['qca_tools',
'qca_tools.composite']
install_requires = ['networkx>=2.0,<3.0',
'decorator>=4.1.0,<5.0.0',
'dimod>=0.6.8,<0.8.0']
setup(name='qca_tools',
version='0.0.1',
... | 1.078125 | 1 |
actionlib-1.11.13/test/simple_action_server_deadlock_companion.py | k-sawa/action_test_case2 | 17 | 49374 | #! /usr/bin/env python
#
# Copyright (c) 2013, <NAME>
# Imperial College London
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyr... | 1.765625 | 2 |
src/MusicTheory/ToneAccidentaler.py | ytyaru/Python.Audio.Chord.2017081743 | 0 | 49375 | #!python3.6
import math
import MusicTheory.NaturalTone
import MusicTheory.Accidental
#NaturalToneに変化記号+,-を付与した値や名前を返す
class ToneAccidentaler:
def __init__(self):
self.__NatulasTone = MusicTheory.NaturalTone.NaturalTone()
self.__Accidental = MusicTheory.Accidental.Accidental()
# tone: C+,B-のような形式... | 2.921875 | 3 |
app/views/api/Member.py | RedFalsh/flask-example | 1 | 49376 | <filename>app/views/api/Member.py
#!/usr/bin/env python
# encoding: utf-8
from app.views.api import route_api
from flask import request,jsonify,g,session
import json
from app import app,db
from app.common.libs.MemberService import MemberService, WXBizDataCrypt
from app.common.libs.Helper import getCurrentDate
from a... | 2.375 | 2 |
Main.py | nntropy/HonoursProject | 0 | 49377 | # this is the main method for my entire program.
import itertools
import math
import os
import sys
import numpy as np
import pandas as pd
import torch
import torch.utils.data
from Utility import feature_selection as fs
from Utility import ngram
from Utility.opcodeseq_creator import run_opcode_seq_creatio... | 2.59375 | 3 |
exportImage.py | daren-thomas/rps-sample-scripts | 27 | 49378 | <filename>exportImage.py
'''
exportImage.py
Export the currently visible view as a PNG image to a location specified by the
user.
'''
import clr
clr.AddReference('RevitAPI')
clr.AddReference('RevitAPIUI')
from Autodesk.Revit.DB import *
doc = __revit__.ActiveUIDocument.Document
# collect file location from user
clr... | 2.203125 | 2 |
binary_addition.py | khasanjonovich/basic_algorithm_implemintaions | 1 | 49379 | from base_expansion import base_expansion as be
def binary_addition(num1, num2):
"""Return binary addition"""
a = _helper(num1)
b = _helper(num2)
c = 0
res = []
length = len(a) if len(a) > len(b) else len(b)
for i in range(length-1):
d = (_get(a, i)+_get(b, i)+c)//2
elem =... | 3.765625 | 4 |
myapp/tasks/__init__.py | jollyshuai/cube-studio | 1 | 49380 | <filename>myapp/tasks/__init__.py
from . import schedules
from . import async_task | 1.132813 | 1 |
chroma/tools.py | youngsm/chroma | 7 | 49381 | <gh_stars>1-10
import numpy as np
import time
import datetime
import sys
import math
from chroma.transform import normalize
def count_nonzero(array):
'''Return the number of nonzero elements in this array'''
return int((array != 0).sum())
def filled_array(value, shape, dtype):
'''Create a numpy array of g... | 2.421875 | 2 |
src/qsiprep_analyses/tensors/__init__.py | GalBenZvi/qsiprep_analyses | 0 | 49382 | <reponame>GalBenZvi/qsiprep_analyses<gh_stars>0
"""
Tensor estimation module.
"""
| 0.839844 | 1 |
app/api/copytter/serializers.py | T-8723/copytter | 0 | 49383 | <filename>app/api/copytter/serializers.py
from rest_framework import serializers
from .models import Entry, Follow, Profile
from django.contrib.auth.models import User
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ('id', 'username')
class SelfProfileSeriali... | 2.21875 | 2 |
tests/test_proto_import.py | justin-richert/luckycharms | 0 | 49384 | """Test the logger extension module."""
# pylint: disable=protected-access,redefined-outer-name,unused-variable,invalid-name
import importlib
import json
import sys
import google
import pytest
from marshmallow import fields
from conftest import app
from luckycharms import base
from protobuffers import proto
def set... | 1.976563 | 2 |
run_vb.py | ManuelSzewc/bayes-4tops | 1 | 49385 | <reponame>ManuelSzewc/bayes-4tops
# here i take the data and run one gibbs sampling procedure
# inputs are: data_dir output_dir Number of events considered Number of saved samples Burnin Space between samples
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import poisson, norm,... | 1.914063 | 2 |
MLsource/SimpleClassificationModel/source_OLD.py | AIwaffle/AIwaffle | 2 | 49386 | <filename>MLsource/SimpleClassificationModel/source_OLD.py<gh_stars>1-10
import numpy as np # linear algebra
import torch
import torch.nn.functional as F
from enum import Enum
class SimpleClassificationModel():
def __init__(self, layerNum, layerSizes, learningRate = 0.1):
assert(len(layerSizes) == la... | 2.328125 | 2 |
src/actions_server/__init__.py | rzarajczyk/actions-server | 0 | 49387 | <reponame>rzarajczyk/actions-server
from .server import *
__all__ = [
'http_server',
'Response',
'Action',
'JsonGet',
'JsonPost',
'Redirect',
'StaticResources',
'ServerController'
]
| 1.382813 | 1 |
safe_control_gym/envs/env_wrappers/vectorized_env/subproc_vec_env.py | catgloss/safe-control-gym | 120 | 49388 | <reponame>catgloss/safe-control-gym
"""Subprocess vectorized environments.
See also:
* https://github.com/openai/baselines/blob/master/baselines/common/vec_env/subproc_vec_env.py
* https://github.com/DLR-RM/stable-baselines3/blob/master/stable_baselines3/common/vec_env/subproc_vec_env.py
"""
import copy
impor... | 2.375 | 2 |
nkicap/plotting.py | Bronte-Mckeown/nkicap | 1 | 49389 | <reponame>Bronte-Mckeown/nkicap<filename>nkicap/plotting.py<gh_stars>1-10
import matplotlib.colors as mcolor
from matplotlib import cm
from wordcloud import WordCloud
from .utils import get_project_path
FONT_PATH = str(get_project_path() / "data/Arimo-VariableFont_wght.ttf")
class CoefficientWordCloud(WordCloud):
... | 3.015625 | 3 |
where2.py | stakiran/where | 0 | 49390 | <reponame>stakiran/where<filename>where2.py
# -*- coding: utf-8 -*-
import os
import sys
def has_not_extension(path):
''' 拡張子の有無 = `.` の有無、だと思う(たぶん) '''
return path.find('.')==-1
PATH = os.environ['PATH'].split(';')
PATHEXT = os.environ['PATHEXT'].split(';')
if len(sys.argv)<=1:
print('<where2 コマンドのヘ... | 2.984375 | 3 |
src/lansweeper/assets.py | dan76296/LanSweeper | 0 | 49391 | <reponame>dan76296/LanSweeper
import collections
from selenium.webdriver.common.keys import Keys
from log import Log
from exceptions import Exceptions
class Assets:
Key = collections.namedtuple('Key', ['name', 'identifier', 'element_type'])
allowed_keys = {
'state': ('state', 'dropdown'),
'a... | 2.0625 | 2 |
my_pca.py | siddharthtelang/Face-and-Pose-Classification | 0 | 49392 | <reponame>siddharthtelang/Face-and-Pose-Classification
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
import numpy as np
def get_min_dimensions(flattened):
pca = PCA().fit(flattened)
# plt.figure()
# plt.title('PCA')
# plt.xlabel('Dimensions')
# plt.ylabel('Variance Retention... | 3.28125 | 3 |
modulemanager.py | Dante383/sicario | 8 | 49393 | #!/usr/bin/python
import sicario
import os
import importlib
class ModuleManager:
modules = []
modules_failed = []
def load_modules (self, directory="modules/"):
directories = os.listdir(directory)
modules = []
modules_failed = []
for module in directories:
if not os.path.isdir('modules/' + module):
... | 2.59375 | 3 |
qualitymeter/refactoring_opportunities/pullup_method_identification.py | hamidm21/QualityMeter | 0 | 49394 | <gh_stars>0
"""
The module identify pull-up method refactoring opportunities in Java projects
"""
# Todo: Implementing a decent pull-up method identification algorithm.
| 1.078125 | 1 |
tests/test_container_deps.py | hazbottles/flonb | 3 | 49395 | <gh_stars>1-10
import pytest
import flonb
def test_nested_list_deps():
@flonb.task_func()
def multiply(x, y):
return x * y
@flonb.task_func()
def collect(
container=flonb.Dep(
[[multiply.partial(x=x, y=y + 2) for x in range(3)] for y in range(2)]
)
):
... | 2.53125 | 3 |
submissions/valid-parentheses/solution.py | Wattyyy/LeetCode | 0 | 49396 | # https://leetcode.com/problems/valid-parentheses
from collections import deque
class Solution:
def isValid(self, s: str):
if not s:
return True
N = len(s)
st = deque([s[0]])
for i in range(1, N):
if not st:
st.append(s[i])
else:... | 3.53125 | 4 |
retailapp/webapp/app/products/products.py | kmsarabu/auroraglobaldb_eks | 0 | 49397 | <filename>retailapp/webapp/app/products/products.py<gh_stars>0
from flask import request, Flask , Blueprint , render_template, jsonify, request, abort ,redirect, url_for
import requests
from app.models import Product
products_bp = Blueprint("products_bp", __name__, template_folder="templates/products")
@products_bp.r... | 2.578125 | 3 |
AdminServer/appscale/admin/stop_services.py | loftwah/appscale | 790 | 49398 | <gh_stars>100-1000
""" Tries to stop all services until they are stopped. """
import argparse
import logging
import time
from appscale.common import service_helper
from appscale.common.constants import LOG_FORMAT
from appscale.common.retrying import retry
logger = logging.getLogger(__name__)
def start_service():
... | 2.671875 | 3 |
numpy-001-ndarray/numpy03.py | gemark/numpy-note | 0 | 49399 | import numpy as np
one_d_array = [0, 1, 2, 3, 4, 5]
two_d_array = [
[11, 12, 13, 14, 15],
[16, 17, 18, 19, 20],
[21, 22, 23, 24, 25],
[26, 27, 28 ,29, 30],
[31, 32, 33, 34, 35]
]
t = one_d_array[3]
# x: coord(index)
e = two_d_array[2][1]
# y x y:row x:column
arr = ... | 3.171875 | 3 |