source
stringlengths
3
86
python
stringlengths
75
1.04M
compare_Walltoall_qng.py
import qiskit import numpy as np import sys sys.path.insert(1, '../') import qtm.base, qtm.constant, qtm.ansatz, qtm.fubini_study, qtm.encoding import importlib import multiprocessing importlib.reload(qtm.base) importlib.reload(qtm.constant) importlib.reload(qtm.ansatz) importlib.reload(qtm.fubini_study) def run_w...
ros_wrapper.py
#!/usr/bin/env python # coding: utf-8 import os import sys import atexit import pybullet from qibullet.camera import Camera from qibullet.camera import CameraRgb from qibullet.camera import CameraDepth from qibullet.nao_virtual import NaoVirtual from qibullet.romeo_virtual import RomeoVirtual from qibullet.pepper_virt...
morphingMovies.py
# This code should be run in console room computer to display the feedback morphings from __future__ import print_function, division import os if 'watts' in os.getcwd(): main_dir = "/home/watts/Desktop/ntblab/kailong/rtSynth_rt/" else: main_dir="/Users/kailong/Desktop/rtEnv/rtSynth_rt/" import sys sys.path.appe...
client2.py
""" network_client v1.0 done by: Moe Assal Contact: mohammad.elassal04@gmail.com phone number: +96171804948 location: Lebanon, Bekaa, Khirbet Rouha v2.0: reboot without exiting """ import socket import threading HOST = "127.0.0.1" PORT = 5431 my_sock = socket.socket(socket.AF_INET, socket.SOCK_STRE...
market.py
""" This module manages all market related activities """ from StringIO import StringIO import ast from base64 import b64decode, b64encode import logging import traceback from PIL import Image, ImageOps import gnupg import tornado from zmq.eventloop import ioloop import constants from pybitcointools.main import privk...
__main__.py
##################################################################### # # # __main__.py # # # # Copyright 2013, Monash University ...
sim.py
# write to staging service import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import math import numpy from pyevtk.hl import imageToVTK import os import shutil import copy import random import time import ctypes from mpi4py import MPI import dataspaces.dataspaceClient as dataspaces import sys # ...
mod_dir_indicator_extended115.py
# -*- coding: utf-8 -*- import datetime import re import os import json import codecs import urllib2 import urllib import threading from tutorial.control.battle.functional import IDirectionIndicator from Avatar import PlayerAvatar from constants import AUTH_REALM import BigWorld from gui.Scaleform.daapi.view.lobby.ha...
play.py
#!/usr/bin/env python3 import sys import termios import threading from argparse import ArgumentParser from glob import glob from itertools import chain, count from os import system from subprocess import PIPE, Popen, STDOUT from time import sleep lock = threading.Lock() action = None play_process = None def set_acti...
test_sys.py
import builtins import codecs import gc import locale import operator import os import struct import subprocess import sys import sysconfig import test.support from test import support from test.support import os_helper from test.support.script_helper import assert_python_ok, assert_python_failure from test.support imp...
i3msg.py
#!/usr/bin/env python #https://github.com/Ceryn/i3msg-python import socket, subprocess, struct, json, threading MSGS = ['RUN_COMMAND', 'GET_WORKSPACES', 'SUBSCRIBE', 'GET_OUTPUTS', 'GET_TREE', 'GET_MARKS', 'GET_BAR_CONFIG', 'GET_VERSION', 'GET_BINDING_MODES', 'GET_CONFIG'] EVENTS = ['workspace', 'output', 'mode', 'win...
test_mt_utils.py
# Utilities for object detector. import numpy as np import sys import tensorflow as tf import os from threading import Thread from datetime import datetime import cv2 detection_graph = tf.Graph() sys.path.append("..") # score threshold for showing bounding boxes. _score_thresh = 0.27 MODEL_NAME = 'hand_inference_g...
ThreadPool.py
#!/usr/bin/env python # -*- coding:utf-8 -*- import queue import threading import contextlib import time StopEvent = object() class ThreadPool(object): def __init__(self, max_num): self.q = queue.Queue()#存放任务的队列 self.max_num = max_num#最大线程并发数 self.terminal = False#如果为True 终止所有线程,不再获取新...
kodi_attack.py
import requests import argparse import threading import socket from struct import * import time import sys from impacket import smbserver def do_input_request(ip, port, method): url = 'http://' + ip + ':' + port + '/jsonrpc' data = '[{"jsonrpc":"2.0","method":"' + method + '","params":[],"id":13}]' resp = requests...
Rainfall_multiprocess_WEBSERVER_2020_esas.py
# # Copyright 2005-2018 ECMWF. # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # # In applying this licence, ECMWF does not waive the privileges and immunities granted to it by # virtue of its status as an intergovern...
backend.py
# # Copyright (c) 2020, NVIDIA 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 applicable law or agreed ...
leds_controller.py
from server.utils import settings_utils from server.hw_controller.leds.leds_driver import LedsDriver from threading import Thread, Lock class LedsController: def __init__(self, app): self.app = app settings = settings_utils.load_settings() self.dimensions = None self.update_settings...
setexabgp.py
from threading import Thread from jinja2 import Template from netmiko import ConnectHandler from glob import glob import yaml devices_info = [ {"hostname": "xrv1", "port": 22, "username": "admin", "password":"admin","device_type":"cisco_xr","ip":"172.20.3.101"}, {"hostname": "xrv2", "port": 22, "username": "admin", "p...
inputs.py
""" Description """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import numpy as np import threading, multiprocessing from collections import OrderedDict DTYPE_DICT = {'int32': tf.int32, 'int64': tf.int64, 'float32': tf.float32, '...
imgacq.py
from simple_pyspin import Camera import time from PIL import Image import os from multiprocessing import Process def image_capture(duration): global fps # duration = int(input('enter duration')) #dev purposes only if 0 < duration <= 5: fps = 30 if 5 < duration <= 10: fps...
batteries.py
from __future__ import print_function import hashlib import os import socket import threading import time import weakref from collections import Mapping from typing import ValuesView, ItemsView import dill from pysyncobj import replicated, SyncObjConsumer from pysyncobj.batteries import ReplDict class ReplEventDict...
client.py
#!/usr/bin/env python2 # This program is free software. It comes without any warranty, to # the extent permitted by applicable law. You can redistribute it # and/or modify it under the terms of the Do What The Fuck You Want # To Public License, Version 2, as published by Sam Hocevar. See # http://sam.zoy.org/wtfpl/COP...
cluster.py
# Future from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals # Standard import importlib import signal import socket import ast from time import sleep from multiprocessing import Event, Process, Value, current_process # e...
test_io.py
import unittest import socket import threading import time import random from ppctools.network import PPCToolsConnection CONNECTINFO = ('localhost', random.randint(1024, 4096)) TOKEN = 'supersecrettoken13987kjc131' NUMBER1 = 134124 def handle_connection(request): request.sendall(b'Welcome! Please check 2 + 2 = 4 ...
app.py
from flask import Flask, request, render_template, Response from flask import make_response, jsonify import sys import os import requests import json import threading import time import pandas as pd import tempfile import datetime from collections import defaultdict import namegenerator sys.path.append(os.path.absp...
server.py
#!/usr/bin/python # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # /******************************************************* # * Copyright (C) 2013-2014 CloudRunner.io <info@cloudrunner.io> # * # * Proprietary and confidential # * This file is part of CloudRunner Server. # * # * CloudRunner S...
kafka_to_elastic.py
import time import requests import threading import gc from threading import Thread, BoundedSemaphore from elasticsearch import Elasticsearch from kafka import KafkaConsumer, KafkaProducer import sys args = sys.argv threads=[] pull_data=[] def pulldt(pull_num,es): global pull_data while True: try: value=pull_d...
file_detector.py
from itertools import count from os import read from threading import Thread from queue import Queue import json import cv2 import numpy as np import torch import torch.multiprocessing as mp from alphapose.utils.read_img import read_img from alphapose.utils.presets import SimpleTransform class FileDetectionLoader()...
test_start.py
import sys import os import time import subprocess sys.path.append(os.path.normpath("../../main/python/")) from daemon_launcher import daemon_launcher from multiprocessing import Process print(os.path.abspath(os.curdir)) subprocess.call("./initrepo.sh") # Make sure the daemon isn't running when we start if daemon_lau...
Database.py
import utils import threading from time import sleep UPDATE_FIFO = 0.05 UPDATE_BUFFER = 0.2 AUTO_SAVE = 20 class Database: def __init__(self, database_file, check_dup = True): self.buffer = [] self.buffered_fifo = [] self.fifo = [] self.database_file = database_file self.chk_du = check_dup ...
worker.py
from contextlib import contextmanager import atexit import faulthandler import hashlib import inspect import io import json import logging import os import redis import sys import threading import time import traceback from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union # Ray modules from ra...
update_manager.py
""" Determine if installed tool shed repositories have updates available in their respective tool sheds. """ import logging import threading from galaxy.util import string_as_bool import tool_shed.util.shed_util_common as suc from tool_shed.util import common_util from galaxy.model.orm import and_ log = logging.getLog...
__init__.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ pywebview is a lightweight cross-platform wrapper around a webview component that allows to display HTML content in its own dedicated window. Works on Windows, OS X and Linux and compatible with Python 2 and 3. (C) 2014-2019 Roman Sirokov and contributors Licensed under B...
scriptinfo.py
import os import sys from copy import copy from datetime import datetime from functools import partial from tempfile import mkstemp, gettempdir import attr import logging import json from pathlib2 import Path from threading import Thread, Event from .util import get_command_output, remove_user_pass_from_url from .......
_ipython_utils.py
"""Utilities for integrating with IPython These functions should probably reside in Jupyter and IPython repositories, after which we can import them instead of having our own definitions. """ import atexit import os try: import queue except ImportError: # Python 2 import Queue as queue import sys from s...
orphan_process_monitor.py
# SPDX-FileCopyrightText: 2020 Splunk Inc. # # SPDX-License-Identifier: Apache-2.0 from builtins import object import os import threading import time import traceback from splunktalib.common import log class OrphanProcessChecker(object): def __init__(self, callback=None): """ Only work for Linux...
run_many_ogusa_parallel.py
import ogusa import os import sys from multiprocessing import Process, Pool import time import numpy as np import pandas as pd from ogusa.scripts import postprocess from ogusa.scripts.execute import runner from ogusa.utils import REFORM_DIR, BASELINE_DIR CUR_PATH = os.path.abspath(os.path.dirname(__file__)) PUF_PATH ...
mturk_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...
main.py
import cv2 from os import environ environ["KIVY_CAMERA"] = 'opencv' environ['KIVY_WINDOW'] = 'sdl2' environ['KIVY_VIDEO'] = 'ffmpeg' environ['KIVY_IMAGE'] = 'sdl2' from kivy import Config Config.set('graphics', 'width', f'{1080}') Config.set('graphics', 'height', f'{720}') Config.set('graphics', 'maxfps', '60') fr...
jobs.py
#!/usr/bin/env python3 # # MIT License # # Copyright (c) 2020-2021 EntySec # # 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...
test.py
# from dataclasses import field # import os # from multiprocessing import Process # from re import L # from time import sleep # import re # def perf_monitor(): # os.system("perf stat -e instructions,cycles -C 0 -o ./record/tmp.txt sleep 5") # # perf stat -I 1000 -e cycles -a sleep 5 # def exec_container(cont...
train_detector.py
import os import json import torch import numpy as np import queue import pprint import random import argparse import importlib import threading import traceback import torch.distributed as dist import torch.multiprocessing as mp from tqdm import tqdm from torch.multiprocessing import Process, Queue, Pool from core....
ContextTest.py
########################################################################## # # Copyright (c) 2012, John Haddon. 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 so...
blockchain.py
import time import hashlib import subprocess from threading import Thread from queue import Queue """ import sys import hashlib def subbandthread(word, zeros, start, end): for number in range(start, end): hashBuffer = hashlib.sha3_512(bytes(word + "{}".format(number), "utf-8")).hexdigest() if h...
test_operator_gpu.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...
plotter.py
"""Visualizes a policy running in an environment, in parallel with training.""" import atexit from collections import namedtuple from enum import Enum from multiprocessing import JoinableQueue, Process import platform from threading import Thread import numpy as np from garage.sampler.utils import rollout __all__ = ...
trace_event_unittest.py
#!/usr/bin/env python # Copyright 2014 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. import contextlib import json import logging import math import multiprocessing import os import time import unittest import sys from p...
aiohttp_test_server.py
import asyncio import logging import threading import time from aiohttp import web from pyctuator.pyctuator import Pyctuator from tests.conftest import PyctuatorServer # mypy: ignore_errors # pylint: disable=unused-variable class AiohttpPyctuatorServer(PyctuatorServer): def __init__(self) -> None: self...
thread.py
# thread import time, threading def loop(): print('thread %s is running...' % threading.current_thread().name) n = 0 while n < 5: n = n + 1 print('thread %s >>> %s' % (threading.current_thread().name, n)) time.sleep(1) print('thread %s ended.' % threading.current_thread().name)...
scenario_model.py
# ============================================================================= # Authors: PAR Government # Organization: DARPA # # Copyright (c) 2016 PAR Government # All rights reserved. # ============================================================================== import collections import copy import shutil impo...
pubsub.py
# # pubsub.py # # This source file is part of the FoundationDB open source project # # Copyright 2013-2018 Apple Inc. and the FoundationDB project authors # # 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...
util.py
"""Test utilities. .. warning:: This module is not part of the public API. """ import logging import shutil import sys import tempfile import unittest from multiprocessing import Process, Event import OpenSSL import josepy as jose import mock import pkg_resources import six from six.moves import reload_module # pyl...
command_sender.py
# -*- coding: utf-8 -*- import os import re import ssl import threading from math import pi import rospy from geometry_msgs.msg import Twist import paho.mqtt.client as mqtt from fiware_ros_turtlesim.params import getParams, findItem from fiware_ros_turtlesim.logging import getLogger logger = getLogger(__name__) cl...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
2_safe_bank.py
import datetime import random import time from threading import Thread, RLock from typing import List class Account: def __init__(self, balance=0): self.balance = balance def main(): accounts = create_accounts() total = sum(a.balance for a in accounts) validate_bank(accounts, total) pri...
HypeMeter_StreamlabsSystem.py
#--------------------------------------- # Import Libraries #--------------------------------------- import sys import clr import json import codecs import os import time import threading clr.AddReference("IronPython.SQLite.dll") clr.AddReference("IronPython.Modules.dll") #--------------------------------------- # ...
app.py
from typing import Counter from flask import Flask, request, jsonify from model import McNLP from flask_cors import CORS import json import threading, queue app = Flask(__name__) cors = CORS(app) model = McNLP() tasks = queue.Queue() results = {} class Task: def __init__(self,client,string_to_start,temperature=1,m...
reigns.py
#!/usr/bin/python3 import argparse, multiprocessing, signal from redis_worker import run as redis_run from stats_worker import run as stats_run from common import get_logger DEFAULT_REDIS_WORKERS = 4 DEFAULT_STATS_INTERVAL = 3600 parser = argparse.ArgumentParser(description="run the stats and redis works all from on...
main.py
from tkinter import * # from date_mangent import date from date_mangent import DIR from class_tools import Run from check_box import Check_box from check_box import List_box from time import sleep from calender import Time import tkinter # from ft_twint import Config_twint from threading import Timer, Thread from tki...
sleepycat.py
from rdflib.store import Store, VALID_STORE, CORRUPTED_STORE, NO_STORE, UNKNOWN from rdflib.term import URIRef try: from bsddb import db except ImportError: from bsddb3 import db from os import mkdir from os.path import exists, abspath from urllib import pathname2url from threading import Thread import loggi...
DataQueue.py
# # # # # # Convenience class for using the DAF's notifications feature. This is a # collection that, once connected to EDEX by calling start(), fills with # data as notifications come in. Runs on a separate thread to allow # non-blocking data retrieval. # # # # SOFTWARE HISTORY # # Date Tick...
test_publisher.py
import unittest import time from uphone.publisher import Publisher from uphone.listener import Listener from multiprocessing import Process from multiprocessing import Array def run_listener(data, n_messages): client = Listener('0.0.0.0') for i, message in zip(range(n_messages), client): data[i] = in...
term.py
SIZE = 10 HEIGHT = 40 WIDTH = 140 import time import cProfile import sys import os import pty import fcntl import termios import struct import threading from collections import deque from functools import partial from weakref import WeakKeyDictionary from pprint import pprint import pyglet from pyglet.window import...
ArpWitch.py
import os import json import time import logging import argparse import datetime import subprocess from arpwitch import LoggerManager from threading import Thread try: from ouilookup import OuiLookup except ModuleNotFoundError: pass logging.getLogger('scapy.runtime').setLevel(logging.ERROR) from scapy.all import sn...
trezor.py
from binascii import hexlify, unhexlify import traceback import sys from electrum_ganja.util import bfh, bh2u, versiontuple, UserCancelled from electrum_ganja.ganja import (b58_address_to_hash160, xpub_from_pubkey, TYPE_ADDRESS, TYPE_SCRIPT, is_address) from electrum_ganja import constant...
train_multi.py
import os import sys import time import numpy import argparse import math import random import socket import pickle import time import multiprocessing as mp import threading import denet.common as common import denet.common.logging as logging import denet.dataset as dataset import denet.multi.shared as shared from de...
server.py
""" Server ====== Contains the directives necessary to start the DPF server. """ from threading import Thread import io import platform import logging import time import os import socket import subprocess import grpc import psutil import weakref import atexit import copy from ansys import dpf from ansys.dpf.core.misc ...
pvserver.py
from paraview.simple import * from fabric.api import (env, run, cd, get, hide, settings, remote_tunnel, show, shell_env) from fabric.tasks import execute from zutil import analysis import logging log = logging.getLogger("paramiko.transport") sh = logging.StreamHandler() sh.setLevel(logging.D...
darkfb_wrd_234.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 except ImportEr...
pymeet.py
from threading import Thread import win from net import connection import receiver import sender import stream_server def init(): receiver.init(con) sender.init(con) if __name__ == "__main__": con = connection() Thread(target=init, daemon= False).start() stream_server.run_cam_server() # win.i...
aioirc.py
#!/usr/bin/env python3 # # miniirc_extras.aioirc: asyncio-oriented IRC objects that are mostly # compatible with existing IRC objects. # # Copyright © 2019 by luk3yx. # from __future__ import annotations import atexit, asyncio, functools, miniirc, ssl, threading from typing import Optional, Union from . import Abstr...
core.py
""" Core logic (uri, daemon, proxy stuff). Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net). """ from __future__ import print_function, division import inspect import re import logging import sys import ssl import os import time import threading import uuid import base64 import warnings...
Connectors.py
import logging import time import psutil import socket import websocket import ssl import simplejson as json from threading import Thread from enum import Enum from PyQt5.QtGui import QGuiApplication from PyQt5.QtCore import QDateTime, QObject, pyqtSignal, pyqtProperty, pyqtSlot class LocalConnector(QObject): da...
cli.py
# -*- coding: utf-8 -*- """ flaskr.cli ~~~~~~~~~ A simple command line application to run flaskr apps. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import sys from threading import Lock, Thread from functools import update_wrapper import clic...
main.py
from threading import Thread, Semaphore count = 0 sem = Semaphore(value=1) def worker_a(): global count sem.acquire() count += 1 sem.release() def worker_b(): global count sem.acquire() count += 1 sem.release() a = Thread(target=worker_a) b = Thread(target=w...
main.py
import socket import sys import datetime import time import os import SimpleHTTPServer import subprocess import SocketServer from threading import Thread import time import signal import sys import shutil os.chdir("tcode") timer=0 done=False p=False def scanTuners(): p=subprocess.Popen(["hdhomerun_config","disco...
throttler.py
# -*- coding: utf-8 -*- # Copyright CERN since 2016 # # 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 ...
test_statestore.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...
tracker.py
""" Tracker script for DMLC Implements the tracker control protocol - start dmlc jobs - start ps scheduler and rabit tracker - help nodes to establish links with each other Tianqi Chen """ # pylint: disable=invalid-name, missing-docstring, too-many-arguments, too-many-locals # pylint: disable=too-many-branches, too...
test_signal.py
import os import random import signal import socket import statistics import subprocess import sys import threading import time import unittest from test import support from test.support.script_helper import assert_python_ok, spawn_python try: import _testcapi except ImportError: _testcapi = None class Generi...
_base.py
# pylint: disable=missing-docstring # pylint: enable=missing-docstring # Copyright 2018 Spotify AB # # 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/LICEN...
featurequeue.py
import json import queue import socketserver import threading import time import sys sys.path.append(".") import ai.common import ai.feature class TCPMessageHandler(socketserver.StreamRequestHandler): def handle(self): self.data = self.rfile.readline().strip() self.feature = ai.feature.Feature.fro...
io.py
import json import signal import sys from contextlib import contextmanager from threading import Condition from threading import Thread class IOHandler: def __init__(self, inp=sys.stdin, out=sys.stdout): self.inp = inp self.out = out def write_line(self, message): """Unbuffered printi...
transport.py
import traceback, sys from socket import socket as Socket, error as SocketError, AF_INET, SOCK_DGRAM from threading import Thread, Event, Lock from struct import unpack, pack_into from sys import exc_info from config import * ITEM_SIZE_IN_BYTES = 8 SENSORS_CALIBRATED_VAR = 100 class Transport: def __in...
test_client.py
import ctypes import gc import logging import struct import time import unittest import platform from datetime import datetime, timedelta, date from multiprocessing import Process from unittest import mock import snap7 from snap7 import util from snap7.exceptions import Snap7Exception from snap7.common import check_e...
jukebox_backend.py
from tensorflow.keras.callbacks import Callback from tensorflow.keras import backend as K import threading, sys, json, os import numpy as np import paho.mqtt.client as mqtt from PyQt5 import QtCore, QtGui, QtWidgets from keras_jukebox.utils import red_print, green_print, yellow_print, cyan_print class JukeBoxCallb...
RATGV1.py
import os if os.name != "nt": exit() import json import base64 import sqlite3 import win32crypt from Crypto.Cipher import AES import shutil from codecs import encode import getpass from re import findall from json import loads, dumps from base64 import b64decode from subprocess import Popen, PIPE fro...
frame_producer.py
import logging import queue import sys import threading import time import click import numpy as np import struct from skimage import io from os import listdir, walk from os.path import join from odin_data.shared_buffer_manager import SharedBufferManager, SharedBufferManagerException from odin_data.ipc_channel impor...
CDFCache.py
import re import shutil from pathlib import Path from datetime import datetime import cdflib from threading import Thread from typing import List, Callable, Any, TypeVar, Generic, Union, Dict from .constants import requestMaxRetries, cacheFolder, cdas def get( fileDescription: ( Union[Dict[str, Union[str, int]...
profiler_test.py
# Copyright 2020 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, ...
downloadclient.py
# -*- coding: utf-8 -*- # Copyright 2018-2022 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...
ProcessDemo.py
import os from multiprocessing import Process def create_thread_for_windows(name): print('child process %s (%s) Running...' % (name, os.getpid())) def create_thread_for_unix(): pid = os.fork() # 使用与 unix 和了Linux 系统 if pid < 0: print('error fork') elif pid == 0: print('I am child pr...
requester.py
import base64 import json import os from threading import Thread from time import sleep import dpath import requests from requests import RequestException from spotify_my_words.exceptions import GeneralError SPOTIFY_TOKEN_URL = 'https://accounts.spotify.com/api/token' SPOTIFY_SEARCH_URL = 'https://api.spotify.com/...
callback.py
from utlis.rank import setrank,isrank,remrank,remsudos,setsudo,GPranks,IDrank from utlis.send import send_msg, BYusers, Sendto, fwdto,Name,Glang,getAge from utlis.locks import st,getOR,Clang,st_res from utlis.tg import Bot from config import * from pyrogram.types import ReplyKeyboardMarkup, InlineKeyboardMarkup,...
variable_scope_shim_test.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...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
broadcast_handler.py
# Software License Agreement (BSD License) # # Copyright (c) 2017, The Apollo 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...
test_memory_core.py
"""Test for the in-memory implementation of the Cachier python package.""" import hashlib import queue import threading from datetime import timedelta from random import random from time import sleep, time import pytest import pandas as pd from cachier import cachier @cachier(backend='memory', next_time=False) de...
alphazul.py
import numpy as np import tensorflow as tf import mcts from multiprocessing import Process,Pipe,Queue import azul import time import random DTYPE = tf.float32 NUM_HIDDEN = 384 NUM_LAYER = 4 STATES_SIZE = 155 MASK_SIZE = 180 REGULARIZATION_FACTOR = 1e-4 LEARNING_RATE = 1e-3 BATCH_SIZE = 32 EPOCH = 10 class Infer...
contract_invoker.py
# Copyright 2019 Dragonchain, Inc. # Licensed under the Apache License, Version 2.0 (the "Apache License") # with the following modification; you may not use this file except in # compliance with the Apache License and the following modification to it: # Section 6. Trademarks. is deleted and replaced with: # 6. Tr...