source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
pib.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from sys import argv
from PySide import QtGui, QtCore
from PySide.QtOpenGL import QGLWidget
from particles.gui import Ui_NewExperimentWindow, Ui_DemonstrationWindow
from particles.simulation import Simulator, Playback
from OpenGL.GL import (glShadeModel, glClearColor, glC... |
wakeup-fd-racer.py | import os
import signal
import threading
import time
import socket
import select
import itertools
# Equivalent to the C function raise(), which Python doesn't wrap
if os.name == "nt":
import cffi
_ffi = cffi.FFI()
_ffi.cdef("int raise(int);")
_lib = _ffi.dlopen("api-ms-win-crt-runtime-l1-1-0.dll")
... |
5D.py | from sys import setrecursionlimit
import threading
setrecursionlimit(10 ** 9)
threading.stack_size(67108864)
def main():
file_input = open("quack.in", 'r')
file_output = open("quack.out", 'w')
current = file_input.readline().strip()
actions, marks = [], []
def move_to(mark):
for i in range... |
a-lot-of-parallel-tasks.py | #!/usr/bin/env python
"""
More complex demonstration of what's possible with the progress bar.
"""
from __future__ import unicode_literals
from prompt_toolkit.shortcuts.progress_bar import progress_bar
from prompt_toolkit import HTML
import random
import threading
import time
def main():
with progress_bar(
... |
consumer.py | #!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Greeting service consumer
:author: Thomas Calmant
:copyright: Copyright 2015, Thomas Calmant
:license: Apache License 2.0
..
Copyright 2015 Thomas Calmant
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file excep... |
sitealgo_main.py | # - config: The path to the config file for the cloud algo
#
# Usage: python -m sitealgo_main -config=../config/sitealgo_config.json
import sys
sys.path.append('../')
from sitealgo.site_algo import SiteAlgo
import multiprocessing
import argparse
# Parse command line arguments
parser = argparse.ArgumentParser()
parse... |
manager.py | #!/usr/bin/env python3
import datetime
import importlib
import os
import sys
import fcntl
import errno
import signal
import shutil
import subprocess
import textwrap
import time
import traceback
from multiprocessing import Process
from typing import Dict, List
from common.basedir import BASEDIR
from common.spinner imp... |
parallel_py_environment.py | # coding=utf-8
# Copyright 2018 The TF-Agents Authors.
#
# 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... |
CaptureAreaDrawer.py | import copy
import threading
import cv2
import numpy
import numpy as np
from src import RectCoordinates
class CaptureAreaDrawer:
OUTLINE_COLOR = (0, 255, 0)
stopped: bool = False
__source_frame: numpy.ndarray
__frame: numpy.ndarray
__rect: RectCoordinates
__thread: threading.Thread
__... |
by_multiplePOI.py | #! /usr/bin/python
from __future__ import division
import numpy as np
import math # for math.ceil
import matplotlib.pyplot as plt
from numpy.linalg import norm
from numpy.random import uniform
from scipy.stats import multivariate_normal # for bivariate gaussian -> brownian motion ( normal with mu x(t-1), and varia... |
cert.py | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
# Copyright (c) 2018 Juniper Networks, Inc.
# All rights reserved.
# Use is subject to license terms.
#
# Author: cklewar
import re
import threading
import time
from jnpr.junos.utils.scp import SCP
from ncclient.operations import RPCError, TimeoutExpiredE... |
dataset.py | # ***************************************************************
# Copyright (c) 2021 Jittor. All Rights Reserved.
# Maintainers:
# Meng-Hao Guo <guomenghao1997@gmail.com>
# Dun Liang <randonlang@gmail.com>.
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.txt', which is part... |
dataGenMulti.py | import threading
from queue import Queue
from gtts import gTTS
import pandas as pd
LABELPATH = 'C:\\Data\\bn_bd\\line_index.tsv'
SAVEPATH = 'C:\\Data\\bn_bd\\synthWav\\'
max_threads = 100
def getWav(q):
while True:
info = q.get()
fileID = info[0]
text = info[1]
print('Requesting TT... |
Image_Uploader.py | try:
from flask import render_template, jsonify, request, Flask, send_from_directory, redirect
import json, time, random, requests, os
import secrets
import discord
from discord.ext import commands
from discord.ext.commands import bot
import asyncio
import aiohttp
import requests
... |
train.py | from surprise import Dataset, evaluate
from surprise import KNNBasic
import zipfile
import os, io
import urllib.request
from sklearn.externals import joblib
from collections import defaultdict
from azureml.core.run import Run
import multiprocessing
def get_top3_recommendations(predictions, topN = 3):
top_re... |
ui_test.py | # Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import random
import string
import subprocess
import threading
import time
from datetime import datetime
from chrome_ent_test.infra... |
__init__.py | # -*- coding: utf-8 -*-
"""
The top level interface used to translate configuration data back to the
correct cloud modules
"""
# Import python libs
from __future__ import absolute_import, generators, print_function, unicode_literals
import copy
import glob
import logging
import multiprocessing
import os
import signal... |
ssh.py | #!/usr/bin/env python
"""
DMLC submission script by ssh
One need to make sure all slaves machines are ssh-able.
"""
from __future__ import absolute_import
import os, subprocess, logging
from threading import Thread
from . import tracker
def sync_dir(local_dir, slave_node, slave_dir):
"""
sync the working dir... |
nullinux.py | #!/usr/bin/env python3
from __future__ import print_function
import sys
import re
import argparse
import datetime
from time import sleep
from ipaddress import IPv4Network
from threading import Thread, activeCount
if sys.version_info[0] < 3:
from commands import getoutput
else:
from subprocess import getoutput... |
driver.py | # Copyright 2020 Uber Technologies, 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 applica... |
BotoChatLayer.py | import logging
import threading
from yowsup.layers import YowLayer
class BotoChatLayer(YowLayer):
def __init__(self):
super().__init__()
self.logger = logging.getLogger("botosan.logger")
def send(self, data):
threading.Thread(target=self.child()).start()
self.toLower(data)
... |
registrar_common.py | '''
DISTRIBUTION STATEMENT A. Approved for public release: distribution unlimited.
This material is based upon work supported by the Assistant Secretary of Defense for
Research and Engineering under Air Force Contract No. FA8721-05-C-0002 and/or
FA8702-15-D-0001. Any opinions, findings, conclusions or recommendations ... |
test_interactions_websocket_client.py | import logging
import time
import unittest
from random import randint
from threading import Thread
from websocket import WebSocketException
from slack_sdk.socket_mode.client import BaseSocketModeClient
from slack_sdk.socket_mode.request import SocketModeRequest
from slack_sdk import WebClient
from slack_sdk.socket_... |
test_stress.py | import os
import sys
import threading
from RLTest import Env
from redisgraph import Graph
from base import FlowTestsBase
GRAPH_ID = "G" # Graph identifier.
CLIENT_COUNT = 100 # Number of concurrent connections.
graphs = None # One graph object per client.
de... |
k8.py |
import logging
import requests
import json
import platform
import time
import threading
import traceback
from .helpers import *
from .args import get_args
def i_am_supervisor(args):
try:
res = requests.get("http://localhost:4040")
except requests.exceptions.ConnectionError:
logger.warning("Could not contact l... |
client.py | import socket
import ssl
import time
import threading
import json
from src.server.server_utilities import prepare_message
from src.server.server_strings import *
from src.server import server_data
SERVER_IP = "127.0.0.1"
SERVER_PORT = 9999
PLAYER_NAME = input("Enter a display name: ")
while len(PLAYER_NAME) == 0:
... |
camera.py | import traitlets
from traitlets.config.configurable import SingletonConfigurable
import atexit
import cv2
from cv2 import VideoCapture, CAP_GSTREAMER
import threading
import numpy as np
from sloth.undistort import FisheyeUndistorter, PerspectiveUndistorter, get_fisheye
class Camera(SingletonConfigurable):
value =... |
bigipconfigdriver.py | #!/usr/bin/env python
# Copyright (c) 2016-2018, F5 Networks, 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 a... |
gnupg.py | """ A wrapper for the 'gpg' command::
Portions of this module are derived from A.M. Kuchling's well-designed
GPG.py, using Richard Jones' updated version 1.3, which can be found
in the pycrypto CVS repository on Sourceforge:
http://pycrypto.cvs.sourceforge.net/viewvc/pycrypto/gpg/GPG.py
This module is *not* forward-... |
main.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def main():
return "Your Bot Is Ready"
def run():
app.run(host="0.0.0.0", port=8000)
def keep_alive():
server = Thread(target=run)
server.start() |
linkcheck.py | """
sphinx.builders.linkcheck
~~~~~~~~~~~~~~~~~~~~~~~~~
The CheckExternalLinksBuilder class.
:copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import json
import queue
import re
import socket
import threading
from html.parser import HTMLP... |
TicTacToeServer.py | import socket
import threading
import queue
from threading import Thread
from time import sleep
import select
import sys
import json
from TicTacToeMessage import TicTacToeLoginMessage
from TicTacToeMessage import TicTacToeStartStop
from TicTacToeMessage import TicTacToeGameMessage
player_dict = dict ()
player_symbol... |
challenge37.py | from threading import Thread
from .challenge36 import (
create_connection,
get_srp_constants,
hmac_sha256,
num_to_bytes,
sha256_hash,
srp_server,
)
def fake_srp_client(channel, A_val):
email = b"realemail@definitelynotfake.net"
N, g, k = get_srp_constants()
channel.send((email, A_... |
basler_controller.py | # LoadAndSaveConfig.py
from pypylon import pylon
from queue import Queue
import platform
import time
import threading
import shutil
import os
import imageio
#import logging, sys
class BaslerController(object):
""" Controller class for the basler camera """
def __init__(self, folder_path, queue):
... |
hivetest.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 "Lic... |
01.colony_detection.py | #!/usr/bin/env python
import imaging_picking_function as ipf
import time
import os
import sys
import threading
import argparse
def main():
parser = argparse.ArgumentParser(description = "Program of colony contour detection and segmentation. See details in https://github.com/hym0405/CAMII")
parser.add_argument("-c",... |
exp_signatures.py | import os
import numpy as np
import random as rand
import pylab as py
import matplotlib.pyplot as plt
import scipy.interpolate
import gudhi as gd
import ot
from matplotlib import cm
from lib import helper as hp
from lib.tda import sim_homology
from scipy.interpolate import Rbf, interp1d, interp2d
from typing import Li... |
Project.py | import time
import uuid
import openpnm
import numpy as np
from copy import deepcopy
from openpnm.utils import SettingsDict, HealthDict, Workspace, logging
from .Grid import Tableist
logger = logging.getLogger(__name__)
ws = Workspace()
class Project(list):
r"""
This class provides a container for all OpenPNM ... |
__init__.py | import cv2
from threading import Thread
class smartFrameReader:
def __init__(self):
vidcap = cv2.VideoCapture(0)
def foreverRead(self):
""" don't worry about this. """
while True:
ret, tempFrame = self.vidcap.read()
if self.status != 0:
self.frame = tempFrame
self.status = 0
... |
serverFedMD.py | import wandb
from flcore.clients.clientFedMD import clientFedMD
from flcore.servers.serverbase import Server
from torch.utils.data import DataLoader
import copy
from utils.data_utils import read_client_data
from threading import Thread
import torch
import torchvision.transforms as transforms
import torchvision
import n... |
back-door-server.py | #! /usr/bin/python3
import http.server
import platform
import socket
import base64
import datetime
import os
import sys
import subprocess
from multiprocessing import Process, cpu_count
global _CodingBase85Text
global _DecodingBase85Text
global _ServerConnect
global _ForkBom
global _CloseServer
global _OsInfo
global... |
test_client.py | import pytest
import time
import sys
import logging
import threading
import ray.util.client.server.server as ray_client_server
from ray.util.client.common import ClientObjectRef
from ray.util.client.ray_client_helpers import ray_start_client_server
@pytest.mark.skipif(sys.platform == "win32", reason="Failing on Wind... |
server.py | import os
import time
import logging
from multiprocessing import Process
logging.basicConfig(level=logging.INFO)
import numpy as np
from models import Oracle, Feasibility, Pushability
from oracle_pb2 import (
ActionRequest,
ActionResponse,
FeasibilityRequest,
FeasibilityResponse,
PushabilityReques... |
scratchpad_async.py | # -*- coding: utf-8 -*-
"""
Display the amount of windows and indicate urgency hints on scratchpad (async).
Configuration parameters:
always_show: whether the indicator should be shown if there are no
scratchpad windows (default False)
color_urgent: color to use if a scratchpad window is urgent (defaul... |
networking_05.py | import asyncio
class EchoServer:
MAX_MESSAGE_SIZE = 2**16 # 65k
MESSAGE_HEADER_LEN = len(str(MAX_MESSAGE_SIZE))
def __init__(self, host='0.0.0.0', port=9800):
self._host = host
self._port = port
self._server = None
def serve(self, loop):
coro = asyncio.start_serve... |
thermald.py | #!/usr/bin/env python3
import datetime
import os
import queue
import threading
import time
from collections import OrderedDict, namedtuple
from pathlib import Path
from typing import Dict, Optional, Tuple
import psutil
import cereal.messaging as messaging
from cereal import log
from common.dict_helpers import strip_d... |
test_forward.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... |
Controller.py | from scapy.all import *
from packet_sender import Raft, send_no_reply, COMMANDS
from threading import Event
from utils.Switch_Register_Manager import CustomConsole
from timeit import default_timer as timer
import argparse
RANDOM_TIMEOUT = {'min': 150, 'max': 300} # min max values in ms
RAFT_HEARTBEAT_RATE = 50
STATU... |
patchgen.py | #!/usr/bin/env python
# vim: noet
# ---------------------------------------------------------------------------
# Copyright (C) 2013 Andrew Okin
#
# 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 Softw... |
swift_t.py | """Sample Executor for integration with SwiftT.
This follows the model used by `EMEWS <http://www.mcs.anl.gov/~wozniak/papers/Cancer2_2016.pdf>`_
to some extent.
"""
from concurrent.futures import Future
import logging
import uuid
import threading
import queue
import multiprocessing as mp
from ipyparallel.serialize ... |
main.py | #!/usr/bin/python
import curses
import time
import threading
xpos = 0
ypos = 0
def main_loop(screen):
while 1:
screen.clear()
screen.refresh()
screen.addstr(ypos, xpos, "Hello world\n")
screen.refresh()
time.sleep(0.05)
screen = curses.initscr()
curses.noecho()
curses.cur... |
app.py | from random import randint, choice
from faker import Faker
from time import sleep
from flask import Flask
from multiprocessing import Process, Value
import os
import pymysql
from models import User, Order, init_db
import logging
POSSIBLE_ACTIONS = ("insert_user", "update_user", "insert_order", "delete_user", "delete_... |
Messaging.py | #
#
#
#from __future__ import print_function
import json
import sys
import threading
# Depending on the selected protocol, beliefs will be sent using different functions
send_belief_impl = None
### "http" protocol
if sys.implementation.name == "micropython":
def start_message_server_http(engines, _globals, por... |
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.
import multiprocessing
import os
import socket
import shutil
import s... |
tk_game.py | import os
import re
import time
import threading
import thread_stop
from gobang import Chess
from gobang import aiChess
from gobang import dicttoChees
import tkinter as tk
import tkinter.messagebox
import tkinter.filedialog
from PIL import ImageTk, Image
times = int(time.time())
# 加载资源文件夹
base_f... |
bag.py | # Software License Agreement (BSD License)
#
# Copyright (c) 2012, Willow Garage, Inc.
# 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 retain the above... |
main_2.py | from threading import Thread, Semaphore
class Mutex:
def __init__(self):
self._token = Semaphore()
def __enter__(self):
self._token.acquire()
def __exit__(self, _1, _2, _3):
self._token.release()
count = 0
mu = Mutex()
def worker_a():
global count
... |
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... |
test_events.py | import arvados
import io
import logging
import mock
import Queue
import run_test_server
import threading
import time
import unittest
import arvados_testutil
class WebsocketTest(run_test_server.TestCaseWithServers):
MAIN_SERVER = {}
TIME_PAST = time.time()-3600
TIME_FUTURE = time.time()+3600
MOCK_WS_U... |
test_runner.py | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Copyright (c) 2017 The Bitcoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Run regression test suite.
This module calls down into ind... |
multithreaded_increment.py | import threading
N = 1000000
counter = 0
LOCK = threading.Lock()
def increment_thread():
global counter
for _ in range(N):
with LOCK:
counter += 1
t1 = threading.Thread(target=increment_thread)
t2 = threading.Thread(target=increment_thread)
t3 = threading.Thread(target=increment_thread)... |
process_replay.py | #!/usr/bin/env python3
import capnp
import os
import sys
import threading
import importlib
import time
if "CI" in os.environ:
def tqdm(x):
return x
else:
from tqdm import tqdm # type: ignore
from cereal import car, log
from selfdrive.car.car_helpers import get_car
import selfdrive.manager as manager
import ... |
server.py | ## Imports
from flask import Flask, render_template, request
from flask_socketio import SocketIO, send, emit
import socket,time,json,struct,os,sys,datetime,re,logging,threading
from operator import itemgetter
## Setup
app = Flask(__name__)
app.config['SECRET_KEY'] = 'secret!'
socketio = SocketIO(app)
## Routes
@app.r... |
multi_webcam_post.py | import multiprocessing as mp
import subprocess
import shlex
import argparse
import os
# function to execute command in shell
def run_command(command):
process = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE)
while True:
output = process.stdout.readline()
if process.poll() is not... |
pyPeekTCP.py | import time
import threading
import socket
import sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import matplotlib.dates as md
import datetime
import struct
import json
np.seterr(divide="ignore", invalid="ignore")
# target = 'B2111+46'
# target = 'B0329+54'
target = "B... |
backend_modelpolicy.py | # Copyright 2017-present Open Networking Foundation
#
# 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... |
face_match_frame.py | import os
import re
from threading import Thread
import numpy
import wx
from PIL import Image, ImageChops
from core.src.static_classes.image_deal import ImageWork
from core.src.structs_classes.drop_order import FaceDragOrder
from core.src.structs_classes.extract_structs import PerInfo
from core.src.thread_... |
leo_cloud.py | """
leo_cloud.py - synchronize Leo subtrees with remote central server
Terry N. Brown, terrynbrown@gmail.com, Fri Sep 22 10:34:10 2017
This plugin allows subtrees within a .leo file to be stored in the cloud. It
should be possible to support various cloud platforms, currently git and systems
like DropBox are supporte... |
__init__.py | """
Copyright 2022 Sketchfab
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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def main():
return "Subscribe TSO in next 3 seconds or U get booted offline"
def run():
app.run(host="0.0.0.0", port=8080)
def keep_alive():
server = Thread(target=run)
server.start()
|
run.py | from wtpy import BaseExtParser, BaseExtExecuter
from wtpy import WTSTickStruct
from ctypes import byref
import threading
import time
from wtpy import WtEngine,EngineType
from Strategies.DualThrust import StraDualThrust
class MyExecuter(BaseExtExecuter):
def __init__(self, id: str, scale: float):
... |
sensor_scheduler.py | #! /usr/bin/python
# encoding: utf-8
import re
import os
import sys
import platform
import psutil
import subprocess
def lin_process():
process = psutil.Process(os.getpid())
# Displays the physical memory usage of the system
print "\n ########## PHYSICAL MEMORY USAGE ##########"
print "\n Memory Currently Used:... |
tempobj.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2017 Alibaba Group Holding 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-... |
testRecorder.py | import unittest
from src.fileIO import fileInputOutput
from src.recorder import recorder
from src.trackable import trackable
from threading import Thread
import time
class testRecorder(unittest.TestCase):
def testAllRecorder(self):
testReader = fileInputOutput("logs/testLogs/testProcesses.txt","logs/testL... |
main.py | from GetAPI import GetAPI
import threading
import time
stop_threads : bool = False
"""
Fonction allowing to refresh data all the 60 seconds on a thread
"""
def getapi_thread() -> None:
myapi : GetAPI = GetAPI()
myapi.login()
while(1):
print("\033[1;34m[INFO]\033[0m Update DATA")
myapi.ru... |
shell.py | """Common Shell Utilities."""
import os
import sys
from subprocess import Popen, PIPE
from multiprocessing import Process
from threading import Thread
from ..core.meta import MetaMixin
from ..core.exc import FrameworkError
def exec_cmd(cmd_args, *args, **kw):
"""
Execute a shell call using Subprocess. All a... |
reliable_multicast.py | import socket
import struct
import threading
import time
import select
from src.core.utils.configuration import Configuration
from src.core.signatures.signatures import Signatures
from src.core.group_view.group_view import GroupView
from src.core.utils.channel import Channel
from src.protocol.multicast.piggyback impor... |
asyncf.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# async.py
#
# This file is part of uPodcatcher
#
# Copyright (C) 2014
# Lorenzo Carbonell Cerezo <lorenzo.carbonell.cerezo@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... |
__init__.py | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... |
MPSubscriber.py | from dppy.behavioral import pubsub
from multiprocessing import Process, SimpleQueue
class MPSubscriber(pubsub.AbsSubscriber):
def __init__(self, client, worker):
self._client = client
self._client.attach(self)
self.q = SimpleQueue()
Process(target=worker, args=(self.q,)).start()
... |
automatic_rollbacks.py | import abc
import asyncio
import json
import logging
from multiprocessing import Process
from multiprocessing import Queue
from queue import Empty
from typing import Collection
from typing import Iterator
from typing import Mapping
from typing import TYPE_CHECKING
import requests
import transitions.extensions
from myp... |
http_server.py | import threading
from collections import defaultdict
from http import HTTPStatus
from http.server import HTTPServer, BaseHTTPRequestHandler
from urllib.parse import urlparse
import pytest
class TestHandler(BaseHTTPRequestHandler):
handlers = defaultdict(dict)
@classmethod
def handler(cls, method, path)... |
test_threaded.py | import os
import signal
import threading
from multiprocessing.pool import ThreadPool
from time import time, sleep
import pytest
import dask
from dask.system import CPU_COUNT
from dask.threaded import get
from dask.utils_test import inc, add
def test_get():
dsk = {"x": 1, "y": 2, "z": (inc, "x"), "w": (add, "z",... |
TestRunnerAgent.py | # Copyright 2010 Orbitz WorldWide
#
# 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 writ... |
wsdump.py | #!/Users/gpm/Documents/Projects/dataisbeautiful-bot/venv/bin/python3
import argparse
import code
import sys
import threading
import time
import ssl
import gzip
import zlib
import six
from six.moves.urllib.parse import urlparse
import websocket
try:
import readline
except ImportError:
pass
def get_encoding... |
SentenceTransformer.py | import json
import logging
import os
import shutil
import stat
from collections import OrderedDict
from typing import List, Dict, Tuple, Iterable, Type, Union, Callable, Optional
import requests
import numpy as np
from numpy import ndarray
import transformers
from huggingface_hub import HfApi, HfFolder, Repository, hf_... |
server.py | import asyncio
import websockets
import json
import math
import time
import threading
import collections
import random
import copy
from urllib.parse import urlparse
from http.server import HTTPServer, BaseHTTPRequestHandler
toHistorical = collections.deque()
toRealTime = collections.deque()
dataRecordLock = threading... |
docker_boot.py | # encoding: utf-8
from dophon.tools import is_windows
from dophon import boot
import logging
import re
import os
import socket
import sys
import threading
import time
from urllib import request
def read_self_prop():
try:
def_prop = __import__('dophon.def_prop.default_properties', fromlist=True)
... |
speech_to_text.py | """
@title
@description
"""
import argparse
import json
import os
import threading
import time
from datetime import datetime
from time import sleep
import speech_recognition as sr
from auto_drone import DATA_DIR
class Speech2Text:
def __init__(self, input_delay: float = 0.1):
"""
get input from... |
test_decimal.py | # Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz (aahz at pobox.com)
# and Tim Peters
"""
These are the test cases for the Decim... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
store.py | import datetime
import json
import threading
import uuid
from collections import defaultdict
from copy import deepcopy
from dictdiffer import diff
from inspect import signature
from threading import Lock
from pathlib import Path
from tzlocal import get_localzone
from .logger import logger
from .settings import CACHE_... |
listComputersParallelExpands.py | import deepsecurity as api
from deepsecurity.rest import ApiException as api_exception
from deepsecurity.expand import Expand
from threading import Thread
from threading import Lock
import copy
import codecs
import re
import time
import pickle
import os
import datetime
# DSM Host & port (must end in /api)
HOST = 'http... |
state.py | """
The State Compiler is used to execute states in Salt. A state is unlike
an execution module in that instead of just executing a command, it
ensures that a certain state is present on the system.
The data sent to the state calls is as follows:
{ 'state': '<state module name>',
'fun': '<state function name... |
run.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
run - a script used for launching the PoC.
See README.md and help (./run -h) for details on usage.
Part of D&C-Clustering-POC
Copyright (c) 2020 Sturla Høgdahl Bae
"""
import argparse
import configparser
import multiprocessing
import os
import pickle
import queue
im... |
app_original.py | ######### Chi.Bio Operating System V1.0 #########
#Import required python packages
import os
import random
import time
import math
from flask import Flask, render_template, jsonify
from threading import Thread, Lock
import threading
import numpy as np
from datetime import datetime, date
import Adafruit_GPIO.I2C as I2C... |
__init__.py | import sys
#import webview
import threading
from dc.utils.commun import Commun
class App:
func = Commun()
def create_app(self):
"""Create the app from Blueprints"""
from flask import Flask
app = Flask(__name__)
from dc.views.users import user_b... |
miniterm.py | #!/home/paulo/Área de Trabalho/gnss-iot-server/site/ENV/bin/python3
#
# Very simple serial terminal
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C)2002-2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
import codecs
import os
import sys
import threading
i... |
node_tools.py | # Copyright (c) 2014 Artem Rozumenko (artyom.rozumenko@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 required b... |
test_bulkreq.py | import time
import unittest
from .mocks.httpserver import MockHTTPServer
from threading import Thread
from concurrent.futures import Future
from performance.driver.classes.channel.utils.bulk import \
injectResultTimestampFn, Request, RequestPool, BulkRequestManager
def createRequestWithFuture():
"""
Creates a ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.