source
stringlengths
3
86
python
stringlengths
75
1.04M
tests.py
"""Policy daemon related tests.""" import asyncio # from mock import patch from asynctest import patch from multiprocessing import Process import socket import time import redis from django.conf import settings from django.core.management import call_command from django.test import TransactionTestCase from django.ur...
pyPeekTCP_1pol.py
# === Start Python 2/3 compatibility from __future__ import absolute_import, division, print_function, unicode_literals from future.builtins import * # noqa pylint: disable=W0401, W0614 from future.builtins.disabled import * # noqa pylint: disable=W0401, W0614 # === End Python 2/3 compatibility from future import...
utils.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Dec 26 10:36:20 2016 @author: pavel """ import logging import threading from tempfile import NamedTemporaryFile APP = "mime-editor-gui" def async_method(func): def start(*args, **kwargs): thr = threading.Thread(target = func, args = arg...
sram_trace_generator.py
import numpy as np import multiprocessing as mp from multiprocessing import Array, Process # output is the ifmap trace, filter trace, and ofmap # hyper parameters: systolic array size (cols, rows) # hyper_parameter: s1 (pixels in filter) # hyper_parameter: s2 (# of filters) # hyper_parameter: T (ofmap pixels in one ch...
example_jack_o_lantern.py
# Python code generated by CAIT's Visual Programming Interface import random import cait.essentials import threading face_coordinate = None screen_center = None rotate_power = None playing_audio = None x1 = None audio_list = None x2 = None face_center = None person = None coordinates = None face = None power = None s...
test_client.py
# Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (a...
main.py
''' Created on 2 Jan 2017 @author: chrisdoherty ''' from Application import Application from threading import Thread from time import sleep app = Application() Thread(target = app.hub_room_thread).start() sleep(1) app.run()
autoreload.py
# -*- coding: utf-8 -*- # # Copyright (C)2006-2009 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software consis...
APC_STOW_MACHINE.py
#! /usr/bin/env python import roslib import rospy import smach import smach_ros import threading from states.InitData import InitData from states.TestJoints import TestJoints from states.InitRobot import InitRobot from states.StopAbort import StopAbort from states.GetEmptySpace import GetEmptySpace from states.Mov...
main.py
#!/usr/bin/python import multiprocessing from multiprocessing import Pool from multiprocessing.pool import ThreadPool import threading import numpy as np import pyarrow as pa import pysam import pandas as pd import re import hashlib ''' import numpy as np import pandas as pd import pyarrow as pa import pyarrow.plasm...
__init__.py
#!/usr/bin/python import base64 from binascii import hexlify from cryptography import x509 from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes from distutils.spawn import find_executable from kvirt import common from kvirt.common import error, pprint, warning from...
time_lapse.py
import threading import datetime import time def get_time_interval_days(): interval_prompt = "Please enter how many days for each time interval: " interval_days = raw_input(interval_prompt) return int(interval_days) def get_time_interval_hours(): interval_prompt = "Please enter how many hours for each...
twitter.py
import datetime import logging import threading import tweepy from pajbot import utils from pajbot.managers.db import DBManager from pajbot.models.twitter import TwitterUser from pajbot.utils import time_since from pajbot.utils import tweet_prettify_urls log = logging.getLogger(__name__) class TwitterManager: ...
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 # we make extensive use of Python's build-in in web infrastructure import BaseHTTPServer, cgi, urlparse import StringIO, socket # w...
balancer.py
#! /usr/bin/env python3.7 import imp import logging import os import sys import threading import time from typing import Any, Callable, Dict, List from modules import twitch_irc from modules.saltybot import SaltyBot from modules.module_errors import DeactivatedBotException from modules.module_errors import NewBotExce...
newclient.py
from socket import socket, AF_INET, SOCK_DGRAM, SOL_SOCKET, SO_BROADCAST, SO_REUSEPORT, gethostname, gethostbyname from threading import Thread import pyaudio class Client: def __init__(self, host='', port=37020, buffer_size=4096, format=pyaudio.paInt16, channels=2, rate=44100, chunk=256): self._host = h...
worker.py
import logging import os import shutil from subprocess import PIPE, Popen import threading import time import traceback import socket import http.client import sys from typing import Optional, Set, Dict import psutil import docker from codalab.lib.telemetry_util import capture_exception, using_sentry import codalab.w...
server.py
""" Using python 3.8 server side """ import socket import threading from concurrent.futures import ThreadPoolExecutor from multiprocessing import Process import json from time import sleep import sqlite3 import os BUFFER_SIZE = 1024 def creatPath(pat): mypath = str(pat) if not os.path.isdir(mypath): ...
__init__.py
#!/usr/bin/env python3 # # Copyright 2017-2018 Amazon.com, Inc. and its affiliates. All Rights Reserved. # # Licensed under the MIT License. See the LICENSE accompanying this file # for the specific language governing permissions and limitations under # the License. # # # Copy this script to /sbin/mount.efs and make su...
win32spawn.py
import os import threading import Queue # Windows import import win32file import win32pipe import win32api import win32con import win32security import win32process import win32event class Win32Spawn(object): def __init__(self, cmd, shell=False): self.queue = Queue.Queue() self.is_terminated = Fal...
synchronizer.py
from __future__ import annotations import io import logging import queue import threading import time from typing import Any, cast, Optional, TYPE_CHECKING import bitcoinx from bitcoinx import hex_str_to_hash, hash_to_hex_str import refcuckoo from electrumsv_node import electrumsv_node import requests import zmq from...
GUI_QT.py
import sys sys.path.append('C:/Python37/Lib/site-packages') from IPython.display import clear_output from pyqtgraph.Qt import QtGui, QtCore, QtWidgets from PyQt5 import QtWidgets from PyQt5.QtWidgets import QMessageBox from PyQt5.QtGui import QMovie import pyqtgraph as pg import random from pyOpenBCI import OpenBCICyt...
__init__.py
import os import re import sys import ssl import json import time import requests import logging import shutil import argparse import threading from dateutil.parser import parse from watchdog.observers import Observer from watchdog.events import PatternMatchingEventHandler from http.server import HTTPServer, SimpleHTT...
TFLite_mnist_webcam.py
######## Webcam hand-digit Detection Using Tensorflow mnist Model ######### # # Author: jihwan Lee # Date: 02/10/20 # Revised by: LUMI # Date: Nov-21,'21 # Description: # This program uses a TensorFlow Lite model to perform object detection on a live webcam feed # # This code is based off the TensorFlow Lite image cl...
createdeleteview.py
import json import time from threading import Thread, Event from basetestcase import BaseTestCase from couchbase_helper.document import DesignDocument, View from couchbase_helper.documentgenerator import DocumentGenerator from membase.api.rest_client import RestConnection from membase.helper.rebalance_helper import Reb...
test_remote_account.py
# Copyright 2015 Confluent Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
rs.py
# A simplified root dns server # Nicolas Gundersen neg62 # Anthony Tiongson ast119 import threading import time import random import socket import sys def server(): port = int(sys.argv[1]) # This reads the PROJI - DNSRS.txt file rootDNSFile = open("PROJI-DNSRS.txt", 'r') # Create an empty Dictionary roo...
net_mon.py
import threading import time import json import sys import os import net_gargoyle as netg LOCK = threading.Lock() with open("./gargoyle.json", "r") as f: gconfig = json.load(f) maxStartSize = int(gconfig["MAXSTARTSIZE"]) maxRunSize = int(gconfig["MAXRUNSIZE"]) class Gargoyle(): '''gargoyle.db object with c...
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...
avnavavahi.py
# -*- coding: utf-8 -*- # vim: ts=2 sw=2 et ai ############################################################################### # Copyright (c) 2012,2013-2021 Andreas Vogel andreas@wellenvogel.net # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documen...
multiprocessing_queue_in.py
import multiprocessing import multiprocessing_import_worker_queue_in import sys # def worker(num): # """thread worker function""" # print 'Worker:' # return def get_file(filename): return filename.split('.')[0] if __name__ == '__main__': filename = get_file(sys.argv[1]) jobs = [] number_thre...
daemon.py
#!/usr/bin/env python # requires python 3 """ .. module:: daemon :platform: Unix, Windows :synopsis: Manages the uploader and grabber processes, performs configuration on first run .. moduleauthor:: Adam Sheesley <odd.meta@gmail.com> """ """ TODO: Unify logging and status message printing """ import sys compat =...
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...
wsdump.py
#!/Users/Drake/dev/bluecollarbi/bluecollarbi/bin/python3 import argparse import code import sys import threading import time import ssl import six from six.moves.urllib.parse import urlparse import websocket try: import readline except ImportError: pass def get_encoding(): encoding = getattr(sys.stdin...
data_utils.py
"""Utilities for file download and caching.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import hashlib import multiprocessing as mp import os import random import shutil import sys import tarfile import threading import time import warning...
__init__.py
# -*- coding:utf-8 -*- from gsiot.v3 import * import socket,select from multiprocessing import Process from threading import Thread from datetime import datetime from gsiot.v3.net.client import Client # BaseServer是一个标准C/S的对象,建立了连接池,可读取指定连接发送过来的数据 # 缺点是没有timeout,如果客户端一直不发数据,会处于阻塞状态。 class BaseServer(gsIO): instanc...
rebaselineserver.py
# Copyright (c) 2010 Google 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 copyright # notice, this list of conditions and the ...
test_get_text_input.py
# Exits with a 0 return code if the text input modal opens without errors # within 5 seconds. Exits with a 1 return code otherwise. import os import psutil import time from datetime import datetime, timedelta from threading import Thread from cmu_graphics import * def get_children_pids(): return {child.pid for ...
train_pg_f18.py
""" Original code from John Schulman for CS294 Deep Reinforcement Learning Spring 2017 Adapted for CS294-112 Fall 2017 by Abhishek Gupta and Joshua Achiam Adapted for CS294-112 Fall 2018 by Michael Chang and Soroush Nasiriany """ import numpy as np import tensorflow as tf import gym import logz import os import time im...
omsagent_ff.py
#!/usr/bin/env python # # OmsAgentForLinux Extension # # Copyright 2015 Microsoft 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....
bm_sigpro.py
#!/usr/bin/env python #-*- coding:utf-8 -*- #Copyright (C) 2018, Nudt, JingshengTang, All Rights Reserved #Author: Jingsheng Tang #Email: mrtang@nudt.edu.cn import os,sys rootdir = os.path.split(os.path.realpath(__file__))[0] import numpy as np from storage import Store from Queue import Queue as QQ import multiproc...
9.01_race_condition.py
""" Code illustration: 9.01 Race Condition Demo Tkinter GUI Application Development Blueprints """ import threading class RaceConditionDemo: def __init__(self): self.shared_var = 0 self.total_count = 100000 self.demo_of_race_condition() def increment(self): for i in rang...
asyncscheduledtask.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...
myplex.py
# -*- coding: utf-8 -*- import copy import threading import time from xml.etree import ElementTree import requests from plexapi import (BASE_HEADERS, CONFIG, TIMEOUT, X_PLEX_ENABLE_FAST_CONNECT, X_PLEX_IDENTIFIER, log, logfilter, utils) from plexapi.base import PlexObject from plexapi.client impor...
run.py
import csv import os import threading import uuid import boto3 import botocore def get_child_session(account_id, role_name, session=None): """ get session, with error handling, allows for passing in an sts client. This allows Account A > B > C where A cannot assume a role directly to C :param account_id:...
AuthMatrix.py
# Copyright (c) 2016 Mick Ayzenberg - Security Innovation # # 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, modify...
thermostat_server.py
""" A multiroom thermostat controller """ import socket import time import threading import datetime from copy import copy from collections import deque import RPi.GPIO as GPIO GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) # set pin naming scheme to rpi # If you are running Debian (including Raspbian/Raspberry Pi O...
paac.py
import time, logging, zmq, multiprocessing as mp, requests from multiprocessing.sharedctypes import RawArray from ctypes import c_uint, c_float from actor_learner import * from zmq_serialize import SerializingContext class PAACLearner(ActorLearner): def __init__(self, network_creator, args): super(PAACLea...
T24M.py
#Decompiled by MR.KING-N import os, sys, time, datetime, random, hashlib, re, threading, json, getpass, urllib, requests, mechanize from multiprocessing.pool import ThreadPool from requests.exceptions import ConnectionError from mechanize import Browser reload(sys) sys.setdefaultencoding('utf8') br = mechanize.Browser...
provider_buttons.py
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
nntrain.py
import tensorflow as tf from utils.nn import linearND, linear from mol_graph import atom_fdim as adim, bond_fdim as bdim, max_nb, smiles2graph_list as _s2g from models import * from ioutils import * import math, sys, random from collections import Counter from optparse import OptionParser from functools import partial ...
writer.py
import os import time from threading import Thread from queue import Queue import cv2 import numpy as np import torch import torch.multiprocessing as mp from alphapose.utils.transforms import get_func_heatmap_to_coord from alphapose.utils.pPose_nms import pose_nms, write_json DEFAULT_VIDEO_SAVE_OPT = { 'savepath...
core.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """PY4WEB - a web framework for rapid development of efficient database driven web applications""" # Standard modules import argparse import cgitb import code import copy import datetime import functools import importlib.util import importlib.machinery import inspect impor...
applicationrecorder_testcase.py
import traceback from abc import ABC, abstractmethod from concurrent.futures.thread import ThreadPoolExecutor from threading import Event, Thread from unittest.case import TestCase from uuid import uuid4 from eventsourcing.persistence import StoredEvent class ApplicationRecorderTestCase(TestCase, ABC): @abstract...
updater.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Update HTPC Manager from Github. Either through git command or tarball. Updater and SourceUpdater written by styxit https://github.com/styxit Git updater written by mbw2001 https://github.com/mbw2001 Used as reference: - https://github.com/mrkipling/maraschino - htt...
processor.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...
distribute_coordinator_test.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
test_itertools.py
import unittest from test import support from itertools import * import weakref from decimal import Decimal from fractions import Fraction import operator import random import copy import pickle from functools import reduce import sys import struct import threading import gc maxsize = support.MAX_Py_ssize_t minsize = ...
test_backfill_job.py
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
model.py
import json import logging import os import socket import subprocess import sys import threading import time import uuid import pika import shutil rabbitmq_uri = os.getenv('RABBITMQ_URI', 'amqp://guest:guest@rabbitmq/%2F') default_application = os.getenv('APPLICATION', 'job.sh') model_info = None class Worker: ...
prefill.py
import pywikibot import sys import random import requests from app import get_proposed_edits, app import threading from time import sleep def worker(title=None): try: get_proposed_edits(title, False, True, True) except: pass def prefill_cache(max_pages=5000, starting_page=None): site = pyw...
ansible.py
# Copyright 2020 Red Hat, 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 ...
start_menu_helper.py
"""Reorganize the start menu folder.""" import logging import pathlib import re import time from typing import List from library import configuration, constants from library.helpers import windows_shortcuts from library.helpers.stopable_thread import StoppableThread class StartMenuHelper: """Starts and stops cle...
redis_utils.py
# Copyright 2020 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 utility module for interfacing with Redis conveniently. """ import json import logging import threading import redis import settings from protorpc impo...
test_shell_interactive.py
#!/usr/bin/env impala-python # -*- 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 Apach...
test_dataloader.py
import math import sys import errno import multiprocessing import os import ctypes import faulthandler import torch import gc import time import signal import unittest import itertools import warnings import tempfile from torch import multiprocessing as mp from torch.utils.data import ( ChainDataset, ConcatData...
trainers.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import copy import gc import inspect import itertools import json import math import numbers import os import shutil import sys import time import uuid from functools import partial import builtins import thread...
relay_integration.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...
rdd.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...
compare_Walternating_adam_5layers.py
import qiskit import numpy as np import sys sys.path.insert(1, '../') import qtm.base, qtm.constant, qtm.nqubit, qtm.fubini_study, qtm.encoding import importlib import multiprocessing importlib.reload(qtm.base) importlib.reload(qtm.constant) importlib.reload(qtm.onequbit) importlib.reload(qtm.nqubit) importlib.reload(q...
pql.py
import numpy as np import matplotlib.pyplot as plt import gym import rubiks_cube_gym # noqa import warnings from datetime import datetime import argparse import pickle import gc from multiprocessing import shared_memory, Process from multiprocessing import cpu_count, current_process plt.style.use('seaborn-dark') war...
presubmit_support.py
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Enables directory-specific presubmit checks to run at upload and/or commit. """ from __future__ import print_function __versio...
rdd.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...
loadable_elf_example_test.py
import os import threading import time import pexpect import serial from tiny_test_fw import Utility import ttfw_idf class CustomProcess(object): def __init__(self, cmd, logfile): self.f = open(logfile, 'wb') self.p = pexpect.spawn(cmd, timeout=60, logfile=self.f) def __enter__(self): ...
test.py
import argparse import glob import json import os from pathlib import Path from threading import Thread import numpy as np import torch import yaml from tqdm import tqdm from models.experimental import attempt_load from utils.datasets import create_dataloader from utils.general import coco80_to_coco91_c...
users.py
# import twythonaccess to be able to make twitter requests from . import twythonaccess # import apikeys from . import apikeys # import twythonstreamer for the SwedishMiner down below from twython import TwythonStreamer # import threading from threading import Thread # import time import time # this class provides Swed...
plotter.py
import atexit from queue import Empty from multiprocessing import Process, Queue from rllab.sampler.utils import rollout import numpy as np __all__ = [ 'init_worker', 'init_plot', 'update_plot' ] process = None queue = None def _worker_start(): env = None policy = None max_length = None ...
ssn_test_feedback.py
import argparse import time import numpy as np import pickle import sys from ssn_dataset import SSNDataSet from ssn_models import SSN from transforms import * from ops.ssn_ops import STPPReorgainzed import torch from torch import multiprocessing, optim from torch.utils import model_zoo from ops.utils import get_confi...
packages_analyzer.py
#!/usr/bin/env python """ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License")...
datasets_misc.py
import glob import math import os import random import shutil import time from pathlib import Path from threading import Thread import cv2 import numpy as np import torch from PIL import Image, ExifTags from torch.utils.data import Dataset from tqdm import tqdm from det.yolov4.yolo_utils.utils import ( xyxy2cxcyw...
pinger.py
# pinger.py #------------------------------------------------------------------------ # class NodePinger - A NodePinger is an object that uses a new thread to # take on the task of asynchronously "pinging" a given node (via Wi-Fi # to its bridged STDIN port) to make sure that it is still alive. This # will (ide...
video.py
""" """ # Import Libraries import os import sys import argparse import numpy as np import matplotlib import configparser import threading matplotlib.use('TkAgg') from matplotlib import pyplot as plt path = os.path.abspath('../../') if not path in sys.path: sys.path.append(path) import mmwsdr def main(): ""...
Proceso_sin_flask.py
import cv2 import numpy as np import json import datetime import time from multiprocessing import Process, Queue pqueue = Queue() from config_movimiento_frente_camara import FILE_CONFIG_MOVE_DETECT, constante_cambio_area def Leer_HoraActual(): x = datetime.datetime.now() return "{}/{}/{}".format(x.day, x.m...
sonar_v3_dev_daemon.py
# Copyright 2017-2018 CERN for the benefit of the ATLAS collaboration. # # 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...
px_pager.py
import os import errno import logging import threading import subprocess from . import px_processinfo if False: # For mypy PEP-484 static typing validation from . import px_process # NOQA from typing import List # NOQA from typing import Optional # NOQA LOG = logging.getLogger(__name__) def _pum...
asyncTests.py
import unittest from threading import Thread from streamsx.topology.topology import * from streamsx.topology.tester import Tester from streamsx.topology.schema import * import streamsx.topology.context from streamsx import rest import streamsx.spl.op as op import streamsx.spl.toolkit as tk from time import gmtime, ...
transaction.py
#!/usr/bin/env python3 # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including withou...
snapraid-runner.py
#!/usr/bin/env python3 from __future__ import division import argparse import configparser import logging import logging.handlers import os.path import subprocess import sys import threading import time import traceback from collections import Counter, defaultdict from io import StringIO # Global variables config = N...
_nixcommon.py
# -*- coding: utf-8 -*- import struct import os import atexit from time import time as now from threading import Thread from glob import glob try: from queue import Queue except ImportError: from Queue import Queue event_bin_format = 'llHHI' # Taken from include/linux/input.h # https://www.kernel.org/doc/Docu...
test_qgsblockingnetworkrequest.py
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsBlockingNetworkRequest .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later versi...
app.py
from tkinter import * import tkinter.messagebox from verify_email import * from validate_email import * import threading class Email: def __init__(self,root): self.root=root self.root.title("Email Verification") self.root.geometry("500x250") self.root.iconbitmap("logo220.ico") ...
aws-sea-cleanup.py
#!/usr/bin/env python import os import boto3 import botocore import json import threading import time import sys import argparse import base64 from tabulate import tabulate from os import path parser = argparse.ArgumentParser( description="A development script that cleans up resources deployed by the acceler...
test_nanny.py
import asyncio import gc import logging import multiprocessing as mp import os import random from contextlib import suppress from time import sleep from unittest import mock import psutil import pytest pytestmark = pytest.mark.gpu from tlz import first, valmap from tornado.ioloop import IOLoop import dask from dis...
ur3e_rtqhe_x.py
import math from robot_con.ur.robotiq import rtq_eseries_gripper as r2f from robot_con.ur.robotiq import rtq_ft300 as rft from basis import robot_math as rm import drivers.urx.ur_robot as urrobot import robot_con.ur.program_builder as pb import numpy as np import threading import socket import struct import os import m...
base.py
import base64 import hashlib import io import json import os import threading import traceback import socket import sys from abc import ABCMeta, abstractmethod from six import text_type from six.moves.http_client import HTTPConnection from six.moves.urllib.parse import urljoin, urlsplit, urlunsplit from ..testrunner i...
text2tfrecord.py
"""tokenization to bpe or character embeddings of text datasets""" import argparse import io import os import shutil import time import random import multiprocessing import jsonlines import requests import simdjson import tensorflow as tf import zstandard from google.cloud import storage from transformers import GPT2...
tk_gui.py
import tkinter as tk from functools import partial from logging import getLogger from os import path, environ from re import search from shutil import unpack_archive, rmtree, copytree from sys import prefix from threading import Thread from tkinter import messagebox from typing import NamedTuple from dcspy import LCD_...
WrappedTreeVisualWindow.py
import pickle import threading from PyQt5.QtCore import QTimer, QEventLoop from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import ( QWidget, QToolTip, QPushButton, QApplication, QMessageBox, ) from .TreeVisualWindow import TreeVisualWindow from ..utils import remove_if_exists from ..WaitingSpinner...
test_xmlrpc.py
import base64 import datetime import decimal import sys import time import unittest from unittest import mock import xmlrpc.client as xmlrpclib import xmlrpc.server import http.client import http, http.server import socket import threading import re import io import contextlib from test import support ...
database.py
# -*- coding: UTF-8 -*- """ This is a class to deal with all the variables in the system. Main features needed: - multithread safe - a thread can wait until a variable changes his value - contains value and time at witch was the last change Every variable has properties: name: string that identify the vari...