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 |
|---|---|---|---|---|---|---|
apps/logs/logic/data_import.py | techlib/celus | 7 | 46200 | import logging
from collections import Counter, namedtuple
from datetime import date
from typing import Optional, Tuple, Set
from core.logic.debug import log_memory
from logs.logic.validation import clean_and_validate_issn, ValidationError, normalize_isbn
from logs.models import ImportBatch
from nigiri.counter5 import... | 2.03125 | 2 |
examples/Python/multiedges.py | var414n/ubigraph_server | 4 | 46201 | <reponame>var414n/ubigraph_server
import xmlrpclib
import time
# Create an object to represent our server.
server_url = 'http://127.0.0.1:20738/RPC2'
server = xmlrpclib.Server(server_url)
G = server.ubigraph
G.clear()
x = G.new_vertex()
y = G.new_vertex()
G.set_edge_style_attribute(0, "spline", "true")
G.set_verte... | 2.6875 | 3 |
game.py | ChristianBRPy/RollingDiceGame | 0 | 46202 | import os, sys, random, csv, getpass, platform
gamename = "Rolling Dice Game"
os.system('cls' if os.name == 'nt' else 'clear')
if platform.system() == "Linux":
os.system("PROMPT_COMMAND='echo -ne \"\033]0;"+gamename+"\007\"'")
else:
os.system('title '+gamename if os.name == 'nt' else 'title="'+gamename+'" && ... | 3.21875 | 3 |
solutions/previous_solution_python/leetcode_1041.py | YuhanShi53/Leetcode_solutions | 0 | 46203 | """ Leetcode 1041 - Robot Bounded in Circle
https://leetcode.com/problems/robot-bounded-in-circle/
"""
class Solution1:
""" 1. MINE Straight-Forward """
def is_robot_bounded(self, instructions: str) -> bool:
nums = {'G': 0, 'R': 1, 'L': -1}
direction = [1, -1]
position = [0, 0]
... | 3.484375 | 3 |
tests/test_decorators.py | Dominik1123/click-inspect | 0 | 46204 | <reponame>Dominik1123/click-inspect<gh_stars>0
from __future__ import annotations
import sys
from typing import List, Sequence, Tuple, Union
import click
import pytest
from click_inspect.decorators import add_options_from, _parse_type_hint_into_kwargs
def test_add_options_from(base_function):
@click.command()
... | 2.234375 | 2 |
rterm_src/get_rss.py | totuta/rterm | 10 | 46205 | import datetime
import feedparser
import json
import os
import shutil
import sys
import time
from .common import p, FEEDS_FILE_NAME
from .config import TIMEZONE
def do(target_category=None, log=False):
def getFeedFromRSS(category, urls, show_author=False, log=False):
rslt = {}
for source, url i... | 2.625 | 3 |
tools/reuse_factors_examples.py | walkieq/LSTM-HLS | 18 | 46206 | import math
import numpy as np
"""
This function calculates the roots of the quadratic inequality for the Rh reuse factor.
Parameters:
lx - list of input sizes of the lstms. The size of this list is equal to the number of layers.
lh - list of input sizes of the hidden layers. The size of this ... | 3.125 | 3 |
processing_components/calibration/pointing.py | ska-telescope/algorithm-reference-library | 22 | 46207 | <reponame>ska-telescope/algorithm-reference-library
""" Functions for calibration, including creation of pointingtables, application of pointingtables, and
merging pointingtables.
"""
import copy
import logging
import numpy.linalg
from data_models.memory_data_models import PointingTable, BlockVisibility, QA
from da... | 2.28125 | 2 |
lab01/tiago-dalloca.py | Desnord/lab-mc102 | 7 | 46208 | <filename>lab01/tiago-dalloca.py
# DESCRIÇÃO
# Escreva um programa que calcule a circunferência C de um determinado
# planeta, com base na observação do ângulo A, entre duas localidades C1 e
# C2, e na distância D, em estádios, entre elas.
# Suponha que as localidades estejam no mesmo meridiano de um planeta
# esféri... | 4.1875 | 4 |
src/squad/test.py | sciling/example-kubeflow-qatransfer | 0 | 46209 | try:
from kfp.components import InputPath
from kfp.components import OutputPath
except ImportError:
def InputPath(c):
return c
def OutputPath(c):
return c
metrics = "Metrics"
def test(
prepro_dir: InputPath(str),
prev_model_dir: InputPath(str),
sent_size_th,
ques_si... | 2.21875 | 2 |
run_evaulate.py | aayn/seaadrl-pytorch | 3 | 46210 | import os
import time
from collections import deque
import functools
import itertools
from typing import Callable, Iterable
import numpy as np
import yaml
import gym
from box import Box
import torch
# torch.multiprocessing.set_start_method("forkserver")
import torch.nn as nn
from torch.utils.data import IterableData... | 1.921875 | 2 |
tests/test_safe_threading.py | justengel/continuous_threading | 7 | 46211 | <reponame>justengel/continuous_threading
import time
import continuous_threading
def test_thread():
h = [False]
def set_h():
h[0] = True
th = continuous_threading.Thread(target=set_h)
th.start()
time.sleep(0.01)
assert h[0] is True
th.join()
# Test class based approach
c... | 2.90625 | 3 |
django/app_whoami/views.py | a-rey/aaronmreyes_heroku | 1 | 46212 | <reponame>a-rey/aaronmreyes_heroku
import decimal
import ipaddress
import django.http
import django.core.cache
import app_whoami.models
def main(request):
"""
request handler for '/'.
"""
# try to get client IP from HTTP header
raw_ip = request.META.get('HTTP_X_FORWARDED_FOR', request.META.get('REMOTE_ADD... | 2.203125 | 2 |
tests/python_frontend/unroll_test.py | FlorianDeconinck/dace | 0 | 46213 | <reponame>FlorianDeconinck/dace<filename>tests/python_frontend/unroll_test.py
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
""" Tests loop unrolling functionality. """
import dace
from dace.frontend.python import astutils
from dace.frontend.python.preprocessing import LoopUnroller, DaceSyn... | 2.296875 | 2 |
converter/nnef_converters/tf_converters/nnef_to_tf/transformations.py | asdor/NNEF-Tools | 0 | 46214 | # Copyright (c) 2017 The Khronos Group Inc.
#
# 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 ... | 1.992188 | 2 |
src/sst/elements/simpleElementExample/tests/example0.py | sudhanshu2/sst-elements | 58 | 46215 | # Import the SST module
import sst
# In Example0, two components send each other a number of events
# The simulation ends when the components have sent and
# received all expected events. While the eventSize is parameterized,
# it has no effect on simulation time because the components don't limit
# their link bandwi... | 2.734375 | 3 |
sphinxcontrib/needs/services/base.py | twodrops/sphinxcontrib-needs | 0 | 46216 | import sphinx
from pkg_resources import parse_version
sphinx_version = sphinx.__version__
if parse_version(sphinx_version) >= parse_version("1.6"):
from sphinx.util import logging
else:
import logging
logging.basicConfig()
class BaseService:
def __init__(self, *args, **kwargs):
self.log = l... | 2.328125 | 2 |
hardware/opentrons_hardware/scripts/network_test.py | Opentrons/protocol_framework | 0 | 46217 | <reponame>Opentrons/protocol_framework<gh_stars>0
"""Network error and quality test script.
By sending broadcast messages that incur responses on the canbus network,
we can test whether all nodes get those messages without errors. At a
specified bitrate, knowing the length of the messages lets us stimulate
at a specif... | 2.359375 | 2 |
laptop/gui.py | zach-lau/FreeFlowingFurniture | 1 | 46218 | #System libraries
import tkinter as tk
import sys
sys.path.insert(1, '../common')
import socket
from cli import *
#User libraries
# from motorcommands import *
key_to_direction = {
38: "left",
25: "forward",
40: "right",
39: "back",
65: "stop",
}
numbers = {
19 : 0,
10 : 1,
... | 2.453125 | 2 |
meerschaum/connectors/sql/_users.py | bmeares/Meerschaum | 32 | 46219 | <reponame>bmeares/Meerschaum<filename>meerschaum/connectors/sql/_users.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
"""
Manage users via the SQL Connector
"""
from __future__ import annotations
from meerschaum.utils.typing import SuccessTuple, Optional, Any, Dict, List
def register_user(
... | 2.421875 | 2 |
frappe/commands/create_demo.py | fproldan/frappe | 0 | 46220 | <gh_stars>0
from __future__ import unicode_literals, absolute_import
import frappe
def setear_fechas(doctype, dates=[], child_dates={}, related_doctype=''):
"""
doctype (str): Quotation
dates (list): ['transaction_date', 'valid_till']
child_dates (dict): {'Payment Schedule': 'due_date'}
related_do... | 2.203125 | 2 |
tests/test_utils.py | metasyn/scikeras | 111 | 46221 | import numpy as np
import pytest
from tensorflow.keras import losses as losses_module
from tensorflow.keras import metrics as metrics_module
from scikeras.utils import loss_name, metric_name
class CustomLoss(losses_module.Loss):
pass
class CustomMetric(metrics_module.AUC):
pass
@pytest.mark.parametrize(... | 2.5625 | 3 |
majestic-monolith-django/core/log_schema.py | kokospapa8/majestic-monolith-django | 1 | 46222 | <reponame>kokospapa8/majestic-monolith-django
from kubi_ecs_logger.models import BaseSchema
from kubi_ecs_logger.models.include import INCLUDE_FIELDS
from kubi_ecs_logger.models.fields.user import UserSchema
from kubi_ecs_logger.models.fields.field_set import FieldSet, FieldSetSchema
from marshmallow import fields
M... | 2.046875 | 2 |
sdk/python/pulumi_azure/apimanagement/product_api.py | henriktao/pulumi-azure | 109 | 46223 | <reponame>henriktao/pulumi-azure<gh_stars>100-1000
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping,... | 1.9375 | 2 |
applications/RANSApplication/python_scripts/fluid_solver_no_replace.py | HubertBalcerzak/Kratos | 0 | 46224 | from __future__ import absolute_import, division # makes KratosMultiphysics backward compatible with python 2.6 and 2.7
# Import applications
import KratosMultiphysics as Kratos
# Import base class file
from KratosMultiphysics.FluidDynamicsApplication.navier_stokes_solver_vmsmonolithic import NavierStokesSolverMonol... | 2.15625 | 2 |
repos/spikeextractors/spikeextractors/extractors/biocamrecordingextractor/biocamrecordingextractor.py | tjd2002/spikeforest2 | 0 | 46225 | from spikeextractors import RecordingExtractor
import numpy as np
import h5py
import ctypes
class BiocamRecordingExtractor(RecordingExtractor):
def __init__(self, recording_file):
RecordingExtractor.__init__(self)
self._recording_file = recording_file
self._rf, self._nFrames, self._sampli... | 2.46875 | 2 |
src/foremast/awslambda/cloudwatch_event/cloudwatch_event.py | StuartApp/foremast | 0 | 46226 | <filename>src/foremast/awslambda/cloudwatch_event/cloudwatch_event.py
# Foremast - Pipeline Tooling
#
# Copyright 2018 Gogo, 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
#
# ... | 2.125 | 2 |
commercialoperator/migrations/0086_auto_20200817_1702.py | shibaken/commercialoperator | 0 | 46227 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2020-08-17 09:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('commercialoperator', '0085_proposaleventotherdetails_other_comments'),
]
operations... | 1.679688 | 2 |
pytglib/api/types/rich_texts.py | iTeam-co/pytglib | 6 | 46228 |
from ..utils import Object
class RichTexts(Object):
"""
A concatenation of rich texts
Attributes:
ID (:obj:`str`): ``RichTexts``
Args:
texts (List of :class:`telegram.api.types.RichText`):
Texts
Returns:
RichText
Raises:
:class:`telegram.Error... | 2.828125 | 3 |
aiy_led.py | YeongJunKim/rpi-pyrec | 1 | 46229 | # autor : colson (<NAME>)
# https://www.github.com/YeongJunKim
from aiy.vision.leds import Leds
from time import sleep
from aiy_log import MyLogger
import logging
class MyLed:
def __init__(self, led=(0x00, 0x00, 0x00)):
self.logger = MyLogger(level=logging.INFO, get="LED")
self.leds = Leds()
... | 2.75 | 3 |
nullcline-plot.py | liu2z2/nullclineplot | 0 | 46230 | <gh_stars>0
# By <NAME> 4/27/2019
# Plot aged-based predation model
# Diff eq used in this model:
# dv/dt=Bu-v-Dv(u+v)-Pv, du/dt=v-u(u+v)-Qu
# Import the required modules
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
# External parameters
B=1
D=1
P=2
Q=0
# display windo... | 2.28125 | 2 |
torrent/torrent_tracker/whitelist_api/serializers.py | projectpai/paipass | 3 | 46231 | # Core
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
# Third party
from rest_framework import serializers
# Local
from .models import TorrentInfoHash
class TorrentInfoHashSerializer(serializers.Serializer):
info_hash = serializers.CharField()
prev_info_hash = seriali... | 2.109375 | 2 |
configs/flownet2/flownet2sd_8x1_slong_chairssdhom_384x448.py | hologerry/mmflow | 481 | 46232 | <reponame>hologerry/mmflow<filename>configs/flownet2/flownet2sd_8x1_slong_chairssdhom_384x448.py
_base_ = [
'../_base_/models/flownet2/flownet2sd.py',
'../_base_/datasets/chairssdhom_384x448.py',
'../_base_/schedules/schedule_s_long.py', '../_base_/default_runtime.py'
]
| 0.941406 | 1 |
examples/HER/HER_eager.py | Rowing0914/TF_RL | 23 | 46233 | import gym
import argparse
import tensorflow as tf
from tf_rl.common.memory import HER_replay_buffer
from tf_rl.common.utils import eager_setup, her_sampler, create_log_model_directory, get_alg_name, RunningMeanStd
from tf_rl.common.params import ROBOTICS_ENV_LIST
from tf_rl.common.train import train_HER, train_HER_ray... | 2.109375 | 2 |
tools/convert_nb201_benchmark.py | matluster/anonymous-2102 | 0 | 46234 | import collections
import pickle
import random
import h5py
import numpy as np
import tqdm
from nas_201_api import NASBench201API
def is_valid_arch(matrix):
n = matrix.shape[0]
visited = {0}
q = collections.deque([0])
while q:
u = q.popleft()
for v in range(u + 1, n):
if v ... | 2.125 | 2 |
hdfio/mat_io.py | RealPolitiX/hdfio | 0 | 46235 | <filename>hdfio/mat_io.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from . import dict_io as io
import numpy as np
from h5py import File
from scipy.io import loadmat, savemat
# Conversion functions
def mat_to_h5(load_addr, h5_dir, keep_meta=False, loadkwargs={}, **kwargs):
""" Convert mat file to HDF5 via ... | 2.65625 | 3 |
diffimg/AbstractPrfLookup.py | exoplanetvetting/DAVE | 7 | 46236 | <reponame>exoplanetvetting/DAVE<filename>diffimg/AbstractPrfLookup.py<gh_stars>1-10
"""
Created on Sun Dec 2 14:12:41 2018
@author: fergal
"""
from __future__ import print_function
from __future__ import division
import numpy as np
class AbstractPrfLookup(object):
"""Store and lookup a previously computed PRF... | 2.578125 | 3 |
main.py | Template-Latex/Export-Subtemplate | 1 | 46237 | """
EXPORT-SUBTEMPLATE
Genera distintos sub-releases y exporta los templates
Autor: <NAME>. @ <EMAIL>
Licencia:
The MIT License (MIT)
Copyright 2017-2021 <NAME>.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Sof... | 1.742188 | 2 |
rklearn/tests/it/cifar10_data_generator.py | rejux/rklearn-lib | 0 | 46238 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#############
## Imports ##
#############
import os
import sys ; sys.path.append("/home/developer/workspace/rklearn-lib")
import time
import pickle
import numpy as np
from rklearn.tfoo_v1 import BaseDataGenerator
from rktools.monitors import ProgressBar
##############... | 2.015625 | 2 |
scheduler/views.py | saketbairoliya2/salescheduler | 0 | 46239 | from django.contrib.auth import login, authenticate
from django.contrib.auth.forms import UserCreationForm
from django.shortcuts import render, redirect
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseBadRequest
from django.contrib.auth.decorators import login_required
from django.views.decorato... | 2.234375 | 2 |
py/_run_py3.py | FellowsFreiesWissen/- | 1 | 46240 | __author__ = "<NAME>"
__copyright__ = "MIT Licence 2021, <NAME>"
__credits__ = ["<NAME>"]
__license__ = "MIT"
__version__ = "1.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "1.0"
__update__ = "2021-05-11"
import glob
import os
import os.path
dir_path = os.path.dirname(os.path.realpath(__file__))
pri... | 2.359375 | 2 |
furaffinity/misc.py | lukeroge/python-furaffinity | 3 | 46241 | <reponame>lukeroge/python-furaffinity
import hashlib # To hash images and files
import os # For working with paths
import re
import attr # For useful tiny classes.
import requests
from .errors import SubmissionFileNotAccessible
# Functions for... functionality.
def clean(text, safe=False, separator=" "):
"""... | 3.078125 | 3 |
fastsettings/models.py | wickeym/django-fastsettings | 2 | 46242 | # -*- encoding=UTF-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
import json
from . import projectsettings as fstsettings
import logging
logger = logging.getLogger('fastsettings_logger')
class Settings(mo... | 2 | 2 |
app/admin.py | VickramMS/arccp | 0 | 46243 | <gh_stars>0
from django.contrib import admin
from .models import *
admin.site.register(Test)
admin.site.register(Question)
admin.site.register(Report)
admin.site.register(Formula) | 1.25 | 1 |
helpers/helpers.py | JoseSalgado1024/anonimizar_columnas | 0 | 46244 | # coding: utf8
import json
import os
import time
import random
import socket
import hashlib
try:
lib = __import__('pandas')
globals()['pd'] = lib
except ImportError:
pandas_import_error_msg = \
'''
Este script utiliza la libreria de Python Pandas.
Por favor ejecuta:
$ sudo -H pip install pand... | 2.5625 | 3 |
packages/python/m/core/json.py | LaudateCorpus1/m | 0 | 46245 | <reponame>LaudateCorpus1/m
import json
import sys
from collections.abc import Mapping
from typing import Any, List
from typing import Mapping as Map
from typing import Optional, Union, cast
from . import issue
from .fp import Good, OneOf
from .io import CITool
from .issue import Issue
def read_json(
filename: Op... | 2.734375 | 3 |
image_generation/__init__.py | shibing624/cvnet | 2 | 46246 | # -*- coding: utf-8 -*-
"""
@author:XuMing(<EMAIL>)
@description: 包括gan图像生成、vae图像生成、艺术风格迁移、图像漫画化
"""
| 1.617188 | 2 |
detector/__init__.py | EvenDBL/License-Plate-Detection-and-Recognition | 1 | 46247 | <filename>detector/__init__.py
from .segmentation_detector import SEGDetecor | 1.101563 | 1 |
setup.py | Huge/shamir | 19 | 46248 | from setuptools import setup, find_packages
setup(
name='shamir',
version='17.12.0',
url='https://github.com/kurtbrose/shamir',
author='<NAME>',
author_email='<EMAIL>',
decription="fast, secure, pure python shamir's secret sharing",
long_description = open('README.rst').read(),
py_modul... | 1.054688 | 1 |
alembic/versions/2016120514_add_anonymous_flags_4ea0403733dc.py | nikita-bykov/codalab-worksheets | 1 | 46249 | """Add anonymous flags
Revision ID: 4ea0403733dc
Revises: 5<PASSWORD>
Create Date: 2016-12-05 14:04:39.239593
"""
# revision identifiers, used by Alembic.
revision = '4ea0403733dc'
down_revision = '<KEY>'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('bundle', sa.Column('is_anony... | 1.257813 | 1 |
main.py | eero-inc/dnsmonitor | 7 | 46250 | #!/usr/bin/env python3
import dnsmonitor
import json
import os
from base64 import b64decode
import boto3
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def decrypt_environment(env=os.environ):
kms = boto3.client("kms")
for item in env.copy().keys():
if item.endswith("_ENC")... | 2.125 | 2 |
plot_all_hurricane_tracks/plot_all_tracks.py | Sunnyfred/Atlantic_Hurricane_Simulations | 0 | 46251 | <reponame>Sunnyfred/Atlantic_Hurricane_Simulations<gh_stars>0
import csv
import matplotlib.pyplot as plt
import numpy as np
from collections import OrderedDict
import matplotlib as mpl
# import matplotlib.gridspec as gridspec
from matplotlib.ticker import MaxNLocator
from matplotlib.ticker import StrMethodFormatter
imp... | 1.953125 | 2 |
server/star.py | 1850061/image_retrieval | 0 | 46252 | <filename>server/star.py
import os
import matplotlib.image as mpimg
from tensorflow.python.platform import gfile
basePath = os.getcwd()
def getTagName(filename):
fir = filename.split('\\')[-1]
end = fir.split('/')[-1]
return end
def add_star(imageStar):
baseFile = 'static\\result'
for filepath,... | 2.6875 | 3 |
Part3-Article-NLP/question_answering/app_question_answering.py | tonywu71/Excess-Mortality-Covid | 1 | 46253 | import dash
from dash.dependencies import Input, Output, State
import dash_core_components as dcc
import dash_html_components as html
import dash_table
import plotly.express as px
import pandas as pd
import requests
from bs4 import BeautifulSoup
import re
from newspaper import Article
import sys
module_path = './que... | 2.75 | 3 |
pelicanconf_local.example.py | marcus-clements/pelican-netlify-cms | 0 | 46254 | LOAD_CONTENT_CACHE = False
# Uncomment following line if you want document-relative URLs when developing
#RELATIVE_URLS = True
| 1.03125 | 1 |
core/views.py | kevcal69/etmark | 0 | 46255 | <reponame>kevcal69/etmark
import json
from hashids import Hashids
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponse, HttpResponseRedirect
from django.views.generic import View
from .models import Document
hashids = Hashids()
class SaveDoc(View):
def post(self, reques... | 2.171875 | 2 |
src/orion/algo/asha.py | dendisuhubdy/evolve | 1 | 46256 | <reponame>dendisuhubdy/evolve
# -*- coding: utf-8 -*-
"""
Asynchronous Successive Halving Algorithm
=========================================
"""
from __future__ import annotations
import copy
import hashlib
import logging
from collections import defaultdict
from typing import Any, Sequence
import numpy
import numpy ... | 1.90625 | 2 |
src/api/dataflow/uc/adapter/operation_client.py | Chromico/bk-base | 84 | 46257 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
------------------------------------------... | 1.3125 | 1 |
astruct/type_hints/extras.py | misterfifths/nis_mods | 1 | 46258 | import ctypes as C
from typing import TYPE_CHECKING, Sequence, Union
from .ctypes_aliases import AnyCType
if TYPE_CHECKING:
import mmap
"""
TODO: Better WriteableBuffer type? Feels like a MutableSequence[int] should be
fine, but there's some weirdness between the types struct.unpack_from and
ctypes.Structure.fro... | 2.421875 | 2 |
test/a.py | liaohongdong/IPProxy | 0 | 46259 | <reponame>liaohongdong/IPProxy
import time
import json
import random
if __name__ == '__main__':
# a = 10
# while '172.16.17.32:1080':
# a -= 1
# print(a)
# if a <= 0:
# break
# a = ['a', 'b', 'c', 'd']
# a = []
# while a:
# print(time.gmtime().tm_sec)
... | 2.609375 | 3 |
test_session.py | dkkline/pylectio | 0 | 46260 | <reponame>dkkline/pylectio<gh_stars>0
from lectio.session import Session
from getpass import getpass
s = Session("248")
username = "jepp3467"
password = <PASSWORD>()
r = s.auth(username, password)
| 1.5625 | 2 |
archive/data-processing/archive/features/nn50.py | FloFincke/affective-chat | 0 | 46261 | <filename>archive/data-processing/archive/features/nn50.py<gh_stars>0
#!/usr/bin/env python
#pNN50, the proportion of differences greater than 50ms
import math
def nn50(rr):
threshold = 0.05; #50 if in milliseconds
nn50 = 0
i = 0
while i < len(rr) - 1:
if (math.fabs(rr[i] - rr[i + 1]) > threshold):
nn50 += ... | 2.265625 | 2 |
twisted/plugins/tftp_plugin.py | aivins/python-tx-tftp | 1 | 46262 | <filename>twisted/plugins/tftp_plugin.py
'''
@author: shylent
'''
from tftp.backend import FilesystemSynchronousBackend
from tftp.protocol import TFTP
from twisted.application import internet
from twisted.application.service import IServiceMaker
from twisted.plugin import IPlugin
from twisted.python import usage
from t... | 2.296875 | 2 |
python__fundamentals/list_basics/04.search.py | EmilianStoyanov/Projects-in-SoftUni | 1 | 46263 | number = int(input())
word = input()
save = []
for i in range(number):
current_string = input()
save.append(current_string)
print(save)
for i in range(len(save) -1, -1, -1):
element = save[i]
if word not in element:
save.remove(element)
print(save)
| 3.859375 | 4 |
dashboard/apps.py | hosseinmoghimi/waiter | 1 | 46264 | <gh_stars>1-10
from django.apps import AppConfig
APP_NAME="dashboard"
class DashboardConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'dashboard'
| 1.421875 | 1 |
midi_transformer/data.py | s-omranpour/Midi-Transformer | 9 | 46265 | import os
import numpy as np
from tqdm.notebook import tqdm
from deepnote import MusicRepr
from deepnote import DEFAULT_UNIT
from joblib import delayed, Parallel
import torch
from torch.utils.data import random_split, Dataset, DataLoader
def get_dataloaders(dataset,
n_jobs=2,
b... | 2.15625 | 2 |
arjuna-samples/workspace/arjex/tests/modules/s02guiauto/ep01selenium/ex01_basic.py | test-mile/arjuna | 9 | 46266 | <reponame>test-mile/arjuna<gh_stars>1-10
from arjuna.tpi import Arjuna
from arjuna.tpi.markup import *
@test_function
def test(my):
automator = Arjuna.create_gui_automator()
automator.Browser().go_to_url("https://www.google.com")
print(automator.MainWindow().get_title())
automator.quit()
| 1.890625 | 2 |
examples/helloworld2.py | lam2mo/FPTuner | 14 | 46267 | <reponame>lam2mo/FPTuner
import tft_ir_api as IR
A = IR.RealVE("A", 0, 0.0, 100.0)
rel = IR.BE("+", 4, A, A)
IR.TuneExpr(rel)
| 1.3125 | 1 |
cycif_modules.py | biodev/cycIF-workflow | 0 | 46268 | <gh_stars>0
# CycIF Modules
#
# <NAME> <EMAIL>
#
# These functions were developed for use in the CycIF workflow,
# which was developed based off of the scripts written by
# Dr. <NAME> and <NAME>.
#
# Last updated: 20200527
# Import neccessary libraries
import os
import subprocess
import random
import re
import matplot... | 2.671875 | 3 |
lagom/core/transform/centralize.py | dkorduban/lagom | 0 | 46269 | <filename>lagom/core/transform/centralize.py
import numpy as np
from .base_transform import BaseTransform
class Centralize(BaseTransform):
r"""Centralize the input data to zero-centered.
Let :math:`x_1, \dots, x_N` be :math:`N` samples, the centralization does the following:
.. math::
... | 3.3125 | 3 |
src/subtitles_job_schedule/subtitles_observer.py | hguerra/subtitles-job-schedule | 0 | 46270 | <filename>src/subtitles_job_schedule/subtitles_observer.py
# -*- coding: utf-8 -*-
"""
This is a skeleton file that can serve as a starting point for a Python
console script. To run this script uncomment the following lines in the
[options.entry_points] section in setup.cfg:
console_scripts =
subtitles = ... | 2.109375 | 2 |
sarpy/deprecated/tools/taser_web/algorithms/sarpy/remap_data/main.py | spowlas/sarpy | 0 | 46271 | from algorithm_toolkit import Algorithm, AlgorithmChain
from sarpy.visualization import remap
class Main(Algorithm):
def run(self):
cl = self.cl # type: AlgorithmChain.ChainLedger
params = self.params # type: dict
# Add your algorithm code here
ro = params['sarpy_reader']
... | 2.59375 | 3 |
donkeycar/tests/test_tub_reader.py | cliffordchow/donkey | 13 | 46272 | <filename>donkeycar/tests/test_tub_reader.py
# -*- coding: utf-8 -*-
import unittest
import tempfile
import os
from donkeycar.parts.datastore import Tub, TubReader, TubWriter
def test_tubreader():
with tempfile.TemporaryDirectory() as tempfolder:
path = os.path.join(tempfolder, 'new')
inputs = ['... | 2.875 | 3 |
parameter.py | safamathl/ResUnet | 3 | 46273 | <reponame>safamathl/ResUnet
# -----------------------Path related parameters---------------------------------------
train_ct_path = '/content/gdrive/My Drive/MICCAI-LITS2017-master/train/ct' # CT data path of the original training set
train_seg_path = '/content/gdrive/My Drive/MICCAI-LITS2017-master/train/seg' #... | 1.40625 | 1 |
CreateDB.py | elahesadatnaghib/FB-Scheduler-v2 | 1 | 46274 | <gh_stars>1-10
__author__ = 'Elahe'
import ephem
import numpy as np
import sqlite3 as lite
import os
def creatFBDE():
# Delete previous database
try:
os.remove('FBDE.db')
except:
pass
inf = 1e10
eps = 1e-10
''' Connect to the FBDE data base '''
con = lite.connect('FBDE.d... | 2.109375 | 2 |
tests/compliance/test_iam_compliance.py | hmrc/platsec-compliance-alerting | 0 | 46275 | from datetime import datetime, timedelta
from typing import List, Dict, Any
from zoneinfo import ZoneInfo
from tests.test_types_generator import create_account, create_audit
from src.compliance.iam_compliance import IamCompliance
from src.data.account import Account
from src.data.findings import Findings
EXPECTED_OL... | 2.453125 | 2 |
ar_app/scripts/renamefiles.py | osetr/ar-opencv-python | 1 | 46276 | import os
from natsort import natsorted
path_to_directory = input("Enter path to directory: ") + "/"
new_name = input("Enter new name for files: ")
try:
i = 0
list_of_files = natsorted(os.listdir(path_to_directory))
for file in list_of_files:
i += 1
extension = file.split(".")[1]
o... | 3.828125 | 4 |
pwn/ROP/arr/writeup/exploit.py | roytu/challs2 | 0 | 46277 | <reponame>roytu/challs2
from pwn import *
ppr = 0x80487ba
sysAddr = 0x8048430
scanf = 0x8048460
storage = 0x804999c
strFmtStr = 0x804882f
current = -2147483635
con = remote('localhost',1234)
con.sendline( "kablaa")
print "sending scanf..."
sleep(1)
con.sendline( str(current))
con.sendline(str(scanf))
current = curr... | 2.453125 | 2 |
keyman44/interface/rcv_page.py | sahabi/keyman44 | 0 | 46278 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui/rcv_page.ui'
#
# Created by: PyQt5 UI code generator 5.9
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjec... | 1.992188 | 2 |
python-flask-server/jatdb_server/models/__init__.py | NGenetzky/jatdb | 0 | 46279 | # coding: utf-8
# flake8: noqa
from __future__ import absolute_import
# import models into model package
from jatdb_server.models.content_file import ContentFile
from jatdb_server.models.trello_action import TrelloAction
from jatdb_server.models.trello_query import TrelloQuery
from jatdb_server.models.universal_resour... | 1.125 | 1 |
geohash/models.py | sewald101/geohash_root | 1 | 46280 |
import datetime
from django.db import models
from django.utils import timezone
# Create your models here.
class Woeids(models.Model):
country = models.CharField(max_length=200, null=True, blank=True)
name = models.CharField(max_length=200, null=True, blank=True)
woeid = models.IntegerField(default=0, nul... | 2.78125 | 3 |
Numeric Patterns/numericpattern130.py | vaidehisinha1/Python-PatternHouse | 0 | 46281 | print("Enter the no of rows: ")
n = int(input())
for i in range(n):
count = 0
flag = 0
for j in range(n):
if(i==j):
flag = 1
if(flag==1):
print(n-count, end=" ")
count+=1
if(flag!=1):
print("1",end=" ")
print()
# Enter the no o... | 3.859375 | 4 |
Knight-Rank/DAY-5/114A.py | rohansaini886/Peer-Programming-Hub-CP-Winter_Camp | 2 | 46282 | <filename>Knight-Rank/DAY-5/114A.py
I=input
k=int(I())
l=int(I())
r=1
while k**r<l:r+=1
print(['NO','YES\n'+str(r-1)][k**r==l])
| 3.03125 | 3 |
web-client/core/main/builder_custom.py | libremente/service-app | 0 | 46283 | # Copyright INRIM (https://www.inrim.eu)
# See LICENSE file for full licensing details.
import copy
from copy import deepcopy
from formiodata.builder import Builder
from formiodata.form import Form
import collections
from . import custom_components
import logging
import uuid
logger = logging.getLogger(__name__)
cla... | 1.820313 | 2 |
signuplogin/views.py | xflows/textflows | 18 | 46284 | <gh_stars>10-100
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login, logout
from django.shortcuts import render, get_object_or_404, redirect
from django.utils import timezone
def signuplogin(request):
if request.method == 'POST':
if request.POST.get('login'):
... | 2.28125 | 2 |
calculate_gc.py | kaclark/DHS_intergenic_analysis | 0 | 46285 | <reponame>kaclark/DHS_intergenic_analysis
#Calculates length and GC content of DHSs sites from fasta files
#DHS_#_intergenic.fa generated from bedtools getfasta using original DHS files filtered for only intergenic regions
#Exports DHS_#_gc.csv
#Exports DHS_#_lengths.csv
from Bio import SeqIO
import csv
#DhS files
... | 2.453125 | 2 |
tests/functional/test_90_pages.py | tomberek/liberaforms | 3 | 46286 | <filename>tests/functional/test_90_pages.py
"""
This file is part of LiberaForms.
# SPDX-FileCopyrightText: 2021 LiberaForms.org
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
import os
def test_landing(db, client):
response = client.get("/")
assert response.status_code == 200
html = response.data.dec... | 1.992188 | 2 |
thermostat/multiple.py | EPAENERGYSTAR/epathermostat | 12 | 46287 | from multiprocessing import Pool
def _calc_epa_func(thermostat):
""" Takes an individual thermostat and runs the
calculate_epa_field_savings_metrics method. This method is necessary for
the multiprocessing pool as map / imap need a function to run on.
Parameters
----------
thermostat : thermo... | 3.640625 | 4 |
training_LSTM.py | Zhangism/EEG-to-speech-classcification | 2 | 46288 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 15 17:43:05 2020
@author: zhang
"""
import os
import numpy as np
import torch
from torch.utils.data import DataLoader,TensorDataset
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
import torch.optim... | 2.078125 | 2 |
data_collection/gazette/spiders/sc_sao_domingos.py | kaiocp/querido-diario | 454 | 46289 | <reponame>kaiocp/querido-diario
from gazette.spiders.base.fecam import FecamGazetteSpider
class ScSaoDomingosSpider(FecamGazetteSpider):
name = "sc_sao_domingos"
FECAM_QUERY = "cod_entidade:244"
TERRITORY_ID = "4216107"
| 1.5625 | 2 |
mirtop/gff/body.py | AlisR/mirtop | 0 | 46290 | import mirtop.libs.logger as mylog
logger = mylog.getLogger(__name__)
def create(reads, database, sample, fn, header):
"""Read https://github.com/miRTop/mirtop/issues/9"""
seen = set()
lines = []
seen_ann = {}
# print >>out_handle, "seq\tname\tfreq\tchrom\tstart\tend\tmism\tadd\tt5\tt3\ts5\ts3\tDB\... | 2.265625 | 2 |
src/messages.py | K-Paul-Acct/wChanger | 2 | 46291 | <filename>src/messages.py
bot_is_not_admin = 'Ой! Для того, чтобы бот мог менять название беседы, нужно сделать его админом.'
setting = 'Для настройки смены названия для вашей беседы введите, разделяя вертикальной ' \
'чертой "@wchanger Название чётной недели | Название нечётной недели"'
success = 'Бот успешн... | 2.1875 | 2 |
test/integration/smoke/test_deploy_vm_with_userdata.py | ksowmya/cloudstack-1 | 1 | 46292 | <gh_stars>1-10
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License")... | 1.679688 | 2 |
day-09/part-2/jon.py | TPXP/adventofcode-2019 | 8 | 46293 | <reponame>TPXP/adventofcode-2019
from tool.runners.python import SubmissionPy
class JonSubmission(SubmissionPy):
def run(self, s):
code = [int(v) for v in s.strip().split(",")]
return compute(code, [2])
def compute(code, inputs):
mem = {}
pc = 0
relative_base = 0
def p(i):
... | 3 | 3 |
imdb/migrations/0004_auto_20200318_1539.py | raviteja1766/modern-resume-theme | 1 | 46294 | # Generated by Django 3.0.4 on 2020-03-18 15:39
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('imdb', '0003_remove_cast_is_debut_movie'),
]
operations = [
migrations.AlterField(
model_name='... | 1.554688 | 2 |
pages/predictions.py | karencfisher/Hotel-App | 0 | 46295 | # Imports from 3rd party libraries
import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import dash_daq as daq
import datetime as dt
from sklearn.tree import DecisionTreeRegressor
from sklearn.ensemble imp... | 2.34375 | 2 |
utilities/management/commands/pages_seed.py | JsyPhil/literaterobot | 0 | 46296 | from django.core.management.base import BaseCommand
from wagtail.core.models import Page
from events.models import EventIndexPage, Event
from home.models import HomePage
from pathlib import Path
import json
import os
import sys
json_directory_path = Path("legacy_site_data/old_site_data_events.json")
with open(json_d... | 2.171875 | 2 |
src/createFile.py | mretolaza/dmbsDataProject | 0 | 46297 | <gh_stars>0
# Se importan las librerías que se van a utilizar
# https://docs.python.org/2/library/os.html
import os
# https://docs.python.org/3/library/shutil.html
import shutil
data_folder = "DATABASES/"
class createFile():
# crea el folder / los folders en la direccion que se especifica
def create_folder... | 3.890625 | 4 |
fundamentals/15-advance-objects-and-data-structures/5-advance-lists.py | davidokun/Python | 0 | 46298 | <filename>fundamentals/15-advance-objects-and-data-structures/5-advance-lists.py
# Advance Lists
my_list = [1, 2, 3]
# Add element
print('\n# Add element\n')
my_list.append(4)
my_list.append(4)
print(my_list)
# Count element's occurrences
print('\n# Count element\'s occurrences\n')
print(f'2 = {my_list.count(2)}')
p... | 4.1875 | 4 |
scripts/remove_empty_models.py | emanjavacas/casket | 0 | 46299 | <reponame>emanjavacas/casket<filename>scripts/remove_empty_models.py
#!/usr/bin/env python
import argparse
def remove_where(field, match_fn):
def transform(element):
pass
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Remove empty models from a db')
parser.add... | 2.21875 | 2 |