source
stringlengths
3
86
python
stringlengths
75
1.04M
pkb.py
# Copyright 2019 PerfKitBenchmarker 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...
test_sigma_dut.py
# Test cases for sigma_dut # Copyright (c) 2017, Qualcomm Atheros, Inc. # # This software may be distributed under the terms of the BSD license. # See README for more details. import logging logger = logging.getLogger() import os import socket import subprocess import threading import time import hostapd from utils i...
helpers.py
"""High-level functions to help perform complex tasks """ from __future__ import print_function, division import os import multiprocessing as mp import warnings from datetime import datetime import platform import struct import shutil import copy import numpy as np import pandas as pd import time pd.options.display.m...
web.py
"""Runs the web interface version of chemprop, allowing for training and predicting in a web browser.""" from argparse import ArgumentParser, Namespace import os import sys import shutil from tempfile import TemporaryDirectory, NamedTemporaryFile from typing import List, Tuple import time import multiprocessing as mp ...
kbapi.py
import hid import struct import threading import queue import platform import sys import time import cv2 import numpy as np # define MAX_PAK_DATALEN 56 # typedef struct __packed{ # uint8_t reportID; # uint8_t datalen; # uint16_t packageID; # uint32_t addr; # uint8_t data[MAX_PAK_DATALEN]; # }hid_...
throttled.py
#!/usr/bin/env python3 from __future__ import print_function import argparse import configparser import glob import gzip import os import re import struct import subprocess import sys from collections import defaultdict from datetime import datetime from errno import EACCES, EPERM from multiprocessing import cpu_count...
hypothesis_test.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import copy import time from functools import partial, reduce from future.utils import viewitems, viewkeys from hypothesis import assume, given, settings, HealthCheck import hypothesis.strate...
test_io.py
from __future__ import division, absolute_import, print_function import sys import gzip import os import threading from tempfile import NamedTemporaryFile import time import warnings import gc from io import BytesIO from datetime import datetime import numpy as np import numpy.ma as ma from numpy.lib._iotools import ...
startServer.py
""" MIT License Copyright (c) 2021 Meme Studios Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, ...
test_waffle.py
from __future__ import unicode_literals import logging import random import threading import unittest from django.contrib.auth import get_user_model from django.conf import settings from django.contrib.auth.models import AnonymousUser, Group from django.db import connection, transaction from django.test import Reques...
job_manager.py
#!/usr/bin/env python import os import sys import time import Queue import threading import subprocess import shlex import signal import json import argparse all_patts = ['all', '*'] # TODO: all this stuff should be wrapped in some kind of state object and passed around pipe_name = 'jobs.pipe' max_jobs = 4 jobs_runni...
helper.py
import threading import json from itertools import islice def create_task(target, daemon=True): task = threading.Thread(target=target) task.setDaemon(daemon) task.start() return task def proccess_reply(reply): try: return json.loads(reply) except: return reply def dps_to_value...
trainer.py
# Lint as: python3 # Copyright 2018 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 ...
server.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Created by yetongxue<me@xander-ye.com> import socket import threading server=socket.socket(socket.AF_INET,socket.SOCK_STREAM) server.bind(('0.0.0.0',8001)) server.listen() def handle_sock(sock,addr): data = sock.recv(1024) print(addr,data.decode('utf8')) r...
CrawlerWrapper.py
# /usr/bin/env python3 # -*- coding: utf-8 -*- ''' 代理IP抓取Worker ''' from Lib.Config import WebConf, UserAgent from Lib.Parser import XiCiParser, IP181Parser, KuaiIPParser, Data5UParser from Lib.Checker import ProxyChecker from Lib.AutoLock import AutoLock from Lib.DBHelper import DBHelper import requests as rq i...
app.py
#!/usr/bin/env python3 """DConnect application class""" import sys import signal import socket import logging.handlers from random import randint from threading import Thread from socketserver import ThreadingUDPServer, UDPServer from .device_manager import DeviceManager, Device from .server_search import ServerSear...
aio_client_multithreads.py
# -*- coding: utf-8 -*- from concurrent.futures import ThreadPoolExecutor import asyncio import zmq import zmq.asyncio url = "tcp://127.0.0.1:5000" loop = zmq.asyncio.ZMQEventLoop() @asyncio.coroutine def recv_and_process(num): ctx = zmq.asyncio.Context() # sock = ctx.socket(zmq.SUB) sock = ctx.socket(zmq.PULL...
__init__.py
# Copyright 2019 Atalaya Tech, 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 writing,...
client.py
#!/usr/bin/env python3 ''' Created on 29.3.2017 @author: T ''' import socket import time from time import gmtime, strftime import threading import signal from datetime import datetime import sys DEFAULT_HOST = "127.0.0.1" PORT = 5000 DEFAULT_NICK = "Anonymous" BUFFER_SIZE = 1024 DEBUG = False running = True print_...
test_server.py
import requests import threading from moksha_monitor_exporter.moksha_monitor_exporter import app from requests.packages.urllib3.util.retry import Retry session = requests.Session() session.mount('http://', requests.adapters.HTTPAdapter( max_retries=Retry( total=3, backoff_factor=0.5, ))) cla...
tests.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 us...
payments.py
import json from . import db, config, wallet from .priceinfo import ticker import decimal import time import threading import logging import imp import os from hashlib import sha1 from pycoin.encoding import b2a_base58 from .db import qNum D = decimal.Decimal def normalizeAmount(amount): return D(str(amount)).quan...
mock_web_api_server.py
import asyncio import json import logging import re import sys import threading import time from http import HTTPStatus from http.server import HTTPServer, SimpleHTTPRequestHandler from multiprocessing.context import Process from typing import Type from unittest import TestCase from urllib.request import Request, urlop...
life.py
#!/usr/bin/env python3 from functools import partial from threading import Thread from time import sleep from tkinter import Tk, messagebox, Canvas from tkinter.ttk import Style, Frame, Button class CanvasGrid(Canvas): def __init__(self, master=None, data=None, cell_size=10, color='green'): self.cell = d...
params.py
#!/usr/bin/env python3 """ROS has a parameter server, we have files. The parameter store is a persistent key value store, implemented as a directory with a writer lock. On Android, we store params under params_dir = /data/params. The writer lock is a file "<params_dir>/.lock" taken using flock(), and data is stored in...
sbp_arbitrator.py
#!/usr/bin/env python import rospy import os import datetime import subprocess import json import sbp.msg import sys import time import operator import threading import Queue as queue from multiprocessing import Process, Value from multiprocessing.managers import BaseManager from sbp.table import dispatch from sbp.c...
autoreload.py
#!/usr/bin/env python3 from lightning import Plugin import json import psutil import subprocess import threading import time import os try: # C-lightning v0.7.2 plugin = Plugin(dynamic=False) except: plugin = Plugin() class ChildPlugin(object): def __init__(self, path, plugin): self.path = p...
pss.py
import os import threading from cm.util import misc from cm.util import cluster_status from cm.services import service_states from cm.services import ServiceRole from cm.services.apps import ApplicationService import logging log = logging.getLogger('cloudman') class PSSService(ApplicationService): """ post_start...
test_run.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2019-2021 tecnovert # Distributed under the MIT software license, see the accompanying # file LICENSE or http://www.opensource.org/licenses/mit-license.php. """ basicswap]$ pytest Run one test: $ pytest -v -s tests/basicswap/test_run.py::Test::test_04_lt...
client_socket.py
# TODO documentation from __future__ import print_function import sys import socket import threading import select from fprime.constants import DATA_ENCODING # Constants for public use GUI_TAG = "GUI" FSW_TAG = "FSW" class ThreadedTCPSocketClient(object): '''Threaded TCP client that connects to teh socket server w...
command_line_interface.py
""" Helper classes that allow to invoke training and execution of clients using command line arguments. """ # TODO: Properly compile this before running on OTHR computers import pyximport; pyximport.install() import definitions import argparse import importlib import logging import hometrainer.distribution as distribut...
solve_hallway.py
import logging import time from typing import Tuple import tensorflow as tf import sqlalchemy from sqlalchemy import create_engine from rlmolecule.tree_search.reward import LinearBoundedRewardFactory logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) def construct_problem(ranked_reward=T...
fb_manager.py
from os.path import join from kivy.utils import platform from kivy.storage.dictstore import DictStore from kivy.logger import Logger if platform == 'android': pass elif platform == 'ios': pass else: import webbrowser from threading import Thread from requests_oauthlib import OAuth2Session fro...
Polls.py
import datetime import threading import discord import asyncio import json import operator import os # Every module have his own function, don't mix them in one file from DjangoORM import addPollsVote, getList, pollObject, pollDelete, pollOptionCreate, pollWinnerSet, getAllActivePolls, getPoll, timezone from discord_c...
Search.py
import sublime, sublime_plugin import subprocess, os import threading from queue import Queue class CodeSearchEvents(sublime_plugin.EventListener): LastSearchString = "" SearchActive = False def on_load_async(self, view): if CodeSearchEvents.SearchActive: regions = view.find_all(CodeSearchEvents.LastSearchStr...
pika.py
import json import logging import os import time import typing from collections import deque from threading import Thread from typing import Callable, Deque, Dict, Optional, Text, Union from rasa.constants import ( DEFAULT_LOG_LEVEL_LIBRARIES, ENV_LOG_LEVEL_LIBRARIES, DOCS_URL_EVENT_BROKERS, ) from rasa.co...
manager.py
#!/usr/bin/env python3 import os import time import sys import fcntl import errno import signal import shutil import subprocess import datetime import textwrap from typing import Dict, List from selfdrive.swaglog import cloudlog, add_logentries_handler from common.basedir import BASEDIR, PARAMS from common.android im...
championship.py
from immutable import List, Map, set, append, remove, pop, add, toPython from datastore import Datastore import json import time from chat import postChat from jsonNetwork import fetch, Timeout from games import game from threading import Thread from match import postMatchState getState, updateState, subscribe = Datas...
gui.py
"""Tkinter-based GUI""" import logging import threading import tkinter as tk import tkinter.ttk as ttk import tkinter.filedialog as filedialog import tkinter.scrolledtext as scrolledtext from musedash_ripper import core logger = logging.getLogger(__name__) class Application(ttk.Frame): def __init__(self, mast...
deploy.py
import sys import subprocess from docker_honey.util import * from docker_honey.collector_actions import * from docker_honey.commands import * from docker_honey.consts import GLOBAL_NOTIFIER as NOTIFIER from docker_honey.consts import * from docker_honey.notify import * from docker_honey.simple_commands.app import Hyper...
contextutil.py
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations import logging import os import shutil import ssl import sys import tempfile import threading import zipfile from contextlib import contextmanager from ...
DebugReloader.py
import logging import time import threading from Config import config if config.debug: # Only load pyfilesytem if using debug mode try: from fs.osfs import OSFS pyfilesystem = OSFS("src") pyfilesystem_plugins = OSFS("plugins") logging.debug("Pyfilesystem detected, source code auto...
timer.py
__author__ = 'shengjia' import threading import time class Timer: def __init__(self, max_time): self.max_time = max_time self.begin_time = time.time() self.time_out_flag = False self.time_out_flag_lock = threading.Lock() self.timer_thread = threading.Thread(target=self.tim...
dns-amp.py
import time, sys, threading, argparse, socket try: from dns import resolver except: print " dnspython is not installed." print " Download: https://github.com/rthalley/dnspython" sys.exit() parser = argparse.ArgumentParser() parser.add_argument("-d", "--dns",help="DNS Server List",default=["4.2.2.1","4.2.2.2","4.2....
test.py
from contextlib import contextmanager ## sudo -H pip install PyMySQL import pymysql.cursors import pytest import time import threading from helpers.cluster import ClickHouseCluster from helpers.client import QueryRuntimeException cluster = ClickHouseCluster(__file__) node1 = cluster.add_instance('node1', main_config...
test_flow.py
import unittest import logging from flowbee.workers import Worker from flowbee.deciders import Decider from flowbee.cli.test import MyWorkflow log = logging.getLogger("flowbee.test") class TestFlow(unittest.TestCase): def test_create_resources(self): return from flowbee.cli.runner import Runner ...
labels.py
import hashlib import requests import threading import json import sys import traceback import base64 import electrum from electrum.plugins import BasePlugin, hook from electrum.i18n import _ class LabelsPlugin(BasePlugin): def __init__(self, parent, config, name): BasePlugin.__init__(self, parent, con...
ThreadEx1.py
import threading #아래는 쓰레드에서 실행 시킬 함수 이다. def worker(count): print("name: %s, args: %s " % (threading.currentThread().getName(), count)) def main(): for i in range(50): t = threading.Thread(target=worker, name="thread %i" % i, args=(i,)) t.start() if __name__ == "__main__": main()
ups_streamer.py
__author__ = "Your name" __email__ = "Your email" __version__ = "0.1" from threading import Thread import subprocess from time import sleep class UpsStreamer(object): """ Docstring here """ def __init__(self, message_queue): """ :param self: """ self.message_queue = ...
singleMachine.py
# Copyright (C) 2015-2016 Regents of the University of California # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
webserver.py
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
utils.py
#!/usr/bin/env python3 # # Electron Cash - lightweight Bitcoin Cash client # Copyright (C) 2012 thomasv@gitorious # # This file is: # Copyright (C) 2018 Calin Culianu <calin.culianu@gmail.com> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated document...
alfredlog.py
"""Provides basic logging configuration for alfred experiments. .. moduleauthor: Johannes Brachem <jbrachem@posteo.de> """ from builtins import object import logging import sys import os import traceback import queue import threading import copy import re from pathlib import Path from typing import Union from .confi...
smb_hashes.py
from src.platform.jboss.authenticate import checkAuth from src.platform.jboss.interfaces import JINTERFACES from src.lib.cifstrap import Handler from collections import OrderedDict from threading import Thread from log import LOG from auxiliary import Auxiliary from time import sleep import socket import utility import...
x.py
# LICENSE https://github.com/L-codes/Neo-reGeorg/blob/master/LICENSE from threading import Thread from itertools import chain from socket import * from datetime import datetime from time import sleep, time, mktime import codecs import uuid import requests import hashlib import random import struct import base64 import ...
safe_t.py
from binascii import hexlify, unhexlify import traceback import sys from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING from electrum_zcash.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException from electrum_zcash.bip32 import BIP32Node from electrum_zcash import con...
main.py
#!/usr/bin/env python3 import argparse from http.server import BaseHTTPRequestHandler from http.server import HTTPServer import ipaddress import json import os try: from secrets import token_hex except ImportError: def token_hex(nbytes=None): return os.urandom(nbytes).hex() import socket from socketser...
025.0195-send-a-value-to-another-thread.py
"""Send a value to another thread. Share the string value "Alan" with an existing running process which will then display "Hello, Alan" Source: programming-idioms.org """ # Implementation author: programming-idioms.org # Created on 2016-02-18T16:57:58.135862Z # Last modified on 2016-02-18T16:57:58.135862Z # Version ...
build.py
# -*- coding: utf-8 -*- from __future__ import (unicode_literals, absolute_import, division, print_function) import os import time import threading from glob import glob import genpac from genpac import GenPAC, Config, Namespace # 使用进程 uwsgi需使用参数--enable-threads # REF: # https://stackoverflow...
coap.py
# -*- coding: utf-8 -*- # pylint: disable=broad-except, bare-except, invalid-name import threading from datetime import datetime, timedelta import time import socket import struct from .compat import s from .utils import exception_log from .const import ( LOGGER, COAP_IP, COAP_PORT ) class...
guimodel.py
# -*- coding: utf-8 -*- import inspect import typing import dataclasses import math import os import sys import traceback import copy import datetime import time # import textwrap #import pprint import pickle import PIL import functools #import copy #from operator import getitem, setitem import mpmath import threading...
QSubprocessor.py
import multiprocessing import sys import time import traceback from PyQt6.QtCore import * from PyQt6.QtGui import * from PyQt6.QtWidgets import * from .qtex import * class QSubprocessor(object): """ """ class Cli(object): def __init__ ( self, client_dict ): s2c = multiprocessing...
test_ki.py
import outcome import pytest import sys import os import signal import threading import contextlib import time from async_generator import ( async_generator, yield_, isasyncgenfunction, asynccontextmanager ) from ... import _core from ...testing import wait_all_tasks_blocked from ..._util import signal_raise, is_...
base.py
import logging import multiprocessing import socket import floto.api logger = logging.getLogger(__name__) class Base: def __init__(self, swf=None, identity=None): """Base class for deciders. Parameters ---------- swf: floto.api.Swf The SWF client, if swf is None an in...
exec.py
import os import subprocess import sys import threading import time import codecs import signal import html import sublime import sublime_plugin import re import datetime g_last_scroll_positions = {} g_last_click_time = time.time() g_last_click_buttons = None try: from FixedToggleFindPanel.fixed_toggle_find_p...
USBPrinterOutputDeviceManager.py
# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import threading import time import serial.tools.list_ports from PyQt5.QtCore import QObject, pyqtSlot, pyqtProperty, pyqtSignal from UM.Logger import Logger from UM.Signal import Signal, signalemitter from UM.OutputDevic...
optimize_pickups.py
from smartmonkey import Client import math from smartmonkey.models import ( Vehicle, ) import threading import time import sys import json import random class Spinner: busy = False delay = 0.1 @staticmethod def spinning_cursor(): while 1: for cursor in '|/-\\': ...
websockets.py
import logging from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket import urllib.request, json from xml.dom import minidom import random import unicodedata import time import sys from threading import Thread logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG) WEATHERAPIKEY = '5d...
emails.py
from flask import render_template from flask_mail import Message from app import mail from decorators import async from config import ADMINS, APP_NAME @async def send_async_email(msg): mail.send(msg) def send_email(subject, sender, recipients, text_body, html_body): msg = Message(subject, sender=sender, rec...
keep_alive.py
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def home(): return "Bot is online" def run(): app.run(host='0.0.0.0',port=8080) def keep_alive(): t = Thread(target=run) t.start()
main.py
""" Example script for testing the Azure theme Author: rdbende License: GNU GPLv2.1 """ # Importing the libraries import psutil import time import platform import tkinter as tk from tkinter import ttk from threading import * import socket # Create the window root = tk.Tk() root.title('Personal Computer Monitoring') r...
ultimate.py
# -*- coding: utf-8 -*- from glob import glob import os import sys import threading import time sys.path.append(os.path.join(sys.path[0], '../../')) import schedule from instabot import Bot, utils import config bot = Bot(comments_file=config.COMMENTS_FILE, blacklist_file=config.BLACKLIST_FILE, w...
test_ipc.py
import abc import itertools import multiprocessing import sys import textwrap import time import traceback from typing import Any, List, Optional, cast import pytest import determined as det from determined import core, ipc from tests import parallel class Subproc(multiprocessing.Process): """ Subproc execu...
bot.py
# -*- coding: utf-8 -*- import LINETCR from LINETCR.lib.curve.ttypes import * from datetime import datetime import time,random,sys,json,codecs,threading,glob,re,ast,os,subprocess,requests cl = LINETCR.LINE() #cl.login(qr=True) cl.login(token="EnliZjabbWniaqdsPTt5.nqZhqiZgZilGvU4eyth5jq.4DldEayovtSgtlpllfy/HiizJIJKmoj...
a3c-gs.py
import tensorflow as tf from time import sleep import threading import numpy as np from tensorflow.contrib import slim import time import scipy.signal import cv2 #import gym import csv from scipy.ndimage.filters import gaussian_filter1d from simulator import simulator num_workers = 2; global_workers = 3 #there are 2 w...
cli.py
import ast import inspect import os import platform import re import sys import traceback import warnings from functools import update_wrapper from operator import attrgetter from threading import Lock from threading import Thread import click from werkzeug.utils import import_string from .globals import current_app ...
run.py
#!/usr/bin/env python # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: # # Copyright 2021 The NiPreps Developers <nipreps@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with ...
testnd.py
'''Statistical tests for NDVars Common Attributes ----------------- The following attributes are always present. For ANOVA, they are lists with the corresponding items for different effects. t/f/... : NDVar Map of the statistical parameter. p_uncorrected : NDVar Map of uncorrected p values. p : NDVar | None ...
launcher.py
# Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this f...
multiprocessing5_1.py
import multiprocessing import sys import time def worker_with(f): fs = open(f, 'a+') n = 10 while n > 1: fs.write("Locked acquired via with\n") time.sleep(1) n -= 1 fs.close() def worker_no_with(f): fs = open(f, 'a+') n = 10 w...
fish-tank.py
# old code import time, socket, json, pickle, datetime, queue, threading from adafruit_motorkit import MotorKit from adafruit_motor import stepper import serial def main(q1): connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM) connection.connect(('pi.cmasterx.com', 8000)) while True: t...
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 (the # "License"); you may not...
manager.py
import time import threading import time from multiprocessing import Process, Queue from explorer.utils.misc_helpers import get_sliced_range from explorer.utils import CustomLogger from explorer.models import WorkerTask from explorer.services import Worker class WorkerManager(): def __init__(self, callback_fun...
na_santricity_proxy_systems.py
#!/usr/bin/python # (c) 2020, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = """ --- module: na_santricity_proxy_systems short_description: NetApp E-Series m...
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...
singlethread.py
''' author: Rodrigo Dal Ri email: rodrigodalri1995@gmail.com ''' import logging import threading import time def thread_function(name): logging.info("Thread %s: starting", name) time.sleep(2) logging.info("Thread %s: finishing", name) if __name__ == "__main__": format = "%(asctime)s: %(message)s" ...
test_simulator.py
import multiprocessing import os.path as osp import random import magnum as mn import numpy as np import pytest import examples.settings import habitat_sim def test_no_navmesh_smoke(sim): sim_cfg = habitat_sim.SimulatorConfiguration() agent_config = habitat_sim.AgentConfiguration() # No sensors as we ar...
rdd.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 us...
amazon.py
from .util import Envoy, is_valid import multiprocessing from concurrent.futures import ThreadPoolExecutor import threading class AmazonAlexa(Envoy): def __init__(self, debug=False, token=None, base_url='https://api.botanalytics.co/v1/', callback=None, is_async=False): """ :para...
datasets.py
# Dataset utils and dataloaders import glob import logging import math import os import random import shutil import time from itertools import repeat from multiprocessing.pool import ThreadPool from pathlib import Path from threading import Thread import cv2 import numpy as np import torch import torch.nn.functional ...
lanGhost.py
#!/usr/bin/env python3 # -.- coding: utf-8 -.- # lanGhost.py # author: xdavidhu try: import logging logging.getLogger("scapy.runtime").setLevel(logging.ERROR) # Shut up scapy! from telegram.ext import Updater, CommandHandler, MessageHandler, Filters from netaddr import IPAddress from time import ...
windowsui_poco.py
# -*- coding: utf-8 -*- import threading from poco.drivers.std import StdPoco from poco.utils.device import VirtualDevice from poco.drivers.std import DEFAULT_ADDR, DEFAULT_PORT from poco.utils.simplerpc.utils import sync_wrapper from poco.exceptions import InvalidOperationException class WindowsPoco(StdPoco): "...
sockets.py
import socket import struct from threading import Thread from time import sleep from bases.fl.messages import MessageTypes, ClientToServerAckMessage from utils.save_load import dumps, loads __all__ = ["ServerSocket", "ClientSocket"] class Socket(socket.socket): def recv_msg(self): msg_len = struct.unpac...
shapenet.py
import json import logging import os.path as osp from Queue import Empty, Queue from threading import Thread, current_thread import numpy as np from config import SHAPENET_IM from loader import read_camera, read_depth, read_im, read_quat, read_vol def get_split(split_js='data/splits.json'): dir_path = osp.dirna...
hydrus_client.py
#!/usr/bin/env python3 # Hydrus is released under WTFPL # You just DO WHAT THE FUCK YOU WANT TO. # https://github.com/sirkris/WTFPL/blob/master/WTFPL.md import locale try: locale.setlocale( locale.LC_ALL, '' ) except: pass try: import os import argparse import sys from hydrus.core import H...
kubot_client.py
import socketserver import threading from .stream_handler import StreamHandler class KubotClient: """Client class, listening data from the dispatcher """ def __init__(self, submission_handler: StreamHandler, comment_handler: StreamHandler): self.submission_handler = submission_h...
get_and_display_data.py
from __future__ import division import threading import rethinkdb as r import math import numpy as np import cv2 from matplotlib import pyplot as plt import os def kmeans(Z,STO):# pg please make Z a np array like the one described below :P #Z = np.array([[a1,b1],[x1,y1],[x2,y2],[a3,b3],[a2,b2]]) # convert to np.f...
training.py
from __future__ import print_function from __future__ import absolute_import import warnings import copy import time import numpy as np import multiprocessing import threading try: import queue except ImportError: import Queue as queue from .topology import Container from .. import backend as K from .. import...
learner.py
import time import numpy as np import torch import threading import torch.backends.cudnn import json from agent.algorithms.v_trace import v_trace from agent.learner_d.builder.learner_builder import LearnerBuilder from agent.learner_d.builder.learner_builder_sync import LearnerBuilderSync from scheduler.polynomial_lr_s...
gui_base.py
""" @name `gui_base.py` @description `src file for GUI base class` @package `GUI for Fortran/C++ Application` @official_repository `https://github.com/the-utkarshjain/GUI-for-Fortran` @contributors * Abhishek Bhardwaj * Utkarsh Jain * Jhalak Choudhary * Navya ...