source
stringlengths
3
86
python
stringlengths
75
1.04M
generate-dataset-canny.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author : Hongzhuo Liang # E-mail : liang@informatik.uni-hamburg.de # Description: # Date : 20/05/2018 2:45 PM # File Name : generate-dataset-canny.py import numpy as np import sys import pickle from dexnet.grasping.quality import PointGraspMetrics3D from...
Chap10_Example10.13.py
from threading import * from time import sleep def display(num1,num2): print(f"{current_thread().name} thread started") sleep(1) mul = num1 * num2 print(f"{current_thread().name} executing display function with value {mul}") myt1 = Thread(target = display, name= "MyChildThread1",args = (10,20))...
__init__.py
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Implements context management so that nested/scoped contexts and threaded contexts work properly and as expected. """ import collections import functools import logging import platform import string import sys import threading import time from ..timeout import Timeout...
test_api_gunicorn_scheduler.py
import json import os import shutil import sys import time import unittest from multiprocessing import Process import requests from app import api from app import configs from app import schedulerv2 from app import sync from common import posts EC = configs.EnjoliverConfig(importer=__file__) EC.api_uri = "http://127...
notify.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 urllib.parse import requests # 原先的 print 函数和主线程的锁 _print = print mutex = threading.Lock() # 定义新的 print 函数 def print(text, *args, **kw): """ 使输出有序进行,不出现多线...
actions.py
# This files contains your custom actions which can be used to run # custom Python code. # # See this guide on how to implement these action: # https://rasa.com/docs/rasa/core/actions/#custom-actions/ # This is a simple example for a custom action which utters "Hello World!" import re import io import ast import req...
base_test.py
# -*- coding: utf-8 -*- import contextlib import copy import datetime import json import threading import elasticsearch import mock import pytest from elasticsearch.exceptions import ElasticsearchException from elastalert.enhancements import BaseEnhancement from elastalert.kibana import dashboard_temp from elastalert...
wsdump.py
#!/usr/bin/env python3 """ 测试websocket用的工具 需要安装的依赖: websocket-client """ 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 = ...
mail.py
#!/usr/bin/env python # -*- coding=UTF-8 -*- # ************************************************************************* # Copyright © 2015 JiangLin. All rights reserved. # File Name: mail.py # Author:JiangLin # Mail:mail@honmaple.com # Created Time: 2015-11-27 21:59:02 # *************************************...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
mtg_goldfish_parser.py
from typing import Collection from bs4 import BeautifulSoup import requests import re from .deck import Deck from threading import Thread class Goldfish_Parser(): def __init__(self, my_collection): self.decks = [] self.my_coll = my_collection def get_mtg_goldfish_deck_links(self): pa...
test_client.py
import asyncio from collections import deque from contextlib import suppress from functools import partial import gc import logging from operator import add import os import pickle import psutil import random import subprocess import sys import threading from threading import Semaphore from time import sleep import tra...
ssh.py
from __future__ import absolute_import from __future__ import division import inspect import logging import os import re import shutil import six import string import sys import tarfile import tempfile import threading import time import types from pwnlib import term from pwnlib.context import context, LocalContext f...
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...
wsocket.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ WSocket is a Simple WSGI Websocket Server, Framework, Middleware And App. It also offers a basic WSGI framework with routes handler, a built-in HTTP Server and event based websocket application. all in a single file and with no dependencies other than the Python Standard...
server.py
import socket from threading import Thread conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM) conn.bind(('127.0.0.1', 5000)) conn.listen(10) def send(message, sender): for client in clients: if sender != client: client.send(message) def listen(client): while True: message ...
Lauren.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import time from src import InstaBot from src.check_status import check_status from src.feed_scanner import feed_scanner from src.follow_protocol import follow_protocol from src.unfollow_protocol import unfollow_protocol from multiprocessing import Process from ...
engine.py
# encoding: UTF-8 # 系统模块 from __future__ import print_function from __future__ import absolute_import try: import queue except ImportError: import Queue as queue from threading import Thread from time import sleep from collections import defaultdict # 第三方模块 # TODO: add timer # from qtpy.QtCore import QTimer ...
tunnel.py
"""Basic ssh tunnel utilities, and convenience functions for tunneling zeromq connections. """ # Copyright (C) 2010-2011 IPython Development Team # Copyright (C) 2011- PyZMQ Developers # # Redistributed from IPython under the terms of the BSD License. from __future__ import print_function import atexit import os i...
ComputeNodeTest.py
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted ...
__init__.py
""" exos.py EXpressions Over Statements: extended functional tools in Python. """ import threading from functools import partial, reduce from inspect import getfullargspec from operator import iconcat from .decorators import curry, fattr, memoize from .exceptions import NonExhaustivePattern from .io import each, peac...
_techreview-textEditor.py
""" ################################################################################ PyEdit 2.1: a Python/tkinter text file editor and component. Uses the Tk text widget, plus GuiMaker menus and toolbar buttons to implement a full-featured text editor that can be run as a standalone program, and attached as a componen...
binlogCapturer.py
# Copyright (c) 2020-present ly.com, 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 applic...
scripts.py
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function import os import sys import time import logging import threading import traceback from random import randint # Import salt libs from salt....
test.py
import json import select import time import logging import os import threading from typing import Callable import aicrowd_helper import gym import minerl import abc import numpy as np import coloredlogs coloredlogs.install(logging.DEBUG) # our dependencies import joblib import sys sys.path.append(os.path.abspat...
heartbeat.py
import sys import datetime import json import time from multiprocessing import Process from .repository import repository_for_url, Repository from .metadata import rfc3339_datetime DEFAULT_REFRESH_INTERVAL = datetime.timedelta(seconds=10) class Heartbeat: def __init__( self, experiment_id: str,...
1507834892-1to7-Host.py
import sys import time import threading import traceback import pythonsv_icx_handler as itp_sv from MiddleWare import lib_wmi_handler from MiddleWare import lib_flash_server as lfs from MiddleWare import lib_power_action_soundwave as lpa from MiddleWare.lib_bios_config import BiosMenuConfig from SoftwareAbstractionLaye...
test_signal.py
import os import random import signal import socket import statistics import subprocess import sys import threading import time import unittest from test import support from test.support.script_helper import assert_python_ok, spawn_python try: import _testcapi except ImportError: _testcapi = None class Generi...
eval_jcr.py
import os import torch import torch.multiprocessing as mp from utils.evaluation import UntrimmedDatasetEvaluator from utils.misc import get_folders_and_files os.environ['CUDA_VISIBLE_DEVICES'] = '0' mp.set_start_method('spawn', force=True) def benchmark(evaluator: UntrimmedDatasetEvaluator, m_path: str, o_path: str...
species.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from . import BaseSpecies from .utils import * import threading from itertools import product class SimpleSpecies(BaseSpecies): pass class DualSpecies(BaseSpecies): params = {'n_elders':0.5, 'mate_prob':0.75} @property def male_population(self): ...
eventlet.py
"""A eventlet based handler.""" from __future__ import absolute_import import contextlib import logging import eventlet from eventlet.green import select as green_select from eventlet.green import socket as green_socket from eventlet.green import time as green_time from eventlet.green import threading as green_thread...
httpclient_test.py
from __future__ import absolute_import, division, print_function import base64 import binascii from contextlib import closing import copy import functools import sys import threading import datetime from io import BytesIO from tornado.escape import utf8, native_str from tornado import gen from tornado.httpclient impo...
multiprocessing7_lock.py
# View more 3_python 1_tensorflow_new tutorial on my Youtube and Youku channel!!! # Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg # Youku video tutorial: http://i.youku.com/pythontutorial import multiprocessing as mp import time def job(v, num, l): l.acquire() for _ in rang...
threads.py
import time from threading import Thread, Event def countdown(n, event): while n: event.set() print(n) time.sleep(1.5) n -= 1 event = Event() t = Thread(target=countdown, args=(100, event)) class CountDown: def __init__(self): self._running = True def terminat...
PreDebugWatchDev.py
import os import platform import subprocess from threading import Thread import time import sys import random import socket print("SqBuild: Python ver: " + platform.python_version() + " (" + platform.architecture()[0] + "), CWD:'" + os. getcwd() + "'") if (os.getcwd().endswith("SqCore")) : # VsCode's context menu 'Run...
service_handler.py
""" Deals with the webserver and the service modules """ import importlib import BaseHTTPServer import SimpleHTTPServer from SocketServer import ThreadingMixIn import threading from time import sleep from utils import * import json import MySQLdb import warnings import base_service import atexit #Web server Protocol =...
adb_profile_chrome.py
#!/usr/bin/env python # # Copyright 2013 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. import gzip import logging import optparse import os import re import select import shutil import sys import threading import time im...
test_index.py
import pytest from base.client_base import TestcaseBase from base.index_wrapper import ApiIndexWrapper from utils.util_log import test_log as log from common import common_func as cf from common import common_type as ct from common.common_type import CaseLabel, CheckTasks from common.code_mapping import CollectionErro...
processy.py
try: from queue import Queue, Empty except ImportError: from Queue import Queue, Empty from multiprocessing import Process import logging log = logging.getLogger(__name__) def processed(items, func, max_processes=5, max_queue=200, join=True, daemon=True): """ Run a function ``func`` for ...
freetests.py
#!/usr/bin/env python3 # coding: utf-8 # Copyright 2013 Abram Hindle # # 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 ...
reactor.py
import asyncore import errno import io import logging import os import select import socket import ssl import sys import threading import time from collections import deque from functools import total_ordering from heapq import heappush, heappop from threading import get_ident from hazelcast.config import SSLProtocol...
test_avi_api.py
import json import logging import unittest from multiprocessing.pool import ThreadPool import pytest from avi.sdk.avi_api import (ApiSession, ObjectNotFound, APIError, ApiResponse, avi_timedelta, sessionDict) from avi.sdk.utils.api_utils import ApiUtils from avi.sdk.samples.common import ge...
client.py
from socket import AF_INET, socket, SOCK_STREAM from threading import Thread import tkinter def receive(): """Handles receiving of messages.""" while True: try: msg = client_socket.recv(BUFSIZ).decode("utf8") if(msg=="options"): global pool globa...
test_forward.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...
bot.py
# -*- coding: utf-8 -*- from linepy import * import time, threading ts = time.time() cl = LINE("ST", appName="IOS\t10.1.1\tiPhone X\t11.2.5") cl.log(cl.authToken) oepoll = OEPoll(cl) clMID = cl.profile.mid print(clMID) admin = ["u8b9d115e85202db06eb798e8c1b40ae9", "udfd61c9d62794fcae8323841b1fc4b83"] clog = [] cl.findA...
radical-pilot-limits.py
#!/usr/bin/env python import os import time import socket import threading as mt import multiprocessing as mp threads = list() procs = list() files = list() sockets = list() t_max = 4 * 1024 p_max = 1 * 1024 f_max = 1 * 1024 s_max = 1 * 1024 def _work(): time.sleep(30) base = '/tmp/rp_limit...
preprocessing.py
#!/usr/bin/python __author__ = 'Nitin' import threading import marisa_trie as mt import csv import os.path import marshal as Pickle from backports import lzma as lz IP6_INDEX_FILE = '_ip6_index.marisa' NAME_INDEX_FILE = '_name_index.marisa' def build_map(all_name_index_trie, all_target_index_trie, filename='../rec...
segments.py
import json import requests import logging import threading API_KEY = "<enter your edge_impulse_api_key>" projectId = 16681 headers = { "Accept": "application/json", "x-api-key": API_KEY } def segment(tid, ids): for sampleId in ids: url1 = "https://studio.edgeimpulse.com/v1/api/{}/raw-data/{}/fi...
modified_smbprotocol_transport.py
# -*- coding: utf-8 -*- # Copyright: (c) 2019, Jordan Borean (@jborean93) <jborean93@gmail.com> # MIT License (see LICENSE or https://opensource.org/licenses/MIT) # Added support to directly use socket.socket object instead of giving ip and port by (@nkpro2000sr) <naveenstudy2000sr@gmail.com> import logging import sel...
test_fx.py
import builtins import contextlib import copy import functools import inspect import math import numbers import operator import os import pickle import sys import torch import traceback import warnings import unittest from math import sqrt from pathlib import Path from torch.multiprocessing import Process from torch.te...
refactor.py
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Refactoring framework. Used as a main program, this can refactor any number of files and/or recursively descend down directories. Imported as a module, this provides infrastructure to write your own refactor...
data_processing.py
# -*- coding: utf-8 -*- import numpy as np import re import random import json import collections import numpy as np import util.parameters as params from tqdm import tqdm import nltk from nltk.corpus import wordnet as wn import os import pickle import multiprocessing from nltk.tag import StanfordNERTagger from nltk.t...
im2rec.py
import os import sys curr_path = os.path.abspath(os.path.dirname(__file__)) sys.path.append(os.path.join(curr_path, "../python")) import mxnet as mx import random import numpy as np import argparse import threading import cv, cv2 import time def list_image(root, recursive, exts): image_list = [] if recursive: ...
future_object_test.py
# Copyright (c) 2018 PaddlePaddle 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 app...
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...
service_table.py
# Copyright (c) 2020 PaddlePaddle 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 appli...
test_all.py
#! /usr/bin/env python3 """Brute-force test script: test libpqxx against many compilers etc. This script makes no changes in the source tree; all builds happen in temporary directories. To make this possible, you may need to run "make distclean" in the source tree. The configure script will refuse to configure other...
graphical_interface.py
#!/usr/bin/env python import rospy import math import time import sys, select, termios, tty import os from std_msgs.msg import Empty import geometry_msgs.msg from geometry_msgs.msg import Twist from geometry_msgs.msg import TwistStamped x = 0 y = 0 z = 0 from Tkinter import * import ttk import threading import...
test_migrate_stopped_vm_progress.py
''' New Integration test for testing stopped vm migration between hosts. @author: quarkonics ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.operations.volume_operations as vol_ops import zstackwoodpecker.operations.resource_operations...
utils.py
#!/usr/bin/env python import sys import array import numpy as np from skimage.color import rgb2gray from skimage.transform import resize from skimage.io import imread import matplotlib.pyplot as plt import matplotlib.image as mpimg from inputs import get_gamepad import math import threading def resize_image(img)...
test_logging.py
# Copyright 2001-2019 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...
example3.py
# ch15/example3.py import time import threading from multiprocessing import Pool COUNT = 50000000 def countdown(n): while n > 0: n -= 1 if __name__ == '__main__': ####################################################################### # Sequential start = time.time() countdown(COUNT) ...
SparkMQTTStage1_1.py
######################################################################## # This is implementation for Cloud + Edge = iotx Stage 1. Cloud is represented # by Apache Spark and Edge computing framework is Calvin. Apache Spark is # receiving temperature data from Calvin via MQTT (pub/sub model). This # program calculates r...
main.py
from bin.world import search; from colorama import Fore; import multiprocessing as mp; import datetime, random, os; THREADS = int(os.environ.get('THREADS', 4)); RADIUS = int(os.environ.get('RADIUS', 2500)); MIN_SIZE = int(os.environ.get('MIN_SIZE', 18)); SPACING = int(os.environ.get('SPACING', 3)); # Search random se...
test_lock.py
""" Copyright (c) 2008-2017, Jesus Cea Avion <jcea@jcea.es> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of...
run_agentFCL.py
from __future__ import print_function import numpy as np import cv2 import sys import os sys.path.append('./agent') from agent.doom_simulator import DoomSimulator import feedforward_closedloop_learning import threading from matplotlib import pyplot as plt from datetime import datetime import random width = 160 widthI...
race.py
import threading from time import sleep from random import random counter = 0 randsleep = lambda: sleep(0.1 * random()) def incr(n): global counter for count in range(n): current = counter randsleep() counter = current + 1 randsleep() n = 5 t1 = threading.Thread(target=incr...
sensor_daemon.py
''' Created on 2013.09.07. ''' from threading import Thread import time import logging import os from node.sensor.sensor_type import SensorType from node.sensor.sensor_collector import TempHumCollector from node.sensor.sensor_collector import LuxCollector from node.sensor.sensor_collector import DistanceC...
test_message_dict.py
""" Tests for data class message dict. """ import unittest import threading import time from synchronized_set import SynchronizedSet from src.beans import NodeInformation, NetAddress from src.message_dict import MessageDict, DEFAULT_MESSAGE, DISPATCH_MESSAGE, MESSAGE_SEPARATOR, JSON_SEPARATOR alice_information = Nod...
server.py
import cherrypy from cherrypy.lib.static import serve_file import os import sys import webbrowser import threading import time import socket import json from client import addClient, loadClients, clearClients, clientsList, removeClient from transmitJSON import sendJSON, recvJSON def getRootDir(): return os.path.di...
regressions.py
#!/usr/bin/env python3 from argparse import ArgumentParser import sys import os import subprocess import re import glob import threading import time DESCRIPTION = """Regressor is a tool to run regression tests in a CI env.""" class PrintDotsThread(object): """Prints a dot every "interval" (default is 300) second...
main.py
#!/usr/bin/env pybricks-micropython import struct, threading from pybricks import ev3brick as brick from pybricks.ev3devices import (Motor, TouchSensor, ColorSensor, InfraredSensor, UltrasonicSensor, GyroSensor) from pybricks.parameters import (Port, Stop, Direction, Button, Color, SoundFile, ImageFile, Align) from p...
ir_engine.py
# # Copyright (c) 2018-2019 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 la...
dmock.py
# ============================================================================= # # Copyright (c) 2016, Cisco Systems # All rights reserved. # # # Author: Klaudiusz Staniek # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met...
labels.py
import hashlib import requests import threading import json import sys import traceback import aes import base64 import electrum_sib from electrum_sib.plugins import BasePlugin, hook from electrum_sib.i18n import _ class LabelsPlugin(BasePlugin): def __init__(self, parent, config, name): BasePlugin._...
uiautomation.py
# coding=utf-8 __author__ = 'lxn3032' import os import requests import time import warnings import threading import atexit from airtest.core.api import connect_device, device as current_device from airtest.core.android.ime import YosemiteIme from hrpc.client import RpcClient from hrpc.transport.http import HttpTran...
common.py
# -*- coding: utf-8 -*- """ Classes used both by front-end and back-end """ import os.path import platform import site import sys import tokenize from collections import namedtuple from typing import List, Optional # @UnusedImport import subprocess import logging import traceback from threading import Thread MESSAGE...
camera_pi.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # camera_pi.py # # # # Raspberry Pi camera module (developed by Miguel Grinberg) import time import io import threading import picamera class Camera(object): thread = None # background thread that reads frames from camera frame = None # current frame is s...
gui.py
# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # # 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, o...
gdrive.py
#!/usr/bin/env python3 """A script to interact with your Google Drive files using the terminal""" import os import io import pickle import mimetypes import threading import time from argparse import ArgumentParser from os.path import expanduser, join from google_auth_oauthlib.flow import InstalledAppFlow from google....
imageme.py
#coding:utf-8 #!/usr/bin/python """ imageMe is a super simple image gallery server. Run imageme.py from the top level of an image directory to generate gallery index HTML and run a SimpleHTTPServer on the localhost. Imported as a module, use imageme.serve_dir(your_path) to do the same for any directory programmatica...
main.py
#!/usr/bin/env python """Main module.""" import importlib import itertools import logging import multiprocessing import os import pkgutil import signal import sys import threading import time from datetime import datetime, timedelta from ipaddress import ip_address from multiprocessing import Manager, Process import ...
test_isp.py
# -*- coding: utf-8 -*- """ Alle in isp befindlichen Klassen und Funktionen prüfen. Alle Laufzeit Fehlermeldungen sind bei der Testausführung gewollt Nach der Ausführung steht am Ende OK wenn alle Tests durchgefürt wurden. Bei Fehlern in den Überprüfungen steht am Ende:: =====================================...
main.py
import argparse import socket import subprocess import threading from sys import platform import getmac parser = argparse.ArgumentParser(description="Network scanner") parser.add_argument("-a",'--all',help="Scan from 10.10.0.1 to 10.10.255.1",action="store_true") parser.add_argument("-s",'--subnetwork',help...
monitor.py
import sys sys.path.append(r"/home/anoldfriend/OpenFOAM/anoldfriend-7/utilities/") import signal import multiprocessing as mp import time from residual_monitor import read_residuals,plot_multiple_residuals,quit log="run.log" pressure_name="p_rgh" nCorrectors=1 interval=1 sample_size=200 # m_residuals=[["h"],["Ux",...
player_blink_gui.py
import os os.environ["OPENCV_VIDEOIO_MSMF_ENABLE_HW_TRANSFORMS"] = "0" import cv2 import heapq import json import os.path import signal import sys import threading import time import tkinter as tk import tkinter.filedialog as fd from tkinter import ttk from os import listdir from os.path import isfile, join from PIL im...
test_double_spend.py
# Copyright © 2020 Interplanetary Database Association e.V., # Planetmint and IPDB software contributors. # SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) # Code is Apache-2.0 and docs are CC-BY-4.0 # # Double Spend testing # This test challenge the system with double spends. import os from uuid import uuid4 fro...
tasks.py
# -*- coding: utf-8 -*- # Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. # Python from collections import OrderedDict, namedtuple import errno import functools import importlib import json import logging import os import shutil import stat import tempfile import time import traceback from distutils.dir_util ...
tcp_sink.py
import logging import threading import socketserver import hdfs import traceback class TCPSink(object): def __init__(self, queue): self.queue = queue self.thread = threading.Thread(target=self.run, args=()) self.thread.daemon = True self.thread.start() def run(self): ...
server.py
from flask import Flask, render_template from flask import jsonify from threading import Thread import threading import time import datetime import shotgunEventDaemon as sgED import logging import Queue import json # App instance app = Flask(__name__) thread = None running = True # Debug mode, wit...
explorations.py
# pylint: disable=wrong-import-order, wrong-import-position, too-many-nested-blocks # Imports: standard library import os import csv import copy import logging import argparse import datetime import multiprocessing as mp from typing import Any, Dict, List, Tuple, Union, Optional from functools import reduce from collec...
__init__.py
#!/usr/bin/python3 # @todo logging # @todo extra options for url like , verify=False etc. # @todo enable https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl as option? # @todo option for interval day/6 hour/etc # @todo on change detected, config for calling some API # @todo fetch title into json # https://di...
OblivionClient.py
# -*- coding: utf-8 -*- --noconsole import sys import threading import ctypes import time import random import pathlib import base64 import glob import logging import coloredlogs import verboselogs from PySide2 import QtCore, QtWidgets, QtGui from PySide2.QtWidgets import QWidget from PySide2.QtGui import (QBrush, QC...
batcher.py
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # Modifications Copyright 2017 Abigail See # # 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...
task.py
"""task.py: Contains the main unit of execution in PyREM, the task.""" __author__ = "Ellis Michael" __email__ = "emichael@cs.washington.edu" __all__ = ['Task', 'SubprocessTask', 'RemoteTask', 'Parallel', 'Sequential'] import atexit import os import random import string import signal import sys from colle...
main_backup.py
from dk_metric import image_metrics import os from multiprocessing import Process, Lock, Manager import numpy as np import time gt_folder = './180405/180405_Label' prop_folder = './180405/ALBU/train_merged/' output_csv = './scores.csv' radius = 3 files = os.listdir(prop_folder) lock = Lock() ALL_thresholds = [] ALL_...
chrome_test_server_spawner.py
# 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. """A "Test Server Spawner" that handles killing/stopping per-test test servers. It's used to accept requests from the device to spawn and kill instances...
pipeline_utilities.py
#!/usr/bin/env python3 # coding: utf-8 """ Common source for utility functions used by ABCD-BIDS task-fmri-pipeline Greg Conan: gconan@umn.edu Created: 2021-01-15 Updated: 2021-11-12 """ # Import standard libraries import argparse from datetime import datetime # for seeing how long scripts take to run from glob impo...
context.py
#!/usr/bin/env python3 from http import HTTPStatus from urllib.parse import urlparse # import socketserver import threading import http.server import json import queue import socket import subprocess import time import uuid import string import random import yaml import requests import websocket from sqlalchemy impor...
updator.py
"""Has classes that help updating Prompt sections using Threads.""" import builtins import concurrent.futures import threading import typing as tp from prompt_toolkit import PromptSession from prompt_toolkit.formatted_text import PygmentsTokens from xonsh2.prompt.base import ParsedTokens from xonsh2.style_tools impo...