source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
stress_test.py | import threading
import requests
import random
from time import time, sleep
times = []
#print(requests.post('http://84.201.158.229:8080/api/start_conversation').json())
def print_times():
while True:
times_len = len(times)
print(times_len, end=' ')
if times_len == THREAD_COUNT * REQUESTS_... |
test_ftplib.py | """Test script for ftplib module."""
# Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS
# environment
import ftplib
import asyncore
import asynchat
import socket
import io
import errno
import os
import time
try:
import ssl
except ImportError:
ssl = None
from unittest import TestCase, skipUnless
... |
server.py | import socket
import threading
import time
import cypher
import utils
import os
import rsa
import pickle
class Server():
UNLOCK = 'unlockCrypt'
def __init__(self, host='', port=55555):
self.key = self.UNLOCK
self.host = host
self.port = port
self.msg_arg... |
mouse_rel_view.py | import json
import math
import os
import random
import socket
import threading
import time
from concurrent.futures import thread
from queue import Queue
import RPi.GPIO as GPIO
from utils.defines import *
from utils.interface import *
def atomWarpper(func):
lock = threading.Lock()
def f(*args, **kwargs):
... |
__init__.py | # !/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: phicomm_m1.py
# Author: binss
# Create: 2018-08-24 19:10:15
# Description: No Description
#
import logging
import json
import re
import threading
import asyncio
from tornado.tcpserver import TCPServer
from tornado.iostream import Strea... |
test_threading.py | import random
import threading
def list_append(count, id, out_list):
"""
Creates an empty list and then appends a
random number to the list 'count' number
of times. A CPU-heavy operation!
"""
for i in range(count):
out_list.append(random.random())
if __name__ == "__main__":
size ... |
EWSv2.py | import email
import hashlib
import subprocess
import warnings
from collections import deque
from multiprocessing import Process
import exchangelib
from CommonServerPython import *
from cStringIO import StringIO
from exchangelib import (BASIC, DELEGATE, DIGEST, IMPERSONATION, NTLM, Account,
Bod... |
network.py |
import re
import subprocess
import threading
class AccessPoint:
def __init__(self, ssid, quality):
self.ssid = ssid
self.quality = quality
def output(cmd):
op = subprocess.check_output(cmd, shell=True)
if op:
return op.strip()
def card_info():
return output('lspci | grep -... |
jsview_3d.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from libtbx.math_utils import roundoff
import traceback
from cctbx.miller import display2 as display
from cctbx.array_family import flex
from cctbx import miller, sgtbx
from scitbx import graphics_utils
from scitbx import matrix
im... |
test_cdecimal2.5.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... |
livereload_tests.py | #!/usr/bin/env python
import contextlib
import email
import io
import os
import sys
import threading
import time
import unittest
from pathlib import Path
from unittest import mock
from mkdocs.livereload import LiveReloadServer
from mkdocs.tests.base import tempdir
class FakeRequest:
def __init__(self, content):... |
__init__.py | # -*- coding: utf-8 -*-
"""
keyboard
========
Take full control of your keyboard with this small Python library. Hook global events, register hotkeys, simulate key presses and much more.
## Features
- **Global event hook** on all keyboards (captures keys regardless of focus).
- **Listen** and **send** keyboard event... |
graphic_engine.py | from physical_engine.physical_engine import PhysicalEngine
from chuncks.chunck_loader import ChunckLoader
from views.main_menu_view import MainMenuView
from views.game_view import GameView
from character.player import Player
from tkinter import *
import PIL.ImageTk
import PIL.Image
import threading
import time
import j... |
v3.py | import cv2
from cv2 import imshow
from cv2 import waitKey
from cv2 import INTER_LINEAR
from cv2 import INTER_NEAREST
from cv2 import imwrite
from cv2 import INTER_BITS
from cv2 import INTER_LANCZOS4
from cv2 import INTER_LINEAR_EXACT
from cv2 import INTER_AREA
from cv2 import INTER_CUBIC
import numpy as np
import os
fr... |
TAMV.py |
# Error codes
# [0] No error
# [1] CV2 ImportError
# [2] DuetWebAPI ImportError
# [3] SSH Not Permitted Error
# [4] Printer is not a Duet V2 or V3
# [5]
# Imports
import numpy as np
import threading
import argparse
import datetime
import imutils
import queue
import time
import sys
import os
try:
import cv2
excep... |
run.py | import os
import threading
import time
import sys, getopt
def client(i,results,loopTimes):
print("client %d start" %i)
command = "./single-cold_warm.sh -R -t " + str(loopTimes)
r = os.popen(command)
text = r.read()
results[i] = text
print("client %d finished" %i)
def warmup(i,warmupTimes,a... |
compile_json.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import Queue
import threading
import argparse
import os
import gzip
import unicodedata, re
from keyvi.compiler import JsonDictionaryCompiler
from keyvi.util import JumpConsistentHashString
control_chars = ''.join(map(unichr, range(0,32)))
control_char_re = re.compile('[... |
grpc_asyncio.py | __copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import asyncio
import functools
import inspect
import threading
from concurrent import futures
from grpc import _server
from ..helper import use_uvloop, typename
from ..logging import default_logger
use_uvloop()
... |
dream_api_master.py | import asyncio
from threading import Thread
from mitmproxy.master import Master
from mitmproxy.options import Options
from mitmproxy.proxy import ProxyServer, ProxyConfig
from mitmproxy.tools.web.master import WebMaster
from mitm.addons.epic import EpicAddon
from mitm.addons.origin import OriginAddon
from setup.confi... |
genericeventwrapper.py | import json
import threading
__author__ = 'Daniel Puschmann'
import os
from virtualisation.misc.jsonobject import JSONObject
from messagebus.rabbitmq import RabbitMQ
from virtualisation.misc.threads import QueueThread
from virtualisation.annotation.genericannotation import GenericAnnotation
from virtualisation.triple... |
1.context1.py | import multiprocessing as mp
def foo(q):
q.put('hello')
if __name__ == '__main__':
mp.set_start_method('spawn') # 不要过多使用
q = mp.Queue()
p = mp.Process(target=foo, args=(q, ))
p.start()
print(q.get())
p.join() |
input_server.py | # first to start the nameserver start: python -m Pyro4.naming
import time
from threading import Thread
import numpy as np
import Pyro4
from plaidrl.launchers import conf as config
Pyro4.config.SERIALIZERS_ACCEPTED = set(["pickle", "json", "marshal", "serpent"])
Pyro4.config.SERIALIZER = "pickle"
device_state = Non... |
zerorpc_server.py | from gevent.monkey import patch_all
patch_all()
from gevent import Greenlet, sleep
from gevent.queue import Queue as GQueue
from multiprocessing import Process, Queue
from multiprocessing.queues import Empty
import os
import zerorpc
import json
import logging
from copy import deepcopy
from salt.client.api import APICli... |
allsettings.py | # Released under the MIT License. See LICENSE for details.
#
"""UI for top level settings categories."""
from __future__ import annotations
from typing import TYPE_CHECKING
import _ba
import ba
if TYPE_CHECKING:
from typing import Tuple, Optional, Union
class AllSettingsWindow(ba.Window):
"""Window for se... |
monitor.py | """
Support for heartbeat and file monitoring in wrappers.
"""
import os
import threading
class BaseMonitor(object):
"""
Base class for monitors.
name: string
Name for the monitor thread,
delay: float
The delay in seconds between calls to :meth:`poll`.
monitor_id: string
... |
sensor.py | from threading import Thread
class Sensor():
def __init__(self, manager):
self.manager = manager
def start(self):
Thread(target=self.run, args=[]).start()
|
api.py | from django.db.utils import IntegrityError
from django.db.models import Q, Sum
from django.contrib.auth import authenticate
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import generics, status, exceptions, permissions, viewsets, mixins
from rest_framework.ex... |
main.py | from kivymd.app import MDApp
from kivymd.uix.screen import MDScreen
from kivy.clock import mainthread
from kivy.properties import NumericProperty
from android.permissions import Permission, request_permissions
import sync
import threading
import math
import time
# thread constants
DOWNLOAD_THREAD_COUNT = 6
THREAD_SPA... |
body_temperature_monitor.py | __author__ = "Jerry Overton"
__copyright__ = "Copyright (C) 2022 appliedAIstudio LLC"
__version__ = "0.0.1"
# needed to access host and port environment variables
import os
# needed to run temperature monitoring on a non-blocking loop
import threading
import time
# the Highcliff ai_actions we are going to implement
... |
winmonitor.py | import logging
import multiprocessing as mp
import os
import socket
import sys
from typing import Any
import win32event
import win32service
import win32serviceutil
from simplemonitor import monitor
r"""
Notes:
This service expects the 'monitor.ini' file to exist in the same directory.
If you receive an error "The ... |
LocalMaximaRewardFunction2D.py | import math
from threading import Thread
from time import sleep
from typing import Tuple
import numpy as np
from examples.PolicyGradient.TestRigs.Interface.RewardFunction2D import RewardFunction2D
"""
In 3D Space (but 2D in the sense 2 degrees of freedom in state space) this Reward Function has a local maximas
as a... |
test_serialize.py | import contextlib
import gc
import pickle
import runpy
import subprocess
import sys
import unittest
from multiprocessing import get_context
import numba
from numba.core.errors import TypingError
from numba.tests.support import TestCase
from numba.core.target_extension import resolve_dispatcher_from_str
from numba.clou... |
session.py | import typing
import logging
import threading
import time
import sys
from .api import BSHLocalAPI, JSONRPCError
from .device import BSHLocalDevice
from .room import BSHLocalRoom
from .services_impl import SUPPORTED_DEVICE_SERVICE_IDS
logger = logging.getLogger("bshlocal")
class BSHLocalSession:
def __init__(sel... |
gceProvisioner.py | # Copyright (C) 2015-2021 Regents of the University of California
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
multiprocessing2.py | import numpy as np
import multiprocessing as mp
import os
from time import sleep
from wzk import change_tuple_order
# FINDING h5py objects can not be pickled
# -> read the files inside the function instead / h5py objects are only references anyway
# Joblib: Threading backend allows shared memory
# FINDING
def... |
rustws.py | import logging
import time
from datetime import datetime
from threading import Thread
from typing import Optional
import websocket
from .rustplus_pb2 import AppMessage, AppRequest
from ..structures import RustChatMessage
from ...exceptions import ClientNotConnectedError
class RustWebsocket(websocket.WebSocket):
... |
geemap.py | """Main module for interactive mapping using Google Earth Engine Python API and ipyleaflet.
Keep in mind that Earth Engine functions use both camel case and snake case, such as setOptions(), setCenter(), centerObject(), addLayer().
ipyleaflet functions use snake case, such as add_tile_layer(), add_wms_layer(), add_mi... |
test_lib_lmdbslab.py | import os
import asyncio
import pathlib
import multiprocessing
import synapse.exc as s_exc
import synapse.glob as s_glob
import synapse.common as s_common
from unittest.mock import patch
import synapse.lib.base as s_base
import synapse.lib.const as s_const
import synapse.lib.lmdbslab as s_lmdbslab
import synapse.lib.... |
test_random.py | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_raises, assert_equal,
assert_warns)
from numpy import random
from numpy.compat import asbytes
import sys
class TestSeed(TestCase):
def test_sc... |
utils_test.py | from __future__ import print_function, division, absolute_import
from contextlib import contextmanager
from glob import glob
import logging
from multiprocessing import Process, Queue
import os
import shutil
import signal
import socket
from subprocess import Popen, PIPE
import sys
from time import time, sleep
import uu... |
voicea.py | #!/usr/bin/env python
import requests
import json
import pyttsx3
import speech_recognition as sr
import re
import threading
import time
import os
from django.core.management.base import BaseCommand
from tracker.models import Country, Total
API_KEY = 'txGsgA6p2w46'
PROJECT_TOKEN = 't3GeyApmVs_c'
RUN_TOKEN = 'tz24XhG... |
test_events.py | #
# Copyright 2021 Ocean Protocol Foundation
# SPDX-License-Identifier: Apache-2.0
#
import logging
import os
import threading
import elasticsearch
import json
import time
from jsonsempai import magic # noqa: F401
from eth_keys import KeyAPI
from eth_keys.backends import NativeECCBackend
from unittest.mock import pat... |
01.py | import threading
import time
import string
class LockNamed:
"""Custom wrapper for threading.Lock, contains name (cannot subclass .Lock)"""
def __init__(self, name: str):
self.name = name
self._locked = False
self._lock = threading.Lock()
def acquire(self):
self._lock.acqui... |
test_smtplib.py | import asyncore
import email.mime.text
import email.utils
import socket
import smtpd
import smtplib
import io
import re
import sys
import time
import select
import errno
import unittest
from test import support, mock_socket
try:
import threading
except ImportError:
threading = None
HOST = support.HOST
if sy... |
run_keras_server_redis.py | # USAGE
# Start the server:
# python run_keras_server.py
# Submit a request via cURL:
# curl -X POST -F image=@jemma.png 'http://localhost:5000/predict'
# Submita a request via Python:
# python simple_request.py
# import the necessary packages
from keras.applications import ResNet50
from keras.preprocessing.image i... |
playsound.py | import logging, coloredlogs
import json
import time
from threading import Thread
from modules.api import API
from modules.database import Database
from modules.config import *
from modules.timer import Timer
import os.path
import sys
database = Database(db_host, db_user, db_pass, db_name, db_autocommit)
database.datab... |
fraud-detector.py | #!python
#
# Copyright 2021 mmontour@enya.ai. Internal use only; all rights reserved
#
# Basic fraud checker. Reads state roots from SCC and checks them against
# actual L2 values, reporting mismatches. Note - code was copied from
# stress_tester.py and contains a lot of irrelevant cruft to be cleaned up
# later.
imp... |
gui_03.py | import tkinter
from tkinter import simpledialog
from tkinter import ttk
from queue import Queue
class ProgressDialog(simpledialog.SimpleDialog):
def __init__(self, master, text='', title=None, class_=None):
super().__init__(master=master, text=text, title=title, class_=class_)
self.default = None
... |
mission_test.py | #!/usr/bin/env python2
#***************************************************************************
#
# Copyright (c) 2015-2016 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are m... |
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.a... |
cloud.py | """
Object Store plugin for Cloud storage.
"""
import logging
import multiprocessing
import os
import os.path
import shutil
import subprocess
import threading
import time
from datetime import datetime
from galaxy.exceptions import (
ObjectInvalid,
ObjectNotFound,
)
from galaxy.util import (
directory_hash... |
http.py | import scrollphathd
import threading
import time
from datetime import datetime
from scrollphathd.fonts import font5x7, font5x5
from argparse import ArgumentParser
try:
from queue import Queue, Empty
except ImportError:
from Queue import Queue, Empty
from .action import Action
from .stoppablethread import S... |
test_socket.py | import unittest
from test import support
import errno
import io
import socket
import select
import tempfile
import time
import traceback
import queue
import sys
import os
import array
import platform
import contextlib
from weakref import proxy
import signal
import math
import pickle
import struct
try:
import multi... |
ars.py | #!/usr/bin/python3
# -*- coding:utf-8 -*-
# import threading
# import multiprocessing
from app.adb import adb
from app.door import Door
from app.serv import serv
from config import FFPLAY, ADB
from tkinter import messagebox
dr = Door()
def size(udid):
srcsize = adb.screenSize(udid=udid)
k = 350.0/float(srcs... |
tensorFI.py | #!/usr/bin/python
# Library for performing fault injections into TensorFlow graphs (in place)
# Uses the fault injection functions defined in modifyGraph and ficonfig
import tensorflow as tf
import printGraph as pg
import modifyGraph as mg
from injectFault import initFIConfig, initFILog, logRun
from fiConfig import c... |
tentacle.py | import time
import threading
import logging
import pyDatalog
from tp_utils import pipe
logger = logging.getLogger(__name__)
def monitor_debug_info(entity_zoo, extra):
pyDatalog.Logic(extra['logic'])
while True:
try:
data = pipe.read_debug_pipe()
except Exception as err:
... |
monitors.py | import logging
import threading
from .sleeper import Sleeper
from .web_compat import register_postfork_function
log = logging.getLogger(__name__)
DEFAULT_MONITOR_THREAD_JOIN_TIMEOUT = 5
class Monitors:
def _init_monitor_thread(self, name, target_name=None, target=None, start=False, config=None):
self.... |
TestUnderProcessMode.py | from unittest import TestCase
import unittest
from multiprocessing import Process
import time
import pinpointPy
import random
class TestUnderProcessMode(TestCase):
def tearDown(self):
pinpointPy.force_flush_trace(4)
def _test_api_flow(self):
self.assertTrue(pinpointPy.set_agent(collector_hos... |
exchange_rate.py | from datetime import datetime
import inspect
import requests
import sys
from threading import Thread
import time
import traceback
import csv
from decimal import Decimal
from electrum_ltc.bitcoin import COIN
from electrum_ltc.plugins import BasePlugin, hook
from electrum_ltc.i18n import _
from electrum_ltc.util import ... |
test_utils.py | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
multithread_vector_env.py | # MIT License
#
# Copyright (c) 2020 Preferred Networks, Inc.
#
# 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
# to use, copy, mo... |
XApi.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from .XQueueEnum import *
from .XSpi import *
import threading
import queue
import time
import logging
logger = logging.getLogger("XApi")
# function
fnOnRespone = WINFUNCTYPE(c_void_p, c_char, c_void_p, c_void_p, c_double, c_double, c_void_p, c_int, c_void_p, c_int,
... |
bot.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2009-2015 Ben Kurtovic <ben.kurtovic@gmail.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 ... |
daq.py | """ A command line program to control the pattern the LED plays when triggered.
This MUST be running in order to trigger the LED.
If no wave is specified the type will be a square wave.
Hit escape or q twice to exit (or that special key once).
Usage:
daq.py [--on=<ms> --off=<ms> --rep=<int> --minV=<V> -... |
lib.py | import random
import socket
import threading
import struct
import time
class Datagetter(object):
"""
gets one data point at a time
"""
_dtype = None # "random" or "thermal"
_zone = None
_entered = None
temp_file_name = None
temp_file_object = None
_last_val = None
delay = 0.0... |
context_test.py | #
# Copyright 2008 The ndb 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 l... |
step_5_ABS_surveys_topic modelling.py | # -*- coding: utf-8 -*-
"""
Created on Sat Aug 21 16:49:33 2021
@author: roman
"""
#########
# can pre-defined data categories used in variety of ABS surveys to monitor topics of importance
# and test them as hypotheses in our topic modelling data worklow
# applied to parliamentary data streams across all parliament... |
__init__.py |
###############################################################################
# DO NOT MODIFY THIS FILE #
###############################################################################
import inspect
import logging
import sys
import textwrap
import time
from coll... |
runtests.py | #!/usr/bin/env python
import json
import os
import platform
import select
import signal
import time
import subprocess
import unittest
import sys
import re
from threading import Thread
BASE_TIMEOUT = 10
TEST_ROOT = os.path.abspath(os.path.dirname(__file__))
CASPERJS_ROOT = os.path.abspath(os.path.join(TEST_ROOT, '..'... |
shell.py | # Date: 06/04/2018
# Author: Pure-L0G1C
# Description: Communicate with server
import sys
import socket
import subprocess
from os import chdir
from time import sleep
from queue import Queue
from . import ssh, sftp, screen
from threading import Thread, RLock
class Shell(object):
def __init__(self, s... |
app.py | # encoding: utf-8
'''
A REST API for Salt
===================
.. versionadded:: 2014.7.0
.. py:currentmodule:: salt.netapi.rest_cherrypy.app
:depends:
- CherryPy Python module. Versions 3.2.{2,3,4} are strongly
recommended due to a known `SSL error
<https://bitbucket.org/cherrypy/cherrypy/issue/1298/... |
keepkey.py | from binascii import hexlify, unhexlify
import traceback
import sys
from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING
from electrum_mona.util import bfh, bh2u, UserCancelled, UserFacingException
from electrum_mona.bip32 import BIP32Node
from electrum_mona import constants
from elect... |
centrifuge.py | import logging
import socket
from multiprocessing import Process
from time import sleep
from Crypto import Random
from core.clients.handler import ClientsHandler
from core.crypto.cipher import AESCipher
from core.messages.common import PingResponse
from core.messages.encrypted import EncryptedResponse
from core.setti... |
StormEyeSetup.py | ## Oszust OS Storm Eye - Setup Installer 2.1.2 - Oszust Industries
installerVersion = "v2.1.2"
import os, subprocess, sys
def fixPython():
print("Installing Python Packages...")
install = "Python"
try: subprocess.run(['py -m pip install --upgrade pip setuptools > /dev/null'], check = True)
except... |
client2.py | import socket
from threading import Thread
from datetime import datetime
from colorama import Fore, init, Back
import random
init()
colors = [Fore.BLUE, Fore.CYAN, Fore.GREEN, Fore.LIGHTBLACK_EX,
Fore.LIGHTBLUE_EX, Fore.LIGHTCYAN_EX, Fore.LIGHTGREEN_EX,
Fore.LIGHTMAGENTA_EX, Fore.LIGHTRE... |
handlers.py | # Copyright 2001-2016 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
OSC.py | #!/usr/bin/python
"""
This module contains an OpenSoundControl implementation (in Pure Python), based (somewhat) on the
good old 'SimpleOSC' implementation by Daniel Holth & Clinton McChesney.
This implementation is intended to still be 'Simple' to the user, but much more complete
(with OSCServer & OSCClient classes)... |
freeze_source.py | # Software License Agreement (BSD License)
#
# Copyright (c) 2016, Clearpath Robotics
# 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 ... |
device.py | # -*- coding: utf-8 -*-
import os
import sys
import json
import time
import logging
import threading
import logging.config
import numpy as np
from datetime import datetime
from collections import defaultdict
from .io import discover_hosts, io_from_host, Ws
from .services import name2mod
from anytree import AnyNode, ... |
cmd.py | # coding: utf-8
import os
import sys
import subprocess
import logging
import threading
import webbrowser
from datetime import datetime
from functools import partial
import sublime
from .util import get_executable, get_setting, text_type
from .helpers import GitRepoHelper
logger = logging.getLogger('SublimeLegit.cmd... |
parallel.py | import datetime
import logging
import os
import shutil
import tempfile
import signal
import traceback
from multiprocessing import Process, Manager, Pipe
from tests.common.helpers.assertions import pytest_assert as pt_assert
logger = logging.getLogger(__name__)
class SonicProcess(Process):
"""
Wrapper class a... |
driver.py | #!/usr/bin/env python
import roslib; roslib.load_manifest('ur_driver')
import time, sys, threading, math
import copy
import datetime
import socket, select
import struct
import traceback, code
import optparse
import SocketServer
from BeautifulSoup import BeautifulSoup
import rospy
import actionlib
from sensor_msgs.msg ... |
test_reading.py | # coding=utf-8
from __future__ import with_statement
import random, threading, time
import pytest
from whoosh import fields, formats, reading
from whoosh.compat import b, u, xrange
from whoosh.reading import SegmentReader
from whoosh.filedb.filestore import RamStorage
from whoosh.util.testing import TempIndex
def _... |
tunneling.py | """
This file provides remote port forwarding functionality using paramiko package,
Inspired by: https://github.com/paramiko/paramiko/blob/master/demos/rforward.py
"""
import select
import socket
import sys
import threading
from io import StringIO
import warnings
import paramiko
def handler(chan, host, port):
so... |
views.py | import ast
import json
import psutil
import os
import yaml
from django.http import HttpResponse, Http404
from django.shortcuts import get_object_or_404, render
from django.views.generic import View
from django.core.cache import caches
from django.conf import settings
from django.forms import model_to_dict
from pytz im... |
you_tube_downloader_v1.0.0.py | # -------------------------------------------
# module import
from moviepy.video.io.VideoFileClip import VideoFileClip
from webdriver_manager.firefox import GeckoDriverManager
from webdriver_manager.chrome import ChromeDriverManager
from multiprocessing import cpu_count
from bs4 import BeautifulSoup as bs
from o... |
master.py | """Master process which detects hardware and launches controllers."""
import collections
import json
import logging
import multiprocessing
import select
import shutil
import socket
import threading
import time
from pathlib import Path
import pyudev
import setproctitle
from .devices import BOARDS
LOGGER = logging.ge... |
client.py | #!/usr/bin/python3
# from server import Server
import argparse
import logging
import datetime
import h5py
import socket
import sys
import ismrmrd
import multiprocessing
from connection import Connection
import time
import os
defaults = {
'address': 'localhost',
'port': 9002,
'outfile': ... |
firehose.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# (c) B.Kerler 2018-2019
import binascii
import io
import platform
import time
import json
from struct import unpack
from binascii import hexlify
from queue import Queue
from threading import Thread
from edlclient.Library.utils import *
from edlclient.Library.gpt import gpt
f... |
example2.py | import threading
def writer():
global text
global wcount
while True:
with wcounter:
wcount += 1
if wcount == 1:
read_try.acquire()
with resource:
print(f'Writing being done by {threading.current_thread().name}.')
text += f'Wr... |
app.py | import streamlit as st
from streamlit.ReportThread import add_report_ctx
import SessionState
import pandas as pd
import numpy as np
import os
import sys
import json
import time
from datetime import datetime
import subprocess
import threading
from glob import glob
from random import randint
def generate_json(mode,ba... |
example_test.py | from __future__ import print_function, unicode_literals
import os
import random
import re
import socket
import string
from threading import Event, Thread
import ttfw_idf
from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket
from tiny_test_fw import Utility
def get_my_ip():
s = socket.socket(socket.... |
runExp.py | from os import set_inheritable
import Env
import multiprocessing
def run_test(size=(10,10), test_num=10, episode_num=250):
"""
"""
################################ Multi-Training Test ########################################
settings = [ (False, 'monte_carlo'),
(False ,'SARSA'),
... |
contract.py | from node import *
import threading
class Contract(Node):
def __init__(self):
Node.__init__(self)
self.customers = {} # {url: collateral, url:[key, collateral], ...}
self.merchants = {} # {url: [key, collateral], url:[key, collateral], ...}
self.current_transactions = [] # {'transac... |
tripAdvisorScrapev2.py | import requests
from bs4 import BeautifulSoup, Tag
import timeit
import re
import multiprocessing
import time
import timeit
import csv
import os
import xlsxwriter
from multiprocessing import Pool
from fake_useragent import UserAgent
from selenium import webdriver
from phantomjs_bin import executable_path
... |
lisp.py | # -----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain... |
bpytop.py | #!/usr/bin/env python3
# pylint: disable=not-callable, no-member, unsubscriptable-object
# indent = tab
# tab-size = 4
# Copyright 2021 Aristocratos (jakob@qvantnet.com)
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ... |
distributed_train.py | import os
import logging
import time
import random
import math
import re
import json
from copy import deepcopy
import numpy as np
import torch
from torch.optim import Adam
from torch.multiprocessing import Process
from tqdm import tqdm
import torch.distributed as dist
from transformers import BertTokenizer
from dora ... |
support.py | """
Assorted utilities for use in tests.
"""
import cmath
import contextlib
import enum
import gc
import math
import platform
import os
import shutil
import subprocess
import sys
import tempfile
import time
import io
import ctypes
import multiprocessing as mp
import warnings
import traceback
from contextlib import con... |
schedule.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@File : LogHandler.py
@Time : 2019-06-19 10:45
@Author : Sky.z
@Version : 1.0
@Contact : skyz319@gmail.com
@License : (C)Copyright 2017-2018, Sky.z
@Desc : None
"""
import aiohttp
import asyncio
import time
from multiprocessing import Process
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.