source
stringlengths
3
86
python
stringlengths
75
1.04M
test_enum.py
import enum import cosmo import inspect import pydoc import unittest from collections import OrderedDict from enum import Enum, IntEnum, EnumMeta, Flag, IntFlag, unique, auto from io import StringIO from pickle import dumps, loads, PicklingError, HIGHEST_PROTOCOL from test import support try: import _thread imp...
lfimap.py
#!/usr/bin/env python3 import os import sys import re import socket import subprocess import time import random import argparse import requests import requests.exceptions import threading import http.client import http.server import socketserver import traceback import errno import fileinput from contextlib import cl...
start_node.py
import asyncio import logging import sys from urllib.request import urlopen from functools import partial from secp256k1_zkp import PrivateKey, PublicKey from leer.syncer import Syncer from leer.transport.network_manager import NM_launcher from leer.rpc.rpc_manager import RPCM_launcher from leer.core.core_loop import...
cv_racer.py
""" Script to drive a keras TF model with the Virtual Race Environment. Usage: cv_racer.py (--host=<ip_address>) (--name=<car_name>) Options: -h --help Show this screen. """ import os import numpy as np import json import time from io import BytesIO import base64 import re import socket import sele...
jobs.py
# -*- coding: utf-8 -* from micro import config import threading import schedule import logging import time import re ## # Schedule def repeat(args, thread=False): def decorator(handle): every = args["every"] if every == "day": scheduler = schedule.every().day elif every...
main.py
#!/usr/bin/python from bottle import get,request, route, run, static_file,template import time, threading from neopixel import * # LED strip configuration: LED_COUNT = 4 # Number of LED pixels. LED_PIN = 18 # GPIO pin connected to the pixels (must support PWM!). LED_FREQ_HZ = 800000 # LED...
tui.py
import curses import sys import npyscreen from threading import Thread from typing import List, Optional from psy import network from psy.client import Client, Contact from psy.client.config import bus from psy.client.user import User from psy.client.message import Message from psy.client.ui import Contacts, Message...
base_crash_reporter.py
# Electrum - lightweight Bitcoin client # # 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, # publish...
watson.py
#!/usr/bin/env python3 """Script for Tkinter GUI chat client.""" from socket import AF_INET, socket, SOCK_STREAM from threading import Thread import tkinter def receive(): """Handles receiving of messages.""" while True: try: msg = client_socket.recv(BUFSIZ).decode("utf8") msg_...
test_unix_events.py
"""Tests for unix_events.py.""" import collections import contextlib import errno import io import os import pathlib import signal import socket import stat import sys import tempfile import threading import unittest from unittest import mock from test import support if sys.platform == 'win32': raise unittest.Ski...
ListenThread.py
import json.decoder as decoder_json import socket from Server.models.business.ConnectedClientThread import ConnectedClientThread class ListenThread: def __init__(self): self.__socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) with open("config.conf", 'r') as content_file: dec...
ExtractTagsFromOSChina.py
#coding=utf-8 # 如果需要使用北大pkuseg分词,通过如下命令安装python包 # !pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pkuseg """ 数据预处理功能 根据现有的数据,从开源中国的标签库取得IT相关的标签,更新到原有数据行的新字段 0)从Greenplum读取所有的datarow 1) source: datarow + 文本文件(content)path:~/minio/source/xxxx.txt 2)根据文章内容取得一个关键字集合 3)根据关键字集合和开源中国标签库筛选出一个IT相关的标签集合 4) 插入这个标签集合结果到...
GUI_queues_put_get_loop.py
''' May 2017 @author: Burkhard A. Meier ''' #====================== # imports #====================== import tkinter as tk from tkinter import ttk from tkinter import scrolledtext from tkinter import Menu from tkinter import messagebox as msg from tkinter import Spinbox from time import sleep import Ch04_Code...
havocbot_roll.py
#!/havocbot import logging import random from random import choice import threading import time from havocbot.exceptions import FormattedMessageNotSentError from havocbot.message import FormattedMessage from havocbot.plugin import HavocBotPlugin, Trigger, Usage from havocbot.user import UserDoesNotExist logger = logg...
test_notifier.py
#!/usr/bin/env python # coding: utf-8 from collections import Counter from http.server import HTTPServer, BaseHTTPRequestHandler from itertools import count import json import logging from math import sqrt from socketserver import ThreadingMixIn from typing import List, Tuple, Optional from unittest import mock import...
_reloader.py
"""Hot Reload Logic.""" # This code was copied from the werkzeug project # Project: https://palletsprojects.com/p/werkzeug/ # # Original License # Copyright 2007 Pallets # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: #...
recorder.py
import datetime import logging import os from threading import Thread import cv2 from lib.cleanup import SegmentCleanup from lib.helpers import draw_objects from lib.mqtt.camera import MQTTCamera from lib.segments import Segments LOGGER = logging.getLogger(__name__) class FFMPEGRecorder: def __init__(self, con...
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...
chooser.py
import argparse try: import Tkinter except ImportError: import tkinter as Tkinter import yaml import os import subprocess import re import time import threading if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument( "--configpath", type=str, default=os.path.join(os.path.dirname(os...
test_multiprocess.py
# -*- coding: utf-8 -*- # ---------------------------------------------------------------------------- # Copyright (c) 2005-2021, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is...
main.py
import threading import time import bs4 import requests import StellarPlayer import re import urllib.parse cilixiong_home = 'https://www.cilixiong.com/' def concatUrl(url1, url2): if url2.startswith('http'): return url2 splits = re.split(r'/+',url1) url = splits[0] + '//' if url2.startswith('/...
dev_test_cex_subscribe.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # File: dev_test_cex_subscribe.py # # Part of ‘UNICORN Binance WebSocket API’ # Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api # Documentation: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api # PyPI: https://py...
example_test.py
import re import os import socket import BaseHTTPServer import SimpleHTTPServer from threading import Thread import ssl from tiny_test_fw import DUT import ttfw_idf import random import subprocess server_cert = "-----BEGIN CERTIFICATE-----\n" \ "MIIDXTCCAkWgAwIBAgIJAP4LF7E72HakMA0GCSqGSIb3DQEBCwUAMEUxCz...
test021.py
import webview import threading import time ''' This example demonstrates how to change a window title. ''' def change_title(): """changes title every 3 seconds""" for i in range(1, 100): time.sleep(3) webview.set_title("New Title #{}".format(i)) if __name__ == '__main__': t = threading...
tfpub.py
#!/usr/bin/env python import roslib from geometry_msgs.msg import Pose from geometry_msgs.msg import PoseStamped from nav_msgs.msg import Odometry from sensor_msgs.msg import PointCloud2 as pc2 import rospy import tf import cv2 import threading import numpy as np br = tf.TransformBroadcaster() ugv_pose = [0,0,0...
vayyar_plotter.py
from pathlib import Path from dataclasses import dataclass from threading import Thread from live_plotter import LivePlotter from post_plotter import PostPlotter @dataclass(unsafe_hash=True) class Config: live_monitor: bool = False weldcloud_overlay: bool = False weldcloud_data: Path = Path("data/weldcl...
callbacks_test.py
# Copyright 2016 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...
run_plots.py
import os import sys import threading def run_command(version,command): os.system('python{version} {command}'.format(version=version, command=command)) if __name__ == '__main__': version = "3" threading.Thread(target=run_command, args=(version,"plot_altitude.py")).start() threading.Thread(target=run...
test_concurrent_futures.py
import sys import test.support if sys.platform != 'uwp': # Skip tests if _multiprocessing wasn't built. test.support.import_module('_multiprocessing') # Skip tests if sem_open implementation is broken. test.support.import_module('multiprocessing.synchronize') _have_multiprocessing = True else: ...
util.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without...
broadcast_scheduler.py
# Copyright 2018 ICON Foundation # # 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 writi...
scrapy.py
##### # YourName .~= ruichao zhang =~. ### import urllib import re import requests from pattern import web import pandas as pd from bs4 import BeautifulSoup import networkx as nx import timeit import sys import multiprocessing import threading import math import os import Queue import time import logging NumErr = ...
problems.py
import random from abc import ABCMeta, abstractmethod from collections import namedtuple from multiprocessing import Process from pathlib import Path from multiprocessing import Queue from typing import List, Tuple, Dict, Union from sympy.parsing.sympy_parser import parse_expr from pythovolve.plotting import TSPPlot,...
connection.py
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the...
__init__.py
from __future__ import print_function import argparse import io import itertools import json import os import random import re import shlex import string import sys import traceback import warnings from collections import OrderedDict from fnmatch import fnmatchcase from subprocess import list2cmdline from threading im...
async_worker.py
""" opbeat.contrib.async_worker ~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2011-2012 Opbeat Large portions are :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import logging import os import time from threading import Lock, Thread from opbeat.u...
test_pipe.py
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the ...
test_loadtable.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2021 4Paradigm # # 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 ...
reactor.py
# Copyright 2019 Nativepython 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 applicable law or a...
screen_state_observer.py
import multiprocessing as mp import logging import threading import time import Foundation import AppKit from PyObjCTools import AppHelper import setproctitle from main_loop import start_main_loop from common_utils import kill_main_loop_recursive, get_process_id, pkill from volume_utils import restore_volume class ...
thermos_observer.py
# # 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, software # distributed under ...
spotifyAccount.py
import platform import random import string import threading import request import time from os import system if platform.system() == "Linux": title = "Linux" elif platform.system() == "Windows": title = "Windows" else: title = "Mac OsX" def setRandomName(size=10, chars=string.ascii_letters + string.digi...
multi_threading.py
"""Main program for experimenting with multi threading""" import time import threading def calc_square(numbers): print("Calculate square numbers: ") for i in numbers: time.sleep(2) # artificial time-delay print(str(i), ' power of 2: ', str(i * i)) def calc_cube(numbers): print("Calcula...
multi_process_runner_test.py
# Copyright 2019 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...
server.py
''' The main server script which will recieve and handel requests ''' import os import socket import threading from decouple import config class Client: ''' A client object to handel multithreading ''' global client_list def __init__(self, conn, addr): ''' Sets up the client and...
utils.py
# coding: utf-8 # This file is a part of VK4XMPP transport # © simpleApps, 2014. """ Contains useful functions which used across the modules """ import threading import time import xmpp import urllib from socket import error from writer import * isNumber = lambda obj: (not execute(int, (obj,), False) is None) def ...
example1.py
from queue import Queue from threading import Thread import time _sentinel = object() # A thread that produces data def producer(out_q): n = 10 while n > 0: # Produce some data out_q.put(n) time.sleep(2) n -= 1 # Put the sentinel on the queue to indicate completion ou...
runner.py
#!/usr/bin/env python2 # Copyright 2010 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. """This is the Emscripten test runner. To run ...
examples_bg_keywords.py
import os from datetime import datetime from threading import Thread, Event from time import sleep from typing import Dict, AnyStr, Tuple import logging.handlers from threading import currentThread from robot.api.deco import keyword from robot.libraries.BuiltIn import BuiltIn from robotbackground_custom_logger import...
ircbot.py
#!/usr/bin/env python3 """IRC bot for doing stupid stuff and sometimes handling commands for account creation.""" import argparse import collections import functools import getpass import pkgutil import re import ssl import threading import time from configparser import ConfigParser from datetime import date import ir...
exact-counting_pcap-pedrostream_trace-multi.py
#!/usr/bin/env python2.7 from multiprocessing import Process import numbers from operator import itemgetter import math import xxhash_cffi as xxhash import socket import numpy as np import sys import numpy from scipy import stats import dpkt import time import argparse from datetime import datetime import os MIN_RAN...
test.py
import json import random import re import string import threading import time from multiprocessing.dummy import Pool import pytest from helpers.client import QueryRuntimeException from helpers.cluster import ClickHouseCluster cluster = ClickHouseCluster(__file__) node1 = cluster.add_instance('node1', ...
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...
mvc1_5g_orc8r_deployment_script.py
#!/usr/bin/env python3 """ Copyright 2020 The Magma Authors. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BAS...
mqueue.py
import io from queue import Queue, SimpleQueue, Empty import threading class MQueuePool(object): def __init__(self): self.with_new_dat = set() self.e = threading.Event() self.lock = threading.Lock() def get_queue(self, block=True, timeout=None): with self.lock: if s...
test_bridge.py
# Copyright 2020 The FedLearner 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...
ntlmrelayx.py
#!/usr/bin/env python # Copyright (c) 2013-2016 CORE Security Technologies # # This software is provided under under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # # Generic NTLM Relay Module # # Authors: # Alberto Solino (@agsolino) # Dirk-ja...
generate_forward_simulations_fault_2ms_line_validate.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat May 4 13:38:15 2019 @author: bmoseley """ import shutil import sys import numpy as np import multiprocessing, queue import time sys.path.insert(0, '../shared_modules/') import io_utils from helper import run_command ### TODO: # # Consider writing ...
test_local_task_job.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...
ctfd.py
import os import re import threading import yaml import json # Initialize ctfcli with the CTFD_TOKEN and CTFD_URL. def init(): CTFD_TOKEN = os.getenv("CTFD_TOKEN", default=None) CTFD_URL = os.getenv("CTFD_URL", default=None) if not CTFD_TOKEN or not CTFD_URL: exit(1) os.system(f"echo '{CTFD_U...
main.py
#! /usr/bin/python3 # -*- coding: utf-8 -*- # This is the main program #Ricardos.geral@gmail.com import os import datetime import time from time import sleep import threading import py3nextion_lib as nxlib # simple python3 library to use nextion device import nextionApp as nxApp # initialization of the comp...
hd_addresses.py
from shadowlands.sl_dapp import SLDapp, SLFrame from shadowlands.tui.debug import debug from shadowlands.credstick import DeriveCredstickAddressError import threading from time import sleep import pdb class HDAddressPicker(SLDapp): def initialize(self): self.show_wait_frame() threading.Thread(targ...
test_utils.py
# Copyright 2020 Google LLC # # 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, s...
controllers.py
import os from flask import Flask, request, Response from flask import render_template, url_for, redirect, send_from_directory from flask import send_file, make_response, abort import mpylayer from os import listdir,getcwd from os.path import isfile,join, islink import json import subprocess, time import pdb import th...
quorum-queue-test.py
#!/usr/bin/env python import pika import sys import time import datetime import subprocess import random import threading import requests import json from command_args import get_args, get_mandatory_arg, get_optional_arg, is_true, get_optional_arg_validated from RabbitPublisher import RabbitPublisher from MultiTopicCo...
bcp_server.py
"""BCP Server interface for the MPF Media Controller""" import logging import queue import socket import sys import threading import time import traceback import select import mpf.core.bcp.bcp_socket_client as bcp class BCPServer(threading.Thread): """Parent class for the BCP Server thread. Args: ...
brain_control_interface_gen3.py
#!/usr/bin/env python import time import math import rospy import socket import threading import actionlib import select import tf import PyKDL from tf_conversions import posemath from brain_control.msg import brain_control_msg from geometry_msgs.msg import PoseStamped from geometry_msgs.msg import Pose from kortex_dr...
ecp.py
#!/usr/bin/env python # coding=utf-8 import time import threading import random TIMEOUT = 2 def consumer(event, l): t = threading.current_thread() while 1: event_is_set = event.wait(TIMEOUT) if event_is_set: try: print '{} poped from list by {}'.format(l.pop(), t....
scylla-artifacts.py
#!/usr/bin/python import os import re import logging import threading import datetime from pkg_resources import parse_version try: from check_version import CheckVersionDB except: # Avocado may not copy check_version.py to VM print "failed to import CheckVersionDB" from avocado import Test from avocado im...
ddos.py
import requests import sys from multiprocessing import Process, Queue, cpu_count from threading import Thread from proxy_manager import ProxyManager import socket import time MAX_THREADS = 100 def spin_threads(target_ip, port, proxy_queue, abort_queue): print('spinning threads') threads = [None for i in rang...
helpers.py
""" Helper functions file for OCS QE """ import base64 import datetime import hashlib import json import logging import os import re import statistics import tempfile import threading import time import inspect from concurrent.futures import ThreadPoolExecutor from subprocess import PIPE, TimeoutExpired, run from uuid ...
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...
helpers.py
""" Helper functions file for OCS QE """ import base64 import random import datetime import hashlib import json import logging import os import re import statistics import tempfile import threading import time import inspect from concurrent.futures import ThreadPoolExecutor from itertools import cycle from subprocess i...
pyusb_v2_backend.py
# pyOCD debugger # Copyright (c) 2019 Arm Limited # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
debug.py
# -*- coding: utf-8 -*- """ debug.py - Functions to aid in debugging Copyright 2010 Luke Campagnola Distributed under MIT/X11 license. See license.txt for more information. """ from __future__ import print_function import sys, traceback, time, gc, re, types, weakref, inspect, os, cProfile, threading from . import p...
closure_etl.py
"""Closure ETL.""" import logging import multiprocessing from etl import ETL from transactors import CSVTransactor from transactors import Neo4jTransactor from .helpers import Neo4jHelper class ClosureETL(ETL): """Clojure ETL.""" logger = logging.getLogger(__name__) insert_isa_partof_closure_query_tem...
collect_server_info.py
#!/usr/bin/env python import getopt import sys import os import time from threading import Thread from datetime import datetime import subprocess import platform sys.path = [".", "lib"] + sys.path from testconstants import WIN_COUCHBASE_BIN_PATH_RAW import TestInput def usage(error=None): print("""\ Syntax: coll...
HOODIE.py
#!/bin/sh #import import socket import threading import pyfiglet from pyfiglet import Figlet import os #clear screen os.system('cls' if os.name == 'nt' else 'clear') #aTAG LINE print('''\033[5;34;40m _____ _____ ...
test_functional.py
# mypy: allow-untyped-defs try: from importlib import reload except ImportError: pass import json import os import queue import tempfile import threading import pytest from . import serve from wptserve import logger class ServerProcSpy(serve.ServerProc): instances = None def start(self, *args, **k...
Dataloader_for_AM_v2_old.py
#!/usr/bin/python import kaldi_io import sys import os from os.path import join, isdir from numpy.random import permutation import itertools import keras import numpy as np from keras.preprocessing.sequence import pad_sequences import queue from threading import Thread import random import glob import sys sys.path.i...
Internet.py
import os import shutil from threading import Thread import urllib import requests from tqdm import tqdm class Internet: @staticmethod def write_to_failed_image_urls_file(file_name, image_url, failed_image_urls_file): """ Check image in file and write it if need :param file_name: image...
arduino_data.py
import serial import threading import csv class ArduinoData: def __init__(self): self.arduino_data = "" try: self.arduinoSerialData = serial.Serial('com3', 9600) #9600 is the Baudrate read_thread = threading.Thread(target=self.start_reading_data) read_thread...
test_api.py
# ---------------------------------------------------------------------------- # Copyright 2016-2017 ARM 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...
_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 ...
test_creator.py
from __future__ import absolute_import, unicode_literals import difflib import gc import logging import os import stat import subprocess import sys from itertools import product from threading import Thread import pytest import six from virtualenv.__main__ import run from virtualenv.create.creator import DEBUG_SCRIP...
odarun.py
import requests import time import sys from subprocess import PIPE, Popen, STDOUT from threading import Thread from queue import Queue, Empty import os import re class UnsupportedCallType(Exception): pass def run(w, timeout): print("run this", w) if w['base']['call_type'] == "http://odahub.io/ontology#...
test_cache.py
# This file is part of the MapProxy project. # Copyright (C) 2010 Omniscale <http://omniscale.de> # # 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...
spatial.py
## dea_spatialtools.py ''' Description: This file contains a set of python functions for conducting spatial analyses on Digital Earth Australia data. License: The code in this notebook is licensed under the Apache License, Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0). Digital Earth Australia data is li...
test_serialization.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...
wclient.py
""" UDP Client 2019.10.28 """ import socket import threading import tkinter as tk from my_aes import PrpCrypt class Client_wzk(object): def __init__(self, mytop): self.top = mytop self.ip_entry = tk.Entry(self.top, width=80) self.port_entry = tk.Entry(self.top, width=80) self.pas...
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...
mash.py
#!/usr/bin/env python3 from olctools.accessoryFunctions.accessoryFunctions import make_path, GenObject, run_subprocess, write_to_logfile from click import progressbar from threading import Thread from queue import Queue import logging import os __author__ = 'adamkoziol' class Mash(object): def sketching(self): ...
pydoc.py
#!/usr/bin/env python # -*- coding: Latin-1 -*- """Generate Python documentation in HTML or text for interactive use. In the Python interpreter, do "from pydoc import help" to provide online help. Calling help(thing) on a Python object documents the object. Or, at the shell command line outside of Python: Run "pydo...
net.py
import sys import socket import getopt import threading import subprocess listen = False command = False update = False execute = "" target = "" upload_destination = "" port = 0 def usage(): print "Net Tool" print print "netool.py -t target_host -p port" print " -l --listen" print " -e --execu...
obs.py
from flask import Blueprint, request, jsonify import os import time from obswebsocket import obsws, requests import threading obs = Blueprint('obs', __name__, url_prefix='/obs') host = "localhost" port = 4444 ws = obsws(host, port) def connect_thread(): while True: try: ws.connect() ...
utils.py
from bitcoin.core import COIN # type: ignore from bitcoin.rpc import RawProxy as BitcoinProxy # type: ignore from bitcoin.rpc import JSONRPCError from contextlib import contextmanager from pathlib import Path from pyln.client import RpcError from pyln.testing.btcproxy import BitcoinRpcProxy from collections import Or...
multiprocess_iterator.py
from __future__ import division from collections import namedtuple import multiprocessing from multiprocessing import sharedctypes import signal import sys import threading import warnings import numpy import six from chainer.dataset import iterator _response_time = 1. _short_time = 0.001 _PrefetchState = namedtupl...
app.py
import logging import threading from datetime import datetime from astropy import units as u from astropy.coordinates import solar_system_ephemeris, SkyCoord, get_body, Angle from astropy.time import Time from fastapi import FastAPI, Request from fastapi.responses import HTMLResponse from fastapi.templating i...
test_gil_scoped.py
import multiprocessing import threading from pybind11_tests import gil_scoped as m def _run_in_process(target, *args, **kwargs): """Runs target in process and returns its exitcode after 10s (None if still alive).""" process = multiprocessing.Process(target=target, args=args, kwargs=kwargs) process.daemon...
env.py
import gym from multiprocessing import Process, Pipe from gym_minigrid.minigrid import * from gym_minigrid.envs import DistShiftEnv import numpy as np import torch class StochasticDistShiftEnv(DistShiftEnv): """ Stochastic Distributional shift environment. """ class RestrictedActions(IntEnum): ...