source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
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.
import argparse
import json
import multiprocessing
imp... |
latch_test.py |
import threading
import unittest2
import mitogen.core
import testlib
class EmptyTest(testlib.TestCase):
klass = mitogen.core.Latch
def test_is_empty(self):
latch = self.klass()
self.assertTrue(latch.empty())
def test_is_nonempty(self):
latch = self.klass()
latch.put(N... |
wallet.py | # Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights t... |
multiprocess_module.py | import tensor
import NN as nn
import multiprocessing
class Process:
def __init__(self, process_num):
self.process_num = process_num
def run(self, iters):
for () in range(self.process_num - 1):
multiprocessing.Process(target=self._run, args=(iters,))
self._run(iters)
... |
http_server.py | __author__ = "mashed-potatoes"
from os import curdir, mkdir, _exit
from os.path import join, isdir
from threading import Thread
from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib.parse import urlparse, parse_qs
from pymitter import EventEmitter
from modules.config import HOME_PATH
class StoreHand... |
gcsio.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... |
_debugger_case_check_tracer.py | import threading, atexit, sys
from collections import namedtuple
import os.path
if sys.version_info[0] >= 3:
from _thread import start_new_thread
else:
from thread import start_new_thread
FrameInfo = namedtuple('FrameInfo', 'filename, name, f_trace')
def _atexit():
sys.stderr.flush()
sys.stdout.flus... |
bkg_metrics_job_script.py | import time
import multiprocessing as mp
import pymongo
from datetime import datetime, timedelta
from pymongo import MongoClient
import logging
import sys
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG);
MONGO_DB_URL = 'mongodb://localhost:27017/'
DATABASE_NAME = 'hpc_monitoring'
EPOCH_BEGIN_DATETIME = ... |
host.py | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyright (c) 2012 University Of Minho
# (c) Copyright 2013 Hewlett-Pa... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Copyright (c) 2017-2019 The Raven Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test ravend shutdown."""
from threading import Thread
... |
maintenance.py | # Copyright 2019 Red Hat, 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... |
mplot_thread.py | """
Project: Visual Odometry
Name : Heru-05 | M09158023
Date
"""
import time
import sys
import numpy as np
import platform
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
import multiprocessing as mp
from multiprocessing import Process, Queue, Lock, RLock, Value
import ctypes
kPlotSleep = 0.04
... |
https.py | from __future__ import absolute_import, unicode_literals
import ssl
import sys
import socket
import threading
import contextlib
try:
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
except ImportError:
from http.server import HTTPServer, BaseHTTPRequestHandler
from .. import results
from ..utils ... |
test_run_and_rebot.py | import unittest
import time
import glob
import sys
import threading
import tempfile
import signal
import logging
from io import StringIO
from os.path import abspath, curdir, dirname, exists, join
from os import chdir, getenv
from robot import run, run_cli, rebot, rebot_cli
from robot.model import SuiteVisitor
from rob... |
dictionary_attack.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import paramiko # external package
import ftplib
import threading
import queue
import socket
from ftplib import FTP
from common_utils import menu_utils
from common_utils import file_utils
import config_params
from os import listdir
from os.path import isfile, join
... |
spider_3x3.py | """The 3x3 spider light on the cieling
https://www.amazon.com/gp/product/B07XRDB4QT/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
"""
import logging
import multiprocessing as mp
import time
import numpy as np # type: ignore
import music_visualization_system as mvs
import pymvf
LOGGER = logging.getLogger(__name_... |
pypanda_target.py | from threading import Thread
from time import sleep
from os.path import abspath
from avatar2.targets import PandaTarget
from ..watchmen import watch
from .target import action_valid_decorator_factory, TargetStates
class PyPandaTarget(PandaTarget):
'''
The pypanda target is a PANDA target, but uses pypanda to... |
test_connection.py | import time
import multiprocessing as mp
from threading import Thread
from unittest.mock import patch
import pytest
import rethinkdb as r
def test_get_connection_returns_the_correct_instance():
from bigchaindb.backend import connect
from bigchaindb.backend.connection import Connection
from bigchaindb.bac... |
dataengine-service_install_libs.py | #!/usr/bin/python
# *****************************************************************************
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The A... |
client.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Hello World client in Python
# Connects REQ socket to tcp://localhost:5555
# Sends "Hello" to server, expects "World" back
#
import zmq
import threading
import queue
from zmqcs.common.message import MessageBase, CommandMSG, AsyncMSG
from zmqcs.common.defaults im... |
test_file_utils.py | import asyncio
import io
import os
import threading
from typing import AsyncGenerator
import pytest
from contaxy.utils.file_utils import (
FileStreamWrapper,
FormMultipartStream,
SyncFromAsyncGenerator,
)
@pytest.fixture()
def metadata() -> dict:
return {
"filename": "test.csv",
"hea... |
plot_benchmarks.py | #!/usr/bin/env python3
# Copyright Hans Dembinski 2019
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
from matplotlib import pyplot as plt, lines
import shelve
from collections import defaultdict
from run_benchmarks ... |
Main.py | #!/usr/bin/python3
import pygame, sys, random
from pygame.locals import *
import multiprocessing
import colorama
import sys
#from multiprocessing import Process, Queue
import Tasks
from Tank import *
from Tree import *
from Train import *
from Lake import *
from Tracks import *
from Sheep import *
from Fence import ... |
status_server.py | from waitress import serve
from flask import Flask, request
import threading
import http
class StatusServer(object):
def __init__(self):
self.source_done = threading.Event()
self.source_error_event = threading.Event()
self._source_error_message = None
self.sink_done = threading.Ev... |
local_service_handler.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... |
main_window.py | #!/usr/bin/env python3
#
# 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 with... |
multiprocess.py | import config
import multiprocessing,cv2,copy
from multiprocessing import Queue
from src.utilities.tesseract.helper import tess_eval,add_lines_to_tess_queue
from src.utilities.tesseract.utils import frequent_height,scale_coords,crop_region,get_tess_text
from src.utilities.tesseract.dynamic_adjustment import coord_adju... |
main.py | #!/bin/python3.8
import subprocess
import json
import time
import threading
class Interrupt ():
def __init__(self, code: int, response: str):
self.code = code
self.response = response
def __repr__(self):
return str(self.__dict__)
class Program ():
def __init__(self, exec: str, i... |
main.py | import datetime
import json
import logging
import random
import sys
import requests
import threading
import time
import robonomicsinterface as RI
from typing import List
# set up logging
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s %(levelname)s: %(message)s",
)
API_KEY = 'f601b0c9e92272482e... |
distributed.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Distributed helpers."""
import multiprocessing
import os
import signal
import threading
import traceback
import t... |
test_logger_runner.py | #!/usr/bin/env python3
import logging
import os
import sys
import tempfile
import threading
import time
import unittest
import warnings
sys.path.append('.')
from logger.readers.text_file_reader import TextFileReader
from logger.writers.text_file_writer import TextFileWriter
from server.logger_runner import LoggerRun... |
client.py | import time
from tkinter import *
from PIL import Image, ImageTk
import socket
from time import sleep
import threading
import sys
c = socket.socket()
HOST = 'localhost'
PORT = 5000
HEADER = 1024
def connect_to_server():
global c
try:
c.connect((HOST, PORT))
welcomeScreen()
except socket.e... |
setup.py | import cv2
import numpy as np
import serial
import threading
from time import sleep
stop_Cascade = cv2.CascadeClassifier('stop_sign.xml')
speed_Cascade = cv2.CascadeClassifier('haarCascade.xml')
yield_Cascade = cv2.CascadeClassifier('yield.xml')
fourcc = cv2.VideoWriter_fourcc(*'XVID')
out = cv2.VideoWriter('A... |
human_friendly.py | """This module manages the interaction with the user and
sends the user's commands to a file read by the artificial
primary investigator."""
normal = """The computer is currently running Theodore's AP Research project
between midnight and 2:30 pm. Type 'quit' to safely quit the program.
Type... |
process.py | # -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import, with_statement
import copy
import os
import sys
import time
import errno
import types
import signal
import logging
import threading
import contextlib
import subprocess
import multiprocessing
import multiprocessing.util
# Import salt... |
kernel.py | #!/usr/bin/env python3
#!/usr/bin/python3.8
# OpenCV 4.2, Raspberry pi 3/3b/4b - test on macOS
from camera.camera_async import CameraAsync
from camera.frame import Frame
from camera.record import Record
from camera.streaming import Streaming
from camera.type_cam import TypeCam
from dto.record import RecordDTO
from thre... |
updateIndex.py | import time
import os
import threading
def generateIndex(cwd, date):
f = open(os.path.join(cwd, "mesAct", "index.html"), 'w')
messageList = ""
for i in range(1, 32):
messageList += """
<li class="list-group-item"><a href="./messages_"""+str(i).center(2, "0")+"""{0}.html" class="stretched-li... |
simple_fork.py | import multiprocessing
import select
import socket
from time import time
from qactuar import ASGIApp, Config
from qactuar.processes.simple_fork import make_child
from qactuar.servers.base import BaseQactuarServer
class SimpleForkServer(BaseQactuarServer):
def __init__(
self,
host: str = None,
... |
remotecontroltransmitter.py | # Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC organizers
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, ... |
serv.py | import os,sys,logging
import signal, time
from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
import threading
import Queue
import socket
import StringIO
try:
import sqlite3
except ImportError:
from pysqlite2 import dbapi2 as sqlite3
import bb.server.xmlrpc
import prserv
import prser... |
scrape.py | import requests as r
from json import loads, dumps
from os import mkdir, chdir, listdir, getcwd
import threading
from sys import argv
class Parse:
def __init__(self, data : str):
self.data = loads(data)
def refine(self) -> str:
data = []
for item in self.data['data']:
del ... |
test_aiowebsocket.py | import time
import pytest
import asyncio
import threading
import contextlib
import urllib.parse
import urllib.request
import aiohttp
from flask import Flask, request
from websocket import WebSocket
from werkzeug.debug import DebuggedApplication
from .. import AioHTTP, wrap_wsgi_middleware, async, websocket
class Se... |
iot_gateway.py | import time, random
import requests, json
import uuid, hashlib, hmac
import paho.mqtt.client as mqtt
from threading import Thread
from datetime import datetime
DEVICE_NO = '02-0000b5'
PRODUCT_KEY = 'A4MU33FGXY4URY6Z'
CLOUD_PASSWORD =''
SECRET_KEY = 'a234d8152d2f6ef163baa68acbfb5db0'
GATEWAY_URL = 'http:... |
executors.py | import multiprocessing
import os
import signal
import subprocess
import sys
import threading
import warnings
from concurrent.futures import ThreadPoolExecutor
from concurrent.futures import TimeoutError as FutureTimeout
from functools import wraps
from typing import TYPE_CHECKING, Any, Callable, List, Union
import pre... |
server.py | #!/usr/bin/env python3
"""
This script launch the server, used as a master to handle
clients configuration and validate credentials.
It can be run on any platform with python and pip requierments installed
"""
__version__ = '0.1'
""" """
from configparser import ConfigParser
import json
import time
from threading im... |
run_webgpu_cts.py | # Copyright 2021 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 argparse
import json
from six.moves import BaseHTTPServer
from six.moves import urllib
import sys
from tempfile import mkstemp
import threading
import... |
splink_client_project.py | """
Client-side sPLINK project to compute local parameters
Copyright 2021 Reza NasiriGerdeh and Reihaneh TorkzadehMahani. 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 t... |
basic_example.py | """Toggles the state of a digital output on an EL1259.
Usage: python basic_example.py <adapter>
This example expects a physical slave layout according to
_expected_slave_layout, see below.
"""
import sys
import struct
import time
import threading
from collections import namedtuple
import pysoem
class BasicExampl... |
test_ssl.py | # Test the support for SSL and sockets
import sys
import unittest
from test import support
import socket
import select
import time
import datetime
import gc
import os
import errno
import pprint
import urllib.request
import threading
import traceback
import asyncore
import weakref
import platform
import functools
impor... |
ui.py | #!/usr/bin/env python
import json
import re
import threading
from rosgraph.masterapi import Master
import rospy
from rospy.exceptions import ROSInterruptException
from std_msgs.msg import Empty, String
from needybot.services.base import BaseServiceClient, BaseService
import needybot.lib.channels as nb_channels
from... |
loader.py | from typing import Any, Callable, Iterable, Union
from itertools import tee
import queue
import sys
import threading
import numpy as np
import torch
from torch.utils.data import DataLoader
class ILoaderWrapper(DataLoader):
"""Loader wrapper interface.
Args:
loader: torch dataloader.
"""
de... |
Run.py | #!/usr/bin/env python3
import os
import sys
import time
import glob
import socket
import argparse
import threading
import traceback
import _pickle as pickle
from prettytable import PrettyTable
from pimdm import Main
from pimdm.tree import pim_globals
from pimdm.daemon.Daemon import Daemon
VERSION = "1.3.1"
def cli... |
simple_tokenize.py | # Converts C/C++ files flatly into their tokens
import tokenizer.main as tokenizer
import helpers.common as common
import helpers.io as io
from multiprocessing import Process
def doAssignment(students, assign, helpers):
helpers.printf("tokenizing '{}' in parellel...\n".format(assign.name))
# for each student
for s... |
server.py | import uvicorn
from fastapi import FastAPI
from pydantic import BaseModel
import os
import logging
import json
import time
from threading import Thread
from multiprocessing import Process, Pool
from functools import partial
import boto3
import botocore
import sys
import cache
class LoadMessage(BaseModel):
file_t... |
host_callback_test.py | # Copyright 2020 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
mainwindow.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from PySide import QtCore, QtGui
import time, sys
import threading
import os
execfile("shift_registers.py") # Import the shift registers code from other file
execfile("touch_sound.py") # MPR121 sensor/sounds
execfile("read_lifs.py")
class Ui_MainWindow(QtCore.Q... |
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... |
face_detector_node.py | #!/usr/bin/env python
import rospy
import numpy as np
import math
from duckietown_msgs.msg import Twist2DStamped, LanePose
from sensor_msgs.msg import CompressedImage, Image
from cv_bridge import CvBridge, CvBridgeError
import cv2
import sys
from duckietown_utils.jpg import image_cv_from_jpg
import time
import threadi... |
audio_reader.py | import fnmatch
import os
import random
import re
import threading
import librosa
import numpy as np
import tensorflow as tf
FILE_PATTERN = r'p([0-9]+)_([0-9]+)\.wav'
def get_category_cardinality(files):
id_reg_expression = re.compile(FILE_PATTERN)
min_id = None
max_id = None
for filename in files:
... |
PathfinderInstaller.py | import os
import platform
import stat
import subprocess
from tkinter import *
from tkinter import filedialog
from tkinter.ttk import *
import shutil
from threading import Thread
import requests
from zipfile import ZipFile
from io import BytesIO
import re
import pathlib
if platform.system() == 'Windows':
from winre... |
util.py | """
Code taken from https://github.com/andrew-abimansour/QCEngine
Provides QCEngine utils for executing a process, with support for handling large data files.
"""
from typing import Tuple, Dict, Optional, Any, List, Union, BinaryIO, TextIO
from threading import Thread
import time
from contextlib import contextmanager
... |
discovery.py | #!/usr/bin/python
import socket
import struct
import threading
import logging
known_services = {}
callbacks = []
cont = False
def init():
logging.debug("initiating discovery")
global cont, thread
cont = True
thread = threading.Thread(target=run)
thread.start()
def run():
global cont
cont = True
MC... |
_server.py | # Copyright 2016, Google 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 copyright
# notice, this list of conditions and the f... |
state.py | import multiprocessing
import importlib
import sys
import os
class State:
''' Handles the Unicorn HAT state'''
def __init__(self, is_hd=True):
self._process = None
self.set_model(is_hd)
def set_model(self, is_hd):
self.is_hd = is_hd
if self.is_hd is True:
imp... |
Exchange.py | """
The Ouch Team
Exchange Integration
Integration of all required classes together into a working implementation. Will be changed
as new components are added. This is mostly for knowing what we have to implement in future modules.
"""
import threading
import time
from src.OrderBook import OrderBook
from src.receiver... |
paygen.py | #!/usr/bin/env python3
import encrypt_code
import os
import argparse
import subprocess
import shutil
import banners
import platform
from essential_generators import DocumentGenerator
BLUE, RED, WHITE, YELLOW, MAGENTA, GREEN, END = '\33[94m', '\033[91m', '\33[97m', '\33[93m', '\033[1;35m', '\033[1;32m', '\033... |
26'sPick Up.py | import sys
from g_python.gextension import Extension
from g_python.hmessage import Direction
from time import sleep
import threading
extension_info = {
"title": "26's Pick Up",
"description": "dl: set&off&stack&pick ",
"version": "0.1.1",
"author": "funkydemir66"
}
ext = Extension(exten... |
fake_learner.py | # -*- coding: utf-8 -*-
"""
File name : learner
Date : 14/05/2019
Description : {TODO}
Author : VickeeX
"""
from zmq_serialize import SerializingContext
import multiprocessing as mp, zmq
class FakeLearner:
def __init__(self):
self.shared = []
self.qu... |
streaming.py | import sys
import os
from time import sleep
import grpc
import camera_pb2
import camera_pb2_grpc
import threading
import logging
from concurrent import futures
import queue
import traceback
from flask import Flask, render_template, Response
from kubernetes import client, config
import re
cam... |
download.py | def download(task_id, path):
global responses
path = path.replace("\\", "/")
# print("Downloading " + path)
# chunkSize = 512000
chunkSize = 10000
fileSize = os.path.getsize(path)
chunks = math.ceil(fileSize / chunkSize)
fullpath = os.path.abspath(path)
# print("FILESIZE = " + str... |
portable_runner.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... |
stress_test.py | # standard libraries
import sys
import os
from os import walk
from os.path import splitext, join
import threading
import unittest
import time
# 3rd party packages
import xmlrunner
from snakes.nets import Marking, MultiSet
sys.path.append(os.path.abspath("../lotlan_schedular"))
# local sources
import lotlan_schedular... |
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 | from flask import Flask, url_for
import logging
from logging.handlers import RotatingFileHandler
import sys
import requests
from contextlib import redirect_stderr
from flask import request
from flask import jsonify
import threading
import time
app = Flask(__name__)
runningPort = 5000
listOfClients = []
RETRY_COUNT = ... |
main.py | import atexit
import ctypes
import ctypes.wintypes
import os
import subprocess
import sys
import tkinter
import time
import threading
from PIL import Image,ImageTk
BUFFER_SIZE=2048
IGNORE_TIME=0.05
RENDER_SIZE=(960,540)
ANIMATION_LENGTH=5
FILE_ACTION_MODIFIED=3
FILE_FLAG_BACKUP_SEMANTICS=0x2000000
FILE_FLAG_OVERL... |
throttled.py | #!/usr/bin/env python3
from __future__ import print_function
import argparse
import configparser
import glob
import gzip
import os
import re
import struct
import subprocess
import sys
from collections import defaultdict
from datetime import datetime
from errno import EACCES, EIO, EPERM
from multiprocessing import cpu_... |
train_pg.py | import numpy as np
import tensorflow as tf
import gym
import logz
import scipy.signal
import os
import time
import inspect
from multiprocessing import Process
#============================================================================================#
# Utilities
#====================================================... |
main.py | #########################################################################
# The MIT License (MIT) #
# Copyright (c) 2016 Patrick Lai, Josh Manogaran, #
# Brendan Srinivasalu, Elias Tadros #
# ... |
multi_process_runner.py | # Lint as: python3
# 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 ... |
Botpro.py | # -*- coding: utf-8 -*-
#ღḯḉḯη-тєαм
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
from bs4 import BeautifulSoup
import time, random, sys, re, os, json, subprocess, threading, string, codecs, requests, tweepy, ctypes, urllib, urllib2, wikipedia,tempfile,glob,shutil,unicodedata,gosl... |
conftest.py | import contextlib
import os
import threading
import time
import typing
import pytest
import uvicorn
from httpcore._types import URL
from .utils import Server, http_proxy_server
SERVER_HOST = "example.org"
HTTPS_SERVER_URL = "https://example.org"
@pytest.fixture(scope="session")
def proxy_server() -> typing.Iterat... |
mudpi.py | import RPi.GPIO as GPIO
import threading
import datetime
import socket
import redis
import time
import json
import sys
sys.path.append('..')
from action import Action
from config_load import loadConfigJson
from server.mudpi_server import MudpiServer
from workers.pi.lcd_worker import LcdWorker
from workers.pi.i2c_worker... |
motor_step.py | import RPi.GPIO as GPIO
from RpiMotorLib import RpiMotorLib
import multiprocessing as mp
#define GPIO pins
GPIO_pins = (17, 27, 22)
direction= 20
step = 21
motor = RpiMotorLib.A4988Nema(direction, step, GPIO_pins, "A4988")
#class Motor_step():
def motor_step_run():
#print (... |
wsdump.py | #!/home/guilherme/Programming/Python/Reddit_Bot/bin/python3
import argparse
import code
import sys
import threading
import time
import ssl
import six
from six.moves.urllib.parse import urlparse
import websocket
try:
import readline
except ImportError:
pass
def get_encoding():
encoding = getattr(sys.st... |
ssh.py | import paramiko
import threading
from threading import Thread
from django_webssh.tools.tools import get_key_obj
import traceback
import socket
import json
zmodemszstart = b'rz\r**\x18B00000000000000\r\x8a'
zmodemszend = b'**\x18B0800000000022d\r\x8a'
zmodemrzstart = b'rz waiting to receive.**\x18B0100000023be50\r\x8a'... |
local_controller.py | import os
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
import pygame
import ipywidgets
from ipywidgets.widgets.trait_types import TypedTuple
from traitlets import Bool, Int, Float, Unicode, Instance, List
from ipywidgets.widgets.widget_controller import Axis, Button
import traitlets
import time
import threading
i... |
metrics.py | # Copyright Contributors to the Testing Farm project.
# SPDX-License-Identifier: Apache-2.0
"""
Classes and functions dealing with metrics.
Our metrics are stored in the database. To transport them through our code, we use dataclasses based on
:py:class:`MetricsBase` class. These are then responsible for loading thei... |
lambda_executors.py | import os
import re
import sys
import glob
import json
import time
import logging
import threading
import traceback
import subprocess
import six
import base64
from multiprocessing import Process, Queue
try:
from shlex import quote as cmd_quote
except ImportError:
from pipes import quote as cmd_quote # for Pyth... |
cnelsonAppDemoServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import json
import os
import random as _random
import sys
import traceback
from getopt import getopt, GetoptError
from multiprocessing import Process
from os import environ
from wsgiref.simple_server import make_server
import requests as _requests
from json... |
__init__.py | import logging
import os
import signal
import sys
import time
from patroni.version import __version__
logger = logging.getLogger(__name__)
PATRONI_ENV_PREFIX = 'PATRONI_'
KUBERNETES_ENV_PREFIX = 'KUBERNETES_'
class Patroni(object):
def __init__(self, conf):
from patroni.api import RestApiServer
... |
safe_t.py | from binascii import hexlify, unhexlify
import traceback
import sys
from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING
from electrum_onion.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException
from electrum_onion.bip32 import BIP32Node
from electrum_onion import con... |
test_regrtest.py | """
Tests of regrtest.py.
Note: test_regrtest cannot be run twice in parallel.
"""
import contextlib
import glob
import io
import os.path
import platform
import re
import subprocess
import sys
import sysconfig
import tempfile
import textwrap
import unittest
from test import libregrtest
from test import support
from t... |
monitor3b.py | # *-* encoding: utf-8 *-*
#!/usr/bin/python
import threading
import commands
import os, sys
import time
semaforo=threading.Semaphore(0) #Se señaliza con un semaforo
def multiProc():
os.system("clear")
print "\t\t\t Ejemplo de multiprocesamiento"
print "\nEste es solo un ejemplo de como crear multiprocesos.\n"
de... |
c-realV2.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2020 - 2021
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
t... |
usage.py | """Module to that provides functions for usage logging."""
import contextlib
import hashlib
import json
import locale
import logging
import os
import platform
import sys
import threading
import traceback
import uuid
import importlib
from urllib.request import urlopen, Request
from urllib.parse import urlencode
from o... |
test_memory.py | import ctypes
import gc
import pickle
import sys
import threading
import unittest
import fastrlock
import cupy.cuda
from cupy.cuda import device
from cupy.cuda import memory
from cupy.cuda import stream as stream_module
from cupy import testing
class MockMemory(memory.Memory):
cur_ptr = 1
def __init__(self... |
mock_ias_server.py | # Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
session.py | import os
import platform
import queue
import threading
import time
from datetime import datetime
from dataclasses import dataclass
from enum import Enum, auto
from typing import Callable
from typing import Optional, Dict, Type, Union
import ray
from ray.data import Dataset, DatasetPipeline
from ray.train._internal.ac... |
rc_software.py | from multiprocessing import Process, Queue
from json import dumps, loads
from threading import Thread
from controller import Controller
from lan_agent import LAN_Agent
from bluetooth_agent import BluetoothAgent
from ds4_agent import DS4Agent
from agent_base import AgentBase
from hashlib import sha256
from utils.consta... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.