source
stringlengths
3
86
python
stringlengths
75
1.04M
lishogi-bot.py
import argparse import shogi import engine_wrapper import model import json import lishogi import logging import multiprocessing import traceback import logging_pool import signal import sys import time import backoff import threading from config import load_config from conversation import Conversation, ChatLine from f...
installwizard.py
import os import sys import threading import traceback from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from electroncash import Wallet, WalletStorage from electroncash.util import UserCancelled, InvalidPassword from electroncash.base_wizard import BaseWizard from electroncash.i18n ...
tests.py
# -*- coding: utf-8 -*- """ Unit tests for reverse URL lookups. """ from __future__ import unicode_literals import sys import threading import unittest from admin_scripts.tests import AdminScriptTestCase from django.conf import settings from django.conf.urls import include, url from django.contrib.auth.models import...
scrape.py
import requests # request product page from amazon.in from bs4 import BeautifulSoup # parsing the page from re import sub # substitute , in currency from decimal import Decimal # better currency representation import time from datetime import datetime # logging #REVIEW import bot import threading import logging impo...
util.py
import subprocess from rc.exception import RunException, PmapException import sys from collections import namedtuple import os from typing import Union, List import io from threading import Thread, Lock from queue import Queue from concurrent.futures import ThreadPoolExecutor, as_completed import signal _RunResult = n...
http_server.py
# Copyright 2019 Uber Technologies, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
web_monitor.py
__author__ = 'Jaakko Aro' import sys import os import ConfigParser import threading import logging import time from monitor_app import MonitoredPage from monitor_app import NoResponse from logging import config from web_server import run_server from optparse import OptionParser LOGGING = { 'version': 1, 'dis...
crawler.py
############################################################### ## Python crawler 1.0 for google play for data extraction ## ## Flavio Giorgi ## ############################################################### ###import statement## from lxml import etree from io import Str...
test_bz2.py
from test import support from test.support import bigmemtest, _4G import array import unittest from io import BytesIO, DEFAULT_BUFFER_SIZE import os import pickle import glob import tempfile import pathlib import random import shutil import subprocess import threading from test.support import import_helper from test.s...
youtube_audioset.py
import numpy as np import pandas as pd from pydub import AudioSegment from subprocess import call, check_call, CalledProcessError import threading import os from datetime import datetime import tensorflow as tf from sklearn.preprocessing import LabelBinarizer explosion_sounds = [ 'Fireworks', 'Burst, pop', 'Eruption...
driver.py
from redis import Redis from threading import Thread from {{ cookiecutter.device_name }} import config as cfg from {{ cookiecutter.device_name }} import command_getter, data_producer def main(): print(cfg.REDIS_HOST, cfg.REDIS_PORT, cfg.REDIS_PASSWORD) redis_instance = Redis(cfg.REDIS_HOST, cfg.REDIS_PORT, ...
node_multilayer_multimaster.py
# -*- coding: utf-8 -*- from blockchain import Blockchain # from wallet import Wallet # from transaction import Transaction from uuid import uuid4 import py2p import socket import threading import time import sys # PARAMETERS # Generate a globally unique address for this Node node_identifier = str(uuid4()).replace('...
bitter.py
#!/usr/bin/env python import re import os import sys import json import glob import html import shutil import signal import datetime import importlib import threading import functools import subprocess from collections import OrderedDict # always flush print = functools.partial(print, flush=True) icon_font = sys.arg...
trouper.py
from slackbot.bot import listen_to import re from slacker import Slacker import local_settings import os import sys import shutil from time import sleep import requests from threading import Thread from slackmq import slackmq import json import chatops version = open(os.path.join( os.path.dirname(__file...
cluster_monitor_3_test.py
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
main.py
from threading import Thread from time import sleep total = 4 def creates_item(): global total for i in range(10): sleep(0.1) print('iteration_1 {}'.format(i)) total += 1 print('iterations_1 done') def creates_item_2(): global total for i in range(7): sleep(0...
rabbit.py
import json import pika import os import subprocess import sys import hashlib import time import logging import threading from functools import partial import functools from TPool.TPool import Pool # from threading import Lock from multiprocessing import Process, Pipe, Lock import multiprocessing import traceback def ...
metadata_widget.py
#!/usr/bin/python # -*- coding:utf-8 -*- import re import os import sys import time import threading from PIL import Image from PyQt5.Qt import * from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * import api import song_metadata as sm from components import dialog from components.work_...
multi_gym_example.py
#!/usr/bin/env python3 import gym import numpy as np import ffai from multiprocessing import Process, Pipe import ffai def worker(remote, parent_remote, env): parent_remote.close() # Get observations space (layer, height, width) obs_space = env.observation_space # Get action space act_space = e...
dashboard.py
# Dashboard for KFM Bot # Imports from flask import Flask from threading import Thread # Create flask app dashboard = Flask("") # Main page @dashboard.route("/") def home(): # Read logs with open("Core/Logs/system.kfmlog", "r") as file: logs = file.read() # Reorder log_list = logs.split("\n")...
main.py
# Copyright 2017 Mycroft AI 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 writin...
lt_traffic_generation.py
""" Probability based traffic generator """ import os import threading import sched import time import sys import random import subprocess DESTINATION = str(sys.argv[1]) PACKET_SIZE = int(sys.argv[2]) PROBABILITY = float(sys.argv[3]) RATE_IF_TRANS = int(sys.argv[4]) scheduler = sched.scheduler(time.time, time.sleep) ...
listener_websocket.py
import asyncio import websockets import json import time import ntplib from threading import Thread from opentrons import types # import nest_asyncio # nest_asyncio.apply() # status enumerations STATUS_IDLE = 0 STATUS_TASK_RECEIVED = 1 STATUS_TASK_INPROGRESS = 2 # STATUS_TASK_COMPLETE = 3 STATUS_ALL_DONE = 9 class...
tensor_models.py
# -*- coding: utf-8 -*- # # setup.py # # Copyright 2018 Amazon.com, Inc. or its affiliates. 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/...
conftest.py
import sys import logging import typing import pytest import os import time from kubernetes import config, client from threading import Thread from config import ( NAMESPACE, POD_NAMES, YAML_DIR, MANAGER_DEPLOYMENT, SERVICE_ACCOUNT, MANAGER_NAME, CONFIG_MAP, ) from util import run_kubectl_c...
utility_functions.py
## # Utility Functions to support re-use in python scripts. # Includes functions for running external commands, etc # # Copyright (c) Microsoft Corporation # # SPDX-License-Identifier: BSD-2-Clause-Patent ## import re import os import logging import datetime import time import shutil import threading import subprocess ...
test_io.py
import numpy as np import pandas as pd import pandas.util.testing as tm import pytest from threading import Lock import threading import dask.array as da import dask.dataframe as dd from dask.dataframe.io.io import _meta_from_array from dask.delayed import Delayed, delayed from dask.utils import tmpfile from dask.l...
test_numexpr.py
################################################################### # Numexpr - Fast numerical array expression evaluator for NumPy. # # License: MIT # Author: See AUTHORS.txt # # See LICENSE.txt and LICENSES/*.txt for details about copyright and # rights to use. ##########################################...
test.py
import gzip import json import logging import os import io import random import threading import time import helpers.client import pytest from helpers.cluster import ClickHouseCluster, ClickHouseInstance MINIO_INTERNAL_PORT = 9001 SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) CONFIG_PATH = os.path.join(SC...
render.py
from datetime import datetime import Queue import re import StringIO import sys import threading import traceback import wx import koko from koko.struct import Struct from koko.fab.asdf import ASDF from koko.fab.tree import MathTree from koko.fab.fabvars import FabVars...
meterssh.py
from socket import * import paramiko import multiprocessing import time import subprocess import ctypes import thread import threading import select ##################################################################################### # # MeterSSH # Tunneling Shellcode over SSH # ...
test_io.py
"""Unit tests for the io module.""" # Tests of io are scattered over the test suite: # * test_bufio - tests file buffering # * test_memoryio - tests BytesIO and StringIO # * test_fileio - tests FileIO # * test_file - tests the file interface # * test_io - tests everything else in the io module # * test_univnewlines - ...
spunkyOrig.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Spunky Bot - An automated game server bot http://github.com/spunkybot/spunkybot Author: Alexander Kress This program is released under the MIT License. See LICENSE for more details. ## About ## Spunky Bot is a lightweight game server administration bot and RCON tool,...
test_debugger_json.py
# coding: utf-8 from collections import namedtuple import json from os.path import normcase import os.path import sys import time import pytest from _pydev_bundle.pydev_localhost import get_socket_name from _pydevd_bundle._debug_adapter import pydevd_schema, pydevd_base_schema from _pydevd_bundle._debug_adapter.pydev...
contact_source.py
from contact_tpfs import get_metadata_tpf, contact_single_tpf_server, contact_single_tpf_server_binding from contact_sparql import contact_single_endpoint_server, get_metadata_endpoint, \ contact_single_endpoint_server_bindings from contact_brtpf import get_metadata_brtpf, contact_single_brtpf_server, contact_singl...
eventEngine.py
# encoding: UTF-8 # 系统模块 from Queue import Queue, Empty from threading import Thread # 第三方模块 from PyQt4.QtCore import QTimer # 自己开发的模块 from eventType import * ######################################################################## class EventEngine: """ 事件驱动引擎 事件驱动引擎中所有的变量都设置为了私有,这是为了防止不小心 从外部修改了...
main.py
import requests import urllib from time import sleep from threading import Thread from colorama import Fore def startDir(): print(Fore.BLUE + """ MMMMMMMMMMMMWNK0kxdoolllccclllodxk0KNWMMMMMMMMMMMM MMMMMMMMMWX0xdllccclccccclllcccccllldx0XWMMMMMMMMM MMMMMMWN0xollccccclllcccclllcccccccclclox0NWM...
os_utility.py
import smtplib, ssl import time import threading import psutil import os from getpass import getpass def cpu_usage(): x = psutil.cpu_percent(interval=1, percpu=True) return x[0] def ram_usage(): r_usage = psutil.virtual_memory()[2] return r_usage def disk_space(): d_usage = psutil.disk_usage...
common_func.py
#!/usr/bin/env python # coding=utf-8 from __future__ import print_function, unicode_literals, division, absolute_import import sys import time import binascii import struct import collections import logging import socket import functools import threading import traceback import warnings try: import selectors f...
callback.py
# event.py # # CallBack is an object holding # a function and its arguments. # This object make easier the use of # callback functions. # # Created by Lenselle Nicolas, January, 2016. # lenselle.nicolas@gmail.com import threading import time class CallBack: def __init__(self, function=None, activat...
V1_Novo_Biorad_ok .py
from opentrons.types import Point import json import os import math import threading from time import sleep metadata = { 'protocolName': 'V1_Novo_BioRad', 'adapted by': 'Ricardo Magalhães', 'author': 'Ricardo Magalhães', 'apiLevel': '2.3' } NUM_SAMPLES = 48 # start with 8 samples, slowly...
neat_mario.py
#!/usr/bin/env python3 import gym_super_mario_bros import gym from gym_super_mario_bros.actions import SIMPLE_MOVEMENT from nes_py.wrappers import JoypadSpace import numpy as np import multiprocessing as mp import neat import visualize import pickle import sys import os import cv2 # disable warnings gym.logger.set_le...
thread_demo_two.py
import threading import time def run(n, semaphore): semaphore.acquire() #加锁 time.sleep(1) print("run the thread:%s\n" % n) semaphore.release() #释放 if __name__ == '__main__': semaphore = threading.BoundedSemaphore(5) # 最多允许5个线程同时运行 for i in range(22): t = threading.Thread(target=...
matching_request.py
import uuid import json import threading from flask import Response import common.log from matching.matcher import Matcher from common.utility import get_current_ms class MatchingRequest(): def __init__(self, uid, data, time): self.uid = uid self.time_created = get_current_ms() self.data = ...
endofTrial_lcd_and_display_station.py
#End of trial with threading #End state: combining LCD display and display station (bluetooth) #LCD #At the end of 75 seconds, your vehicle should cease operation. #The locations of bridge damage should be presented on the display in sequential form (one at a time), #with each location displayed for a duration of appr...
download.py
import argparse from datetime import date, datetime import glob import logging from pathlib import Path import os import shutil import zipfile from threading import Thread from queue import Queue import sys from bs4 import BeautifulSoup import requests from requests.exceptions import HTTPError from statement_parser.ut...
__init__.py
import os import zstandard import ujson as json import time import tarfile import codecs from functools import reduce import jsonlines import io from zipfile import ZipFile import gzip from math import ceil import mmap import multiprocessing as mp def listdir_or_file(x): if isinstance(x, list): return red...
http.py
import sys import os import re import traceback import requests import socket import threadutils import urllib import mimetypes import plexobjects from xml.etree import ElementTree import asyncadapter import callback import util codes = requests.codes status_codes = requests.status_codes._codes DEFAULT_TIMEOUT = ...
test_processor.py
#!/usr/bin/env python3 import os import glob import logging import ctypes import unittest import ast from time import sleep import threading import multiprocessing as mp from queue import Empty import socket from shutil import which, rmtree, copyfile import numpy as np from astropy.time import Time, TimeDelta import h...
task4.py
# Material: # Link to the Colab notebook: # https://colab.research.google.com/drive/1s5F1uFqCK1MOG2GHzCWqSWqECDmC3O5h#scrollTo=zPmrTNlSBW-R # You may find the IPYNB/RISE notebook in: # robotic_systems_lab/notebooks/_modeling_and_control_of_manipulators.ipynb # Link to the practice report: # https://docs.google.com/do...
evaluation.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import import six import six.moves.cPickle as pickle from six.moves.queue import Queue import os import sys from threading import Thread, stack_size as set_threa...
azure-parallel-start-vm.py
""" Python support for Azure automation is now public preview! Azure automation documentation : https://aka.ms/azure-automation-python-documentation Azure Python SDK documentation : http://azure-sdk-for-python.readthedocs.io/en/latest/index.html """ import sys import threading import automationassets from...
parallel_processing_ingest_dense_matrix.py
# """THIS IS A WORK IN PROGRESS # Command-line interface for ingesting dense matrixes into firestore with paraelle processing # DESCRIPTION # This CLI uses paraelle processing to map expression data from a dense matrix. # Genes are mapped to expression values and cell names and inputted into firestore # PREREQUISITE...
utils.py
import logging import threading, time, traceback import sqlite3 def my_logger (mqtt_client , channel , msg): print(msg) #mqtt_client.publish(channel , msg , 2 , True) logging.info(msg) def every(delay, task): next_time = time.time() + delay while True: time.sleep(max(0, next_time - time.time())) try: ...
app.py
from flask import request, Response, Flask from pystress import * import json from threading import Timer app = Flask(__name__) processes = dict() def stop(procs): for p in procs: p.terminate() processes.pop(p.pid) @app.route('/start', methods=['POST']) def start(): try: exec_time =...
algo_nba_bot.py
# -*- coding: utf-8 -*- """List of functions: ---pinnacle specific--- get_balance get_fixtures get_ids get_lines get_sport_odds place_bet ---other--- create_model get_pick get_start_times initiate_scheduler load_trained_model login_to_twitter open_sheet prepare_bet prepare_training_set prevent_inactivity set_schedule...
__init__.py
# Copyright (c) 2014 Alcatel-Lucent Enterprise # 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 # # Un...
autotaskdownloadmanager.py
""" autotask download manager create by judy 2019/07/27 """ import threading import time import traceback from queue import Queue from datetime import datetime import pytz from datacontract import ETaskStatus, ECommandStatus from datacontract.automateddataset import AutomatedTask, EAutoType from idownclient.automated ...
app.py
import requests import json import threading import os import sys import uuid from multiprocessing import Process from functools import partial from celery import Celery from celery.result import AsyncResult from flask import Flask, jsonify # from flask_admin.contrib import rediscli from flask_sqlalchemy import SQLAl...
trainer_utils.py
# coding=utf-8 # Copyright 2020-present the HuggingFace Inc. team. # # 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 ap...
dx_users.py
#!/usr/bin/env python # Adam Bowen - Aug 2017 # Description: # This script will allow you to easily manage users in Delphix # This script currently only supports Native authentication # # Requirements # pip install docopt delphixpy.v1_8_0 # The below doc follows the POSIX compliant standards and allows us to use # thi...
client.py
#!/usr/bin/env python3 import socket import threading from queue import Queue import time DELETE = False queue = Queue() def receive(): ip = socket.gethostbyname(socket.gethostname()) port = 9999 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.bind((ip, port)) while DELETE != True: ...
generator.py
import copy import sys from collections import defaultdict from typing import Generic, TypeVar, Type, Callable, List, Dict from webdnn.backend.code_generator.allocator import MemoryLayout from webdnn.backend.interface.graph_descriptor import IGraphExecutionData from webdnn.graph import traverse from webdnn.graph.graph...
device_controller_tests.py
#Copyright 2013 Pieter Rautenbach # # 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...
subscriber.py
#!/usr/bin/env python # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
flask_threaded_rpc_client.py
import threading from time import sleep from flask import Flask import amqpstorm from amqpstorm import Message app = Flask(__name__) class RpcClient(object): """Asynchronous Rpc client.""" def __init__(self, host, username, password, rpc_queue): self.queue = {} self.host = host sel...
__init__.py
"""Hermes MQTT server for Rhasspy TTS using external program""" import io import logging import re import shlex import socket import subprocess import threading import time import typing import wave from queue import Queue import webrtcvad from rhasspyhermes.asr import AsrStartListening, AsrStopListening from rhasspyh...
distance_method.py
#!/usr/bin/env python # ---------------------------------------------------------------------------- # Copyright (c) 2015--, The WGS-HGT Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------...
test.py
#!/usr/bin/env python # coding:utf-8 """ Test functionality of Service elements. """ # -- standard library --------------------------------------------------------- from cgi import parse_header, FieldStorage from threading import Thread import unittest import tempfile import zipfile import socket import json import s...
useroperations_helper.py
import threading import random import string import bcrypt import requests from lxml import html from Geoportal.settings import HOSTNAME, HTTP_OR_SSL, INTERNAL_SSL, MULTILINGUAL from Geoportal.utils import utils from searchCatalogue.utils.searcher import Searcher from useroperations.models import MbUser from useropera...
buck.py
# Copyright 2004-present Facebook. All rights reserved. import functools import glob import json import logging import os import subprocess import sys import tempfile import threading from collections import namedtuple from typing import Dict, Iterable, List, Optional, Set, Tuple, cast # noqa from .filesystem impor...
handlers.py
from telegram import ChatAction, Update, PhotoSize, InlineKeyboardButton, InlineKeyboardMarkup, InlineQueryResultPhoto from telegram.ext import CallbackContext, run_async from telegram.error import TelegramError, Unauthorized from threading import Thread from uuid import uuid4 import validators import requests import ...
VideoFeed.py
#!/usr/bin/env python3 import threading import datetime import imutils from imutils.video import VideoStream import os import sys import time import tkinter as tk from PIL import Image, ImageTk import cv2 from button_gpio_test import setupButtonInput class VideoFeed: def __init__(self, vs): """Initializes basic...
running.py
# -*- coding: utf-8 -*- """Code for maintaining the background process and for running user programs Commands get executed via shell, this way the command line in the shell becomes kind of title for the execution. """ import collections import logging import os.path import re import shlex import signal import sub...
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 ta...
Currency Ticker.py
import json import requests import oandapyV20 from oandapyV20 import API import oandapyV20.endpoints.pricing as pricing import pandas as pd import urllib3 from multiprocessing.dummy import Pool as ThreadPool import time as t import matplotlib from tkinter import * import threading from multiprocessing impo...
views.py
import shlex from http import HTTPStatus from pathlib import Path from threading import Thread import flask from flask import request, render_template, redirect, url_for from flask.json import jsonify from flask_login import login_user, logout_user, login_required, current_user from app import app, db from app.attack...
nvm.py
import sys, time import multiprocessing as mp import numpy as np import scipy as sp import visualizer as vz import mock_net as mn class NVM: def __init__(self, coding, network): self.coding = coding self.network = network self.visualizing = False # Encode layer names and constants ...
utils.py
# python3 # Copyright 2018 DeepMind Technologies 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.org/licenses/LICENSE-2.0 # # Unless re...
__init__.py
"""This module provides an example Cayenne plugin containing a sensor and an actuator""" import random import time from threading import Thread from myDevices.utils.logger import info class ExampleSensor(): """An example sensor that reads random or incremental values.""" def __init__(self, max=100, min=0, ra...
test_operator_gpu.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...
RemoteControlTransmitterProcess.py
# Copyright (c) 2019, Bosch Engineering Center Cluj and BFMC organizers # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, ...
app.py
import os from flask import Flask, request, jsonify, render_template from flask_cors import CORS # 解决跨域的问题 from flask_sqlalchemy import SQLAlchemy from config import Config, networkSeg from gethost import getIP import time import threading app = Flask(__name__) # 连接用户更新间隔时间 updateTime = 60 # userIP, userAR = getIP()...
test.py
import logging import time import sys import os import ctypes from ctypes import wintypes, byref import subprocess import threading import queue from JABWrapper.context_tree import ContextNode, ContextTree, SearchElement from JABWrapper.jab_types import JavaObject from JABWrapper.jab_wrapper import JavaAccessBridge...
mc_pce_utils.py
from itertools import product, islice from multiprocessing import Process import os import logging import numpy as np from scipy.io import savemat, loadmat, matlab from scipy.stats import beta import multidim_galerkin_pod.chaos_expansion_utils as ceu def get_wfunc(distribution='uniform', nulb=0., nuub=1., dimunc=1)...
application.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
ch08_listing_source.py
import BaseHTTPServer import cgi import functools import json import math import random import socket import SocketServer import time import threading import unittest import uuid import urlparse import redis def acquire_lock_with_timeout( conn, lockname, acquire_timeout=10, lock_timeout=10): identifier = str...
bm_chameleon.py
from mpkmemalloc import * import threading import psutil import functools import gc import six import pyperf import os from chameleon import PageTemplate BIGTABLE_ZPT = """\ <table xmlns="http://www.w3.org/1999/xhtml" xmlns:tal="http://xml.zope.org/namespaces/tal"> <tr tal:repeat="row python: options['table']"> <td ...
watcher.py
import asyncio import logging import threading from dataclasses import dataclass from typing import Callable, List import pywatchman logger = logging.getLogger(__name__) MatchOptions = {"includedotfiles": True} def _patterns_to_expression(include, exclude): # convert a list of globs into the equivalent watchman...
sdk_worker.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...
MainRunner.py
import datetime import logging import threading import time import traceback from multiprocessing import Process, Value import utils from BiliLive import BiliLive from BiliLiveRecorder import BiliLiveRecorder from BiliVideoChecker import BiliVideoChecker from DanmuRecorder import BiliDanmuRecorder from Processor impor...
pabot.py
#!/usr/bin/env python # 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 ...
test_operator.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
process_parallel.py
""" process_parallel.py ~~~~~~~~~~~~~~~~~~~ A simple library whichs helps with parallel computing. :copyright: (c) 2014 by Raphael Brand. :license: MIT, see LICENSE for more details. """ from multiprocessing import Process, JoinableQueue, Queue, cpu_count from threading import Thread class StopSignal(object): pa...
RecvData.py
import sys sys.path.append("C:/Users/David/Desktop/programacion/python/Anime Battle Online/client") import threading from pygame import Rect from socket import timeout import settings import Globals from functions.ShortFunctions import unpackPacket, getPlayerByNumber, getBulletByNumber, getSkillByNumber, goodb...
verificaitonRawdataSize.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # 引用 FileSegByHour 类切分原始文件,并合并最终结果至按天分的子文件中 import sys import os import time import logging import getopt from multiprocessing import Process from util.CountTravelNum import CountTravelNum def processTask(x, city, stdindir, stdoutdir, inum, onum, MAXDAY, SAFECOUNT): P...
train_imagenet.py
#!/usr/bin/env python """Example code of learning a large scale convnet from ILSVRC2012 dataset. Prerequisite: To run this example, crop the center of ILSVRC2012 training and validation images and scale them to 256x256, and make two lists of space- separated CSV whose first column is full path to image and second colu...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
A1scan2obs.py
# ECSC on the opencv image to quit import numpy as np import cv2 import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import math import time import sys import rospy import sensor_msgs.point_cloud2 as pc2 from sensor_msgs.msg import PointCloud2, CompressedImage, LaserScan from geometry_msgs.msg imp...
dev_server.py
''' A python server to mimic the behavior of unrealcv server Useful for development ''' import threading, logging, sys if (sys.version_info > (3, 0)): import socketserver as SocketServer else: import SocketServer # import MySocketServer as SocketServer SocketServer.ThreadingMixIn.daemon_threads = True SocketSer...