source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
robotiq2f140_real.py | import socket
import struct
import threading
import time
from subprocess import check_output
import numpy as np
import rospy
from control_msgs.msg import GripperCommandActionGoal
from sensor_msgs.msg import JointState
from std_msgs.msg import String
from airobot.ee_tool.ee import EndEffectorTool
from airobot.utils.co... |
Merge_multiprocess.py | try:
from PIL import Image
except:
print()
print("pip install Pillow")
exit()
from queue import Queue
import os
import time
import ctypes
import sys
import multiprocessing
all_task: int = 0
def Worker(fs: Queue, all_task: int):
# for the_folder in folders:
while not fs.empty():
the_fo... |
DMPShell.py | import pynput
from multiprocessing import Process
from elevate import elevate
from time import sleep
import shutil
import socket, subprocess
import os
import tempfile
import pyautogui
import logging, sys,_thread
import base64
import getpass, platform
from requests import get
import geocoder
import inspect
import ctypes... |
sdk_worker.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
generate_gender_mutants_imdb.py | import sys
sys.path.append('./fine-tuning')
sys.path.append('./gender')
import pandas as pd
import numpy as np
import math
import spacy
import os
import time
from gender.utils import preprocessText
from gender.MutantGeneration import MutantGeneration
from multiprocessing import Pool, Process, Queue, Manager
import m... |
__init__.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2014 Vinay M. Sajip. See LICENSE for licensing information.
#
# sarge: Subprocess Allegedly Rewards Good Encapsulation :-)
#
from io import BytesIO
import logging
import os
try:
import queue
except ImportError: # pragma: no cover
import Queue as queue
import re
i... |
wsgi.py | """
WSGI config for fr project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
import time
from django.core.wsgi import get_wsgi_application
from setting.models import Pr... |
player.py | from GA.ranking import Elo
from game.enums import PlayerType
from game.state import GameState
from characters.characters import Character
from input.pad import Pad
from input.enums import Button
from training.reward import Rewards
import numpy as np
import threading
from collections import deque
from time import time... |
cli.py | # -*- coding: utf-8 -*-
"""
flask.cli
~~~~~~~~~
A simple command line application to run flask 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 click
... |
copy_pic.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Script for simultaneously copying the pictures from up to 6 cameras.
The primary goal is to copy the pictures from 4 action-cams, make groups of pictures with a cutoff time, create
a subfolder for each cam and copy the renamed pictures (timestamp added to the fil... |
runner.py | #!/usr/bin/env python3
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
registration.py | """
Copyright (c) 2015-present, Philippine-California Advanced Research Institutes-
The Village Base Station Project (PCARI-VBTS). 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.
-
Registration (provisioning) handle... |
python_yndexer.py | import os
import sys
import threading
import subprocess
def _try_to_kill(process):
try:
process.kill()
except Exception:
pass
def touch(path):
if not os.path.exists(path):
with open(path, 'w') as _:
pass
class Process(object):
def __init__(self, args):
s... |
run_augmentation-checkpoint.py | import os
import argparse
import random
import math
from multiprocessing import Process, cpu_count
import cv2
import image_augmentation as ia
def parse_args():
parser = argparse.ArgumentParser(
description='A Simple Image Data Augmentation Tool',
formatter_class=argparse.ArgumentDefaultsHelpForma... |
test_urllib.py | """Regresssion tests for urllib"""
import urllib
import httplib
import unittest
import os
import sys
import mimetools
import tempfile
import StringIO
from test import test_support
from base64 import b64encode
def hexescape(char):
"""Escape char as RFC 2396 specifies"""
hex_repr = hex(ord(char))[2:].upper()
... |
test_utils.py | """Utilities shared by tests."""
import collections
import contextlib
import io
import logging
import os
import re
import socket
import socketserver
import sys
import tempfile
import threading
import time
import unittest
import weakref
from unittest import mock
from http.server import HTTPServer
from wsgiref.simple_... |
gramgrab_notGN.py | '''
Minimally edited gramgrab to generate indices for data other than the google ngrams (which contain POS tags and have fixed length)
'''
import re
import os
import collections
import argparse
from multiprocessing import Process, Queue
import random
import time
#import sys
#sys.path.append("/home/vivi/work/Projects/... |
server.py | from time import sleep
from datetime import datetime
import bluetooth
import json
import requests
import threading
import RPi.GPIO as GPIO
import paho.mqtt.client as mqtt
from collections import deque
from dps310 import DPS310
from btxmt import BTServer
PORT = 1
RECV_SIZE = 1024
WF_ADDR = 'b8:27:eb:a9:5e:97'
PIN = 2... |
async_checkpoint.py | # Copyright 2018 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... |
smart_explainer.py | """
Smart explainer module
"""
import logging
import copy
import tempfile
import shutil
import pandas as pd
from shapash.webapp.smart_app import SmartApp
from shapash.utils.io import save_pickle
from shapash.utils.io import load_pickle
from shapash.utils.transform import inverse_transform, apply_postprocessing
from sha... |
bilibiliLiveWebSocket.py | import websocket
import threading
import _thread as thread
import time
import json
import logging
import zlib
import re
from bilibiliQRLogin import bilibiliQRLogin
from config import logger
class bilibiliLiveWebSocket():
def __init__(self,roomId):
self.roomId = roomId
self.ws_url = 'wss://b... |
redirfinder.py | import requests
import sys
import re
import threading
import urllib.parse
PAYLOADS = ["google.com", "https%3A%2F%2Fgoogle.com", "https%3A%2F%2F%2F%2Fgoogle.com", "%40google.com", "%3A%2F%2Fgoogle.com", "@google.com", "://google.com", "https://google.com", "https://////google.com", "https://///google.com", "https... |
thread.py | from multiprocessing import Pool, Process
from os import name
from queue import LifoQueue
import os, time, random
def process_test(name):
start = time.time()
print(f'{name}, {os.getpid()}')
time.sleep(random.random()*3)
print(f'engding: {time.time()-start} sec')
if __name__=='__main__':
## 多进程
... |
Confirm.py | from binascii import Error as b64Error
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from base64 import urlsafe_b64decode, urlsafe_b64encode
from smtplib import SMTP
from threading import Thread
from django.conf import settings
from django.template.loader import render_to_string
f... |
PerThreadList.py | """Per-thread list."""
import _thread
class PerThreadList(object):
"""Per-thread list.
PerThreadList behaves like a normal list, but changes to it are kept
track of on a per-thread basis. So if thread A appends an item to
the list, only thread A sees that item. There are a few non-standard
met... |
testing.py | #!/usr/bin/env python
#
# Copyright 2011 Rafe Kaplan
#
# 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 o... |
test_spawn.py | from __future__ import absolute_import
import sys
from billiard import get_context, Value, Process, Event
from billiard.util import set_pdeathsig, get_pdeathsig
import pytest
import psutil
import signal
from time import sleep
class test_spawn:
def test_start(self):
ctx = get_context('spawn')
p = ... |
morphling_client_mnist.py | from __future__ import print_function
import math
import os
import threading
import time
from queue import Queue
import api_pb2
import api_pb2_grpc
import grpc
import numpy as np
import tensorflow as tf
from tensorflow_serving.apis import predict_pb2, prediction_service_pb2_grpc
models = {
"densenet121": [224, 2... |
fc_2015_03_17.py | #!/usr/bin/env python3
# imports go here
import pika
import multiprocessing
import time
import logging
#
# Free Coding session for 2015-03-17
# Written by Matt Warren
#
logger = logging.getLogger(__name__)
def talker():
connection = pika.BlockingConnection()
channel = connection.channel()
channel.excha... |
build_image_data.py | #!/usr/bin/python
# 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 a... |
main.py | from UI_Function import *
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from UI_main import Ui_MainWindow
import threading
from UI_splashscreen import Ui_MainWindow as UI_splashscreen
from RTC import GetTime
from pyqt... |
osr_basic.py | #!/usr/bin/env pytest
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Basic tests of OGRSpatialReference (OSR) operation, not including
# support for actual reprojection or use of EPSG tables.
# Author... |
identity.py | from multiprocessing import Pipe
from multiprocessing import Process
import os
from .util import moving_temporary_file
def get_cassandra_classpath():
cassandra_conf = os.environ.get('CASSANDRA_CONF', '/etc/cassandra')
cassandra_home = os.environ.get('CASSANDRA_HOME', '/usr/share/cassandra')
return [
... |
node_base.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, ... |
model_average_optimizer_test.py | # Copyright 2017 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... |
optimize_logp.py | """ Optimize the logP of a molecule
Starting point: methane (C)
- actions: add a bond or an atom
- state: molecule state
- reward: 0, unless a terminal state is reached, then the penalized logp estimate of the molecule
"""
import argparse
import logging
import math
import multiprocessing
import os
import sys
imp... |
test_betfairstream.py | import unittest
import socket
import time
import threading
from tests import mock
from betfairlightweight.streaming.betfairstream import (
BetfairStream,
HistoricalStream,
)
from betfairlightweight.exceptions import (
SocketError,
ListenerError,
)
class BetfairStreamTest(unittest.TestCase):
def ... |
manager.py | import logging
logging.basicConfig(level=logging.INFO, format='%(message)s')
from grow.common import sdk_utils
from grow.preprocessors import file_watchers
from grow.server import main as main_lib
from werkzeug import serving
from xtermcolor import colorize
import os
import socket
import sys
import threading
# Number... |
SPOR_MULTI_VOLUME_WRITE_3.py | #!/usr/bin/env python3
import sys
import os
import re
import subprocess
from itertools import product
from threading import Thread
import TEST
import TEST_FIO
import TEST_LIB
import TEST_LOG
import TEST_SETUP_POS
arrayId = 0
volumes = [1, 2]
current_test = 0
########################################################... |
manager.py | '''ScoreBox Baseball Manager'''
import json
from threading import Thread
from typing import Dict
import websock
from util import get_ordinal
class BaseballManager:
def __init__(self, home_team, visitor_team, home_color, visitor_color) -> None:
self.home_team = home_team
self.home_color = home_c... |
ssh_brute_forcer.py | #!./env/bin/python
""" SSH Password Brute Forcer
Takes optional host, username, and password file arguments to connect to
a host and test every line in the password file as a potential password until
a login occurs.
Don't be a moron, please don't use this for something illegal.
Usage:
ss... |
server.py | import ast
import os
import sys
import socket
import logging
import traceback
import atexit
from io import StringIO
import threading
from threading import Thread
import psutil
from msgpack import Packer, Unpacker
from .helper import BackdoorRequest, BackdoorResponse, get_socket_path
LOG = logging.getLogger(__name__... |
shell.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
feeding.py | import pandas
import tensorflow as tf
from threading import Thread
from math import ceil
from six.moves import range
from util.audio import audiofile_to_input_vector
from util.gpu import get_available_gpus
from util.text import ctc_label_dense_to_sparse, text_to_char_array
class ModelFeeder(object):
'''
Feeds... |
test_worker.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
main.py | from cj.bookmaker import get_chapters_for_maker
from cj.bookmaker.pdf import PdfMaker
from cj.data.cj_db import CJDB
from cj.objects.book import Book
from cj.objects.novel import Novel
from cj.scraper.novels.rnf import RNF
from cj.utils.enums import BookType, CjType
from cj.utils.save import Save
from cj.utils.cmd_args... |
btcc.py | from befh.restful_api_socket import RESTfulApiSocket
from befh.exchanges.gateway import ExchangeGateway
from befh.market_data import L2Depth, Trade
from befh.util import Logger
from befh.instrument import Instrument
from befh.clients.sql_template import SqlClientTemplate
import time
import threading
from functools impo... |
test_polled_blocking.py | import os
import threading
import time
import pytest
import uhid
from . import find_hidraw
@pytest.mark.timeout(1)
def test_create(basic_mouse_rdesc):
device = uhid.UHIDDevice(0x1234, 0x4321, 'Dummy Mouse', basic_mouse_rdesc, backend=uhid.PolledBlockingUHID)
hidraw = find_hidraw(device)
assert hidraw... |
test_advanced.py | # coding: utf-8
from concurrent.futures import ThreadPoolExecutor
import json
import logging
import random
import sys
import threading
import time
import os
import numpy as np
import pytest
import ray.cluster_utils
import ray._private.profiling as profiling
from ray._private.test_utils import (
client_test_enabl... |
_test_get_current_url.py | import pytest
import threading
from .util import run_test, destroy_window
def get_current_url():
import webview
def _get_current_url(webview):
webview.get_current_url()
t = threading.Thread(target=_get_current_url, args=(webview,))
t.start()
destroy_window(webview, 5)
webview.create_... |
shutdown_master.py | """Simulate the shutdown sequence on the master pi."""
import socket
import threading
import time
def talk_to_train():
with socket.socket() as sock:
# TODO: replace localhost with static ip of train pi
# port number has to match the socket.bind() of the other program.
sock.connect(('localh... |
thread_demo.py | from threading import Thread
import os
def loop():
i = 0
while True:
i += 1
def main():
print('start')
for _ in range(os.cpu_count()):
t = Thread(target=loop)
t.start()
if __name__ == '__main__':
main()
|
safe_t.py | from binascii import hexlify, unhexlify
import traceback
import sys
from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING
from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException
from electrum.bip32 import BIP32Node
from electrum import constants
from electr... |
deyangjindian.py | import base64
import csv
import json
import re
import threading
import requests
import queue
from bs4 import BeautifulSoup
from pathlib import Path
from commonbaby.httpaccess import HttpAccess
class DeYang(object):
imagesnumbel = 0
def __init__(self):
self._ha = HttpAccess()
cookies = '_RF1=... |
log.py | #!/usr/bin/env python
"""
Copyright (c) 2014-2017 Miroslav Stampar (@stamparm)
See the file 'LICENSE' for copying permission
"""
import os
import signal
import socket
import SocketServer
import sys
import threading
import time
import traceback
from core.common import check_whitelisted
from core.common import check_s... |
base.py | # coding: utf-8
from __future__ import absolute_import, division, print_function
import datetime as dt
import re
import threading
import time
import weakref
from collections import Mapping, OrderedDict
from functools import partial
import requests
from logbook import Logger
from ratelimiter import RateLimiter
from re... |
kncloudevents.py | #!/usr/bin/env python
"""
Copyright 2019 The Elegant Monkeys
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... |
eventEngine.py | # encoding: UTF-8
# 系统模块
from Queue import Queue, Empty
from threading import Thread
from time import sleep
# 自己开发的模块
from eventType import *
########################################################################
class EventEngine2(object):
"""
计时器使用python线程的事件驱动引擎
"""
#-------------------... |
main.py | import sys
from PySide import QtGui, QtCore
import win32api
import win32con
from threading import Thread, Event
import time
def setup_menu():
menu = QtGui.QMenu()
enable_action = menu.addAction("&Enable")
disable_action = menu.addAction("&Disable")
exit_action = menu.addAction("E&xit")
enable_act... |
test_events.py | """Tests for events.py."""
import collections.abc
import concurrent.futures
import functools
import gc
import io
import os
import platform
import re
import signal
import socket
try:
import ssl
except ImportError:
ssl = None
import subprocess
import sys
import threading
import time
import errno
import unittest
... |
dy.py | import requests
from threading import Thread
import time
import os
import re
import shutil
import sys
import random
import streamlink
import traceback
names = []
namenum=0
#url = 'https://webcast3-c.amemv.com/webcast/feed/?content_type=1&channel_id=37&version_code=8.8.0&pass-region=0&pass-route=0&js_sdk_version=1.32.1.... |
pysh.py | #!/usr/bin/env python
import time
import sys
import threading
import subprocess
import shlex
from pcaspy import Driver, SimpleServer
prefix = 'MTEST:'
pvdb = {
'COMMAND' : {
'type' : 'char',
'count': 128,
'asyn' : True
},
'OUTPUT' : {
'type' : 'char',
'count': 500... |
callbacks_test.py | # Copyright 2016 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... |
bot.py | """A Telegram bot that can be queried for Losungen
and sends the daily Losung to subscribers
"""
import datetime
from time import sleep
import logging
import threading
from typing import Any, Coroutine, List
import schedule
from telebot.async_telebot import AsyncTeleBot
from telebot import logger as telebot_logger
from... |
demo_batchthreaded.py | import os
os.chdir(r'C:\Users\rgalanakis\Documents\maya\projects\default\scenes')
import mayaserver.client_7 as mayaclient
execstr = """import pymel.core as pmc
pmc.openFile(%r, force=True)
for item in pmc.ls(type='unknown'):
if item.exists():
pmc.delete(item)
pmc.system.saveAs(%r)"""
def process(socket, ... |
binance_trade.py | import sys
import time
import logging
import threading
import json
from pprint import pprint
from binance.client import Client
# Add your API key
api_key = ''
# Add your secret
api_secret = ''
RECV_WINDOW=6000000
logging.basicConfig(level=logging.DEBUG,
filename='binance.log',
... |
heatvideo.py | #!/usr/bin/python3
import argparse
import sys
import time
import numpy as np
import scipy.ndimage.interpolation as interp
import matplotlib.animation as animation
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib.patches as patch
import multiprocessing as mp
from moviepy.video.io.bindings i... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
from electrum.bitcoin import TYPE_ADDRESS
from electrum.storage import WalletStorage
from electrum.wallet import Wallet
from electrum.paymentrequest import InvoiceStore
from electrum.util import pro... |
Hiwin_RT605_Socket_v3_20190628101132.py | #!/usr/bin/env python3
# license removed for brevity
import rospy
import os
import socket
##多執行序
import threading
import time
import sys
import matplotlib as plot
import HiwinRA605_socket_TCPcmd_v3 as TCP
import HiwinRA605_socket_Taskcmd_v3 as Taskcmd
import numpy as np
from std_msgs.msg import String
from ROS_Socket.s... |
api.py | from flask import Flask, Response, jsonify, request, send_file, json
from bson import ObjectId
import datetime
import inspect
import logging
import traceback
from PyMongoWrapper import *
from collections import defaultdict
from queue import deque
from models import *
from task import Task
from pipeline impor... |
test_client.py | # test_client.py
# -*- coding: utf8 -*-
# vim:fileencoding=utf8 ai ts=4 sts=4 et sw=4
# Copyright 2009 SKA South Africa (http://ska.ac.za/)
# BSD license - see COPYING for details
"""Tests for client module.
"""
import unittest2 as unittest
import socket
import mock
import time
import logging
import threading
impo... |
idf_monitor.py | #!/usr/bin/env python
#
# esp-idf serial output monitor tool. Does some helpful things:
# - Looks up hex addresses in ELF file with addr2line
# - Reset ESP32 via serial RTS line (Ctrl-T Ctrl-R)
# - Run "make (or idf.py) flash" (Ctrl-T Ctrl-F)
# - Run "make (or idf.py) app-flash" (Ctrl-T Ctrl-A)
# - If gdbstub output is... |
__init__.py | # -*- coding: utf-8 -*-
'''
Set up the Salt integration test suite
'''
# Import Python libs
from __future__ import absolute_import, print_function
import os
import re
import sys
import copy
import json
import time
import stat
import errno
import signal
import shutil
import pprint
import atexit
import socket
import lo... |
HumanAgent.py | import cv2
import numpy as np
import time
from threading import Thread
try:
import pygame
from pygame.locals import K_BACKSPACE
from pygame.locals import K_COMMA
from pygame.locals import K_DOWN
from pygame.locals import K_ESCAPE
from pygame.locals import K_F1
from pygame.locals import K_LE... |
watcher.py | from __future__ import absolute_import
import sys
import os
# Ensure we don't have the wandb directory in the path to avoid importing our tensorboard
# module. This should only happen when wandb is installed with pip -e or pip install ...#egg=wandb
for path in sys.path:
if path.endswith(os.path.join("client", "wan... |
responder.py | import logging
import SocketServer
import time
logging.basicConfig(level=logging.DEBUG,
format='%(name)s: %(message)s',
)
logger = logging.getLogger(__name__)
class EchoRequestHandlerTCP(SocketServer.BaseRequestHandler):
def handle(self):
logger.debug('handle')
... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... |
AVSS_Main.py | """
Project: AVSS (Airborne Virus Sanitation System)
Team: Jacob Alongi | Samuel Bishop | Michael Boeding
"""
import Jetson.GPIO as GPIO
import time
import nanocamera as nano
import cv2
import numpy as np
import queue
import threading
# kill flag for threads
exitFlag = 0
# deadline for threads in seconds
dead... |
runner.py | # Copyright 2018 Datawire. 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 agr... |
running.py | # -*- coding: utf-8 -*-
"""Code for maintaining the background process and for running
user programs
Commands get executed via shell, this way the command line in the
shell becomes kind of title for the execution.
"""
import collections
import logging
import os.path
import re
import shlex
import signal
import sub... |
session.py | <<<<<<< HEAD
# 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 requir... |
test_sockets.py | import os, multiprocessing, subprocess, socket, time
from runner import BrowserCore, path_from_root
from tools.shared import *
node_ws_module_installed = False
try:
NPM = os.path.join(os.path.dirname(NODE_JS[0]), 'npm.cmd' if WINDOWS else 'npm')
except:
pass
def clean_processes(processes):
import signal, errno
... |
test_InfoExtractor.py | #!/usr/bin/env python3
from __future__ import unicode_literals
# Allow direct execution
import io
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import FakeYDL, expect_dict, expect_value, http_server_port
from yt_dlp.compat import... |
http_server.py | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
vInput.py | '''
Author: Ligcox
Date: 2021-04-06 15:20:21
LastEditors: Ligcox
LastEditTime: 2021-08-10 15:28:26
Description: Image input module. According to different input sources, the image information is processed.
Apache License (http://www.apache.org/licenses/)
Shanghai University Of Engineering Science
Copyright (c) 2021 Bi... |
analyzer.py | # Copyright (c) 2014, Guillermo López-Anglada. Please see the AUTHORS file for details.
# All rights reserved. Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.)
import json
import os
import queue
import threading
import time
from collections import defaultdict
from d... |
test2.py | #!/usr/bin/env python3
import socket
import struct
import threading
import time
import ipaddress # kjw
import pickle
from collections import namedtuple
class Ascii(object):
"""Simple ASCII format to send info"""
def dumps(self, data):
return "|".join(data).encode('utf-8')
def loads(self, msg):
... |
producers.py | import asyncio
import threading
from abc import abstractmethod, ABC
from confluent_kafka import SerializingProducer, KafkaException
from confluent_kafka.schema_registry import SchemaRegistryClient
from confluent_kafka.schema_registry.json_schema import JSONSerializer
from confluent_kafka.serialization import StringSer... |
__main__.py | from builtins import NotImplementedError
from argparse import ArgumentParser
from threading import Thread, Event
from dinner_bot.core_bot import CoreBot
from dinner_bot.telegram_bot import TelegramDinnerBot
from dinner_bot.groupme_bot import GroupmeBot
from dinner_bot.tk_bot import TkBot
bot_classes = [
Telegram... |
alarmwin.py | # coding=utf-8
import wx
import wx.xrc
from crm import service, textvalidator, idnumbervalidator, auth, vehiclepanel, excelutil
import datetime
import time
import threading
from wx.lib.scrolledpanel import ScrolledPanel
# Class CustomerWin
class AlarmWin(wx.Dialog):
def __init__(self, parent):
wx.Dialog._... |
ftpserver.py |
import os
import socket
import stat
import sys
import threading
import time
from pathlib import Path
from utils import fileProperty
try:
host = socket.gethostbyname(socket.gethostname())
except socket.gaierror:
host = socket.gethostname()
port = 21
working_directory = os.getcwd()
ascii_buffer = 1024
binary_... |
keygen.py | ################################################################################
# Copyright 2018 Martin Grap
#
# 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/li... |
worker.py | # -*- coding: utf-8 -*-
import multiprocessing
import Queue
import signal
import os
import time
from beaver.config import BeaverConfig
from beaver.run_queue import run_queue
from beaver.ssh_tunnel import create_ssh_tunnel
from beaver.utils import setup_custom_logger, REOPEN_FILES
from beaver.worker.worker import Worke... |
test_autograd.py | # Owner(s): ["module: autograd"]
import contextlib
import gc
import io
import math
import os
import random
import sys
import tempfile
import threading
import time
import unittest
import uuid
import warnings
import operator
from copy import deepcopy
from collections import OrderedDict
from itertools import product
from... |
batch_generator.py | # -*- coding: utf-8 -*-
# This file includes functionality for (multi-threaded) batch generation.
# Author: Stefan Kahl, 2018, University of Technology Chemnitz
import sys
sys.path.append("..")
import numpy as np
import config as cfg
from utils import image
RANDOM = cfg.getRandomState()
#################### IMAGE ... |
build.py | # Copyright 2014 The Oppia 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 applicable ... |
browser.py | # encoding: utf-8
import sys
import logging
if sys.version_info[:2] <= (2, 6):
logging.Logger.getChild = lambda self, suffix:\
self.manager.getLogger('.'.join((self.name, suffix)) if self.root is not self else suffix)
import json
import threading
import time
from bs4 import BeautifulSoup
import requests
im... |
cloudlog.py | import atexit
import json
import logging
import threading
import time
import uuid
from abc import abstractmethod
from logging import LogRecord
from logging.handlers import QueueHandler, QueueListener
from queue import Queue
from socket import gethostname
from typing import Any, List, Optional, Tuple, Type
import boto3... |
services.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
create_user.py | from redash.app import create_app
from redash.utils import users
from multiprocessing import freeze_support, Process
import getopt
import sys
import os
def create_user(email,name,tenant,password,admin):
app = create_app()
with app.app_context():
users.create(email,name,tenant,password,admin)
if __nam... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.