source
stringlengths
3
86
python
stringlengths
75
1.04M
run.py
# flake8: noqa import os import sys import multiprocessing from time import sleep from datetime import datetime, time from logging import INFO # 将repostory的目录i,作为根目录,添加到系统环境中。 ROOT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..')) sys.path.append(ROOT_PATH) print(f'append {ROOT_PATH} ...
recoco.py
# Copyright 2011-2013 James McCauley # # 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 ...
main.py
import logging # set up logging to file - see previous section for more details logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s', datefmt='%m-%d %H:%M:%S', filename='/tmp/henpi.log', file...
interface_rpc.py
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Beans Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Tests some generic aspects of the RPC interface.""" import os from test_framework.authproxy import JSONR...
csg2d.py
""" 2D meshing using mostly FEniCS """ import dolfin from dolfin_utils.meshconvert import meshconvert import mshr import numpy from .base import CSG, CSGCollection, csg_eps class CSG2D(CSG): @classmethod def getCollection(cls): return CSG2DCollection() class Circle(CSG2D): def __init__(self, center, radius, *,...
watchdog.py
#TODO: Count restarts during a time period, and terminate if too high. # Add a vital flag to a process, if restart fails, program will terminate. # from threading import Thread import logging log = logging.getLogger('watchdog') watches={} def watch(): global watches for (name, process) in ...
REgtk.py
import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk, Gdk, GObject, GLib import RE import read import threading import sys import serialize import os import load_hooks from argparser import args, need_to_compare, project_dir class WrappedTextBuffer(): def __init__(self, buffer): self.bu...
test_weakref.py
import gc import sys import unittest import collections import weakref import operator import contextlib import copy import time from test import support from test.support import script_helper # Used in ReferencesTestCase.test_ref_created_during_del() . ref_from_del = None # Used by FinalizeTestCase as a global that...
__init__.py
import io import os import sys import subprocess import wave import aifc import math import audioop import collections import json import base64 import threading import platform import stat import hashlib import hmac import time import uuid try: # attempt to use the Python 2 modules from urllib import urlenco...
ipc.py
# # IPC utilities for Lemonbar # import json import os import queue import socket import threading import uuid from .common import LemonpyError, default_lemonpy_dir from enum import Enum class SocketExists(LemonpyError): """ Socket already exists. """ pass class SocketDoesNotExist(LemonpyError): ...
tcs3472_ftdi.py
#! /usr/bin/env nix-shell #! nix-shell -i python3 -p "python3.withPackages (p: with p; [pyftdi tkinter])" # use ftdi_urls.py in the nix-shell to list available device. #url = "ftdi:///1" # just use the first one / only one url = 'ftdi://ftdi:2232h/1' # datasheet: https://cdn-shop.adafruit.com/datasheets/TCS34725.pdf...
schedule.py
import time from multiprocessing import Process import asyncio import aiohttp from aiohttp import streams try: from aiohttp.errors import ProxyConnectionError,ServerDisconnectedError,ClientResponseError,ClientConnectorError except: from aiohttp import ClientProxyConnectionError as ProxyConnectionError,ServerDis...
link.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Use the pySerial-3.0 serial module # import sys import os.path #sys.path.insert(1,os.path.normpath(sys.path[0]+"/pyserial-3.0")) import serial import time from utils import * if os.name == 'nt': # sys.platform == 'win32': from serial.tools.list_ports_windows imp...
SlackEventTranslator.py
from threading import Thread from src.models.slack.requests.SlackEventRequest import SlackEventRequest from src.services.parent.InitiateSaveStrandService import InitiateSaveStrandService from src.services.parent.ProvideHelpService import ProvideHelpService from src.services.parent.RevokeTokensService import RevokeToke...
thread_test.py
# -*- coding: utf-8 -*- """ Created on Thu Nov 15 00:38:18 2018 @author: wangyu """ #! /usr/bin/python #-* coding: utf-8 -* # __author__ ="tyomcat" import threading import time import os def booth(tid): global i global lock while True: lock.acquire() if i!=0: i=i-1 ...
onnxruntime_test_python.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # -*- coding: UTF-8 -*- import gc import numpy as np import onnxruntime as onnxrt import os import platform import sys import threading import unittest from helper import get_name from onnxruntime.capi.onnxruntime_pybind11_s...
server_v13n2.py
import socket from threading import Thread from lesson13n2.request import Request from lesson13.state_machine_helper_v13 import StateMachineHelperV13 from lesson12_projects.house3.data.const import OUT from lesson13n2_projects.house3n2.data.transition2 import house3n2_transition2_doc from lesson13n2_projects.house3n2....
traininggui.py
import tkinter from tkinter import ttk from tkinter import filedialog, messagebox import tkinter.font as font import os import threading import re import trainingdriver from ..gdmodules import gdv from src.handlers import filehandler class GUI: def __init__(self): self.root = tkinter.Tk() self.r...
PiController.py
if __name__ == "__main__": # ---------------- Add Path -------------------------------------------------- import sys from sys import path as sys_pth import os.path as pth local_directory = pth.dirname(pth.abspath(__file__)) import_list = ( #local_directory pth.realp...
image_lib.py
''' Loads an image file, process and then save to file Loads an audio file, process and then save to file ''' import skimage from skimage import io, filters from os.path import expanduser import os from multiprocessing import Process from threading import Thread home = expanduser("~") def edgify(im, fname): edge...
coap.py
import logging.config import os import random import socket import select import struct import threading from coapthon import defines from coapthon.layers.blocklayer import BlockLayer from coapthon.layers.messagelayer import MessageLayer from coapthon.layers.observelayer import ObserveLayer from coapthon.layers.reques...
dnsserver.py
#!/usr/bin/env python3.6 # -*- coding: utf-8 -*- import json import logging import os import sys import signal import re import socket import argparse import ipaddress from datetime import datetime from time import sleep import threading from multiprocessing.connection import Listener import dnslib from dnslib import...
scylla_node.py
# ccm node from __future__ import with_statement from datetime import datetime import errno import os import signal import shutil import socket import stat import subprocess import time import threading import psutil import yaml import glob import re from six import print_ from six.moves import xrange from ccmlib i...
utils.py
import errno import os import sys from os.path import join as pjoin from binascii import hexlify from threading import Thread, Event try: from unittest.mock import patch except ImportError: from mock import patch # py2 from ipython_genutils.tempdir import TemporaryDirectory from jupyterlab.labapp import LabA...
configuration.py
import copy import multiprocessing as mp import os import re import shutil import stat import time from io import StringIO from ipaddress import ip_network as str2ip from typing import Dict from typing import List from typing import NoReturn from typing import Optional from typing import Text from typing import TextIO ...
server.py
from pynput import keyboard import time import os import socket import sys import threading HOST = '127.0.0.1' PORT = 65432 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((HOST, PORT)) s.listen() conn, addr = s.accept() encoding = sys.getdefaultencoding() thread = None client_key = None def thread_f...
__init__.py
from __future__ import print_function import argparse import itertools import os import random import re import shlex import string import sys import traceback import warnings from collections import OrderedDict from fnmatch import fnmatchcase from subprocess import list2cmdline from threading import Thread import pl...
example_stream.py
import time, cv2 from threading import Thread from djitellopy import Tello tello = Tello() tello.connect() keepRecording = True tello.streamon() frame_read = tello.get_frame_read() def videoRecorder(): # create a VideoWrite object, recoring to ./video.avi height, width, _ = frame_read.frame.shape video ...
mks.py
# -- coding: utf-8 -- import re import logging import serial import time import threading class MKSField: _RELAY_BITS = 4 _RELAY_SEGMENTS = 2 _RELAY_OUTPUTS = _RELAY_BITS * _RELAY_SEGMENTS _RELAY_REGEX = re.compile('^' + '-'.join(["([0-1]{{{}}})".format(_RELAY_BITS)] * _RELAY_SEGMENTS) + '$') _T...
PyServer.py
# -*- coding: UTF-8 -*- from GameEvent import Event from GameNetwork import PassiveNetSide import threading import asyncore from Core.Extent.sortedcontainers import SortedDict from Core import ImportTool from GameMessage import Message import Setting class GameServer(PassiveNetSide.BaseSever): Instance = N...
executor.py
# Copyright (C) The Arvados Authors. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 from __future__ import division from builtins import next from builtins import object from builtins import str from future.utils import viewvalues, viewitems import argparse import logging import os import sys import thr...
coinmarketcap_tracker.py
import configparser import datetime import json import logging import os import shutil import sys import time from heartbeatmonitor import Heartbeat from pymongo import MongoClient from slackclient import SlackClient #logging.basicConfig() logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) class Tr...
InsertSinePlugin.py
import os import threading import numpy as np from PyQt5 import uic from PyQt5.QtCore import QRegExp from PyQt5.QtCore import Qt from PyQt5.QtCore import pyqtSignal from PyQt5.QtCore import pyqtSlot from PyQt5.QtGui import QBrush from PyQt5.QtGui import QColor from PyQt5.QtGui import QPen from PyQt5.QtGui import QRegE...
process_video.py
#!/usr/bin/env python import sys import os import shutil import math import numpy as np import argparse import contextlib import itertools import signal import subprocess import tempfile import threading try: import queue # Python 3 except ImportError: import Queue as queue # Python 2 sys.dont_write_bytecode = T...
experiment.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ TODO TBD """ # Python-native imports import logging.config from http.server import BaseHTTPRequestHandler import threading import json # Third-party imports import pykka # App imports from pyCrow.crowlib import Action from pyCrow.crowlib.http import Server L = logging....
log.py
# Copyright (c) 2016-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. # pyre-strict import argparse import copy import io import logging import os import re import sys import threading import time from typing import L...
bgpstreamlive.py
import multiprocessing as mp import os import signal import time import _pybgpstream import pytricia import redis import requests import ujson as json from artemis_utils import get_ip_version from artemis_utils import get_logger from artemis_utils.constants import CONFIGURATION_HOST from artemis_utils.constants import...
guiInfo.py
import Tkinter as tk from versionControl import greeting import AppKit from infoTwitterGet import getFollower from infoFindEdge import followerInfo import threading start_bt_ms = "Get information about followers/friends of an account~" class App(tk.Frame): def __init__(self, master): tk.Frame.__init__(sel...
comfoconnect.py
import logging import queue import struct import threading import time from .bridge import Bridge from .error import * from .message import Message from .zehnder_pb2 import * KEEPALIVE = 60 DEFAULT_LOCAL_UUID = bytes.fromhex('00000000000000000000000000001337') DEFAULT_LOCAL_DEVICENAME = 'pycomfoconnect' DEFAULT_PIN ...
marathon_lb.py
#!/usr/bin/env python3 """Overview: The marathon-lb is a replacement for the haproxy-marathon-bridge. It reads the Marathon task information and dynamically generates haproxy configuration details. To gather the task information, the marathon-lb needs to know where to find Marathon. The service configuratio...
client.py
#!/usr/bin/python3 import socket import threading import pyaudio import signal import sys import time class Client: def handler(signum,f): print(signum) sys.exit() signal.signal(signal.SIGINT, handler) def __init__(self): self.s = socket.socket(socket.AF_INET, sock...
datafeed.py
from functools import wraps as _wraps from itertools import chain as _chain import json from .utils import convert_to, Logger, dec_con from decimal import Decimal import pandas as pd from time import sleep from datetime import datetime, timezone, timedelta import zmq import threading from multiprocessing import Process...
client.py
# Echo client program import socket import time import struct import threading from multiprocessing import Process ttl =2 threads_cnt = 1 HOST = '127.0.0.1' PORT = 18600 def recvall(sock,size): torecv =size data ='' while torecv>0: d =sock.recv(torecv) data =data+d ...
kitchen.py
import argparse import asyncio import io import random import threading import time import colors from colors.colors import _color_code as cc from multiplex import ansi, Process from multiplex import Multiplex, Controller from multiplex.log import init_logging def run_simple(): async def text_generator(index): ...
quantize_ssd4.py
#!/usr/bin/env python # -------------------------------------------------------- # Quantize Fast R-CNN based Network # Written by Chia-Chi Tsai # -------------------------------------------------------- """Quantize a Fast R-CNN network on an image database.""" import os os.environ['GLOG_minloglevel'] = '2' import _...
streamer.py
#!/usr/bin/python3 from concurrent.futures import ThreadPoolExecutor from threading import Thread import subprocess import time from configuration import env from db_query import DBQuery office = list(map(float,env["OFFICE"].split(","))) if "OFFICE" in env else None dbhost= env.get("DBHOST",None) class Streamer(obje...
logger.py
''' Key & Mouse Logger by Andrey Avramenko Note: Doesn't work for Mac's "command" key or Windows' "windows" key Codes for the log: KEY_TYPED = 0 MOUSE_MOVE = 1 MOUSE_CLICK = 2 MOUSE_RELEASE = 3 MOUSE_SCROLL = 4 ''' import time, sys, json, platform, os, threading from pynput.mouse import Listener as MouseListener fr...
main.py
import multiprocessing import shutil from FL.node import FLNode from FL.process import FLProcess from FL.run import run from os import path, mkdir import utils.util as util import numpy as np from FL.node import FLNode from os import path from utils.util import save_file def clean_fl_process(num_nodes,...
o80_pam_plotting.py
import sys import math import threading import time import fyplot import o80 import o80_pam import pam_interface from functools import partial DEFAULT_FREQUENCY = 2000 # to plot the frequency on the right scale WINDOW = (1200, 800) # plot window size (in pixels) class ReadOnce: def __init__(self): self...
tkinter_setup.py
import asyncio import threading import tkinter from tkinter import ttk from typing import List from PIL import Image, ImageOps, ImageTk from toio_API.scenarios import SCENARIOS, make_scenario from toio_API.utils.general import create_toios, discover_toios from toio_API.utils.logging import initialize_logging logger =...
PyQuran.py
import tweepy import threading from GettingAyah import GettingAyah from FridaysAndFastingTimes import FridaysAndFastingTimes import time API = "Your API" API_secret = "Your API secret" token = "Your token" token_secret = "Your token secret" auth = tweepy.OAuthHandler(API, API_secret) auth.set_access_token(token, tok...
WebClient.py
from webapi_pb2 import * import sys import socket import time import logging import uuid import threading logger = logging.getLogger(__name__) def delimitProtobuf(src): """Python protobuf bindings are missing writeDelimited, this is a workaround to add a delimiter""" from google.protobuf.internal import encod...
learn.py
import sys, os, shutil if os.getcwd() not in sys.path: sys.path.append(os.getcwd()) from modules.utils import process_log_records, register_kill_hook, register_debug_hook # torch import torch # multiprocessing import torch.multiprocessing as mp from multiprocessing.managers import BaseManager import platform if plat...
eon_testing_slave.py
#!/usr/bin/env python3 import re import time import json import base64 import requests import subprocess from http.server import BaseHTTPRequestHandler, HTTPServer from os.path import expanduser from threading import Thread from common.params import Params import os MASTER_HOST = "testing.comma.life" def get_workd...
flask.py
from __future__ import annotations import asyncio import json import logging from asyncio import Queue as AsyncQueue from queue import Queue as ThreadQueue from threading import Event as ThreadEvent from threading import Thread from typing import Any, Callable, Dict, NamedTuple, Optional, Tuple, Union, cast from urlli...
utilities.py
# # Copyright 2016 Dohop hf. # # 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, ...
mcts_agent.py
# MCTS to search for a best move. # Some notes to the MCTS agent. # Performance seems to be major issue: # - There are about 30 possible moves per layer. So 3 layer-depth search # would generate about 27000 different states. # - Finding all possible valid moves for a state takes about 100 ~ 200 ms. # # Given this se...
aws_glue.py
import datetime import json import os import pickle import tempfile import threading import time import zipfile from collections import OrderedDict, deque from typing import Any, Deque, Dict, Iterable, Iterator, List, Optional, Tuple, Union, cast from redun.executors import aws_utils from redun.executors.base import E...
conftest.py
import array import functools import logging import os import signal import subprocess import sys import threading import time import uuid from types import SimpleNamespace import pytest import caproto as ca import caproto.asyncio # noqa import caproto.benchmarking # noqa import caproto.threading # noqa from capro...
subscribe_io.py
__all__ = [ 'FlexibleDistributeV0', 'FlexibleDistributeV2', 'pop_subs_to_admin', 'detach', 'set_task2url_cache', 'select_subs_to_admin', ] import threading from collections import Counter from datetime import datetime from urllib.parse import urlparse from uuid import uuid4 from faker import F...
minimal_server.py
import six import sys import time import math import socket import inspect from datetime import datetime import threading try: import SocketServer as socketserver import cPickle as pickle except ImportError: import socketserver import pickle def pad_message(message, blocklength): """Pad a message...
lsgn_data.py
import tensorflow as tf import tensorflow_hub as hub import h5py import json import numpy as np import random import threading from input_utils import * import util import srl_eval_utils # Names for the "given" tensors. _input_names = [ "tokens", "context_word_emb", "head_word_emb", "lm_emb", "char_idx", "text_...
test_unix_events.py
"""Tests for unix_events.py.""" import collections import errno import io import os import pathlib import signal import socket import stat import sys import tempfile import threading import unittest from unittest import mock from test import support if sys.platform == 'win32': raise unittest.SkipTest('UNIX only')...
_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 import re from shutil import rmtree import string import tempfile from typing import Any, Callable, ContextManager, List, Optional, Type, Union...
arduino_flasher.py
from .base_flasher import BaseFlasher import zipfile import re import os import shutil import json from threading import Thread from datetime import datetime import serial import flask from flask_babel import gettext import pyduinocli import intelhex class ArduinoFlasher(BaseFlasher): def __init__(self, settings, p...
__init__.py
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
paramvirdemoServer.py
#!/usr/bin/env python from wsgiref.simple_server import make_server import sys import json import traceback import datetime from multiprocessing import Process from getopt import getopt, GetoptError from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\ JSONRPCError, ServerError, InvalidRequestE...
multi_process_runner_test.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
__init__.py
"""Web application stack operations.""" import inspect import json import logging import multiprocessing import os import sys import threading from typing import ( Callable, Dict, FrozenSet, List, Optional, Tuple, Type, ) from urllib.request import install_opener # The uwsgi module is auto...
flist-uploader.py
import os import sys import shutil import json import threading import time import hub.itsyouonline import hub.threebot import hub.security from stat import * from flask import Flask, Response, request, redirect, url_for, render_template, abort, make_response, send_from_directory, session from werkzeug.utils import sec...
__init__.py
#!/usr/bin/python3 -OO # Copyright 2007-2020 The SABnzbd-Team <team@sabnzbd.org> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any late...
server.py
from __future__ import absolute_import, print_function from failover import HealthCheckServer from random import SystemRandom from threading import Thread, Condition LOOPBACK = "127.0.0.1" def get_test_port(): while True: port = SystemRandom().randint(1025, 32767) # Make sure we can't connect to t...
pymt5.py
# -*- coding: utf-8 -*- # # Copyright (C) DevCartel Co.,Ltd. # Bangkok, Thailand # import socket import threading from six.moves import socketserver import re import time from collections import OrderedDict MSG_SEPARATOR = '\n' MSG_SEPARATOR_TAG = '\x01' MSG_SEPARATOR_TAGVALUE = '=' MSG_MA...
Domain.py
"""Domain module encompassess all domain logic""" import threading import time from datetime import datetime, timedelta import logging class Domain(object): """Domain class for domain logic""" def __init__(self, persistence, acquisition, service): """Initializes Domain object""" self.persistenc...
btcc.py
from befh.restful_api_socket import RESTfulApiSocket from befh.exchanges.gateway import ExchangeGateway from befh.market_data import L2Depth, Trade from befh.util import Logger from befh.instrument import Instrument from befh.clients.sql_template import SqlClientTemplate import time import threading from functools impo...
helps.py
# By: LawlietJH # Odyssey in Dystopia from datetime import datetime import threading import binascii # hexlify y unhexlify import psutil import pygame # python -m pip install pygame import ctypes import base64 import time import math import bz2 import os # Manipulacion de DLLs de Windows =============...
test_enum.py
import enum import inspect import pydoc import sys import unittest import threading from collections import OrderedDict from enum import Enum, IntEnum, EnumMeta, Flag, IntFlag, unique, auto from io import StringIO from pickle import dumps, loads, PicklingError, HIGHEST_PROTOCOL from test.support import ALWAYS_EQ, check...
test_hbase_master.py
# (C) Datadog, Inc. 2010-2016 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # stdlib import threading import time from types import ListType import unittest import os import mock # 3p from nose.plugins.attrib import attr # project from aggregator import MetricsAggregator import logging ...
fixtures.py
from contextlib import contextmanager import os import sys import threading from robocorp_ls_core.options import USE_TIMEOUTS, NO_TIMEOUT import pytest from typing import Optional TIMEOUT: Optional[float] _curr_pytest_timeout = os.getenv("PYTEST_TIMEOUT") if _curr_pytest_timeout: TIMEOUT = float(_curr_pytest_timeo...
pubsub.py
from __future__ import absolute_import import redis import logging from threading import Thread from six.moves.queue import Queue, Full class QueuedPublisherService(object): """ A publisher that queues items locally and publishes them to a remote pubsub service on a background thread. Maintains a l...
telebotapi.py
import requests import asyncio import sys import importlib import inspect from threading import Thread class Message: def __init__(self, **update): self.text = None self.chat = None for key, value in update.items(): if isinstance(value, dict): se...
port_forward.py
#!/usr/bin/env python3 import __init__ import argparse import signal import subprocess from time import sleep from threading import Thread, Event from typing import List SERVICES = [ ("svc/mongodb", "27017:27017"), ("svc/prometheus-server", "8080:80"), ("svc/prometheus-aggregation-gateway", "9091:9091"), ...
User.py
from rwaFiles import * from cipher import * from verifiers import * from datetime import datetime import time import threading from colors import * userID = '' modelAns = [] ansList = [] noOfQns = qzSettings(2) timer = 0 ############################################ Start of Countdown #######################...
demo.py
# -*- coding: utf-8 -*- # Copyright 2018 The Blueoil 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 # # Unles...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import asyncio from typing import TYPE_CHECKING, Optional from electrum_scribe.bitcoin import TYPE_ADDRESS from electrum_scribe.storage import WalletStorage, StorageReadWriteError from electrum_scri...
app.py
import time, sys, traceback, logging # noqa import widdy from ohlc import colors, cli from ohlc.colors import modes from ohlc.candles import chart from ohlc.types import Ohlc from ohlc.random import random_ohlc_generator from threading import Thread # noqa log = logging.getLogger(__name__) palette = [ (colors.O...
views.py
from django.shortcuts import render, redirect from django.core.files.storage import FileSystemStorage as File from .forms import SelectForm from .forms import language_model_choices import scripts import os import threading import time import shutil import os from django.conf import settings from django.http import Fil...
main.py
from handler import metricHandler from handler import welcomePage import argparse from yamlconfig import YamlConfig from wsgiref.simple_server import make_server, WSGIServer, WSGIRequestHandler import logging import sys import falcon from wsgiref import simple_server import socket import threading from socketserver imp...
train_book.py
#coding:utf-8 import numpy from data_iterator import DataIterator import tensorflow as tf from model import * import time import random import sys from utils import * import multiprocessing import argparse import cPickle as pkl parser = argparse.ArgumentParser() parser.add_argument('-p', type=str, default='train', hel...
background_caching_job.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...
py_wrapper.py
""" Setup ~/.bashrc with the followling lines export AWS_ACCESS_KEY_ID=YOUR_KEY_ID export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_KEY export AWS_DEFAULT_REGION=YOUR_REGION export AWS_KVS_LOG_LEVEL=2 export THING_NAME=YOUR_THING_NAME export GST_DEBUG="*:3" IAM User need policy to access kinesisvide...
test_decimal.py
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz (aahz at pobox.com) # and Tim Peters """ These are the test cases for the Decim...
behaviors.py
"""Provides various mixin-classes for kivy widgets.""" from functools import partial from threading import Thread import toolz from kivy.animation import Animation from kivy.clock import Clock from kivy.event import EventDispatcher from kivy.factory import Factory from kivy.properties import ( AliasProperty, ...
worker.py
"""timeflux.core.worker: spawn processes.""" import importlib import logging import signal from multiprocessing import Process from timeflux.core.logging import get_queue, init_worker from timeflux.core.graph import Graph from timeflux.core.scheduler import Scheduler from timeflux.core.registry import Registry from ti...
test_threaded.py
import os import sys import signal import threading from multiprocessing.pool import ThreadPool from time import time, sleep import pytest import dask from dask.compatibility import PY2 from dask.threaded import get from dask.utils_test import inc, add def test_get(): dsk = {"x": 1, "y": 2, "z": (inc, "x"), "w"...
threading_test_v1.py
#!/usr/bin/python # -*- coding: utf-8 -*- __author__ = 'ar' # import numpy as np import multiprocessing as mp import multiprocessing.pool from sklearn.cluster import KMeans import math import numpy as np from concurrent.futures import ThreadPoolExecutor import threading def my_fun(params): idx = params[0] va...
Igralci.py
from tkinter import* from Crnobelo import* import logging import random import threading # V slovar spravimo seznam sosedov vsakega polja. SLOVAR_SOSEDOV = {} #Vrne nasprotnika def nasprotnik(igralec): if igralec == BELI: return CRNI elif igralec == CRNI: return BELI else: assert...
test_setup.py
"""Test component/platform setup.""" # pylint: disable=protected-access import asyncio import datetime import os import threading from unittest.mock import AsyncMock, Mock, patch import pytest import voluptuous as vol from homeassistant import config_entries, setup import homeassistant.config as config_util from home...
test_socket.py
import unittest from test import support import errno import io import itertools import socket import select import tempfile import time import traceback import queue import sys import os import platform import array import contextlib from weakref import proxy import signal import math import pickle import struct impo...
extract_frequencies_from_corpus.py
"""Extract general token/lemma frequencies and subject-verb order information from a large corpus. We use a multi-processing, producer-consumer pattern to efficiently parse the data with spaCy.""" import logging from collections import Counter, defaultdict from dataclasses import dataclass, field import multiprocessin...