source
stringlengths
3
86
python
stringlengths
75
1.04M
email.py
from threading import Thread from flask import render_template from flask_mail import Message from flask_babel import _ from app import app, mail def send_async_email(app, msg): with app.app_context(): mail.send(msg) def send_email(subject, sender, recipients, text_body, html_body): msg = Message(su...
runqm.py
#!/usr/bin/python # coding=utf-8 import multiprocessing import socket from http.server import SimpleHTTPRequestHandler, HTTPServer import qrcode as qrcode from PIL import Image, ImageTk from biplist import * import os import shutil import zipfile from tkinter import filedialog from tkinter import messagebox import tki...
turret_and_tracking.py
try: import cv2 except Exception as e: print("Warning: OpenCV not installed. To use motion detection, make sure you've properly configured OpenCV.") import time import _thread as thread import threading import atexit import sys import termios import contextlib import imutils import RPi.GPIO as GPIO from adaf...
account.py
#!/usr/bin/python3 import json import sys import threading import time from collections.abc import Iterator from getpass import getpass from pathlib import Path from typing import Any, Dict, List, Optional, Tuple, Union import eth_account import eth_keys import rlp from eip712.messages import EIP712Message, _hash_eip...
camera.py
from typing import Optional, Tuple, Iterator, Union from pathlib import Path from tempfile import mkstemp from os import close from time import time, sleep from threading import Thread, Lock, Event # noinspection PyUnresolvedReferences from picamera import PiCamera class CameraBufferAble: def __init__(self, max_...
mailClientThunderbird.py
# Copyright (C) 2018 Sascha Kopp # This file is part of fortrace - http://fortrace.fbi.h-da.de # See the file 'docs/LICENSE' for copying permission. # This version of the mail client plugin uses the native mozilla python modules for manipulating the configuration to reduce code bloat # See fortrace.utility.tbstuff.py f...
test_utils.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import ctypes import multiprocessing import queue import socket import uuid def is_asan...
supervisor.py
import time from datetime import timedelta import subprocess import threading, time, signal import display import sensors import os from sampleRing import sampleRing from http.server import HTTPServer, BaseHTTPRequestHandler import json import datetime WAIT_TIME_SECONDS = 1 def getStatusText(): if os.name == 'nt':...
s3booster-snowball-v2.py
#!/bin/env python3 ''' ChangeLogs - 2022.01.19: - added no_extract option - 2021.08.12: - using s3client.upload_fileobj instead of mpu_upload - improve upload performance, but more memory usage - 2021.08.11: - adding compression argument and adjusting suffix "tgz" - compression feature is added by "Kirill Dav...
__main__.py
#!/usr/bin/env python3 import argparse from datetime import timedelta, datetime import io import itertools as it import json import multiprocessing as mp import multiprocessing.dummy as mp_dummy import os import os.path as path import sys from time import strptime, strftime, mktime import urllib.request from glob impo...
pend.py
#!/usr/bin/python # """Simulates and displays a collection of potentially-interacting pendulums.""" # # # Copyright 2017-2019 David Talkin. # # 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 # #...
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...
workers.py
# -*- coding: utf-8 -*- # # Copyright (C) 2009-2019 Ben Kurtovic <ben.kurtovic@gmail.com> # # 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 ...
process.py
#!/usr/bin/python """ Utilities for decrypting a book in a separate process. This gets its own module as the multiprocessing module duplicates the global namespace when spawning new processes. This separate module limits the amount of stuff that gets duplicated and prevents serialization errors on cert...
test_basic.py
import gc import re import time import uuid import warnings import weakref from datetime import datetime from platform import python_implementation from threading import Thread import pytest import werkzeug.serving from werkzeug.exceptions import BadRequest from werkzeug.exceptions import Forbidden from werkzeug.excep...
traeger.py
""" Library to interact with traeger grills Copyright 2020 by Keith Baker All rights reserved. This file is part of the traeger python library, and is released under the "GNU GENERAL PUBLIC LICENSE Version 2". Please see the LICENSE file that should have been included as part of this package. """ import time import s...
ssh_lite_py2.py
#!/usr/bin/env python # coding: utf-8 # author: Rainy Chan # mailto: rainydew@qq.com import paramiko import threading import time import sys import warnings class KeyAbbr: """alias of combination keys""" CTRL_C = "\x03" CTRL_D = "\x04" CTRL_Z = "\x1a" class Server(object): """a simple server tha...
Py_chat_client.py
import socket import threading HOST = input('Enter Host:') PORT = int(input('Enter Port:')) ADDR = (HOST, PORT) buff_size = 1024 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(ADDR) def receive(): while True: try: msg = s.recv(buff_size).decode("utf8") print(msg...
video_stream.py
#!/usr/bin/python3 import time import threading import sys import traceback import numpy as np import rospy import ros_numpy import cv2 from sensor_msgs.msg import Image class VideoStreamClient: """ This class captures the video from the drone and publishes it """ def __init__(self, url, width=...
test_mix.py
import pdb import copy import pytest import threading import datetime import logging from time import sleep from multiprocessing import Process import sklearn.preprocessing from milvus import IndexType, MetricType from utils import * dim = 128 index_file_size = 10 collection_id = "test_mix" add_interval_time = 5 vecto...
test_random.py
from __future__ import division, absolute_import, print_function import warnings import numpy as np from numpy.testing import ( assert_, assert_raises, assert_equal, assert_warns, assert_no_warnings, assert_array_equal, assert_array_almost_equal, suppress_warnings ) from numpy import ra...
framework.py
#!/usr/bin/env python from __future__ import print_function import gc import sys import os import select import signal import unittest import tempfile import time import faulthandler import random import copy import psutil import platform from collections import deque from threading import Thread, Event from inspect i...
client.py
# -*- coding: utf-8 -*- """ /* * 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 ...
context.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...
core.py
# -*- coding: utf-8 -*- """ yaspin.yaspin ~~~~~~~~~~~~~ A lightweight terminal spinner. """ from __future__ import absolute_import import functools import itertools import signal import sys import threading import time import colorama from pipenv.vendor.vistir import cursor from .base_spinner import default_spinn...
worker.py
import time from contextlib import contextmanager from fennel.client.state import count_results, get_state from fennel.utils import get_mp_context from fennel.worker import EXIT_SIGNAL, Executor, start @contextmanager def worker(app): # For end-to-end integration tests, will spawn N more # executor processes...
network.py
import queue import threading from select import select import sys import hexdump from commands import SpotifyCommand class ProxyConnection(object): def __init__(self, conns): self.conns = conns self.incoming_queue = queue.Queue() assert len(conns) <= 2 self.conn_mapping = dict(zi...
tf_util.py
import numpy as np import tensorflow as tf # pylint: ignore-module import copy import os import functools import collections import multiprocessing def switch(condition, then_expression, else_expression): """Switches between two operations depending on a scalar value (int or bool). Note that both `then_expres...
smart_system.py
import json import logging from oauthlib.oauth2 import LegacyApplicationClient from requests_oauthlib import OAuth2Session import websocket from threading import Thread import time import sys from gardena.location import Location from gardena.devices.device_factory import DeviceFactory class Client: def __init_...
leecher.py
import random import string from time import sleep import webbrowser from pathlib import Path import os from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.chrome.options import Options from selenium.common.exceptions import NoSuchElementException from PyQt5 i...
gui.py
# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This program 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 2 of the License, o...
msi.py
# -*- coding: iso-8859-1 -*- # Message Socket interface from __future__ import print_function, division import sys if( sys.version_info[0] == 2 ): range = xrange import socket import struct import time import threading class server: def __recv( self, sckt ): msg = sckt.recv( self.slen ) try:...
custom_multiprocessing.py
############################################# # Author: Hongwei Fan # # E-mail: hwnorm@outlook.com # # Homepage: https://github.com/hwfan # ############################################# from queue import Queue, Empty from threading import Thread import subprocess impo...
vision.py
from tracker.core import * from tracker.camera import Camera from tracker.blob_detector import BlobDetector from tracker.cone_detector import ConeDetector from tracker.calibrator import Calibrator from tracker.mosse_tracker import MOSSETracker from multiprocessing import Process, Manager msgHeader = "[VISION]: " cla...
controller.py
# External Dependencies import time import re from multiprocessing import Process, Queue from subprocess import call import os, sys from embit import bip32, script, ec from embit.networks import NETWORKS from embit.descriptor import Descriptor from binascii import hexlify from threading import Thread # Internal file c...
base.py
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2022 Valory AG # Copyright 2018-2021 Fetch.AI Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # ...
__init__.py
# -*- coding: utf-8 -*- # # Copyright (c) 2016 - 2021 -- Lars Heuer # All rights reserved. # # License: BSD License # """\ QR Code and Micro QR Code implementation. "QR Code" and "Micro QR Code" are registered trademarks of DENSO WAVE INCORPORATED. """ from __future__ import absolute_import, unicode_literals import sy...
base_historian.py
# -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # # Copyright 2019, Battelle Memorial Institute. # # 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...
test_views_transaction.py
import mock import time import threading import unittest from uuid import uuid4 from pyramid import testing from pyramid import httpexceptions from kinto.core.storage.exceptions import BackendError from kinto.core.utils import sqlalchemy from kinto.core import events from kinto.core.testing import skip_if_no_postgres...
cartpole_gui.py
#!/usr/bin/env python import rospy import threading import time from robot_sim.msg import RobotState import matplotlib.pyplot as plt import matplotlib.lines as mlines from math import sin from math import cos from math import pi class CartPoleGUI(object): def __init__(self): self.sub = rospy.Subscriber("...
find_current_thread.py
import threading def thread_count(count): print("I am the thread number ",count,".") print("My name is ",threading.currentThread().getName()) print("active coutn",threading.activeCount()) l1 = threading.enumerate() for i in l1: print(i) #print(threading.enumer) for i in rang...
invalid_location_test.py
from time import sleep from uuid import UUID, uuid4 as rand_uuid from socket import * import traceback import threading import struct import sys def packet_to_string(packet): return "".join(["\\x%02x"%i for i in packet]) CLIENT_PACKETS = { "LOGIN": lambda: chr(0...
test_tracking.py
# -*- coding: utf-8 -*- # flake8: disable E501 ''' Tests for contrib/tracking... Compatibility Tests Table ============= ==================================== ======================================== ======================================== client/server native v2 ...
coinminer.py
import hashlib, json, random, os, re, requests, time import multiprocessing as mp from operator import itemgetter from datetime import datetime import settings class StrategyManager: """ Class for managing Strategies """ def __init__(self, stats_length=None): if stats_length is not None: ...
installwizard.py
# Copyright (C) 2018 The Electrum developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php import os import json import sys import threading import traceback from typing import Tuple, List, Callable, NamedTuple, Optional, TYPE_CH...
SLM_release_version.py
__author__ = 'Chronis' from pySLM.definitions import SLM import numpy as np from tkinter import _setit import PIL from astropy.io import fits import pygame, os, time, pickle from tkinter import * from tkinter import ttk from tkinter import filedialog import matplotlib matplotlib.use('TkAgg') import matplotl...
inference_speed_profiling.py
# Copyright (c) Facebook, Inc. and its affiliates. # # 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 ...
scheduler_job.py
# pylint: disable=no-name-in-module # # 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, Versio...
multifeat.py
import logging import time from multiprocessing import JoinableQueue, Manager, Process import doors as wu import numpy as np import pandas as pd FEATURE_PREFIX = "feat:" def generate_features(df, features, helpers, n_jobs=4): helpers = [] if helpers is None else helpers if n_jobs == 1: manager = Ser...
engine.py
""" Main BZT classes Copyright 2015 BlazeMeter 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...
ip.py
"""Module to connect to a KNX bus using a KNX/IP tunnelling interface. """ import socket import threading import logging import time import queue as queue import socketserver as SocketServer from knxip.core import KNXException, ValueCache, E_NO_ERROR from knxip.helper import int_to_array, ip_to_array from knxip.gatewa...
gocode.py
import sublime, sublime_plugin, subprocess, difflib, threading # go to balanced pair, e.g.: # ((abc(def))) # ^ # \--------->^ # # returns -1 on failure def skip_to_balanced_pair(str, i, open, close): count = 1 i += 1 while i < len(str): if str[i] == open: count += 1 elif str[i] == close: count -= 1 if ...
producer_consumer_test.py
import random, threading, time, unittest from bibliopixel.util.threads import producer_consumer class ProducerConsumerTest(unittest.TestCase): def test_all(self): buffer = producer_consumer.Queues([], []) counter = [0] def producer(): for i in range(10): time...
lightstreamer.py
""" Author: Lee Gim Yuen License: Apache 2.0 License Copyright(c) 2015 Lee Gim Yuen """ import sys import threading import pprint as pp import traceback ############################################ # FIX for SSL PROTOCOL in Python # This must be done before Requests import ssl from functools import wraps ...
NewHorizon.py
import pandas import time import datetime import smbus import RPi.GPIO as GPIO import dht11 import numpy as np import threading GPIO.cleanup() GPIO.setwarnings(True) GPIO.setmode(GPIO.BCM) #DHT11 ping instance = dht11.DHT11(pin=14) #A/D converter address = 0x48 A0 = 0x40 A1 = 0x41 A2 = 0x42 A3 = 0x43 bus = smbus.S...
op3.py
import time from threading import Thread import numpy as np from ..util import action_file_parser np.set_printoptions(precision=2) import pybullet as p import pybullet_data import sys import os from .. import __file__ module_path = os.path.dirname(__file__) if sys.platform == "win32": from ctypes import windll ...
apmia_callback_log.py
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2017 Ansible Project # 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 = ''' callback: default type:...
multi_echo_server.py
#!/usr/bin/env python3 import socket import time from multiprocessing import Process HOST = "" PORT = 8001 BUFFER_SIZE = 1024 def main(): with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.bind((HOST, PORT)) s.listen(2) ...
termux.py
# Author : Krypton Byte import time import colorama import os import sys import re import threading from loader import loading, help # import requests def args(params, default): for i in sys.argv: for cordinate in re.finditer(params, i): return i[cordinate.span()[1]:] else: return de...
test_poll.py
# Test case for the os.poll() function import os import subprocess import random import select import threading import time import unittest from test.support import TESTFN, run_unittest, cpython_only from test.support import threading_helper try: select.poll except AttributeError: raise unittest.SkipTest("sel...
mem.py
"Utility functions for memory management" from ..imports.torch import * from ..core import * from ..script import * from ..utils.env import * import pynvml, functools, traceback, threading, time from collections import namedtuple IS_IN_IPYTHON = is_in_ipython() GPUMemory = namedtuple('GPUMemory', ['total', 'used', '...
haimgard.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import cmd import importlib import importlib.util import readline import sys import time import os import re import cowsay import colorama from colorama import Fore, Style from loguru import logger from rich.console import Console from rich.table import Table from types i...
conftest.py
import os import sys from indexclient.client import IndexClient as SignpostClient from multiprocessing import Process from psqlgraph import PsqlGraphDriver from signpost import Signpost import json import pytest import requests import sheepdog import peregrine from peregrine.api import app as _app, app_init from pere...
test_allocator_strategy_crt_vm_mem.py
''' New Integration Test for mem allocator strategy. @author: SyZhao ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_state as test_state import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.operations.resource_operations as res_ops import zstackwoodpecker.zs...
02multiprocessing.py
from multiprocessing import Process from time import sleep import os def run(desc): while True: print('today is %s--%s--%s' % (desc, os.getpid(), os.getppid())) sleep(3) # break if __name__ == '__main__': # 主进程 print('主进程开始执行--%s' % (os.getpid(),)) # 创建进程执行run # p = Proce...
_Nsfw.py
import os,sys,inspect import bot import asyncio import discord commands = bot.commands if not discord.opus.is_loaded(): # the 'opus' library here is opus.dll on windows # or libopus.so on linux in the current directory # you should replace this with the location the # opus library is lo...
testing.py
from lib import delete_txt_files delete_txt_files.run() import threading from lib import monitoring from algo import algo1 from algo import algo2 import time t = threading.Thread(target=monitoring.capture) t.start() t.status = 'idle' time.sleep(.1) t.status = 'algo1' algo1.run() t.status = 'idle' t.status = 'al...
test_utilities.py
# Copyright 2015, Google Inc. # 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 conditions and the f...
watcher.py
import logging import os.path import threading import time from galaxy.util.hash_util import md5_hash_file try: from watchdog.events import FileSystemEventHandler from watchdog.observers import Observer from watchdog.observers.polling import PollingObserver can_watch = True except ImportError: Obse...
parallel_mi.py
from __future__ import absolute_import from __future__ import print_function import sys import os import os.path import json import errno import uuid import subprocess import argparse import pythoncom import six.moves.winreg as winreg with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"Software\META") as...
controller.py
import asyncio from collections import defaultdict import inspect from typing import Dict, Any, Optional, Set, Tuple import ray from ray.actor import ActorHandle from ray.serve.async_goal_manager import AsyncGoalManager from ray.serve.backend_state import BackendState from ray.serve.backend_worker import create_backen...
basic_app.py
from orchestrators import Orchestrator from printers import Printer from jobs import Job import threading import time class TestUser(): def __init__(self): self.username = 'tom' p = Printer('Duplicator i3', '192.168.0.201', 'B5A36115A3DC49148EFC52012E7EBCD9', 'Hackspace', 'duplicat...
test_mainwindow.py
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright © Spyder Project Contributors # # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) # ----------------------------------------------------------------------------- """ Te...
upload.py
#!/usr/bin/env python # upload.py # # Bulk uploads files to SoftLayer object storage. # # Use UPLOAD_SLEEP=0 to skip the sleep at the beginning of the batch routine. import os from os.path import isfile, join import time import swiftclient from Queue import Queue from threading import Thread import mimetypes # Confi...
store.py
from os import unlink, path, mkdir import json import uuid as uuid_builder from threading import Lock from copy import deepcopy import logging import time import threading import os from changedetectionio.notification import default_notification_format, default_notification_body, default_notification_title # Is ther...
log_handler.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...
start.py
#!/usr/bin/env python3 from concurrent.futures import ThreadPoolExecutor, as_completed from contextlib import suppress from itertools import cycle from json import load from logging import basicConfig, getLogger, shutdown from math import log2, trunc from multiprocessing import RawValue from os import urandom as randb...
run.py
# 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 the License. # You may...
test_index.py
import multiprocessing as mp import os import time import unittest import numpy as np from jina.enums import FlowOptimizeLevel from jina.executors.indexers.vector import NumpyIndexer from jina.flow import Flow from jina.parser import set_flow_parser from jina.proto import jina_pb2 from tests import JinaTestCase, rand...
sync.py
import argparse import asyncio import logging import os from collections import namedtuple from multiprocessing import Process import apsw from elasticsearch import AsyncElasticsearch from elasticsearch.helpers import async_bulk from lbry.wallet.server.env import Env from lbry.wallet.server.coin import LBC from lbry.w...
probe_endtoend.py
""" This probe runs in a Telepresence created and managed execution context. It observes things about that environment and reports about them on stdout. The report can be inspected by the test suite to verify Telepresence has created the execution context correctly. """ from time import ( sleep, ) from os import (...
clusterScaler.py
# Copyright (C) 2015-2018 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...
ShutdownTasklet.py
''' Created on Jan 1, 2014 @author: David Daeschler ''' import threading from tasklets.TaskletBase import TaskletBase from inworldz.maestro.environment.RegionEntry import RegionState import inworldz.maestro.environment.ComputeResource as ComputeResource import inworldz.util.general as Util class ShutdownTasklet(Tas...
application.py
#SPDX-License-Identifier: MIT """ Handles global context, I/O, and configuration """ import os import time import argparse import multiprocessing as mp import logging import json import pkgutil from beaker.cache import CacheManager from beaker.util import parse_cache_config_options from sqlalchemy import...
__init__.py
from thonny.globals import get_workbench from tkinter.messagebox import showerror from thonny.ui_utils import SubprocessDialog from thonny import THONNY_USER_BASE from threading import Thread from thonny.globals import register_runner, get_runner from thonny.misc_utils import running_on_mac_os, running_on_windows, ...
command_runner.py
"""command runner""" import multiprocessing from queue import Queue import subprocess from typing import Any from typing import Callable from typing import List from typing import Union from types import SimpleNamespace PROCESSES = (multiprocessing.cpu_count() - 1) or 1 class Command(SimpleNamespace): # pylint...
LR1parsing2.py
# with user-defined error recovery from pprint import pprint from random import randint from threading import Thread,Lock mutex = Lock() def import_grammar(fileHandle): G,T,Nt = [],[],[] for lines in fileHandle: production = lines.split(' -> ') if production[0] not in Nt: Nt.append(production[0]...
v2.py
import multiprocessing as mp import sqlite3 # IDEA: # - baza partycjonowana po czasie oparta o sqlite # - partycja obslugiwana w osobnym, rownoleglym procesie # - map -> zapytania sql wewnatrz partycji # - combine -> za pomoca sqla lub pythona # - reduce -> za pomoca pythona # v2 - dowolny schemat zamiast kcv def wo...
yubikey.py
# _ __ # | |/ /___ ___ _ __ ___ _ _ ® # | ' </ -_) -_) '_ \/ -_) '_| # |_|\_\___\___| .__/\___|_| # |_| # # Keeper Commander # Copyright 2019 Keeper Security Inc. # Contact: ops@keepersecurity.com # from typing import Optional, List, Tuple import time import threading import os import si...
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 gym import wrappers from pathos.multiprocessing import ProcessingPool from concurrent.futures import ThreadPoolExecutor,as_completed CONST = 1e-15 #===========================================...
gui.py
""" A Basic GUI based on napari """ import logging import multiprocessing as mp import sys from multiprocessing import Process from pathlib import Path from typing import Optional import matplotlib import napari import numpy as np import xarray as xr from napari.qt.threading import thread_worker from PyQt5.QtCore impo...
SariNitahSayank.py
# -*- coding: utf-8 -*- import os, sys, time, datetime, random, hashlib, re, threading, json, getpass, urllib, requests, mechanize from multiprocessing.pool import ThreadPool try: import mechanize except ImportError: os.system('pip2 install mechanize') else: try: import requests exce...
omxplayer.py
# pyomxplayer from https://github.com/jbaiter/pyomxplayer # modified by KenT, heniotierra # ******************************** # PYOMXPLAYER # ******************************** import pexpect import re import string import dbus try: import gobject except: import gi gi.require_version('Gdk', ...
SyncOnSave.py
from __future__ import print_function import sublime, sublime_plugin import subprocess import threading DEBUG = False # Base rsync command template: rsync -arv <local> <remote> base_cmd = "rsync -arv {0} {1}" class SyncOnSaveCommand(sublime_plugin.EventListener): def on_post_save(self, view): """ Sync d...
HelperFunctions_ClassFunctions_ReubenPython2and3.py
# -*- coding: utf-8 -*- ''' Reuben Brewer, Ph.D. reuben.brewer@gmail.com www.reubotics.com Apache 2 License Software Revision E, 03/13/2022 Verified working on: Python 2.7, 3.8 for Windows 8.1, 10 64-bit and Raspberry Pi Buster (no Mac testing yet). ''' ############### import os, sys, platform import...
robusta_sink.py
import base64 import json import logging import time import traceback import threading from hikaru.model import Deployment, StatefulSetList, DaemonSetList, ReplicaSetList from typing import List, Dict from pydantic import BaseModel from ..sink_config import SinkConfigBase from ..sink_base_params import SinkBaseParams ...
tracks_manipulation_lib.py
__author__ = "unknow" __copyright__ = "Sprace.org.br" __version__ = "1.0.0" import sys, os, fnmatch import pandas as pd import numpy as np import sys import random from trackml.dataset import load_event from trackml.dataset import load_dataset from trackml.randomize import shuffle_hits from trackml.score import scor...
server.py
"""Fix TCP server module.""" import errno import socket import select import threading import queue from testplan.common.utils.sockets.fix.parser import FixParser from testplan.common.utils.timing import ( TimeoutException, TimeoutExceptionInfo, wait, ) from testplan.common.utils.sockets.fix.utils import ...
download_data.py
import argparse import datetime import os from multiprocessing import Process, Queue from time import sleep import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import pandas as pd import praw from helpers import * # from mpl_toolkits.mplot3d import Axes3D mpl.use('Agg') ...
test_socket_manager.py
#!/usr/bin/env python3 # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. im...