source
stringlengths
3
86
python
stringlengths
75
1.04M
mycron.py
""" Custom Cron (scheduler) """ import datetime import time import threading class MyCron(object): """ Custom cron (scheduler) class Check tasks at every <base_delay> seconds (can be float). Runs them when they should run (every <freq> checks). Usage: cron = MyCron(60) # check once a mi...
6_rms_wound_wait_NS.py
from functools import reduce from sys import * import numpy as np import random as r import ping_code as pc import socket import struct import subprocess as sp import threading from threading import Thread import ast import time import datetime as dt import os import psutil import getpass as gp from netifaces import in...
train_pg.py
import numpy as np import tensorflow as tf import gym import logz import scipy.signal import os import time import inspect from multiprocessing import Process from gym import wrappers #============================================================================================# # Utilities #===========================...
bot.py
# coding=utf-8 import asyncio import time from datetime import datetime from threading import Thread from typing import Dict, Optional, Union import discord import requests from colorama import Back from discord import Game, Embed, Colour, Client, Channel from .config import Config from .stream import ZaifStream from...
webcam.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 applicab...
socketio_client.py
""" SocketIOClient ============== Example:: from amitu.socketio_client import SocketIOClient sock = SocketIOClient("localhost", 8081) def my_connect(): print("opened!") sock.emit("browser", "data!") sock.on("server", on_server) def on_server(data): print data so...
test_contextlocals.py
# -*- coding: utf-8 -*- ''' Some objects are context-local, meaning that they have different values depending on the context they are accessed from. A context is currently defined as a thread. ''' import unittest import bottle import threading def run_thread(func): t = threading.Thread(target=func) t.start()...
hue.py
from phue import Bridge import threading import random import time class HueController: def __init__(self): self.bridge = Bridge('192.168.1.107') # Enter bridge IP here. #If running for the first time, press button on bridge and run with b.connect() uncommented #bridge.connect() se...
labels.py
import base64 import json import hashlib import logging import requests import threading from electrumsv.bitcoin import aes_decrypt_with_iv, aes_encrypt_with_iv from electrumsv.plugin import BasePlugin, hook logger = logging.getLogger("plugin.labels") class LabelsPlugin(BasePlugin): def __init__(self, parent, c...
test_game_threading.py
from __future__ import unicode_literals, print_function import threading from netrps.game import play_second, play_first def test_game(turn, reset_beacon): results = [] def wrapped_play(n, my_move_char): if n == 1: result = play_first(my_move_char) else: result = pla...
bz2_server.py
#!/usr/bin/env python3 # encoding: utf-8 # # Copyright (c) 2008 Doug Hellmann All rights reserved. # """ """ #end_pymotw_header import bz2 import logging import socketserver import binascii BLOCK_SIZE = 32 class Bz2RequestHandler(socketserver.BaseRequestHandler): logger = logging.getLogger('Server') def ha...
memcached.py
#!/usr/bin/env https://github.com/Tandelajr/mr.tandela # MIT License # # Copyright (C) 2020, Entynetproject. All Rights Reserved. # # 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 re...
jitrebalance.py
#!/usr/bin/env python3 from math import ceil from pyln.client import Plugin, Millisatoshi, RpcError import binascii import hashlib import secrets import threading import time plugin = Plugin() def get_reverse_chan(scid, chan): for c in plugin.rpc.listchannels(scid)['channels']: if c['channel_flags'] != c...
__init__.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of command_runner module """ command_runner is a quick tool to launch commands from Python, get exit code and output, and handle most errors that may happen Versioning semantics: Major version: backward compatibility breaking changes Minor ...
__init__.py
"""Unit test package for niko_homekit.""" import pytest import json import threading from socket import socket from threading import Thread from niko_homekit.niko import Niko class MockNikoController(object): """Mocks a Niko Home Control controller """ def __init__(self): super(MockNikoControlle...
exchange.py
# DEPENDENCIES import time import os import threading import numpy as np # CUSTOM MODULES import support from globals import config_dict class Exchange(object): """ The Exchange class keeps track of the prices """ def __init__(self): self.price_vector:np.ndarray = np.array([co...
8_queued_no_waits.py
import time import random import queue from threading import Thread # still needed for daemon threads from concurrent.futures import ThreadPoolExecutor counter = 0 job_queue = queue.Queue() counter_queue = queue.Queue() def increment_manager(): global counter while True: increment = counter_queue.get() # this...
arrow_dataset_ops.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...
test_clients.py
# -*- coding: utf-8 -*- # Copyright 2012-2021 CERN # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
tagsyi.py
import time import pymysql import multiprocessing from pymysql.cursors import DictCursor from multiprocessing import Process, Pool db1 = pymysql.connect("localhost", "root", "", "bidscore") db2 = pymysql.connect("localhost", "root", "", "miraihyoka") cursor_b = db1.cursor(DictCursor) cursor_m = db2.cursor(DictCursor...
chromedriver_tests.py
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Tests for ChromeDriver. If your test is testing a specific part of the WebDriver API, consider adding it to the appropriate place in the WebDriver tr...
worker.py
import queue import threading import websocket import json import time from django.utils import timezone from datetime import timedelta def _run_worker(): while True: _, fn, args = _work_queue.get() try: fn(*args) except: pass _work_queue = queue.PriorityQueue() _...
client-copy2.py
# -*- coding: utf-8 -*- import socket from tkinter import * import time import threading global sock,t, txtMsg,txtMsgList,addr,M,chat_client_list def Clear_History(): txtMsgList.delete('0.0', END) def sendMsg(sock): # 发送消息 text = txtMsg.get('0.0', END).strip() + "\n" txtMsg.delete('0.0', END) sock.se...
core.py
__all__ = ['setup_dirs', 'find_next_script', 'check_if_process_running', 'safe_rename', 'ResourcePoolBase', 'ResourcePoolCPU'] import logging import time from datetime import datetime import psutil logger = logging.getLogger(__name__) # Cell import os import subprocess from copy import copy from threading import...
reader.py
from queue import Queue import random def padding_seq(seq): results = [] max_len = 0 for s in seq: if max_len < len(s): max_len = len(s) for i in range(0, len(seq)): l = max_len - len(seq[i]) results.append(seq[i] + [0 for j in range(l)]) return results def en...
cnn_util.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...
hotword_factory.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...
optimizer_tcp_manager.py
import yaml import os import subprocess import socket import json import logging import time import math import pkg_resources from threading import Thread from retry import retry from .solver_response import SolverResponse class OptimizerTcpManager: """Client for TCP interface of parametric optimizers This c...
diskover_dupes.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """diskover - Elasticsearch file system crawler diskover is a file system crawler that index's your file metadata into Elasticsearch. See README.md or https://github.com/shirosaidev/diskover for more information. Copyright (C) Chris Park 2017-2019 diskover is released unde...
listener.py
#! /usr/bin/env python3 """ This is the main pi module. Only works on a raspberry pi (4). usage: python3 listener.py [-h] [--dirpath DIRPATH] [--modelpath MODELPATH] [--tokenfile TOKENFILE] [--permanent PERMANENT] [--server_url SERVER_URL] [--threshold THRESHOLD] ...
util.py
from __future__ import print_function from __future__ import absolute_import from __future__ import division import base64 import colorsys import codecs import errno import hashlib import json import getpass import logging import os import re import shlex import subprocess import sys import threading import time impor...
test.py
import unittest import configparser import subprocess import os, sys import random import ecdsa import threading import time import imp sys.path.append(os.path.realpath(os.path.dirname(__file__)+"/../../../")) imp.load_module('electroncash', *imp.find_module('lib')) imp.load_module('electroncash_gui', *imp.find_modul...
controlGUI.py
#! /usr/bin/python3 ''' This file contains GUI code for Controlling PiArm ''' import piarm import logging import os import threading import shutil import subprocess import time import re import picamera from tkinter import font import tkinter as tk from tkinter import messagebox from tkinter import simpledialog from ...
gobgp.py
# Copyright (C) 2015 Nippon Telegraph and Telephone 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 appli...
concurrency.py
from invoke.vendor.six.moves.queue import Queue from invoke.exceptions import ExceptionWrapper from invoke.util import ExceptionHandlingThread as EHThread from spec import Spec, ok_, eq_ # TODO: rename class ExceptionHandlingThread_(Spec): class via_target: def setup(self): def worker(q): ...
test_callbacks.py
import os import multiprocessing import numpy as np import pytest from csv import Sniffer import shutil from keras import optimizers from keras import initializers from keras import callbacks from keras.models import Sequential from keras.layers.core import Dense, Dropout from keras.layers.convolutional import Conv2D ...
__main__.py
""" Joseph's lemonbar """ import subprocess import time import threading import os from .elements import get_battery, get_ws, get_date, get_volume, now_playing from .constants import ( BG_COL, FG_COL, HL_COL, GENERAL_PLACEHOLDER, TEXT_FONT, ICON_FONT ) def restart(): print("Restarting...") os.execv...
main.py
import time from threading import Thread import keyboard import mouse def event_loop(): while True: if runnable_space: keyboard.press_and_release("space") if runnable_click: mouse.click() if exit_condition: break time.sleep(1) def reverse_runn...
flask_api.py
from flask import Flask, request from flask import jsonify from flask_cors import CORS, cross_origin from omegaconf import OmegaConf import numpy as np, math,torch,json from support import load_model,W2lKenLMDecoder,W2lViterbiDecoder,load_data import time,os import sys import webvtt from nltk import sent_tokenize # fro...
tunnel.py
# code for IP tunnel over a mesh # Note python-pytuntap was too buggy # using pip3 install pytap2 # make sure to "sudo setcap cap_net_admin+eip /usr/bin/python3.8" so python can access tun device without being root # sudo ip tuntap del mode tun tun0 # sudo bin/run.sh --port /dev/ttyUSB0 --setch-shortfast # sudo bin/run...
threading_test.py
#! /usr/bin/python """ Test by Karen Tracey for threading problem reported in http://www.mail-archive.com/matplotlib-devel@lists.sourceforge.net/msg04819.html and solved by JDH in git commit 175e3ec5bed9144. """ from __future__ import print_function import os import threading import traceback import numpy as np from...
eval.py
import sys import os sys.path.append(os.getcwd()) import threading import time import glob import numpy as np from utils.file_io import * from argparse import ArgumentParser import speechmetrics as sm MAX_THREAD = 3 root = os.getcwd() MUSDB_TEST = "data/musdb18hq/test" def sdr(references, estimates): # compute S...
perf_test_rest_api.py
""" Description: Scale up REST API functional tests to performance tests using threading. Note: requests module is synchronous and does not support asyncio to await for responses. Another option is to use aiohttp module, which uses asyncio for asynchrony. This option requires re-writing the API test functions, thou...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import electrum from electrum.bitcoin import TYPE_ADDRESS from electrum import WalletStorage, Wallet from electrum_gui.kivy.i18n import _ from electrum.paymentrequest import InvoiceStore from electr...
acquire.py
import zmq import json import numpy as np from base64 import standard_b64decode, standard_b64encode from types import MethodType #dont delete this gets called in an exec import warnings import re import time import json import multiprocessing import threading import queue from inspect import signature import copy impor...
test__socket.py
# This line can be commented out so that most tests run with the # system socket for comparison. from __future__ import print_function from __future__ import absolute_import from gevent import monkey; monkey.patch_all() import sys import array import socket import time import unittest from functools import wraps fro...
inference_webstreaming.py
import numpy as np import scipy, cv2, os, sys, argparse, audio import json, subprocess, random, string from tqdm import tqdm from glob import glob import torch, face_detection from models import Wav2Lip import platform # from flask import Response, Flask, render_template import threading import subprocess import zipfil...
vaitracePyRunner.py
#!/usr/bin/python3 # -*- coding: UTF-8 -*- # Copyright 2019 Xilinx 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...
run.py
# coding: utf-8 """ Usage: python [options] Options: -h,--help 显示帮助 -i,--inference 推断 [default: False] -a,--algorithm=<name> 算法 [default: ppo] -c,--config-file=<file> 指定模型的超参数config文件 [default: None] -e,--env=<file> 指定环境名称 [defaul...
test_server.py
# ***************************************** # |docname| - Tests using the web2py server # ***************************************** # These tests start the web2py server then submit requests to it. All the fixtures are auto-imported by pytest from ``conftest.py``. # # .. contents:: # # Imports # ======= # These are lis...
athenad.py
#!/usr/bin/env python3 import base64 import bz2 import hashlib import io import json import os import queue import random import select import socket import subprocess import sys import tempfile import threading import time from collections import namedtuple from datetime import datetime from functools import partial f...
tornadoWebControl.py
import tornado.web import tornado.websocket import tornado.ioloop import os import sys import serial import time import threading #host=os.environ['IP'] #port=os.environ['PORT'] host="*" port="8080" #PORT = "loop://logging=debug" PORT = "/dev/ttyACM0" TIMEOUT = 1 class Application(tornado.web.Application): def _...
proxy-server.py
import socket from threading import Thread import requests serverSocket = socket.socket() # Create socket localHostIp = "0.0.0.0" # work for all ips of the server port = 2874 # Reserve port serverSocket.bind((localHostIp, port)) # Listen to up to 15 client connections serverSocket.listen(15) allThreads = set() ...
TProcessPoolServer.py
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
web_ping.py
""" This module defines the Website Monitoring web_ping modular input. """ import os import sys path_to_mod_input_lib = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'modular_input.zip') sys.path.insert(0, path_to_mod_input_lib) from modular_input import Field, ModularInput, URLField, DurationField, Intege...
server.py
import socket import pickle import threading as th host = '' port = 4041 ids_jogadores = [] conections = [] clientes = [] threads = [] mensagens = [] def existeIDinServer(id): for j in ids_jogadores: return j == id return False def broadCastMensagens(con): q = {"erro": 0, "mensagens": mensagens}...
wandb_run.py
import _thread as thread import atexit from collections.abc import Mapping from datetime import timedelta from enum import IntEnum import glob import json import logging import numbers import os import re import sys import threading import time import traceback from types import TracebackType from typing import ( A...
main.py
# encoding: utf-8 #这里放置主程序以及IO from numpy import * from utils.tools import loadvoc from keras.models import Sequential,load_model,Model from keras.layers import Input, Embedding, LSTM, Dense, merge, RepeatVector,TimeDistributed,Masking from keras.optimizers import SGD,Adam from keras.utils.np_utils import to_categorica...
core.py
import re import sys import os import time from threading import Thread, Event from datetime import datetime, timedelta from collections import deque try: from Queue import Queue except ImportError: from queue import Queue import boto3 from botocore.compat import total_seconds from termcolor import colored fr...
integrationtestSocket.py
#!/usr/bin/env python3.3.6 import unittest import sys import threading import queue import time from socket import AF_INET, SOCK_STREAM from geosquizzy.gs_socket.gs_client import GsSocketClient from geosquizzy.gs_socket.gs_server import GsSocketServer from geosquizzy.geosquizzy import GeoSquizzy from tests.getdata ...
part2.py
import threading import time from itertools import permutations class AmplifierController: def get_value(self, index, mode, program): if mode == "0": return program[program[index]] return program[index] def run_program(self, program, I): i = 0 while i < len(program...
wallet_multiwallet.py
#!/usr/bin/env python3 # Copyright (c) 2017-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test multiwallet. Verify that a bitcoind node can load multiple wallet files """ from decimal import D...
threaded.py
''' threaded.py Threaded command module Copyright 2008 Corey Tabaka 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 requir...
multipro.py
#/usr/bin/env python #coding=utf8 """ # Author: kellanfan # Created Time : Tue 18 Jul 2017 08:14:59 PM CST # File Name: multipro.py # Description: """ from multiprocessing import Process import os # 子进程要执行的代码 def run_proc(name): print 'Run child process %s (%s)...' % (name, os.getpid()) if __name__=='__main__'...
JDBCConnectionWrapper.py
"""This module holds a ConnectionWrapper that is used with a JDBC Connection. The module should only be used when running Jython. """ # Copyright (c) 2009-2014, Aalborg University (pygrametl@cs.aau.dk) # All rights reserved. # Redistribution and use in source anqd binary forms, with or without # modification, are ...
prom_client.py
"""Implement Prometheus client.""" # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer. # Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd. # Copyright (C) 2015--2019 The Contributors # # Licensed under the Apac...
armory.py
# Armory 3D Engine # https://github.com/armory3d/armory bl_info = { "name": "Armory", "category": "Render", "location": "Properties -> Render -> Armory Player", "description": "3D Game Engine for Blender", "author": "Armory3D.org", "version": (0, 6, 0), "blender": (2, 80, 0), "wiki_url":...
progress_bar.py
import sys sys.path.append('../../lib') from UI import * from tkinter import filedialog import time import threading FILE_TYPES=[('PDF files', '.pdf'), ('JPG files', '.jpg'), ('PNG files', '.png'), ('Py files', '*.py'), ('all files', '.*')] cb_thread=None def open_fo...
__init__.py
"Python wrapper for mkp224o CLI tool." import os import time import threading from collections import defaultdict from queue import Queue, Empty from subprocess import Popen, PIPE, TimeoutExpired from .version import __version__ COMMAND = os.getenv('MKP224O_PATH', 'mkp224o') class _Mkpy224o: # pylint: disable=to...
dashboard.py
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
websocket.py
import json import multiprocessing import threading try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse from spectrum.conf import SPECTRUM_UUID4 from spectrum.handlers.base import BaseSpectrumHandler from autobahn.asyncio.websocket import WebSocketClientProtocol from autob...
run_experiment.py
import atexit import sacred import argparse import time import math import subprocess import shutil import os import json import threading import requests import glob from configs import fetch_model_params import socket import subprocess import queue import sys import signal parser = argparse.ArgumentParser() parser....
get_set_attribute_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...
KeyMidiMapper.py
import time import csv from distutils.util import strtobool #文字列→bool型変換で使用 import threading #外部ライブラリ import rtmidi from pyhooked import Hook, KeyboardEvent, MouseEvent #自作ライブラリ import KeyMidiGui as kmGui class MapData(): def __init__(self): self.mapData = [] self.valData = {} self.ptime =...
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from electrum.util import bfh, bh2u, UserCancelled, UserFacingException from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT from electrum.bip32 import deserialize_xpub from electrum import constants from electrum.i18n import _ from electrum.transac...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import, print_function, with_statement, unicode_literals import os import re import sys import copy import time import types import signal import random import fnmatch import logging import threading import ...
test_smtplib.py
import asyncore import base64 import email.mime.text from email.message import EmailMessage from email.base64mime import body_encode as encode_base64 import email.utils import hashlib import hmac import socket import smtpd import smtplib import io import re import sys import time import select import errno import textw...
scheduler_daemon.py
# Copyright (C) 2015-2017 XLAB, Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
pipeline.py
#!/usr/bin/env """Pipeline utilities""" import gem import json import logging import os import errno import signal import traceback from gem.utils import Timer import gem.gemtools as gt import gem.filter import gem.utils class dotdict(dict): def __getattr__(self, attr): return self.get(attr, None) __s...
sherlock_qot_transform_traffic.py
# @file helloworld.py # @brief Sherlock QoT Python Transform for Traffic Input # @author Anon D'Anon # # Copyright (c) Anon, 2018. # Copyright (c) Anon Inc., 2018. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following cond...
ssh.py
from __future__ import print_function, division, absolute_import import logging import socket import os import sys import time import traceback try: from queue import Queue except ImportError: # Python 2.7 fix from Queue import Queue from threading import Thread from toolz import merge from tornado import...
BOOT_GUI10Key.py
import RPi.GPIO as GPIO import tkinter as tk import tkinter.font as TkFont from tkinter import * from tkinter import ttk import time #from signal import pause import threading from AtlasOEM_PH import AtlasOEM_PH from AtlasOEM_EC import AtlasOEM_EC import time from tkinter import messagebox global fullscreen from PIL im...
drive.py
#%% import time import numpy as np import cv2 import torch import random import logging import threading from goprocam import GoProCamera from actuation import Controller from driving_agents import CenterOfMassFollower as Agent MOVE_COEFF = 3 VIDEO_NAME = str(random.randint(0, 10**6))+'.mp4' logging.basicConfig( ...
timed_run.py
import datetime import os import json import subprocess import threading import time class TimedRun: """A run of an external process, with a timeout. Call start() to begin running, then periodically call check() to detect when it is done or terminate it if it times out, e.g.: run = TimedR...
maintenance.py
# Copyright 2019 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
data_utils.py
""" Miscellaneous functions manage data. Date: September 2018 Author: Ignacio Heredia Email: iheredia@ifca.unican.es Github: ignacioheredia """ import os import threading from multiprocessing import Pool import queue import subprocess import warnings import base64 import numpy as np import requests from tqdm import ...
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...
utils.py
# Copyright (c) MONAI Consortium # 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, so...
tcp.py
# -*- coding: utf-8 -*- ''' TCP transport classes Wire protocol: "len(payload) msgpack({'head': SOMEHEADER, 'body': SOMEBODY})" ''' # Import Python Libs from __future__ import absolute_import, print_function, unicode_literals import logging import msgpack import socket import os import weakref import time import tra...
xresconv_cli.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re import sys # ================================================================================== import threading import xml.etree.ElementTree as ET from multiprocessing import cpu_count from argparse import ArgumentParser from subprocess import PIPE, P...
main.py
import threading from __init__ import app, configuration import database.database_connection as database if database.connect_if_required(): database.database_engine.init_app(app) database.database_engine.create_all() def run_schedulers(): import time import schedule from server_settings.shutdow...
interactive.py
import asyncio import logging import os import tempfile import textwrap import uuid from functools import partial from multiprocessing import Process from typing import Any, Callable, Dict, List, Optional, Text, Tuple, Union import numpy as np from aiohttp import ClientError from colorclass import Color from sanic imp...
test_thread.py
""" Copyright (c) 2008-2017, Jesus Cea Avion <jcea@jcea.es> 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 notice, this list of...
python_ls.py
# Copyright 2017 Palantir Technologies, Inc. from functools import partial import logging import os import socketserver import threading from pyls_jsonrpc.dispatchers import MethodDispatcher from pyls_jsonrpc.endpoint import Endpoint from pyls_jsonrpc.streams import JsonRpcStreamReader, JsonRpcStreamWriter from . imp...
Redbot4.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,os,subprocess cl = LINETCR.LINE() cl.login(token="EqQNKPSnbQ84wRP9QmU3.rQbq68XMQqTh/UyLzuFmuW.fgs+hV8Nze3kyMIhzeMOqBG+fcV7pQcPFlLT7pC2XQc=") cl.loginResult(...
main.py
import pickle from random import random import torch import time import pyautogui import gc import numpy as np from threading import Thread from tqdm import tqdm import environment from trainer import QTrainer, RainbowTrainer, TaikoTrainer torch.set_printoptions(sci_mode=False) pyautogui.MINIMUM_DURATION = 0.0 pyau...
njrat.py
#!/usr/bin/env python3 #MIT License # #Copyright (c) 2021 Sloobot # #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, m...
enviandoArduino.py
import serial import threading import time conectado = False desligarArduino = False contador = 0 # posso criar inputs para esses parâmetros portaCOM = 'COM5' velocidadeBaud = 115200 # Se isso for válido, entra aqui try: # Comunicação com a serial serialArduino = serial.Serial(portaCOM, velocidadeBaud, timeo...
06-performace-threads-python.py
import datetime import math from multiprocessing import cpu_count from threading import Thread def computar(fim, inicio=1): pos = inicio fator = 1000 * 1000 while pos < fim: pos += 1 math.sqrt((pos - fator) * (pos - fator)) def main(): quantidade_cores = cpu_count() print(f'Reali...
gui.py
#!/usr/bin/env python3 import json import multiprocessing import os import threading import time import sys from PyQt5 import QtCore, QtWidgets, uic from PyQt5.QtGui import QIcon from tools.exceptions import ValidationError, MissingValuesError from tools import Modus from tools import kontaktdaten as kontak_tools fr...