source
stringlengths
3
86
python
stringlengths
75
1.04M
tracer.py
"""Cyberbrain public API and tracer setup.""" import argparse import dis import functools import os import sys from types import MethodType, FunctionType, FrameType from typing import Optional, Union from get_port import get_port from . import logger, utils, rpc_server from .frame import Frame from .frame_tree impor...
util.py
# pylint: disable=consider-using-enumerate """Common utilities.""" import functools import itertools as it import os import subprocess import time from collections import OrderedDict from datetime import datetime from functools import partial, partialmethod import threading from typing import Sequence, Any from warning...
Simple.py
from threading import Thread, current_thread, Lock from time import sleep report_progress_now = [] progress_lock = Lock() def check_report_progress(me, id): global report_progress_now, progress_lock if report_progress_now[id]: progress_lock.acquire() print("{} [{}] is making progress...
pumpThread.py
#Creation Date: (July 16, 2007) #Author: John Creson import maya.cmds as cmds import maya.utils as utils import threading import time import sys from PyQt4 import QtCore, QtGui pumpedThread = None app = None def pumpQt(): global app def processor(): app.processEvents() while 1: ti...
test_rpc.py
import os import time import socket import dgl import backend as F import unittest, pytest import multiprocessing as mp from numpy.testing import assert_array_equal if os.name != 'nt': import fcntl import struct INTEGER = 2 STR = 'hello world!' HELLO_SERVICE_ID = 901231 TENSOR = F.zeros((10, 10), F.int64, F....
watchdog.py
# Thanks to Tim Golden for the excellent examples of win32 package import os import sys import threading import re import win32file import win32con import win32api import datetime import configparser class Watcher(threading.Thread): def __init__(self, path_to_watch): self.run = True self.path_t...
test_gc.py
import unittest from test.support import (verbose, refcount_test, run_unittest, strip_python_stderr, cpython_only, start_threads, temp_dir, requires_type_collecting, TESTFN, unlink, import_module) from test.support.script_helper import a...
http_server.py
import os import signal from datetime import datetime from functools import update_wrapper, wraps from threading import Thread, Timer import flask from flask import request from server.demo_control import DemoControl from server.detector_wrappers import EnvelopeHandler, IQHandler, PowerBinHandler, SparseHandler # T...
act_coverage.py
# Copyright (c) 2016-present, Ke Mao. 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 conditio...
http.py
import logging import base64 import sys import random import os import ssl import time import copy import sys from pydispatch import dispatcher from flask import Flask, request, make_response, send_from_directory # Empire imports from lib.common import helpers from lib.common import agents from lib.common import encryp...
parallel.py
# -*- coding: utf-8 -*- # # Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu> # # 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 # # Un...
test_api.py
""" mbed SDK Copyright (c) 2011-2014 ARM 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 License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
scriptinfo.py
import os import sys from copy import copy from datetime import datetime from functools import partial from tempfile import mkstemp, gettempdir import attr import logging import json from pathlib2 import Path from threading import Thread, Event from .util import get_command_output, remove_user_pass_from_url from .......
Speech_Recognizer.py
import speech_recognition as sr from tkinter import * from tkinter import ttk from tkinter import filedialog import threading import time import os import numpy as np import librosa.display import copy from sklearn.externals import joblib from winsound import * from numpy import array, zeros, argmin, inf, ndim from sci...
main.py
import schedule import time import threading import logging.config from schedinstances.TextFileURLs import TextFileURLs from schedinstances.ArtPackages import ArtPackages from schedinstances.ArtMails import ArtMails, ArtDevMails from schedinstances.BigTasks import BigTasks from schedinstances.Harvester import Harveste...
scanner_engine.py
# -*- coding: utf-8 -*- u"""Scanner Engine module for SecureTea AntiVirus. Project: ╔═╗┌─┐┌─┐┬ ┬┬─┐┌─┐╔╦╗┌─┐┌─┐ ╚═╗├┤ │ │ │├┬┘├┤ ║ ├┤ ├─┤ ╚═╝└─┘└─┘└─┘┴└─└─┘ ╩ └─┘┴ ┴ Author: Abhishek Sharma <abhishek_official@hotmail.com> , Jul 4 2019 Version: 1.4 Module: SecureTea """ from securetea.lib.an...
skybot_job.py
import json import os from datetime import datetime, timedelta import pandas as pd from rest_framework import mixins, viewsets from rest_framework.decorators import action from rest_framework.response import Response from common.dates_interval import get_days_interval from common.read_csv import csv_to_dataframe from...
transceiver.py
#!/usr/bin/env python3 # python modules import sys import time import subprocess from multiprocessing import Process, Queue import atexit import argparse import logging # numpy etc import numpy as np import matplotlib.pyplot as plt # open xcvr modules import openxcvr from cat_server import cat_server, command_queue,...
login.py
import os, sys, time, re, io import threading import json, xml.dom.minidom import copy, pickle, random import traceback, logging import requests from .. import config, utils from ..returnvalues import ReturnValue from .contact import update_local_chatrooms, update_local_friends from .messages import produc...
repair_test.py
import threading import time from collections import namedtuple from unittest import skip from cassandra import ConsistencyLevel from cassandra.query import SimpleStatement from dtest import FlakyRetryPolicy, Tester, debug from tools import insert_c1c2, known_failure, no_vnodes, query_c1c2, since def _repair_option...
httpwrite.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 plist = [] def sendwriterequest(): ...
gui.py
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'gui.ui' # # Created by: PyQt5 UI code generator 5.15.1 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. import os, sys, threading from PyQt...
environment.py
import os import threading from wsgiref import simple_server from wsgiref.simple_server import WSGIRequestHandler from selenium import webdriver from selenium.webdriver.chrome.options import Options from app import app # Use the chrome driver specific to your version of Chrome browser and put it in ./driver director...
jetbot_control.py
import time import threading # 引入threading leftvalue = 0 rightvalue = 0 running = True robot = "" def control(): print("start running control mode") while running: print("is controlling") global leftvalue global rightvalue #更改左右馬達速度 robot.set_motors(leftvalue,rightvalue)...
sendtosocket.py
#!/usr/bin/env python3 # import rospy import socket from threading import Thread import inputs import struct import time # def send(conn): # while True: # conn.send('a') # host1 = "10.5.5.9" # port1 = 10000 # sock1 = socket.socket() # sock1.connect((host1, port1)) # Thread(target=send, args=[sock1]).sta...
multhread.py
import cv2 as cv import numpy as np import time from timeit import repeat from multiprocessing import Pool import threading backSub = cv.createBackgroundSubtractorMOG2() # list to store clicked coordinates coords = [] # cut the given frame and rect with np array of coords def cut_image(frame, rect, pts): x,y,w...
crawler.py
from bottle import Bottle, view, request, redirect from wtforms import Form, StringField, IntegerField, BooleanField, validators import urllib.request from model import Base, Page, Relation import urllib.request import urllib.parse import urllib.robotparser from bs4 import BeautifulSoup from queue import Queue import t...
streamer.py
# INTEL CONFIDENTIAL # # Copyright (C) 2021 Intel Corporation # # This software and the related documents are Intel copyrighted materials, and # your use of them is governed by the express license under which they were provided to # you ("License"). Unless the License provides otherwise, you may not use, modify, copy, ...
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...
GroundTruth.py
''' Calculate ground truth with standard Apriori algorithm ''' from collections import defaultdict from models.DataSet import SeqDataSet,Trajectory from utils.Naming import SupportCountPickleName import pickle import multiprocess import math from utils.Print import printRound from models.Apriori import * def gen...
notify.py
# -*- coding: UTF-8 -*- import datetime import re import traceback from threading import Thread from django.contrib.auth.models import Group from sql.models import QueryPrivilegesApply, Users, SqlWorkflow, SqlGroup, WorkflowAudit, WorkflowAuditDetail from common.config import SysConfig from sql.utils.group import aut...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
stream.py
import os import time import eel from pygame import mixer from mutagen.mp3 import MP3 import threading os.system('cls') print('') print('example:- https://www.youtube.com/playlist?list=XYZ123ABC') link = str(input('ENTER A YOUTUBE PLAYLIST/VIDEO LINK:- ')) print('') with open('config.txt') as f: Store...
generate_wx_data.py
# -*- coding:utf-8 -*- from wxpy import * from platform import system from os.path import exists from os import makedirs from os import listdir from shutil import rmtree from queue import Queue from threading import Thread from time import sleep from pyecharts import Pie from pyecharts import Map from pyecharts import ...
treasury.py
import logging import threading import time from brownie import Contract, chain, web3 from brownie.network.event import EventLookupError from eth_abi import encode_single from joblib import Parallel, delayed from yearn.events import create_filter, decode_logs from yearn.multicall2 import fetch_multicall from yearn.out...
worker.py
import threading, time, sys, getopt, queue from debug_utils import * from commer import CommerOnWorker, LISTEN_IP from msg import result_from_req, InfoType, Info from plot import plot_worker class Worker(): def __init__(self, _id): self._id = _id self.msg_q = queue.Queue() # self.epoch__num_req_l = [] self....
botal.py
from threading import Thread, Lock class Botal: class _ThreadSafeGenerator: def __init__(self, uuid, handler): self.uuid = uuid self._lock = Lock() self._handler = handler(uuid) next(self._handler) def send(self, message): with self._lo...
run.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distrib...
qt.py
#!/usr/bin/env python # # Electrum - Lightweight Bitcoin Client # Copyright (C) 2015 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without...
train_model.py
import tensorflow as tf from tf_agents.agents.dqn import dqn_agent from tf_agents.environments import tf_py_environment from tf_agents.networks import q_network from tf_agents.policies import random_tf_policy from tf_agents.replay_buffers import tf_uniform_replay_buffer from tf_agents.trajectories import trajectory fro...
fit.py
#!/usr/bin/env python2 # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source code form or as a compiled # binary, for any purpose, commercial or non-commercial, and by any # means. # # ...
test_weakref.py
import gc import sys import unittest import collections import weakref import operator import contextlib import copy import threading import time import random from test import support from test.support import script_helper, ALWAYS_EQ # Used in ReferencesTestCase.test_ref_created_during_del() . ref_fr...
host.py
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # Copyright (c) 2011 Piston Cloud Computing, Inc # Copyright (c) 2012 University Of Minho # (c) Copyright 2013 Hewlett-Pa...
qolsys_socket.py
import json import socket import ssl import sys import time import asyncio import threading import logging class qolsys: ################################################################################ # Code def __init__(self): self._sock = socket.socket self._wrappedSocket = ssl.SSLConte...
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...
ws_thread.py
import sys import websocket import threading import traceback import ssl from time import sleep import json import decimal import logging from market_maker.settings import settings from market_maker.auth.APIKeyAuth import generate_expires, generate_signature from market_maker.utils.log import setup_custom_logger from m...
Metrics.py
import atexit import math import queue import threading import requests import json import importlib from readme_metrics import MetricsApiConfig from readme_metrics.publisher import publish_batch from readme_metrics.PayloadBuilder import PayloadBuilder from readme_metrics.ResponseInfoWrapper import ResponseInfoWrapper...
synchronous_source.py
# Copyright (c) 2018, ZIH, # Technische Universitaet Dresden, # Federal Republic of Germany # # 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 t...
range_tool.py
# Copyright 2018-2019 Jetperch LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
download_images.py
import os import shutil import threading import time import numpy as np import pandas as pd import requests class DownloadData(object): def __init__(self, input_csv, output_dir, num_threads=10): self.input_csv = input_csv self.output_dir = output_dir self.num_threads = num_threads de...
server.py
import asyncio from socket import socket as Socket import threading from typing import Any, Callable, Dict, List, Optional, cast from aiohttp import web EventCallback = Callable[[Dict[str, Any]], None] class Server: """A handle to a running server.""" def __init__(self, handle_event: EventCallback, host: s...
bridge.py
#!/usr/bin/env python3 import time import math import atexit import numpy as np import threading import random import cereal.messaging as messaging import argparse from common.params import Params from common.realtime import Ratekeeper from lib.can import can_function, sendcan_function from lib.helpers import FakeSteer...
__init__.py
from server.utils.settings_utils import get_ip4_addresses from flask import Flask, url_for from flask.helpers import send_from_directory from flask_socketio import SocketIO from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_cors import CORS from werkzeug.utils import secure_filename ...
extract.py
from .muse import Muse from .models import Sample import time from multiprocessing import Process, Queue def _target(queue, address=None, backend=None, interface=None, name=None): def add_to_queue(data, timestamps): for i in range(12): queue.put(Sample(timestamps[i], data[:, i])) try: ...
astra.py
import argparse import base64 import json import requests import time import ast import utils.logger as logger import utils.logs as logs import urlparse import hashlib import webbrowser from core.zapscan import * from core.parsers import * from utils.logger import * from core.login import APILogin from utils.logger im...
subscribers.py
import zmq from .sockets import ClientConnection from .constants import * import threading def subscriber(address,topics,callback,message_type): """ Creates a subscriber binding to the given address and subscribe the given topics. The callback is invoked for every message received. Args: ...
Client.py
import requests import websockets import asyncio import threading from .plumberhub_pb2 import Sample from .plumberhub_pb2 import Event def noop(): pass class PlumberHubClient: def __init__( self, hostname, port, client_id, onready = noop, onsample=noop, onevent = noop, ...
optimization_controller.py
import json import signal import threading import connexion import re import os import subprocess import time import gc import psutil from IO.MQTTClient import InvalidMQTTHostException from IO.redisDB import RedisDB from optimization.ModelException import InvalidModelException, MissingKeysException from swagger_se...
reader.py
# Copyright (c) 2019 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 appli...
reddit-update.py
#! usr/bin/env python3 # -*- coding: utf-8 -*- ''' #------------------------------------------------------------------------------- Project : Project JaaS Module : reddit Purpose : Reddit API Wrapper Version : 0.1.1 beta Status : Development Modified : 2020 Mar 04 Created : 2020 Mar 04 Author : Burak Tokma...
test.py
import tkinter import tkinter as tk from tkinter import ttk def GUITEST(): # print(ttp._getNowTime()) root=tkinter.Tk() root.geometry("800x400") #print(datetime.datetime.now(), datetime.date.today()) # Frame=ttk.Frame(root, padding=16) # Label=tkinter.Label(text="現在時刻は"+str(ttp._getNowTime()...
test_io.py
# expected: fail """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 # * tes...
worker.py
import time import logging from functools import wraps from multiprocessing import Queue from threading import Thread LOG = logging.getLogger(__name__) try: import RPi.GPIO as GPIO except RuntimeError: LOG.warn("Not running on Raspberry Pi; controls unavailable") def async(function): @wraps(function) ...
test_report_server.py
# -*- coding: utf-8 -*- """Module unittests.test_report_server.py This module contains methods to test the report_server module via pytest. """ import os import time import signal from multiprocessing import Process from compliance_suite.report_server import capitalize, ReportServer from unittests.constants import OU...
crypto_util_test.py
"""Tests for acme.crypto_util.""" import itertools import socket import threading import time import unittest import six from six.moves import socketserver #type: ignore # pylint: disable=import-error import OpenSSL from acme import errors from acme import jose from acme import test_util class SSLSocketAndProbeS...
sleep_sort.py
import sys import threading from time import sleep def arg_to_list(string): return [int(x.strip(" "), 10) for x in string.split(',')] def sleep_sort(i, output): sleep(i) output.append(i) def error_and_exit(): print('Usage: please provide a list of at least two integers to sort in the format "1, 2,...
run.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- # python 3.3.2+ Indonesian Dos Script v.1 # by Can Yalçın # only for legal purpose from queue import Queue from optparse import OptionParser import time,sys,socket,threading,logging,urllib.request,random import os R = "\033[91;1m" G = "\033[92;1m" Y = "\033[93;1m" B = "\033[...
deployment.py
import logging from threading import Thread from deployer.components.vmgroup import VMGroup from deployer.errors import ArgumentsError from deployer.utils import generate_ssh_key_pair, get_random_file_name __author__ = 'Giannis Giannakopoulos' class Deployment: """ This class represents a deployment entity. ...
positionZMQSub.py
''' All components of this library are licensed under the BSD 3-Clause License. Copyright (c) 2015-, Algorithmic Robotics and Control Group @Rutgers (http://arc.cs.rutgers.edu). All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided...
test_task_manager.py
# SPDX-FileCopyrightText: 2017 Fermi Research Alliance, LLC # SPDX-License-Identifier: Apache-2.0 import os import threading from unittest.mock import patch import pytest import decisionengine.framework.config.policies as policies from decisionengine.framework.config.ValidConfig import ValidConfig from decisioneng...
TeslaAPI.py
import base64 import hashlib import json import logging import os import re import requests from threading import Thread import time from urllib.parse import parse_qs from ww import f logger = logging.getLogger("\U0001F697 TeslaAPI") class TeslaAPI: __apiCaptcha = None __apiCaptchaCode = None __apiCaptc...
ArknightsRoguelike.py
# 请参考视频教程 https://www.bilibili.com/video/BV1u3411E7KD/ 改写此脚本后再运行 # 请注意视频教程或文字教程中的相关注意事项 import RaphaelScriptHelper as gamer import multiprocessing import ResourceDictionary as rd import settings from enum import Enum class Direction(Enum): UP = 0 DOWN = 1 LEFT = 2 RIGHT = 3 # 请在跑脚本之前参考...
download_pdfs.py
import os import time import pickle import random import threading import requests import requests_random_user_agent from utils import Config timeout_secs = 10 # after this many seconds we give up on a paper if not os.path.exists(Config.pdf_dir): os.makedirs(Config.pdf_dir) db = pickle.load(open(Config.db_path,...
gragh_test.py
import pygame import threading import multiprocessing from colour import Color GR_HEIGHT = 400 GR_WIDTH = GR_HEIGHT * 3 all_pixels_num =64 sensor_data = [29.8888]*all_pixels_num bk_grd_data = [27.888]*all_pixels_num pixels_row = 8 pixels_colum = 8 height = 480 width = 480 pixels_size_height = height /pixels_co...
iron-plotter.py
from datetime import datetime, timedelta from multiprocessing.connection import Client, Listener from multiprocessing import Process, Pipe from collections import deque from math import nan import argparse import matplotlib.pyplot as plt import matplotlib.animation as animation import matplotlib def server(conn, seri...
Keylogger.py
# Import modules from pynput.keyboard import Listener, Key # pip install pynput from threading import Thread class Logger: # Constructor def __init__(self): self.__keys = '' self.__stopped = None self.__thread = self.__NewThread() # Log key press def __LogKeyPre...
labels.py
import hashlib import requests import threading import json import sys import traceback import base64 import electrum_dash from electrum_dash.plugins import BasePlugin, hook from electrum_dash.i18n import _ class LabelsPlugin(BasePlugin): def __init__(self, parent, config, name): BasePlugin.__init__(se...
mock_binary_server.py
import socket import socketserver import threading class MockMemSession(socketserver.BaseRequestHandler): def handle(self): data = self.request.recv(1024) self.server.append(data) self.server.server.basic_handler(self.server.data, self.request) class MockMemcachedServerInternal(socketser...
ocs_end_of_night_process.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # + # import(s) # - from OcsCameraEntity import * from OcsSequencerEntity import * import multiprocessing import os # + # function: worker_code() # - def worker_code(entity='', entobj=None): # debug output print('name: {0:s}'.format(multiprocessing.current_proc...
TkBoard.py
import socket, sys, time from Tkinter import * from math import floor from GameStack import GameStack import Helpers as h from sys import argv from time import sleep from threading import Thread from threading import Timer import time import select # TODO - print graph socket_list = [] #Accepting incoming connections...
tf_utils.py
import tensorflow as tf def _weight_variable(shape): initial = tf.truncated_normal(shape, stddev=0.1) return tf.get_variable("W", initializer=initial) def _bias_variable(shape): initial = tf.constant(0.1, shape=shape) return tf.get_variable("b", initializer=initial) def _linear(x, output_size, name): ...
server_client.py
#!/usr/bin/env python import socket # Import socket module import serial, time import binascii import struct import SocketServer import threading import logging import Queue import argparse from select import select import sys import parse # Time to allow a connection to stay open (in seconds) TIMEOUT = ...
meterserver-rpyc.py
#!/usr/bin/env python3 # Copyright © 2012-13 Qtrac Ltd. All rights reserved. # This program or module 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 ...
livegame.py
#!/usr/bin/env python import time; import curses; import sys; import argparse; import pickle; import socket; import threading; import re; import string; import pygame; import errno; import os; # For the server, the list of client sockets connected to us connected_sockets = []; connected_sockets_lock = threading.Lock(...
test.py
# # Simple benchmarks for the multiprocessing package # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # import time, sys, multiprocessing, threading, queue, gc if sys.platform == 'win32': _timer = time.clock else: _timer = time.time delta = 1 #### TEST_QUEUESPEED def queuespeed_func(q, c, it...
test_dogstatsd.py
# stdlib from unittest import TestCase import socket import threading import Queue from collections import defaultdict # 3p import mock # project from dogstatsd import mapto_v6, get_socket_address from dogstatsd import Server, init from utils.net import IPV6_V6ONLY, IPPROTO_IPV6 class TestFunctions(TestCase): d...
train.py
# Author: Bichen Wu (bichen@berkeley.edu) 08/25/2016 """Train""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import cv2 from datetime import datetime import os.path import sys import time import numpy as np from six.moves import xrange import tensorfl...
parallel.py
import logging import multiprocessing import threading from dataclasses import dataclass from typing import TypeVar, Generic, List, Tuple, Callable from glimmer.processing import Topology, Operator, Source, Sink, Node, Executable, Environment Result = TypeVar("Result") Out = TypeVar("Out") @dataclass class Parallel...
artifact_service.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 use ...
gameWithCom.py
# -*- coding:utf-8 -*- import LED_display as LED import threading import keyboard import time import numpy as np import random import copy import os import sys import serial ser = serial.Serial('/dev/ttyACM0', 9600) ser_who = -1 num_1=[[0,1,0,0], [1,1,0,0], [0,1,0,0], [0,1,0,...
chatb_process.py
__author__ = 'Aaron Yang' __email__ = 'byang971@usc.edu' __date__ = '8/4/2020 11:30 AM' from multiprocessing import Process lis = [] def foo(i): lis.append(i) print("This is Process ", i, " and lis is ", lis, " and lis.address is ", id(lis)) if __name__ == '__main__': for i in range(5): p = P...
test_utils.py
# Copyright 2017 Mycroft AI Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
agent.py
import logging import os import queue import threading import time import traceback import uuid from signal import SIGINT, SIGTERM, signal import zmq from pyrsistent import pmap from rx.subject import Subject from .mixins import ( AuthenticationMixin, NotificationsMixin, RouterClientMixin, WebserverMi...
dask_util.py
# -*- coding: utf-8 -*- from collections import defaultdict from timeit import default_timer from threading import Event, Thread, Lock import os import time import sys try: from dask.callbacks import Callback from dask.utils import ignoring except ImportError as e: opt_import_err = e Callback = object ...
dashboard.py
import collections import threading import time import numpy as np from optuna._imports import try_import import optuna.logging import optuna.study from optuna.study import StudyDirection import optuna.trial from optuna import type_checking if type_checking.TYPE_CHECKING: from typing import Any # NOQA from ...
script.py
import requests import time import random import threading TOKEN = "" CHANNEL = 000000000000 DELAY = 3 AMOUNT = 4 def random_chars() -> str: return "".join(random.choice("abcdefghijklmnopqrstuvwxyz") for i in range(0, random.randint(1, 20))) def spam_channel(token: str, channel_id=str, content=str, ...
sac.py
"""Author: Brandon Trabucco, Copyright 2019, MIT License""" import multiprocessing from cs285.baselines.off_policy.sac import SAC from gym.envs.mujoco.half_cheetah import HalfCheetahEnv def run_experiment(experiment_id): SAC( HalfCheetahEnv, logging_dir="./half_cheetah/sac/{}".format(experiment_...
TiltTracker.py
# The Leginon software is Copyright 2004 # The Scripps Research Institute, La Jolla, CA # For terms of the license agreement # see http://ami.scripps.edu/software/leginon-license # import threading import wx from leginon.gui.wx.Choice import Choice from leginon.gui.wx.Entry import Entry, FloatEntry, IntEntry, EVT_ENT...
grader.py
#!/usr/bin/python\ import sys import os from multiprocessing import Process import time import threading import MySQLdb moduleNames = [str(sys.argv[3])] modules = map(__import__, moduleNames) dct = {} for x in xrange(4,len(sys.argv),2): if (sys.argv[x+1] == "''"): sys.argv[x+1] = "" dct[str(sys.argv[x])] =...
eon_testing_slave.py
#!/usr/bin/env python3 import re import time import json import requests import subprocess from common.timeout import Timeout from http.server import BaseHTTPRequestHandler, HTTPServer from os.path import expanduser from threading import Thread from selfdrive.manager import unblock_stdout from common.params import Par...