source
stringlengths
3
86
python
stringlengths
75
1.04M
test_crud.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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
runtests.py
#!/usr/bin/env python # vim:ts=4:sw=4:et: from __future__ import absolute_import from __future__ import division from __future__ import print_function # no unicode literals import os import os.path # in the FB internal test infra, ensure that we are running from the # dir that houses this script rather than some othe...
GUI_initIOCs.py
#!/usr/bin/env python3 import initIOCs #------------------------------------------------- #---------------- MAIN GUI CLASSES --------------- #------------------------------------------------- # Include guard in case user doesn't have tkinter installed but still wants to use the CLI version WITH_GUI=True try: fr...
tests.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...
kutil.py
# Copyright (c) 2020, 2021, Oracle and/or its affiliates. # # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ # # Kubernetes (kubectl) utilities # Use kubectl instead of the API so we go through the same code path as an end-user import subprocess import logging ...
test_local.py
# Copyright 1999-2021 Alibaba Group Holding Ltd. # # 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 a...
gamecontroller.py
from threading import Thread, Lock from time import sleep from controller.snakelistcontroller import SnakeListController from service.simulationservice import SimulationService from view.dashboard import * from view.gameview import * from util.encoding import * from view.tkuithread import TKUIThread class GameContro...
Miz-cpu.py
''' Made by Mizogg Look for HASH160 Compressed and Uncompressed Using iceland2k14 secp256k1 https://github.com/iceland2k14/secp256k1 fastest Python Libary Good Luck and Happy Hunting HASH160_randomCPU.py Version 2 scan randomly in Range with CPU Speed Improvments https://mizogg.co.uk ''' import secp256k1 as ice im...
SpotifyOAuthHandler.py
import threading, requests, webbrowser, configparser, datetime from http.server import BaseHTTPRequestHandler, HTTPServer from urllib.parse import urlparse import base64 server_address = ("127.0.0.1", 5000) event_get_token = threading.Event() config = configparser.ConfigParser() config.read("config.ini") redirect_ur...
svnwrap.py
#!/usr/bin/env python # coding=utf-8 from __future__ import print_function from __future__ import unicode_literals import atexit import codecs import difflib import errno import io import locale import os import platform import re import shlex import shutil import signal import subprocess import sys import textwrap i...
process.py
import importlib import os import signal import time import subprocess from abc import ABC, abstractmethod from multiprocessing import Process from setproctitle import setproctitle # pylint: disable=no-name-in-module import cereal.messaging as messaging import selfdrive.crash as crash from common.basedir import BASE...
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...
graph-size-degree-trim.py
#! /usr/bin/env python # # This file is part of khmer, http://github.com/ged-lab/khmer/, and is # Copyright (C) Michigan State University, 2009-2013. It is licensed under # the three-clause BSD license; see doc/LICENSE.txt. Contact: ctb@msu.edu # import khmer import sys import screed import os.path import threading imp...
lbbroker3.py
""" Least-recently used (LRU) queue device Demonstrates use of pyzmq IOLoop reactor While this example runs in a single process, that is just to make it easier to start and stop the example. Each thread has its own context and conceptually acts as a separate process. Author: Min RK <benjaminrk(at)g...
playerrobot.py
""" High-level interface to the Player client libraries. The Player client libraries allow Python code to communicate with hardware devices such as robots, cameras, and range sensors. This is a temporary home for this file until it finds a permanent home (maybe in the PlayerStage project or in PLASTK?) """ import t...
elevate.py
# # Elevate the current users privs # import os import sys import argparse import importlib import threading from prettytable import PrettyTable __description__ = "Attempt to elevate the beacons privilages on the target" ERROR = False error_list = "" RAN_COMMAND = False # let argparse error and exit nice def erro...
anti-afk-mover.py
from enum import Enum from pynput.keyboard import ( Key, Listener as KeyboardListener, Controller as KeyboardController, ) from pynput.mouse import ( Button, Listener as MouseListener, Controller as MouseController, ) from random import randrange import time import sys import threading import os...
penv.py
""" Copyright (c) https://github.com/lcswillems/torch-rl """ from multiprocessing import Process, Pipe import gym def worker(conn, env): while True: cmd, data = conn.recv() if cmd == "step": obs, reward, done, info = env.step(data) if done: obs = env.res...
lib.py
""" Test library. """ import difflib import inspect import json import subprocess import os import posixpath import shlex import shutil import string import threading import urllib import pprint import SocketServer import SimpleHTTPServer class ThreadedTCPServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer): ...
managers.py
# Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import datetime import json import os from logging import Logger from queue import Queue from threading import Thread from typing import Dict import websocket from jupyter_client.asynchronous.client import AsyncKernelC...
recipe-576965.py
#!/usr/bin/env python """worker.py: Executes inline code across multiple execution contexts. The inline code to be executed is contained in a generator, which contains a `yield` statement to signal each context change. A decorator added to the generator function wraps the returned generator in the executor when the g...
controller.py
"""Main controller that will maintain the connection, and send buy/sell singals """ import time import json from datetime import timedelta from copy import deepcopy from multiprocessing import Process from trader import Trader from args_parser import args_parser def load_config(options) -> dict: """Loads the con...
Live_phone.py
import os import pathlib import cv2 from threading import Thread, Event class Live_phone: def __init__(self): self.img = None def get(self, img): # self.img = img i = 0 while True: try: path = 'Android_Web\\flask\\examples\\tutorial\\flaskr\\images\\l...
visdomLogger.py
import numpy as np import matplotlib.pyplot as plt import seaborn as sn from visdom import Visdom def run_async(func): from threading import Thread from functools import wraps @wraps(func) def async_func(*args, **kwargs): thread = Thread(target=func, args=args, kwargs=kwargs) thread.st...
scradaway.py
import os import os.path from optparse import OptionParser import random import threading import time import re import json import traceback import signal signal.signal(signal.SIGINT, signal.SIG_DFL) # External dependencies: import psycopg2 from lxml import etree from lxml.html.clean import Cleaner from lxml.cssselect...
thread_objects_01.py
import threading def target_function() -> None: print('threading.current_thread().is_alive(): ', threading.current_thread().is_alive()) thread_01 = threading.Thread(target=target_function) print('thread_01.is_alive(): ', thread_01.is_alive()) thread_01.start()
launcher.py
""" Helper functions to parse and launch programs presented in an input file """ import os from multiprocessing import Process from time import time import shlex import subprocess import psutil def parse_file(file_path): """Parse input file and return list of programs with thier dir annd shares""" retval = [] ...
concurrent.py
from __future__ import absolute_import import logging import threading from Queue import Full, PriorityQueue from concurrent.futures import Future from concurrent.futures._base import RUNNING, FINISHED from time import time logger = logging.getLogger(__name__) class TimedFuture(Future): def __init__(self, *arg...
common.py
TRACE = False import sys import threading import traceback import time import os log_file = None def init_logging(name): global log_file pid = os.getpid() path = '/tmp/%s_%d.log' % (name, pid) log_file = open(path, 'a') def debug(str, level='DEBUG', to_stderr=False): now = time.time() time_s...
quizscreen.py
from drawengine import * import screens import random from copy import deepcopy from tkinter import Tk from tkinter import filedialog Tk().withdraw() class Quizscreen: page = 0 quest = None correct = 0 def __init__(self): self.window = Singleton.window self.color =...
session_test.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
lights-back-forth.py
#! /usr/bin/env python3 import RPi.GPIO as GPIO import time, sys from itertools import cycle from threading import Thread import mypins GPIO.setmode(GPIO.BCM) pins = mypins.pins6 GPIO.setup(pins, GPIO.OUT) GPIO.output(pins, GPIO.LOW) GPIO.setwarnings(False) def cycle_pin(pin): GPIO.output(pin, GPIO.HIGH) ...
regrtest.py
#! /usr/bin/env python """ Usage: python -m test.regrtest [options] [test_name1 [test_name2 ...]] python path/to/Lib/test/regrtest.py [options] [test_name1 [test_name2 ...]] If no arguments or options are provided, finds all files matching the pattern "test_*" in the Lib/test subdirectory and runs them in alphabeti...
current_thread.py
''' Date: 2021.06.01 10:51:00 Description: Omit LastEditors: Rustle Karl LastEditTime: 2021.06.01 10:51:08 ''' import threading import time def first_function(): print(threading.currentThread().getName() + str(' is Starting ')) time.sleep(2) print(threading.currentThread().getName() + str(' is Exiting '))...
mcedit.py
# !/usr/bin/env python2.7 # -*- coding: utf_8 -*- # import resource_packs # not the right place, moving it a bit further #-# Modified by D.C.-G. for translation purpose #.# Marks the layout modifications. -- D.C.-G. """ mcedit.py Startup, main menu, keyboard configuration, automatic updating. """ import splash impor...
mc_remote_pillar.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' .. _module_mc_remote_pillar: mc_remote_pillar / masterless pillar management =============================================== The idea is to have masterless managed tenants, where the pillar is remotely generated on a central box and replicated onto final destinatio...
Miner.py
#Miner import SocketUtils import Transactions import TxBlock import pickle wallets = [('localhost',5006)] tx_list = [] head_blocks=[None] break_now = False verbose = True def StopAll(): global break_now break_now = True def minerServer(my_addr): global tx_list global break_now ...
basic01.py
""" web服务器返回灵活页面,根据制定的路径打开指定的页面 """ import socket, threading, multiprocessing,gevent import re import time # dynamic包中存放的是框架之类的东西,注意更新import的路径 import dynamic.mini_framework from gevent import monkey monkey.patch_all() class WSGIServer(object): def __init__(self): self.server_socket = socket.socket...
test_crud.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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
test_apiserver.py
# -*- coding: utf-8 -*- """ tests.apiserver ~~~~~~~~~~~~ Tests cobra.api :author: 40huo <git@40huo.cn> :homepage: https://github.com/wufeifei/cobra :license: MIT, see LICENSE for more details. :copyright: Copyright (c) 2017 Feei. All rights reserved """ import json import multiproc...
client.py
import logging try: import queue except ImportError: # pragma: no cover import Queue as queue import signal import ssl import threading import time import six from six.moves import urllib try: import requests except ImportError: # pragma: no cover requests = None try: import websocket except Impo...
proxy2proxy.py
# -*- coding: utf-8 -*- # 2020/7/10 # create by: snower import time import argparse import logging import traceback import threading import signal import sevent from .simple_proxy import format_data_len, warp_write, http_protocol_parse, socks5_protocol_parse from .tcp2proxy import http_build_protocol, sock...
combat.py
import math import string from datetime import datetime, timedelta from util.logger import Logger from util.utils import Region, Utils from scipy import spatial from threading import Thread class CombatModule(object): def __init__(self, config, stats, retirement_module, enhancement_module): """Initializes...
test_default_headers.py
import threading import time import requests from uvicorn import Config, Server class App: def __init__(self, scope): if scope["type"] != "http": raise Exception() async def __call__(self, receive, send): await send({"type": "http.response.start", "status": 200, "headers": []}) ...
cluster_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...
thread_queue_test.py
#!usr/bin/python # -*- coding:utf8 -*- # 通过queue的方式进行线程间的同步 from queue import Queue import time import threading detail_url_list = [] def get_detail_html(queue): # 爬取文章详情页 while True: url = queue.get() print("get detail html started") time.sleep(2) print("get ...
main.py
#!/usr/bin/env python import Queue import codecs import socket import threading import time import paramiko import module_aix as aix import module_freebsd as freebsd import module_linux as ml import module_mac as mc import module_openbsd as openbsd import module_solaris as ms import module_hpux as hp...
server.py
# Copyright 2020 Adap GmbH. 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 applicable law or ag...
watchers.py
from threading import Thread, Event try: from invoke.vendor.six.moves.queue import Queue, Empty except ImportError: from six.moves.queue import Queue, Empty from invoke import Responder, FailingResponder, ResponseNotAccepted # NOTE: StreamWatcher is basically just an interface/protocol; no behavior to # tes...
test_run.py
import os from gui.functions.image_provider import ImageProvider from gui.functions.image_calculator import ImageCalculator from threading import Thread if __name__ == "__main__": d = os.path.join(os.getcwd(), "trash") c = ImageCalculator(lambda x: print(f"Calculated new center: {x}")) i = ImageProvider(...
antifier.py
#based on T1932 protocol import usb.core import time import ant, trainer import sys import binascii import struct import platform, glob import os import threading import Tkinter import pickle from Tkinter import * from tkMessageBox import * from datetime import datetime import argparse if os.name ...
prac04.py
#Import all relevant libraries import busio import digitalio import board import adafruit_mcp3xxx.mcp3008 as MCP from adafruit_mcp3xxx.analog_in import AnalogIn import threading import datetime import time #Declare global variables global now global button global Timeint #Instantiate some global variables Timeint = 5 n...
transpiler_test.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
test_sample.py
import cv2 import numpy as np import pandas as pd import threading import Queue import tensorflow as tf from tensorflow.python.client import device_lib from tqdm import tqdm import params import os input_size = params.input_size batch_size = 1 orig_width = params.orig_width orig_height = params.orig_height threshold ...
mouse_handler.py
import datetime import random import sys import threading import time import win32api import win32con SCREEN_WIDTH = win32api.GetSystemMetrics(0) SCREEN_HEIGHT = win32api.GetSystemMetrics(1) class Mouse_Handler: def __init__(self): # thread self.active_thread = None self.timer_handler_thr...
simulate_trj.py
#!/usr/bin/env python # This script loads a trajectory file and simulates the execution publishing a # custom trajectory message that is converted in odometry by another node import numpy as np import rospy import crazyflie import time import uav_trajectory from threading import Thread from crazyflie_demo.msg import...
timed_bounds_solver.py
from random import shuffle,random import click import json from multiprocessing import Process, Manager import time from math import sqrt from minimax_solver import setup, calc_maxmin_minmax, spruik_solver import gmpy2 indsplus = None N = None def v(s): global indsplus if indsplus is None: indsplus = calc_maxmin_...
agent.py
#!/usr/bin/env python import threading import sys import time import os import commands import psutil import random import urllib,urllib2 import socket from optparse import OptionParser SERVER_IP='' SERVER_PORT=8899 DETECT_TIME=3600 try: import simplejson except ImportError as e: import json as simplejson de...
pub.py
"""Publish a message.""" import itertools import sys import threading import time import nng def main(argv): if len(argv) < 2: print('usage: %s url' % argv[0], file=sys.stderr) return 1 def publish(url): try: with nng.Socket(nng.Protocols.PUB0) as socket: ...
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...
NetworkLatencyCollector.py
#!/usr/bin/env python import Queue import socket import time import threading import copy import math import json from datetime import datetime import stomp import tools import siteMapping topic = '/topic/perfsonar.raw.histogram-owdelay' siteMapping.reload() conns = [] class MyListener(object): def on_messag...
test_pdb.py
# A test suite for pdb; not very comprehensive at the moment. import doctest import os import pdb import sys import types import unittest import subprocess import textwrap from contextlib import ExitStack from io import StringIO from test import support # This little helper class is essential for testing pdb under do...
train.py
import argparse import logging import math import os import random import time from copy import deepcopy from pathlib import Path from threading import Thread import numpy as np import torch.distributed as dist import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.optim.lr_sche...
transaction.py
#!/usr/bin/python3 import functools import sys import threading import time from enum import IntEnum from hashlib import sha1 from pathlib import Path from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union import black import requests from eth_abi import decode_abi from hexbytes import HexByte...
msa_module.py
import os import sys import re import pickle import logging from datetime import datetime from threading import Thread logging.basicConfig(format='%(levelname)s: %(name)s - %(message)s', level=logging.INFO) logger = logging.getLogger('MSA-module') from kqml import KQMLPerformative, KQMLList from ...
serverApp.py
import subprocess import sys import socket import time import piDriverSafetyWebcam as driver import config import threading import _thread import json path = config.homeDirectory + "src/resources/data.txt" with open(path, "r") as myfile: # Reading file for runParameter data = myfile.read() data = data.sp...
S1.py
import socket import threading import sys import pickle class Servidor(): """docstring for Servidor""" def __init__(self, host="localhost", port=8991): self.clientes = [] print(self.clientes) self.ident=[] print(self.ident) ...
activity.py
""" Activity ======== Activities are self generated classes to which you can pass an identifier, and a list of tasks to perform. The activities are in between the decider and the task. For ease, two types of task runners are available: SyncTasks and AsyncTasks. If you need something more specific, you should either c...
main.py
# Author : globalpolicy # Date : March 2-4, 2017 # Script : pyWall # Description : Change windows wallpaper # Python : 3.5 # Blog : c0dew0rth.blogspot.com import requests from bs4 import BeautifulSoup import random import shutil # for copying raw image data(a file-like object) to an actual image file i...
updater.py
from subprocess import call import os, sys from os import path #from tkinter import * from threading import * import tkinter as tk #from tk import tkFileDialog from tkinter import filedialog as fd from tkinter import messagebox as mb #from tk import tkMessageBox import logging from logging import handlers import csv ...
main.py
""" Date: 07 DEC 2018 Author: Pritam Kamble """ from UI.dialogs import UIdialog import grayscale, flip, _filter, _rotation, _enhance from tkinter import * from tkinter import ttk from PIL import Image, ImageTk import threading import copy import datetime # from multiprocessing.pool import ThreadPool from random...
main_tested.py
import pygame as pg import sys import board import busio import adafruit_pca9685 import VL53L0X import time # from threading import Thread channel = [9, 10, 11, 13, 14, 15] gpio = [0x31, 0x32, 0x33, 0x34, 0x35, 0x36] tofs = [] dist = [0, 0, 0, 0, 0, 0] i2c = busio.I2C(board.SCL, board.SDA) pca = adafruit_pca9685.PCA96...
wsdanmu.py
import websocket import socket import time from websocket import create_connection,WebSocket import pystt import threading from .config import conf from .tail_call import tail_call_optimized from .tools import sendEmail luckystar=0 keybody='' uenter_set=set() speaker_set=set() class DouyuMsg(object): """ ...
test_paymentrequests.py
import unittest from threading import Thread from http.server import SimpleHTTPRequestHandler, HTTPServer from ..address import Address from ..paymentrequest import get_payment_request from .. import paymentrequest_pb2 as pb2 class Test_PaymentRequests(unittest.TestCase): def setUp(self): self.serv = None...
forms.py
# Copyright (c) 2015, Imperial College London # 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, # this list of condi...
registry.py
import logging import threading import time from typing import List from brownie import Contract, chain, web3 from joblib import Parallel, delayed from web3._utils.abi import filter_by_name from web3._utils.events import construct_event_topic_set from yearn.events import create_filter, decode_logs, get_logs_asap from ...
authorization_code_grant.py
import logging import os import sys import urllib import urlparse import json import signal from multiprocessing.process import Process from wsgiref.simple_server import make_server, WSGIRequestHandler sys.path.insert(0, os.path.abspath(os.path.realpath(__file__) + '/../../../')) from oauth2 import Provider from oau...
main.py
from __future__ import division import warnings warnings.filterwarnings("ignore", category=FutureWarning) warnings.filterwarnings("ignore", message="size changed") import sys import os import time import math import random try: import Queue as queue except ImportError: import queue import threading import h5py...
test_messaging.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in the project root # for license information. from __future__ import absolute_import, division, print_function, unicode_literals """Tests for JSON message streams and channels. """ import collections import fun...
fifo_queue_test.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
subprocess42.py
# Copyright 2013 The Swarming Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 that # can be found in the LICENSE file. """subprocess42 is the answer to life the universe and everything. It has the particularity of having a Popen implementation that can yield o...
sqlite_support.py
import asyncio import concurrent.futures from enum import Enum import queue try: # Linux expects the latest package version of 3.35.4 (as of pysqlite-binary 0.4.6) import pysqlite3 except ModuleNotFoundError: # MacOS has latest brew version of 3.35.5 (as of 2021-06-20). # Windows builds use the official...
main.py
#!./venv/bin/python from pyModbusTCP.server import ModbusServer, DataBank from time import sleep from random import uniform, random import os import json import itertools import http.server import socketserver import threading from datetime import datetime from flask import Flask from flask_cors import CORS app = Fla...
test_carbonlookaside_route.py
#!/usr/bin/env python3 # 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. from mcrouter.test.McrouterTestCase import McrouterTestCase import tempfile import os import time from string import Te...
tracker.py
# Copyright 1999-2020 Alibaba Group Holding Ltd. # # 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 a...
main.py
from tkinter import IntVar from tkinter import StringVar from tkinter import Tk from tkinter import Menu from tkinter import Frame from tkinter import Canvas from tkinter.filedialog import askdirectory, askopenfilenames from tkinter import Label from tkinter import Checkbutton from tkinter.ttk import Combobox from tkin...
test_pooling.py
# Copyright 2009-present MongoDB, 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 wri...
gdal2tiles.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # ****************************************************************************** # $Id$ # # Project: Google Summer of Code 2007, 2008 (http://code.google.com/soc/) # Support: BRGM (http://www.brgm.fr) # Purpose: Convert a raster into TMS (Tile Map Service) tiles in a di...
app_test.py
# MIT License # # Copyright (c) 2020 Christopher Friedt # # 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 # to use, copy, modify, ...
params.py
#!/usr/bin/env python3 """ROS has a parameter server, we have files. The parameter store is a persistent key value store, implemented as a directory with a writer lock. On Android, we store params under params_dir = /data/params. The writer lock is a file "<params_dir>/.lock" taken using flock(), and data is stored in...
plugin.py
import threading from binascii import hexlify, unhexlify from electrum_xzc.util import bfh, bh2u from electrum_xzc.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, TYPE_ADDRESS, TYPE_SCRIPT, NetworkConstants, is_segwit_address) from electrum...
main.py
import pyautogui import time import math import random import os import sys import requests import wmi import imaplib import email from email.header import decode_header import webbrowser import threading from os.path import expanduser import concurrent.futures from datetime import datetime from seleniu...
test_PROTON_1709_application_event_object_leak.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...
alpha_zero.py
# -*- coding: utf-8 -*- # @Time : 2019/3/8 12:38 # @Author : yx # @Desc : ============================================== import multiprocessing as mp import random from collections import deque from logger import logger from mcts import * if USE_PYTORCH: from policy_value_net_pytorch import PolicyValueNet as PVN...
utils_test.py
from __future__ import print_function, division, absolute_import import collections from contextlib import contextmanager import copy from datetime import timedelta import functools import gc from glob import glob import itertools import logging import logging.config import os import re import shutil import signal imp...
jobManager.py
from __future__ import print_function # # JobManager - Thread that assigns jobs to worker threads # # The job manager thread wakes up every so often, scans the job list # for new unassigned jobs, and tries to assign them. # # Assigning a job will try to get a preallocated VM that is ready, # otherwise will pass 'None' ...
live_prediction.py
import numpy as np from tensorflow.keras.models import load_model from tensorflow.keras.preprocessing.image import load_img, img_to_array import cv2 import time from communications import Communications from database import request, count, update from threading import Thread if __name__ == "__main__": PORT = "/de...
ppo_mp.py
import numpy as np import pydart2 as pydart from Examples.gliding_pd_action.skate_env_pd_using_cma_result import SkateDartEnv from collections import namedtuple from collections import deque import random import time import os from multiprocessing import Process, Pipe import torch from torch import nn, optim import...
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING from electrum_cintamani.util import bfh, bh2u, UserCancelled, UserFacingException from electrum_cintamani.bip32 import BIP32Node from electrum_cintamani import const...
socket_manager.py
#!/usr/bin/env python3 # 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. import errno import logging import json import threading import time from queue import PriorityQueue, Empty import webso...