max_stars_repo_path stringlengths 3 269 | max_stars_repo_name stringlengths 4 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.05M | score float64 0.23 5.13 | int_score int64 0 5 |
|---|---|---|---|---|---|---|
scripts/12865.py | JihoChoi/BOJ | 0 | 13800 | <reponame>JihoChoi/BOJ
"""
TAG: 0-1 Knapsack Problem, Dynamic Programming (DP), O(nW)
References:
- https://www.geeksforgeeks.org/0-1-knapsack-problem-dp-10/
weights and values of n items, capacity -> max value
"""
N, W = map(int, input().split()) # number of items, capacity
weights = []
values = []
for i in... | 3.28125 | 3 |
tests/test_parse.py | fphammerle/duplitab | 1 | 13801 | <gh_stars>1-10
import pytest
import datetime
import duplitab
@pytest.mark.parametrize(('duplicity_timestamp', 'expected'), [
['Tue Oct 11 11:02:01 2016', datetime.datetime(2016, 10, 11, 11, 2, 1)],
])
def test_parse_duplicity_timestamp(duplicity_timestamp, expected):
assert expected == duplitab._parse_duplici... | 2.53125 | 3 |
cdlib/algorithms/internal/COACH.py | xing-lab-pitt/cdlib | 248 | 13802 | # Author: <NAME> <<EMAIL>>
# A core-attachment based method to detect protein complexes in PPI networks
# <NAME>, Kwoh, Ng (2009)
# http://www.biomedcentral.com/1471-2105/10/169
from collections import defaultdict
from itertools import combinations
import functools
# return average degree and density for a graph
de... | 2.75 | 3 |
appengine/findit/waterfall/test/revert_and_notify_culprit_pipeline_test.py | mcgreevy/chromium-infra | 1 | 13803 | # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from common.constants import DEFAULT_QUEUE
from common.waterfall import failure_type
from gae_libs.pipeline_wrapper import pipeline_handlers
from waterfall i... | 1.8125 | 2 |
labs/lab2/lm_model/models/LSTM.py | luyuliu/CSE-5194 | 1 | 13804 | import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.nn import functional as F
import numpy as np
class LSTM(nn.Module):
def __init__(self, embedding_matrix, embedding_dim, vocab_size, hidden_dim, dropout, num_layers, bidirectional, output_dim):
"""
Args:
... | 2.890625 | 3 |
Day 17/Aayushi-Mittal.py | ChetasShree/MarchCode | 9 | 13805 | # To print fibonacci series upto a given number n.
first = 0
second = 1
n = int(input())
print("Fibbonacci Series:")
for i in range(0,n):
print(first, end=", ")
next = second + first
first = second
second = next
| 4.1875 | 4 |
taotao-cloud-python/taotao-cloud-oldboy/day84-PerfectCRM/PerfectCRM/kingadmin/permissions.py | shuigedeng/taotao-cloud-paren | 47 | 13806 | from django.core.urlresolvers import resolve
from django.shortcuts import render,redirect,HttpResponse
from kingadmin.permission_list import perm_dic
from django.conf import settings
def perm_check(*args,**kwargs):
request = args[0]
resolve_url_obj = resolve(request.path)
current_url_name = resolve_url_o... | 2.140625 | 2 |
wserver_qdk/tests/main_test.py | PunchyArchy/wserver_qdk | 0 | 13807 | <reponame>PunchyArchy/wserver_qdk
""" Тесты основного класса. """
import unittest
from wserver_qdk.main import WServerQDK
from wserver_qdk import tools
import uuid
class MainTest(unittest.TestCase):
""" Test Case """
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self... | 2.28125 | 2 |
notes/SparkDifferentialJoin.py | ketanpurohit0/experimental | 1 | 13808 | <gh_stars>1-10
import SparkHelper as sh
sparkSession = sh.getSpark()
sparkSession.sparkContext.setLogLevel("ERROR")
# URL
url = sh.getUrl('postgres','postgres','foobar_secret')
q1 = "SELECT * FROM foo_left"
q2 = "SELECT * FROM foo_right"
df1 = sh.getQueryDataFrame(sparkSession, url, q1)
df2 = sh.getQueryDat... | 3.015625 | 3 |
test/broken_test_log.py | Brimizer/python-ant | 0 | 13809 | <reponame>Brimizer/python-ant
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2011, <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
... | 1.835938 | 2 |
python/GafferSceneUI/LightToCameraUI.py | ddesmond/gaffer | 561 | 13810 | ##########################################################################
#
# Copyright (c) 2016, Image Engine Design 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:
#
# * Redistrib... | 1.023438 | 1 |
eccProg.py | ganey/hm-gwmfr | 1 | 13811 | #!/usr/bin/env python3
from time import sleep
import logging
import os
import subprocess
print("Nebra ECC Tool")
preTestFail = 0
afterTestFail = 0
ECC_SUCCESSFUL_TOUCH_FILEPATH = "/var/data/gwmfr_ecc_provisioned"
logging.basicConfig(level=os.environ.get("LOGLEVEL", "DEBUG"))
def record_successful_provision():
... | 2.453125 | 2 |
doc/tutorial/getargs.py | OliverTED/doit | 0 | 13812 | DOIT_CONFIG = {'default_tasks': ['use_cmd', 'use_python']}
def task_compute():
def comp():
return {'x':5,'y':10, 'z': 20}
return {'actions': [(comp,)]}
def task_use_cmd():
return {'actions': ['echo x=%(x)s, z=%(z)s'],
'getargs': {'x': ('compute', 'x'),
'z': ('compute... | 2.46875 | 2 |
examples/run_unlinkable.py | danesjenovdan/reference_implementation | 1 | 13813 | #!/usr/bin/env python3
""" Simple example/demo of the unlinkable DP-3T design
This demo simulates some interactions between two phones,
represented by the contact tracing modules, and then runs
contact tracing.
"""
__copyright__ = """
Copyright 2020 EPFL
Licensed under the Apache License, Version 2.0 (the "... | 2.578125 | 3 |
EasyRecycle/tests/unittests/core/views/test_BecomeCommercialAPIView.py | YuriyLisovskiy/EasyRecycle | 0 | 13814 | from django.urls import reverse
from rest_framework import status
from rest_framework.test import force_authenticate
from rest_framework_simplejwt.state import User
from core.views import DeactivateSelfAPIView, BecomeCommercialAPIView
from tests.unittests.common import APIFactoryTestCase
class BecomeCommercialAPITes... | 2.40625 | 2 |
colour/colorimetry/tests/test_spectrum.py | aurelienpierre/colour | 0 | 13815 | <filename>colour/colorimetry/tests/test_spectrum.py<gh_stars>0
"""Defines the unit tests for the :mod:`colour.colorimetry.spectrum` module."""
import colour
import numpy as np
import unittest
import scipy
from distutils.version import LooseVersion
from colour.algebra import CubicSplineInterpolator
from colour.colorim... | 2.015625 | 2 |
experiments/src_exp/data_experimentation/test_clean_store_delete_playground.py | earny-joe/CvDisinfo-Detect | 4 | 13816 | # Comment
import pandas as pd
import re
from google.cloud import storage
from pathlib import Path
def load_data(filename, chunksize=10000):
good_columns = [
'created_at',
'entities',
'favorite_count',
'full_text',
'id_str',
'in_reply_to_screen_name',
'in_rep... | 2.59375 | 3 |
codes/correl.py | KurmasanaWT/community | 0 | 13817 | <reponame>KurmasanaWT/community<filename>codes/correl.py
from dash import dcc, html
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output, State
import numpy as np
import pandas as pd
import plotly.io as pio
import plotly.graph_objects as go
from plotly.subplots import make_subplots
import... | 2.328125 | 2 |
custom_components/blitzortung/geohash_utils.py | Nag94/HomeAssistantConfig | 163 | 13818 | <filename>custom_components/blitzortung/geohash_utils.py
import math
from collections import namedtuple
from . import geohash
Box = namedtuple("Box", ["s", "w", "n", "e"])
def geohash_bbox(gh):
ret = geohash.bbox(gh)
return Box(ret["s"], ret["w"], ret["n"], ret["e"])
def bbox(lat, lon, radius):
lat_de... | 2.703125 | 3 |
deepmask/models/DeepMask.py | TJUMMG/SiamDMU | 3 | 13819 | <gh_stars>1-10
import torch
import torch.nn as nn
import torchvision
from collections import namedtuple
Config = namedtuple('Config', ['iSz', 'oSz', 'gSz'])
default_config = Config(iSz=160, oSz=56, gSz=112)
class Reshape(nn.Module):
def __init__(self, oSz):
super(Reshape, self).__init__()
self.oS... | 2.421875 | 2 |
phi.py | filiptronicek/constants | 0 | 13820 | nums = [0,1]
def calcFi():
n1 = nums[-2]
n2 = nums[-1]
sM = n1 + n2
phi = sM/n2
nums.append(sM)
return (phi)
for i in range(45):
if i % 15 == 0 or i == 44:
phi = calcFi()
print(phi)
if i == 44:
with open("outputs/phi.txt", "w") as f:
f... | 3.453125 | 3 |
var_gp/datasets.py | uber-research/var-gp | 11 | 13821 | import os
import glob
import torch
import numpy as np
# from PIL import Image, UnidentifiedImageError
from torch.utils.data import Dataset
from torchvision.datasets import MNIST
class ToyDataset(Dataset):
def __init__(self, N_K=50, K=4, X=None, Y=None):
super().__init__()
if X is not None:
self.data,... | 2.5625 | 3 |
apps/ouvertime_record/views.py | dnetochaves/repense_rh | 0 | 13822 | from django.shortcuts import render, HttpResponse
from django.views.generic.list import ListView
from django.views.generic.edit import UpdateView, DeleteView, CreateView
from . models import OuverTimeRecord
from django.contrib.auth.models import User
from django.urls import reverse_lazy
from django.views import View
im... | 2.140625 | 2 |
second_HW/second_hw_2.py | alex123012/Bioinf_HW | 0 | 13823 | import unittest as ut
import time
class test_magick(ut.TestCase):
def test_us(self):
list_r = list(range(0, 100))
for i in list_r:
with self.subTest(case=i):
self.assertEqual(magick(i), i)
def magick(x=None, start=0, stop=100):
yes = ['да', 'д', 'yes', 'y', 'ye']... | 3.5625 | 4 |
research/vrgripper/episode_to_transitions.py | Xtuden-com/tensor2robot | 1 | 13824 | # coding=utf-8
# Copyright 2020 The Tensor2Robot Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 2.359375 | 2 |
flopy/plot/map.py | mwtoews/flopy | 0 | 13825 | <reponame>mwtoews/flopy
import numpy as np
from ..discretization import StructuredGrid, UnstructuredGrid
from ..utils import geometry
try:
import matplotlib.pyplot as plt
import matplotlib.colors
from matplotlib.collections import PathCollection, LineCollection
from matplotlib.path import Path
except (... | 2.46875 | 2 |
pacu/modules/rds__explore_snapshots/main.py | damienjburks/pacu | 1 | 13826 | <filename>pacu/modules/rds__explore_snapshots/main.py
#!/usr/bin/env python3
import argparse
from pathlib import Path
import json
import random
import string
from botocore.exceptions import ClientError
module_info = {
"name": "rds__explore_snapshots",
"author": "<NAME> <EMAIL>",
"category": "EXFIL",
"... | 2.5 | 2 |
mechroutines/trans/_routines/lj.py | sjklipp/mechdriver | 0 | 13827 | <filename>mechroutines/trans/_routines/lj.py
"""
Executes the automation part of 1DMin
"""
import statistics
import autofile
from autorun import run_script
from mechroutines.trans._routines import _geom as geom
from mechroutines.trans._routines import _gather as gather
from mechroutines.trans.runner import lj as lj_ru... | 2.078125 | 2 |
barry/convert.py | jyotiska/barry | 0 | 13828 | from exceptions import BarryFileException, BarryConversionException, BarryExportException, BarryDFException
import pandas as pd
import requests
from StringIO import StringIO
def detect_file_extension(filename):
"""Extract and return the extension of a file given a filename.
Args:
filename (str): name... | 3.421875 | 3 |
flaskerize/schematics/flask-api/files/{{ name }}.template/commands/seed_command.py | darkguinito/myflaskerize | 1 | 13829 | from flask_script import Command
from app import db
class SeedCommand(Command):
""" Seed the DB."""
def run(self):
if (
input(
"Are you sure you want to drop all tables and recreate? (y/N)\n"
).lower() == "y"
):
print("Dropping tables...")
... | 2.78125 | 3 |
com/aptitute_tests/RSL.py | theeksha101/problem_solving | 0 | 13830 | <filename>com/aptitute_tests/RSL.py
a = [2, 4, 5, 7, 8, 9]
sum = 0
for i in range(len(a) - 1):
if a[i] % 2 == 0:
sum = sum + a[i]
print(sum)
| 3.359375 | 3 |
plivo/rest/client.py | vaibhav-plivo/plivo-python | 0 | 13831 | # -*- coding: utf-8 -*-
"""
Core client, used for all API requests.
"""
import os
import platform
from collections import namedtuple
from plivo.base import ResponseObject
from plivo.exceptions import (AuthenticationError, InvalidRequestError,
PlivoRestError, PlivoServerError,
... | 2.203125 | 2 |
Project2/part3/part3controller.py | tyrenyabe/CSE461 | 0 | 13832 | <gh_stars>0
# Part 3 of UWCSE's Project 3
#
# based on Lab Final from UCSC's Networking Class
# which is based on of_tutorial by <NAME>
from pox.core import core
import pox.openflow.libopenflow_01 as of
from pox.lib.addresses import IPAddr, IPAddr6, EthAddr
log = core.getLogger()
#statically allocate a routing table... | 2.625 | 3 |
lessons/terminal.report.py | thepros847/python_programiing | 0 | 13833 | #students exams data entries for terminal report card
print("Westside Educational Complex--End Of second Terminal Report--Class-KKJA--Name:<NAME>")
while True:
student_score = float(input ("Enter the student score:"))
if student_score >= 1.0 and student_score <= 39.9:
print("student_score is F9", "f... | 3.546875 | 4 |
Python/ex_semanal.py | ArikBartzadok/beecrowd-challenges | 0 | 13834 | <reponame>ArikBartzadok/beecrowd-challenges
n = int(input())
l = []
c = 0
for i in range(0,n):
p = input()
print('c -> ', c)
if p in l:
c += 1
l.append(p)
print("Falta(m) {} pomekon(s).".format(151 - (n-c))) | 2.921875 | 3 |
util/templatetags/custom_tags.py | dvcolgan/ludumdare27 | 0 | 13835 | from django import template
from django.conf import settings
from django.utils.safestring import mark_safe
register = template.Library()
@register.simple_tag
def setting(name):
return getattr(settings, name, "")
#@register.filter
#def format_difference(value):
# number = int(value)
# if number > 0:
# ... | 2.375 | 2 |
Day1/day1.py | leblancpj/AoC21 | 0 | 13836 | # Given a series of input numbers, count the number of times
# the values increase from one to the next.
import pandas as pd
# Part 1
sample = pd.read_csv(".\Day1\sample.txt", header=None, squeeze=True)
input = pd.read_csv(".\Day1\input.txt", header=None, squeeze=True)
#print(type(input))
ans = input.diff(1).apply(l... | 3.546875 | 4 |
KivyTest.py | ethanmac9/GeneralTools | 1 | 13837 | <reponame>ethanmac9/GeneralTools<filename>KivyTest.py
import kivy
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
kivy.require('1.9.0')
class GUITestApp(App):
def build(self):
return BoxLayout()
glApp = GUITestApp()
glApp.run()
| 2.046875 | 2 |
avalanche/evaluation/metrics/gpu_usage.py | aishikhar/avalanche | 1 | 13838 | ################################################################################
# Copyright (c) 2021 ContinualAI. #
# Copyrights licensed under the MIT License. #
# See the accompanying LICENSE file for terms. ... | 2.265625 | 2 |
901-1000/971.flip-binary-tree-to-match-preorder-traversal.py | guangxu-li/leetcode-in-python | 0 | 13839 | <reponame>guangxu-li/leetcode-in-python
#
# @lc app=leetcode id=971 lang=python3
#
# [971] Flip Binary Tree To Match Preorder Traversal
#
# @lc code=start
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
#... | 3.625 | 4 |
hydraulics/ifcb/classifier.py | axiom-data-science/hydraulics | 1 | 13840 | import base64
import datetime
import io
import json
import os
import requests
from collections import namedtuple
from urllib.parse import urlparse
import faust
import numpy as np
import keras_preprocessing.image as keras_img
from avro import schema
from confluent_kafka import avro
from confluent_kafka.avro import Avr... | 1.890625 | 2 |
upcfcardsearch/c260.py | ProfessorSean/Kasutamaiza | 0 | 13841 | import discord
from discord.ext import commands
from discord.utils import get
class c260(commands.Cog, name="c260"):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command(name='Yikilth_Lair_of_the_Abyssals', aliases=['c260', 'Abyssal_11'])
async def example_embed(self, ctx):
... | 2.9375 | 3 |
test_cookiecutter_ali92hm/__main__.py | ali92hm/test-cookiecutter | 0 | 13842 | from .cli import entrypoint
if __name__ == "__main__": # pragma: no cover
entrypoint.main()
| 1.148438 | 1 |
backend/elasticsurgery/views/__init__.py | EDITD/ElasticSurgery | 0 | 13843 | <filename>backend/elasticsurgery/views/__init__.py
from flask import jsonify
from ..app import app
@app.route('/ping', methods=('GET',))
def get_ping():
return jsonify(ping='pong')
| 1.882813 | 2 |
version.py | iridiumcow/OoT-Randomizer | 0 | 13844 | __version__ = '5.2.158 f.LUM'
| 1.085938 | 1 |
scripts/test_process_traj.py | hyyh28/trajectory-transformer | 0 | 13845 | <reponame>hyyh28/trajectory-transformer<filename>scripts/test_process_traj.py<gh_stars>0
import numpy as np
import pickle
expert_file = 'maze_expert.npy'
imitation_agent_file = 'maze_agent.npy'
with open(imitation_agent_file, 'rb') as handle:
agent_data = pickle.load(handle)
with open(expert_file, 'rb') as handle:
... | 1.984375 | 2 |
test/test_strings.py | harthur/celestial-snips-app | 1 | 13846 | <gh_stars>1-10
import unittest
from celestial import Celestial
from strings import CelestialStrings
from datetime import datetime
import pytest
import math
class TestCelestial(unittest.TestCase):
"""Testing the CelestialStrings class for generating celestial answers for TTS to read aloud"""
def setUp(self):... | 3.03125 | 3 |
hiburn/config.py | OpenHisiIpCam/hiburn | 8 | 13847 | <filename>hiburn/config.py
import copy
import json
import logging
from . import utils
# -------------------------------------------------------------------------------------------------
def _update_config_by_args(config, args, prefix=""):
for k, v in config.items():
arg_name = prefix + k.replace("-", "_"... | 2.53125 | 3 |
examples/4_randomized_timing.py | jonikula/pyosmo | 0 | 13848 | <filename>examples/4_randomized_timing.py
from osmo import Osmo
import random
import time
class PositiveCalculator:
@staticmethod
def guard_something():
return True
@staticmethod
def step_something():
print("1. inside step")
# Random wait can be added inside test step
... | 3.203125 | 3 |
ec2/physbam/utils.py | schinmayee/nimbus | 20 | 13849 | #!/usr/bin/env python
# Author: <NAME> <<EMAIL>>
import sys
import os
import subprocess
import config
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
import ec2
temp_file_name = '_temp_file_'
def copy_binary_file_to_hosts(ip_addresses):
for ip in ip_addresses:
command = ''
... | 2.53125 | 3 |
Lista5/Lista5ex1.py | hugo-paiva/IntroducaoCienciasDaComputacao | 0 | 13850 | <filename>Lista5/Lista5ex1.py
frase = input().split()
for palavra in frase:
print(palavra[2], end='') | 3.078125 | 3 |
ishashad.py | albusdemens/Twitter-mining-project | 0 | 13851 | #To run the code, write
#from ishashad import ishashad
#then ishashad(number)
def ishashad(n):
if n % sum(map(int,str(n))) == 0:
print("True")
else:
print("False")
return | 3.671875 | 4 |
tests/utils/test_utils.py | OpenLMIS-Angola/superset-patchup | 0 | 13852 | """
This module tests utils
"""
from unittest.mock import patch, MagicMock
from superset_patchup.utils import get_complex_env_var, is_safe_url, is_valid_provider
from superset_patchup.oauth import CustomSecurityManager
class TestUtils:
"""
Class to test the utils module
"""
@patch("superset_patchup.... | 2.84375 | 3 |
xitorch/_tests/test_integrate.py | Jaikinator/xitorch | 0 | 13853 | <filename>xitorch/_tests/test_integrate.py
import random
import torch
import numpy as np
from torch.autograd import gradcheck, gradgradcheck
import xitorch as xt
from xitorch.integrate import quad, solve_ivp, mcquad, SQuad
from xitorch._tests.utils import device_dtype_float_test
###############################... | 2.40625 | 2 |
biothings-hub/files/nde-hub/hub/dataload/sources/figshare/dumper.py | NIAID-Data-Ecosystem/nde-crawlers | 0 | 13854 | from hub.dataload.nde import NDEFileSystemDumper
class FigshareDumper(NDEFileSystemDumper):
SRC_NAME = "figshare"
| 1.359375 | 1 |
faiss_utils.py | yizt/keras-lbl-IvS | 22 | 13855 | <filename>faiss_utils.py
# -*- coding: utf-8 -*-
"""
File Name: faiss_utils
Description : faiss工具类
Author : mick.yi
date: 2019/1/4
"""
import faiss
import numpy as np
def get_index(dimension):
sub_index = faiss.IndexFlatL2(dimension)
index = faiss.IndexIDMap(sub_i... | 2.375 | 2 |
relogio.py | Glightman/project_jogo_POO | 1 | 13856 | <reponame>Glightman/project_jogo_POO
class Relogio:
def __init__(self):
self.horas = 6
self.minutos = 0
self.dia = 1
def __str__(self):
return f"{self.horas:02d}:{self.minutos:02d} do dia {self.dia:02d}"
def avancaTempo(self, minutos):
self.minutos += minut... | 3.046875 | 3 |
custom/logistics/api.py | dslowikowski/commcare-hq | 1 | 13857 | import requests
from custom.api.utils import EndpointMixin
class MigrationException(Exception):
pass
class LogisticsEndpoint(EndpointMixin):
models_map = {}
def __init__(self, base_uri, username, password):
self.base_uri = base_uri.rstrip('/')
self.username = username
self.passw... | 2.390625 | 2 |
users/migrations/0004_auto_20191028_2154.py | icnmtrx/classified | 0 | 13858 | # Generated by Django 2.2.5 on 2019-10-28 21:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0003_auto_20191028_1802'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='registered_a... | 1.554688 | 2 |
functionaltests/api/v2/test_pool.py | kiall/designate-py3 | 0 | 13859 | <filename>functionaltests/api/v2/test_pool.py
# Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Author: <NAME> <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# ... | 2.03125 | 2 |
fewshot/models/basic_model_VAT_ENT.py | AhmedAyad89/Consitent-Prototypical-Networks-Semi-Supervised-Few-Shot-Learning | 22 | 13860 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
import tensorflow as tf
from fewshot.models.kmeans_utils import compute_logits
from fewshot.models.model import Model
from fewshot.models.refine_model import RefineModel
from fewshot.models... | 2.15625 | 2 |
FileStorage/utils/__init__.py | Thiefxt/FileStorage | 1 | 13861 | """
@Author : xiaotao
@Email : <EMAIL>
@Lost modifid : 2020/4/24 10:02
@Filename : __init__.py.py
@Description :
@Software : PyCharm
""" | 0.785156 | 1 |
molsysmt/tools/items.py | dprada/molsysmt | 0 | 13862 | <gh_stars>0
import numpy as np
import re as re
from molsysmt._private_tools.lists_and_tuples import is_list_or_tuple
def compatibles_for_a_single_molecular_system(items):
from molsysmt.basic.get_form import get_form
from molsysmt.basic.get import get
from molsysmt.forms import dict_has
output = True
... | 2.59375 | 3 |
runner/monitor.py | wynterl/federated-learning-lib | 0 | 13863 | <reponame>wynterl/federated-learning-lib
#!/usr/bin/env python3
import argparse
import subprocess as sp
import select
import sys
import time
import yaml
if __name__ == '__main__':
"""
We can daemonize our connections to our remote machines, list the FL processes on remote
machines, or kill FL processes o... | 2.203125 | 2 |
brian2sampledevice/__init__.py | brian-team/brian2sampledevice | 0 | 13864 | <gh_stars>0
from .device import SampleDevice
from .codeobject import SampleDeviceCodeObject
__all__ = ['SampleDevice', 'SampleDeviceCodeObject']
| 1.085938 | 1 |
tests/node_test.py | allenai/beaker-py | 0 | 13865 | <filename>tests/node_test.py
from beaker import Beaker
def test_node_get(client: Beaker, beaker_node_id: str):
assert client.node.get(beaker_node_id).limits.gpu_count == 8
| 2 | 2 |
crawling/data_crawler_set.py | CLUG-kr/cau_hashkeyword | 5 | 13866 | <gh_stars>1-10
# coding: utf-8
# In[2]:
import firebase_admin
from firebase_admin import credentials
from firebase_admin import db
# Fetch the service account key JSON file contents
cred = credentials.Certificate('/Users/Solomon/Desktop/cau-hashkeyword-serviceAccountKey.json')
# Initialize the app with a service ... | 2.21875 | 2 |
compose.py | luyao777/speech-robot | 0 | 13867 | <reponame>luyao777/speech-robot
#coding: utf-8
from aip import AipSpeech
from config import DefaultConfig as opt
class composer():
def __init__(self):
pass
def compose(self,text ='你好'):
#百度后台获取的秘�?
APP_ID = opt.baidu_app_id
API_KEY = opt.baidu_api_key
SECRET_KEY =opt.ba... | 2.703125 | 3 |
tests/test_input_output.py | dpanici/DESC | 1 | 13868 | import unittest
import os
import pathlib
import h5py
from desc.input_reader import InputReader
from desc.equilibrium_io import hdf5Writer, hdf5Reader
from desc.configuration import Configuration, Equilibrium
#from desc.input_output import read_input
#class TestIO(unittest.TestCase):
# """tests for input/output fun... | 2.765625 | 3 |
backend/vcdat/test_end_to_end.py | CDAT/vcdat | 4 | 13869 | <reponame>CDAT/vcdat
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions as EC
import pytest
# Declare Fixtures
# --------------------------------------------------------------------
@pytest.fixture()
def driver():
driver = web... | 2.34375 | 2 |
scripts/makeToast.py | zgrannan/Technical-Theatre-Assistant | 3 | 13870 | <reponame>zgrannan/Technical-Theatre-Assistant
#makes a toast with the given string ID
from sys import argv
def make_toast (string_id):
return "Toast.makeText(getBaseContext(), getString(R.string." + string_id + "), Toast.LENGTH_SHORT).show();"
if ( argv[0] == "makeToast.py" ):
print make_toast(argv[1])
| 2.65625 | 3 |
crisiscleanup/calls/migrations/0011_merge_20180122_2308.py | CrisisCleanup/wcicp-call-service | 0 | 13871 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-01-22 23:08
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('calls', '0010_auto_20180119_2117'),
('calls', '0007_auto_20180122_2157'),
]
operati... | 1.359375 | 1 |
test/market_feature_1/test_nose_plugin.py | StefanRatzke/nose-market-features | 5 | 13872 | from unittest import skip
import unittest2
from nose.plugins.attrib import attr
from nose.tools import assert_equals
@attr('test_nose_plugin')
class TestNosePlugin(unittest2.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_one(self):
"""first test, simulation p... | 2.578125 | 3 |
charmcraft/manifest.py | aznashwan/charmcraft | 32 | 13873 | # Copyright 2020-2021 Canonical Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 1.914063 | 2 |
ricnn/RICNN.py | jiangruoqiao/RICNN_RepeatGongCheng-sPaper | 33 | 13874 | #ecoding:utf-8
import DatasetLoader
import RICNNModel
import tensorflow as tf
import sys
import numpy as np
import regularization as re
import os
import trainLoader
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
TRAIN_FILENAME = '/media/liuqi/Files/dataset/test_mnist_ricnn_raw_100.h5'
TEST_FILENAME = '/media/liuqi/Files/da... | 2.1875 | 2 |
mcot/core/_scripts/gcoord/split.py | MichielCottaar/mcot.core | 0 | 13875 | #!/usr/bin/env python
"""Extract radial, sulcal, and gyral orientations from gyral coordinate NIFTI file"""
def main():
import argparse
parser = argparse.ArgumentParser("Extract radial, sulcal, and gyral dyads from a coord NIFTI file")
parser.add_argument('coord', help='name of the coord file')
parse... | 2.984375 | 3 |
src/pyshark/packet/fields.py | Lovemma/pyshark | 10 | 13876 | <reponame>Lovemma/pyshark
import binascii
from pyshark.packet.common import Pickleable, SlotsPickleable
class LayerField(SlotsPickleable):
"""
Holds all data about a field of a layer, both its actual value and its name and nice representation.
"""
# Note: We use this object with slots and not just a ... | 2.90625 | 3 |
tasks/swipe_card.py | devBezel/among_us_tasker | 0 | 13877 | import pyautogui
import time
import datetime
class SwipeCard:
def __init__(self):
self.resolution = pyautogui.size()
def resolve_task(self):
try:
hide_card_position = pyautogui.center(
pyautogui.locateOnScreen(f"assets/tasks/swipe_card/main.png",
... | 2.875 | 3 |
python/geeksforgeeks/arrays/rearrengment/reverse_a_string.py | othonreyes/code_problems | 0 | 13878 | <reponame>othonreyes/code_problems
# https://www.geeksforgeeks.org/write-a-program-to-reverse-an-array-or-string/
# Time: O(n)
# Space: 1
def reverseByMiddles(arr):
n = len(arr)
limit = n//2
for i in range(limit):
temp = arr[i]
arr[i] = arr[(n-1)-i]
arr[(n-1)-i] = temp
return arr
arr = [1,2,3]
res... | 4.0625 | 4 |
test_service.py | cmput401-fall2018/web-app-ci-cd-with-travis-ci-derek-repka | 0 | 13879 | from service import Service
from unittest import TestCase
from mock import patch
import sys
class TestService(TestCase):
@patch('service.Service.bad_random', return_value=10)
def test_bad_random(self, bad_random):
self.assertEqual(bad_random(), 10)
@patch('service.Service.bad_random', return_value=10)
def test_... | 3.171875 | 3 |
libweasyl/libweasyl/alembic/versions/eff79a07a88d_use_timestamp_column_for_latest_.py | akash143143/weasyl | 111 | 13880 | """Use TIMESTAMP column for latest submission
Revision ID: eff<PASSWORD>0<PASSWORD>
Revises: <PASSWORD>
Create Date: 2017-01-08 22:20:43.814375
"""
# revision identifiers, used by Alembic.
revision = 'eff<PASSWORD>'
down_revision = '<PASSWORD>'
from alembic import op # lgtm[py/unused-import]
import sqlalchemy as ... | 1.4375 | 1 |
MBTA/step1_group.py | 404nofound/MBTA_Python | 1 | 13881 | <gh_stars>1-10
import pandas as pd
import numpy as np
import os
# Function, divided all data into groups by time period, like [1AM-3AM; 3AM-5Am ...]
def binning(column, points, labels=None, month=0, stop=0):
'''
Notes: The Row Data from MBTA webiste
The Time format is from 3:00 to 27:00, means 3:00... | 3.421875 | 3 |
tests/dags/test_job_operator_jinja.py | Fahadsaadullahkhan/KubernetesJobOperator | 0 | 13882 | <reponame>Fahadsaadullahkhan/KubernetesJobOperator
from utils import default_args
from datetime import timedelta
from airflow import DAG
from airflow_kubernetes_job_operator import (
KubernetesJobOperator,
JobRunnerDeletePolicy,
KubernetesLegacyJobOperator,
)
dag = DAG(
"kub-job-op-test-jinja",
def... | 2.046875 | 2 |
spacecapsule/executor.py | zengzhilong/space-capsule | 7 | 13883 | <reponame>zengzhilong/space-capsule<gh_stars>1-10
import json
import jsonpath
import paramiko
from spacecapsule.history import store_experiment, rollback_command
from subprocess import Popen, PIPE
from spacecapsule.k8s import prepare_api, copy_tar_file_to_namespaced_pod, executor_command_inside_namespaced_pod
from s... | 2.25 | 2 |
experiments/2d_shallowwater/gen.py | flabowski/POD-UQNN | 15 | 13884 | <gh_stars>10-100
"""POD-NN modeling for 1D, unsteady Burger Equation."""
#%% Imports
import sys
import os
import pickle
import numpy as np
sys.path.append(os.path.join("..", ".."))
from poduqnn.podnnmodel import PodnnModel
from poduqnn.mesh import read_multi_space_sol_input_mesh
from poduqnn.handling import clean_dir,... | 2.125 | 2 |
day1/ex4.py | dsky1990/python_30days | 1 | 13885 | cars = 100
space_in_a_car = 4.0
drivers = 30
passengers = 90
cars_not_driven = cars -drivers
cars_driven = drivers
carpool_carpacity = cars_driven * space_in_a_car
average_passengers_per_car = passengers / cars_driven
print("There are", cars, "cars available")
print("There are only", drivers, "drivers available")
prin... | 3.828125 | 4 |
faculty_xval/bin/jobs_cross_validation_executor.py | facultyai/faculty-xval | 4 | 13886 | <filename>faculty_xval/bin/jobs_cross_validation_executor.py
import json
import logging
import os
import click
import numpy as np
from keras import backend as K
from keras.models import load_model as keras_load
from sklearn.base import clone as sklearn_clone
from sklearn.externals import joblib
from faculty_xval.uti... | 2.640625 | 3 |
Solution.py | TheMLGuy/Simple-Web-Scraper | 0 | 13887 | from bs4 import BeautifulSoup
import requests
import math
import time
start_url='https://www.macys.com'
domain='https://www.macys.com'
''' get soup '''
def get_soup(url):
# get contents from url
content=''
while content=='':
try:
content = requests.get(url,
... | 3.3125 | 3 |
contactnetwork/urls.py | pszgaspar/protwis | 21 | 13888 | <reponame>pszgaspar/protwis<filename>contactnetwork/urls.py
from django.conf.urls import url
from contactnetwork import views
# from django.views.generic import TemplateView
urlpatterns = [
url(r'^clusteringdata$', views.ClusteringData, name='clusteringdata'),
url(r'^clustering$', views.Clustering, name='clus... | 1.984375 | 2 |
app.py | jero2rome/HelloWorld-Python | 0 | 13889 | <filename>app.py
course = "Python Programming"
print(course.upper())
print(course.lower())
print(course.title())
course = " Python Programming"
print(course)
print(course.strip())
print(course.find("Pro"))
print(course.find("pro"))
print(course.replace("P", "-"))
print("Programming" in course)
print("Programming... | 3.265625 | 3 |
FPN_Backend/api_utility/validators.py | DeeMATT/friendly-invention | 0 | 13890 | <filename>FPN_Backend/api_utility/validators.py
import re
from data_transformer.views import stringIsInteger
def validateEmailFormat(email):
emailPattern = r'^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$'
if(re.search(emailPattern, email)):
return True
return False
def validatePho... | 2.53125 | 3 |
app/model.py | hfikry92/fast-api-auth-starter | 43 | 13891 | from pydantic import BaseModel, Field, EmailStr
class PostSchema(BaseModel):
id: int = Field(default=None)
title: str = Field(...)
content: str = Field(...)
class Config:
schema_extra = {
"example": {
"title": "Securing FastAPI applications with JWT.",
... | 2.9375 | 3 |
griffin_powermate/__init__.py | alex-ong/griffin-powermate | 11 | 13892 | __version__ = '1.0.2'
__author__ = '<NAME> <<EMAIL>>'
__url__ = 'https://github.com/crash7/griffin-powermate'
__all__ = []
from griffin_powermate import * | 1.109375 | 1 |
servermn/core/__init__.py | masterhung0112/servermn | 0 | 13893 | <filename>servermn/core/__init__.py
def init():
# Set locale environment
# Set config
# Set user and group
# init logger
pass | 1.65625 | 2 |
flink/test_flink.py | chekanskiy/bi-dataproc-initialization-actions | 1 | 13894 | <gh_stars>1-10
import unittest
from parameterized import parameterized
import os
from integration_tests.dataproc_test_case import DataprocTestCase
METADATA = 'flink-start-yarn-session=false'
class FlinkTestCase(DataprocTestCase):
COMPONENT = 'flink'
INIT_ACTION = 'gs://dataproc-initialization-actions/flink/... | 2.140625 | 2 |
regression/testplan/firmware_small.py | sld-columbia/nvdla-sw | 407 | 13895 | # Copyright (c) 2018, NVIDIA CORPORATION. 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 copyright
# notice, this list of conditions a... | 1.445313 | 1 |
peaksql/datasets/narrowpeak.py | vanheeringen-lab/PeakSQL | 0 | 13896 | <gh_stars>0
import numpy as np
from typing import List, Tuple
from .base import _DataSet
class NarrowPeakDataSet(_DataSet):
"""
The NarrowPeakDataSet expects that narrowPeak files have been added to the DataBase.
"""
SELECT_LABEL = (
" Bed.ChromosomeId, Bed.ConditionId, BedVirtual_{assembly}... | 2.671875 | 3 |
strip_ansi_escape_codes.py | neilrjones/DevOps-Python-tools | 1 | 13897 | #!/usr/bin/env python
# vim:ts=4:sts=4:sw=4:et
#
# Author: <NAME>
# Date: 2018-09-09 23:06:06 +0100 (Sun, 09 Sep 2018)
#
# https://github.com/harisekhon/devops-python-tools
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn and optional... | 2.015625 | 2 |
vk_bot/mods/other/counting.py | triangle1984/GLaDOS | 3 | 13898 | from vk_bot.core.modules.basicplug import BasicPlug
import time
class Counting(BasicPlug):
command = ("отсчет",)
doc = "Отсчет от 1 до 3"
def main(self):
for x in range(3, -1, -1):
if x == 0:
return
self.sendmsg(x)
time.sleep(1)
| 2.671875 | 3 |
wind-oci-marketplace/setup.py | LaudateCorpus1/wind | 1 | 13899 | ## Copyright © 2021, Oracle and/or its affiliates.
## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
#!/usr/bin/env python
from setuptools import setup
setup(name='wind-marketplace-library',
version="1.0.0",
description='Robot Framework test librar... | 1.09375 | 1 |