source
stringlengths
3
86
python
stringlengths
75
1.04M
gst_overlay_pipeline.py
# Based on https://github.com/google-coral/examples-camera/tree/master/gstreamer import os import sys import svgwrite import threading import numpy as np import gi gi.require_version("Gst", "1.0") gi.require_version("GstBase", "1.0") gi.require_version("Gtk", "3.0") from gi.repository import GLib, GObject, Gst, GstB...
systemMngApi.py
# -*- coding:utf-8 -*- import json import os import threading from flask import Blueprint, request from flask.globals import session from flask.helpers import send_from_directory from util.common import paramEscape, getApiData, postApiData, getApiSingleData, \ strToLong, deleteApiDataByJson, getParameter, getData...
vms_nginx_listen.py
# coding: utf-8 #------------------------------ # [ไปŽ]ๆœๅŠกๅ™จไธŠๆŠฅ #------------------------------ import sys import os import json import time import threading import subprocess import shutil sys.path.append("/usr/local/lib/python2.7/site-packages") import psutil root_dir = os.getcwd() sys.path.append(root_dir + "/class/co...
composed_reader.py
#!/usr/bin/env python3 import logging import sys import threading import time sys.path.append('.') from logger.readers.reader import Reader from logger.transforms.transform import Transform from logger.utils import formats # How long to a reader thread should lie dormant before shutting down # and counting on getti...
Temple.py
# coding=utf-8 # Copyright 2019 StrTrek Team 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 License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
CVE-2019-17240_bludit-3.9.2_pwd-bruteforce_multi.py
#!/usr/bin/env python3 #coding: utf8 #CVE-2019-17240 Bludit <= 3.9.2 Admin Portal login brute-force tool for (HTB - blunder) #Need valid username to use import multiprocessing import sys import time from multiprocessing import Queue import re import requests def worker(cred_queue): print('Starting new worker thre...
test.py
# -*- coding: utf-8 -*- """ Created on Tue Mar 19 00:50:01 2019 @author: nac2313 """ #module used for testing new code import time import multiprocessing def basic_func(x): if x == 0: return 'zero' elif x%2 == 0: return 'even' else: return 'odd' def multiprocessing_func(x): ...
DtbIKBones.py
import sys import os import math sys.path.append(os.path.dirname(__file__)) import bpy import mathutils from copy import deepcopy from . import DazRigBlend from . import DtbShapeKeys from . import DataBase from . import ToRigify from . import Global from . import Versions from . import DtbDazMorph from . import DtbOper...
test_ffi.py
import sys, py from pypy.module.pypyjit.test_pypy_c.test_00_model import BaseTestPyPyC class Test__ffi(BaseTestPyPyC): def test__ffi_call(self): from rpython.rlib.test.test_clibffi import get_libm_name def main(libm_name): try: from _rawffi.alt import CDLL, types ...
driver.py
from appl.kafka_interface import TopicConsumer, TopicPublisher import sys import threading import traceback import logging LOG = logging.getLogger("root") # Constants bootstrap_servers = '127.0.0.1:9092' kafka_conf = {"bootstrap.servers": bootstrap_servers} class ApplicationState: def __init__(self): se...
models.py
# -*- coding: utf-8 -*- """ Data models for the Deis API. """ from __future__ import unicode_literals import base64 from datetime import datetime import etcd import importlib import logging import re import time from threading import Thread from django.conf import settings from django.contrib.auth import get_user_mo...
Controller.py
from udi_interface import Node,LOGGER,Custom,LOG_HANDLER import logging,re,json,sys,asyncio from threading import Thread,Event from node_funcs import get_valid_node_name,get_valid_node_address #sys.path.insert(0,"pyHS100") #from pyHS100 import Discover from kasa import Discover from nodes import SmartStripPlug...
host_callback_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, ...
app_timer.py
import tkinter import playsound import threading from tkinter.constants import DISABLED, NORMAL class AppEntry: def __init__(self, root): self.st_min = tkinter.StringVar(value="01") self.st_sec = tkinter.StringVar(value="00") self.ent_min = tkinter.Entry(root, textvariable=self.s...
individual_coverage.py
#!/usr/bin/env python3 import io import contextlib import os import sys import glob import multiprocessing import configparser import itertools import pytest def run_tests(src, test, fail): stderr = io.StringIO() stdout = io.StringIO() with contextlib.redirect_stderr(stderr): with contextlib.redi...
skeleton_reader_standardize.py
import fnmatch import os import re import threading import librosa import numpy as np import tensorflow as tf def normalizationStats(completeData): data_mean = np.mean(completeData, axis=0) data_std = np.std(completeData, axis=0) # dimensions_to_ignore = [] # if not full_skeleton: # ...
test_threads.py
import asyncio import sys import threading import time from concurrent.futures import CancelledError from contextlib import suppress import pytest from anyio import ( create_blocking_portal, create_capacity_limiter, create_event, create_task_group, get_cancelled_exc_class, get_current_task, run, run_async_fro...
main.py
# This is a sample Python script. # Press Shift+F10 to execute it or replace it with your code. # Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. import sys, os, threading, queue, pyautogui, time from multiprocessing.managers import BaseManager import ctypes import keyb...
road_speed_limiter.py
import json import select import threading import time import socket import fcntl import struct from threading import Thread from cereal import messaging from common.params import Params from common.numpy_fast import interp from common.realtime import sec_since_boot CAMERA_SPEED_FACTOR = 1.05 class Port: BROADCAST...
gossip.py
import os from common import utility, crypto import hashlib import time from copy import deepcopy from multiprocessing import Process, Lock def gossip(config, network, gossipSequence): """ creates and writes all gossip from the files nodeSaveFile and channelSaveFile defined in config Writes this informat...
session.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020 Alibaba Group Holding Limited. 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...
helpers.py
""" Helper functions file for OCS QE """ import logging import re import datetime import statistics import os from subprocess import TimeoutExpired import tempfile import time import yaml import threading from ocs_ci.ocs.ocp import OCP from uuid import uuid4 from ocs_ci.ocs.exceptions import TimeoutExpiredError, Unex...
unicorn_binance_websocket_api_manager.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # File: unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py # # Part of โ€˜UNICORN Binance WebSocket APIโ€™ # Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api # Documentation: https://oliver-zehentleitner.github.io/uni...
usbtest_rw_buf.py
#!/usr/bin/env python import logging import threading import time from usblib import device_from_fd from usblib import shell_usbdevice from usblib import CP210xSerial LOGGER = logging.getLogger(__name__) # ---------------------------------------------------------------------------- def main(fd, debug=False): ...
trainer.py
# Copyright 2021 RLCard Team of Texas A&M University # Copyright 2021 DouZero Team of Kwai # # 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 ...
driver_util.py
"""Scripts for drivers of Galaxy functional tests.""" import http.client import logging import os import random import re import shlex import shutil import signal import socket import string import subprocess import sys import tempfile import threading import time from typing import Optional from urllib.parse import u...
test_core.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...
part_test.py
import sys import threading sys.path.append('../../common') from env_indigo import * def outPrint(str, pid, output): #output = None if output == None: print(str) else: old_out = output[pid] output[pid] = '{0}\n{1}'.format(old_out, str) def insertSmi(db, pid, input_smi, ou...
runner.py
import argparse import datetime import docker import json import multiprocessing.pool import numpy import os import psutil import requests import sys import threading import time import psutil from datasketch import MinHash import collections from ann_benchmarks.datasets import get_dataset, DATASETS from ann_benchmar...
serial_reader.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright ยฉ 2019 ckitagawa <ckitagawa@edu.uwaterloo.ca> # # Distributed under terms of the MIT license. import logging import threading import serial import serial.tools.list_ports import fiber_reading from collections import deque def select_devic...
client.py
import logging try: import queue except ImportError: # pragma: no cover import Queue as queue import signal import threading import time import six from six.moves import urllib try: import urllib3 except ImportError: # pragma: no cover urllib3 = None try: import websocket except ImportError: # p...
poseidonMain.py
#!/usr/bin/env python # # Copyright (c) 2016 In-Q-Tel, Inc, All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 #...
views.py
from django.shortcuts import render, redirect from django.http import HttpResponse, StreamingHttpResponse import threading import pyrebase import cv2 from django.contrib.gis.geoip2 import GeoIP2 from .forms import * from itertools import chain # from . import db_models as db_method ###########################-FIREB...
test_capture.py
import contextlib import io import os import subprocess import sys import textwrap from io import UnsupportedOperation from typing import BinaryIO from typing import cast from typing import Generator from typing import TextIO import pytest from _pytest import capture from _pytest.capture import _get_multicapture from ...
build_imagenet_data.py
# 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
main.py
#!/usr/bin/env python3 import threading from socket import AF_INET, SOCK_DGRAM, SOCK_STREAM, socket, SHUT_WR import config from config import SERVER_ADDRESS, SERVER_PORT from definitions import AnsiColors from utility import print_protected if config.TCPIP_PROT == config.Protocols.TCPIP_PROT_1_UDP: CLIENT_SOCKET ...
utility.py
import os import math import time import datetime from multiprocessing import Process from multiprocessing import Queue import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import imageio import torch import torch.optim as optim import torch.optim.lr_scheduler as lrs class time...
external_program.py
# -*- coding: utf-8 -*- # # Copyright 2012-2016 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/LICENSE-2.0 # # Unless required by applicable law...
test_content.py
from __future__ import print_function import os import re import sys import json import time import argparse import threading import subprocess import traceback from time import sleep import datetime from distutils.version import LooseVersion import pytz from google.cloud import storage from google.api_core.exception...
imbd_data_loader.py
import os from urllib import request import subprocess import csv import sys import pickle from sklearn.preprocessing import MultiLabelBinarizer import spacy from functools import partial from multiprocessing import Manager,Process from scipy.sparse import lil_matrix from scipy.sparse import csr_matrix import numpy a...
_threading_local.py
"""Thread-local objects. (Note that this module provides a Python version of the threading.local class. Depending on the version of Python you're using, there may be a faster one available. You should always import the `local` class from `threading`.) Thread-local objects support the management of thread-local d...
EDL.py
import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * from flask import Flask, Response, request from gevent.pywsgi import WSGIServer from tempfile import NamedTemporaryFile from typing import Callable, List, Any, Dict, cast from base64 import b64decode from copy import dee...
lobbyscreen.py
from mbaacc import MOON from json.decoder import JSONDecodeError import time import requests import threading import pyperclip from functools import partial from config import * from kivy.properties import ObjectProperty from kivy.uix.screenmanager import Screen from ui.modals import * from ui.buttons import DummyBtn, ...
reconhecimento.py
# -*- coding: utf-8 -*- import multiprocessing from multiprocessing import Pipe,Process import multiprocessing.dummy as mp import face_recognition import cv2 import time # This is a demo of running face recognition on live video from your webcam. It's a little more complicated than the # other example, but it inc...
test.py
import sys import time from multiprocessing import Process from pprint import pprint import http.client import psycopg2 import toml from flask import Flask app = Flask(__name__) SLOW_DELAY = 1.0 @app.route('/hello') def route_hello(): return 'hello' @app.route('/fast') def route_fast(): return 'fast' @...
__init__.py
import importlib import os from os import path import sys import time import math import collections import multiprocessing import imageio import pickle import itertools import torch import torchvision.utils as vutils def str2num(string): ''' Extract a number from the given string Arg: ''' retur...
loader.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...
Proyecto2sistop.py
# -*- coding: utf-8 -*- """ Created on Sat Apr 11 02:52:43 2020 @name: El plato de comida para perros @author: Fernando Arturo Medina Molina @contact: fernando170@comunidad.unam.mx @version: 1.0 @description: A travรฉs de รฉste cรณdigo se pretende dar soluciรณn al problema de sincronizaciรณn de hilos pla...
exported-sql-viewer.py
#!/usr/bin/env python # SPDX-License-Identifier: GPL-2.0 # exported-sql-viewer.py: view data from sql database # Copyright (c) 2014-2018, Intel Corporation. # To use this script you will need to have exported data using either the # export-to-sqlite.py or the export-to-postgresql.py script. Refer to those # scripts f...
custom.py
# pylint: disable=too-many-lines # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -----------------------------------...
parfor.py
from typing import Any, Callable, List import threading def parfor(data_list: List[Any], func: Callable, num_workers: int, prog_bar: bool = True, **kwargs): """a parfor implementation Args: data_list ([list]): a list stores all the data func ([function]): a function which has three parameters...
coco_download.py
from __future__ import print_function from pycocotools.coco import COCO import os import zipfile import shutil import skimage.io as io from PIL import Image from threading import Thread, Lock from urllib.error import URLError from urllib.request import urlopen # Choose main data dir and category from: # person bicycl...
tunnel.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
test_io.py
"""Unit tests for the io module.""" # Tests of io are scattered over the test suite: # * test_bufio - tests file buffering # * test_memoryio - tests BytesIO and StringIO # * test_fileio - tests FileIO # * test_file - tests the file interface # * test_io - tests everything else in the io module # * test_univnew...
newprofiler.py
# Python Profiler v3 # Copyright (c) 2015-2017 David R Walker # TODO: # [x] Record only functions in StackLines # [ ] Handle per-line hotspots as separate structure (not nested) - ? # [ ] Handle timeline as separate structure # [x] Use unique stack IDs to dedupe stack tuples # [ ] Merge profile data method #...
utils.py
import datetime from queue import Queue, Empty from threading import Thread import os from itertools import chain from typing import Union, Any, Optional, TypeVar, Set, Dict, Iterable, Tuple, Iterator, Callable, List import pytz import six from importlib import import_module from importlib.util import find_spec from ...
gym_gazeboros.py
#!/usr/bin/env python from datetime import datetime import copy import traceback import os, subprocess, time, signal #from cv_bridge import CvBridge import gym import math import random # u import numpy as np import cv2 as cv import rospy # Brings in the SimpleActionClient import actionlib # Brings in the .actio...
collective_ops_test.py
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
scanner.py
from multiprocessing import Process, Manager from os import devnull, popen from threading import Thread from subprocess import Popen, PIPE, STDOUT from tabulate import tabulate import requests class ThreadFastScanIP(Thread): def __init__(self, gateway, range_start, range_end, parent= None): ...
test1.py
# # FreeRTOS BLE HAL V2.0.0 # Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including wit...
btcomm.py
from __future__ import unicode_literals import socket import sys import errno from .utils import ( register_spp, get_mac, get_adapter_powered_status, get_adapter_discoverable_status, get_adapter_pairable_status, get_paired_devices, device_pairable, device_discoverable, device_power...
SleepableThread.py
import threading import time import os from termcolor import colored class SleepableThread(threading.Thread): def __init__(self): super(SleepableThread, self).__init__() self.create_thread() self.start_thread() thread = None thread_pid = '' thread_spawn_count = 0 thread_s...
__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # 2020, Jan Cervenka import redis import multiprocessing as mp from .app import create_app from .backend import RequestProcessor from .constants import (REDIS_HOST, REDIS_PORT, DEFAULT_SERVICE_HOST, DEFAULT_SERIVCE_PORT) def run_app(args): """...
server.py
#!/usr/bin/python # -*- coding: utf-8 -*- import io import socket import struct import time import picamera import fcntl import sys import threading from Motor import * from servo import * from Led import * from Buzzer import * from ADC import * from Thread import * from Light import * from Ultrasonic import * from L...
mitm_relay.py
#!/usr/bin/env python import sys import socket import ssl import os import requests import argparse import time import string from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from threading import Thread from select import select BIND_WEBSERVER = ('127.0.0.1', 49999) BUFSIZE = 4096 __...
test_ssl.py
# Test the support dla SSL oraz sockets zaimportuj sys zaimportuj unittest z test zaimportuj support zaimportuj socket zaimportuj select zaimportuj time zaimportuj datetime zaimportuj gc zaimportuj os zaimportuj errno zaimportuj pprint zaimportuj tempfile zaimportuj urllib.request zaimportuj traceback zaimportuj async...
pod.py
""" Pod related functionalities and context info Each pod in the openshift cluster will have a corresponding pod object """ import logging import os import re import yaml import tempfile import time import calendar from threading import Thread import base64 from semantic_version import Version from ocs_ci.ocs.bucket_...
long_dump_thread.py
# Copyright (c) 2010-2011 openpyxl # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, ...
scheduling.py
import schedule import threading import time import datetime class JobSchedule(object): SECOND = 0 MINUTE = 1 HOUR = 2 DAY = 3 WEEK = 4 NEW_YEAR = "0101" EPIPHANY = "0106" LIBERATION = "0425" LABOUR_DAY = "0501" REPUBLIC_DAY = "0206" ASSUMPTION_DAY = "0815" ...
one_vs_one_collector.py
from typing import Dict, Any, List import copy import time import uuid from collections import namedtuple from threading import Thread from functools import partial import numpy as np import torch from easydict import EasyDict from ding.policy import create_policy, Policy from ding.envs import get_vec_env_setting, cre...
test_policies.py
# Copyright 2013-2016 DataStax, 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 writi...
pigear.py
""" =============================================== vidgear library source-code is deployed under the Apache 2.0 License: Copyright (c) 2019 Abhishek Thakur(@abhiTronix) <abhi.una12@gmail.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with th...
_threading_local.py
from threading import current_thread, RLock """Thread-local objects. (Note that this module provides a Python version of the threading.local class. Depending on the version of Python you're using, there may be a faster one available. You should always import the `local` class from `threading`.) Thread-local obje...
test_video.py
import socket import threading import time import pickle import cv2 from Detection.MtcnnDetector import MtcnnDetector from Detection.detector import Detector from Detection.fcn_detector import FcnDetector from train_models.mtcnn_model import P_Net, R_Net, O_Net import visualization_utils thresh = [0.7, 0.1, 0.1] min_f...
SpotifyLyrics.pyw
#!/usr/bin/env python3 import configparser import getpass import os import platform import re import subprocess import sys import threading import time import webbrowser import pathvalidate import pylrc import sentry_sdk from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import QSystemTrayIcon, QAction, Q...
tree-height.py
# python3 import sys, threading sys.setrecursionlimit(10**7) # max depth of recursion threading.stack_size(2**27) # new thread will get stack of such size class TreeHeight: def read(self): self.n = int(sys.stdin.readline()) self.parent = list(map(int, sys.stdin.readline().spli...
test_worker.py
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) import json import os import psutil import shutil import signal import subprocess import sys import time import zlib from datetime import datetime, timedelta, timezone from multiprocess...
run2017.py
# -*- coding: utf-8 -*- """ Running the trained neural network, normalise image and control RoboFace. Copyright (C) 2017 Letitia Parcalabescu 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 v...
server.py
import json import time import random import socket import pickle import logging import threading from string import ascii_lowercase logging.basicConfig( format='%(asctime)s %(levelname)-8s %(message)s', level=logging.DEBUG, datefmt='%Y-%m-%d %H:%M:%S' ) IP = "192.168.1.12" PORT = 1234 ...
server.py
print(" * [i] Loading Python modules...") import time import numpy as np import flask import urllib3 from newspaper import Article from threading import Thread from claimreview import ClaimReview cr = ClaimReview() print(" * [i] Loading NLP models...") from model_nlp import * app = flask.Flask(__name__) model_click...
twitter.py
from json import loads from os import getenv from queue import Empty from queue import Queue from threading import Event from threading import Thread from time import time from tweepy import API from tweepy import Cursor from tweepy import OAuthHandler from tweepy import Stream from tweepy.error import TweepError from ...
pico_run_cart.py
import sublime import sublime_plugin import subprocess import threading class PicoRunCartCommand(sublime_plugin.TextCommand): def run(self, edit): def target(): subprocess.Popen(self.cmd, bufsize=-1, stdin=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) pico8 = "\"" + self.view.settings().get("pico-8_pat...
vtask.py
# Copyright (c) 2014, 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. # """Base Task and related helper ...
cached.py
from datetime import datetime, timedelta from css_html_js_minify import html_minify import os import threading import redis import web redis_client = redis.from_url(os.environ.get("REDIS_URL")) class cached(object): def __init__(self, *args, **kwargs): self.path_cache_time = {} self.default_max_a...
run_backfill.py
#!/usr/bin/python3 import argparse import json import os import sys import subprocess import tempfile import time import threading def get_parameters(run_command): uid = os.getuid() gid = os.getgid() app_username = os.getenv("APP_USERNAME", "") app_password = os.getenv("APP_PASSWORD", "") #Loadin...
test_cloudpickle.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2017 Alibaba Group Holding Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
3.08.py
""" Code illustration: 3.08 Adding support for multiple beat patterns New methods added here: - display_pattern_name() - change_pattern() - restart_play_of_new_pattern Methods modified here: - create_top_bar() - added a call to display_pattern_name(...
backend.py
# # Copyright (c) 2021, 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 ...
map_tnseqServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import json import os import random as _random import sys import traceback from getopt import getopt, GetoptError from multiprocessing import Process from os import environ from wsgiref.simple_server import make_server import requests as _requests from json...
test_weakref.py
import gc import sys import unittest import collections import weakref import operator import contextlib import copy import threading import time import random from test import support from test.support import script_helper # Used in ReferencesTestCase.test_ref_created_during_del() . ref_from_del = None # Used by Fi...
grab_pickle.py
# coding: utf-8 try: import cPickle as pickle except ImportError: import pickle from multiprocessing import Queue from test.util import BaseGrabTestCase, exclude_transport from test.util import build_grab class TestGrab(BaseGrabTestCase): def setUp(self): self.server.reset() @exclude_transpo...
client.py
import os import hashlib import time import queue import signal import typing import getpass import logging import base64 import threading from typing import Any, Dict, List, Type, Callable, Optional, DefaultDict, Tuple, Union from types import FrameType from collections import defaultdict from python_telegram import ...
extract_feature.py
from pysoftNLP.bert.graph import import_tf from pysoftNLP.bert import modeling from pysoftNLP.bert import tokenization from pysoftNLP.bert.graph import optimize_graph from pysoftNLP.bert import args from queue import Queue from threading import Thread tf = import_tf(0, True) class InputExample(object): def __in...
manual_control.py
import pickle import paho.mqtt.client as mqtt from threading import Thread import time import os import paramiko import json # algorithm imports mec_nodes = {'mec-9': '192.168.122.119', 'mec-8': '192.168.122.118', 'mec-7': '192.168.122.117', 'mec-6': '192.168.122.116', 'mec-5': '192.168.122.115', 'mec-4'...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 witho...
go_tool.py
import argparse import copy import json import os import shutil import subprocess import sys import tempfile import threading arc_project_prefix = 'a.yandex-team.ru/' std_lib_prefix = 'contrib/go/_std/src/' vendor_prefix = 'vendor/' def compare_versions(version1, version2): v1 = tuple(str(int(x)).zfill(8) for x ...
obj.py
# # CORE # Copyright (c)2011-2013 the Boeing Company. # See the LICENSE file included in this directory. # # author: Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com> # ''' ns3.py: defines classes for running emulations with ns-3 simulated networks. ''' import sys, os, threading, time from core.netns.nodes import CoreN...
launcher.py
import time start = time.perf_counter() import os import sys #disable python warnings if not sys.warnoptions: import warnings warnings.simplefilter("ignore") #route error output to file sys.stderr = open('log.txt', 'w+') #suppress pygame welcome message oldStdout = sys.stdout sys.stdout = open(os.devnull, 'w') i...
thonny-ws.py
from thonny import get_workbench import websocket from threading import Thread from tkinter.simpledialog import askstring def on_message(ws, message): """This method is called if the client received a message. :param ws: WebSocketApp object :param message: message object represented as string R...
main_server.py
#!/usr/bin/env python3 import rospy import threading import signal from flask import Flask, render_template from flask_socketio import SocketIO, send, emit from publishers.move_pub import MovePub from subscribers.image_sub import ImageSub HOST_IP = "0.0.0.0" HOST_PORT = 4040 class SubInfo: def __init__(self, r...