source
stringlengths
3
86
python
stringlengths
75
1.04M
testipc.py
from unittest import TestCase, main from multiprocessing import Process, Queue from mypy.ipc import IPCClient, IPCServer import pytest import sys import time CONNECTION_NAME = 'dmypy-test-ipc' def server(msg: str, q: 'Queue[str]') -> None: server = IPCServer(CONNECTION_NAME) q.put(server.connection_name) ...
lruqueue2.py
""" Least-recently used (LRU) queue device Clients and workers are shown here in-process Author: Guillaume Aubert (gaubert) <guillaume(dot)aubert(at)gmail(dot)com> """ import threading import time import zmq NBR_CLIENTS = 10 NBR_WORKERS = 3 def worker_thread(worker_url, context, i): """ Worker usi...
client.py
# coding: utf-8 __author__ = 'zhenhang.sun@gmail.com' __version__ = '1.0.0' import time import json import socket import random from multiprocessing import Process def send(): cs = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) servers = [ ('localhost', 10001), ('localhost...
test_parallel.py
""" Test the parallel module. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2010-2011 Gael Varoquaux # License: BSD Style, 3 clauses. import os import sys import time import mmap import threading from traceback import format_exception from math import sqrt from time import sl...
main.py
import socket, sys, random, os import time from multiprocessing import Process from datetime import datetime server_old_private_value, server_private_value, server_private_time = 0, 0, 0 client_old_private_value, client_private_value, client_private_time = 0, 0, 0 token = 0 common_value = 1758 old_token, ne...
common_snmp_actions.py
''' Copyright 2017, Fujitsu Network Communications, 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 in w...
pingpong.py
import socket import os import threading import random import sys import pygame class PingPongexception(Exception): pass class Server: def __init__(self): self.HOST = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.PORT = 12000 self.hostName = socket.gethostname() self.h...
utils.py
import threading def run_in_thread(fn): def run(*k, **kw): t = threading.Thread(target=fn, args=k, kwargs=kw) t.start() return run
db.py
import functools import sqlite3 import threading from threading import Thread from typing import Callable, Dict, Union from util.types import Function class Database(object): """Database wrapper.""" def __init__(self, path, debug=False): # type: (str) -> None self.path = ...
data_utils.py
# coding: utf8 # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
iCopy.py
import time, logging, re, chardet from telegram.ext import ( Updater, CommandHandler, MessageHandler, Filters, CallbackQueryHandler, ConversationHandler, ) from telegram.ext.dispatcher import run_async import utils from utils import ( folder_name, sendmsg, restricted, menu_keyboa...
test_distributed_sampling.py
import dgl import unittest import os from dgl.data import CitationGraphDataset from dgl.distributed import sample_neighbors, find_edges from dgl.distributed import partition_graph, load_partition, load_partition_book import sys import multiprocessing as mp import numpy as np import backend as F import time from utils i...
tests.py
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (a...
server.py
import asyncio try: import ujson as json except ImportError: import json import os import threading import traceback import rethinkdb as r from flask import Flask, render_template, request, g, jsonify, make_response from dashboard import dash from utils.db import get_db, get_redis from utils...
util_test.py
# Copyright 2014 Scalyr 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 in writing, so...
container.py
import threading import sys def fun(i): try: fun(i+1) except: sys.exit(0) t = threading.Thread(target=fun, args=[1]) t.start()
absolutely.py
#!/usr/bin/env python """ `votakvot-ABsolutely` is a script you can use to quickly smoke-test your application. It run user-provided python function from many greenlets and collect time statistics. ABsolutely was inspired by https://github.com/tarekziade/boom It behaves similar to Apache Bench, but call python callba...
cmdtlmrouter.py
""" Copyright 2022 Open STEMware Foundation All Rights Reserved. This program is free software; you can modify and/or redistribute it under the terms of the GNU Affero General Public License as published by the Free Software Foundation; version 3 with attribution addendums as found in the LICEN...
fmripreproc_wrapper.py
#! usr/bin/env python # ## PIPELINE: fmripreproc_wrapper.py # ## USAGE: python3 fmripreproc_wrapper --in=<inputs> --out=<outputs> [OPTIONS] # * requires python3 and FSL (calls FSL via python subprocess) # # ## Author(s) # # * Amy K. Hegarty, Intermountain Neuroimaging Consortium, University of Colorado Boulder # * ...
multiprocess_vector_env.py
import signal import warnings from multiprocessing import Pipe, Process import numpy as np from torch.distributions.utils import lazy_property import pfrl def worker(remote, env_fn): # Ignore CTRL+C in the worker process signal.signal(signal.SIGINT, signal.SIG_IGN) env = env_fn() try: while ...
hotswap.py
#!/usr/bin/env python """Automatic replacement of imported Python modules. The hotswap module watches the source files of imported modules which are replaced by its new version when the respective source files change. The need for a program restart during development of long-running programs like GUI applications for...
Start_Sorting.py
from tkinter import * from tkinter import messagebox from random import shuffle, sample from Codes.Sorting_Algorithms import algochooser from colorsys import hls_to_rgb from threading import * from tkinter import * import Codes.Start_Threading # Main sorting class class Sorting: def __init__(self, root, AlgoNameVa...
client.py
"""A semi-synchronous Client for the ZMQ cluster Authors: * MinRK """ #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as...
CenterServer.py
import socket from threading import Thread import time import pickle address = ('127.0.0.1', 11451) server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) models: dict[str, list] = {} # 模型列表 dataGroups: dict[str, tuple] = {} # 数据列表 def registerModelServer(address, modelName): """ 注册一个模型服...
x509tests.py
from basetestcase import BaseTestCase from security.x509main import x509main # from newupgradebasetest import NewUpgradeBaseTest from membase.api.rest_client import RestConnection, RestHelper import subprocess import json import socket from couchbase.bucket import Bucket from threading import Thread, Event from remote....
mlaunch.py
#!/usr/bin/env python import Queue import argparse import subprocess import threading import os, time, sys, re import socket import json import re import warnings import psutil import signal from collections import defaultdict from mtools.util import OrderedDict from operator import itemgetter, eq from mtools.util....
sleepgraph.py
#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0-only # # Tool for analyzing suspend/resume timing # Copyright (c) 2013, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published b...
systrace_controller.py
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import threading import zlib from profile_chrome import controllers from profile_chrome import util from pylib import cmd_helper _SYSTRACE_OPTIONS = [ ...
socksserver.py
#!/usr/bin/env python # SECUREAUTH LABS. Copyright 2018 SecureAuth Corporation. All rights reserved. # # This software is provided under under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # # SOCKS proxy server/client # # Author: # Alberto Soli...
trainer_factory.py
# Copyright (c) 2019 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...
package.py
import os import threading import uuid import yaml from django.db import models from common.models import JsonTextField from django.utils.translation import ugettext_lazy as _ from fit2ansible.settings import PACKAGE_DIR from kubeops_api.package_manage import * logger = logging.getLogger('kubeops') __all__ = ['Packag...
client.py
# client.py -- Implementation of the server side git protocols # Copyright (C) 2008-2013 Jelmer Vernooij <jelmer@samba.org> # Copyright (C) 2008 John Carr # # 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 F...
telemetry_listener.py
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE file in the project root for full license information. import random import time import threading # Using the Python Device SDK for IoT Hub: # https://github.com/Azure/azure-iot-sdk-python # The sample connects to a device...
test_pooled_pg.py
"""Test the PooledPg module. Note: We don't test performance here, so the test does not predicate whether PooledPg actually will help in improving performance or not. We also assume that the underlying SteadyPg connections are tested. Copyright and credit info: * This test was contributed by Christoph Zwerschke """ ...
helper.py
import asyncio import functools import json import math import os import random import re import sys import threading import time import uuid import warnings from argparse import ArgumentParser, Namespace from contextlib import contextmanager from datetime import datetime from itertools import islice from pathlib impor...
data.py
"""Contains classes for loading and augmenting data.""" from __future__ import absolute_import from __future__ import division from __future__ import division import cv2 import abc import numpy as np import six import multiprocessing import logging cityscapes_value_map = {0: 255, 1: 255, 2: 255, 3: 255, 4: 255, 5: ...
sublert.py
#!/usr/bin/env python # coding: utf-8 # Announced and released during OWASP Seasides 2019 & NullCon. # Huge shout out to the Indian bug bounty community for their hospitality. import argparse import dns.resolver import sys import requests import json import difflib import os import re import psycopg2 from tld import g...
tello.py
# coding=utf-8 import logging import socket import time import threading import cv2 # type: ignore from threading import Thread from typing import Optional from enforce_types import enforce_types threads_initialized = False drones: Optional[dict] = {} client_socket: socket.socket @enforce_types class Tello: """P...
ioutil.py
import os import io import json import oss2 import cv2 import configparser import enum import numpy as np from PIL import Image from typing import Any, Union, Dict, List, Tuple from multiprocessing import Queue, Process, Pool from loguru import logger class StoreType(enum.Enum): def __new__(cls, *args, **kwargs...
dispatcher.py
#!/usr/bin/python ''' # ===================================================================== # Abstract PDRA dispatcher class # # Author: Marc Sanchez Net # Date: 01/29/2019 # Copyright (c) 2019, Jet Propulsion Laboratory. # ===================================================================== ''' # General import...
ArduinoConection.py
""" * @author Kai Fischer * @email kathunfischer@googlemail.com * @desc Class to encapsulate the communication to the arduino using a serial com-port connection """ import serial import time import json import serial.tools.list_ports from threading import Thread from userDefaultsHandler import getUUIDFromSettings f...
inter.py
import threading import pickle from problems import problems from contestant import contestant from connection import connection import time class inter: def __init__(self,info): self.loadedbase = problems.loadbase() self.base = self.loadedbase['base'] self.basetime = self.loadedbase['time'...
variable_scope.py
# Copyright 2015 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...
scandownloadmanager.py
""" iscan task的下载分配 """ import threading import time import traceback from datetime import datetime from queue import PriorityQueue import pytz from datacontract import IdownCmd, ETaskStatus, IscanTask, ECommandStatus from idownclient.config_task import clienttaskconfig from .scanmanagebase import ScanManageBase from...
run_unittests.py
#!/usr/bin/env python3 # Copyright 2016-2017 The Meson development 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.apache.org/licenses/LICENSE-2.0 # Unless required by ...
AttackUp.py
from PyQt4.QtGui import * from PyQt4.QtCore import * from os import getcwd,popen,chdir,walk,path,remove,stat,getuid from Module.DHCPstarvation import frm_dhcp_Attack,conf_etter from platform import linux_distribution from re import search import threading from shutil import copyfile class frm_update_attack(QMainWindow)...
skahdibuddy.py
import tkinter as tk from tkinter import * from os import listdir from os.path import isfile, join from PIL import Image from random import randint import os, tempfile, cv2, time import sys, webbrowser, shutil ,random, pyttsx3, threading import json, ctypes, subprocess, pythoncom, subprocess, re import base64,...
functions.py
#!/usr/bin/python __author__ = 'Trifon Trifonov' import sys, os #sys.path.insert(0, '../lib') import numpy as np import jac2astrocen import corner import re from subprocess import PIPE, Popen import signal import platform import tempfile, shutil from threading import Thread from .Warning_log import Warning_log imp...
chatClient.py
import socket import threading import time tLock = threading.Lock() shutDown = False def receving(name, sock): while not shutDown: try: while True: data, addr = sock.recvfrom(1024) print str(data) except Exception as e: if str(e) == "[Errno 3...
fake_server.py
from __future__ import (absolute_import, division, print_function) from mantid import AlgorithmManager, ConfigService from mantid.simpleapi import FakeISISHistoDAE from threading import Thread facility = ConfigService.getFacility().name() ConfigService.setFacility('TEST_LIVE') def startServer(): FakeISISHistoDAE...
cpt.py
#!/usr/bin/env python # Copyright (c) 2022 Vitaly Yakovlev <vitaly@optinsoft.net> # # CPT.py # # This script allows to forward multiple local ports to the remote host:port via SSH. # If argument "count" equals 1 then it works exactly as this command: # # ssh -L local_port:remote_ip:remote_port ssh_user@ssh_host -i s...
cp.py
try : import os import subprocess import json from termcolor import colored as clr , cprint import time from itertools import zip_longest from tqdm import tqdm import threading import socket import getpass from settings.compiler import competitive_companion_port, parse_proble...
gtagsExpl.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import vim import re import os import os.path import shutil import itertools import subprocess from .utils import * from .explorer import * from .manager import * if sys.version_info >= (3, 0): import queue as Queue else: import Queue #***************************...
signals.py
from threading import Thread from blinker import Namespace from flask import request, url_for from mongoengine import DoesNotExist from .models import Tracker, PostStatistic from .settings import BlogSettings from .utils import submit_url_to_baidu # 创建信号 app_signals = Namespace() post_visited = app_signals.signal('p...
HizlandirilmisPiKamera.py
from picamera import PiCamera from picamera.array import PiRGBArray from threading import Thread import cv2 class HizlandirilmisPiKamera: def __init__(self, cozunurluk=(640, 480)): self.camera = PiCamera() self.camera.resolution = cozunurluk self.hamKare = PiRGBArray(self.camera, size=se...
eslint.py
#!/usr/bin/env python """ eslint.py Will download a prebuilt ESLint binary if necessary (i.e. it isn't installed, isn't in the current path, or is the wrong version). It works in much the same way as clang_format.py. In lint mode, it will lint the files or directory paths passed. In lint-patch mode, for upload.py, i...
ip.py
"""Module to connect to a KNX bus using a KNX/IP tunnelling interface. """ import socket import threading import logging import time import queue as queue import socketserver as SocketServer from knxip.core import KNXException, ValueCache, E_NO_ERROR from knxip.helper import int_to_array, ip_to_array from knxip.gatewa...
plutus.py
# Plutus Bitcoin Brute Forcer # Made by Isaac Delly # https://github.com/Isaacdelly/Plutus # Added fastecdsa - June 2019 - Ian McMurray # Program adjustment to work on Dogecoin Dormant Wallets - May 2021 - LongWayHomie # Main idea is to look for private keys to lost wallets of Dogecoin. List has been created with dorma...
operator.py
import logging import multiprocessing as mp import os import time import threading from typing import Any from typing import Callable from typing import Dict from typing import Tuple from typing import Optional from kubernetes.client.exceptions import ApiException import yaml import ray.autoscaler._private.monitor as...
android.py
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import atexit import json import logging import os import os.path import subprocess import sys import threading import time import SimpleHTTPServer import S...
test_server.py
import logging from threading import Thread from http.server import HTTPServer, BaseHTTPRequestHandler logging.basicConfig(level=logging.NOTSET) logger = logging.getLogger("test_web_server") reply_payload = "default reply" class RequestHandler(BaseHTTPRequestHandler): def _set_response(self): self.send_r...
mavtester.py
#!/usr/bin/env python ''' test MAVLink performance between two radios ''' import sys, time, os, threading, Queue from optparse import OptionParser parser = OptionParser("mavtester.py [options]") parser.add_option("--baudrate", type='int', help="connection baud rate", default=57600) parser.add_opti...
deploygame.py
#!/usr/bin/env python # Copyright (c) 2011-2014 Turbulenz Limited import logging import locale import mimetypes from os.path import exists as path_exists, dirname as path_dirname, basename as path_basename, abspath as path_abspath from optparse import OptionParser, TitledHelpFormatter from urllib3 import connection_f...
contextlog.py
"""This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license. """ import logging import os import sys import io import requests import calendar import threading import json import platform from datetime import da...
render.py
import off_loader as ol import moderngl import numpy as np from pyrr import Matrix44 from PIL import Image dodecahedron_polar_pos = [[0.78539816, 0.61547971], [0.78539816, -0.61547971], [-0.78539816, 0.61547971], [-0.78539816, -0.61547971], ...
utils.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time import pickle import threading from contextlib import contextmanager from functools import wraps from collections import deque import tensorflow as tf # TODO: move to utils def _check_f...
persistence.py
# -*- coding: iso-8859-1 -*- """Module to store persistence handler classes. Persistence handlers take care of all implementation details related to resource storage. They expose a common interface (defined in :class:`BasePersistenceHandler`) through which the server (and/or filters/crawlers) can load, save and perfo...
main_threaded.py
import datetime import multiprocessing from threading import Thread from model.hash_generator import HashGenerator QUANTITY = 160 def main(): hash_gen = HashGenerator(difficulty=4) processor_count = multiprocessing.cpu_count() threads = [] print(f'\nProcessors count: {processor_count}\n') t0 = ...
build_image_data.py
"""Converts image data to TFRecords file format with Example protos. Modified from https://github.com/tensorflow/models/blob/master/inception/inception/data/build_image_data.py The image data set is expected to reside in PNG files located in the following directory structure. data_dir/video_id/image0.png data_di...
test_bulk_insert.py
import logging import time import pdb import copy import threading from multiprocessing import Pool, Process import pytest from milvus import DataType 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_...
views.py
import os import threading from django.conf import settings from django.contrib.auth.decorators import login_required from django.core.exceptions import ObjectDoesNotExist from django.shortcuts import render, redirect from django.utils import timezone from django.utils.datastructures import MultiValueDictKeyError imp...
viewerclient.py
from __future__ import absolute_import, division, print_function import time import json import os import tempfile import threading from collections import defaultdict, Iterable import numpy as np from lcm import LCM from robotlocomotion import viewer2_comms_t from director.thirdparty import transformations class Cl...
test_utils.py
import logging import sys import threading import time import pytest from ophyd import Component as Cpt from ophyd import Device from .. import utils from ..device import GroupDevice from ..utils import post_ophyds_to_elog try: import pty except ImportError: pty = None logger = logging.getLogger(__name__) ...
mainwindow.py
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ Spyder, the Scientific PYthon Development EnviRonment ===================================================== Developped and maintained by the Spyder Project Contr...
cUR50_tfrecords.py
# convert a pandas DataFrame of amino acid sequence, secondary structure # sequence pairs into TF records from multiprocessing import Process, Queue from pathlib import Path from glob import glob import mmap import pandas as pd import numpy as np import tensorflow as tf from sklearn.model_selection import KFold from pr...
train.py
#!/home/zhuqingjie/env/py3_tf_low/bin/python ''' @Time : 08.05 0005 下午 01:45 @Author : zhuqingjie @User : zhu @FileName: train.py @Software: PyCharm ''' import json, os, cv2, sys, time import tensorflow as tf from threading import Thread # #################################### 测试GPU能不能用 #######################...
tcoreapi_mq.py
import zmq import json import re import threading class TCoreZMQ(): def __init__(self,APPID,SKey): self.context = zmq.Context() self.appid=APPID self.ServiceKey=SKey self.lock = threading.Lock() self.m_objZMQKeepAlive = None #连线登入 def Connect(self, por...
test_fx.py
import builtins import contextlib import copy import functools import inspect import math import numbers import operator import os import pickle import sys import torch import traceback import typing import types import warnings import unittest from math import sqrt from torch.multiprocessing import Process from torch....
keyboard_teleop.py
#!/usr/bin/env python # Author: Silvia Knappe # Control movo with keyboard teleop, moves base and torso! import rospy from geometry_msgs.msg import Twist from movo.system_defines import TRACTOR_REQUEST from movo_msgs.msg import ConfigCmd, LinearActuatorCmd from sensor_msgs.msg import JointState import sys, select, te...
main_part2.py
#!/usr/bin/env python import threading import time from queue import Queue lock = threading.Lock() state = { 0: { 'is_waiting': False, 'q': Queue() }, 1: { 'is_waiting': False, 'q': Queue() } } def get_value(val, registers): try: return int(val) except...
fmos_trainer#2_for_non-spatial_DONTUSE.py
''' FMON Trainer 2 - Freely Moving Odor Navigation - ODOR ASSOCIATION Written: Teresa Findley, tmfindley15@gmail.com Last Updated: 9/23/17 --Records tracking data via OSC from custom code in Bonsai (open source computer vision software -- https://bonsai-rx.org/) --Records signal data through NI USB-6009 --Co...
client.py
#!/usr/bin/env python # # Copyright 2014 Huawei Technologies Co. Ltd # # 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 ...
safe_bank.py
import datetime import random import time from threading import Thread, RLock from typing import List class Account: def __init__(self, balance=0): self.balance = balance def main(): accounts = create_accounts() total = sum(a.balance for a in accounts) validate_bank(accounts, total) pri...
driver.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # Copyright (c) 2011 Piston Cloud Computing, Inc # Copyright (c) 2012 Univer...
subprocess_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 us...
sample_deadlock.py
import time import threading lock_a = threading.Lock() lock_b = threading.Lock() def task1(): print('Task 1 is starting...') print('Task 1 is waiting to acquire Lock A') with lock_a: print('Task 1 has acquired Lock A') print('Task 1 is doing some calculations') time.sleep(2) ...
test_api.py
import cio import six import threading from cio.backends import cache from cio.conf import settings from cio.conf.exceptions import ImproperlyConfigured from cio.pipeline import pipeline from cio.backends import storage from cio.backends.exceptions import NodeDoesNotExist from cio.utils.uri import URI from tests import...
minipip.py
#!/usr/bin/env python3 """ MIT License Copyright (c) 2021 Aivar Annamaa 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 from datetime import datetime import logging from flask import Flask from flask import jsonify import asyncio import sys from flask import request from multiprocessing import Process sys.path.append('../') sys.path.append('../../') sys.path.append('../strategy/') from dquant.markets._binance_sp...
teardown-test.py
import subprocess import time import random import sys import threading import time import os import directio import mmap from os import path import stat import datetime from multiprocessing import Process, Manager, Array, current_process, Lock subprocess.call("sudo iscsiadm -m node --logout", shell=True) subprocess....
test_asyncore.py
# expected: fail import asyncore import unittest import select import os import socket import sys import time import warnings import errno import struct from test import test_support from test.test_support import TESTFN, run_unittest, unlink, HOST from StringIO import StringIO try: import threading except ImportE...
HIVE MIND.py
import datetime class hivemind: class mind: class neurone: def __init__(self,name,resistance=0,accelerate=0.999,brake=0.999,bayeslearningrate=10): import random self.learningrate={} self.bayeslearningrate=bayeslearningrate ...
mossbackScaner.py
# -*- coding: utf-8 -*- # version: 0.2 # date: 2020.09.22 import json import re import socket import sys import http.client import time import threading from socket import * from time import ctime import hashlib import subprocess from subprocess import PIPE from scanner_sqli import test_sqli from sc...
app.py
# coding=utf-8 from __future__ import print_function import inspect import logging import numbers import os import sys import threading import time import warnings from os.path import isfile import numpy as np import six from phi import struct from phi.data.fluidformat import Scene, write_sim_frame from phi.physics.f...
AccessibleRunner.py
# TODO # * Resize the command output textbox together with the window. # * Make the size of the help dialog relative to the desktop size. import os import sys import wx import re import psutil import accessible_output2.outputs.auto from subprocess import call, Popen, PIPE, STDOUT from threading import Thread from play...
test_operator.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...
dataset.py
# -*- coding: utf-8 -*- """ Copyright (c) 2020-2022 INRAE Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, ...
connection.py
graph_client_dict = {} current_server = None reloaded_graph = None # Called for every client connecting def new_client(client, server): global reloaded_graph if client['id'] not in graph_client_dict : # If some other client has left (cf. client_left()) if reloaded_graph : graph_client_dict[client['id']] = r...
dark-fb.py
import os, sys, time, datetime, random, hashlib, re, threading, json, getpass, urllib, requests, mechanize from multiprocessing.pool import ThreadPool from requests.exceptions import ConnectionError from mechanize import Browser reload(sys) sys.setdefaultencoding('utf8') br = mechanize.Browser() br.set_handl...
main.py
# main.py import datetime # import whois import json import socket import time import traceback from random import choice from threading import Thread from urllib.parse import quote as urlencode from urllib.parse import unquote from urllib.error import URLError import pytz import requests import socks import subproce...