source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
train_ac_f18.py | """
Original code from John Schulman for CS294 Deep Reinforcement Learning Spring 2017
Adapted for CS294-112 Fall 2017 by Abhishek Gupta and Joshua Achiam
Adapted for CS294-112 Fall 2018 by Soroush Nasiriany, Sid Reddy, and Greg Kahn
"""
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
im... |
redis_frame_grabber.py | #!/usr/bin/env python
# __BEGIN_LICENSE__
# Copyright (c) 2015, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The xGDS platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this fi... |
Primes.py | """
A module designed to act as a singleton-like prime suite.
Once imported, it begins processes designed to help determine what numbers are prime
and uses concurrent branching to split primality tests and prime factorizations and
speed up the whole process.
"""
try:
import cPickle as pickle
except:
import pic... |
launch.py | # Copyright 2018 Datawire. 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 applicable law or agr... |
test.py | import gzip
import json
import logging
import os
import io
import random
import threading
import time
import helpers.client
import pytest
from helpers.cluster import ClickHouseCluster, ClickHouseInstance
logging.getLogger().setLevel(logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler())
SCRIPT_DIR = o... |
speed_test_proc.py | #!/usr/bin/env python
from netmiko import ConnectHandler
from datetime import datetime
from getpass import getpass
from net_system.models import NetworkDevice, Credentials
import django
from multiprocessing import Process, current_process
''' ********************************************** '''
''' average time for mul... |
scan.py | #!/usr/bin/env python
# encoding=utf-8
#codeby 道长且阻
#email ydhcui@suliu.net/QQ664284092
#https://github.com/ydhcui/Scanver
import socket
import re
import os
import sys
import traceback
import time
import json
import urllib
import threading
import datetime
import copy
import queue
from lib import requests
from... |
task_queue.py | import copy
import json
import queue
import random
import traceback
from threading import Thread, get_ident
from compipe.runtime_env import Environment as env
from ..response.response import response_channel_handlers, RespChannel
from ..cmd_enroller import command_list
from ..exception.task_queue_error import GErrorDu... |
main.py |
# author: Bartlomiej "furas" Burek (https://blog.furas.pl)
# date: 2021.07.30
#
# title: Initializing tkinter gui leads to main thread not in main loop
# url: https://stackoverflow.com/questions/68577245/initializing-tkinter-gui-leads-to-main-thread-not-in-main-loop/
import threading
import time
import tkinter as tk
... |
flasher.py | #!/usr/bin/env python
#
# Copyright (c) 2018, Pycom Limited.
#
# This software is licensed under the GNU GPL version 3 or any
# later version, with permitted additional terms. For more information
# see the Pycom Licence v1.0 document supplied with this file, or
# available at https://www.pycom.io/opensource/licensing
... |
messageTester.py | import json
import socket
from threading import Thread
def recv(c):
while True:
print(c.recv(4096).decode())
# hanxu
token = "92e5352dfae25bed36efa18db987d38e7fb989530a02656a2e319616690138af"
def wrap_message(mes):
return json.dumps({
'Authorization': token,
# Pikachu
'to':... |
benchmark_utils.py | """
Utilities for working with the local dataset cache.
This file is adapted from the AllenNLP library at https://github.com/allenai/allennlp
Copyright by the AllenNLP authors.
"""
import copy
import csv
import linecache
import os
import platform
import sys
from abc import ABC, abstractmethod
from collections import d... |
cron.py | import threading
from time import sleep
import traceback
from aspen import log_dammit
class Cron(object):
def __init__(self, website):
self.website = website
self.conn = None
self.has_lock = False
self.exclusive_jobs = []
def __call__(self, period, func, exclusive=False):
... |
jsonrpc.py | """Server implementation of the JSON RPC 2.0 protocol.
Originally adapted from:
https://github.com/palantir/python-language-server/blob/b08891f9345a5bbd543c657d1251cceed9f79b01/pyls/python_ls.py
"""
# TODO how to show status bar of server status (https://github.com/onivim/oni/pull/524)
from functools import partial, ... |
tests.py | """
Unit tests for reverse URL lookups.
"""
import sys
import threading
from admin_scripts.tests import AdminScriptTestCase
from django.conf import settings
from django.conf.urls import include, url
from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
f... |
test_get_collection_info.py | import pdb
import pytest
import logging
import itertools
from time import sleep
import threading
from multiprocessing import Process
from utils import *
collection_id = "info"
default_fields = gen_default_fields()
segment_row_count = 5000
class TestInfoBase:
@pytest.fixture(
scope="function",
p... |
chat.py | from tkinter import *
# from mttkinter import *
from tkinter import messagebox
import time
from pygame import mixer
import threading
from chat_utils import *
from chat_client_class import *
from client_state_machine import *
import json
import argparse
import os
import pickle
import random
import Game.Plane
parser = ... |
04process_shunxu.py | from multiprocessing import Process
from time import sleep
import os
# 子进程
def run():
print('子进程开始执行--%s' % (os.getpid(),))
sleep(10)
print('子进程执行结束')
if __name__ == '__main__':
print('父进程开始执行--%s' % (os.getpid(),))
# 创建子进程
p = Process(target=run)
p.start()
p.join(timeout=5)
p... |
addon.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# 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 ... |
unsplash_picture_multithreading.py | # -*- coding: utf-8 -*-
import requests,time,re,os
from threading import Thread
import threading
def timer(func):
@functools.wraps(func)
def wrapper_timer(*args, **kwargs):
start = time.time()
value = func(*args, **kwargs)
print(f"Finished {func.__name__!r} in {time.time()-start:.5f} s... |
lisp.py | # -----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com>
#
# 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... |
train.py | import sys
import time
from multiprocessing import Process, Queue
import yaml
import numpy as np
import zmq
import pycuda.driver as drv
sys.path.append('./lib')
from tools import (save_weights, load_weights,
save_momentums, load_momentums)
from train_funcs import (unpack_configs, adjust_learning_ra... |
bazin_roe.py | #!/usr/bin/env python3
# A idéia é calcular o ranking (Bazin) das ações analisando os dados fundamentalistas de todas as empresas da bolsa B3
# Para a análise, são utilizados princípios do Décio Bazin
# Ele é autor do livro: "Faça Fortuna Com Ações", que é tido como literatura indicada
# por Luis Barsi, o maior inves... |
fn_pp_threat_polling.py | # -*- coding: utf-8 -*-
# pragma pylint: disable=unused-argument, no-self-use
# (c) Copyright IBM Corp. 2010, 2019. All Rights Reserved.
"""Polling implementation"""
import calendar
import logging
import os
import time
from datetime import datetime
from threading import Thread
import jinja2
from resilient_circuits i... |
install.py | # Date: 01/09/2019
# Author: Mohamed
# Description: Install file
from time import sleep
from queue import Queue
from os.path import exists
from subprocess import Popen
from threading import Thread, RLock
class Install:
def __init__(self, path_to_req):
self.lock = RLock()
self.is_alive = True
... |
WrappedTreeVisualWindow.py | import pickle
import threading
from PyQt5.QtCore import QTimer, QEventLoop
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import (
QWidget, QToolTip, QPushButton, QApplication, QMessageBox, )
from .TreeVisualWindow import TreeVisualWindow
from ..utils import remove_if_exists
from ..WaitingSpinner... |
competition_example.py | #!/usr/bin/env python3
import botbowl
import socket
from botbowl.ai.competition import PythonSocketClient, PythonSocketServer
from multiprocessing import Process
import time
import secrets
import botbowl
import socket
def run_agent(registration_name, port, token):
"""
Starts a server that hosts an agent.
... |
running.py | # -*- coding: utf-8 -*-
"""Code for maintaining the background process and for running
user programs
Commands get executed via shell, this way the command line in the
shell becomes kind of title for the execution.
"""
import collections
import logging
import os.path
import re
import shlex
import signal
import sub... |
4.py | import threading
def job1():
global A, lock
# lock.acquire()
for i in range(10):
A += 1
print('job1', A)
# lock.release()
def job2():
global A, lock
# lock.acquire()
for i in range(10):
A += 10
print('job2', A)
# lock.release()
if __name__ == '__main__':... |
threaded.py | from threading import Thread, Lock, Event
from types import MethodType
from powerline.lib.monotonic import monotonic
from powerline.segments import Segment
class MultiRunnedThread(object):
daemon = True
def __init__(self):
self.thread = None
def is_alive(self):
return self.thread and sel... |
util.py | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import base64
import binascii
import colorsys
import contextlib
import codecs
import errno
import hashlib
import json
import getpass
import logging
import math
import numbers
import traceback
import os
import r... |
relay_control.py | from logger import Logger
from threading import Thread, Condition
import collections
import time
import os
# check if platform being used is laptop without GPIO functionality
from sys import platform
if platform == "win32":
testing = True
else:
#print(platform)
from gpiozero import Buzzer, OutputDevice
... |
manager.py | #!/usr/bin/env python3.7
import os
import time
import sys
import fcntl
import errno
import signal
import shutil
import subprocess
import datetime
from common.basedir import BASEDIR
from common.android import ANDROID
sys.path.append(os.path.join(BASEDIR, "pyextra"))
os.environ['BASEDIR'] = BASEDIR
TOTAL_SCONS_NODES = ... |
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... |
ReadData_CNN.py | from src.DataReader.DataUtils import *
import threading, cv2, sys, time
from src.Params import getNoiseLevel
import numpy as np
class ReadData():
def __init__(self, dsName='airsim', subType='mr', seq=0):
self.dsName = dsName
self.subType = subType
self.path = getPath(dsName, seq=seq, subTy... |
thread_test.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test Python threading
# Author: Even Rouault <even dot rouault at mines dash paris dot org>
#
#############################################... |
utils_mac.py | #!/usr/bin/env python3.9
from cProfile import label
import tkinter as tk
import tkinter.filedialog
from tkinter.ttk import *
from tkinter import ttk
from tkinter import *
from tkinter.filedialog import askopenfile
import tkinter.scrolledtext as scrolledtext
from tkinter import messagebox as msg
from tkinter import fon... |
scapy_bridge_multiprocess.py | # -*- coding: utf-8 -*-
from scapy.all import conf
import multiprocessing
def bridge_from_eth0_to_eth1():
eth0_socket = conf.L2socket(iface='eth0')
eth1_socket = conf.L2socket(iface='eth1')
while True:
p = eth0_socket.recv()
if p:
eth1_socket.send(p.original)
def bridge_from... |
CsvTcpSocket.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Brief : Socket相机连接类
@Project :CsvMasterSdk
@File :CsvTcpSocket.py
@Author :HORSETAIL
@Date :2022/2/9 15:49
@Company : Shenzhen Cosmos Vision Tech Co., Ltd
@Copyright: Copyright@Cosmos Vision Tech.All Rights Reserved.
"""
import datetime
import logging
im... |
renderer.py | ##!/usr/bin/env python3
import threading, queue, subprocess, os, sys, yaml, platform, multiprocessing
# from datetime.datetime
from datetime import datetime
startTime = datetime.now()
# import the params file if specified
current_dir = os.getcwd()
config_file = "{}/render_config.yml".format(current_dir)
# some defa... |
collections_drop_recreate_rebalance.py | import threading
import time
import json
from Cb_constants import CbServer
from collections_helper.collections_spec_constants import MetaCrudParams
from bucket_collections.collections_base import CollectionBase
from membase.api.rest_client import RestConnection
from bucket_utils.bucket_ready_functions import BucketUti... |
Factory.py | # -*- coding: utf-8 -*-
## @package JsMVA.Factory
# @author Attila Bagoly <battila93@gmail.com>
# Factory module with the functions to be inserted to TMVA::Factory class and helper functions and classes
import ROOT
from ROOT import TMVA
import sys
if sys.version_info >= (3, 0):
from JsMVA import JPyInterface
el... |
downloader.py | import os
import sys
import multiprocessing as mp
import time
from datetime import timedelta
from types import FunctionType
import requests
import colors
from .page import Page
from . import utils, const
class Downloader:
cli_initialized: bool
terminating: bool
processes: slice
captcha_process: mp.Pr... |
proxy2.py | # -*- coding: utf-8 -*-
#
#
# This code originated from the project https://github.com/inaz2/proxy2 but has since
# been modified extensively.
#
#
import base64
import re
import socket
import ssl
import threading
import urllib.parse
from http.client import HTTPConnection, HTTPSConnection
from http.server import BaseH... |
player.py | import base64
import threading
import xbmc
import xbmcgui
import kodijsonrpc
import colors
from windows import seekdialog
import util
from plexnet import plexplayer
from plexnet import plexapp
from plexnet import signalsmixin
from plexnet import util as plexnetUtil
FIVE_MINUTES_MILLIS = 300000
class BasePlayerHandl... |
drive.py | #!/usr/bin/env python3
"""
The main driver program that loops the live internal state.
"""
import argparse
import logging
from multiprocessing import Event, Process
from pathlib import Path
import time
import derp.util
import derp.brain
import derp.camera
import derp.imu
import derp.joystick
import derp.servo
import de... |
host_callback_test.py | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
halo.py | # -*- coding: utf-8 -*-
# pylint: disable=unsubscriptable-object
"""Beautiful terminal spinners in Python.
"""
from __future__ import absolute_import, unicode_literals
import atexit
import functools
import sys
import threading
import time
import pdm._vendor.halo.cursor as cursor
from pdm._vendor.log_symbols.symbols ... |
screenrec.py | import cv2
import pyautogui
import pyaudio
import numpy as np
from threading import Thread
from screencapture import *
from audiocapture import *
class ScreenRecorder:
def __init__(self):
self.audio = CaptureAudio()
self.video = ScreenCapture()
def startRecoding(self):
t1 = Thread(targ... |
stimpresent-videocapture.py | import numpy, cv2, datetime, threading, time, csv, math
from psychopy import visual, core, event, gui
from psychopy.visual import ShapeStim
experiment_types = ['darkloom', 'brightloom']
## Here, choose the experiment type. 0 = dark looming stimuli; 1 = bright looming stimuli
experiment_type = experiment_types[0]
i... |
proximity.py | # -*- coding: utf-8 -*-
import os, sys
import collections
import itertools
import queue
import threading
import time
from ..core import config, exc, logging, utils
log = logging.logger(__package__)
from . import remote
from . import statistics34 as statistics
from ..sensors import ultrasonic
#
# This controller is tr... |
proccess_respond.py |
from core.speak import voice_assistant_speak
from core.listen import record_audio
import time
import web_browser_control.web_command as webr
import os_functions.manage_dir as manage_dir # use manage directory file
import miscellaneous_functions.weather as weather # use weather file
import miscellaneous_functions... |
test.py | import json
import os.path as p
import random
import subprocess
import threading
import time
from random import randrange
import pika
import pytest
from google.protobuf.internal.encoder import _VarintBytes
from helpers.client import QueryRuntimeException
from helpers.cluster import ClickHouseCluster
from helpers.test_... |
test_browser.py | # coding=utf-8
# Copyright 2013 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
from __future__ import print_function
import argparse
... |
main_Server.py | from time import sleep
import threading
from flask import Flask, render_template, url_for, request, jsonify
import cls_ServerTCP
import logging
log = logging.getLogger('werkzeug')
log.setLevel(logging.ERROR)
cls_TCP = cls_ServerTCP.cls_ServerTCP("127.0.0.1", 500)
cls_TCP.start()
#-----------------------------------... |
backups.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# This is a part of CMSeeK, check the LICENSE file for more information
# Copyright (c) 2018 - 2020 Tuhinshubhra
import threading
import cmseekdb.basic as cmseek
joom_bak_found = 0
joom_backups = []
def check_backup(url,file,ua):
global joom_bak_found, joom_backups
... |
_import.py | #!/usr/bin/env python
'''`rethinkdb import` loads data into a RethinkDB cluster'''
from __future__ import print_function
import codecs, collections, csv, ctypes, json, multiprocessing
import optparse, os, re, signal, sys, time, traceback
from . import ast, errors, query, utils_common
try:
unicode
except NameEr... |
testing_utils.py | """
weasyprint.tests.testing_utils
------------------------------
Helpers for tests.
"""
import contextlib
import functools
import logging
import os.path
import sys
import threading
import wsgiref.simple_server
from weasyprint import CSS, HTML, images
from weasyprint.css import get_all_computed_styles
f... |
run_7za.py | from subprocess import Popen, PIPE
from threading import Thread
from queue import Queue, Empty
def output_parser_7za(proc, q_progress, q_files):
line = b''
# stdout read will only return b'' when the process has ended
while (b := proc.stdout.read(1)) != b'':
# 7za outputs \r (CR) as end of line
... |
old_downloader.py | import socket
import hashlib
import collections
import threading
import sys
import csv
import time
import matplotlib.pyplot as plt
'''
HTTP/1.1 206 Partial Content
Date: Wed, 18 Nov 2020 06:30:10 GMT
Server: Apache/2.4.29 (Ubuntu)
Last-Modified: Mon, 22 Apr 2019 17:44:41 GMT
ETag: "63025a-5872205e3b440"
Accept-R... |
run_func.py | #coding:utf-8
#実行用スクリプト
import chainer
import chainer.links as L
import chainer.functions as F
from chainer import cuda, Variable
from chainer import optimizers
import numpy as np
import data
import time
from PIL import Image
stop_flag = False
#モデル読み込み、初期設定
def run_set_model():
gpu = 0 # 0:gpu使用、-1:gpu不使用
... |
tracking.py | import cv2
from lib import camshift
from lib import meanshift
import configparser
from lib import tellolib
import threading
from time import sleep
import math
from timeit import default_timer as timer
# load configuration
config = configparser.ConfigParser()
config.read('tello.cfg')
resize_prop = eval(config.get('came... |
data.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... |
jenkins_generic_job.py | import CIME.wait_for_tests
from CIME.utils import expect, run_cmd_no_fail
from CIME.case import Case
import os, shutil, glob, signal, logging, threading, sys, re
##############################################################################
def cleanup_queue(test_root, test_id):
######################################... |
network.py | """
Defines network nodes used within core.
"""
import logging
import os
import socket
import threading
import time
from socket import AF_INET, AF_INET6
from core import CoreCommandError, utils
from core import constants
from core.nodes.base import CoreNetworkBase
from core.emulator.data import LinkData
from core.emu... |
Utils.py | import argparse
import multiprocessing
import numpy as np
import os
import time
import zmq
class cd:
"""Context manager for changing the current working directory"""
def __init__(self, newPath):
self.newPath = os.path.expanduser(newPath)
def __enter__(self):
self.savedPath = os.getcwd()
... |
test_send_recv_two_workers.py | import asyncio
import multiprocessing
import os
import random
import cloudpickle
import numpy as np
import pytest
from utils import get_cuda_devices, get_num_gpus, recv, send
from distributed.comm.utils import to_frames
from distributed.protocol import to_serialize
from distributed.utils import nbytes
import cudf.te... |
run_test_package.py | # Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Contains a helper function for deploying and executing a packaged
executable on a Target."""
from __future__ import print_function
import common
import h... |
sbp_logger.py | #!/usr/bin/env python
#https://stackoverflow.com/questions/34337514/updated-variable-into-multiprocessing-python
import rospy
import os
import datetime
import subprocess
import json
import sbp.msg
import sys
import time
from threading import Thread
from multiprocessing import Process, Value
from sbp.client.loggers.ud... |
bootstrap_test.py | import os
import random
import re
import shutil
import tempfile
import threading
import time
import logging
import signal
import uuid
from cassandra import ConsistencyLevel
from cassandra.concurrent import execute_concurrent_with_args
from ccmlib.node import NodeError, TimeoutError, ToolError, Node
import pytest
fro... |
common.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... |
test_compaction.py | import threading
from time import time, sleep
import pytest
from pymilvus.grpc_gen.common_pb2 import SegmentState
from base.client_base import TestcaseBase
from common import common_func as cf
from common import common_type as ct
from common.common_type import CaseLabel, CheckTasks
from utils.util_log import test_log... |
Robot.py | import cozmo
import logging
import threading
import asyncio
from time import sleep
class Robot:
robot = -1
_startOn = -1
dbg = False
log = -1
fileRecorders = {}
asyncTasks = []
# set by self.start(...)
robot = None # cozmo.robot.Robot
_startOn = None # callable
# built... |
test_do_not_complete_on_return_complete.py | import asyncio
import threading
from datetime import timedelta
from time import sleep
import pytest
from temporal.activity import Activity
from temporal.workflow import workflow_method, WorkflowClient, Workflow
from temporal.activity_method import activity_method
TASK_QUEUE = "test_async_do_not_complete_on_return_co... |
app.py | import os
import json
import tweepy
from tweepy import OAuthHandler
from tweepy import Stream
from tweepy.streaming import StreamListener
from dotenv import load_dotenv
from flask import Flask, render_template
from threading import Thread
from shapely.geometry import mapping, shape
from flask_socketio import SocketIO
f... |
mpirun_exec_fn.py | # Copyright 2018 Uber Technologies, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
async_api_multi-threads.py | #!/usr/bin/env python3
import cv2
import os
import sys
import time
import numpy as np
from openvino.inference_engine import IENetwork, IEPlugin
from multiprocessing import Process, Queue
import multiprocessing
import threading
import queue
def async_infer_worker(exec_net, image_queue, input_blob, out_blob):
glob... |
couple.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from subprocess import PIPE, Popen
from .. import arg, Unit, RefineryPartialResult
from ..strings.cfmt import ByteStringWrapper
class couple(Unit):
"""
Turns any command into a refinery unit. Data is processed by feeding it to the standard input of a... |
manager.py | #!/usr/bin/env python3
import datetime
import importlib
import os
import sys
import fcntl
import errno
import signal
import shutil
import subprocess
import textwrap
import time
import traceback
from multiprocessing import Process
from typing import Dict
from common.basedir import BASEDIR
from common.spinner import Sp... |
runner.py | import asyncio
import concurrent.futures
import contextlib
import threading
import types
from typing import cast, Any, Optional, Tuple, Type, TYPE_CHECKING
import click.testing
from typing_extensions import Literal
from kopf import cli
_ExcType = BaseException
_ExcInfo = Tuple[Type[_ExcType], _ExcType, types.Traceba... |
engine.py | """
"""
import logging
from logging import Logger
import smtplib
import os
from abc import ABC
from datetime import datetime
from email.message import EmailMessage
from queue import Empty, Queue
from threading import Thread
from typing import Any, Type, Dict, List, Optional
from vnpy.event import Event, EventEngine
f... |
GA_TSP.py | import math
import timeit
import numpy as np
import random
from threading import Thread
import functools
# 시간제한 데코레이터
def timeout(seconds_before_timeout):
def deco(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
res = [Exception('function [%s] timeout [%s seconds] exceeded!'... |
test_controller.py | from pySOT.experimental_design import SymmetricLatinHypercube
from pySOT.strategy import DYCORSStrategy
from pySOT.surrogate import RBFInterpolant, CubicKernel, LinearTail
from pySOT.optimization_problems import Ackley
from pySOT.controller import CheckpointController
from poap.controller import SerialController
impor... |
cpuFixIndicator.py | #!/usr/bin/env python3
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('AppIndicator3', '0.1')
gi.require_version('Notify', '0.7')
from gi.repository import GLib, Gtk, GObject
from gi.repository import AppIndicator3
from gi.repository import Notify
APPINDICATOR_ID = "cpuFixIndicator"
ICON = "cpu"
AVER... |
test.py | #!/usr/bin/python2
import sys
import json
import urllib2
import threading
import Queue
import glob
import os
import jsonschema
from jsondiff import diff
hdr = { 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
'Accept': 'application/json... |
test_utils.py | # Copyright 2018 The TensorFlow Hub 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 app... |
topic_queue_producer.py | #!/usr/bin/env python
import pika
import uuid
import os
import time
import threading
import logging
MQ_HOST = os.environ.get('MQ_HOST')
# hardcode for testing
MQ_HOST = 'aw-sdx-monitor.renci.org'
class TopicQueueProducer(object):
def __init__(self, timeout, exchange_name, routing_key):
self.logger = logg... |
runtests.py | #!/usr/bin/env python3
"""
Testing dec2flt
===============
These are *really* extensive tests. Expect them to run for hours. Due to the
nature of the problem (the input is a string of arbitrary length), exhaustive
testing is not really possible. Instead, there are exhaustive tests for some
classes of inputs for which ... |
request_manager.py | """
This module implements the request manager functionality.
Job Queue and Processing
^^^^^^^^^^^^^^^^^^^^^^^^
As requests are issued via http to the API a process queue will store all
active jobs. Processes will be created and assume one of the following
states throughout their existence: ::... |
testapp.py |
from threading import Thread
import time
from bokeh.models import ColumnDataSource
from bokeh.plotting import curdoc, figure
from bokeh.models.widgets import RangeSlider, Button, DataTable, TableColumn, NumberFormatter
from bokeh.layouts import column, layout
from tornado import gen
from functools import partial
imp... |
schedule.py | # Python job scheduling for humans.
# An in-process scheduler for periodic jobs that uses the builder pattern for configuration.
# Schedule lets you run Python functions (or any other callable) periodically at pre-determined intervals using a simple,
# human-friendly syntax.
# pip install schedule
# https://schedule... |
helpers.py | # -*- coding: utf-8 -*-
"""
:copyright: Copyright 2013-2017 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
tests.support.helpers
~~~~~~~~~~~~~~~~~~~~~
Test support helpers
"""
from __future__ import absolute_import, print_function, unicode... |
frames.py | import threading
import time
import tkinter as tk
import traceback
from tkinter import filedialog
from tkinter import messagebox
from tkinter import ttk
import psutil
from sharkpylib.tklib import tkinter_widgets as tkw
from svepa import exceptions as svepa_exceptions
from . import components
from ..saves import Save... |
celery3.py | #from celery import Celery
from celery.decorators import task
from celery.decorators import periodic_task
from celery.task.schedules import crontab
#app = Celery('hello', broker='amqp://guest@localhost//')
@task
def hello():
print('123')
def foo():
print('Start!')
hello()
from multiprocessing import Process
... |
infeed_test.py | # Copyright 2019 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, ... |
test_reservation.py | import threading
import unittest
from tensorflowonspark.reservation import Reservations, Server, Client
class ReservationTest(unittest.TestCase):
def test_reservation_class(self):
"""Test core reservation class, expecting 2 reservations"""
r = Reservations(2)
self.assertFalse(r.done())
# add first ... |
netview.py | #!/usr/bin/env python
# SECUREAUTH LABS. Copyright 2018 SecureAuth Corporation. All rights reserved.
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# Author:
# beto (@agsolino)
#
# Description:
# The ... |
serve.py | # Copyright (c) 2020 PaddlePaddle 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... |
DependencyNodeTest.py | ##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted ... |
info.py | import time
from datetime import datetime
from datetime import timedelta
import requests
import threading
import os
import praw
import pygame
import pgx
from reference import references
"""
Ideas:
Break down activity over weekdays
"""
# object to get and store all of the information on the selected redditor
class I... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.