source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
test_logging.py | # -*- coding: utf-8 -*-
"""Stupid tests that ensure logging works as expected"""
from __future__ import division, absolute_import, print_function
import sys
import threading
import logging as log
from StringIO import StringIO
import beets.logging as blog
from beets import plugins, ui
import beetsplug
from test impor... |
queues.py | # This is a simple unit-test designed to see whether multiprocessing Queues are
# leaking on Linux. They don't seem to be, which is good for most people, but
# leaves me still with an unexplained leak.
import os
import sys
import time
import Queue
import psutil
import random
import datetime
import multiprocessing
m... |
sdk_worker_main.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... |
failure_handler_test.py | # Copyright 2022 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 applicable ... |
cli.py | # encoding: utf-8
from __future__ import print_function
import collections
import csv
import multiprocessing as mp
import os
import datetime
import sys
from pprint import pprint
import re
import itertools
import json
import logging
from optparse import OptionConflictError
import traceback
from six import text_type
f... |
dhcp.py | #!/usr/bin/python3
import time
import threading
import struct
import queue
import collections
import traceback
import random
import socket
import heapq
from listener import *
def get_host_ip_addresses():
return gethostbyname_ex(gethostname())[2]
class PriorityQueue(object):
def __init__(self):
se... |
bot_controllable_talknet.py | import sys
import os
import base64
from typing import Text
import torch
import numpy as np
import tensorflow as tf
import crepe
import scipy
from scipy.io import wavfile
import psola
import io
import nemo
from nemo.collections.asr.models import EncDecCTCModel
from nemo.collections.tts.models import TalkNetSpectModel
fr... |
test_server.py | import os
import socketserver
import threading
from http.server import BaseHTTPRequestHandler
class TestHandler(BaseHTTPRequestHandler):
def do_GET(self):
filename = os.path.basename(self.path)
self.send_response(200)
self.send_header('Content-Disposition', 'attachment; filename="{}"'.for... |
experiment.py | '''
Experiment class containing all information about the current setup of experiment.
Lists of liquids (Experiment.liq) and solids (Experiment.sol).
Allowed ranges of quantities for every component in a dict (Experiment.rng)
'''
from bayes_opt import DiscreteBayesianOptimization, UtilityFunction
from kuka_parser impor... |
server.py | import socket
from threading import Thread
import sys
import signal
MESSAGE_SIZE = 1024
sock = None
separator_token = "<SEP>" # we will use this to separate the client name & message
client_sockets = None
def sigterm_handler(_signum, _frame) -> None:
sys.exit(1)
def clean_up():
global sock
global cli... |
_script_docker_python_loop_example.py | # type: ignore[attr-defined]
"""
This is a simplified example script which demonstrates the concept of how the XSOAR Server executes python integrations/scripts.
The XSOAR Server will run the docker container with a python script which it will use to execute the integration/script.
The communication with the script is... |
using_tips_5.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
50个话题
9章
1.课程简介
2.数据结构相关话题
3.迭代器与生成器相关话题
4.字符串处理相关话题
5.文件I/O操作相关话题
6.数据编码与处理相关话题
7.类与对象相关话题
8.多线程与多进程相关话题
9.装饰器相关话题
"""
"""
第1章 课程简介
1-1 课程简介
1-2 在线编码工具WebIDE使用指南
第2章 数据结构与算法进阶训练
2-1 如何在列表, 字典, 集合中根据条件筛选数据
2-2 如何为元组中的每个元素命名, 提高程序可读性
2-3 如何统计序列中元素的出现频... |
module.py | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
flask.py | from __future__ import annotations
import asyncio
import json
import logging
from asyncio import Queue as AsyncQueue
from queue import Queue as ThreadQueue
from threading import Event as ThreadEvent
from threading import Thread
from typing import Any, Callable, Dict, NamedTuple, Optional, Tuple, Union, cast
from urlli... |
test_docxmlrpc.py | from DocXMLRPCServer import DocXMLRPCServer
import httplib
import sys
from test import test_support
threading = test_support.import_module('threading')
import time
import socket
import unittest
PORT = None
def make_request_and_skipIf(condition, reason):
# If we skip the test, we have to make a request because
... |
server.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... |
main.py | """ MSE """
# import multiprocessing
import threading
import numpy as np
import os
import shutil
import matplotlib.pyplot as plt
import tensorflow as tf
import math
import pickle
import sympy as sym
from scipy import signal
import random
np.random.seed(42)
# PARAMETERS
OUTPUT_GRAPH = False # save lo... |
Messenger_Client.py | import threading
from messenger_package.Messenger_Socket import *
from messenger_package.Messenger_Functions import *
class MessengerClient():
def __init__(self):
print("client init!")
self.message_header = ""
self.last_message_sent = ""
def start(self, addr, sock, username, user_id)... |
receiver_emu.py | #!/usr/bin/env python
###############################################################################
# Imports
###############################################################################
from gnuradio import zeromq
from gnuradio import gr
from gnuradio import blocks
from gnuradio import analog
from gnuradio impor... |
auto_optimization.py | """
This module contains the algorithm for optimizing the costs of energy systems.
"""
from datetime import datetime
from scipy.optimize import fmin_l_bfgs_b
import calendar
import cProfile
import copy
from collections import namedtuple
import numpy as np
from numpy import array
from server.devices.base import BaseEn... |
test_path.py |
import unittest
import multiprocessing as mp
from generalfile import *
from generalfile.test.setup_workdir import setup_workdir
def _thread_test(queue, i):
queue.put(int(Path("test.txt").write(i, overwrite=True)))
class PathTest(unittest.TestCase):
def setUp(self):
"""Set working dir and clear fol... |
main.pyw | import subprocess;
import tkinter;
import os;
import threading;
def getNetworkInformation(pingMeter, canvas):
global running;
#gatewayAddressProcess = subprocess.Popen(["ipconfig"], shell = True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdin = subprocess.PIPE, cwd = os.getcwd(), env = os.environ);
... |
alarm_sound.py | import tkinter as tk
from tkinter.font import Font
import pygame.mixer
import wave
from os.path import relpath
from threading import Thread
class AlarmSound():
def __init__(self, parent, file="default", set_window=False):
self.parent = parent
self.file = file # File path or "default" alarm Sound
... |
TestFlight.py | # Started from Tello Template
# This Python app is in the Public domain
# Some parts from Tello3.py
import threading, socket, sys, time, subprocess
# GLOBAL VARIABLES DECLARED HERE....
host = ''
port = 9000
locaddr = (host,port)
tello_address = ('192.168.10.1', 8889) # Get the Tello drone's address
# Creates a UD... |
motors.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020-2021 by Murray Altheim. All rights reserved. This file is part
# of the Robot Operating System project, released under the MIT License. Please
# see the LICENSE file included as part of this package.
#
# author: Murray Altheim
# created: 2020-01-18
# ... |
chrome_test_server_spawner.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.
"""A "Test Server Spawner" that handles killing/stopping per-test test servers.
It's used to accept requests from the device to spawn and kill instances of ... |
sync_cross_cluster.py | #!/usr/bin/env python2
# coding:utf-8
import copy
import errno
import getopt
import logging
import os
import sys
import threading
import time
import traceback
import boto3
import yaml
from botocore.client import Config
from pykit import fsutil
from pykit import jobq
from pykit import logutil
from pykit import thread... |
test.py | import json
import pytest
import random
import re
import string
import threading
import time
from multiprocessing.dummy import Pool
from helpers.client import QueryRuntimeException
from helpers.cluster import ClickHouseCluster
from helpers.test_tools import TSV
cluster = ClickHouseCluster(__file__)
node1 = cluster.ad... |
main.py | import multiprocessing
from mlapp.env_loader import EnvironmentLoader
from mlapp.utils.general import read_json_file
import importlib
import uuid
import json
from mlapp.handlers.wrappers.database_wrapper import database_instance
from mlapp.handlers.wrappers.file_storage_wrapper import file_storage_instance
from mlapp.h... |
window_title_async.py | # -*- coding: utf-8 -*-
"""
Display the current window title with async update.
Uses asynchronous update via i3 IPC events.
Provides instant title update only when it required.
Configuration parameters:
always_show: do not hide the title when it can be already
visible (e.g. in tabbed layout). (default Fal... |
test_util.py | # Copyright 2015 Google 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 or a... |
threading_test.py | import threading
import time
from threading import Thread
"""
我们只需要创建一个Thread对象,并运行start方法,
解释器就会创建一个子进程执行我们的target,我们创建了5个线程,但是使用threading.enumerate查看线程的数量发现有6个线程,
因为当前在执行的还有一个主线程。主线程会默认等待所有的子线程结束后再结束
"""
# def test(x):
# print('this is {}'.format(x))
# time.sleep(2)
# def get_thread(number=5):
# l_thr... |
checker.py | from random import choice
from time import sleep, time
from typing import Iterable, Dict, List, Tuple
from json.decoder import JSONDecodeError
import multiprocessing as mp
import os
import urllib3
import requests
from termcolor import colored
from interutils import cyan, pr
from proxion.util import (
Proxy,
)
fro... |
engine.py | # -*- coding:utf-8 -*-
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,... |
agent.py | from __future__ import print_function
from builtins import zip
from builtins import range
from builtins import object
# 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 ... |
tinkup.py | from cgitb import text
import queue
from random import seed
import serial
import serial.tools.list_ports
from signal import signal, SIGINT
import sys
import threading
import time
import tkinter
from tkinter import END, W, PhotoImage, filedialog as fd, scrolledtext as sd
global fw_filename
fw_filename = ""
COM_OVERRID... |
jetbot_center.py | import threading
import socket
import jetbot_stream, jetbot_socket
from jetbot import Camera, bgr8_to_jpeg
import ipywidgets.widgets as widgets
import traitlets
##取得ip
ss = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
ss.connect(("8.8.8.8", 80))
ip = ss.getsockname()[0]
##初始化相機
camera = Camera.instance(width=224, h... |
openvino_yolov3_MultiStick_test.py | import sys, os, cv2, time, heapq, argparse
import numpy as np, math
try:
from armv7l.openvino.inference_engine import IENetwork, IEPlugin
except:
from openvino.inference_engine import IENetwork, IEPlugin
import multiprocessing as mp
from time import sleep
import threading
yolo_scale_13 = 13
yolo_scale_26 = 26
... |
bluetooth.py | import Queue as queue
import serial
import struct
import threading
BLUETOOTH_EVENTS = {
0x05: 'Disconnection Complete',
0x08: 'Encryption Change',
0x0c: 'Read Remote Version Information Complete',
0x0e: 'Command Complete',
0x0f: 'Command Status',
0x10: 'Hardware Error (optional)',
0x13: 'N... |
sensors.py | import sys
import wifi
import base64
import csv
import json
import threading
from datetime import datetime
import subprocess
import socket
import urllib
import os
import configparser
import subprocess as sp
os.system('sudo systemctl start bluetooth')
import pygatt
from binascii import hexlify
import time
import binasci... |
ipython_memory_usage.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Profile mem usage envelope of IPython commands and report interactively"""
from __future__ import division # 1/2 == 0.5, as in Py3
from __future__ import absolute_import # avoid hiding global modules with locals
from __future__ import print_function # force use of pri... |
test_pool.py | import collections
import random
import threading
import time
import weakref
import sqlalchemy as tsa
from sqlalchemy import event
from sqlalchemy import pool
from sqlalchemy import select
from sqlalchemy import testing
from sqlalchemy.testing import assert_raises
from sqlalchemy.testing import assert_raises_message
f... |
base.py | from abc import abstractmethod
import asyncio
from pathlib import Path
from multiprocessing.managers import (
BaseManager,
)
from threading import Thread
from typing import (
List,
Type,
Union
)
from evm.chains.base import BaseChain
from p2p.peer import (
PeerPool
)
from p2p.service import (
B... |
sanitylib.py | #!/usr/bin/env python3
# vim: set syntax=python ts=4 :
#
# Copyright (c) 2018 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import contextlib
import string
import mmap
import sys
import re
import subprocess
import select
import shutil
import shlex
import signal
import threading
import concurrent.fu... |
app.py | import dispenser
import flask
import os
import logging
from time import sleep
import datetime
from coinbase_commerce.client import Client
from threading import Thread, Timer
event_dict = {}
polling = True
sample_lock = False
app = flask.Flask(__name__)
TYPE_CREATED = "charge:created"
TYPE_PENDING = "charge:pending"
A... |
artifacts.py | import json
import mimetypes
import os
import pickle
from six.moves.urllib.parse import quote
from copy import deepcopy
from datetime import datetime
from multiprocessing import RLock, Event
from multiprocessing.pool import ThreadPool
from tempfile import mkdtemp, mkstemp
from threading import Thread
from time import t... |
test_enum.py | import enum
import inspect
import pydoc
import unittest
import threading
from collections import OrderedDict
from enum import Enum, IntEnum, EnumMeta, Flag, IntFlag, unique, auto
from io import StringIO
from pickle import dumps, loads, PicklingError, HIGHEST_PROTOCOL
from test import support
from datetime import timede... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including witho... |
server_rpc.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/server/server_rpc.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice... |
test_smtpserver.py | # Copyright The IETF Trust 2014-2020, All Rights Reserved
# -*- coding: utf-8 -*-
import smtpd
import threading
import asyncore
import debug # pyflakes:ignore
class AsyncCoreLoopThread(object):
def wrap_loop(self, exit_condition, timeout=1.0, use_poll=False, map=None):
if map... |
ui.pyw | import threading
import bulbabot
import iomanage
import asyncio
import time
from PySide2.QtWidgets import QApplication, QWidget, QVBoxLayout, QHBoxLayout, QPushButton, \
QLabel, QListWidget, QListWidgetItem, QLineEdit, QCheckBox, QComboBox
from PySide2.QtCore import Signal, Slot, QObject
Default_Settings = {
... |
test_decimal.py | # Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz (aahz at pobox.com)
# and Tim Peters
"""
These are the test cases for the Decim... |
coach.py | # Copyright (c) 2017 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
mainwindow.py | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Spyder, the Scientific Python Development Environment
=====================================================
Developed and maintained by the Spyder Proj... |
learner.py | # Lint as: python3
# Copyright 2020 DeepMind Technologies Limited. 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
#
# ... |
host_state.py | """
Global shared state about the host.
"""
import sys
import threading
import time
import utils
CLIENT_VERSION = '1.0.3'
class HostState(object):
def __init__(self, fiat_auth, predictor):
self.host_ip = None
self.host_mac = None
self.gateway_ip = None
self.packet_processor ... |
imageNetMemory.py | '''
Created on Sep 20, 2021
@author: thomas
'''
from multiprocessing import Process, Queue
import webdataset as wds
from torch.utils.data import DataLoader
class ComChannel():
def __init__(self, qIn, qOut, process):
self.qIn = qIn
self.qOut = qOut
self.process = process
self.retri... |
serve.py | #!/usr/bin/python
import os
import threading
from time import sleep, time
import datetime
import sys
from ClientSettings import settings
from bin import communication, monitor
Communication = communication.Communication()
Monitor = monitor.Monitor()
BASE_DIR = os.getcwd()
FILE_DIR = (BASE_DIR + '/static/')
FILE = (BA... |
fixtures.py | import threading
import pytest
from contextlib import contextmanager
import os
import logging
import sys
from robotframework_ls.options import USE_TIMEOUTS, NO_TIMEOUT
__file__ = os.path.abspath(__file__) # @ReservedAssignment
log = logging.getLogger(__name__)
TIMEOUT = int(os.getenv("PYTEST_TIMEOUT", 7))
if not U... |
monitor.py | # -*- coding: utf-8 -*-
# File: monitor.py
import json
import numpy as np
import operator
import os
import re
import shutil
import time
from collections import defaultdict
from datetime import datetime
import six
import threading
from ..compat import tfv1 as tf
from ..libinfo import __git_version__
from ..tfutils.su... |
multiprocessing_module.py |
import multiprocessing
from level_2.module.gesture_control import main_avm
queue_shared = multiprocessing.Queue()
process_object = multiprocessing.Process(target = main_avm, args = (queue_shared,)) |
updatedb.py | # -*- coding:utf-8 -*-
import sys
import time
import os
from time import clock
from datetime import datetime,date,timedelta
import logging
from multiprocessing import Process
import threading, multiprocessing
from nsnqtlib.servers import serverlist
from nsnqtlib.db import mongodb
from nsnqtlib.utils import WindQuote
... |
presenter.py | import sys
import threading
import time
from datetime import datetime, timedelta
from PyQt5 import QtWidgets, QtCore, QtGui
import view
import timer
class Presenter:
def __init__(self, view_: view.View):
self.view = view_
self.update_time = None
self.timer = 0
sel... |
fabfile.py | # Auto-scale Rackspace Cloud servers with Fabric and Celery
#
# Copyright 2012 Nicholas Kuechler
# http://www.nicholaskuechler.com/
"""
Fabric fabfile to build workers using Rackspace Cloud api
and then configure them with the code base.
"""
import cloudservers
import urllib2
import uuid
from time import sle... |
test_io.py | import sys
import gc
import gzip
import os
import threading
import time
import warnings
import io
import re
import pytest
from pathlib import Path
from tempfile import NamedTemporaryFile
from io import BytesIO, StringIO
from datetime import datetime
import locale
import numpy_demo as np
import numpy_demo.ma as ma
from... |
service_streamer.py | # coding=utf-8
# Created by Meteorix at 2019/7/13
import logging
import multiprocessing
import os
import threading
import time
import uuid
import weakref
import pickle
from queue import Queue, Empty
from typing import List
from redis import Redis
from .managed_model import ManagedModel
TIMEOUT = 1
TIME_SLEEP = 0.001... |
autoreload.py | import functools
import itertools
import logging
import os
import signal
import subprocess
import sys
import threading
import time
import traceback
import weakref
from collections import defaultdict
from pathlib import Path
from types import ModuleType
from zipimport import zipimporter
from django.apps import apps
fro... |
input_server.py | # first to start the nameserver start: python -m Pyro4.naming
import Pyro4
from threading import Thread
import time
import numpy as np
from railrl.launchers import config
# HOSTNAME = "192.168.0.102"
Pyro4.config.SERIALIZERS_ACCEPTED = set(['pickle','json', 'marshal', 'serpent'])
Pyro4.config.SERIALIZER='pickle'
dev... |
pickletester.py | import collections
import copyreg
import dbm
import io
import functools
import os
import math
import pickle
import pickletools
import shutil
import struct
import sys
import threading
import unittest
import weakref
from textwrap import dedent
from http.cookies import SimpleCookie
try:
import _testbuffer
except Impo... |
repository.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 (t... |
meteor_sort.py | import tensorflow as tf
from tensorflow.keras.layers import Dense, Conv2D, MaxPooling2D, Flatten, BatchNormalization
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.callbacks import Callback
from tensorflow.keras.models import Sequen... |
diskover_socket_server.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""diskover - Elasticsearch file system crawler
diskover is a file system crawler that index's
your file metadata into Elasticsearch.
See README.md or https://github.com/shirosaidev/diskover
for more information.
Copyright (C) Chris Park 2017-2019
diskover is released unde... |
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... |
enterprise_backup_restore_test.py | import os, re, copy, json, subprocess
from random import randrange, randint, choice
from threading import Thread
from couchbase_helper.cluster import Cluster
from membase.helper.rebalance_helper import RebalanceHelper
from couchbase_helper.documentgenerator import BlobGenerator, DocumentGenerator
from ent_backup_resto... |
deepQlearning.py | from torch import nn, multiprocessing as mp, Tensor
from franQ.Replay.wrappers import TorchDataLoader
import itertools
import typing as T, logging
from franQ.Agent.conf import AgentConf, AttrDict
from collections import OrderedDict
import torch
from torch.utils.tensorboard import SummaryWriter
from pathlib import ... |
server.py | import http.server
import json
import queue
import signal
import socketserver
import socket
import struct
import time
import threading
from io import BytesIO
running = True
pos = (0.0, 0.0, 0.0)
q = queue.Queue()
class HTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
return http... |
channel_test.py |
import itertools
import multiprocessing
import threading
import time
import pytest
from omnidiff import channel
from omnidiff.channel import QueueChannel as Channel
def test_put_get():
"""
Channel is a FIFO queue. Write with put() or put_many(), then read with
get().
"""
chnl = Channel()
chn... |
userportalgtk.py | #!/usr/bin/python
import pygtk
import gtk
import gtk.glade
import gobject
import time
import sys
import os
import subprocess
from threading import Thread
import dispatcher
import urllib2
import tempfile
global dispatcher
dispatcher = dispatcher.OvirtApi()
VarSaida = True
class Client:
def Quit(*args, **kwargs)... |
sge.py | #!/usr/bin/env python
# coding:utf-8
# 投递任务,将任务散播到集群SGE,并等待所有任务执行完成时退出。 杀掉本主进程时,由本进程投递的qsub任务也会被杀掉,不接受`kill -9`信号
import os
import sys
import time
import signal
import getpass
import argparse
from shutil import rmtree
from threading import Thread
from datetime import datetime
from subprocess import call, PIPE
from .... |
test_pool.py | import collections
import random
import threading
import time
from unittest.mock import ANY
from unittest.mock import call
from unittest.mock import Mock
from unittest.mock import patch
import weakref
import sqlalchemy as tsa
from sqlalchemy import event
from sqlalchemy import pool
from sqlalchemy import select
from s... |
openvpn.py | #!/usr/bin/python
# openvpn.py: library to handle starting and stopping openvpn instances
import logging
import os
import signal
import subprocess
import threading
import time
class OpenVPN:
connected_instances = []
def __init__(self, config_file=None, auth_file=None, crt_file=None,
tls_aut... |
word2vec_optimized.py | # Copyright 2015 Google 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 or a... |
actor_definition.py | import contextlib
import logging
import os
import pkgutil
import sys
from io import UnsupportedOperation
from multiprocessing import Process, Queue
import leapp.libraries.actor
from leapp.actors import get_actors, get_actor_metadata
from leapp.exceptions import ActorInspectionFailedError, MultipleActorsError, Unsuppor... |
zPushTest.py | #!/usr/bin/python
import time
import json
import urllib
import urllib2
import base64
import random
from multiprocessing import Process
PUSHD_SERVER = 'http://54.64.230.59:5566'
PUSHD_SERVER_WITHOUT_AUTH = 'http://54.64.230.59:5566'
PUSHD_AUTHORIZATION = 'Basic %s' % base64.encodestring('admin:admin')
TOKEN_HTTP = 'ht... |
runner.py | #!/usr/bin/env python3
# Copyright 2010 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.
"""This is the Emscripten test runner. To run ... |
dices.py | import os
import telebot
import time
import random
import threading
from emoji import emojize
from telebot import types
from pymongo import MongoClient
import traceback
import json
import requests
import http.cookiejar as cookielib
import urllib
import urllib.request as urllib2
CJ = cookielib.LWPCookieJar()
from reques... |
log_handler.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... |
CTRLdeck.py | from tkinter import *
from tkinter import ttk
from tkinter import filedialog
from inc.getCOM import serial_ports
from pystray import MenuItem as item
import pystray
from PIL import Image, ImageTk
import inc.serialValuetoVolume as serialValuetoVolume
import threading
import pythoncom
import logging
from time import slee... |
ServiceUbuntu.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import os
import sys
import re
import time
import urllib
import lxml
import threading
import time
import requests
import base64
import json
import http.cookiejar as cookielib
from bs4 import BeautifulSoup
from selenium import web... |
data.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import random
import logging
import sys
import numbers
import math
import sklearn
import datetime
import numpy as np
import cv2
import mxnet as mx
from mxnet import ndarray as nd
#from . import _ndar... |
extraVMmetrics.py |
__author__="mcanuto"
__date__ ="$Feb 13, 2014 6:11:42 PM$"
import sys
from time import sleep
import os
import gmetric
from domain_info import domainsVM, VMobject
from countersMetrics import CountersMetrics
from rawCountersMetrics import RawCountersMetrics
from threading import Thread
from gmetric import GmetricConf
f... |
PySC2_A3C_old.py | """
PySC2_A3C_old.py
A script for training and running an A3C agent on the PySC2 environment, with reference to DeepMind's paper:
[1] Vinyals, Oriol, et al. "Starcraft II: A new challenge for reinforcement learning." arXiv preprint arXiv:1708.04782 (2017).
Advantage estimation uses generalized advantage estimation from... |
A3CtypeAD.py | '''
Type anomaly detection file
'''
import tensorflow as tf
import threading
import multiprocessing
import os
import shutil
import itertools
from my_enviroment import my_env
from estimators import ValueEstimator, PolicyEstimator
from policy_monitor import PolicyMonitor
from worker import Worker
def del_all_flags(... |
isaac_ros_server.py | #!/usr/bin/env python3
import rospy
from sensor_msgs.msg import JointState
from std_msgs.msg import Header, Float32MultiArray, Float32
import threading
class isaac_ros_server():
def __init__(self) -> None:
print("Initializing node... ")
rospy.init_node("isaac_ros_server")
print("Initializi... |
main_ui.py | # -*- coding: utf-8 -*-
from sys import exit
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from capture_core import *
# 使用matplotlib绘制柱状图
import numpy as np
import matplotlib.pyplot as plt
import json
from monitor_system import start_monitor
from forged_packet import startForged
fro... |
threading_tests.py | import threading
import time
import logging
import json
import urllib.request
logging.basicConfig(level=logging.DEBUG,
format='(%(threadName)-9s) %(message)s',)
class ThreadPool(object):
def __init__(self):
super(ThreadPool, self).__init__()
self.active = []
self.lock =... |
run_parallel_sensitivity_analysis 2.py | import sys
import os
from multiprocessing import Process
import time
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../../..')))
import sys
import os
from multiprocessing import Process
import time
# sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../../..')))
... |
ThreadJoin.py | from threading import Thread
global exit_flag
exit_flag = False
def f():
i = 1
while not exit_flag:
i = (i + 1) % 100000000
if i % 100000 == 0: print("f making progress: {0}".format(i))
from threading import Thread
if __name__ == '__main__':
t1 = Thread(target=f,name="F_thread"... |
selenium_utils.py | from chromedriver_py import binary_path as driver_path
from selenium.webdriver import DesiredCapabilities
from selenium.webdriver import Chrome, ChromeOptions # TODO: Combine these two dependencies. Leaving it for now since it touches too many sites atm.
from selenium.webdriver.chrome.options import Options
from seleni... |
_polling.py | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import logging
import time
import threading
import uuid
from typing import TYPE_CHECKING
from azure.core.polling import PollingMethod, LROPoller, NoPolling
from azure.c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.