source
stringlengths
3
86
python
stringlengths
75
1.04M
create_threads.py
#!/usr/bin/python # This multithreading program creates five threads # and each thread prints "Hello World" with a two-second interval import threading import time def HelloWorld(): """User defined Thread function""" print "Hello World" return def Main(): threads = [] # Threads list needed when we use a bu...
base.py
"""Executor base classes.""" import threading from collections import OrderedDict from testplan.common.entity import Resource, ResourceConfig from testplan.common.utils.thread import interruptible_join class ExecutorConfig(ResourceConfig): """ Configuration object for :py:class:`Executor <testplan.runn...
apiserveroutput.py
# Copyright (C) Schweizerische Bundesbahnen SBB, 2016 # Python 3.4 from webbrowser import get # # supplies a list of available job-names under http://localhost:8080/jobs # supplies data for a job under http://localhost:8080/job/<job-name>/lastBuild/api/json # __author__ = 'florianseidl' from http.server import HTTPS...
final.py
"""Compute depth maps for images in the input folder. """ import os import glob import torch import utils import cv2 import sys import threading import serial from sys import platform import argparse import matplotlib.pyplot as plt import numpy as np from torchvision.transforms import Compose from midas.dpt_depth im...
Multitasking_Using_Multiple_Thread.py
# Multitasking using multiple thread from threading import Thread class Hotel: def __init__(self, t): self.t = t def food(self): for i in range(1, 6): print(self.t, i) h1 = Hotel("Take Order from table") h2 = Hotel("Serve order to table") t1 = Thread(target=h1.food) t2 = Thread(...
main.py
from flask import Flask, request, abort from os import environ, path import requests from tinytag import TinyTag from zhconv import convert from helper import database import threading from linebot import ( LineBotApi, WebhookHandler ) from linebot.exceptions import ( InvalidSignatureError ) from linebot.model...
main.py
from tkinter import * import os import time import threading import commands from recognize import hear, getcommand, say '''Thread Control Variable''' thread_control = -1 '''Threading Function''' def auto_control(): global thread_control while True: '''Hear current audio and use it for processing''' if thread_c...
monitor.py
import pychromecast import threading import time import logging import pprint from typing import List, Dict logger = logging.getLogger(__name__) def get_device_info(cast: pychromecast.Chromecast) -> Dict[str, str]: return {'uuid': cast.device.uuid, 'name': cast.device.friendly_name} def find_differences(actual...
deviceWebSocket.py
#!/usr/bin/env python import os, serial, threading import json import socket from time import sleep import datetime import termios, sys import atexit import optparse import random import simulator import RTC_DS1307 as RTC global mysocketMessage global mysocketMessageJSON global myEvent class socketMessage: def ...
tube.py
from .. import log, log_levels, context, term, atexit, thread from ..util import misc import re, threading, sys, time, subprocess def _fix_timeout(timeout, default): if timeout == 'default': return default elif timeout == None: return timeout elif isinstance(timeout, (int, long, float)): ...
metrics.py
# Copyright 2013 Google Inc. All Rights Reserved. """Used to collect anonymous SDK usage information.""" import atexit import collections import hashlib import mutex import os import Queue import socket import sys import threading import urllib import uuid import httplib2 from googlecloudsdk.core import config from...
hogKeyboard.py
#################################################################################################################### # # *****smartRemotes created by HeadHodge***** # # HeadHodge/smartRemotes is licensed under the MIT License # # A short and simple permissive license with conditio...
pdf.py
import threading from functools import partial from logging import getLogger from os import makedirs from pathlib import Path import re from subprocess import Popen, run, getstatusoutput, check_output from sys import platform as _platform from kivymd.toast import toast from kivymd.uix.button import MDFlatButton from k...
pdf_reader.py
from multiprocessing import JoinableQueue, Process, Queue, Value import camelot import fitz import pandas as pd from PIL import Image, ImageDraw from .bar_utils import ProcessBar from .database import Job, db from .utils import simple_job ZOOM_FACTOR = 4.166106501051772 def blocks_without_table(blocks, table_bbox)...
__main__.py
import socket import argparse import time from threading import Thread from acceptor import listenForClients # Do argument work ap = argparse.ArgumentParser() ap.add_argument("-p", "--port", default=6060) args = ap.parse_args() # Deal with type conversions args.port = int(args.port) # Start up master socket session...
backend.py
import pymongo import datetime import json import Queue import threading import time import calc_postion from pprint import pprint import md5 from baselib import error_print global_db_name = "gpsmap" global_db_url = "mongodb://gpsmap:gpsmap@127.0.0.1:27017/"+global_db_name global_db_origin_collection = "origin...
CamScan.py
import requests from shodan import Shodan from time import sleep,time,localtime import os import threading import webbrowser import csv class CamScan: def __init__(self, dirname='Images', search=None, path=None, timeout=7, verbose=False): self.search = search se...
test_io.py
"""Unit tests for the io module.""" import abc import array import errno import locale import os import pickle import random import signal import sys import time import unittest import warnings import weakref from collections import deque, UserList from itertools import cycle, count from test import support from test.s...
notify_mtr.py
#!/usr/bin/env python3 # _*_ coding:utf-8 _*_ import base64 import hashlib import hmac import json import os import re import threading import time import traceback import urllib.parse import requests import tomli from utils_env import get_file_path link_reg = re.compile(r"<a href=['|\"](.+)['|\"]>(.+)<\s?/a>") bold...
test_socket_client.py
from threading import Thread import time from socketIO_client import SocketIO host = 'localhost' port = 5000 class TwoWayClient(object): def on_event(self, event): print(event) def __init__(self): self.socketio = SocketIO(host, port) self.socketio.on('latencyResponse', self.on_event...
test_interpreter_more.py
"""More test cases for ambianic.interpreter module.""" import logging import threading import time from ambianic import pipeline from ambianic.pipeline import interpreter from ambianic.pipeline.avsource.av_element import AVSourceElement from ambianic.pipeline.interpreter import ( HealingThread, Pipeline, P...
mainwindow.py
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ Spyder, the Scientific Python Development Environment ===================================================== Developed and maintained by the Spyder Proj...
test_connection.py
from test.UdsTest import UdsTest from udsoncan.connections import * from test.stub import StubbedIsoTPSocket import socket import threading import time import unittest try: _STACK_UNVAILABLE_REASON = '' _interface_name = 'vcan0' import isotp import can s = isotp.socket() s.bind(_i...
numski.py
import tkinter as tk from tkinter.constants import SEL_FIRST import tkinter.font from tkinter import messagebox from random import choice from time import perf_counter, sleep from threading import Barrier, Thread from widgets import generate_font, get_date, button, winner_dialog, shuffling_dialog tileImg = No...
client.py
#!/usr/bin/env python3 import matplotlib import socket import os import ast import random as r import time import datetime as dt import subprocess as sp import paho.mqtt.client as mqtt import matplotlib.pyplot as plt from drawnow import * import smtplib import config import pickle import data_homo as homo import data_h...
backups.py
# Copyright (C) 2018-2020 Amano Team <contact@amanoteam.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 the rights to # use, copy, mod...
__init__.py
# Copyright 2019 Atalaya Tech, 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,...
swaggerConfig.py
from flask import Flask, g, request from flask_restx import Api import time, datetime, os, json, decimal # from flask_jwt_extended import get_jwt_identity import threading # siteroot = os.path.realpath(os.path.dirname(__file__) + "/service/auth/") # json_url = os.path.join(siteroot, "OAuth.json") # OAuthJson = json.lo...
github_notifications_control.py
import os import threading from subprocess import Popen, DEVNULL from time import sleep from typing import Any, Dict import requests as requests from devdeck_core.controls.deck_control import DeckControl class GithubNotificationsControl(DeckControl): def __init__(self, key_no: int, **kwargs) -> None: sup...
mpc.py
import os.path import re import time import threading import _thread from functools import wraps import win32con, win32api, win32gui, ctypes, ctypes.wintypes #@UnresolvedImport @UnusedImport from syncplay import constants from syncplay.messages import getMessage from syncplay.players.basePlayer import BasePlayer fr...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import, print_function, with_statement import os import re import sys import copy import time import types import signal import fnmatch import logging import threading import traceback import contextlib impo...
proxy_list_scrape.py
import requests from bs4 import BeautifulSoup import pandas as pd import re from multiprocessing import Process, Queue, Pool, Manager def testProxies(aProxy, headers, q): #Declare All so we can use the queue all=[] if 'http' in aProxy: printProxy = aProxy['http'] else: printProxy...
vms_async_monitor.py
# coding: utf-8 #------------------------------ # video 数据同步监控 #------------------------------ import sys import os import json import time import threading import subprocess import shutil import base64 sys.path.append("/usr/local/lib/python2.7/site-packages") import psutil sys.path.append(os.getcwd() + "/class/cor...
input_dataset.py
from .dataset import DataSet, DataSetMode, RawDataSet from calamari_ocr.ocr.data_processing import DataPreprocessor from calamari_ocr.ocr.text_processing import TextProcessor from calamari_ocr.ocr.augmentation import DataAugmenter from typing import Generator, Tuple, List, Any import numpy as np import multiprocessing ...
ssh.py
import logging import socket import threading import paramiko import configparser import csv import io import time ref = { 'timestamp': 0, 'name': 1, 'index': 2, 'utilization.gpu': 3, 'memory.total': 4, 'memory.free': 5, 'power.limit': 6, 'power.draw': 7 } pause = False def visuali...
pcrlib.py
# pcrlib.py ########################################################################################### # Author: Josh Joseph joshmd@bu.edu # 4/29/16 # This is the main function library file for PCR hero.... from pymongo import MongoClient from bson.objectid import ObjectId import hashlib import json import bson.json...
__init__.py
""" Node A node in its simplest would retrieve a task from the central server by an API call, run this task and finally return the results to the central server again. The node application is seperated in 4 threads: - main thread, waits for new tasks to be added to the queue and run the tasks - listening thread, ...
__init__.py
import click import datetime import fileinput import gspread import multiprocessing import os import queue import sqlite3 import tempfile from oauth2client.client import GoogleCredentials from google.cloud import texttospeech __version__ = 'v1.0.0' class State: def __init__(self): self.quit = multiproces...
anon_env.py
import pickle import numpy as np import json import sys import pandas as pd import os from utility import get_cityflow_config import time import threading from multiprocessing import Process, Pool from script import get_traffic_volume from copy import deepcopy import cityflow # engine = cdll.LoadLibrary("./engine.cpy...
tests.py
"""Tests for the kvstore API""" import unittest import kvstore import Queue import threading ENDPOINT = 'http://10.112.0.101:8500/v1/kv' class KVStoreTestCase(unittest.TestCase): def setUp(self): self.kv = kvstore.Client(ENDPOINT) def tearDown(self): self.kv.delete('__testing__', recursive...
scheduler.py
"""Distributed Task Scheduler""" import os import pickle import logging import sys import distributed from warnings import warn import multiprocessing as mp from collections import OrderedDict from .remote import RemoteManager from .resource import DistributedResourceManager from .. import Task from .reporter import *...
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from electrum_mona.util import bfh, bh2u, UserCancelled, UserFacingException from electrum_mona.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT from electrum_mona.bip32 import BIP32Node from electrum_mona import constants from electrum_mona.i18n import _ fro...
background.py
# Copyright 2018 Datawire. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
worker.py
import time import datetime import json import redis import threading import sys import constants from logger.Logger import Logger, LOG_LEVEL class Worker: """Base Worker Class A worker is responsible for handling its set of operations and running on a thread """ def __init__(self, config, ma...
test_issue_605.py
import collections import logging import os import threading import time import unittest import pytest from integration_tests.env_variable_names import \ SLACK_SDK_TEST_CLASSIC_APP_BOT_TOKEN, \ SLACK_SDK_TEST_RTM_TEST_CHANNEL_ID from integration_tests.helpers import is_not_specified from slack import RTMClien...
jpserve.py
r"""JPServer is a Python script executor running on the Python side. JPServe receiving and executing the script from 3rd-part languages, then send back the result as JSON format to the caller. Usages: - Start server server = JPServe(("hostname", port)) server.start() - Stop server server.shutd...
smc.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import threading import re import logging import serial import pykka from mopidy import exceptions from mopidy.utils import encoding logger = logging.getLogger(__name__) class SerialMonoboxController(pykka.ThreadingActor): d...
test_html.py
from functools import partial from importlib import reload from io import ( BytesIO, StringIO, ) import os from pathlib import Path import re import threading from urllib.error import URLError import numpy as np import pytest from pandas.compat import is_platform_windows import pandas.util._test_decorators as...
StarlightUI.py
import sys import can import can.interfaces.slcan import threading import os from os.path import abspath, dirname, join from datetime import datetime, date import time from textwrap import wrap from PyQt5 import QtCore, QtGui, QtQml from PyQt5.QtWidgets import QApplication from PyQt5.QtQml import QQmlAppli...
__init__.py
import logging import datetime import codecs import os import sqlite3 import numpy as np from sqlite3 import OperationalError from copy import copy from threading import Thread import openpyxl import pandas as pd import xgboost as xgb from threading import Thread from flask import Flask, render_template, request, redir...
random_shuffle_queue_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...
utility.py
import os import math import time import datetime from multiprocessing import Process from multiprocessing import Queue import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import imageio import torch import torch.optim as optim import torch.optim.lr_scheduler as lrs class ti...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import electrum from electrum.bitcoin import TYPE_ADDRESS from electrum import WalletStorage, Wallet from electrum_gui.kivy.i18n import _ from electrum.paymentrequest import InvoiceStore from electr...
img_nav.py
import setup_path import airsim import numpy as np import os import tempfile import pprint import cv2 import math import time import threading from PIL import Image import random # Camera details should match settings.json IMAGE_HEIGHT = 144 IMAGE_WIDTH = 256 CENTER = (IMAGE_HEIGHT //2, IMAGE_WIDTH//2) FOV = 90 # TOD...
test_icdar2015_base.py
# -*- coding:utf-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import division import os import sys import tensorflow as tf import cv2 import numpy as np import math from tqdm import tqdm import argparse from multiprocessing import Queue, Process from utils import...
test_fetcher.py
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import hashlib import http.server import os import socketserver import unittest from buil...
cross_device_ops_test.py
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
p290_test1561.py
import threading threadObj = threading.Thread(target=print, args=['Cats', 'Dogs', 'Forgs'], kwargs={'sep': ' & '}) threadObj.start() """ Cats & Dogs & Forgs """
fire_cli.py
import json import sys import threading from io import StringIO import fire def json_dump(obj): print(json.dumps(obj, indent=4, sort_keys=True, default=str)) # https://stackoverflow.com/a/11875813/973425 class Root(): """ Root """ cmd_history = [] def __init__(self): pass def...
email.py
from flask import render_template from flask_mail import Message from app import mail,app 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, html_body): msg = Message(subject, sender=sender, recipi...
listen.py
from __future__ import absolute_import from __future__ import division import errno import socket from pwnlib.context import context from pwnlib.log import getLogger from pwnlib.timeout import Timeout from pwnlib.tubes.sock import sock log = getLogger(__name__) class listen(sock): r"""Creates an TCP or UDP-sock...
EventLoopTest.py
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2012, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided ...
wifijammer.py
#!/usr/bin/env python import logging logging.getLogger("scapy.runtime").setLevel(logging.ERROR) # Shut up Scapy from scapy.all import * conf.verb = 0 # Scapy I thought I told you to shut up import os import sys import time from threading import Thread, Lock from subprocess import Popen, PIPE from signal import SIGINT,...
quadcopter.py
import numpy as np import math import scipy.integrate import time import datetime import threading class Propeller(): def __init__(self, prop_dia, prop_pitch, thrust_unit='N'): self.dia = prop_dia self.pitch = prop_pitch self.thrust_unit = thrust_unit self.speed = 0 #RPM sel...
requestlog.py
import sys from datetime import datetime from threading import Thread import Queue from boto.utils import RequestHook from boto.compat import long_type class RequestLogger(RequestHook): """ This class implements a request logger that uses a single thread to write to a log file. """ def __init__(s...
test_logging.py
#!/usr/bin/env python # # Copyright 2001-2011 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 n...
tool.py
# -*-coding:utf-8-*- # Copyright (c) 2020 DJI. # # 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 in the file LICENSE.txt or at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
GlobalHandle.py
#!/usr/bin/python ''' (C) Copyright 2018 Intel Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable ...
zoomrec.py
import csv import logging import os import psutil import pyautogui import random import schedule import signal import subprocess import threading import time import atexit from datetime import datetime, timedelta import requests global ONGOING_MEETING global VIDEO_PANEL_HIDED global TELEGRAM_TOKEN global TELEGRAM_RETR...
multiprocessing4__.py
# multiprocessing4.py # -*- coding: utf-8 -*- from multiprocessing import Process, Queue import os, time, random # 数据进程执行代码: def write(q): for value in ['A', 'B', 'C']: print('Put %s to queue...' % value) q.put(value) time.sleep(random.random()) # 读数据进程执行代码: def read(q): while True: ...
SPEED(run_with_python3).py
#!/usr/bin/python3 # # # This python3 program sends out CAN data from the PiCAN2 board to a Mazda RX8 instrument cluster. # For use with PiCAN boards on the Raspberry Pi # http://skpang.co.uk/catalog/pican2-canbus-board-for-raspberry-pi-2-p-1475.html # # Make sure Python-CAN is installed first http://skpang.co.uk/blog...
boot.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import sys import threading from api import Servant, Scheduler, Proxy from cmdexecutor import exec_linux_cmd from extloader import load_exts, set_ext_dict_to_topology from operations import get_operation_dict from server import create_server_instance from t...
pyusb_backend.py
# pyOCD debugger # Copyright (c) 2006-2020 Arm Limited # SPDX-License-Identifier: Apache-2.0 # # 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...
main.py
import sys sys.path.append('..') from data.generate_data import GenerateData from threading import Thread from copy import deepcopy import ast import os from bubble_sort import BubbleSort from bucket_sort import BucketSort from heap_sort import HeapSort from merge_sort import MergeSort from quick_sort import QuickSor...
eth_workers.py
from web3 import Web3, HTTPProvider from Savoir import Savoir from requests import post from threading import Thread import time import json from conf import * ####On Deposit occurs error - tx fee if __name__ == "__main__": eth = Web3(HTTPProvider("http://localhost:"+eport)) # run geth with: geth --rpcapi perso...
ninjaCapeSerialMQTTBridge.py
#!/usr/bin/python # # used to interface the NinjaCape to openHAB via MQTT # - reads data from serial port and publishes on MQTT client # - writes data to serial port from MQTT subscriptions # # - uses the Python MQTT client from the Mosquitto project http://mosquitto.org (now in Paho) # # https://github.com/perrin7/nin...
tests.py
# Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. import copy import io import os import pickle import re import shutil import tempfile import threading import time import unittest from unittest import mock from django.conf import settings from django.core import manageme...
recovery_gsi.py
import logging from threading import Thread import time from .base_gsi import BaseSecondaryIndexingTests from couchbase.n1ql import CONSISTENCY_REQUEST from couchbase_helper.query_definitions import QueryDefinition from lib.memcached.helper.data_helper import MemcachedClientHelper from membase.api.rest_client import R...
tasks.py
import os import threading from invoke import run, task, util API_REFERENCE_CONFIG = { 'client': ['auth'], 'session_client': [ 'user', 'projects', 'project', 'use_project' ], 'project_client': [ 'info', 'collections', 'collection', 'docum...
build.py
## @file # build a platform or a module # # Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR> # Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD Li...
filter.py
import numpy as np import os,re,sys import threading import goal_address import linecache np.random.seed(1337) path='1.txt' db = goal_address.connectdb2() def file_name(file_dir): for root, dirs, files in os.walk(file_dir): return files def process_line(line): lineSpilt = line.split(' ',1) ...
test_content.py
from __future__ import print_function import os import re import sys import json import time import argparse import threading import subprocess import traceback from time import sleep import datetime from distutils.version import LooseVersion import pytz from google.cloud import storage from google.api_core.exception...
printer.py
# coding: utf8 from __future__ import unicode_literals, print_function import datetime from collections import Counter from contextlib import contextmanager from multiprocessing import Process import itertools import sys import time import os import traceback from .tables import table, row from .util import wrap, sup...
continuousStream.py
import pyqtgraph as pg from pyqtgraph.Qt import QtCore, QtGui import numpy as np from multiprocessing import Process import time import constants class ContinousStream: # Displays continous stream by buffering <samplesBuffered> samples def __init__(self, q, secToDisp, SAMPLING_FREQ, graphUpdateFreq): #...
feature_shutdown.py
#!/usr/bin/env python3 # Copyright (c) 2018 The Bitcoin Core developers # Copyright (c) 2017-2019 The Raven Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test redecoind shutdown.""" from threading import Thre...
zoomrec.py
import csv import logging import os import psutil import pyautogui import random import schedule import signal import subprocess import threading import time import atexit import requests from datetime import datetime, timedelta global ONGOING_MEETING global VIDEO_PANEL_HIDED global TELEGRAM_TOKEN global TELEGRAM_RETR...
sender.py
from threading import RLock, Event, Condition, Thread import time import requests import json from src.util import EmptyQueueError, DevicePushbackError from src.updatequeue import UpdateQueue class Sender(object): def __init__(self, k): # :brief Create a new Sender instance. self.lock = RLock() ...
crawler.py
# Copyright 2017 The Forseti Security 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 ap...
test_rpc.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import multiprocessing import socket import time import ssl import pytest import thriftpy2 thriftpy2.install_import_hook() from thriftpy2._compat import PY3 # noqa from thriftpy2.rpc import make_server, client_context # noqa from thriftpy2...
test.py
# Copyright 2013 dotCloud 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 w...
feature_shutdown.py
#!/usr/bin/env python3 # Copyright (c) 2018 The Cicoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test cicoind shutdown.""" from test_framework.test_framework import CicoinTestFramework from test_framework....
dataLink.py
# MIT License # # Copyright (c) 2020 Gcom # # 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, merge, publish...
datasets.py
# Dataset utils and dataloaders import glob import logging import math import os import random import shutil import time from itertools import repeat from multiprocessing.pool import ThreadPool from pathlib import Path from threading import Thread import cv2 import numpy as np import torch import torch.nn.functional ...
daemon.py
import asyncio import multiprocessing as mp import logging from typing import Optional from pydevlpr_protocol import DataFormatException, unwrap_packet, PacketType, DaemonSocket from .serif import DevlprSerif from .DaemonState import DaemonState from .config import BOARDS, Board, ADDRESS server = None state: Optional...
qsatype.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os, fnmatch, re import datetime, weakref from lxml import etree from io import StringIO from PyQt5 import QtCore, QtGui, QtWidgets # Cargar toda la API de Qt para que sea visible. from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.Qt...
federated_learning_keras_low_power_PS_MNIST_crossentropy.py
from DataSets import MnistData from DataSets_task import MnistData_task from consensus.consensus_v3 import CFA_process from consensus.parameter_server_v2 import Parameter_Server # use only for consensus , PS only for energy efficiency # from ReplayMemory import ReplayMemory import numpy as np import os import tensorflo...
stable_topology_fts.py
# coding=utf-8 import copy import json import random from threading import Thread import Geohash from membase.helper.cluster_helper import ClusterOperationHelper from remote.remote_util import RemoteMachineShellConnection from TestInput import TestInputSingleton from .fts_base import FTSBaseTest from lib.membase.api...
dsh_old.py
import paramiko import sys import datetime import threading import logging """ Edit this line and add your command """ #cmd2run = "for f in $(ioscli lsdev -type adapter | grep fcs | grep 8Gb | awk {'print $1'}); do wwpn=$(ioscli lsdev -dev $f -vpd | grep Network | sed s'/\.//g;s/Network Address//g;s/ //g');echo $f,$ww...
circDeep.py
import keras from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_sequences from keras.layers import Dense, Dropout, Merge, Input from keras.callbacks import ModelCheckpoint, EarlyStopping from sklearn import metrics from keras import optimizers from gensim.models import Word2Vec ...
qt_start.pyw
import sys import time from socket import socket from threading import Thread from PyQt4.QtGui import * import start_services import settings import os.path from multiprocessing import Process class Window(QMainWindow): def __init__(self): super(Window, self).__init__() self.create_main_window() ...