source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
kafka_msg_handler.py | #
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""Kafka message handler."""
import itertools
import json
import logging
import os
import re
import shutil
import tempfile
import threading
import time
import traceback
from tarfile import ReadError
from tarfile import TarFile
import requests
from... |
DataExtractor.py | #!python
# Extract the useful data from game files (json)
# Append the useful data to a csv file
import pickle
import os
import queue
import sys
from collections import OrderedDict
import multiprocessing
from multiprocessing.managers import BaseManager, NamespaceProxy
import time
import Modes
import pandas as pd
from ... |
padding_fifo_queue_test.py | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
test_connect_attempts.py | '''
Test Origin Server Connect Attempts
'''
# 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 Lice... |
runner.py | # From Kami: https://raw.github.com/Kami/parallel-django-and-twisted-test-runner/master/runner.py
import sys
import time
import logging
import multiprocessing
from multiprocessing import Process, Queue, Event
from Queue import Empty
from django.test.simple import DjangoTestSuiteRunner, DjangoTestRunner
from django.db... |
preprocess.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 29 14:47:42 2016
@author: tomas
"""
import os
import json
import string
from Queue import Queue
from threading import Thread, Lock
import argparse
from math import floor
import h5py
import numpy as np
from skimage.io import imread
from skimage.col... |
process.py | from multiprocessing import Process, Queue
from promise import Promise
from .utils import process
def queue_process(q):
promise, fn, args, kwargs = q.get()
process(promise, fn, args, kwargs)
class ProcessExecutor(object):
def __init__(self):
self.processes = []
self.q = Queue()
de... |
broadcastServer.py | # simple server for receiving udp packets
# only purpose is to test functionality manually
# large chunk copied off some online tutorial
import socket
import socket
def do_some_stuffs_with_input(input_string):
"""
This is where all the processing happens.
Let's just read the string backwards
"""
... |
3_exam.py | import threading
from threading import Lock
# main function
def print_ln(lk, number, text):
lk.acquire()
print(f'{number}||{text}')
lk.release()
def main():
# Создаем блокиратор потока
lk = Lock()
# Создаем поток и передаем ему функцию для исполнения и аргументы
# Обозначаем поток как де... |
jobber.py | import itertools
import numpy as np
import json
import scipy.special as scs
import multiprocessing as mp
def group_cost(combinations):
cost = 0
for case in combinations:
cost += np.prod([configuration_count(c) for c in case])
return cost
def combinations_in_group(T, R):
combinations = []
... |
SnakeServer.py | import socket
import pickle
import random
import threading
import sys
from PyQt5.QtWidgets import *
from PyQt5.QtCore import Qt
def get_ip():
try:
h_name = socket.gethostname()
IP = socket.gethostbyname(h_name)
except Exception:
IP = '127.0.0.1'
return IP
class SnakeServer:
de... |
main.py | """
mlperf inference benchmarking tool
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import array
import collections
import json
import logging
import os
import sys
import threading
import time
from queue import Queue
import mlperf_l... |
files.py | # Copyright 2017 Google 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 writing, ... |
basic_mapping.py | import uuid, datetime, multiprocessing
import pandas as pd
from functree import app, constants, models, tree, analysis, services
def from_table(form):
methods=['mean', 'sum']
if form.modulecoverage.data and services.DefinitionService.has_definition(form.target.data):
methods.append('modulecoverage')
... |
dabam_height_profile.py | import sys
import time
import numpy
import threading
from PyQt5.QtCore import QRect, Qt
from PyQt5.QtWidgets import QApplication, QMessageBox, QScrollArea, QTableWidget, QTableWidgetItem, QHeaderView, QAbstractItemView, QWidget, QLabel, QSizePolicy
from PyQt5.QtGui import QTextCursor,QFont, QPalette, QColor, QPainter,... |
__init__.py | from threading import Thread
import __orange__ as API
import GTAOrange.player as Player
import GTAOrange.vehicle as Vehicle
import GTAOrange.blip as Blip
import GTAOrange.text as Text
import GTAOrange.marker as Marker
import GTAOrange.object as Object
def _sendPlayerList(target):
players = Player.getAll()
ta... |
installwizard.py |
from functools import partial
import threading
import os
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import ObjectProperty, StringProperty, OptionProperty
from kivy.core.window import Window
from kivy.uix.button import Button
from kivy.uix.togglebutton impo... |
test_consume.py | # -*- coding: utf-8 -*-
# @Author : ydf
# @Time : 2019/8/8 0008 14:57
from multiprocessing import Process
import time
from funboost import get_consumer, get_publisher, AbstractConsumer
from funboost.consumers.redis_consumer import RedisConsumer
from funboost.utils import LogManager
logger = LogManager('complex_e... |
process_data_shared_ctypes.py | """ process data """
import multiprocessing as mp
from multiprocessing.sharedctypes import Synchronized
def increment_process_count(process_count: Synchronized):
""" inc process cnt """
with process_count.get_lock():
process_count.value += 1
print(process_count.value)
def run():
proces... |
conftest.py | import logging
import os
import random
import time
import tempfile
import threading
from concurrent.futures.thread import ThreadPoolExecutor
from datetime import datetime
from math import floor
from shutil import copyfile
from functools import partial
from botocore.exceptions import ClientError
import pytest
from ocs... |
stats_server.py | #!/usr/bin/env python
"""Stats server implementation."""
import BaseHTTPServer
import collections
import json
import socket
import threading
import logging
from grr.lib import config_lib
from grr.lib import registry
from grr.lib import stats
from grr.lib import utils
def _JSONMetricValue(metric_info, value):
... |
__init__.py | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Logging utils
"""
import warnings
from threading import Thread
import torch
from torch.utils.tensorboard import SummaryWriter
from utils.general import colorstr, emojis
# from utils.loggers.wandb.wandb_utils import WandbLogger
from utils.plots import plot_images, plot_... |
services.py | #
# Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v1.0 which accompanies this distribution,
# and is available at http://www.eclipse.org/legal/epl-v10.html
import sys
import soc... |
common_utils.py | r"""Importing this file must **not** initialize CUDA context. test_distributed
relies on this assumption to properly run. This means that when this is imported
no CUDA calls shall be made, including torch.cuda.device_count(), etc.
torch.testing._internal.common_cuda.py can freely initialize CUDA context when imported.... |
data_set_helpers.py |
import pandas
import tensorflow as tf
from threading import Thread
from math import ceil
from six.moves import range
from util.audio import audiofile_to_input_vector
from util.gpu import get_available_gpus
from util.text import ctc_label_dense_to_sparse, text_to_char_array
class DataSets(object):
def __init__(se... |
test_web_backtest.py | #!usr/bin/env python3
#-*- coding:utf-8 -*-
"""
@author: yanqiong
@file: test_web.py
@create_on: 2020/2/12
@description: "Users/yanqiong/Documents/geckodriver-v0.26.0-macos.tar.gz"
"""
import os
import sys
import time
import unittest
import multiprocessing as mp
from selenium import webdriver
from selenium.webdriver.fi... |
NonSSL.py | #!/bin/env python3
'''
'''
# 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 ... |
new_mega_account.py | # fork of https://github.com/IceWreck/MegaScripts
# Create New Mega Accounts
# saves credentials to a file called accounts.csv
import requests
import subprocess
import time
import re
import random
import string
import threading
EMAIL_LENGTH = 16
MINIMUM_PASSWORD_LENGTH = 32
ACCOUNT_TO_GENERATE = int(input("Insert how... |
scanner.py |
#!/usr/bin/python
import socket
import struct
import os
import threading
import time
from ctypes import *
from optparse import OptionParser
from netaddr import IPNetwork, IPAddress
HELP = """\
Sniffer reads a single package decodes the IP Layer and prints it out.
"""
magic_message ="Ad Astra!"
g_verbose = True
cla... |
compaction_handler.py | # !/usr/bin/python
# Copyright 2011 Lockheed Martin
'''
View Compaction class.
Created on August 31, 2011
@author: jklo
'''
import logging
import json
import base64
import urllib2
import multiprocessing
from lr.lib.couch_change_monitor.base_change_threshold_handler import BaseChangeThresholdHandler
log = logging.get... |
qt.py | #!/usr/bin/env python
#
# Electrum - Lightweight Bitcoin Client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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... |
utils.py | # 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 ipaddress
import random
import re
import socket
import time
import weakref
from datetime impor... |
workload_D.py | """
This workload presents a simple interface that can be reused in other workloads.
It summary, it runs several subprocesses using the multiprocessing package,
makes the connections between them, and then starts working.
This particular workload spawns NETWORK_SIZE machines, NUM_PROPOSERS of which are
proposers. We ... |
monitor.py | import os
import time
import threading
class MonitoredLogFile(object):
MAX_LINES_TO_READ = 10
def __init__(self, path, prefix):
self._path = str(path)
self._prefix = str(prefix)
self._offset = 0
def update(self):
# skip over when the log file has not been made yet
... |
barista.py | from utils import json_config
import msgpack
from threading import Thread
import Queue
import time
from cookbook_manager import CookbookManager
from cookbook import Cookbook
from process.process import Point
from process.process import Command
from process.process import Process
from printer_server import PrinterSe... |
loading.py | ###################
## ANAK BABI KAU ##
###################
## WARNA ASU #####
P = '\x1b[1;97m' # PUTIH
M = '\x1b[1;91m' # MERAH
H = '\x1b[1;92m' # HIJAU
K = '\x1b[1;93m' # KUNING
B = '\x1b[1;94m' # BIRU
U = '\x1b[1;95m' # UNGU
O = '\x1b[1;96m' # BIRU MUDA
N = '\x1b[0m' # WARNA MATI
##################
#... |
test__semaphore.py | ###
# This file is test__semaphore.py only for organization purposes.
# The public API,
# and the *only* correct place to import Semaphore --- even in tests ---
# is ``gevent.lock``, never ``gevent._semaphore``.
##
from __future__ import print_function
from __future__ import absolute_import
import weakref
import geve... |
mywindows.py | import Tkinter as tk
import fileinput
from PIL import Image, ImageTk
import pyaudio
import wave
import threading
import socket
import client as cl
fname = 'records/' # this variable take part in forming file name of record
chosen_var = '1' # default variant is '1'
timer_listsec = [5, 90, 90] # there are t... |
test_gc.py | import unittest
from test.support import (verbose, refcount_test, run_unittest,
strip_python_stderr, cpython_only, start_threads,
temp_dir, requires_type_collecting)
from test.support.script_helper import assert_python_ok, make_script
import sys
import time
import gc... |
lcdDisplay.py | #!/usr/bin/env python
import lcddriver
from time import *
import pika
import sys
from threading import Thread
import threading
import time
import logging
import os
lcd = None
rabbitMqHost = os.environ['RABBIT_MQ_HOST']
rabbitMqQueue = os.environ['RABBIT_MQ_QUEUE']
demoMode = eval(os.environ.get('DEMO_MODE', False))... |
ssh_cpython_backend.py | """Intermediate process for communicating with the remote Python via SSH"""
import os.path
import sys
import threading
from threading import Thread
import thonny
from thonny.backend import (
SshMixin,
BaseBackend,
interrupt_local_process,
RemoteProcess,
ensure_posix_directory,
)
from thonny.common ... |
app.py | #!/usr/bin/env python
# encoding: utf-8
"""
@author: Shanda Lau 刘祥德
@license: (C) Copyright 2019-now, Node Supply Chain Manager Corporation Limited.
@contact: shandalaulv@gmail.com
@software:
@file: __init__.py.py
@time: 2020/8/8 16:11
@version 1.0
@descwerkzeug:
"""
from workers import create_mast_worker, create_dist_... |
Code-07-Advance_Official_ThreadName_ParllelExec.py | '''
DEVELOPER NAME : BALAVIGNESH.M
IMPLEMENTED DATE: 16-11-2018
'''
import threading
import time
class serviceThread:
@staticmethod
def serviceThreadName():
print(threading.currentThread().getName(),'Starting....')
time.sleep(2)
print(threading.currentThread().getName(),'Exiting....')... |
context.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
sudos.py | import asyncio
import html
import io
import os
import re
import sys
import traceback
import humanfriendly
import time
from contextlib import redirect_stdout
from typing import Union
import speedtest
from meval import meval
from pyrogram import (
Client,
filters,
__version__ as pyrogram_version,
)
from pyro... |
android.py | #!/usr/bin/python
# Copyright 2017 Google 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 agre... |
pymmw.py | #!/bin/sh
'''which' python3 > /dev/null && exec python3 "$0" "$@" || exec python "$0" "$@"
'''
#
# Copyright (c) 2018, Manfred Constapel
# This file is licensed under the terms of the MIT license.
#
#
# goto pymmw
#
import os
import sys
import glob
import serial
import threading
import json
import argparse
import s... |
conftest.py | """Fixtures and setup / teardown functions
Tasks:
1. setup test database before starting the tests
2. delete test database after running the tests
"""
import os
import copy
import random
from collections import namedtuple
from logging import getLogger
from logging.config import dictConfig
import pytest
from pymongo ... |
test_pdb.py | # A test suite for pdb; not very comprehensive at the moment.
import doctest
import os
import pdb
import sys
import types
import codecs
import unittest
import subprocess
import textwrap
from contextlib import ExitStack
from io import StringIO
from test import support
# This little helper class is essential for testin... |
worker.py | from contextlib import contextmanager
import atexit
import faulthandler
import hashlib
import inspect
import io
import json
import logging
import os
import redis
import sys
import threading
import time
import traceback
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
# Ray modules
from ra... |
logging.py | """Cyberjunky's 3Commas bot helpers."""
import json
import logging
import os
import queue
import threading
import time
from logging.handlers import TimedRotatingFileHandler as _TimedRotatingFileHandler
import apprise
class NotificationHandler:
"""Notification class."""
def __init__(self, program, enabled=Fa... |
mergebot.py | #!/usr/bin/python
"""Mergebot is a program which merges approved SCM changes into a master repo.
"""
import glob
from multiprocessing import Pipe, Process
from time import sleep
import signal
import yaml
from mergebot_backend import mergebot_poller
from mergebot_backend.log_helper import get_logger
from mergebot_fro... |
tk_raw_analy_ver0.6.py | ## 영상 처리 및 데이터 분석 툴
from tkinter import *; import os.path ;import math
from tkinter.filedialog import *
from tkinter.simpledialog import *
## 함수 선언부
def loadImage(fname) :
global window, canvas, paper, filename, inImage, outImage, inW, inH, outW, outH
fsize = os.path.getsize(fname) # 파일 크기 확인
inH ... |
base.py | import collections.abc
import datetime
import logging
import logging.handlers
import numpy as np
import os
import pandas as pd
import random
import re
import string
import sys
import threading
import time
import traceback
import warnings
import yaml
from abc import ABC, abstractmethod
from enum import Enum
from glob i... |
server.py | from threading import Thread
from tornado.ioloop import IOLoop
import tornado.web
import time
import collections
import tornado.gen
import itertools
from grab.util.py3k_support import *
class ServerState(object):
PORT = 9876
EXTRA_PORT1 = 9877
EXTRA_PORT2 = 9878
BASE_URL = None
REQUEST = {}
RE... |
train.py | import argparse, torch, os, sys, time, math, shutil, threading
from ssd import SSD
from imgaug import augmenters as iaa
from dataset.logos.logo_dataset import LogoDataset
"""
MAIN ARGUMENTS
"""
str2bool = lambda x: x.lower() in ("yes", "true", "t", "1")
parser = argparse.ArgumentParser(description='SSD plug & play tr... |
script_request_queue_test.py | # Copyright 2018-2021 Streamlit 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 wr... |
session_debug_testlib.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... |
test_policies.py | # Copyright 2013-2014 DataStax, 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... |
red2ws.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# 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 Lice... |
data_source.py | import time
import Queue
import threading
import logging
log = logging.getLogger(__name__)
def mpu6050_data_generator(dt, stopped):
from mpu6050 import mpu6050
sensor = mpu6050(0x68)
# try to poll the sensor until it configures properly
started_at = time.time()
last_err = None
while time.ti... |
test_sequence.py | from datetime import datetime
import logging
from threading import Thread
import traceback
from typing import List
from mats.test import Test
from mats.archiving import ArchiveManager
Sequence = List[Test]
class TestSequence:
"""
The TestSequence will "knit" the sequence together by taking the test \
o... |
trainer.py | # coding: utf-8
###
# @file trainer.py
# @author Arsany Guirguis <arsany.guirguis@epfl.ch>
#
# @section LICENSE
#
# Copyright (c) 2020 Arsany Guirguis.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to ... |
scantools.py | """
拿到任务后按着插件执行顺序开始执行
modify by judy 2020/03/18
新增回馈 by judy 2020/04/08
暂时增加断点续扫的功能,目前只简单的增加以下
记录扫描到了哪个port
"""
from pathlib import Path
import re
import threading
import time
import traceback
import uuid
from queue import Empty, Queue
import IPy
from datacontract import EClientBusiness
from ..config_client import ba... |
Desktop.py | import headerfile as head
head. create("Nitish",25)
head. read("Nitish")
head. create("Nitish",50)
head. modify("Nitish",55)
head. delete("Nitish")
test=Thread(target=(create or read or delete),args=(key_name,value,timeout))
test.start()
test.sleep() |
cruzamento-rua.py | from threading import Thread
from threading import Semaphore
from time import sleep
from random import randint
import sys
#---------------------------------------------------
def carroA(sA, sB):
while True:
sA.acquire()
print('Carro A Passou')
sleep(2)
sB.release()
#---------... |
driver.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyright (c) 2012 Univer... |
uart_provider.py | import os
import re
import sys
import time
import json
import binascii
import math
# import asyncio
import datetime
import threading
import struct
from ...framework.utils import helper
from ...framework.utils import resource
from ..base import OpenDeviceBase
from ...framework.context import APP_CONTEXT
from ..decorato... |
test_logging.py | # Copyright 2001-2019 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
start_all_test.py | import os
import time
import json5
import argparse
from threading import Thread
from job_manage import JobManager
class Config(object):
def __init__(self, rest_server_url, hdfs_url, webhdfs_url, PAI_username, PAI_password, jobs):
self.rest_server_url = rest_server_url
self.hdfs_url = hdfs_url
... |
global_thread.py | import threading
import time
g_var=100
def add():
global g_var
for i in range(5):
g_var+=1
print('the value in add is %d'%(g_var))
def get():
global g_var
print('the value in get is %d'%(g_var))
t1 = threading.Thread(target=add)
t1.start()
time.sleep(1)
t2 = threading.Thread(target=... |
thread.py | import threading
x = 0
def increment():
global x
for i in range(500000):
x += 1
def main():
global x
x = 0
t1 = threading.Thread(target=increment)
t2 = threading.Thread(target=increment)
t1.start()
t2.start()
t1.join()
t2.join()
print(x)
main() |
hummingbirdconnection.py | # This module implements connection of a Hummingbird controller via USB. It is used by
# hummingbird.py to send and receive commands from the Hummingbird.
# The Hummingbird is a robotics kit to promote engineering and arts education, resulting from
# the Arts & Bots research program at Carnegie Mellon's CREATE lab.
# h... |
test_summary.py | import json
from mock import MagicMock
from mock import patch
from multiprocessing import Process
import os
import unittest
import warnings
import filelock
import numpy as np
import pytest
from chainerui import summary
try:
import chainer # NOQA
_chainer_installed = True
except (ImportError, TypeError):
... |
nifty.py | """@package geometric.nifty Nifty functions, originally intended to be imported by any module within ForceBalance.
This file was copied over from ForceBalance to geomeTRIC in order to lighten the dependencies of the latter.
Table of Contents:
- I/O formatting
- Math: Variable manipulation, linear algebra, least square... |
video.py | import json
import cv2
import numpy as np
import random
import numbers
import os
from skimage import io
from tqdm import tqdm
import math
from collections import defaultdict
import matplotlib.pyplot as plt
import bisect
from skimage import io
import pandas as pd
from concurrent import futures
from plotbee.utils import ... |
log_board.py | import time
import os
import re
from pathlib import Path
import threading
import logging
log = logging.getLogger(__name__)
class LogHSMercs:
def __init__(self, logpath):
"""generator function that yields new lines in filelog to
follow cards in hand and on the battlefield
"""
self.... |
PyShell.py | #! /usr/bin/env python3
import getopt
import os
import os.path
import re
import socket
import subprocess
import sys
import threading
import time
import tokenize
import io
import linecache
from code import InteractiveInterpreter
from platform import python_version, system
try:
from tkinter import *
except ImportE... |
server.py | import socket
import tools.helper as helper
import threading
import time
hp = helper.Helper(helper._FORMAT)
class Server:
def __init__(self,SERVER:str,PORT:int):
self._PORT = PORT
self._SERVER = SERVER
self._ADDR = (SERVER,PORT)
self._SSOCK = socket.socket(socket.AF_INE... |
stats.py | """ XVM (c) www.modxvm.com 2013-2017 """
#############################
# Command
def getBattleStat(args, respondFunc):
_stat.enqueue({
'func': _stat.getBattleStat,
'cmd': XVM_COMMAND.AS_STAT_BATTLE_DATA,
'respondFunc': respondFunc,
'args': args})
_stat.processQueue()
def getBa... |
client.py | import re
import shlex
import threading
import time
from typing import Dict, List, Optional, get_type_hints
import urllib3
from docopt import docopt
from prompt_toolkit import HTML, PromptSession
from prompt_toolkit.completion import Completer
from prompt_toolkit.history import InMemoryHistory
from prompt_toolkit.patc... |
graphicInterface.py | from tkinter import filedialog
from tkinter import *
import ctypes
import tkinter.ttk as ttk
import ProcessMusicTrack
from enum import Enum
import shutil
import threading
import os.path
import signal
class ShowImageMode(Enum):
SPECTRUM = 'Spectrum'
PROBABILITY = 'Probability'
def get_screen_size():
user3... |
lisp.py | # -----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com>
#
# 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... |
picam.py | import logging
from io import BytesIO, StringIO
import time
from PIL import Image
import threading
import queue
log = logging.getLogger(__name__)
picamera_override = None
class Picamera():
def __init__(self, image_format='jpeg', queue_max_size=10):
self.error = None
self.format = image_format
... |
build_mscoco_data.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... |
server.py | #!/usr/bin/python
# -*- 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 law or agre... |
parallel.py | from __future__ import absolute_import
import multiprocessing as mp
from builtins import range
from . import loadable
# Copyright (c) 2017 NVIDIA CORPORATION. All rights reserved.
# See the LICENSE file for licensing terms (BSD-style).
def _parallel_job(factory, args, queue, index):
"""Helper function to start... |
docker_agent.py | import json
import time
import os
import threading
import requests
import docker
from . import BaseAgent
from .. import utility
from .. import characters
class DockerAgent(BaseAgent):
"""The Docker Agent that Connects to a Docker container where the character runs."""
def __init__(self,
doc... |
xla_client_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... |
safaribooks.py | #!/usr/bin/env python3
# coding: utf-8
import re
import os
import sys
import json
import shutil
import pathlib
import getpass
import logging
import argparse
import requests
import traceback
from html import escape
from random import random
from lxml import html, etree
from multiprocessing import Process, Queue, Value
f... |
camera.py | """camera.py
This code implements the Camera class, which encapsulates code to
handle IP CAM, USB webcam or the Jetson onboard camera. In
addition, this Camera class is further extended to take a video
file or an image file as input.
"""
import logging
import threading
import subprocess
import numpy as np
import c... |
pickletester.py | import collections
import copyreg
import dbm
import io
import functools
import os
import math
import pickle
import pickletools
import shutil
import struct
import sys
import threading
import unittest
import weakref
from textwrap import dedent
from http.cookies import SimpleCookie
try:
import _testbuffer
except Impo... |
test_crt_basic_vm_with_max_threads.py | '''
New Perf Test for creating KVM VM with basic L3 network.
The created number will depend on the environment variable: ZSTACK_TEST_NUM
The difference with test_basic_l3_vm_with_given_num.py is this case's max thread is 1000
@author: Youyk
'''
import zstackwoodpecker.test_util as test_util
import zstac... |
exemple_run_threading.py | import threading
import time
from flask import Flask
app = Flask(__name__)
x = 0
def run_job():
while True:
print("Run recurring task")
global x
x += 1
time.sleep(3)
@app.route("/")
def hello():
return "Hello World!" + str(x)
if __name__ == "__main__":
thread = threadin... |
test_partition_20.py | 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 PartitionErrorMessage
prefix = ... |
managers.py | #
# Module providing the `SyncManager` class for dealing
# with shared objects
#
# multiprocessing/managers.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token' ]
#
# Imports
#
import sys
import th... |
dataengine_configure.py | #!/usr/bin/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 A... |
boomcpu_no_colours.py | #boomcpu.py Random Bitcoin&Litecoin Legacy compressed/uncompresses address and Segwit address P2SH.Bitcoin Gold\BitcoinCash\Zcash\Doge\DASH\ETH\ZEN\ZEIT\TENT
# Look for address or HASH160 PUBLIC KEY
#One of the best and most versatile crypto scanner. Looks for 28 different addresses, HASH160 or PUBLICKEY from a txt f... |
spider.py | from . import browser
from . import crawler
import re
from colorama import Fore, Style
import queue
from threading import Thread
import logging
B_BLUE = Style.BRIGHT+Fore.BLUE
B_WHITE = Style.BRIGHT+Fore.WHITE
B_RED = Style.BRIGHT+Fore.RED
B_CYAN = Style.BRIGHT+Fore.CYAN
RESET = Style.RESET_ALL
GREEN = Fore.GREEN
YEL... |
viz.py | #!/usr/bin/env python
# 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 os
import sys
import time
import logging
import omegaconf
import hydra
import pandas as pd
import dash
import d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.