source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
process.py | from typing import Any, Optional, TypedDict, Union
from ._dict import Dict
from subprocess import (Popen, PIPE, DEVNULL, TimeoutExpired,
CalledProcessError)
from tempfile import NamedTemporaryFile
from threading import Thread, Timer
from queue import Queue, Empty
import sys, time, io, asyncio, t... |
test_connection.py | #!/usr/bin/env python
# test_connection.py - unit test for connection attributes
#
# Copyright (C) 2008-2011 James Henstridge <james@jamesh.id.au>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foun... |
test_socketserver.py | """
Test suite for socketserver.
"""
import contextlib
import io
import os
import select
import signal
import socket
import tempfile
import unittest
import socketserver
import test.support
from test.support import reap_children, reap_threads, verbose
try:
import threading
except ImportError:
threading = None
... |
api.py | # _*_ coding: utf-8 _*_
"""
Master Process
Why cluster running at ip6-localhost:8899?
/bin/bash$ adb shell cat /etc/hosts
127.0.0.1 localhost
::1 ip6-localhost
It can also run in ::1:8899.
下一步计划:检查 4g 网络是否可用
# 设备检测,如果设备不见了那么需要将设备踢出去
# devices_str = init_all_devices()
# log.info(f'Now running devic... |
rdtsend.py | import socket as st
import pickle
from packet import Packet
import time
import math
import threading
class RDTSend:
def __init__(self, addr):
self.sendAddr = addr
self.sendSocket = st.socket(st.AF_INET, st.SOCK_DGRAM)
self.timeout = 1
self.congWin = 1
self.threshold = 100
... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
warmup_dataloader.py | import sys
import os
import threading
import numpy as np
import torch
import json
import jieba
import string
import unicodedata
import multiprocessing as mp
#mp.set_start_method('spawn')
from pytorch_pretrained_bert.tokenization import BasicTokenizer, BertTokenizer
from pytorch_pretrained_bert.tokenization import _is_p... |
robot.py | #!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
#
# This file is part of ewm-cloud-robotics
# (see https://github.com/SAP/ewm-cloud-robotics).
#
# This file is licensed under the Apache Software License, v. 2 except as noted
# otherwise in the LIC... |
test_distributed.py | from __future__ import absolute_import, division, print_function, unicode_literals
import copy
import fcntl
import multiprocessing
import os
import sys
import time
import tempfile
import unittest
from contextlib import contextmanager
from datetime import timedelta
from functools import reduce, wraps
import torch
impor... |
processes.py | import logging
import multiprocessing as mp
import bigchaindb
from bigchaindb.pipelines import vote, block, election, stale
from bigchaindb.web import server
logger = logging.getLogger(__name__)
BANNER = """
****************************************************************************
* ... |
remote.py | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... |
windfarm.py | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import threading
import math
import random
import pywt
import numpy as np
import pandas as pd
import logging
import time
import os
from turbine import WindTurbine
from edgeagentclient import EdgeAgentClient
class Wind... |
console.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import cmd
import sys
from multiprocessing import Process
from os.path import abspath, dirname
sys.path.append(abspath(dirname(abspath(__file__)) + '../../../'))
from core.brain.main import Brain, worker
from core.config.settings import PEOPLE
import zmq
class Shell(cmd.... |
publish.py | import subprocess
import json
import multiprocessing
from multiprocessing import Process
from multiprocessing import Lock
import os.path #for basevm check
from threading import Thread
import strutil
import poolb
import sqlite_backend
import aws_utils
#todo actually queue this instead of just spamming them all at on... |
tests.py | ##############################################################################
#
# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
handler.py | #
# Copyright 2018 PyWren Team
#
# 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... |
MamboVision.py | """
MamboVision is separated from the main Mambo class to enable the use of the drone without the FPV camera.
If you want to do vision processing, you will need to create a MamboVision object to capture the
video stream.
This module relies on the opencv module, which can a bit challenging to compile on the Raspberry P... |
api.py | """Defines the Python API for interacting with the StreamDeck Configuration UI"""
import json
import sys
import os
from pathlib import Path
import threading
from functools import partial
import shlex, subprocess
from typing import Dict, List, Tuple, Union
from warnings import warn
from PIL import Image, ImageDraw, Ima... |
test_recv_save_op.py | # Copyright (c) 2018 PaddlePaddle 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 app... |
crop_img.py | import numpy as np
from skimage import io, color, exposure, img_as_float, transform, util
from matplotlib import pyplot as plt
import pathlib
import cv2
import multiprocessing
import time
import argparse
from keras.models import load_model
from keras.preprocessing.image import ImageDataGenerator
import os
... |
imgc.py | from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
from math import log10, sqrt
from matplotlib.image import imread
import matplotlib.pyplot as plt
import os
from skimage import metrics
import cv2
import sys
import itertools
import threading
import time
import os
f... |
client.pyw | import sys
import socket
from time import sleep
import webbrowser
import os
from threading import Thread
import subprocess
import getpass
try:
from PIL import ImageGrab
except ImportError:
pass
class Client:
def __init__(self, server_ip=None, port=None, name="pc"):
self.name = name
self.se... |
deepblaster_targeting_node.py | #################################################################################
# Copyright Cloud Brigade, ScratchSpace, Inc. or its affiliates. All Rights Reserved. #
# #
# Licensed under the Apache License, Version 2.0 (the "... |
wsdump.py | #!C:\Users\rexli\Desktop\Commonly Used\StockTradingBot\venv\Scripts\python.exe
import argparse
import code
import sys
import threading
import time
import ssl
import gzip
import zlib
import six
from six.moves.urllib.parse import urlparse
import websocket
try:
import readline
except ImportError:
pass
def ge... |
preforkunix.py | #! /usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2015 (ita)
"""
A version of prefork.py that uses unix sockets. The advantage is that it does not expose
connections to the outside. Yet performance it only works on unix-like systems
and performance can be slightly worse.
To use::
def options(opt):
... |
utils.py | import os
import glob
import random
import json
from contextlib import contextmanager
from http.server import SimpleHTTPRequestHandler
import shutil
import pathlib
import socketserver
import socket
import logging
import threading
import watchdog.events, watchdog.observers, time
from lxml import etree as ET
from . impo... |
deauth.py | import logging
import sys
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
import socket
from subprocess import call
from threading import Thread
from time import sleep
import printings
# local imports
from scan import WifiScan
conf.verb = 0
RED = "\033[1;31m"
GREEN = "\033[1;32m"
Y... |
timeline.py | import math
import copy
import threading
from .track import Track
from .clock import Clock
from .event import EventDefaults
from ..key import Key
from ..io import MidiOutputDevice
from ..constants import DEFAULT_TICKS_PER_BEAT, DEFAULT_TEMPO
from ..constants import EVENT_TIME, EVENT_ACTION, INTERPOLATION_NONE
from ..e... |
methods.py | # Copyright 2018 gRPC 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 or agreed to in writing... |
app_mt_aidea.py | # Copyright 2021 Industrial Technology Research Institute
#
# Copyright 2020 Xilinx 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... |
Application.py | #!/usr/bin/env python
import cv2
import logging
import pygame
import numpy as np
from multiprocessing import Process, Queue
import sys
import os
import tensorflow as tf
import yaml
from kicker.agents.neural_net_agent import NeuralNetAgent
from kicker.opcua_motor import MotorController
from kicker import ConsoleView, ... |
stress_test_fanout.py | "Stress test diskcache.core.Cache."
from __future__ import print_function
import collections as co
from diskcache import FanoutCache, UnknownFileWarning, EmptyDirWarning
import multiprocessing as mp
import os
import random
import shutil
import sys
import threading
import time
import warnings
try:
import Queue
ex... |
app.py | #!/usr/bin/env python3
"""
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
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, in... |
scCloudStorage.py | """
The Cloud Storage File.
"""
import time
import json
import string
from threading import Thread
from scratchconnect.CloudConnection import CloudConnection
from scratchconnect.scEncoder import Encoder
SUPPORTED_CHARS = list(string.ascii_uppercase + string.ascii_lowercase + string.digits + string.punctuat... |
__main__.py | #!/usr/bin/env python3
import argparse
from datetime import timedelta, datetime
import io
import itertools as it
import json
from lxml import html
import math
import multiprocessing as mp
import multiprocessing.dummy as mp_dummy
import os
import os.path as path
import sys
from time import strptime, strftime, mktime
im... |
make.py | # coding: utf-8
from __future__ import print_function
import argparse
import multiprocessing
import os
import platform
import re
import shutil
import subprocess
import sys
import threading
import time
import zipfile
# The current test/decompression data version in use
current_test_data = 'test_data_v5'
current_decom... |
speechSpyGlobalPlugin.py | # A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2018 NV Access Limited
# This file may be used under the terms of the GNU General Public License, version 2 or later.
# For more details see: https://www.gnu.org/licenses/gpl-2.0.html
"""This module provides an NVDA global plugin which creates a and robo... |
test.py | import gzip
import json
import logging
import os
import io
import random
import threading
import time
import helpers.client
import pytest
from helpers.cluster import ClickHouseCluster, ClickHouseInstance, get_instances_dir
from helpers.network import PartitionManager
from helpers.test_tools import exec_query_with_retr... |
conftest.py | import os
import tempfile
import pytest
import anyio
from functools import partial
from threading import Thread
from asyncclick.testing import CliRunner
class SyncCliRunner(CliRunner):
def invoke(self,*a,_sync=False,**k):
fn = super().invoke
if _sync:
return fn(*a,**k)
# anyi... |
streaming_secured_server.py | # Need threading for multiple clients and a way to terminate gracefully
import threading
# Process command line arguments
import argparse
# Stamp the frames with a timestamp
import datetime
# May need for sleep
import time
# Necessary to process images with openCV
import numpy as np
import pyautogui
import imutils
impo... |
bot.py | from telepot.loop import MessageLoop
import telepot
from bs4 import BeautifulSoup
from datetime import datetime, timedelta
import time
from threading import Thread
from ActivateSelenium import bid
from key import token
activeUsers = {}
timeslots = {}
input_format = "%d/%m/%Y %H:%M"
precise_format = "%d/%m/%Y %H:%M:%S.... |
OpDialogue.py | ##########################################################################
#
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... |
test_dgx.py | import multiprocessing as mp
import os
import dask.array as da
from dask_cuda import DGX
from distributed import Client
import numpy
import pytest
mp = mp.get_context("spawn")
ucp = pytest.importorskip("ucp")
psutil = pytest.importorskip("psutil")
def _check_dgx_version():
dgx_server = None
if not os.path... |
ana.py | # check the staging service
# if check the data
# if the data become meaningless
# write info to meta server
from mpi4py import MPI
import numpy as np
import dataspaces.dataspaceClient as dataspaces
import ctypes
import os
import time
import math
import timeit
import sys
from threading import Thread
import os
sy... |
setup.py | # 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 asyncio
import contextlib
import functools
import json
import os
import socketserver
import tempfile
import threading
from pathlib impo... |
text2tfrecord.py | """tokenization to bpe or character embeddings of text datasets"""
import argparse
import io
import multiprocessing
import os
import shutil
import time
import jsonlines
import requests
import simdjson
import tensorflow as tf
import zstandard
from google.cloud import storage
from transformers import GPT2TokenizerFast
... |
bm_go.py | """
Go board game
"""
import math
from mpkmemalloc import *
import os
import gc
import threading
import psutil
import random
import pyperf
SIZE = 9
GAMES = 200
KOMI = 7.5
EMPTY, WHITE, BLACK = 0, 1, 2
SHOW = {EMPTY: '.', WHITE: 'o', BLACK: 'x'}
PASS = -1
MAXMOVES = SIZE * SIZE * 3
TIMESTAMP = 0
MOVES = 0
def to_po... |
utils.py | #!/usr/bin/env/python
import numpy as np
import tensorflow as tf
import queue
import threading
import pickle
from rdkit.Chem import AllChem
from rdkit.Chem import Draw
from rdkit import Chem
from rdkit.Chem import rdmolops
from rdkit.Chem import rdFMCS
from collections import defaultdict, deque
import os
import heapq
i... |
CV.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from os.path import dirname, abspath
sys.path.append(dirname(dirname(dirname(dirname(abspath(__file__))))))
reload(sys)
sys.setdefaultencoding('utf-8')
from threading import Thread
import cv2
import time
import rospy
from std_msgs.msg import String
from EmeraldAI... |
modem.py | #!/usr/bin/env python
#
# Copyright (c) 2015-2021 University of Antwerp, Aloxy NV.
#
# This file is part of pyd7a.
# See https://github.com/Sub-IoT/pyd7a for further info.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... |
test_stdout.py | import os
import random
import string
import sys
import time
import pytest
from dagster import (
DagsterEventType,
InputDefinition,
ModeDefinition,
execute_pipeline,
pipeline,
reconstructable,
resource,
solid,
)
from dagster.core.execution.compute_logs import should_disable_io_stream_re... |
player.py | from typing import Callable, List
import fseq
from enum import Enum
import pyaudio
import wave
class ParamError(Exception):
pass
class ChannelType(Enum):
UNKNOWN = -1
NOOP = 0
TRANSITION = 1 # the callback will be (channel, change_to_state)
def _run(channel_type_callback, seq, channel):
import t... |
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... |
external_client.py | import grpc
import time
import statistics
# from threading import Thread
from alephclient.services.common_pb2 import Text
from alephclient.services.entityextract_pb2_grpc import EntityExtractStub
URL = 'localhost:50000'
TEXT = 'There was Joseph Stalin working at the Kremlin in Moscow'
channel = grpc.insecure_channel(U... |
evaluation.py | # Copyright (c) 2020 DeNA Co., Ltd.
# Licensed under The MIT License [see LICENSE for details]
# evaluation of policies or planning algorithms
import random
import time
import multiprocessing as mp
import numpy as np
from .environment import prepare_env, make_env
from .connection import send_recv, accept_socket_con... |
local_timer_test.py | # Owner(s): ["oncall: r2p"]
# Copyright (c) Facebook, Inc. and its affiliates.
# 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.
import multiprocessing as mp
import signal
import time
import unittest
import unittes... |
draw_exploit.py | import numpy as np
np.set_printoptions(linewidth=200)
import matplotlib.pyplot as plt
import matplotlib.dates
import socket
import multiprocessing
import time
import pickle
import datetime
UDP_IP = "188.166.115.7"
UDP_BROADCAST_PORT = 7001
UDP_EXCHANGE_PORT = 8001
HELLO_MESSAGE = "TYPE=SUBSCRIPTION_REQUEST".encode("as... |
util.py | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import base64
import binascii
import colorsys
import contextlib
import codecs
import errno
import hashlib
import json
import getpass
import logging
import math
import os
import re
import shlex
import socket
imp... |
Russia.py |
import os, sys, re, traceback, random, time, threading, base64, string, math
import io, socket, ssl, cgi, json, gzip
try:
from urllib.parse import urlparse as urlparse
except:
from urlparse import urlparse as urlparse
try:
import urllib.request, urllib.error, urllib.parse
except:
print ("\nRussia need... |
move_arm_to_pixel.py | #!/usr/bin/env python
import io
import os
import threading
import time
import json
from copy import deepcopy
import rospy
import rospkg
from flask import Flask, request
from flask import render_template, send_file, redirect, url_for
from std_msgs.msg import Header
from sensor_msgs.msg import Image
from geometry_msgs.... |
test_tcp_server.py | # Copyright 2017 StreamSets 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... |
websocket_manager.py | import json
import time
from threading import Thread, Lock
from queue import Queue
from typing import Callable
from gzip import decompress
from websocket import WebSocketApp
from confluent_kafka import Producer
class WebsocketManager():
_CONNECT_TIMEOUT_S = 5
def __init__(self, url: str, subscribe: Callable, ... |
mbatch_generation.py |
# Code for generating mini-batches. The outout can be any
# combination of:
# features/0-stats/1-stats/i-vectors/labels/scp-indices
#
# scp-indices means which position in the data had. This
# can for example be used for looking up a trial weight
# from a list or for accessing data that is already
# loaded to the... |
action_runner.py | #!/usr/bin/env python3.6
"""
Write pid and stdout/stderr to a standard location before execing a command.
"""
import argparse
import contextlib
import logging
import os
import subprocess
import sys
import threading
import time
from tron import yaml
STATUS_FILE = "status"
class StatusFile:
"""Manage a status fil... |
__init__.py | import struct, socket, threading, json, os, pickle
from essentials import tokening
import essentials
import copy
import time
from hashlib import sha1
import base64
import array
PYTHONIC = "python based"
WEB_BASED = "web based"
def SocketDownload(sock, data, usage=None):
"""
Helper function for Socket Clas... |
musicplayer.py | '''
musicplayer.py
Copyright (c) 2022 s1gnsgrfu
This software is released under the MIT License.
see https://github.com/s1gnsgrfu/MusicPlayer/blob/master/LICENSE
'''
#pydub,mutagen,pysimplegui,pytaglib
from pydub import AudioSegment
from pydub.utils import mediainfo
from pydub.playback import play
import simpleaud... |
map_dataset_op_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... |
fake_bulb.py | """Start up a fake bulb to test features without a real bulb."""
import json
import socketserver
import threading
from typing import Any, Callable, Dict
def get_initial_pilot() -> Dict[str, Any]:
return {
"method": "getPilot",
"env": "pro",
"result": {
"mac": "ABCABCABCABC",
... |
master.py | '''
This module contains all of the routines needed to set up a master server, this
involves preparing the three listeners and the workers needed by the master.
'''
# Import python libs
import os
import re
import time
import errno
import fnmatch
import signal
import shutil
import stat
import logging
import hashlib
imp... |
test_browser.py | # coding=utf-8
# Copyright 2013 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
from __future__ import print_function
import argparse
... |
wfsim_utils.py | import numpy as np
import os
import pandas as pd
import time
from threading import Thread
instruction_dtype = [('event_number', np.int), ('type', np.int), ('t', np.int),
('x', np.float32), ('y', np.float32), ('z', np.float32),
('amp', np.int), ('recoil', '<U2')]
def rand_ins... |
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... |
Server.py | import sys
import os
import socket
import struct
import threading
import time
from Crypto.Cipher import AES
# -*- coding=utf-8 -*-
# serverIp = '172.18.35.225'
serverIp = '192.168.199.218'
# Leo's laptop in dormitory
secretary_key = "project-C/S and P2P protocol key"
# serverIp = '127.0.0.1'
serverPort = 6789
messa... |
oase_accept.py | # Copyright 2019 NEC 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 to in wri... |
client.py | """
MIT License
Copyright (c) 2021 CarlFandino
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, pu... |
test_threads.py | 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,
run_async_from_thread, run_sync_in_worker_thread, sleep, start_blocking_portal)
pytest... |
OF_circle.py | import cv2
from tkinter import Tk
from tkinter.filedialog import askopenfilename
import numpy as np
import imutils
import math
import threading
def main():
cap = cv2.VideoCapture(vid_path)
status1, previous_frame = cap.read()
total_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
copy_frame = ... |
tests_gpio.py | #!/usr/bin/env python
#
# This file is part of RPIO.
#
# Copyright
#
# Copyright (C) 2013 Chris Hager <chris@linuxuser.at>
#
# License
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Softwar... |
utils.py | from os.path import dirname, join
from httplib import HTTPConnection
from threading import Thread
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from StringIO import StringIO
from socket import error
from sys import stderr
from re import search
from collective.solr.local import getLocal, setLocal
from c... |
Shooter_CameraTracker.py | import sys
import os
import time
import numpy as np
import serial ### pip install serial, pip install pyserial
import struct
import logging
# import dlib
import copy
from imutils.video import VideoStream
from imutils.video import FPS
import argparse
import imutils
import time
# Threads
# from thread import start_new... |
qt.py | #!/usr/bin/env python3
#
# Cash Shuffle - CoinJoin for Bitcoin Cash
# Copyright (C) 2018-2019 Electron Cash LLC
#
# 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,
# includ... |
pool.py | # -*- coding: utf-8 -*-
import time
import os
import signal
import random
import redis
import rq
import psutil
from Queue import Empty
from .log import logger
from .worker import Worker
from .accounting import PoolAccounting
from multiprocessing import Process, Queue
log = logger()
def msg_exit(wname):
return... |
parser.py | # encoding: utf-8
import os
import re
import StringIO
from ftplib import FTP
from lxml import etree
from Queue import Queue
from threading import Thread
import json
import urllib3
from openpyxl import load_workbook
urllib3.disable_warnings()
def test():
print "测试导入"
# 把所有解析文件的处理都写到这里
class ParseMim2gene(object):... |
_server.py | # Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
update.py | #!/usr/bin/env python
# coding:utf-8
import os
import json
import time
import threading
import zipfile
import sys
import platform
import uuid
from distutils.version import LooseVersion
from xlog import getLogger
xlog = getLogger("launcher")
import config
import update_from_github
import urllib2
try:
reduce ... |
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... |
app.py | from flask import json
from flask import jsonify
from flask import request
from flask import Flask
from flask import abort
from flask import make_response
from multiprocessing import Process, Value
import time
from listen import listenNewMessages
from setDefaultMessages import setDefaultMessages
from getDefaultMessage... |
tools.py | """
tools.py
written by ariyn
"""
from random import randrange
from urllib.request import Request, urlopen
from urllib.error import HTTPError
from copy import copy
from zipfile import ZipFile
from tempfile import NamedTemporaryFile
import json
import unicodedata
import re
import multiprocessing
import os
import time
i... |
main.py | import sublime
import sublime_plugin
import os
import sys
import threading
# Load modules
try:
from .xdebug import *
except:
from xdebug import *
# Set Python libraries from system installation
python_path = config.get_value(S.KEY_PYTHON_PATH)
if python_path:
python_path = os.path.normpath(python_path.re... |
uploader.py | #!/usr/bin/env python
import os
import re
import time
import stat
import json
import random
import ctypes
import inspect
import requests
import traceback
import threading
import subprocess
from collections import Counter
from selfdrive.swaglog import cloudlog
from selfdrive.loggerd.config import ROOT
from common.para... |
batch_reader.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... |
ioloop_test.py | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
import contextlib
import datetime
import functools
import socket
import sys
import threading
import time
import types
from tornado import gen
from tornado.ioloop import IOLoop, TimeoutError, PollIOLoop, PeriodicCal... |
kinesis_video_camera_node.py | #!/usr/bin/env python
##############################################################
# #
# Copyright 2019 Amazon.com, Inc. or its affiliates. #
# All Rights Reserved. #
# ... |
playsound.py | class PlaysoundException(Exception):
pass
def _playsoundWin(sound, block = True):
'''
Utilizes windll.winmm. Tested and known to work with MP3 and WAVE on
Windows 7 with Python 2.7. Probably works with more file formats.
Probably works on Windows XP thru Windows 10. Probably works with all
vers... |
server.py | import http.server
import threading
import socket
import tdl
import hunting.level.parser as parser
import hunting.level.encoder as encoder
from hunting.display.render import Renderer
import hunting.sim.runner as runner
import hunting.resources as resources
UTF_8 = 'utf-8'
def get_random_open_port():
s = socket... |
performance.py | """This will have the code that monitors performance and have some optimization codes
- Use Pytorch data loader with pinned memory (pin_memory) to see if you gain any performance increase.
You might not notice significant improvements since the dataset is small.
- Build in cython:
from Cython.Build import cythonize... |
LDSUtilities.py | # -*- coding: utf-8 -*-
'''
v.0.0.9
LDSReplicate - LDSUtilities
Copyright 2011 Crown copyright (c)
Land Information New Zealand and the New Zealand Government.
All rights reserved
This program is released under the terms of the new BSD license. See the
LICENSE file for more information.
Simple LDS specific utilit... |
test_lock.py | """
Copyright (c) 2008-2022, Jesus Cea Avion <jcea@jcea.es>
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... |
GTN.py | import yaml
import torch
import multiprocessing as mp
import sys
import time
from agents.GTN_master import GTN_Master
from agents.GTN_worker import GTN_Worker
"""
script to run GTN master & slave locally
"""
def run_gtn_on_single_pc(config):
def run_gtn_worker(id):
gtn = GTN_Worker(id)
gtn.run()
... |
_signal_label.py | import argparse
import logging
import gzip
from os import path
import typing
import os
from tqdm import tqdm
from typing import NamedTuple
from .. import dataset_pb2
import numpy as np
import multiprocessing as mp
import threading
from glob import glob
class MinionDataCfg(NamedTuple):
input: str
out: str
cla... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.