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 |
|---|---|---|---|---|---|---|
binatron.py | tosi-n/BITRON | 1 | 43900 | # <NAME>
# /Module for Binary Classification
from classification import ClassificationModel
import pandas as pd
import logging
import sklearn
# import fire
eval_df = pd.read_csv('/Volumes/Loopdisk/Bi_Transformer/data/dev.csv', sep='\t')
eval_df = eval_df[['0', '1']]
eval_df['0'] = eval_df['0'].astype(str)
model =... | 3.109375 | 3 |
src/sphinx_c_autodoc/__init__.py | speedyleion/sphinx-c-doc | 7 | 43901 | """
sphinx_c_autodoc is a package which provide c source file parsing for sphinx.
It is composed of multiple directives and settings:
.. rst:directive:: .. c:module:: filename
A directive to document a c file. This is similar to :rst:dir:`py:module`
except it's for the C domain. This can be used for both c... | 2.34375 | 2 |
odoo-13.0/addons/l10n_mx/models/account.py | VaibhavBhujade/Blockchain-ERP-interoperability | 0 | 43902 | # coding: utf-8
# Copyright 2016 Vauxoo (https://www.vauxoo.com) <<EMAIL>>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
import re
from odoo import models, api, fields, _
class AccountJournal(models.Model):
_inherit = 'account.journal'
@api.model
def _prepare_liquidity_account(self, na... | 1.78125 | 2 |
demo.py | OddBloke/RustPython | 0 | 43903 |
print(42)
| 1.523438 | 2 |
2d_navigation/dynamical_system/modulation.py | nbfigueroa/RoCUS | 0 | 43904 | <gh_stars>0
import sys
import numpy as np
def neighbor_idxs(i, j, H, W):
i_s = set([i, min(i + 1, H - 1), max(i - 1, 0)])
j_s = set([j, min(j + 1, W - 1), max(j - 1, 0)])
neighbors = set([(i, j) for i in i_s for j in j_s])
neighbors.remove((i, j))
return neighbors
def enlarge(occ_grid):
new_occ_grid = np.zeros... | 2.734375 | 3 |
opensda_flasher/utilities.py | jed-frey/opensda_flasher | 8 | 43905 | <filename>opensda_flasher/utilities.py
"""Module Utilities."""
import os
path = os.path.abspath(os.path.dirname(__file__))
| 1.679688 | 2 |
src/bromine/exceptions.py | Etiqa/bromine | 2 | 43906 | """
Global Bromine exception and warning classes.
"""
from selenium.common.exceptions import (NoSuchElementException, # pylint: disable=unused-import
StaleElementReferenceException,
TimeoutException)
class BromineException(Exception):
... | 2.3125 | 2 |
code/group_test_simulations/test_on_simulated_population.py | cleary-lab/covid19-group-tests | 1 | 43907 | <reponame>cleary-lab/covid19-group-tests
import numpy as np
from scipy.stats import poisson
from scipy.sparse import load_npz
import glob,os
import argparse
def random_binary_balanced(m,n,q):
A = np.zeros((m,n))
for i in range(n):
idx = np.random.choice(m,q,replace=False)
A[idx,i] = 1
return A
def decode(y,A,e... | 2.28125 | 2 |
kronos_modeller/kronos_modeller/logreader/scheduler_reader.py | ecmwf/kronos | 4 | 43908 | # (C) Copyright 1996-2018 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergov... | 1.71875 | 2 |
problems/alphabet_war.py | stereoabuse/codewars | 0 | 43909 | <filename>problems/alphabet_war.py
## Alphabet war
## 7 kyu
## https://www.codewars.com/kata/59377c53e66267c8f6000027
def alphabet_war(fight):
l = dict(zip('wpbs', range(4,0,-1)))
r = dict(zip('mqdz', range(4,0,-1)))
left, right = 0,0
for char in fight:
if char in l:
... | 3.46875 | 3 |
tools/parse_log.py | KyleHai/DeepSpeech2 | 158 | 43910 | import fileinput as fin
# funcs:
def findValWithFormat(line):
lines.append(line)
taken = line.split(" ")
raw_val = taken[-1]
val = raw_val.split("/")[-1]
val = val[0:-2]
if 'us' in val:
val = float(val[0:val.find('us')])
val = val/1000
else:
val = float(val[0:val.find('ms')])
return val
def getCellNum(l... | 2.484375 | 2 |
sps/sps/report/contract_posting/contract_posting.py | tushar7724/SPS | 0 | 43911 | <reponame>tushar7724/SPS
# Copyright (c) 2013, <NAME> and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
def execute(filters=None):
columns, data = [], []
if len(filters.keys()) > 1:
rows= []
if not filters:
columns, d... | 2.0625 | 2 |
api_client/auth.py | ciandt-d1/cvtool-ingestion-pipeline | 0 | 43912 | <reponame>ciandt-d1/cvtool-ingestion-pipeline
import base64
import json
import time
from google.appengine.api import app_identity
DEFAULT_SERVICE_ACCOUNT = app_identity.get_service_account_name()
def generate_jwt():
"""Generates a signed JSON Web Token using the Google App Engine default
service account."""... | 2.390625 | 2 |
src/__init__.py | neuront/jtrans | 1 | 43913 | <filename>src/__init__.py<gh_stars>1-10
__version__ = '0.0.3'
REPO = 'https://github.com/neuront/jtrans'
| 1.15625 | 1 |
py_dp/dispersion/dispersion_models_1d.py | amirdel/dispersion-continua | 1 | 43914 | <reponame>amirdel/dispersion-continua
# Copyright 2017 <NAME>, <EMAIL>
#
# Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee
# is hereby granted, provided that the above copyright notice and this permission notice appear in all
# copies.
#
# THE SOFTWARE IS PROVIDED "A... | 1.851563 | 2 |
PhotoShowcase/photolibrary.py | Reinhardtlotter/Valen-s-Repository-Tri-3 | 0 | 43915 | <filename>PhotoShowcase/photolibrary.py
from __future__ import print_function
import os.path
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
import google_auth_oauthlib
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery... | 3.125 | 3 |
SimpleSAC/sampler.py | chethus/CQL | 0 | 43916 | <filename>SimpleSAC/sampler.py
import numpy as np
from collections import defaultdict
from .utils import flatten_dict
class StepSampler(object):
def __init__(self, env, max_traj_length=1000):
self.max_traj_length = max_traj_length
self._env = env
self._traj_steps = 0
self._current... | 2.234375 | 2 |
example.py | Til-Piffl/RAVE_SelectionFunction | 0 | 43917 | import pyRAVE
import numpy as np
import healpy
# Load RAVE data
RAVE = pyRAVE.readCSV('RAVE_DR4.csv')
# =======================================================
# Selection criteria by the user
user_select = np.ones(len(RAVE['rave_obs_id']),dtype=bool) # all entries
user_select = (RAVE['snr_k']>20) &\
(... | 2.484375 | 2 |
topic/templatetags/recent_reply.py | reBiocoder/bioforum | 33 | 43918 | <reponame>reBiocoder/bioforum<gh_stars>10-100
from django import template
from topic.models import Create_Topic
register=template.Library()
@register.simple_tag
def recent_reply(value):
info=Create_Topic.objects.get(title=value)
reply=info.topic_comment_set.all().order_by('-add_time')
i="无"
try:... | 1.851563 | 2 |
shap/explainers/tree.py | naivelamb/shap | 0 | 43919 | import numpy as np
import multiprocessing
import sys
have_cext = False
try:
from .. import _cext
have_cext = True
except ImportError:
pass
except:
print("the C extension is installed...but failed to load!")
pass
try:
import xgboost
except ImportError:
pass
except:
print("xgboost is ins... | 2.703125 | 3 |
tmd/bilayer/clean_wfc.py | tflovorn/tmd | 1 | 43920 | import os
import shutil
from argparse import ArgumentParser
from tmd.bilayer.dgrid import get_prefixes
from tmd.bilayer.bilayer_util import global_config
def _main():
parser = ArgumentParser("wfc cleanup")
parser.add_argument("--subdir", type=str, default=None,
help="Subdirectory under work_base wh... | 2.375 | 2 |
planner/section.py | ksu-web-dev/planner | 0 | 43921 | <reponame>ksu-web-dev/planner<gh_stars>0
import dataclasses
import time
@dataclasses.dataclass
class Section:
department: str = ''
course_number: int = 0
full_name: str = ''
type: str = ''
instructor: str = ''
section_letter: str = ''
section_number: int = 0
start_time: time.time = Non... | 2.859375 | 3 |
app/src/aipcloud/sound/emotion/emotion.py | alaxa27/AIPCloud_Platform | 0 | 43922 | <reponame>alaxa27/AIPCloud_Platform
# -*- coding: utf-8 -*-
import os
from keras.models import model_from_json, Model
import time
import numpy as np
import soundfile as sf
import librosa
import configparser
class SpeechEmotionAnalyzer:
def __init__(self):
self.loaded = False
self.model = None
... | 2.421875 | 2 |
employee/urls.py | shourya1997/django-crud | 0 | 43923 | <gh_stars>0
from django.urls import path
from rest_framework.authtoken.views import obtain_auth_token
from employee.views import EmployeeCreateView, EmployeeListView, EmployeeUpdateView, login_view, register_view, logout_view
app_name = 'employee'
urlpatterns = [
path('e/create', EmployeeCreateView.as_view(), nam... | 1.890625 | 2 |
src/selena/boards/forms.py | deejay1/selena | 23 | 43924 | <filename>src/selena/boards/forms.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django import forms
from services.models import Service
class DateRangeForm(fo... | 2.09375 | 2 |
Dev/Cpp/CreateHeader.py | NumAniCloud/Effekseer | 1 | 43925 | <filename>Dev/Cpp/CreateHeader.py<gh_stars>1-10
import re
import codecs
def isValidLine(line):
if re.search('include \"', line) == None or line.find('.PSVita') != -1 or line.find('.PS4') != -1 or line.find('.Switch') != -1 or line.find('.XBoxOne') != -1:
return True
return False
class CreateHeader:
def __init__(... | 2.71875 | 3 |
hierarchical_auth/admin.py | digitalemagine/django-hierarchical-auth | 1 | 43926 | <filename>hierarchical_auth/admin.py
from django.contrib import admin
from django.conf import settings
from django.db.models import get_model
from models import Group, User # this takes care of custom users Etc.
from django.contrib.auth.admin import GroupAdmin
try:
module_name, class_name = settings.AUTH_USER_AD... | 2.078125 | 2 |
pyramid_learning_journal/routes.py | ChristopherSClosser/pyramid-learning-journal | 0 | 43927 | <reponame>ChristopherSClosser/pyramid-learning-journal
"""Define routes."""
def includeme(config):
"""App routes."""
config.add_static_view(
'static',
'pyramid_learning_journal:static',
cache_max_age=3600
)
config.add_route('home', '/')
config.add_route('detail', '/journal/... | 2.171875 | 2 |
webhdfspy/__init__.py | fsouto/webhdfspy | 0 | 43928 | from .webhdfspy import WebHDFSClient
| 1.085938 | 1 |
app.py | dcshoecousa/MimiWork | 0 | 43929 | <reponame>dcshoecousa/MimiWork
import uvicorn
from fastapi import FastAPI, Request, status
from fastapi.encoders import jsonable_encoder
from fastapi.middleware.cors import CORSMiddleware
from fastapi.middleware.gzip import GZipMiddleware
from fastapi.exceptions import RequestValidationError
from fastapi.responses impo... | 2.171875 | 2 |
tests/test_conversions.py | lehvitus/eln | 2 | 43930 | <gh_stars>1-10
from click.testing import CliRunner
# from eln.commands.conversions.main import convert
# def test_conversions():
# runner = CliRunner()
# result = runner.invoke(convert)
| 1.5 | 2 |
calc.py | nigo81/myquant | 1 | 43931 | <filename>calc.py
#!/usr/bin python3
# -*- coding:UTF-8 -*-
# Author: nigo
import os
import json
import pandas as pd
import akshare as ak
import baostock as bs
import datetime
import numpy as np
from multiprocessing import Pool
import multiprocessing.pool as mpp
import istarmap
from tqdm import tqdm
import plotly.figu... | 2.1875 | 2 |
apollo/__init__.py | yezl77/pyapollo | 5 | 43932 | def start():
print("import successful") | 0.980469 | 1 |
2016/day6/day6.py | e-jameson/aoc | 0 | 43933 | from helpers import as_list
lines = as_list('2016/day6/input.txt')
# lines = as_list('2016/day6/example-input.txt')
length = len(lines[0])
positions = {
}
for line in lines:
for i, c in enumerate(line):
v = positions.setdefault(i, dict()).setdefault(c, 0)
positions[i][c] = v + 1
most_common = ... | 3.3125 | 3 |
src/camera/camera.py | jucoba/IpCamMonitorSystem | 1 | 43934 | from utils.paramUtils import *
from utils.configUtils import *
class Camera():
json_data = None
paramUtil = ParamUtils()
configUtil = ConfigUtils()
def __init__(self, json_data):
self.json_data = json_data
self.url = self.configUtil.getUrl(json_data)
def motion_detected(self):
params = self.get_stat... | 2.578125 | 3 |
cliqz/quiz.py | InTEGr8or/cli-quiz | 0 | 43935 | <gh_stars>0
import datetime
import random
import click
import json
from cliqz.question import Question
from cliqz.bcolors import bcolors
class Quiz:
count = 0
questions = []
description = ""
deadline = None
index = 0
max_questions = 10
def __init__(self, quiz):
self.count = len(qui... | 3.125 | 3 |
django-varnish-master/setup.py | vdmann/cse-360-image-hosting-website | 0 | 43936 | from distutils.core import setup
setup(
name = "django-varnish",
version = '0.1',
url = 'http://opensource.washingtontimes.com/projects/django-varnish/',
author = '<NAME>',
author_email= '<EMAIL>',
long_description=open('README.rst').read(),
description = 'Integration between Django and the... | 1.171875 | 1 |
samples/snippets/sample_templates.py | georgiyekkert/python-compute | 0 | 43937 | <reponame>georgiyekkert/python-compute<gh_stars>0
# Copyright 2021 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 req... | 2.34375 | 2 |
projects/jakub/pipeline/learning_curve.py | chengsoonong/mclass-sky | 9 | 43938 | <reponame>chengsoonong/mclass-sky<filename>projects/jakub/pipeline/learning_curve.py
import json
import sys
import os
import numpy as np
import sklearn.model_selection
import model
import recommenders
# Import splitter
sys.path.insert(1, '..')
import splitter
TRAINING_SAMPLES_NUM = 1000000
TESTING_SAMPLES_NUM = 50... | 2.78125 | 3 |
detect_servers_tpu.py | GSByeon/edge-tpu-servers | 1 | 43939 | <reponame>GSByeon/edge-tpu-servers
"""
Detect objects and faces using tensorflow-tpu served by zerorpc.
This needs to be called from a zerorpc client with
an array of alarm frame image paths.
This is part of the smart-zoneminder project.
See https://github.com/goruck/smart-zoneminder
Copyright (c) 2018, 2019 <NAME>
... | 2.46875 | 2 |
python-scripts/brightness.py | niwhsa9/dwmblocks | 0 | 43940 | import os
import time
max_brightness = 26666
stream = os.popen("cat /sys/class/backlight/intel_backlight/brightness")
output = int(stream.read())
print(f"{int(output/max_brightness * 100)}%")
| 2.5 | 2 |
noodles/draw_workflow/__init__.py | BvB93/noodles | 22 | 43941 | <reponame>BvB93/noodles<filename>noodles/draw_workflow/__init__.py
from .draw_workflow import draw_workflow, graph
__all__ = ['draw_workflow', 'graph']
| 1.125 | 1 |
libdyson/dyson_pure_humidify_cool.py | vbsoftpl/libdyson | 28 | 43942 | """Dyson Pure Humidify+Cool device."""
from typing import Optional
from .const import HumidifyOscillationMode, WaterHardness
from .dyson_pure_cool import DysonPureCoolBase
WATER_HARDNESS_ENUM_TO_STR = {
WaterHardness.SOFT: "2025",
WaterHardness.MEDIUM: "1350",
WaterHardness.HARD: "0675",
}
WATER_HARDNESS... | 2.890625 | 3 |
rainbow/__init__.py | Elysiumskrieger/rainbow-console | 0 | 43943 | <gh_stars>0
"""
This module is designed to color the information displayed in the console.
import rainbow
rainbow.print("#F07427example #F4CA16print")
rainbow.print("example print", color="#CC397B")
print(rainbow.paint("Hello, world!", color="#318CE7"))
Colored line example: "#318CE7Hello #FECF3DWorld#30983... | 3.859375 | 4 |
src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/spalloc/config.py | Roboy/LSM_SpiNNaker_MyoArm | 2 | 43944 | """The spalloc command-line tool and Python library determine their default
configuration options from a spalloc configuration file if present.
.. note::
Use of spalloc's configuration files is entirely optional as all
configuration options may be presented as arguments to commands/methods at
runtime.
By... | 2.34375 | 2 |
num_fh/resolution/framework/predictors/model_base_predictor.py | yanaiela/num_fh | 32 | 43945 | from overrides import overrides
from allennlp.data import Instance
from allennlp.common.util import JsonDict
from allennlp.predictors.predictor import Predictor
@Predictor.register('nfh_classification')
class NfhDetectorPredictor(Predictor):
""""Predictor wrapper for the NfhDetector"""
@overrides
def _js... | 2.609375 | 3 |
sols/1844.py | Paul11100/LeetCode | 0 | 43946 | <reponame>Paul11100/LeetCode
class Solution:
# Codes (Accepted), O(n) time and space
def replaceDigits(self, s: str) -> str:
li, n = [], len(s)
for i in range(0, n, 2):
if i+1 < n:
code = ord(s[i]) + int(s[i+1])
li += [s[i], chr(code)]
else... | 3.234375 | 3 |
UnityEnv.py | jsztompka/MultiAgent-PPO | 21 | 43947 | import numpy as np
from unityagents import UnityEnvironment
"""UnityEnv is a wrapper around UnityEnvironment
The main purpose for this Env is to establish a common interface which most environments expose
"""
class UnityEnv:
def __init__(self,
env_path,
train_mode = True... | 3.03125 | 3 |
netcad_demo_meraki1/design.py | jeremyschulman/netcad-demo-meraki-1 | 0 | 43948 | # -----------------------------------------------------------------------------
# System Imports
# -----------------------------------------------------------------------------
from operator import itemgetter
# -----------------------------------------------------------------------------
# Public Imports
# ----------... | 1.578125 | 2 |
maskrcnn_benchmark/modeling/roi_heads/ke_head/inference.py | happog/Box_Discretization_Network | 285 | 43949 | import torch
from torch import nn
import pdb, os
from shapely.geometry import *
from maskrcnn_benchmark.structures.boxlist_ops import cat_boxlist
import time
import matplotlib.pyplot as plt
import numpy as np
from scipy.signal import argrelextrema
import random
import string
all_types = [[1,2,3,4],[1,2,4,3],[1,3,2,4... | 1.796875 | 2 |
Chapter01/clt_app/clt_demo.py | free2fork/streaml | 12 | 43950 | import streamlit as st
import numpy as np
import matplotlib.pyplot as plt
perc_heads = st.number_input(label='Chance of Coins Landing on Heads', min_value=0.0, max_value=1.0, value=.5)
graph_title = st.text_input(label='Graph Title')
binom_dist = np.random.binomial(1, perc_heads, 1000)
list_of_means =... | 3.15625 | 3 |
edw_fluent/signals/handlers/__init__.py | infolabs/django_edw_fluent | 1 | 43951 | # -*- coding: utf-8 -*-
from django.db.utils import ProgrammingError
try:
from edw_fluent.signals.handlers import (
page_layout,
template,
entity,
data_mart,
term,
simple_page,
hot_tag
)
except (AttributeError, ProgrammingError) as e:
# initial migrat... | 1.71875 | 2 |
submission/util.py | pwqbot/eoj3 | 107 | 43952 | <reponame>pwqbot/eoj3<filename>submission/util.py
class SubmissionStatus(object):
SUBMITTED = -4
WAITING = -3
JUDGING = -2
WRONG_ANSWER = -1
ACCEPTED = 0
TIME_LIMIT_EXCEEDED = 1
IDLENESS_LIMIT_EXCEEDED = 2
MEMORY_LIMIT_EXCEEDED = 3
RUNTIME_ERROR = 4
SYSTEM_ERROR = 5
COMPILE_ERROR = 6
SCORED = 7
... | 2.875 | 3 |
Transforms/Domain/dmarc.py | redhuntlabs/Maltego-Scripts | 21 | 43953 | import sys
import emailprotectionslib.dmarc as dmarc
from MaltegoTransform import *
mt = MaltegoTransform()
mt.parseArguments(sys.argv)
domain = mt.getValue()
mt = MaltegoTransform()
try:
dmarc_record = dmarc.DmarcRecord.from_domain(domain)
#print spf_record
mt.addEntity("maltego.Phrase","DMARC Record: "... | 2.4375 | 2 |
idfy_rest_client/models/update_signer_request_wrapper.py | dealflowteam/Idfy | 0 | 43954 | # -*- coding: utf-8 -*-
"""
idfy_rest_client.models.update_signer_request_wrapper
This file was automatically generated for Idfy by APIMATIC v2.0 ( https://apimatic.io )
"""
from idfy_rest_client.api_helper import APIHelper
import idfy_rest_client.models.redirect_settings
import idfy_rest_client.mode... | 2.03125 | 2 |
lintcode/String/956. Data Segmentation.py | yanshengjia/algorithm | 23 | 43955 | """
Given a string str, we need to extract the symbols and words of the string in order.
Example 1:
input: str = "(hi (i am)bye)"
outut:["(","hi","(","i","am",")","bye",")"].
Explanation:Separate symbols and words.
Solution:
Go through the str, push the alphabetical into stack and append it to res list if we meet a... | 4.21875 | 4 |
src/orm.py | brianherman/Saati | 0 | 43956 | from sqlalchemy import Column, Integer, String
from sqlalchemy.dialects.postgresql import ARRAY, UUID
from sqlalchemy.ext.declarative import declarative_base
from pydantic import BaseModel, constr
Base = declarative_base()
class EventOrm(Base):
__tablename__ = 'EventLog'
uuid = Column(UUID, primary_key=True,... | 2.515625 | 3 |
operacionArchivos.py | FernandoTorresL/search_dispmag_files | 0 | 43957 | import os
def obtenNombreArchivos(ruta):
archivos = list()
with os.scandir(ruta) as ficheros:
for fichero in ficheros:
archivos.append(fichero.name)
return archivos
def concatenaRegistros(ruta,nombreArchivo):
registroConcatenado = list()
with open(ruta,'r') as lecturaArchivo:
for registr... | 3 | 3 |
scripts/fetching/fetch_from_paavo.py | xiaoxiaobt/Reaktor-Data-Science-project | 2 | 43958 | import os
import requests
import time
import json
import io
import numpy as np
import pandas as pd
import paavo_queries as paavo_queries
from sklearn.linear_model import LinearRegression
import statsmodels.api as sm
## NOTE: Table 9_koko access is forbidden from the API for some reasons.
# url to the API... | 2.984375 | 3 |
tools/bin/stretch_realsense_jog.py | soumith/stretch_body | 0 | 43959 | <filename>tools/bin/stretch_realsense_jog.py
#!/usr/bin/env python
import pyrealsense2 as rs
import numpy as np
import cv2
import os
import pathlib
import argparse
import stretch_body.hello_utils as hu
hu.print_stretch_re_use()
parser = argparse.ArgumentParser(description='Tool to test the Realsense D435i Camera.')
p... | 2.515625 | 3 |
galois/_fields/_gfp.py | iyanmv/galois | 0 | 43960 | <filename>galois/_fields/_gfp.py
"""
A module that contains a metaclass mixin that provides GF(p) arithmetic using explicit calculation.
"""
import numba
import numpy as np
from ._main import FieldClass, DirMeta
from ._dtypes import DTYPES
RECIPROCAL = lambda a, *args: 1 / a
class GFpMeta(FieldClass, DirMeta):
... | 2.34375 | 2 |
psec/secrets/generate.py | davedittrich/python_secrets | 10 | 43961 | <filename>psec/secrets/generate.py
# -*- coding: utf-8 -*-
import argparse
import logging
import textwrap
from cliff.command import Command
from psec.secrets_environment import (
generate_secret,
natural_number,
DELIMITER,
MAX_WORDS_LENGTH,
MIN_WORDS_LENGTH,
MAX_ACROSTIC_LENGTH,
MIN_ACROST... | 2.328125 | 2 |
src/minml/components/generator/features.py | timhannifan/minml | 0 | 43962 | from sklearn.compose import ColumnTransformer
from sklearn.pipeline import Pipeline
from sklearn.impute import SimpleImputer
from sklearn.preprocessing import OrdinalEncoder, StandardScaler, OneHotEncoder
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split, GridSearc... | 2.765625 | 3 |
scripts/servers.py | bakketun/electrumsv | 0 | 43963 | <gh_stars>0
#!/usr/bin/env python3
import json
import util
from electrumsv.util import disable_verbose_logging
from electrumsv.network import filter_version
disable_verbose_logging()
servers = filter_version(util.get_peers())
print(json.dumps(servers, sort_keys = True, indent = 4))
| 1.664063 | 2 |
pat10.py | neha-codes/Pattern-Practice-with-Python | 0 | 43964 | <reponame>neha-codes/Pattern-Practice-with-Python
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 20 13:51:55 2019
@author: nehap
"""
"""
Input: 5
Output :
* * * * *
* * * *
* * *
* *
*
"""
if __name__=="__main__":
n = int(input("Input: "))
#Initial Spaces
k=n-1
print("Output :")
... | 3.953125 | 4 |
repoxplorer/tests/test_yamlbackend.py | Priya-100/repoxplorer | 107 | 43965 | <reponame>Priya-100/repoxplorer
# Copyright 2017, Red Hat
#
# 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 applic... | 2.21875 | 2 |
samplecode/sample_exscript_set.py | taijiji/NetworkAutomationTutorial | 3 | 43966 | # For SSH
import Exscript
# For Color Font
from colorama import init as colorama_init
from colorama import Fore
colorama_init(autoreset=True)
username = "user1"
password = "<PASSWORD>"
ip4 = "192.168.33.3"
# SSHセッションの確立
session = Exscript.protocols.SSH2()
session.connect(ip4)
# ルータにログイン
account = Exscript.Account(n... | 2.421875 | 2 |
tests/test_pickling.py | avirshup/mdtcollections | 0 | 43967 | <reponame>avirshup/mdtcollections
import pytest
import pickle
from .fixtures import *
@pytest.mark.parametrize('objkey', pickleable)
def test_pickling(objkey, request):
obj = request.getfixturevalue(objkey)
for iprotocol in (0,1,2):
x = pickle.dumps(obj, protocol=iprotocol)
y = pickle.loads(x... | 2.3125 | 2 |
setup.py | trnielsen/nexus-constructor | 0 | 43968 | <filename>setup.py
"""
Build script for producing standalone executables for the python application using cx_freeze.
The output bundles together the python code, libraries and interpreter, along with the app's resources folder.
See https://cx-freeze.readthedocs.io/en/latest/distutils.html for documentation
"""
import ... | 2.046875 | 2 |
veyon/PySwitchTracer/tasks/task1/task_test1.py | IzayoiRin/VirtualVeyonST | 0 | 43969 | import time
from tasks.capp import app
from others.affine_applications import MoveApps
@app.task(name="sdc.move11", bind=True)
def task_1(self, x):
time.sleep(1)
return MoveApps(":move", x).foo()
@app.task(name="sdc.move12", bind=True)
def task_2(self, x):
return MoveApps(":move", x + 1).foo()
| 2.078125 | 2 |
Simulation/BusinessProcesses/__init__.py | AlexWorldD/NetEmbs | 1 | 43970 | <reponame>AlexWorldD/NetEmbs<filename>Simulation/BusinessProcesses/__init__.py
# encoding: utf-8
__author__ = '<NAME>'
"""
__init__.py.py
Created by lex at 2019-03-24.
"""
from BusinessProcesses.Collections import *
from BusinessProcesses.Depreciation import *
from BusinessProcesses.Disbursements import *
from Business... | 1.210938 | 1 |
20_exec/12_.py | ScriptErrorVGM/Project2021 | 0 | 43971 | def main():
c = input()
if c != c[::-1]: # -1 шаг строки: от конца к началу
print("It's not palindrome")
else:
print("It's palindrome")
if __name__ == "__main__":
main() | 3.640625 | 4 |
src/gbstrategy/core/_Interface.py | GrayBoxAI/GrayBoxStrategy | 1 | 43972 | <filename>src/gbstrategy/core/_Interface.py
# 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... | 2.03125 | 2 |
bordercamp/irc.py | mk-fg/bordercamp-irc-bot | 1 | 43973 | <reponame>mk-fg/bordercamp-irc-bot<filename>bordercamp/irc.py<gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import print_function
import itertools as it, operator as op, functools as ft
from datetime import datetime
import os, sys
from twisted.internet import reactor, protocol, defer
from twisted.words.servic... | 1.976563 | 2 |
UDEMY-Learn Python Programming Masterclass/Section 3-Stepping into the World of Python/sequence_operators.py | Sanjay9921/Python | 0 | 43974 | <filename>UDEMY-Learn Python Programming Masterclass/Section 3-Stepping into the World of Python/sequence_operators.py
str1 = "<NAME> "
str2 = "<NAME> "
str3 = "Scorpion "
str4 = "Sub-Zero "
str5 = "Sonya "
str6 = "Test yo might! "
print(str1 + str2 + str3 + str4 + str5 + str6)
print(str3 * 5)
print(str3 * (5 + 4))
p... | 4.125 | 4 |
produtos/migrations/0007_auto_20171110_1138.py | Moisestuli/karrata | 0 | 43975 | <filename>produtos/migrations/0007_auto_20171110_1138.py<gh_stars>0
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-11-10 10:38
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('produtos', '0006_auto_20171109_1... | 1.414063 | 1 |
users/models.py | barackmaund1/Awwards- | 0 | 43976 | from django.db import models
from django.contrib.auth.models import User
from PIL import Image
# Create your models here.
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
image = models.ImageField(default='default.jpg', upload_to='profile_pics/')
contacts=models.CharF... | 2.578125 | 3 |
cgee/Producao/py-nlp/GenerateID.py | gustavodsf/java_project | 0 | 43977 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
Empresa: Funcao Coppetec
Desenvolvedor: <NAME>
Data: 14/12/2014
Descricao: Classe criada para gerar os id dos objetos a serem adicionados no banco de dados, evitando assim mais requisições ao banco de dados.
'''
class GenerateID:
def __init__(self):
# Variável que... | 3.46875 | 3 |
postGIS_tools/routines/back_up_entire_machine.py | AltaPlanning/postGIS-tools | 4 | 43978 | <gh_stars>1-10
"""
TODO: docstrings all across file
Examples
--------
>>> from postGIS_tools.configurations import get_postGIS_config, USER_DESKTOP
>>> config, _ = get_postGIS_config()
>>> config["localhost"]["debug"] = True
>>> back_up_all_databases(USER_DESKTOP, **config["localhost"])
>>> remo... | 2.5625 | 3 |
src/container_build/__init__.py | solomem/sagemaker_lambda_pipeline | 58 | 43979 | from .container_build import build
| 1.0625 | 1 |
virtual/Lib/site-packages/pylint/test/functional/too_many_arguments.py | JamesKimari/pitch-one | 35 | 43980 | # pylint: disable=missing-docstring
def stupid_function(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9): # [too-many-arguments]
return arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9
| 2.8125 | 3 |
tests/_bundles/custom_extension/base_model.py | briancappello/flask-sqlalchemy-bundle | 0 | 43981 | <gh_stars>0
from flask_sqlalchemy import Model as BaseModel
from flask_sqlalchemy_bundle.meta import McsArgs, MetaOption, ModelMetaFactory
class ExtendExisting(MetaOption):
def __init__(self):
super().__init__(name='extend_existing', default=True, inherit=False)
def check_value(self, value, mcs_args:... | 2.140625 | 2 |
acxDataProcessor/utils/DsapiParams.py | etbrow/dsapi-hashed-pii-example | 1 | 43982 | class DsapiParams:
def __init__(self, limit=1, bundles = [], role=None, tenant=None, format = 'json'):
self.limit = limit
self.bundles = bundles
self.role = role
self.tenant = tenant
self.format = format
def formatForRequest(self):
formattedString = '?'
n... | 2.328125 | 2 |
listenPortCOM2csv.py | FloGom/battery-voltmeter-to-csv | 0 | 43983 | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 16 11:40:09 2017
@author: florentin
"""
import serial
from os import getcwd
## paramètres du port série
#port = input("Quel numéro de port COM voulez-vous écouter?\n")
#vitesse = int(input("Quelle vitesse en baud?\n"))
#caracFin = input("Quel(s) caractère(s) de fin de c... | 2.984375 | 3 |
tests/test_paginated_list.py | eriktews/canvasapi | 0 | 43984 | <filename>tests/test_paginated_list.py
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
import requests_mock
from canvasapi import Canvas
from canvasapi.enrollment_term import EnrollmentTerm
from canvasapi.paginated_list import PaginatedList
from canvasapi.user import... | 2.65625 | 3 |
src/6-VECTOR/Standalone_01/rdf2vec/walkers/community.py | feiphoon/inm713-coursework | 0 | 43985 | <reponame>feiphoon/inm713-coursework
import sys
sys.path.append('../')
from walkers.walker import Walker
from collections import defaultdict
from graph import Vertex
from hashlib import md5
import networkx as nx
import numpy as np
import community
import itertools
import math
def check_random_state(seed):
return n... | 2.71875 | 3 |
src/cms/publications/templatetags/unicms_publications.py | UniversitaDellaCalabria/uniCMS | 6 | 43986 | import logging
from django import template
from django.db.models import Q
from django.utils import timezone
from django.utils.safestring import SafeString
from cms.contexts.utils import handle_faulty_templates
from cms.publications.models import Category, Publication, PublicationContext
logger = logging.getLogger(_... | 1.929688 | 2 |
changeset/load.py | kolorowestudio/critic | 0 | 43987 | # -*- mode: python; encoding: utf-8 -*-
#
# Copyright 2012 <NAME>, Opera Software ASA
#
# 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
#
# Unl... | 2.015625 | 2 |
challenges/re/espresso/example-solution/solve.py | RTN-Team/CTF-2021-01 | 8 | 43988 |
def decode_flag(value, alphabet):
# Construct inverse alphabet.
map_inv = [0]*len(alphabet)
for i in range(len(alphabet)):
map_inv[alphabet[i]] = i
# Apply.
result = bytearray()
for i in range(len(value)):
c = value[i]
if i % 2 == 1:
c -= 1
cc = map_... | 3.40625 | 3 |
src/dice_stats/_magic/mapping.py | sponsfreixes/dice_stats | 2 | 43989 | <filename>src/dice_stats/_magic/mapping.py
"""
Mapping interface.
Code to make Dice implement an immutable mapping interface.
This interface helps to keep code that uses dice Pythonic as they can
use standard methods, and it the immutability helps make all the code
simpler to use as we don't need to think about mutabi... | 3.328125 | 3 |
wheel_sieve/ecm/ecm_montgomery.py | aulawrence/wheel_sieve | 0 | 43990 | <gh_stars>0
"""Elliptic Curve Method using Montgomery Curves.
"""
import random
import time
from math import gcd
import numpy as np
from wheel_sieve.common import (
PRIME_GEN,
InverseNotFound,
CurveInitFail,
inv,
init_wheel,
)
def get_curve_suyama(sigma, n):
"""Given parameter sigma, generate ... | 3.171875 | 3 |
pdns-admin-base-ngoduykhanh/run.py | xoxefdp/docker-pdns | 153 | 43991 | #!/usr/bin/env python3
from powerdnsadmin import create_app
app = create_app()
| 1.125 | 1 |
afkak/test/test_failover_integration.py | zsuzhengdu/afkak | 0 | 43992 | <filename>afkak/test/test_failover_integration.py
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Cyan, Inc.
import os
import logging
import time
from nose.twistedtools import threaded_reactor, deferred
from twisted.internet.defer import inlineCallbacks, returnValue, setDebugging
from twisted.internet.base import Delaye... | 1.78125 | 2 |
lib/formats.py | tong1wu/vaapi-fits | 0 | 43993 | ###
### Copyright (C) 2019-2022 Intel Corporation
###
### SPDX-License-Identifier: BSD-3-Clause
###
subsampling = {
"Y800" : ("YUV400", 8),
"I420" : ("YUV420", 8),
"NV12" : ("YUV420", 8),
"YV12" : ("YUV420", 8),
"P010" : ("YUV420", 10),
"P012" : ("YUV420", 12),
"I010" : ("YUV420", 10),
"422H" : ("Y... | 2.359375 | 2 |
data/data_structures.py | BrancoLab/LocomotionControl | 0 | 43994 | import pandas as pd
from dataclasses import dataclass
import numpy as np
from collections import namedtuple
@dataclass
class TrackingData:
bp: str
x: np.ndarray
y: np.ndarray
bp_speed: np.ndarray
speed: np.ndarray = None
acceleration: np.ndarray = None
orientation: np.ndarray = None
an... | 3.0625 | 3 |
tests/phase1_test.py | jfklorenz/Python-RMedian | 1 | 43995 | #!/usr/bin/python3
# ==================================================
"""
File: RMedian - Unittest - Phase 1
Author: <NAME>
"""
# ==================================================
# Import
import math
import random
import pytest
# ==================================================
# Phase 1
def phase1(X, k, d):... | 2.71875 | 3 |
apzm/wallet/tests/test_models.py | franramirez688/apzm | 0 | 43996 | <reponame>franramirez688/apzm
import uuid
from django.db import IntegrityError
from django.test import TestCase
from wallet.exceptions import WalletError
from wallet.models import Client, ClientWalletAccount, \
TradeWalletAccount
from wallet.tests.factory import create_wallet_clients
class WalletAccountTestCase... | 2.328125 | 2 |
src/ds/08_trees.py | burhanuddinbhopalwala/py-ds-algo | 0 | 43997 | <reponame>burhanuddinbhopalwala/py-ds-algo<filename>src/ds/08_trees.py
# Definition for a binary tree node.
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution(object):
def maxDepth(self, root):
"""
:type root:... | 3.875 | 4 |
services/report_service.py | init-esh/FastAPI-weather-API | 0 | 43998 | <filename>services/report_service.py
import uuid
from typing import Optional,Callable, List, Union, Any
import datetime
from models.location import Location
from models.reports import Report
__reports: List[Report] = []
# fake db
async def get_reports() -> List[Report]:
return list(__reports)
async def add_rep... | 2.359375 | 2 |
server/filemanager.py | toptaldev92/MrHyde | 0 | 43999 | <filename>server/filemanager.py
from os import makedirs, listdir
from os.path import isfile, isdir, join
import logging
import base64
from binascii import Error as Base64Error
from sqlite3 import Error as SQLError
from bottle import template
import dbhandler
logger = logging.getLogger(__name__)
class FileManager:
... | 2.421875 | 2 |