source
stringlengths
3
86
python
stringlengths
75
1.04M
main.py
from __future__ import absolute_import import argparse import logging import logging.config import docker import multiprocessing.pool import os import psutil import random import shutil import sys import traceback from benchmark.datasets import DATASETS from benchmark.algorithms.definitions import (get_definitions, ...
neuron.py
import bittensor import visualizer from Crypto.Hash import SHA256 from concurrent import futures import grpc from loguru import logger import numpy as np import math import pickle import random import time from threading import Lock import threading import queue import tensorflow as tf from io import StringIO import ...
Python advanced keylogger.py
#//python keylogging program ## You will need to comment out the prints and exception prints on code if you were to use this for real, as its testing ## i have prints on here that will tell you and let you know what part of the program is going at the time and that it is ## working # Surport me and subscribe to my ...
test_logging.py
# Copyright 2001-2017 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
process_stage2.py
import multiprocessing import shutil from os import path from exp2.path_service import PathService from .pre import Exp2Assistant from autosklearn.metrics import accuracy from autosklearn.classification import AutoSklearnClassifier from autosklearn.constants import * from sklearn.externals import joblib tmp_folder ...
__init__.py
import os, sys, threading, time CURRENT_DIR = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, os.path.join(CURRENT_DIR, "..", "..")) import constants import psutil import atexit class Monitor: def __init__(self): pass def warn(self): pass def monitor(self): pass cl...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers. # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib impor...
test_core.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...
server.py
# libs import socket import threading from random import randint import sys gener_port = int(randint(1025, 65432)) inp = sys.argv if len(inp) == 3: host, port = inp[1], int(inp[2]) elif len(inp) != 1: print(f"usage: {sys.argv[0]} <HOST/TARGET (IPv4)> <PORT>") sys.exit() else: host, port = "localhost",...
sender.py
"""Models a sender in the self-stabilizing communication protocol. Each node sets up n-1 senders that each connect to a receiver on the other side of the communication link. """ # standard from threading import Thread import socket import logging import time from queue import Queue # local from communication.udp.mes...
makecooccurs.py
import os from collections import Counter from multiprocessing import Queue, Process from Queue import Empty from argparse import ArgumentParser from coha.cohastringutils import process_lemma_line from ioutils import load_pickle, mkdir from cooccurrence.matstore import export_mat_from_dict DATA = "/dfs/scratch0/COHA...
networking.py
import socket import threading import numpy as np import time from main.character import Character class Networking(): def __init__(self, server, ip, port, max_connections): self.server=server self.ip=ip self.port=port self.max_connections=max_connections self.client_threads...
playsound.py
import logging logger = logging.getLogger(__name__) class PlaysoundException(Exception): pass def _canonicalizePath(path): """ Support passing in a pathlib.Path-like object by converting to str. """ import sys if sys.version_info[0] >= 3: return str(path) else: # On earlier...
datasets.py
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license """ Dataloaders and dataset utils """ import glob import hashlib import json import logging import os import random import shutil import time from itertools import repeat from multiprocessing.pool import Pool, ThreadPool from pathlib import Path from threading import Thread ...
run_end_to_end_tests.py
#!/usr/bin/env python3 # # Copyright 2019 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
server.py
import BaseHTTPServer import errno import os import re import socket from SocketServer import ThreadingMixIn import ssl import sys import threading import time import traceback import types import urlparse import routes as default_routes from logger import get_logger from request import Server, Request from response i...
athenad.py
#!/usr/bin/env python3 import base64 import hashlib import io import json import os import sys import queue import random import select import socket import threading import time from collections import namedtuple from functools import partial from typing import Any import requests from jsonrpc import JSONRPCResponseM...
experiment_rx_push_b.py
""" Reception script of the range test. \ author Jonathan Munoz (jonathan.munoz@inria.fr), January 2017 """ import time import sys import logging import threading import Queue import json from datetime import datetime as dt import datetime import socket from threading import Timer import at86rf215_defs as defs impor...
utils.py
import asyncio from asyncio import TimeoutError import atexit from collections import deque, OrderedDict, UserDict from concurrent.futures import ThreadPoolExecutor from contextlib import contextmanager import functools from hashlib import md5 import html import inspect import json import logging import multiprocessing...
mfeepo_connector.py
# File: mfeepo_connector.py # # Copyright (c) 2016-2022 Splunk 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 a...
myJoyStick.py
# -*- coding: utf-8 -*- """ Created on Sun Oct 14 21:47:55 2018 @author: 402072495 """ import os import numpy as np # import inputs # import serial import threading import time class myJoyStick(): def __init__(self, parent=None): # self.pads = inputs.devices.gamepads self.dataType = np.dtype([('AB...
feature_shutdown.py
#!/usr/bin/env python3 # Copyright (c) 2018 TurboCoin # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test turbocoind shutdown.""" from test_framework.test_framework import TurbocoinTestFramework from test_framework.util import...
subproc_vec_env.py
import numpy as np from multiprocessing import Process, Pipe from baselines.common.vec_env import VecEnv, CloudpickleWrapper def worker(remote, env_fn_wrapper, is_multi_agent): env = env_fn_wrapper.x() while True: cmd, data = remote.recv() if cmd == 'step': ob, reward, done, info =...
test_web.py
# test_web.py -- Compatibility tests for the git web server. # Copyright (C) 2010 Google, Inc. # # Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU # General Public License as public by the Free Software Foundation; version 2.0 # or (at your option) any later version. You can redistribute it a...
train.py
import argparse import logging import os import random import time from pathlib import Path from threading import Thread from warnings import warn import math import numpy as np import torch.distributed as dist import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torc...
mcsoda.py
#!/usr/bin/env python import re import sys import math import time import socket import string import struct import random import threading import multiprocessing import queue import logging import logging.config from collections import deque from hashlib import md5 import json import inspect sys.path.extend(('.', 'li...
train.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import tensorflow.compat.v1 as tf tf.disable_v2_behavior() import threading import numpy as np import signal import random import os from network import ActorCriticFFNetwork from training_thread import A3CTrainingThread from utils.ops import log_uniform from utils.rmspro...
multi_thread_processor.py
import threading try: from Queue import Queue, Empty except ImportError: from queue import Queue, Empty def dag_thread(dag_queue, vertex, executor, param): try: dag_queue.put((vertex, executor.execute(param))) except Exception as e: dag_queue.put((vertex, e)) class MultiThreadProces...
background_task.py
#!/usr/bin/env python # Run a background task while the main task loop progresses import numpy as np from threading import Thread import rospy import actionlib from task_executor.abstract_step import AbstractStep from actionlib_msgs.msg import GoalStatus from assistance_msgs.msg import ExecuteAction, ExecuteGoal ...
32multiprocessing.py
import os import random import time import subprocess from multiprocessing import Pool, Process, Queue print('Process (%s) start...' % os.getpid()) # pid = os.fork() # print(pid) # # if pid == 0: # print('I am child process (%s) and my parent is %s.' % (os.getpid(), os.getppid())) # else: # print('I (%s) jus...
exchange_rules.py
import time from rules import RuleChecker import threading class CryptoEngineRules: ''' exchange = filename ''' def __init__(self, exchange, ticker, rule, keyFile): self.exchange = exchange self.ticker = ticker self.rule = rule self.keyFile = keyFile self.checker...
PPO_v1.py
""" A simple version of OpenAI's Proximal Policy Optimization (PPO). [https://arxiv.org/abs/1707.06347] Distributing workers in parallel to collect data, then stop worker's roll-out and train PPO on collected data. Restart workers once PPO is updated. The global PPO updating rule is adopted from DeepMind's paper (DPP...
gunicorn_aio_app.py
# -*- coding: utf-8 -*- import logging import aio_pika import asyncio from flask import Flask import threading LOG_FORMAT = ('%(levelname) -10s %(asctime)s %(name) -30s %(funcName) ' '-35s %(lineno) -5d: %(message)s') LOGGER = logging.getLogger(__name__) async def process_message(message: aio_pika.Inc...
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...
__init__.py
""" This module contains the statistical forecasting initiation and management. The base class for all forecastings is :py:class:`StatisticalForecast` , to generate forecasts one of the following subclasses has to be used .. autosummary:: ~StatisticalForecast ~DSHWForecast ~DayTypeForecast """ imp...
stream_server.py
""" stream_server.py IIT : Istituto italiano di tecnologia Pattern Analysis and Computer Vision (PAVIS) research line Description: Social distancing video stream server Disclaimer: The information and content provided by this application is for information purposes only. You h...
AutoencodingSAC2.py
from stable_baselines3 import SAC from typing import Union, Optional, Any, Dict, Tuple, List, Iterable, Type import torch as th from stable_baselines3.common.off_policy_algorithm import OffPolicyAlgorithm from torch.nn import functional as F from stable_baselines3.common.utils import polyak_update from stable_baseline...
main.py
import socket from queue import Queue from threading import Thread from os import cpu_count from socket import SOCK_DGRAM, SOCK_STREAM, AF_INET, AF_INET6 from click import argument, group, option from .logo import draw_logo from .pprinter import p_print from .Target import Target # Attempt Socket connection. def conn...
process_queue.py
from multiprocessing import Process, Value, Array, Lock, Queue import time def square(numbers, queue): for i in numbers: queue.put(i*i) def make_negative(numbers, queue): for i in numbers: queue.put(-1*i) if __name__ == '__main__': q = Queue() numbers = range(1, 6) p1 = Process(t...
views.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import base64 import random import logging import time import threading import os from ssshare import app from ssshare.ascii import birthday_2017, ss_title from ssshare.ss import crawler from ssshare import donation from flask import render_template, send_from_directory, ab...
common.py
# -*- coding: utf-8 -*- #------------------------------------------------------------------------- # drawElements Quality Program utilities # -------------------------------------- # # Copyright 2015 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use t...
test_read_committed_sees_snapshots.py
############## # Setup Django import django django.setup() ############# # Test proper import threading import time import pytest from django.db import transaction from django.db.models import F, Subquery from app.models import Sock @pytest.mark.django_db def test_read_committed_sees_snapshots(): def create(...
kb_ea_utilsServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- 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, Inva...
fs.py
from typing import Any, AsyncIterator, BinaryIO, cast, AsyncContextManager, Dict, List, Optional, Set, Tuple, Type from types import TracebackType import sys from concurrent.futures import ThreadPoolExecutor import os.path import urllib import threading import asyncio import logging import botocore.exceptions import b...
snake_game.py
import dearpygui.dearpygui as dpg import threading import time import random import webbrowser from theme_settings import * dpg.setup_registries() # Registries for mouse and keyboard press events slither_data = [] # List of points and their respective direction. [[x_coordinate, y_coordinate], direction] slither_cha...
frontend_service.py
from flask import Flask from flask import request from flask_cors import CORS import database.models as entityModels import database.pricesModel as pricesModels import database.co2Model as co2Model import database.gasBoilerModel as gasBoilerModel import database.optimizerModel as optimizerModel from database.databaseha...
installwizard.py
from functools import partial import threading from kivy.app import App from kivy.clock import Clock from kivy.lang import Builder from kivy.properties import ObjectProperty, StringProperty, OptionProperty from kivy.core.window import Window from kivy.uix.button import Button from kivy.utils import platform from kivy...
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...
actioncam.py
import os import sys import time from multiprocessing import Process, Queue, Lock from multiprocessing import Manager from local_ressources import Camera from local_ressources import Configuration from local_ressources import Helper from servicerunner import Servicerunner from webserver import WebServer l_lock = Loc...
rpc_client.py
# Copyright 2017 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
image_injection_demo.py
################################################################################### # Copyright (c) 2020-2021 STMicroelectronics. # All rights reserved. # This software is licensed under terms that can be found in the LICENSE file in # the root directory of this software component. # If no LICENSE file comes ...
downloadclient.py
# Copyright 2018 CERN for the benefit of the ATLAS collaboration. # # 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 appl...
test_autograd.py
import gc import sys import io import math import random import tempfile import time import threading import unittest import warnings from copy import deepcopy from collections import OrderedDict from itertools import product, permutations from operator import mul from functools import reduce, partial import torch fro...
server.py
# Adafruit BNO055 WebGL Example # # Requires the flask web framework to be installed. See http://flask.pocoo.org/ # for installation instructions, however on a Linux machine like the Raspberry # Pi or BeagleBone black you can likely install it by running: # sudo apt-get update # sudo apt-get install python3-flask # ...
mumbleBot.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import re import threading import time import sys import math import signal import configparser import audioop import subprocess as sp import argparse import os import os.path import pymumble_py3 as pymumble import pymumble_py3.constants import variables as var import logg...
client.py
from MusEEG import eegData from MusEEG import TrainingDataMacro from numpy import array import threading import time import matplotlib.pyplot as plt from collections import deque from scipy import signal import numpy as np import socket import queue class client: def __init__(self): self.BUFFER_SIZE = eegData.ch...
jobmanager.py
# BSD 2-Clause License # # Copyright (c) 2021-2022, Hewlett Packard Enterprise # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright...
test_event_log.py
import multiprocessing import os import sys import time import traceback from contextlib import contextmanager import pytest import sqlalchemy from dagster import seven from dagster.core.errors import DagsterEventLogInvalidForRun from dagster.core.events import DagsterEvent, DagsterEventType, EngineEventData from dag...
BotsController.py
from Interface import PipeToJava from LowLevelFunctions import LowLevelFunctions from Bot import Bot from threading import Thread import random from Resources import Resources pipe = PipeToJava(headless=True) bot_id = 0 resources = Resources() llf = LowLevelFunctions(resources) colors = [ '\33[31m', '\33[33m'...
integration_test.py
import unittest import sys import Adafruit_BluefruitLE import logging import time import serial import serial.tools.list_ports import threading from BadgeFramework.ble_badge_connection import BLEBadgeConnection from BadgeFramework.badge import OpenBadge logging.basicConfig(filename="integration_test.log", level=loggi...
unlzhhy__ContigFilterServer.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...
test_io.py
"""Unit tests for the io module.""" # Tests of io are scattered over the test suite: # * test_bufio - tests file buffering # * test_memoryio - tests BytesIO and StringIO # * test_fileio - tests FileIO # * test_file - tests the file interface # * test_io - tests everything else in the io module # * test_univnewlines - ...
feature_shutdown.py
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Wflscoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test wflscoind shutdown.""" from test_framework.test_framework import WflscoinTestFramework from test...
stargate.py
# -*- coding: utf-8 -*- import time from threading import Thread from typing import Generic, TypeVar, Optional, List from udp.ba import Data from udp.mtp import DataType, Package from udp import Connection, ConnectionState, ActiveConnection from udp import Hub from udp import GateDelegate, Docker from udp import Star...
segment.py
"""Controls functions for segmentation of white/gray matter and other things in the brain. """ import os import time import shlex import warnings import numpy as np import subprocess as sp from builtins import input import multiprocessing as mp from . import formats from . import blender from . import freesurfer from ...
runner_config.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 (th...
server.py
import json from robot import config, utils, logging, Updater, constants import base64 import requests import tornado.web import tornado.ioloop import tornado.httpserver import tornado.options import hashlib import threading import asyncio import subprocess import os import time import yaml import markdown import rando...
pso.py
'''Particle Swarm Optimization Algorithm for Minimization''' from threading import Thread, Event import numpy as _np class PSO: """.""" DEFAULT_COEFF_INERTIA = 0.7984 DEFAULT_COEFF_INDIVIDUAL = 1.49618 DEFAULT_COEFF_COLLECTIVE = 1.49618 def __init__(self, save=False): """.""" # ...
other.py
import sys,threading sys.setrecursionlimit(3000000) threading.stack_size(67108864) def firstdfs(vertexind): global fs,isexplored,visitordered,mapDictT if len(mapDictT[vertexind])>0: for ind in mapDictT[vertexind]: if not isexplored[ind-1]: isexplor...
types.py
# -*- coding: utf-8 -*- from threading import Thread """ twython.streaming.types ~~~~~~~~~~~~~~~~~~~~~~~ This module contains classes and methods for :class:`TwythonStreamer` to use. """ class TwythonStreamerTypes(object): """Class for different stream endpoints Not all streaming endpoints have nested end...
LutronCasetaController.py
from polyinterface import Controller,LOG_HANDLER,LOGGER import asyncio import json import requests import socket import ssl import logging import time from threading import Thread,Event #import pylutron_caseta.smartbridge as smartbridge from pylutron_caseta.smartbridge import Smartbridge from pylutron_caseta import...
worker.py
# worker.py - master-slave parallelism support # # Copyright 2013 Facebook, Inc. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from i18n import _ import errno, os, signal, sys, threading import util def countcpus(): '''try ...
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...
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from electrum.util import bfh, bh2u, UserCancelled from electrum.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, TYPE_ADDRESS, TYPE_SCRIPT, is_segwit_address) from electrum import c...
coverage_test_advanced.py
# -*- coding: utf-8 -*- import threading import unittest from queue import Queue import random from example.coapserver import CoAPServer import defines from src.Bubot_CoAP import HelperClient from messages.option import Option from messages.request import Request from messages.response import Response class Tests(u...
node.py
import socket import time import datetime import threading class Node(): port = -1 executing_cs = False requesting_cs = False waiting_reply_q = None host = "?" s_listener = None keep_listeing = True node_name = "?" connectedNodeList=list() defferedRequest=None ...
test_dht_node.py
import asyncio import heapq import multiprocessing as mp import random from itertools import product from typing import Optional, List, Dict import numpy as np import pytest import hivemind from hivemind import get_dht_time, replace_port from hivemind.dht.crypto import RSASignatureValidator from hivemind.dht.node imp...
fetch.py
# Tabulon # Copyright (c) 2015-2017 BeaconHill <theageofnewstars@gmail.com> # See `LICENSE.txt` for license terms. from time import sleep, time from sys import stdout from collections import deque from threading import Thread from lxml import html import requests from util import * from termutil import * from getpass ...
cluster_notebook_test.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_pocs.py
import os import pytest import time from multiprocessing import Process from astropy import units as u from pocs import PanBase from pocs import POCS from pocs.observatory import Observatory from pocs.utils import error from pocs.utils.messaging import PanMessaging @pytest.fixture def observatory(): observator...
remote_logs.py
import time import requests from lithops import multiprocessing as mp # import multiprocessing as mp def lithops_asciiart(): print(requests.get('https://artii.herokuapp.com/make', params={'text': 'Lithops', 'font': 'univers'}).text, flush=True) time.sleep(1) print('Exceptions will show up without the nee...
main.py
# -*- coding: utf-8 -*- import os import ctypes from threading import Thread import time import numpy as np import cv2 from mss import mss from win32api import GetSystemMetrics import config from repositories import detector_repo from repositories import fishing_repo from repositories import render_repo config.PID = ...
misc.py
from fnmatch import fnmatch import multiprocessing import subprocess from time import sleep, time import itertools __copyright__ = "Copyright 2016-2018, Netflix, Inc." __license__ = "Apache, Version 2.0" import sys import os import re from vmaf.tools.scanf import sscanf, IncompleteCaptureError, FormatError def get...
helpers.py
# -*- coding: utf-8 -*- """ :copyright: Copyright 2013-2017 by the SaltStack Team, see AUTHORS for more details. :license: Apache 2.0, see LICENSE for more details. tests.support.helpers ~~~~~~~~~~~~~~~~~~~~~ Test support helpers """ # pylint: disable=repr-flag-used-in-string,wrong-import-order ...
janis.py
import requests import threading from socketIO_client import SocketIO class Janis: def __init__(self, api_key, client_key, platform, *access_token, **kwargs): """ @required: api_key client_key platform @optional: access...
ExtraPractice4.py
# ExtraPractice4.py # สร้างรายงานเคส โควิด-19 ในแต่ละประเทศ import requests import json # list , dictionary from os import path from time import sleep import threading def line(): print("=" * 80) def line2(): print("-" * 80) # นับจำนวนเคสและจำนวนผู้เสียชีวิตในแต่ละประเทศ และคืนค่าเป็น ...
main.py
""" Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: MIT-0 Description: Anomaly detection systems (i.e. Amazon Macie) often perform quantitative analytics over timeseries derived from activities on their monitored subjects. While the core anomaly detection algorithms can...
supervisor.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...
data_upload.py
""" Anonymizes and uploads DNS and flow data to cloud. """ import time import datetime import threading import utils import requests import json import server_config from host_state import HostState UPLOAD_INTERVAL = 5 class DataUploader(object): def __init__(self, host_state): assert isinstance(host...
detection.py
# Copyright (c) HP-NTU Digital Manufacturing Corporate Lab, Nanyang Technological University, Singapore. # # This source code is licensed under the Apache-2.0 license found in the # LICENSE file in the root directory of this source tree. import sys, os lib_path = os.path.abspath(os.path.join('scripts/ncs2')) ...
dataload_ucf_101.py
# -*- coding: utf-8 -*- import tensorflow as tf import numpy as np import multiprocessing as mp import cv2 import os import random import time class ImgArgument(): def __init__(self): self.graph = tf.Graph() with self.graph.as_default(): self.img = tf.placeholder(tf.float32, [256, 256,...
open_remote_file.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 # # Authors: # - Paul Nilsson, paul.nilsson@cern.ch, 2020-2021 import argparse import os import log...
shell.py
from threading import Thread from libs.config import gget, alias, color, set_namespace from libs.myapp import send, base64_encode, is_windows, get_system_code from libs.app import readline, value_translation NEW_WINDOWS_WORDLIST = {"common_wordlist": ( "echo", "dir", "cd", "md", "rd", ...
async.py
import multiprocessing import socket import time import hashlib import base64 import struct import select from django.contrib.sessions.models import Session from django.contrib.auth.models import User ##################################### ASYNC #################################### # The async program is ment to intr...
Neo.py
from os import system, devnull from subprocess import call, STDOUT from sys import exit from time import sleep from threading import Thread class Gpio: def __init__(self): self.gpios = ["178", "179", "104", "143", "142", "141", "140", "149", "105", "148", "146", "147", "100", "102", ...
transfer.py
#!/usr/bin/env python # # Copyright 2015 Google 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...
client.py
import json import logging import os import threading from dataclasses import dataclass from datetime import datetime from typing import List, Any, Union, Optional, Dict from urllib.parse import urlencode import requests def http_get( url: str, headers: Optional[dict] = None, data: Optional[dict] = None, ): ...
prepro.py
#! /usr/bin/python # -*- coding: utf-8 -*- import copy import threading import time import numpy as np import tensorlayer as tl import scipy import scipy.ndimage as ndi from scipy import linalg from scipy.ndimage.filters import gaussian_filter from scipy.ndimage.interpolation import map_coordinates import skimag...
zmqevt.py
import zmq import pickle from itertools import repeat port = 50000 _ctx = zmq.Context() _sock = _ctx.socket(zmq.PUB) _sock.bind('tcp://127.0.0.1:{}'.format(port)) def encode(type, message): return '{} {}'.format(type, pickle.dumps(message)) def decode(message): type, payload = message.split(' ', 1) re...
draft.py
import pandas as pd import numpy as np import random import os import datetime import pickle from IPython.display import display from threading import Thread, Event import ipywidgets as widgets import time # Helper function for bolding text string def bold(string): return '\033[1m' + string + '\033[0m' # Helper...