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 |
|---|---|---|---|---|---|---|
franki/exceptions.py | cr0hn/franki | 1 | 12762851 | <reponame>cr0hn/franki
class FrankiException(Exception):
pass
class FrankiInvalidFormatException(Exception):
pass
class FrankiFileNotFound(Exception):
pass
class FrankiInvalidFileFormat(Exception):
pass
__all__ = ("FrankiInvalidFormatException", "FrankiFileNotFound",
"FrankiInvalidFil... | 1.710938 | 2 |
baselines/mend/efk_hparams.py | kmeng01/rome | 38 | 12762852 | <filename>baselines/mend/efk_hparams.py
from util.hparams import HyperParams
class EFKHyperParams(HyperParams):
KEYS = ["lr_scale", "n_toks", "model_name", "counterfact", "zsre"]
| 1.414063 | 1 |
auth.py | zendikit/wantan | 7 | 12762853 | import getpass
import keyring
KEYRING_SERVICE = "wantan"
def setup_args(args):
"""Add our args to a subgroup of the main script's."""
auth_verbs = args.add_mutually_exclusive_group(required=True)
auth_verbs.add_argument("--dump", action="store_true",
help="Dump the API key associated with a us... | 2.78125 | 3 |
ffmpegNormaIUse.py | boollfd/forSelfUse | 0 | 12762854 | # -*-coding = utf-8 -*-
import json
import os
import subprocess
if __name__ == "__main__":
whereFfmpeg = ""
toDir = ""
beginPath = ""
paths = os.listdir(beginPath)
videoName = "\\video.m4s"
audioName = "\\audio.m4s"
for path in paths:
secondPath = os.path.join(beginPath, path)
liTaskPath = os.listdir(second... | 2.28125 | 2 |
generate_sv_parameters.py | EngRaff92/RDL_REG_GEN | 2 | 12762855 | #!/opt/homebrew/bin/python3.9
##
## Icebreaker and IceSugar RSMB5 project - RV32I for Lattice iCE40
## With complete open-source toolchain flow using:
## -> yosys
## -> icarus verilog
## -> icestorm project
##
## Tests are written in several languages
## -> Systemverilog Pure Testbench (Vivado)
## -> UVM testbench ... | 1.335938 | 1 |
Sessions/S05/json_from_api.py | paulbordea/session3 | 0 | 12762856 | import json
import requests
# POST
payload = {'userId': 6622, 'title': 'Something', 'body': 'some body'}
response = requests.post('https://jsonplaceholder.typicode.com/posts', data=json.dumps(payload))
assert response.status_code == 201, f'POST: Received status code {response.status_code}'
print(response.text)
# GET... | 2.859375 | 3 |
tests/test_CatalogQuery.py | AmpelProject/extcats | 2 | 12762857 | <filename>tests/test_CatalogQuery.py
import pytest
from extcats.CatalogQuery import CatalogQuery
@pytest.fixture
def catq(milliquas, mongo_client):
return CatalogQuery("milliquas", dbclient=mongo_client)
with_index_methods = pytest.mark.parametrize(
"method",
["2dsphere", "healpix"],
)
@with_index_met... | 2.421875 | 2 |
scripts/Qubit/Analysis/histogram.py | sourav-majumder/qtlab | 0 | 12762858 | <reponame>sourav-majumder/qtlab<gh_stars>0
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
powers = list(np.arange(8.3, 8.71, 0.01))
powers.append(8.75)
for power in powers:
# print r"D:\data Summary\Tanmoy\Time domain at different Power\RefCurve_pw-"+"%.2f"%power+".W... | 2.15625 | 2 |
scripts/slave/recipe_modules/buildbucket/config.py | bopopescu/chromium-build | 0 | 12762859 | <reponame>bopopescu/chromium-build<gh_stars>0
# Copyright 2016 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 recipe_engine.config import config_item_context, ConfigGroup
from recipe_engine.config import Single, Stat... | 1.835938 | 2 |
openstack/network/v2/port_forwarding.py | horion/openstacksdk | 99 | 12762860 | # 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 writing, software
# distributed under t... | 2.09375 | 2 |
disassembler.py | mkurzmann/soldec | 6 | 12762861 | <reponame>mkurzmann/soldec
from bytecodeblock import *
from ceptions import *
from opcodes import *
from bytecodes import *
from itertools import groupby
import sys, re
class Disassembler(object):
def __init__(self, binary):
if len(binary) == 0:
raise InputError("empty hex string")
binary += "00"
self.__de... | 2.75 | 3 |
gen3/cli/dict.py | fantix/gen3 | 0 | 12762862 | import glob
import json
import os
import aiohttp
from ruamel.yaml import YAML
from . import with_loop, log
from ..dictionary import loader
@with_loop
async def main(args, loop):
if args.url.startswith("http"):
log.critical("Downloading dictionary JSON...")
async with aiohttp.ClientSession(loop=l... | 2.59375 | 3 |
books_app/urls.py | srinidhibhat/booknotes | 0 | 12762863 | <reponame>srinidhibhat/booknotes
from django.urls import path
from .views import (
BookListView,
BookDetailView,
BookCreateView,
BookUpdateView,
BookDeleteView,
UserBookListView
)
from . import views
urlpatterns = [
path('', BookListView.as_view(), name = 'books_app-home'),
path('user/<... | 2.515625 | 3 |
scripts/heatmap/custom_idw/gdf_interpol_and_tiff_converter.py | PhilipeRLeal/xarray_case_studies | 1 | 12762864 | # -*- coding: utf-8 -*-
"""
Created on Thu Mar 12 14:27:05 2020
@author: ricardoguimaraes
"""
import numpy as np
import pandas as pd
import geopandas as gpd
from gdf_heatmap import gdf_heatmap
from array_to_tiff import array_to_tiff
if '__main__' == __name__ :
from shapely.geometry import Point
impor... | 2.703125 | 3 |
src/resources/organization.py | null-none/fhir-faker | 5 | 12762865 | <gh_stars>1-10
import random
import uuid
from common.base import Base
class Organization(Base):
"""Organization
https://www.hl7.org/fhir/organization.html
Demographics and other administrative information about an individual or animal receiving care or other health-related services.
Attributes:
... | 2.90625 | 3 |
nn_models.py | neuropil/sleep_ann | 1 | 12762866 | from keras.layers import Input, Dense, Dropout, LSTM
from keras.models import Model, Sequential
from keras.optimizers import SGD
from keras import regularizers
def feedforward(layer_spec=[64],num_labels=5,activ='sigmoid',
optim='adam',loss='categorical_crossentropy',
droprate=None,loss_... | 2.890625 | 3 |
tests/app/test_search_ctl.py | marcosnr/search-cli-app | 0 | 12762867 | <filename>tests/app/test_search_ctl.py
import pytest
from search_ctl import SearchApp
from models import OrganizationDAO, UserDAO, TicketDAO
@pytest.fixture(scope="function")
def app_init():
return SearchApp()
@pytest.fixture(scope="module")
def app():
app = SearchApp()
app.load_data()
return app
def test_... | 2.359375 | 2 |
vodscrepe/aliases.py | dawsonbooth/vodscrepe | 2 | 12762868 | import re
stages = {
"Battlefield": re.compile(r"battle", flags=re.I),
"Dream Land N64": re.compile(r"land", flags=re.I),
"Final Destination": re.compile(r"final|fd", flags=re.I),
"Fountain of Dreams": re.compile(r"fount|fod", flags=re.I),
"Yoshi's Story": re.compile(r"yoshi", flags=re.I),... | 2.25 | 2 |
pytorchrl/agent/algorithms/a2c.py | PyTorchRL/pytorchrl | 20 | 12762869 | <reponame>PyTorchRL/pytorchrl<filename>pytorchrl/agent/algorithms/a2c.py
import torch
import itertools
import torch.nn as nn
import torch.optim as optim
import pytorchrl as prl
from pytorchrl.agent.algorithms.base import Algorithm
from pytorchrl.agent.algorithms.policy_loss_addons import PolicyLossAddOn
from pytorchrl... | 2.40625 | 2 |
great_url_shortener/main/views.py | theodor85/url-shortener | 0 | 12762870 | <reponame>theodor85/url-shortener
from django.http import HttpResponseRedirect
from rest_framework import viewsets, mixins
from rest_framework.response import Response
from rest_framework import status
from rest_framework.decorators import api_view
from .models import Url
from .serializers import UrlSerializer
from .... | 2.328125 | 2 |
flake8_declarative_dict/_checker.py | joelschutz/flake8-declarative-dict | 0 | 12762871 | import ast
from typing import Tuple
from flake8_plugin_utils import Error
from .error import DCD001, DCD002, DCD003
def _get_large_dict(node: ast.Dict, dict_size_limit: int, allow_nested_empty_dicts: bool) -> Tuple[Error, int]:
'''Detects if the dict is larger that an allowed value'''
# If a negative value i... | 2.578125 | 3 |
tfu/costs.py | diogo149/tfu | 3 | 12762872 | import tensorflow as tf
from . import utils
from . import base
def l2(params=None):
if params is None:
params = base.find_variables(weight=True)
return utils.smart_sum([tf.nn.l2_loss(x) for x in params])
| 2.6875 | 3 |
pycqed/measurement/openql_experiments/multi_qubit_oql.py | ZW7436/PycQED_py3 | 1 | 12762873 | <reponame>ZW7436/PycQED_py3
import numpy as np
import openql.openql as ql
import pycqed.measurement.openql_experiments.openql_helpers as oqh
from pycqed.utilities.general import int2base, suppress_stdout
from os.path import join
def single_flux_pulse_seq(qubit_indices: tuple,
platf_cfg: str)... | 2.15625 | 2 |
twitter.py | mr-karan/kayako-cust-serv | 0 | 12762874 | <gh_stars>0
#!/usr/bin/env python
import tweepy
import os
from config import(consumer_key, consumer_secret,access_token,\
access_token_secret )
class TwitterAPI(object):
'''
Authenticate requests to Twitter API using Tweepy and fetch tweets.
'''
def __init__(self):
'''
... | 3.390625 | 3 |
docs/conf.py | oAGoulart/sphinx-bulma | 0 | 12762875 | # -*- coding: utf-8 -*-
import sys
import os
from datetime import datetime
sys.path.append(os.path.abspath('..'))
sys.path.append(os.path.abspath('.'))
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
... | 1.554688 | 2 |
hltv/models/match/lib.py | kiobu/hltv-py | 0 | 12762876 | from hltv.api.match.request import MatchRequest
from hltv.models.team.lib import Team
from hltv.libs.helper import *
class Match:
def __init__(self, match_id: int):
self.body: Any = MatchRequest(match_id)()
self.results: dict = dict()
self.match_id = match_id
self._canonicalize_bod... | 2.421875 | 2 |
openingangle/Calculatefunction.py | DingdingLuan/PycharmProjects | 0 | 12762877 | import numpy as np
from scipy.integrate import quad
import pandas as pd
# calculate the k-corrention in erg.s-1.cm-2:
def NE(E,Epeak,alpha,beita):
if (alpha-beita)*Epeak/(2+alpha)>=E:
NE=(E/100)**alpha*np.exp(-E*(2+alpha)/Epeak)
return NE
elif (alpha-beita)*Epeak/(2+alpha)<=E:
NE=(((al... | 2.078125 | 2 |
GPyOpt/util/stats.py | zhenwendai/GPyOpt | 850 | 12762878 | <reponame>zhenwendai/GPyOpt
# Copyright (c) 2016, the GPyOpt Authors
# Licensed under the BSD 3-clause license (see LICENSE.txt)
#from ..util.general import samples_multidimensional_uniform, multigrid, iroot
import numpy as np
| 0.898438 | 1 |
no_of_divisors_in_a_given_range.py | shubhangini-tripathy/geeks_for_geeks | 0 | 12762879 | T = int(input())
for i in range(T):
m, n, a, b = map(int, input().split())
count = 0
for num in range(m, n + 1):
if num % a == 0 or num % b == 0:
count += 1
print(count)
| 3.15625 | 3 |
MLiA_SourceCode/Ch13/extras/createFig2.py | Jerllina/MLiA_LearningRecording | 6 | 12762880 | '''
Created on Jun 1, 2011
@author: Peter
'''
from numpy import *
import matplotlib
import matplotlib.pyplot as plt
import pca
dataMat = pca.loadDataSet('testSet.txt')
lowDMat, reconMat = pca.pca(dataMat, 1)
fig = plt.figure()
ax = fig.add_subplot(111)
ax.scatter(dataMat[:,0], dataMat[:,1], marker='^'... | 2.8125 | 3 |
util/ECA.py | tanlei0/ACECA-simple-classification | 0 | 12762881 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 31 20:21:50 2019
@author: <NAME>
"""
import numpy as np
class ECA:
def __init__(self, rule, init_state='0'*50+'1'+'0'*50,alpha=1.0, d_ini=0.5, k=0, Ttrs=0, Tsample=100, run_num=100, ConvergeMode=0):
"""Initialize the CA with the given rule a... | 2.875 | 3 |
pup/algorithms/fixed_maximum_cost.py | duykienvp/sigspatial-2020-spatial-privacy-pricing | 0 | 12762882 | """
Fixed Maximum Cost (FMC) baseline
"""
import logging
from collections import defaultdict
from typing import Tuple, List
import time
import numpy as np
from pup.algorithms import privacy_helper
from pup.algorithms.uniform_prior import cal_prob_dists_num_users_for_grid
from pup.algorithms.util import get_linear_pr... | 2.4375 | 2 |
restapi/github_request_with_auth_api.py | k19ran/python-net_automation | 0 | 12762883 | import requests
from pprint import pprint
from requests.auth import HTTPBasicAuth
from getpass import getpass
from urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)
if __name__ == "__main__":
username = "k19ran"
password = getpass()... | 2.671875 | 3 |
kubernetes/test/test_io_xk8s_cluster_v1alpha4_cluster_spec.py | mariusgheorghies/python | 0 | 12762884 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.20.7
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unitte... | 1.648438 | 2 |
geocube/_version.py | snowman2/geocube | 152 | 12762885 | """GeoCube Version"""
__version__ = "0.1.1.dev0"
| 1.070313 | 1 |
wristband/stages/serializers.py | hmrc/wristband | 1 | 12762886 | from rest_framework import serializers
class StageSerializer(serializers.Serializer):
name = serializers.CharField()
| 1.546875 | 2 |
energyPATHWAYS/shared_classes.py | anamileva/energyPATHWAYS | 3 | 12762887 | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 17 08:46:24 2015
@author: Ben
"""
import util
import numpy as np
import pandas as pd
from datamapfunctions import Abstract, DataMapFunctions
import config as cfg
import pdb
import logging
class StockItem(object):
def __init__(self):
self.spy = 1. #stock roll... | 2.734375 | 3 |
src/__init__.py | WilliamAshbee/segmentation | 35 | 12762888 | <reponame>WilliamAshbee/segmentation<filename>src/__init__.py
# flake8: noqa
# isort:skip_file
from catalyst.dl import registry, SupervisedRunner as Runner
from catalyst.contrib.models.cv import segmentation as m
from .experiment import Experiment
from . import callbacks
registry.MODELS.add_from_module(m)
registry.C... | 1.273438 | 1 |
pypi_installer/sbtab/sbtab2html.py | derHahn/SBtab | 4 | 12762889 | <filename>pypi_installer/sbtab/sbtab2html.py
"""
SBtab2HTML
==========
Python script that converts SBtab file/s to HTML.
"""
#!/usr/bin/env python
import re
import string
import sys
from . import misc
urns = ["obo.chebi","kegg.compound","kegg.reaction","obo.go","obo.sgd","biomodels.sbo","ec-code","kegg.orthology","un... | 3.34375 | 3 |
telbot.py | therokhman/telebot | 0 | 12762890 | from telebot import types, TeleBot
from dynaconf import settings as _settings
import pyowm
bot = TeleBot(_settings.SECRET_KEY)
keyboard = types.InlineKeyboardMarkup()
key_yes = types.InlineKeyboardButton(text='Что у нас по погоде?', callback_data='weather')
keyboard.add(key_yes)
key_no = types.InlineKeyboardButton(t... | 2.390625 | 2 |
src/algo/stmts/GLineStmt.py | TuringApp/Turing | 42 | 12762891 | <gh_stars>10-100
# -*- coding: utf-8 -*-
from .BaseStmt import *
class GLineStmt(BaseStmt):
def __init__(self, start_x: AstNode, start_y: AstNode, end_x: AstNode, end_y: AstNode, color: AstNode):
super().__init__()
self.start_x = start_x
self.start_y = start_y
self.end_x = end_x
... | 2.75 | 3 |
dash/snapshots.py | thepearson/dash-cli | 7 | 12762892 | from time import sleep, time
from .api import Api
class Snapshots(Api):
delay = 10
def get_snapshots(self, project):
return self.do_request('/naut/project/{project}/snapshots'.format(project=project))
def get_snapshot(self, project, id):
return self.do_request('/naut/project/{project}/sn... | 2.875 | 3 |
blogapp/migrations/0008_auto_20200331_1751.py | uma-shankar-gupta/blog-website | 0 | 12762893 | <reponame>uma-shankar-gupta/blog-website
# Generated by Django 3.0.3 on 2020-03-31 12:21
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('blogapp', '0007_comment_msg'),
]
operations = [
migrations.AlterFi... | 1.734375 | 2 |
cterasdk/core/reports.py | CTERA-Networks/ctera-python-sdk | 5 | 12762894 | from .base_command import BaseCommand
class Reports(BaseCommand):
"""
Reports APIs
"""
def storage(self):
"""
Retrieve the portals statistics report.\n
To retrieve this report, you must first browse the Global Administration Portal, using: `GlobalAdmin.portals.browse_global_adm... | 2.46875 | 2 |
Genome/NN/Brain.py | emre6943/MoneyBoi | 0 | 12762895 | from Genome.NN.Layer import Layer
import numpy as np
import pickle
class Brain:
def __init__(self, brain_structure):
self.brain_structure = brain_structure
self.layers = []
self.id = 0
# First layer added here
ids = []
genes = []
for i in range(brain_struct... | 2.640625 | 3 |
Official_Model_For_Paper/ModelTraining/TwoStep_Algorithm1_Clip/run.py | hyliang96/ICNN | 0 | 12762896 | <reponame>hyliang96/ICNN<gh_stars>0
import os
# rlaunch = 'rlaunch --cpu=4 --memory=4096 --gpu=1 --preemptible=no '
datasets = ['VOCpart']
depths = [152]
gpu_id = '0'
batchsize = 32
epoch = 300
# exp_dir = '/data/ouyangzhihao/Exp/ICNN/LearnableMask/tb_dir/learnable_mask_baseline/Debug'
optim = 'adam'
lr = '1e-5' # fi... | 1.679688 | 2 |
doc/Programs/LifeScience/Hudson_Bay.py | anacost/MachineLearning | 1 | 12762897 | <reponame>anacost/MachineLearning
import numpy as np
import matplotlib.pyplot as plt
def solver(m, H0, L0, dt, a, b, c, d, t0):
"""Solve the difference equations for H and L over m years
with time step dt (measured in years."""
num_intervals = int(m/float(dt))
t = np.linspace(t0, t0 + m, num_intervals... | 3.59375 | 4 |
tests/commands/source/test_sql.py | atviriduomenys/spinta | 2 | 12762898 | <filename>tests/commands/source/test_sql.py
import collections
import pytest
import sqlalchemy as sa
from spinta.testing.datasets import pull
SQL = collections.namedtuple('SQL', ('engine', 'schema'))
@pytest.fixture
def sql(rc):
dsn = rc.get('backends', 'default', 'dsn', required=True)
engine = sa.create_e... | 2.140625 | 2 |
lib-src/lv2/sratom/waflib/TaskGen.py | Marcusz97/CILP_Facilitatore_Audacity | 24 | 12762899 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import copy,re,os
from waflib import Task,Utils,Logs,Errors,ConfigSet,Node
feats=Utils.defaultdict(set)
class task_gen(object):
mappings={}
prec=Utils.defaultdict(list)
def... | 2.125 | 2 |
we-dap/__init__.py | jeremyleung521/WE_dap | 1 | 12762900 | """
Author: <NAME>
Date of Creation: September 13th, 2021
Description:
"""
# Welcome to the WE-dap module!
| 0.96875 | 1 |
jobs/api.py | imcodingideas/CS10-job-board | 0 | 12762901 | <filename>jobs/api.py<gh_stars>0
from .models import JobPost, User, UserMembership, Membership, Payment
from rest_framework import serializers
# Customization of UserSerializer
from rest_framework.utils import model_meta
from .seralizer_helpers import raise_errors_on_nested_writes
from django.contrib.auth.hashers impor... | 2.15625 | 2 |
nps.py | BenDelgado/now-playing-spotify | 0 | 12762902 | <filename>nps.py
import spotipy
def artist(x):
print(x)
radiohead = 'Radiohead'
artist('Radiohead')
artist(123)
artist(radiohead)
| 1.710938 | 2 |
receipt_parser_core/enhancer.py | Dielee/receipt-parser-legacy | 611 | 12762903 | # !/usr/bin/python3
# coding: utf-8
# Copyright 2015-2018
#
# 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... | 2.65625 | 3 |
tests/view/test_images.py | hnesk/ocrd-browser | 14 | 12762904 | import unittest
from unittest.mock import MagicMock
from ocrd_browser.view import ViewImages
from ocrd_browser.ui import MainWindow
from tests import TestCase
class ViewImagesTestCase(TestCase):
def setUp(self):
self.vx = ViewImages('unique', MagicMock(spec=MainWindow))
def test_can_construct(self):... | 2.25 | 2 |
migrations/versions/6c5a2b1c24f3_seventh_migration.py | Maryan23/1-MIN-OF-YOU | 0 | 12762905 | <gh_stars>0
"""Seventh migration
Revision ID: 6c5a2b1c24f3
Revises: <PASSWORD>
Create Date: 2021-11-10 12:13:42.087615
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6c5a2b1c24f3'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None
def upgra... | 1.75 | 2 |
Problem_9_hard.py | alucardthefish/DailyCodingProblem | 0 | 12762906 | # This problem was asked by Airbnb.
#
# Given a list of integers, write a function that returns the largest sum of non-adjacent numbers.
# Numbers can be 0 or negative.
# For example, [2, 4, 6, 2, 5] should return 13, since we pick 2, 6, and 5. [5, 1, 1, 5] should return 10,
# since we pick 5 and 5.
# Follow-up: Can yo... | 4.125 | 4 |
Includes/include/python3.py | WikiLibs/Parser | 0 | 12762907 | <gh_stars>0
import python31 as p3
from python31 import Test as t3
import sys
print('Python', sys.version)
print('\ntiming range()')
print('Python', sys.version)
print('Hello, World!')
print("some text,", end="")
print(' print more text on the same line')
print('Python', sys.version)
print('3 / 2 =', 3 / 2)
print('... | 2.546875 | 3 |
manhattan/tests/test_timerotating_log.py | cartlogic/manhattan | 1 | 12762908 | from __future__ import absolute_import, division, print_function
import types
import time
from threading import Thread
from manhattan.record import Record, PageRecord, GoalRecord
from manhattan.log.timerotating import TimeRotatingLog
from .base import BaseTest, work_path
def set_fake_name(log, index):
def fake... | 2.234375 | 2 |
lib/python3.6/site-packages/trello/card.py | HaiBinh/slack_for_trello | 0 | 12762909 | <gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import with_statement, print_function, absolute_import
from dateutil import parser as dateparser
from trello.checklist import Checklist
from trello.label import Label
class Card(object):
"""
Class representing a Trello card. Card attributes are stored on
... | 2.953125 | 3 |
tlib/es/index_stress.py | txu2008/TXLIB | 1 | 12762910 | <reponame>txu2008/TXLIB
# !/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/10/11 14:02
# @Author : Tao.Xu
# @Email : <EMAIL>
"""Elasticsearch Stress
FYI: https://github.com/logzio/elasticsearch-stress-test
"""
import random
import string
import time
import sys
import json
# import urllib3
import thr... | 2.1875 | 2 |
flask_helloworld_apache2/workflow_handler.py | sidhshar/gcp-explore | 0 | 12762911 | <filename>flask_helloworld_apache2/workflow_handler.py<gh_stars>0
import datetime
import time
import localsettings as ls
import sqlite3
class Singleton(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super(Singleton, cls).__cal... | 2.421875 | 2 |
reproductions/offline/discrete_cql.py | ningyixue/AIPI530_Final_Project | 1 | 12762912 | import argparse
import d3rlpy
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--game', type=str, default='breakout')
parser.add_argument('--seed', type=int, default=1)
parser.add_argument('--gpu', type=int)
args = parser.parse_args()
d3rlpy.seed(args.seed)
dataset, en... | 2.125 | 2 |
main.py | riandeoliveira/mern-stack-project-starter | 0 | 12762913 | <reponame>riandeoliveira/mern-stack-project-starter
import pyautogui
import pyperclip
import time
print('========== MERN STACK PROJECT STARTER ==========\n')
print('by <NAME>\n')
# Pega os dados necessários do usuário.
USERNAME = input('Nome de usuário do GitHub: ')
PROJECT_NAME = input('Nome do projeto: ')
DB_NAME =... | 3.015625 | 3 |
src/main/python/trajectory/utils/prereqs.py | jrouly/trajectory | 4 | 12762914 | """
trajectory/utils/prereqs.py
Author: <NAME>
Define a collection of useful utility functions for analyzing course and
departmental prerequisite structures.
"""
def get_prereq_graph(course_id, format=None):
"""
Generate a graph of prerequisites within a course. If format is not
requested, simply return ... | 2.890625 | 3 |
blusky/transforms/apply_father_wavelet_2d.py | fogoke/blusky | 3 | 12762915 | import re
import keras.backend as keras_backend
from keras.layers import DepthwiseConv2D
import numpy as np
from traits.api import Float, HasStrictTraits, Instance, Int, Tuple, Property
from blusky.wavelets.i_wavelet_2d import IWavelet2D
class ApplyFatherWavlet2D(HasStrictTraits):
"""
Provides a "convolut... | 3.078125 | 3 |
controller.py | elsayed5454/Signal-Flow-Graph-Solver | 1 | 12762916 | import networkx as nx
from matplotlib.pyplot import draw, show, clf
from mason import mason
def add_node(g, node):
if node == "":
return "Add name to the node"
g.add_node(node)
return "Node added successfully"
def remove_node(g, node):
if g.has_node(node):
g.remove_no... | 3.578125 | 4 |
imagepath.py | gitwipo/path_utils | 0 | 12762917 | #!/usr/bin/env python
# Copyright 2019 <NAME>
#
# 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 agre... | 2.859375 | 3 |
statusbar.py | tushar176/Notepad- | 1 | 12762918 | <reponame>tushar176/Notepad-
from tkinter import BOTTOM
from tkinter import ttk
'''Here statusbar and functionality of linebar is defined '''
class Statusbar:
def __init__(self, windows, text_write,linebar):
self.root = windows
self.text_write = text_write
self.linebar=linebar
... | 3.578125 | 4 |
tests/API1/testutils.py | sdrees/param | 90 | 12762919 | <gh_stars>10-100
import datetime as dt
import param
import pytest
from param import guess_param_types
try:
import numpy as np
except ImportError:
np = None
try:
import pandas as pd
except ImportError:
pd = None
now = dt.datetime.now()
today = dt.date.today()
guess_param_types_data = {
'Paramet... | 2.28125 | 2 |
cs15211/VerifyinganAlienDictionary.py | JulyKikuAkita/PythonPrac | 1 | 12762920 | <reponame>JulyKikuAkita/PythonPrac
# coding=utf-8
__source__ = 'https://leetcode.com/problems/verifying-an-alien-dictionary/'
# Time: O(N)
# Space: O(1)
#
# Description: Leetcode # 953. Verifying an Alien Dictionary
#
# In an alien language, surprisingly they also use english lowercase letters,
# but possibly in a dif... | 3.8125 | 4 |
ptart/migrations/0011_label_deprecated.py | Fisjkars/sh00t | 17 | 12762921 | # Generated by Django 2.2.24 on 2022-04-20 16:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ptart', '0010_project_archived'),
]
operations = [
migrations.AddField(
model_name='label',
name='deprecated',
... | 1.390625 | 1 |
src/ion/process/test/manage_system.py | scionrep/scioncc_new | 2 | 12762922 | <filename>src/ion/process/test/manage_system.py
#!/usr/bin/env python
""" call system_management_service actions. use as a proof of concept or the world's worst UI.
invoke with commands like this:
bin/pycc -x ion.process.test.manage_system.ChangeLogLevel logger=ion.process.bootstrap.ion_logger level=DEBUG
... | 2 | 2 |
utility.py | syaoming/molle | 0 | 12762923 | from z3 import *
from operator import or_
from pprint import pprint
def _sorted_inters(inter_list, sp):
''' Sorts the inter_list = [('from', 'to', 'positive'), ...] into a dict,
where keyvalue is a couple of number tuples, wich integer codes as keys.
e.g.
{1: ( (2, 3), (5, 9) )} : species 1 is activa... | 3.171875 | 3 |
functional_tests/test_book.py | PMPL-Arieken/django-locallibrary-tutorial | 1 | 12762924 | import time
from .base import FunctionalTest
from catalog.models import Book
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
bookCatalogLink = '/catalog/books/'
bookDetailsLink = '/catalog/book/'
class TestBookPage(FunctionalTest):
submit_selector = 'input[type=su... | 2.46875 | 2 |
koans/segunda_semana/acerca_de_funciones.py | benjymb/python_koans_pachaqtec | 0 | 12762925 | <filename>koans/segunda_semana/acerca_de_funciones.py<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
def mi_funcion_global(a,b):
return a + b
def funcion_que_no_retorna_nada(a, b):
resultado = a + b
def funcion_con_argumentos_que_tienen_valor_por_defecto(
a, b='Soy el... | 2.9375 | 3 |
rpisec/telegram_bot/commands/status.py | marclr/rpi-security | 0 | 12762926 | <gh_stars>0
def status(bot, update, webcontrol):
chat_id = update.message.chat_id
code, text = webcontrol.execute('detection', 'status')
if code == 200:
bot.sendMessage(chat_id=chat_id, text=text)
else:
bot.sendMessage(chat_id=chat_id, text="Try it later")
| 2.171875 | 2 |
src/check_solution.py | roessig/verify-nn | 1 | 12762927 | from model_boundd import MIPwithBounds
import networkx as nx
def get_vars_and_coefficients(elements, start=3):
"""Use a list which comes from line.split() to create lists of float coefficients and SCIP variables."""
return [var for var in elements[start + 1::2]], [float(coeff) for coeff in elements[start::2]]... | 2.6875 | 3 |
chpt4/coinFlipStreaks.py | maxmacdon/Automate | 0 | 12762928 | #! python3
import random
numberOfStreaks = 0
for experimentNumber in range(10000):
# Code that creates a list of 100 'heads' or 'tails' values.
randomList = []
for listEntry in range(100):
if random.randint(0,1) == 1:
randomList.append('H')
else:
randomList.append('T... | 3.84375 | 4 |
django_eveonline_connector/views/sso.py | KryptedGaming/django-eveonline-connector | 3 | 12762929 | from django.shortcuts import render, redirect
from django_eveonline_connector.models import EveClient, EveToken, EveCharacter, EveScope, EveCorporation, PrimaryEveCharacterAssociation
from django.contrib import messages
from django.contrib.auth.decorators import login_required, permission_required
from django.conf impo... | 1.9375 | 2 |
project/tests/test_string_replace.py | TobiasPrt/Smartphoniker-shop | 2 | 12762930 | from project.server.common.escape import cleanify
class TestReplacements:
def test_ae(self):
assert cleanify("") == ""
assert cleanify("Äpfel") == "Aepfel"
assert cleanify("äpfel") == "aepfel"
assert cleanify("Äpfel Äpfel äpfel") == "Aepfel Aepfel aepfel"
def test_... | 2.34375 | 2 |
src/local/butler/create_config.py | mi-ac/clusterfuzz | 5,023 | 12762931 | # Copyright 2019 Google LLC
#
# 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 writing, ... | 1.265625 | 1 |
examples/4/size.py | ekohilas/comp2041_plpy | 2 | 12762932 | #!/usr/local/bin/python3.5 -u
import sys
sys.stdout.write("Enter a number: ")
a = float(sys.stdin.readline())
if a < 0:
print("negative")
elif a == 0:
print("zero")
elif a < 10:
print("small")
else:
print("large")
| 3.859375 | 4 |
nuitka/utils/Jinja2.py | mikehaben69/Nuitka | 5,421 | 12762933 | # Copyright 2021, <NAME>, mailto:<EMAIL>
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | 1.789063 | 2 |
tests/models/programdb/control/control_unit_test.py | weibullguy/ramstk | 4 | 12762934 | <gh_stars>1-10
# pylint: skip-file
# type: ignore
# -*- coding: utf-8 -*-
#
# tests.models.programdb.control.control_unit_test.py is part of The RAMSTK
# Project
#
# All rights reserved.
# Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com
"""Class for testing FMEA Contro... | 2.234375 | 2 |
tools/my_infer.py | flying0712/reid-strong-baseline | 0 | 12762935 | <reponame>flying0712/reid-strong-baseline
from data.datasets.dataset_loader import read_image # 图片读取方法,可以自己写,我是用的baseline里自带的
import os
import torch
import numpy as np
import json
from utils.re_ranking import re_ranking
os.environ['CUDA_VISIBLE_DEVICES'] = '0' # 指定gpu
device = torch.device("cuda" if torch.cuda.is_av... | 2.375 | 2 |
tests/optimizers/test_binary.py | jole6826/pyswarms | 1 | 12762936 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Import modules
import pytest
import numpy as np
# Import from package
from pyswarms.discrete import BinaryPSO
@pytest.mark.parametrize(
"options",
[
{"c2": 0.7, "w": 0.5, "k": 2, "p": 2},
{"c1": 0.5, "w": 0.5, "k": 2, "p": 2},
{"c1": 0.... | 2.46875 | 2 |
pytest_faker/plugin.py | pytest-dev/pytest-faker | 37 | 12762937 | """pytest-faker plugin."""
import pytest
from faker import Factory
@pytest.fixture(scope='session')
def faker_locale():
"""Faker locale.
None by default which means faker's default locale.
"""
return None
@pytest.fixture(scope='session')
def faker(faker_locale):
"""Faker factory object."""
... | 2.203125 | 2 |
deepvariant/core/variantutils.py | rose-brain/deepvariant | 1 | 12762938 | # Copyright 2017 Google Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
#... | 1.226563 | 1 |
Engine/test_engine.py | spineki/CrazyDiamond | 0 | 12762939 | <filename>Engine/test_engine.py
from Engine.engine import Engine
def test_react_to_keyword():
e = Engine()
e.reactive_keyword = ["apple", "banana"]
verif = e.react_to_keyword("apple")
assert verif == True
verif = e.react_to_keyword("ban")
assert verif == True
verif = e.react_to_keyword("ban... | 2.5625 | 3 |
varats/varats/plots/case_study_overview.py | se-passau/VaRA-Tool-Suite | 8 | 12762940 | <gh_stars>1-10
"""Generate plots that show a detailed overview of the state of one case-
study."""
import typing as tp
import matplotlib.pyplot as plt
from matplotlib import style
from pandas import DataFrame
from varats.data.databases.file_status_database import FileStatusDatabase
from varats.data.reports.empty_rep... | 2.21875 | 2 |
old/test/dist.py | dominickeehan/bayesian-microlensing | 1 | 12762941 | import MulensModel as mm
import Functions as mc
import random
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rc
import matplotlib
from scipy.stats import truncnorm, loguniform, uniform
#plt.style.use('ggplot')
print(plt.style.available)
#print(plt.rcParams["font.family"].available)
#print... | 2.1875 | 2 |
s3parcp_download/miniwdl_s3parcp.py | chanzuckerberg/miniwdl-s3parcp | 1 | 12762942 | <gh_stars>1-10
"""
miniwdl download plugin for s3:// URIs using s3parcp -- https://github.com/chanzuckerberg/s3parcp
Requires s3parcp docker image tag supplied in miniwdl configuration, either via custom cfg file
(section s3parcp, key docker_image) or environment variable MINIWDL__S3PARCP__DOCKER_IMAGE.
Inherits AWS cr... | 1.984375 | 2 |
projects/urls.py | ahmedbatty/portfolio | 0 | 12762943 | <filename>projects/urls.py<gh_stars>0
from django.urls import path
from .views import ProjectView, AboutView, ContactView
urlpatterns = [
# ex: /project/5/
path('project/<int:project_id>/<slug:project_slug>', ProjectView.as_view(), name='project'),
# ex: /about/
path('about/', AboutView.as_view(), na... | 1.929688 | 2 |
pyiron_atomistics/gpaw/pyiron_ase.py | dgehringer/pyiron_atomistics | 0 | 12762944 | # coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
from ase import Atoms
from ase.constraints import dict2constraint
import copy
import importlib
import numpy as np
from p... | 1.875 | 2 |
digsby/src/tests/testgui/uberdemos/UberProgressBarDemo.py | ifwe/digsby | 35 | 12762945 | import wx
from gui.uberwidgets.UberProgressBar import UberProgressBar
from gui import skin as skincore
class F(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, wx.NewId(), "Progress Bar sampler",(0,0),(600,250))
self.Bind(wx.EVT_SLIDER, self.on_slide)
self.content = wx.BoxSiz... | 2.5625 | 3 |
mps_database/models/threshold_fault.py | slaclab/mps_database | 0 | 12762946 | from sqlalchemy import Column, Integer, Float, String, Boolean, ForeignKey
from sqlalchemy.orm import relationship, backref
from mps_database.models import Base
class ThresholdFault(Base):
"""
ThresholdFault class (threshold_faults table)
Describe an analog fault, which is generated by an AnalogDevice.
The An... | 2.8125 | 3 |
SR/model/SRCNN.py | AntonyYX/Super-Resolution | 0 | 12762947 | <gh_stars>0
import math
from torch import nn
import torch
from torch.nn.modules.activation import ReLU
from torchvision import transforms
from PIL import Image
class SRCNN(nn.Module):
def __init__(self, in_channel: int = 3):
super(SRCNN, self).__init__()
self.body = nn.Sequential(
nn.C... | 2.734375 | 3 |
assignments/assignment-6/src/GOT_classification.py | PeterThramkrongart/cds-language-portfolio | 1 | 12762948 | <reponame>PeterThramkrongart/cds-language-portfolio
#!/usr/bin/env python
# system tools
import os
import sys
sys.path.append(os.path.join(".."))
# pandas, numpy
import pandas as pd
import numpy as np
# import my classifier utility functions
import utils.classifier_utils as clf
from sklearn.preprocessing import Labe... | 2.34375 | 2 |
main.py | JAMJU/KernelMethod | 0 | 12762949 | import numpy as np
from logistic_regression import logistic_kernel_regression, compute_label
from kernel_creation import convert_spectral_kernel_quad, convert_spectral_kernel_quint, convert_spectral_kernel_trig
from kernel_creation import convert_acid_kernel, convert_acid_quad, convert_mismatch_lev, convert_lect_trig, ... | 2.109375 | 2 |
test/test_algorithm.py | ehigham/broad-challenge | 0 | 12762950 | # -*- coding: utf-8 -*-
import unittest
import networkx
from challenge.algorithm import dijkstras_shortest_path
class TestAlgorithmModule(unittest.TestCase):
def test_empty_graph(self):
"""Nodes are memebers of graph.nodes"""
graph = networkx.Graph()
with self.assertRaises(ValueError):
... | 3.71875 | 4 |