source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
core_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... |
lisp-rtr.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... |
train.py | import argparse
from multiprocessing import Process, Queue
import os
from pathlib import Path
from time import time
from shutil import rmtree, copyfile
import cv2
import tensorflow as tf
import numpy as np
from networks.ops.gpu_ops import NEAREST_SHADER_MODULE
def cleanup():
'''Deletes leftover folders for previou... |
k.py | # -*- coding: utf-8 -*-
from Linephu.linepy import *
import codecs, json
from humanfriendly import format_timespan
import time, threading
import datetime
ts = time.time()
botStart = time.time()
cl = LINE()
cl.log(cl.authToken)
oepoll = OEPoll(cl)
settingsOpen = codecs.open("temp.json","r","utf-8")
settings = json.load... |
EjercicioSincro.py | import threading
import time
import random
from random import randint
num_alu = 5 #numero de bancas disponibles en el salon
i = 1
mutex_alum_dudas = threading.Semaphore(1) #este me ayudara a que solo se haga una pregunta a la vez
señal_profe_alum = threading.Semaphore(0) #señalizar que ha terminado de responder y el ... |
framework.py | #!/usr/bin/env python
from __future__ import print_function
import gc
import sys
import os
import select
import signal
import unittest
import tempfile
import time
import faulthandler
import random
import copy
import psutil
import platform
from collections import deque
from threading import Thread, Event
from inspect i... |
create_oid_tf_record.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... |
parallel.py | #!/usr/bin/env python
#
# Scanning th momdp_plates_v0 in both the MuJoCo environment and the script environment.
#
# Created by Xinchao Song on June 1, 2020.
#
from multiprocessing import Process
import gym
def run(idx):
print("Process #%d starts." % idx)
env = gym.make(id='MomdpBumps2d-v0', rendering=Fals... |
choose_music_dir.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'C:\Users\13595\PycharmProjects\music-player\ui\choose_music_dir.ui'
#
# Created by: PyQt5 UI code generator 5.11.2
#
# WARNING! All changes made in this file will be lost!
import os
import configparser
import threading
from PyQt5.QtCore imp... |
cli.py | try:
# monkey patch ssl at beginning to avoid RecursionError when running locust.
from gevent import monkey
monkey.patch_ssl()
from locust import main as locust_main
except ImportError:
msg = """
Locust is not installed, install first and try again.
install with pip:
$ pip install locustio
"""
p... |
tcp_server_4.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#
import socket
import threading
import socketserver
import json, types, string
import os, time
class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):
def handle(self):
data = self.request.recv(1024)
jdata = json.loads(data)
print("R... |
demo_socket_pic_server.py | #coding=utf-8
#!/usr/bin/env python2
#
# This file is part of MaixPY
# Copyright (c) sipeed.com
#
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license.php
#
'''
# Network tools srcipt
## pic_server.py
LAN map transmission server
- Installation dependency
update pip
```shell
# pyt... |
interface.py | #
# -*- coding: utf-8 -*-
"""Backend Sender - Send to internal process
Manage backend sender.
"""
import json
import logging
import threading
import uuid
import six
from six.moves import queue
import wandb
from wandb import data_types
from wandb.proto import wandb_internal_pb2 as pb
from wandb.proto import wandb_te... |
GuiStatusApplication.py | #!/usr/bin/env python
from GuiStatusUI import GuiStatusUI
from GuiStatusServer import GuiStatusServer
import threading
import logging
from gevent.pywsgi import WSGIServer
import flask
import flask_restful
if __name__ == "__main__":
log = logging.getLogger("werkzeug")
log.disabled = True
remote_interface = ... |
test_reading.py | from __future__ import with_statement
import random, threading, time
from nose.tools import assert_equal # @UnresolvedImport
from whoosh import analysis, fields, formats, reading
from whoosh.compat import u, xrange
from whoosh.filedb.filereading import SegmentReader
from whoosh.filedb.filestore import RamStorage
fro... |
multitask.py | # multitask.py
import time
import threading
def Toothbrush(brand):
for i in range(10):
print('แปรงฟันอยู่...ยาสีฟันยี่ห้อ' + brand)
time.sleep(0.3)
def Shower(soap,gel):
for i in range(10):
print('กำลังอาบน้ำ...สบู่{} ยาสระผม{}'.format(soap,gel))
time.sleep(1)
task1 = threading.Thread(target=... |
phishinspector.py | '''
phishinspector.py
fork from https://github.com/cybercdh/phishfinder
'''
import custom_functions as phish #Best pratices => one function = only one reuseable action
import json
import time
import multiprocessing
from signal import signal, SIGINT
def main():
ws=multiprocessing.Process(target=phish.web_se... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including witho... |
_stack.py | # Copyright 2016-2022, Pulumi Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... |
spotify.py | import json
import threading
from queue import Queue
from io import StringIO
from urllib import request, parse
from urllib.error import HTTPError
from resources.common import *
from searchEngines.searchEngineBase import SearchEngineBase, ThreadData
from searchEngines.models.Artist import Artist, ArtistType
from searchE... |
web.py | """Web server resource, base on bottle framework
"""
import threading
from bottle import (
Bottle,
run
)
web_server = None
class ConfigItems:
"""Web server配置项
"""
SERVER_TYPE = "server_type" # web服务基于的IO模型,比如gevent、tornado、gunicorn等等
HOST = "host" # 监听的host地址
PORT = "port" # 监听的端... |
_logger.py | """
.. References and links rendered by Sphinx are kept here as "module documentation" so that they can
be used in the ``Logger`` docstrings but do not pollute ``help(logger)`` output.
.. |Logger| replace:: :class:`~Logger`
.. |add| replace:: :meth:`~Logger.add()`
.. |remove| replace:: :meth:`~Logger.remove()`
.. |... |
Time_transmit.py | #
# Created on Sat Oct 09 2021
# Author: Owen Yip
# Mail: me@owenyip.com
#
import os,sys
pwd = os.path.abspath(os.path.abspath(__file__))
father_path = os.path.abspath(os.path.dirname(pwd) + os.path.sep + "..")
sys.path.append(father_path)
import time
from datetime import datetime
import threading
from Communication.... |
test_storage.py | import datetime
import hashlib
import itertools
import os
import shutil
import threading
import unittest
try:
from queue import Queue
except ImportError:
from Queue import Queue
from redis.connection import ConnectionPool
from redis import Redis
from huey.api import Huey
from huey.api import MemoryHuey
from h... |
test_s3blobstore.py | #!/usr/bin/env python
# coding: utf-8
import io
import os
import sys
import time
import unittest
import uuid
import select
import boto3
import botocore
import contextlib
import datetime
import socket
from multiprocessing import Process, Manager
from http.server import BaseHTTPRequestHandler, HTTPServer
from botocore.... |
main.py | # -*- coding: utf-8 -*-
"""
-----------------------------------------------------------------------------
Copyright 2017 David Griffis
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
... |
benchmark_incr.py | """Benchmark cache.incr method.
"""
import json
import multiprocessing as mp
import shutil
import time
import diskcache as dc
from .utils import secs
COUNT = int(1e3)
PROCS = 8
def worker(num):
"Rapidly increment key and time operation."
time.sleep(0.1) # Let other workers start.
cache = dc.Cache('... |
io.py | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
mongo.py | from typing import List
from datetime import datetime
import paho.mqtt.client as mqtt
import pymongo
import pymongo.database
import pymongo.collection
import pymongo.errors
import threading
import os
MONGO_URI = "mongodb://host:27017" # mongodb://user:pass@ip:port || mongodb://ip:port
MONGO_DB = "MasterIoT"
MONGO_CO... |
detector_utils.py | # Utilities for object detector.
import numpy as np
import sys
#import tensorflow as tf
import tensorflow.compat.v1 as tf
import os
from threading import Thread
from datetime import datetime
import cv2
from utils import label_map_util
from collections import defaultdict
detection_graph = tf.Graph()
sys.path.append("... |
cliffy.py | #!/usr/bin/env python3
from __future__ import print_function
import future
import builtins
import past
import six
from builtins import input
from colorama import Fore
from colorama import Style
from threading import RLock
from threading import Thread
import argcomplete
import argparse
import os
import readline
import... |
process.py | # Copyright 2011 Xavier de Gaye
#
# 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... |
test_threading.py | try:
import queue
except ImportError:
import Queue as queue
import threading
import pytest
import networkzero as nw0
_logger = nw0.core.get_logger("networkzero.tests")
nw0.core._enable_debug_logging()
def support_test_bound_in_other_thread(address, event1):
#
# Create a socket in a thread and signal ... |
twitch_eventsub.py | import hashlib
import hmac
import logging
import random
import string
import sys
import time
from concurrent.futures._base import CancelledError
import requests
from aiohttp import web
import threading
import asyncio
from logging import getLogger, Logger
from twitch_rest_api import TwitchRestApi, API_BASE as TWITCH... |
userenum.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# This is a part of CMSeeK, check the LICENSE file for more information
# Copyright (c) 2018 Tuhinshubhra
import cmseekdb.basic as cmseek ## Good old module
import re ## Comes in handy while detecting version
import json ## For parsing the wpvulndb result
import threading
wp... |
serveravg.py | from flcore.clients.clientavg import clientAVG
from flcore.servers.serverbase import Server
#from utils.data_utils import read_client_data
from utils.model_utils import read_data, read_user_data #added
from threading import Thread
import time
class FedAvg(Server):
def __init__(self, device, dataset, algorithm, mo... |
robolink.py | # Copyright 2015-2021 - RoboDK Inc. - https://robodk.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 a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agr... |
Rerequester.py | # Written by Bram Cohen
# modified for multitracker operation by John Hoffman
# see LICENSE.txt for license information
from BitTornado.zurllib import urlopen, quote
from urlparse import urlparse, urlunparse
from socket import gethostbyname
from btformats import check_peers
from BitTornado.bencode import bdecode
from ... |
sse.py | import asyncio
from aiohttp import web
from aiohttp.web import Application, Response
from aiohttp_sse import sse_response
from multiprocessing import Process, Pipe, Value, Manager
import time
listner_conn, ticker_conn = Pipe(False)
cur_tick = Value('i',0)
# async def hello(request):
# loop = request.... |
capture_screen_demo.py | #encoding=utf-8
'''
本Demo实现截取视频
'''
import cv2
import threading
import time
flag_video = True
def videoCapture():
print(cv2.__version__)
print('cv2.VideoCapture......')
global cap
cap = cv2.VideoCapture(0)
print('cap.read......')
ret, frame = cap.read()
global flag_vid... |
test_executor.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
# "L... |
federated_learning_keras_consensus_FL_threads_CIFAR_crossentropy.py | from DataSets import CIFARData
from DataSets_task import CIFARData_task
from consensus.consensus_v3 import CFA_process
from consensus.parameter_server_v2 import Parameter_Server
# use only for consensus , PS only for energy efficiency
# from ReplayMemory import ReplayMemory
import numpy as np
import os
import tensorflo... |
startBot.py | import pydirectinput
from pyHM import mouse
import keyboard as kb
import cv2
import random
import win32gui
import psutil
from time import time, sleep
from threading import Thread, Lock
from gamecapture import GameCapture
from detect import Detection
from vision import Vision
x_min, x_max, y_min, y_max = 177, 202, 4... |
ib_events.py | import threading
import pandas as pd
from ibapi.client import EClient
from ibapi.common import OrderId
from ibapi.contract import Contract
from ibapi.order import Order
from ibapi.wrapper import EWrapper
import atpy.portfolio.order as orders
from atpy.portfolio.order import *
class DefaultWrapper(EWrapper):
def... |
Binance Detect Moonings.py | """
Olorin Sledge Fork
Version: 1.25
Disclaimer
All investment strategies and investments involve risk of loss.
Nothing contained in this program, scripts, code or repositoy should be
construed as investment advice.Any reference to an investment's past or
potential performance is not, and should not be construed as, ... |
parallel.py | #!/usr/bin/python3.6
#QiitaAPIをロード
import sys, os, json
sys.path.append('../../src')
from QiitaAPIMain import *
#multi process
import multiprocessing
def writeFile(name, mddata):
with open(name, 'w') as f:
f.write(mddata)
def call_items(index):
result=QiitaAPIMain(['html',f'pagenation_parallel_{index}.json','ite... |
speechRecognition.py | import argparse
import os
import queue
import sounddevice as sd
import vosk
import sys
from threading import *
class speechRecognition:
q = 0
speech_to_text = ""
started = "no"
def hasStarted(self):
return self.started
def getSpeechToText(self):
if self.speech_to_text == "":
... |
client.py | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2009- Spyder Project Contributors
#
# Distributed under the terms of the MIT License
# (see spyder/__init__.py for details)
# --------------------------------------------------------------------... |
o3m_lidar.py | import socket
from structures import Channel8Data
from channel import Channel
import threading
import numpy as np
def point_cloud_from_channel_8_data(data: Channel8Data):
distance_image = data.distanceImageResult
positions = np.empty((len(distance_image.X), 3))
positions[:, 0] = distance_image.X
... |
create_places365.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from datetime import datetime
import os
import random
import sys
import threading
import numpy as np
import tensorflow as tf
tf.app.flags.DEFINE_integer('val_shards', 4,
'Number of ... |
test_sockets.py | # Copyright 2013 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
from __future__ import print_function
import multiprocessing
import o... |
amplitude_display.py | import sys
import functools
import signal
import select
import socket
import numpy as np
import pickle
import matplotlib.pyplot as plt
import time
from multiprocessing import Process, Queue
sys.path.append('../dhmsw/')
import interface
import struct
PLOT = True
headerStruct = struct.Struct('III')
class guiclient(obje... |
cross_device_ops_test.py | # Copyright 2020 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... |
webcam.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 applicab... |
bot.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import ctypes
import getpass
import gettext
import logging
import os
import platform
import socket
import sqlite3
import subprocess
import sys
import threading
import tkinter as tk
from datetime import datetime
from pathlib import Path
from tkinter import ttk
import distr... |
LiabilityExecutionThread.py | import threading
from .player import Player, get_rosbag_from_file
from .recorder import Recorder
import rospy
import os
from ipfs_common.srv import IpfsUploadFile, IpfsUploadFileRequest, IpfsDownloadFile, IpfsDownloadFileRequest
class LiabilityExecutionThread(object):
def __init__(self, work_directory, master_ch... |
tiny_yolo_processor.py | #! /usr/bin/env python3
# Copyright(c) 2017 Intel Corporation.
# License: MIT See LICENSE file in root directory.
# NPS
# processes images via tiny yolo
from mvnc import mvncapi as mvnc
import numpy as np
import cv2
import queue
import threading
class tiny_yolo_processor:
# Tiny Yolo assumes input images are ... |
repl.py | #!/usr/bin/env python
# https://gist.github.com/tim-patterson/4471877
'''Python interactive console server,
To be embedded in an application/service, once connected to (ie using nc or putty) you will be
provided with an interactive python interpreter attached to your main process,
application state can be queried and... |
VideoShow.py | from threading import Thread
import cv2
class VideoShow:
"""
Class that continuously shows a frame using a dedicated thread.
"""
def __init__(self, frame=None):
self.frame = frame
self.stopped = False
def start(self):
Thread(target=self.show, args=()).start()
retur... |
mic.py | # Copyright 2017 Mycroft AI 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 writin... |
tpu_estimator.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... |
scion_elem.py | # Copyright 2014 ETH Zurich
#
# 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, sof... |
event_watcher.py | try:
import argparse
import ast
import configparser
import datetime
import json
import kerberos
import logging
import os.path
import pymongo
import re
import signal
import sys
import time
import threading
import socket
from pymongo.errors import DuplicateKeyError, OperationFailure
except... |
test.py | import sancty
from blessed import Terminal
from blessed.formatters import NullCallableString
import multiprocessing as mp
import pickle
def test_hi(term_test):
print("hi")
if __name__ == '__main__':
# mp.set_start_method('spawn')
# term = Terminal()
# process = mp.Process(target=test_hi, args=(term,... |
Conversion.py | # std library
import os
import sys
import csv
import subprocess
import threading
# 3rd party library
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
# Internal Script
from src.database.table import Base, Company, News
from src.tools.globalvar import *
class GenerateDB:
... |
__init__.py | # org.onap.dcae
# ============LICENSE_START====================================================
# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
# =============================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you ma... |
_testing.py | import bz2
from collections import Counter
from contextlib import contextmanager
from datetime import datetime
from functools import wraps
import gzip
import operator
import os
from pathlib import Path
import random
import re
from shutil import rmtree
import string
import tempfile
from typing import IO, A... |
ConductorWorker.py | #
# Copyright 2017 Netflix, 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... |
skipgram.py | import threading
import queue
import io
import gzip
import itertools
from concurrent.futures import ThreadPoolExecutor
from os import path
import tensorflow as tf
import numpy as np
OPTIMIZERS = {
"gradient-descent" : tf.train.GradientDescentOptimizer,
"adam" : tf.train.AdamOptimizer,
"rmspro... |
bp.py | # ## Python 3 look ahead imports ###
#from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from panda3d.core import loadPrcFileData
from direct.showbase.ShowBase import ShowBase
base = ShowBase()
base.setSleep(0.001)
imp... |
map_dataset_op_test.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
helpers.py | from LSP.plugin.core.typing import Any, Callable, List, Optional, Tuple
import re
import sublime
import subprocess
import threading
StringCallback = Callable[[str], None]
SemanticVersion = Tuple[int, int, int]
def run_command_sync(args: List[str], cwd: Optional[str] = None) -> Tuple[str, Optional[str]]:
"""
... |
monitor.py | import functools
import logging
import os
import subprocess
import threading
from dataclasses import dataclass
from typing import TYPE_CHECKING, Callable, List
from dvc.repo.live import create_summary
from dvc.stage.decorators import relock_repo
from dvc.stage.exceptions import StageCmdFailedError
if TYPE_CHECKING:
... |
run.py | import os
from tempfile import mkdtemp
from multiprocessing import Process
from robot import run
from allure_robotframework import allure_robotframework
from allure_commons_test.report import AllureReport
def make_temp_dir():
return mkdtemp(dir=os.environ.get('TEST_TMP', None))
def make_dir(path, name):
dir... |
main.py | /**
*
* The MIT License (MIT)
*
* Copyright (c) 2013 Shrey Malhotra
*
* 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... |
KerasWrapper.py | from __future__ import division
import logging
import numpy as np
import sklearn
from sklearn.utils import class_weight
from sklearn.metrics import log_loss, roc_curve, auc, f1_score
import tempfile
import os
import time
import threading
import multiprocessing
import Queue
import basicutils
import gzip
import json
impo... |
algo_two.py | from functools import reduce
from sys import *
import numpy as np
import random as r
import socket
import struct
import subprocess as sp
import threading
from threading import Thread
import ast
import time
import datetime as dt
import os
import psutil
from netifaces import interfaces, ifaddresses, AF_INET
import paho.m... |
test_enum.py | import enum
import doctest
import inspect
import os
import pydoc
import sys
import unittest
import threading
import builtins as bltns
from collections import OrderedDict
from datetime import date
from enum import Enum, IntEnum, StrEnum, EnumType, Flag, IntFlag, unique, auto
from enum import STRICT, CONFORM, EJECT, KEEP... |
threadtest.py | #!/usr/bin/env python
import time
import threading
import multiprocessing
class nothread(object):
def foo(self):
start=time.time()
b=[]
for i in range(1000000):
b.append(i*i)
print type(self),"Timing",str(time.time()-start)+'s'
class threaded(nothread):
def foo(sel... |
tests.py | from __future__ import unicode_literals
import time
import unittest
from django.conf import settings
from django.db import transaction, connection, router
from django.db.utils import ConnectionHandler, DEFAULT_DB_ALIAS, DatabaseError
from django.test import (TransactionTestCase, skipIfDBFeature,
skipUnlessDBFeatu... |
train_bak.py | import argparse
import os
import random
import threading
from datetime import datetime, time
from this import i
import numpy as np
import torch
import transformers
from torch.nn import DataParallel
from torch.utils.tensorboard import SummaryWriter
from tqdm import tqdm
from tokenizations.bpe_tokenizer import get_enco... |
test_socketutils.py | # -*- coding: utf-8 -*-
import sys
import time
import errno
import socket
import threading
from boltons.socketutils import (BufferedSocket,
NetstringSocket,
ConnectionClosed,
NetstringMessageTooLong,
... |
runpipeline_video_latest_frame.py | import threading
import cv2
import pyrealsense2 as rs
import numpy as np
from queue import Queue, Empty
from utilities.hough_transform_lane_detection import HoughTransformLaneDetection
# Functions to read frames from Video or RealSense Camera
class VideoCaptureLatestFrame:
def __init__(self):
self.cap = c... |
testit_daemon.py | #!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2019 Gert Kanter.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must r... |
test_tracer.py | import time
import opentracing
from opentracing import (
child_of,
Format,
InvalidCarrierException,
UnsupportedFormatException,
SpanContextCorruptedException,
)
import ddtrace
from ddtrace.ext.priority import AUTO_KEEP
from ddtrace.opentracer import Tracer, set_global_tracer
from ddtrace.opentrace... |
restapi_endpointhandler.py | '''
Copyright (c) 2021-2022 OVGU LIA
Author: Harish Kumar Pakala
This source code is licensed under the Apache License 2.0 (see LICENSE.txt).
This source code may use other Open Source software components (see LICENSE.txt).
'''
import json
import logging
import os
import requests
import threading
from flask import Fl... |
dask.py | # pylint: disable=too-many-arguments, too-many-locals, no-name-in-module
# pylint: disable=missing-class-docstring, invalid-name
# pylint: disable=too-many-lines, fixme
# pylint: disable=import-error
"""Dask extensions for distributed training. See
https://xgboost.readthedocs.io/en/latest/tutorials/dask.html for simple... |
LogAnalyzeLogs_BACKUP.py | import LogAnalyzeDBOps as db
import threading
import re
import datetime
def analyzeLogs(storeName):
t1 = threading.Thread(target=jobGetAccLoginAttackStatus, name='GetAccLoginAttackStatus', args= (storeName,))
t2 = threading.Thread(target=jobGetAccessAttackStatus, name='jobGetReadAccessAttackStatus', args=(sto... |
simple_crawler.py | import socket
import copy
import threading
import logging
import requests
import urllib3
from .response_decoder import decode_response
MAX_FILE_SIZE = 20000000
MIN_FILE_SIZE = 10
LOGGER = logging.getLogger(__name__)
# customize headers
HEADERS = {
'Connection': 'close',
'Accept':'*/*',
#'User-Agent': '... |
retrowrapper.py | """
This module exposes the RetroWrapper class.
"""
import multiprocessing
import retro
import gc
MAKE_RETRIES = 5
def set_retro_make( new_retro_make_func ):
RetroWrapper.retro_make_func = new_retro_make_func
def _retrocom(rx, tx, game, kwargs):
"""
This function is the target for RetroWrapper's internal... |
calibrate-agent.py |
#
# Copyright 2016-2018 Games Creators Club
#
# MIT License
#
import time
import threading
import traceback
import pyroslib
from RPi import GPIO
DEBUG = True
STROBO_LIGHT_GPIO = 4
stroboTime = -1
nextTime = time.time()
state = False
def strobo():
global nextTime, state
while True:
if stroboTime >... |
installwizard.py |
import os
import sys
import threading
import traceback
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from electrum import Wallet, WalletStorage
from electrum.util import UserCancelled, InvalidPassword
from electrum.base_wizard import BaseWizard, HWD_SETUP_DECRYPT_WALLET
from elec... |
wikisourcetext.py | #!/usr/bin/python
"""
This bot applies to Wikisource sites to upload text.
Text is uploaded to pages in Page ns, for a specified Index.
Text to be stored, if the page is not-existing, is preloaded from the file used
to create the Index page, making the upload feature independent from the format
of the file, as long a... |
run_ctc_segmentation.py | # Copyright (c) 2020, NVIDIA CORPORATION. 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 appli... |
integration_test_utils.py | from subprocess import Popen
import mock
import os
from threading import Thread
import socket
import time
import tempfile
import mlflow
from mlflow.server import BACKEND_STORE_URI_ENV_VAR, ARTIFACT_ROOT_ENV_VAR
from mlflow.utils.file_utils import path_to_local_file_uri, local_file_uri_to_path
from tests.helper_funct... |
test_event_based_scheduler.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 | #####################################################################
# #
# /main.pyw #
# #
# Copyright 2013, Monash University ... |
test_threading_local.py | # this is http://svn.python.org/view/python/trunk/Lib/test/test_threading_local.py?view=markup&pathrev=78336
# although we do have test_patched_local.py, it does not have all the tests that this file has
from gevent import monkey; monkey.patch_all()
import unittest
from doctest import DocTestSuite
from test import test... |
generic_websocket.py | """
Module used as a interfeace to describe a generick websocket client
"""
import asyncio
import websockets
import socket
import json
import time
from threading import Thread, Lock
from pyee import AsyncIOEventEmitter
from ..utils.custom_logger import CustomLogger
# websocket exceptions
from websockets.exceptions i... |
servers.py | # Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.