source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
coco_discover.py | import binascii
import select
import threading
import socket
import netifaces
from getmac import get_mac_address
class CoCoDiscover:
"""CoCoDiscover will help you discover NHC2.
It will also tell you about NHC1, but the result will differ.
You create CoCoDiscover, passing along a callback an the time you... |
vstream.py | import time
import configparser
import socket
from threading import Thread
import numpy as np
from PIL import Image
class RealCameraBase:
def __init__(self, resolution=(64,48), framerate=32):
from picamera import PiCamera
from picamera.array import PiRGBArray
self.camera = PiCamera()
... |
engine.py | """
"""
import logging
import smtplib
from abc import ABC
from datetime import datetime
from email.message import EmailMessage
from queue import Empty, Queue
from threading import Thread
from typing import Any, Sequence
from vnpy.event import Event, EventEngine
from .app import BaseApp
from .event import (
EVENT_... |
serverapfl.py | from flcore.clients.clientapfl import clientAPFL
from flcore.servers.serverbase import Server
from threading import Thread
class APFL(Server):
def __init__(self, args, times):
super().__init__(args, times)
# select slow clients
self.set_slow_clients()
self.set_clients(args, client... |
manager.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
# Copyright 2016 Howard Liu
#
# 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/LICEN... |
api_chess.py | """
Defines the process which will listen on the pipe for
an observation of the game state and return a prediction from the policy and
value network.
"""
from multiprocessing import connection, Pipe
from threading import Thread
import numpy as np
from chess_zero.config import Config
class ChessModelAPI:
"""
... |
article_list.py | '''
https://blog.csdn.net/xufive/phoenix/article/list/2
'''
import json
import threading
import time
import MySQLdb
import math
from utils import myutils
# 分库分表 500W分一次库
def sqlfkfb():
for x in range(1, 9):
database = "db_csdn_article_list_" + str(x)
table_list = "t_article_list_" + str(x)
... |
HChat.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2017 Alex Epstein
# 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 limitat... |
test_generator.py | import unittest
import zmq
import threading
import json
from CardenalGenerator.generator import CardenalGenerator
class MockServer(object):
def __init__(self,
command_port=6666,
command_poller_timeout=5):
self._context = zmq.Context()
self._command_socket = self... |
utils.py | import asyncio
from asyncio import TimeoutError
import atexit
import click
from collections import deque, OrderedDict, UserDict
from concurrent.futures import ThreadPoolExecutor, CancelledError # noqa: F401
from contextlib import contextmanager
import functools
from hashlib import md5
import html
import inspect
import... |
test_serialization.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... |
main.py | """
An example demonstrating a stand-alone "console".
Copyright (c) Jupyter Development Team.
Distributed under the terms of the Modified BSD License.
Example
-------
To run the example, make sure the Jupyter notebook server version 4.2+ is
installed.
- To build the JavaScript bundle: ``npm install && npm run build... |
tc_reader.py | from threading import Thread, Lock
from timecode import Timecode
from tcnetsync.tc_sync import secs_to_hms
from tcnetsync.tc_printer import TCPrinter
import time
class TcReader:
def __init__(self, sync, freeroll=5):
self.pos = 0
self.sync = sync
self.gen_thread = Thread(target=self.gen)
... |
test_fork1.py | """This test checks for correct fork() behavior.
"""
import _imp as imp
import os
import signal
import sys
import threading
import time
import unittest
from test.fork_wait import ForkWait
from test import support
# Skip test if fork does not exist.
support.get_attribute(os, 'fork')
class ForkTest... |
train_ug_ranking_pretrain.py | import tensorflow as tf
import numpy as np
import time
import datetime
import os
import network_pretrain_rank as network
import json
from sklearn.metrics import average_precision_score
import sys
import ctypes
import threading
from kg_dataset_transe import KnowledgeGraph
export_path = "../biomedical_part1/"
export_pat... |
store.py | import datetime
import json
import threading
import uuid
from collections import defaultdict
from copy import deepcopy
from dictdiffer import diff
from inspect import signature
from threading import Lock
from pathlib import Path
from tzlocal import get_localzone
from .logger import logger
from .settings import CACHE_... |
arena.py | import time
import numpy as np
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
import torch.optim as optim
from torch.multiprocessing import Manager, Process, set_start_method
from tictactoe_gpu import TicTacToe
from alphazero import AZAgent, arena
from replay_buffer impo... |
sender.py | import logging
import multiprocessing
import os
from proton import Message
from proton.handlers import MessagingHandler
from proton.reactor import Container
import common
"""
This AMQP sender application, sends one message, with a pre-defined
body and properties sizes, every `interval_delay` (or CLIENT_INTERVAL_SECO... |
ingester.py | import time
from logbook import Logger
import multiprocessing
from catalyst.exchange.exchange_bundle import ExchangeBundle
from rq import Connection, Worker
import pandas as pd
import redis
from kryptos import logger_group
from kryptos.settings import REDIS_HOST, REDIS_PORT
CONN = redis.Redis(host=REDIS_HOST, port=R... |
proxyip.py | # *-* coding:utf-8 *-*
import requests
from bs4 import BeautifulSoup
import lxml
from multiprocessing import Process, Queue
import random
import json
import time
class Proxies(object):
"""docstring for Proxies"""
def __init__(self, page=3):
self.proxies = []
self.verify_pro = []
self.... |
val.py | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Validate a trained YOLOv5 model accuracy on a custom dataset
Usage:
$ python path/to/val.py --weights yolov5s.pt --data coco128.yaml --img 640
Usage - formats:
$ python path/to/val.py --weights yolov5s.pt # PyTorch
... |
bt3.py | #!python3
# Copyright (c) 2016 DeKrijger Engineering
#
# 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, modif... |
test_partition_20.py | from os import name
import threading
import pytest
from base.partition_wrapper import ApiPartitionWrapper
from base.client_base import TestcaseBase
from common import common_func as cf
from common import common_type as ct
from common.common_type import CaseLabel, CheckTasks
from common.code_mapping import PartitionErr... |
utils.py | import datetime
import sys
import importlib
import os
import yaml
import json
import pickle
import datetime
import subprocess
import os
from os.path import join
import signal
import math
import random
import socket
import errno
import urllib
import time
from os import listdir
from os.path import dirname, join, abspath
... |
statistic.py | import threading
import time
from datetime import datetime
from rich import box
from rich.live import Live
from rich.table import Table
from ripper.context import Context, ErrorCodes, Errors
from ripper.constants import *
from ripper.health_check import get_health_status
import ripper.common as common
import ripper.... |
server.py | #!/usr/bin/env python3
import os
import threading
from http.server import BaseHTTPRequestHandler, HTTPServer
from cgi import FieldStorage
from .arguments import args
from .logger import logger
from . import forms
from . import redirection
success_count = 0
failure_count = 0
class ReCaptchaRequestHandler(BaseHTTPReq... |
gen_protos.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... |
test_models.py | import itertools
import threading
import unittest2
from nose.tools import *
from gutter.client.arguments import Container as BaseArgument
from gutter.client import arguments
from gutter.client.models import Switch, Manager, Condition
from durabledict import MemoryDict
from durabledict.base import DurableDict
from gutt... |
test_example.py | import pytest
import threading
from stub.test_pb2 import EchoRequest, Empty
@pytest.fixture(scope='module')
def grpc_add_to_server():
from stub.test_pb2_grpc import add_EchoServiceServicer_to_server
return add_EchoServiceServicer_to_server
@pytest.fixture(scope='module')
def grpc_servicer():
from serv... |
engine.py | import copy
import json
import os
import platform
import queue
import shlex
import subprocess
import threading
import time
import traceback
from typing import Callable, Dict, List, Optional
from kivy.utils import platform as kivy_platform
from katrain.core.constants import (
OUTPUT_DEBUG,
OUTPUT_ERROR,
OU... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
hub.py | # -*- coding: utf-8 -*-
"""An event hub that supports sockets and timers, based on Python 2.6's select & epoll support."""
import select
try:
import pyev
except:
have_libev = False
else:
have_libev = True
import errno
import fcntl
import os
import signal
import threading
from collections import deque, ... |
oldtest.py | '''
DISTRIBUTION STATEMENT A. Approved for public release: distribution unlimited.
This material is based upon work supported by the Assistant Secretary of Defense for
Research and Engineering under Air Force Contract No. FA8721-05-C-0002 and/or
FA8702-15-D-0001. Any opinions, findings, conclusions or recommendation... |
example.py | '''This example shows how to use some of the features of libhoney in python'''
import datetime
import libhoney
import signal
import threading
writekey = "abcabc123123defdef456456"
dataset = "factorial"
def factorial(n):
if n < 0:
return -1 * factorial(abs(n))
if n == 0:
return 1
return n... |
server.py | from collections import deque
from multiprocessing import Process
import json
import logging
import socket
import struct
import cv2
import numpy as np
from gaze_predictor import GazePredictor
# Length of the buffer we use for reading data.
READ_BUFFER_LENGTH = 8192
# The JPEG magic at the start and end of each fra... |
metaserver.py | #!/usr/bin/env python
"""
Author: David Wolinsky
Version: 0.03
Description:
The XmlRpc API for this library is:
get(base64 key)
Returns the value associated with the given key using a dictionary
or an empty dictionary if there is no matching key
Example usage:
rv = rpc.get(Binary("key"))
pr... |
run_server.py | import socket
from threading import Thread
import sys
from time import sleep
import os
s = None
kill = False
hist = []
sender_h = []
def refresh():
prev_sender = ""
os.system('cls' if os.name == 'nt' else 'clear')
print("Connected to IP: " + addr[0] + ":" + str(addr[1]))
print("_________________________... |
simulator.py | import time
from typing import List, Dict
import threading
from contxt.utils.config import load_config_class_from_file, ContxtEnvironmentConfig
from contxt.utils.contxt_environment import ContxtEnvironment
from contxt.services.control.control import ControlService
from dataclasses import dataclass
from contxt.utils.c... |
main_ard.py | #!/usr/bin/env python3
# main_ard.py - the main file for measuring Boltzmann constant experiment (with Arduino)
#
# Created by Jerry Yan
#
# Some code excerpted from Physics 13BH/CS15B
import util
import sys
import time
import math
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import numpy... |
test_callbacks.py | import os
import multiprocessing
import numpy as np
import pytest
from csv import Sniffer
import shutil
from keras import optimizers
from keras import initializers
from keras import callbacks
from keras.models import Sequential
from keras.layers.core import Dense, Dropout
from keras.layers.convolutional import Conv2D
... |
thread.py | # Copyright 2017, Google LLC All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
slider_box.py | '''
Simple python script to sample the MiM slider box data via USB
Thomas FLAYOLS - LAAS CNRS
Use:
To display data, run "python slider_box.py"
'''
import serial
import time
from copy import deepcopy
from multiprocessing import Process
from multiprocessing.sharedctypes import Value
from ctypes import c_double, c_bool
... |
lambda_executors.py | import os
import re
import sys
import glob
import json
import time
import logging
import threading
import traceback
import subprocess
import six
import base64
from multiprocessing import Process, Queue
try:
from shlex import quote as cmd_quote
except ImportError:
from pipes import quote as cmd_quote # for Pyth... |
controller.py | import multiprocessing
import os
import threading
import signal
import logging
from datetime import datetime, timedelta
from time import sleep
import click
log = logging.getLogger('pyFx')
class IntervalClock(object):
def __init__(self, interval):
self.interval = interval
def __iter__(self):
... |
automated_run.py | # ===============================================================================
# Copyright 2011 Jake Ross
#
# 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... |
RR_Thread.py | # Round-Robin com thread
from collections import deque, defaultdict
import threading
from threading import Thread
import time
from time import sleep
import random
def my_xrange(i, job_id):
cur = 0
while cur < i:
yield cur
cur+=1
class Job(object):
def __init__(self, job_func, kwargs, job_Prioridade, job_id... |
demo1.py | """
2019/12/08 14:28
140.【Python多任务编程】multiprocessing多进程编程
"""
"""
multiprocessing模块介绍:
multiprocessing提供了一个Process类创建进程.
获取进程号:
os模块:
getpid(): 获取当前进程的进程号
getppid(): 这个进程的父进程的进程号
"""
from multiprocessing import Process
import os
def zhiliao():
print('===子进程开始===')
print('zhiliao process')
print('子进程ID... |
main.py | import atexit
import os
import re
import sys
import threading
import time
import traceback
import yaml
import requests
import datetime
@atexit.register
def _end():
end_time = time.time()
print(to_log("INFO", "执行结束", "执行耗时{:.3f}s".format(end_time - start_time)))
def get_shopid():
"""
获取 shopid, 如果网... |
manager.py | # Ant-FS
#
# Copyright (c) 2012, Gustav Tiger <gustav@tiger.name>
#
# 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... |
test_kernel.py | # coding: utf-8
"""test the IPython Kernel"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import io
import os.path
import sys
import time
import nose.tools as nt
from IPython.testing import decorators as dec, tools as tt
from ipython_genutils import py3compat... |
parallel_processor.py | """
This module is designed for breaking the restriction of Python Global Interpreter Lock (GIL): It uses multi-processing (compute-intensive operations) and multi-threading (return data collecting) to accelerate computing.
Once it's initialized, it creates a sub process pool, all the added data will be dispatched to d... |
equipment_alarm_warn_redis.py | # encoding: utf-8
import datetime
import json
import logging
import threading
import time
from logging.handlers import TimedRotatingFileHandler
from queue import Queue
import psycopg2.extras
import redis
import requests
from influxdb import InfluxDBClient
def getLogger(fileName: str, name='mylogger', level=logging.D... |
map_stage_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... |
somaNum.py | import sys
import os
from multiprocessing import Process, Value
lista = []
lista.append(int(sys.argv[1]))
lista.append(int(sys.argv[2]))
lista.append(int(sys.argv[3]))
lista.append(int(sys.argv[4]))
lista.append(int(sys.argv[5]))
soma = Value("i", 0)
def func_soma():
global soma
soma.value = sum(lista)
p... |
server_udp.py | # coding:utf-8
'''
UDP服务端,等待客户端的连接。
有连接呼入时接收文件并保存。
'''
import os, threading, json, asyncio, hashlib, random
def display_file_length(file_size):
'''格式化文件长度'''
if file_size < 1024:
return '{0:.1f}B'.format(file_size)
elif 1024 <= file_size < 1048576:
return '{0:.1f}kB'.format(file_size/1024)
... |
message_server.py | from concurrent.futures import thread
import socket
import sys
from rc4 import enc, dec
from rsa import *
from Crypto.Util.number import *
import threading
import os
from message_threads import *
def recieve_msg(conn, key):
while True:
msgRcv = conn.recv(1024)
if msgRcv != b'':
msg = d... |
__main__.py | import threading
import sys
import os
import platform
import subprocess
import json
import time
import datetime
import netifaces
if os.name != 'nt':
from pick import pick
import click
from howmanypeoplearearound.oui import *
from howmanypeoplearearound.analysis import *
def which(program):
"""Determines whe... |
magic-entrypoint.py | #!/usr/bin/env python3
import logging
import os
import random
import sys
import subprocess, threading, signal
from dns.resolver import Resolver
logging.root.setLevel(logging.INFO)
LISTENS = os.environ.get("LISTEN", ":100").split()
NAMESERVERS = os.environ.get("NAMESERVERS", "208.67.222.222 8.8.8.8 208.67.220.220 8.... |
appClasses.py | from email.mime import audio
import pyshark
import time
import threading
import yaml
import metrics
import matplotlib.pyplot as plt
from flask import Flask , request
from flask_cors import CORS
from flask_socketio import SocketIO, send
from metrics import BandWidth, Loss, Jitter , VideoLoss , InterArrivalJitterAudio, D... |
endless_dungeon_driver.py | from stormAPI import *
import time
from threading import Thread
from prompt_toolkit import HTML, print_formatted_text
from prompt_toolkit.styles import Style
import sys
import os
try:
driver = stormAPI().register_window()
wx, wy = driver.get_window_rect()[:2]
ROUND_COUNT = 0
print = print_formatted_te... |
multiple-chat-app-server.py | # Start Date: 3/9/2021
# Finished Date: 3/9/2021
# Author: Lucifer 14
# App Name: Chat App (Multi Client)
# Version: CLI Version 1.0
# Type: Server
import socket
import random
import threading
connection_list=[]
# generates random portnumber for client
def random_port_generator(address):
result_of... |
solve_cartpole_sb3_ppo_cnn.py | #!/usr/bin/env python3
import time
import tqdm
import shutil
import datetime
import os.path
import torch as th
import os
from pyvirtualdisplay import Display
import inspect
from typing import Optional, Union, List, Tuple, Dict, Type, Any
import argparse
from stable_baselines3.ppo import CnnPolicy
from stable_baseline... |
multithreaded_web_browser.py | import threading
import time
from queue import Queue
import requests
def make_request(url):
"""Makes a web request, prints the thread name, URL, and
response code.
"""
resp = requests.get(url)
with print_lock:
print("Thread name: {}".format(threading.current_thread().name))
print("U... |
test_etcd3.py | """
Tests for `etcd3` module.
----------------------------------
"""
import base64
import contextlib
import json
import os
import signal
import string
import subprocess
import tempfile
import threading
import time
import grpc
from hypothesis import given, settings
from hypothesis.strategies import characters
impor... |
proxy_list.py | import os
import time
import random
import requests
from queue import Queue
from importlib import import_module
from threading import Thread, Timer
from .utilities import selector_is_valid
default_url = 'https://example.org/'
default_timeout = 10
default_check_interval = 0.03
default_parsers = []
for file in os.lis... |
test_functools.py | import abc
import builtins
import collections
import collections.abc
import copy
from itertools import permutations
import pickle
from random import choice
import sys
from test import support
import threading
import time
import typing
import unittest
import unittest.mock
import os
import weakref
import gc
from weakref ... |
client_config.py | # -*- coding: utf-8 -*-
################################################################################
# Copyright (c) 2017 McAfee Inc. - All Rights Reserved.
################################################################################
import logging
import threading
from Queue import Queue
import os.path as path... |
calculator.py | #!/usr/bin/env python3
import sys
from multiprocessing import Queue,Process,Lock
class Config(object):
def __init__(self,configfile):
self._configfile = configfile
@property
def config(self):
config = {}
with open(self._configfile,'r') as file:
for line in file:
... |
linkcheck.py | # -*- coding: utf-8 -*-
"""
sphinx.builders.linkcheck
~~~~~~~~~~~~~~~~~~~~~~~~~
The CheckExternalLinksBuilder class.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import sys
import Queue
import socket
import threading
from o... |
worker.py | import logging
import os
import shutil
from subprocess import PIPE, Popen
import threading
import time
import traceback
import socket
import http.client
import sys
from typing import Optional, Set, Dict
import psutil
import docker
import codalab.worker.docker_utils as docker_utils
from .bundle_service_client import ... |
snippet.py | import sys
from gevent import server
from gevent.baseserver import _tcp_listener
from gevent import pywsgi
from gevent.monkey import patch_all; patch_all()
from multiprocessing import Process, current_process, cpu_count
def hello_world(env, start_response):
if env['PATH_INFO'] == '/':
start_response('200 O... |
ServerWalle.py | import socket
import bluetooth
import threading
class ServerWalle:
def __init__(self,host,port):
self.host = host
self.port = port
self.bt_address = '00:15:FF:F3:E2:09'
self.bt_port = 1
self.buff_bt = 1024
self.buff_sock = 1024
self.run_thread = True
... |
ioloop_manager.py | # Copyright 2014 National Research Foundation (South African Radio Astronomy Observatory)
# BSD license - see LICENSE for details
from __future__ import absolute_import, division, print_function
from future import standard_library
standard_library.install_aliases() # noqa: E402
import logging
import sys
import textwr... |
interface.py | #!/usr/bin/python3 -OO
# Copyright 2007-2020 The SABnzbd-Team <team@sabnzbd.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any late... |
stats.py | import os
import threading
import time
from typing import TYPE_CHECKING
import psutil
import pynvml
if TYPE_CHECKING:
from manta_lab.sdk.interface.interface import Interface
# TODO: add vendor pandas?
# TODO: track gpu per process
# TODO: add thread
# WARNING: DO NOT CHANGE THIS VALUE, SERVER WIL... |
shapeChange.py | import tkinter as tk # library for simple graphical interfaces
from PIL import Image, ImageTk
import numpy as np # maths library
import threading # multi-tasking library
import time # library for timing
import RPi.GPIO as GPIO # raspberry pi IO library
import addapy # python wrapper for waveshare drivers
from ad... |
eynollah.py | # pylint: disable=no-member,invalid-name,line-too-long,missing-function-docstring,missing-class-docstring,too-many-branches
# pylint: disable=too-many-locals,wrong-import-position,too-many-lines,too-many-statements,chained-comparison,fixme,broad-except,c-extension-no-member
# pylint: disable=too-many-public-methods,too... |
demo.py | import sys
import pdb
import pygame
from pygame import display
from pygame.draw import *
import scipy
import time
from phosphene import audio, util, signalutil, signal
from phosphene.graphs import barGraph, boopGraph, graphsGraphs
from threading import Thread
if len(sys.argv) < 2:
print "Usage: %s file.mp3" % sy... |
__init__.py | import logging
import sys
from threading import Thread,Lock
import time
__all__ = ['Field', 'All', 'Every', 'Int', 'List', 'Job', 'Scheduler']
__version__ = '0.1.0'
class Field(object):
def __init__(self, param):
self.param = param
def __repr__(self):
return 'cron.Field(' + repr(self.para... |
server.py | #!/usr/bin/env python
"""
Dummy server used for unit testing.
"""
from __future__ import print_function
import errno
import logging
import os
import random
import string
import sys
import threading
import socket
from tornado.platform.auto import set_close_exec
import tornado.wsgi
import tornado.httpserver
import tor... |
client_bomber_ex.py | import socket
import threading as thread
def request():
socket_instance = socket.socket()
socket_instance.connect(("localhost", 9999))
message = "+|200|100"
socket_instance.send(message.encode())
result = socket_instance.recv(1024).decode("utf-8")
print("Result: ", result)
if name == "__main__":
while True:
... |
score_syncnet.py |
import pandas as pd
import json
import os
from datetime import datetime, timedelta
import seaborn as sns
from math import cos, sin
import matplotlib.pyplot as plt
import numpy as np
import math
from threading import Thread
from sklearn.metrics import (
confusion_matrix,
classification_report,
roc_auc_sc... |
__init__.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# 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 ... |
yap_tools.py | #!/usr/bin/env python
"""
Copyright 2014 Novartis Institutes for Biomedical Research
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 ... |
test_event_log.py | import multiprocessing
import os
import sys
import time
import traceback
from contextlib import contextmanager
import pytest
import sqlalchemy
from dagster import seven
from dagster.core.events import DagsterEvent, DagsterEventType, EngineEventData
from dagster.core.events.log import DagsterEventRecord
from dagster.c... |
train.py | # --------------------------------------------------------
# FCN
# Copyright (c) 2016 RSE at UW
# Licensed under The MIT License [see LICENSE for details]
# Written by Yu Xiang
# --------------------------------------------------------
"""Train a FCN"""
from fcn.config import cfg
from gt_data_layer.layer import GtDat... |
launch.py | # Lint as: python3
# Copyright 2020 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... |
wgen.py | import logging
import time
from multiprocessing import Process, Value, Lock, Event
from numpy import random
from twisted.internet import reactor
from decorator import decorator
from logger import logger
from dcp import DcpClient, ResponseHandler
from couchbase.n1ql import MutationState
from couchbase.n1ql import N1QL... |
mail_bomber.py | import smtplib
from threading import Thread
banner = """
__ __ __ __
/ |/ | / | / |
_____ ____ ______ $$/ $$ | $$ |____ ______... |
node.py | import binascii
import shelve
import socket
import random
from pycoin.tx import Tx #remove this
from io import BytesIO
from threading import Thread, Lock, Timer
from . import clients
from . import networks
from . import serializers
from . import log
from . import storage
MAX_CLIENT_FAILURES = 5
class NodeClient (clie... |
pyqt_inter_video.py | # -*- coding: utf-8 -*-
"""
Created on Mon Apr 27 07:52:16 2020
@author: Ampofo
"""
import os
import threading
from random import randrange
from time import sleep, time
# Just in case user won't need it
try:
import cv2
except:
pass
from PyQt5.QtCore import pyqtProperty, pyqtSlot, pyqtSignal
from PyQt5.QtQuic... |
reports.py | import sys, traceback
from network import getSocket, serialNumber
from signal import pause
from time import sleep
from threading import Thread
def subscribeReportCheckList(updateList):
def callback(_id, data):
try:
checkList = data['payload']['data']['report_check_list']['items']
updateList(... |
log.py | # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""Utility classes for logging the output of blocks of code.
"""
from __future__ import unicode_literals
import multiproc... |
Package.py | import os, sys, copy, shutil, subprocess, shlex
import time
import datetime
import socket
from threading import Thread
import sconsconfig.utils as utils
from sconsconfig.utils import conv
from SCons.Variables import BoolVariable
## Backup a list of environment variables.
# @param[in] env An SCons environment.
# @param... |
speedtest_runner.py | import schedule
import sys
import logging
import time
import os
import mysql.connector
from mysql.connector import Error as MySQLError
from speedtest import Speedtest
from threading import Thread
from dotenv import load_dotenv
load_dotenv()
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(lev... |
single_thread_flow.py | # Copyright (c) 2017, 2018 Jae-jun Kang
# See the file LICENSE for details.
from threading import Thread
from x2py.builtin_events import *
from x2py.event import EventProxy
from x2py.flow import Flow
from x2py.flows.event_based_flow import EventBasedFlow
from x2py.util.trace import Trace
class SingleThreadFlow(Event... |
cleanup.py | import tempfile
import argparse
import logging
import datetime
import threading
import os
import re
from botocore.exceptions import ClientError
from ocs_ci.framework import config
from ocs_ci.ocs.constants import CLEANUP_YAML, TEMPLATE_CLEANUP_DIR
from ocs_ci.utility.utils import get_openshift_installer, destroy_clus... |
server.py | #!/usr/bin/env python3
import bluetooth
import subprocess
import threading
import cv2
import time
import board
from adafruit_motorkit import MotorKit
def fil_video():
while True:
server_sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
server_sock.bind(("", bluetooth.PORT_ANY))
server_so... |
train.py | #!/usr/bin/env python
import os
import json
import tensorflow.contrib.slim as slim
import datetime
import random
import time
import argparse
import os
import threading
from scipy import misc
import tensorflow as tf
import numpy as np
from distutils.version import LooseVersion
if LooseVersion(tf.__version__) >= LooseVe... |
__main__.py | from pathlib import Path
from argparse import ArgumentParser
import logging
from threading import Thread
from .application import client
from .config import Config
from .db import initialize_db
from .httpserver import run_webserver
arguments = ArgumentParser()
arguments.add_argument("-c", "--configfile", type=str, he... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.