source
stringlengths
3
86
python
stringlengths
75
1.04M
moto_server.py
import asyncio import functools import logging import socket import threading import time import os # Third Party import aiohttp import moto.server import werkzeug.serving host = '127.0.0.1' _PYCHARM_HOSTED = os.environ.get('PYCHARM_HOSTED') == '1' _CONNECT_TIMEOUT = 90 if _PYCHARM_HOSTED else 10 def get_free_tcp...
fuzzing.py
import os import threading from System.Core.Global import * from System.Core.Colors import * from System.Core.Modbus import * from System.Lib import ipcalc class Module: info = { 'Name': 'Fuzzing Function', 'Author': ['@enddo'], 'Description': ("Fuzzing Modbus Functions"), } options = { 'RHOSTS' ...
meusthreads.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('...
enterprise_backup_restore_test.py
import re, copy, json, subprocess from random import randrange, randint from threading import Thread from couchbase_helper.cluster import Cluster from membase.helper.rebalance_helper import RebalanceHelper from couchbase_helper.documentgenerator import BlobGenerator, DocumentGenerator from ent_backup_restore.enterpris...
dataset.py
import glob import pickle import sys import os import gc import time import ujson as json import tarfile from typing import Iterable, List, Dict, Union, Tuple import multiprocessing import threading import queue from tqdm import tqdm import numpy as np from . import nn_util from .ast import AbstractSyntaxTree, Syntax...
test_simulator.py
import multiprocessing import random from os import path as osp import magnum as mn import numpy as np import pytest import examples.settings import habitat_sim def test_no_navmesh_smoke(sim): sim_cfg = habitat_sim.SimulatorConfiguration() agent_config = habitat_sim.AgentConfiguration() # No sensors as ...
tpu_estimator.py
# Copyright 2017 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...
test_basics.py
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import absolute_import import os import sys import six.moves.queue import shutil import platform import tempfile import warnings import threading import subprocess import six from six.moves import range from six.moves import zip try: im...
test_base.py
import asyncio import fcntl import logging import os import random import sys import threading import time import uvloop import unittest import weakref from unittest import mock from uvloop._testbase import UVTestCase, AIOTestCase class _TestBase: def test_close(self): self.assertFalse(self.loop._closed...
server.py
import socket import threading import database as db from server_logic import * from serializer import serialize, deserialize HEADER = 64 PORT = 5055 SERVER = "192.168.0.12" # IPV4 of local server ADDR = (SERVER, PORT) # Address to be bound FORMAT = 'utf-8' DISCONNECT_MESSAGE = "!DISCONNECT" KICK_MESSAGE...
solution.py
import common import multiprocessing as mp import os data = [x.split(' ') for x in common.read_file('2019/22/data.txt').splitlines()] def calc_pos(start, deck_size, curr_mul, const_add): return (start*curr_mul+const_add)%deck_size def calc_muls(deck_size): curr_mul = 1 const_add = 0 for move in data...
ui.py
import os import threading from kivy.lang import Builder from kivy.properties import ObjectProperty from kivy.uix.floatlayout import FloatLayout from kivy.uix.label import Label from kivy.uix.popup import Popup from kivy.uix.screenmanager import Screen from kivy.uix.treeview import TreeViewLabel, TreeView from pyoram...
backend.py
from thonny.common import ( InputSubmission, InterruptCommand, EOFCommand, parse_message, ToplevelCommand, ToplevelResponse, InlineCommand, InlineResponse, UserError, serialize_message, BackendEvent, ValueInfo, execute_system_command, ) import sys import logging impor...
async_multi_daq_data_handler.py
import threading import time from datetime import datetime import sys from collections import deque class CircularBufferWrapper(object): """docstring for CircularBufferWrapper""" def __init__(self, float_buffer): super(CircularBufferWrapper, self).__init__() self.float_buffer = float_buffer ...
main.py
#!/usr/bin/env python import os from datetime import datetime, timezone, timedelta import threading import logging import re from botocore.vendored import requests import boto3 # semaphore limit of 5, picked this number arbitrarily maxthreads = 5 sema = threading.Semaphore(value=maxthreads) logging.getLogger('boto3...
__init__.py
__author__ = "Johannes Köster" __copyright__ = "Copyright 2022, Johannes Köster" __email__ = "johannes.koester@uni-due.de" __license__ = "MIT" import os import sys import contextlib import time import datetime import json import textwrap import stat import shutil import shlex import threading import concurrent.futures...
uploader.py
#!/usr/bin/env python import os import time import stat import random import ctypes import inspect import requests import traceback import threading from collections import Counter from selfdrive.swaglog import cloudlog from selfdrive.loggerd.config import get_dongle_id_and_secret, ROOT from common.api import api_get...
_stack.py
# Copyright 2016-2021, Pulumi 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 t...
compareDQMOutput.py
#!/bin/env python3 import os import sys import glob import argparse import subprocess from threading import Thread COMPARISON_RESULTS = [] def collect_and_compare_files(base_dir, pr_dir, output_dir, num_procs, pr_number, test_number, release_format): files = get_file_pairs(base_dir, pr_dir) threads = [] ...
rop.py
# coding=utf-8 # Copyright 2018 Sascha Schirra # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and the following di...
hogwild_trainer.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import copy import torch import torch.multiprocessing as mp from pytext.common.constants import Stage from pytext.config.pytext_config import ConfigBase from pytext.legacy.data import Iterator from pytext.metric_reporters im...
managewait.py
# # The MIT License # # Copyright 2016 Vector Software, East Greenwich, Rhode Island USA # # 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 limita...
task.py
import threading import time import sys from .common import logger from .service import Service """ The task.py module containes classes needed to manage multithreading and running tasks within the application. """ class Signal: """ Signal class is used by the TaskManager to communicate with the Task classes. """...
main.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun May 20 @author: ollbap """ from pystray import MenuItem as item import pystray from PIL import Image import traceback import os from MyUtil import myPrint from MyGitUtil import gitCheckDirtyStateRecursive from MyGitUtil import DirtyState from MyConfig...
favorites.py
import datetime import logging import re import threading from telegram import ForceReply from telegram import InlineKeyboardButton from telegram import InlineKeyboardMarkup, ReplyKeyboardMarkup from telegram.ext import ConversationHandler import captions import mdformat import const import settings import util from ...
corehandlers.py
""" socket server request handlers leveraged by core servers. """ import logging import os import shlex import shutil import socketserver import sys import threading import time from builtins import range from itertools import repeat from queue import Empty, Queue from core import CoreError, utils from core.api.tlv i...
repository.py
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import import functools import logging import os import re import shutil import subprocess from argparse import ArgumentParser, _SubParsersAction from cont...
tests.py
# # (c) 2015 Kaminario Technologies, Ltd. # # This software is licensed solely under the terms of the Apache 2.0 license, # the text of which is available at http://www.apache.org/licenses/LICENSE-2.0. # All disclaimers and limitations of liability set forth in the Apache 2.0 license apply. # import unittest import os...
racecar_core_real.py
""" Copyright Harvey Mudd College MIT License Spring 2020 Contains the Racecar class, the top level of the racecar_core library """ # General from datetime import datetime import threading from typing import Callable, Optional # ROS2 import rclpy as ros2 # racecar_core modules import camera_real import controller_r...
basic04.py
""" 多线程下的全局变量共享问题 1- 互斥锁:就是为变量引入一个状态:锁定和非锁定状态,类似于上厕所的锁门 2- 多个线程互相互斥,只有厕所门开锁之后才能让下一个进去,多个线程**协同配合** 3- 互斥锁:保证每次只有一个线程读写变量 """ import threading, time global_num = 0 # 创建一把全局互斥锁 global_lock = threading.Lock() def worker1(): global global_num for i in range(100000): # 修改资源前,尝试获取并加锁,如果没有...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
worker.py
from contextlib import contextmanager import atexit import faulthandler import hashlib import inspect import io import json import logging import os import redis import sys import threading import time import traceback from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union # Ray modules from ra...
server.py
#!/usr/bin/env python3 from __future__ import print_function import base64 import copy import hashlib import json import logging import os import pkgutil import random import signal import ssl import string import subprocess import sys import time from typing import List import urllib3 import requests import socket...
main.py
import threading from core.checkers.Checker import Start as Checker from core.customthread import ExtremeDev from core.funcs import System, Load, Others from core.config import * import random import os import time import sys import keyboard from threading import Thread from core.config_handler import Text stocking = {...
test_oauth2.py
# coding: utf-8 from __future__ import unicode_literals from functools import partial import re from threading import Thread import uuid from mock import Mock, patch import pytest from six.moves import range # pylint:disable=redefined-builtin # pylint:disable=import-error,no-name-in-module,wrong-import-order,relat...
beacon_scaner.py
import time TIME_SCAN_BEACON = 5 ################## Util.beacon ################################################# # https://github.com/bowdentheo/BLE-Beacon-Scanner class Beacon_Obj(object): mac = str() rssi = int() uuid = str() tx_power = int() major = int() minor = int() tipo = str() ...
msg_dispatcher_base.py
# Copyright (c) Microsoft Corporation. All rights reserved. # # MIT License # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and # associated documentation files (the "Software"), to deal in the Software without restriction, # including without limitation the rights to u...
pipe.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from multiprocessing import Process, Pipe, current_process def pipe1(pipe): pipe.send(f'Hello, I am {current_process().name}.') print(pipe.recv()) def pipe2(pipe): print(pipe.recv()) pipe.send(f'Hello, I am {current_process().name}.') pipe.close() ...
__main__.py
"""Starts home assistant.""" from __future__ import print_function import argparse import os import signal import sys import threading import time from multiprocessing import Process from homeassistant.const import ( __version__, EVENT_HOMEASSISTANT_START, REQUIRED_PYTHON_VER, RESTART_EXIT_CODE, ) d...
HTTPListener.py
import logging import os import sys import threading import SocketServer import BaseHTTPServer import ssl import socket import posixpath import mimetypes import time from . import * MIME_FILE_RESPONSE = { 'text/html': 'FakeNet.html', 'image/png': 'FakeNet.png', 'image/ico': 'FakeNet.ico', ...
helpers.py
# # helpers # import codecs import functools import json import multiprocessing import os import re import subprocess import sys import uuid import time try: from urllib.request import urlopen, urlretrieve, Request from urllib.parse import urlparse except ImportError: from urllib import urlretrieve fr...
test_worker.py
# -*- encoding: 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 ...
test_s3.py
import boto3 import botocore.session from botocore.exceptions import ClientError from botocore.exceptions import ParamValidationError from nose.tools import eq_ as eq from nose.plugins.attrib import attr from nose.plugins.skip import SkipTest import isodate import email.utils import datetime import threading import re ...
crs3_local_memory.py
import random as rn import time import numpy as np import helpers as hp import functions as f import multiprocessing def get_G(x): return (np.sum(np.array(x), axis=0)/len(x)).tolist() def get_P(centroid, w): doubled_G = [2*x for x in centroid] return [doubled_G[i] - w[i] for i in range(len(centroid))] ...
test_flight.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 # "...
conftest.py
import sys import os from typing import Callable from multiprocessing import Process import pytest sys.path.append("../apps/network/src") from apps.network.src.app import create_app as create_network from apps.node.src.app import create_app as create_domain from apps.worker.src.app import create_app as create_worker...
email.py
from flask_mail import Message, current_app from app import mail from threading import Thread def send_async_email(app, msg): with app.app_context(): mail.send(msg) def send_email(subject, sender, recipients, text_body, html_body): msg = Message(subject=subject, recipients=recipients, sender=sender) ...
controller_manager.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Software License Agreement (BSD License) # # Copyright (c) 2010, Antons Rebguns, Cody Jorgensen, Cara Slutter # 2010-2011, Antons Rebguns # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are per...
settings.py
import platform import subprocess import os import sys import locale import time import psutil from PySide2.QtGui import * from PySide2.QtCore import * from PySide2.QtWidgets import * import globals from languages import * from tools import * from tools import _ class SettingsWindow(QScrollArea): def __init__(...
collaborative.py
import http import ipaddress import logging import os import platform import re import threading import time import warnings from http.server import BaseHTTPRequestHandler from typing import Any, Callable, Dict, List, Optional, Union import requests import torch import pytorch_lightning as pl from pytorch_lightning.s...
mcedit.py
# !/usr/bin/env python2.7 # -*- coding: utf_8 -*- # import resource_packs # not the right place, moving it a bit further #-# Modified by D.C.-G. for translation purpose #.# Marks the layout modifications. -- D.C.-G. """ mcedit.py Startup, main menu, keyboard configuration, automatic updating. """ import splash impor...
reconst_display.py
import sys import functools import signal import select import socket import numpy as np import pickle import matplotlib.pyplot as plt import time from multiprocessing import Process, Queue sys.path.append('../dhmsw/') import interface import struct PLOT = True headerStruct = struct.Struct('III') class guiclient(obje...
run_experiments.py
# global imports import argparse from multiprocessing import process import sys, os import glob import multiprocessing as mp from joblib import Parallel, delayed # relative file paths sim_folder = "DataSim" experiments_folder = sim_folder + "/configs/experiments" bt_pipeline_folder = "BehaviorTreeDev" result_analysis_...
manager.py
from dataclasses import dataclass import logging import threading import time import traceback from pathlib import Path from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Iterator from concurrent.futures.thread import ThreadPoolExecutor from blspy import G1Element from chiapos import DiskProver from ...
tasks.py
import youtube_dl import datetime import threading import requests import re import time import os threads = [] # all threads list tasks_list = [] # all tasks list def start_received_request_action(data): """ Main function which extract task type and start proper action. Then return response. :param d...
server.py
# -*- encoding: utf-8 -*- from socket import * import threading class Server: def __init__(self): # Set up socket self.server_sock = socket(AF_INET, SOCK_STREAM) self.server_sock.bind(("127.0.0.1", 5021)) self.server_sock.listen(5) print 'Server socket setting is done!!' ...
controller.py
#!/usr/bin/env python # vim: set sw=4 et: import logging import json import time import threading import kombu import socket from brozzler.browser import BrowserPool, BrowsingException import brozzler import urlcanon class AmqpBrowserController: """ Consumes amqp messages representing requests to browse urls,...
util.py
import base64 import os import pickle import random import re import string import subprocess import threading from typing import Tuple def is_set(name: str) -> bool: """Helper method to check if given property is set, anything except missing, 0 and false means set """ val = os.environ.get(name, '0').lower() r...
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...
test_fanout.py
"Test diskcache.fanout.FanoutCache." from __future__ import print_function import collections as co import errno import functools as ft import hashlib import io import mock import os import os.path as op import pytest import random import shutil import sqlite3 import subprocess as sp import sys import threading impor...
test_pipeline.py
import os import threading import time import gi gi.require_version('Gst', '1.0') from gi.repository import Gst, GObject Gst.init(None) loop = None def run_main_loop(loop): loop.run() def main(): global loop print('The python.exe that this script is called with must be in the same di...
h264decoder.py
# -*- coding: utf-8 -*- # Copyright (c) 2013 Adrian Taylor # Inspired by equivalent node.js code by Felix Geisendörfer # # 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, i...
protocol_arduinosimulator.py
"""Provides a simple simulator for telemetry_board.ino or camera_board.ino. We use the pragma "no cover" in several places that happen to never be reached or that would only be reached if the code was called directly, i.e. not in the way it is intended to be used. """ import copy import datetime import queue import r...
service_driver.py
""" ServiceDriver ServiceDriver manages the tasks and processes associate with a single 'type' of service (e.g. Yara). There is a ServiceDriver instantiated for each type of service running on a node. The driver is responsible for launching 'ServiceWorker's which are the subprocesses that actually perform the...
mqtt_s3_comm_manager.py
# -*-coding:utf-8-*- import json import logging import time import traceback import uuid from typing import List import paho.mqtt.client as mqtt import yaml from .remote_storage import S3Storage from ..base_com_manager import BaseCommunicationManager from ..message import Message from ..observer import Observer from ...
slack.py
import slackclient import logging import time import traceback import os import requests import importlib import inspect import sys import asyncio from time import sleep from threading import Thread from utils.BotTools import get_config, log_command from utils.exceptions import JalBotError from utils.exceptions impor...
hh_flask_parser.py
from parser_app import main as pr import multiprocessing as ml from web_app import create_app import traceback if __name__ == "__main__": # Создать приложение Flask app = create_app() # Запустить парсер par_service = ml.Process(name="HH API Parser", target=pr.main) par_service.start() # Запус...
socket_server.py
#!/usr/bin/env python """ Socket HOST. """ import socket import threading HEADER = 64 PORT = 5050 def get_host(): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) try: # doesn't have to be reachable s.connect(('10.255.255.255', 1)) host = s.getsockname()[0] except Exception: ...
settings.py
# Copyright 2017 Mycroft AI 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 writin...
visualization.py
# Copyright 2020-2022 OpenDR European Project # # 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 agree...
cctv_cams.py
import cv2 import video_streaming_pb2_grpc, video_streaming_pb2 import argparse import os import grpc import time import numpy as np import multiprocessing import psycopg2 import signal import sys from recognize_image import recognize_image import dlib from config import postgres_conn, validate_param from queue impo...
_compat_test.py
# Copyright 2019 The Cirq Developers # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
scope.py
import logging import socketserver import subprocess import threading def get_scope_version(scope_path): completed_proc = subprocess.run([scope_path], universal_newlines=True, stdout=subprocess.PIPE) stdout = completed_proc.stdout for line in stdout.splitlines(): if "Scope Version: " in line: ...
correctord.py
import time from multiprocessing import Manager, Process from correctorlib.corrector_batch import CorrectorBatch from correctorlib.logger_manager import LoggerManager from settings import Settings if __name__ == '__main__': """ The main method. """ settings = Settings() logger_m = LoggerManager(se...
handlers.py
# Copyright 2001-2013 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
accessory_driver.py
"""AccessoryDriver - glues together the HAP Server, accessories and mDNS advertising. Sending updates to clients The process of sending value changes to clients happens in two parts - on one hand, the value change is indicated by a Characteristic and, on the other, that change is sent to a client. To begin, typically...
controller.py
from multiprocessing import Process, Queue from time import sleep from auth import * from gamelogic import * from messagelogic import * class Controller: def __init__(self): self.authorizedUsers = [] self.unAuthUsers = [] self.authInQue = Queue() self.authOutQue = Queue() self.auth = Process(target=star...
musicdata_volumio2.py
#!/usr/bin/python # coding: UTF-8 # musicdata service to read from Volumio V2 # Written by: Ron Ritchey import pydPiper_config import json, threading, logging, queue, time, sys from . import musicdata from socketIO_client import SocketIO def on_GetState_response(*args): logging.debug("********* Got Response ******...
main.py
#!/usr/bin/env python3 from threading import Thread from time import sleep def snooze(): sleep(10) def main(): threads = [] for i in range(10000): thread = Thread(target=snooze) thread.start() threads.append(thread) for thread in threads: thread.join() if __name__ =...
bot.py
# -*- coding: utf-8 -*- from linepy import * from datetime import datetime from threading import Thread import os,sys,youtube_dl,pafy,pytz,requests,time timenow = datetime.now(tz=pytz.timezone("Asia/Taipei")).strftime('%Y.%m.%d %H:%M:%S') tokenPath = 'authToken.txt' if os.path.isfile(tokenPath): f = open(tokenPath,...
obdii_logger.py
#!/usr/bin/python3 # ## obdii_logger.py # # This python3 program sends out OBDII request then logs the reply to the sd card. # For use with PiCAN boards on the Raspberry Pi # http://skpang.co.uk/catalog/pican2-canbus-board-for-raspberry-pi-2-p-1475.html # # Make sure Python-CAN is installed first http://skpang.co.uk/b...
webSocketAppHeardBeat.py
import websocket import threading import time import sys import os import json # Generalmente leemos un json para configurar nuestro socket class Configurador: pathToConfFile = '' connDATA = '' def __init__(self, path, connDATA): self.pathToConfFile=path self.connDATA=connDATA se...
otbtf.py
# -*- coding: utf-8 -*- # ========================================================================== # # Copyright 2018-2019 IRSTEA # Copyright 2020-2021 INRAE # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtai...
test_mv_manager.py
# =============================================================================== # Copyright 2013 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/licens...
REST_API1.py
import time import requests import threading # 스레드로 무식하게 푼 방법 cnt_per_page = [] def get_res(addr): res = requests.get(addr).json() cnt = 0 for match_ in res['data']: if match_['team1goals'] == match_['team2goals']: cnt +=1 cnt_per_page.append(cnt) def getNumDraws(year): res =...
EWSO365.py
import random import string from typing import Dict 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 io import StringIO import logging import warnings import email fr...
test_cymj.py
import pytest import unittest from numbers import Number from io import BytesIO, StringIO import numpy as np from numpy.testing import assert_array_equal, assert_array_almost_equal from mujoco_py import (MjSim, load_model_from_xml, load_model_from_path, MjSimState, ignore_m...
omsagent.py
#!/usr/bin/env python # # OmsAgentForLinux Extension # # Copyright 2015 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....
tests.py
import threading import time from unittest import mock from multiple_database.routers import TestRouter from django.core.exceptions import FieldError from django.db import ( DatabaseError, NotSupportedError, connection, connections, router, transaction, ) from django.test import ( Transact...
malware_utils.py
#!/usr/bin/python3 from .config_utils import get_base_config from .file_utils import profile_url_file, clean_up from .filter_utils import filter_url_list from .log_utils import get_module_logger from .plugin_utils import load_plugins from .viper_utils import upload_to_viper from .virus_total import get_urls_for_ip, ge...
test_logging.py
# Copyright 2001-2021 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
train.py
#!/usr/bin/env python """ Main training workflow """ from __future__ import division import argparse import glob import os import random import signal import time import torch from pytorch_pretrained_bert import BertConfig import distributed from models import data_loader, model_builder from models.data_loader i...
cli.py
import ast import inspect import os import platform import re import sys import traceback import warnings from functools import update_wrapper from operator import attrgetter from threading import Lock from threading import Thread import click from werkzeug.utils import import_string from .globals import current_app ...
helpers.py
import uuid import zipfile from pathlib import Path from multiprocessing import Process from django.conf import settings from django.core.mail import send_mail from django.template.loader import get_template, render_to_string from django.utils import timezone from django.utils.deconstruct import deconstructible LANG =...
bus.py
#!/usr/bin/env python3 """ BUS class - Should be seen as a singleton by the system. Works in the publish subscribe paradigm Bus messages should be a list with three elements. Destination of the message: BROADCAST or NAME_APPLICATION Type of message: Just an identifier so that the receiver can handle properly Payloa...
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...
brute_joomla.py
''' Made By Sai Harsha Kottapalli Tested on python3 About : Brute force joomla Use : Brute forcing joomla , retrieve login token and accept cookies ''' import urllib.request import urllib.parse import cookielib import queue from threading import * from HTMLParser import * class Parse_all(HTMLParser): def __i...
player.py
# -*- coding: utf-8 -*- import rospy, rosbag from threading import Thread def simple_publisher(msgs): pubs = {} for topic, msg, _ in msgs: if not topic in pubs: rospy.logdebug('New publisher %s of %s', topic, msg.__class__) pubs[topic] = rospy.Publisher(topic, msg.__class__, qu...
content-archiver.py
# ██████╗ ██████╗ ███╗ ██╗████████╗███████╗███╗ ██╗████████╗ # ██╔════╝██╔═══██╗████╗ ██║╚══██╔══╝██╔════╝████╗ ██║╚══██╔══╝ # ██║ ██║ ██║██╔██╗ ██║ ██║ █████╗ ██╔██╗ ██║ ██║ # ██║ ██║ ██║██║╚██╗██║ ██║ ██╔══╝ ██║╚██╗██║ ██║ # ╚██████╗╚██████╔╝██║ ╚████║ ██║ ███████╗██║ ╚████║ ...
aidemo.py
import os import sys import gi import cv2 import numpy as np from threading import Event, Thread, Lock from queue import Queue gi.require_version('Gtk', '3.0') gi.require_version('GdkPixbuf', '2.0') from gi.repository.GdkPixbuf import Colorspace, Pixbuf from gi.repository import Gtk, GLib, GObject #import camerapc as...