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 |
|---|---|---|---|---|---|---|
dueros/directive/VideoPlayer/Stop.py | Mryan2005/bot-sdk-python | 70 | 12790851 | #!/usr/bin/env python3
# -*- encoding=utf-8 -*-
# description:
# author:jack
# create_time: 2018/7/2
from dueros.directive.BaseDirective import BaseDirective
class Stop(BaseDirective):
"""
VideoPlayer.Stop指令
详见文档:https://dueros.baidu.com/didp/doc/dueros-bot-platform/dbp-custom/videoplayer_markdown#Video... | 2.015625 | 2 |
sum.py | Suvradippaul/actions | 0 | 12790852 | <reponame>Suvradippaul/actions<gh_stars>0
# simple addition program
a = 20
b = 20
print("The sum is ", a+b)
| 1.976563 | 2 |
meppel_afvalkalender/__init__.py | westenberg/python-meppel-afvalkalender | 0 | 12790853 | # -*- coding: utf-8 -*-
"""Asynchronous Python client for the Meppel Afvalkalender API."""
from .const import ( # noqa
WASTE_TYPE_NON_RECYCLABLE,
WASTE_TYPE_ORGANIC,
WASTE_TYPE_PAPER,
WASTE_TYPE_PLASTIC,
)
from .meppel_afvalkalender import ( # noqa
MeppelAfvalkalender,
MeppelAfvalkalenderAddr... | 1.164063 | 1 |
checknotuse.py | danjia/CheckNotUsePic | 0 | 12790854 | <gh_stars>0
# -*- coding:utf-8 -*-
#=====================================
# 通过分析所有代码,找出没有用到的图片
# 没有用的图片资源主要有如下3种情况:
# (1)png => code
# (2)png => csd, csd => code
# (3)
# 1. png => plist, plist => code
# 2. png => plist, plist => ExportJson, ExportJson => code
# (4)
# 1. png => fnt, fnt => code
# 2. png =>... | 3.125 | 3 |
src/lib/pedal/report/imperative.py | Skydler/skulpt | 4 | 12790855 | <filename>src/lib/pedal/report/imperative.py<gh_stars>1-10
"""
Imperative style commands for constructing feedback in a convenient way.
Uses a global report object (MAIN_REPORT).
"""
__all__ = ['set_success', 'compliment', 'give_partial', 'explain',
'gently', 'hide_correctness', 'suppress', 'log', 'debug',
... | 2.953125 | 3 |
lib/config.py | galeadmn/aRNApipe | 0 | 12790856 | # -*- coding: utf-8 -*-
import sys
import os
# LIBRARY USED TO SUBMIT JOBS:
# - 'LSF' FOR IBM LSF WORKLOAD MANAGER (it uses 'sys_LSF.py')
# - 'LOCAL' FOR SEQUENTIAL RUN ON SINGLE MACHINE (it uses 'sys_single.py')
# - 'OTHER' FOR LIBRARIES ADAPTED TO OTHER WORKLOAD MANAGERS (it uses 'sys_OTHER.py')
mode = "OTHER"
# PA... | 1.835938 | 2 |
pyhumio/__init__.py | dsb-automation/pyhumio | 0 | 12790857 | <gh_stars>0
from .humio_handler import HumioHandler | 1.054688 | 1 |
src/cache3/memory.py | SHIELD616416/hello-world | 0 | 12790858 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# DATE: 2021/7/24
# Author: <EMAIL>
from collections import OrderedDict
from threading import Lock
from time import time as current
from typing import Dict, Any, Type, Union, Optional, NoReturn, Tuple, List, Callable
from cache3 import AbstractCache
from cache3.setting import... | 2.703125 | 3 |
code/pi-estimators.py | jakryd/0800-fizobl | 0 | 12790859 | <reponame>jakryd/0800-fizobl
import argparse
import numpy as np
import matplotlib.pyplot as plt
def pi_estimator(n_samples):
est = list()
n_inside = 0; n_all = 0
for i in range(n_samples):
x = np.random.uniform(-1.0, 1.0)
y = np.random.uniform(-1.0, 1.0)
dist = np.sqrt(np.power(x, 2) + np.power(y, 2)... | 3.140625 | 3 |
awx/main/migrations/0118_auto_20200326_1123.py | Pavloid21/awx | 0 | 12790860 | <filename>awx/main/migrations/0118_auto_20200326_1123.py
# Generated by Django 2.2.8 on 2020-03-26 11:23
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import taggit.managers
class Migration(migrations.Migration):
dependencies = [
('taggit', '0... | 1.625 | 2 |
mainapp/urls.py | RashidRysaev/geekshop | 0 | 12790861 | from django.urls import re_path
import mainapp.views as mainapp
from .apps import MainappConfig
app_name = MainappConfig.name
urlpatterns = [
re_path(r"^$", mainapp.products, name="index"),
re_path(r"^category/(?P<pk>\d+)/$", mainapp.products, name="category"),
re_path(r"^category/(?P<pk>\d+)/page/(?P<p... | 1.804688 | 2 |
crichtonweb/cli/crichtoncli/commands/indexzenoss.py | bpluly/crichton | 0 | 12790862 | <reponame>bpluly/crichton<gh_stars>0
# Crichton, Admirable Source Configuration Management
# Copyright 2012 British Broadcasting Corporation
#
# 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
... | 1.445313 | 1 |
tools/map_use_tool.py | BenSmithers/MultiHex2 | 0 | 12790863 | from math import pi
import os
from MultiHex2.tools import Basic_Tool
from MultiHex2.core.coordinates import screen_to_hex, hex_to_screen
from MultiHex2.actions import NullAction
from tools.basic_tool import ToolLayer
from PyQt5 import QtGui
art_dir = os.path.join( os.path.dirname(__file__),'..','assets','buttons')
... | 2.609375 | 3 |
hero_rpg.py | darroyo97/hero-rpg | 0 | 12790864 | <gh_stars>0
#!/usr/bin/env python
# In this simple RPG game, the hero fights the goblin. He has the options to:
# 1. fight goblin
# 2. do nothing - in which case the goblin will attack him anyway
# 3. flee
class Character:
def __init__(self, name, health, power):
self.health = health
self.power ... | 4.0625 | 4 |
src/dataset_miku.py | shidoy/talking-miku | 0 | 12790865 | <filename>src/dataset_miku.py
import requests
from bs4 import BeautifulSoup
from time import sleep
seq = []
print("Fetching", end="")
for i in range(1, 1000):
sleep(1.0)
url = "https://icws.indigo-bell.com/search?q=前川みく&st=n&page=" + str(i)
responce = requests.get(url)
print(".", end="", flush=True)
... | 2.65625 | 3 |
setup.py | Arinerron/pystrfry | 3 | 12790866 | <gh_stars>1-10
#!/usr/bin/env python3
from setuptools import setup
with open('README.md', 'r') as f:
long_description = f.read()
setup(
name = 'pystrfry',
version = '1.0.3',
license = 'BSD-3-Clause',
description = 'a tool for solving those annoying strfry CTF challenges',
long_description = l... | 1.265625 | 1 |
setup.py | jlakkis/sciPENN | 1 | 12790867 | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="sciPENN",
version="0.9.6",
author="<NAME>",
author_email="<EMAIL>",
description="A package for integrative and predictive analysis of CITE-seq data",
long_description... | 1.351563 | 1 |
main.py | k5924/TheVault | 2 | 12790868 | <filename>main.py
import sys
import os
import random
import csv
import json
from platform import system
from string import ascii_uppercase, ascii_lowercase, digits, punctuation
from startPage import Ui_startPage
from genPassPage import Ui_passwordGen
from allAccountsPage import Ui_allAccounts
from AddAccountPage import... | 2.53125 | 3 |
website/views/__init__.py | luxutao/django-blog | 0 | 12790869 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
"""
@__Create Time__ = 2017/12/11 10:34
@__Description__ = " "
"""
| 1.234375 | 1 |
altar/altar/bayesian/__init__.py | AlTarFramework/altar | 32 | 12790870 | # -*- python -*-
# -*- coding: utf-8 -*-
#
# <NAME> <<EMAIL>>
#
# (c) 2013-2020 parasim inc
# (c) 2010-2020 california institute of technology
# all rights reserved
#
# the package
import altar
# and the protocols
from .Controller import Controller as controller
from .Sampler import Sampler as sampler
from .Scheduler... | 2.0625 | 2 |
tti/indicators/_volume_oscillator.py | Bill-Software-Engineer/trading-technical-indicators | 68 | 12790871 | """
Trading-Technical-Indicators (tti) python library
File name: _volume_oscillator.py
Implements the Volume Oscillator technical indicator.
"""
import pandas as pd
from ._technical_indicator import TechnicalIndicator
from ..utils.constants import TRADE_SIGNALS
from ..utils.exceptions import NotEnoughInputData, ... | 3.0625 | 3 |
bobby/tests/test_cass.py | rackerlabs/bobby | 0 | 12790872 | <gh_stars>0
# Copyright 2013 Rackspace, Inc.
"""
Tests for bobby.cass
"""
from bobby import cass
import mock
from silverberg.client import CQLClient
from twisted.internet import defer
from twisted.trial import unittest
class _DBTestCase(unittest.TestCase):
"""Abstract DB test case."""
def setUp(self):
... | 2.1875 | 2 |
day56/ISS_position.py | Nitin-Diwakar/100-days-of-code | 1 | 12790873 | <gh_stars>1-10
import requests
response = requests.get(url="http://api.open-notify.org/iss-now.json")
response.raise_for_status()
data = response.json()
# print(data)
longitude = data["iss_position"]["longitude"]
latitude = data["iss_position"]["latitude"]
iss_position = (longitude, latitude)
print(is... | 2.9375 | 3 |
setup.py | nickp60/pyfastg | 1 | 12790874 | # NOTE: Derived from https://github.com/biocore/qurro/blob/master/setup.py
from setuptools import find_packages, setup
classes = """
Development Status :: 3 - Alpha
Topic :: Software Development :: Libraries
Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: Bio-Informatics
Program... | 1.367188 | 1 |
tools/instant_collada_export.py | maggo007/Raygun | 31 | 12790875 | <reponame>maggo007/Raygun
bl_info = {
"name": "Instant Collada Export",
"blender": (2, 80, 0),
"category": "Import-Export",
}
import bpy
import os
class InstantColladaExport(bpy.types.Operator):
"""Instantly export the current scene as collada"""
bl_idname = "object.instant_collada_export"
bl... | 2.28125 | 2 |
simulation/vis_lib.py | stanford-iprl-lab/UniGrasp | 39 | 12790876 | from mayavi import mlab as mayalab
import numpy as np
import os
def plot_pc(pcs,color=None,scale_factor=.05,mode='point'):
if color == 'red':
mayalab.points3d(pcs[:,0],pcs[:,1],pcs[:,2],mode=mode,scale_factor=scale_factor,color=(1,0,0))
print("color",color)
elif color == 'blue':
mayalab.points3d(pcs[:... | 2.34375 | 2 |
offlinetools/views/login.py | OpenCIOC/offlinetools | 1 | 12790877 | # =========================================================================================
# Copyright 2016 Community Information Online Consortium (CIOC) and KCL Software Solutions
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.... | 1.539063 | 2 |
dxmate.py | jtowers/dxmate | 1 | 12790878 | <gh_stars>1-10
import sublime
import sublime_plugin
import os
import subprocess
import threading
import sys
import json
import mdpopups
import time
from collections import OrderedDict
from .lib.printer import PanelPrinter
from .lib.threads import ThreadProgress
from .lib.threads import PanelThreadProgress
from .lib.lan... | 2.375 | 2 |
sdk/exception/validation_failed_exception.py | CLG0125/elemesdk | 1 | 12790879 | <gh_stars>1-10
class ValidationFailedException(Exception):pass
| 0.917969 | 1 |
nonequilibrium/noneq_data_io.py | mattsmart/biomodels | 0 | 12790880 | <gh_stars>0
import datetime
import numpy as np
import os
from os import sep
from noneq_settings import RUNS_FOLDER
def run_subdir_setup(run_subfolder=None):
current_time = datetime.datetime.now().strftime("%Y-%m-%d %I.%M.%S%p")
time_folder = current_time + os.sep
if run_subfolder is None:
current... | 2.4375 | 2 |
apps/users/admin.py | Houston-ARTCC/information-display-system | 1 | 12790881 | <filename>apps/users/admin.py<gh_stars>1-10
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from ..users.models import User
@admin.register(User)
class UserAdmin(UserAdmin):
model = User
list_display = ('cid', 'email', 'first_name', 'last_name')
search_fields = list_displ... | 2.046875 | 2 |
ds.py | metal-gear-solidworks/mgs-ds | 0 | 12790882 | <reponame>metal-gear-solidworks/mgs-ds
import pygame
import pygame_gui
WIDTH = 1600
HEIGHT = 1200
# pygame init
pygame.init()
window_surface = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption('MGS Driver Station')
background = pygame.Surface((WIDTH, HEIGHT))
background.fill(pygame.Color('#000000'... | 2.6875 | 3 |
CadVlan/Pool/facade.py | marcusgc/GloboNetworkAPI-WebUI | 17 | 12790883 | # -*- coding:utf-8 -*-
# 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 "Lic... | 2 | 2 |
agent/heuristics/HeuristicSlr.py | bpiv400/eBay | 2 | 12790884 | import numpy as np
import torch
from agent.heuristics.util import get_agent_turn, wrapper, get_days, \
get_recent_byr_offers, get_last_norm
from agent.const import DELTA_SLR, NUM_COMMON_CONS
class HeuristicSlr:
def __init__(self, delta=None):
self.patient = np.isclose(delta, DELTA_SLR[-1])
def __... | 2.203125 | 2 |
MachineLearning/TP1/normalEqn.py | piwithy/ENSTA_MACHINE_LEARNING | 0 | 12790885 | <reponame>piwithy/ENSTA_MACHINE_LEARNING<gh_stars>0
import numpy as np
def normalEqn(X, y):
""" Computes the closed-form solution to linear regression
normalEqn(X,y) computes the closed-form solution to linear
regression using the normal equations.
"""
# Initialize some useful values
th... | 3.703125 | 4 |
local_groups/migrations/0028_auto_20170308_1812.py | JoshZero87/site | 4 | 12790886 | <reponame>JoshZero87/site<gh_stars>1-10
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-03-08 18:12
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('local_groups', '0027_auto_20170308_1801'),
]
... | 1.671875 | 2 |
deeplfinterp/util/analytics.py | leaveitout/deep_light_field_interp | 3 | 12790887 | <reponame>leaveitout/deep_light_field_interp
#!/usr/bin/env python3
"""
Copyright <NAME>, Trinity College Dublin, 2017.
Contact sbruton[á]tcd.ie.
"""
import json
import os
from typing import Type
# Need to ensure can run on server, i.e. no X session
import matplotlib; matplotlib.use('Agg')
import matplotlib.pyplot as... | 1.664063 | 2 |
easysocks5/__init__.py | keenser/easysocks5 | 5 | 12790888 | <reponame>keenser/easysocks5
""" easysocks5 is a simple SOCKS5 server implementation based on AsyncIO library
Currently easysocks5 only support unauthenticated socks5 and CONNECT command.
"""
__name__ = "easysocks5"
__version__ = "0.0.5"
__author__ = "<NAME>"
__author_email__ = "<EMAIL>"
__license__ = "MIT"
| 1.171875 | 1 |
fonts/__init__.py | pro585code/RaspDroid-SeverSide | 1 | 12790889 | <reponame>pro585code/RaspDroid-SeverSide
__author__ = 'youngsoul'
| 0.871094 | 1 |
mp_VTKRoutines.py | andregouws/dev | 0 | 12790890 | #!/usr/bin/python
'''
VTK engine room for mrMeshPy viewer
The main vtk processing is done by functions here - although some hardcore
processing is handled in subroutines of other imported modules.
A core concept here is the tracking (kepping in scope) or the "targetVTKWindow"
- this is a vtkRenderWindowInteractor... | 2.453125 | 2 |
src/hyperparameter_tuning.py | KatharinaHermann/tum-Advanced-DL-for-robotics-RL | 2 | 12790891 | <gh_stars>1-10
import os
import sys
import glob
import shutil
import numpy as np
import tensorflow as tf
import gym
import gym_pointrobo
from hwr.agents.pointrobo_ddpg import DDPG
from hwr.cae.cae import CAE
from hwr.training.pointrobot_trainer import PointrobotTrainer
from hwr.utils import load_params
# loading pa... | 2 | 2 |
prep/column_serializer.py | mack-the-psych/vdok3 | 0 | 12790892 | <reponame>mack-the-psych/vdok3<filename>prep/column_serializer.py
#!/usr/bin/env python
import pandas as pd
import ac_column_serializer as clsr
'''
Put a path file like "plimac-custom.pth" into any of your sys.path directories
(e.g. C:/ProgramData/Anaconda3/Lib/site-packages).
# plimac-custom.pth ###################... | 2.484375 | 2 |
memory_stats/main.py | makinteract/micropython-examples | 0 | 12790893 | from microbit import*
import gc
import micropython
def mem_stat():
print('MEMORY STATS')
gc.collect()
micropython.mem_info()
print('Initial free: {} allocated: {}'.format(
gc.mem_free(), gc.mem_alloc()))
print('END OF REPORT')
sleep(500)
mem_stat()
# Output will be printed via serial (11... | 2.6875 | 3 |
home/adapt.py | the-kid89/django_adatp_demo | 0 | 12790894 | <filename>home/adapt.py
from adapt.intent import IntentBuilder
from adapt.engine import IntentDeterminationEngine
engine = IntentDeterminationEngine()
weather_keyword = [
"weather"
]
for wk in weather_keyword:
engine.register_entity(wk, "WeatherKeyword")
weather_types = [
"snow",
"rain",
"wind",... | 2.65625 | 3 |
config/atlas/pybullet_simulation.py | junhyeokahn/PnC | 25 | 12790895 | import numpy as np
class Config(object):
CONTROLLER_DT = 0.001
N_SUBSTEP = 1
CAMERA_DT = 0.05
KP = 0.
KD = 0.
INITIAL_POS_WORLD_TO_BASEJOINT = [0, 0, 1.5 - 0.761]
INITIAL_QUAT_WORLD_TO_BASEJOINT = [0., 0., 0., 1.]
# INITIAL_QUAT_WORLD_TO_BASEJOINT = [0., 0., 0.7071, 0.7071]
PRINT... | 2.03125 | 2 |
home/migrations/0003_alter_blogmodel_image.py | CleoMenezes/My-Distro-Hope | 2 | 12790896 | # Generated by Django 3.2.9 on 2021-11-25 04:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0002_alter_blogmodel_slug'),
]
operations = [
migrations.AlterField(
model_name='blogmodel',
name='image',
... | 1.546875 | 2 |
workflow/tasks/Start.py | cipher-ops/backend-kts | 1 | 12790897 | <gh_stars>1-10
import os
from workflow.task import Task
from workflow.utils.ansible import Ansible
class Start(Task):
def __init__(self, *args, **kwargs):
self.cmd = kwargs.get('cmd')
self.servers = kwargs.get('servers')
def info(self):
self.logger.info('TaskName=Start')
def exec(... | 2.171875 | 2 |
Python/5 kyu/Human Readable Time/humanreadabletime.py | newtonsspawn/codewars_challenges | 3 | 12790898 | import math
def make_readable(seconds):
hh = math.floor(seconds / 3600)
mm = math.floor((seconds - (hh * 3600)) / 60)
ss = math.floor((seconds - (hh * 3600) - (mm * 60)))
readable_time = f'{hh:02}:{mm:02}:{ss:02}'
return readable_time
if __name__ == '__main__':
make_readable(0)
make_r... | 3.359375 | 3 |
examples/s3-2017/rtu2a.py | pgaulon/minicps | 119 | 12790899 | <reponame>pgaulon/minicps
"""
rtu2a.py
"""
from minicps.devices import RTU
from utils import STATE, RTU2A_PROTOCOL
from utils import RTU_PERIOD_SEC
from utils import IP
# rtu2a tags
from utils import CO_0_2a, CO_1_2a, CO_2_2a, CO_3_2a
from utils import HR_0_2a, HR_1_2a, HR_2_2a
from utils import wadi1, wadi1_bin
im... | 2.65625 | 3 |
source/multimode/package/OPA.py | kevinwhere/Bleeding-Pineapple | 0 | 12790900 | <gh_stars>0
from __future__ import division
import random
import math
import QT,DP
def modeAudsley(tasks,scheme):
## to know how many priority levels we need to decide
num_modes=0
for itask in tasks:
num_modes+=len(itask)
for imode in itask:
## put an attribute for each mode used as an indicator for wheth... | 2.625 | 3 |
vectorAngle.py | JustinBonus/Borja-Amies | 0 | 12790901 | <gh_stars>0
def vectorAngle(vec1, vec2, type):
# First take the dev() and hydroProjector() of the vectors if measuring
# angle from deviatoric view
#
#if vec1.shape == (6,1) or vec1.shape(6,) or vec1.shape == (1,6):
#theta = cos-1((u dot v)/(||u|| dot ||v||))
switch_type = {
1: 2, #Stres... | 2.65625 | 3 |
backend/www/photo_store.py | sleepingAnt/viewfinder | 645 | 12790902 | # Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""HTTP request handler for serving viewfinder photo image file
assets.
In case of a local file store, permissions for the current user and
the requested photo are verified and the requester is redirected to
the FileObjectStoreHandler.
For an s3 file store, permi... | 2.390625 | 2 |
RLBotPack/Botimus&Bumblebee/strategy/offense.py | FormularSumo/RLBotPack | 0 | 12790903 | from maneuvers.strikes.double_touch import DoubleTouch
from maneuvers.dribbling.carry_and_flick import CarryAndFlick
from maneuvers.maneuver import Maneuver
from maneuvers.strikes.aerial_strike import AerialStrike, FastAerialStrike
from maneuvers.strikes.close_shot import CloseShot
from maneuvers.strikes.dodge_str... | 2.359375 | 2 |
rec/dataset/split.py | btwardow/dml4rec | 6 | 12790904 | from abc import abstractmethod
from numpy import random
from rec.base import ParametrizedObject
from rec.dataset.dataset import Dataset
class DatasetSplitter(ParametrizedObject):
@abstractmethod
def split(self, dataset):
assert isinstance(dataset, Dataset)
pass
def _prepare_target_datas... | 3.140625 | 3 |
Taller_02_Secuenciales/Ejercicio_01.py | BarinasJ/Algoritmos_Programacion | 0 | 12790905 | <reponame>BarinasJ/Algoritmos_Programacion
"""
Entradas: 3 edades
Edad 1 --> int --> a
Edad 2 --> int --> b
Edad 3 --> int --> c
Salidas --> El promedio los valores (a,b,c)
Promedio --> int --> p
"""
# Entradas
a = int(input("Dime la primera edad\n"))
b = int(input("Dime la primera edad\n"))
c = int(input("Dime la p... | 3.96875 | 4 |
src/data/utils.py | ehudbaumatz/enhance | 0 | 12790906 | import cv2
def split_image_horizontally(path):
img = cv2.imread(path) if type(path) == str else path
height, width = img.shape[:2]
# Let's get the starting pixel coordiantes (top left of cropped top)
start_row, start_col = int(0), int(0)
# Let's get the ending pixel coordinates (bottom right of... | 3.171875 | 3 |
binsdpy/similarity/group_c.py | mikulatomas/binsdpy | 0 | 12790907 | import math
from binsdpy.utils import operational_taxonomic_units, BinaryFeatureVector
def smc(
x: BinaryFeatureVector, y: BinaryFeatureVector, mask: BinaryFeatureVector = None
) -> float:
"""Sokal-Michener similarity (also called simple matching coefficient)
<NAME>. (1958).
A statistical method for... | 3.328125 | 3 |
03 - Types/3.3 - InbuiltTypes-DictionarySetArray/06-dictions-multiple-assignments.py | python-demo-codes/basics | 2 | 12790908 | # HEAD
# DataType - Dictionaries Multiple Assignments
# DESCRIPTION
# Describes the assigning, working, and method usages of dictionaries
# RESOURCES
#
obj = {'color': 'red', 'age': 42}
# Using multiple assignments from the item tuple returned during each iteration
for k, v in obj.items():
print('Key: ' + k + '... | 4.5 | 4 |
utility_ai/models/bucket.py | TomasMaciulis/Utility-AI-API | 0 | 12790909 | from .configuration_entry import ConfigurationEntry
from .action import Action
from utility_ai.traits.utility_score_trait import UtilityScoreTrait
class Bucket(ConfigurationEntry, UtilityScoreTrait):
def __init__(self, name: str, description: dict):
ConfigurationEntry.__init__(self, name, description)
... | 2.390625 | 2 |
test_izettle.py | vilkasgroup/iZettle | 0 | 12790910 | import os
import sys
import unittest
import logging
import uuid
import time
from iZettle.iZettle import Izettle, RequestException
logger = logging.getLogger()
logger.level = logging.DEBUG
stream_handler = logging.StreamHandler(sys.stdout)
logger.addHandler(stream_handler)
class TestIzettle(unittest.TestCase):
de... | 2.609375 | 3 |
QuickSort/quick_sort.py | sddxzsb/algorithm | 0 | 12790911 | <gh_stars>0
def quick_sort(array, pivot_location, compare_count=0):
if len(array) == 1:
return array, compare_count
if len(array) == 2:
if array[0] < array[1]:
return [array[0], array[1]], compare_count + 1
else:
return [array[1], array[0]], compare_count + 1
... | 3.703125 | 4 |
MAIN.py | KDen404/twitch-IRC-chat-bot | 1 | 12790912 | <filename>MAIN.py
from FUNCTIONS import *
import datetime
def main(chan, Main, irc, VIP, f):
print("finished Loading")
print("executing main section")
while Main:
text = irc.get_text().strip(bytes("\r\n", "UTF-8")).decode("UTF-8", "ignore")
buffer = text.replace(":", "")
... | 2.796875 | 3 |
utils.py | natsukium/TensorNet-TF | 0 | 12790913 | import numpy as np
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
from sklearn.model_selection import train_test_split
def down_scale(x, scale=2):
# order 2 -> order 4
h = int(np.sqrt(x.shape[1]))
img = x.astype("float32").reshape(x.shape[0], h, h, 1)
scaled_img = t... | 3.03125 | 3 |
Blender 2.91/2.91/scripts/addons/io_export_dxf/__init__.py | calculusrobotics/RNNs-for-Bayesian-State-Estimation | 1 | 12790914 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 2.046875 | 2 |
Obsolete-Commands/LastMentioned.py | HeNine/PyMoronBot | 0 | 12790915 | # -*- coding: utf-8 -*-
from IRCMessage import IRCMessage
from IRCResponse import IRCResponse, ResponseType
from CommandInterface import CommandInterface
import subprocess
class Command(CommandInterface):
triggers = ['lastsaid', 'lastmention', 'lastmentioned']
help = 'lastmention(ed)/lastsaid <text> - checks... | 2.8125 | 3 |
pandas/core/internals/api.py | roberthdevries/pandas | 0 | 12790916 | """
This is a pseudo-public API for downstream libraries. We ask that downstream
authors
1) Try to avoid using internals directly altogether, and failing that,
2) Use only functions exposed here (or in core.internals)
"""
from __future__ import annotations
from collections import defaultdict
from typing import Defa... | 2.265625 | 2 |
Python/Connection.py | mathur-rishi/Voice-Controlled-Assistant | 0 | 12790917 | import Libraries
#function definitions
def add_wlan_profile():
Libraries.subprocess.run('netsh wlan add profile filename="../Credentials/G5s_Hotspot.xml"', shell=True)
def open_wifi():
Libraries.subprocess.run('start ms-settings:network-wifi', shell=True)
Libraries.time.sleep(15)
def wifi_unsuccessful():
... | 2.65625 | 3 |
reactivex/scheduler/historicalscheduler.py | christiansandberg/RxPY | 0 | 12790918 | <gh_stars>0
from datetime import datetime
from typing import Optional
from .scheduler import UTC_ZERO
from .virtualtimescheduler import VirtualTimeScheduler
class HistoricalScheduler(VirtualTimeScheduler):
"""Provides a virtual time scheduler that uses datetime for absolute time
and timedelta for relative ti... | 2.921875 | 3 |
HackerRank/FindAString/string.py | Naga-kalyan/competitive_programming | 8 | 12790919 | def count_substring(string, sub_string):
count=0
i=0
while(i!=len(string)-len(sub_string)+1):
z=string[i:].find(sub_string)
if(z!=-1):
count+=1
i=i+z+1
else:
break
return count
| 3.796875 | 4 |
Ejercicios/clases/__pycache__/ordenacion_topologica.py | albabernal03/ejercicios_de_ordenar | 0 | 12790920 | class Tareas:
def __init__(self, lista_tareas):
self.lista_tareas = lista_tareas
def bubbleSort(self):
for i in range(len(self.lista-1)):
for j in range(len(self.lista-1)):
if self.lista[j] > self.lista[j+1]:
self.lista[j], self.lista[j+1] = self.lista[j+1], self.lista[j]
lista= [... | 4.03125 | 4 |
train.py | makisgrammenos/alzheimer-stage-classifier | 3 | 12790921 | import numpy as np
from tensorflow import keras
import matplotlib.pyplot as plt
import os
import cv2
import random
import sklearn.model_selection as model_selection
import datetime
from model import createModel
from contextlib import redirect_stdout
categories = ["NonDemented", "MildDemented", "ModerateDemented", "Ver... | 2.6875 | 3 |
heligym/__init__.py | ugurcanozalp/heli-gym | 8 | 12790922 | from gym.envs.registration import register
from heligym.envs import Heli, HeliHover, HeliForwardFlight
register(
id='Heli-v0',
entry_point='heligym.envs:Heli',
max_episode_steps = 5000,
reward_threshold = 0.95,
nondeterministic = False
)
register(
id='HeliHover-v0',
entry_point='heligym... | 1.570313 | 2 |
main.py | Tenvence/digital-device-image-retrieval | 0 | 12790923 | <gh_stars>0
import csv
import os
import numpy as np
import torch
import torch.backends.cudnn
import torch.cuda.amp as amp
import torch.nn as nn
import torch.nn.functional as fun
import torchvision.transforms as transforms
from torch.optim import SGD
from torch.utils.data import DataLoader
from torchvision.datasets imp... | 2.03125 | 2 |
spider/__init__.py | yifei8/spider_blogs | 2 | 12790924 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
Description []
Created by yifei on 2018/2/5.
"""
import control_center
if __name__ == "__main__":
root_url = "http://blog.csdn.net/hustqb/article/list"
spider = control_center.SpiderMain()
spider.start_crawling(root_url) | 1.6875 | 2 |
main.py | filipinascimento/bl-network-measurements | 0 | 12790925 | #!/usr/bin/env python
import sys
import os.path
from os.path import join as PJ
import re
import json
import numpy as np
from tqdm import tqdm
import igraph as ig
import jgf
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
def calcModularity(g):
if("Community" in g.vertex_attributes()):
Ci... | 2.15625 | 2 |
discordBot/bot.py | chand1012/IoTGarageDoor | 0 | 12790926 | <filename>discordBot/bot.py
import discord
import requests
from bs4 import BeautifulSoup
from json_extract import json_extract
HOST = json_extract("host")
PORT = json_extract("port")
URL = "http://{}:{}".format(HOST, PORT)
token = json_extract("token")
me = json_extract("admin")
client = discord.Client()
@client.eve... | 3.03125 | 3 |
pytglib/api/types/address.py | iTeam-co/pytglib | 6 | 12790927 | <reponame>iTeam-co/pytglib
from ..utils import Object
class Address(Object):
"""
Describes an address
Attributes:
ID (:obj:`str`): ``Address``
Args:
country_code (:obj:`str`):
A two-letter ISO 3166-1 alpha-2 country code
state (:obj:`str`):
State, ... | 2.75 | 3 |
world-codesprint-5/algorithms/strings/string-construction/solution.py | bitnot/hackerrank-solutions | 0 | 12790928 | #!/bin/python3
import sys
n = int(input().strip())
for a0 in range(n):
s = input().strip()
letters = set()
cost = 0
for ch in s:
if not ch in letters:
letters.add(ch)
cost += 1
print(cost) | 3.09375 | 3 |
src/010_fib/pyx_fib2.py | xupingmao/benchmark | 0 | 12790929 | <filename>src/010_fib/pyx_fib2.py
# -*- coding:utf-8 -*-
# @author xupingmao
# @since 2022/01/26 16:35:51
# @modified 2022/01/26 16:36:46
# @filename pyx_fib2.py
import pyximport
pyximport.install()
import fib2
fib2.run()
| 1.15625 | 1 |
lfsearch.py | isi-metaphor/mokujin | 0 | 12790930 | <gh_stars>0
#!/usr/bin/env python
# coding: utf-8
# Copyright (C) USC Information Sciences Institute
# Author: <NAME> <<EMAIL>>
# URL: <http://nlg.isi.edu/>
# For more information, see README.md
# For license information, see LICENSE
import sys
import logging
import argparse
import cPickle as pickle
from mokujin.i... | 2.5 | 2 |
siga/prospeccao/views.py | JenniferAmaral/DjangoSpike | 0 | 12790931 | from django.shortcuts import render
from django.views import generic
from django.urls import reverse_lazy
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from .models import DesafioInovacao
from .models import InovacaoAberta
# Desafios de Inovação
class DesafioInovacao(generic.ListView):
... | 2.265625 | 2 |
Algorithms_medium/0750. Number Of Corner Rectangles.py | VinceW0/Leetcode_Python_solutions | 4 | 12790932 | """
0750. Number Of Corner Rectangles
Medium
Given a grid where each entry is only 0 or 1, find the number of corner rectangles.
A corner rectangle is 4 distinct 1s on the grid that form an axis-aligned rectangle. Note that only the corners need to have the value 1. Also, all four 1s used must be distinct.
Exampl... | 3.953125 | 4 |
tests/test_parse_timedelta.py | stanford-rc/globus-timer-cli | 0 | 12790933 | from datetime import timedelta
import pytest
from timer_cli.main import _parse_timedelta
timedelta_test_cases = [
("", timedelta(seconds=0)),
(" ", timedelta(seconds=0)),
("0", timedelta(seconds=0)),
("0s", timedelta(seconds=0)),
("0 s", timedelta(seconds=0)),
("10", timedelta(seconds=... | 2.578125 | 3 |
exact.py | SajedeNick1999/Exact-and-Inexact-Solver-For-a-NP-hard-problem | 1 | 12790934 | from minizinc import Instance, Model, Solver
gecode = Solver.lookup("gecode")
max=0
trivial = Model()
FileName="small"
with open(FileName+".txt") as f:
file=f.readlines()
f.close()
minizinc=""
file = [x.strip() for x in file]
file = [x.split(" ") for x in file]
#file = [x.split("\t") for x in file]
print(file... | 3.328125 | 3 |
app/assess/routes.py | communitiesuk/funding-service-design-assessment | 0 | 12790935 | from app.assess.data import *
from app.config import APPLICATION_STORE_API_HOST_PUBLIC
from app.config import ASSESSMENT_HUB_ROUTE
from flask import abort
from flask import Blueprint
from flask import render_template
from flask import request
assess_bp = Blueprint(
"assess_bp",
__name__,
url_prefix=ASSESSM... | 2.515625 | 3 |
AI/recommendation/data_update.py | osamhack2021/AI_APP_handylib_devlib | 1 | 12790936 | <reponame>osamhack2021/AI_APP_handylib_devlib<filename>AI/recommendation/data_update.py<gh_stars>1-10
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))))
from main... | 2.59375 | 3 |
quicktest/test.py | 0xf0f/quicktest | 0 | 12790937 | <reponame>0xf0f/quicktest<gh_stars>0
class Test:
def __init__(self):
self.name = '<NAME>'
self.method = lambda: None
| 1.609375 | 2 |
docs/examples/fig6p24.py | uluturki/Mathematics-of-Epidemics-on-Networks | 136 | 12790938 | import networkx as nx
import EoN
from collections import defaultdict
import matplotlib.pyplot as plt
import scipy
import random
colors = ['#5AB3E6','#FF2000','#009A80','#E69A00', '#CD9AB3', '#0073B3','#F0E442']
rho = 0.01
Nbig=500000
Nsmall = 5000
tau =0.4
gamma = 1.
def poisson():
return scipy.random.poisson(5)... | 2.3125 | 2 |
calabro/widgets/__init__.py | CarlosGabaldon/calabro | 2 | 12790939 | <reponame>CarlosGabaldon/calabro
from widgets import * | 0.976563 | 1 |
modules/2.79/bpy/types/LimitRotationConstraint.py | cmbasnett/fake-bpy-module | 0 | 12790940 | <reponame>cmbasnett/fake-bpy-module
class LimitRotationConstraint:
max_x = None
max_y = None
max_z = None
min_x = None
min_y = None
min_z = None
use_limit_x = None
use_limit_y = None
use_limit_z = None
use_transform_limit = None
| 1.195313 | 1 |
laboratorio/migrations/0001_initial.py | alejandroquintero/proyecto_laboratorio | 0 | 12790941 | <reponame>alejandroquintero/proyecto_laboratorio
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-14 20:09
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
... | 1.59375 | 2 |
src/secml/ml/scalers/tests/c_scaler_testcases.py | zangobot/secml | 63 | 12790942 | from secml.testing import CUnitTest
from secml.array import CArray
from secml.ml.tests import CModuleTestCases
class CScalerTestCases(CModuleTestCases):
"""Unittests interface for Normalizers."""
def _compare_scalers(self, scaler, scaler_sklearn,
array, convert_to_dense=False):
... | 2.515625 | 3 |
herramientas/zapador/tests/test_zapadorapp.py | ZR-TECDI/Framework_ZR | 4 | 12790943 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from zapador.zapadorapp import ZapadorApp
class TestZapadorApp(unittest.TestCase):
"""TestCase for ZapadorApp.
"""
def setUp(self):
self.app = ZapadorApp()
def test_name(self):
self.assertEqual(self.app.nam... | 2.578125 | 3 |
tonclient/boc.py | move-ton/ton-client-py | 28 | 12790944 | <gh_stars>10-100
from tonclient.decorators import result_as
from tonclient.module import TonModule
from tonclient.types import ParamsOfParse, ResultOfParse, \
ParamsOfParseShardstate, ParamsOfGetBocHash, ResultOfGetBocHash, \
ParamsOfGetBlockchainConfig, ResultOfGetBlockchainConfig, \
ParamsOfGetCodeFromTvc... | 2.21875 | 2 |
scripts/pygrill/board/ssrc_client.py | kins-dev/igrill | 5 | 12790945 | <gh_stars>1-10
#!/usr/bin/env python3
"""
Copyright (c) 2019: <NAME> <<EMAIL>>
(https://git.kins.dev/igrill-smoker)
License: MIT License
See the LICENSE file
"""
__author__ = "<NAME>"
__version__ = "1.4.0"
__license__ = "MIT"
import pigpio
import logg... | 1.96875 | 2 |
beginner_contest/123/C.py | FGtatsuro/myatcoder | 0 | 12790946 | <reponame>FGtatsuro/myatcoder
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
print(((n + min(a,b,c,d,e) - 1) // min(a,b,c,d,e)) + 4)
| 2.1875 | 2 |
app/appmodule/remote.py | linjinux/foxJobGui | 0 | 12790947 | <filename>app/appmodule/remote.py
#!/usr/bin/env python
import tkinter as tk
import os
class RemoteWindow_W(tk.Tk):
"""remote module function"""
def __init__(self):
super(RemoteWindow_W, self).__init__() # 继承类
width = 500 # 登录界面宽度
height = 300 # 登录界面高度
sw = (self.winfo_screen... | 3.3125 | 3 |
pyeccodes/defs/grib1/mars_labeling_def.py | ecmwf/pyeccodes | 7 | 12790948 | <reponame>ecmwf/pyeccodes
import pyeccodes.accessors as _
def load(h):
h.add(_.StringCodetable('marsClass', 1, "mars/class.table"))
h.add(_.StringCodetable('marsType', 1, "mars/type.table"))
h.add(_.StringCodetable('marsStream', 2, "mars/stream.table"))
h.add(_.Ksec1expver('experimentVersionNumber', ... | 1.867188 | 2 |
doc/code/basic_note_calculation.py | 6r1d/midi-message-parser | 0 | 12790949 | #!/usr/bin/env python3
"""
A program to calculate note frequencies for a number of MIDI notes.
"""
from numpy import power, divide
def midi_note_to_freq_basic(keynum):
return 440.0 * pow(2.0, (keynum - 69.0) / 12.0)
f_basic = [midi_note_to_freq_basic(key) for key in range(128)]
print(f_basic)
| 3.640625 | 4 |
highlanderclient/tests/unit/v1/test_cli_actions.py | StephenTao/python-stephenclient | 0 | 12790950 | <filename>highlanderclient/tests/unit/v1/test_cli_actions.py<gh_stars>0
# Copyright 2014 Mirantis, Inc.
# All Rights Reserved
#
# 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.25 | 2 |