source
stringlengths
3
86
python
stringlengths
75
1.04M
xr3.py
#!/usr/bin/env python3 from threading import Thread from con import Console from userinput import UserInput from interface import Interface from global_flags import GFLAGS __version__ = '1.0a2' if __name__ == "__main__": if GFLAGS.FLG_TKINTER: INTERFACE = Interface(GFLAGS) else: INTERFACE = None INPUT = User...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
unicorn_binance_websocket_api_manager.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # File: unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py # # Part of ‘UNICORN Binance WebSocket API’ # Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api # Documentation: https://oliver-zehentleitner.github.io/uni...
hts-params-explore.py
#!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import pandas as pd from fbprophet import Prophet import os import json # In[2]: import inspect def get_default_args(func): signature = inspect.signature(func) return{ k: v.default for k, v in signature.parameters.items() ...
custom.py
# pylint: disable=too-many-lines # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -----------------------------------...
process_helper.py
#!/usr/bin/env python3 import queue import time import os import atexit import subprocess import threading import errno from typing import Any, Dict, List, TextIO, Optional class Runner: def __init__(self, log_dir: str, model: str, case: str, ve...
test_context.py
import cloudpickle import queue import threading import time from typing import Any import pytest import prefect from prefect import context from prefect.configuration import Config from prefect.utilities.context import Context def test_context_sets_variables_inside_context_manager(): """ Tests that the con...
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 ...
main.py
import socket import threading from queue import Queue def scan_port(port): try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((target, port)) return True except OSError: return False def fill_queue(ports): for port in ports: queue.put(port...
async_helper.py
import threading class TimeoutError(RuntimeError): pass class AsyncCall(object): def __init__(self, fnc, callback = None): self.Callable = fnc self.Callback = callback def __call__(self, *args, **kwargs): self.Thread = threading.Thread(target = self.run, name = self.Callable.__nam...
__init__.py
# -*- coding: utf-8 -*- """ keyboard ======== Take full control of your keyboard with this small Python library. Hook global events, register hotkeys, simulate key presses and much more. ## Features - **Global event hook** on all keyboards (captures keys regardless of focus). - **Listen** and **send** keyboard event...
remote_access.py
""" * Implementation of remote access Use localhost.run ssh remote port forwarding service by running a ssh subprocess in PyWebIO application. The stdout of ssh process is the connection info. * Strategy Wait at most one minute to get stdout, if it gets a normal out, the connection is successfully established. Othe...
fixspaces.py
# -*- coding: utf-8 -*- ''' Helper function for fixing accidentally concatinated words in Headword definition, Notes and Quotes. ''' from DictionaryOfNewZealandEnglish.headword.citation.models import Citation from DictionaryOfNewZealandEnglish.headword.models import Headword from DictionaryOfNewZealandEnglish.setting...
vnzaif.py
# encoding: utf-8 from __future__ import print_function import urllib import hashlib import json import requests import hmac import time from datetime import datetime from time import time, sleep , mktime from Queue import Queue, Empty from threading import Thread import urllib import hashlib import inspect import ...
lightgun.py
import cwiid import uinput import time import math import os import pygame import sys import numpy as np import atexit import threading import argparse import subprocess USE_P3P = True # use P3P if only three points are visible at a given time P3P_PROXIMITY_PREFERENCE = True # choose the solution closest to the last ...
queues_and_pipe.py
from multiprocessing import Process, Queue, Pipe # there are two ways to communicate between processes, queues and pipes # queues are thread and process safe # def f(q): q.put([42, None, 'hello']) def g(conn): conn.send([42, None, 'hello']) conn.close() if __name__ == '__main__': q = Queue() # ...
liuli_schedule.py
#!/usr/bin/env python """ Created by howie.hu at 2021/4/10. Description:统一调度入口 - 运行: 根目录执行,其中环境文件pro.env根据实际情况选择即可 - 命令: pipenv run pro_schedule or PIPENV_DOTENV_LOCATION=./pro.env pipenv run python src/liuli_schedule.py - 调度时间:每日的 ["00:10", "12:10", "21:10"] Changelog: all notable changes t...
node.py
from sys import stderr import threading from time import sleep, time from message import MSG_ACK, MSG_TOK, MSG_REC, MSG_RCK, Message from random import random import logging class Node: def __init__(self, rank, comm, node_count, success_rate=1, no_acks=False, deny_from=[], log_file=""): self.rank = rank ...
views.py
from django.shortcuts import render # Create your views here. from django.shortcuts import render from django.shortcuts import get_object_or_404 from rest_framework.response import Response from .models import RemoteInput from rest_framework.views import APIView from .serializers import RemoteInputSerializer ...
main.py
import requests import threading from tinytag import TinyTag import os from bs4 import BeautifulSoup from termcolor import colored from progress.bar import FillingCirclesBar BASE_URL = "https://downloads.khinsider.com" SEARCH_PARTIAL = "/search?search=" def getSearchResults(search): page = requests.get(BASE_URL +...
volthaTest.py
# Copyright 2017-present Open Networking Foundation # # 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 ag...
test_streaming.py
# -*- coding: utf-8 -*- # (c) 2009-2019 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license.php """ Unit tests for wsgidav.stream_tools.FileLikeQueue """ from tempfile import gettempdir from tests.util import Ti...
savenload.py
""" utilities that involve file searching and operations (i.e. save/load) """ from typing import Union, List, Tuple, Optional, Callable import sys import logging import contextlib import contextvars import tempfile from pathlib import Path import shutil import os import yaml # accumulate writes to group for renaming ...
TAXIIServer.py
import demistomock as demisto from CommonServerPython import * from flask import Flask, request, make_response, Response, stream_with_context from gevent.pywsgi import WSGIServer from urllib.parse import urlparse, ParseResult from tempfile import NamedTemporaryFile from base64 import b64decode from typing import Callab...
PingSweep.py
import subprocess import threading import os netMap = {} def windowsPingThread(address): global netMap with open(os.devnull, 'w') as DEVNULL: res = subprocess.call(["ping", "-n", "1", "-w", "200", address], stdout=DEVNULL) if res == 0: netMap.update({address: []}) def unixPingThread(addres...
__init__.py
import pir2.roaming.stopper as stopper import pir2.roaming.move as move import pir2.common.Logger as Logger import pir2.common as common import time import threading CONST_CONFIG_NAME_ROAMING = 'ROAMING' CONST_CONFIG_ENABLE_MOVE = 'enable.movement' CONST_CONFIG_ENABLE_DIST_SENSOR = 'enable.sensor.distance' CONST_FRON...
server.py
# python modules import glob import logging import os import pysftp import shutil from threading import Thread, Lock class ServerTasks: def __init__(self, config): self.settings = config # Logging self._logger = logging.getLogger(__name__) # Threading lock self.lock = L...
__init__.py
""" An embedded version of Milvus (https://milvus.io/) """ import ctypes import threading import pathlib import shutil import os from importlib_resources import files from distutils.dir_util import copy_tree CONFIG_PATH = '/var/bin/e-milvus/configs/' LIB_PATH = '/var/bin/e-milvus/lib/' LOG_PATH = '/var/bin/e-milvus/lo...
index.py
# 性能调试: # pip install line_profiler # python -m kernprof -l -v index.py import asyncio from websockets import connect from websockets import serve from datetime import datetime from time import sleep websockets=set() async def echo(websocket, path): websockets.add(websocket) await websocket.send("来自Python里的W...
tests.py
import re import threading import unittest from django.db import connection from django.db.models import Avg, StdDev, Sum, Variance from django.db.models.fields import CharField from django.db.utils import NotSupportedError from django.test import TestCase, TransactionTestCase, override_settings from django.test.utils...
s3.py
""" Object Store plugin for the Amazon Simple Storage Service (S3) """ import logging import multiprocessing import os import shutil import subprocess import threading import time from datetime import datetime try: # Imports are done this way to allow objectstore code to be used outside of Galaxy. import boto ...
slack.py
import json import logging import random import re import requests import sys import time import traceback from websocket import WebSocketConnectionClosedException from markdownify import MarkdownConverter from will import settings from .base import IOBackend from will.utils import Bunch, UNSURE_REPLIES, clean_for_pi...
test_events.py
"""Tests for events.py.""" import collections.abc import concurrent.futures import functools import io import os import platform import re import signal import socket try: import ssl except ImportError: ssl = None import subprocess import sys import threading import time import errno import unittest from unitt...
test1.py
import pyaudio import numpy import matplotlib.pyplot as plt import matplotlib.animation as animation import time from threading import Thread def peak_detect(): RATE=16000 RECORD_SECONDS = 10 CHUNKSIZE = 1024 peakinfo = 0; flag = 0; triggger = 0; # initialize portaudio p = pyaudio.PyAud...
test_client.py
import os import pytest import time import sys import logging import queue import threading import _thread from unittest.mock import patch import ray.util.client.server.server as ray_client_server from ray.tests.client_test_utils import create_remote_signal_actor from ray.tests.client_test_utils import run_wrapped_act...
compareDQMOutput.py
#!/bin/env python import os import sys import glob import argparse import subprocess from threading import Thread COMPARISON_RESULTS = [] def collect_and_compare_files(base_dir, pr_dir, output_dir, num_procs, pr_number, test_number, release_format): files = get_file_pairs(base_dir, pr_dir) threads = [] ...
data_store.py
#!/usr/bin/env python """The main data store abstraction. The data store is responsible for storing AFF4 objects permanently. This file defines the basic interface of the data store, but there is no specific implementation. Concrete implementations should extend the DataStore class and provide non-abstract methods. T...
test_state.py
""" state loading & saving tests """ import pickle from typing import NoReturn, Tuple import uuid from simple_di import Provide, Provider, container, inject, sync_container from simple_di.providers import Configuration, Factory, SingletonFactory, Static class NotPicklable: def __getstate__(self) -> NoReturn: ...
client1.py
import threading from scapy.all import * import os import subprocess import json import argparse import random import socket from struct import * import datetime import pcapy import sys import time import math parser = argparse.ArgumentParser(description='Client') parser.add_argument('-interface', dest='interface', ac...
graph.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...
runners.py
from __future__ import annotations from ssl import SSLContext from typing import TYPE_CHECKING, Dict, Optional, Type, Union from sanic.config import Config from sanic.server.events import trigger_events if TYPE_CHECKING: from sanic.app import Sanic import asyncio import multiprocessing import os import socket ...
workflows_scaling.py
#!/usr/bin/env python """A small script to drive workflow performance testing. % ./test/manual/launch_and_run.sh workflows_scaling --collection_size 500 --workflow_depth 4 $ .venv/bin/python scripts/summarize_timings.py --file /tmp/<work_dir>/handler1.log --pattern 'Workflow step' $ .venv/bin/python scripts/summarize_...
multi_memmap_iterator.py
import numpy as np import itertools from collections import namedtuple from keras.preprocessing.image import Iterator from queue import Queue from threading import Thread class MultiMemmapIterator(): def __init__(self, memmap_path, memmap_shape, images_df, num_classes=None, batch_size=32, shuffle=True, seed=None, ...
build_imagenet_data.py
"""Converts ImageNet data to TFRecords file format with Example protos. The raw ImageNet data set is expected to reside in JPEG files located in the following directory structure. data_dir/n01440764/ILSVRC2012_val_00000293.JPEG data_dir/n01440764/ILSVRC2012_val_00000543.JPEG ... where 'n01440764' is the unique...
data_writer.py
# Copyright 2020 KCL-BMEIS - King's College London # 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...
test_concurrency.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for concurrency libraries.""" import glob import os import random import re import sys import threading import time from flaky import flaky import pytest...
helper.py
__copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved." __license__ = "Apache-2.0" import asyncio import functools import json import math import os import random import re import sys import threading import time import uuid import warnings from argparse import ArgumentParser, Namespace from context...
ebpf.py
# Copyright 2022 DeChainers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
get_events.py
#!/usr/bin/env python3 """ Download all TensorFlow event files from the specified jobs' output files. """ import argparse import os import os.path as osp import subprocess import time from multiprocessing import Process def get(job_id, out_dir): print("Listing files...") cmd = "floyd data listfiles {}/outpu...
context.py
#!/usr/bin/env python3 from http import HTTPStatus from socketserver import ThreadingMixIn from urllib.parse import urlparse from ruamel.yaml.comments import CommentedMap as OrderedDict # to avoid '!!omap' in yaml import threading import http.server import json import queue import socket import subprocess import time ...
test_sync.py
import asyncio import threading import time from concurrent.futures import ThreadPoolExecutor import pytest from asgiref.sync import async_to_sync, sync_to_async @pytest.mark.asyncio async def test_sync_to_async(): """ Tests we can call sync functions from an async thread (even if the number of thread w...
threading_test.py
import threading import curses import time import random command = None command_lock = threading._allocate_lock() stdscr = curses.initscr() stdscr.nodelay(1) def input_handler(): print('input_handler') # do not wait for input when calling getch global command, command_lock tmp_command = None ...
apptrace.py
from __future__ import print_function import sys import os try: from urlparse import urlparse except ImportError: from urllib.parse import urlparse try: import SocketServer except ImportError: import socketserver as SocketServer import threading import tempfile import time import subprocess import os.pa...
coref_model_sentence_span.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function #-*-encoding:utf-8-*- import os import operator import random import math import json import threading import numpy as np import tensorflow as tf import tensorflow_hub as hub import h5py import util import cor...
core.py
import traceback from ..classes.Color import Color from ..classes.Log import logTime from ..classes.socket.events.events import Events from ..classes.socket.receive.Devlog import Devlog as ReceivedDevlog from ..classes.socket.receive.User import User as ReceivedUser from ..classes.socket.receive.Post import Post as Re...
base_crash_reporter.py
# Electrum - lightweight Bitcoin client # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights to use, copy, modify, merge, # publish...
make_input.py
''' generates input data for pipeline producing four files attributes, samples, values and coexistences see ./docs/documentation.md for details This version: Creates coexistances.csv directly avoiding doing this via a json file. This is better because the converter was build with regex and was less robust. Does not ...
server.py
# (C) Copyright Syd Logan 2016 # (C) Copyright Thousand Smiles Foundation 2016 # # 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 requir...
data_loading.py
# coding=utf-8 # Copyright 2020 The Google Research 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 applicab...
start.py
#!/usr/bin/python3 import os import glob import shutil import multiprocessing import logging as log import sys from podop import run_server from pwd import getpwnam from socrate import system, conf log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING")) def start_podop(): os.setuid(ge...
test_explicit_comms.py
import multiprocessing as mp import numpy as np import pandas as pd import pytest import dask from dask import dataframe as dd from dask.dataframe.shuffle import partitioning_index from distributed import Client from distributed.deploy.local import LocalCluster from dask_cuda.explicit_comms import ( CommsContext...
mysql_config.py
#!/usr/bin/python # -*-coding:utf-8-*- """ Sync fetch the config from mysql, subsrcibe a redis key, while event happened then sync the specified msg Copyright(c) 2007-2016, by MY Capital Inc. """ config = { 'host': 'localhost', 'port': 6379, 'db': 0, } import redis import threading from operation.models ...
server.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations import asyncio import logging from typing import Any, Callable, List, NoReturn, Optional, Sequence, Uni...
test_bson.py
# -*- coding: utf-8 -*- # # Copyright 2009-present MongoDB, 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 applicab...
client.py
from socket import * import threading class Client: def __init__(self): self.client_sock = socket(AF_INET, SOCK_STREAM) self.write_thread = threading.Thread(target=self.write_th) self.read_thread = threading.Thread(target=self.read_th) self.name = '' self.rNum = 0 def ...
broker.py
import os import argparse import threading import time from util.subscription_manager import SubscriptionManager import util.logger as logger from util.listeners import * from util.configreader import BrokerConfigReader as ConfigReader from util.client_manager import ClientManager if __name__ == "__main__": # Lis...
record.py
# # record.py # Simple recorder and viewer element # from atom import Element from atom.messages import Response, LogLevel from threading import Thread import time import msgpack import os import matplotlib.pyplot as plt import numpy as np import math # Where to store temporary recordings TEMP_RECORDING_LOC = "/shar...
connection.py
# Copyright (c) 2015 Canonical Ltd # Copyright (c) 2015 Mirantis 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 # # Un...
tetris_cpu.py
from tetris_view import online_view from tetris_ctl import controller_cpu, agent_ctl from tetris_agent import agent from model import v_net import multiprocessing as mp import pygame as pg import gym import torch import sys import time def cpu(l_conn, f_conn, g_conn, lock): env = gym.make("gym_tetris:tetris-v0") ...
new.py
# BOT LOGIN # KHIE WAS HERE # </> NOOB CODER 2K17 from linepy import * from akad.ttypes import Message from liff.ttypes import LiffChatContext, LiffContext, LiffSquareChatContext, LiffNoneContext, LiffViewRequest from akad.ttypes import ContentType as Type from akad.ttypes import TalkException from KhieBots.thrift.prot...
web_pcap.py
import select import tornado.ioloop import tornado.web import subprocess as sub from threading import Thread from queue import Queue, Empty import time data = {'running': False} def get_app(): class ControlHandler(tornado.web.RequestHandler): def get(self): now = str(time.strftime("%...
bot_jira_review_schedule.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # -*- encoding: utf-8 -*- # # Copyright (c) 2020 anqi.huang@outlook.com # # 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.apach...
driver.py
# Copyright 2020 Uber Technologies, 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 applica...
ch05_listing_source.py
import bisect import contextlib import csv from datetime import datetime import functools import json import logging import random import threading import time import unittest import uuid import redis QUIT = False SAMPLE_COUNT = 100 config_connection = None # <start id="recent_log"/> SEVERITY = { ...
cursortablemodel.py
# # -*- coding: utf-8 -*- import math from pineboolib.utils import filedir from PyQt5 import QtCore, QtGui, QtWidgets import traceback import threading import logging import time import itertools from PyQt5.QtWidgets import QCheckBox DEBUG = False DisplayRole = QtCore.Qt.DisplayRole EditRole = QtCore.Qt.EditRole H...
process.py
# -*- coding: utf-8 -*- from __future__ import print_function import subprocess import threading def watch_process(cmd, stdout_handler=None, stderr_handler=None, **kwargs): def default_handler(line): print(line) if not stdout_handler: stdout_handler = default_handler if not stderr_handle...
script.py
import os import time import serial import colorama import pyautogui import playsound import pywinauto import configparser from threading import Thread from termcolor import colored from pywinauto import application from filemanagement import teams_downloads_function #own zip file function from pywinauto.findwindow...
balancer.py
import heapq import logging import queue import threading from queue import Queue from typing import List, Dict, Tuple from smart_load_balancer.strategy.strategy import GroupsByNameWithTime, Strategy from smart_load_balancer.work import Work from smart_load_balancer.worker import Worker, WorkerInfo logger = logging.g...
distdiff.py
# This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be usefu...
bot.py
# -*- coding: utf-8 -*- print('Iniciando o fcnIAbot...') # metodos from amanobot.loop import MessageLoop from amanobot.exception import TelegramError from amanobot.namedtuple import InlineKeyboardMarkup # biblioteca import datetime import amanobot import time import threading import aiml import numexpr import wolfra...
managers.py
# # Module providing the `SyncManager` class for dealing # with shared objects # # multiprocessing/managers.py # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditio...
test_dota_base_q.py
# -*- coding:utf-8 -*- # Author: Xue Yang <yangxue-2019-sjtu@sjtu.edu.cn> # # License: Apache-2.0 license from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import math import os from multiprocessing import Queue, Process import cv2 import num...
base_controller.py
#!/usr/bin/env python # coding: utf-8 import time import atexit import weakref import pybullet import threading from qibullet.tools import * from qibullet.controller import Controller class BaseController(Controller): """ Class describing a robot base controller """ # _instances = set() FRAME_WO...
base.py
from core import app, Configuration from core.rabbit import RabbitClient from threading import Thread def main(): rabbit = RabbitClient(Configuration.RABBIT) Thread(target=rabbit.start_consuming).start() app.run(host='0.0.0.0', port=Configuration.PORT, threaded=True) rabbit.stop_consuming() ...
bot.py
"""An irc bot with a hammer""" import copy import importlib import json import signal import threading import traceback import uuid import yaml import irc.bot # type: ignore import irc.client from jaraco.stream import buffer import paho.mqtt.publish as publish import paho.mqtt.client as mqtt from bugbunnies.irc impo...
qt.py
#!/usr/bin/env python # # Electrum - Lightweight Bitcoin Client # Copyright (C) 2015 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 without...
client.py
import json import base64 import requests import threading import base64 from uuid import UUID from os import urandom from time import timezone, sleep from typing import BinaryIO, Union from binascii import hexlify from time import time as timestamp from locale import getdefaultlocale as locale from .lib.util import ...
scheduler.py
import time from multiprocessing import Process from Proxy_pool.api import app from Proxy_pool.getter import Getter from Proxy_pool.tester import Tester from Proxy_pool.db import MySqlClient from Proxy_pool.setting import * class Scheduler(): def schedule_tester(self, cycle=TESTER_CYCLE): """ 定时测试...
time.py
import os import time from contextlib import suppress from datetime import timezone as tz from astropy import units as u from astropy.time import Time from loguru import logger from panoptes.utils import error def current_time(flatten=False, datetime=False, pretty=False): """ Convenience method to return the "cu...
experiment.py
from __future__ import division, print_function import pickle import pdb import os import time from sklearn.model_selection import StratifiedKFold from sklearn import svm from sklearn import metrics import gensim import random from learners import SK_SVM, SK_KNN, SK_MLP from tuner import DE from model import PaperData ...
store_utils.py
# Copyright 2011 OpenStack Foundation # Copyright 2012 Red Hat, 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/...
command.py
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import argparse import enum import json import logging import os import resource import signal import subprocess import threading from abc im...
router.py
# -*- coding: utf-8 -*- # Copyright (c) 2021 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 applicab...
installwizard.py
# Copyright (C) 2018 The Electrum developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php import os import json import sys import threading import traceback from typing import Tuple, List, Callable, NamedTuple, Optional, TYPE_CH...
ChordsAutoscroll.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Author: Pasquale Lafiosca # Last modified: 25 July 2018 # ''' Copyright 2017 Pasquale Lafiosca 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 ...
evaluation.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import pickle from queue import Queue import os import sys from threading import Thread, stack_size as set_thread_stack_size from typing import Tuple from mathics import settings from mathics.core.expression import ensure_context, KeyComparable FORMATS = ['StandardFor...
install.pyw
from threading import Thread, Lock import logging import webview from time import sleep from server import run_server try: from http.client import HTTPConnection except ImportError: # Use httplib on Python 2 from httplib import HTTPConnection server_lock = Lock() logger = logging.getLogger(__name__) de...
webcore.py
# Copyright 2011,2012 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 ...
IntegrationTests.py
import os import sys import time import unittest import multiprocessing import percy from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from selenium.webdriver.su...
main.py
import time import threading import pyautogui import pyfiglet import telebot import colorama from telebot import types from termcolor import colored import getscreenhash as ar from time import strftime from config import token,admin_id colorama.init() pyautogui.PAUSE = 2.5 bot = telebot.TeleBot(token, parse_mode=None...