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 |
|---|---|---|---|---|---|---|
main.py | hermanxcxr/ong_projects_recommender | 1 | 12789551 | from extraction import Extraction
from transform import Transform
from db_search import DbSearch
if __name__ == '__main__':
task = input('Buscar coincidencias de proyectos (y/n): ')
if task == 'y':
country = input('Country: ')
funding = input('Funding: ')
keywords = input('Keywords: '... | 2.875 | 3 |
tests/component/test_one_component.py | mwtoews/pymt | 38 | 12789552 | import os
from pytest import approx
from pymt.component.component import Component
from pymt.framework.services import del_component_instances
def test_no_events(with_no_components):
del_component_instances(["AirPort"])
comp = Component("AirPort", uses=[], provides=[], events=[])
comp.go()
assert c... | 2.125 | 2 |
gdc_filtration_tools/tools/create_oxog_intervals.py | MarcSaric/variant-filtration-tool | 0 | 12789553 | """Takes an input VCF file and convert it to an interval list
for use by Broad oxog metrics tool. This assumes that the
input VCF only contains SNPs.
@author: <NAME> <<EMAIL>>
"""
import pysam
from gdc_filtration_tools.logger import Logger
def create_oxog_intervals(input_vcf: str, output_file: str) -> None:
"""... | 3.078125 | 3 |
nobos_torch_lib/configs/training_configs/training_config_base.py | noboevbo/nobos_torch_lib | 2 | 12789554 | <reponame>noboevbo/nobos_torch_lib<gh_stars>1-10
import os
from nobos_commons.utils.file_helper import get_create_path
from nobos_torch_lib.learning_rate_schedulers.learning_rate_scheduler_base import LearningRateSchedulerBase
from nobos_torch_lib.learning_rate_schedulers.learning_rate_scheduler_dummy import Learning... | 2.109375 | 2 |
app/library/technologies/bundle.py | imamsolikhin/Python | 0 | 12789555 | # -*- coding: utf-8 -*-
"""The Bundle module defines a few Ethernet specific network element classes: BundleInterface"""
# local modules
import pynt.elements
import pynt.layers
import pynt.xmlns
# ns and layers variables and GetCreateWellKnownAdaptationFunction() functions are always present in the pynt.technologies... | 2.6875 | 3 |
examples/on_improvement.py | roshanrahman/miraiml | 0 | 12789556 | <filename>examples/on_improvement.py
from time import sleep
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import GaussianNB
from sklearn.metrics import roc_auc_score
from miraiml import HyperSearchSpace, Config, Engine
# Let's use a single Naive Bayes classifier fo... | 3.140625 | 3 |
includes/remote.py | b1scuit-thi3f/jimiPlugin-remote | 3 | 12789557 | <reponame>b1scuit-thi3f/jimiPlugin-remote
class remote():
def command(self, command, args=[], elevate=False, runAs=None, timeout=None):
self.error = "Not implimented"
return (-2555, "Not implimented", "Not implimented")
def reboot(self,timeout):
# Not implimented yet!
self.erro... | 2.328125 | 2 |
tools/test_gan_ui.py | ChenFengYe/relightable-nr | 0 | 12789558 | <gh_stars>0
from flask import Flask
from flask import request, jsonify
from flask import send_file
from io import BytesIO
from PIL import Image
from test_gan import build_model
import numpy as np
import json
import torch
import cv2
import math
import time
class Args():
def __init__(self, cfg, opts):
sel... | 2.015625 | 2 |
proteinsolver/utils/protein_design.py | ostrokach/proteinsolver | 27 | 12789559 | import heapq
from dataclasses import dataclass, field
from typing import Any, Optional, Tuple
import torch
import torch.nn as nn
from torch_geometric.data import Data
def get_node_proba(net, x, edge_index, edge_attr, num_categories=20):
raise Exception("Use get_node_outputs instead!")
def get_node_value(net, x... | 2.546875 | 3 |
fastmri_recon/evaluate/scripts/dealiasing_eval.py | samiulshuvo/fastmri-reproducible-benchmark | 105 | 12789560 | <gh_stars>100-1000
import os
from tqdm import tqdm
from fastmri_recon.config import *
from fastmri_recon.data.datasets.fastmri_pyfunc import train_masked_kspace_dataset_from_indexable as singlecoil_dataset
from fastmri_recon.evaluate.metrics.np_metrics import METRIC_FUNCS, Metrics
from fastmri_recon.models.subclassed... | 1.75 | 2 |
test.py | JackWetherell/self-driving-car-behavioral-cloning | 0 | 12789561 | import pickle
import numpy as np
import sklearn as skl
import tensorflow as tf
import matplotlib.pyplot as plt
# Set up GPU
gpus = tf.config.experimental.list_physical_devices('GPU')
if gpus:
try:
for gpu in gpus:
tf.config.experimental.set_memory_growth(gpu, True)
except RuntimeError as e... | 2.53125 | 3 |
ee/clickhouse/queries/funnels/test/test_funnel_correlation_persons.py | csmatar/posthog | 0 | 12789562 | from uuid import uuid4
from ee.clickhouse.models.event import create_event
from ee.clickhouse.queries.funnels.funnel_correlation_persons import FunnelCorrelationPersons
from ee.clickhouse.util import ClickhouseTestMixin
from posthog.constants import INSIGHT_FUNNELS
from posthog.models import Cohort, Filter
from postho... | 2.171875 | 2 |
run.py | AnthraxisBR/kibana-index-alert-tool | 0 | 12789563 | """
Start the application
"""
import os
import getpass
from kibana_index_alert_tool import main
from dotenv import load_dotenv
home = os.path.expanduser("~")
load_dotenv(f'/{home}/.kibana_index_alert_tool')
if __name__ == '__main__':
main()
| 1.351563 | 1 |
transforms_deprecated/randomerasing.py | edificewang/imageclassification | 2 | 12789564 | import math
import random
import numpy as np
class RandomErasing_Tensor(object):
""" Randomly selects a rectangle region in an image and erases its pixels.
'Random Erasing Data Augmentation' by Zhong et al.
See https://arxiv.org/pdf/1708.04896.pdf
Args:
probability: The probability th... | 3.6875 | 4 |
setup.py | Xysss7/data_visualisation_project | 0 | 12789565 | from setuptools import setup
setup(
name="datavisualization",
version="1.2.0",
author="<NAME>",
packages=['datavisualization'],
install_requires=['matplotlib','IPython']
)
| 1.039063 | 1 |
python/12_Auto_ML_AML_Compute.py | rdmueller/TensorFlow101 | 13 | 12789566 | <gh_stars>10-100
import logging
import os
import shutil
import random
from matplotlib import pyplot as plt
from matplotlib.pyplot import imshow
import numpy as np
import pandas as pd
from sklearn import datasets
import azureml.core
from azureml.core.experiment import Experiment
from azureml.core.workspace import Wor... | 2.4375 | 2 |
recipes/opencolorio/all/conanfile.py | rockandsalt/conan-center-index | 562 | 12789567 | from conans import ConanFile, CMake, tools
import os
required_conan_version = ">=1.33.0"
class OpenColorIOConan(ConanFile):
name = "opencolorio"
description = "A color management framework for visual effects and animation."
license = "BSD-3-Clause"
homepage = "https://opencolorio.org/"
url = "htt... | 1.984375 | 2 |
trabajos/utilidades.py | jmjacquet/IronWeb | 0 | 12789568 | # -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from django.contrib import messages
from django.conf import settings
from django.contrib.messages import constants as message_constants
from django.forms import Widget
from django.utils.safestring import mark_safe
from .models import *
import json
from de... | 1.5625 | 2 |
code/results/02_fig_01.py | data-intelligence-for-health-lab/delirium_prediction | 0 | 12789569 | <gh_stars>0
# --- loading libraries -------------------------------------------------------
import pandas as pd
import numpy as np
import datetime
# ------------------------------------------------------- loading libraries ---
# --- main routine ------------------------------------------------------------
# Opening... | 2.953125 | 3 |
roblox/utilities/url.py | Warhawk947/ro.py | 1 | 12789570 | """
This module contains functions and objects used internally by ro.py to generate URLs.
"""
root_site = "roblox.com"
cdn_site = "rbxcdn.com"
class URLGenerator:
"""
Generates URLs based on a chosen base URL.
Attributes:
base_url: The base URL
"""
def __init__(self, base_url: str):
... | 3.578125 | 4 |
python/lib/lib_care/measure/get_tips_local.py | timtyree/bgmc | 0 | 12789571 | from ..my_initialization import *
# @njit
def compute_all_spiral_tips(img,dimgdt,level1,level2,width=200,height=200):
#compute all spiral tips present
retval = find_intersections(img,dimgdt,level1,level2,theta_threshold=theta_threshold)
# level2=V_threshold
# retval = find_intersections(img1,img2,level... | 2.375 | 2 |
app.py | muarachmann/cgsbot | 4 | 12789572 | <filename>app.py<gh_stars>1-10
from flask import Flask, request, make_response
from slackclient import SlackClient
import json
import os
app = Flask(__name__)
slack_token = os.environ['SLACK_API_TOKEN']
sc = SlackClient(slack_token)
general_channel = "C93RP3CSG"
introductions_channel = "CFQV2533L"
@app.route('/', ... | 3.3125 | 3 |
ngboost/api.py | wakamezake/ngboost | 0 | 12789573 | <filename>ngboost/api.py
import numpy as np
from ngboost.ngboost import NGBoost
from ngboost.distns import Bernoulli, Normal, LogNormal
from ngboost.scores import MLE
from ngboost.learners import default_tree_learner
from sklearn.base import BaseEstimator
class NGBRegressor(NGBoost, BaseEstimator):
def __init__(... | 2.828125 | 3 |
xml.py | KirillDmit/xmljson | 0 | 12789574 | import xml.etree.ElementTree as ET
from urllib.request import urlopen
import json
data = urlopen('https://lenta.ru/rss').read().decode('utf8')
root = ET.fromstring(data)
items = root.find('channel').findall('item')
result = []
for item in items:
for tag in ['pubDate', 'title']:
result.append({tag: item.fin... | 2.78125 | 3 |
python/pythonstartup.py | andrewpsp/dotfiles | 249 | 12789575 | def _init():
import atexit
import os
import sys
try:
import readline
except Exception:
readline = None
import types
import time
import uuid
import json
import pprint
import hashlib
import subprocess
import datetime
try:
import __builtin__
... | 2.125 | 2 |
tests/test_set.py | mike0sv/pyjackson | 20 | 12789576 | <gh_stars>10-100
from typing import Set
from pyjackson import serialize
from pyjackson.core import Comparable
from pyjackson.decorators import make_string
from tests.conftest import serde_and_compare
@make_string
class AClass(Comparable):
def __init__(self, value: str):
self.value = value
def __hash... | 2.828125 | 3 |
chad_finance/api/urls.py | StfnC/chad-finance | 0 | 12789577 | from django.urls import path
from .views import *
urlpatterns = [
# Portfolio urls
path('portfolio/', PortfolioAPIView.as_view()),
path('portfolio/data/', PortfolioChartDataView.as_view()),
# Trade urls
path('trade/<int:pk>/', TradeRetrieveAPIView.as_view()),
path('trade/', TradeCreateAPIView.... | 1.796875 | 2 |
settings.py | joeltg/nsfw | 1 | 12789578 | <filename>settings.py
# Set this to the path to Caffe installation on your system
caffe_root = "/usr/local/caffe/python"
gpu = False
# -------------------------------------
# These settings should work by default
# DNN being visualized
# These two settings are default, and can be overriden in the act_max.py
net_weight... | 1.890625 | 2 |
SOSS/trace/calibrate_tracepol.py | njcuk9999/jwst-mtl | 1 | 12789579 | <reponame>njcuk9999/jwst-mtl<gh_stars>1-10
import numpy as np
from astropy.io import fits
import matplotlib.pylab as plt
from scipy import interpolate
from scipy.optimize import least_squares
import sys
sys.path.insert(0, '/genesis/jwst/github/jwst-mtl/')
import SOSS.trace.tracepol as tp
from SOSS.dms.soss_centroids ... | 2.09375 | 2 |
homework/pre-course assignment/fibonacci_with_array.py | coderica/effective_cpp | 0 | 12789580 | <gh_stars>0
### Libraries
import sys
import math
### Function Definition
def version_response(str):
if sys.version_info[0] > 2: #check python version
response = input(str)
else:
response = raw_input(str)
return(response)
def get_user_input():
start_num, seq_size = '', ''
while not a.isdigit() or not 1 <= i... | 3.921875 | 4 |
planning_system/cli/__init__.py | jehboyes/planning_system | 0 | 12789581 | <filename>planning_system/cli/__init__.py
import sys
import os
from importlib import import_module as imp
import click
import planning_system
import sqlalchemy.ext.declarative # for pyinstaller's benefit
import sqlalchemy.ext.automap # for pyinstaller's benefit
import office365.runtime.auth.user_credential # for pyin... | 2.234375 | 2 |
engine/admin.py | x-risk/x-risk | 5 | 12789582 | <filename>engine/admin.py
from django.contrib import admin
from .models import Topic, Source, SearchString, Search, Publication, Assessment, Profile, AssessmentStatus, HumanPrediction, MLModel, MLPrediction, Log
admin.site.register(Topic)
admin.site.register(Source)
admin.site.register(SearchString)
admin.site.registe... | 1.492188 | 1 |
modules/ceo/docker/src/ceo/ceo/api/record.py | BuddyVolly/sepal | 0 | 12789583 | import os, logging, json, datetime
from flask import session, request, redirect, url_for, jsonify, render_template, send_file, abort
from flask_cors import cross_origin
from .. import app
from .. import mongo
from ..common.utils import import_sepal_auth, requires_auth, generate_id
from ..common.fusiontables import s... | 2.03125 | 2 |
shortner/models.py | shivagangula/shortme | 0 | 12789584 | from django.db import models
# from django.contrib.auth.models import User
from django.urls import reverse
class UrlDetailes(models.Model):
"""
# user field for authanticate
user = models.OneToOneField(User)
# click_n_time means number of times link clicked
click_n_time = models.IntegerField... | 2.375 | 2 |
scripts/unpivot.py | TshepisoMokoena/covid19africa | 51 | 12789585 | <gh_stars>10-100
import sys
import os
import pandas as pd
import re
import argparse
from utils import *
def parse_args():
cmd_parser = argparse.ArgumentParser()
cmd_parser.add_argument("-i", "--input_path", default="img/",
help="path to the image file to parse data from")
cmd_... | 2.890625 | 3 |
src/69.py | cloudzfy/euler | 12 | 12789586 | # Euler's Totient function, phi(n) [sometimes called the phi function],
# is used to determine the number of numbers less than n which are
# relatively prime to n. For example, as 1, 2, 4, 5, 7, and 8, are all
# less than nine and relatively prime to nine, phi(9) = 6.
# n Relatively Prime phi(n) n/phi(n)
#... | 3.96875 | 4 |
tests/utils/test_devices.py | jcao1022/tiflash | 1 | 12789587 | import os
import pytest
from tiflash.utils import devices
class TestDevices():
def test_get_devices_directory(self, t_env):
expected = os.path.normpath(t_env['CCS_PATH'] +
'/ccs_base/common/targetdb/devices')
result = devices.get_devices_directory(t_env['CCS_P... | 2.140625 | 2 |
Petstagram/main/validators/image_size_validator.py | Pavel-Petkov03/Petstagram | 1 | 12789588 | <reponame>Pavel-Petkov03/Petstagram<filename>Petstagram/main/validators/image_size_validator.py
from django.core.exceptions import ValidationError
from django.utils.deconstruct import deconstructible
@deconstructible
class ValidateImage:
def __init__(self, file):
self.file = file
def __call_... | 2.390625 | 2 |
client/xbee-client.py | ddaza/iothax | 0 | 12789589 | import serial
class Client:
serial_connection = serial.Serial(port="/dev/ttyUSB0", timeout=None)
def run(self):
while True:
try:
reading = self.serial_connection.read()
if reading == "":
continue
print "THIS> " + reading... | 2.75 | 3 |
py/legacyanalysis/talk-plots.py | manera/legacypipe | 32 | 12789590 | <filename>py/legacyanalysis/talk-plots.py
import matplotlib
matplotlib.use('Agg')
import pylab as plt
#from astrometry.util.fits import *
from legacypipe.runbrick import *
from legacypipe.runbrick_plots import *
from legacypipe.runbrick import _coadds, _get_mod
from astrometry.util.stages import *
from astrometry.ut... | 1.929688 | 2 |
listing_22-6.py | PrinceChou/Play-Python-with-Alisa | 0 | 12789591 | <filename>listing_22-6.py
# Listing_22-6.py
# Copyright Warren & <NAME>, 2013
# Released under MIT license http://www.opensource.org/licenses/mit-license.php
# Version $version ----------------------------
# Using pickle to store a list to a file
import pickle
my_list = ['Fred', 73, 'Hello there', 81.9876e-13]
pi... | 3.546875 | 4 |
tools/cfn-resource-list.py | PatMyron/aws-cfn-resource-specs | 25 | 12789592 | import json
from gzip import GzipFile
import os
from datetime import date
from pathlib import Path
from distutils.version import StrictVersion
# Third-Party modules
import requests
import git
from github import Github
from packaging import version
from boto3 import client, resource
def resource_spec_versions(cfn_res... | 2.3125 | 2 |
dicetables/tools/alias_table.py | eric-s-s/share-with-z | 5 | 12789593 | from collections import namedtuple
Alias = namedtuple('Alias', ['primary', 'alternate', 'primary_height'])
class AliasTable(object):
"""
here is
`a nice explanation of alias tables: <http://www.keithschwarz.com/darts-dice-coins/>`_
`Vose's algorithm <https://web.archive.org/web/20131029203736/http:... | 3.84375 | 4 |
gen2.py | shubham303/SynthText | 0 | 12789594 | # Author: <NAME>
# Date: 2015
"""
Entry-point for generating synthetic text images, as described in:
@InProceedings{Gupta16,
author = "<NAME>. and <NAME>. and <NAME>.",
title = "Synthetic Data for Text Localisation in Natural Images",
booktitle = "IEEE Conference on Computer Vision a... | 2.53125 | 3 |
gp_mpc/model_class.py | DiegoAE/GP-MPC | 93 | 12789595 | <reponame>DiegoAE/GP-MPC<gh_stars>10-100
# -*- coding: utf-8 -*-
"""
Dynamic System Model
Copyright (c) 2018, <NAME>
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pyDOE
import numpy as np
import casadi as ca
import scipy.linalg
import matplotl... | 2.453125 | 2 |
tests/core/middleware/test_request_param_normalizer.py | y19818/web3.py | 0 | 12789596 | <gh_stars>0
import pytest
from web3 import Web3
from web3.middleware import ( # noqa: F401
construct_result_generator_middleware,
request_parameter_normalizer,
)
from web3.providers.base import (
BaseProvider,
)
@pytest.fixture
def w3_base():
return Web3(provider=BaseProvider(), middle... | 1.773438 | 2 |
Information Security/Information Security Projects/Port Scanner/port_scanner.py | Fradxyz/FCCProjects | 0 | 12789597 | from common_ports import ports_and_services
import socket, re
def get_open_ports(target, port_range, verbose=None):
open_ports = []
ports = range(port_range[0], port_range[1] + 1)
try:
host = socket.gethostbyname(target)
except:
if re.search('[a-zA-Z]', target):
return 'Er... | 2.890625 | 3 |
Exercise_14_PassowrdGenerator.py | lukas9557/learning_python | 2 | 12789598 | <filename>Exercise_14_PassowrdGenerator.py
#Strong password generator
lowercaseLetters = list()
uppercaseLetters = list()
numbers = list()
special = list()
all = list()
output = str()
import string
lowercaseLetters = list(string.ascii_lowercase)
uppercaseLetters = list(string.ascii_uppercase)
numbers = ["0"... | 4 | 4 |
tests/test_inferences.py | Edwardp17/causalimpact-1 | 0 | 12789599 | <filename>tests/test_inferences.py
# MIT License
#
# Copyright (c) 2018 Dafiti OpenSource
#
# 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 t... | 1.679688 | 2 |
demos/datasource_csv.py | weldermarcosxd/agatereports | 1 | 12789600 | <reponame>weldermarcosxd/agatereports
# from agatereports.adapters.CSVAdapter import CSVAdapter
from agatereports.basic_report import BasicReport
import logging
logger = logging.getLogger(__name__)
def datasource_csv_sample(jrxml_filename='./jrxml/datasource_csv.jrxml', output_filename='./output/datasource_csv.pdf')... | 2.5625 | 3 |
utils/table-rotation.py | vuminhduc97/TableDetect | 13 | 12789601 | <gh_stars>10-100
# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# Name: table-rotation.py
# Author: wdf
# Date: 2019/7/7
# IDE: PyCharm
# Description:
# 1. HoughLines ——> get the rotation angle
# 2. warpAffine ——> affine(r... | 2.78125 | 3 |
tests/primers_test.py | martinghunt/viridian_workflow | 8 | 12789602 | import os
import pytest
from intervaltree import Interval
from viridian_workflow import primers
this_dir = os.path.dirname(os.path.abspath(__file__))
data_dir = os.path.join(this_dir, "data", "primers")
def test_AmpliconSet_from_json():
with pytest.raises(NotImplementedError):
primers.AmpliconSet.from_j... | 2.21875 | 2 |
leetcode/0525 Duplicate Zeros.py | jaredliw/python-question-bank | 1 | 12789603 | class Solution(object):
def duplicateZeros(self, arr):
"""
:type arr: List[int]
:rtype: None Do not return anything, modify arr in-place instead.
"""
# Runtime: 1116 ms
# Memory: 13.8 MB
idx = 0
while idx < len(arr):
if arr[idx] == 0:
... | 3.453125 | 3 |
django_side/core/urls.py | tyronedamasceno/flask-vs-django-api | 0 | 12789604 | <filename>django_side/core/urls.py<gh_stars>0
from django.urls import path, include
from rest_framework import routers
from core import views
router = routers.DefaultRouter()
router.register('user_register', views.UserViewSet, base_name='user_register')
router.register('user', views.ProtectedUserViewSet, base_name='... | 1.84375 | 2 |
redpanda/template/entitytemplate.py | fueler/redpanda | 0 | 12789605 |
class EntityTemplate():
def __init__(self) -> None:
self._name: str = ''
self._spritesheet: str = ''
self._width: int = 0
self._height: int = 0
def __repr__(self) -> str:
return f'{self._name}: sprite:{self._spritesheet}'
@property
def name(self) -> str:
... | 2.875 | 3 |
test/test_common.py | FPEPOSHI/PyBoof | 36 | 12789606 | <reponame>FPEPOSHI/PyBoof
#!/usr/bin/env python3
import unittest
from pyboof import gateway
import pyboof as pb
import numpy as np
pb.init_memmap()
class JavaData(unittest.TestCase):
def test_is_java_class(self):
array_class = gateway.jvm.java.util.ArrayList().getClass()
vector_class = gateway.... | 2.234375 | 2 |
dakara_server/users/fields.py | DakaraProject/dakara-server | 4 | 12789607 | from django.db import models
class CaseInsensitiveFieldMixin:
"""Field mixin that uses case-insensitive lookup alternatives if they exist.
See: https://concisecoder.io/2018/10/27/case-insensitive-fields-in-django-models/
"""
LOOKUP_CONVERSIONS = {
"exact": "iexact",
"contains": "icon... | 2.46875 | 2 |
app/books/migrations/0010_auto_20200317_0846.py | kaantecik/yazlab2_p_1 | 0 | 12789608 | # Generated by Django 3.0.4 on 2020-03-17 08:46
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('books', '0009_auto_20200315_2015'),
]
operations = [
migrations.AddField(
model_name='book',
name='i... | 1.617188 | 2 |
intervals.py | uaraven/paperclock | 1 | 12789609 | import threading
class repeating:
def __init__(self, interval_calculator):
self.interval = interval_calculator
def __call__(self, func):
def wrapped(*args):
func(*args)
sleep_for = self.interval()
threading.Timer(sleep_for, lambda: wrapped(*args)).start()
... | 3.28125 | 3 |
interview/leet/399_Evaluate_Division_v2.py | eroicaleo/LearningPython | 1 | 12789610 | #!/usr/bin/env python
class Solution:
def calcEquation(self, equations, values, queries):
graph, ret = {}, []
for st, v in zip(equations, values):
s, t = st
graph.setdefault(s, []).append((t, v))
graph.setdefault(t, []).append((s, 1.0/v))
def dfs(s, q):
... | 3.359375 | 3 |
source/GA/genetic_pipeline.py | JessikaSmith/AutomatedTrainTestSplit | 0 | 12789611 | <gh_stars>0
from data import *
from source.GA import Selector, Mutation, Crossover
from vis_tools import *
from model import QRNN_model
import logging
import numpy as np
import operator
import pandas as pd
dataset = pd.read_csv('/data/GAforAutomatedTrainTestSplit/data/dataset/dataset.csv')
verification = pd.read_csv... | 2.34375 | 2 |
niddk_covid_sicr/stats.py | cannin/covid-sicr-test | 0 | 12789612 | """Compute stats on the results."""
import arviz as az
from datetime import datetime
import numpy as np
import pandas as pd
from pathlib import Path
from pystan.misc import _summary
from scipy.stats import nbinom
from tqdm.auto import tqdm
from warnings import warn
from .io import extract_samples
def get_rhat(fit) ... | 2.765625 | 3 |
setup.py | biobakery/docent | 0 | 12789613 | <reponame>biobakery/docent
from setuptools import setup, find_packages
setup(
name='docent',
version='0.0.1',
description=("Install python scripts into a virtualenv, "
"then expose them outside of the virtualenv"),
zip_safe=False,
classifiers=[
"Development Status :: 1 - Pr... | 1.398438 | 1 |
Sampling/api.py | tpsatish95/Youtube-Comedy-Comparison | 5 | 12789614 | import urllib.request
import urllib
import re
import time
import xml
from xml.dom import minidom
import csv
f = open('comedy_comparisons.testtamp')
csv_f = csv.reader(f)
f1= open("funny.txt","w")
f2= open("notfunny.txt","w")
f1d= open("funnyd.txt","w")
f2d= open("notfunnyd.txt","w")
for row in csv_f:... | 2.8125 | 3 |
visualize_alpha_evolution.py | sjoshi804/neural-architecture-search-project | 2 | 12789615 | <filename>visualize_alpha_evolution.py
# External Imports
from copy import deepcopy
from os import write
import sys
# Internal Imports
from util import create_alpha_history_object, load_alpha,print_alpha, update_alpha_history, write_alpha_history_to_csvs
alpha_dir_path = sys.argv[1]
num_epochs = int(sys.argv[2])
# L... | 2.625 | 3 |
qcdb/tests/nwchem_tests/test_hess_h2o.py | loriab/qccddb | 8 | 12789616 | import os
import sys
import numpy as np
import qcdb
from ..utils import *
@using("nwchem")
def test_grad():
h2o = qcdb.set_molecule(
"""
O 0.00000000 0.00000000 0.00000000
H 0.00000000 1.93042809 -1.10715266
H 0.00000000 -1.93042809 -1.10715266
... | 2.15625 | 2 |
mixly_arduino/sample/mixpy/海龟画图/py/海龟画图04盛开的向日葵_01太阳公公.py | wecake/Mixly_Arduino | 118 | 12789617 | import turtle
tina= turtle.Turtle()
tina.pencolor("#ffcc33")
tina.fillcolor("#ffcc33")
tina.pensize(5)
tina.begin_fill()
tina.circle (80,360)
tina.end_fill()
tina.penup()
tina.goto(-40,100)
tina.pendown()
tina.pencolor("#000000")
tina.setheading(30)
tina.circle ((-30),60)
tina.penup()
tina.goto(20,100)
tina.pendown()
... | 3.5625 | 4 |
config/config.py | Morgan-Gan/2D-3D-SLowFast-TSM--Proj | 0 | 12789618 | <reponame>Morgan-Gan/2D-3D-SLowFast-TSM--Proj
import ast
from typing import Tuple, List
from roi.pooler_ import Pooler
class Config(object):
ANCHOR_RATIOS = [(1, 2), (1, 1), (2, 1)]
#ANCHOR_SIZES = [128, 256, 512]
ANCHOR_SIZES = [64, 128]
POOLER_MODE = Pooler.Mode.POOLING
BACKBONE_NAME='tsm' #sl... | 1.953125 | 2 |
contrib/example_plugins/mycomp/src/mycomp/mycomp.py | mjfwest/OpenMDAO-Framework | 69 | 12789619 | <filename>contrib/example_plugins/mycomp/src/mycomp/mycomp.py
from openmdao.main.api import Component
from openmdao.main.datatypes.api import Float
# Make sure that your class has some kind of docstring. Otherwise
# the descriptions for your variables won't show up in the
# source documentation.
class MyComponent(C... | 2.390625 | 2 |
ifthen/statements/thens/0001.py | tinyx/yitao.io | 0 | 12789620 | def execute(operating_player, opponent_player):
operating_player.attack = operating_player.attack + 5
| 1.726563 | 2 |
release/stubs.min/Wms/RemotingImplementation/Batches/__init__.py | tranconbv/ironpython-stubs | 0 | 12789621 | # encoding: utf-8
# module Wms.RemotingImplementation.Batches calls itself Batches
# from Wms.RemotingImplementation,Version=1.23.1.0,Culture=neutral,PublicKeyToken=null
# by generator 1.145
# no doc
# no important
from System.Collections.Generic import *
from ..__init__ import *
# no functions
# classes
... | 2.046875 | 2 |
rulr/Nodes/Item/Camera.py | elliotwoods/Rulr-2.0 | 6 | 12789622 | import rulr.Nodes
import rulr.Components.RigidBody
import rulr.Components.View
class Node(rulr.Nodes.Base):
def __init__(self):
super().__init__()
self.components.rigidBody = rulr.Components.RigidBody.Component()
self.components.view = rulr.Components.View.Component(self.components.rigidBody) | 2.140625 | 2 |
server/commands/__init__.py | griseduardo/Facial-Recognition-Database-Management-System | 6 | 12789623 | from .build import cli as build_cli
from .data import cli as data_cli
from .dev import cli as dev_cli
| 1.148438 | 1 |
run.py | yamamo-i/attendance-slack | 0 | 12789624 | <filename>run.py
from slackbot.bot import Bot
import logging
def main():
bot = Bot()
bot.run()
if __name__ == "__main__":
# TODO: configのクラスを作って最初にコールできるようにする
logging.basicConfig(format='%(asctime)s [%(levelname)s]: %(message)s', level=logging.INFO)
logging.info("starting....")
main()
| 2.5 | 2 |
test/test.py | is9117/mp | 0 | 12789625 | <gh_stars>0
import sys
import time
import logging
sys.path.append(".")
import mp
logging.basicConfig(format="%(asctime)s %(levelname)s [%(process)d:%(module)s:%(funcName)s] %(message)s", level=logging.DEBUG)
class Task:
def task(self, *args):
logging.info(args)
mp.start()
worker = mp.new_worker("te... | 2.234375 | 2 |
PokerRL/cfr/VRCFR.py | MAWUT0R/PokerRL | 1 | 12789626 | <reponame>MAWUT0R/PokerRL
# Copyright (c) 2019 <NAME>
import numpy as np
import sys
from PokerRL.cfr._MCCFRBase import MCCFRBase as _VRCFRBase
class VRCFR(_VRCFRBase):
def __init__(self,
name,
chief_handle,
game_cls,
agent_bet_set,
... | 2 | 2 |
config.py | SViN24/smlinux | 1 | 12789627 | # for file mangement and exiting
import os
import sys
# Qt imports
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QMainWindow
from PyQt5.QtWidgets import QWidget
from PyQt5.QtWidgets import QVBoxLayout, QHBoxLayout, QGridLayout
from PyQt5.QtWidgets import QLabel
from P... | 2.953125 | 3 |
garagepi/framework/usecase/__init__.py | constructorfleet/GaragePi-Assistant | 0 | 12789628 | <reponame>constructorfleet/GaragePi-Assistant<gh_stars>0
"""Use case frameworks."""
from garagepi.framework.usecase.UseCase import UseCase
from garagepi.framework.usecase.CommandUseCase import CommandUseCase | 0.78125 | 1 |
Utilities/Dox/PythonScripts/ICRParserTest.py | rjwinchester/VistA | 72 | 12789629 | # ---------------------------------------------------------------------------
# Copyright 2018 The Open Source Electronic Health Record Alliance
#
# 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 a... | 1.429688 | 1 |
web_shortcuts/bs4.pyw | aburakayaz/automating-the-boring-stuff | 1 | 12789630 | import webbrowser
webbrowser.open('https://www.crummy.com/software/BeautifulSoup/bs4/doc/')
| 2.03125 | 2 |
wrappers/python/virgil_crypto_lib/foundation/key_material_rng.py | odidev/virgil-crypto-c | 26 | 12789631 | <filename>wrappers/python/virgil_crypto_lib/foundation/key_material_rng.py
# Copyright (C) 2015-2021 Virgil Security, Inc.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# (1) Redistrib... | 1.445313 | 1 |
usage_test_unit.py | budhiraja/Test-Unit | 0 | 12789632 | from test_unit_module import test_unit
class Usage(test_unit):
def __init__(self):
pass
def test_case_0(self):
"""
Example of a passing test case.
"""
actual = 8 # 3+5
expected = 8
self.assert_op(actual,expected,0) # Actual result, Expected result, test case id or identifier(not optional), HINT (Optio... | 3.640625 | 4 |
cron_rdahmm_unavco.py | GeoGateway/PythonRDAHMM | 0 | 12789633 | #!/usr/local/bin/python
#==========================================================================
# Ingest, and execute rdahmm evaluation for unavco datasets
# Set up a cron job to run nightly
#
# usage: cron_rdahmm_unavco.py
#
#===========================================================================
import os, s... | 2.296875 | 2 |
src/cycle.py | haslersn/crow-cycle | 0 | 12789634 | <reponame>haslersn/crow-cycle
#!/usr/bin/env python3
import argparse
import random
import csv
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('names',
type=argparse.FileType('r'),
help='Path to a file containing names for creating a ci... | 4.125 | 4 |
dynapython/client.py | Dynactionize/Dyna-Python | 0 | 12789635 | import grpc
import csv
#from tables import Table
from enum import IntEnum
from dynagatewaytypes import datatypes_pb2
from dynagatewaytypes import enums_pb2
from dynagatewaytypes import general_types_pb2
from dynagatewaytypes import authentication_pb2_grpc
from dynagatewaytypes import authentication_pb2
from dynagate... | 2.234375 | 2 |
run_main.py | zhjpqq/scaledensenet | 5 | 12789636 | <filename>run_main.py
# -*- coding: utf-8 -*-
__author__ = 'ooo'
__date__ = '2018/12/15 12:17'
import os
import time
import random
import warnings
import argparse
import torch
import torch.backends.cudnn as cudnn
from config.configure import Config
from train_val_test import run_main_by_cfgs
# How To Use #########@##... | 2.34375 | 2 |
tests/test_auth.py | taylordeatri/phc-sdk-py | 1 | 12789637 | <reponame>taylordeatri/phc-sdk-py
from phc.easy.auth import Auth, _shared_auth
def test_basic_use():
auth = Auth(
{
"token": "<PASSWORD>",
"account": "my-account",
"project_id": "my-project-id",
}
)
assert auth.account == "my-account"
def test_updatin... | 2.515625 | 3 |
Leetcode/Python Solutions/Arrays/MinimumDominoRotationsForEqualRow.py | Mostofa-Najmus-Sakib/Applied-Algorithm | 1 | 12789638 | """
LeetCode Problem: 1007. Minimum Domino Rotations For Equal Row
Link: https://leetcode.com/problems/minimum-domino-rotations-for-equal-row/
Language: Python
Written by: <NAME>
"""
"""
Inefficient - Simulation with all possible dominos
Time Complexity: O(n)
Space Complexity: O(n)
"""
class Solution(object):
de... | 3.609375 | 4 |
BOJ/05000~05999/5800~5899/5893.py | shinkeonkim/today-ps | 2 | 12789639 | print(bin(int(input(),2)*17)[2:])
| 2.578125 | 3 |
Game Functions/gameVars.py | jordanandrigo/Andrigo_J_Python_Homework | 0 | 12789640 | from random import randint
choices=["rock", "paper", "scissors"]
player_lives = 5
computer_lives = 5
total_lives = 5
computer=choices[randint(0,2)]
player = False | 3.078125 | 3 |
tests/fixtures/submodels.py | pashashocky/xsdata | 0 | 12789641 | <reponame>pashashocky/xsdata
from dataclasses import dataclass
from tests.fixtures.models import ChoiceType
@dataclass
class ChoiceTypeChild(ChoiceType):
pass
| 1.539063 | 2 |
backend/webshop/app_settings/prod.py | mbranko/webshop | 0 | 12789642 | <gh_stars>0
from .base import *
from .utils import read_variable, get_variable
ALLOWED_HOSTS = ['localhost', 'badasswebshop.com', 'www.badasswebshop.com']
DEBUG = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': get_variable('POSTGRES_DBNAME', 'webshop'),
... | 1.710938 | 2 |
day2.py | luth31/aoc-2020 | 0 | 12789643 | import util
def first(input_path: str):
passwords = 0
with open(input_path) as file:
lines = file.read().splitlines()
for line in lines:
split = line.split()
(min_count_str, max_count_str) = split[0].split('-')
min_count = int(min_count_str)
max_count = int(max_coun... | 3.609375 | 4 |
9. Find the Runner-UpScore!/sol.py | Abhishek20182/HackerRank-Python-Practice | 2 | 12789644 | if __name__ == '__main__':
n = int(input())
arr = set(map(int, input().split()))
lst = list(arr)
lst.sort()
print(lst[-2]) | 3.28125 | 3 |
env_Cleaner.py | FavOla/SIAUROP | 0 | 12789645 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: fnels
"""
import numpy as np
import maze
import random
import cv2
class EnvCleaner(object):
def __init__(self, N_agent, map_size, seed):
self.map_size = map_size
self.seed = seed
self.occupancy = self.generate_maze(seed)
... | 2.75 | 3 |
game.py | subhramit/Double-DQN | 10 | 12789646 | from collections import deque
import random
import numpy as np
import gym
from gym.wrappers import AtariPreprocessing
class Game():
def __init__(self, game_name, start_noop=2, last_n_frames=4, frameskip=4, grayscale_obs=True, scale_obs=False):
self.start_noop = start_noop
self.last_n_frames = ... | 2.71875 | 3 |
checkov/arm/registry.py | pmalkki/checkov | 4,013 | 12789647 | <reponame>pmalkki/checkov
from checkov.arm.base_registry import Registry
arm_resource_registry = Registry()
arm_parameter_registry = Registry()
| 1.179688 | 1 |
src/tests/docx.py | glibin/simple-report | 0 | 12789648 | <filename>src/tests/docx.py<gh_stars>0
#!coding:utf-8
import unittest
import os
from simple_report.report import DocumentReport
from simple_report.xlsx.spreadsheet_ml import (SectionException,
SectionNotFoundException)
from simple_report.docx.drawing import DocxImage
LORE... | 2.4375 | 2 |
ImageProcessing/midterm5.py | annisanurdiana/python_programming | 0 | 12789649 | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 29 15:50:11 2021
@author: <NAME>
"""
import cv2 as cv
img = cv.imread("Lena.bmp", 0)
img2 = cv.imread("Baboon.png", 0)
cv.imshow("FirstOriginal.Img",img)
cv.imshow("SecondOriginal.Img",img2)
pic = img[:200,:200]
pic2 = img2[img2.shape[0]-200:img2.shape... | 2.875 | 3 |
sparse2spatial/RFRbuild.py | tsherwen/sparse2spatial | 1 | 12789650 | """
Build ensemble models from ensemble of RandomForestRegressor models
"""
import sys
import numpy as np
import pandas as pd
import xarray as xr
import datetime as datetime
import sklearn as sk
from sklearn.ensemble import RandomForestRegressor
import glob
# import AC_tools (https://github.com/tsherwen/AC_tools.git)... | 2.53125 | 3 |