source
stringlengths
3
86
python
stringlengths
75
1.04M
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...
manager.py
# from multiprocessing import Process, Manager from lithops.multiprocessing import Process, Manager def f(d, l): d[1] = '1' d['2'] = 2 d[0.25] = None l.reverse() if __name__ == '__main__': with Manager() as manager: d = manager.dict() l = manager.list(range(10)) p = Proc...
kernel.py
from queue import Queue from threading import Thread from ipykernel.kernelbase import Kernel import re import subprocess import tempfile import os import os.path as path import json import shlex import ctypes def rm_nonempty_dir (d): for root, dirs, files in os.walk (d, topdown=False): for name in files:...
plotting.py
""" pyvista plotting module """ import collections import logging import os import time from threading import Thread import imageio import numpy as np import scooby import vtk from vtk.util import numpy_support as VN import pyvista from pyvista.utilities import (convert_array, get_scalar, is_pyvista_obj, ...
scenario_model.py
from image_graph import createGraph, current_version, getPathValues import exif import os import numpy as np import logging from tool_set import * import video_tools from software_loader import Software, getProjectProperties, ProjectProperty, MaskGenLoader,getRule import tempfile import plugins import graph_rules from ...
train-mario-curiosity.py
import os import argparse import gym import numpy as np import torch import torch.cuda import torch.multiprocessing as _mp from models.actor_critic import ActorCritic from models.icm import ICM from common.atari_wrapper import create_mario_env from optimizer.sharedadam import SharedAdam from trainer.a3c.train_curiosit...
first_thread.py
# encoding: utf-8 """ @author: yp @software: PyCharm @file: first_thread.py @time: 2019/7/26 0026 09:04 """ import threading def action(max): for i in range(max): print(threading.current_thread().getName() + " " + str(i)) for i in range(100): print(threading.current_thread().getName() + " " + str(...
spectra.py
from __future__ import division from builtins import hex from builtins import str from builtins import range from builtins import object from past.utils import old_div import numpy as np import threading import logging import socket import struct class Spectra(object): """ REACH spectrometer data receiver """ ...
robot_commander.py
#!/usr/bin/env python # robot_commander.py # Copyright (C) 2017 Niryo # All rights reserved. # # 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 3 of the License, or # (at your opt...
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...
pydoc.py
#!/usr/bin/env python # -*- coding: latin-1 -*- """Generate Python documentation in HTML or text for interactive use. In the Python interpreter, do "from pydoc import help" to provide online help. Calling help(thing) on a Python object documents the object. Or, at the shell command line outside of Python: Run "pydo...
run_manager.py
# -*- encoding: utf-8 -*- import errno import json import logging import os import re import signal import socket import stat import subprocess import sys import time from tempfile import NamedTemporaryFile import threading import yaml import numbers import inspect import glob import platform import fnmatch import cl...
controller.py
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
test_pdb.py
# A test suite for pdb; not very comprehensive at the moment. import doctest import pdb import sys import types import unittest import subprocess import textwrap from test import support # This little helper class is essential for testing pdb under doctest. from test.test_doctest import _FakeInput class PdbTestInpu...
task.py
""" Backend task management support """ import collections import itertools import logging from enum import Enum from threading import RLock, Thread from copy import copy from six.moves.urllib.parse import urlparse, urlunparse import six from ...backend_interface.task.development.worker import DevWorker from ...backe...
test_automap.py
import random import threading import time from sqlalchemy import create_engine from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchemy import MetaData from sqlalchemy import String from sqlalchemy import testing from sqlalchemy.ext.automap import automap_base from sqlalchemy.ext.automap impor...
test_sys.py
import builtins import codecs import gc import locale import operator import os import struct import subprocess import sys import sysconfig import test.support from test import support from test.support import os_helper from test.support.script_helper import assert_python_ok, assert_python_failure from test.support imp...
mafia_service.py
import logging import threading import time import random from concurrent import futures import grpc import mafia_pb2 import mafia_pb2_grpc import mafia.service.service_config as config from mafia.service.decorators import validate_day, validate_night, validate_game_started, validate_game_not_started, \ validate_...
ajax.py
import json import logging import os import threading import time import cherrypy import datetime import core from core import config, library, searchresults, searcher, snatcher, notification, plugins, downloaders from core.library import Metadata, Manage from core.movieinfo import TheMovieDatabase, YouTube from core.p...
test.py
# vim: sw=4:ts=4:et import logging import os, os.path import pickle import re import shutil import signal import tarfile import tempfile import threading import time import unittest import uuid from multiprocessing import Queue, cpu_count, Event from queue import Empty import saq, saq.test from saq.analysis import R...
io.py
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
vsnp_build_tables.py
#!/usr/bin/env python import argparse import multiprocessing import os import pandas import queue import pandas.io.formats.excel import re from Bio import SeqIO INPUT_JSON_AVG_MQ_DIR = 'input_json_avg_mq_dir' INPUT_JSON_DIR = 'input_json_dir' INPUT_NEWICK_DIR = 'input_newick_dir' # Maximum columns allowed in a LibreO...
test_conveyor.py
# -*- coding: utf-8 -*- # Copyright 2021 CERN # # 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...
camera.py
import threading import binascii from time import sleep from utils import base64_to_pil_image, pil_image_to_base64 class Camera(object): def __init__(self, makeup_artist): self.to_process = [] self.to_output = [] self.makeup_artist = makeup_artist thread = threading.Thread(target=...
corrector_batch.py
# The MIT License # Copyright (c) 2021- Nordic Institute for Interoperability Solutions (NIIS) # Copyright (c) 2017-2020 Estonian Information System Authority (RIA) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"...
SlideSpeech.py
# -*- coding: utf-8 -*- """ SlideSpeech.py Use browser and local text-to-speech engine to display and play Wiki-to-Speech scripts Copyright (c) 2011 John Graves MIT License: see LICENSE.txt 20110818 Changes to enable reading http://aucklandunitarian.pagekite.me/Test20110818b 20110819 Tested on Mac: http://aucklandu...
microservice.py
import argparse import contextlib import importlib import json import logging import multiprocessing import multiprocessing as mp import os import socket import sys import time from distutils.util import strtobool from functools import partial from typing import Callable, Dict from seldon_core import __version__ from ...
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...
generate_script.py
import csv import json import os from threading import Thread import falcon import jinja2 from commons.logger import set_up_logging from script_buddy.utils import load_model, generate, send_mail from config import SENDER_EMAIL_CREDENTIALS, ADMIN_EMAIL_CREDENTIALS logger = set_up_logging() class Succ...
console_analysis.py
import os import time import threading import logging import matplotlib.pyplot as plt from pandas import DataFrame import strategies as s from strategies.strategy import Strategy from strategies.call import Call from strategies.put import Put from strategies.vertical import Vertical from screener.screener import Scre...
main_gui.py
#! /usr/bin/env python3.7 # -*- coding: utf-8 -*- # Created by kayrlas on August 17, 2019 (https://github.com/kayrlas) # main_gui.py from threading import Thread import time import tkinter as tk import tkinter.ttk as ttk from tkinter import filedialog from serialcompy import SerialCom class Applicatio...
rfid.py
import sys import evdev import logging import threading def print_callback ( id ) : logging.info( id ) class RfidReader : # set to true when the reader thread starts; if set to false, the reader will stop running = False # the thread that is reading characters from the RFID reader thread = None ...
TaskManager.py
""" Python thread pool, see http://code.activestate.com/recipes/577187-python-thread-pool/ Author: Valentin Kuznetsov <vkuznet [AT] gmail [DOT] com> """ # futures from __future__ import division from builtins import range, object from future import standard_library standard_library.install_aliases() # system modules...
pyesc.py
#!/usr/bin/python # Python Email Scrapper # Copyright (c)2020 - RND ICWR red="\033[1;31m" green="\033[0;32m" blue="\033[1;34m" normal_color="\033[0;0m" print(red+""" /$$$$$$$ /$$ /$$ /$$$$$$$$ /$$$$$$ /$$$$$$ | $$__ $$| $$ /$$/| $$_____/ /$$__ $$ /$$__ $$ | $$ \ $$ \ $$ /$$/ | $$ | $$ \__/| $$...
redis_stats_sse.py
#!/usr/bin/env python # __BEGIN_LICENSE__ # Copyright (c) 2015, United States Government, as represented by the # Administrator of the National Aeronautics and Space Administration. # All rights reserved. # # The xGDS platform is licensed under the Apache License, Version 2.0 # (the "License"); you may not use this fi...
test_spark.py
# (C) Datadog, Inc. 2018 # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import json import os import ssl import threading import time import mock import pytest import requests import urllib3 from six import iteritems from six.moves import BaseHTTPServer from six.moves.urllib.parse im...
utils.py
from tasks import run_omm_with_celery, run_omm_with_celery_fs_pep, run_cvae_with_celery from celery.bin import worker import numpy as np import threading, h5py import subprocess, errno, os import warnings from sklearn.cluster import DBSCAN import MDAnalysis as mda from keras import backend as K from molecules.utils.mat...
maze.py
import json import time from collections import defaultdict from threading import Thread, Event from tkinter import * from tkinter.ttk import * from tkinter.filedialog import asksaveasfilename, askopenfilename from tkinter.simpledialog import askstring from tkinter.messagebox import showerror, showinfo fro...
EWSv2.py
import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * import sys import traceback import json import os import hashlib from datetime import timedelta from cStringIO import StringIO import logging import warnings import subprocess import email from requests.exceptions import...
engine.py
"""""" import importlib import os import traceback from collections import defaultdict from pathlib import Path from typing import Any, Callable from datetime import datetime, timedelta from threading import Thread from queue import Queue from copy import copy from vnpy.event import Event, EventEngine from vnpy.trade...
test_sockets.py
# 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. import multiprocessing import os import socket import shutil import s...
testing.py
import bz2 from collections import Counter from contextlib import contextmanager from datetime import datetime from functools import wraps import gzip import os from shutil import rmtree import string import tempfile from typing import Union, cast import warnings import zipfile import numpy as np from numpy.random imp...
utility.py
import os import math import time import datetime from multiprocessing import Process from multiprocessing import Queue import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import imageio import torch import torch.optim as optim import torch.optim.lr_scheduler as lrs class time...
bootstrap_test.py
import os import random import re import shutil import tempfile import threading import time import logging import signal from cassandra import ConsistencyLevel from cassandra.concurrent import execute_concurrent_with_args from ccmlib.node import NodeError, TimeoutError, ToolError, Node import pytest from distutils....
dist_autograd_test.py
import sys import threading import time from enum import Enum import random import torch import torch.nn as nn from datetime import timedelta import torch.distributed as dist import torch.distributed.autograd as dist_autograd import torch.distributed.rpc as rpc import torch.testing._internal.dist_utils from torch.autog...
Streamer.py
# local config helper stuff try: import ISStreamer.configutil as configutil except ImportError: import configutil try: import ISStreamer.version as version except ImportError: import version import uuid # python 2 and 3 conversion support import sys if (sys.version_info < (2,7,0)): sys.stderr.write("You need at l...
calibrate.py
import cv2 import numpy as np import queue #experiment import threading #experiment # bufferless VideoCapture class VideoCapture: def __init__(self, name): self.cap = cv2.VideoCapture(name) # self.cap.set(6, cv2.VideoWriter_fourcc('H', '2', '6', '4')) # for reading raspivid self.q = queue.Queue() t...
A3C_discrete_action.py
""" Asynchronous Advantage Actor Critic (A3C) with discrete action space, Reinforcement Learning. The Cartpole example. View more on my tutorial page: https://morvanzhou.github.io/tutorials/ Using: tensorflow 1.8.0 gym 0.10.5 """ import multiprocessing import threading import tensorflow.compat.v1 as tf import numpy...
futu_gateway.py
""" Please install futu-api before use. """ from copy import copy from datetime import datetime from threading import Thread from time import sleep import pytz from futu import ( ModifyOrderOp, TrdSide, TrdEnv, OpenHKTradeContext, OpenQuoteContext, OpenUSTradeContext, OrderBookHandlerBase,...
wallet_multiwallet.py
#!/usr/bin/env python3 # Copyright (c) 2017-2020 The Bitcoin Core developers # Copyright (c) 2013-2021 The Riecoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test multiwallet. Verify that a riecoind node can loa...
py3test_io_tcp_async_in_thread.py
# -*- coding: utf-8 -*- """ Testing external-IO TCP connection - open/close - send/receive (naming may differ) """ __author__ = 'Grzegorz Latuszek' __copyright__ = 'Copyright (C) 2018, Nokia' __email__ = 'grzegorz.latuszek@nokia.com' import time import importlib import asyncio import pytest import threading def te...
base_test.py
# -*- coding: utf-8 -*- import contextlib import copy import datetime import json import threading import elasticsearch import mock import pytest from elasticsearch.exceptions import ElasticsearchException from elastalert.enhancements import BaseEnhancement from elastalert.enhancements import DropMatchException from ...
ssr_check.py
#!/usr/bin/env python3 import requests import time import threading from ssshare.ss import ss_local import random def test_connection( url='http://cip.cc', headers={'User-Agent': 'curl/7.21.3 (i686-pc-linux-gnu) ' 'libcurl/7.21.3 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18'}, proxies=None, port=10...
proc_google_selenium.py
#sub processes to scrape Google selenium #include libs import sys sys.path.insert(0, '..') from include import * def google_selenium(): call(["python3", "job_google_selenium.py"]) def google_selenium_sv(): call(["python3", "job_google_selenium_sv.py"]) def reset_scraper(): call(["python3", "job_reset_sc...
webloader.py
# Copyright 2004-2021 Tom Rothamel <pytom@bishoujo.us> # # 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, m...
ipr.py
#!/usr/bin/env python3 import time import sys import threading import Bio from Bio import SeqIO from Bio.Seq import Seq import multiprocessing as mp import tempfile import subprocess import shutil import pandas as pd import io limit = 30 threads = [] jobq=mp.Queue(limit) assert jobq.empty() results = [] t1 = time.ti...
Main.py
import base64 import ctypes import inspect import socket import threading import datetime from hyperlpr_py3 import pipline as pp import cv2 import time import HK_Capture as hkc from xlutils.copy import copy from xlrd import open_workbook statedict = {} SEGKEY = "---" # its a try catch_Interval = 0 # 设置抓图间隔,单位s tim...
client.py
from __future__ import print_function, division __version__ = '0.0.1' import datetime as dt import logging import os.path from threading import Thread, RLock from zeep.client import Client, CachingClient, Settings from zeep.wsse.username import UsernameToken import zeep.helpers from onvif.exceptions import ONVIFError...
DescripteursHarmoniques.py
from __future__ import print_function, division import numpy as np import matplotlib.pyplot as plt from numpy import linalg as LA from matplotlib.animation import FuncAnimation from matplotlib.ticker import FormatStrFormatter from mpl_toolkits.mplot3d import Axes3D from operator import itemgetter, attrgetter, truediv i...
server.py
#!/usr/bin/env python """ server.py Author: Toki Migimatsu Created: April 2017 """ from __future__ import print_function, division import threading from multiprocessing import Process from argparse import ArgumentParser import redis import json import time import sys import math import os import shutil from WebSocke...
server.py
import threading from flask import Flask from logbook import debug from flasgger import Swagger try: from urlparse import urlparse except ImportError: # pragma: no cover from urllib.parse import urlparse # pragma: no cover class ButlerServer(object): """ButlerServer implements Butler functions in Flask...
backgroundTestServers.py
import os import time import platform import threading import multiprocessing # sys.path.append(rootPath) from rtCommon.structDict import StructDict from rtCommon.scannerDataService import ScannerDataService from rtCommon.subjectService import SubjectService from rtCommon.exampleService import ExampleService from rtCom...
cache.py
import hashlib import logging import os import shutil import socket import tempfile import urllib from Queue import Queue, Full, Empty from stat import S_IFDIR, S_IFLNK, S_IFREG from StringIO import StringIO from threading import Lock, Thread, Event from time import time from urlparse import urlparse # Set download t...
__init__.py
from time import time from socket import * from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QVBoxLayout, QLabel, QGraphicsColorizeEffect, QHBoxLayout from PyQt5.QtGui import QColor, QFontDatabase, QIcon, QPalette, QBrush, QPixmap from PyQt5.QtCore import QTimer, Qt from functools import partial from thre...
robot.py
# Copyright 2019 Hanson Robotics 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 License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
test_capture.py
import contextlib import io import os import pickle import subprocess import sys import textwrap from io import StringIO from io import UnsupportedOperation from typing import List from typing import TextIO import pytest from _pytest import capture from _pytest.capture import CaptureManager from _pytest.main import Ex...
download_thread.py
from dataclasses import dataclass from datetime import datetime from os import mkdir from os.path import dirname, exists, join from queue import Queue from threading import Thread import requests API_URL = 'https://pokeapi.co/api/v2/' @dataclass class Pokemon: id: int name: str sprite: str = None clas...
test_shared_array.py
from multiprocessing import Process import numpy as np from kiox.distributed.shared_array import create_shared_array def test_create_shared_array(): array = create_shared_array([3, 84, 84], dtype=np.float32) def child(array): array.fill(1.0) p = Process(target=child, args=(array,)) p.start...
mask_test.py
import argparse import importlib import math import os import pprint import pickle as pkl from functools import reduce from queue import Queue from threading import Thread from core.detection_module import DetModule from core.detection_input import Loader from utils.load_model import load_checkpoint from utils.patch_c...
ImageProcessor.py
# This Python file uses the following encoding: utf-8 import os import sys import cv2 import numpy as np import threading from svg_to_gcode.svg_parser import parse_string from svg_to_gcode.compiler import Compiler, interfaces from svg_to_gcode import TOLERANCES from PySide2.QtCore import QSize from PySide2.QtGui impo...
dppo.py
""" simple version of OpenAI's Proximal Policy Optimization (PPO). [https://arxiv.org/abs/1707.06347] Distributing workers in parallel to collect data, then stop worker's roll-out and train PPO on collected data. Restart workers once PPO is updated. The global PPO updating rule is adopted from DeepMind's paper (DPPO): ...
main.py
import threading import signal import logging from argparse import ArgumentParser from blackboard import Blackboard from gas import GasReader from temp import TemperatureReader from sound import SoundReader from exporter import PrometheusExporter threads = [] log_level = logging.INFO # in some environments the sensor...
dx_skel.py
#!/usr/bin/env python # Corey Brune - Feb 2017 # Description: # This is a skeleton script which has all of the common functionality. # The developer will only need to add the necessary arguments and functions # then make the function calls in main_workflow(). # Requirements # pip install docopt delphixpy.v1_8_0 # The ...
utils.py
import logging import multiprocessing as mp import sys import threading import time import matplotlib.pyplot as plt from functools import partial from multiprocessing import Pool from dateutil.relativedelta import relativedelta _logger = logging.getLogger(__name__) def histogram_plot(data, x_labels, y_labels, fi...
jobs.py
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
backEnd.py
from django.contrib.auth.models import User from maracay.models import Product, Profile, PurchaseConfirmation, Tools, purchaseHistory from django.db import transaction import json,random, string from threading import Thread from django.template.loader import render_to_string from django.core.mail import send_mail from ...
player.py
from __future__ import absolute_import import base64 import threading from kodi_six import xbmc from kodi_six import xbmcgui from . import kodijsonrpc from . import colors from .windows import seekdialog from . import util from plexnet import plexplayer from plexnet import plexapp from plexnet import signalsmixin from...
simulation.py
''' Created on Oct 12, 2016 @author: mwittie CSCI 466 Nov 5, 2018 Program 3 Kyle Hagerman, Benjamin Naylor Git: KyleHagerman, Vispanius ''' import network import link import threading from time import sleep ##configuration parameters router_queue_size = 0 #0 means unlimited simulation_time = 10 #give the network suf...
snippet.py
####################################################### #### NOW AT A GITHUB REPO #### #### https://github.com/tusing/unicorn_phat #### ####################################################### #!/usr/bin/env python # Display a list of user-defined color bars; # fill the remaining area w...
server.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 use ...
02-mt_restaurant.py
import time import sys from threading import Thread from kitchen import Kitchen from burgers import Burger from utils import ( ingredients_list_from_recipe, prepare_ingerdient, flat_generator, select_ingredients, gather_ingredients, ) RECIPES = { "cheeseburger": [ "bun-bottom", ...
extract_prototypes.py
import argparse import os import pretrainedmodels import torch import multiprocessing as mp import torchvision.transforms as transforms from PIL import Image import numpy as np import h5py def parse_arguments(): parser = argparse.ArgumentParser(description="scrape all possible images from ai2thor scene") par...
app.py
import logging import re import requests import time from threading import Thread from django.conf import settings from django.db import models from django.db.models import Count, Max from django.core.exceptions import ValidationError from jsonfield import JSONField from api.models import UuidAuditedModel, log_event ...
twisterlib.py
#!/usr/bin/env python3 # vim: set syntax=python ts=4 : # # Copyright (c) 2018 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import os import contextlib import string import mmap import sys import re import subprocess import select import shutil import shlex import signal import threading import concurrent.fu...
__main__.py
from threading import Thread print("Starting Playground...") # Config camera_count = 2 # Start program print("Starting webdashboard emulator...") from robot import configserver as robotconfig web_config_thread = Thread(target=robotconfig.server.run) web_config_thread.start() print("Starting camera emulators...") fr...
debug.py
# -*- coding: utf-8 -*- """ debug.py - Functions to aid in debugging Copyright 2010 Luke Campagnola Distributed under MIT/X11 license. See license.txt for more infomation. """ from __future__ import print_function import sys, traceback, time, gc, re, types, weakref, inspect, os, cProfile, threading from . import pt...
test_itertools.py
import unittest from test import support from itertools import * import weakref from decimal import Decimal from fractions import Fraction import operator import random import copy import pickle from functools import reduce import sys import struct import threading import gc maxsize = support.MAX_Py_ssize_t minsize = ...
cashacct.py
##!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Oregano - A Ergon SPV Wallet # This file Copyright (c) 2019 Calin Culianu <calin.culianu@gmail.com> # # 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 th...
multi_pro3.py
from multiprocessing import Process import time import os #시작시간 start_time = time.time() #멀티쓰레드 사용 (40만 카운트 출력) def count(cnt): proc = os.getpid() for i in range(cnt): print("Process Id : ", proc ," -- ",i) if __name__ == '__main__': #멀티 쓰레딩 Process 사용 num_arr = [100000, 100000, 100000, 10000...
emanemanager.py
""" emane.py: definition of an Emane class for implementing configuration control of an EMANE emulation. """ import logging import os import threading from collections import OrderedDict from typing import TYPE_CHECKING, Dict, List, Set, Tuple, Type from core import utils from core.config import ConfigGroup, Configur...
hyperparameter_optimization.py
#!/usr/bin/env python # Amazon Machine Learning Samples # Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Amazon Software License (the "License"). You may not use # this file except in compliance with the License. A copy of the License is # located at # # http://aws.am...
webserver.py
# Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 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 requ...
proc.py
# -*- coding: utf-8 -*- """Interface for running Python functions as subprocess-mode commands. Code for several helper methods in the `ProcProxy` class have been reproduced without modification from `subprocess.py` in the Python 3.4.2 standard library. The contents of `subprocess.py` (and, thus, the reproduced methods...
test_client.py
import asyncio from collections import deque from contextlib import suppress from functools import partial import gc import logging from operator import add import os import pickle import psutil import random import subprocess import sys import threading from threading import Semaphore from time import sleep import tra...
test_icdar2015_base.py
# -*- coding:utf-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import division import os import sys import tensorflow as tf import cv2 import numpy as np import math from tqdm import tqdm import argparse from multiprocessing import Queue, Process from utils import...
app.py
from flask import Flask, render_template, url_for, request, jsonify, redirect import requests import pandas from bs4 import BeautifulSoup from textblob import TextBlob import matplotlib.pyplot as plt import urllib import nltk import spacy import queue from threading import Thread # import en_core_web_sm from nltk.corpu...
minecraftBot.py
from discord.ext.commands import Bot from discord.ext import commands from mcstatus import MinecraftServer from threading import Thread from searchYT import search, getInfo, getPlaylist import asyncio, time, discord, os, subprocess, socket, sys, youtube_dl, re, io, random, datetime botID = "" Client = discord.Client(...
multiprocessing.py
import os import pickle import select class Process: def __init__(self, group=None, target=None, name=None, args=(), kwargs={}): self.target = target self.args = args self.kwargs = kwargs self.pid = 0 self.r = self.w = None def start(self): self.pid = os.fork()...
lisp-core.py
# ----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.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...
hashdump_sam.py
import core.implant class HashDumpSAMImplant(core.implant.Implant): NAME = "SAM Hash Dump" DESCRIPTION = "Dumps the SAM hive off the target system." AUTHORS = ["zerosum0x0"] def load(self): self.options.register("LPATH", "/tmp/", "local file save path") self.options.register("RPATH", ...