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 |
|---|---|---|---|---|---|---|
openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/share/nslcd-utils/users.py | sotaoverride/backup | 0 | 35400 | <reponame>sotaoverride/backup
# coding: utf-8
# users.py - functions for validating the user to change information for
#
# Copyright (C) 2013 <NAME>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software... | 2.625 | 3 |
migrations/versions/00f001a958b1_web_dev_chapter3_quiz_total_score.py | GitauHarrison/somasoma_V1 | 0 | 35401 | <filename>migrations/versions/00f001a958b1_web_dev_chapter3_quiz_total_score.py
"""web dev chapter3 quiz total score
Revision ID: 00f001a958b1
Revises: <KEY>
Create Date: 2022-03-02 11:57:04.695611
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '00f001a958b1'
... | 1.351563 | 1 |
tsv_to_indexd.py | uc-cdis/aws-batch-index | 0 | 35402 | <reponame>uc-cdis/aws-batch-index
import csv
import json
import re
import os
import sys
import requests
import base64
PATH = "./output"
stuff = []
with open("thing.txt", "w+") as r:
for path, dirs, files in os.walk(PATH):
for filename in files:
fullpath = os.path.join(path, filename)
... | 2.296875 | 2 |
eventup/events/models/events.py | Z-Devs-platzi/backend | 0 | 35403 | ''' Events Model '''
import uuid
from django.db import models
# Utils Model
from eventup.utils.models import GeneralModel
class Event(GeneralModel):
''' Event Model '''
# Id
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
# Event data
name = models.CharField(max_leng... | 2.328125 | 2 |
tests/test_api/test_project.py | orf/polyaxon-schemas | 0 | 35404 | <gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import uuid
from unittest import TestCase
from hestia.tz_utils import local_now
from marshmallow import ValidationError
from tests.utils import assert_equal_dict
from polyaxon_schemas.api.experiment import Experimen... | 2.125 | 2 |
pos_repair_order/wizard/assign_wizard.py | divyapy/odoo | 0 | 35405 | <reponame>divyapy/odoo<gh_stars>0
# -*- coding: utf-8 -*-
from odoo import api, fields, models, _
class AssignMechanicWizard(models.TransientModel):
_name = 'assign.mechanic.wizard'
_description = 'Assign Mechanic Wizard'
# relations
mechanic_ids = fields.Many2many('hr.employee', string="Assign Mecha... | 2.28125 | 2 |
python_to_you/models/profile.py | jacksonsr45/python_to_you | 1 | 35406 | <reponame>jacksonsr45/python_to_you
import datetime
from python_to_you.extensions.database import db
from sqlalchemy_serializer import SerializerMixin
class Profile(db.Model, SerializerMixin):
__tablename__ = 'profiles'
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.ForeignKey('users.... | 2.609375 | 3 |
boofuzz/boofuzz/primitives/simple.py | mrTavas/owasp-fstm-auto | 2 | 35407 | from ..fuzzable import Fuzzable
class Simple(Fuzzable):
"""Simple bytes value with manually specified fuzz values only.
:type name: str, optional
:param name: Name, for referencing later. Names should always be provided, but if not, a default name will be given,
defaults to None
:type default... | 3.296875 | 3 |
schedule.py | budgidiere/Schedule | 0 | 35408 | <filename>schedule.py
#schedule.py
#importing time
import time
#Making time readable format
clock = (time.ctime())
hour = clock[11:13]
minute = clock[14:16]
currenttime = 60*int(hour) + int(minute)
day = clock[0:3]
print (currenttime)
print (clock)
#IDK why this is here
whatclass = ("none")
#used to read White and Go... | 3.75 | 4 |
duffy/models/__init__.py | Zlopez/duffy | 0 | 35409 | from .nodes import Host, HostSchema, Session, SessionSchema, Project, SSHKey
| 0.933594 | 1 |
math/next_perfect_square.py | ethyl2/code_challenges | 0 | 35410 | """
https://www.codewars.com/kata/56269eb78ad2e4ced1000013/train/python
Given an int, return the next 'integral perfect square', which is an integer n such that sqrt(n) is also an int.
If the given int is not an integral perfect square, return -1.
"""
def find_next_square(sq: int) -> int:
sqrt_of_sq = sq ** (1/2... | 4.1875 | 4 |
scripts/moveCenterPtOutOfExtras.py | 75RAUL/georef | 6 | 35411 | #! /usr/bin/env python
import django
from django.conf import settings
django.setup()
from geocamTiePoint.models import Overlay
def moveCenterPtOutOfExtras():
overlays = Overlay.objects.all()
for overlay in overlays:
overlay.centerLat = overlay.extras.centerLat
overlay.centerLon = overlay.extr... | 1.828125 | 2 |
xl_tensorflow/models/vision/detection/utils/yolo_utils.py | Lannister-Xiaolin/xl_tensorflow | 0 | 35412 | <gh_stars>0
#!usr/bin/env python3
# -*- coding: UTF-8 -*-
from functools import reduce
from PIL import Image, ImageFont, ImageDraw
import numpy as np
from matplotlib.colors import rgb_to_hsv, hsv_to_rgb
import colorsys
def compose(*funcs):
"""Compose arbitrarily many functions, evaluated left to right.
Refer... | 2.71875 | 3 |
src/python/shared/constants.py | rgrannell1/monic-polynomial | 0 | 35413 | <filename>src/python/shared/constants.py<gh_stars>0
import os
constants = {
'print_frequency': 10_000,
'flush_threshold': 10_000,
'tile_size': 5_000,
'project_root': os.path.realpath(os.path.join(os.path.dirname(__file__), '../../../')),
'colours': {
'background': 'black'
},
'escapes': {
'line_up': '\x... | 1.609375 | 2 |
server/permatrix.py | osaizar/sand | 0 | 35414 | <reponame>osaizar/sand
import random
import numpy as np
MATRIX = [(7, 6, 2, 1, 0, 3, 5, 4),
(6, 5, 0, 1, 3, 2, 4, 7),
(1, 0, 3, 7, 5, 4, 6, 2),
(7, 5, 2, 6, 1, 3, 0, 4),
(0, 4, 2, 3, 7, 1, 6, 5),
(7, 1, 0, 2, 3, 5, 6, 4),
(3, 4, 2, 6, 0, 7, 5, 1),
(6, 1, 5, 2, 7, 4, 0, 3),
(3, 1, 4, 5, 0, 7, 2, 6),
(3, 2, 6, 5, 0, 4, ... | 2.640625 | 3 |
fizzbuzz.py | harman31/TwilioQuest | 0 | 35415 | import sys
# Set up a list for our code to work with that omits the first CLI argument,
# which is the name of our script (fizzbuzz.py)
inputs = sys.argv
inputs.pop(0)
# Process the "inputs" list as directed in your code
inputs = [int(x) for x in sys.argv[0:]]
for x in inputs:
if x % 3 == 0 and x % 5 == 0:
... | 3.484375 | 3 |
robotics/simulators/sensor_model.py | bkolligs/robotics-prototyping | 3 | 35416 | <filename>robotics/simulators/sensor_model.py<gh_stars>1-10
import numpy as np
import matplotlib.pyplot as plt
# sensor object to inherit for different sensors
class Sensor:
def __init__(self, name, mean, cov, state):
self.name_ = name
# add the sensor noise characteristics
self.mean_ = mea... | 3.59375 | 4 |
tests/__init__.py | frenck/python-ambee | 6 | 35417 | <filename>tests/__init__.py
"""Asynchronous Python client for the Ambee API."""
| 0.882813 | 1 |
Singleton.py | cxwithyxy/PythonSingleton | 0 | 35418 | #coding:utf-8
import threading
class Singleton(object):
def __new__(cls, *args, **kwargs):
lock = threading.Lock()
lock.acquire()
if not hasattr(cls, "_instance"):
cls._instance = object.__new__(cls)
cls._instance.__Singleton_Init__(*args, **kwargs)
lock.rele... | 3 | 3 |
api/tacticalrmm/integrations/bitdefender/urls.py | subzdev/tacticalrmm | 1 | 35419 | from django.urls import path, include
from . import views
urlpatterns = [
path('endpoints/', views.GetEndpoints.as_view()),
path('endpoint/<str:endpoint_id>/', views.GetEndpoint.as_view()),
path('packages/', views.GetPackages.as_view()),
path('endpoint/quickscan/<str:endpoint_id>/', views.GetQuickSc... | 1.75 | 2 |
libcoop.py | jethornton/coop4 | 0 | 35420 | <reponame>jethornton/coop4
class Ledfade:
def __init__(self, *args, **kwargs):
if 'start' in kwargs:
self.start = kwargs.get('start')
if 'end' in kwargs:
self.end = kwargs.get('end')
if 'action' in kwargs:
self.action = kwargs.get('action')
self.transit = self.end - self.start
def ledpwm(self, p):
... | 3.046875 | 3 |
challenges/Sorter/poller/for-release/machine.py | pingjuiliao/cb-multios | 473 | 35421 | from generator.actions import Actions
import random
import string
import struct
import numpy as np
import math
import datetime as dt
import ctypes
def kaprica_mixin(self):
if hasattr(self, 'xlat_seed'):
return
def xlat_seed(seed):
def hash_string(seed):
H = 0x314abc86
f... | 2.234375 | 2 |
KanoTerminator.py | JJFReibel/KanoTerminator | 0 | 35422 | # Kano or Terminator
# By <NAME>
# I will not be held responsible for:
# any shenanigans
import os
# ಠ_ಠ
# ¯¯\_(ツ)_/¯¯
# (╭ರ_•́)
os.system("printf '\e[0;35;1;1m (╭ರ_'")
os.system("printf '\e[0;31;1;5m°'")
os.system("printf '\e[0;35;1;1m)\n'")
| 2.015625 | 2 |
tests/test_leggins_list.py | ButterflyBug/Affordable-leggins | 3 | 35423 | <reponame>ButterflyBug/Affordable-leggins
import pytest
from affordable_leggins.leggins_list import get_rrp_from_single_site
from affordable_leggins.leggins_list import get_list_of_leggins_from_page
from affordable_leggins.leggins_list import get_list_of_leggins
from affordable_leggins.store import store_data, read_dat... | 2.296875 | 2 |
spotify_gender_ex/downloader.py | Theta-Dev/Spotify-Gender-Ex | 1 | 35424 | import os
import re
import urllib.request
import click
import requests
from tqdm import tqdm
URL_UPTODOWN = 'https://spotify.de.uptodown.com/android/download'
URL_GHAPI = 'https://api.github.com/repos/Theta-Dev/Spotify-Gender-Ex/commits/master'
URL_RTABLE = 'https://raw.githubusercontent.com/Theta-Dev/Spotify-Gender-... | 2.8125 | 3 |
robopager/check_type/intraday_latency_check.py | equinoxfitness/robopager | 1 | 35425 | # Intraday latency check function
from datetime import datetime
import pytz
from datacoco_batch.batch import Batch
from datacoco_core.logger import Logger
log = Logger()
def convert_time(t):
# convert naive datetime object to utc aware datetime
utc = pytz.utc
timetz = utc.localize(t)
return timetz
... | 2.625 | 3 |
data_util.py | imalikshake/StyleNet | 202 | 35426 | <filename>data_util.py<gh_stars>100-1000
import numpy as np
class BatchGenerator(object):
'''Generator for returning shuffled batches.
data_x -- list of input matrices
data_y -- list of output matrices
batch_size -- size of batch
input_size -- input width
output_size -- output width
mini -... | 2.734375 | 3 |
PointCloudClass/down_sample.py | 565353780/pointcloud-manage | 3 | 35427 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import open3d as o3d
def downSample(pointcloud_file_path, down_sample_cluster_num, save_pointcloud_file_path):
print("[INFO][downSample]")
print("\t start down sampling pointcloud :")
print("\t down_sample_cluster_num = " + str(down_sample_cluster_num) + "..."... | 2.5 | 2 |
congregation/net/handler.py | CCD-HRI/congregation | 3 | 35428 | import asyncio
import pickle
from congregation.net.messages import *
class Handler:
def __init__(self, peer, server: [asyncio.Protocol, None] = None):
self.peer = peer
self.server = server
self.msg_handlers = self._define_msg_map()
def handle_msg(self, data):
"""
deter... | 2.328125 | 2 |
Course-4-Clustering-and-Retrieval/week-3-k-means-with-text-data_blank.py | emetnatbelt/Machine-Learning-Univ-Washington1 | 20 | 35429 |
# coding: utf-8
# # k-means with text data
# In this assignment you will
# * Cluster Wikipedia documents using k-means
# * Explore the role of random initialization on the quality of the clustering
# * Explore how results differ after changing the number of clusters
# * Evaluate clustering, both quantitatively and q... | 3.46875 | 3 |
esp8266.py | mertaksoy/rpi-pico-micropython-esp8266-lib | 8 | 35430 | <gh_stars>1-10
from machine import UART, Pin
import time
from httpParser import HttpParser
ESP8266_OK_STATUS = "OK\r\n"
ESP8266_ERROR_STATUS = "ERROR\r\n"
ESP8266_FAIL_STATUS = "FAIL\r\n"
ESP8266_WIFI_CONNECTED="WIFI CONNECTED\r\n"
ESP8266_WIFI_GOT_IP_CONNECTED="WIFI GOT IP\r\n"
ESP8266_WIFI_DISCONNECTED="WIFI DISCONN... | 3.421875 | 3 |
src/data_science/data_science/tools/time.py | viclule/api_models_deployment_framework | 0 | 35431 | <gh_stars>0
from datetime import datetime, timezone
def get_timestamp_isoformat():
"""
Generate a timestampt in iso format.
"""
dt = datetime.utcnow().replace(microsecond=0).isoformat("T") + "Z"
return dt
def get_timestamp_unix():
"""
Generate a timestampt in unix format.
########.##... | 3.1875 | 3 |
examples/crab_gateway.py | OnroerendErfgoed/crabpy | 4 | 35432 | <reponame>OnroerendErfgoed/crabpy
# -*- coding: utf-8 -*-
'''
This script demonstrates using the crab gateway to walk the entire
address tree (street and number) of a `gemeente`.
'''
from crabpy.client import crab_request, crab_factory
from crabpy.gateway.crab import CrabGateway
g = CrabGateway(crab_factory())
gemee... | 2.40625 | 2 |
datatracer/foreign_key/base.py | HDI-Project/DataTracer | 15 | 35433 | <gh_stars>10-100
"""Foreign Key Solving base class."""
class ForeignKeySolver():
def fit(self, list_of_databases):
"""Fit this solver.
Args:
list_of_databases (list):
List of tuples containing ``MetaData`` instnces and table dictinaries,
which contain ... | 3.09375 | 3 |
aim2_metrics/aim/evaluators/evaluators.py | heseba/aim | 0 | 35434 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Evaluators.
"""
# ----------------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------------
# Standard library modules
import importlib
import time
from datetime import date
... | 1.671875 | 2 |
Traditional/split_path.py | hmarko/netapp-data-science-toolkit | 0 | 35435 | <filename>Traditional/split_path.py
#!/usr/bin/env python3
import os
from posixpath import normpath
path = "///data/video/project1//"
normalized_path = os.path.normpath(path)
sep_path = normalized_path.split(os.sep)
path_tail = sep_path[-1] #last word in path - need to be volume name
currentPath = ''
for folder in sep_... | 2.921875 | 3 |
http/torcheck.py | k11dd00/oniongen | 0 | 35436 | # MIT License
#
# Copyright (c) 2018 k1dd00
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publi... | 1.835938 | 2 |
ObjectsName_to_Meshs/ObjectsName_to_Meshs.py | a2d4f3s1/Blender-Tips | 0 | 35437 | <reponame>a2d4f3s1/Blender-Tips
## メッシュ名をオブジェクト名に変更し、メッシュリンクなオブジェクトを選択
import bpy
objects = bpy.data.objects
shareObjects = list()
## Deselect All
for object in objects:
bpy.context.scene.objects[(object.name)].select_set(False)
## Copy Name obj to mesh
for obj in objects:
if obj.data and obj.data.users == 1... | 2.875 | 3 |
tgbotapi.py | suhasa010/tgbotapi-bot | 5 | 35438 | <filename>tgbotapi.py
from telegram.ext import Updater
import os
from dotenv import load_dotenv
load_dotenv()
BOT_API = os.getenv("BOT_API")
updater = Updater(token=BOT_API, use_context=True)
dispatcher = updater.dispatcher
import logging
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)... | 2.515625 | 3 |
python/helpers/pydev/third_party/wrapped_for_pydev/ctypes/wintypes.py | truthiswill/intellij-community | 695 | 35439 | <gh_stars>100-1000
#@PydevCodeAnalysisIgnore
# XXX This module needs cleanup.
from ctypes import *
DWORD = c_ulong
WORD = c_ushort
BYTE = c_byte
ULONG = c_ulong
LONG = c_long
LARGE_INTEGER = c_longlong
ULARGE_INTEGER = c_ulonglong
HANDLE = c_ulong # in the header files: void *
HWND = HANDLE
HDC = HANDLE
HMODULE ... | 1.804688 | 2 |
publishfeed/tests.py | RobertLD/publishfeed-OTC | 9 | 35440 | import unittest
from models import FeedSet, Base, RSSContent
import config
import sqlalchemy
from sqlalchemy.orm import sessionmaker
from unittest.mock import MagicMock
from test_data.feedparser_data import fake_response
from helpers import RSSContentHelper, FeedSetHelper
class TestFeedSet(unittest.TestCase):
def ... | 2.59375 | 3 |
src/faceRecognition.py | lizenan/Face-Recognition | 3 | 35441 | ## -*- coding: utf-8 -*-
"""
Created on Tue Sep 26 13:38:17 2017
@author: Administrator
"""
import dlib
import cv2
import numpy as np
from sklearn.externals import joblib
import os
import pathAttributes
#ap = argparse.ArgumentParser()
#ap.add_argument("-p", "--shape-predictor", metavar="D:\\用户目录\\下载\\sh... | 2.71875 | 3 |
tests/contrib/value_learning/_test_valuestore.py | spirali/gamegym | 49 | 35442 | from gamegym.game import Game, Situation
from gamegym.utils import get_rng
from gamegym.distribution import Explicit
from gamegym.value_learning.valuestore import LinearValueStore
import numpy as np
import pytest
from scipy.sparse import csr_matrix
def test_init():
LinearValueStore(shape=(3, 3))
LinearValueSt... | 2.34375 | 2 |
test/e2e/tests/test_route_table.py | timbyr/ec2-controller | 14 | 35443 | # Copyright Amazon.com Inc. or its affiliates. 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. A copy of the
# License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanyin... | 1.984375 | 2 |
desicos/abaqus/gui/gui_commands.py | saullocastro/desicos | 1 | 35444 | import os
import subprocess
import shutil
from itertools import chain
import __main__
import numpy as np
import desicos.abaqus.abaqus_functions as abaqus_functions
import desicos.conecylDB as conecylDB
import desicos.abaqus.conecyl as conecyl
import desicos.abaqus.study as study
from desicos.abaqus.constants import ... | 1.546875 | 2 |
pydeelib/widgets/texteditor.py | pombreda/pydee | 0 | 35445 | # -*- coding: utf-8 -*-
#
# Copyright © 2009 <NAME>
# Licensed under the terms of the MIT License
# (see pydeelib/__init__.py for details)
"""
Text Editor Dialog based on PyQt4
"""
# pylint: disable-msg=C0103
# pylint: disable-msg=R0903
# pylint: disable-msg=R0911
# pylint: disable-msg=R0201
from PyQt... | 2.390625 | 2 |
invoices/xml/__init__.py | pythonitalia/fatturae | 11 | 35446 | <gh_stars>10-100
from __future__ import annotations
from typing import TYPE_CHECKING, List
from lxml import etree
from .types import ProductSummary, XMLDict
from .utils import dict_to_xml, format_price
if TYPE_CHECKING:
from invoices.models import Invoice, Sender, Address
NAMESPACE_MAP = {
"p": "http://iv... | 2.109375 | 2 |
src/sentry/db/models/fields/foreignkey.py | withrocks/commonlims | 4 | 35447 | """
sentry.db.models.fields.foreignkey
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from django.db.models import ForeignKey
__all__ = ('FlexibleForeignKey', )
c... | 2.125 | 2 |
pybond/bond/bond_helpers/observe_files.py | necula01/bond | 8 | 35448 | <reponame>necula01/bond
# Helper functions to observe files and directories
import os
import re
def collect_directory_contents(directory,
file_filter=None,
collect_file_contents=False):
"""
Collect an object reflecting the contents of a directory
... | 3.734375 | 4 |
p4z3/expressions.py | gauntlet-repo/gauntlet | 2 | 35449 | <filename>p4z3/expressions.py
import operator as op
from p4z3.base import log, z3_cast, z3, copy_attrs, copy, gen_instance
from p4z3.base import P4ComplexInstance, P4Expression, P4ComplexType
class P4Initializer(P4Expression):
def __init__(self, val, instance_type=None):
self.val = val
self.instan... | 2.234375 | 2 |
Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/foundation.py | prophetl33t/o3de | 0 | 35450 | # coding:utf-8
#!/usr/bin/python
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
# ------------------------------------------------------------------------... | 1.867188 | 2 |
analyze/install.py | takkii/Pylean | 1 | 35451 | import importlib
import platform
import site
import subprocess
import sys
import traceback
class InstallerClass:
sci_win = ['python', '-m', 'pip', 'install', 'scikit-learn']
nump_win = ['python', '-m', 'pip', 'install', 'numpy']
pan_win = ['python', '-m', 'pip', 'install', 'pandas']
req_win = ['python... | 2.34375 | 2 |
ros2_workspace/src/kumo/kumo/handlers/node_handler.py | ichiro-its/kumo-playground | 2 | 35452 | <filename>ros2_workspace/src/kumo/kumo/handlers/node_handler.py
# Copyright (c) 2021 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation... | 1.84375 | 2 |
rcnn.py | PlanetExp/rcnn | 0 | 35453 | """RCNN model
"""
import tensorflow as tf
from define_scope import define_scope # custom decorators
class Model:
def __init__(self, X, y, output_size=None,
learning_rate=1e-5, learning_rate_decay=0.95,
reg=1e-5, dropout=0.5, verbose=False):
"""
Initalize the model.
Inputs:
- output_size: number of clas... | 2.84375 | 3 |
nihongo_companion/dictionary/nihongomaster.py | northy/anki-nihongo-companion | 1 | 35454 | # -*- coding: utf-8 -*-
# MIT License
# Copyright (c) 2021 <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, cop... | 2.328125 | 2 |
src/aceinna/devices/configs/openimu_predefine.py | LukaszChl/ros_openimu | 6 | 35455 | """
predefined params for openimu
"""
JSON_FILE_NAME = 'openimu.json'
def get_app_names():
'''
define openimu app type
'''
app_names = ['Compass',
'IMU',
'INS',
'Leveler',
'OpenIMU',
'VG',
'VG_AHRS',
... | 2.0625 | 2 |
app.py | dhill2522/DroneWeatherApi | 0 | 35456 | <reponame>dhill2522/DroneWeatherApi<gh_stars>0
from flask import Flask, request, Response
from flask_cors import CORS
import drone_awe
import json
import copy
import traceback
import utilities
'''
Notes:
- Need to disable plotting in the library
- if possible remove matplotlib entirely from the library
- i... | 2.609375 | 3 |
cspass.py | Ruulian/CSPass | 30 | 35457 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# Author : @Ruulian_
# Date created : 31 Oct 2021
from random import choice
from requests_html import HTMLSession
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.firefox.options import Optio... | 1.75 | 2 |
backend/tests/test_search.py | Davidw1339/GroceryBuddy | 0 | 35458 | <filename>backend/tests/test_search.py
import json
import search
import test_data
import copy
from utils import Error
def test_no_args(client):
'''
Tests search without arguments.
'''
rv = client.get('/search')
response = json.loads(rv.data)
assert response == {'success': False,
... | 2.828125 | 3 |
app/main.py | DataScienceHobbyGroup/nacho-b | 0 | 35459 | """TODO: Add file description."""
import curio # async library
import logging # python standard logging library
import click # command line interface creation kit (click)
import click_log # connects the logger output to click output
from datasources.binance_csv import BinanceCSV
from datasources.binance... | 2.28125 | 2 |
github/joeynmt/vizseq/__init__.py | shania3322/joeynmt | 0 | 35460 | <reponame>shania3322/joeynmt<gh_stars>0
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import os.path as op
from pathlib import Path
FILE_ROOT = Path(__file_... | 1.453125 | 1 |
invest_app/investlib/yfhelper.py | bdastur/builder | 0 | 35461 | <reponame>bdastur/builder<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import yahoofinancials
def get_historical_price_data(ticker_symbol,
start_date, end_date,
frequency='weekly'):
'''
The API returns historical price data.
'''
... | 2.375 | 2 |
tools/HGMD/access_HGMDdb.py | NickyPan/bio_informatics | 1 | 35462 | #!/usr/bin/env python
import os
import sys
dbSet = []
with open('other_allmut_HD.txt',"r") as beds:
for bed in beds:
bed = bed.strip()
bed = bed.split('\t')
item = bed[15] + '\t' + bed[16] + '\t' + bed[17] + '\t' + bed[17] + '\t' + bed[17] + '\t' + bed[17] + '\t' + 'https://www.ncbi.nlm.ni... | 2.6875 | 3 |
home/pi/blissflixx/chls/bfch_r_documentaries/__init__.py | erick-guerra/Royalbox | 1 | 35463 | import chanutils.reddit
_SUBREDDIT = 'Documentaries'
_FEEDLIST = [
{'title':'Latest', 'url':'http://www.reddit.com/r/Documentaries.json'},
{'title':'Anthropology', 'url':'http://www.reddit.com/r/documentaries/search.json?q=flair%3A%27Anthropology%27&sort=top&restrict_sr=on&t=all'},
{'title':'Art', 'url':'http:/... | 2.125 | 2 |
python/__init__.py | SpM-lab/irbasis | 17 | 35464 | from .irbasis import load, basis, sampling_points_matsubara, __version__
| 0.847656 | 1 |
src/bake_a_py/cli.py | derSuessmann/bake-a-py | 0 | 35465 | import sys
import traceback
import click
from . import imaging_utility as iu
from . import provisioning
from . import __version__
def eprint(msg, show):
if show:
traceback.print_exc()
print(file=sys.stderr)
click.echo(msg, file=sys.stderr)
@click.group()
@click.version_option(__version__)
@c... | 2.234375 | 2 |
utility/gd_content.py | SoftBlankie/dsa-twitter-bot | 0 | 35466 | <gh_stars>0
def read_paragraph_element(element):
"""Returns text in given ParagraphElement
Args:
element: ParagraphElement from Google Doc
"""
text_run = element.get('textRun')
if not text_run:
return ''
return text_run.get('content')
def read_structural_elements(elemen... | 3.625 | 4 |
SchoolManagement/ServerRestAPI/admin.py | amiremohamadi/django-restful-api | 4 | 35467 | from django.contrib import admin
from ServerRestAPI.models import (
Student, Teacher, StudentLecture,
TeacherLecture, Lecture
)
admin.site.register(Student)
admin.site.register(Teacher)
admin.site.register(StudentLecture)
admin.site.register(TeacherLecture)
admin.site.register(Lecture) | 1.429688 | 1 |
BOJ/17000~17999/17200~17299/17286.py | shinkeonkim/today-ps | 2 | 35468 | import itertools,math
L = [1,2,3]
p = list(itertools.permutations(L,3))
D = [list(map(int,input().split())) for i in range(4)]
ans = 999999999999
for pp in p:
k = [0]+list(pp)
d = 0
for i in range(1,4):
d += math.sqrt((D[k[i-1]][0] - D[k[i]][0])**2 + (D[k[i-1]][1] - D[k[i]][1])**2)
if d < ans:... | 2.359375 | 2 |
scellseg/guis/scellsegGui.py | cellimnet/scellseg-publish | 1 | 35469 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'cellPoseUI.ui'
# Created by: PyQt5 UI code generator 5.11.3
import os, platform, ctypes, sys
from PyQt5 import QtWidgets
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QFontDatabase
from scellseg.guis.scellsegUi import Ui_... | 1.929688 | 2 |
tff_group_by_key_example/group_by_key_tff.py | michaeldtz/fed-dsp-examples | 0 | 35470 | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 2.34375 | 2 |
final_project/machinetranslation/translator.py | Opaso/xzceb-flask_eng_fr | 0 | 35471 | import os
from ibm_watson import LanguageTranslatorV3
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from dotenv import load_dotenv
load_dotenv()
apikey= os.environ['apikey']
url= os.environ['url']
VERSION= '2018-05-01'
authenticator= IAMAuthenticator(apikey)
language_translator= LanguageTranslatorV3(... | 2.65625 | 3 |
Malloc/run.py | Yanjun-Chen/Python-Tools | 1 | 35472 | import trace_malloc as trace
'''trace 10 files with maximum memory allocated'''
trace.start()
# ... run your code ...
snapshot = trace.take_snapshot()
top_stats = snapshot.statistics('lineno')
print("[ Top 10 ]")
for stat in top_stats[:10]:
print(stat)
'''Backtrack the largest memory block'''
# Store 25 f... | 3.140625 | 3 |
test/visualization/test_visualize.py | wukathryn/axondeepseg | 115 | 35473 | <filename>test/visualization/test_visualize.py<gh_stars>100-1000
# coding: utf-8
from pathlib import Path
import pytest
from AxonDeepSeg.visualization.visualize import visualize_training
class TestCore(object):
def setup(self):
# Get the directory where this current file is saved
self.fullPath ... | 2.296875 | 2 |
normal_forms/examples/normal_form/07.py | joepatmckenna/normal_forms | 0 | 35474 | <reponame>joepatmckenna/normal_forms
from normal_forms import normal_form
import sympy
# Murdock, Normal Forms and Unfoldings of Local Dynamical Systems, Example 4.5.24
def f(x, y, z):
f1 = 6 * x + x**2 + x * y + x * z + y**2 + y * z + z**2
f2 = 2 * y + x**2 + x * y + x * z + y**2 + y * z + z**2
f3 = 3 * ... | 2.703125 | 3 |
julie/physics/velocity.py | MarcelloBB/julieutils | 2 | 35475 |
def average_speed(s1 : float, s0 : float, t1 : float, t0 : float) -> float:
"""
[FUNC] average_speed:
Returns the average speed.
Where:
Delta Space = (space1[s1] - space0[s0])
Delta Time = (time1[t1] - time0[t0])
"""
return ((s1-s0)/(t1-t0));
def average_acceleration(v1 : flo... | 3.75 | 4 |
projects/tests.py | DoubleCapitals/web-platform-prototype | 3 | 35476 | from django.test import TestCase, Client
from django.urls import reverse
from django.test.utils import setup_test_environment
from bs4 import BeautifulSoup
import re
import time
from projects.models import *
from projects.forms import *
client = Client()
# length of base template, used to test for empty pages
LEN_B... | 2.3125 | 2 |
chess/__main__.py | quadratic-bit/pygame-chess | 3 | 35477 | <filename>chess/__main__.py
from sys import exit
from typing import Optional, Final
import pygame
from rich.traceback import install
from chess.board import Chessboard, Move, PieceType, PieceColour
from chess.bot import ChessBot
from chess.const import GameState
from chess.utils import load_image, load_sound, load_fo... | 2.90625 | 3 |
rfb_utils/scenegraph_utils.py | N500/RenderManForBlender | 5 | 35478 | <gh_stars>1-10
def set_material(sg_node, sg_material_node):
'''Sets the material on a scenegraph group node and sets the materialid
user attribute at the same time.
Arguments:
sg_node (RixSGGroup) - scene graph group node to attach the material.
sg_material_node (RixSGMaterial) - the scene ... | 2.484375 | 2 |
models/attention_ensemble_diff_layers.py | tlatkowski/attention-ensemble-gene-expression | 0 | 35479 | import tensorflow as tf
from layers.attention_layers import attention_layer
from layers.common_layers import init_inputs
from layers.feed_forward_layers import feed_forward_diff_features, feed_forward_diff_layers
from utils.hyperparams import Hyperparams as hp
class AttentionBasedEnsembleNets:
def __init__(self... | 2.34375 | 2 |
webapps/ivs/test/test_validators_views.py | mongodb-labs/mongo-web-shell | 22 | 35480 | # Copyright 2013 10gen 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 to... | 2.109375 | 2 |
utils/train.py | fbuchert/mixmatch-pytorch | 0 | 35481 | import math
from itertools import product
from typing import Tuple, List, Optional, Union
import numpy as np
import torch
import torch.nn as nn
import torch.nn.init as init
class EMA:
"""
Class that keeps track of exponential moving average of model parameters of a particular model.
Also see https://gith... | 2.875 | 3 |
plotting-cell-cycle.py | kbromma/DBCCode | 0 | 35482 | import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import csv
import seaborn as sns
import itertools
import pandas as pd
import scipy
from scipy.signal import savgol_filter
from scipy.signal import find_peaks_cwt
from scipy.signal import boxcar
sns.set(font_scale=1.2)
sns.set_style("white")
colors = ... | 2.421875 | 2 |
config.py | sneakysnakesfrc/sneaky-vision-2019 | 2 | 35483 | # Debug or not
DEBUG = 1
# Trackbar or not
CREATE_TRACKBARS = 1
# Display or not
DISPLAY = 1
# Image or Video, if "Video" is given as argument, program will use cv2.VideoCapture
# If "Image" argument is given the program will use cv2.imread
imageType = "Video"
# imageType = "Image"
# Image/Video source 0 or 1... | 2.9375 | 3 |
context/steps.py | NanoScaleDesign/Canparam | 0 | 35484 | <gh_stars>0
#! /usr/bin/env python3
"""Context files must contain a 'main' function.
The return from the main function should be the resulting text"""
def main(params):
if hasattr(params,'time'):
# 1e6 steps per ns
steps = int(params.time * 1e6)
else:
steps = 10000
return steps
| 2.328125 | 2 |
python.io/study-20180412.py | cnzht/grit | 1 | 35485 | <reponame>cnzht/grit<filename>python.io/study-20180412.py
#-*-coding:utf-8-*-
#bodyBMI.py
#2018年4月11日 21:03:12
#打印出字符串中的某一部分
'''
import random
st = [1,1,15,1,5,8,1,5,8]
print (random.shuffle(st))
'''
'''
#利用蒙特卡洛方法计算圆周率PI
from random import random
from time import perf_counter
DATA = pow(1000,100)
hit = 0
start = per... | 2.765625 | 3 |
ixian/task.py | kreneskyp/ixian | 0 | 35486 | <filename>ixian/task.py
# Copyright [2018-2020] <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 2.078125 | 2 |
src/main/tools/dbpy/meta_to_db_data.py | inqwell/inq | 1 | 35487 | <gh_stars>1-10
#!/usr/local/bin/bash
"""
Two options:
1) Build DB-specific data files from meta-data files
2) Build a single file containing all the DB-specific 'insert' statements in the correct dependency
order from meta-data files and XML table files
NOTE:
- The data files must be named "xxx.dat"; for option (2)... | 2.046875 | 2 |
YOLOtiny_chainer_v2/YOLOtiny.py | ashitani/ppap_detect | 9 | 35488 | #!/usr/bin/env python
import numpy as np
import chainer
from chainer import cuda, Function, gradient_check, Variable, optimizers, serializers, utils
from chainer import Link, Chain, ChainList
import chainer.functions as F
import chainer.links as L
from chainer import training
from chainer.training import extensions
d... | 2.4375 | 2 |
prf/tests/test_resource.py | vahana/_prf | 0 | 35489 | import mock
import pytest
from prf.tests.prf_testcase import PrfTestCase
from pyramid.exceptions import ConfigurationExecutionError
from prf.resource import Resource, get_view_class, get_parent_elements
from prf.view import BaseView
class TestResource(PrfTestCase):
def test_init_(self):
res = Resource(se... | 2.25 | 2 |
tests/integration/test_aggregator.py | mananpal1997/flake8 | 0 | 35490 | """Test aggregation of config files and command-line options."""
import os
import pytest
from flake8.main import options
from flake8.options import aggregator
from flake8.options import config
from flake8.options import manager
@pytest.fixture
def optmanager():
"""Create a new OptionManager."""
option_manag... | 2.40625 | 2 |
id/trafficmon/TrafficMain.py | umanium/trafficmon | 0 | 35491 | import os
import cv2
import numpy as np
import time
from backgroundsubtraction.KMeans import KMeans
from objectblob.ObjectBlobDetection import ObjectBlobDetection
from pixelcleaning.MorphologicalCleaning import MorphologicalCleaning
__author__ = 'Luqman'
def morphological(image):
cleaning_model = Morphologica... | 2.734375 | 3 |
qrscannerpy.py | nunogois/qrscannerpy | 0 | 35492 | # Imports
import sys, os, time, logging, json
# QR code scanning is on a separate file
from qr import qrscan
# Configuration using config.json
with open('config.json', 'r') as f:
config = json.load(f)
if 'outfile' in config:
outfile = config['outfile']
if 'path' in config:
path = config['path']
extensions = c... | 2.734375 | 3 |
src/zope/app/publisher/interfaces/ftp.py | zopefoundation/zope.app.publisher | 1 | 35493 | ##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# TH... | 2.296875 | 2 |
lankuai/lankuai/lkitsm/project/workfolw/__init__.py | abiner/lankuai | 0 | 35494 | <reponame>abiner/lankuai
default_app_config='workfolw.apps.WorkfolwConfig' | 1.023438 | 1 |
release/stubs.min/Autodesk/Revit/DB/__init___parts/NamingUtils.py | YKato521/ironpython-stubs | 0 | 35495 | <filename>release/stubs.min/Autodesk/Revit/DB/__init___parts/NamingUtils.py
class NamingUtils(object):
""" A collection of utilities related to element naming. """
@staticmethod
def CompareNames(nameA, nameB):
"""
CompareNames(nameA: str,nameB: str) -> int
Compares two object na... | 2.546875 | 3 |
testing/marker.py | knosmos/robowordle | 2 | 35496 | import cv2
import numpy as np
from rich import print
dewarped = cv2.imread('../dewarped.png')
'''
SIZE = 600
# Get ROI corners
arucoDict = cv2.aruco.Dictionary_get(cv2.aruco.DICT_APRILTAG_36h11)
arucoParams = cv2.aruco.DetectorParameters_create()
(corners, ids, rejected) = cv2.aruco.detectMarkers(image, arucoDict, p... | 2.421875 | 2 |
src/trusted/validator_ragel/trie_test.py | cohortfsllc/cohort-cocl2-sandbox | 2,151 | 35497 | #!/usr/bin/python
# Copyright (c) 2014 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import trie
class TrieTest(unittest.TestCase):
def MakeUncompressedTrie(self):
uncompressed = trie.Node(... | 2.984375 | 3 |
venv/lib/python3.7/site-packages/gitlab/cli.py | bhaving07/pyup | 0 | 35498 | <reponame>bhaving07/pyup
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2017 <NAME> <<EMAIL>>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of t... | 2.140625 | 2 |
RandomForestScores_1.py | dgudenius/football_win_predictions_v2 | 1 | 35499 | import pandas as pd
import numpy
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
| 1.429688 | 1 |