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 |
|---|---|---|---|---|---|---|
lira/ui.py | stsewd/pylearn | 1 | 12792851 | from prompt_toolkit.application import Application
from prompt_toolkit.formatted_text import merge_formatted_text, to_formatted_text
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.layout.containers import HSplit, VSplit, Window
from prompt_toolkit.layout.layout import Layout
from prompt_toolkit.... | 2.828125 | 3 |
fred/conf.py | TUDelft-DataDrivenControl/FRED | 0 | 12792852 | import yaml
import numpy as np
import logging
logger = logging.getLogger("cm.conf")
class ControlModelParameters:
"""
Load parameters from .yaml file.
"""
def __init__(self):
self._config = None
self.wind_farm = None
self.turbine = None
self.simulation = None
... | 2.640625 | 3 |
knlp/information_extract/keywords_extraction/textrank_keyword.py | ERICMIAO0817/knlp | 19 | 12792853 | # !/usr/bin/python
# -*- coding:UTF-8 -*-
# -----------------------------------------------------------------------#
# File Name: textrank_keyword
# Author: <NAME>
# Mail: <EMAIL>
# Created Time: 2021-09-04
# Description:
# -----------------------------------------------------------------------#
import networkx as nx... | 2.671875 | 3 |
comprehend_groundtruth_integration/src/comprehend_customer_scripts/GroundTruth/DocumentClassifier/groundtruth_format_conversion_handler.py | rpivo/amazon-comprehend-examples | 16 | 12792854 | <reponame>rpivo/amazon-comprehend-examples
import json
import argparse
from urllib.parse import urlparse
from groundtruth_to_comprehend_clr_format_converter import GroundTruthToComprehendCLRFormatConverter
class GroundTruthToCLRFormatConversionHandler:
def __init__(self):
self.convert_object = GroundTru... | 3.15625 | 3 |
0001.Two Sum/solution.py | zhlinh/leetcode | 0 | 12792855 | <filename>0001.Two Sum/solution.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
*****************************************
Author: zhlinh
Email: <EMAIL>
Version: 0.0.1
Created Time: 2016-01-04
Last_modify: 2016-09-02
******************************************
'''
'''
Given an array of ... | 3.90625 | 4 |
core/management/commands/constants.py | daichi-yoshikawa/django-boilerplate | 4 | 12792856 | <reponame>daichi-yoshikawa/django-boilerplate<filename>core/management/commands/constants.py<gh_stars>1-10
from api.common import constants
N_USERS = 11
N_TENANTS = 5
ADMIN = constants.TENANT_USER_ROLE_TYPE.ADMIN.value
GENERAL = constants.TENANT_USER_ROLE_TYPE.GENERAL.value
TENANT_USERS = {
1: (1, 1, ADMIN), # ... | 1.6875 | 2 |
pendulum_environment.py | Gjain234/AdaptiveQLearning | 1 | 12792857 | <reponame>Gjain234/AdaptiveQLearning
import gym
import numpy as np
from agents import pendulum_agent
from eNet_Agent import eNet
from eNet_Agent import eNet_Discount
from eNet_Agent import eNetPendulum
from src import environment
from src import experiment
from src import agent
import pickle
''' Defining parameters t... | 2.53125 | 3 |
centinel/unit_test/test_http.py | mikiec84/centinel | 29 | 12792858 | import pytest
import os
from ..primitives import http
class TestHTTPMethods:
def test_url_not_exist(self):
"""
test if _get_http_request(args...) returns failure
for an invalid url.
"""
file_name = "data/invalid_hosts.txt"
fd = open(file_name, 'r')
for line... | 2.9375 | 3 |
demo_video.py | lippman1125/pytorch_FAN | 58 | 12792859 | <reponame>lippman1125/pytorch_FAN
import torch
import torchvision.transforms as transforms
import numpy as np
import cv2
import copy
import sys
from utils.imutils import *
from utils.transforms import *
from datasets import W300LP, VW300, AFLW2000, LS3DW
import models
from models.fan_model import FAN
from utils.evalua... | 2 | 2 |
krobot/captcha.py | rbardenet/krobot | 1 | 12792860 | import os,sys
from PIL import Image
import numpy
LETTER_NB = 5
LETTER_SPACE = 1
LETTER_SIZE = 8
LETTER_LEFT = 10
LETTER_RIGHT = 16
class CaptchaReader(object):
"""docstring for CaptchaReader"""
def __init__(self, folderDico):
super(CaptchaReader, self).__init__()
self.folderDico = folderDico + "/"
def read(s... | 2.765625 | 3 |
Assignment_1/git/CSL622/rankingNodes.py | atlkdr/Social_Networks | 0 | 12792861 | <filename>Assignment_1/git/CSL622/rankingNodes.py
"""
@author: <NAME>, <NAME>, <NAME>
"""
import networkx as netx
import matplotlib.pyplot as plt
#find adjacent_nodes
def adj_nodes(G):
list_nodes_info = []
node_mapped = []
i = 0
for u in G.nodes():
list_nodes_info.append([])
... | 3.109375 | 3 |
tests/test_wificontrol.py | TopperBG/pywificontrol | 115 | 12792862 | <filename>tests/test_wificontrol.py
# Written by <NAME> and <NAME> <<EMAIL>>
#
# Copyright (c) 2016, Emlid Limited
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of sourc... | 1.84375 | 2 |
app/main/doc.py | hezmondo/lulu | 0 | 12792863 | <reponame>hezmondo/lulu
import imghdr
import os
import re
from bs4 import BeautifulSoup
from datetime import datetime, timedelta
from xhtml2pdf import pisa
from app import db
from flask import current_app, flash, request
from werkzeug.utils import secure_filename
from app.main.common import Attachment, mget_filestore_d... | 1.851563 | 2 |
test/test_io.py | BioroboticsLab/deeppipeline | 4 | 12792864 | from pipeline.io import unique_id, video_generator
def test_video_generator_2015(bees_video, filelists_path):
gen = video_generator(bees_video, ts_format="2015", path_filelists=filelists_path)
results = list(gen)
assert len(results) == 3
prev_ts = 0.0
for _, _, ts in results:
assert ts > p... | 2.1875 | 2 |
tests/test_encoding_validators/test_are_sources_in_utf.py | SerejkaSJ/fiasko_bro | 25 | 12792865 | <gh_stars>10-100
from fiasko_bro import defaults
from fiasko_bro.pre_validation_checks import file_not_in_utf8
def test_file_not_in_utf8_fail(encoding_repo_path):
directories_to_skip = defaults.VALIDATION_PARAMETERS['directories_to_skip']
output = file_not_in_utf8(encoding_repo_path, directories_to_skip)
... | 2.234375 | 2 |
tests/test_ds_simple_db/test_serializers/test_table_serializer.py | dmitryshurov/simple_data_storage_library | 0 | 12792866 | <filename>tests/test_ds_simple_db/test_serializers/test_table_serializer.py
from unittest import TestCase
from ds_simple_db.core.entry import Entry
from ds_simple_db.serializers.table_serializer import TableSerializer
class TestTableSerializer(TestCase):
def test_entries_to_string_empty_entries_returns_empty_str... | 2.75 | 3 |
src/gui/combobox.py | Epihaius/panda3dstudio | 63 | 12792867 | <filename>src/gui/combobox.py<gh_stars>10-100
from .base import *
from .button import Button
from .menu import Menu
class ComboBox(Button):
_ref_node = NodePath("combobox_ref_node")
def __init__(self, parent, field_width, gfx_ids, text="", icon_id="", tooltip_text=""):
Button.__init__(self, parent,... | 2.546875 | 3 |
model/contact.py | OlegM8/python_training | 0 | 12792868 | from sys import maxsize
class Contact:
def __init__(self, f_name=None, l_name=None, company=None, id=None, info=None, phone=None):
self.f_name = f_name
self.l_name = l_name
self.company = company
self.id = id
self.info = info
self.phone = phone
def __repr__(s... | 3.390625 | 3 |
assistive_gym/__main__.py | RCHI-Lab/bodies-uncovered | 3 | 12792869 | import argparse
from .env_viewer import viewer
from .envs.bm_config import BM_Config
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Assistive Gym Environment Viewer')
parser.add_argument('--env', default='ScratchItchJaco-v1',
help='Environment to test (default:... | 2 | 2 |
src_python/user/user.py | vasisouv/twitter-api-tutorial | 2 | 12792870 | import tweepy
import json
import pymongo
#from src_python import utilities
# Initialize the API consumer keys and access tokens
consumer_key = "LukFsjKDofVcCdiKsCnxiLx2V"
consumer_secret = "<KEY>"
access_token = "<KEY>"
access_token_secret = "<KEY>"
# Authenticate tweepy using the keys
auth = tweepy.OAuthHandler(con... | 2.984375 | 3 |
ixl_learning_3.py | EternalTitan/ICPC-Practise | 1 | 12792871 | <reponame>EternalTitan/ICPC-Practise
def countX(steps):
RC_MAXIMUM = 1000000
edge_r = edge_c = RC_MAXIMUM
for each_step in steps:
r, c = map(int, each_step.split())
if r < edge_r:
edge_r = r
if c < edge_c:
edge_c = c
return edge_r * edge_c
| 2.375 | 2 |
Experiment1/phy1021/thermology.py | wzk1015/PhysicsExperiment | 2 | 12792872 | import xlrd
# from xlutils.copy import copy as xlscopy
import shutil
import os
from numpy import sqrt, abs
import sys
sys.path.append('../..') # 如果最终要从main.py调用,则删掉这句
from GeneralMethod.PyCalcLib import Fitting
from GeneralMethod.PyCalcLib import Method
from reportwriter.ReportWriter import ReportWriter
c... | 2.421875 | 2 |
wagtaildocs_previews/tests/urls.py | mikiec84/wagtail-filepreviews | 22 | 12792873 | <gh_stars>10-100
from __future__ import absolute_import, unicode_literals
from django.conf.urls import include, url
from wagtail.admin import urls as wagtailadmin_urls
from wagtail.core import urls as wagtail_urls
from wagtaildocs_previews import urls as wagtaildocs_urls
urlpatterns = [
url(r'^admin/', include(... | 1.320313 | 1 |
chat/filters.py | jbbqqf/okapi | 0 | 12792874 | # -*- coding: utf-8 -*-
from django_filters import (FilterSet, CharFilter, DateTimeFilter,
NumberFilter, BooleanFilter)
from guardian.shortcuts import get_objects_for_user
from rest_framework import filters
from chat.models import Post, Channel
def get_readable_channel_ids(user):
"""
... | 2.25 | 2 |
onetrack/TrackingData.py | murnanedaniel/OneTrack | 1 | 12792875 | <filename>onetrack/TrackingData.py
# import all
import os
import sys
import logging
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
from scipy import sparse as sps
from tqdm import tqdm
from tqdm.contrib.concurrent import process... | 2.4375 | 2 |
todo_api/services/todo_service.py | acuencadev/distributed-todo-api | 0 | 12792876 | import uuid
from typing import List, Optional
from todo_api.extensions import db
from todo_api.models import Todo
def create_todo(text: str, user_id: int) -> Todo:
todo = Todo(public_id=uuid.uuid4(), text=text, user_id=user_id)
db.session.add(todo)
db.session.commit()
return todo
def get_all_todo... | 2.390625 | 2 |
simpleml/pipelines/__init__.py | ptoman/SimpleML | 15 | 12792877 | <reponame>ptoman/SimpleML
'''
Import modules to register class names in global registry
Define convenience classes composed of different mixins
'''
__author__ = '<NAME>'
from .base_pipeline import Pipeline, AbstractPipeline, DatasetSequence, TransformedSequence
from .validation_split_mixins import Split, SplitConta... | 1.976563 | 2 |
serie3/matrix.py | Koopakiller/Edu-NLA | 0 | 12792878 | # Authors: <NAME> (lambertt) and <NAME> (odafaluy)
import numpy
import scipy
import scipy.linalg
import plot
class Matrix:
"""
Provides Methods for operations with an hilbert- or a special triangular matrix.
"""
def __init__(self, mtype, dim, dtype):
"""
Initializes the class instan... | 3.265625 | 3 |
examples/quadtree/quadtree_demo_insert.py | joshuaskelly/Toast | 0 | 12792879 | import pygame
import random
from toast.quadtree import QuadTree
from toast.scene_graph import GameObject, Scene
from toast.camera import Camera
from toast.event_manager import EventManager
from examples.demo_game import DemoGame
class QuadTreeVisualizer(GameObject):
def __init__(self, quadtree):
super(Qu... | 2.578125 | 3 |
migrations/versions/c1ca0249cb60_update_tiles_v0.1.0.py | mzaglia/bdc-db | 0 | 12792880 | """empty message
Revision ID: c1ca0249cb60
Revises: 0b986a10b559
Create Date: 2020-01-07 08:36:09.067866
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'c1ca0249cb60'
down_revision = '0b986a10b559'
branch_labels = None
depends_on = None
def upgrade():
# ... | 1.34375 | 1 |
test/language/expressions/python/FullConstTypeTest.py | dkBrazz/zserio | 86 | 12792881 | import unittest
from testutils import getZserioApi
class FullConstTypeTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.api = getZserioApi(__file__, "expressions.zs").full_const_type
def testBitSizeOfWithOptional(self):
fullConstTypeExpression = self.api.FullConstTypeExpressi... | 2.546875 | 3 |
api/src/opentrons/config/gripper_config.py | Opentrons/protocol_framework | 0 | 12792882 | from __future__ import annotations
from dataclasses import dataclass
import logging
from typing import Tuple, Optional
from typing_extensions import Literal
log = logging.getLogger(__name__)
GripperName = Literal["gripper"]
GripperModel = Literal["gripper_v1"]
DEFAULT_GRIPPER_CALIBRATION_OFFSET = [0.0, 0.0, 0.0]
@... | 2.484375 | 2 |
importer/management/commands/delete_categories.py | dragon-dxw/nhs-ei.website | 0 | 12792883 | <gh_stars>0
import sys
from django.core.management.base import BaseCommand
from cms.categories.models import Category
from cms.posts.models import Post
from cms.blogs.models import Blog
class Command(BaseCommand):
help = "Deletes categories (bulk action)"
def handle(self, *args, **options):
"""remov... | 2.1875 | 2 |
application/pages/dialog_template/__init__.py | slamer59/awesome-panel | 0 | 12792884 | <filename>application/pages/dialog_template/__init__.py
"""Provides a servable view of a Panel application with a dialog"""
from .app import view
| 1.382813 | 1 |
app/visualization.py | mateuszbaranczyk/portfolio | 0 | 12792885 | import matplotlib.pyplot as plt
import pandas as pd
from app.requester import ExchangeRateRequester
class Grapher:
def __init__(self) -> None:
self.exchange_rate_requester = ExchangeRateRequester()
def _create_historical_rates_df(self, transactions) -> pd.DataFrame:
assert transactions, "The... | 2.828125 | 3 |
biorxiv/biorxiv_extractor.py | danich1/annorxiver | 4 | 12792886 | <reponame>danich1/annorxiver
import os
from pathlib import Path
import re
import subprocess
import tqdm
import pandas as pd
files = (
list(Path("Back_Content").rglob("*.meca"))
+
list(Path("Current_Content").rglob("*.meca"))
)
doc_file_hash_mapper = []
already_seen = set()
for file_name in tqdm.tqdm(fi... | 2.28125 | 2 |
tantrum/workflows/__init__.py | lifehackjim/tantrum | 3 | 12792887 | # -*- coding: utf-8 -*-
"""Workflow encapsulation package for performing actions using the Tanium API."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
import json
import time
from collections import... | 2.359375 | 2 |
vision/visualization.py | yihui-he2020/epipolar-transformers | 360 | 12792888 | import os.path, sys, re, cv2, glob, numpy as np
import os.path as osp
from tqdm import tqdm
from IPython import embed
import scipy
import matplotlib.pyplot as plt
from skimage.transform import resize
from mpl_toolkits.mplot3d import Axes3D
from sklearn.metrics import auc
from matplotlib.patches import Circle
import to... | 2.125 | 2 |
lib/python/treadmill_aws/cli/admin/cell/zk.py | Morgan-Stanley/treadmill-aws | 6 | 12792889 | <filename>lib/python/treadmill_aws/cli/admin/cell/zk.py<gh_stars>1-10
"""Admin module to manage cell ZooKeeper servers.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import click
from treadmill ... | 1.773438 | 2 |
vendors/pipelines.py | nl-hugo/grapy | 2 | 12792890 | <reponame>nl-hugo/grapy
# -*- coding: utf-8 -*-
import logging
from vendors.exporters import RestApiExporter
logger = logging.getLogger(__name__)
class WineVendorsPipeline(object):
def __init__(self, api_url, api_key, forbidden_names, accepted_volumes):
# set api properties
self.api_url = api_u... | 1.984375 | 2 |
PythonCode/src/MinDivLP.py | KoslickiLab/DiversityOptimization | 0 | 12792891 | <reponame>KoslickiLab/DiversityOptimization<filename>PythonCode/src/MinDivLP.py
import numpy as np
from .sparse_nnls import sparse_nnls
from scipy.sparse import vstack
def MinDivLP(A_k_small, A_k_large, y_small, y_large, const, q, thresh=0.01):
""" MinDivLP
A basic, regularized version of the MinDivLP algorit... | 3.140625 | 3 |
pyblast/blast.py | tjomasc/pyblast | 1 | 12792892 | import subprocess
import base64
import json
import re
import hashlib
import tempfile
import os
from lxml import etree
import pprint
from math_tools import percentile
def get_blast_databases(exe_loc, db_loc):
"""
Look for BLAST databases using in given path and return a list
Args:
exe_loc: Locat... | 2.765625 | 3 |
Scrapers/setup.py | TLTFinancialConsulting/Stock-Analysis | 0 | 12792893 | from distutils.core import setup
import py2exe
setup(console=['Single Stock Scraper.py'])
| 1.109375 | 1 |
src/model/UrlMap.py | joyghosh/tiny | 1 | 12792894 | '''
Created on 02-Jul-2016
@author: <NAME>
@version: 1.0
@since: 1.0
'''
from flask_sqlalchemy import SQLAlchemy
from restful.tiny_routes import app
db = SQLAlchemy(app)
class UrlMap(db.Model):
'''
A model responsible for storing shortened to long url mapping.
'''
id = db.Column('id', db.Integer, pri... | 2.96875 | 3 |
method2/utils.py | Kenneth111/BlindWatermark | 2 | 12792895 | <gh_stars>1-10
import numpy as np
from scipy.fftpack import dct, idct
def dct2(a):
return dct( dct( a, axis=0, norm='ortho' ), axis=1, norm='ortho' )
def idct2(a):
return idct( idct( a, axis=0 , norm='ortho'), axis=1 , norm='ortho')
def binarizeImg(img):
threshold = 200
table = []
for i in ran... | 2.546875 | 3 |
Python/Programming Fundamentals/Lists Basics/15. Search.py | teodoramilcheva/softuni-software-engineering | 0 | 12792896 | n = int(input())
word = input()
list_of_strings = [input() for _ in range(n)]
filtered_list = []
for i in range(n):
if word in list_of_strings[i]:
filtered_list.append(list_of_strings[i])
print(list_of_strings)
print(filtered_list)
| 3.9375 | 4 |
examples/poll_card.py | smaeda-ks/twitter-python-ads-sdk | 162 | 12792897 | from twitter_ads.campaign import Tweet
from twitter_ads.client import Client
from twitter_ads.creative import MediaLibrary, PollCard
from twitter_ads.enum import MEDIA_TYPE
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_TOKEN = ''
ACCESS_TOKEN_SECRET = ''
ACCOUNT_ID = ''
# initialize the client
client = Client(CONSUM... | 2.53125 | 3 |
HAFTA-2/DERS-5/1.py | aydan08/Python-Kursu-15.02.21 | 1 | 12792898 | <reponame>aydan08/Python-Kursu-15.02.21
a=input("Sayı Girin:")
a=int(a)
b=input("İkinci Sayı Girin:")
b=int(b)
c=a+b
print(c)
| 3.65625 | 4 |
tagannotator/base/migrations/0004_auto_20200113_0232.py | kixlab/suggestbot-instagram-context-annotator | 0 | 12792899 | # Generated by Django 2.2.7 on 2020-01-13 02:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0003_auto_20200113_0225'),
]
operations = [
migrations.RemoveField(
model_name='photo',
name='user',
... | 1.46875 | 1 |
kibitzr/cli.py | paulmassen/kibitzr | 478 | 12792900 | import sys
import logging
import click
import entrypoints
LOG_LEVEL_CODES = {
"debug": logging.DEBUG,
"info": logging.INFO,
"warning": logging.WARNING,
"error": logging.ERROR,
}
def merge_extensions(click_group):
"""
Each extension is called with click group for
ultimate agility while p... | 2.140625 | 2 |
tests/test_board.py | meyer1994/connect5 | 0 | 12792901 | <reponame>meyer1994/connect5
from unittest import TestCase
from ai.board import Board
class TestBoard(TestCase):
def setUp(self):
self.board = Board(5, 5)
self.board.board = ''.join([
'----X',
'XXXX-',
'-----',
'XXXXO',
'X-X-X'
]... | 3.5625 | 4 |
stubs/esp32_1_10_0/btree.py | jmannau/micropython-stubber | 0 | 12792902 | "Module 'btree' on firmware 'v1.10-247-g0fb15fc3f on 2019-03-29'"
DESC = 2
INCL = 1
def open():
pass
| 0.984375 | 1 |
src/elm_fluent/html_compiler.py | elm-fluent/elm-fluent | 17 | 12792903 | <reponame>elm-fluent/elm-fluent
"""
HTML specific compilation functions
"""
import re
import bs4
from fluent.syntax import ast
from elm_fluent import codegen
from elm_fluent.stubs import defaults as dtypes, html, html_attributes
html_output_type = dtypes.List.specialize(a=html.Html)
def compile_pattern(pattern, lo... | 2.71875 | 3 |
api/tests/opentrons/file_runner/test_create_file_runner.py | mrakitin/opentrons | 0 | 12792904 | """Tests for the create_protocol_runner factory."""
import pytest
from pathlib import Path
from opentrons.hardware_control import API as HardwareAPI
from opentrons.protocol_engine import ProtocolEngine, create_protocol_engine
from opentrons.file_runner import (
ProtocolFileType,
ProtocolFile,
JsonFileRunne... | 2.46875 | 2 |
KGQA/LSTM/test_api.py | johnson7788/EmbedKGQA | 0 | 12792905 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2022/4/18 11:45 上午
# @File : test_api.py
# @Author:
# @Desc : 测试
import unittest
import requests
import time, os
import json
import base64
import random
import string
import pickle
import sys
class LSTMKQGATestCase(unittest.TestCase):
host_server = f'http:... | 2.8125 | 3 |
Python-Automate-Email/main.py | abhijeetpandit7/Flight-Deals | 0 | 12792906 | <gh_stars>0
#This file will need to use the DataManager,FlightSearch, FlightData, NotificationManager classes to achieve the program requirements.
from notification_manager import NotificationManager
from flight_search import FlightSearch
from flight_data import FlightData
from data_manager import DataManager
notifica... | 3.125 | 3 |
test/import_it.py | cltl/FrameNetNLTK | 1 | 12792907 | <reponame>cltl/FrameNetNLTK<gh_stars>1-10
import sys
sys.path.insert(0, '../..')
from FrameNetNLTK import load
my_fn = load(folder='test_lexicon',
verbose=2) | 1.539063 | 2 |
examples/pybullet/gym/pybullet_envs/minitaur/agents/trajectory_generator/tg_inplace.py | felipeek/bullet3 | 9,136 | 12792908 | """Trajectory Generator for in-place stepping motion for quadruped robot."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import numpy as np
TWO_PI = 2 * math.pi
def _get_actions_asymmetric_sine(phase, tg_params):
"""Returns the leg exte... | 3.0625 | 3 |
1_Agent_based_modeling.py | gy19sp/GEO5003-Practicals | 0 | 12792909 | <reponame>gy19sp/GEO5003-Practicals<gh_stars>0
import random # imports the random function
""" ransomised position of y coordinate of agent in a 99*99 grid, this function varies
from the random.random function, as the randint functions offers the possibility to create
a range of numbers whereas random.random offers... | 3.859375 | 4 |
082 - LISTA, dividindo valores entre LISTAS.py | Rprjunior/PraticandoPython | 0 | 12792910 | '''082 - LISTA, DIVIDINDO VALORES ENTRE LISTAS.
PROGRAMA QUE LEIA VÁRIOS VALORES E GUARDE NUMA LISTA.
DIVIDA OS VALORES IMPARES E PARES EM OUTRAS DUAAS LISTAS E MOSTRE AS 3 NO FINAL.'''
numeros = list()
pares = list()
impares = list()
while True:
numeros.append(int(input('Digite um valor: ')))
resposta = str(... | 4 | 4 |
htic/data.py | jenskutilek/HumbleTypeInstructionCompiler | 2 | 12792911 | from __future__ import absolute_import
from .error import HumbleError
class Data(object):
"""Manage parsed data"""
def __init__(self):
self.gasp = []
"""[(int size, bool doGridfit, bool doGray, bool symSmoothing, bool symGridfit)]"""
self.maxp = {}
"""{string name : int value}"""
self.cvt = []
"""[i... | 2.4375 | 2 |
Task1B.py | AndrewKeYanzhe/part-ia-flood-warning-system | 0 | 12792912 | <filename>Task1B.py
from floodsystem.stationdata import build_station_list
from floodsystem.geo import stations_by_distance
def run():
stations = build_station_list()
p = (52.2053, 0.1218)
distances = stations_by_distance(stations, p)
print("The closest stations are: ", distances[:10])
print("The ... | 3.15625 | 3 |
Models/FCNNs.py | alexchartrand/IoT | 0 | 12792913 | <gh_stars>0
# FCNNs
#<NAME>, <NAME>, <NAME> (2017b) Time series classification from scratch with deep neural networks:
#A strong baseline. In: International Joint Conference on Neural Networks, pp 1578–1585
import torch.nn as nn
import torch.optim as optim
from . import Utility
class FCNNs(nn.Module):
def __init... | 2.625 | 3 |
client/paddleflow/run/run_info.py | Mo-Xianyuan/PaddleFlow | 0 | 12792914 | """
Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... | 1.859375 | 2 |
src/RFDTypeDefinition.py | RFDaemoniac/ReadableFormattedData | 1 | 12792915 | <reponame>RFDaemoniac/ReadableFormattedData
import re
import pprint
import pdb
from RFDUtilityFunctions import LogValidationCheck, LogError, GetInteger, GetBoolean, GetFloat, GetString, ParseValue
class RootTypes():
Unspecified = 'Unspecified'
Bool = 'Bool'
Int = 'Int'
Float = 'Float'
String = 'String'
Array = ... | 2.34375 | 2 |
lib/modes/mode_twitch.py | okonomichiyaki/parrot.py | 80 | 12792916 | <reponame>okonomichiyaki/parrot.py<gh_stars>10-100
from lib.detection_strategies import single_tap_detection, loud_detection, medium_detection, percentage_detection
import threading
import numpy as np
import pyautogui
from pyautogui import press, hotkey, click, scroll, typewrite, moveRel, moveTo, position
from time imp... | 2.375 | 2 |
main.py | scsole/rpi-gpio-video | 0 | 12792917 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# main.py
#
import RPi.GPIO as GPIO
import time
import subprocess
import os
PIR_PIN = 11 # GPIO11
GPIO.setmode(GPIO.BOARD) # Use header pin numbers
GPIO.setup(PIR_PIN, GPIO.IN)
running = False # Is a video currently playing?
player ... | 3.0625 | 3 |
scripts/feature_def_gen/feature_def_gen.py | isb-cgc/ISB-CGC-Webapp | 13 | 12792918 | ###
# Copyright 2015-2019, Institute for Systems Biology
#
# 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 la... | 1.9375 | 2 |
pysot/models/backbone/resnet.py | eldercrow/tracking-pytorch | 0 | 12792919 | <gh_stars>0
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision.models import resnet18 as _resnet18
from torchvision.models import resnet34 as _resnet34
from torchvision.models import resnet50 as _resnet50
__all__ = ['ResnetCGD', 'resnet18', 'resnet34', 'resnet50']
class... | 2.28125 | 2 |
clients/abn_client.py | xahgmah/abnamro2ynab | 1 | 12792920 | import abna
import json
import settings
class ABNClient:
mutations = None
new_last_transaction = None
FILENAME = "last_transactions.json"
def __init__(self):
self.sess = abna.Session(settings.ABNA_ACCOUNT)
self.sess.login(settings.ABNA_PASSNUMBER, settings.ABNA_PASSWORD)
self.... | 2.34375 | 2 |
Leetcode/0105. Construct Binary Tree from Preorder and Inorder Traversal.py | luckyrabbit85/Python | 1 | 12792921 | class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def buildTree(self, preorder: list[int], inorder: list[int]) -> list[TreeNode]:
if not preorder or not inorder:
return None
r... | 3.640625 | 4 |
oo/pessoa.py | DouglasPortela0403/pythonbirds | 0 | 12792922 | <gh_stars>0
class Pessoa:
olhos = 2
def __init__(self, *filhos, nome=None, idade=None):
self.nome = nome
self.idade = idade
self.filhos =list(filhos)
def cumprimentar(self):
return 'Olá'
@staticmethod
def metodo_estatico():
return 42
@classmethod
def... | 3.6875 | 4 |
autos/googleapi/__init__.py | hans-t/autos | 1 | 12792923 | from .drive import Drive
from .sheets import Sheets
| 0.980469 | 1 |
bin/nrcSpreadsheetScraper.py | SkyTruth/scraper | 2 | 12792924 | #!/usr/bin/env python
# This document is part of scraper
# https://github.com/SkyTruth/scraper
# =================================================================================== #
#
# The MIT License (MIT)
#
# Copyright (c) 2014 SkyTruth
#
# Permission is hereby granted, free of charge, to any person obtainin... | 1.78125 | 2 |
s3splitmerge/tests/aws.py | MacHu-GWU/s3splitmerge-project | 0 | 12792925 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
S3 object for testing naming convention::
s3://{bucket}/{prefix}/{module}/{function/method_name}/{filename}
"""
import boto3
# --- manually configure following settings
aws_profile = None
aws_region = "us-east-1"
bucket = "aws-data-lab-sanhe-aws-etl-solutions"
prefix = "s3... | 1.617188 | 2 |
modules/infra/admin_piccolo/tables.py | Fates-List/BotList | 17 | 12792926 | <reponame>Fates-List/BotList<filename>modules/infra/admin_piccolo/tables.py
import datetime
from piccolo.columns.column_types import (UUID, Array, BigInt, Boolean, Float,
ForeignKey, Integer, Secret, Text,
Timestamptz, Varchar)
from pi... | 2.203125 | 2 |
01_Python_Basico_Intermediario/Aula027/aula27.py | Joao-Inacio/Curso-de-Python3 | 1 | 12792927 | """
Expressão condicional com operador OR
"""
nome = input('Qual é seu nome: ')
print(nome or 'Você não digitou nada!')
| 3.734375 | 4 |
elements-of-programming-interviews/14.1.sorted-array-intersection.py | vtemian/interviews-prep | 8 | 12792928 | <filename>elements-of-programming-interviews/14.1.sorted-array-intersection.py
from typing import List
def intersection(x: List[int], y: List[int]) -> List[int]:
result = []
idx_x = idx_y = 0
while idx_x < len(x) and idx_y < len(y):
if x[idx_x] == y[idx_y] and (not result or result[-1] != x[idx_x... | 3.828125 | 4 |
src/semver/__init__.py | b0uh/python-semver | 159 | 12792929 | <gh_stars>100-1000
"""
semver package major release 3.
A Python module for semantic versioning. Simplifies comparing versions.
"""
from ._deprecated import (
bump_build,
bump_major,
bump_minor,
bump_patch,
bump_prerelease,
compare,
finalize_version,
format_version,
match,
max_v... | 0.898438 | 1 |
src/lda_test.py | mpenza19/LatentDirichletAlloc | 0 | 12792930 | # Adapted from:
# https://www.analyticsvidhya.com/blog/2016/08/beginners-guide-to-topic-modeling-in-python/
import read_bibtex
import os, shutil
from nltk.corpus import stopwords
from nltk.stem.wordnet import WordNetLemmatizer
from nltk.stem.porter import PorterStemmer
import string
import gensim
from gensim import c... | 3.09375 | 3 |
test_package/conanfile.py | appimage-conan-community/appimagetool_installer | 0 | 12792931 | <reponame>appimage-conan-community/appimagetool_installer
import os
from conans import ConanFile, CMake, tools
class AppimagetoolinstallerTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
exports_sources = ("appimage.svg", "org.appimagecraft.TestApp.desktop")
# build_requires = ("cm... | 1.84375 | 2 |
docs/examples/tutorial/2_split/main3.py | ynikitenko/lena | 4 | 12792932 | <filename>docs/examples/tutorial/2_split/main3.py
from __future__ import print_function
import os
from lena.core import Sequence, Split, Source
from lena.structures import Histogram
from lena.math import mesh
from lena.output import ToCSV, Write, LaTeXToPDF, PDFToPNG
from lena.output import MakeFilename, RenderLaTeX
... | 2.65625 | 3 |
build-support/mini-cluster/relocate_binaries_for_mini_cluster.py | granthenke/kudu | 2 | 12792933 | <reponame>granthenke/kudu
#!/usr/bin/env python
################################################################################
# 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... | 1.273438 | 1 |
SumOfPrimes.py | kevjames3/CodingChallenges | 0 | 12792934 | '''
Focus of this file is to determine the sum of the first 1000 prime numbers.
'''
import random
import math
def isPrime(num):
result = True
if num > 2 and not (num % 2 == 0):
#Use Fermat's little theorem a^n (mod n) = a (mod n).
#If they equal each other, then that means that this
#one is prime. Also, 2 <=... | 4.0625 | 4 |
src/rnn/text_classification_model_simple.py | jorgemf/kaggle_redefining_cancer_treatment | 20 | 12792935 | import tensorflow as tf
from tensorflow.contrib import slim
import tensorflow.contrib.layers as layers
from ..configuration import *
from .text_classification_train import main
class ModelSimple(object):
"""
Base class to create models for text classification. It uses several layers of GRU cells.
"""
... | 3.1875 | 3 |
Programmi/script/print_comandi_c0data.py | lgiacomazzo/SG0-ITA | 1 | 12792936 | <reponame>lgiacomazzo/SG0-ITA<filename>Programmi/script/print_comandi_c0data.py
path_dir = "SG0-2.1.1/immagini_c0data"
print("")
print("")
print(f"cd {path_dir}")
lista_png = ["BG12A.png","BG24A1.png","BG24A3.png","BG24A4.png","BG24A5.png","BG24E1.png","BG24E4.png","BG24N1.png","BG24N3.png","BG24N4.png","BG83A3.png","I... | 1.804688 | 2 |
ventura/_hweb.py | HermesPasser/ventura | 0 | 12792937 | import urllib.request as req
import ventura._hpath as hpath
import os
def download(url, file_name):
response = req.urlopen(url)
# Create folders if need
hpath.create_dir(file_name)
file = open(file_name,'wb')
file.write(response.read())
file.close()
def get_page(url):
response = req.urlopen(url)
return r... | 2.9375 | 3 |
pyramid_api/helper_types.py | shawnsarwar/pyramid_analytics_python | 0 | 12792938 | <reponame>shawnsarwar/pyramid_analytics_python
from dataclasses import dataclass
import json
from string import Template
from typing import Any
from dataclasses_json import DataClassJsonMixin
from . import api_types
@dataclass
class MetaData(DataClassJsonMixin):
name: str = None
dstPath: str = ... | 2.265625 | 2 |
python/pynet/w01_03.py | bandarji/lekhan | 0 | 12792939 | #!/usr/bin/env python
"""
Create three different variables the first variable should use all lower case
characters with underscore ( _ ) as the word separator. The second variable
should use all upper case characters with underscore as the word separator.
The third variable should use numbers, letters, and undersco... | 4.125 | 4 |
tsserver/configutils.py | m4tx/techswarm-server | 1 | 12792940 | import os
from tsserver import app
def get_upload_dir():
return os.path.join(app.root_path, app.config['PHOTOS_UPLOAD_FOLDER'])
| 1.742188 | 2 |
carts/views.py | cristinacorghi/BeautyProject | 0 | 12792941 | from django.shortcuts import render, HttpResponseRedirect
from django.urls import reverse
import Store.views
from Store.models.productModel import *
from .forms import CustomerPaymentForm
from .models import *
from Store.models.productModel import CustomerOrders
def cart_view(request):
try:
the_id = reque... | 2.390625 | 2 |
sessao03/04_56-FuncoesPart3/aula56.py | Ruteski/CursoPythonOM | 0 | 12792942 | """
funcoes - *args e **kwargs
"""
# def func(a1,a2,a3,a4,a5, nome=None, a6=None):
# print(a1,a2,a3,a4,a5,nome, a6)
# return nome, a6
#
#
# var = func(1,2,3,4,5, nome='lincoln', a6='5')
# print(var[0], var[1])
# **kwargs = key word args - argumentos nomeados, basicamente um json
def func(*args, **kwargs):
... | 4.0625 | 4 |
clusterwrapper/clustermetrics.py | opennlp/DeepPhrase | 2 | 12792943 | <reponame>opennlp/DeepPhrase<filename>clusterwrapper/clustermetrics.py
from sklearn.metrics import silhouette_score, calinski_harabaz_score
def get_silhouette_coefficient(cluster_train_data,labels_assigned):
return silhouette_score(cluster_train_data,labels_assigned)
def get_calinski_harabaz_coefficient(cluster... | 2.046875 | 2 |
Python/Strings/designer_door.py | abivilion/Hackerank-Solutions- | 0 | 12792944 | <gh_stars>0
# Enter your code here. Read input from STDIN. Print output to STDOUT
x,y = map(int,input().split())
items = list(range(1,x+1,2))
items = items+items[::-1][1:]
for i in items:
text= "WELCOME" if i == x else '.|.'*i
print (text.center(y,'-'))
| 3.65625 | 4 |
deployment_tool/middleware.py | Onyxnetworks/deployment_tool | 0 | 12792945 | <filename>deployment_tool/middleware.py
import re
from django.shortcuts import render, redirect
from django.conf import settings
EXEMPT_URL = settings.LOGIN_URL.lstrip('/')
# Class to redirect user to login unless they have a valid APIC Cookie
class LoginRequiredMiddleware:
def __init__(self, get_response):
... | 2.1875 | 2 |
soam/core/__init__.py | MuttData/soam | 1 | 12792946 | """SoaM core."""
from soam.core.runner import SoamFlow
from soam.core.step import Step
| 0.898438 | 1 |
weixin/framework/tornado.py | 500-Error/weixin-SDK | 1 | 12792947 | <gh_stars>1-10
# encoding=utf-8
import functools
import tornado.web
from ..utils import is_valid_request
def weixin_request_only(func):
@functools.wraps(func)
def _wrapper_(req):
nts = map(lambda k: req.get_query_argument(k, ""),
['nonce', 'timestamp', 'signature'])
nonce, tim... | 2.125 | 2 |
Mixin/Search.py | parente/clique | 3 | 12792948 | <filename>Mixin/Search.py<gh_stars>1-10
'''
Defines search related mixins.
@author: <NAME> <<EMAIL>>
@copyright: Copyright (c) 2008 <NAME>
@license: BSD License
All rights reserved. This program and the accompanying materials are made
available under the terms of The BSD License which accompanies this
distribution, a... | 2.828125 | 3 |
projectmanager/migrations/0010_client_email.py | gregplaysguitar/django-projectmanager | 8 | 12792949 | <reponame>gregplaysguitar/django-projectmanager
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('projectmanager', '0009_auto_20150414_1019'),
]
operations = [
migrations.Add... | 1.398438 | 1 |
barcodes/dxfwrite/dxfwrite/htmlcolors.py | sbarton272/AcousticBarcodes-Explorations | 2 | 12792950 | capitalized_html_colors = {
"Blue": (
0,
0,
255
),
"Pink": (
255,
192,
203
),
"Darkorange": (
255,
140,
0
),
"Fuchsia": (
255,
0,
255
),
"LawnGreen": (
124,
252,
0
... | 1.625 | 2 |