source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
bot.py | print(r'''
_____ _ ____ _ _
| ____|__| |_ _ _ _| _ \ ___ | |__ ___ | |_
| _| / _` | | | | | | | |_) / _ \| '_ \ / _ \| __|
| |__| (_| | |_| | |_| | _ < (_) | |_) | (_) | |_
|_____\__,_|\__,_|\__,_|_| \_\___/|_.__/ \___/ \__|
Iniciando...
''')
import sys, io
import traceba... |
test_connection.py | # Copyright 2009-2010 10gen, 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 writing,... |
online_controller.py | import asyncio
import multiprocessing
from datetime import datetime, timezone
import requests
import websockets
from requests import RequestException
from chillow.controller.controller import Controller
from chillow.model.action import Action
from chillow.model.game import Game
from chillow.service.data_loader import ... |
job.py | import time
import types
from threading import Thread
def addJob(jobs, op, history, func, timeout):
if op in jobs:
raise Exception(f'op already in job list: {op}')
def th():
jobs[op] = {
"name": op,
"running": True,
"start": time.time(),
"end": No... |
test_basic.py | # coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
from concurrent.futures import ThreadPoolExecutor
import json
import logging
from multiprocessing import Process
import os
import random
import re
import setproctitle
import s... |
run_manager.py | import errno
import json
import logging
import os
import re
import signal
import socket
import stat
import subprocess
import sys
import time
from tempfile import NamedTemporaryFile
import threading
import yaml
import numbers
import inspect
import glob
import platform
import fnmatch
import click
from pkg_resources impo... |
threads.py | from threading import Thread
class DummyHome:
a = 0
def __init__(self):
self.a = 0
def increment(self):
self.a = self.a + 1
def thrd(this):
for x in range(0,30000):
this.increment()
print("Incremented a")
home = DummyHome()
home.increment()
thrd = Th... |
relaypositioner.py | import os
import sys
import random
import time
import threading
''' emul-gs232.py by ka8ncr '''
''' MIT license '''
try:
import RPi.GPIO as GPIO
except:
GPIO = None
class GPIORelay:
def __init__(self,conf,debug):
self.debug = debug
if debug:
print(f"GPIORelay:... |
fcord.py | from requests import request
from socket import *
import json
from threading import Thread
import sys
import os
import fcord
import pathlib
token = None
user_agent = None
listeners = []
events = []
def main():
global sock, token, user_agent, events, listeners
sys.path.append(relative("mods"))
sys.pa... |
shel.py | #! /usr/bin/env python3
## Shell Help submenu
import os
import importlib
from importlib import util
spec = importlib.util.find_spec('.subserv', package='lib')
m = spec.loader.load_module()
##Shells
def Shells():
os.system("clear")
#random ports
rp1 = m.randomPort()
rp2 = m.randomPort()
rp3 = m.randomPort... |
DebugReplTest3.py | import threading
stop_requested = False
t1_done = None
t2_done = None
def thread1():
global t1_done
t1_done = False
t1_val = 'thread1'
while not stop_requested:
pass
t1_done = True
def thread2():
global t2_done
t2_done = False
t2_val = 'thread2'
while not... |
app.py | import eel
from vnc import VNC
from threading import Thread
import atexit
import sys
from input_manager import InputManager
from vnc import VNC
status = 'None'
connection = 'None'
vnc = VNC()
input_manager = InputManager()
eel.init('web')
@eel.expose
def host():
global status
global vnc
global transmit_... |
distribution.py | import torch
import tarfile
import tempfile
import shutil
import os
import uuid
import traceback
from threading import Thread
from termcolor import colored
from .. import __version__, util
class Distribution():
def __init__(self, name, address_suffix='', batch_shape=torch.Size(), event_shape=torch.Size(), torch_... |
_testing.py | import bz2
from collections import Counter
from contextlib import contextmanager
from datetime import datetime
from functools import wraps
import gzip
import operator
import os
from shutil import rmtree
import string
import tempfile
from typing import Any, Callable, ContextManager, List, Optional, Type, Union, cast
imp... |
main.py | from rpc.client import connect
from rpc.exceptions import *
import threading
import tkinter as tk
from tkinter import font
from tkinter import messagebox
from tkinter import ttk
from widgets import ScrollableFrame, WrappingLabel
HOST = 'localhost'
PORT = 8080
POLLING_DELAY = 250
TITLE_TEXT = "Honours Study Evaluator"... |
example20.py | """
线程间通信(共享数据)非常简单因为可以共享同一个进程的内存
进程间通信(共享数据)比较麻烦因为操作系统会保护分配给进程的内存
要实现多进程间的通信通常可以用系统管道、套接字、三方服务来实现
multiprocessing.Queue
守护线程 - daemon thread
守护进程 - firewalld / httpd / mysqld
在系统停机的时候不保留的进程 - 不会因为进程还没有执行结束而阻碍系统停止
"""
from threading import Thread
from time import sleep
def output(content):
while True:
pri... |
exchange_rate.py | from datetime import datetime
import inspect
import requests
import sys
from threading import Thread
import time
import traceback
import csv
from decimal import Decimal
from bitcoin import COIN
from i18n import _
from util import PrintError, ThreadJob
from util import format_satoshis
# See https://en.wikipedia.org/w... |
step_impl.py | import threading
from getgauge.python import step, before_scenario, Messages
from step_impl.utils.driver import Driver
from selenium.webdriver.support.select import Select
from selenium.webdriver.support.wait import WebDriverWait
import requests
import json
# --------------------------
# Gauge step implementations
# -... |
drivableGPIO.py | from logging import getLogger
from math import pi
from struct import pack, unpack
from threading import Event, Thread
from time import sleep
from mobility.domain.angle import Angle
from mobility.domain.distance import Distance
from mobility.domain.iDrivable import IDrivable
from mobility.infrastructure.uartSerial impo... |
MegaMind_text_API.py | import sock as consts
import socket
import threading
import struct
from mypipe import MyPipe
listen_event_signal = False
def send_cmd_to_sdk(cmd):
speech_recog_end_pipe.write_to_pipe(cmd)
return
def wait_for_keyword_detection():
speech_recog_start_pipe.wait_on_pipe()
return
def send_start_request():
# print("Se... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2018-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test satcoind shutdown."""
from test_framework.test_framework import SatcoinTestFramework
from test_fr... |
example_binance_us.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: example_binance_us.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api
# Documentation: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api
# PyPI: https://pypi.o... |
endpoint_finder.py | import nmap
import json
import requests
import subprocess
import argparse
import warnings
from queue import Queue
from threading import Thread
warnings.filterwarnings("ignore", message="Unverified HTTPS request")
domain_q = Queue(maxsize=0)
port_q = Queue(maxsize=0)
def creating_nmap(file_path):
num_threads = 10... |
demo_1_4_1_2.py | #!/usr/bin/python2.7
# -*- coding:utf-8 -*-
# Author: NetworkRanger
# Date: 2019/1/7 下午11:12
"""
第二种方法:使用multiprocessing模块创建多进程
"""
import os
from multiprocessing import Process
# 子进程要执行的代码
def run_proc(name):
print 'Child process %s (%s) Running...' % (name, os.getpid())
if __name__ == '__main__':
print ... |
server.py | import socket
from threading import Thread
from concurrent.futures import ProcessPoolExecutor as Pool
from fib import fib
pool = Pool(5)
def fib_server(address):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.setsockopt(socket.IPPRO... |
ndjson_reader.py | #!/usr/bin/env python3
import sys
import multiprocessing as mp
import ujson as json
def process_chunk(q):
while True:
chunk = q.get()
if chunk is None or len(chunk) == 0:
return
objs = chunk.split(b'\n')
for obj in objs:
j = json.loads(obj)
... |
Universal_Controller.py | from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QApplication, QWidget, QInputDialog, QLineEdit
from UI.QT_Engine import Ui_MainWindow, DialogApp
from time import sleep as delay
from Controller.Control import Control
from ConsoleManager import ConsoleManager
from MQTT_Engine import MQTTEngine
imp... |
HuConJsonRpc.py | #!/usr/bin/python
""" HuConJsonRpc.py - The JSON RPC class to handle all incoming requests and return a well formed response.
Copyright (C) 2019 Basler AG
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
impo... |
view_audio.py | #!/usr/bin/env python3
###################################################################################################
#
# Project: Embedded Learning Library (ELL)
# File: view_audio.py
# Authors: Chris Lovett, Chuck Jacobs
#
# Requires: Python 3.x, numpy, tkinter, matplotlib
#
###########################... |
analytics.py | import logging
import os
import io
import requests
import calendar
import threading
import json
import werkzeug
from datetime import datetime
from mixpanel import Mixpanel, MixpanelException
from copy import deepcopy
from operator import itemgetter
from collections import defaultdict
from uuid import uuid4
from .misc... |
tasks.py | from threading import Thread
from django.db import transaction
from problem.tasks import judge_submission_on_problem
from submission.models import Submission
from submission.util import SubmissionStatus
from .models import Contest, ContestParticipant
from .statistics import invalidate_contest, invalidate_contest_part... |
weather.py | from tkinter import *
import json
import requests
import os
import threading
HEIGHT=400
WIDTH=800
############################# function #####################################################################
def weather(city):
key='48a90ac42caa09f90dcaeee4096b9e53'
#print('Please Wait')
show['text'] = 'Pl... |
test_forward.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
gan_grid.py | #!/usr/bin/env python3
# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
#
# This document should comply with PEP-8 Style Guide
# Linter: pylint
"""
TensorFlow training executable for DIGITS
Defines the training procedure
Usage:
See the self-documenting flags below.
"""
import threading
import tim... |
steel.py | #!/usr/bin/env python
# Copyright (c) 2019 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License"). This software is distributed "AS IS"
# as set forth in the License.
import re
import os
import sys
import time
import glob
imp... |
duplicate_gui.py | import tkinter as tk
import hashlib
import os
from send2trash import send2trash
from time import time
from functools import partial, update_wrapper
import json
from hyperlink_manager import HyperlinkManager
from PIL import Image, ImageTk
import threading
class StoreHashes(object):
def __init__(self):... |
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... |
test_gil_scoped.py | # -*- coding: utf-8 -*-
import multiprocessing
import threading
from pybind11_tests import gil_scoped as m
def _run_in_process(target, *args, **kwargs):
"""Runs target in process and returns its exitcode after 10s (None if still alive)."""
process = multiprocessing.Process(target=target, args=args, kwargs=kw... |
main.py | import json
import os
import re
import subprocess
import uuid
from pathlib import Path
from threading import Event, Thread
from time import time
from typing import Any, Dict, List, Literal, Optional, Tuple, TypedDict
import requests
import toml
from requests import Response, Session
from .inspect import LogMsg, inspe... |
pyi_lib_requests.py | # -----------------------------------------------------------------------------
# Copyright (c) 2014-2021, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.tx... |
file_server.py | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... |
reference_test.py | import unittest
import collections
import time
import redis
import threading
import phonon.connections
import phonon.reference
class ReferenceTest(unittest.TestCase):
def setUp(self):
self.client = redis.StrictRedis(host='localhost')
self.client.flushall()
self.conn = phonon.connections.... |
OccupancyGridTest.py | # -*- coding: utf-8 -*-
"""
Created on Fri Nov 2 13:11:39 2018
@author: 13383861
"""
import sys
import enum
sys.path.append('.')
sys.path.append('..')
import requests
import os
import time
from collections import namedtuple
import copy
import random
import typing
import functools
import json
import threading
import ... |
LiveSystemManager.py | import copy
import pylsl
import threading
import numpy as np
from pubsub import pub
from collections import deque
import storage.Constants as Constants
from helpers import Preprocessor, FeatureCalculator
###########################################################################
# Class LiveSystemManager
# -> manages... |
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 tempfile
import urllib.request
import traceback
import asyncore
import weakref
import platform
import re
import functo... |
connection.py | from __future__ import division
import copy
import hashlib
import hmac
import logging
import math
import os
import struct
import time
import threading
from datetime import datetime
from threading import Lock
from cryptography.exceptions import UnsupportedAlgorithm
from cryptography.hazmat.backends import default_back... |
controller.py | #!/usr/bin/python3
from supervisors.supervisor import Supervisor
from supervisors.bitWiseSupervisor import BitWiseSupervisor
from simulations.sendTrueFile import FileSimulation
from simulations.randomSimulation import RandomSimulation
from simulations.randomOnFlySimulation import RandomOnFlySimulation
from progressBar... |
framework.py | #!/usr/bin/env python3
from __future__ import print_function
import gc
import sys
import os
import select
import signal
import unittest
import tempfile
import time
import faulthandler
import random
import copy
import psutil
import platform
from collections import deque
from threading import Thread, Event
from inspect ... |
ttldict.py | import threading
import time
class TTLDict(dict):
""" A dictionary with keys having specific time to live """
def __init__(self, ttl=5):
self._ttl = ttl
# Internal key mapping keys of _d
# to times of access
self.__map = {}
self._flag = True
self._... |
abandoned_lock-midpoint.py | '''
eS UTIL USAR TRY FINALLY PARA TEMRINAR DE LIBERAR EL LOCK DE LOQ UE ESTÁBA HACIENDO
'''
#!/usr/bin/env python3
""" Three philosophers, thinking and eating sushi """
import threading
chopstick_a = threading.Lock()
chopstick_b = threading.Lock()
chopstick_c = threading.Lock()
sushi_count = 500
some_lock = thr... |
keyboard_ctrl.py | import sys
import termios
import time
from termios import (BRKINT, CS8, CSIZE, ECHO, ICANON, ICRNL, IEXTEN, INPCK,
ISIG, ISTRIP, IXON, PARENB, VMIN, VTIME)
from typing import Any
# Indexes for termios list.
IFLAG = 0
OFLAG = 1
CFLAG = 2
LFLAG = 3
ISPEED = 4
OSPEED = 5
CC = 6
def getch():
fd = s... |
ping_test.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import subprocess
from itertools import count
from threading import Thread
from time import sleep
class Packet_loss:
"""
"""
# defaults: Google Public DNS: 8.8.8.8 or 8.8.4.4
HOST = "8.8.8.8"
INTERVAL = 4
PACKETSIZE = 8
GET_PACKET_LOSS = Tru... |
test_selftest_snippets.py | from multiprocessing import Process
from pyteen.core import Collection
from pyteen import snippets
# This does not report any errors in the test suite!
def test(capsys):
"""Can we test the collection's entire test suite?
"""
coll = Collection(snippets)
p = Process(target=coll.test)
p.start()
p... |
test_dbnd_run_from_process_and_threads.py | import logging
import sys
import threading
from threading import Thread
from dbnd import PythonTask, new_dbnd_context, output
from dbnd._core.context.bootstrap import _dbnd_exception_handling
from dbnd._core.settings import RunConfig
from dbnd.tasks.basics import SimplestTask
from dbnd.testing.helpers import run_dbnd... |
detector_utils.py | # Utilities for object detector.
from PIL import Image
import GUI
import numpy as np
import sys
import tensorflow as tf
import os
from threading import Thread
from datetime import datetime
import cv2
from collections import defaultdict
from pynput.mouse import Button, Controller
from tensorflow.keras.models import load... |
demo3.py | # -*- coding:utf-8 -*-
# @Time : 2019/10/10 11:20
# @Author : Dg
import os
import time
from multiprocessing import Process, Queue
n = 100 # 在windows系统中应该把全局变量定义在if __name__ == '__main__'之上就可以了
a = Queue()
a.put(1)
a.put(2)
a.put(2)
b = [1,2,3]
def work(n, b):
print(n)
n = 0
# print('子进程内: ', id(n), a.... |
1.py | # -*- coding: utf-8 -*-
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
import time, random, sys, ast, re, os, io, json, subprocess, threading, string, codecs, requests, ctypes, urllib, urllib2, urllib3, wikipedia, tempfile
from bs4 import BeautifulSoup
from urllib import urlopen
fr... |
main.py | import cv2
from keras.models import load_model
import numpy as np
from websocket_server import WebsocketServer
import logging
import sys
from util import *
import rumps
from subprocess import Popen, PIPE
from threading import Thread
from os import listdir
from os.path import isfile, join
# parameters for loading data ... |
countdown_threading_v1.py | import threading
import time
def countdown(name, delay):
counter = 5
while counter:
time.sleep(delay) # number of seconds
print(f'{name} is counting down: {counter}...')
counter -= 1
print(f'{name} finished counting down')
if __name__ == '__main__':
t1 = threading.Thread(t... |
tftp.py | import errno
import logging
import socket
from pathlib import Path, PurePosixPath
from threading import Thread
from typing import List, NewType, Tuple, Union, Dict
logger = logging.getLogger('tftpd')
# BLOCK_SIZE = 512
BLOCK_SIZE = 4096
BUF_SIZE = 65536
TIMEOUT = 5.0
MAX_RETRIES = 10
class TFTPOpcodes:
"""Class... |
test_sync.py | import os
from unittest import mock
import threading
from sync import get_settings_from_env, server_factory
import json
import pytest
import requests
# Data sets passed to server
DATA_INCORRECT_CHILDREN = {
"parent": {
"metadata": {
"labels": {
"pipelines.kubeflow.org/enabled":... |
file_based_engine.py | # (C) Copyright 1996- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernment... |
serial-electret-data-listener.py | import serial
import time
import threading
from socketIO_client import SocketIO, LoggingNamespace, BaseNamespace
from threading import Thread
from tendo import singleton
import configparser
import sys
me = singleton.SingleInstance()
config = configparser.ConfigParser()
config.read('./config.cfg')
password = config.g... |
app_test.py | from __future__ import print_function
from __future__ import unicode_literals
import re
import os
import socket
import select
import subprocess
from threading import Thread, Event
import ttfw_idf
import ssl
def _path(f):
return os.path.join(os.path.dirname(os.path.realpath(__file__)),f)
def set_server_cert_cn(i... |
test_dutd.py | """
Copyright (c) 2017, Intel Corporation
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 following disclaim... |
regrtest.py | #! /usr/bin/env python
"""
Usage:
python -m test.regrtest [options] [test_name1 [test_name2 ...]]
python path/to/Lib/test/regrtest.py [options] [test_name1 [test_name2 ...]]
If no arguments or options are provided, finds all files matching
the pattern "test_*" in the Lib/test subdirectory and runs
them in alphabeti... |
Ultracortex_16CH.py | import sys
sys.path.append('C:/Python37/Lib/site-packages')
from IPython.display import clear_output
from pyqtgraph.Qt import QtGui, QtCore
import pyqtgraph as pg
import random
from pyOpenBCI import OpenBCICyton
import threading
import time
import numpy as np
from scipy import signal
pg.setConfigOption('background', '... |
road_speed_limiter.py |
import json
import threading
import time
import socket
from threading import Thread
from common.params import Params
from common.numpy_fast import interp
current_milli_time = lambda: int(round(time.time() * 1000))
CAMERA_SPEED_FACTOR = 1.05
class RoadSpeedLimiter:
def __init__(self):
self.json = None
sel... |
demo_theme.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
import os
import sys
import time
import curses
import locale
import threading
from types import MethodType
from collections import Counter
from vcr import VCR
from six.moves.urllib.parse import ... |
movie_search.py | #!/usr/bin/env python3
# Copyright 2019 Pablo Navais
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
test_statsd_thread_safety.py | # stdlib
from collections import deque
import six
import threading
import time
import unittest
# 3p
from mock import patch
# datadog
from datadog.dogstatsd.base import DogStatsd
class FakeSocket(object):
"""
Mocked socket for testing.
"""
def __init__(self):
self.payloads = deque()
def ... |
run-ebpf-sample.py | #!/usr/bin/env python
# Copyright 2013-present Barefoot Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... |
test_acl_propagation.py | # Copyright (C) 2019 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Test acl role propagation on workflows."""
# pylint: disable=invalid-name
import datetime
from copy import deepcopy
from threading import Thread
from freezegun import freeze_time
from ggrc import db
fr... |
kernel.py | from queue import Queue
from threading import Thread
from ipykernel.kernelbase import Kernel
import re
import subprocess
import tempfile
import os
import os.path as path
class RealTimeSubprocess(subprocess.Popen):
"""
A subprocess that allows to read its stdout and stderr in real time
"""
def __init... |
test_core.py | """
tests.test_core
~~~~~~~~~~~~~~~~~
Provides tests to verify that Home Assistant core works.
"""
# pylint: disable=protected-access,too-many-public-methods
# pylint: disable=too-few-public-methods
import os
import unittest
import time
import threading
from datetime import datetime
import homeassistant as ha
class... |
serverfomo.py | import torch
import time
import copy
import random
import numpy as np
from flcore.clients.clientfomo import clientFomo
from flcore.servers.serverbase import Server
from threading import Thread
class FedFomo(Server):
def __init__(self, args, times):
super().__init__(args, times)
# select slow clie... |
multiYearGrabber.py | import os
import multiprocessing as mp
import psutil
from Database.SQLfuncs import SQLfuncs
import re
def thread_function(path, tablets, cpu, progress):
db = SQLfuncs('sumerian-social-network.clzdkdgg3zul.us-west-2.rds.amazonaws.com', 'root', '2b928S#%')
for tabid in tablets:
progress[cpu - 1] += 1
... |
test_stream_roster.py | # -*- encoding:utf-8 -*-
#from __future__ import unicode_literals
from sleekxmpp.test import *
import time
import threading
class TestStreamRoster(SleekTest):
"""
Test handling roster updates.
"""
def tearDown(self):
self.stream_close()
def testGetRoster(self):
"""Test handling... |
test_request.py | import asyncio
import threading
from urllib import request
import aiohttp_jinja2
from ddtrace import config
from ddtrace.contrib.aiohttp.middlewares import trace_app
from ddtrace.contrib.aiohttp.patch import patch
from ddtrace.contrib.aiohttp.patch import unpatch
from ddtrace.pin import Pin
from tests.utils import as... |
context.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... |
multi_threaded_augmenter.py | # Copyright 2017 Division of Medical Image Computing, German Cancer Research Center (DKFZ)
#
# 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
#... |
tcpviewer.py | # This file is part of libigl, a simple c++ geometry processing library.
#
# Copyright (C) 2017 Sebastian Koch <s.koch@tu-berlin.de> and Daniele Panozzo <daniele.panozzo@gmail.com>
#
# This Source Code Form is subject to the terms of the Mozilla Public License
# v. 2.0. If a copy of the MPL was not distributed with thi... |
train_lm.py | import logging
import math
import multiprocessing as mp
import os
import random
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union, cast
import torch
from logzero import logger
from misspell import make_typo
from tensorboardX... |
WorkspaceServer.py | #!/usr/bin/env python
from wsgiref.simple_server import make_server
import sys
import json
import traceback
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, ServerError, InvalidRequestError
from os imp... |
pythonClient.py | import queue, threading, json, socket, inspect, traceback, time
from enum import Enum
class LanguageClient:
def __init__(self, host, port):
self.host = host
self.port = port
self.global_local_objects = {}
self.outgoing = queue.Queue(0)
self.returnQueue = queue.Queue(1)
... |
common.py | """Test the helper method for writing tests."""
from __future__ import annotations
import asyncio
import collections
from collections import OrderedDict
from contextlib import contextmanager
from datetime import timedelta
import functools as ft
from io import StringIO
import json
import logging
import os
import pathli... |
rigolx.py | """
Advanced Physics Lab - University of Oregon
Jan 26th, 2016
A user interface for controlling the Rigol DS1000D/E oscilloscopes
Source for integrating matplotlib plots to tkinter
- http://matplotlib.org/examples/user_interfaces/embedding_in_tk.html
multiprocessing based off of the answer to this post
- http:... |
mtproto.py | import cachetools as cachetools
from telethon import TelegramClient
from telethon.utils import get_extension
from telethon.tl.types import UpdateShortMessage, UpdateShortChatMessage, UpdateEditMessage, UpdateDeleteMessages, \
UpdateNewMessage, UpdateUserStatus, UpdateShort, Updates, UpdateNewChannelMessage, \
U... |
offline.py | import os
import subprocess
import time
from datetime import datetime
from multiprocessing import Process
from threading import Thread
from typing import AnyStr, NoReturn, Union
import requests
from executors.alarm import alarm_executor
from executors.automation import auto_helper
from executors.conditions import con... |
bot.py | # Copyright 2008, Sean B. Palmer, inamidst.com
# Copyright © 2012, Elad Alfassa <elad@fedoraproject.org>
# Copyright 2012-2015, Elsie Powell, http://embolalia.com
# Copyright 2019, Florian Strzelecki <florian.strzelecki@gmail.com>
#
# Licensed under the Eiffel Forum License 2.
from __future__ import generator_stop
fr... |
dcwebsocket.py | from dccontroller import DogCamController
from datetime import datetime
import asyncio
import websockets
import threading
import json
# This makes a websocket for taking in remote commands
class DogCamWebSocket():
WSThread = None
WSLoop = None
__clients = set()
def __init__(self):
print("Starting websocke... |
pyrep.py | from pyrep.backend import vrep, utils
from pyrep.objects.object import Object
from pyrep.objects.shape import Shape
from pyrep.textures.texture import Texture
from pyrep.errors import PyRepError
import os
import sys
import time
import threading
from threading import Lock
from typing import Tuple, List
class PyRep(obj... |
datagenerator.py | """
datagenerator script. run this standalone.
read PGN files of recorded blitz games from variously rated
players. spawn N number of threads for reading M amount of data.
total games read from one session is equal to N*M, which has to
be smaller than the number of games in one PGN file.
the fics2019-blitz dataset co... |
queues.py | import threading
import queue
import random
import time
def mySubscriber(queue):
while not queue.empty():
item = queue.get()
if item is None:
break
print("{} removed {} from the queue".format(threading.current_thread(), item))
queue.task_done()
time.sleep(1)
myQueue = queue.Queue()
for i i... |
set_background.py | # -*-coding:utf-8-*-
import ctypes
import os
import random
import shutil
import time
from threading import Thread
from typing import Dict, Callable, List
import win32con
import win32gui
from system_hotkey import SystemHotkey
import args_definition as argsdef
import configurator as configr
import const_config as const... |
funddata.py | # -*- coding:utf-8 -*-
"""
该文件爬取基金信息和所有基金的历史数据,存储到数据库中,只需要运行一次即可。
:copyright: (c) 2020 by olixu
:license: MIT, see LICENCE for more details.
"""
import sys
import requests
import re
from lxml import etree
import sqlite3
import time
import json
import argparse
from multiprocessing.dummy import Pool as ThreadPool
impor... |
autobrowserbot.py | import os
import sys
import json
import random
from multiprocessing import Pool, Process, Lock
from simulatedbrowser import *
# This constant controls how many seperate individual bots are to be
# running for this application
NUMBER_OF_RUNNING_BOT_INSTANCES = 6
class AutoBrowserBotProcess:
def __init__(self, lo... |
tvhProxy.py | from gevent import monkey
monkey.patch_all()
import json
from dotenv import load_dotenv
from ssdp import SSDPServer
from flask import Flask, Response, request, jsonify, abort, render_template
from gevent.pywsgi import WSGIServer
import xml.etree.ElementTree as ElementTree
from datetime import timedelta, datetime, time
... |
test_itertools.py | import unittest
from test import support
from itertools import *
import weakref
from decimal import Decimal
from fractions import Fraction
import operator
import random
import copy
import pickle
from functools import reduce
import sys
import struct
import threading
import gc
maxsize = support.MAX_Py_ssize_t
minsize = ... |
spark.py | from __future__ import print_function
import copy
import threading
import time
import timeit
from hyperopt import base, fmin, Trials
from hyperopt.base import validate_timeout
from hyperopt.utils import coarse_utcnow, _get_logger, _get_random_id
try:
from pyspark.sql import SparkSession
_have_spark = True
e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.