source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
eval_coco_format.py | # Copyright 2019 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 ... |
face_detection.py | import os
import time
import shutil
import pathlib
from socketer import MASM
import threading
from facer import Facer
masmPath = None
pDataPath = None
pLBPHPath = None
pNamePath = None
detcMethod = 0 # 0 HAAR, 1 DNN, 2 BOTH
failTimeout = 10
memoryTimeout = 3
lastAccess = False
preparedYet = False
keepWebcamOpen = Non... |
usage.py | """Module to that provides functions for usage logging."""
import contextlib
import hashlib
import json
import locale
import logging
import os
import platform
import sys
import threading
import traceback
import urllib
import urllib2
import uuid
from osgeo import gdal
from osgeo import osr
import natcap.invest
import p... |
start.py | # Copyright BigchainDB GmbH and BigchainDB contributors
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
import logging
import setproctitle
import bigchaindb
from bigchaindb.lib import BigchainDB
from bigchaindb.core import App
from bigchaindb.parallel_validation impor... |
gateway_listener.py | import os
import tempfile
import json
import uuid
import random
import logging
from socket import socket, timeout, AF_INET, SOCK_STREAM
from ipython_genutils.py3compat import str_to_bytes
from jupyter_client.connect import write_connection_file
from threading import Thread
max_port_range_retries = int(os.getenv('EG_MA... |
env_wrappers.py | """
Modified from OpenAI Baselines code to work with multi-agent envs
"""
import numpy as np
import torch
from multiprocessing import Process, Pipe
from abc import ABC, abstractmethod
from onpolicy.utils.util import tile_images
class CloudpickleWrapper(object):
"""
Uses cloudpickle to serialize contents (other... |
maint.py | # -*- coding: utf-8 -*-
'''
Define the behaviors used in the maintenance process
'''
from __future__ import absolute_import
# Import python libs
import multiprocessing
import os
# Import ioflo libs
import ioflo.base.deeding
# Import salt libs
import salt.fileserver
import salt.loader
import salt.utils.minions
import ... |
poem_es.py | import sys
import socket
import os
import subprocess as sp
class Server:
def __init__(self,port, model = 0, beam_size = 10):
self.host = socket.gethostname()
self.port = port
self.model = model
self.root_dir = os.path.abspath(__file__ + "/../../")
model_names = ["lyrics.tl... |
code_executor.py | # Copyright 2015 deepsense.ai (CodiLime, 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 agree... |
app.py |
"""
WebSocketApp provides higher level APIs.
"""
import inspect
import select
import sys
import threading
import time
import traceback
from .abnf import ABNF
from .core import WebSocket, getdefaulttimeout
from .exceptions import *
from . import logging
__all__ = ["WebSocketApp"]
class Dispatcher:
def __init... |
test_ipc.py | import sys
import multiprocessing as mp
import traceback
import pickle
import numpy as np
from numba import cuda
from numba.cuda.cudadrv import drvapi, devicearray
from numba.cuda.testing import skip_on_cudasim, ContextResettingTestCase
from numba.tests.support import linux_only
import unittest
linux = sys.platform.... |
runner.py | import config
from functions import meow
from likert import likert
import time
from multiprocessing import Process
def func1():
for i in range(config.actionCount):
meow.twt()
time.sleep(config.timeBetweenTweets)
def func2():
likert()
if __name__ == '__main__':
p1 = Process(target=func1... |
deGatosYRatones.py | # -*- coding: utf-8 -*-
"""
Correa Gonzรกlez Alfredo
De gatos y ratones
- Tengo k gatos (e I ratones) en casa.
- Les sirvo comida a mis gatos en m platos.
- Gatos y ratones han llegado a un acuerdo para repartirse el
tiempo y comida pero tienen que convencerme que estรกn haciendo
su trabajo
- Los gatos pueden comer ... |
run.py | import os
import threading
import subprocess as sp
RESULT_DRECTORY = 'results'
class Runner:
def __init__(self, cmd):
self.cmd = cmd
def run_it(self):
os.system(self.cmd)
def run_vendor(vendor_dir, vendor):
print "Running vendor: " + vendor
p = sp.Popen("find {} -name 'squashfs-roo... |
Spec.py | # -*- coding: utf-8 -*-
import glob
import io
import sys
import os
from collections import defaultdict, OrderedDict
from datetime import datetime
from . import biblio
from . import boilerplate
from . import caniuse
from . import dfns
from . import mdnspeclinks
from . import conditional
from . import config
from . im... |
udp.py | import random
import time
import socket
from threading import Thread
def UDP_ATTACK(threads, attack_time, target):
# Finish
global FINISH
FINISH = False
target_ip = target.split(":")[0]
target_port = int(target.split(":")[1])
print("[#] Attack started for " + str(attack_time) + " secounds..")
... |
threaded_run.py | import threading
import time
import spam
class Ticker:
def __init__(self, delay):
self.cnt = 0
self.delay = delay
def tick(self):
while True:
self.cnt += 1
print("Tick %d..." % self.cnt)
time.sleep(self.delay)
if __name__ == "__main__":
threa... |
hdf5.py | import threading
import contextlib
import logging
@contextlib.contextmanager
def threaded_io(vs, filepath, mode):
"""
If using IO threads, start a new thread to write the netCDF data to disk.
"""
import h5py
if vs.use_io_threads:
_wait_for_disk(vs, filepath)
_io_locks[filepath].cle... |
basicclientserver.py | import sys
import threading
import isocketet
class GenesisNode:
isocket = isocketet.isocketet(isocketet.AF_INET, isocketet.isocket_STREAM)
peerList = []
def __init__(self):
self.isocket.bind(('0.0.0.0', 10000))
self.isocket.listen(1)
def handler(self, conn, alrt):
while Tru... |
rfc2217.py | #! python
#
# This module implements a RFC2217 compatible client. RF2217 descibes a
# protocol to access serial ports over TCP/IP and allows setting the baud rate,
# modem control lines etc.
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C) 2001-2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX... |
fabfile.py | #
# OtterTune - fabfile.py
#
# Copyright (c) 2017-18, Carnegie Mellon University Database Group
#
'''
Created on Mar 23, 2018
@author: bohan
'''
import sys
import json
import logging
import time
import os.path
import re
from multiprocessing import Process
from fabric.api import (env, local, task, lcd)
from fabric.stat... |
process.py | from django import db
from django.core.management.base import BaseCommand
from photod.core.steps import MediaFilePipeline
from photod.core.models import MediaFile
from photod.cli.models import Job
import multiprocessing
def worker(queue, force):
db.connections.close_all()
# Prepare the pipeline instance.
... |
main.py | import os
os.environ["OMP_NUM_THREADS"] = "1"
import torch
import torch.multiprocessing as mp
import torch.optim as optim
import argparse
from multiprocessing import Manager
from multiprocessing.managers import BaseManager
from params import params, log_params
from GACE_GDAN.train import run_sim
from GACE_GDAN.eval... |
test_smr.py | # Copyright (c) 2015 SONATA-NFV, 2017 5GTANGO
# 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 ... |
lanes.py | from threading import Thread
import time
import numpy as np
class Lane(Thread):
_MAX_CARS = 50
def __init__(self, car_factory, daemon=False):
super(Lane, self).__init__(daemon=daemon)
self._cars = []
self.car_factory = car_factory
self.left_count = 0
self.right_count... |
Agora.py | #!/usr/bin/env python3
'''
Agora v1
Compile with:
pyinstaller -F -w -i icon.ico --hidden-import tkinter --hidden-import tkinter.ttk --hidden-import ttkthemes --hidden-import pycrypto --add-data 'images/*:images' --add-data 'users.txt:.' Agora.py
'''
import os, sys, random, string, hashlib, subprocess, socket, select, ... |
thread.py | #!/usr/bin/python3
import threading
import time
import logging
def worker_1():
print "worker_1"
def worker_2():
print "worker_2"
while True:
print "worker_2"
time.sleep(5)
if __name__ == "__main__":
worker1 = threading.Thread(target=worker_1)
worker2 = threading.Thread(target=w... |
driver_util.py | """Scripts for drivers of Galaxy functional tests."""
import fcntl
import logging
import os
import random
import shutil
import signal
import socket
import string
import struct
import subprocess
import sys
import tempfile
import threading
import time
import nose.config
import nose.core
import nose.loader
import nose.p... |
test.py | import argparse
import json
import os
from pathlib import Path
from threading import Thread
import numpy as np
import torch
import yaml
from tqdm import tqdm
from models.experimental import attempt_load
from utils.datasets import create_dataloader
from utils.general import coco80_to_coco91_class, check_dataset, check... |
cc2531connector.py | import logging.handlers
import struct
import sys
import threading
import serial
from zigbear.radio.connector import Connector
# based on https://github.com/g-oikonomou/sensniff/blob/master/sensniff.py
LINKTYPE_IEEE802_15_4_NOFCS = 230
LINKTYPE_IEEE802_15_4 = 195
MAGIC_NUMBER = 0xA1B2C3D4
VERSION_MAJOR = 2
VERSION_M... |
test_html.py | from functools import partial
from importlib import reload
from io import BytesIO, StringIO
import os
import re
import threading
from urllib.error import URLError
import numpy as np
from numpy.random import rand
import pytest
from pandas.compat import is_platform_windows
from pandas.errors import ParserE... |
ThreadedComponent.py | #!/usr/bin/env python
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (the "Lice... |
utils.py | import socket
import threading
import struct
import ipaddress
import subprocess
import os
from typing import Tuple
import atexit
def connect_socks(s1: socket.socket, s2: socket.socket):
t1 = threading.Thread(target=connect_loop, args=(s1, s2))
t2 = threading.Thread(target=connect_loop, args=(s2, s1))
t1.s... |
test_currentthreadscheduler.py | import pytest
import unittest
import threading
from datetime import timedelta
from time import sleep
from rx.concurrency import CurrentThreadScheduler
from rx.internal.basic import default_now
class TestCurrentThreadScheduler(unittest.TestCase):
def test_currentthread_singleton(self):
scheduler = [Curr... |
frontend_simulation.py | import socket
import threading
import json
HEADER = 20
PORT = 50551
IP_ADDRESS = socket.gethostbyname(socket.gethostname())
ADDRESS = (IP_ADDRESS, PORT)
FORMAT = "utf-8"
DISCONNECT_MESSAGE = "!DISCONNECT"
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(ADDRESS)
def send(msg):
msg = j... |
process_replay.py | #!/usr/bin/env python3
import os
import threading
import importlib
import shutil
if "CI" in os.environ:
tqdm = lambda x: x
else:
from tqdm import tqdm
from cereal import car, log
from selfdrive.car.car_helpers import get_car
import selfdrive.manager as manager
import selfdrive.messaging as messaging
from common.p... |
listing27-3.py | from xmlrpc.client import ServerProxy, Fault
from cmd import Cmd
from random import choice
from string import ascii_lowercase
from server import Node, UNHANDLED
from threading import Thread
from time import sleep
import sys
HEAD_START = 0.1 # Seconds
SECRET_LENGTH = 100
def random_string(length):
"""
Returns ... |
test_functools.py | import abc
import collections
import copy
from itertools import permutations
import pickle
from random import choice
import sys
from test import support
import unittest
from weakref import proxy
try:
import threading
except ImportError:
threading = None
import functools
py_functools = support.import_fresh_mod... |
node.py | from typing import List
from dqc.BaseInstructions import BaseInstruction, SingeQubitInstruction, CNOTInstruction
from multiprocessing import Process
def compute(name: str, instructions: List[BaseInstruction], conn):
from cqc.pythonLib import CQCConnection, qubit
# Initialize the connection
with CQCConnec... |
concurrent.py | """
This module provides a @concurrent decorator primitive to
offload computations from mitmproxy's main master thread.
"""
from __future__ import absolute_import, print_function, division
import threading
class ReplyProxy(object):
def __init__(self, original_reply, script_thread):
self.original_reply = ... |
extApi.py | from multiprocessing import Process, Queue
from MultiProcessingLog import MultiProcessingLog
import os
import sys
import json
import shutil
import uuid
import cgi
import falcon
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
import constants
sys.path.append(constants.FDF... |
th_test.py | from multiprocessing import Process, Manager
def f(d, l):
d[1] = '1'
d['2'] = 2
d[0.25] = None
l.reverse()
if __name__ == '__main__':
with Manager() as manager:
d = manager.dict()
l = manager.list(range(10))
p = Process(target=f, args=(d, l))
p.start()
p.jo... |
test_operator.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... |
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... |
pi_cam_noir_v21.py | """
Implementation for the Pi Camera Noir V2.1
Should be similar for other camera's connected to the CSI interface on the Raspberry Pi
"""
import time
import picamera.array
import picamera
import os
import cv2
import numpy as np
import subprocess
import multiprocessing as mp
from fractions import Fraction
from PIL im... |
notebookapp.py | # coding: utf-8
"""A tornado based Jupyter notebook server."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import absolute_import, print_function
import notebook
import binascii
import datetime
import errno
import gettext
import hashlib
import ... |
toggle.py | #!/usr/bin/python
# apt-get install python-appindicator
import os
import time
import signal
import threading
from . import vpn
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('AppIndicator3', '0.1')
from gi.repository import Gtk as gtk
from gi.repository import AppIndicator3 as appindicator
# config
AP... |
multiuser_db.py | import prodigy
from multiprocessing import Process
from time import sleep
import atexit
from pathlib import Path
from prodigy.components import printers
from prodigy.components.loaders import get_stream
from prodigy.core import recipe, recipe_args
from prodigy.util import TASK_HASH_ATTR, log
from datetime import datet... |
databinder.py | #
# COPYRIGHT:
# The Leginon software is Copyright 2003
# The Scripps Research Institute, La Jolla, CA
# For terms of the license agreement
# see http://ami.scripps.edu/software/leginon-license
#
import Queue
from pyami import ordereddict
import threading
import datatransport
from leginon impo... |
local_elastic_agent_test.py | #!/usr/bin/env python3
# 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 json
import multiprocessing as mp
import os
import shutil
import signal
import temp... |
streampromise.py | # -*- coding: utf-8 -*-
# Copyright ยฉ 2014 Cask Data, 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 applica... |
phaselink_dataset.py | #!/usr/bin/python
#-----------------------------------------------------------------------------------------------------------------------------------------
# PhaseLink: Earthquake phase association with deep learning
# Author: Zachary E. Ross
# Seismological Laboratory
# California Institute of Technology
# Script D... |
database_heartbeat.py | import datetime
import logging
import os
import socket
import threading
from galaxy.model import WorkerProcess
from galaxy.model.orm.now import now
log = logging.getLogger(__name__)
class DatabaseHeartbeat:
def __init__(self, application_stack, heartbeat_interval=60):
self.application_stack = applicati... |
run_script.py | import os, json, sys
from sys import platform
import threading
python_path = ''
class BackendRunScript:
def __init__(self):
self.config_path = os.path.join(os.path.dirname(os.getcwd()), 'Engine360')
self.config_file = os.path.join(self.config_path, 'Backend', 'Engine', 'project_settings.json')
... |
shell.py | # !/usr/bin/env python
"""
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"... |
service.py | # -*- coding: utf-8 -*-
from resources.lib import proxy
from codequick import Script
import SocketServer
import threading
from xbmc import Monitor
def serveForever(handler):
try:
handler.serve_forever()
except Exception as e:
Script.log(e, lvl=Script.DEBUG)
pass
SocketServer.Threadi... |
server_app.py | import select
import threading
from typing import Tuple
from socket import socket, AF_INET, SOCK_STREAM
# from utils.config_jim import TO
from server.utils.config_server import WORKERS, MSG_SIZE
from server.utils.metaclasses import ServerVerifier
from server.utils.descriptors import CheckedHost
from server.utils.conf... |
block.py | from abc import ABC, abstractmethod
from threading import Thread
class Block(ABC):
def __init__(self, event):
self._cache = ""
self._event = event
return
@abstractmethod
async def _thread(self):
pass
async def start(self, loop):
# run self._thread in another th... |
main.py | import sys
import cv2
import threading
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QMainWindow ,QGraphicsScene, QGraphicsPixmapItem, QFileDialog
from PyQt5.QtCore import Qt,pyqtSignal,QCoreApplication
from PyQt5.QtGui import QPixmap,QImage
from mainwindow import Ui_MainWindow # ๅ ่ฝฝๆไปฌ็ๅธๅฑ
... |
challenges.py | #!/usr/bin/env python3
# standard library modules
import base64
import cProfile
import functools
import gzip
import hashlib
import inspect
import itertools
import os
import pprint as pprint_module
import re
import string
import struct
import sys
import traceback
import warnings
from argparse import ArgumentParser
fro... |
actor.py | """ Actor for rodario framework """
# stdlib
import atexit
from uuid import uuid4
from time import sleep
from threading import Thread, Event
import pickle
import inspect
# local
from rodario import get_redis_connection
from rodario.registry import Registry
from rodario.exceptions import UUIDInUseException
REGISTRY =... |
b3_data_iter.py | """ Data iterator"""
import mxnet as mx
import numpy as np
import sys, os
import cv2
import time
import multiprocessing
import itertools
from scipy import ndimage
from sklearn import neighbors
sys.path.append('../')
from utils import get_rgb_data
from utils import get_spectral_data
from utils import get_polygons
fro... |
test_search.py | import threading
import time
import pytest
import random
import numpy as np
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
prefix = "search_collection"
s... |
train_pg.py | import numpy as np
import tensorflow as tf
import gym
import logz
import scipy.signal
import os
import time
import inspect
from multiprocessing import Process
#============================================================================================#
# Utilities
#====================================================... |
pre_commit_linter.py | # coding: utf-8
#
# 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 requi... |
test_coroutine_sink.py | import asyncio
import sys
import pytest
import logging
import loguru
import time
import threading
import os
import re
import multiprocessing
from loguru import logger
async def async_writer(msg):
await asyncio.sleep(0.01)
print(msg, end="")
class AsyncWriter:
async def __call__(self, msg):
await... |
test_flight.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... |
supervisor.py | #!/usr/local/bin/python3
import threading, time, io, json, sys, os
import socketserver, datetime, re
import subprocess
import ipaddress
import netifaces
from http.server import ThreadingHTTPServer, BaseHTTPRequestHandler
from http import HTTPStatus
from telnetlib import Telnet
from functools import partial
ERROR_DAT... |
dataset_manager.py | import clip
import pytorch_lightning as pl
import os
import multiprocessing as mp
import clip, torch
import PIL
from operator import itemgetter
from .multigrain import * #SlidingWindow,PyramidTx,non_resized_transform
from .embeddings import *
from .vloop_dataset_loaders import EvDataset
import glob
import pandas as... |
interface.py | import asyncio
import logging
import argparse
from time import sleep
from threading import Thread
from kademlia.network import Server
# command line interface
class App(object):
def __init__(self):
self.parser = argparse.ArgumentParser(description='A p2p key-value databse.')
self.loop = asyncio.n... |
sserver.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 clowwindy
# Copyright (c) 2014 v3aqb
#
# 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... |
subbuddy.py | #!/usr/bin/python
import os
import sys
import glob
import time
import json
import codecs
import pprint
import urllib
import argparse
import sbconfig
import httplib2
import threading
import subprocess
import gdata.youtube
import gdata.youtube.service
user_email = sbconfig.user_email
user_password = sbconfig.user_passw... |
scheduler.py | import os
import sys
sys.path.append(os.path.join(os.getcwd().split('xtraderbacktest')[0],'xtraderbacktest'))
import datetime
import modules.common.scheduler
import modules.other.logg
import logging
import modules.price_engine.price_loader as price_loader
import modules.other.sys_conf_loader as sys_conf_loader
impor... |
l1_driver.py | # CloudShell L1 driver core
#
# It should not be necessary to edit this file.
#
# - Listens on a port passed on the command line, e.g. {{cookiecutter.driver_name.replace(' ', '') }}.exe 4000
# - Receives commands from CloudShell
# - Dispatches commands to your L1 handler
import socket
import traceback
import... |
main.py | import click
import os
import sys
import json
from threading import Thread
from mouseftp.ftp import ftp_server
import mouseftp.api
def read_dir(ctx, param, value):
if not value:
if not os.path.exists('home'):
os.mkdir('home')
if not os.path.isdir('home'):
print('home is not... |
exporter.py | #!/usr/bin/python3
import sys
import time
import os
from prometheus_client import start_http_server
from prometheus_client.core import REGISTRY #GaugeMetricFamily, REGISTRY, CounterMetricFamily
from optparse import OptionParser
from threading import Thread
# from VropsCollector import VropsCollector
from InventoryBuil... |
speechtotext.py | #************************************************************************************************************************************************************************************
# Copyright (c) 2021 Tony L. Jones
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and a... |
analysis_subprocess.py | #####################################################################
# #
# /analysis_subprocess.py #
# #
# Copyright 2013, Monash University ... |
server.py | from random import randint
import socket
import threading
import pickle
import time
class Server:
def __init__(self,IP):
self.BUFFER = 1000000
self.serverSocket = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
try:
self.serverSocket.bind((IP,80))
except:
... |
counter_characteristic.py | from bikevr_sensor_controller.common.user_descriptor import UserDescriptor
from bikevr_sensor_controller.common.format_descriptor import FormatDescriptor
from bikevr_sensor_controller.common.tools import sint16, to_int
from bluezero import peripheral
from threading import Thread
from time import sleep
NAME = 'Test Cha... |
make.py | # coding: utf-8
from __future__ import print_function
import argparse
import multiprocessing
import os
import platform
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_v3'
current_decomp_data = '... |
hub.py | # coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------... |
messageFrame.py | # -*- coding:utf-8 -*-
from src.Client.Conf.config import *
from src.Client.MissionSystem import missionSystem
from src.Client.SystemTools.ConfFileRead import configFileRead
class MessageFrame():
"""
่ด่ดฃๆพ็คบ ๆพ็คบๅฝๆฅไปปๅกไฟกๆฏ็GUI็้ข๏ผไปฅๅ็จๆทๅฎๆไปปๅกไฟกๆฏ็ๅๅบใ
"""
def __init__(self, firstTabFrame=None):
"""
:... |
1.safe_kill_thread1.py | from time import sleep
from multiprocessing.dummy import threading
class ShutdownTask(object):
def __init__(self):
self.__running = True
def terminate(self):
self.__running = False
def run(self):
# ่ฝฎ่ฏขๆนๅผๅฟ
้กปๆ นๆฎไธๅกๆฅ๏ผไธ็ถๆฒกๆๆไน
while self.__running:
print("do something")... |
worker.py | import logging
import threading
import time
class Worker:
"""Worker Class
A class to execute periodic background tasks.
Args:
period : Worker period in seconds.
fcn : Function to execute every period.
args : Tuple with arguments for the given function.
name : Optional wor... |
MotorStages.py | #========================================
# Imports
#========================================
from __future__ import print_function
try:
from matplotlib import pyplot
except ImportError:
pyplot = None
from pipython import GCSDevice, pitools, datarectools
import multiprocessing as mp
import collections
from m... |
RestAPI.py | import eventlet
from flask import Flask, request, jsonify, session
from flask_sqlalchemy import SQLAlchemy
from flask_socketio import SocketIO, emit
from flask_httpauth import HTTPTokenAuth
from flask_login import current_user, LoginManager
import threading
from functools import wraps
from lxml import etree
from FreeTA... |
pyvenvex.py | #
# Copyright (C) 2013 Vinay Sajip. New BSD License.
#
import os
import os.path
from subprocess import Popen, PIPE
import sys
from threading import Thread
from urllib.parse import urlparse
from urllib.request import urlretrieve
import venv
class ExtendedEnvBuilder(venv.EnvBuilder):
"""
This builder installs se... |
rank.py | from typing import List, Dict, Union, Optional, Tuple, Any, Callable, ClassVar
import numpy
import threading
from loguru import logger
import asyncio
import functools
import aiohttp
import asyncio
import pickle
import requests
def server_wrapper(func):
"""Checks for a server at http://localhost:22647/. If there i... |
ServerMain.py | import tornado.web
import tornado.ioloop
import tornado.websocket
import os
import Handlers as WH
from networktables import NetworkTables
#import py networktables bindings
import pynetworktables2js.tornado_handlers as networkTablesToJS
from multiprocessing import Process, Queue
import RobotChecker as RC
#default rob... |
meter_test_utils.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 multiprocessing
import queue
import tempfile
import unittest
import torch
UPDATE_SIGNAL = 0
VALUE_SIGNAL = 1
... |
main_input.py | import re
import threading
import traceback
import queue
from core.db import get_db_connection
threading.stack_size(1024 * 512) # reduce vm size
class Input(dict):
def __init__(self, bot, conn, raw, prefix, command, params,
nick, user, host, paraml, msg):
chan = paraml[0].lower()
... |
test_deleter.py | import os
import time
import threading
from collections import namedtuple
import selfdrive.loggerd.deleter as deleter
from common.timeout import Timeout, TimeoutException
from loggerd_tests_common import UploaderTestCase
Stats = namedtuple("Stats", ['f_bavail', 'f_blocks'])
fake_stats = Stats(f_bavail=0, f_blocks=1... |
qianjianghangzhoufangchan.py | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import urllib
import urllib2
import re
import requests
from lxml import etree
#from bs4 import BeautifulSoup
import chardet
import xlwt
#from xlwt import *
import sys
import os
import traceback
import requests
import Queue
import time
import threading
myQueue = Queue.Queue... |
diayn_music.py | import gym
import argparse
from gym.envs.mujoco import HalfCheetahEnv
from gym.wrappers import FlattenObservation, FilterObservation
import rlkit.torch.pytorch_util as ptu
from rlkit.torch.sac.diayn.diayn_env_replay_buffer import DIAYNEnvReplayBuffer
from rlkit.envs.wrappers import NormalizedBoxEnv
from rlkit.launchers... |
smsflood.py | #-= It's just illusion =-#
import requests
from threading import Thread
import random
from termcolor import colored
print('''
\033[1;32m โโโโ โโโ\033[39mโ
\033[1;32m โโโโโ โโโโ\033[39mโโโโโ
\033[1;32m โโโโโโโโโโโ โโโโโโ\033[39mโ
\033[1;32m โโโโโโโโโโโ โโโ โโ โโ \033[39m ... |
brute.py | #!/usr/bin/python3
# coding=utf-8
#######################################################
# File : brute.py #
# Author : Raden #
# Github : https://github.com/afifrden7 #
# Python version : 3.9+ ... |
fortilog-pick.py | import argparse
import csv
import glob
import gzip
import sys
import tkinter as tk
import tkinter.ttk as ttk
import tkinter_plus as tkp
from collections import OrderedDict
from datetime import datetime as dt
from pathlib import Path
import threading
class LogFile():
''' logfile management class '''... |
pjf_testcase_server.py | """
The MIT License (MIT)
Copyright (c) 2016 Daniele Linguaglossa <d.linguaglossa@mseclab.com>
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 th... |
tracker.py | import os
import numpy as np
import math
import cv2
import onnxruntime
import time
import queue
import threading
import copy
from .similaritytransform import SimilarityTransform
from .retinaface import RetinaFaceDetector
from .remedian import remedian
def resolve(name):
f = os.path.join(os.path.dirname(__file__)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.