source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
async_plc.py | #!/usr/bin/env python
# SCADA Simulator
#
# Copyright 2018 Carnegie Mellon University. All Rights Reserved.
#
# NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESSED OR IMPL... |
_task_commons.py | import json
import logging
import os
import re
import sys
from typing import List, Tuple, Dict, Optional, NamedTuple, Union
import cloudpickle
import skein
import tensorflow as tf
from tf_yarn import event, cluster, Experiment, constants, KerasExperiment
from tf_yarn._internal import MonitoredThread, iter_tasks
_lo... |
recursive_solver.py | from tree_viewer import TreeViewer
import Tkinter as tk
import threading
import time
NUM_DISKS = 3
Pole1 = '1'
Pole2 = '2'
Pole3 = '3'
BEGIN_QUEUE = [1,5]
MOVES = {}
MOVES[Pole1, Pole2] = [5,1,4,3,4,1,5,2,]
MOVES[Pole2, Pole1] = [3,5,1,4,2,4,1,5,]
MOVES[Pole1, Pole3] = [5,1,4,3,4,1,1,5,2,5,1,4,]
MOVES[Pole3, Pole1] ... |
test_python_pdb.py | """Test Python backend with option pdb=True.
It seems pytest-cov does not work well if PDB is imported during pytest runs.
To deal with it, code with PDB is executed in a separate process. This seems
enough to make coverage work again.
"""
import multiprocessing
import os
from myia import myia
def run_pdb(return_ce... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import asyncio
from typing import TYPE_CHECKING, Optional
from electrum.bitcoin import TYPE_ADDRESS
from electrum.storage import WalletStorage, StorageReadWriteError
from electrum.wallet import Wall... |
platform_utils.py | # -*- coding:utf-8 -*-
#
# Copyright (C) 2016 The Android Open Source Project
#
# 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 re... |
parseSAM_MT.py | #!/usr/bin/python
import sys
import os
import threading
def GetPathAndName(pathfilename):
ls=pathfilename.split('/')
filename=ls[-1]
path='/'.join(ls[0:-1])+'/'
return path, filename
#Main**************************************************************************#
def main():
# Read input paramete... |
message_channel.py | import logging
import socket
import json
import threading
import asyncio
class MessageChannel():
"""Send messages to Notepadqq and receive responses."""
def __init__(self, socket_path):
"""Initialize a new channel on the specified address."""
# FIXME Windows support
self._logger = logg... |
tello.py | # coding=utf-8
import logging
import socket
import time
import threading
import queue
import cv2
import numpy as np
from threading import Thread
from djitellopy.decorators import accepts
class Tello:
"""Python wrapper to interact with the Ryze Tello drone using the official Tello api.
Tello API documentation:... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import asyncio
from typing import TYPE_CHECKING, Optional, Union, Callable, Sequence
from electrum.storage import WalletStorage, StorageReadWriteError
from electrum.wallet_db import WalletDB
from el... |
test_update_control.py | #!/usr/bin/python
# Copyright 2022 Northern.tech AS
#
# 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 ap... |
fast.py | # issues:
# - for now, units in si
# - a common coordinate system is used for all systems
# - sync of systems should be checked
# - timestepping: adaptive dt?
from amuse.units import units
from amuse.units.quantities import zero
import threading
from amuse import datamodel
def radius_or_hsmooth(parts):
d=set(dir(pa... |
api.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2007 Christopher Lenz <cmlenz@gmx.de>
# Copyright (C) 2007-2010 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://... |
test_subprocess.py | import unittest
from unittest import mock
from test import support
import subprocess
import sys
import platform
import signal
import io
import itertools
import os
import errno
import tempfile
import time
import selectors
import sysconfig
import select
import shutil
import threading
import gc
import textwrap
from test.s... |
cli.py | """
Command line entry
"""
import os
import sys
import time
import threading
from os import getpid
import psutil
# from .web import Webserver
from ..models import WebserverArgs
from ..core.driver import (Driver, DriverEvents)
from ..core.device_context import DeviceContext
from ..core.tunnel_web import WebServer
from ... |
unsafe_bank.py | import datetime
import random
import time
from threading import Thread
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)
print("Sta... |
AVR_Miner.py | #!/usr/bin/env python3
##########################################
# Duino-Coin Python AVR Miner (v2.6.1)
# https://github.com/revoxhere/duino-coin
# Distributed under MIT license
# © Duino-Coin Community 2019-2021
##########################################
# Import libraries
import sys
from configparser import ConfigPa... |
fcp.py | #!/usr/bin/env python
"""
PCP provides MPI-based parallel data transfer functionality.
Author: Feiyi Wang (fwang2@ornl.gov)
"""
from __future__ import print_function, division
import time
import stat
import os
import shutil
import os.path
import hashlib
import sys
import signal
import resource
import sqlite3
import ... |
subprocess_.py | import subprocess
import os
import sys
import traceback
import glob
from os.path import join
from multiprocessing import Pool, Value
import multiprocessing
import time
from termcolor import cprint
from threading import Thread
from queue import Queue, Empty
from msbase.logging import logger
def timed(func):
def fu... |
control.py | # -*- coding: utf-8 -*-
from random import choice
import pickle
import threading
import time
import jieba
from gensim.models.doc2vec import Doc2Vec, LabeledSentence
from sklearn.externals import joblib
import numpy as np
from bert_serving.client import BertClient
from retrieval_documents import Retrieval
from fuzzy... |
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... |
maze_escaping.py | # -*- coding: utf-8 -*-
import maze
import threading
import time
discount = 0.3
actions = maze.actions
states = []
Q = {}
for i in range(maze.x):
for j in range(maze.y):
states.append((i, j))
for state in states:
temp = {}
for action in actions:
temp[action] = 0.1
maze.set_cell_sc... |
ping.py | #!/usr/bin/env python3
import subprocess
import sys
import threading
import obozrenie.helpers as helpers
def add_rtt_info(array):
"""Appends server response time to the table."""
hosts_array = []
rtt_array = []
rtt_array.append([])
for entry in array:
host = entry['host'].split(":")
... |
test_concurrency.py | from threading import Thread
from nose.tools import ok_
from pyvirtualdisplay.display import Display
def test_with():
ls = [0, 0]
def f1():
ls[0] = Display()
# d1.start()
def f2():
ls[1] = Display()
# d2.start()
t1 = Thread(target=f1)
t2 = Thread(targ... |
join.py | from Table import Table
import numpy as np
from schemas import *
import threading
def recup_index_lig(tab, Nom):
for index, element in enumerate(tab.col_names):
if element == Nom:
# print (index)
return index
def recup_index_col(tab, lig, test):
liste = []
if (tab.storage ... |
display_server.py | import threading
import Adafruit_SSD1306
import time
import PIL.Image
import PIL.ImageFont
import PIL.ImageDraw
from flask import Flask
from .utils import ip_address, power_mode, power_usage, cpu_usage, gpu_usage, memory_usage, disk_usage
from jetcard import ads1115
from jetcard import ina219
import os
class DisplaySe... |
run_k_core.py | import socket
from exec_utilities import time_out_util
from config import *
from exec_utilities.exec_utils import *
from multiprocessing import Process
def run_exp(env_tag=knl_tag, with_c_group=True, data_path_tag=k_truss_exec_path_tag):
hostname = socket.gethostname()
with open('config.json') as ifs:
... |
_test_multiprocessing.py | #
# Unit tests for the multiprocessing package
#
import unittest
import queue as pyqueue
import contextlib
import time
import io
import itertools
import sys
import os
import gc
import errno
import signal
import array
import socket
import random
import logging
import struct
import operator
import weakref
import warning... |
stepper_controller.py | import pigpio
import time
import threading
import math
pi = pigpio.pi()
gpio_pin_lst = (14, 15, 18, 23, 24, 25, 8, 16, 20)
DIR_PIN1, STEP_PIN1, DIR_PIN2, STEP_PIN2, M2, M1, M0, GRAB_SERVO, MAG_SERVO = gpio_pin_lst
for pin in gpio_pin_lst:
pi.set_mode(pin, pigpio.OUTPUT)
pi.write(M0, 1) ... |
train_abstractive.py | #!/usr/bin/env python
"""
Main training workflow
"""
from __future__ import division
import argparse
import glob
import os
import random
import signal
import time
import torch
from pytorch_transformers import BertTokenizer
import distributed
from models import data_loader, model_builder
from models.data_loader i... |
tuner.py | import threading
import datetime
from fHDHR.exceptions import TunerError
from fHDHR.tools import humanized_time
from .stream import Stream
class Tuner():
def __init__(self, fhdhr, inum, epg, origin):
self.fhdhr = fhdhr
self.number = inum
self.origin = origin
self.epg = epg
... |
p2p-nfc.py | #!/usr/bin/python
#
# Example nfcpy to wpa_supplicant wrapper for P2P NFC operations
# Copyright (c) 2012-2013, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import os
import sys
import time
import random
import threading
import argparse... |
WebFuzzer.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# "Testing Web Applications" - a chapter of "The Fuzzing Book"
# Web site: https://www.fuzzingbook.org/html/WebFuzzer.html
# Last change: 2021-10-16 12:21:54+02:00
#
# Copyright (c) 2021 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland Un... |
Cgi.py | import logging
from os import getcwd
from flask import request, render_template, jsonify, redirect, url_for
from flask_socketio import emit
class CgiSocket(object):
def __init__(self):
self.events = {}
self.args = {'emitter':None,'namespace':'default'}
self.namespace = 'default'
sel... |
consumer.py | #!/bin/env python
#===============================================================================
# NAME: consumer.py
#
# DESCRIPTION: This module is the consumer class. Class contains a thread
# which blocks on a queue for messages. The thread then
# executes conext specific data processing,... |
main.py | import process
import server
import argparse
import cv2
import numpy as np
import pyfakewebcam # generating fake webcam on top of v4l2loopback-utils
import os
from multiprocessing import Process, Queue
def blur_frame(img, net, settings):
faces = process.find_faces_yolo(img, net)
# faces = process.find_faces... |
infeed_test.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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
trezor.py | import traceback
import sys
from typing import NamedTuple, Any
from zephyr_code.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException
from zephyr_code.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT
from zephyr_code.bip32 import BIP32Node, convert_bip32_path_to_list_of_uint32 as parse_path
from zephyr_code ... |
manager.py | #!/usr/bin/env python3.7
import os
import time
import sys
import fcntl
import errno
import signal
import shutil
import subprocess
import datetime
from common.basedir import BASEDIR, PARAMS
from common.android import ANDROID
sys.path.append(os.path.join(BASEDIR, "pyextra"))
os.environ['BASEDIR'] = BASEDIR
TOTAL_SCONS_... |
threading_utilities.py | import threading
from data_science.simulation.time import TimeSimulator
class StoppableThread(threading.Thread):
"""
Thread class with a stop() method. The thread itself has to check
regularly for the stopped() condition.
"""
def __init__(self, target=None):
if target is None:
... |
bootsteps.py | from __future__ import absolute_import
import os
import json
from subprocess import PIPE, STDOUT
from threading import Thread
from logging import getLogger
from time import sleep
try:
# noinspection PyCompatibility
from Queue import Queue
except ImportError:
# noinspection PyUnresolvedReferences,PyCompati... |
downloader.py | import os
import sys
import multiprocessing as mp
import time
from datetime import timedelta
from types import FunctionType
import requests
import colors
from .page import Page
from . import utils, const
class Downloader:
cli_initialized: bool
terminating: bool
processes: slice
captcha_process: mp.Pr... |
brdybot.py | #this is for opening the configuration file
import sys
import configparser
#this is for connecting to IRC
import socket
#this is for connecting to the postgres database
import psycopg2
#this is for doing cute equations
import math
#for multithreading for additional channels
import threading
#traceback is for error hand... |
test_framed_transport.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
import socket
import threading
import time
from os import path
from unittest import TestCase
from tornado import ioloop
import thriftpy
from thriftpy.tornado import make_server
from thriftpy.rpc import make_client
from thriftpy.transport... |
tasks.py | import inspect
import six
import sys
import textwrap
from fabric import state
from fabric.utils import abort, warn, error
from fabric.network import to_dict, disconnect_all
from fabric.context_managers import settings
from fabric.job_queue import JobQueue
from fabric.task_utils import crawl, merge, parse_kwargs
from f... |
manager.py | #!/usr/bin/env python3
import os
import time
import sys
import fcntl
import errno
import signal
import shutil
import subprocess
import datetime
import textwrap
from typing import Dict, List
from selfdrive.swaglog import cloudlog, add_logentries_handler
from common.basedir import BASEDIR, PARAMS
from common.android im... |
download_data.py | #!/Users/coha/.pyenv/shims/python
from grs import BestFourPoint
from grs import Stock
from grs import TWSENo
import threading
#from concurrent.futures import ThreadPoolExecutor
stock_no_list = TWSENo().all_stock_no
def WorkerJob(stock_index, days):
print('# index {}'.format(stock_index))
stock = Stock(stock... |
phase_multi.py | import numpy as np
import mmwave.dsp as dsp
from mmwave.dataloader import DCA1000
import os
from FER.utils import parseConfigFile, arange_tx, get_label
from queue import Queue
import threading
from mmwave.dsp.utils import Window
# configure file
configFileName = 'C:/Users/Zber/Desktop/mmWave Configuration/profile_3d_a... |
play.py | # Released under the MIT License. See LICENSE for details.
#
"""Provides the top level play window."""
from __future__ import annotations
from typing import TYPE_CHECKING
import _ba
import ba
if TYPE_CHECKING:
from typing import Optional, Tuple
class PlayWindow(ba.Window):
"""Window for selecting overall ... |
PPO_run.py | #!/usr/bin/env python3
import threading, queue
import time
import os
import shutil
import numpy as np
import math
import rospy
from ppo import PPO
from env_v5 import Test
MAX_EPISODES = 100000
MAX_EP_STEPS = 400
MEMORY_CAPACITY = 10000
SIDE = ['right_', 'left_']
GOAL_REWARD = 1500
LOAD = False
def train(nameIndx):
... |
gui.py | #/usr/bin/python3
# https://github.com/tnware/product-checker
# by Tyler Woods
# coded for Bird Bot and friends
# https://tylermade.net
# -*- coding: utf-8 -*-
import wx
import wx.xrc
import json
import requests
import time
from datetime import datetime
import urllib.parse as urlparse
from urllib.parse import parse_qs
... |
Soundlocalization_socket_local.py | #
# Created on Sat Oct 09 2021
# Author: Owen Yip
# Mail: me@owenyip.com
#
import os, sys
import threading
import numpy as np
import time
import zmq
import json
pwd = os.path.abspath(os.path.abspath(__file__))
father_path = os.path.abspath(os.path.dirname(pwd) + os.path.sep + "..")
sys.path.append(father_path)
class... |
input.py | import cv2
import random
import numpy as np
import time
import queue
import threading
import globals as g_
from concurrent.futures import ThreadPoolExecutor
from functools import partialmethod
W = H = 256
class Shape:
def __init__(self, list_file):
with open(list_file) as f:
self.label = int(f... |
manager.py | """
Copyright (c) 2010-2012, Contrail consortium.
All rights reserved.
Redistribution and use in source and binary forms,
with or without modification, are permitted provided
that the following conditions are met:
1. Redistributions of source code must retain the
above copyright notice, this list of conditions
... |
checkTagTest.py | from time import sleep
import unittest
import tracemalloc
import threading
from pynput.keyboard import Key, Controller
import os
from checkTag import CheckTag
os.system("clear")
tracemalloc.start()
# Incorrect, Incorrect, Correct, Incorrect len, Correct, Correct test-tag
tagList = ["67523475", "876... |
appledl.py | # stdlib
import os
import pathlib
import shutil
import signal
import subprocess
import tempfile
import threading
import time
# external
from cachetools import TTLCache # dict with timout
from scp import SCPClient # ssh copy directories
from tqdm import tqdm # progress bar
from zxtouch import touchtypes, toasttypes
... |
pyGBFweapon.py | # 批量下载GBF武器立绘
from queue import Queue
import os
import time
import threading
import urllib.request
import urllib.error
import datetime
import sys
sys.path.append(".")
import pyDownload as download
dirname = os.getcwd()
print_lock = threading.Lock()
data_q = Queue()
SAVELINK = False
DEBUG = False
# chara[R/SR/SSR/sk... |
main.py | import tkinter as tk
from tkinter import ttk
from cv2 import equalizeHist
import numpy as np
import cv2
from openni import openni2
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib import cm
from matplotlib.ticker import LinearLocator
import numpy as np
import threading
#=========... |
poc.py | import os
import time
import torch
torch.multiprocessing.set_sharing_strategy("file_system")
import torch.multiprocessing as mp
import torch.distributed.rpc as rpc
from collections import deque
import datetime
import requests
from flask import Flask
from flask import request
import logging
no_of_saver_processes = 1
w... |
remote_completion.py | # Copyright 2014 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 ag... |
test_collection.py | import numpy
import pandas as pd
import pytest
from pymilvus import DataType
from base.client_base import TestcaseBase
from utils.util_log import test_log as log
from common import common_func as cf
from common import common_type as ct
from common.common_type import CaseLabel, CheckTasks
from utils.utils import *
from... |
test_subprocess.py | import unittest
from unittest import mock
from test import support
from test.support import import_helper
from test.support import os_helper
from test.support import warnings_helper
import subprocess
import sys
import signal
import io
import itertools
import os
import errno
import tempfile
import time
import traceback
... |
test_events.py | # coding: utf-8
from threading import Event, Thread
import pytest
import requests
from boxsdk.object.folder import FolderSyncState
from boxsdk.object.event import Event as BoxEvent
@pytest.fixture
def box_events(box_client):
return box_client.events()
@pytest.fixture
def move_target(box_client):
return b... |
logcollector.py | #!/usr/bin/python
import sys
import os
from optparse import OptionParser, OptionGroup, SUPPRESS_HELP
import subprocess
import shlex
import urllib
import urllib2
import base64
import pprint
import fnmatch
import traceback
import tempfile
import shutil
import logging
import getpass
from schemas import hypervisors
vers... |
_testing.py | import bz2
from collections import Counter
from contextlib import contextmanager
from datetime import datetime
from functools import wraps
import gzip
import operator
import os
import re
from shutil import rmtree
import string
import tempfile
from typing import Any, Callable, ContextManager, List, Optional, Type, Union... |
eterbase_utils.py | import logging
from typing import Dict, Any, Optional, Tuple, List
import hummingbot.connector.exchange.eterbase.eterbase_constants as constants
from hummingbot.connector.exchange.eterbase.eterbase_auth import EterbaseAuth
from hummingbot.client.config.config_var import ConfigVar
from hummingbot.client.config.config_m... |
Knauer_autodiscover.py | """ Autodiscover Knauer devices on network """
import asyncio
import queue
import socket
import sys
import time
from threading import Thread
from typing import Dict, Text, Tuple, Union
from getmac import getmac
from loguru import logger
Address = Tuple[str, int]
class BroadcastProtocol(asyncio.DatagramProtocol):
... |
videocv.py | #!/usr/bin/env python2
import time
import cv2
from threading import Thread
class Videocv():
"""
Ensures constant frame rates for the CV2 video input.
"""
def __init__(self, src=0, fps=30):
self.fps = float(fps)
self._vc = cv2.VideoCapture(src)
(self.grabbed, self.frame) = self... |
ContextManagers.py | import builtins
import os
import platform
import signal
import sys
import threading
from contextlib import closing, contextmanager
from io import StringIO
from coala_utils.MutableValue import MutableValue
from coala_utils.FileUtils import create_tempfile
@contextmanager
def subprocess_timeout(sub_process, seconds, k... |
test_postgresql.py | import mock # for the mock.call method, importing it without a namespace breaks python3
import os
import psycopg2
import subprocess
import time
from mock import Mock, MagicMock, PropertyMock, patch, mock_open
from patroni.async_executor import CriticalTask
from patroni.dcs import Cluster, ClusterConfig, Member, Remot... |
test_mturk_agent.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import os
import time
import threading
from unittest import mock
from parlai.mturk.core.agents import MT... |
Update_ALL.py | from wakeonlan import send_magic_packet
from fabric import Connection
import marshal
import types
import threading
from queue import Queue
import socket
import time
import base64
import sys
import paramiko.ssh_exception
def starting_module(c_q):
print("###########################################")
print("## ... |
transform_handler.py | import threading
import numpy as np
import rospy
import tf2_ros
from geometry_msgs.msg import TransformStamped
from visualization_msgs.msg import Marker
from tf import transformations
class TransformHandler(object):
"""
This class uses a tfBuffer to handle transforms related to the vision kit.
"""
d... |
__init__.py | #!/usr/bin/python3
# @todo logging
# @todo extra options for url like , verify=False etc.
# @todo enable https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl as option?
# @todo option for interval day/6 hour/etc
# @todo on change detected, config for calling some API
# @todo fetch title into json
# https://di... |
test_fanout.py | "Test diskcache.fanout.FanoutCache."
import collections as co
import hashlib
import io
import os
import os.path as op
import pickle
import shutil
import subprocess as sp
import tempfile
import threading
import time
import warnings
from unittest import mock
import pytest
import diskcache as dc
warnings.simplefilter(... |
processpool.py | import multiprocessing
import pickle
import queue
import sys
import time
from concurrent.futures import Future
from threading import Thread
from typing import Any
from tblib import pickling_support
SLEEP_TICK = 0.001 # Duration in seconds used to sleep when waiting for results
class WorkerDiedException(Exception):... |
Helper.py | #!/usr/bin/python
from pygame.sprite import DirtySprite
import random
import time
import logging
from pygame.surface import Surface
from src.Properties import Color, Size
from tts_client import invoke_tts
from utils import *
RATE_PERCENTAGE_MAX = 25
RATE_PERCENTAGE_MIN = -25
# RANGE_PERCENTAGE_MAX = 50 # RG
# RANGE... |
dockerTest.py | # Copyright (C) 2015-2020 Regents of the University of California
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
views.py | import os
from threading import Thread
from tempfile import gettempdir
from django.shortcuts import render, redirect, get_object_or_404
from django.views.decorators.csrf import csrf_protect
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.password_validation import validate_password,... |
MultiCast.py | # -- coding: utf-8 --
import sys
import threading
import termios
from ctypes import *
sys.path.append("../MvImport")
from MvCameraControl_class import *
g_bExit = False
# 为线程定义一个函�?
def work_thread(cam=0, pData=0, nDataSize=0):
stFrameInfo = MV_FRAME_OUT_INFO_EX()
memset(byref(stFrameInfo), 0, si... |
app.py | #!/usr/bin/env python3
from pathlib import Path
from types import SimpleNamespace
import argparse
import logging
import json
import cv2
import fastmot
import fastmot.models
from fastmot.utils import ConfigDecoder, Profiler
def motcount(inputurl, count_global, process_number):
parser = argparse.ArgumentParser(fo... |
startcron.py | #!/usr/bin/python
import sys
import time
import os
import getpass
import getopt
import argparse
import re
import paramiko
import socket
import Queue
import threading
def sshDeploy(retry,hostname):
global projectName
global user
global password
global userInsightfinder
global licenseKey
global ... |
mserver.py | # -*- coding: utf-8 -*-
"""
Created on Sat Jul 10 21:52:21 2021
@author: qq735
"""
from multiprocessing import Process
from socket import *
# import wiringpi
import RPi.GPIO as GPIO
import time
import string
import threading
import timeout_decorator
import serial
import pynmea2
serialPort = serial.Serial("/dev/tty... |
tuq_advisor.py |
from remote.remote_util import RemoteMachineShellConnection
from .tuq import QueryTests
import time
from deepdiff import DeepDiff
from membase.api.exception import CBQError
import threading
class QueryAdvisorTests(QueryTests):
def setUp(self):
super(QueryAdvisorTests, self).setUp()
self.log.info(... |
allele_etl.py | """Allele ETL."""
import logging
import multiprocessing
import uuid
from etl import ETL
from etl.helpers import ETLHelper
from etl.helpers import TextProcessingHelper
from files import JSONFile
from transactors import CSVTransactor, Neo4jTransactor
logger = logging.getLogger(__name__)
class AlleleETL(ETL):
"""... |
fed_client_base.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. 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 ... |
python_gil.py | #!usr/bin/python
# -*- coding:utf8 -*-
# gil global interpreter lock (ipython)
# python中一个线程对应c语言中的一个线程
# gil使得同一时刻只有一个线程运行在一个CPU上执行字节码,无法将多个线程映射到多个cpu上
# gil会根据执行的字节码行数以及时间片释放GIL,遇到IO操作也会释放
# import dis
# def add(a):
# a = a + 1
# return a
#
# print(dis.dis(add))
total = 0
def add():
global total
for i... |
rgb-depth-encoding-v3.py | #!/usr/bin/env python3
import os
import cv2
import sys
import time
import depthai as dai
import numpy as np
import socket
import struct
import pickle
from pathlib import Path
from datetime import datetime
from argument_parser import argument_parser
from colormaps import apply_colormap
from utils import dequeue, ... |
debugger.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... |
puzzle64.py | # Bitcoin Puzzle 64 Random
# Made by Andrei Melek
# https://github.com/Xh0st/puzzle64
try:
import sys
import os
import time
import hashlib
import binascii
import multiprocessing
from multiprocessing import Process, Queue
from multiprocessing.pool import ThreadPool
import threading
... |
weixin.py | #!/usr/bin/env python
# coding: utf-8
import qrcode
import urllib
import urllib2
import cookielib
import requests
import xml.dom.minidom
import json
import time
import re
import sys
import os
import random
import multiprocessing
import platform
import logging
from collections import defaultdict
from urlparse import url... |
build_electrs.py | #!/usr/bin/env python3
import argparse
import logging
import os
import sys
import shutil
PROJECT_NAME = "ElectrsCash"
GIT_REPO = "https://github.com/BitcoinUnlimited/{}.git".format(PROJECT_NAME)
GIT_BRANCH = "v1.0.0"
EXPECT_HEAD = "aa95d64d050c286356dadb78d19c2e687dec85cf"
ROOT_DIR = os.path.realpath(
os.path.... |
__init__.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Implements context management so that nested/scoped contexts and threaded
contexts work properly and as expected.
"""
from __future__ import absolute_import
import collections
import functools
import logging
import os
import platform
import socket
import stat
import s... |
tbui.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import backend.twixt as twixt
import util.pmeter as pmeter
import constants as ct
import settings as st
import layout as lt
import files as fi
import plot as pt
import heatmap as hm
import uiboard
from tkinter import ttk
import PySimpleGUI as sg
import threading
import... |
test_pdb.py | # A test suite for pdb; not very comprehensive at the moment.
import doctest
import os
import pdb
import sys
import types
import codecs
import unittest
import subprocess
import textwrap
import linecache
from contextlib import ExitStack
from io import StringIO
from test import support
# This little hel... |
QueueAsyncDriver.py | """ Async Driver Method """
import threading
from masonite.contracts.QueueContract import QueueContract
from masonite.drivers.BaseDriver import BaseDriver
class QueueAsyncDriver(QueueContract, BaseDriver):
"""Queue Aysnc Driver
"""
def __init__(self, Container):
"""Queue Async Driver
A... |
__main__.py | import argparse
import logging
import json
import time
import sys
# from threading import Thread
import paho.mqtt.client as mqtt
import rc522
import led_rgb
import utils
from __init__ import __version__, APP_NAME, HOST, PORT, LED_PINS, MQTT_TOPIC, LOG_FILE, LOG_FORMAT
def message_led(client, userdata, msg):
""" ... |
data_download.py | import numpy as np
import binascii
import os
import multiprocessing
import wget
import zipfile
import requests
def download_sentinel_data(product_identifier, output_location, verbose=1, timeout=10*60, debug=False):
"""
Download and unzip a tile with satelite data.
Args:
product_identifier (string)... |
tests.py | # -*- coding: utf-8 -*-
# Unit tests for cache framework
# Uses whatever cache backend is set in the test settings file.
from __future__ import unicode_literals
import os
import re
import copy
import shutil
import tempfile
import threading
import time
import unittest
import warnings
from django.conf import settings
... |
batchMakeTrials.py | from __future__ import division, print_function
from physicsTable import *
from physicsTable.constants import *
import threading
import pygame as pg
import random, os, sys
import numpy as np
import json
defVel = 300
# modified trial folder:
#trialfolder = os.path.join('..','public_html','trials')
trialfolder = os.path... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.