source
stringlengths
3
86
python
stringlengths
75
1.04M
transfer.py
#!/usr/bin/env python # # Copyright 2015 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
main.py
#!/usr/bin/env python3 import base64 import sys from concurrent import futures from datetime import datetime from threading import Thread from time import sleep import cv2 import grpc import numpy as np # libs for pylon from pypylon import pylon from api import Datas_pb2, Datas_pb2_grpc from loggerClient import Logg...
KiwoomOpenApiPlusStore.py
# pylint: disable=no-member import time import datetime import logging import threading import collections import backtrader as bt import pandas as pd import numpy as np from exchange_calendars import get_calendar from backtrader import TimeFrame from backtrader.metabase import MetaParams from backtrader.utils.py3 ...
threaded_unix_listener.py
import base64 import glob import importlib import inspect import os import queue import socketserver from threading import Thread from software.logger.logger import createLogger logger = createLogger(__name__) import proto from google.protobuf.any_pb2 import Any class ThreadedUnixListener: def __init__(self, un...
andromeda.py
""" Copyright [yyyy] [name of copyright owner] 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...
test_insert.py
import pytest from pymilvus import DataType, ParamError, BaseException from utils.utils import * from common.constants import * from common.common_type import CaseLabel ADD_TIMEOUT = 60 uid = "test_insert" field_name = default_float_vec_field_name binary_field_name = default_binary_vec_field_name default_single_query ...
util.py
# -*- coding: utf-8 -*- """ (C) 2014-2019 Roman Sirokov and contributors Licensed under BSD license http://github.com/r0x0r/pywebview/ """ import json import logging import os import re import sys from platform import architecture from threading import Thread from uuid import uuid4 from .js import api, npo, dom _t...
bot.py
import json import time import datetime from enum import Enum from itertools import chain from threading import Thread from typing import List, Iterator, Optional import telegram from telegram import InlineKeyboardMarkup, InlineKeyboardButton from telegram.ext import (CallbackQueryHandler, ConversationHandler, Command...
__init__.py
#!/usr/bin/python import base64 from binascii import hexlify from cryptography import x509 from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes from distutils.spawn import find_executable from kvirt import common from kvirt.common import error, pprint, warning from...
UDPServer_2nodes.py
import socket # import threading bind_ip = "" bind_port = 9998 server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) server.bind((bind_ip, bind_port)) print("[*] Listening from %s:%d" % (bind_ip, bind_port)) def handle_client(): recv_data, addr = server.recvfrom(1024) print("[*] Reveived: %s from %s" ...
device_connection_test.py
# Copyright 2020 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...
launch_scheduler.py
from athena import gpu_ops as ad import os import sys import yaml import json import multiprocessing import signal def main(): def start_scheduler(settings): for key, value in settings.items(): os.environ[key] = str(value) assert os.environ['DMLC_ROLE'] == "scheduler" print('S...
tcpServe.py
# -*- coding: utf-8 -*- import time import socket # 导入 socket 模块 host='localhost' port=10010 # 设置端口 address = (host, port or 0) delay=1 num_bytes=64 filename = 'poetry.txt' # 1.创建套接字,绑定套接字到本地IP与端口 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # 创建 socket 对象 # host = socket.gethostname() # 获取...
day12_03.py
##히스토그램 from tkinter import *; import os.path ;import math from tkinter.filedialog import * from tkinter.simpledialog import * import matplotlib.pyplot as plt ## 함수 선언부 def loadImage(fname) : global window, canvas, paper, filename, inImage, outImage, inW, inH, outW, outH fsize = os.path.getsize(fname)...
test_basic_3.py
# coding: utf-8 import gc import logging import os import sys import time import subprocess import numpy as np import pytest import ray.cluster_utils from ray._private.test_utils import ( dicts_equal, wait_for_pid_to_exit, wait_for_condition, ) from ray.autoscaler._private.constants import RAY_PROCESSES f...
queue.py
import threading import queue import atexit import logging logger = logging.getLogger(__name__) class TaskQueue(object): def __init__(self, name, num_workers=1, max_backlog=0): self.name = name self.max_backlog = max_backlog self.num_workers = num_workers self._queue = queue.Queu...
test_soef_integration.py
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2020 Fetch.AI Limited # # 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 ...
serverMedia.py
from socket import socket, AF_INET, SOCK_STREAM from threading import Thread import struct import socket as sc HOST = input("Enter Host IP: \n") print('Host: '+HOST) PORT_VIDEO = 3000 PORT_AUDIO = 4000 lnF = 640*480*3 CHUNK = 1024 BufferSize = 4096 addressesAudio = {} addresses = {} threads = {} def ConnectionsVideo(...
__main__.py
# -*- coding: utf-8 -*- from logging import getLogger, ERROR getLogger("scapy.runtime").setLevel(ERROR) import argparse import sys from PyQt5 import QtCore from wifipumpkin3 import PumpkinShell from wifipumpkin3.core.utility.printer import ( banner, setcolor, display_messages, set_nocolors, ) from wifi...
visualizer.py
import pygame, sys, random from pygame.locals import QUIT from ola.ClientWrapper import ClientWrapper import array import threading import os # CONFIG VARIABLES # WINDOWWIDTH = 500 WINDOWHEIGHT = 400 FPS = 120 BOARDWIDTH = 5 BOARDHEIGHT = 4 UNIVERSE_ID = 1 # CONFIG VARIABLES # BOXWIDTH = WINDOWWIDTH / BOARDWIDTH BOX...
athenad.py
#!/usr/bin/env python3.7 import json import os import io import random import re import select import subprocess import socket import time import threading import traceback import zmq import base64 import requests import six.moves.queue from functools import partial from jsonrpc import JSONRPCResponseManager, dispatche...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
task.py
import atexit import json import os import shutil import signal import sys import threading import time from argparse import ArgumentParser from logging import getLogger from operator import attrgetter from tempfile import mkstemp, mkdtemp from zipfile import ZipFile, ZIP_DEFLATED try: # noinspection PyCompatibili...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import, print_function, with_statement import os import re import sys import copy import time import types import signal import random import fnmatch import logging import threading import traceback import c...
test_wrapper.py
__copyright__ = "Copyright (C) 2009 Andreas Kloeckner" __license__ = """ 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, ...
run.py
import os import time import gym import torch import numpy as np import numpy.random as rd import multiprocessing as mp from copy import deepcopy from elegantrl.env import build_env from elegantrl.replay import ReplayBuffer, ReplayBufferMP from elegantrl.evaluator import Evaluator """[ElegantRL.2021.09.01](https://g...
kernel_image_puller.py
import logging import os import queue import requests import time from threading import Thread cri_sock = os.getenv("KIP_CRI_SOCK", "unix:///var/run/containerd/containerd.sock") cri_client = os.getenv("KIP_CRI_CLI", False) gateway_host = os.getenv("KIP_GATEWAY_HOST", "http://localhost:8888") num_pullers = int(os.ge...
__main__.py
import adj import adj.audio import adj.db import adj.gui.app import adj.gui.firstrun import ctypes import multiprocessing import os.path if adj.platform.os == 'mac': multiprocessing.set_start_method('spawn') multiprocessing.freeze_support() if adj.platform.os == 'windows': multiprocessing.set_start_method...
run_nvmf.py
#!/usr/bin/env python3 import os import re import sys import json import paramiko import zipfile import threading import subprocess import itertools import time import uuid import rpc import rpc.client import pandas as pd from common import * class Server: def __init__(self, name, username, password, mode, nic_i...
train.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ """ from __future__ import annotations import argparse import logging import math import os import random import sys import time from copy import deepcopy from pathlib import Path from threading import Thread sys.path.append("/") # to run '$ python *.py' files in s...
master.py
# Copyright (c) 2022 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 ap...
test_base_events.py
"""Tests for base_events.py""" import errno import logging import math import os import socket import sys import threading import time import unittest from unittest import mock import asyncio from asyncio import base_events from asyncio import constants from asyncio import test_utils try: from test import support...
main.py
from threading import Thread, Event from gevent.pywsgi import WSGIServer import os from server import app from data import db import atexit import shelve import datetime import httpagentparser import colorama from utils import ( exit_handler, watcher, clear, invalid, cursor, help...
worker.py
from multiprocessing import Process import threading import queue import time as ttime import os import asyncio from functools import partial import logging import uuid import enum import traceback import copy import json from .comms import PipeJsonRpcReceive from .output_streaming import setup_console_output_redirect...
platformAgent.py
import time, threading from Queue import Empty, Full from multiprocessing import Value from bemoss_lib.utils import db_helper import multiprocessing from multiprocessing.reduction import reduce_connection from guppy import hpy import traceback import sys import linecache from bemoss_lib.platform.BEMOSSThread import BT...
Handlers.py
''' Handler of FFPA ''' import abc import math import numpy as np import multiprocess import pickle from collections import defaultdict from utils.Sampling import sampleClients from utils.Print import printRound, printLines from models.Sandwich import FfpaServer from models.Randomize import Randomizer from utils....
test_ipc.py
# -*- coding: utf-8 -*- ''' :codeauthor: Mike Place <mp@saltstack.com> ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import errno import socket import threading import logging import tornado.gen import tornado.ioloop import tornado.testing import salt...
events_monitor.py
# # Copyright 2021 Ocean Protocol Foundation # SPDX-License-Identifier: Apache-2.0 # import json import logging import os import time from json import JSONDecodeError from threading import Thread import elasticsearch from eth_account import Account from eth_utils import is_address from aquarius.app.auth_util import s...
basebot.py
import asyncio import logging import warnings from asyncio import get_event_loop from typing import Optional, TYPE_CHECKING from threading import Thread from ..poll import PollData from .. import util from ..channel import Channel, channels from ..command import Command, commands, CustomCommandAction, is_command_on_co...
connection.py
# Copyright (c) 2018 Anki, 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 in the file LICENSE.txt or at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
BotMonitor.py
#!/usr/bin/env python3 """ Created on Apr 23, 2012 @author: moloch --------- websocket - WebSocket client library for Python Copyright (C) 2010 Hiroki Ohtani(liris) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as publishe...
migration_script_v4.py
#!/usr/bin/env python3 from slickrpc import Proxy import time import sys import datetime import os import json import re import platform import threading import calendar # set your log directory here, make sure the directory exists. All exports and failed imports will be logged here. # without this funds can be lost...
test_basic_server.py
#!/usr/bin/env python import json import urllib2 import unittest import threading from slashproc_parser.basic_server import SimpleThreadedJSONRPCServer, SERVER_PORT from slashproc_parser.basic_server import get_parsers, get_groups, get_vars, get_data class TestBasicServer(unittest.TestCase): def setUp(self)...
server_ingester_test.py
# Copyright 2020 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...
run_designs.py
# Copyright 2020 Efabless 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 law or agreed to in...
test_threading_jy.py
"""Misc threading module tests Made for Jython. """ import unittest from test import test_support import threading import time import random from threading import Thread class ThreadingTestCase(unittest.TestCase): def test_str_name(self): t = Thread(name=1) self.assertEqual(t.getName(), '1') ...
tensor.py
# Copyright 2017 The Nuclio 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 wr...
preprocess_data_many_cores.py
# coding=utf-8 # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
user.py
# Copyright (c) 2020. Lena "Teekeks" During <info@teawork.de> # Copied here and adapted for the purposes of adding authorization flow to the bots. # All of the following code is essentially the same or code was copied from files it imported for # brevity. See: https://github.com/Teekeks/pyTwitchAPI """ User OAuth Au...
cohort_frequency_source_builder.py
#!/usr/bin/env python """ ------------- Copyright (c) 2015. Genome Research Ltd. Author: Deciphering Development Disorders Project Team. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www....
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...
ratings.py
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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, or (at your option) any later version. # # This program is distrib...
Timer.py
# -*- coding: utf-8 -*- # # This file is part of the Timer project # # SKA # # Distributed under the terms of the GPL license. # See LICENSE.txt for more info. """ ska-tango-examples A Timer countdown device composed by minutes and seconds. """ import logging import threading import time # PyTango imports import ta...
bazel_external_repository_test.py
# pylint: disable=g-bad-file-header # Copyright 2017 The Bazel 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 ...
main.py
from com.src.SingleThreadSpider import SingleThreadSpider from com.src.CryptoProcessor import CryptoProcessor from com.src.network.ApiRequester import ApiRequester from com.src.persist.MongoDatastore import MongoDatastore from com.src.passwords import COINMARKETCAP_API_KEY import threading import time #TODO: Need to f...
control.py
#!/usr/bin/env python #-*- coding:utf-8 –*- #2021.10.27 更新,单独接收/gps/fix话题,单独发布路径信息 import math from re import split import json import requests import rospy import time import threading from rospy.core import rospyinfo #线程 import tf from tf.transformations import * from sensor_msgs.msg import Imu from sensor_ms...
federated_sample_2NN_CFA-PER.py
from __future__ import absolute_import, division, print_function, unicode_literals from keras.utils import to_categorical from consensus.cfa_per import CFA_process import numpy as np # import tensorflow as tf import datetime import scipy.io as sio import multiprocessing import math from matplotlib.pyplot import pause i...
StrainTensor.py
#! /usr/bin/python #-*- coding: utf-8 -*- from __future__ import print_function import sys import os import time from datetime import datetime from copy import deepcopy from math import degrees, radians, floor, ceil import numpy from scipy.spatial import Delaunay import argparse from pystrain.strain import * from pyst...
test_jwt_token_manager.py
# pylint: disable=missing-docstring,protected-access,abstract-class-instantiated import time import threading from typing import Optional import jwt import pytest from ibm_cloud_sdk_core import JWTTokenManager, DetailedResponse class JWTTokenManagerMockImpl(JWTTokenManager): def __init__(self, url: Optional[str...
lldb_batchmode.py
#!/usr/bin/env python3 # Copyright 2014 The Rust Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution and at # http://rust-lang.org/COPYRIGHT. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license #...
runtests.py
#!/usr/bin/env python from __future__ import print_function import atexit import base64 import os import sys import re import gc import heapq import locale import shutil import time import unittest import doctest import operator import subprocess import tempfile import traceback import warnings import zlib import glo...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
pyusb_backend.py
# pyOCD debugger # Copyright (c) 2006-2021 Arm Limited # Copyright (c) 2020 Patrick Huesmann # Copyright (c) 2021 mentha # Copyright (c) Chris Reed # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License....
listen.py
import numpy as np from config.config import * from lib.machinelearning import feature_engineering, feature_engineering_raw, get_label_for_directory, get_highest_intensity_of_wav_file, get_recording_power import pyaudio import wave import time import scipy import scipy.io.wavfile import hashlib import os import operato...
hydrus_server.py
#!/usr/bin/env python3 # Hydrus is released under WTFPL # You just DO WHAT THE FUCK YOU WANT TO. # https://github.com/sirkris/WTFPL/blob/master/WTFPL.md action = 'start' try: import locale try: locale.setlocale( locale.LC_ALL, '' ) except: pass import os import sys import threa...
mp_process06.py
from multiprocessing import Process,Queue import os def run_proc(name,q): print('Run Child process %s (%s)' % (name, os.getpid())) q.put('value') def run_proce(name,q): print('Run Child process %s (%s)' % (name, os.getpid())) print(q.get()) if __name__ == '__main__': print('Parent process %s.' % ...
sensor.py
"""Pushbullet platform for sensor component.""" import logging import threading from pushbullet import PushBullet from pushbullet import InvalidKeyError from pushbullet import Listener import voluptuous as vol from homeassistant.const import CONF_API_KEY, CONF_MONITORED_CONDITIONS from homeassistant.components.sensor...
main.py
import json import random import threading from twython.exceptions import TwythonError from tweet import tweet from tweet import init as init_tweet from generate_image import draw_participants from enum import Enum from time import sleep import datetime as dt import os config = json.load(open('./config.json', 'r')) d...
infertab.py
import os from threading import Thread import tkinter as tk import tkinter.filedialog as tkfiledialog import tkinter.messagebox as tkmessagebox from mipqctool.controller import InferSchema from mipqctool.gui.inferoptionsframe import InferOptionsFrame from mipqctool.config import LOGGER class InferTab(tk.Frame): d...
python_lsp.py
# Copyright 2017-2020 Palantir Technologies, Inc. # Copyright 2021- Python Language Server Contributors. from functools import partial import logging import os import socketserver import threading from pylsp_jsonrpc.dispatchers import MethodDispatcher from pylsp_jsonrpc.endpoint import Endpoint from pylsp_jsonrpc.str...
__init__.py
import ast import logging import io import os import platform import queue import re import subprocess import sys import textwrap import threading import time import tokenize import traceback import webbrowser from queue import Queue from textwrap import dedent from time import sleep from tkinter import ttk from thonny...
test_enum.py
import enum import inspect import pydoc import unittest 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 # for pickle tests try: ...
multithread_dataiter_for_cross_entropy_v1.py
# -*- coding: utf-8 -*- import random import math import threading import time import logging import queue import cv2 import numpy from ChasingTrainFramework_GeneralOneClassDetection.image_augmentation.augmentor import Augmentor from ChasingTrainFramework_GeneralOneClassDetection.data_iterator_base.data_batch import D...
test_train_TrainProducerOperator.py
#!/usr/bin/env python #################### # Required Modules # #################### # Generic/Built-in import time from multiprocessing import Manager, Process # Libs # Custom from synmanager.config import TRAIN_QUEUE from conftest import ( PROJECT_KEY, RUN_RECORD_1, RUN_RECORD_2, enumerate_federated_conb...
cli_api_run_launcher.py
import os import threading import time import weakref from dagster import check from dagster.api.execute_run import cli_api_launch_run from dagster.core.host_representation import ExternalPipeline from dagster.core.instance import DagsterInstance from dagster.core.storage.pipeline_run import PipelineRun from dagster.s...
thermald.py
#!/usr/bin/env python3 import datetime import os import queue import threading import time from collections import OrderedDict, namedtuple from pathlib import Path from typing import Dict, Optional, Tuple import psutil from smbus2 import SMBus import cereal.messaging as messaging from cereal import log from common.di...
process.py
# -*- coding: utf-8 -*- # Import python libs from __future__ import absolute_import import os import sys import time import types import signal import subprocess import logging import multiprocessing import threading # Import salt libs import salt.defaults.exitcodes import salt.utils # Import 3rd-party libs import ...
deploy_ssl.py
""" always read, until wake up, choose part to compute gcc """ import pyaudio import wave from scipy.io import wavfile import tensorflow as tf import numpy as np import sys import os import math import time import collections import threading import warnings import ctypes as ct warnings.filterwarnings('ignore') o...
template.py
# 'images' and 'mesh' folders # are needed alongside this script # args: # localhost -> server hostname # ws/http -> ws (transmit data) or # http (post images) # examples: # python2 template.py localhost ws photo_capture # python3 template.py localhost ws sfm # python2 template.py localhost http cache_i...
live.py
from flask import Flask, jsonify from threading import Thread app = Flask(" ") @app.route("/") def home(): return jsonify({"status":True}) def run(): app.run(host="0.0.0.0",port=8000) def live(): t = Thread(target=run) t.start()
pyfiscan.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Pyfiscan is free web-application vulnerability and version scanner and can be used to locate out-dated versions of common web-applications in Linux-servers. Example use case is hosting-providers keeping eye on their users installations to keep up with security-updates...
sample.py
# # Copyright 2020 IBM Corp. # SPDX-License-Identifier: Apache-2.0 # from timeit import repeat import pyarrow.flight as fl import json import threading # taken from https://github.com/apache/arrow/blob/master/python/pyarrow/tests/test_flight.py#L450 class HttpBasicClientAuthHandler(fl.ClientAuthHandler): """An exa...
server.py
#!/usr/bin/env python3 from _socket import SHUT_RDWR import socket import struct import time import timer import socketserver import threading import globals as G from savingsystem import save_sector_to_bytes, save_blocks, save_world, load_player, save_player from world_server import WorldServer import blocks from te...
core.py
from dataclasses import dataclass from threading import Thread from typing import List, Type, Set, Any, Dict, Optional, TypeVar, Callable from ludere.reflection import resolve_constructor_parameter_types, resolve_function_parameter_types, has_return_type T = TypeVar("T") class Ludere: def __init__(self): ...
Misc.py
## @file # Common routines used by all tools # # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the lic...
__main__.py
import time import globals import threading from config import Config import PySimpleGUI as sg from extractor import get_links credentials = Config () def main (): """Main function of the project with gui """ # Get theme from config file theme = credentials.get ("theme") # S...
server.py
# coding: latin-1 import pickle import socket import threading # from urllib3 import urlopen def println(s): print(s) class Server(): def __init__(self, port): self.clients = [] self.messages = {} s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(("gmail.com",80)...
tail.py
# -*- coding: utf-8 -*- import multiprocessing import Queue import signal import time from beaver.config import BeaverConfig from beaver.run_queue import run_queue from beaver.ssh_tunnel import create_ssh_tunnel from beaver.utils import REOPEN_FILES, setup_custom_logger from beaver.worker.tail_manager import TailManag...
multiple-windows.py
import numpy as np import open3d as o3d import os import threading import time SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) CLOUD_NAME = "points" def main(): MultiWinApp().run() class MultiWinApp: def __init__(self): self.is_done = False self.n_snapshots = 0 self.cloud...
es_dump.py
"""The script will dump you ES index to local disk""" import argparse import bz2 import json import logging import os import queue import threading from utils import DumpError, EsError, RequestsClient def discover_indices(client): result = client.get("_aliases") return [str(i) for i in result.keys()] def di...
test_ssl.py
import rpyc import os import threading import unittest import time from rpyc.utils.authenticators import SSLAuthenticator from rpyc.utils.server import ThreadedServer from rpyc import SlaveService from nose import SkipTest try: import ssl #@UnusedImport except ImportError: raise SkipTest("requires ssl") clas...
test_pantsd_integration.py
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import datetime import itertools import os import re import signal import sys import threading import time import unittest from textwrap import dedent from pants.testutil.pants_run_integr...
standalone_test.py
"""Tests for acme.standalone.""" import http.client as http_client import socket import socketserver import threading import unittest from typing import Set from unittest import mock import josepy as jose import requests from acme import challenges from acme import crypto_util from acme import errors import test_uti...
MemoryUsageLoop.py
# Copyright 2015 Ufora Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
qt.py
#!/usr/bin/env python3 # # Electron Cash - a lightweight Bitcoin Cash client # CashFusion - an advanced coin anonymizer # # Copyright (C) 2020 Mark B. Lundeberg # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to d...
proxy.py
# -*- coding: utf-8 -*- # # Proxy minion metaproxy modules # from __future__ import absolute_import, print_function, with_statement, unicode_literals import os import signal import sys import types import logging import threading import traceback # Import Salt Libs # pylint: disable=3rd-party-module-not-gated import s...
main.py
from tkinter import * import speech_recognition as sr import pyttsx3 import pywhatkit import datetime import wikipedia import pyjokes import requests import bs4 import threading import os #threading def threading1(): t1= threading.Thread (target = run_tom) t1.start() listener = sr.Recognizer() engine = pytts...
tests.py
from __future__ import absolute_import import sys import time from django.conf import settings from django.db import transaction, connection, router from django.db.utils import ConnectionHandler, DEFAULT_DB_ALIAS, DatabaseError from django.test import (TransactionTestCase, skipIfDBFeature, skipUnlessDBFeature) fr...
utils.py
import asyncio import functools import html import importlib import inspect import json import logging import multiprocessing import os import pkgutil import re import shutil import socket import sys import tempfile import threading import warnings import weakref import xml.etree.ElementTree from asyncio import Timeout...
reducer.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import re import sys import os import subprocess import multiprocessing import M4 from Command import * from Sequence import Sequence from CodeParser import CodeParser from TestCase import TestCase from Qemu import Qemu class Trigger: def __init__(self, trigger_sc...