source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
test_demos.py | import multiprocessing
import os
import random
import time
import unittest
import requests
from matplotlib.testing.compare import compare_images
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui... |
test_gtp_wrapper.py | from interface.gtp_wrapper import run_gtp
from multiprocessing import Process
from AlphaGo import go
import unittest
class PassPlayer(object):
def get_move(self, state):
return go.PASS_MOVE
class TestGTPProcess(unittest.TestCase):
def test_run_commands(self):
def stdin_simulator():
... |
worker.py | import os
import sys
import json
import platform
import socket
import signal
import logging
import logging.config
import threading
import traceback
import argparse
import multiprocessing
from time import monotonic
from typing import Dict, Any, List, Tuple, Type, Optional # noqa
import amqp
from kuyruk import importe... |
test_capi.py | # Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
from __future__ import with_statement
import os
import pickle
import random
import subprocess
import sys
import time
import unittest
from test import support
try:
imp... |
init.py | import asyncio
from operator import indexOf
from src.websocket import server
import threading
from pyngrok import ngrok
import websockets
from flask import Flask
from src.http_server import app
from src.dc import bot
import logging
import click
import json
from src.logger import consoleLog
from src.input import Input
i... |
functions.py | #!/usr/bin/env python
# coding=utf-8
"""
Utility functions for better functional programming, and other general purpose
functions.
Note: more basic ones can be found in toolz
"""
from __future__ import absolute_import
import multiprocessing
import sys
import traceback
import re
from six.moves import reduce
from too... |
__init__.py | from threading import Thread
import tkinter as tk
import tkinter.messagebox as messagebox
from ficdl import __version__, __version_info__
from ficdl.gui.converter import Converter
from ficdl.gui.downloader import Downloader
from ficdl.gui.preferences import Preferences
from ficdl.gui.subscription_manager import Subscr... |
AgentCodeAPI.py | import threading
from agent import Agent
class api(object):
def __init__(self):
self.agents = []
def runAgentsAndRetrive(self, numberOfAgents=5, numberOfSteps=50):
for i in range(numberOfAgents):
self.agents.append(Agent())
for x in range(numberOfSteps):
threa... |
sdp.py | # -*- coding: utf-8 -*-
"""
Simple Data Protocol
Date: 9.11.2017
@author: Domen Jurkovic
@source http://damogranlabs.com/, https://github.com/damogranlabs
"""
import sys
import threading
import time as systime
import crcmod
import serial
__version__ = 1.1
############################################################... |
ssh.py | from scp import SCPClient
import threading
from binascii import hexlify
import getpass
import os
import socket
import sys
import random
import string
import hashlib
from cryptography.fernet import Fernet
from paramiko.py3compat import input
import paramiko
import pickle
import time
class SSH(object):
def __init__... |
test_cache.py | import errno
import multiprocessing
import os
import timeit
from subprocess import CalledProcessError
import numpy as np
from numpy.testing import assert_equal
import pytest
import nengo
from nengo.cache import (CacheIndex, DecoderCache, Fingerprint,
get_fragment_size, WriteableCacheIndex)
fr... |
vocal_client.py | import threading
import voice
from client_socket import ClientSocket
def voice_command(clientsocket):
"""Show available commands and send user choice to the server.
This function will (until terminated by the user) show the available
set of commands provided by the application. It then will call another
... |
Client.py | from __future__ import print_function, division
import queue
import random
import numpy as np
import os
import requests
import yfinance as yf
import matplotlib.pyplot as plt
import datetime
from datetime import datetime, timedelta
import pandas as pd
import torch
import torch.nn as nn
import torch.nn.fun... |
exch_gdax.py | from befh.restful_api_socket import RESTfulApiSocket
from befh.ws_api_socket import WebSocketApiClient
from befh.market_data import L2Depth, Trade
from befh.exchange import ExchangeGateway
from befh.instrument import Instrument
from befh.sql_client_template import SqlClientTemplate
from befh.util import Logger
import t... |
tracing_backend.py | # Copyright 2013 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.
import cStringIO
import json
import logging
import socket
import threading
from telemetry.core.backends.chrome import trace_result
from telemetry.core.backe... |
powcoin.py | """
POWCoin
Usage:
powcoin.py serve
powcoin.py ping [--node <node>]
powcoin.py tx <from> <to> <amount> [--node <node>]
powcoin.py balance <name> [--node <node>]
Options:
-h --help Show this screen.
--node=<node> Hostname of node [default: node0]
"""
import uuid, socketserver, socket, sys, argparse,... |
jobs.py | # coding=utf8
from __future__ import unicode_literals, absolute_import
import copy
import datetime
import sys
import threading
import time
if sys.version_info.major >= 3:
unicode = str
basestring = str
py3 = True
else:
py3 = False
try:
import Queue
except ImportError:
import queue as Queue
... |
py_utils.py | # Lint as: python3
# 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 ... |
TFC_3D.py | import sys
import jax.numpy as np
import numpy as onp
import matplotlib.pyplot as plt
import pykep as pk
import time
import pandas as pd
import streamlit as st
import random
import utils
import time
import queue
from tqdm import tqdm
from tfc ... |
gpssim.py | ''' GPS Simulation Library
The simulation library has two main classes:
ModelGnssReceiver - model and view of the GNSS receiver data
GpsSim - simulation server that runs the model
Typical usage would instantiate a new GpsSim instance,
providing a custom ModelGnssReceiver instance as an input argument.
See __main__ fo... |
cli.py | import collections
import csv
import multiprocessing as mp
import os
import datetime
import sys
from pprint import pprint
import re
import ckan.logic as logic
import ckan.model as model
import ckan.include.rjsmin as rjsmin
import ckan.include.rcssmin as rcssmin
import ckan.lib.fanstatic_resources as fanstatic_resources... |
final_eval_server.py | from tkinter import *
import socket
import sys
import server_auth
import random
import time
import threading
import os
import pandas as pd
class server:
def __init__(self, ip_addr, port_num):
global action
global action_set_time
# init server
self.auth = server_auth.server_auth()
... |
SpotifyDownloader.py | import sys
from threading import Thread
from os import system
try:
import spotdl
except:
if input("spotdl not found, Download Now? (y/n): ").lower() == 'y':
system('pip install -U spotdl')
else:
sys.exit()
from spotdl.authorize.services import AuthorizeSpotify
from spotdl import... |
infer_wsi.py | # added for girder interaction as plugin arbor task
from girder_worker.app import app
from girder_worker.utils import girder_job
from tempfile import NamedTemporaryFile
# declared for subprocess to do GPU stuff. Package 'billiard' comes with celery
# and is a workaround for subprocess limitations on 'daemonic' proces... |
Reference.py | import wx
import threading
from leginon.gui.wx.Choice import Choice
from leginon.gui.wx.Entry import FloatEntry
import leginon.gui.wx.Node
import leginon.gui.wx.Settings
import leginon.gui.wx.ToolBar
class SettingsDialog(leginon.gui.wx.Settings.Dialog):
def initialize(self):
return ScrolledSettings(self,self.scrsi... |
streaming_puppet.py | from multiprocessing import Process, Queue
import time
import serial
import numpy
import pandas as pd
from scipy import signal
from scipy import fftpack
import math
def sync_to_uq(ser):
"""
Aligns the serial port read to the next 'UQ' header at the start of a data frame.
:type ser: pySerial Serial object... |
robot.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# Author : cold
# E-mail : wh_linux@126.com
# Date : 14/01/16 11:33:32
# Desc : SimSimi插件
#
import json
from tornadohttpclient import TornadoHTTPClient
import config
from smartrobot import Searcher
from plugins import BasePlugin
class SimSimiTa... |
test_api.py | import multiprocessing
import os
import signal
import pytest
from pkgcheck import PkgcheckException, scan
from pkgcheck import objects
class TestScanApi:
@pytest.fixture(autouse=True)
def _setup(self, testconfig):
self.base_args = ['--config', testconfig]
self.scan_args = ['--config', 'no', ... |
test_socket_manager.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import time
import uuid
from unittest import mock
from parlai.mturk.core.socket_manager import Packet, S... |
datasetsCustom.py | import glob
import math
import os
import random
import shutil
import time
from pathlib import Path
from threading import Thread
import cv2
import numpy as np
import torch
from PIL import Image, ExifTags
from torch.utils.data import Dataset
from tqdm import tqdm
# import io
# import base64
import cv2
from utils.utils... |
logger.py | from typing import Union
from collections import Counter
import queue
import re
import threading
import unicodedata
import time
import requests
VALID_MASK = r"^[a-zA-Z0-9_\-]{3,64}$"
VALID_RE = re.compile(VALID_MASK)
VALID_METRIC_MASK = r"^[\w\-/]{3,64}$"
VALID_METRIC_RE = re.compile(VALID_METRIC_MASK)
def validat... |
test.py | import json
import os.path as p
import random
import subprocess
import threading
import logging
import time
from random import randrange
import math
import pika
import pytest
from google.protobuf.internal.encoder import _VarintBytes
from helpers.client import QueryRuntimeException
from helpers.cluster import ClickHous... |
Main.py | #!/usr/bin/python
import threading
from multiprocessing.context import Process
import ts3 #teamspeak library
import time #time for sleep function
import re #regular expressions
import TS3Auth #includes datetime import
import sqlite3 #Database
import os #operating system commands -check if files exist
import datetime #... |
ethpool.py | # -*- coding: utf-8 -*-
import os
import logging
import time
import requests
import json
import sys
import signal
import sqlite3
from flask import Flask, render_template, url_for, request
from threading import Thread, Lock
import Queue
from ethjsonrpc import EthJsonRpc
methods = [
'eth_hashrate',
'eth_accounts',
'et... |
nqd.py | import socketserver
from threading import Thread
import logging
from manager import NqManager
from log import NqLog
nqlog = logging.getLogger("nq")
class NqHandler(socketserver.StreamRequestHandler):
def handle(self):
str_data = self.rfile.readline().strip().decode("utf-8")
if str_data == "play":
nqlog.inf... |
VehicleMoniter.py | import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
import zipfile
import time
from imutils.video import WebcamVideoStream
from imutils.video import FPS
import imutils
from vehicle import vehicle
import PIL.Image as Image
from collections import defaultdict
f... |
server.py | import asyncio
import threading
from aiohttp import web
from routes import setup_routes
HOST = '0.0.0.0'
PORT = 1337
def aiohttp_server():
app = web.Application()
setup_routes(app)
app.add_routes([web.static('/static', 'static')])
runner = web.AppRunner(app)
return runner
def run_server(runner):
loop = ... |
backup.py | # -*- coding: utf-8 -*-
"""
Created on Fri Aug 7 15:47:04 2020
@author: Nikki
"""
import importlib
import multiprocessing as mp
import ip_streamer
import cv2
import sys
import numpy as np
import time
from ctypes import c_bool
import scipy.spatial
import tensorflow as tf
from core import utils
import pixel_realwor... |
parallel.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
# "License... |
__main__.py | #!/usr/bin/env python3
from pathlib import Path
from threading import Thread
import signal
import sys
from PySide2 import QtCore, QtGui
from PySide2.QtWidgets import QApplication, QSplashScreen
from .main_window import MainWindow, _openmcReload
def main():
path_icon = str(Path(__file__).parent / 'assets/openmc_... |
test_chatcommunicate.py | import chatcommunicate
import chatcommands
from globalvars import GlobalVars
from datahandling import _remove_pickle
import collections
import io
import os
import os.path
import pytest
import threading
import time
from fake import Fake
from unittest.mock import Mock, patch
def test_parse_room_config():
chatcomm... |
dump.py | #!/usr/bin/python3
# coding=utf-8
#######################################################
# File : dump.py #
# Author : Raden #
# Github : https://github.com/afifrden7
# Facebook : https://www.facebook.com/AKUN.KERTASS #
... |
test_websocket_worker.py | import torch
import time
from syft.workers import WebsocketClientWorker
from syft.workers import WebsocketServerWorker
from multiprocessing import Process
def start_proc(participant, kwargs): # pragma: no cover
""" helper function for spinning up a websocket participant """
def target():
server = pa... |
pjf_server.py | """
The MIT License (MIT)
Copyright (c) 2016 Daniele Linguaglossa <d.linguaglossa@mseclab.com>
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 th... |
master.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Global modules:
from multiprocessing import Process, Queue, Value, Array, Event
import time
import queue
import signal
import sys
import logging
logging.basicConfig(level=logging.DEBUG)
# Local files:
from http_server import server as http_server
import rgb_serial
# Func... |
MainWindow.py | from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from configparser import ConfigParser
# locals
from src.views.botones.inicio.boton import Boton
from src.views.teclado.teclado_numeros import TecladoNumeros
from src.views.teclado.teclado_letras import TecladoLetras
from src.communicatio... |
analysis.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 5 11:56:26 2019
@author: descentis
"""
import xml.etree.ElementTree as ET
import math
import glob
import numpy as np
from multiprocessing import Process, Lock, Manager
from datetime import datetime
import re
import string
import os
import mwparserf... |
device.py | '''
Device class
'''
import json
import logging
import queue
import threading
from http import HTTPStatus
import requests
from utils.errors import AldebaranError
from utils.utils import GenericRequestHandler, GenericServer
logger = logging.getLogger(__name__)
class Device:
'''
Generic device class
C... |
tv.py | import json
import threading
from datetime import date, datetime
from .. import BaseResponder
from ..lib import MemoryCache, parse_command, get_url
class APIError(Exception):
pass
class TheTVDB(object):
version = '2.1.1'
def __init__(self, config_get):
self.config_get = config_get
# ca... |
test_client.py | import asyncio
import threading
import logging
import multiprocessing as mp
import pytest
import msgpack
from msgpackio.client import Client
log = logging.getLogger(__name__)
def server():
import asyncio
class ServerProto(asyncio.Protocol):
def __init__(self):
self.unpacker = msgpack.... |
ReaderThread.py | from RFID import RFID
import threading
from gi.repository import GLib
class ReaderThread:
def __init__(self, isTest, handler):
self.reader = RFID(isTest)
self.handler = handler
def startReader(self, join = False):
""" Creates and starts the reader thread.
:param handler: GUI handler to manage the read info.... |
bulldog_vision_3.py | #!/usr/bin/env python
#!coding=utf-8
import rospy
import numpy as np
import PIL.Image as pilimage
import actionlib
from sensor_msgs.msg import CompressedImage
from sensor_msgs.msg import Image
from std_msgs.msg import Float64
from cv_bridge import CvBridge, CvBridgeError
import cv2
import time
from yolo import YOLO
fro... |
web.py | # Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# 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 t... |
test_eap_proto.py | # EAP protocol tests
# Copyright (c) 2014-2015, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import binascii
import hashlib
import hmac
import logging
logger = logging.getLogger()
import os
import select
import struct
import threading
i... |
driver.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyright (c) 2012 Univer... |
_led.py | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
evaluate.py | '''
Evaluate predictive performance of predictors in parallel with multiprocessing.
'''
import argparse
from multiprocessing import Process, JoinableQueue
from multiprocessing import set_start_method
import os
import pandas as pd
from utils import parse_vars, merge_dfs
from evaluate_multiprocessing import run_from_qu... |
cache.py | import json
import requests
import time
import multiprocessing as mp
from typing import List, Text
from random import randint, choice, sample
from . import API
class ImageCache:
"""Class used for caching images"""
ratelimit = 0.05
with API.open() as fp:
api = json.load(fp)
api_cache = {
... |
_kit2fiff_gui.py | """Mayavi/traits GUI for converting data from KIT systems"""
# Authors: Christian Brodbeck <christianbrodbeck@nyu.edu>
#
# License: BSD (3-clause)
import os
import numpy as np
from scipy.linalg import inv
from threading import Thread
from ..externals.six.moves import queue
from ..io.meas_info import _read_dig_points... |
results_view.py | # ===============================================================================
# Copyright 2014 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/licenses... |
fly_mission.py | #!/usr/bin/env python
from __future__ import print_function
import grpc
import time
import threading
# import dronecore_pb2 as dc
# import dronecore_pb2_grpc
# import dronecore_pb2_grpc
# import action_pb2 as dc_action
import action_pb2_grpc
import mission_pb2 as dc_mission
import mission_pb2_grpc
from google.protobu... |
run.py | # import pygame
import time, threading
import RPi.GPIO as GPIO
# import smbus
# bus = smbus.SMBus(1) # Pi 2
# MPR121 Register Defines
MHD_R = 0x2B
NHD_R = 0x2C
NCL_R = 0x2D
FDL_R = 0x2E
MHD_F = 0x2F
NHD_F = 0x30
NCL_F = 0x31
FDL_F = 0x32
ELE0_T = 0x41
ELE0_R = 0x42
ELE1_T = 0x43
ELE1_R = 0x44
ELE2_T = 0x45
ELE2_R = 0x... |
independent.py | """
Custom minimization algorithms in jbopt
minimization routines that assume the parameters to be mostly independent from
each other, optimizing each parameter in turn.
"""
import numpy
def opt_normalizations(params, func, limits, abandon_threshold=100, noimprovement_threshold=1e-3,
disp=0):
"""
**optimization ... |
artifacts.py | import hashlib
import json
import mimetypes
import os
from zipfile import ZipFile, ZIP_DEFLATED
from copy import deepcopy
from datetime import datetime
from multiprocessing.pool import ThreadPool
from tempfile import mkdtemp, mkstemp
from threading import Thread
from multiprocessing import RLock, Event
from time import... |
doom_multiagent_wrapper.py | import threading
import time
from enum import Enum
from multiprocessing import Process, JoinableQueue
from queue import Empty, Queue
import cv2
import filelock
import gym
from filelock import FileLock
from envs.doom.doom_gym import doom_lock_file
from envs.doom.doom_render import concat_grid, cvt_doom_obs
from envs.d... |
stream.py | # coding=utf-8
import struct
from queue import Queue
import threading
import pyaudio
import numpy as np
import config
import utils
logger = utils.get_logger()
class Stream(object):
def __init__(self):
self.chunk = 1024
self.channels = config.AUDIO_CHANNELS
self.bit = config.AUDIO_BIT
... |
webserver.py | import http.server
import socketserver
import threading
import os
import pkg_resources as p
def generate_handler(html, scripts=None):
"""
Generates an http.server.BaseHTTPRequestHandler that is triggered on webrequest
:param html: path to root html file
:param scripts: list of paths to scripts to add... |
virt.py | import atexit
import concurrent.futures
import contextlib
import hashlib
import os
import subprocess
import tempfile
import threading
import time
import access
import command
import configuration
import infra
import iso
import seq
import util
import verify
def get_bridge(ip):
"""The name to be used for the bridg... |
base.py | """
Module containing base classes that represent object entities that can accept
configuration, start/stop/run/abort, create results and have some state.
"""
import os
import sys
import time
import signal
import threading
import traceback
from collections import deque, OrderedDict
import psutil
from schema import Or... |
test_reductions.py | from multiprocessing.reduction import ForkingPickler
import quiver
import torch.multiprocessing as mp
import torch
import torch_quiver as torch_qv
import random
import numpy as np
import time
from typing import List
from quiver.shard_tensor import ShardTensor, ShardTensorConfig, Topo
from quiver.utils import reindex_fe... |
packet_reader.py | # Copyright (c) 2011 Mattias Nissler <mattias.nissler@gmx.de>
#
# Redistribution and use in source and binary forms, with or without modification, are permitted
# provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# condition... |
external_program.py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2016 Spotify AB
#
# 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... |
utils.py | """
Miscellaneous utility functions, wrappers around some subprocess procedures.
"""
import concurrent.futures
import fcntl
import hashlib
import importlib
import inspect
import json
import logging
import logging.config
import os
import random
import shlex
import shutil
import sys
import threading
from pathlib import ... |
dense_update_ops_no_tsan_test.py | """Tests for state updating ops that may have benign race conditions."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.python.platform
import numpy as np
import tensorflow as tf
class AssignOpTest(tf.test.TestCase):
# NOTE(mrry): We... |
cli.py | # -*- coding: utf-8 -*-
from __future__ import print_function
import click
import copy
from functools import wraps
import glob
import io
import json
import logging
import netrc
import os
import random
import re
import requests
import shlex
import signal
import socket
import stat
import subprocess
import sys
import tex... |
train.py | #! /usr/bin/env python3
import rospy
import comet_ml
from multiprocessing import set_start_method
import torch.multiprocessing as torch_mp
import multiprocessing as mp
import numpy as np
import queue
import torch
import time
import yaml
import copy
import os
try:
set_start_method('spawn')
except:
pass
from uti... |
deep_query.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016 - Present, Tianwei Shen, HKUST.
# Copyright 2017 - Present, Zixin Luo, HKUST.
"""
query images and get rank lists.
evaluate oxford5k (paris6k) benchmark datasets.
"""
from __future__ import print_function
import os
import sys
import time
from random imp... |
test_filter_runner.py | # Copyright 2021 Zilliz. 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 agree... |
mock_watcher_test.py | import logging, sys
import yaml
from multiprocessing import Process
from diana.apis import Orthanc, ObservableProxiedDicom
from diana.daemons.mock_site import MockSite
from diana.dixel.mock_dixel import reset_mock_seed
from diana.utils.dicom import DicomEventType
from diana.utils.endpoint import Watcher, Trigger
from ... |
test_graphdata_distributed.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... |
vms_task.py | # coding: utf-8
#------------------------------
# 计划任务
#------------------------------
import sys
import os
import json
import time
import threading
import subprocess
import shutil
# print sys.path
sys.path.append("/usr/local/lib/python2.7/site-packages")
import psutil
root_dir = os.getcwd()
sys.path.append(root_dir... |
main.py | from _webkit import eval_js
import json
import threading, time
import traceback, inspect
import os
print 'loading module'
class Server(object):
def __init__(self, webkit_handle):
try:
self.webkit_handle = webkit_handle
self.thread = threading.Thread(target=self.delay_test)
... |
test_dag_serialization.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... |
client.py | import datetime
import hashlib
import pickle
import threading
import urllib.parse
import logging
from typing import Union, Optional
import requests
import simplejson as json
from django.core.cache import cache
from django.core.management.base import OutputWrapper
from django.db import connections
from django.db.models... |
worker_pool.py | # Copyright (c) 2013 Greg Lange
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
gramgrab.py | import re
import os
import collections
import argparse
from multiprocessing import Process, Queue
import random
import time
import ioutils
from googlegngram import indexing
from representations import sparse_io
VERSION = '20120701'
TYPE = '5gram'
POS = re.compile('.*_[A-Z]+\s.*')
LINE_SPLIT = 100000000
EXCLUDE_PATTER... |
cmd.py | # cmd.py
# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
from __future__ import annotations
import io
import logging
import os
import signal
import subprocess
im... |
incoming.py | import socket
import threading
import email.mime.text
import email.mime.image
import email.mime.multipart
import email.header
import bminterface
import re
import select
import logging
class ChatterboxConnection(object):
END = "\r\n"
def __init__(self, conn):
self.conn = conn
def __getattr__(self, nam... |
async_ppo_atari_visual2.py | # https://github.com/facebookresearch/torchbeast/blob/master/torchbeast/core/environment.py
import numpy as np
from collections import deque
import gym
from gym import spaces
import cv2
cv2.ocl.setUseOpenCL(False)
class NoopResetEnv(gym.Wrapper):
def __init__(self, env, noop_max=30):
"""Sample initial st... |
inception_v1.py | '''
Copyright 2019 Xilinx Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... |
test_tracer.py | # -*- coding: utf-8 -*-
"""
tests for Tracer and utilities.
"""
import contextlib
import multiprocessing
import os
from os import getpid
import threading
from unittest.case import SkipTest
import mock
import pytest
import ddtrace
from ddtrace.constants import ENV_KEY
from ddtrace.constants import HOSTNAME_KEY
from dd... |
test_statestore.py | # Copyright (c) 2015 Cloudera, 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 applicable law o... |
_channel.py | # Copyright 2016 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... |
run.py | from time import time
import os
import random
import sys
import threading
import time
import datetime
import requests
import pickle
from selenium import webdriver
from selenium.common.exceptions import TimeoutException, NoSuchElementException, ElementNotInteractableException, StaleElementReferenceException
import sele... |
presubmit_support.py | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Enables directory-specific presubmit checks to run at upload and/or commit.
"""
from __future__ import print_function
__versio... |
test_poplib.py | """Test script for poplib module."""
# Modified by Giampaolo Rodola' to give poplib.POP3 and poplib.POP3_SSL
# a real test suite
import poplib
import socket
import os
import errno
import threading
import unittest
from unittest import TestCase, skipUnless
from test import support as test_support
from test.support imp... |
common.py | # Copyright (C) 2008 The Android Open Source Project
#
# 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 ... |
test_utils.py | # Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... |
test_fetcher.py | import tempfile
import os.path as op
import sys
import os
import numpy.testing as npt
from nibabel.tmpdirs import TemporaryDirectory
import dipy.data.fetcher as fetcher
from dipy.data import SPHERE_FILES
from threading import Thread
if sys.version_info[0] < 3:
from SimpleHTTPServer import SimpleHTTPRequestHandler ... |
test_vrf.py | import sys, os
import time
import threading
import Queue
import yaml
import json
import random
import logging
import tempfile
import traceback
from collections import OrderedDict
from natsort import natsorted
from netaddr import IPNetwork
import pytest
from tests.common.fixtures.ptfhost_utils import copy_ptftests_di... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.