source
stringlengths
3
86
python
stringlengths
75
1.04M
main.py
# Built in import json import sqlite3 import threading import time from urllib3.util.url import parse_url # Third party from bottle import route, run, template, static_file, request import requests # First party from website import Site # The home page route @route('/', method='GET') def index(): return template('v...
test_application.py
# GUI Application automation and testing library # Copyright (C) 2006-2018 Mark Mc Mahon and Contributors # https://github.com/pywinauto/pywinauto/graphs/contributors # http://pywinauto.readthedocs.io/en/latest/credits.html # All rights reserved. # # Redistribution and use in source and binary forms, with or without # ...
__main__.py
import _thread import argparse import logging import os import time import webbrowser from threading import Thread from cryptography.hazmat.backends import default_backend as crypto_default_backend from cryptography.hazmat.primitives import serialization as crypto_serialization from cryptography.hazmat.primitives.asym...
coredump_recv_server.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import socket import struct import threading import string import datetime # typedef struct { # uint8_t mac[6]; # char version[20]; # uint8_t flag; # size_t size; # uint8_t data[0]; # } mesh_coredump_data_t; pkt_head_size = 32 pkt_type_index = 26 pk...
tests.py
from __future__ import unicode_literals import os import sys import threading import time from unittest import skipIf, skipUnless from django.db import ( DatabaseError, Error, IntegrityError, OperationalError, connection, transaction, ) from django.test import ( TransactionTestCase, skipIfDBFeature, skipU...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
datasets.py
from flask import request from flask_restplus import Namespace, Resource, reqparse from flask_login import login_required, current_user from werkzeug.datastructures import FileStorage from mongoengine.errors import NotUniqueError from mongoengine.queryset.visitor import Q from threading import Thread from google_image...
img.py
import threading import cv2 import numpy as np class ImageThread: def __init__(self, URL): # threading.Thread.__init__(self) self.URL = URL self.cap = cv2.VideoCapture(URL) self.frame = self.cap.read() self.frame = self.frame[1] self.stopped = False def start(...
runner.py
#!/usr/bin/env python2 # This Python file uses the following encoding: utf-8 ''' Simple test runner These tests can be run in parallel using nose, for example nosetests --processes=4 -v -s tests/runner.py will use 4 processes. To install nose do something like |pip install nose| or |sudo apt-get install python-no...
uzm_util.py
#coding=utf-8 #created by SamLee 2020/3/6 import os import sys import math from elftools.elf.elffile import ELFFile import zipfile import tempfile import shutil import struct import entropy from concurrent.futures import ThreadPoolExecutor import threading from queue import Queue import time import multiprocessing imp...
payloads.py
#!/usr/bin/python # -*- coding: utf-8 -*- 'Reverse TCP Shell Payload (Build Your Own Botnet)' # standard library import os import sys import time import json import errno import base64 import ctypes import ftplib import struct import socket import signal import logging import functools import threading import subproce...
8.flask_multiple_session_impliment.py
import subprocess import time from selenium.webdriver import Chrome import pywebio import template import util from pywebio.input import * from pywebio.utils import to_coroutine, run_as_function def target(): template.basic_output() template.background_output() run_as_function(template.basic_input()) ...
spa.py
""" Calculate the solar position using the NREL SPA algorithm either using numpy arrays or compiling the code to machine language with numba. """ # Contributors: # Created by Tony Lorenzo (@alorenzo175), Univ. of Arizona, 2015 from __future__ import division import os import threading import warnings import logging p...
amqp.py
import logging import threading import time import pika class Client(): def __init__(self, cn=None, xchg="testexchange", logger=None): self.brokers = [] self.cn = cn self.xchg = xchg self.disconnected = True self.recon = False if logger: self.log = ...
assess.py
#!/usr/bin/python import getpass from netmiko import ConnectHandler import netmiko import csv,sys, re import yaml import operator import threading from Queue import Queue from mail import send_report from tabulate import tabulate LOGIN = raw_input("Login: ") PASSWORD = getpass.getpass("Password: ") SECRET = getpass.ge...
data.py
# This file is adapted from https://github.com/abisee/pointer-generator/blob/master/data.py import glob import struct import csv import queue import time import re import json import io from threading import Thread import numpy as np import random from random import shuffle random.seed(123) import config import dat...
test_io.py
import numpy as np import pandas as pd import pandas.util.testing as tm import pytest from threading import Lock import threading import dask.array as da import dask.dataframe as dd from dask.dataframe.io.io import _meta_from_array from dask.delayed import Delayed, delayed from dask.utils import tmpfile from dask.l...
recorder_engine.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from threading import Thread from nanomsg import Socket, SUB, PUSH, SUB_SUBSCRIBE, SOL_SOCKET, RCVTIMEO from datetime import datetime, time import os import yaml import json from pathlib import Path from ..api.ctp_constant import THOST_FTDC_PT_Net from ..common.constant imp...
mem_quota_util.py
#!/usr/bin/env python import os, sys PATH, EXECNAME = os.path.split(os.path.abspath(sys.argv[0])) MYD = os.path.abspath(os.path.dirname(__file__)) mkpath = lambda *x: os.path.join(MYD, *x) #globals SAMPLE_QUERY="(select count(*) from (select o0.o_orderkey from (heap_orders o0 left outer join heap_orders o1 on o0.o_o...
train.py
import tensorflow as tf import numpy as np import time import datetime import os import network import json import sys import ctypes import threading export_path = "../data_15k/" word_vec = np.load(export_path + 'vec.npy') f = open(export_path + "config", 'r') config = json.loads(f.read()) f.close() ll = ctypes.cdll...
__init__.py
#!/usr/bin/env python """ Yet Another S3-backed File System, or yas3fs is a FUSE file system that is designed for speed caching data locally and using SNS to notify other nodes for changes that need cache invalidation. """ import urllib import argparse import errno import stat import time import os import os.path imp...
clusterScaler.py
# Copyright (C) 2015-2018 Regents of the University of California # # 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...
scheduler_job.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 #...
config.py
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: # # Copyright 2021 The NiPreps Developers <nipreps@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may...
interactive.py
''' Interactive launcher ==================== .. versionadded:: 1.3.0 .. deprecated:: 1.10.0 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:: T...
test_ClientContext.py
#!/usr/bin/env python3 from mock_decorators import setup, teardown from flask import Flask, request from threading import Thread import socket import select import sys import os @setup('WiFi release ClientContext') def setup_tcpsrv(e): global thread app = Flask(__name__) def run(): global runn...
interface.py
#config.py #Class containing all configuration variables #Used to declutter modules that share config variables import config from config import Config #parser.py import parser from parser import ParseError #trajectory.py #Holds final and initial positions and calculates the interpolation between them from trajectory...
launcher_local.py
#!/usr/bin/env python """ submission script, local machine version """ import argparse import sys import os import signal import subprocess from threading import Thread import signal from loguru import logger from tracker import tracker from tracker.args import parse_args keepalive = """ nrep=0 rc=254 while [ $rc -eq...
__main__.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. """Sets up and starts a Chrome slave.""" import argparse import re import sys import threading # pylint: disable=F0401 from infra.tools.bot_setup.start im...
idf_monitor.py
#!/usr/bin/env python # # esp-idf serial output monitor tool. Does some helpful things: # - Looks up hex addresses in ELF file with addr2line # - Reset ESP32 via serial RTS line (Ctrl-T Ctrl-R) # - Run "make (or idf.py) flash" (Ctrl-T Ctrl-F) # - Run "make (or idf.py) app-flash" (Ctrl-T Ctrl-A) # - If gdbstub output is...
knxd.py
#!/usr/bin/env python import time import socket import logging from threading import Thread from knxpy.util import encode_ga, encode_dpt, encode_data, decode_telegram, default_callback logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) class KNXD(object): KNXWRITE = 0x80 KNXREAD = 0x00 ...
PointCloudViewer.py
""" PosePipelineMaker.py Generates and executes a pipeline to estimate poses """ import numpy as np import time import rospy import numpy as np from shutil import copyfile from libs import * import sys import threading import PointCloudVisualizer import Classes.State as State import CommandLine from open3d import...
corscheck.py
import gevent.monkey gevent.monkey.patch_all() import requests, json, os, inspect, tldextract from future.utils import iteritems try: from urllib.parse import urlparse except Exception as e: from urlparse import urlparse import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) from...
samuri6.py
# -*- coding: utf-8 -*- import LINETCR from LINETCR.lib.curve.ttypes import * from datetime import datetime import time, random, sys, ast, re, os, io, json, subprocess, threading, string, codecs, requests, tweepy, ctypes, urllib, urllib2, wikipedia, goslate import timeit from bs4 import BeautifulSoup from urllib impor...
labels.py
import hashlib import requests import threading import json import sys import traceback import base64 from electrum_pac.plugin import BasePlugin, hook from electrum_pac.crypto import aes_encrypt_with_iv, aes_decrypt_with_iv from electrum_pac.i18n import _ class LabelsPlugin(BasePlugin): def __init__(self, pare...
xystage.py
import time import logging import threading import zmq from zaber.serial import * from collections import OrderedDict class ZaberXYStage: """Class for interfacing the Zaber XY-stage of the irradiation setup at Bonn isochronous cyclotron""" def __init__(self, serial_port='/dev/ttyUSB0'): """ D...
ProcPost.py
# -*- coding: utf-8 -*- ''' Created By: hidura On Date: Oct 13, 2010 ''' import cgi import io import json from multiprocessing import Process, Queue import os import urllib.parse from urllib.parse import unquote class pproc: """This class is building to take the information from the byte.""" def __i...
test_sys.py
from test import support from test.support.script_helper import assert_python_ok, assert_python_failure import builtins import codecs import gc import locale import operator import os import struct import subprocess import sys import sysconfig import test.support import textwrap import unittest import warnings # coun...
main.py
#!/usr/bin/python # -*- coding: utf-8 -*-### # Copyright (2018) Hewlett Packard Enterprise Development LP # # 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/LI...
task_4_client3.py
import socket import threading def read_msg(): while True: data = conn.recv(1024) print(data.decode("utf-8")) def send_msg(): conn.sendto(("["+nickname+"]" + msg).encode("utf-8"), server) conn = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) server = "127.0.0.1", 5667 nickname = input("Write...
thermald.py
#!/usr/bin/env python3 import datetime import os import queue import threading import time from collections import OrderedDict, namedtuple from pathlib import Path from typing import Dict, Optional, Tuple import psutil import cereal.messaging as messaging from cereal import log from common.dict_helpers import strip_d...
s3.py
""" Object Store plugin for the Amazon Simple Storage Service (S3) """ import logging import multiprocessing import os import shutil import subprocess import threading import time from datetime import datetime try: # Imports are done this way to allow objectstore code to be used outside of Galaxy. import boto ...
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...
test_postgresql.py
import datetime import os import psutil import psycopg2 import re import subprocess import time from mock import Mock, MagicMock, PropertyMock, patch, mock_open from patroni.async_executor import CriticalTask from patroni.dcs import Cluster, RemoteMember, SyncState from patroni.exceptions import PostgresConnectionExce...
Demo_Multithreaded_Long_Task_Simple.py
#!/usr/bin/python3 import threading import time import PySimpleGUI as sg """ DESIGN PATTERN - Multithreaded Long Tasks GUI using shared global variables Presents one method for running long-running operations in a PySimpleGUI environment. The PySimpleGUI code, and thus the underlying GUI framework, ru...
remote_controller.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- # Author: i2cy(i2cy@outlook.com) # Filename: remote_controller # Created on: 2020/9/17 """ WARNING: INTERNAL NETWORK USE ONLY WARNING: INTERNAL NETWORK USE ONLY WARNING: INTERNAL NETWORK USE ONLY """ import socket import time import os import threading LI...
hikvision.py
""" pyhik.hikvision ~~~~~~~~~~~~~~~~~~~~ Provides api for Hikvision events Copyright (c) 2016-2021 John Mihalic <https://github.com/mezz64> Licensed under the MIT license. Based on the following api documentation: System: http://oversea-download.hikvision.com/uploadfile/Leaflet/ISAPI/HIKVISION%20ISAPI_2.0-IPMD%20Servi...
autowalker.py
import threading import time from g_python.hdirection import Direction from g_python.hmessage import HMessage from g_python.hparsers import HEntityType, HPoint from g_python.hunityparsers import HUnityEntity, HUnityStatus ADD_TILES_COMMAND = '!addtiles' STOP_ADD_COMMAND = '!stopadd' WALK_INTERVAL_COMMAND = '!walkint...
ssyoutube.py
#!/usr/bin/env python from __future__ import unicode_literals import file_queue import os import web import string from time import sleep from threading import Thread from youtube_dl import YoutubeDL from youtube_dl.utils import sanitize_path, compat_str q = file_queue.FileQueue('videos_to_dl') allowed_chars = unico...
ssd_model.py
# coding=utf-8 # Copyright 2020 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
test_replica_set_client.py
# Copyright 2011-2012 10gen, 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,...
test3.py
import cv2 import requests,json import threading,time def save_picture(): cap=cv2.VideoCapture(0) cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc('H', '2', '6', '4')); cap.set(cv2.CAP_PROP_FPS, 60) if not cap.isOpened(): return ret,frame=cap.read() return frame def POST(Data): ...
roomba.py
from __future__ import division # @modified 20191115 - Branch #3262: py3 # from os import kill, getpid from os import kill from redis import StrictRedis, WatchError from multiprocessing import Process from threading import Thread from msgpack import Unpacker, packb try: from types import TupleType except ImportErr...
Utils.py
# # Cython -- Things that don't belong # anywhere else in particular # from __future__ import absolute_import try: from __builtin__ import basestring except ImportError: basestring = str try: FileNotFoundError except NameError: FileNotFoundError = OSError import os import sys import re ...
worker.py
#!/usr/bin/env python # encoding: utf-8 """ @author: Shanda Lau 刘祥德 @license: (C) Copyright 2019-now, Node Supply Chain Manager Corporation Limited. @contact: shandalaulv@gmail.com @software: @file: worker.py @time: 2020/8/15 09:54 @version 1.0 @desc: """ # coding=utf-8 # Created by Meteorix at 2019/7/13 import logg...
sl.py
import os import re from concurrent.futures import ProcessPoolExecutor, as_completed from datetime import datetime from logging import getLogger from threading import Thread from time import time import chess.pgn from blackqueen.agent.player_chess import ChessPlayer from blackqueen.config import Config from blackquee...
mputils.py
# encoding: utf-8 """ *General multiprocessing utilities file.* :Author: Ken W. Smith """ # 2013-07-31 KWS Allow overriding of number of processors (e.g. to use less than the CPU count) # 2018-10-01 KWS Completely rewrote this function. We can now split the list # in round robin manner or preserve ...
main.py
from subprocess import Popen, PIPE from threading import Thread from queue import Queue, Empty import atexit import os import sys agent_processes = [None, None] t = None q = None def cleanup_process(): global agent_processes for proc in agent_processes: if proc is not None: proc.kill() def...
Chap10_Example10.3.py
from threading import * def my_msgprint(): print("The above line is executed by: ", current_thread().getName()) print("Main Thread creating child object") mthread = Thread(target = my_msgprint, name = 'MyChildThread') print("Main Thread starting child thread") mthread.start()
main.py
import module_qrcode as qr from flask import Flask,render_template,redirect, url_for,render_template from colorama import Fore,init from PIL import Image import pathlib , os ,time,json,json from threading import Thread from pyngrok import ngrok init() fichier = os.path.join('static', 'image') app = Flask...
exchange_rate.py
from datetime import datetime import inspect import requests import sys from threading import Thread import time import csv from decimal import Decimal from .bitcoin import COIN from .i18n import _ from .util import PrintError, ThreadJob # See https://en.wikipedia.org/wiki/ISO_4217 CCY_PRECISIONS = {} ''' {'BHD': 3,...
dataserver.py
#!/usr/bin/env python1 import sys, os import traceback from os.path import join as pjoin import shutil import signal import socket import time import datetime from datetime import timedelta import argparse import random import queue import heapq from queue import PriorityQueue, Queue import multiprocessing from functoo...
master.py
import os import threading import time import math import pdb import copy import logging import numpy as np from hpbandster.core.dispatcher import Dispatcher from hpbandster.core.result import Result from hpbandster.core.base_iteration import WarmStartIteration class Master(object): def __init__(self, run_id...
utils.py
import os import time from functools import wraps from picktrue.logger import pk_logger from threading import Thread def run_as_thread(func, *args, name=None, **kwargs): if name is None: name = func.__name__ t = Thread(target=func, args=args, kwargs=kwargs, name=name) t.setDaemon(True) t.sta...
base.py
import hashlib import httplib import os import threading import traceback import socket import urlparse from abc import ABCMeta, abstractmethod from ..testrunner import Stop from protocol import Protocol, BaseProtocolPart here = os.path.split(__file__)[0] # Extra timeout to use after internal test timeout at which t...
start_lambda_api_integ_base.py
import signal from unittest import TestCase, skipIf import threading from subprocess import Popen import time import os import random from pathlib import Path from tests.testing_utils import SKIP_DOCKER_TESTS, SKIP_DOCKER_MESSAGE @skipIf(SKIP_DOCKER_TESTS, SKIP_DOCKER_MESSAGE) class StartLambdaIntegBaseClass(TestCa...
licenseversion.py
#!/usr/bin/python ## Binary Analysis Tool ## Copyright 2011-2016 Armijn Hemel for Tjaldur Software Governance Solutions ## Licensed under Apache 2.0, see LICENSE file for details import os, os.path, sys, subprocess, copy, cPickle, Queue import multiprocessing, re, datetime from multiprocessing import Process, Lock fr...
libs.py
import threading def create_thread(func, *args, **kwargs): thread = threading.Thread(target=func, args=args, kwargs=kwargs) thread.daemon = True thread.start() def run_thread(func): def f(*args, **kwargs): create_thread(func, *args, **kwargs) return f
hl7_bridge.py
# Copyright 2019 Open Source Robotics Foundation, 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...
train.py
''' ## Train ## # Code to train D4PG Network on OpenAI Gym environments @author: Mark Sinton (msinto93@gmail.com) ''' import threading import random import tensorflow as tf import numpy as np from params import train_params from prioritised_experience_replay import PrioritizedReplayBuffer from gaussian_n...
graphene_metanode_server.py
##!/usr/bin/env python # DISABLE SELECT PYLINT TESTS # pylint: disable=bad-continuation, too-many-locals, broad-except, too-many-statements # pylint: disable=too-many-arguments, too-many-branches r""" ╔════════════════════════════════════════════════════╗ ║ ╔═╗╦═╗╔═╗╔═╗╦ ╦╔═╗╔╗╔╔═╗ ╔╦╗╔═╗╔╦╗╔═╗╔╗╔╔═╗╔╦╗╔═╗ ║ ║ ║ ╦╠...
connection.py
import sched from threading import Thread from collections import defaultdict import websocket import logging import time import json class Connection(Thread): def __init__(self, event_handler, url, reconnect_handler=None, log_level=None, daemon=True, reconnect_interval=10, socket_kwargs=None, **...
multi_proxy_server.py
#!/usr/bin/env python3 import socket,time,sys from multiprocessing import Process HOST = "" PORT = 8001 BUFFER_SIZE = 1024 def main(): extern_host = "www.google.com" extern_port = 80 #create socket with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as proxy_start: print("Starting proxy server") #a...
fuzzer.py
#! /usr/bin/python import requests from urllib.parse import urljoin import time import threading import multiprocessing import os import sys import colors class Fuzzer(object): """fuzzObj = Fuzzer(base_url='http://sample-site', thread_num=10, fuzz_file_path='fuzz_url.txt')""" def __...
wikisourcetext.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ This bot applies to wikisource sites to upload text. Text is uploaded to pages in Page ns, for a specified Index. Text to be stored, if the page is not-existing, is preloaded from the file used to create the Index page, making the upload feature independent from the forma...
power_monitoring.py
import random import threading import time from statistics import mean from typing import Optional from cereal import log from common.params import Params, put_nonblocking from common.realtime import sec_since_boot from selfdrive.hardware import HARDWARE from selfdrive.swaglog import cloudlog from selfdrive.statsd imp...
pySuakeSavedVersion1.py
import time import curses import threading import sys import random #import pygame SCORE_FOR_GOODY = 100 def thread_function(screen): global bstop global ch global bgameover global screen2 chOld = ch while bstop: chOld = ch ch = screen2.getch() if ch == ord('q'): break ...
mem.py
"Utility functions for memory management" from ..imports.torch import * from ..core import * from ..script import * from ..utils.env import * import functools, traceback, threading, time from .pynvml_gate import * from collections import namedtuple IS_IN_IPYTHON = is_in_ipython() is_osx = platform.system() == "Darwin...
server.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # IkaLog # ====== # Copyright (C) 2015 Takeshi HASEGAWA # # 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/l...
AutoBot.py
from pynput.mouse import Listener import pyautogui import re import threading import threading as Thread from threading import Thread from time import sleep import time import os t = 0 ti2 = 0 key1 = '' ti1 = 0 time2 = 0 current_t1 = 0 current = [] mouse_list = [] key_list = [] after = 0 before = 0 def on_click(x, y...
Get_Partitions_Frm_Range.py
from threading import Thread def Partitions(n): partitions_of = [] partitions_of.append([()]) partitions_of.append([(1,)]) for num in range(2, n+1): ptitions = set() for i in range(num): for partition in partitions_of[i]: ptitions.add(tuple(sorted((...
countdown.py
import random import itertools import msvcrt import threading import time from os import system import unittest def select_characters(): """Returns a string of selected characters from the lists of vowels and consonants depanding on the user input.""" #lists with probability weighting for each elem...
igniter.py
import logging import queue import time from datetime import datetime from threading import Thread, get_ident import requests from cromwell_tools.cromwell_api import CromwellAPI from falcon import queue_handler from falcon import settings logging.basicConfig(level=logging.INFO) logger = logging.getLogger(f'falcon.{_...
hi.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(2021, 10, 10) #expirydate = datetime.date(2021, 8, 30) today=date.today() def hero(...
athena.py
#********************************************************************** # Copyright 2020 Advanced Micro Devices, 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.o...
ros_executor.py
from multiprocessing import Process import rospy from erdos.executor import Executor from erdos.ros.ros_input_data_stream import ROSInputDataStream from erdos.ros.ros_output_data_stream import ROSOutputDataStream class ROSExecutor(Executor): """Class wrapping the common logic for starting ROS operators. ...
venv_builder.py
# # Copyright (C) 2013-2020 Vinay Sajip. New BSD License. # import os import os.path from subprocess import Popen, PIPE import sys from threading import Thread from urllib.parse import urlparse from urllib.request import urlretrieve import venv class ExtendedEnvBuilder(venv.EnvBuilder): """ This builder insta...
dynamic_secret_rotation_db_conn.py
# -*- coding: utf-8 -* import logging import threading import mysql.connector from __future__ import absolute_import from ssm.requester import Error, LoopTimer, get_current_account from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException class Config(object): u"""完整配置信息类,包括数据...
CoExpressionServer.py
#!/usr/bin/env python from wsgiref.simple_server import make_server import sys import json import traceback from multiprocessing import Process from getopt import getopt, GetoptError from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\ JSONRPCError, ServerError, InvalidRequestError from os imp...
xla_client_test.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...
mqtt_broker.py
import socket, sys, time from threading import Thread from .mqtt import MQTT_decoder from .mqtt import MQTT_database from .mqtt.MQTT_packet_handler import packet_router from .mqtt.MQTT_control_packets import PUBLISH HOST = "127.0.0.1" PORT = 1883 connected_clients = [] def run_server(): print('\u001b[31m' +f'MQ...
server.py
from websocket_server import WebsocketServer import time,random import threading import json # send the path data to the client # modify this function def send_path_data_to_client(client): path_locations = [(3,4),(4,5)] # get it from your generated code json_data = {"data_type":"path_data","data":path_locations} ...
seq_attack.py
import argparse import logging import multiprocessing import time import pysmt.shortcuts as pystm from common.circuit import sort_circuits from file.bench import bench2circuit from sat.attack_comps import FormulaGenerator, get_formulas from common.utils import logo, execution_time def main(config): logo() par...
follow_waypoints.py
#!/usr/bin/env python import threading import rospy import actionlib from smach import State,StateMachine from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal from geometry_msgs.msg import PoseWithCovarianceStamped, PoseArray ,PointStamped from std_msgs.msg import Empty , Int8 from tf import TransformListener i...
multipartuploadufile.py
# -*- coding: utf-8 -*- import os import json from .baseufile import BaseUFile from .util import _check_dict, initialsharding_url, finishsharding_url, shardingupload_url, _file_iter, mimetype_from_file, mimetype_from_buffer from .httprequest import ResponseInfo, _initialsharding, _finishsharding, _shardingupload from...
858ee61457a474c1136a9b6312604ee8afdd0d70router2req.py
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2013 ASMlover. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright #...
SentenceTransformer.py
import json import logging import os import shutil from collections import OrderedDict from typing import List, Dict, Tuple, Iterable, Type, Union, Callable from zipfile import ZipFile import requests import numpy as np from numpy import ndarray import transformers import torch from torch import nn, Tensor, device from...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcore client # Copyright (C) 2012 thomasv@gitorious # # 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 witho...
data_server.py
import os import time import socket import logging import asyncio from hashlib import md5 from threading import Thread __all__ = ['get_data_server'] def get_data_server(verbose=False): """ This starts up a tornado server and returns a handle to a DataServer object which can be used to register files to ...
test_smtplib.py
import base64 import email.mime.text from email.message import EmailMessage from email.base64mime import body_encode as encode_base64 import email.utils import hashlib import hmac import socket import smtplib import io import re import sys import time import select import errno import textwrap import threading import ...