source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
build_mscoco_data.py | # Copyright 2016 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... |
car_helpers.py | import os
import threading
import requests
from common.params import Params, put_nonblocking
from common.basedir import BASEDIR
from selfdrive.version import comma_remote, tested_branch
from selfdrive.car.fingerprints import eliminate_incompatible_cars, all_known_cars
from selfdrive.car.vin import get_vin, VIN_UNKNOWN
... |
test_base_events.py | """Tests for base_events.py"""
import errno
import logging
import math
import os
import socket
import sys
import threading
import time
import unittest
from unittest import mock
import asyncio
from asyncio import base_events
from asyncio import constants
from asyncio import events
from test.test_async... |
vmsh.py | #!/usr/bin/env python3
import subprocess
import threading
import os
from queue import Queue
from pathlib import Path
from nix import notos_image
from typing import Union, Any, Callable, List, Optional, Dict
from root import PROJECT_ROOT
from shlex import quote
EOF = 1
def cargo_build(target: str = "debug") -> Path:... |
test_multithreads.py | import traceback
import threading
import multiprocessing
import numpy as np
from numba import cuda
from numba.cuda.testing import skip_on_cudasim, SerialMixin
import unittest
try:
from concurrent.futures import ThreadPoolExecutor
except ImportError:
has_concurrent_futures = False
else:
has_concurrent_futur... |
queues-with-multiprocess.py | # Process
# Implement queues
# dishes.py
import multiprocessing as mp
import os
def washer(dishes, queue):
print("Process %s (washer)" % (os.getpid()))
for dish in dishes:
print('Washing', dish, 'dish')
queue.put(dish)
def dryer(queue):
print("Process %s (dryer)" % (os.getpid()))
whi... |
util.py | #
# Copyright (C) 2012-2021 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import codecs
from collections import deque
import contextlib
import csv
from glob import iglob as std_iglob
import io
import json
import logging
import os
import py_compile
import re
import socket
try:
import ssl
... |
client.py | # Copyright (c) 2012-2014 Roger Light <roger@atchoo.org>
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# and Eclipse Distribution License v1.0 which accompany this distribution.
#
# The Eclipse Public License is available at
... |
monitor.py | from collections import defaultdict
from inspect import signature
import json
import re
import threading
import time
import uuid
import requests
from requests import HTTPError
from .collection import Collection
from .logger import logger
from .records import Record
class Monitor(object):
thread = None
def... |
bootstrap.py | # Released under the MIT License. See LICENSE for details.
"""Initial ba bootstrapping."""
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from typing import Any, TextIO, Callable, List
def _ballistica_bootstrap() -> object:
import sys
import signal
import _ba
... |
gym_environment.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from multiprocessing import Process, Pipe
import numpy as np
import cv2
import gym
from environment import environment
COMMAND_RESET = 0
COMMAND_ACTION = 1
COMMAND_TERMINATE = 2... |
lyric.py | import threading
from time import sleep
import pygame
# TODO, 重构,增加歌词加载功能
from settings import LYRIC_PATH
class Lyric(object):
def __init__(self, app):
self.app = app
self.lyric = {}
self.sentence = ''
def min_to_sec(self, min):
if min == '' or min is None:
pass
... |
timeout.py | #!/usr/bin/env python
from multiprocessing import Process, Queue
from time import sleep
def query_fun_example(query, out_q):
sleep(0.5)
out_q.put(query)
def run_with_timeout(func, timeout_sec, args, kwargs):
"""Runs a function with time limit
:param func: The function to run
:param args: The... |
target_bigquery.py | #!/usr/bin/env python3
import argparse
import io
import sys
import json
import logging
import collections
import threading
import http.client
import urllib
import pkg_resources
from jsonschema import validate
import singer
from oauth2client import tools
from tempfile import TemporaryFile
from google.cloud import bi... |
main.py | # Keylogger
# DISCLAIMER.
# TO BE USED FOR EDUCATIONAL PURPOSES ONLY.
# This tool can and should only be used with written consent of the owner of the system it is being run on.
# Using this tool for any other use is ILLEGAL.
# The developer assumes NO liability and is NOT RESPONSIBLE for any damage caused by th... |
jobs_processing.py | #!/usr/bin/env python
r"""
This module contains keyword functions to support multiprocessing
execution of keywords where generic robot keywords don't support.
"""
from robot.libraries.BuiltIn import BuiltIn
from multiprocessing import Process, Manager
import os
import gen_print as gp
##############################... |
ticker.py | # -*- coding: utf-8 -*-
"""
ticker.py
Websocket implementation for kite ticker
:copyright: (c) 2017 by Zerodha Technology.
:license: see LICENSE for details.
"""
import six
import sys
import time
import json
import struct
import logging
import threading
from datetime import datetime
from twisted.inter... |
main.py |
import os
from licensing.models import *
from licensing.methods import Key, Helpers
from PIL import Image, ImageFont, ImageDraw
import sys
import time
from colorama import Fore, Back, Style, init
import shutil
import sys
import os
import requests
import shutil
from bs4 import BeautifulSoup
from requests import get
... |
aws_service_health_dashboard.py | #!/bin/env python
import re
import calendar
import dateutil.parser
import feedparser
import threading
import time
import urllib2
import argparse
import json
import socket
import struct
from HTMLParser import HTMLParser
class AWSSHDParser(HTMLParser):
def __init__(self,
base_url,
... |
stt_datagenerator.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... |
policy_server_input.py | import logging
import queue
import threading
import traceback
from http.server import SimpleHTTPRequestHandler, HTTPServer
from socketserver import ThreadingMixIn
import ray.cloudpickle as pickle
from ray.rllib.offline.input_reader import InputReader
from ray.rllib.env.policy_client import PolicyClient, \
create_... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... |
core.py | from ctypes import *
from OpenGL.GL import *
from PIL import Image
from math import copysign
from .matrix import Matrix
from . import glfw
from . import util
import cPickle as pickle
import os
import Queue
import threading
import time
def delete_all(obj):
'''Calls `delete()` on all members of `obj` that are recogn... |
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... |
standalone.py | #
# Copyright Cloudlab URV 2020
#
# 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... |
test_arpack.py | from __future__ import division, print_function, absolute_import
__usage__ = """
To run tests locally:
python tests/test_arpack.py [-l<int>] [-v<int>]
"""
import threading
import itertools
import numpy as np
from numpy.testing import (assert_allclose, assert_array_almost_equal_nulp,
as... |
quickstart.py | # -*- mode: python; encoding: utf-8 -*-
#
# Copyright 2013 Jens Lindström, Opera Software ASA
#
# 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... |
run_engine.py | import asyncio
from datetime import datetime
import sys
from warnings import warn
from inspect import Parameter, Signature
from itertools import count
from collections import deque, defaultdict, ChainMap
from enum import Enum
import functools
import inspect
from contextlib import ExitStack
import threading
import weakr... |
threadtest2.py | import random
import threading
import time
from modules.alarm import NBAlarm
rng = random.SystemRandom(time.time())
def generate_random_list(num_range=10, list_size=10):
return [rng.randrange(num_range) for _ in range(list_size)]
def shuffle(orig_list):
return random.sample(orig_list, k=len(orig_list))
... |
A3C_continuous_action.py | """
Asynchronous Advantage Actor Critic (A3C) with continuous action space, Reinforcement Learning.
The Pendulum example.
View more on my tutorial page: https://morvanzhou.github.io/tutorials/
Using:
tensorflow r1.3
gym 0.8.0
"""
import multiprocessing
import threading
import tensorflow as tf
import numpy as np
imp... |
ant-v2.py | import os, sys, signal
import random
import numpy as np
from multiprocessing import Process, Queue, current_process, freeze_support
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--pgmorl', default=False, action='store_true')
parser.add_argument('--ra', default=False, action='store_true')
pars... |
test23.py | from threading import local, Thread, get_ident
import time
# 内置local实现
obj = local()
def task(arg):
# 执行后的值全部是一样的
# global obj
# obj = arg
# 线程中执行时,为每一个线程开辟空间存储其值
obj.value = arg
time.sleep(2)
# print(obj)
print(obj.value)
print(get_ident())
for i in range(10):
t = Thread(ta... |
test_api.py | #!/usr/bin/python
##############################################################################
# Copyright 2016-2017 Rigetti Computing
#
# 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 ... |
localizers.py | #!/usr/bin/env python
"""
Module containing localization interfaces for motion capture, indoor
localization, etc.
"""
from __future__ import division
from threading import Thread, Event
import rospy
from svea.states import VehicleState
__license__ = "MIT"
__maintainer__ = "Tobias Bolin, Frank Jiang"
__email__ = "tbo... |
basehandler.py | from abc import ABCMeta, abstractmethod
# from time import sleep
from threading import Thread
from covertutils.helpers import defaultArgMerging
class BaseHandler :
"""
Subclassing this class and overriding its methods automatically creates a threaded handler.
"""
__metaclass__ = ABCMeta
Defaults = {
'start' :... |
test_driver.py | import threading
import unittest
import cupy
from cupy.cuda import driver
class TestDriver(unittest.TestCase):
def test_ctxGetCurrent(self):
# Make sure to create context.
cupy.arange(1)
self.assertNotEqual(0, driver.ctxGetCurrent())
def test_ctxGetCurrent_thread(self):
# Mak... |
fid_api.py | from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import argparse
import logging
import socket
import threading
import time
import colorlog
import requests
from plexapi.server import PlexServer
handler = colorlog.St... |
OptimizeRasters.py | # ------------------------------------------------------------------------------
# Copyright 2016 Esri
# 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/LICEN... |
run.py | from bot import Bot
from game_recovery import GameRecovery
from game_stats import GameStats
from health_manager import HealthManager
from death_manager import DeathManager
from screen import Screen
from logger import Logger
import keyboard
import os
from config import Config
from utils.graphic_debugger import run_graph... |
vanity_address.py | from collections import namedtuple
from multiprocessing import Event, Process, Queue
from typing import Callable, Generator
from vanity_address.coins.bitcoin import PublicKey, PrivateKey, PrivateKeyGenerator, SecretsRNG
VanityAddress = namedtuple('VanityAddress', ['address', 'private_key'])
class VanityAddressGenera... |
proxy_crawler.py | #! /usr/bin/python3
# rootVIII
from argparse import ArgumentParser
from re import findall
from random import randint, random
from requests import get
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from sys import exit
from threading import Thread
from time import sleep
class ProxyCrawl... |
depthai_record.py | #!/usr/bin/env python3
from pathlib import Path
from multiprocessing import Process, Queue
from cv2 import VideoWriter, VideoWriter_fourcc
import depthai as dai
class Record:
def __init__(self, path, device) -> None:
self.save = ['color', 'mono']
self.fps = 30
self.device = device
... |
weixin.py | #!/usr/bin/env python
# coding: utf-8
import qrcode
import urllib, urllib2
import cookielib
import requests
import xml.dom.minidom
import json
import time, re, sys, os, random
import multiprocessing
import platform
import logging
from collections import defaultdict
from urlparse import urlparse
from lxml ... |
pubsub.py | from __future__ import absolute_import
import redis
import logging
import random
from django.conf import settings
from threading import Thread
from six.moves.queue import Queue, Full
class QueuedPublisher():
"""
A publisher that queues items locally and publishes them to a
remote pubsub service on a bac... |
PC_Miner.py | #!/usr/bin/env python3
##########################################
# Duino-Coin Python PC Miner (v2.49)
# https://github.com/revoxhere/duino-coin
# Distributed under MIT license
# © Duino-Coin Community 2019-2021
##########################################
# Import libraries
import sys
from configparser import C... |
suspengine.py | import socket
import threading
import json
userdata = {}
clientlist = []
userevents = {}
userdata = {}
use = {}
prev = {}
splitter = "[{//V//}]"
def savevariable(name,data,client):
global userdata
userdata[str(client)][name] = data
def callvariable(name,client):
global userdata
if name in userdata... |
socket.py | import subprocess
import threading
class Socket():
def __init__(self, sck, engine):
self.socket = sck
self.engine = engine
self.stop = threading.Event()
self.alive = True
self.listener = threading.Thread(target=self.recv_thread)
self.listener.daemon = True
... |
test.py | import threading
import time
import queue
a = 0
b = 0
que = queue.Queue( 5 )
def f():
global a, b, que
while a < 10:
if not que.full():
a += 1
b += 2
time.sleep( 1 )
print( "1-", a, b )
que.put( b, False )
def g():
global a, b, que
w... |
cleanup.py | import tempfile
import argparse
import logging
import datetime
import threading
import os
from ocs_ci.framework import config
from ocs_ci.ocs.constants import CLEANUP_YAML, TEMPLATE_CLEANUP_DIR
from ocs_ci.utility.utils import run_cmd
from ocs_ci.utility import templating
from ocs_ci.utility.aws import AWS
from ocs_ci... |
monitor.py |
import sys
sys.path.append(r"/home/anoldfriend/OpenFOAM/anoldfriend-7/utilities/")
import signal
import multiprocessing as mp
import time
from residual_monitor import read_residuals,plot_multiple_residuals,quit
log="run.log"
pressure_name="p_rgh"
nCorrectors=2
interval=1
sample_size=200
m_residuals=[["e"],["Ux","U... |
yunbi.py | from befh.restful_api_socket import RESTfulApiSocket
from befh.exchanges.gateway import ExchangeGateway
from befh.market_data import L2Depth, Trade
from befh.util import Logger
from befh.instrument import Instrument
from befh.clients.sql_template import SqlClientTemplate
from functools import partial
from datetime impo... |
conftest.py | # Copyright The PyTorch Lightning team.
#
# 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 i... |
query_responsecode.py |
from __future__ import print_function
import boto3
from boto3.dynamodb.conditions import Key, Attr
import time
import sys
import argparse
import threading
from multiprocessing import Queue
from lab_config import boto_args
queue = Queue()
def query_responsecode_shard(tableName, shardid, responsecode, date="all"):
... |
updater.py | #!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2018
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... |
nums_xgb.py | import logging
import time
import uuid
from threading import Thread
from typing import Dict
import numpy as np
import xgboost as xgb
import nums.numpy as nps
from nums.core.application_manager import instance as _instance
from nums.core.array.application import ArrayApplication
from nums.core.array.blockarray import ... |
MTGCardFinder.py | from selenium import webdriver
from selenium.common.exceptions import TimeoutException
import threading
import time
import os
FACE_TO_FACE = "https://www.facetofacegames.com/products/multi_search"
WIZARDS_TOWER = "https://kanatacg.crystalcommerce.com/products/multi_search/"
PATH = os.path.dirname(os.path.realpath(__f... |
test_integrations_kinesis.py | # import unittest
# import shlex
# import subprocess
# import boto3
# import requests
# import os
# import time
# import json
# from datetime import datetime, timedelta
# import decimal
#
# from http.server import BaseHTTPRequestHandler, HTTPServer
# import socket
# from threading import Thread
# from botocore.exceptio... |
tdvt.py | """
Test driver script for the Tableau Datasource Verification Tool
"""
import sys
if sys.version_info[0] < 3:
raise EnvironmentError("TDVT requires Python 3 or greater.")
import argparse
import glob
import json
import pathlib
import queue
import shutil
import threading
import time
import zipfile
from pathl... |
testplus.py | #
# The contents of this file are subject to the Mozilla Publics
# License Version 1.1 (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.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis... |
_optimize.py | from concurrent.futures import FIRST_COMPLETED
from concurrent.futures import Future
from concurrent.futures import ThreadPoolExecutor
from concurrent.futures import wait
import copy
import datetime
import gc
import itertools
import math
import os
import sys
from threading import Event
from threading import Thread
from... |
TargetManager.py | ##############################################################################
# Copyright (c) 2016 Intel 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... |
test_file2k.py | import sys
import os
import unittest
import itertools
import time
from array import array
from weakref import proxy
try:
import threading
except ImportError:
threading = None
from test import test_support
from test.test_support import TESTFN, run_unittest
from UserList import UserList
class Au... |
repair_test.py | import os
import os.path
import threading
import time
import re
import pytest
import logging
from collections import namedtuple
from threading import Thread
from cassandra import ConsistencyLevel
from cassandra.query import SimpleStatement
from ccmlib.node import ToolError
from dtest import FlakyRetryPolicy, Tester,... |
recorder.py | #!/usr/bin/python3
import os
import sys
import time
import math
import shutil
import logging
import zipfile
import matplotlib.pyplot as plt
import multiprocessing as mp
import PySimpleGUI as sg
import numpy as np
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
def create_trace_file(dirnam... |
test_stream_buffer.py | from base import pipeline, clean_db
import threading
def test_stream_buffer(pipeline, clean_db):
"""
Run CQs which take different times to process an event in the stream buffer
and each stream is read by a disjoint set of CQs.
"""
pipeline.create_stream('stream1', x='int', string='text')
pipeline.create_s... |
subproc_vec_env.py | """
Helper functions to make a vector environment.
Code modified based on
https://github.com/openai/baselines/blob/master/baselines/common/vec_env/subproc_vec_env.py
"""
import multiprocessing as mp
import numpy as np
from util.vec_env import VecEnv, CloudpickleWrapper, clear_mpi_env_vars
def worker(remote, paren... |
index.py | # -*- coding: utf8 -*-
from threading import Thread
from activity.unicom.dailySign import SigninApp
from activity.unicom.integralTask import IntegralTask
from activity.unicom.watchAddFlow import WatchAddFlow
from activity.unicom.superSimpleTask import SuperSimpleTask
from activity.unicom.unicomTurnCard import TurnCard... |
http.py | from __future__ import print_function
from builtins import str
from builtins import object
import logging
import base64
import sys
import random
import string
import os
import ssl
import time
import copy
import json
import sys
import threading
from pydispatch import dispatcher
from flask import Flask, request, make_res... |
4-5-mtsleepD.py | #!/usr/bin/env python
import threading
from time import sleep, ctime
loops = [4, 2]
class ThreadFunc(object):
def __init__(self, func, args, name):
self.name = name
self.func = func
self.args = args
def __call__(self):
self.func(*self.args)
def loop(nloop, nsec):
pr... |
person_query.py | #!/bin/python3
import time
import multiprocessing
import random
import argparse
from memsql.common import database
ERROR = "***ERROR***"
DEBUG = False
NL = "\n"
#DEFAULT_AGGS = "172.31.57.177:3306,172.31.59.251:3306,172.31.53.236:3306"
DEFAULT_AGGS = "127.0.0.1:3306"
#get arguments
parser = argparse.ArgumentParser(... |
thread_pool.py | # !/usr/bin/env python
# -*- coding: utf-8 -*-
# author: humingk
# ----------------------
import time
from threading import Thread, currentThread
from queue import Queue
from my_tools.logger_tool import loggler_tool
logger = loggler_tool()
# 线程停止标志
stop_task = object()
class thread_pool:
"""
线程池类(弃用,改用futu... |
wise_data.py | import os, subprocess, copy, json, argparse, tqdm, time, threading, math, queue, pickle, getpass, requests
import multiprocessing as mp
import pandas as pd
import numpy as np
import pyvo as vo
from astropy.io import ascii
import astropy.units as u
from astropy.table import Table
import matplotlib.pyplot as plt
from td... |
slim_client_img.py | # -*- coding: utf-8 -*-
import os
import threading
import gc
from time import time, sleep
import numpy as np
import cv2
import wx
from slim_face import SlimFace
global_fps = 24
os.environ["UBUNTU_MENUPROXY"]="0"
class ImagePanel(wx.Panel):
def __init__(self, parent, size):
super(ImagePanel, self).__in... |
matmul_multithread.py | import os
os.environ["OMP_NUM_THREADS"] = "24" # TODO: Play with this for best performance
import numpy as np
from time import perf_counter as time
import threading
NMATRICES = 8
MATRIX_SIZES = [512, 4096]
small_mats = [np.random.rand(MATRIX_SIZES[0], MATRIX_SIZES[0]) for i in range(NMATRICES)]
large_mats = []
large... |
cluster_install_dev_multi.py | #!/usr/local/bin/python3
# Author: Adrian Bronder
# Date: October 15th, 2018
# Description: Cluster setup + configuration based on JSON input
from threading import Thread
import sys
import time
import json
sys.path.append("./NetApp")
from NaServer import *
def print_usage():
print("\nUsage: " + __file__ + " <c... |
wuxia.py | # coding=utf-8
__all__ = ['MODE', 'press', 'release']
import threading
import general
import force.core
import force.mouseInfo
from . import general_lib
from . import normal
MODE = 'wuxia'
__hwnd = None
__mouse_x, __mouse_y = 0, 0
__rush_flags = False
def press() -> dict:
result = {
'0002*... |
member_single.py | import logging
from network import Node
from statemachine import sequence_generator
# Remove from final copy:
# - logging
class Member(Node):
def __init__(self):
Node.__init__(self)
def start(self, execute_fn, initial_value=None):
self.execute_fn = execute_fn
self.state = initial_v... |
naive_attack.py | import argparse
import os
import time
import traceback
from pathlib import Path
import threading
import fnfqueue
from scapy.layers.inet import IP, TCP
from scapy.packet import Raw
from dhalsim.network_attacks.utilities import launch_arp_poison, restore_arp, \
translate_payload_to_float, translate_float_to_payload... |
test_python_script_runner.py | import json
import pytest
import random
import threading
from script_runner import PythonVersion
from script_runner import PythonScriptRunner
@pytest.mark.python_script_runner
def test_python_version_1():
assert PythonVersion.PYTHON_0_9 < PythonVersion.PYTHON_2_3
assert PythonVersion.PYTHON_2_7 >= PythonVers... |
interactiveConsole.py | import sys
from threading import Thread
from time import sleep
from dota2comm import Dota2Comm
class InteractiveConsole():
def __init__(self, name):
self.name = name
self.dota = Dota2Comm(self.name)
def StartThreads(self):
self.running = True
self.threadrecv = Thread(targe... |
test_subprocess.py | import unittest
from unittest import mock
from test import support
import subprocess
import sys
import signal
import io
import itertools
import os
import errno
import tempfile
import time
import traceback
import types
import selectors
import sysconfig
import select
import shutil
import threading
import gc
import textwr... |
tasks.py | from __future__ import absolute_import
import json
import logging
from datetime import datetime
from threading import Thread
from tornado import web
from tornado import gen
from tornado.escape import json_decode
from tornado.web import HTTPError
from celery import states
from celery.result import AsyncResult
from c... |
ssh.py | #!/usr/bin/env python
"""
DMLC submission script by ssh
One need to make sure all slaves machines are ssh-able.
"""
from __future__ import absolute_import
import os, subprocess, logging
from threading import Thread
from . import tracker
def sync_dir(local_dir, slave_node, slave_dir):
"""
sync the working dir... |
tasks.py | import math
import pytz
import logging
from datetime import datetime, timedelta
from celery.task import task
from time import sleep
from redis_cache.cache import RedisCache
from corehq.apps.sms.mixin import SMSLoadBalancingMixin
from corehq.apps.sms.models import SMSLog, OUTGOING, INCOMING
from corehq.apps.sms.api impo... |
train.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import caffe
import os
import argparse
import moxing as mox
import multiprocessing
import time
import logging
TRAIN_BASE_PATH = "/home/work/user-job-dir/"
def save_inter_model(src_url, dst_url, interval=10):
save_num = 1
while True:
time.sleep(interval * ... |
main.py | # -*- coding: utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the... |
Pong.py | #author: Alex Vorhies
#date: 11/10/15
#description: The Driver class for a Pong game
#import processes required for boing.wav to work
import subprocess
import threading
#importing the classes needed for this class to work
from Paddle import *
from Ball import *
from tkinter import *
class Pong:
def __init__(self)... |
deploy_ovf.py | #!/usr/bin/env python
"""
Written by Tony Allen
Github: https://github.com/stormbeard
Blog: https://stormbeard.net/
This code has been released under the terms of the Apache 2 licenses
http://www.apache.org/licenses/LICENSE-2.0.html
Script to deploy VM via a single .ovf and a single .vmdk file.
"""
from os impor... |
test_uds_msgpackrpc.py | '''
@author: hvishwanath | harish.shastry@gmail.com
'''
from msgpackrpc.transport import uds
from time import sleep
import threading
try:
import unittest2 as unittest
except ImportError:
import unittest
import helper
import msgpackrpc
from msgpackrpc import error
class TestMessagePackRPC(unittest.TestCase):
... |
003.py | import time
from multiprocessing import Process
def sleep_func():
print('Sleeping for a 1 second')
time.sleep(1)
print('Done.')
if __name__ == '__main__':
time_start = time.time()
process_1 = Process(target=sleep_func)
process_2 = Process(target=sleep_func)
process_3 = Process(target=sl... |
pipeline_app.py | import sys
import traceback
import threading
from queue import Queue
import numpy
import cv2
import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst, GObject, GLib
pipelineOutputQueue = Queue()
def extract_data(sample):
buf = sample.get_buffer()
caps = sample.get_caps()
# ref: ge... |
peripherals.py | import logging
import math
import traceback
from struct import pack, unpack
from threading import Thread
from pylgbst.messages import MsgHubProperties, MsgPortOutput, MsgPortInputFmtSetupSingle, MsgPortInfoRequest, \
MsgPortModeInfoRequest, MsgPortInfo, MsgPortModeInfo, MsgPortInputFmtSingle
from pylgbst.utilities... |
background_caching_job.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 us... |
python_instance.py | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "... |
stats.py | import json
import re
from threading import Thread
import time
import gzip
from collections import defaultdict
import logging
import logging.config
from uuid import uuid4
from itertools import cycle
from lib.membase.api.exception import SetViewInfoNotFound, ServerUnavailableException
from lib.membase.api.rest_client i... |
sample.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import VizexecLogWriter as vze
import threading
import time
gMessageBuf = None
gAckBuf = None
#------------------------------------------------------------------------------
# Functions for ProcessThread
#-------------------------------------------------------------------... |
test_execute.py | import asyncio
import tempfile
import time
from threading import Thread
import dagster_pandas as dagster_pd
import pytest
from dagster import (
DagsterUnmetExecutorRequirementsError,
InputDefinition,
ModeDefinition,
execute_pipeline,
execute_pipeline_iterator,
file_relative_path,
fs_io_mana... |
__init__.py | """
Entry Points for Hyde Engine
"""
import imp
import mimetypes
import os
import sys
import subprocess
import traceback
import urllib
from collections import defaultdict
from Queue import Queue, Empty
from threading import Thread, Event
from django.conf import settings
from django.template import add_to_builtins
... |
encoder.py | import os
import time
import torch
import ujson
import numpy as np
import itertools
import threading
import queue
from colbert.modeling.inference import ModelInference
from colbert.evaluation.loaders import load_colbert
from colbert.utils.utils import print_message
from colbert.indexing.index_manager import IndexMan... |
couchapy_logger.py | from couchapy import CouchDB, CouchError
from datetime import datetime
from queue import Queue, Empty
import threading
import signal
import uuid
from pprint import pprint
class Logger():
"""
Threaded logging to couchdb database
"""
__allowed_keys = ['config', 'db_conn']
__SLEEP_TIME_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.