source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
send.py | import subprocess, threading
from .models import Message
from .config import SEND_COMMAND
def __send(msg: Message):
subprocess.run(SEND_COMMAND.format(msg.sender, msg.content, msg.receiver), shell=True)
def send_Thread(msg: Message) -> threading.Thread:
x = threading.Thread(target=__send, args=(msg,), daem... |
unzip5.py | # identify zip file name and dictionary name
import zipfile
import optparse
from threading import Thread
def extractFile(zFile, password):
try:
zFile.extractall(pwd = password.encode(encoding = 'utf-8'))
print('[+] Found password ' + password)
except:
pass
def main():
parser = opt... |
monitor_system.py | # -*- coding: utf-8 -*-
from threading import Thread
from time import time
from PyQt5 import QtCore, QtGui, QtWidgets
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt5 import NavigationToolbar2QT as NavigationToolbar
import matplotlib.pyplot as plt
fro... |
server.py | import socket
from threading import Thread, Event
from pyngrok import ngrok
class Client:
def __init__(self, host: str, port: int, sock: socket.socket):
self.host = host
self.port = port
self.sock = sock
self.name = self.get_name()
def send(self, data: str, *args, encoding: st... |
dgm.py | from threading import Thread
from BucketLib.BucketOperations import BucketHelper
from basetestcase import ClusterSetup
from cb_tools.cbstats import Cbstats
from couchbase_helper.documentgenerator import doc_generator
from remote.remote_util import RemoteMachineShellConnection
from table_view import TableView
class ... |
runners.py | # -*- coding: utf-8 -*-
import locale
import os
import struct
from subprocess import Popen, PIPE
import sys
import threading
import time
import signal
from .util import six
# Import some platform-specific things at top level so they can be mocked for
# tests.
try:
import pty
except ImportError:
pty = None
tr... |
client.py | '''
implements the client side of the Debug Adapter protocol
documentation can be found here
https://microsoft.github.io/debug-adapter-protocol/specification
https://microsoft.github.io/debug-adapter-protocol/overview
a list of server implementers can be found here
https://microsoft.github.io/debug-adapter-prot... |
conftest.py | # Copyright 2021 Edward Leardi. All Rights Reserved.
#
# Copyright 2020 IBM Corp. 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/L... |
LURKland.py |
# # # Module that initializes server conn,
from game import Game
from client_manager import ClientManager
import socket, select, logging, os
from multiprocessing import Pipe, Process, Queue
host = '0.0.0.0'
port = 5050
def setup_logging():
FORMAT = '%(asctime)-15s %(clientip)s %(user)-8s %(message)s'
loggi... |
redfishMockupServer.py | # Copyright Notice:
# Copyright 2016-2019 DMTF. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/Redfish-Mockup-Server/blob/master/LICENSE.md
# redfishMockupServer.py
# tested and developed Python 3.4
import sys
import argparse
import time
import collections
import... |
server.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Author: LIURLN
"""
from flask import Flask
from flask_cors import CORS
from thid import THID
import threading
import json
from fingerprintSensor import Fingerprint
from weight import weight_sensor
from height import height_sensor
from pulse import pulse_sensor
from t... |
Hiwin_RT605_Socket_v3_20190628113328.py | #!/usr/bin/env python3
# license removed for brevity
import rospy
import os
import socket
##多執行序
import threading
import time
import sys
import matplotlib as plot
import HiwinRA605_socket_TCPcmd_v3 as TCP
import HiwinRA605_socket_Taskcmd_v3 as Taskcmd
import numpy as np
from std_msgs.msg import String
from ROS_Socket.s... |
test_urllib.py | """Regresssion tests for urllib"""
import urllib.parse
import urllib.request
import urllib.error
import http.client
import email.message
import io
import unittest
from test import support
import os
import sys
import tempfile
from base64 import b64encode
import collections
def hexescape(char):
"""Escape char as R... |
wopibridge.py | #!/usr/bin/python3
'''
wopibridge.py
The WOPI bridge for IOP. This PoC only integrates CodiMD
and for now the code is not fully abstracted to support other integrations.
Author: Giuseppe.LoPresti@cern.ch, CERN/IT-ST
'''
import os
import sys
import time
import traceback
import socket
from platform import python_versi... |
schedule.py | from threading import Thread
import time
import schedule
from datetime import datetime
from datetime import timedelta
from cloudant.client import Cloudant
from cloudant.result import Result
from cloudant.query import Query
from .pusher import push_data
from .database import traces_db, patients_db, anomalies_db
from ... |
runner.py | import subprocess
import shlex
import threading
def print_output(process, identifier):
while process.poll() is None:
line = process.stdout.readline()
if line != b'':
print(f"[{identifier}] {line.decode('ascii')}")
line = process.stdout.read()
if line != b'':
print(f"a... |
slave.py | from __future__ import absolute_import
import logging
logger = logging.getLogger(__name__)
import sys
import os
import time
import threading
import random
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from service.client import Client
from service.server import Server
from service.c... |
A3C_pendulum.py | import numpy as np
import gym
import threading
from keras.models import Sequential, Model
from keras.layers import Dense, Activation, Flatten, Input, merge
from keras.optimizers import Nadam
from rl.agents import ContinuousA3CAgent
ENV_NAME = 'Pendulum-v0'
gym.undo_logger_setup()
# Get the environment and extract... |
healthcheck_runner.py | import time
import datetime
import threading
import os
import requests
from core import Core
class HealthCheckRunner(object):
_TAG = '[HealthCheckRunner]'
core = Core()
INTERNAL_SERVICE_PORT = '80'
def __init__(self, interval=10):
print(self._TAG+datetime.datetime.now().__str__() + ' : Starti... |
llcm.py |
# Copyright (c) 2018 SONATA-NFV, 5GTANGO and Paderborn University
# 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
#
#... |
recently_added.py | from flask import render_template
import jsonrpclib, ast, os
from maraschino import app, logger, DATA_DIR, THREADS, HOST, PORT, WEBROOT
from maraschino.noneditable import *
from maraschino.tools import *
from threading import Thread
from maraschino.models import RecentlyAdded, XbmcServer
from maraschino.database impor... |
fattree.py | # -*- coding: UTF-8 -*-
# Copyright (C) 2016 Huang MaChi at Chongqing University
# of Posts and Telecommunications, Chongqing, China.
# Copyright (C) 2016 Li Cheng at Beijing University of Posts
# and Telecommunications. www.muzixing.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not ... |
fs.py | from typing import (Any, AsyncIterator, BinaryIO, cast, AsyncContextManager, Dict, List, Optional,
Set, Tuple, Type)
from types import TracebackType
import sys
from concurrent.futures import ThreadPoolExecutor
import os.path
import urllib
import threading
import asyncio
import logging
import botoco... |
othelloEval.py | from othelloGame import othello
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
from progress.bar import Bar
import pandas as pd
import threading as thr
import time
# TODO: Fix Threading
class othello_eval:
def __init__(self, bot1, bot2, runs=8, adverse=False)... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2019 The bitcoinphantom Core developers
# Copyright (c) 2019 bitcoinphantom developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test bitcoinphantomd shutdown."""
from test_framework... |
__init__.py | # -*- coding: utf-8 -*-
"""The initialization file for the Pywikibot framework."""
#
# (C) Pywikibot team, 2008-2019
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, division, unicode_literals
__version__ = __release__ = '3.1.dev0'
__url__ = 'https://www.mediawiki.org/wiki/... |
email.py | from flask_mail import Message
from flask import render_template, current_app
from app import mail
from threading import Thread
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(subject, sender, recipients, text_body):
msg = Message(subject, sender=sender, recipien... |
__init__.py | import os
import threading
import time
lock = threading.RLock()
task_idx = 0
task_tot = 0
task_list = []
lib_path = ""
def transtoflo(thread_name):
global task_idx
while True:
lock.acquire()
print('trans_flo: [{}/{}]'.format(task_idx, task_tot))
if task_idx >= task_tot:
l... |
compareDQMOutput.py | #!/bin/env python
import os
import sys
import glob
import argparse
import subprocess
from threading import Thread
COMPARISON_RESULTS = []
def collect_and_compare_files(base_dir, pr_dir, output_dir, num_procs, pr_number, test_number, release_format):
files = get_file_pairs(base_dir, pr_dir)
threads = []
... |
__init__.py | # Copyright 2017 Mycroft AI 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 writin... |
base.py | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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 ... |
views.py | import json
from threading import Thread
import numpy as np
import pandas as pd
from django.shortcuts import redirect, render
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import DetailView, ListView
from user.level import admin_req... |
test_weakref.py | import gc
import sys
import unittest
import collections
import weakref
import operator
import contextlib
import copy
import threading
import time
import random
from test import support
from test.support import script_helper
# Used in ReferencesTestCase.test_ref_created_during_del() .
ref_from_del = None
# Used by Fi... |
receiver.py | """
Client/Receiver.py
------------------
This listens for incoming messages from the TroopServer
"""
from __future__ import absolute_import
from .threadserv import ThreadedServer
from .message import *
from .config import *
import socket
from threading import Thread
from time import sleep
class Receive... |
client.py | # -*- coding=utf-8 -*-
import base64
import hashlib
import logging
import socket
import json
import platform
import time
import hmac
try:
import ssl
except ImportError:
ssl = None
from multiprocessing import Process, Manager, Queue, pool
from threading import RLock, Thread
try:
# python3.6
from http ... |
wrtobleant.py | # ---------------------------------------------------------------------------
# Original code from the bfritscher Repo waterrower
# https://github.com/bfritscher/waterrower
# ---------------------------------------------------------------------------
import threading
import time
import datetime
import logging
import n... |
procs.py | import os
import Queue
import signal
import sys
from subprocess import Popen, PIPE
from threading import Thread
PROCERR = 1
PROCWARN = -1
class ProcessManager(object):
def __init__(self):
self.devnull = open(os.devnull, 'w')
self.procs = {}
self.log = None
def log(self, msg):
... |
use_classifier.py | #!/usr/bin/env python3
from skimage import io, transform
import torch
import torchvision
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from classifier_net import Net
import atexit
import cv... |
misc.py | import subprocess
from fnmatch import fnmatch
import multiprocessing
from time import sleep, time
import itertools
import pathos
__copyright__ = "Copyright 2016-2020, Netflix, Inc."
__license__ = "BSD+Patent"
import sys
import errno
import os
import re
from vmaf import run_process
from vmaf.tools.scanf import sscanf... |
stockmarket.py | from __future__ import print_function
import random
import threading
import time
class StockMarket(object):
def __init__(self, marketname, symbols):
self.name = marketname
self.symbolmeans = {}
for symbol in symbols:
self.symbolmeans[symbol] = random.uniform(20, 200)... |
scheduler_job.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
#... |
runtests.py | #!/usr/bin/env python
from __future__ import print_function
import atexit
import os
import sys
import re
import gc
import heapq
import locale
import shutil
import time
import unittest
import doctest
import operator
import subprocess
import tempfile
import traceback
import warnings
import zlib
import glob
from context... |
test_kv.py | from __future__ import print_function, division, absolute_import
import copy
import operator
import sys
import threading
import time
import weakref
from collections import MutableMapping, OrderedDict
import pytest
from skein import kv
from skein.exceptions import ConnectionError
from skein.test.conftest import run_a... |
flowmeter_073018-1337.py | import logging
import os
import sys
import time
import argparse
import configparser
import datetime
from multiprocessing import Process
from pprint import pprint
#import threading
from binance.client import Client as BinanceClient
from binance.websockets import BinanceSocketManager
import dateparser
from pymongo imp... |
serve.py | # Most of this code is:
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
# The server command includes the additional header:
# For discussion of daemonizing:
# http://aspn.activestate.com/ASPN/C... |
mbed_greentea_cli.py |
"""
mbed SDK
Copyright (c) 2011-2016 ARM Limited
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 w... |
test_failure_2.py | import json
import logging
import os
import signal
import sys
import threading
import time
import numpy as np
import pytest
import redis
import ray
from ray.experimental.internal_kv import _internal_kv_get
from ray.autoscaler._private.util import DEBUG_AUTOSCALING_ERROR
import ray._private.utils
from ray.util.placeme... |
remote_settings.py | import platform
import urllib.request
import json
import threading
import time
from urllib.parse import urlencode
from copy import deepcopy
from .version import version
from .notifier_name import notifier_name
from .settings_data import SettingsData
# Query params to be appended to each GET request.
_NOTIFIER_INFO =... |
reservation.py | # Copyright 2017 Yahoo Inc.
# Licensed under the terms of the Apache 2.0 license.
# Please see LICENSE file in the project root for terms.
"""This module contains client/server methods to manage node reservations during TFCluster startup."""
from __future__ import absolute_import
from __future__ import division
from _... |
session_debug_testlib.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... |
p2p_stress.py | import testUtils
import p2p_test_peers
import random
import time
import copy
import threading
from core_symbol import CORE_SYMBOL
class StressNetwork:
speeds=[1,5,10,30,60,100,500]
sec=10
maxthreads=100
trList=[]
def maxIndex(self):
return len(self.speeds)
def randAcctName(self):
... |
Simulation.py | # Copyright 2017 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... |
smt2_parser.py | import sys
from sympy import *
from typing import Any, List
from multiprocessing import *
import os
# Parse input string into a list of all parentheses and atoms (int or str),
# exclude whitespaces.
def normalize_str(string: str) -> List[str]:
str_norm = []
last_c = None
for c in string:
if c.isal... |
tests.py | """Tests related to djmodels.db.backends that haven't been organized."""
import datetime
import threading
import unittest
import warnings
from djmodels.core.management.color import no_style
from djmodels.db import (
DEFAULT_DB_ALIAS, DatabaseError, IntegrityError, connection, connections,
reset_queries, transa... |
gui_advance.py | """
This is the main script of main GUI of the OXCART Atom Probe.
@author: Mehrpad Monajem <mehrpad.monajem@fau.de>
"""
import numpy as np
import nidaqmx
import time
import threading
import datetime
import os
# PyQt and PyQtgraph libraries
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import QThread, py... |
play_recorder_test_signal.py | """
Plays chirps repeatedly forever.
Different chirps can be configured for different channels.
I wrote this script to help test the Vesper recorder. Chirp test signals
should make it relatively easy to spot locations of dropped sample buffers
in test recording spectrograms.
The script allocates a fixed amount of sa... |
DjangoNetmikoProcesses.py | #!/usr/bin/env python
from netmiko import ConnectHandler
from datetime import datetime
from net_system.models import NetworkDevice, Credentials
import django
from multiprocessing import Process, current_process, Queue
import time
def show_arp_queue(a_device, q):
output_dict = {}
creds = a_device.credentials
re... |
registration.py | # Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# 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... |
__init__.py | import tempfile
import shutil
import importlib
import os
from multiprocessing import Process
from copy import copy
from execution.cd import cd
def initialize(task):
for step in task["steps"]:
plugin = importlib.import_module('execution.plugins.' + step["plugin"])
if "params_from_context" in step a... |
test_thread.py | import concurrent.futures
import datetime
import random
import sys
import threading
import time
sys.path.append('.')
from factorys import time_it
from milvus import Milvus
dimension = 512
number = 100000
table_name = 'multi_task'
def add_vector_task(milvus, vector):
status, ids = milvus.add_vectors(table_name=t... |
test_execution_state.py | import threading
import time
import datetime
from test.pytestutils import before
from queue import Queue, Empty
from unittest.mock import MagicMock, call
from codeguru_profiler_agent.utils.execution_state import ExecutionState
# this is to make sure the unit test does not run forever if there is a bug in the schedule... |
csv_list.py | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:set ts=4 sw=4 et:
# Copyright 2018-2019 Artem Smirnov
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licens... |
map_test.py | # Copyright 2017 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... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2018-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test neond shutdown."""
from test_framework.test_framework import NeonTestFramework
from test_framewor... |
ui.py | import os
import sys
import sdl2
import sdl2.ext
import argparse
from snake import SnakeGame, SnakeDirs
from snake_ai import SnakeAgent
from collections import deque
from threading import Thread, Lock
from tensorflow.keras.models import model_from_json
cell_size = 20
game_lock = Lock()
def draw_point(p, renderer, r, ... |
CinemaServer.py | #!/usr/bin/python
import threading
import socketserver
import socket
import os
import time
import serial # install pySerial
from pathlib import Path
import RPi.GPIO as GPIO
# using BCM GPIO 00..nn numbers
GPIO.setmode(GPIO.BCM) #/??
PYTHON_SERVER_PORT = 50000
PYTHON_SERVER_IP = "127.0.0.1" # Type there server's ip... |
pymolhttpd.py | # Copyright (C) Schrodinger, LLC.
# All Rights Reserved
#
# For more information, see LICENSE in PyMOL's home directory.
#
# pymolhttpd.py
#
# web server interface for controlling PyMOL
from __future__ import print_function
from __future__ import absolute_import
# we make extensive use of Python's build-in in web inf... |
tpu_estimator.py | # Copyright 2017 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... |
VChannel.py | # -*- coding: utf-8 -*-
# Copyright 2017-2020 NTT Communications
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
plaso_xmlrpc.py | # -*- coding: utf-8 -*-
"""XML RPC server and client."""
from __future__ import unicode_literals
import sys
import threading
# pylint: disable=import-error,wrong-import-order
if sys.version_info[0] < 3:
import xmlrpclib
import SimpleXMLRPCServer
import SocketServer
else:
from xmlrpc import server as SimpleXM... |
_ssh_utils.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
load_test.py | import argparse
import logging
import multiprocessing
import os
import re
import sys
import time
from datetime import timedelta, datetime
from threading import Thread
from tqdm import tqdm # type: ignore
from typing import Dict, Iterable, List, Tuple, Optional
sys.path.append(os.path.dirname(__file__))
sys.path.appen... |
stage.py | import time
import threading
import serial
try:
import thorlabs_apt as apt
except:
print('Thorlabs APT did not load properly - if needed, ensure that DLL has been installed!')
class Thorlabs_LTS150_xy(object):
def __init__(self, xMotorAddress = 45992790, yMotorAddress = 45951900):
self.x = apt.Motor(xMotorAddress... |
convert_aibee_tfrecords.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
import os
import random
import sys
import threading
import numpy as np
import six
import tensorflow as tf
import argparse
import json
# =========================Feature function===================... |
LSM9DS1.py | from smbus import SMBus
import threading
OUT_X_L_XL = 0x28
OUT_X_H_XL = 0x29
OUT_Y_L_XL = 0x2A
OUT_Y_H_XL = 0x2B
OUT_Z_L_XL = 0x2C
OUT_Z_H_XL = 0x2D
CTRL_REG6_XL = 0x20
class LSM9DS1(object):
"""Watches an LSM9DS1 to see if it is moving or not"""
def __init__(self, bus_num=1, address=0x6b):
super(LSM9DS1, s... |
multivent_client.py | #!/usr/local/bin/python
# UUT is running continuous pre/post snapshots
# subscribe to the snapshots and save all the data.
import threading
import epics
import argparse
import time
import datetime
import os
NCHAN = 16
# WF record, raw binary (shorts)
WFNAME = ":1:AI:WF:{:02d}"
# alt WF record, VOLTS. Kindof harder t... |
Tienda.py | import threading
import sys
import time
import random
from CODE.Cliente import Cliente
from CODE.Empleado import Empleado
from CODE.Proveedor import Proveedor
class Tienda(object):
#Declaramos los productos que se venden en la tienda
productos = {1:["disfraz de Dracula","Disfraz de zombie","disfraz de homb... |
bridge.py | # Copyright 2020 The FedLearner 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... |
open_poet.py | # Re-implmenetation of POET with ARS instead of ES and with A1 robot on
# procedurally generated environments
import numpy as np
import multiprocessing as mp
from multiprocessing import Process, Pipe
import argparse
from scenes.poet_env import create_poet_env
from copy import deepcopy
import random
import time
from e... |
test_regrtest.py | """
Tests of regrtest.py.
Note: test_regrtest cannot be run twice in parallel.
"""
import contextlib
import glob
import io
import os.path
import platform
import re
import subprocess
import sys
import sysconfig
import tempfile
import textwrap
import unittest
from test import libregrtest
from test import support
from t... |
master.py | import os
import threading
import time
import math
import pdb
import copy
import logging
import time
import numpy as np
from datetime import datetime
from hpbandster.core.dispatcher import Dispatcher
from hpbandster.core.result import Result
from hpbandster.core.base_iteration import WarmStartIteration
class Maste... |
node_provider.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import random
import threading
from collections import defaultdict
import logging
import boto3
import botocore
from botocore.config import Config
from ray.autoscaler.node_provider import NodeProvider
from ray... |
app.py | # rsync -Pr /Users/eczech/repos/misc/wakipy/* pi@rb1:/home/pi/repos/wakipy/
from flask import Flask
from flask import request
from flask import jsonify
import argparse
import traceback
import lights
import schedule
import threading
import time
import os.path as osp
import music
import logging
import config
logging.bas... |
run_messaging_hub.py | #!/usr/bin/env python
import argparse
import sys
import threading
import time
from pocs.utils.config import load_config
from pocs.utils.logger import get_root_logger
from pocs.utils.messaging import PanMessaging
the_root_logger = None
def say(fmt, *args, error=False):
if args:
msg = fmt.format(*args)
... |
schedule_service.py | import json
import logging
import os
import sched
import threading
import time
from datetime import timedelta
from auth.user import User
from config.config_service import ConfigService
from execution.execution_service import ExecutionService
from execution.id_generator import IdGenerator
from scheduling import schedul... |
win32eventreactor.py | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
A win32event based implementation of the Twisted main loop.
This requires pywin32 (formerly win32all) or ActivePython to be installed.
To install the event loop (and you should do this before any connections,
listeners or connectors are add... |
fixedLoad.py | #!/usr/bin/python
import sys, httplib, uuid, random,time, resource
from threading import Thread
from urllib3 import HTTPConnectionPool
from multiprocessing import Process
httplib.HTTPConnection.debuglevel = 0
KeyspaceName = 'm2m'
tablename = 'sensor'
HAProxyIP="localhost"
HAProxyPort='8080'
BaseURL = HAProxyIP+':'... |
thread_semaphore.py | # -*- coding: utf-8 -*-
"""Using a Semaphore to synchronize threads"""
import threading
import time
import random
# The optional argument gives the initial value for the internal
# counter;
# it defaults to 1.
# If the value given is less than 0, ValueError is raised.
semaphore = threading.Semaphore(0)
def consumer(... |
logging.py | """Logging utilities."""
import asyncio
from asyncio.events import AbstractEventLoop
from functools import wraps
import inspect
import logging
import threading
import traceback
from typing import Any, Callable, Optional
from .async_ import run_coroutine_threadsafe
class HideSensitiveDataFilter(logging.Filter):
"... |
robot_module.py | #!/usr/bin/env python
# coding: utf-8
import atexit
import weakref
import threading
class RobotModule:
"""
Abstract class describing a robot module. The Sensor and Controller classes
inherit that class
"""
_instances = set()
def __init__(self, robot_model, physics_client):
"""
... |
img_scraperNEW.py | from requests_html import HTMLSession
from .image_scraper import *
from PIL import Image, UnidentifiedImageError
import multiprocessing
import secrets
from io import BytesIO
class ImageScraper(Image_Scraper):
@staticmethod
def get_im_bytes(image):
image = Image.open(image)
im_bytes = BytesIO(... |
connections.py | # BEGIN_COPYRIGHT
#
# Copyright 2009-2015 CRS4.
#
# 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_selenium.py | import unittest
import re
import threading
import time
from selenium import webdriver
from app import create_app, db
from app.models import User, Role, Post, Permission
class SeleniumTestCase(unittest.TestCase):
client = None
@classmethod
def setUpClass(cls):
#start Chrome
try:
... |
keepkey.py | from binascii import hexlify, unhexlify
import traceback
import sys
from electrum.util import bfh, bh2u, UserCancelled
from electrum.bitcoin import (b58_address_to_hash160, xpub_from_pubkey,
TYPE_ADDRESS, TYPE_SCRIPT,
is_segwit_address)
from electrum import c... |
ip_lib.py | # Copyright 2012 OpenStack Foundation
# 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 requ... |
test_closing.py | from fixtures import * # noqa: F401,F403
from flaky import flaky
from lightning import RpcError
from utils import only_one, sync_blockheight, wait_for, DEVELOPER, TIMEOUT, VALGRIND, SLOW_MACHINE, COMPAT
import os
import queue
import pytest
import re
import threading
import unittest
@unittest.skipIf(not DEVELOPER, "... |
up2k.py | #!/usr/bin/env python3
from __future__ import print_function, unicode_literals
"""
up2k.py: upload to copyparty
2021-10-04, v0.7, ed <irc.rizon.net>, MIT-Licensed
https://github.com/9001/copyparty/blob/hovudstraum/bin/up2k.py
- dependencies: requests
- supports python 2.6, 2.7, and 3.3 through 3.10
- almost zero err... |
base_test.py | # Copyright 2013-present Barefoot Networks, 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 agre... |
EmoteHandler_StreamlabsSystem.py | import sys
import json
import os
import time
import threading
import codecs
ScriptName = "Emote Handler"
Website = "http://www.github.com/th3bfg"
Description = "Emote Handler for Streamlabs Bot"
Creator = "th3bfg"
Version = "0.0.6"
# Handler Variables
path = os.path.dirname(__file__)
configFile = "EmotesConfig.json"
... |
recorder.py | # coding: utf8
import copy
import heapq
import os
import shutil
import socket
import threading
import time
import json
import traceback
import datetime
from . import config, utils, constant
from .replay_file import ReplayFile
from .translation import Translation
from .packet_processor import PacketProcessor
from .log... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.