source
stringlengths
3
86
python
stringlengths
75
1.04M
main.py
import socket import ssl import random import threading import logging import json thread_amount = int(input("Number of Threads: ")) def main(): for _ in range(10000): random_numbers = str(random.randint(100000, 999999)) ssl_context = ssl.create_default_context() sock = ...
scannet.py
''' Scan device ip address in the name network Author: Viki (a) Vignesh Natarajan https://vikilabs.org ''' import os import socket import multiprocessing import subprocess from multiprocessing import Process, Queue import signal import time from time import sleep import sys import threading debug ...
base.py
""" Module containing base classes that represent object entities that can accept configuration, start/stop/run/abort, create results and have some state. """ import os import sys import signal import time import uuid import threading import psutil import functools from collections import deque, OrderedDict import tra...
check_bam.py
# -*- coding: utf-8 -*- """ Created on Thu Nov 05 16:44:30 2015 @brief: Check script, BAM can be used with the genomon. @author: okada $Id: check_bam.py 181 2017-07-04 03:49:33Z aokada $ $Rev: 181 $ # before run @code export DRMAA_LIBRARY_PATH=/geadmin/N1GE/lib/lx-amd64/libdrmaa.so.1.0 @endcode # run @code check_b...
Cluster.py
# Copyright 2017-present Open Networking Foundation # # 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 ag...
__init__.py
# -*- coding: utf-8 -*- ''' Set up the Salt integration test suite ''' # Import Python libs from __future__ import absolute_import, print_function import os import re import sys import copy import time import stat import errno import signal import shutil import pprint import atexit import socket import logging import...
opencv.py
import logging from collections import deque from contextlib import contextmanager from itertools import cycle from time import monotonic, sleep from threading import Event, Thread from typing import ( Callable, ContextManager, Deque, Iterable, Iterator, Generic, Optional, TypeVar ) import cv2 import n...
autolock.py
# -*- coding: utf-8 -*- """ Event server simple client Waits for I-Beacons and sends messages Temporary stores messages in file MIT License Copyright (c) 2017 Roman Mindlin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Softwar...
Simple PS.py
# if you use this code please give credit to Konstantinos Karakasidis import pyautogui as p from datetime import datetime import tkinter as tk from tkinter import simpledialog import os import PySimpleGUIQt as sg import threading # ------------------------------MS imports for admin privileges start---------------------...
HTTPDownloader.py
from BitTornado.CurrentRateMeasure import Measure from BitTornado.bitfield import TrueBitfield from random import randint from urlparse import urlparse from httplib import HTTPConnection from urllib import quote from threading import Thread from BitTornado.__init__ import product_name, version_short EXPIRE_TIME = 60 *...
Spinner.py
import sys import time import threading # From https://stackoverflow.com/questions/4995733/how-to-create-a-spinning-command-line-cursor-using-python?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa class Spinner: busy = False delay = 0.1 @staticmethod def spinning_cursor(): ...
hydroshare.py
from __future__ import print_function import os, sys import getpass import socket import glob import requests import threading import time # from IPython.core.display import display, HTML from hs_restclient import HydroShare, HydroShareAuthBasic, HydroShareHTTPException import xml.etree.ElementTree as et from datetime ...
polysemy_estimates.py
''' Created on Feb 21, 2022 @author: vivi ''' import os import time import random import argparse import re import scipy from multiprocessing import Process, Queue import ioutils from viz.common import load_embeddings def get_distance(a, b, dist): if "cos" in dist: return scipy.spatial.distanc...
test_utils.py
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
phaselink_dataset.py
#! /home/zross/bin python import numpy as np import multiprocessing as mp import pickle import sys import json from obspy.geodetics.base import gps2dist_azimuth bounds_scaler = 1 limit_max_distance = True random_sta_locs = False def output_thread(out_q, params): none_count = 0 X = [] Y = [] while Tru...
ImgProcess.py
#!/usr/bin/env python # coding: utf-8 # In[1]: import base64 import urllib import urllib.request import cv2 from multiprocessing import Process, Queue import os access_token = '24.46a59369c77ecda08838e4cf097e1bf6.2592000.1571900094.282335-17330240' #__VideoIndex__ = '.\Data\WIN_20190927_12_48_37_Pro.mp4' __VideoInde...
trezor.py
from binascii import hexlify, unhexlify import traceback import sys from electrum_dash.util import bfh, bh2u, versiontuple, UserCancelled from electrum_dash.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, deserialize_xpub, TYPE_ADDRESS, TYPE_SCRIPT, is_address) from electru...
main.py
import re from multiprocessing import Process, Queue from Database import Database from utils import * from interface import user_interface def get_urls(url): page = requests.get(url) #getURL return re.findall("<a href=\"([^\">]+)\">", page.text) #parseUrl def search_urls(url, queue): vali...
cli.py
from Tkinter import * import rospy from std_msgs.msg import String import threading class Client: def __init__(self): self.cmd_out = "NONE" self.mast_cmd_out = [] self.tk = Tk() self.pub = rospy.Publisher('rover_cmds', String, queue_size=10) self.pub_thread = threading.T...
test_tcp_client.py
from aws_embedded_metrics.sinks.tcp_client import TcpClient from urllib.parse import urlparse import socket import threading import time import logging log = logging.getLogger(__name__) test_host = '0.0.0.0' test_port = 9999 endpoint = urlparse("tcp://0.0.0.0:9999") message = "_16-Byte-String_".encode('utf-8') def ...
syncer.py
#!/usr/bin/env python from __future__ import absolute_import, division, print_function, unicode_literals import contextlib import datetime import os import sys import time import unicodedata import dropbox import time import shutil import threading sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__fil...
mailService.py
# Remote Services Calls from threading import Thread import jwt from flask import url_for from flask_mail import Message from . import app from . import mail def send_async(app, msg): with app.app_context(): mail.send(msg) def send_verification_mail(recipient, token): link = url_for('verify_email',...
subprocess.py
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
stream.py
import cv2 from threading import Thread import threading class liveStream: def __init__(self, src, width, height): # initialize the video camera stream and read the first frame # from the stream self.src = src self.width = width self.height = height # initialize th...
node_provider.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import random import threading from collections import defaultdict import boto3 from botocore.config import Config from ray.autoscaler.node_provider import NodeProvider from ray.autoscaler.tags import TAG_RAY...
_coreg.py
from contextlib import contextmanager from functools import partial import os import os.path as op import time import queue import threading import re import numpy as np from traitlets import observe, HasTraits, Unicode, Bool, Float from ..io.constants import FIFF from ..defaults import DEFAULTS from ..io import read...
pi_pact.py
#!/usr/bin/python3 # -*- mode: python; coding: utf-8 -*- """Bluetooth Low Energy (BLE) beacon advertisement and scanning. Execution of a BLE beacon for use in BWSI PiPact independent project. Configuration of beacon done via external YAML. Underlying functionality provided by PyBluez module (https://github.com/pybluez...
camera.py
#!/usr/bin/env python3 import sys sys.path.append("/usr/local/lib/") import os from os.path import dirname, realpath from threading import Thread import datetime import pyrealsense2 as rs from mycelium.components import RedisBridge, Base class Camera(Base): TYPE_T265 = 't265' TYPE_D435 = 'd435' ALIVE_...
run_server.py
import threading import webbrowser import os from http.server import HTTPServer, SimpleHTTPRequestHandler class HTTPRequestHandler(SimpleHTTPRequestHandler): """Hacky way to get blog posts to resolve (dont have the html extenstion)""" def do_GET(self): posts = [f.split('.')[0] for f in os.listdir...
mavtester3.py
#!/usr/bin/env python ''' test MAVLink performance between three radios ''' import sys, time, os, threading, Queue from optparse import OptionParser parser = OptionParser("mavtester.py [options]") parser.add_option("--baudrate", type='int', help="connection baud rate", default=57600) parser.add_op...
requests_executor.py
from requests_pkcs12 import Pkcs12Adapter from pyravendb.commands.raven_commands import GetTopologyCommand, GetStatisticsCommand from pyravendb.connection.requests_helpers import * from pyravendb.custom_exceptions import exceptions from OpenSSL import crypto from pyravendb.data.document_conventions import DocumentConv...
player.py
""" The MIT License (MIT) Copyright (c) 2015-present Rapptz 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, merg...
remote_event.py
import contextlib import threading import queue from lizard.events import FINAL_STATES REMOTE_EVENTS = None REMOTE_EVENTS_LOCK = threading.Lock() def create_remote_events(): """Create remote events object""" with REMOTE_EVENTS_LOCK: global REMOTE_EVENTS REMOTE_EVENTS = RemoteEvents() @cont...
base_historian.py
# -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # # Copyright 2020, 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...
ngrams.py
import copy import random from queue import Queue from threading import Thread import rocksdb import traceback from collections import Counter from multiprocessing import Process, Manager from multiprocessing.pool import Pool import nltk from tqdm import tqdm from django.conf import settings from capdb.models import ...
background_caching_job.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...
create_tfrecords_py3.py
""" Create the tfrecord files for a dataset. A lot of this code comes from the tensorflow inception example, so here is their license: # Copyright 2016 Google 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...
stream_detect.py
#!/usr/bin/python3 import argparse import numpy as np import socket import cv2 import time import yaml import multiprocessing from multiprocessing.sharedctypes import RawArray import ctypes import signal import subprocess import datetime import requests from detectron2 import model_zoo from detectron2.config import g...
serve.py
# Copyright 2021 Zilliz. 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 applicable law or agree...
wirus.py
#!/usr/bin/env python import RPi.GPIO as GPIO import time import sys import signal import logging import config from threading import Thread import ultrasonic_senor from Adafruit_PWM_Servo_Driver import PWM import termios import tty import L298NHBridge as HBridge import os import speech class Wirus: def __init__(...
gitrecon.py
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # pylint: disable-msg=C0103 # pylint: disable-msg=C0301 # pylint: disable-msg=W0611 # pylint: disable-msg=W0612 # pylint: disable-msg=W0702 # pylint: disable-msg=W0703 # pylint: disable-msg=W0621 # pylint: disable-msg=R0913 """ Massive GitHub repo clonning """ import os i...
automatic.py
# Imports from time import time import threading import os import asyncio import logging import importlib commands = None try: # Try and use msvcrt if possible - Windows only importlib.import_module("msvcrt") commands = "msv" except ImportError: # msvcrt is not available commands = "get" # Version...
consume.py
from threading import Thread import pika import config def __setup_channel(exchange, routing_key, queue, callback): connection = pika.BlockingConnection(pika.ConnectionParameters( host=config.AMQP_HOST, port=config.AMQP_PORT, credentials=pika.credentials.PlainCredentials(config.AMQP_USER, config....
maml_parallel_env_executor.py
import numpy as np import pickle as pickle from multiprocessing import Process, Pipe from sandbox_maml.rocky.tf.misc import tensor_utils def worker(remote, parent_remote, env_pickle, n_envs, max_path_length, seed): parent_remote.close() envs = [pickle.loads(env_pickle) for _ in range(n_envs)] ts = np.zeros...
stl_capture_test.py
#!/router/bin/python from .stl_general_test import CStlGeneral_Test, CTRexScenario from trex_stl_lib.api import * import os, sys import pprint import zmq import threading import time import tempfile import socket from scapy.utils import RawPcapReader from nose.tools import assert_raises, nottest def ip2num (ip_str): ...
copyutil.py
# cython: profile=True # 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 # "...
remote_host.py
#!/usr/bin/python # Copyright (C) 2012 Ion Torrent Systems, Inc. All Rights Reserved """Attempt to open a socket connection to each of a list of HOST:PORT pairs """ __author__ = "bakennedy" import socket import threading import optparse import sys from Queue import Queue def check_connection(connection_string, time...
checksizes.py
#!/usr/bin/python3 import tkinter as tk import tkinter.filedialog as filedialog from tkinter import ttk from collections import deque from multiprocessing import Process, Queue, freeze_support from threading import Thread #from tqdm import tqdm import os import signal multi_queue = Queue() DELAY_PROGRESS = 50 DELAY_C...
__init__.py
import os from django.core.files.storage import FileSystemStorage import threading from DeepFake.settings import BASE_DIR from detection.models import File def save_file(file, user): fs = FileSystemStorage() filename = fs.save(file.name, file) uploaded_file_url = fs.url(filename) file = File.objects...
eventgenerator.py
import threading import time __author__ = 'Marten Fischer' import os from virtualisation.misc.jsonobject import JSONObject from messagebus.rabbitmq import RabbitMQ from virtualisation.misc.threads import QueueThread from virtualisation.triplestore.threadedtriplestoreadapter import ThreadedTriplestoreAdapter class Ev...
run.py
from OnlineHeart import OnlineHeart from Silver import Silver from LotteryResult import LotteryResult from Tasks import Tasks from connect import connect from rafflehandler import Rafflehandler import asyncio from login import login from printer import Printer from statistics import Statistics from bilibili import bili...
test.py
#!/usr/bin/env python # # Copyright 2008 the V8 project authors. 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 # noti...
mapdl_grpc.py
"""gRPC specific class and methods for the MAPDL gRPC client """ import re from warnings import warn import shutil import threading import weakref import io import time import os import socket from functools import wraps import tempfile import subprocess import grpc import numpy as np from tqdm import tqdm from grpc....
pipetool.py
# This file is part of Scapy # See http://www.secdev.org/projects/scapy for more information # Copyright (C) Philippe Biondi <phil@secdev.org> # This program is published under a GPLv2 license from __future__ import print_function import os import subprocess import collections import time import scapy.modules.six as s...
thread_processos_dois.py
# Neste exemplo, a função que será paralelizada é a funcao_a (linha 7). Ela contém um laço que é executado cem mil vezes e para cada iteração adiciona # o elemento 1 à lista minha_lista, definida globalmente na linha 5. # Vamos criar 10 threads (e processos) para executar 10 instâncias dessa função, na qual, esperamos ...
worker.py
from multiprocessing import Process, Queue from urllib.parse import urlparse import requests import pandas as pd import sqlalchemy as s from sqlalchemy.ext.automap import automap_base from sqlalchemy import MetaData import logging logging.basicConfig(filename='worker.log', level=logging.INFO) class CollectorTask: ...
connection.py
# -*- coding: utf-8 -*- # # Copyright (c) 2022 Adam Solchenberger <asolchenberger@gmail.com> # Copyright (c) 2022 Jason Engman <jengman@testtech-solutions.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...
pjit_test.py
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
postmaster.py
import logging import multiprocessing import os import psutil import re import signal import subprocess import sys from patroni import PATRONI_ENV_PREFIX, KUBERNETES_ENV_PREFIX # avoid spawning the resource tracker process if sys.version_info >= (3, 8): # pragma: no cover import multiprocessing.resource_tracker ...
test_api.py
""" mbed SDK Copyright (c) 2011-2014 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
ErrorChecks_v22testerr.py
__date__ = '5/29/14' __author__ = 'ABREZNIC' import os, arcpy, xlwt, datetime, math, multiprocessing, shutil, smtplib, base64, sys # date now = datetime.datetime.now() curMonth = now.strftime("%m") curDay = now.strftime("%d") curYear = now.strftime("%Y") today = curYear + "_" + curMonth + "_" + curDay runday = now.st...
perf-hos.py
"""num_threads simulates the number of clients num_requests is the number of http requests per thread num_metrics_per_request is the number of metrics per http request Headers has the http header. You might want to set X-Auth-Token. Urls can be an array of the Monasca API urls. There is only one url in it right now, bu...
openbazaar_daemon.py
import logging import json import multiprocessing import os import signal from threading import Lock import time import tornado.httpserver import tornado.netutil import tornado.web from zmq.eventloop import ioloop from threading import Thread from twisted.internet import reactor from db_store import Obdb from market ...
test.py
import gzip import json import logging import os import io import random import threading import time import helpers.client import pytest from helpers.cluster import ClickHouseCluster, ClickHouseInstance logging.getLogger().setLevel(logging.INFO) logging.getLogger().addHandler(logging.StreamHandler()) # Creates S3 ...
test_csv.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...
doc.py
import inspect import tempfile import subprocess import shutil import os import sys import threading from itertools import chain def header(func): signature = inspect.signature(func) args = [str(k) if v.default is inspect.Parameter.empty else str(k) + "=" + str(v.default) for k, v in signature.paramete...
app3.py
from webkit import WebView import pygtk pygtk.require('2.0') import sys, gtk, threading, time, glib from nuimo import NuimoScanner, Nuimo, NuimoDelegate glib.threads_init() class App: def __init__(self): window = gtk.Window(gtk.WINDOW_TOPLEVEL) fixed = gtk.Fixed() views = [WebView(), WebVi...
ImageNodeTest.py
########################################################################## # # Copyright (c) 2013, Image Engine Design 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: # # * Redistrib...
scylla_test_all_calls.py
import sys sys.path.append('gen-py') import random import threading from gen.server.ttypes import * from common import * def create_database(session): session.execute("""CREATE KEYSPACE sha WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}""") session.execute("""C...
soal2.py
from fuzzy import command from multiprocessing import Process,Pipe import random import time def SensorDepan(depan): Jdepan = random.randrange(1,2000) depan.send(Jdepan) print('Jarak depan mobil : ',Jdepan,' cm') depan.close() def SensorBelakang(belakang): Jbelakang = random.randrange(1,1000) ...
thruster_manager.py
# Copyright (c) 2020 The Plankton Authors. # All rights reserved. # # This source code is derived from UUV Simulator # (https://github.com/uuvsimulator/uuv_simulator) # Copyright (c) 2016-2019 The UUV Simulator Authors # licensed under the Apache license, Version 2.0 # cf. 3rd-party-licenses.txt file in the root direct...
speedtest_cli-gdocs.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2013 Matt Martz # Google Docs addition 2014 Markus Busche # 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 Licens...
test_closing.py
from fixtures import * # noqa: F401,F403 from lightning import RpcError from utils import only_one, sync_blockheight, wait_for, DEVELOPER, TIMEOUT, VALGRIND, SLOW_MACHINE import queue import pytest import re import threading import unittest @unittest.skipIf(not DEVELOPER, "Too slow without --dev-bitcoind-poll") de...
test_comms.py
from __future__ import print_function, division, absolute_import from functools import partial import os import sys import threading import pytest from tornado import gen, ioloop, locks, queues from tornado.concurrent import Future from distributed.metrics import time from distributed.utils import get_ip, get_ipv6 ...
main.py
#!/usr/local/bin/python3.4 import os, sys, logging, json, argparse, time, datetime, uuid, requests from flask import Flask, request, jsonify from configparser import ConfigParser from concurrent.futures import ThreadPoolExecutor from threading import Thread, Lock from web3 import Web3 from config_files imp...
update.py
import os import django os.environ.setdefault("DJANGO_SETTINGS_MODULE", "codearena.settings") django.setup() from codelabs.models import Problem, Customuser from django.contrib.auth.models import User import threading import json import sys from codelabs.webscrape import fetch_interviewbit, fetch_spoj, fetch_hacke...
server.py
### webhook listener, using flask import shutil from flask import Flask, request, Response from datetime import datetime from download import download from verify import verifyWebhook from metadata import add_metadata from new_recognition import loadAllFaces, detectVideoFaces import os import threading app = Flask(...
installwizard.py
import os import sys import threading import traceback from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from electrum_ltc import Wallet, WalletStorage from electrum_ltc.util import UserCancelled, InvalidPassword from electrum_ltc.base_wizard import BaseWizard, HWD_SETUP_DECRYPT_WALL...
HiwinRA605_socket_ros_test_20190625185027.py
#!/usr/bin/env python3 # license removed for brevity #接收策略端命令 用Socket傳輸至控制端電腦 import socket ##多執行序 import threading import time ## import sys import os import numpy as np import rospy import matplotlib as plot from std_msgs.msg import String from ROS_Socket.srv import * from ROS_Socket.msg import * import HiwinRA605_s...
tcp2proxy.py
# -*- coding: utf-8 -*- # 2020/7/10 # create by: snower import time import logging import struct import socket import traceback import argparse import threading import signal import sevent def config_signal(): signal.signal(signal.SIGINT, lambda signum, frame: sevent.current().stop()) signal.s...
views.py
from django.shortcuts import render from .models import UserTvSeries, UserTvSeriesModel, TvSeriesDetailsModel from django.template import loader from django.contrib.auth.decorators import login_required from django.http import HttpResponse, HttpResponseForbidden, HttpResponseRedirect from django.contrib import messages...
publisher.py
#------------------------------------------------------------------------------ # Copyright (c) 2011, Enthought, Inc. # All rights reserved. #------------------------------------------------------------------------------ """ A simple publisher api that acts as a throttling broadcaster for a high frequency data sourc...
registry.py
import time import threading from redis import StrictRedis class Refresher(object): default_refresh_period = 30 def __init__(self, refresh_period: float = default_refresh_period, timeout_granule=1): self._refresh_functions_lock = threading.Lock() self._start_thread_lock = threading.Lock() ...
test_html.py
from functools import partial from importlib import reload from io import BytesIO, StringIO import os import re import threading from urllib.error import URLError import numpy as np from numpy.random import rand import pytest from pandas.compat import is_platform_windows from pandas.errors import ParserError import p...
batcher.py
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # Modifications Copyright 2017 Abigail See # # 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/l...
Acimdes_Client.py
# Vesion 1.0 # run with "python Acimdes_Client.py" # Copyright 2020 Ivan Derdić # 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 requ...
data_generator.py
import re import traceback import tensorflow as tf import numpy as np import SimpleITK as sitk import multiprocessing as mp import utils # https://stanford.edu/~shervine/blog/keras-how-to-generate-data-on-the-fly class DataGenerator(tf.keras.utils.Sequence): def __init__(self , list_files ...
ws_thread.py
import sys import websocket import threading import traceback import ssl from time import sleep import json import decimal import logging from market_maker.settings import settings from market_maker.auth.APIKeyAuth import generate_expires, generate_signature from market_maker.utils.log import setup_custom_logger from m...
test_operator.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...
helper.py
import asyncio import functools import inspect import json import math import os import random import re import sys import threading import time import uuid import warnings from argparse import ArgumentParser, Namespace from collections.abc import MutableMapping from datetime import datetime from itertools import islic...
graphUiParser.py
## Copyright 2015-2019 Ilgar Lunin, Pedro Cabrera ## 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...
info.py
import multiprocessing as mp import os from typing import Any, Mapping import h5py from fastapi import APIRouter from starlette.responses import JSONResponse from hdf5_reader_service.utils import NumpySafeJSONResponse router = APIRouter() SWMR_DEFAULT = bool(int(os.getenv("HDF5_SWMR_DEFAULT", "1"))) # Setup bluep...
utils.py
import jwtoken import threading m3ustr = '#EXTM3U x-tvg-url="http://botallen.live/epg.xml.gz" \n\n' kodiPropLicenseType = "#KODIPROP:inputstream.adaptive.license_type=com.widevine.alpha" def processTokenChunks(channelList): global m3ustr kodiPropLicenseUrl = "" if not channelList: print("Chann...
foo.py
# Python 3.3.3 and 2.7.6 # python fo.py from threading import Thread # Potentially useful thing: # In Python you "import" a global variable, instead of "export"ing it when you declare it # (This is probably an effort to make you feel bad about typing the word "global") i = 0 def incrementingFunction(): glob...
core.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 (the #...
scheduler_command.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...
mbase.py
""" mbase module This module contains the base model class from which all of the other models inherit from. """ from __future__ import print_function import abc import sys import os import shutil import threading import warnings if sys.version_info > (3, 0): import queue as Queue else: ...
marshal.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, ...
vid2img_sthv2.py
# Code for "TSM: Temporal Shift Module for Efficient Video Understanding" # arXiv:1811.08383 # Ji Lin*, Chuang Gan, Song Han # {jilin, songhan}@mit.edu, ganchuang@csail.mit.edu import os import threading NUM_THREADS = 100 VIDEO_ROOT = '/home/space0/datasets/20bn-something-something-v2' # Downloaded webm video...
can_replay.py
#!/usr/bin/env python3 import os import time import threading from tqdm import tqdm os.environ['FILEREADER_CACHE'] = '1' from common.realtime import config_realtime_process, Ratekeeper, DT_CTRL from selfdrive.boardd.boardd import can_capnp_to_can_list from tools.lib.logreader import LogReader from panda import Panda ...