source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
realtime.py | import os
from tqdm import tqdm
import numpy as np
import pandas as pd
import cv2
import time
import re
import threading
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
from deepface import DeepFace
from deepface.extendedmodels import Age
from deepface.commons import functions, realtime, distance as dst
from deep... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... |
thread_buffer.py | # Copyright 2020 - 2021 MONAI Consortium
# 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 wri... |
serialization.py | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... |
utils.py |
import json
import sys
import re
import os
import stat
import fcntl
import shutil
import hashlib
import tempfile
import subprocess
import base64
import threading
import pipes
import uuid
import codecs
try:
from collections.abc import Iterable, Mapping
except ImportError:
from collections import Iterable, Mapp... |
data_util.py | '''
this file is modified from keras implemention of data process multi-threading,
see https://github.com/fchollet/keras/blob/master/keras/utils/data_utils.py
'''
import time
import numpy as np
import threading
import multiprocessing
try:
import queue
except ImportError:
import Queue as queue
class GeneratorE... |
home_controller.py | from app.controllers.base_controller import BaseController
from app.repositories.request_repo import RequestRepo
from app.utils import request_status_text, request_item_title, floor_wings
from app.utils.slackhelper import SlackHelper
import pandas as pd
from app.repositories.user_repo import UserRepo
from app.models.lo... |
loadingAnimation.py | #!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
# @Author: KevinMidboe
# @Date: 2017-07-30 13:53:38
# @Last Modified by: KevinMidboe
# @Last Modified time: 2017-07-30 13:53:46
import itertools
from threading import Thread
from time import sleep
from sys import stdout
class LoadingAnimation(object):
def __init__... |
test_greenlet.py | import gc
import sys
import time
import threading
import unittest
from abc import ABCMeta, abstractmethod
from greenlet import greenlet
class SomeError(Exception):
pass
def fmain(seen):
try:
greenlet.getcurrent().parent.switch()
except:
seen.append(sys.exc_info()[0])
... |
bootstrap.py | """
Bootstrap an installation of TLJH.
Sets up just enough TLJH environments to invoke tljh.installer.
This script is run as:
curl <script-url> | sudo python3 -
Constraints:
- The entire script should be compatible with Python 3.6, which is the on
Ubuntu 18.04+.
- The script should parse in Pytho... |
thread.py |
from multiprocessing import Process, Queue, Pool
import os
import time
import random
# def queue_demo(func):
# def wrapper(*args, **kwargs):
# print(f'fetch task from queue: {os.getpid()}')
# func(*args, **kwargs)
# return wrapper
# @queue_demo
def read(q):
while True:
if q.empt... |
vhSockets.py | # Websocket handler
from socketIO_client_nexus import SocketIO, LoggingNamespace
import threading, json, math
class vhSockets:
devices = []
connected = False
win = False
socketIO = None
#bindable events
onConnection = None # bool connected
def init(self, win):
self.win = win
... |
toy.py | # -*- encoding: utf-8 -*-
import sys
import getpass
import json
import platform
import random
import socket
import string
import time
import threading
import logging
import Queue
try:
from urllib2 import urlopen, Request
except ImportError:
from urllib.request import urlopen, Request
from commander.thirdparty... |
contribs.py | import os
import threading
import time
from ._compat import unittest
from ._adapt import IS_GAE
from pydal._compat import to_bytes
from pydal.contrib.portalocker import lock, unlock, read_locked, write_locked
from pydal.contrib.portalocker import LockedFile, LOCK_EX
def tearDownModule():
if os.path.isfile('test.t... |
multithreading-client.py | from socketIO_client_nexus import SocketIO, BaseNamespace
import json
from threading import Thread
import threading
socketIO = SocketIO('ip', port)
namespace = socketIO.define(BaseNamespace, '/directory')
def receive_events_thread():
socketIO.wait()
def on_response(*args):
global emotion_batch
loads = jso... |
operate.py | # copytrue (c) 2020 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 applicab... |
test_asyncore.py | import asyncore
import unittest
import select
import os
import socket
import sys
import time
import warnings
import errno
import struct
from test import support
from test.support import TESTFN, run_unittest, unlink, HOST, HOSTv6
from io import BytesIO
from io import StringIO
try:
import threading
except ImportErr... |
server.py | from socket import AF_INET, socket, SOCK_STREAM, SOL_SOCKET, SO_REUSEADDR
from threading import Thread
from re import match
# A few colors that will be used in text messaging. This is not compatible with the Windows Terminal.
# You might try using Cmder instead (or any terminal compatible with ANSI Escape Sequenc... |
manager.py | #!/usr/bin/env python3
import os
import time
import sys
import fcntl
import errno
import signal
import shutil
import subprocess
import datetime
import textwrap
from typing import Dict, List
from selfdrive.swaglog import cloudlog, add_logentries_handler
from common.basedir import BASEDIR, PARAMS
from common.hardware i... |
Async.py | # Copyright 2007 by Tiago Antao <tiagoantao@gmail.com>. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Asynchronous execution of Fdist and spliting of loads.
FDistAsync All... |
datahandler.py | import time
import logging
from enum import Enum
from threading import Thread, Lock
from tornado import gen
import pandas as pd
_logger = logging.getLogger(__name__)
class UpdateType(Enum):
ADD = 1,
UPDATE = 2,
class LiveDataHandler:
'''
Handler for live data
'''
def __init__(self, doc, ... |
staticfiles.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Jolla Ltd.
# Contact: Jussi Pakkanen <jussi.pakkanen@jolla.com>
# All rights reserved.
#
# You may use this file under the terms of BSD license as follows:
#
# Redistribution and use in source and binary forms, with or without
# modification, ar... |
Wootopia 1_6_6.py | # -*- coding: UTF-8 -*-
#!/usr/bin/env python3
# Version 1.6.6
# Imports pour le slider
from __future__ import absolute_import, division, print_function, unicode_literals
try:
import pi3d
except:
print("IMPORT Pi3D ERROR!")
pass
import os
import subprocess
import struct
import time
import random
import as... |
loader.py | # Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
#
# 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, m... |
behavior_cloning.py | """Author: Brandon Trabucco, Copyright 2019, MIT License"""
import multiprocessing
from cs285.baselines.imitate.behavior_cloning import BehaviorCloning
from gym.envs.mujoco.walker2d import Walker2dEnv
def run_experiment(experiment_id):
BehaviorCloning(
Walker2dEnv,
logging_dir="./walker2d/behavi... |
test_multiprocess_iterator.py | from __future__ import division
import copy
import errno
import os
import signal
import subprocess
import sys
import tempfile
import threading
import time
import unittest
import numpy
import six
from chainer import iterators
from chainer import serializer
from chainer import testing
class DummySerializer(serializer... |
spinner.py | import sys
from itertools import cycle
from threading import Event, Thread
from time import sleep
from typing import Any
class Spinner:
phases: Any = cycle(["⣾", "⣷", "⣯", "⣟", "⡿", "⢿", "⣻", "⣽"])
def __init__(self) -> None:
self.stop_running: Any = Event()
self.spin_thread: Any = Thread(tar... |
plogging.py | import Pyro4
Pyro4.config.HMAC_KEY = 'deadbeef'
import os, threading
from Queue import Queue
socket = "/tmp/passe_logger.sock"
uri = "PYRO:logger@./u:%s" % socket
proxy = None
pid = None
def plog(tag, time):
global proxy, pid
if proxy == None or os.getpid() != pid:
pid = os.getpid()
proxy = ... |
window.py | from threading import Thread
import numpy as np
import sdl2
from sdl2 import mouse
import sdl2.ext
from sdl2.ext import window
from sdl2.ext.sprite import Renderer
import ctypes
class Window:
def __init__(self, nbox, title="Visualizer"):
self.size = [1000, 1000]
sdl2.ext.init()
disp_hw =... |
code.py | # Released under the MIT License. See LICENSE for details.
#
"""Functionality for formatting, linting, etc. code."""
from __future__ import annotations
import os
import subprocess
import sys
from pathlib import Path
from typing import TYPE_CHECKING
from efrotools.filecache import FileCache
if TYPE_CHECKING:
fro... |
collective_ops_multi_worker_test.py | # Copyright 2018 The TensorFlow Authors. 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 applicab... |
tracker.py | """
Tracker script for DMLC
Implements the tracker control protocol
- start dmlc jobs
- start ps scheduler and rabit tracker
- help nodes to establish links with each other
Tianqi Chen
"""
# pylint: disable=invalid-name, missing-docstring, too-many-arguments, too-many-locals
# pylint: disable=too-many-branches, too-... |
custom.py | # pylint: disable=too-many-lines
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------... |
benchmark.py | from motion_marmot.utils.video_utils import extract_video
from motion_marmot.advanced_motion_filter import (
AdvancedMotionFilter,
MotionMaskMetadata,
)
from datetime import datetime
import typer
import time
import threading
import os
app = typer.Typer()
contour_count = 0
frame_count = 0
def motion_detection... |
blockcheck.py | #!/usr/bin/env python3
# coding: utf-8
import argparse
import json
import urllib.request
import urllib.parse
import urllib.error
import socket
import ssl
import sys
import os.path
import dns.resolver
import dns.exception
import ipaddress
import ipwhois
'''
=================================
IMPORTANT
Make sure to ru... |
good_mornings.py | import selenium
import glob
from numpy import arange
from random import sample
from sys import exit
from time import sleep
from progress.spinner import Spinner
from progress.bar import ChargingBar
from threading import Thread
from selenium import webdriver
from selenium.webdriver.firefox.options import Option... |
Main.py | #coding:utf-8
#! /usr/bin/env python
#Author:Sh4d0w_小白
from tkinter import *
from Content import *
from threading import Thread
window = Tk()
checkButton = []
boxButton = []
var = []
var.append(IntVar())
pageNum = round(len(checkButtonText) / 9)
pageIndex = 1
treasureBox = Toplevel()
max = 0
def In... |
test_normalize_by_median.py | # This file is part of khmer, https://github.com/dib-lab/khmer/, and is
# Copyright (C) 2015-2016, The Regents of the University of California.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions... |
Server.py | import socket
import threading
from tkinter import *
import tkinter.scrolledtext
host = '127.0.0.1'
port = 9090
class Server:
def __init__(self, HOST, PORT):
self.gui_done = False
self.running = True
gui_threading = threading.Thread(target=self.gui_loop)
running_threading = threa... |
threading_daemon_join_timeout.py | import threading
import time
import logging
def daemon():
logging.debug('Starting')
time.sleep(0.2)
logging.debug('Exiting')
def non_daemon():
logging.debug('Starting')
logging.debug('Exiting')
logging.basicConfig(
level=logging.DEBUG,
format='(%(threadName)-10s) %(message)s',
)
d = t... |
cleanup.py | """
sentry.runner.commands.cleanup
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2015 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
from datetime import timedelta
from uuid import uuid4
import click
from djan... |
dag_processing.py | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
cl_4.py | import socket
import time
from threading import Thread
import sys
conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
conn.connect(("127.0.0.1", 14903))
def receive():
while True:
data = conn.recv(16384)
udata = data.decode("utf-8")
if not data:
break
print(udata)
def send_mes():
while True:
messa... |
test_lowlevel.py | import datetime
import unittest
import threading
import time
from elasticsearch import Elasticsearch
from elasticsearch_opentracing import TracingTransport, init_tracing, \
enable_tracing, disable_tracing, set_active_span, clear_active_span, \
get_active_span, _clear_tracing_state
from mock import patc... |
dist_autograd_test.py | import sys
import threading
import time
import unittest
from enum import Enum
import random
import torch
import torch.nn as nn
from datetime import timedelta
import torch.distributed as dist
import torch.distributed.autograd as dist_autograd
import torch.distributed.rpc as rpc
import torch.testing._internal.dist_utils
... |
motion_from_file.py | #! /usr/bin/env python
from __future__ import print_function
import rospy
from std_msgs.msg import Float64
from sensor_msgs.msg import JointState
import actionlib
import pbr_gazebo.msg
from threading import Thread
from collections import deque
import numpy as np
import rospkg
import os
import csv
from gazebo_msgs.msg i... |
convert_velo_txt2bin.py | import argparse
import glob
import multiprocessing
import os
import sys
import time
import numpy as np
import tqdm
dname = os.path.dirname(__file__)
module_dir = os.path.abspath("{}/deeplio".format(dname))
content_dir = os.path.abspath("{}/..".format(dname))
sys.path.append(dname)
sys.path.append(module_dir)
sys.path... |
upload_symbols.py | # Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Upload all debug symbols required for crash reporting purposes.
This script need only be used to upload release builds symbols or to debug
crashes... |
test_initialize.py | import multiprocessing as mp
import numpy
import psutil
import pytest
from dask import array as da
from distributed import Client
from distributed.deploy.local import LocalCluster
from dask_cuda.initialize import initialize
from dask_cuda.utils import get_ucx_config
mp = mp.get_context("spawn")
ucp = pytest.importo... |
multithread.py | from ximea import xiapi
from imutils.video import FPS
import imutils
import cv2
import numpy as np
from queue import Queue
from threading import Thread
import time
RESIZE = 50000
def worker(input_q, output_q):
fps = FPS().start()
while True:
fps.update()
frame = input_q.get()
frame_rgb... |
BotDebugger.py | import numpy as np
import matplotlib.pyplot as mpl
from threading import Thread
import time
import traceback
import Const
def CF(pct):
if pct == Const.PL_C:
return 'y'
if pct == Const.PL_O:
return 'b'
if pct == 'E':
return 'r'
if pct == -1:
return 'k'
return 'g'
cla... |
main.py | #NAME: main.py
#DATE: Tuesday 6th August 2019
#AUTH: Ryan McCartney, EEE Undergraduate, Queen's University Belfast
#DESC: A python script for running a CherryPy API as a serial passthrough
#COPY: Copyright 2019, All Rights Reserved, Ryan McCartney
import subprocess
import threading
import cherrypy
import signal
i... |
run.py | from flask import Flask, request, jsonify
from flask_mqtt import Mqtt
from twilio.twiml.messaging_response import MessagingResponse
import json
import twilio_messaging as messaging
import chatbot
import db
import connect
import visual_recognition as vr
import nlp
import os
import sparrow_handler as sparrow
from time im... |
192-01-queue.py | import logging
import queue
import threading
logging.basicConfig(level=logging.DEBUG, format="%(threadName)s: %(message)s")
def worker1(queue):
logging.debug("start")
while True:
item = queue.get()
if item is None:
break
logging.debug(item)
queue.task_done()
lo... |
test_vscode_robot.py | import logging
import os
from pathlib import Path
import threading
import pytest
from robocorp_ls_core.protocols import ILanguageServerClient
from robocorp_ls_core.unittest_tools.cases_fixture import CasesFixture
from robotframework_ls.commands import ROBOT_INTERNAL_RFINTERACTIVE_STOP
from robotframework_ls.impl.robo... |
good_videocapture.py | import time
import threading
import cv2
class GoodVideoCpature(cv2.VideoCapture):
def __init__(self, url, timeout = 3, *args, **kwargs):
super(GoodVideoCpature, self).__init__(url, *args, **kwargs)
self.frame_receiver = None
self.timeout = timeout
self._result = (None, None)
... |
worker.py | """timeflux.core.worker: spawn processes."""
import importlib
import logging
import signal
from multiprocessing import Process
from timeflux.core.logging import get_queue, init_worker
from timeflux.core.graph import Graph
from timeflux.core.scheduler import Scheduler
from timeflux.core.registry import Registry
from ti... |
collect_telemetry_events.py | # Microsoft Azure Linux Agent
#
# Copyright 2020 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
stdin-plot.py | #!/usr/bin/python3
import collections
import sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib import style
from matplotlib.lines import Line2D
from threading import Thread
style.use('dark_background')
#style.use('ggplot')
figure = plt.figure()
timedoma... |
fit.py | import sys
import os
from musket_core.project_paths import *
print(("Adding " + os.path.dirname(sys.path[0]).replace('\\', '/')).encode('ascii', 'replace'))
#sys.path.append(os.path.dirname(sys.path[0]))
sys.path[0] = os.path.dirname(sys.path[0])
print("sys.path:")
print(str(sys.path).replace('\\', '/').encode('ascii',... |
worker.py | # -*- coding: utf-8 -*-
import json
import threading
import time
import logging
import socket
import random
from register import register
from logger import logger
def get_config(filename='config.json'):
try:
with open(filename) as f:
return json.load(f)
except IOError as err:
log... |
dynamic_tc.py | """
這裡程式可以動態改變鏈路網路狀態目的是更靈活的模擬改變網路
delay-distro=jitter
https://github.com/Lu-Yi-Hsun/tcconfig#set-traffic-control-tcset-command
sudo tcset s2-eth1 --delay 30ms --rate 10Kbps --loss 50.1% --delay-distro 10ms --overwrite
"""
import zmq
from multiprocessing import Process
import os
import time
import random
def tc(interf... |
streamingService.py | import cv2
from CameraLib import baseCamera, faceTracking
from IotLib.log import Log
from IotLib.iotNode import IotNode
from IotLib.pyUtils import startThread
def startVideoStream(camera, config, debug=False):
""" start video stream """
port = config.getOrAddInt('video.httpVideoPort', 8000)
streamer = Vide... |
simple_print_worker.py | #!/usr/bin/env python
# encoding: utf-8
from __future__ import print_function
import multiprocessing
def worker(num):
"""The `num` passed should be pickle-lable"""
print("hello there", num)
return
if __name__ == "__main__":
jobs = []
for i in range(5):
p = multiprocessing.Process(target=w... |
test_operator_gpu.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
server.py | """
bender_mc.server
~~~~~~~~~~~~~~~~
Built in, production ready webserver for easy access.
"""
# :copyright: (c) 2020 by Nicholas Repole.
# :license: MIT - See LICENSE for more details.
import configparser
from cheroot import wsgi
from cheroot.ssl.builtin import BuiltinSSLAdapter
import os
import logging
... |
browser.py | # -*- coding: utf-8 -*-
#
# This file is part of urlwatch (https://thp.io/2008/urlwatch/).
# Copyright (c) 2008-2020 Thomas Perl <m@thp.io>
# 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.... |
views.py | # -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""
# Python modules
import fnmatch
import os, logging
# Flask modules
import threading
import requests
from flask import render_template, request, url_for, redirect, send_from_directory, session, Response, flash
from flask_login impo... |
run_client.py | import socket
import sys
from time import sleep
from threading import Thread
import os
kill = False
s = socket.socket()
print("Connected to IP: " + "Server" + ":" + "9999")
print("Wrap commands in %/%.")
global hist
hist = []
sender_h = []
def refresh():
prev_sender = ""
os.system('cls' if os.name == 'nt' e... |
contentconfigurationservice.py | #!/usr/bin/env python2
'''A library and a command line tool to interact with the LOCKSS daemon's
content configuration service via its Web Services API.'''
__copyright__ = '''\
Copyright (c) 2000-2016, Board of Trustees of Leland Stanford Jr. University
All rights reserved.'''
__license__ = '''\
Redistribution and u... |
playlist.py | import json
import threading
import logging
import random
import time
import variables as var
from media.cache import (CachedItemWrapper, ItemNotCachedError,
get_cached_wrapper_from_dict, get_cached_wrapper_by_id)
from database import Condition
from media.item import ValidationFailedError, Pre... |
state.py | # -*- coding: utf-8 -*-
"""
The State Compiler is used to execute states in Salt. A state is unlike
an execution module in that instead of just executing a command, it
ensures that a certain state is present on the system.
The data sent to the state calls is as follows:
{ 'state': '<state module name>',
'fun... |
shell.py | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not... |
_ipython_utils.py | """Utilities for integrating with IPython
These functions should probably reside in Jupyter and IPython repositories,
after which we can import them instead of having our own definitions.
"""
import atexit
import os
try:
import queue
except ImportError:
# Python 2
import Queue as queue
import sys
from s... |
solicitud.py | import time
import threading
import random
#Variables globales
estudiantes_reunidos = 0
error = 1
visitantes_formados = []
#Semáforos utilizados
mutex_estudiante = threading.Semaphore(1)
mutex_visitante = threading.Semaphore(1)
profesor_libre = threading.Semaphore(0)
jefe_esperando = threading.Semaphore(0)
#Defini... |
_contextvars_propagation_test.py | # Copyright 2020 The gRPC authors.
#
# 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 wri... |
main.py | import json, argparse, sys, random, os, re
from threading import Thread
from time import sleep
from collections import Iterator
# See example.json for example
class Exam(Iterator):
def __init__(self, file_name= None, shuffle=False, shuffle_answers=False, limit=-1, test_mode=False, **kwargs):
self.count_qu... |
handlers.py | # Copyright 2001-2016 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this perm... |
FingerprintIdentifier.py | import requests
import lib.fingerprint.FingerprintLoader
import lib.controller.FunctionLib
import re
import threading
import hashlib
import queue
import socket
import sys
import urllib2
import time
# Debug options.
# Make sure you know what are you doing.
# todo: Change mode after debug
debug = False
class Fingerp... |
cableController.py | # cableController.py
# shotmanager
#
# The cable movement controller.
# Runs as a DroneKit-Python script.
#
# Created by Jon Challinger and Will Silva on 1/21/2015.
# Copyright (c) 2016 3D Robotics.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... |
common.py | import inspect
import json
import os
import random
import subprocess
import ssl
import time
import requests
import ast
import paramiko
import rancher
import pytest
from urllib.parse import urlparse
from rancher import ApiError
from lib.aws import AmazonWebServices
from copy import deepcopy
from threading import Lock
fr... |
pydock.py | #!/usr/bin/env python
import sys
import os
import numpy as np
from multiprocessing import Manager
from multiprocessing import Process
from multiprocessing import Queue
import subprocess
import argparse
import pandas as pd
from pdbtools import ligand_tools
class DockingVina(object):
"""
python module for Vina
... |
_do_not_test_csvrgrep.py | """
csvrgrep is in experimental status
"""
import contextlib
from io import StringIO
import sys
from tests.mk import (
CmkTestCase,
ColumnsTests,
EmptyFileTests,
NamesTests,
patch,
skiptest,
)
from csvmedkit.xutils.csvrgrep import CSVRgrep, launch_new_instance
from csvmedkit.exceptions import... |
pcollector.py | # -*- coding:utf8 -*-
# File : pcollector.py
# Author : Jiayuan Mao
# Email : maojiayuan@gmail.com
# Date : 01/07/2017 #
# This file is part of TensorArtist.
import os
import collections
import itertools
import os.path as osp
import threading
import uuid
import imageio
import numpy as np
import sortedcollection... |
file_listener.py | # ===============================================================================
# Copyright 2012 Jake Ross
#
# 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/licens... |
docker.py | # Copyright 2016 Koichi Shiraishi. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
import re
import threading
from .base import Base
from deoplete.util import load_external_module
load_external_module(__file__, 'urllib3')
load_external_module(... |
timed_face_recognition.py | import cv2
import numpy as np
import time, threading
import pandas as pd
def face_recognition(names):
door_closed = cv2.imread("door_1.png")
door_open = cv2.imread("door_14.png")
resized_door_closed = cv2.resize(door_closed,None,fx=0.5,fy=0.5)
resized_door_open = cv2.resize(door_open,None,fx... |
object_storage_service_benchmark.py | # Copyright 2016 PerfKitBenchmarker Authors. 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 appli... |
test_build.py | # This script should run without errors whenever we update the
# kaggle/python container. It checks that all our most popular packages can
# be loaded and used without errors.
import tensorflow as tf
print(tf.__version__)
hello = tf.constant('TensorFlow ok')
sess = tf.Session()
print(sess.run(hello))
print("Tensorflow... |
_kit2fiff_gui.py | """Mayavi/traits GUI for converting data from KIT systems."""
# Authors: Christian Brodbeck <christianbrodbeck@nyu.edu>
#
# License: BSD (3-clause)
from collections import Counter
import os
import queue
import sys
import numpy as np
from scipy.linalg import inv
from threading import Thread
from mayavi.core.ui.mayav... |
analoginput.py | #####################################################################
# #
# analogoutput.py #
# #
# Copyright 2013, Monash University ... |
plugin.py | # Copyright (c) 2017 LSD - UFCG.
#
# 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 writin... |
COM_2_MAIN.py | ##COM 2 Main
## Written with Python v3.6.3 (CPython)
## Satellite Communication Subsystem 2
## Copyright (C) 2017 Jasper Yao, COM2 Subsystem Team,
##
##This program is free software: you can redistribute it and/or modify
##it under the terms of the GNU General Public License as published by
##the Free Software Foundati... |
conway.py | """PyGoL Game of Life"""
from __future__ import annotations
import multiprocessing as mp
from signal import SIGTERM
from typing import Any, Callable, List, Union
from pygol.utils import Matrix
from .rules import Signature as Rule
from .rules import conways_life, RULES
class Game(Matrix):
"""PyGoL Game simulati... |
server_test.py | # Copyright 2015 The TensorFlow Authors. 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... |
test_util_test.py | # Copyright 2015 The TensorFlow Authors. 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... |
cosmoscli.py | import enum
import hashlib
import json
import tempfile
import threading
import time
import bech32
from dateutil.parser import isoparse
from .app import CHAIN
from .ledger import ZEMU_BUTTON_PORT, ZEMU_HOST, LedgerButton
from .utils import build_cli_args_safe, format_doc_string, interact
class ModuleAccount(enum.Enu... |
loading.py | """Context manager for pretty terminal loading bars
"""
# %% stdlib
from itertools import cycle
from shutil import get_terminal_size
from threading import Thread
from time import sleep
# %% Context Manager
class Loader:
def __init__(self, desc="Loading...", end="Done!", timeout=0.5):
"""
A loader-... |
dircbot.py | #!/usr/bin/env python3.4
# dircbot 0.1 - a Python IRC bot
# by Duy Nguyen
# import system modules
import random
import socket
import sys
import time
import threading
# import my own modules in modules/ subfolder
import modules.quote as quote
import modules.misc as misc
import modules.pingpong as pingp... |
downloader.py | import os
import time
import shutil
import threading
import requests
import retry
from config import TEMP_FOLDER
# 多线程下载
# 来自 https://www.cnblogs.com/weiyinfu/p/8126063.html
# @JiangGua 进行了一些修改
def multithread_download(url, path, debug=False):
PER_THREAD_MIN = 2000 # 每个线程至少下载量
MAX_THREAD_COUNT = 50 # 最多线程数... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.