source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
klee_conc_explorer.py | import ConfigParser
from ConfigParser import NoOptionError
import multiprocessing
import subprocess
import os
import sys
import utils
import signal
from utils import bcolors
def se_info(s):
print bcolors.HEADER+"[KleeConc-Info]"+bcolors.ENDC," {0}".format(s)
class ConcExplorer:
def __init__(self, config, tar... |
dashboard.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
import os
import sys
import logging
import ccs811LIBRARY
logging.basicConfig(format='%(asctime)s %(levelname)-8s %(message)s', level=logging.DEBUG, datefmt='%Y-%m-%d %H:%M:%S')
picdir = os.path.join(os.path.join(os.path.join(os.path.join(os.path.dirname(os.path.realpath(__fil... |
gui.py | from tkinter import *
from tkinter.ttk import *
import timer
import threading
import os
import sys
def resource_path(relative_path):
if hasattr(sys, '_MEIPASS'):
return os.path.join(sys._MEIPASS, relative_path)
return os.path.join(os.path.abspath("."), relative_path)
class RepetitiveTi... |
register.py | # coding: utf-8
import random
import json
import asyncio
import itchat
from threading import Thread
from .config import (STICKERS_FOR_SPAM, EVERY_REPLY_SEND_COUNT, REPLY_TEMPLATE_SPAM,
ANIMATED_QUERY_TYPE, GIFT_MONEY_KEYWORD, GIFT_MONEY_STICKER_QUERY)
from .logger import logger
from .chatroom impor... |
lmps.py | # ******************************************************************************
# pysimm.lmps module
# ******************************************************************************
#
# ******************************************************************************
# License
# ******************************************... |
SAC_run_v7.py | #!/usr/bin/env python3
import threading, queue
import time
import os
import shutil
import numpy as np
import math
import rospy
import tensorflow as tf
from sac_v14 import SAC
from env_v20 import Test
from manipulator_h_base_module_msgs.msg import P2PPose
MAX_EPISODES = 100000
MAX_EP_STEPS = 600
MEMORY_CAPACITY = 100... |
tests.py | # -*- coding: utf-8 -*-
# Unit and doctests for specific database backends.
from __future__ import unicode_literals
import datetime
from decimal import Decimal
import re
import threading
import unittest
from django.conf import settings
from django.core.management.color import no_style
from django.db import (connectio... |
connection.py | import functools
import uuid as _uuid
from threading import Thread
import importlib.util
from pathlib import Path
import rpy2
import rpy2.rinterface
import rpy2.rinterface_lib
from rpy2.robjects.packages import importr
import fdrtd.server
from fdrtd.server.microservice import Microservice
try:
from fdrtd.plugins.... |
RobotRaconteurPythonTest.py | from __future__ import print_function
import sys
import time
from os import path
import struct
import threading
import os
import traceback
import functools
import codecs
import copy
import numpy
#sys.path.append(r"C:\Users\wasonj\Documents\RobotRaconteur2\bin\out\Python")
#sys.path.append(r"C:\Users\wasonj\Documents\... |
batcher.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Modifications Copyright 2017 Abigail See
#
# 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... |
model_service_worker.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
# http://www.apache.org/licenses/LICENSE-2.0
# or in the "license" file... |
WebServer.py | from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import json
from threading import Thread
import Constants
class WebServer:
def initServer(self):
thread = Thread(target = self.run)
thread.start()
def run(self):
server_address = ("0.0.0.0", 2626)
self.handler = HTTPServer(server_address, Request... |
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... |
api_service.py |
import threading
import logging
from flask_api import FlaskAPI
from .api_v1 import api as api_v1
SERVICE_NAME = "api_service"
app = FlaskAPI(__name__)
class ApiService(threading.Thread):
def __init__(self):
super().__init__()
self.daemon = True
self._stop_event = threading.Event()
... |
words_parallel2.py | import glob
from icu import Collator, Locale
import multiprocessing as mp
import os
import re
import shutil
import time
import yaml
def worker(path, outdir, with_sorting=True):
collator = Collator.createInstance(Locale("pl_PL.UTF-8"))
separator = re.compile("[\W\d]+")
filepath = path.replace(".yml", ".txt... |
views.py | from datetime import date, datetime, timedelta
from django.contrib.auth.decorators import login_required
from django.db import transaction
from threading import Thread
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
from django.shortcuts import redirect, render
from django.views.decorators.csrf... |
subprocessBatchCommands.py | import os
import sys
import stat
import abc
from pathlib import Path
import shlex
import collections
import subprocess
from typing import List
from threading import Thread
import utils
from .baseClasses import PythonBatchCommandBase
import logging
log = logging.getLogger(__name__)
class RunProcessBase(PythonBatchCom... |
fetcher.py | # This module makes asynchronous HTTP requests in Python.
# This runs in Python 2.x* and 3.x
# This requires no special library to be installed.
# This is public domain.
# This is provided as-is.
# Go nuts.
# * HTTP header names in the response are all lowercase in Python 2.x. This seems to be
# a limitation in urll... |
test_replication.py | """TestCases for distributed transactions.
"""
import os
import time
import unittest
from test_all import db, test_support, have_threads, verbose, \
get_new_environment_path, get_new_database_path
#----------------------------------------------------------------------
class DBReplicationManager(unittest.Te... |
audio_datasets_tutorial.py | # -*- coding: utf-8 -*-
"""
Audio Datasets
==============
``torchaudio`` provides easy access to common, publicly accessible
datasets. Please refer to the official documentation for the list of
available datasets.
"""
# When running this tutorial in Google Colab, install the required packages
# with the following.
# ... |
wallet_downloader.py | import json, os, requests, threading
from sqlalchemy.sql.expression import join
from database import *
from loguru import logger
from time import sleep
os.makedirs('wallets', exist_ok=True)
def get_all_wallets():
query = "SELECT DISTINCT(address) from outputs UNION SELECT DISTINCT(address) from inputs;"
with ... |
picar.py | #!/usr/bin/python3
# File name : picar.py
# Description : encapsulate an Adeept Robotic PiCar
import time
import threading
from iotServerLib import piStripLed, piIotNode, piLineTracking
from iotServerLib.iotCommon import ON, OFF, RGB
from piServices.piUtils import timePrint, startThread
import picarDrive
import pic... |
__init__.py | from flask import Flask
app = Flask(__name__)
from app import apis
from app import kafka_consumer
import threading
threading.Thread(target=kafka_consumer.start_consumer).start()
|
commons.py |
import logging
import sys
import gzip
import numpy as np
from tqdm import tqdm
import shutil
import itertools
# COMMIT_FOLDER = 'commits/'
from os import listdir
import re
import pandas as pd
from os.path import isfile, join, isdir
import pickle as p
from subprocess import Popen, PIPE
from subprocess import CalledPro... |
AsynchronousSender.py | from .SenderBase import SenderBase, DEFAULT_ENDPOINT_URL
from threading import Lock, Thread
class AsynchronousSender(SenderBase):
"""An asynchronous sender that works in conjunction with the :class:`AsynchronousQueue`. The sender object will
start a worker thread that will pull items from the :func:`queue`. T... |
tk_raw_analy_ver0.4_1.py |
## 영상 처리 및 데이터 분석 툴
from tkinter import *; import os.path ;import math
from tkinter.filedialog import *
from tkinter.simpledialog import *
## 함수 선언부
def loadImage(fname) :
global window, canvas, paper, filename, inImage, outImage, inW, inH, outW, outH
fsize = os.path.getsize(fname) # 파일 크기 확인
inH... |
Simulation.py | # Copyright 2017 Battelle Energy Alliance, LLC
#
# 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... |
var_7_24.py | #!/usr/bin/env python3
# -*- config: utf-8 -*-
# Вариант 7 и 24
import math
from threading import Thread
def sm_first(x, n):
return ((-1) ** (n + 1) * math.sin(n) * x) / n
def first(x, n):
n = n
x = x
eps = 1.0E-7
previous = 0
current = sm_first(x, n)
n += 1
t... |
main.py | import time
import functions
import find_window
import os
import sys
import threading
import tkinter as tk
from tkinter import messagebox
from tkinter import ttk
from playsound import playsound
# VARS
stopped = False
## Main window
main_window = tk.Tk()
main_window.title("NEBEL'S SLACKER TOOLS")
#mai... |
remote.py | import os
import time
import signal
import atexit
import weakref
import logging
import subprocess
import concurrent
from threading import Thread
import multiprocessing as mp
from distributed import Client
from .ssh_helper import start_scheduler, start_worker
__all__ = ['Remote']
logger = logging.getLogger(__name__)... |
Window.py | import tkinter as tk
import tkinter.messagebox as mb
from Character import Character
import Generator
from Runner import Runner
import ScriptMaker as sm
from Entry import Entry
from Reward import Reward
import TwitchEventHandler
import threading
import json
runner = Runner()
runner.playAsFemale = True
li... |
runner.py | #!/usr/bin/env python2
# Copyright 2010 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.
"""This is the Emscripten test runner. To run ... |
db.py | # -*- coding:utf-8 -*-
# author: szy
# time: 2017/11/8 12:07
# email: shizhenyu96@gmail.com
# -*- coding:utf8 -*-
# Author: shizhenyu96@gamil.com
# github: https://github.com/imndszy
"""
设计db模块的原因:
1. 更简单的操作数据库
一次数据访问: 数据库连接 => 游标对象 => 执行SQL => 处理异常 => 清理资源。
db模块对这些过程进行封装,使得用户仅需关注SQL执行。
2. 数据安全
... |
run.py | #!python
import time
import argparse
import signal
import multiprocessing
from multiprocessing import Process
import concurrent.futures
import os
import logging
import yaml
from multiprocessing_logging import install_mp_handler
from kafka import KafkaAdminClient
# from numba import jit
from minas import producer
from... |
avtech.py | # Avtech loader
import sys, time, requests
from threading import Thread
import random
num = 1
host_server = "23.130.192.132"
ips = open(sys.argv[1], "r").readlines()
filename = random.randint(1, 100) # making a random num for first of file name so cant get killed ez and avoid any other probs
filename = s... |
mainpy.py | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 20 2017
This the main python script for datataking and processing
@author: Dong Wang
"""
from ethernet_t import *
from dataprocess_t import *
from command import *
from i2c_control import *
import sys
import os
import shlex
import socket
import time
import select
from thre... |
JChip.py | import socket
import sys
import time
import datetime
import atexit
import re
import os
import wx
import wx.lib.newevent
import Utils
import Model
import select
from threading import Thread as Process
from six.moves.queue import Queue, Empty
ChipReaderEvent, EVT_CHIP_READER = wx.lib.newevent.NewEvent()
stripLeadingZer... |
client.py | # -*- coding: utf-8 -*-
"""
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
... |
start_check_automap_version.py | # -*- coding: utf-8 -*-
from base.log import *
import os
from multiprocessing import Process
import redis_pool
def gen_id():
r = redis_pool.get('dornaemon')
return r.incr('deploy_id')
def do(app_id, version, deploy_id):
log_path = 'html/deploy_logs/%d.txt' % deploy_id
cmd = 'python check_automap_ver_v2.py %s %... |
form.py | import ipywidgets as widgets
import threading
import time
from IPython.display import display
from typing import Optional
from .api import cancel, get_job
from .model import Job, JOBS
from ..debug import get_debug_view
from ..info import InfoComponent
def obs_job_form(job: Job, mock=False):
get_job_func = _get_... |
__init__.py | """Simple python wrapper for controlling an aster account"""
import socket
import ssl
import json
import threading
import base64
from typing import *
from .user import User
from .channel import Channel
from .message import Message
from .sync import SyncData, SyncServer
from .emoji import Emoji
DEBUG = True
def debug... |
mock_unit.py | from pythonfiledatastore import main_executor
from pythonfiledatastore import operations
from time import sleep
import threading
class mock_unit:
client = "hopstre"
key = "mock_test"
key_int = 12
key_more_than_32 = "Reamsochung Chongapipa Aiill CFCS6"
value_dict = {"Registered_firm" :
{
"... |
main.py | from fastapi import FastAPI, Response
import os
import sys
import traceback
import json
import time
import asyncio
import logging
import pprint
import ssl
import pathlib
import uvicorn
from multiprocessing import Process, Queue
import random
from config import config
from is_enabled import is_enabled
from logic impo... |
common.py | # Copyright (C) 2008 The Android Open Source Project
#
# 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 ... |
ai_test.py | import unittest
import json
import requests
from app import app
from threading import Thread
from time import sleep
from copy import copy
from functools import reduce
# URL pointing to your local dev host
LOCAL_URL = "http://localhost:5000"
# Constants
MHP = 10
ATK = 2
MHP_INCREMENT = 4
ATK_INCREMENT = 2
# Sample re... |
reliable_multicast.py | import os
import sys
import multiprocessing
import time
import threading
sys.path.append(sys.path[0] + "/../..")
from src.core.utils.configuration import Configuration
from src.core.utils.channel import Channel
from src.protocol.base import Message
from src.core.multicast.reliable_multicast import ReliableMulticast
fro... |
test_rest_v2_0_0.py | import json
import os
import random
import shutil
import string
import subprocess
import sys
import time
import unittest
from multiprocessing import Process
import requests
from dateutil.parser import parse
from test.apiv2.rest_api import Podman
PODMAN_URL = "http://localhost:8080"
def _url(path):
return PODMA... |
thesis.py | import os
import pathlib
import numpy as np
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
import zipfile
from collections import namedtuple
from io import StringIO
from matplotlib import pyplot as plt
from PIL import Image
from IPython.display import display
import cv2
import tim... |
__init__.py | import platform
import Queue
import threading
import time
from ..log import warning, exception
pyTTS = None
TTS_TIMEOUT = .1 # in seconds
_tts = None
_is_speaking = False
_queue = Queue.Queue()
def is_speaking():
if not is_available: return False
# The TTS doesn't always start speaking at once, but we do... |
core.py | """
Core components of Home Assistant.
Home Assistant is a Home Automation framework for observing the state
of entities and react to changes.
"""
import enum
import functools as ft
import logging
import os
import signal
import threading
import time
from types import MappingProxyType
import homeassistant.helpers.tem... |
base.py | import argparse
import base64
import copy
import itertools
import json
import os
import re
import sys
import threading
import time
import uuid
import warnings
from collections import OrderedDict
from contextlib import ExitStack
from typing import Optional, Union, Tuple, List, Set, Dict, overload, Type
from .builder im... |
draw.py | """
pygame based tool for hand labeling Planet images
author: Tuguldur Sukhbold
usage:
python draw.py fieldID
set datapath below to where you keep Zindi data
there is an issue of multiprocessing on Windows-Anaconda; use drawWindows.py
"""
datapath = '../../../d/'
import os
import numpy as np
import pandas a... |
ocr_handler.py | # -*- coding: utf-8 -*-
import os
import io
import sys
import cv2
import numpy
import pytesseract
from tqdm import tqdm
from pdf2image import convert_from_bytes
from queue import Queue
from threading import Thread
from multiprocessing import Lock
from multiprocessing import Pool
class OCR_Handler():
"""
OC... |
run_generation.py | # Parts of this file were adopted from https://github.com/huggingface/transformers.
# See the original copyright notice below.
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed unde... |
ticker.py | # -*- coding: utf-8 -*-
"""
ticker.py
Websocket implementation for kite ticker
:copyright: (c) 2021 by Zerodha Technology Pvt. Ltd.
:license: see LICENSE for details.
"""
import six
import sys
import time
import json
import struct
import logging
import threading
from datetime import datetime
from twis... |
tello.py | # coding=utf-8
import logging
import socket
import time
import threading
import cv2
from threading import Thread
from .decorators import accepts
class Tello:
"""Python wrapper to interact with the Ryze Tello drone using the official Tello api.
Tello API documentation:
https://dl-cdn.ryzerobotics.com/downl... |
test_utils_misc.py | import secrets
import threading
import psutil
import time
from multiprocessing import Process
import os
import pytest
import requests
from ansys.openapi.common._util import (
CaseInsensitiveOrderedDict,
OIDCCallbackHTTPServer,
)
class TestCaseInsensitiveOrderedDict:
@pytest.fixture(autouse=True)
def... |
test_driver_remote_connection_threaded.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... |
logica.py | from PyQt5.QtCore import pyqtSignal, QObject
import parametros as p
from threading import Thread
from matplotlib import pyplot as plt
import pandas as pd
from datetime import datetime
import os
class Logica(QObject):
senal_carga_lista = pyqtSignal()
senal_terminar = pyqtSignal()
def __init__(self):
... |
standalone.py | """Support for standalone client challenge solvers. """
import argparse
import collections
import functools
import logging
import os
import socket
import sys
import threading
from six.moves import BaseHTTPServer # type: ignore # pylint: disable=import-error
from six.moves import http_client # pylint: disable=import... |
03_threads_with_argument.py | import time
import threading
start = time.perf_counter()
def do_something(seconds):
print(f'Sleeping {seconds} second(s)..')
time.sleep(seconds)
print('Done Sleeping..')
threads = []
for _ in range(10):
t = threading.Thread(target=do_something, args=[1.5])
t.start()
threads.append(t)
for t... |
main.py | from ros.processor.inventory_events_consumer import InventoryEventsConsumer
from ros.processor.insights_engine_result_consumer import InsightsEngineResultConsumer
from ros.processor.garbage_collector import GarbageCollector
from prometheus_client import start_http_server
import threading
from ros.lib.config import METR... |
notify.py | #!/usr/bin/env python3
# _*_ coding:utf-8 _*_
import base64
import hashlib
import hmac
import json
import os
import re
import threading
import time
import urllib.parse
import requests
# 原先的 print 函数和主线程的锁
_print = print
mutex = threading.Lock()
# 定义新的 print 函数
def print(text, *args, **kw):
"""
使输出有序进行,不出现多线... |
train_q_model.py | """
This script will train a q model
"""
import tensorflow as tf
import numpy as np
import time
import threading
import matplotlib.pyplot as plt
import matplotlib
from tkinter import *
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import matplotlib.animation as animation
from game import Game2048
f... |
build_pretraining_dataset.py | # coding=utf-8
# Copyright 2020 The Google Research 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 applicab... |
redis_lock.py | # -*- coding: utf-8 -*-
"""
Created on 2019/11/5 5:25 PM
---------
@summary:
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import threading
import time
from feapder.utils.log import log
class RedisLock(object):
def __init__(self, key, redis_cli, wait_timeout=0, lock_timeout=86400):
"""
... |
worker_handlers.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
hclib.py | """Wrapper for the hack.chat API."""
import json
import re
import ssl
import threading
import time
import websocket
class HackChat(object):
"""This receives and sends data from and to hack.chat."""
def __init__(self, callback, nick, channel, pwd=None,
url="wss://hack.chat/chat-ws", require... |
runtest.py | from __future__ import absolute_import, division, print_function
import os
import pytest
import re
import string
import sys
import threading
import time
import unittest
from collections import defaultdict, namedtuple, OrderedDict
import numpy as np
import ray
import ray.ray_constants as ray_constants
import ray.test... |
datasets.py | # Dataset utils and dataloaders
import glob
import math
import os
import random
import shutil
import time
from itertools import repeat
from multiprocessing.pool import ThreadPool
from pathlib import Path
from threading import Thread
import cv2
import numpy as np
import torch
from PIL import Image, ExifTags
from torch... |
sxr_client.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#########################################################################
# Copyright/License Notice (Modified BSD License) #
#########################################################################
###################################################... |
C2Server.py | #!/usr/bin/env python3
import os, sys, datetime, time, base64, logging, signal, re, ssl, traceback, threading
from urllib.request import urlopen, Request
from urllib.error import HTTPError, URLError
from socketserver import ThreadingMixIn
from http.server import BaseHTTPRequestHandler, HTTPServer
from poshc2.server.I... |
threadinit.py | #!/usr/bin/python3
# Python program to illustrate the concept
# of threading
# concurrent access of threads to the shared variable cause race condition
# however if the shared variable is static you should be good...?
import os
import time
import threading
"""
"aws s3 ls s3://bucket | grep -cE '/[z]+/'"
... |
concurrency.py | __all__ = ['stream_batched', 'call_once', 'threadlocal', 'shared_call']
import functools
import threading
import time
from collections.abc import Callable, Sequence
from concurrent.futures import Future
from contextlib import ExitStack
from queue import Empty, SimpleQueue
from threading import Thread
from typing impor... |
webcamhooker.py | import cv2
from subprocess import Popen, PIPE
from PIL import Image
import numpy as np
import argparse
from enum import IntEnum, auto
import sys, math, os, time
import threading
import queue
from keras.models import load_model
import tensorflow as tf
sys.path.append(os.path.join(os.path.dirname(__file__), 'UGATIT'))... |
test_shared_state.py | import os
import sys
import threading
import time
import uuid
from astropy.io import fits
from multiprocess.context import TimeoutError
from multiprocess.managers import BaseProxy, ListProxy, RemoteError
import numpy as np
import pytest
from catkit.testbed.caching import MutexedDict, UserCache
from catkit.multiproces... |
__init__.py | """
A library of various helpers functions and classes
"""
import inspect
import sys
import socket
import logging
import threading
import time
import random
from rpyc.lib.compat import maxint # noqa: F401
class MissingModule(object):
__slots__ = ["__name"]
def __init__(self, name):
self.__name = nam... |
service.py | # -*- coding: utf-8 -*-
# Author: asciidisco
# Module: service
# Created on: 13.01.2017
# License: MIT https://goo.gl/5bMj3H
"""Kodi plugin for Netflix (https://netflix.com)"""
import threading
import socket
from SocketServer import TCPServer
from xbmc import Monitor
from resources.lib.KodiHelper import KodiHelper
f... |
app.py | # encoding: utf-8
"""
A REST API for Salt
===================
.. py:currentmodule:: salt.netapi.rest_cherrypy.app
:depends:
- CherryPy Python module.
Note: there is a `known SSL traceback for CherryPy versions 3.2.5 through
3.7.x <https://github.com/cherrypy/cherrypy/issues/1298>`_. Please use
... |
square.py | from multiprocessing import Process
def squared(x):
print(x**2)
# create parallel processes
procs = [Process(target=squared, args=[x]) for x in range(10)]
# start all processes
for p in procs:
p.start()
# wait for all tasks to finish
for p in procs:
p.join()
|
service.py | # -*- coding: utf-8 -*-
# Author: asciidisco
# Module: service
# Created on: 13.01.2017
# License: MIT https://goo.gl/5bMj3H
# pylint: disable=wrong-import-position
"""Kodi plugin for Netflix (https://netflix.com)"""
from __future__ import unicode_literals
import sys
import threading
import traceback
# Import and int... |
test_dag_serialization.py | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
test_queue.py | import argparse
import asyncio
import pytest
import signal
import multiprocessing
import time
import urllib3
import gevent
from controller.app import main, set_args
from controller.app import server as mlq_api_server
from mlq.queue import MLQ
@pytest.fixture
def http():
return urllib3.PoolManager()
@pytest.fixt... |
rdd.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
run_mxnet_server.py | """
This is a sample stub of loadgen with multiple processes support.
Each process sets its affinity by a proc list.
Loadgen is a producer, which calls issue_queries(). issue_queries() gets query
from loadgen and puts query id/sample indices into an input queue.
Each Consumer(process)'s run() reads input queue, calls... |
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... |
search.py | #!/usr/bin/python3.8
import curses,time,os # Import some main dependencies
import getpass,sys,signal # Used for getting user information and for passing system arguments
import shutil # Tree level copy, move, delete
from distutils.dir_util import copy_tree
i... |
run.py | import os
import threading
import time
import sys, getopt
def client(i,results,loopTimes):
print("client %d start" %i)
command = "./single-cold_warm.sh -R -t " + str(loopTimes)
r = os.popen(command)
text = r.read()
results[i] = text
print("client %d finished" %i)
def warmup(i,warmupTimes,a... |
laikago.py | import pybullet as p
import pybullet_data as pd
import time, psutil, os
import numpy as np
from uuid import uuid1
import rocksdb, json
from multiprocessing import Process
import copy
useMaximalCoordinates = True
needLog = False
# db = rocksdb.DB("fyp.db", rocksdb.Options(create_if_missing=True))
logid = 0
class Lai... |
__init__.py | import os
import sys
import time
import glob
import socket
import winreg
import locale
import hashlib
import tempfile
import datetime
import threading
import subprocess
from ctypes import windll
from urllib.request import urlopen
import psutil
import win32gui
from PySide2.QtGui import *
from PySide2.QtCore import *
fr... |
UltrasonikSensor.py | import RPi.GPIO as GPIO
from time import sleep, time
from threading import Thread
class UltrasonikSensor:
def __init__(self, echo, trig, setup=GPIO.BOARD):
self.echo = echo
self.trig = trig
self.sure = 0
self.anlikOlcum = 0
GPIO.setmode(setup)
GPIO.setup(self.t... |
bnArb.py | import websockets, asyncio, json, time
from threading import Thread
from binance.client import Client
class BnArber:
"""
Triangular Arbitrage Bot for Binance.
Trading Patterns:
- USDT -> BTC -> ALTCOIN -> USDT
- USDT -> ALTCOIN -> BTC -> USDT
"""
def __init__(self, curs, ... |
pioneer_avr.py | """ API for Pioneer Network Receivers. """
# pylint: disable=logging-fstring-interpolation,broad-except
import logging
import traceback
import socket
import telnetlib
import time
import random
from threading import Thread, Event, Lock
_LOGGER = logging.getLogger(__name__)
MAX_VOLUME = 185
MAX_VOLUME_ZONEX = 81
MAX... |
test_closing.py | from fixtures import * # noqa: F401,F403
from lightning import RpcError
from utils import only_one, sync_blockheight, wait_for, DEVELOPER, TIMEOUT, VALGRIND, SLOW_MACHINE
import queue
import pytest
import re
import threading
import unittest
@unittest.skipIf(not DEVELOPER, "Too slow without --dev-bitcoind-poll")
de... |
main.py |
from conferenceCalendar.run_scrapy import script
import shlex
import subprocess
from multiprocessing import Process, Queue , Manager
def hello_http(request):
queue = Queue()
# wrap the spider in a child process
manager = Manager()
return_dict = manager.dict()
main_process = Pro... |
lifx-poly.py | #!/usr/bin/env python3
##!/home/e42/dev/py3_envs/udi-lifx-poly-venv/bin/python
"""
LiFX NodeServer for UDI Polyglot v2
by Einstein.42 (James Milne) milne.james@gmail.com
"""
import polyinterface
import time
import sys
import lifxlan
from copy import deepcopy
import json
import yaml
from threading import Thread
from pa... |
xbox.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from os.path import join, dirname
sys.path.insert(0, join(dirname(__file__), '..'))
import simulator
simulator.load('/home/wang/CARLA_0.9.9.4')
import carla
import pygame
import threading
class JoyStick:
def __init__(self, verbose=False, clo... |
util.py | import io
import threading
import wx
PROGRESS_STYLE = wx.PD_SMOOTH | wx.PD_APP_MODAL | wx.PD_ELAPSED_TIME | wx.PD_CAN_ABORT | wx.PD_AUTO_HIDE
def start_thread(func, *args):
thread = threading.Thread(target=func, args=args)
thread.setDaemon(True)
thread.start()
return thread
class MyBytesIO(io.Byte... |
nastro_app.py |
# -*- coding: utf-8 -*-
import remi.gui as gui
from remi.gui import *
from remi import start, App
import nastro_mindvision
import widgets
import cv2
import threading
import time
import numpy as np
import image_utils
import glob #to list files
import shelve
class OpencvImageWidget(gui.Image):
def __init__(self, ... |
DummyServer.py | import time
import threading
import os
import logging
logging.basicConfig(format='%(message)s', level=logging.INFO)
'''
logging.debug('This is a debug message')
logging.info('This is an info message')
logging.warning('This is a warning message')
logging.error('This is an error message')
logging.critical('This is a cri... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.