source
stringlengths
3
86
python
stringlengths
75
1.04M
client.py
import time import json import numbers from six.moves.queue import Queue import threading import uuid from eth_client_utils.utils import ( get_transaction_params, construct_filter_args, wait_for_transaction, wait_for_block, get_max_gas, ) class BaseClient(object): def __init__(self, async=Tru...
python_ls.py
# Copyright 2017 Palantir Technologies, Inc. import logging import socketserver import threading from pyls_jsonrpc.dispatchers import MethodDispatcher from pyls_jsonrpc.endpoint import Endpoint from pyls_jsonrpc.streams import JsonRpcStreamReader, JsonRpcStreamWriter from . import lsp, _utils, uris from .config impor...
__init__.py
import copy import threading import typing StateType = typing.TypeVar('StateType') class TimedThread(typing.Generic[StateType]): """ This is a "Thread" class that runs a job for a maximum period of time. The class provides concurrency-safe methods to retrieve and persist a chunk of state. """ d...
regz_socket_MP_FD.py
# coding: utf-8 # # load package and settings # In[ ]: import cv2 import sys import dlib import time import socket import struct import numpy as np import tensorflow as tf from win32api import GetSystemMetrics import win32gui from threading import Thread, Lock import multiprocessing as mp from config import get_c...
threadpool.py
""" Generic thread pool class. Modeled after Java's ThreadPoolExecutor. Please note that this ThreadPool does *not* fully implement the PEP 3148 ThreadPool! """ from threading import Thread, Lock, currentThread from weakref import ref import logging from ambari_agent.ExitHelper import ExitHelper try: from queue i...
dmlc_local.py
#!/usr/bin/env python """ DMLC submission script, local machine version """ import argparse import sys import os import subprocess from threading import Thread import tracker import signal import logging keepalive = """ nrep=0 rc=254 while [ $rc -eq 254 ]; do export DMLC_NUM_ATTEMPT=$nrep %s rc=$?; nr...
worker_manager.py
""" A manager for multiple workers. -- kandasamy@cs.cmu.edu """ from __future__ import print_function from __future__ import division # pylint: disable=invalid-name # pylint: disable=abstract-class-not-used # pylint: disable=abstract-class-little-used from argparse import Namespace from multiprocessing import Pro...
overlay.py
__author1__ = 'David Northcote' __author2__ = 'Lewis McLaughlin' __organisation__ = 'The University of Strathclyde' __date__ = '22nd October 2021' __version_name__ = '<a href="https://www.google.com/search?q=the+cobbler" target="_blank" rel="noopener noreferrer">The Cobbler</a>' __version_number__ = '0.4.0' __channels_...
concurrencytest.py
#!/usr/bin/env python3 # # Modified for use in OE by Richard Purdie, 2018 # # Modified by: Corey Goldberg, 2013 # License: GPLv2+ # # Original code from: # Bazaar (bzrlib.tests.__init__.py, v2.6, copied Jun 01 2013) # Copyright (C) 2005-2011 Canonical Ltd # License: GPLv2+ import os import sys import traceback...
classifyFiles.py
import csv import os import shutil from threading import Thread file_csv = csv.reader(open('D:/dev/csv/train.csv', 'r')) sourceDir = 'D:/dev/csv/data/' targetDir = 'D:/dev/csv/data/target/' suffix = '.tif' i = 0 notExistList = [] existList = [] targetList = [] # 遍历csv for row in file_csv: i = i + 1 # 忽略首行 ...
tk_raw_image_analy_ver0.091.py
## 영상 처리 및 데이터 분석 툴 from tkinter import *; import os.path ;import math from tkinter.filedialog import * from tkinter.simpledialog import * ## 함수 선언부 def loadImage(fname) : global window, canvas, paper, filename, inImage, outImage, inW, inH, outW, outH fsize = os.path.getsize(fname) # 파일 크기 확인 inH ...
CW_Remote_PySide2_Qt.py
#!/usr/bin/env python2.7 # -*- encoding: utf-8 -*- # Y axis ticks/labels optimize # Defer refresh if zoomed # Tried these, can't do, limitations of PySide2: # # X axis ticks/labels optimize # # X/Y axis subticks # $ pyinstaller -F -w --exclude-module _tkinter --exclude-module Tkinter --exclude-module enchant --exclu...
f.py
from pynput.keyboard import Key,Listener import ctypes from os import system from threading import Thread from win32gui import GetWindowText, GetForegroundWindow from pywinauto.application import Application from WConio2 import getkey,setcursortype,clrscr system('mode 55,10') system('color 04') print('svasti') ctypes....
auto_reset_event_test.py
import threading import time from unittest import TestCase from puma.primitives import AutoResetEvent class AutoResetEventTest(TestCase): # AutoResetEvent is derived from threading.Event, and only overrides the wait() method. We only test the modified behaviour, not the base class's behaviour. def test_clea...
client.py
# import blockchain from ecdsa.keys import VerifyingKey from hashutils import hash_object import socket import threading import os import time import hashlib import shutil from blockchain import Blockchain, Block from card import Card import uuid from pickle import dumps, loads import pandas as pd import numpy as np i...
record.py
from __future__ import print_function, division import numpy as np import cv2 import pyaudio import wave import threading import time import subprocess import os import keyboard class VideoRecorder(): "Video class based on openCV" def __init__(self, name="output.avi", fourcc="XVID", sizex=640, s...
test_server_client_am.py
import multiprocessing as mp import os from functools import partial from queue import Empty as QueueIsEmpty import numpy as np import pytest from ucp._libs import ucx_api from ucp._libs.arr import Array from ucp._libs.utils_test import blocking_am_recv, blocking_am_send mp = mp.get_context("spawn") RNDV_THRESH = 8...
cabinet.py
import ipaddress import os.path import threading import time import yaml from enum import Enum from typing import Dict, List, Optional, Sequence, Tuple, Union from naomi import NaomiSettingsPatcher from netdimm import NetDimmInfo, NetDimmException, NetDimmVersionEnum, CRCStatusEnum from netboot.hostutils import Host, ...
mc_test.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' .. _module_mc_test: mc_test =============================================== ''' import threading import time import Queue import os import traceback import salt.exceptions import salt.output from salt.utils.odict import OrderedDict from mc_states import api from ...
test_ucx_options.py
import multiprocessing as mp import numpy import pytest import dask from dask import array as da from distributed import Client from distributed.deploy.local import LocalCluster from dask_cuda.utils import _ucx_110 mp = mp.get_context("spawn") ucp = pytest.importorskip("ucp") # Notice, all of the following tests i...
00Template.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # ----------------------------------------------------------------------------------------------------------- # Name: 00Template.py # Purpose: This is a copy of an early version of 01ThreadCounter.py # saved as a template for other modules # # ...
test_ftplib.py
"""Test script for ftplib module.""" # Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS # environment import ftplib import asyncore import asynchat import socket import StringIO import errno import os try: import ssl except ImportError: ssl = None from unittest import TestCase, ...
batch_ops_test.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
AIData.py
# import python libs from threading import Thread # import project libs from controller import Client from ai import AiDataEngine class AIData: """start all the data threading pass it the master signal class for emmission""" def __init__(self, ai_signal_obj, harmony_signal): self.ai_signal = ai...
pruebas.py
#!/usr/bin/env python # -*- coding: latin-1 -*- import os import sys import csv import time import datetime import math from tkinter import* from PIL import Image, ImageTk from reportlab.lib.units import mm, inch from reportlab.pdfgen import canvas as pdf from mbarete import geometria global d,canvas_width,canvas_heigh...
legion.py
#!/usr/bin/env python3 import time import sys import select import re import getopt import uuid import socket import hashlib import random import datetime import os import netifaces import fnmatch from comms import Comms from multicast import MultiCast from multicast import continuousTimer from multiprocessing import ...
test__geometric_intersection.py
# 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 # distributed under t...
process_replay.py
#!/usr/bin/env python3 import importlib import os import sys import threading import time import signal from collections import namedtuple import capnp import cereal.messaging as messaging from cereal import car, log from cereal.services import service_list from common.params import Params from common.timeout import ...
background_task.py
#!/usr/bin/env python # Run a background task while the main task loop progresses import numpy as np from threading import Thread import rospy import actionlib from task_executor.abstract_step import AbstractStep from actionlib_msgs.msg import GoalStatus from task_executor.msg import ExecuteAction, ExecuteGoal #...
explicit_threading.py
# Copyright 2019, OpenCensus Authors # # 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...
tests.py
""" Unit tests for reverse URL lookups. """ import sys import threading from admin_scripts.tests import AdminScriptTestCase from django.conf import settings from django.conf.urls import include, url from django.contrib.auth.models import User from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist f...
foldbot.py
#!/usr/bin/env python from threading import Thread from bottle import get, post, run, request, response from time import sleep from dotenv import load_dotenv from sys import exit import requests import os load_dotenv() port = 3000 username = os.getenv('USERNAME') api_token = os.ge...
runner.py
#!/usr/bin/env python2 # Copyright 2010 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. """This is the Emscripten test runner. To run ...
paho_mqtt_client.py
#!/usr/bin/env python import paho.mqtt.client as mqtt_client import asyncio import traceback import threading import functools from uuid import getnode as get_mac from homie.mqtt.mqtt_base import MQTT_Base import logging logger = logging.getLogger(__name__) mqtt_logger = logging.getLogger("MQTT") mqtt_logger.setLe...
server.py
from fastapi import FastAPI, WebSocket import uvicorn import torch import time import json from torch import optim from torch.utils.data import DataLoader import logging from aux import train_one_epoch, get_lr from threading import Thread import copy from utils.AverageMeter import AverageMeter import itertools import n...
build_data.py
# Copyright 2016 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...
personnages3d.py
""" Echap pour finir proprement le script Capture de 1 à 4 squelettes avec camera Intel RealSense D455, Google posenet et Google Coral. """ import os from time import time, sleep from threading import Thread import json import enum import numpy as np import cv2 import pyrealsense2 as rs from posenet.this_posene...
webhook.py
''' webhook.py pj@mrpjevans.com Create a WebHook at ifttt.com to do, well, whatever you want! Maybe send an email to begin with. You'll give it a trigger name which is used to create a URL something like the following: https://maker.ifttt.com/trigger/{trigger_name}/with/key/{your_key} Replace those two values in {} ...
test_futures.py
import os import subprocess import sys import threading import functools import contextlib import logging import re import time import gc import traceback from StringIO import StringIO from test import test_support from concurrent import futures from concurrent.futures._base import ( PENDING, RUNNING, CANCELLED, C...
render.py
#!/usr/bin/python import pygame import sys import time import dpkt import socket import struct import psu from board import Board pygame.init() board = Board(height=45) # we will show the diagonal # actually only 44x57, but the diagonal makes it 45x57, where the diagonal is always off for x in xrange(57): for...
docker.py
# Copyright 2016 Koichi Shiraishi. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. import re import threading from .base import Base from deoplete.util import load_external_module load_external_module(__file__, 'urllib3') load_external_module(...
AppServer.py
# coding : utf-8 import socket import subprocess import threading from time import ctime, sleep from util import * import yaml print('=========SDP应用服务器=========') # 读取配置文件 try: f = open('config.yaml', 'r') global_config = yaml.load(f.read(), Loader=yaml.FullLoader) # {'AuthServer': {'port': 6789, 'id': ...
email.py
from email import message_from_bytes # noinspection PyProtectedMember from email.message import EmailMessage, MIMEPart from email.utils import parsedate_to_datetime from typing import Callable, Type import datetime import imaplib import logging import smtplib import threading import time import tzlocal from chatty.ex...
serverMediaPulse.py
from socket import socket, AF_INET, SOCK_STREAM from threading import Thread import numpy as np import zlib import struct import cv2 from detector.processor import getCustomPulseApp HOST = input("Enter Host IP\n") PORT_VIDEO = 3000 PORT_AUDIO = 4000 lnF = 640*480*3 CHUNK = 1024 BufferSize = 4096 addressesAudio = {} ad...
executor.py
"""HighThroughputExecutor builds on the Swift/T EMEWS architecture to use MPI for fast task distribution """ from concurrent.futures import Future import typeguard import logging import threading import queue import pickle from multiprocessing import Process, Queue from typing import Any, Dict, List, Optional, Tuple, ...
main.py
from selenium import webdriver from selenium.webdriver.common.keys import Keys import re import time import datetime from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By import threading def comment(browser...
routes.py
from .entities import Board from .strategy import need_food, check_attack, detect_wall_tunnels from .utils import timing, get_direction, add, neighbours, touching, food_in_box, available_next_positions from .algorithms import bfs, find_safest_positions, rate_food, flood_fill, rate_cell, longest_path from .constants imp...
helper.py
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri Dec 22 11:53:52 2017 @author: GustavZ """ import datetime import cv2 import threading import time import tensorflow as tf import rospy import sys PY2 = sys.version_info[0] == 2 PY3 = sys.version_info[0] == 3 if PY2: import Queue elif PY3: impor...
AutDriver.py
from threading import Thread from typing import List, Union import time import onnxruntime as rt import cv2 import os from PIL import Image import numpy as np from autcar import Camera, Car class Model: def __init__(self, model_file_path: str, execution_interval: float = 2, name = None): """ Model ...
01_calc_square.py
import time import threading def calc_sq(num): print("Calculate Square numbers: ") for n in num: time.sleep(1) print(f"Square {n*n}\n") def calc_cube(num): print("Calculate Cube numbers: ") for n in num: time.sleep(1) print(f"Cube {n*n*n}\n") arr = [2, 3, 8, 9] star...
test_socket.py
## # Copyright (c) 2013 Yury Selivanov # License: Apache 2.0 ## import asyncio import unittest import grenado import grenado.socket as greensocket class SocketTests(unittest.TestCase): def setUp(self): asyncio.set_event_loop_policy(greando.GreenEventLoopPolicy()) self.loop = asyncio.new_event_...
common.py
#common import sys, argparse, os.path, json, io, glob, time import pathlib, urllib.request, shutil from collections import OrderedDict def as_bytes(x, encoding='utf-8'): if isinstance(x, str): return x.encode(encoding) if isinstance(x, bytes): return x if isinstance(x, bytearray): ...
rtk_provider_base.py
import os import time import json import datetime import threading import math import re import collections import serial import serial.tools.list_ports from ..widgets import NTRIPClient from ...framework.utils import ( helper, resource ) from ...framework.context import APP_CONTEXT from ...framework.utils.firmware...
test_flight.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...
Main_Program_v10.py
''' Main Program v10 --- Features: - Support for reading GPS position values through LCM - Support for reading GPS command values through LCM - Support for Mode change - Support for infrared lane following - Transfered to uno - Support for Odometry. - Serial interface with the Arduino has been disabled - Fuse...
wsdump.py
#!c:\users\connexall\desktop\welcomebot\welcomebot\scripts\python.exe 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 = geta...
gameserver.py
#!/usr/bin/python3 from engine.event import * from engine.action import * from engine.code import * from engine.player import * from engine.round import * from engine.team import * import configparser from flask import Flask, json, jsonify, make_response, session, render_template, request, send_file import json impor...
aria2_download.py
from bot import aria2, download_dict_lock, STOP_DUPLICATE_MIRROR from bot.helper.mirror_utils.upload_utils.gdriveTools import GoogleDriveHelper from bot.helper.ext_utils.bot_utils import * from .download_helper import DownloadHelper from bot.helper.mirror_utils.status_utils.aria_download_status import AriaDownloadStatu...
ddqn_nstep_per_verup_lstm.py
import math, random import gym import numpy as np import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import visdom import time import os vis = visdom.Visdom(port = 8097) import torch.multiprocessing as mp #win_4 = vis.line(Y=torch.tensor([0]),opts=dict(title='reward')) im...
basic_gpu_test.py
# Copyright 2016 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...
smoother.py
"""this is a prototype ensemble smoother based on the LM-EnRML algorithm of Chen and Oliver 2013. It requires the pest++ "sweep" utility to propagate the ensemble forward. """ from __future__ import print_function, division import os from datetime import datetime import shutil import threading import time import numpy...
regen.py
#!/usr/bin/env python3 import os import time import multiprocessing from tqdm import tqdm import argparse # run DM procs os.environ["USE_WEBCAM"] = "1" import cereal.messaging as messaging from cereal.services import service_list from cereal.visionipc.visionipc_pyx import VisionIpcServer, VisionStreamType # pylint: d...
scheduler.py
''' This is the application scheduler. It defines scheduled tasks and runs them as per their defined schedule. This scheduler is started and stopped when the app is started and stopped. Unless RUN_SCHEDULE is set to False in the config. In which case it must be started manually / managed by supervisor. It is presume...
ftumixer.py
#!/usr/bin/env python # Copyright 2013 Jonas Schulte-Coerne # # 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 applicab...
threading_progress.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # threading_progress.py """ Generic classes to perform threading with a progress frame """ # Copyright (c) 2020 Dan Cutright # This file is part of DVHA DICOM Editor, released under a BSD license. # See the file LICENSE included with this distribution, also # availab...
utils.py
#================================================================ # # File name : utils.py # Author : PyLessons # Created date: 2020-09-27 # Website : https://pylessons.com/ # GitHub : https://github.com/pythonlessons/TensorFlow-2.x-YOLOv3 # Description : additional yolov3 and yolov4 functio...
app.py
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 import logging import json import os import pathlib import pprint import subprocess import threading import time import boto3 import srt from flask import Flask, jsonify, Response from flask_cors import CORS # -- E...
test_c10d_common.py
# Owner(s): ["oncall: distributed"] import copy import os import sys import tempfile import threading import time from datetime import timedelta from itertools import product from sys import platform import torch import torch.distributed as dist if not dist.is_available(): print("distributed package not availabl...
NetworkPacketLossCollector.py
#!/usr/bin/env python import os import queue import socket import time import threading from threading import Thread import copy import json from datetime import datetime import stomp import tools import siteMapping TOPIC = "/topic/perfsonar.raw.packet-loss-rate" INDEX_PREFIX = 'ps_packetloss-' siteMapping.reload() ...
KpmManager.py
from threading import Thread, Timer, Event from queue import Queue import sublime_plugin, sublime from .SoftwareOffline import * from .SoftwareUtil import * from .SoftwareHttp import * from .Constants import * from .CommonUtil import * from .TrackerManager import * DEFAULT_DURATION = 60 # payload trigger to store it ...
lambda_function.py
import requests_unixsocket import time import json import subprocess import uuid import multiprocessing import queue import threading import signal import os # note: see https://aws.amazon.com/blogs/compute/parallel-processing-in-python-with-aws-lambda/ def _enqueue_output(out, queue): for line in iter(out.readl...
multi_process_runner.py
# Lint as: python3 # 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 ...
heatmap.py
import pygame from library import * import util import math import threading def debugger(pot_mat): game = threading.Thread(target=heat_map, args=(pot_mat,)) game.start() def heat_map(pot_mat): EXPLORDING = False pygame.init() #Start Pygame SCALLER = 4 HEIGHT = pot_mat...
test_client.py
import os import socket import threading import time import msgpack import pytest from pynats import NATSClient from pynats.exceptions import NATSInvalidSchemeError, NATSReadSocketError @pytest.fixture def nats_plain_url(): return os.environ.get("NATS_PLAIN_URL", "nats://127.0.0.1:4222") @pytest.fixture def n...
test_client.py
import asyncio import concurrent.futures import copy import datetime import functools import os import re import threading import warnings from base64 import b64decode, b64encode from queue import Empty from unittest.mock import MagicMock, Mock import nbformat import pytest import xmltodict from ipython_genutils.py3co...
VirtualSmartcard.py
# # Copyright (C) 2011 Frank Morgner, Dominik Oepen # # This file is part of virtualsmartcard. # # virtualsmartcard 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 3 of the License, or (at your ...
parallel_gc.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- # # Copyright (c) 2019 ASMlover. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright...
modeling.py
''' Main module for "modeling" endpoints ''' __author__ = 'Elisha Yadgaran' from quart import request, render_template, flash, redirect, url_for import imagehash from squirrel.database.models import ModelHistory, UserLabel, SquirrelDescription from simpleml.utils.scoring.load_persistable import PersistableLoader imp...
mainMethods.py
from links import RemoteLinks import file_management import web_data import threading import sys def downloadExamSection(currentPath, examClass): ''' Used for multithreaded downloading. Parameters: currentPath (string): The path to the class folder(accounting, comp sci) examSection (linkClass): T...
test_tasks.py
# Copyright The OpenTelemetry Authors # # 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 ...
portscan.py
#!/usr/bin/env python """Quickly scans a range of TCP/IP ports for a given address This script is intended to ONLY interact with targets for which You are expressly authorized to scan """ import socket, threading, itertools, json, re, os, datetime as dt from optparse import OptionParser __author__ = "Sean ...
client.py
import pickle import socket import random import threading import time import ast import sys def println(s): print(s) def diff(a, b): return set_dict(DictDiffer(a, b).new_or_changed(), a) def set_dict(s, d): return {k: d[k] for k in s} class DictDiffer(object): """ Calculate the difference betwe...
test_enum.py
import enum import inspect import pydoc import sys import unittest import sys import threading from collections import OrderedDict from enum import Enum, IntEnum, EnumMeta, Flag, IntFlag, unique, auto from io import StringIO from pickle import dumps, loads, PicklingError, HIGHEST_PROTOCOL from test import support from ...
misc_utils.py
# -*- coding: utf-8 -*- """ Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix) Copyright (C) 2018 Caphm (original implementation module) Miscellaneous utility functions SPDX-License-Identifier: MIT See LICENSES/MIT.md for more information. """ from __future__ import absolute_import, divisi...
multprocess_crawl.py
import time from multiprocessing import Process import pandas as pd import requests from scrapy.selector import Selector def main(url,icon): print("下载任务{}".format(icon)) r = requests.get(url,headers = {"user-agent":"Mozilla/5.0"}) r.encoding = r.apparent_encoding selector = Selector(text=r.text) ...
scanbackup_20210224142513.py
""" 1、文件到这里 一份给ES 一份给自己 新增ES旧索引入库 在继承原有功能的基础上 重构备份程序,按照数据内的 国家-当前时间(年-月-日) 如果按照数据内的时间的话也会面临和按国家端口备份的问题 不用再分端口了 create by judy 20201217 """ from pathlib import Path import threading import json from queue import Queue import traceback import datetime import time from shutil import copyfile import zipfile import shutil ...
custom_gevent_pool_executor.py
# -*- coding: utf-8 -*- # @Author : ydf # @Time : 2019/7/2 14:11 import atexit import time import warnings from collections import Callable import threading import gevent from gevent import pool as gevent_pool from gevent import monkey from gevent.queue import JoinableQueue from nb_log import LoggerMixin, nb_print...
fetch_refseq.py
#!/usr/bin/env python from __future__ import division, print_function import argparse import functools import gzip import json import os import os.path import sys from datetime import date from multiprocessing import Process, Queue import requests try: from io import StringIO except ImportError: from String...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
rpc.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020 Alibaba Group Holding Limited. 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...
datasets.py
# -*- coding: utf-8 -*- """ © Michael Widrich, Markus Hofmarcher, 2017 Template and parent classes for creating reader/loader classes for datasets """ import glob import time import numpy as np import multiprocessing import pandas as pd from os import path from PIL import Image from TeLL.utility.misc import load_fil...
eventbus.py
import logging import time from threading import Thread, Lock from queue import Queue from .events import Event, TickEvent, isEventMatching from .reflection import publishesHint class ExitEvent(Event): """ A local event that instructs the main event loop to exit """ class EventBusSubscriber: """ The bas...
WikiExtractor.py
#!/usr/bin/python # -*- coding: utf-8 -*- # # ============================================================================= # Version: 2.39 (September 29, 2015) # Author: Giuseppe Attardi (attardi@di.unipi.it), University of Pisa # # Contributors: # Antonio Fuschetto (fuschett@aol.com) # Leonardo Souza (lsouza@amter...
screen.py
import numpy as np from mss import mss from logger import Logger from typing import Tuple from utils.misc import WindowSpec, find_d2r_window, wait from config import Config import threading sct = mss() monitor_roi = sct.monitors[0] found_offsets = False monitor_x_range = None monitor_y_range = None detect_window = Tru...
test_client.py
import asyncio from collections import deque from concurrent.futures import CancelledError 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 traceback import wa...
parser.py
import argparse import subprocess import sys from .conf import PAGES, QUIT_KEY, NginxConfig from .picasso import Picasso from .store import Store from blessed import Terminal from threading import Thread, Lock parser = argparse.ArgumentParser() parser.add_argument('-f', '--file', type=str, required=True, help='The ...
vpp_transport_socket.py
# # VPP Unix Domain Socket Transport. # import socket import struct import threading import select import multiprocessing try: import queue as queue except ImportError: import Queue as queue import logging from . import vpp_papi class VppTransportSocketIOError(IOError): # TODO: Document different values o...
client.py
import tkinter as tk from tkinter import * from PIL import Image, ImageTk import socket import threading import activeWindows import tkMessageBox def client(ip_address, port, username, password): def validate_client(): # print("attempting to validate client...") IP = ip_address ...
test_threads.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in the project root # for license information. from __future__ import absolute_import, division, print_function, unicode_literals import pytest import sys import time from tests import debug @pytest.mark.param...
train_sampling_multi_gpu.py
import dgl import numpy as np import torch as th import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.multiprocessing as mp from torch.utils.data import DataLoader import dgl.function as fn import dgl.nn.pytorch as dglnn import time import argparse from _thread import start_new...