source
stringlengths
3
86
python
stringlengths
75
1.04M
facelook_photo_management.py
##Main program ## Before running this program, you need to have functional aws cli and boto3 installed. ##^^^^^^ ##Author: AI_Papa (matthew.tsoi@gmail.com) ##Import AWS client modules import boto3 from botocore.exceptions import ClientError ##Import modules for multi-thread and general OS utilities import logging,...
conftest.py
# -*- coding: utf-8 -*- # Copyright: (c) 2021, Jordan Borean (@jborean93) <jborean93@gmail.com> # MIT License (see LICENSE or https://opensource.org/licenses/MIT) import base64 import collections import contextlib import os import queue import socket import subprocess import threading import typing import uuid from xm...
run_thread.py
from mylib.centroidtracker import CentroidTracker from mylib.trackableobject import TrackableObject from imutils.video import VideoStream from imutils.video import FPS #from imutils import resize from mylib.mailer import Mailer from mylib import config from mylib.config import x1,y1,x2,y2,vertical_direction,enter_direc...
GraphDrawer.py
import time import threading import networkx as nx import matplotlib.pyplot as plt def draw_graph(e): one_thr = threading.Thread(target=_draw_graph(e), args=['test']) one_thr.start() return one_thr def _draw_graph(e): g = nx.Graph() g.add_weighted_edges_from(e) pos = nx.spring_layout(g) nx.draw(g, pos, node_...
test_serial.py
'''Test the serial worker''' # Internal imports from common import TestQless import time from threading import Thread # The stuff we're actually testing from qless import logger from qless.workers.serial import SerialWorker class SerialJob(object): '''Dummy class''' @staticmethod def foo(job): ...
prop.py
import time import sys import os import traceback try: import cPickle except ImportError: import pickle as cPickle try: xrange except NameError: xrange = range try: from shinken.objects.host import Host except ImportError: Host = None from multiprocessing.sharedctypes import Value, Array from...
test_state.py
# -*- coding: utf-8 -*- """ Tests for the state runner """ from __future__ import absolute_import, print_function, unicode_literals import errno import logging import os import shutil import signal import tempfile import textwrap import threading import time import salt.exceptions import salt.utils.event import salt....
multiplexer.py
from __future__ import absolute_import from threading import Thread try: from Queue import Queue, Empty except ImportError: from queue import Queue, Empty # Python 3.x # Yield STOP from an input generator to stop the # top-level loop without processing any more input. STOP = object() class Multiplexer(obj...
Example3.py
# -------------------------------------------------------------------- # # This eexample was designed to show the GA can produce near optimal solutions # It was used as a response to reviewers of AUTCON journal # -------------------------------------------------------------------- # import time import ast import pan...
common_utils.py
r"""Importing this file must **not** initialize CUDA context. test_distributed relies on this assumption to properly run. This means that when this is imported no CUDA calls shall be made, including torch.cuda.device_count(), etc. torch.testing._internal.common_cuda.py can freely initialize CUDA context when imported....
tpincrement.py
#!/usr/bin/env python3 """Cyberjunky's 3Commas bot helpers.""" import argparse import configparser import json import logging import os import queue import sqlite3 import sys import threading import time from logging.handlers import TimedRotatingFileHandler as _TimedRotatingFileHandler from pathlib import Path import ...
test_pvc_creation_deletion_scale.py
""" Test to measure pvc scale creation & deletion time. Total pvc count would be 1500 """ import logging import csv import random import pytest import threading from tests import helpers from ocs_ci.framework.testlib import scale, E2ETest, polarion_id from ocs_ci.ocs import constants from ocs_ci.utility.utils import o...
main.py
#!/usr/bin/env python3 import sys, os, signal from spotmicro.utilities.log import Logger from spotmicro.utilities.config import Config import multiprocessing from multiprocessing.managers import BaseManager from queue import LifoQueue from spotmicro.motion_controller.motion_controller import MotionController from ...
scanner.py
# coding=utf-8 """ 基于sniffer_with_icmp构建的嗅探器 前置依赖:pip install netaddr 或 easy_install netaddr """ import os import socket import struct import threading from ctypes import * from netaddr import IPNetwork, IPAddress def udp_sender(subnet, magic_message): """ 批量发送UDP数据包 :param subnet: :param magic_messa...
get_file.py
import os import sys import threading import numpy as np ''' This file for generate matrix avg, matrix max, matrix min for plotting fitness purpose Before running this script, please checks some parameter below : 1. Rootdir : Contain your root directory path 2. Dataset : Dataset name that you want t...
pyusb_basic.py
""" mbed SDK Copyright (c) 2018-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 Unless required ...
state_manager.py
import asyncio from concurrent.futures import ThreadPoolExecutor from contextlib import suppress from queue import Queue from threading import Thread from PySide2.QtCore import QObject, Signal from modbus_client.communication.connection import Connection from modbus_client.db.backend import Backend from modbus_client...
main_window.py
import copy from functools import partial import os import pickle from threading import Thread from PySide2 import QtCore, QtGui from PySide2.QtGui import QKeyEvent from PySide2.QtWidgets import (QApplication, QLabel, QSizePolicy, QMainWindow, QScrollArea, QMessageBox, QAction, QFileDial...
client.py
import os import hashlib import time import queue import signal import typing import getpass import logging import base64 import threading from typing import ( Any, Dict, List, Type, Callable, Optional, DefaultDict, Union, Tuple, ) from types import FrameType from collections import ...
scratch_fretting.py
""" Date 01.2021 @author: Chair of Functional Materials - Saarland University - Saarbrücken, Bruno Alderete @version 1.0 """ __author__ = 'Bruno Alderete' ####################################################################################################################### # # The MIT License (MIT) # # Cop...
tether_task_runner.py
#!/usr/bin/env python ## # 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 #...
cpuinfo.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Copyright (c) 2014-2018, Matthew Brennan Jones <matthew.brennan.jones@gmail.com> # Py-cpuinfo gets CPU info with pure Python 2 & 3 # It uses the MIT License # It is hosted at: https://github.com/workhorsy/py-cpuinfo # # Permission is hereby granted, free of charge, to an...
PySight2.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created on Sep 20, 2016 Modified: May 2020 @author: deralexxx Script to pull iocs from iSight and push them to MISP Modified by: Douglas Molina Alexander Jaeger See CHANGELOG.md for history """ import datetime import email.utils import hashlib import hmac import json ...
test_processfamily.py
__author__ = 'matth' import unittest import sys from processfamily.test import ParentProcess, Config import os import subprocess import requests import time import socket import logging import glob from processfamily.processes import process_exists, kill_process, AccessDeniedError from processfamily import _traceback_...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import asyncio from typing import TYPE_CHECKING, Optional, Union, Callable, Sequence from electrum.storage import WalletStorage, StorageReadWriteError from electrum.wallet_db import WalletDB from el...
env_pool.py
""" Vectorized environment wrappers. """ import numpy as np import multiprocessing as mp import ctypes from baselines.common.vec_env import VecEnv def env_worker(env_maker, conn, n_envs): envs = [env_maker() for _ in range(n_envs)] try: while True: command, data = conn.recv() i...
doyouhaveguts.py
otherLevels=True import Tkinter from Tkinter import * import time import random import socket from threading import Thread from PIL import ImageTk import pygame #If using other versions of the creator, change the names in the functions # createWalls and createMonsters import monster if otherLevels...
main.py
import discord import requests from discord.ext import commands from threading import Thread, Lock from datetime import datetime from time import sleep from flask import Flask, request import values client = commands.Bot(command_prefix=values.command_prefix) lock = Lock() # Locked by the say command. released by the...
run-bmv2-test.py
#!/usr/bin/env python # Copyright 2013-present Barefoot Networks, 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...
test_local_api_service.py
""" Function test for Local API service """ import os import shutil import random import threading import requests import time import logging from samcli.commands.local.lib import provider from samcli.commands.local.lib.local_lambda import LocalLambdaRunner from samcli.local.lambdafn.runtime import LambdaRuntime from...
bhnet.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import socket import getopt import threading import subprocess # グローバル変数の定義 listen = False command = False upload = False execute = "" target = "" upload_destination = "" port = 0 def usag...
codeforces.py
import io import os import random import subprocess import threading import zipfile from datetime import datetime from xml.etree import ElementTree from django.conf import settings from account.models import User from polygon.models import CodeforcesPackage def get_directory_size(dir): total_size = 0 for top, d...
test_threading.py
""" Tests for the threading module. """ import test.support from test.support import verbose, import_module, cpython_only from test.support.script_helper import assert_python_ok, assert_python_failure import random import sys import _thread import threading import time import unittest import weakref import os import ...
susi_loop.py
""" Processing logic of susi_linux """ import time import os import re import logging import queue from threading import Thread, Timer, current_thread from datetime import datetime from urllib.parse import urljoin import speech_recognition as sr import requests import json_config import speech_recognition from speech_r...
execute.py
""" Once state information has been calculated, handle actually executing tools from various states, tracking results, and building implicit dataset collections from matched collections. """ import collections import logging from threading import Thread import six import six.moves from six.moves.queue import Queue fr...
mocker.py
# Copyright (C) 2018 by eHealth Africa : http://www.eHealthAfrica.org # # See the NOTICE file distributed with this work for additional information # regarding copyright ownership. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with # the License. Y...
wss.py
from .base import BaseSocket from ..util import Logger import websocket import threading import json import time class WebSocketApiSocket(BaseSocket): """ Generic REST API call """ def __init__(self, id): """ Constructor :param id: Socket id """ BaseSocket.__ini...
httprw.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import requests, random import moment import multiprocessing from httpinit import generateUser para_list = [] for i in range(0,1000): para_list.append(generateUser(i)) post_url = "http://192.168.99.100:4000/user/" numprocess = 100 def sendrwrequest(): st = moment...
server.py
# -*- coding: utf-8 -*- import os import posixpath import threading from http.server import SimpleHTTPRequestHandler from socketserver import ThreadingTCPServer from urllib.parse import unquote HERE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "data") class SimpleHTTPRequestHandlerHere(SimpleHTTPReques...
train_gcn.py
import argparse import time import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import numpy as np from dgl.nn.pytorch import GraphConv import dgl.multiprocessing as mp from torch.nn.parallel import DistributedDataParallel import os import sys import samgraph.torch as sam impo...
views.py
from django.shortcuts import render import numpy as np import os from Lab_Misc import General from Lab_Misc.General import * from .Generate import CreateAndUpdate import webbrowser from itertools import chain import threading import subprocess from Exp_Main import Sort_Videos from django.templatetags.static ...
use_map_autonomous_drive.py
''' Naruda: 2019-1 AJOU Univ. major of Software department Capstone project Robot main firmware made by "Park Jun-Hyuk" (github nickname 'BrightBurningPark'). Robot can drive by itself, localize position and direction in given map. it can also build the map from zero. I Love my school and the Capstone Program SO MUCH...
IntervalRunner.py
import threading import time class IntervalRunner: def __init__(self, action, interval): self.interval = interval self.action = action self.stop_event = threading.Event() thread = threading.Thread(target=self._set_interval) thread.start() def _set_interval(...
__init__.py
""" HEM - HTTP(s) Endpoint Monitor """ from multiprocessing import Pool from datetime import timedelta import abc import logging import os import requests import click import yaml import six import time import pike.discovery from pike.manager import PikeManager import pkg_resources import threading import jwt __versio...
main.py
import json import base64 import numpy as np import cv2 import os import mediapipe as mp import math from sklearn.svm import OneClassSVM from sklearn import svm from joblib import dump, load from sklearn.decomposition import PCA from sklearn.model_selection import train_test_split from sklearn.metrics import classifica...
combiner.py
import os import queue import sys import threading import uuid from datetime import datetime, timedelta from fedn.common.net.connect import ConnectorCombiner, Status from fedn.common.net.grpc.server import Server import fedn.common.net.grpc.fedn_pb2 as fedn import fedn.common.net.grpc.fedn_pb2_grpc as rpc from fedn.c...
receive_video.py
import base64 from root import * import cv2 import time import pickle from datetime import datetime import redis video_buffer = [b""] video_buffer_lock = [] frame_size = [-1] frame_size_lock = [] tmp_frame_size = [[]] # to be used when the frame size is changed in the receiver thread but not in the display thread tm...
main.py
from xml_to_json import process_posts from preprocessing import preprocess_text from post_stats import generate_stats from post_freqdist import generate_freqdist from post_sentiment_analysis import sentiment_analysis import json import multiprocessing def save_freqdist_to_file(input_path, output_path): freq_per_ye...
node.py
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_list.insert(tkinter.END, msg) except OSError: # Possibly...
strategy.py
# Importing various modules import threading import os import abc import time import yfinance as yf from alpaca_trade_api import REST import pandas as pd import numpy as np import tensorflow as tf from sklearn.model_selection import train_test_split from sklearn.metrics import classification_report from ker...
dense_update_ops_no_tsan_test.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...
generate_msgs.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Generates random ROS messages and publishes them to live topics. Usage: generate_msgs.py [TYPE [TYPE ...]] [--no-type TYPE [TYPE ...]] [--max-count NUM] [--max-per-topic NUM] [--m...
datachannel.py
from pyrtcdc import ffi, lib from time import sleep from threading import Thread from base64 import b64encode, b64decode RTCDC_CHANNEL_STATE_CLOSED = 0 RTCDC_CHANNEL_STATE_CONNECTING = 1 RTCDC_CHANNEL_STATE_CONNECTED = 2 RTCDC_DATATYPE_STRING = 0 RTCDC_DATATYPE_BINARY = 1 @ffi.def_extern() def onopen_cb(channel, userd...
train_multi.py
#!/usr/bin/env python """ Multi-GPU training """ import argparse import os import signal import torch import onmt.opts as opts import onmt.utils.distributed from onmt.utils.logging import logger from onmt.train_single import main as single_main def main(opt): """ Spawns 1 process per GPU """ nb_gpu = le...
p_bfgs.py
# This code is part of Qiskit. # # (C) Copyright IBM 2018, 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
car_control.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- import threading import time from server import TcpServer import key_control def recv_msg(client_socket): while True: recv_content = client_socket.recv(1024) if recv_content: # 起停开关 档位杆 左转向舵 右转向舵 加速踏板 减速踏板 ...
links_test.py
# -*- coding: utf-8 -*- import requests import threading class Check(object): def __init__(self, urls, p): self.urls = set(urls.split('\n')) self.p = p self.dic = dict() self.headers = {'user-agent': 'Mozilla/5.0 (Windows NT 5.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50....
acquire.py
import numpy as np import multiprocessing import threading from inspect import signature import copy import types import time from pycromanager.core import serialize_array, deserialize_array, Bridge from pycromanager.data import Dataset import warnings import os.path import queue ### These functions outside class to p...
dirstructure.py
from __future__ import print_function from __future__ import absolute_import ################################################################################ # RelMon: a tool for automatic Release Comparison # https://twiki.cern.ch/twiki/bin/view/CMSPublic/RelMon # # # ...
recorder.py
# Part of the code has been updated from # http://www.swharden.com/wp/2013-05-09-realtime-fft-audio-visualization-with-python/ # Author: Scott W Harden: neuroscientist, dentist, molecular biologist, code monkey (2013) import matplotlib matplotlib.use('TkAgg') # <-- THIS MAKES IT FAST! import numpy import scipy ...
backend.py
# Copyright 2020 Supun Nakandala, Yuhao Zhang, and Arun Kumar. All Rights Reserved. # Copyright 2019 Uber Technologies, Inc. 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 ...
doh-threadpool2.py
#!/usr/bin/env python3 import socket import threading, queue import requests, random host = '127.0.0.1' port = 5053 headers = {'accept': 'application/dns-message', 'content-type': 'application/dns-message'} upstreams = ['https://1.1.1.1/dns-query', 'https://1.0.0.1/dns-query'] conns = [] queue = queue.Queue() sock_l...
config.py
# Copyright (c) The Diem Core Contributors # SPDX-License-Identifier: Apache-2.0 from dataclasses import dataclass, field, asdict from typing import Dict, Any, List, Tuple from .client import RestClient from .app import App, falcon_api from .. import LocalAccount from ... import offchain, testnet, jsonrpc, utils impor...
test_functools.py
import abc import builtins import collections import collections.abc import copy from itertools import permutations import pickle from random import choice import sys from test import support import threading import time import typing import unittest import unittest.mock from weakref import proxy import contextlib imp...
utils.py
from biosimulators_utils.log.data_model import CombineArchiveLog # noqa: F401 from biosimulators_utils.report.data_model import SedDocumentResults # noqa: F401 import functools import importlib import multiprocessing import os import sys import time import types # noqa: F401 import yaml __all__ = [ 'get_simula...
main.py
import json, time, multiprocessing, importlib, sys import MiniBotFramework from threading import Thread from multiprocessing import Process from multiprocessing.managers import BaseManager from Queue import Queue # Constants CONFIG_LOCATION = "MiniBotConfig/config.json" def main(): #BaseManager.register('MiniBot'...
init.py
#!/usr/bin/env python # Copyright 2014 Boundary, 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 o...
divae.py
import configparser import socket import threading import signal import os import sys import traceback import base64 import select import json from threading import Timer sys.path.append( "lib" ) from iseclogger import Logger from commandprocessor import CommandProcessor from threading import Thread from configuration ...
test_api_simple.py
import json import os import shutil import sys import time import unittest from multiprocessing import Process import requests from app import api from app import configs from app import generator from common import posts ec = configs.EnjoliverConfig(importer=__file__) class TestAPI(unittest.TestCase): p_match...
stacoan.py
#!/bin/python import codecs import hashlib import os import sys import webbrowser import configparser import argparse import threading import json import multiprocessing from threading import Thread from multiprocessing import Process from time import time from helpers.logger import Logger from helpers.project import...
ImageConvertTool.py
""" Helper script for using Basisu. Usage: $ basisu.py fixall - TODO: """ import sys import os from shutil import copyfile import subprocess import threading import time import platform # LIST OF COMMANDS # ----------------------------- CMD_FIXALL = "fixall" # ----------------------------- # HELPERS ------------...
main_motion.py
# coding=utf-8 ''' python 2.7 pi@raspberrypi ~ $ echo $LANG zh_TW.UTF-8 https://pypi.python.org/pypi/Pillow/2.2.1 https://github.com/ashtons/picam http://host:8888/ ''' import m_settings,m_pushover,m_tornado import picam import logging, threading,io,struct import datetime, time import Image import httplib, urllib, js...
toy.py
#!/usr/bin/env python2 # coding: utf-8 import requests import time import os import subprocess import platform import shutil import sys import traceback import threading import uuid import StringIO import zipfile import tempfile import socket import getpass if os.name == 'nt': from PIL import ImageGrab else: i...
test_participant_emails.py
from __future__ import absolute_import, division, print_function, unicode_literals import json import Queue import sys import threading import urllib import mock from pytest import raises from gratipay.exceptions import CannotRemovePrimaryEmail, EmailTaken, EmailNotVerified from gratipay.exceptions import TooManyEma...
dataReceiver.py
#!/usr/bin/env python # windows : pyinstaller -F dataReceiver.py --noupx --hidden-import graphics --hidden-import websockets --noconsole import xpc import json import socket import http.server import webbrowser import threading import asyncio import websockets import graphics import time import types app = types.Sim...
_algorithm.py
''' Copyright (c) 2018 by Tobias Houska This file is part of Statistical Parameter Optimization Tool for Python(SPOTPY). :author: Tobias Houska This file holds the standards for every algorithm. ''' from __future__ import absolute_import from __future__ import division from __future__ import print_function from __fut...
tests.py
import io import json from django.db.models.signals import * from django.test import TestCase, override_settings from django_signals_cloudevents import send_cloudevent import os from django_fake_model import models as f from django.db import models from http.server import BaseHTTPRequestHandler, HTTPServer import s...
esp8266.py
import pyrebase, json, threading, telegram, os, time from telegram.ext.updater import Updater from telegram.update import Update from telegram.ext.callbackcontext import CallbackContext from telegram.ext.commandhandler import CommandHandler from telegram.ext.messagehandler import MessageHandler from telegram.ext.filter...
package_disabler.py
import json import threading import sublime import os import time import random from . import text from . import settings as g_settings from .console_write import console_write from .package_io import package_file_exists, read_package_file from .settings import preferences_filename, pc_settings_filename, load_list_s...
algo_multilateral_arbitrage.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ general notation is formed as bid-ask. first exchange is the bid side (sell on side) and the second is the ask side (buy on side) """ import os import datetime import uuid import threading import yaml import numpy as np import psycopg2 from multiprocessing.pool import Thr...
manager.py
#!/usr/bin/env python3 import datetime import importlib import os import sys import fcntl import errno import signal import shutil import subprocess import textwrap import time import traceback from multiprocessing import Process from typing import Dict from common.basedir import BASEDIR from common.spinner import Sp...
test.py
import multiprocessing as mp import os import mod print(os.getpid()) ps = [mp.Process(target=mod.f) for _ in range(3)] for p in ps: p.start() for p in ps: p.join()
detector_utils.py
# Utilities for object detector. import numpy as np import sys import tensorflow as tf import os from threading import Thread from datetime import datetime import cv2 from utils import label_map_util from collections import defaultdict import json detection_graph = tf.Graph() sys.path.append("..") # Load a frozen i...
tracker.py
# Copyright 1999-2020 Alibaba Group Holding Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
streamer.py
""" Streamer for reading input """ # Copyright (C) 2021-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # import abc import multiprocessing import queue import sys from enum import Enum from pathlib import Path from typing import Iterable, Iterator, List, NamedTuple, Optional, Tuple, Union import cv2 im...
main.py
#!-*-coding:utf-8-*- # !@Date: 2018/8/12 9:00 # !@Author: Liu Rui # !@github: bigfoolliu """ tkinter + pygame + 所线程 一个线程用来播放音乐 另一个线程用来接收界面的操作 """ from tkinter import * import pygame import threading import time class AppUI(object): """UI""" def __init__(self): # 定义主窗口 self.screen = Tk() self.screen.title(...
handover.py
# Copyright (C) 2013 Sony Mobile Communications AB. # All rights, including trade secret rights, reserved. import json import time import traceback from ave.network.process import Process from ave.network.exceptions import * from ave.broker._broker import validate_serialized, RemoteBroker, Broker from ave.brok...
color_calibrate_all.py
# Copyright (c) 2016-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE_render file in the root directory of this subproject. An additional grant # of patent rights can be found in the PATENTS file in the same directory. import argparse im...
materialized_views_test.py
import collections import re import sys import time import traceback import pytest import threading import logging from flaky import flaky from enum import Enum from queue import Empty from functools import partial from multiprocessing import Process, Queue from cassandra import ConsistencyLevel, InvalidRequest, Writ...
test_functools.py
import abc import builtins import collections import collections.abc import copy from itertools import permutations import pickle from random import choice import sys from test import support import threading import time import typing import unittest import unittest.mock from weakref import proxy import contextlib imp...
vipfile_test.py
"""Unit test for vipfile - rule manager. """ import os import shutil import tempfile import threading import unittest from treadmill import vipfile class VipFileTest(unittest.TestCase): """Tests for teadmill.rulefile.""" def setUp(self): self.root = tempfile.mkdtemp() self.vips_dir = os.pat...
pattern_executor.py
# =============================================================================== # Copyright 2012 Jake Ross # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licens...
test_logger.py
#!/usr/bin/env python # Copyright (C) 2015 Swift Navigation Inc. # Contact: https://support.swiftnav.com # # This source is subject to the license found in the file 'LICENSE' which must # be be distributed together with this source. All other rights reserved. # # THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WA...
arcus_alarm.py
# # Hubblemon - Yet another general purpose system monitor # # Copyright 2015 NAVER Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
main.py
import os import sys import random import traceback import numpy as np import math from math import log import argparse from datashape.coretypes import real random.seed(42) import threading import codecs from tqdm import tqdm import logging logger = logging.getLogger(__name__) logging.basicConfig(level=logging.INFO, fo...
swift_rings.py
#!/usr/bin/env python # Copyright 2014, Rackspace US, 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...
ContigFilteringPSDServer.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...
pod.py
""" Pod related functionalities and context info Each pod in the openshift cluster will have a corresponding pod object """ import logging import os import re import yaml import tempfile import time import calendar from threading import Thread import base64 from semantic_version import Version from ocs_ci.ocs.bucket_...
hadoopjobs.py
import os,json,pathlib import threading def mapping(filen,i,splits,local_path_mapper,output,arguements): a=filen[0]+'_'+str(i)+'.'+filen[1] rep = len(splits[a]) inp = '-1' for i in range(rep): if not pathlib.Path(splits[a][i]).exists: i+=1 else: inp = splits[a][i...
osc_receive.py
import socket, OSC, re, time, threading, math import event class PiException(Exception): def __init__(self, value): self.value = value def __str__(self): return repr(self.value) class OscReceive : def __init__(self, port): self.receive_address = '0.0.0.0', port #Mac Adress, Outgoing Port self.s = OSC.OS...