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 |
|---|---|---|---|---|---|---|
recommender/delete_account.py | google/article-recommender | 8 | 47800 | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 1.945313 | 2 |
envs/hns/mujoco-worldgen/mujoco_worldgen/util/path.py | jiayu-ch15/curriculum | 424 | 47801 | from os.path import abspath, dirname, join
WORLDGEN_ROOT_PATH = abspath(join(dirname(__file__), '..', '..'))
def worldgen_path(*args):
"""
Returns an absolute path from a path relative to the mujoco_worldgen repository
root directory.
"""
return join(WORLDGEN_ROOT_PATH, *args)
| 2.359375 | 2 |
sina_spider/spiders/weibo_ids.py | lokicui/sina-spider | 0 | 47802 | <reponame>lokicui/sina-spider
# encoding=utf-8
import urllib
from urlparse import urlparse, urljoin
""" 初始的待爬队列 """
weiboID = [
'1797054534', '2509414473', '2611478681', '5861859392', '2011086863', '5127716917', '1259110474', '5850775634', '1886437464',
'3187474530', '2191982701', '1940562032', '5874450550', ... | 2.390625 | 2 |
1_Overview/fizzbuzz_rulebased.py | LuizHuang/AI-LearnNote | 0 | 47803 | <reponame>LuizHuang/AI-LearnNote
def func(max):
res = []
for i in range(1, max):
# 对15取余为0 输出fizzbuzz
if i % 15 == 0:
res.append('fizzbuzz')
# 对3取余为0,输出fizz
elif i % 3 == 0:
res.append('fizz')
# 对5取余为0,输出为buzz
elif i % 5 == 0:
r... | 3.4375 | 3 |
backend/config.py | Xingwd/seer | 0 | 47804 | # -*- coding: UTF-8 -*-
# https://dormousehole.readthedocs.io/en/latest/config.html#config
class Config(object):
SECRET_KEY = 'e9d37baf44de4b11a76159c50820468f'
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://xingweidong:xingweidong&123@localhost/idss_stock' # 股票数据库,默认
... | 1.695313 | 2 |
problems/324.Wiggle_Sort_II/try.py | subramp-prep/leetcode | 0 | 47805 | <reponame>subramp-prep/leetcode<gh_stars>0
# coding=utf-8
# Author: <NAME>
# Question: 324.Wiggle_Sort_II
# Date:
# Complexity: O(N)
import random
class Solution(object):
def wiggleSort(self, nums):
"""
:type nums: List[int]
:rtype: void Do not return anything, modify nums in-place inste... | 3.921875 | 4 |
proxy_switcher/chain.py | spumer/ProxySwitcher | 1 | 47806 | # encoding: utf-8
import os
import re
import sys
import gzip
import time
import json
import socket
import random
import weakref
import datetime
import functools
import threading
import collections
import urllib.error
import urllib.parse
import urllib.request
import collections.abc
import json_dict
from . import util... | 2.15625 | 2 |
scripts/json2numpy.py | shannonfenn/data-tools | 0 | 47807 | <reponame>shannonfenn/data-tools<filename>scripts/json2numpy.py
#! /usr/bin/env python
import json
import argparse
import os.path
import numpy as np
def main(in_name):
out_name = os.path.splitext(in_name)[0]
with open(in_name) as f:
ds_settings = json.load(f)
func = np.array(ds_settings['functi... | 3.03125 | 3 |
mount_point.py | janglapuk/smstools-bot | 0 | 47808 | <gh_stars>0
import spf, os
from email.parser import Parser
__author__ = "TRA"
__doc__ = '''Modified mount point module'''
RECEIVED = 'RECEIVED'
SENT = 'SENT'
FAILED = 'FAILED'
REPORT = 'REPORT'
class Bot(object, metaclass=spf.MountPoint):
_runnable = False
_program = None
_headers = None
_body = None
trim ... | 2.296875 | 2 |
3. Python Advanced (September 2021)/3.2 Python OOP (October 2021)/24. Exam Preparation/10.04.2021/project/controller.py | kzborisov/SoftUni | 1 | 47809 | from project.aquarium.freshwater_aquarium import FreshwaterAquarium # noqa
from project.aquarium.saltwater_aquarium import SaltwaterAquarium # noqa
from project.decoration.decoration_repository import DecorationRepository
from project.decoration.ornament import Ornament # noqa
from project.decoration.plant import Pl... | 2.703125 | 3 |
api/Note_test.py | gracejiang/note-sharing | 0 | 47810 | import json
from Note import Note
n = Note("Friction", "introduction to friction", "UC Berkeley", 0, True, False, False, "https://google.com", 'lec.pdf')
print(n.toJSON())
| 2.875 | 3 |
pairDataGen.py | sunny-Codes/MotionBuilderScript | 4 | 47811 | # Reference/tutorial to take a look at
# https://help.autodesk.com/view/MOBPRO/2019/ENU/?guid=__py_ref__tasks_2_assign_rigid_body_8py_example_html
# https://help.autodesk.com/view/MOBPRO/2019/ENU/?guid=__files_GUID_A1189AA0_3816_4350_B8F3_5383DEC25A33_htm
# https://mocappys.com/complete-guide-to-poses-in-motionbuilder... | 2.140625 | 2 |
tests/test_gon.py | slacAdpai/pcdsdevices | 0 | 47812 | import logging
import pytest
from ophyd.sim import make_fake_device
from pcdsdevices.gon import (BaseGon, Goniometer, GonWithDetArm, Kappa, SamPhi,
XYZStage)
logger = logging.getLogger(__name__)
def test_gon_factory():
logger.debug('test_gon_factory')
assert isinstance(Goniomet... | 2.125 | 2 |
day11/main.py | Floozutter/aoc-2019-speedrun | 0 | 47813 | <reponame>Floozutter/aoc-2019-speedrun<filename>day11/main.py<gh_stars>0
INPUTPATH = "input.txt"
with open(INPUTPATH) as ifile:
raw = ifile.read()
program = tuple(map(int, raw.strip().split(",")))
from enum import Enum
class Mde(Enum):
POS = 0
IMM = 1
REL = 2
from itertools import chain, repeat, islice
from collec... | 2.703125 | 3 |
src/morphforge/constants/standardtags.py | mikehulluk/morphforge | 1 | 47814 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) 2012 <NAME>.
# 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.226563 | 1 |
tests/assets/sample_tasks/sample.py | MarcoJHB/ploomber | 2,141 | 47815 | <gh_stars>1000+
# + tags=["parameters"]
1 + 1
| 1.09375 | 1 |
emgproc.py | jonpas/EMGProc | 0 | 47816 | #!/usr/bin/env python3
import sys
import os
import argparse
import time
import serial
import csv
import math
import pickle
from collections import defaultdict
import numpy as np
from sklearn.decomposition import PCA, FastICA
from sklearn.svm import SVC
# Graph
WINDOW_WIDTH = 800
WINDOW_HEIGHT = 800
PLOT_SCROLL = 3 ... | 2.4375 | 2 |
201805_Programs/XDF_RecruitsNum_v1.py | MOMOKO606/XDF | 0 | 47817 | <filename>201805_Programs/XDF_RecruitsNum_v1.py
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 26 14:41:52 2018
@author: bianl
"""
import datetime
import xlrd
import math
import numpy as np
from openpyxl import Workbook
from openpyxl import load_workbook
from openpyxl.styles import Font
from openpyxl.styles.colors im... | 2.328125 | 2 |
main.py | moritztng/hedgy | 3 | 47818 | import numpy as np
from preprocess import Vectorizer
from flask import render_template, make_response
from google.oauth2.id_token import verify_oauth2_token
from google.auth.transport.requests import Request
from google.cloud import firestore
from os.path import join, abspath, dirname
from random import randint
from pi... | 2.421875 | 2 |
constants.py | HugoSchtr/lepidemo | 2 | 47819 | MONTHS_MAPS = {"janvier" : '01',
"février": '02',
"fevrier": '02',
"mars": '03',
"avril": '04',
"mai": '05',
"juin": '06',
"juillet": '07',
"août": '08',
"aout": '08',
... | 1.953125 | 2 |
src/core_backend/service/plugin.py | jhchen3121/wechat_shop | 0 | 47820 | #-*- coding:utf-8 -*-
import sys, traceback
from core_backend import context
from core_backend.libs.exception import Error
import logging
#logger = Log.getDebugLogger()
#logger.setLevel(logging.INFO)
logger = logging.getLogger(__name__)
class plugin(object):
def __init__(self, handler, session):
self.han... | 2.125 | 2 |
source/predict.py | thomasly/neutrophil | 0 | 47821 | '''
Filename: predict.py
Python Version: 3.6.5
Project: Neutrophil Identifier
Author: <NAME>
Created date: Sep 5, 2018 4:13 PM
-----
Last Modified: Oct 9, 2018 3:48 PM
Modified By: <NAME>
-----
License: MIT
http://www.opensource.org/licenses/MIT
'''
import os
import sys
import logging
from math import ceil
from keras.... | 2.578125 | 3 |
src/athene/rte/utils/fill_gold_sentences.py | UKPLab/fever-2018-team-athene | 41 | 47822 | import argparse
import json
from tqdm import tqdm
from common.dataset.reader import JSONLineReader
from common.util.log_helper import LogHelper
def _sent_to_str(sent):
return sent[-2] + "$$$" + str(sent[-1])
def _replace_sent_with_str(sent, string):
segments = string.split(r"$$$")
if len(segments) != 2:... | 2.6875 | 3 |
tests/test_bloomfilter.py | anexplore/pyredisbloomfilter | 1 | 47823 | <filename>tests/test_bloomfilter.py
# -*- coding: utf-8 -*-
import unittest
import redis
import src.bloomfilter as bf
import src.exceptions as ep
class BloomFilterTest(unittest.TestCase):
redis_host = ''
redis_port = 6379
redis_db = 0
redis_client = None
name = 'bloom_for_test'
bloom_filter... | 2.75 | 3 |
tfx/orchestration/portable/input_resolution/exceptions.py | ajmarcus/tfx | 0 | 47824 | <gh_stars>0
# Copyright 2021 Google LLC. 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 1.90625 | 2 |
catalearn/__init__.py | Catalearn/Catalearn | 0 | 47825 | <gh_stars>0
import sys
import warnings
from .upgrade import isLatestVersion
sys.setrecursionlimit(50000)
warnings.filterwarnings('ignore')
# if not isLatestVersion():
# print('This version of catalearn is no longer compatible with the backend')
# print('Please use \'pip3 install -U catalearn\' to upgrade to t... | 1.851563 | 2 |
pip_update.py | esitarski/CrossMgr | 25 | 47826 | <filename>pip_update.py<gh_stars>10-100
import re
import os
import sys
import shutil
import subprocess
def pip_update():
# Check for Ubuntu and get the wxPython extras release version.
UBUNTU_RELEASE = ''
os_release_file = '/etc/os-release'
if os.path.exists( os_release_file ):
with open( os_release_file ) as f:... | 2.59375 | 3 |
docxx/text/paragraph.py | betasewer/python-docx-xtended | 1 | 47827 | <reponame>betasewer/python-docx-xtended<gh_stars>1-10
# encoding: utf-8
"""
Paragraph-related proxy types.
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
from docxx.enum.style import WD_STYLE_TYPE
from docxx.text.run import Run, same_run
from docxx.shared import Parent... | 2.40625 | 2 |
shop/views.py | edytafraszczak/dj-shop | 0 | 47828 | <reponame>edytafraszczak/dj-shop
import string
import weasyprint
from django.conf import settings
from django.contrib import messages
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.shortc... | 1.914063 | 2 |
kubernetes_typed/client/models/v1_iscsi_volume_source.py | nikhiljha/kubernetes-typed | 22 | 47829 | # Code generated by `typeddictgen`. DO NOT EDIT.
"""V1ISCSIVolumeSourceDict generated type."""
from typing import TypedDict, List
from kubernetes_typed.client import V1LocalObjectReferenceDict
V1ISCSIVolumeSourceDict = TypedDict(
"V1ISCSIVolumeSourceDict",
{
"chapAuthDiscovery": bool,
"chapAut... | 1.578125 | 2 |
django_basics/apps.py | pinehq/django_basics | 0 | 47830 | <gh_stars>0
from django.apps import AppConfig
class DjangoBasicsConfig(AppConfig):
name = 'django_basics'
| 1.132813 | 1 |
krogon_gocd/hash.py | enamrik/krogon-gocd | 0 | 47831 | <filename>krogon_gocd/hash.py
import bcrypt
def hash_text(plaintext: str) -> str:
return bcrypt.hashpw(plaintext.encode('utf-8'), bcrypt.gensalt(10)).decode('utf-8')
| 2.5625 | 3 |
pytpp/attributes/adaptable_workflow.py | Venafi/pytpp | 4 | 47832 | from pytpp.attributes._helper import IterableMeta, Attribute
from pytpp.attributes.workflow import WorkflowAttributes
class AdaptableWorkflowAttributes(WorkflowAttributes, metaclass=IterableMeta):
__config_class__ = "Adaptable Workflow"
adaptable_workflow_text_field_1 = Attribute('Adaptable Workflow Text Field 1', ... | 1.953125 | 2 |
src/readers/read_giza.py | LalicUfscar/WE-PE-tool | 1 | 47833 | <reponame>LalicUfscar/WE-PE-tool
import re
class GIZAReader(object):
def __init__(self, filename):
self.aligned_lines = list()
with open(filename, 'r') as giza_file:
while True:
line_info = giza_file.readline()
if not line_info:
break... | 2.734375 | 3 |
giving/executors.py | breuleux/giving | 3 | 47834 | <gh_stars>1-10
import hashlib
import os
import pdb
from datetime import datetime
try:
import breakword as bw
except ImportError: # pragma: no cover
bw = None
def _dethash(s):
return int(hashlib.md5(s.encode()).hexdigest(), base=16)
def _term_color(key):
"""Generate a terminal color for this group.... | 2.390625 | 2 |
pages/themes/loopsAndComprehensions/examples/slides/while_loop.py | WWWCourses/ProgressBG-Python-UniCredit-Slides | 0 | 47835 | # print("{:~^45}".format(" Simple while loop "))
# i = 1
# while i<=5 :
# print(i)
# i += 1
# print("\n{:~^45}".format(" Example: sum all numbers in [1..100] "))
# i = 1
# sum = 0
# while i <= 100:
# sum += i
# i += 1
# print("sum = ", sum)
# print("\n{:~^45}".format(" Task: sum even numbers in [1..100] "))
# i ... | 4.15625 | 4 |
aula8/aula08.py | matheusluz071098/Curso-de-Python | 0 | 47836 | <reponame>matheusluz071098/Curso-de-Python<gh_stars>0
# aula 8
# tuplas
numeros = [1,4,6]
usuario = {'nome:''user','passwd',:<PASSWORD>}
pessoa = ('matheus','luz',0,45,5,numeros)
print(numeros)
print(usuario)
print(pessoa)
numeros[1] = 5
usuario ['passwd'] = <PASSWORD>
lista_pessoa = []
lista_pessoa.append(pessoa)
... | 3.65625 | 4 |
sources/algorithms/sweepln/cyclesweep.py | tipech/OverlapGraph | 0 | 47837 | #!/usr/env/python
"""
Generalized Cyclic Multi-Pass Sweep-line Algorithm
The cyclic multi-pass sweep-line algorithm, simply repeatedly
sweeps across the same Timeline, until a specified number of passes
has been completed or some signal is given to stop sweeping.
Classes:
- CycleSweep
"""
from typing import TypeVar... | 3.40625 | 3 |
codesamples/apps.py | Manny27nyc/pythondotorg | 911 | 47838 | <reponame>Manny27nyc/pythondotorg<filename>codesamples/apps.py
from django.apps import AppConfig
class CodesamplesAppConfig(AppConfig):
name = 'codesamples'
| 1.421875 | 1 |
project/server/users/userIndex.py | mjqPauli/cs501-t1-assessment | 0 | 47839 | <gh_stars>0
from flask import Blueprint, request, make_response, jsonify
from flask.views import MethodView
from project.server import bcrypt, db
from project.server.models import User
index_blueprint = Blueprint('index', __name__)
class IndexAPI(MethodView):
"""
User Registration Resource
"""... | 2.578125 | 3 |
boo/dataframe/canonic.py | AirVetra/boo | 1 | 47840 | import numpy
import pandas as pd
from boo.columns import SHORT_COLUMNS
from boo.errors import UnclassifiableCodeError
QUOTE_CHAR = '"'
EMPTY = int(0)
NUMERIC_COLUMNS = SHORT_COLUMNS.numeric
def adjust_rub(df, cols=NUMERIC_COLUMNS):
rows = (df.unit == "385")
df.loc[rows, cols] = df.loc[rows, cols].multiply(1... | 3.25 | 3 |
tasks/models/__init__.py | csdevsc/colcat_crowdsourcing_application | 0 | 47841 | <filename>tasks/models/__init__.py
from data import *
from tasks import *
| 1.09375 | 1 |
tests/test_create_repo.py | domdfcoding/repo_helper_github | 1 | 47842 | # 3rd party
import pytest
from coincidence.regressions import AdvancedFileRegressionFixture
from consolekit.testing import CliRunner, Result
from domdf_python_tools.paths import in_directory
from github3.exceptions import UnprocessableEntity
# this package
from repo_helper_github.cli import new
@pytest.mark.usefixtu... | 1.984375 | 2 |
flask_mysql/crud/biolerplate_code/flask_app/__init__.py | ZhouSusan/CodingDojoPython | 0 | 47843 | from flask_app import app
from flask_app.controllers import
if __name__ == "__main__":
app.run(debug=True)
from flask import Flask
from flask_bcrypt import Bcrypt
| 1.5 | 2 |
Graph/Bar_revenue/exbar3.py | hashtagSELFIE/That-s-a-Wrap- | 2 | 47844 | <gh_stars>1-10
"""Project"""
import pygal
import pandas as pd
from ast import literal_eval
def open(dir_name):
"""openfile,last_data"""
movie_type = {}
filedata = pd.read_csv('completed_movie_database_for_PSIT.csv')
top1 = filedata.loc[filedata['director'] == dir_name, ["title", "vote_average", "reven... | 2.6875 | 3 |
Project1/project_1.py | spencerperley/CPE_101 | 1 | 47845 | <filename>Project1/project_1.py
aqiRanges = (0, 50, 100, 150, 200, 300, 500)
aqiDescriptions = ("Good", "Moderate", "Unhealthy for Sensitive Groups",
"Unhealthy", "Very Unhealthy", "Hazardous")
aqiDescription = ""
pm25ranges = (0, 12, 35.4, 55.4, 150.4, 250.4, 500.4)
pm10ranges = (0, 54, 154, 254,... | 3.8125 | 4 |
desktop/core/ext-py/nose-1.3.7/unit_tests/test_issue_786.py | kokosing/hue | 5,079 | 47846 | def test_evens():
yield check_even_cls
class Test(object):
def test_evens(self):
yield check_even_cls
class Check(object):
def __call__(self):
pass
check_even_cls = Check()
| 2.734375 | 3 |
libra_client/lbrtypes/account_config/resources/dual_attestation.py | violas-core/violas-client | 0 | 47847 | <gh_stars>0
from libra_client.lbrtypes.event import EventHandle
from libra_client.canoser import Struct, Uint64
from libra_client.move_core_types.move_resource import MoveResource
class CredentialResource(Struct, MoveResource):
MODULE_NAME = "DualAttestation"
STRUCT_NAME = "Credential"
_fields = [
... | 1.632813 | 2 |
MyProjects/Python/python-ba-PythonCheetSheet.py | JohanChane/JohanChane.github.io | 6 | 47848 | #!/usr/bin/env python3
# -*- coding: utf8 -*-
## # Python Cheet Sheet
# Python version Python3.8
# 简单地列出一些有关基础知识的例子,详细说明请看个人笔记
# `##` 开头表示是 markdown 的标题
import math
## ## Basic
def funcForDebug():
print('### funcForDebug')
i = 100
print(type(i))
print(type(int))
print(dir())
print(id(i... | 3.34375 | 3 |
atss4po/auth/views.py | kaiueo/atss4po | 0 | 47849 | <reponame>kaiueo/atss4po<filename>atss4po/auth/views.py<gh_stars>0
# -*- coding: utf-8 -*-
"""Public section, including homepage and signup."""
from flask import Blueprint, flash, redirect, render_template, request, url_for, session, make_response
from flask_login import login_required, login_user, logout_user, current... | 2.109375 | 2 |
geoportal/geoportailv3_geoportal/views/upload.py | Geoportail-Luxembourg/geoportailv3 | 17 | 47850 | <gh_stars>10-100
# -*- coding: utf-8 -*-
from pyramid.view import view_config
import os
import uuid
import json
from pyramid.response import Response
from pyramid.httpexceptions import HTTPBadRequest
class Upload(object):
def __init__(self, request):
self.request = request
@view_config(route_name='up... | 2.390625 | 2 |
array_observation/sac_discrete_gb/core.py | prateekiiest/discreteminimalistsac | 81 | 47851 | import numpy as np
import os
import tensorflow as tf
EPS = 1e-8
def placeholder(dim=None):
return tf.placeholder(dtype=tf.float32, shape=(None,dim) if dim else (None,))
def placeholders(*args):
return [placeholder(dim) for dim in args]
def mlp(x, hidden_sizes=(32,), activation=tf.tanh, output_activation=Non... | 2.296875 | 2 |
src/web_homepage/jinja.py | Mattan-Qwer/test1 | 1 | 47852 | <filename>src/web_homepage/jinja.py
from django.templatetags.static import static
from django.urls import reverse
from jinja2 import Environment
from fontawesome_5.templatetags import fontawesome_5
from wissenslandkarte.settings import DEBUG, ENABLE_LIVE_JS
def environment(**options):
env = Environment(**option... | 1.742188 | 2 |
app.py | EGeorge2021r/nft-marketplace | 0 | 47853 | <reponame>EGeorge2021r/nft-marketplace
import streamlit as st
from multiapp import MultiApp
from apps import buyer, home,creator # import your app modules here
app = MultiApp()
app.add_app("Home", home.home)
app.add_app("Creator", creator.creator)
app.add_app("Buyer", buyer.buyer)
# The main app
app.run()
| 1.976563 | 2 |
S4/S4 Library/simulation/objects/lighting/lighting_object_interactions.py | NeonOcean/Environment | 1 | 47854 | from objects.lighting.lighting_interactions import SwitchLightImmediateInteraction
from objects.object_state_utils import ObjectStateHelper
import sims4
logger = sims4.log.Logger('LightingAndObjectState', default_owner='mkartika')
class SwitchLightAndStateImmediateInteraction(SwitchLightImmediateInteraction):
INST... | 2.171875 | 2 |
python/utils/CAN.py | TSO-team/StationDePesage | 0 | 47855 | <filename>python/utils/CAN.py
#!/usr/bin/env python3
# File: python/utils/CAN.py
# By: <NAME>
# For: My team.
# Description: TSO protocol for CAN bus.
from __future__ import print_function
import os, signal, subprocess, time, utils.drivers.CAN
def add_CAN_args(parser):
parser.add_argument... | 2.4375 | 2 |
stade/tracker/models/__init__.py | ImageMarkup/stade | 4 | 47856 | <filename>stade/tracker/models/__init__.py
from .email import Email
__all__ = ['Email']
| 1.101563 | 1 |
library/tests/test_setup.py | edalatpour/unicornhatmini-python | 32 | 47857 | import mock
def test_setup(GPIO, spidev):
from unicornhatmini import UnicornHATMini
unicornhatmini = UnicornHATMini()
spidev.SpiDev.assert_has_calls((
mock.call(0, 0),
mock.call(0, 1)
), any_order=True)
GPIO.setwarnings.assert_called_once_with(False)
GPIO.setmode.assert_calle... | 2.4375 | 2 |
botfw/bybit/order.py | lzpel/btc_bot_framework | 115 | 47858 | import time
from ..base import order as od
from .api import BybitApi
class BybitOrderManager(od.OrderManagerBase):
def __init__(self, api, ws=None, retention=60):
super().__init__(api, ws, retention)
self.ws.subscribe('execution', self.__on_events, True)
self.ws.subscribe('position', self... | 2.15625 | 2 |
clip/__init__.py | AgentMaker/Paddle-CLIP | 57 | 47859 | import os
import wget
import paddle
from .tokenizer import Tokenizer
from .model import CLIP
from paddle.vision.transforms import Compose, Resize, CenterCrop, ToTensor, Normalize
tokenizer = Tokenizer()
def get_transforms(image_resolution):
transforms = Compose([
Resize(image_resolution, interpolation='... | 2.328125 | 2 |
sdk/python/pulumi_yandex/_inputs.py | pulumi/pulumi-yandex | 9 | 47860 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | 1.226563 | 1 |
shared/tools/snapshot/ia/project.py | DougMahoney/metatools | 12 | 47861 | """
Project resources
Many configuration and scripting resources are extracted here.
"""
from shared.tools.snapshot.utils import encode, hashmapToDict
def extract_project_props(client_context):
global_props = client_context.getGlobalProps()
configuration = {
'permissions': hashmapToDict(global_props.getPe... | 1.953125 | 2 |
pybaselines/polynomial.py | derb12/pybaselines | 18 | 47862 | # -*- coding: utf-8 -*-
"""Polynomial techniques for fitting baselines to experimental data.
Created on Feb. 27, 2021
@author: <NAME>
The function penalized_poly was adapted from MATLAB code from
https://www.mathworks.com/matlabcentral/fileexchange/27429-background-correction
(accessed March 18, 2021), which was lic... | 1.492188 | 1 |
contacts/urls.py | melodyPereira05/PropertyDekho | 0 | 47863 | from django.urls import path
from . import views
urlpatterns = [
path('<int:sproperty_id>/',views.contact,name="contact"),
path('',views.contact_submit,name="contact-submit"),
] | 1.523438 | 2 |
dataset_seam/__init__.py | lonestar686/pytorch-saltnet | 0 | 47864 | <gh_stars>0
from .seam_data import SEAM, TileBase | 0.96875 | 1 |
namebench/appengine/models.py | chicks-net/namebench | 2 | 47865 | #!/usr/bin/env python
#
# Copyright 2010 Google 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 o... | 2.234375 | 2 |
py3rijndael/__init__.py | squaresmile/py3rijndael | 0 | 47866 | <reponame>squaresmile/py3rijndael
from py3rijndael.paddings import Pkcs7Padding, ZeroPadding
from py3rijndael.rijndael import Rijndael, RijndaelCbc
__version__ = "0.3.5"
__all__ = ["Pkcs7Padding", "ZeroPadding", "Rijndael", "RijndaelCbc"]
| 1.421875 | 1 |
MontyExtractor.py | treatmesubj/MontyLingua | 0 | 47867 | <filename>MontyExtractor.py
__author__="<NAME> <<EMAIL>>"
__version__="2.0"
import sys,string,os,re
class MontyExtractor:
def __init__(self):
print("Semantic Interpreter OK!")
return
def extract_info(self,chunked_text,lemmatise_function_handle=None):
cp_cleaned=self.strip... | 2.5 | 2 |
PE/PE77.py | bristy/codemania | 0 | 47868 | # https://projecteuler.net/problem=77
from prime_util import sieve
MAX = 5000
INF = 1 << 31
def pe77():
primes, s = sieve(MAX)
dp = [0] * MAX
dp[0] = 1
for p in primes:
w = p
while w < MAX:
dp[w] = dp[w] + dp[w - p]
w += 1
for i, p in enumerate(dp):
... | 2.6875 | 3 |
lcms_results_processor/charts.py | domdfcoding/PhD-Data | 0 | 47869 | <gh_stars>0
#!/usr/bin/env python3
#
# charts.py
#
# Copyright © 2020 <NAME> <<EMAIL>>
#
# 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.609375 | 2 |
grav_tele/d_focal.py | mvtea/sgl | 0 | 47870 | <filename>grav_tele/d_focal.py<gh_stars>0
#Program to compute the minimum focal distance of light passing the sun at a distance equal to the
#radius of the sun
import matplotlib.pyplot as plt
#Constants
G = 6.67e-11 #Gravitational constant [m^3 kg^-1 s^-2]
M_sun = 1.989e30 #Mass of the sun [kg]... | 3.53125 | 4 |
examples/PyGame/avoid_joint_limits.py | elsuizo/abr_control | 1 | 47871 | """
Running operational space control with the PyGame display, using an exponential
additive signal when to push away from joints.
The target location can be moved by clicking on the background.
"""
import numpy as np
from abr_control.arms import threejoint as arm
# from abr_control.arms import twojoint as arm
from ab... | 3.15625 | 3 |
ManualTest/eventCheckAndActionTest.py | terapotan/NewBreakingBlocks | 0 | 47872 | <filename>ManualTest/eventCheckAndActionTest.py
import unittest
class mainTest(unittest.TestCase):
def test_checkCollectEventCheckListContent(self):
self.assertEqual(input('EventOccurCheckClassesInAFrame:dummyEventCheck1,dummyEventCheck2,dummyEventCheck3,と表示されているか(y/n)'),'y')
def test_checkCollectEvent... | 3.25 | 3 |
tests/utils/data/test_image_utils.py | chenwenxiao/DOI | 1 | 47873 | import itertools
from unittest import TestCase
import numpy as np
from utils.data import ArrayInfo, image_array_to_rgb
from utils.data.mappers import *
class ImageUtilsTestCase(TestCase):
def test_image_array_to_rgb(self):
np.random.seed(1234)
def f(batch_size, n_channels, channel_last, the_ch... | 2.5625 | 3 |
closeness_server/wsgi.py | wligtenberg/closeness-server | 0 | 47874 | # -*- coding: utf-8 -*-
# closeness-server (c) <NAME>
from closeness_server import create_app
app = create_app()
| 1.234375 | 1 |
apps/gsekit/admin.py | iSecloud/bk-process-config-manager | 8 | 47875 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸 (Blueking) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
You may... | 1.40625 | 1 |
src/vision/stereo.py | hb-jones/rp1-ros | 0 | 47876 | <filename>src/vision/stereo.py
from logging import config
import threading, cv2, time, json
from .stereocam import StereoCam
from .vision_config import BallConfig, StereoConfig, MonocularConfig
from . import preprocessing, trajectory_estimation, monocular
class Stereo(monocular.Monocular):
def __init__(... | 2.796875 | 3 |
AD11-flask-admin-with-sqlalchemy-demo/models.py | AngelLiang/Flask-Demos | 3 | 47877 | from sqlalchemy import Table, Column, Integer, String
from sqlalchemy.orm import mapper
from .database import metadata, db_session
class User(object):
query = db_session.query_property()
def __init__(self, name=None, email=None):
self.name = name
self.email = email
def __repr__(self):
... | 2.921875 | 3 |
jumbo_cols.py | yldrmdenz/fin_dashboard | 0 | 47878 | import dash_bootstrap_components as dbc
import dash_html_components as html
"""
Creation of jumbotrons for a better Homepage display
"""
left_jumbotron = dbc.Col(
html.Div(
[
html.H2("Your Favorite Finance Hub", className="display-3"),
html.Hr(className="my-2"),
html.P(
... | 2.765625 | 3 |
17_greedy/greedy_xrh.py | Xinrihui/Data-Structure-and-Algrithms | 1 | 47879 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
from numpy import *
import heapq
class solutions:
def childs_with_sugers(self,childs,sugers):
"""
分糖给小朋友,一个小朋友只能拿一块糖,糖不能分割
:param childs:
:param sugers:
:return:
"""
childs=sorted(childs)
sugers=sorted(su... | 3 | 3 |
demo.py | xyukiono/job-runner | 1 | 47880 | <reponame>xyukiono/job-runner<filename>demo.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import time
import tensorflow as tf
import argparse
def main(config):
gpu = os.environ.get('CUDA_VISIBLE_DEVICES')
print('demo.py (#depth={}, #channel={})'.format(config.n_depth, config.n_channel))
if c... | 2.234375 | 2 |
examples/example_plugin/example_plugin/urls.py | susanhooks/nautobot | 0 | 47881 | <gh_stars>0
from django.templatetags.static import static
from django.urls import path
from django.views.generic import RedirectView
from nautobot.extras.views import ObjectChangeLogView
from example_plugin import views
from example_plugin.models import AnotherExampleModel, ExampleModel
app_name = "example_plugin"
... | 1.859375 | 2 |
dl_l8s2_uv/satreaders/l8image.py | csaybar/DL-L8S2-UV | 13 | 47882 | <gh_stars>10-100
"""
Classes and functions for reading L8 images and manually annotated cloud masks from the Biome and 38-Cloud
cloud cover dataset.
https://landsat.usgs.gov/landsat-8-cloud-cover-assessment-validation-data
"""
import os
from datetime import datetime
from datetime import timezone
import numpy as np
i... | 2.875 | 3 |
otcextensions/tests/unit/sdk/waf/v1/test_domain.py | zsoltn/python-otcextensions | 10 | 47883 | <reponame>zsoltn/python-otcextensions<filename>otcextensions/tests/unit/sdk/waf/v1/test_domain.py<gh_stars>1-10
# 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/li... | 1.796875 | 2 |
editor/editor.py | LordKBX/EbookCollection | 1 | 47884 | <reponame>LordKBX/EbookCollection<gh_stars>1-10
import os
import sys
if os.name == 'nt':
import ctypes
import PyQt5.QtGui
import PyQt5.QtCore
from PyQt5.uic import *
from window import *
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from common.dialog import *
from common.archive i... | 2.140625 | 2 |
Intensivo-Python/Cap-7/Exer-Cap-7.10.py | RodrigoTAbreu/Python-3 | 0 | 47885 | local = {}
incluir = True
while incluir:
nome = input('qual seu nome? :')
local_escolhido = input('Qual local de suas próximas férias? :')
local[nome] = local_escolhido
repetir = input('Gostaria de incluir outro na enquete?(Yes/No):')
if repetir == 'no':
incluir = False
print('Resultados d... | 3.796875 | 4 |
dagshub/fastai/logger.py | gagan3012/client | 37 | 47886 | <filename>dagshub/fastai/logger.py
from fastai.learner import Learner, Recorder
from fastcore.basics import *
from fastai.callback.core import Callback
from fastai.callback.hook import total_params
from fastai.torch_core import rank_distrib, to_detach
from ..logger import DAGsHubLogger as LoggerImpl
class DAGsHubLog... | 2.28125 | 2 |
src/python/generators/workflows.py | ncsa/NCSA-Genomics_MGC_GenomeGPS_CromwelWDL | 0 | 47887 | <reponame>ncsa/NCSA-Genomics_MGC_GenomeGPS_CromwelWDL
#!/usr/bin/env python3
import sys
from .tasks import *
import logging
from util.log import ProjectLogger
"""
Exit code Rules:
1. Exit codes in this module are only given when an error has occurred, so they will all start with 'E.'
2. The letters 'wfg.' because th... | 2.265625 | 2 |
src/my_pytube/__init__.py | mjmartinson/intravideo_search | 0 | 47888 | # -*- coding: utf-8 -*-
# flake8: noqa
# noreorder
"""
Pytube: a very serious Python library for downloading YouTube Videos.
"""
__title__ = 'my_pytube'
__version__ = '9.5.2'
__author__ = '<NAME>'
__license__ = 'MIT License'
__copyright__ = 'Copyright 2019 <NAME>'
#import logging
#import query
#import streams
#import ... | 1.765625 | 2 |
examples/loopyfunction.py | j00st/larry | 0 | 47889 | def sommig(n):
result = 0
while(n>=1):
result += n
n-=1
return result
print(sommig(3))
print(sommig(8))
print(sommig(17))
print(sommig(33)) | 3.53125 | 4 |
nodes/Controller.py | jimboca/udi-poly-FlumeWater | 0 | 47890 | <gh_stars>0
"""
Get the polyinterface objects we need. Currently Polyglot Cloud uses
a different Python module which doesn't have the new LOG_HANDLER functionality
"""
try:
from polyinterface import Controller,LOG_HANDLER,LOGGER
except ImportError:
from pgc_interface import Controller,LOGGER
import logging
f... | 2.25 | 2 |
unittesting/__init__.py | SpaceAppsXploration/semantic-data-chronos | 1 | 47891 | <reponame>SpaceAppsXploration/semantic-data-chronos
__author__ = '<EMAIL>'
| 1.015625 | 1 |
galaxylearning/entity/job.py | ZJU-DistributedAI/GalaxyLearning | 4 | 47892 | class Job(object):
def __init__(self, server_host, job_id, train_strategy, train_model, train_model_class_name, aggregate_strategy,
distillation_alpha=None):
self.server_host = server_host
self.job_id = job_id
self.train_strategy = train_strategy
self.train_model = ... | 2.578125 | 3 |
SUAVE/SUAVE-2.5.0/trunk/SUAVE/Methods/Aerodynamics/Airfoil_Panel_Method/panel_geometry.py | Vinicius-Tanigawa/Undergraduate-Research-Project | 0 | 47893 | ## @ingroup Methods-Aerodynamics-Airfoil_Panel_Method
# panel_geometry.py
# Created: Mar 2021, <NAME>
# ---------------------------------------
#-------------------------------
# Imports
# ----------------------------------------------------------------------
import SUAVE
from SUAVE.Core import Units
import numpy ... | 2.375 | 2 |
pdb_multimutate.py | LilySnow/PDB_related | 0 | 47894 | #!/usr/bin/python
"""
(dummy-)Mutates multiple residues on a PDB-formatted structure.
HADDOCK will then reconstruct the residue according to its topology.
Usage: python pdb_multimutate.py pdbFL <mutation list file>
The format of mutation list:
chain resi resn_wt resn_mut
Example: python pdb_multimuta... | 2.96875 | 3 |
gears/usables.py | fmunoz-geo/gearhead-caramel | 2 | 47895 | <gh_stars>1-10
from pbge import Singleton
from . import geffects, stats, materials, aitargeters, enchantments
import pbge
class AntidotePill(Singleton):
VALUE = 800
@classmethod
def get_invocations(cls, pc):
mylist = list()
mylist.append(pbge.effects.Invocation(
name = 'Antidote... | 2.046875 | 2 |
setup.py | AjayMT/emitter | 1 | 47896 | <reponame>AjayMT/emitter
#!/usr/bin/env python
from distutils.core import setup
setup(
name='emitter',
version='0.0.7',
description='simple event emitter',
author='<NAME>',
author_email='<EMAIL>',
url='http://github.com/ajaymt/emitter',
download_url='https://github.com/AjayMT/emitter/tarba... | 1.046875 | 1 |
preprocessing/extract_hashtags.py | acvander/kaggle_real_or_not | 0 | 47897 | <filename>preprocessing/extract_hashtags.py
import re
import pandas as pd
def extract_hashtags(df: pd.DataFrame) -> pd.DataFrame:
pattern = re.compile(r'#(\w+)')
def get_hashtags(row: pd.Series) -> pd.Series:
text = row['text']
hashtags = re.findall(pattern, text)
row['hashtags'] = h... | 3.359375 | 3 |
app/app.py | escofresco/makeschool_fsp2_realtweets | 0 | 47898 | import marshal
from multiprocessing import Condition, Process, Queue, Pipe
import os
from threading import Timer
from types import FunctionType
import pickle
from celery import Celery
from flask import Flask, url_for
from grams.grams import Histogram
from grams.markov import MC
import time
def make_app():
def... | 2.640625 | 3 |
CursoemVideo/ex006.py | arthxvr/coding--python | 0 | 47899 | numero = int(input('Número: '))
dobro = numero*2
triplo = numero*3
raiz = numero**(1/2)
print(f'Dobro: {dobro}, Triplo: {triplo}, Raiz quadrada: {raiz:.2f}')
| 3.625 | 4 |