source
stringlengths
3
86
python
stringlengths
75
1.04M
mpi.py
""" A work manager which uses MPI to distribute tasks and collect results. """ import sys import time import traceback import logging import threading from collections import deque from mpi4py import MPI from westpa.work_managers import WorkManager, WMFuture log = logging.getLogger(__name__) # +------+ # | Task | #...
image_detection.py
from threading import Thread # 创建线程的模块 from imageai.Detection import ObjectDetection import tensorflow as tf import keras.backend as K import sys import time print(sys.argv) input_img_path , output_img_path = sys.argv[1], sys.argv[2] def image_detection(input_img_path, output_img_path): start_time = time.time() ...
testqueuepriority.py
# https://pymotw.com/3/queue/index.html # Sometimes the processing order of the items in a queue needs to be based on # characteristics of those items, rather than just the order they are created # or added to the queue. For example, print jobs from the payroll department # may take precedence over a code listing print...
camera.py
from tracker.core import * from threading import Thread from multiprocessing import Process, Queue from sys import argv from pathlib import Path from queue import Empty as QueueEmptyException header = "[CAMERA]: " if len(argv) > 1: filename = argv[1] else: filename = "raw" CAPTURE_WIDTH = 640 CAPTURE_HEIGHT = 480 ...
file_listener.py
# =============================================================================== # Copyright 2012 Jake Ross # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licens...
base.py
# Copyright 2018 Alibaba Cloud Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
trainer.py
# Copyright 2021 RLCard Team of Texas A&M University # Copyright 2021 DouZero Team of Kwai # # 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 ...
sync.py
import os import subprocess import json from multiprocessing import Process,Lock """ Upload and download, API handling services provided by rclone.org VERY IMPORTANT: it reads config from a JSON file: config.json drawback: no exception catching Example: from:**here**:/home/exampleuser/examplerfolder to:**there**...
gene_cohort_1_source_builder.py
#!/usr/bin/env python """ ------------- Copyright (c) 2015. Genome Research Ltd. Author: Deciphering Development Disorders Project Team. 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....
visualization.py
from threading import local,Thread from musket_core.parralel import Error from tqdm import tqdm import os import numpy as np from musket_core.utils import save,load from musket_core import parralel from musket_core import datasets import inspect _context=local() class VFunc: def __init__(self,dataset,item,func,a...
job_polling.py
import logging import time from http import HTTPStatus import sys import threading import re from utils.logger import Logger, LOG_LEVELS class JobsConstants: UFM_API_JOBS="jobs" UFM_API_JOBS_PARENT_ID_PARAM="parent_id" API_JOB_COMPLETED = "Completed" API_JOB_COMPLETED_ERRORS = "Completed With Errors"...
Communication.py
from MessageQueue.MessageQueue import MessageQueue, Message from GUI import GUI from SerialCommunication import SerialCommunication, StopState from MotorControl import MotorControl from PositionDetermination.PosSensor import PosSensor from multiprocessing import Process, Event from threading import Thread, Lock from ti...
tester.py
# Copyright 2020 Google LLC # Copyright 2020 Team Spacecat # # 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 applicabl...
tests.py
# -*- coding: utf-8 -*- # # See LICENSE for copyright notices from __future__ import print_function, unicode_literals import asyncore import lmtpd import os import shutil import socket import tempfile import threading import unittest TO = b"mrs.smoker@example.com" FROM = b"mrs.non-smoker@example.com" MSG = b"""Subje...
feature_shutdown.py
#!/usr/bin/env python3 # Copyright (c) 2018-2019 The Bitkincoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test bitkincoind shutdown.""" from test_framework.test_framework import BitkincoinTestFramework fro...
TaskMan.py
import time from actasks import Task from wsmanager import WSManager import websocket import threading import tempfile import os #import signal import shutil import ntpath import n4d.responses class TaskMan(): ''' Server Task Manager Manages all tasks in server and its communication via web socke...
1.4.2.py
#coding:utf-8 #1. threading模块创建多线程 import random import time, threading # 新线程执行的代码: def thread_run(urls): print 'Current %s is running...' % threading.current_thread().name for url in urls: print '%s ---->>> %s' % (threading.current_thread().name,url) time.sleep(random.random()) print '%s ...
test_runner.py
# Copyright 2019 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "LICENSE.txt" file acc...
PyBirthdayWish.py
#!/usr/bin/python3 import os,random from threading import Thread from time import sleep import vlc from termcolor import colored from config import * # Importing module specified in the config file art = __import__(f'arts.{artFile}', globals(), locals(), ['*']) def replaceMultiple(mainString, toBeRep...
test_tcp.py
import asyncio import asyncio.sslproto import gc import os import select import socket import unittest.mock import ssl import sys import threading import time import weakref from OpenSSL import SSL as openssl_ssl from uvloop import _testbase as tb SSL_HANDSHAKE_TIMEOUT = 15.0 class MyBaseProto(asyncio.Protocol): ...
newsreceipt.py
""" newsreceipt.py Copyright (c) 2015 Brunston Poon/brupoon Written for RPi and Adafruit Thermal Printer (note to self: try PEP8 for functions/classes, etc.) """ from __future__ import print_function import RPi.GPIO as GPIO import sys, os, random, getopt, re import subprocess, time, Image, socket from Adafruit_Therma...
test_logging.py
# Copyright 2001-2021 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...
sparql_status_without_iam.py
""" Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 """ import threading import logging import time import requests from graph_notebook.configuration.generate_config import AuthModeEnum from graph_notebook.sparql.query import do_sparql_query from graph_notebook....
game.py
import time import numpy as np from enum import Enum from threading import Thread from kivy.clock import mainthread from kivy.properties import StringProperty, ObjectProperty, BooleanProperty, DictProperty from kivy.core.window import Window from kivy.uix.relativelayout import RelativeLayout from kivy.uix.label import...
pyshell.py
#! /usr/bin/env python3 import sys try: from tkinter import * except ImportError: print("** IDLE can't import Tkinter.\n" "Your Python may not be configured for Tk. **", file=sys.__stderr__) raise SystemExit(1) import tkinter.messagebox as tkMessageBox if TkVersion < 8.5: root = ...
002b_thread (004b).py
# Python code to create threads import threading import time def dummy(): pass def main(): for i in range(5): tid = threading.Thread(target=dummy, args=[]) print (f'Created new thread {tid} {threading.get_ident()}') time.sleep(1) if __name__ == '__main__': main()
read.py
import multiprocessing import cv2 as cv import numpy as np import re import sys from scipy import ndimage #from skimage import measure import pandas as pd import os from Operations import addBorders, find_contours, process_kwh, process_numb, resize_kwh, rotate, create_final_answer import easyocr from multiprocessing im...
breakpad_test.py
#!/usr/bin/python # Copyright 2015 Couchbase, 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 appl...
run_server.py
from argparse import ArgumentParser, Namespace import base64 from dataclasses import dataclass from enum import Enum from functools import partial import json import os import platform import queue import random import shutil from subprocess import Popen, PIPE import sys import time import threading import traceback fr...
4.thread_name.py
import threading import time def worker(): print(threading.currentThread().getName(), "Starting") time.sleep(2) print(threading.currentThread().getName(), "Ending") return t = threading.Thread(target=worker) t.start() w = threading.Thread(name="worker", target=worker) w.start() print("testing")
test_validation.py
from threading import Thread import pytest from pep440_version_utils import Version from rasa.shared.exceptions import YamlException, SchemaValidationError import rasa.shared.utils.io import rasa.shared.utils.validation as validation_utils import rasa.utils.io as io_utils import rasa.shared.nlu.training_data.schemas...
05_solve_consumer_producer_problem_with_mutual_exclusion.py
import threading counter_buffer = 0 counter_lock = threading.Lock() COUNTER_MAX = 10000000 def counsumer1_counter(): global counter_buffer for i in range(COUNTER_MAX): # counter_lock.acquire() # print(threading.current_thread().name, i) counter_buffer += 1 # counter_lock.release() def counsumer2_counter...
test_concurrency.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Tests for concurrency libraries.""" import os import random import sys import threading import time from flaky import flaky import coverage from coverage impo...
main.py
import os, sys from threading import Thread, Timer from bokeh.layouts import column, row from bokeh.models import Button from bokeh.plotting import curdoc, figure from bokeh.models.widgets import Div from functools import partial from PIL import Image from pathlib import Path try: import datashader except ImportE...
process_queue.py
""" 进程间通信示例 """ from multiprocessing import Process,Queue q = Queue() # 消息队列 # 解决问题 分之任务解决器 def handle(): while True: res = q.get() try: # 将res作为语句执行 eval(res) except: print("语法有误") p = Process(target=handle,daemon=True) p.start() # 任务主线,随时提取问题需要解决 whi...
test_xmlrpc.py
import base64 import datetime import sys import time import unittest import xmlrpclib import SimpleXMLRPCServer import mimetools import httplib import socket import StringIO import os import re from test import test_support try: import threading except ImportError: threading = None try: import gzip except...
runtests.py
#!/usr/bin/env python3 # This file is picked from project testa [https://github.com/TimeExceed/testa.git] # Copyright (c) 2013, Taoda (tyf00@aliyun.com) # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are...
accessory_driver.py
"""AccessoryDriver - glues together the HAP Server, accessories and mDNS advertising. Sending updates to clients The process of sending value changes to clients happens in two parts - on one hand, the value change is indicated by a Characteristic and, on the other, that change is sent to a client. To begin, typically...
queue_runner.py
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
rwf.py
#!/usr/bin/env python #-*- coding: utf-8 -*- from time import time from collections import deque from threading import RLock, Thread from random import Random from httplib import HTTPConnection, responses from argparse import ArgumentParser class RWF: def __init__(self, num_threads=30, conn_timeout=1, ...
__init__.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import codecs import logging import os import select import six import subprocess import sys import time import timeit import warnings from multiprocessing import Pipe from threading import Thread # # run() - A function to sync...
ubxstreamer.py
""" Example implementation of a threaded UBXMessage streamer Connects to the receiver's serial port and sets up a threaded UBXReader process. With the reader process running in the background, it polls the current PRT, USB, NMEA and MSG configuration. You should see the poll responses in the input stream, or an ACK-N...
testHarness.py
import copy, ctypes, multiprocessing, os, random, io, sys, threading, time, ast import importlib.util from ..tools import log from ..paths import TEST_PATH done = False msg_length = 400 def timerDone(): global done done = True def manageException(e, errors, input, output, actual): if type(e) == AssertionError: ...
mypal_topics.py
#!/usr/bin/env python2 import time import os import sys import signal import threading import rospy from pymycobot.mypalletizer import MyPalletizer from mypalletizer_communication import( MypalAngles, MypalCoords, MypalSetAngles, MypalSetCoords, MypalGripperStatus, MypalPumpStatus, ) class W...
GoogleArtDownloader.py
import os import platform import shutil import time as t import tkinter as tk import webbrowser from threading import Thread from PIL import Image, ImageChops from selenium import webdriver from conf import data_ IMG_XPATH = ".//html/body/div[3]/div[3]/div/div/div/div[3]/div" ZOOM_BTN_XPATH = ".//html/body/div[3]/di...
test_server.py
"""Tests for the HTTP server.""" # -*- coding: utf-8 -*- # vim: set fileencoding=utf-8 : from __future__ import absolute_import, division, print_function __metaclass__ = type from contextlib import closing import os import socket import tempfile import threading import time import uuid import pytest import requests ...
game.py
import os import torch import torch.multiprocessing as _mp from models.a2c.A2C import A2C from models.a2c.test import test as test_a2c from models.a2c.train import train as train_a2c from models.a3c.A3C import A3C from models.a3c import optimizers from models.a3c.test import test as test_a3c from models.a3c.train imp...
worker.py
import logging import queue import threading from time import sleep from searchzone.tasks.helper import read_file_and_add_to_queue from searchzone.elastic.appsearch import AppSearchConnector from searchzone.tasks.update import outdated from searchzone.tasks.new import new from searchzone.tasks.diff import diff from se...
lock.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) """These tests ensure that our lock works correctly. This can be run in two ways. First, it can be run as a node-local t...
test_browser.py
# coding=utf-8 # Copyright 2013 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. from __future__ import print_function import argparse ...
test_pool.py
import collections import random import threading import time from unittest.mock import ANY from unittest.mock import call from unittest.mock import Mock from unittest.mock import patch import weakref import sqlalchemy as tsa from sqlalchemy import event from sqlalchemy import pool from sqlalchemy import select from s...
master.py
# .~~. .~~. # '. \ ' ' / .' # .~ .~~~..~. # : .~.'~'.~. : # ~ ( ) ( ) ~ # ( : '~'.~.'~' : ) WEATHER LOGGER V 0.0.1 ALPHA # ~ .~ ( ) ~. ~ # ( : '~' : ) # '~ .~~~. ~' # '~' # # This Python script logs data from a Raspberry Pi 4 connected to a sensor arra...
printing_cost.py
import argparse import csv import os from multiprocessing import Process, Queue import cost_config as cfg from PIL import Image cmyk_scale = 255 # PIL scale cmyk from 0 to 255 def main(image_path, output, num_threads): image_list = os.listdir(image_path) task_queue = Queue() for img in image_list: ...
__init__.py
#!/usr/bin/env python # # 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 sur...
popups.py
import glob import json import os import re import stat import threading import time from typing import Any, Dict, List, Tuple, Union from zipfile import ZipFile import urllib3 from kivy.clock import Clock from kivy.metrics import dp from kivy.properties import BooleanProperty, ListProperty, NumericProperty, ObjectPro...
Mocha.py
""" Mocha - Discord bot for tracking Ko-fi supporters by SockHungryClutz Discord bot side handles initialization, handling messages to and from discord, all the data associated with normal use, pretty much everything. """ import discord from discord.ext import commands from multiprocessing import Process, Queue from CS...
blokus_multi_client.py
from ..envs.blokus.BlokusEnvironment import BlokusEnvironment from ..envs.blokus.BlokusClientEnvironment import BlokusClientEnvironment from colosseumrl.RLApp import RLApp from colosseumrl.rl_logging import init_logging import logging import numpy as np from random import choice from itertools import repeat import mult...
test_sampling.py
import math import threading import pickle import pytest from copy import deepcopy import numpy as np from numpy.testing import assert_allclose, assert_equal, suppress_warnings from numpy.lib import NumpyVersion from scipy.stats.sampling import ( TransformedDensityRejection, DiscreteAliasUrn, DiscreteGuideT...
__main__.py
import curses import sys import threading import re import castero from castero import helpers from castero.config import Config from castero.display import Display from castero.feeds import Feeds from castero.player import Player def main(): # instantiate DataFile-based objects feeds = Feeds() # update...
EastMoneyFundCrawler.py
import copy import logging import threading import time from datetime import datetime from multiprocessing.dummy import Pool as ThreadPool from urllib.parse import urlencode from django.db import transaction from django.conf import settings import requests from apps.fund.models import FundManagerRelationship, FundRank...
region.py
from __future__ import with_statement import contextlib import datetime from functools import partial from functools import wraps import logging from numbers import Number import threading import time from decorator import decorate from . import exception from .api import CachedValue from .api import NO_VALUE from ....
dumping_callback_test.py
# Copyright 2019 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...
heartbeat.py
import os import sys import BaseHTTPServer import threading import nose.tools sys.path.append(os.path.join(os.path.dirname( __file__), '../../../libbeat/tests/system')) from beat.beat import TestCase class BaseTest(TestCase): @classmethod def setUpClass(self): self.beat_name = "heartbeat" ...
global_no_lock.py
import time from threading import Thread x = 0 def test_function(): global x local_x = x # process local_x += 1 time.sleep(0.5) x = local_x thread_1 = Thread(target=test_function) thread_2 = Thread(target=test_function) thread_1.start() thread_2.start() thread_1.join() thread_2.join() ...
core.py
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
grab_pickle.py
# coding: utf-8 from unittest import TestCase try: import cPickle as pickle except ImportError: import pickle from multiprocessing import Process, Queue from grab import Grab from test.server import SERVER from test.util import build_grab class TestGrab(TestCase): def setUp(self): SERVER.reset() ...
googlesearch.py
''' Created on May 5, 2017 @author: anthony ''' import urllib2 import math import re from bs4 import BeautifulSoup from pprint import pprint from threading import Thread from collections import deque from time import sleep class GoogleSearch: USER_AGENT = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/5...
test_PROTON_2121_blocking_connection_fd_leak.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...
Actor.py
""" An actor is a threaded program that communicates with the hub. It accepts commands (defined in its Commands/*Cmd.py files), sends keywords (defined in its actorkeys file), and may also send commands to other actors and/or listen for keywords from other actors. Prepare an actor by initializing its class. It will re...
shopify-sites.py
''' NERYS a universal product monitor Current Module: Shopify Sites Usage: NERYS will monitor specified sites for keywords and sends a Discord alert when a page has a specified keyword. This can be used to monitor any site on a product release date to automatically detect when a product has been uploaded. U...
sender.py
#!/usr/bin/python3 # This file is part of the MAVLink Router project # # Copyright (C) 2017 Intel Corporation. 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 # # h...
participant_controller.py
# Author: # Arpit Gupta (Princeton) # Robert MacDavid (Princeton) import argparse import atexit import json import socket from multiprocessing.connection import Listener, Client import os from sys import exit from threading import RLock, Thread import time import sys np = os.path.dirname(os.path.dirname(os.path.r...
boarddesigner.py
#!/usr/bin/env python3 import sys import os from enum import Enum, auto import tkinter as tk from threading import Thread, Event from PIL import Image, ImageTk import tkinter.filedialog as tkfd import libnochmal as ln from libnochmal import Color class Tool(Enum): PEN = auto() FILL = auto() STAR = aut...
ps.py
#!/usr/bin/env python3 __version__ = '0.2' __author__ = 'Dan Hollis' import os import sys import traceback from datetime import datetime from flask import Flask from flask import render_template from flask import request from getpass import getpass from glob import glob from sqlalchemy import func from threading imp...
mypivideostream.py
import os import cv2 from picamera.array import PiRGBArray from picamera import PiCamera from threading import Thread # path to training data for HAAR face classifier FACE_DETECTOR_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'haarcascade_frontalface_default.xml...
tools.py
# -*- coding: utf-8 -*- # @Time : 2021/3/22 13:20 # @Author : Shigure_Hotaru # @Email : minjie96@sencyber.cn # @File : tools.py # @Version : Python 3.8.5 + import json import math import os import socket import logging import struct import time import traceback from concurrent.futures import ThreadPoolEx...
uiautomation_in_thread.py
#!python3 # -*- coding: utf-8 -*- import os import sys import time import threading sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # not required after 'pip install uiautomation' from uiautomation import uiautomation as auto def threadFunc(uselessRoot): """ If you want to use U...
app.py
import argparse import time import signal from threading import Thread, Event from cron_tools.agent.config import AgentConfiguration from cron_tools.agent.rpc_server import AgentUnixStreamRPCServer, attach_agent_functions from cron_tools.agent.queries import SimpleConnectionPool, write_schema, remove_old_jobs, get_key...
core.py
# Copyright 2011-2013 James McCauley # # 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 ...
rpc_test.py
import concurrent.futures import contextlib import json import os import sys import threading import time from collections import namedtuple from functools import partial from threading import Event from threading import Lock from unittest import mock import torch import torch.nn as nn import torch.distributed as dis...
jackbox_room_finder.py
import datetime import logging import random import time from concurrent.futures import ThreadPoolExecutor, as_completed from itertools import product import requests from .models import JackboxRoom base_url = "https://blobcast.jackboxgames.com/room/" logger = logging.getLogger(__name__) max_attempts = 100 attempts ...
track.py
# Copyright (c) 2021 Alphons Gwatimba # # This software is released under the MIT License. # https://opensource.org/licenses/MIT import os from multiprocessing import Process, Queue from shutil import rmtree from alive_progress import alive_bar import click import epic from epic.analysis.analyse import analyse from ...
herd.py
#!/usr/bin/env python import argparse import logging import os import random import re import socket import subprocess import sys import tempfile import threading import time import BitTornado.BT1.track as bttrack import BitTornado.BT1.makemetafile as makemetafile import murder_client as murder_client opts = {} log = ...
gate.py
# coding: utf-8 import argparse import livechanapi import config import requests import websocket import threading import time import json tripmap = {} for l in requests.get('https://kotchan.org/js/tripflags.js').text.splitlines(): if l.startswith('flags_image_table'): tripmap[l.split('"')[1]] = l.split('"...
bF-processes.py
import itertools import string import time import math import multiprocessing as mp class bruteForce: def __init__(self): self.charList = 'abcdefghijklmnopqrstuvwxyz' self.password = 'qwerty' self.password_length = len(self.password) self.limit = math.pow(len(self.charList),self.password_length)/26 self.sta...
dask.py
# pylint: disable=wrong-import-position,wrong-import-order,import-error """Dask extensions for distributed training. See xgboost/demo/dask for examples.""" import os import sys import math import platform import logging from threading import Thread from . import rabit from .core import DMatrix from .compat im...
collector.py
# **************************************************************************** # # fkie_iop_node_manager # Copyright 2019 Fraunhofer FKIE # Author: Alexander Tiderko # # 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 ...
guimicro.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # final level Graphical User Interface for stagecontrol.py # Swapped to PyQt5 from Tkinter, because the former is more powerful/intuitive to implement features # microgui will pair functions with commands imported from stagecontrol.py which uses raster in turn # I'm sorr...
plateviewer.py
# coding=utf-8 """plateviewer.py - a user interface to view the image files for a plate """ import multiprocessing import threading import traceback import matplotlib import matplotlib.backends.backend_wx import matplotlib.backends.backend_wxagg import matplotlib.cm import matplotlib.figure import numpy import wx imp...
simbot_bootstrap.py
""" Filename: simbot_bootstrap.py Author: contact@simshadows.com Manages basic configuration, and wraps simbot in a child process that is restarted automatically by this module as needed. """ import os import os.path import sys import time import textwrap import logging import multiprocessing as mp from copy import...
keep_alive.py
from flask import Flask from threading import Thread app = Flask("") @app.route("/") def home(): return "Senpai is online" def run(): app.run(host="0.0.0.0", port=8080) def keep_alive(): t = Thread(target=run) t.start()
app_communication.py
#!/usr/bin/env python3 import rospy import bluetooth as bt import select import threading from std_srvs.srv import Empty import dynamic_reconfigure.client from struct import pack, unpack class Communicator: def __init__(self): self.connections = [] self.port = 1 self.server_socket = bt.Bluet...
spacepaper.py
#!/usr/bin/env python import os import sys import time import signal import random import argparse import requests import datetime import calendar import threading import subprocess as subp R = '\033[31m' # red G = '\033[32m' # green C = '\033[36m' # cyan W = '\033[0m' # white i = '' key = '' sv = '' url = '' arr = ...
tile_downloader.py
import csv import os import pickle import json from itertools import chain from shapely.geometry.polygon import Polygon import threading import shutil import requests from pathlib import Path class TileDownloader(object): """ Class to download tiles from the openNRW web server in a multi-threaded ...
runners.py
# -*- coding: utf-8 -*- import locale import os import struct from subprocess import Popen, PIPE import sys import threading import time import signal from .util import six # Import some platform-specific things at top level so they can be mocked for # tests. try: import pty except ImportError: pty = None tr...
server.py
# -*- coding: utf-8 -*- """ This module contains the server socket definition. """ import argparse import inspect import logging import json import os import struct import sys import time import traceback import threading try: import socketserver PY33 = True except ImportError: import SocketServer as sock...
connector.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 https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software dist...
filter.py
import socket import threading from dnslib import DNSRecord from dnslib import A #ipv4 from dnslib import AAAA #ipv6 from dnslib import CNAME #redirection def ProcessDNSQuery(DnsDisConnection, PowerDnsConnection, BufferSize, DnsQuery, DnsQueryAddress): PowerDnsConnection.send(DnsQuery) DnsResponse, D...
dagger.py
"""Author: Brandon Trabucco, Copyright 2019, MIT License""" import multiprocessing from cs285.baselines.imitate.dagger import Dagger from gym.envs.mujoco.hopper import HopperEnv def run_experiment(experiment_id): Dagger( HopperEnv, logging_dir="./hopper/dagger/{}".format(experiment_id), ...
test_ssl.py
# Test the support for SSL and sockets import sys import unittest from test import support import socket import select import time import datetime import gc import os import errno import pprint import urllib.request import threading import traceback import asyncore import weakref import platform import functools impor...