source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
multiprocessing_train.py | #!/usr/bin/env python3 -u
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import o... |
core.py | # -*- coding: utf-8 -*-
#
# 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, software
... |
simple_sweep.py | import IPython
import bisect
import threading
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
from matplotlib.figure import Figure
fr... |
test_restart_services.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... |
subprocess42.py | # Copyright 2013 The LUCI 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 outpu... |
hourlyReminder.py | # The playsound module is subject to Copyright (c) 2016 Taylor Marks <taylor@marksfam.com>
###
# The MIT License (MIT)
# Copyright (c) 2016 Taylor Marks <taylor@marksfam.com>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Sof... |
test_threaded.py | # -*- coding: utf-8 -
#
# This file is part of socketpool.
# See the NOTICE for more information.
import socket
import sys
import threading
try:
from queue import *
except ImportError:
from Queue import *
try:
import SocketServer as socketserver
except ImportError:
import socketserver
import time
f... |
download.py | import argparse
import logging
import os
import subprocess
import boto3
from multiprocessing import Pool
from multiprocessing import Process
from datetime import datetime
from botocore.exceptions import ClientError
import CustomLogHandler
# Configure AWS credentials before continue
# http://docs.aws.amazon.com/cli/lat... |
run.py | import random
from random import shuffle
import numpy as np
from datetime import datetime
import time
import queue
import threading
import logging
from PIL import Image
import itertools
import re
import os
import glob
import shutil
import sys
import copy
import h5py
from typing import Any, List, Tuple
import torch
impo... |
datasets.py | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Dataloaders and dataset utils
"""
import glob
import hashlib
import json
import os
import random
import shutil
import time
from itertools import repeat
from multiprocessing.pool import Pool, ThreadPool
from pathlib import Path
from threading import Thread
from zipfile im... |
test_s3.py | from cStringIO import StringIO
import boto.exception
import boto.s3.connection
import boto.s3.acl
import boto.s3.lifecycle
import bunch
import datetime
import time
import email.utils
import isodate
import nose
import operator
import socket
import ssl
import os
import requests
import base64
import hmac
import sha
import... |
utils.py | #!/usr/bin/env python
"""This file contains various utility classes used by GRR."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import base64
import errno
import functools
import getpass
import io
import os
import... |
perf_test_ringbuffer.py | #!/usr/bin/env python3
"""Performance test of the RingBuffer class."""
import argparse
import collections
import cProfile
import ctypes
import functools
import logging
import multiprocessing
import os
import pstats
import random
import struct
import time
import zlib
import ringbuffer
FLAGS = argparse.ArgumentParser(... |
conftest.py | from multiprocessing import Process
from src import server
import pytest
@pytest.fixture(scope='session', autouse=True)
def server_setup():
instance = server.create_server()
process = Process(target=instance.serve_forever)
process.daemon = True
process.start()
|
kivy_ui.py | import json
import re
import time
from copy import copy, deepcopy
from datetime import datetime
from functools import partial
from subprocess import Popen, PIPE, STDOUT
from threading import Thread
from collections import namedtuple
from kivy.logger import Logger
import io
import os
import atexit
import yaml
from PIL ... |
__init__.py | # Copyright 2019 TerraPower, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
network_table_stress_test.py | #!/usr/bin/env python3
# This script will:
# 1 Run the network table server.
# 2 Run multiple clients which will
# communicate with the network table.
# 3 Determine how many errors occured
# based on the return values of the clients.
# The clients return 0 if no
# errors occured, otherwise return the
# numbe... |
YoutubeDL.py | #!/usr/bin/env python
# coding: utf-8
from __future__ import absolute_import, unicode_literals
import collections
import contextlib
import copy
import datetime
import errno
import fileinput
import io
import itertools
import json
import locale
import operator
import os
import platform
import re
import shutil
import su... |
populate_sql.py | import multiprocessing
import uuid,secrets,string,datetime,psycopg2
from psycopg2.pool import ThreadedConnectionPool
from multiprocessing import Pool
import time
def random_str(N):
return ''.join(secrets.choice(string.ascii_uppercase + string.digits) for i in range(N))
count_insert=0
# just give evenly divida... |
async_.py | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import sys
import time
import threading
__all__ = [
'await_callback',
]
class ThreadExceptHookHandler(object):
"""Workaround to deal with a bug in the Python interpreter (!).
Report: http://bug... |
extract_techs.py | """A script to generate a list of products we are interested in found in job descriptions.
It takes a list of urls from infile (stdin by default) and returns a |-separated output
for each url. The script requires a file with techs we are searching for, the file is
specified by --techs-file option. The urls that led to... |
JobProcessingEngine.py |
import os
import typing
import time
import threading
import jk_typing
import jk_utils
import jk_logging
import jk_prettyprintobj
from .EnumJobState import EnumJobState
from .Job import Job
from .JobProcessingCtx import JobProcessingCtx
from .AbstractJobProcessor import AbstractJobProcessor
from .JobQueue import Jo... |
trainbugselector.py | import argparse
import logging
from pathlib import Path
from queue import Queue
from threading import Thread
from typing import NoReturn
import msgpack
import yaml
import zmq
from dpu_utils.utils import RichPath, run_and_debug
from ptgnn.baseneuralmodel import ModelTrainer
from ptgnn.baseneuralmodel.utils.data import ... |
util.py | '''
some of these should go into neovim python client
'''
from __future__ import print_function
import os
import time
from subprocess import *
from threading import Thread
import shlex
import string
import random
from functools import wraps
from distutils.spawn import find_executable
from neovim import attach
def at... |
visual_debug_predictor.py | from __future__ import annotations
import json
import subprocess
import threading
import cv2
import numpy as np
import typing
import zerorpc
from PIL import Image
import drawer
from from_internet_or_for_from_internet import PNP_solver as PNP_solver
from utilities import path_change_decorator
from .basic_predictor im... |
__init__.py | import requests
import datetime
import dateutil
import logging
import boto3
import time
import os
import json
import hashlib
import hmac
import base64
import re
from threading import Thread
from io import StringIO
import azure.functions as func
sentinel_customer_id = os.environ.get('WorkspaceID')
sentinel_shared_key... |
01_select.py | import os
import struct
import pandas as pd
import numpy as np
import talib as tdx
import multiprocessing
import sys, getopt
import datetime
def readTdxLdayFile(st_end, fname="data/sh000001.day"):
dataSet=[]
with open(fname,'rb') as fl:
buffer=fl.read() #读取数据到缓存
size=len(buffer)
rowSize=32 #通信达day数据,每... |
test_pvc_creation_deletion_performance.py | """
Test to verify performance of PVC creation and deletion
for RBD, CephFS and RBD-Thick interfaces
"""
import time
import logging
import datetime
import pytest
import ocs_ci.ocs.exceptions as ex
import threading
import statistics
from concurrent.futures import ThreadPoolExecutor
from uuid import uuid4
from ocs_ci.fr... |
http_server.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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
server.py | #!/usr/bin/env python3
# =============================================================================
# Created at Hochschule Esslingen - University of Applied Sciences
# Department: Anwendungszentrum KEIM
# Author: Andreas Rößler
# Contact: emanuel.reichsoellner@hs-esslingen.de
# Date: February 2021
# License: MIT L... |
tf_unittest_runner.py | # ==============================================================================
# Copyright 2018-2020 Intel Corporation
#
# 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://ww... |
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... |
accessory_driver.py | """AccessoryDriver - glues together the HAP Server, accessories and mDNS advertising.
Sending updates to clients
The process of sending value changes to clients happens in two parts - on one hand, the
value change is indicated by a Characteristic and, on the other, that change is sent to a
client. To begin, typically... |
threadtest.py | import threading
import time
from modules.alarm import NBAlarm
def loop(play_event):
for i in range(3):
time.sleep(0.1)
print(i)
play_event.set()
def play(event):
event.wait()
alarm = NBAlarm()
alarm.play()
def main():
play_event = threading.Event()
loop_thread = th... |
sequenza-utils.py | ####!/usr/bin/env python2.7
###
### This script is part of Sequenza
### http://www.cbs.dtu.dk/biotools/sequenza/
###
import argparse, os, sys, gzip, math, multiprocessing, time, logging, json, gc
from itertools import izip_longest
from multiprocessing.pool import ThreadPool
from functools import partial
from mult... |
common.py | from ..common import * # NOQA
import inspect
import json
import os
import random
import subprocess
import ssl
import time
import requests
import ast
import paramiko
import rancher
import pytest
from urllib.parse import urlparse
from rancher import ApiError
from lib.aws import AmazonWebServices
from copy import deepcop... |
pydoc.py | #!/usr/bin/env python
# -*- coding: Latin-1 -*-
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide online
help. Calling help(thing) on a Python object documents the object.
Or, at the shell command line outside of Python:
... |
adls_copy_utils.py | #!/usr/bin/env python
import logging, subprocess, json, datetime, os.path, itertools, threading, argparse
import requests
from collections import deque
try:
import queue
except ImportError:
import Queue as queue
log = logging.getLogger(__name__)
class AdlsCopyUtils():
ADLS_REST_VERSION = "2018-11-09"
... |
clang_format.py | #! /usr/bin/env python
"""
A script that provides:
1. Ability to grab binaries where possible from LLVM.
2. Ability to download binaries from MongoDB cache for clang-format.
3. Validates clang-format is the right version.
4. Has support for checking which files are to be checked.
5. Supports validating and updating a s... |
map_dataset_op_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... |
statsv2.py | import logging
import logging
import multiprocessing
import abc
import math
import re
import nibabel as nib
import numpy as np
import os
import pandas
from kerosene.metrics.gauges import AverageGauge
from samitorch.inputs.patch import Patch, CenterCoordinate
from samitorch.inputs.transformers import ToNumpyArray, Appl... |
mqtt_ws_example_test.py | from __future__ import print_function, unicode_literals
import os
import re
import sys
from builtins import str
from threading import Event, Thread
import paho.mqtt.client as mqtt
import ttfw_idf
from tiny_test_fw import DUT
event_client_connected = Event()
event_stop_client = Event()
event_client_received_correct =... |
word2vec.py | # Copyright 2015 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 by applicable law or a... |
PythonDota2.py | from multiprocessing import Process, Condition
from multiprocessing.managers import BaseManager
import re
import os
import sys
import shlex
import shutil
import subprocess
import signal
import time
import pyautogui
import select
class State(object):
def __init__(self):
self.loc_x = 0.1
self.loc_y = 0.1
self.... |
output.py | import json
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from kafka import KafkaConsumer
import time
import threading
import random
plt_val_x=[]
plt_val_temp=[]
plt_val_apptemp=[]
plt_val_pres=[]
plt_val_rh=[]
city_name='Chennai'
def animate(i):
global plt_val_x, plt_val_temp, pl... |
master.py | # -*- coding: utf-8 -*-
'''
This module contains all of the routines needed to set up a master server, this
involves preparing the three listeners and the workers needed by the master.
'''
# Import python libs
import os
import re
import time
import errno
import signal
import shutil
import stat
import logging
import ha... |
gui.py | # remember to remove make_gui call at the bottom when done
# GUI code for movie organizer project
# Due for heavy rewriting using more python concepts and code cleanup.
# python libraries
import configparser
from tkinter import *
from tkinter import filedialog as files
from tkinter import ttk
from multiproces... |
pipeliner.py | """
Deal with general setup stuff
"""
import threading
import gi
gi.require_version('Gst', '1.0')
from gi.repository import GObject, Gst
class Decoder(object):
def __init__(self):
""" Init all the gi things
"""
GObject.threads_init()
Gst.init(None)
self.pipeline = None
... |
sync_dockerce_script.py | #!/usr/bin/env python3
import os
import sys
import threading
import queue
import traceback
from pathlib import Path
from email.utils import parsedate_to_datetime
import requests
from pyquery import PyQuery as pq
BASE_URL = "https://download.docker.com/"
WORKING_DIR = "/data/repos/docker-ce"
# connect and read timeo... |
app.py | #!flask/bin/python
import uuid
from threading import Thread
from flask import Flask, jsonify, request, make_response, url_for, render_template, current_app
from flask.ext.httpauth import HTTPBasicAuth
from flask.ext.mongoengine import MongoEngine
from flask.ext.bootstrap import Bootstrap
from flask.ext.mail import Mail... |
manager.py | from dataclasses import dataclass
import logging
import threading
import time
import traceback
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Set, Tuple
from concurrent.futures.thread import ThreadPoolExecutor
from blspy import G1Element
from chiapos import DiskProver
from chia.conse... |
dbapi.py | # pysqlite2/test/dbapi.py: tests for DB-API compliance
#
# Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of t... |
index.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import hashlib
import logging
import os
import shutil
import subprocess
import tempfile
try:
from threading import Thread
except ImportErr... |
client.py | # Modules
import json
import socket
import threading
from .colors import colored
from .logging import verbose
from .commands import run_command
# Client class
class Client(object):
def __init__(self, addr, conn, manager):
self.addr = addr
self.conn = conn
self.manager = manager
def ... |
linkcheck.py | # -*- coding: utf-8 -*-
"""
sphinx.builders.linkcheck
~~~~~~~~~~~~~~~~~~~~~~~~~
The CheckExternalLinksBuilder class.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import socket
import codecs
import threading
from os import p... |
flask_app.py | #env AGENT_KEY=agnetkeyhere FLASK_APP=examples/demo/flask_app.py flask run -p 5010
from __future__ import print_function
import os
import time
import sys
import threading
import subprocess
import collections
import random
import traceback
from flask import Flask
try:
# python 2
from urllib2 import urlopen
e... |
mir.py | import sys
import threading
import time
from queue import Queue
import requests
import schedule
# 游戏设置
_username = "wus1223"
_password = "godlike88115"
host = "http://mir.uuuyx.com/mir/game/do.php"
_account_md5 = "935992030a7057d2cc5f8bd964694376"
# 当幻境结束时, 是否启用幻境重置卷
_enable_use_item_recovery_hj_lvl = True
# 使用祭坛重置... |
pyads.py | import struct
import threading
import select
from datetime import datetime, timedelta
from socket import socket, AF_INET, SOCK_STREAM
from enum import Enum
class AdsState(Enum):
ADSSTATE_INVALID = 0
ADSSTATE_IDLE = 1
ADSSTATE_RESET = 2
ADSSTATE_INIT = 3
ADSSTATE_START = 4
ADSSTATE_RUN = 5
... |
lyr_rainbow.py | #!/usr/bin/python
import pxlBuffer as pxb
import random
from time import sleep
import time
def wheel(pos):
"""Generate rainbow colors across 0-255 positions."""
if pos < 85:
return pxb.Color(pos * 3, 255 - pos * 3, 0)
elif pos < 170:
pos -= 85
re... |
concurrent_schema_changes_test.py | import time
import os
import pprint
from threading import Thread
from dtest import Tester, debug
from ccmlib.node import Node
import cql
def wait(delay=2):
"""
An abstraction so that the sleep delays can easily be modified.
"""
time.sleep(delay)
class TestConcurrentSchemaChanges(Tester):
def __... |
test_vision.py | import os
import signal
import threading
from time import sleep
from unittest import TestCase
from vision.vision import Vision, get_log_config_path
from vision.vision import main as main_method
from vision.constant import VisionException
from vision.node_communicator.node_connector import NodeConnector
from mock impor... |
server.py | #!/usr/bin/env python3
# date: 2020.02.24
import socket
import threading
import sys
# --- functions ---
def recv_msg():
while True:
recv_msg = conn.recv(1024)
if not recv_msg:
sys.exit(0)
recv_msg = recv_msg.decode()
print(recv_msg)
def send_msg():
while True:
... |
hello.py | Flasky Admin <tomsing1@gmail.comfrom flask import Flask, render_template, session, redirect, url_for
from flask_script import Manager, Shell
from flask_bootstrap import Bootstrap
from flask_moment import Moment
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import R... |
DocsetManager.py | import json
import os
import ui
import requests
import xml.etree.cElementTree
import threading
import ui
import time
import math
import tarfile
import plistlib
import console
import sqlite3
import shutil
import copy
from urllib.parse import urlparse
from os.path import splitext, basename
from objc_util import ns, Obj... |
serial_connection.py | import base64
import os
import re
import time
from threading import Thread
import serial
from src.utility.settings import Settings
from src.connection.connection import Connection
from src.helpers.pyinstaller_helper import PyInstallerHelper
from src.logic.file_transfer import FileTransfer, FileTransferError
from src.... |
advanced-reboot.py | #
# ptf --test-dir ptftests fast-reboot --qlen=1000 --platform remote -t 'verbose=True;dut_username="admin";dut_hostname="10.0.0.243";reboot_limit_in_seconds=30;portchannel_ports_file="/tmp/portchannel_interfaces.json";vlan_ports_file="/tmp/vlan_interfaces.json";ports_file="/tmp/ports.json";dut_mac="4c:76:25:f5:48:80";... |
lldb_batchmode.py | # Copyright 2014 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://... |
main.py | # coding=UTF-8
import sys
sys.path.append("C:\Users\Myst\AppData\Local\Programs\Python\Python35-32\Lib\site-packages")
from gtts import gTTS
import mp3play
import select
import socket
import sys
import Queue
import string
import requests
from bs4 import BeautifulSoup
import json
import re, os
import time
from time impo... |
zeromq.py | # -*- coding: utf-8 -*-
"""
Zeromq transport classes
"""
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import copy
import errno
import hashlib
import logging
import os
import signal
import socket
import sys
import threading
import weakref
from random import randint
# I... |
interface.py | # Date: 06/07/2018
# Author: Pure-L0G1C
# Description: Interface for the master
from os import path
from re import match
from lib import const
from . import ssh, sftp
from hashlib import sha256
from time import time, sleep
from os import urandom, path
from threading import Thread
from datetime import da... |
__init__.py | import os, time, shutil
from configparser import ConfigParser
if not os.path.exists(os.path.join('logs','dump')):
os.makedirs(os.path.join('logs','dump'))
'''from OpenSSL import crypto, SSL
from random import SystemRandom
r = SystemRandom()
def cert_gen(
serialNumber=r.randint(333,99999999),
validityStar... |
biconfigs.py | from __future__ import print_function
import os
import random
import string
import warnings
from collections import MutableMapping, MutableSequence
from threading import Thread
from .parsers import PARSERS, EXTENSION_TO_PARSER, DYNAMIC_PARSER_HELPER
from .storages import STORAGES
from .exceptions import *
__randstr_ch... |
TDStream_v1.py | # -*- coding: utf-8 -*-
"""
Created on Mon Sep 2 11:19:59 2019
The MIT License
Copyright (c) 2018 Addison Lynch
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, in... |
metrics.py | #!/usr/bin/python
"""X-Road Health and Environment monitoring collector for Zabbix."""
# pip install py-zabbix
from pyzabbix import ZabbixMetric, ZabbixSender, ZabbixAPI
import argparse
import re
import requests
import sys
import threading
import uuid
import six
import time
import calendar
import logging
import xml.e... |
datasets.py | from flask import request
from flask_restplus import Namespace, Resource, reqparse
from flask_login import login_required, current_user
from werkzeug.datastructures import FileStorage
from mongoengine.errors import NotUniqueError
from threading import Thread
from google_images_download import google_images_download as... |
gargoyle_regression_test.py | '''Imports net_gargoyle.py directly to use the functions and creates a template class and thread.'''
import threading
import time
import sys
import net_gargoyle as netg
class RealRun():
'''actually run all of the core functions once'''
def __init__(self, realrun, network, printeda, printedb):
self.rea... |
test_training.py | import threading
import time
from concurrent.futures import Future
import numpy as np
import pytest
import torch
from tiktorch.server.session import State
from tiktorch.server.session.backend import commands
from tiktorch.server.session.backend.supervisor import Supervisor
class TestExemplumSupervisor:
class Du... |
communicator.py | """
Communicator
"""
import sys
import os
import time
import json
import serial
import serial.tools.list_ports
import threading
from ..devices import DeviceManager
from .constants import BAUDRATE_LIST
from .context import APP_CONTEXT
from .utils.resource import (
get_executor_path
)
if sys.version_info[0] > 2:
... |
build_mscoco_data.py | # Copyright 2016 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... |
screenshot.py | # -*- coding: utf-8 -*-
import win32gui
import win32api
import win32ui
import win32con
#import ctypes
import numpy as np
import cv2
SM_XVIRTUALSCREEN = 76
SM_YVIRTUALSCREEN = 77
SM_CXVIRTUALSCREEN = 78
SM_CYVIRTUALSCREEN = 79
def find_window(title):
def _EnumWindowCallback( hwnd, windows):
temp = []
... |
username.py | import threading
from colorama import Fore, Style, init
import os
import json
import httpx
from time import sleep
import names
init()
blue = Fore.BLUE + Style.BRIGHT
white = Fore.WHITE
os.system(f'cls & mode 90,25 & title [Username Gen] - Menu')
print(f'''
{blue}
██▒ █▓ ▒█████ ██▓▓█████▄ ▄... |
masterslave.py | # Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain ... |
data_helper.py | import numbers
from collections.abc import Sequence
from typing import Iterable, Any, List, Optional
import time
from threading import Thread
from queue import Queue
import numpy as np
import torch
def to_device(item: Any, device: str, ignore_keys: list = []) -> Any:
r"""
Overview:
Transfer data to c... |
hw2.py | '''
使用多进程模型实现,父进程将命令行所跟的文件发送给子进程,子进程将收到的文件打印出来
python hw2.py “/etc/passwd”
'''
from multiprocessing import Process,Pipe
import sys
import os
def jieshou(out,inn):
in_p.close()
while True:
try:
print(out_p.recv())
except:
out_p.close()
break
if __name__... |
diff.py | """
Implements a special view to visualize and stage pieces of a project's
current diff.
"""
from collections import namedtuple
from contextlib import contextmanager
from functools import partial
from itertools import chain, dropwhile, takewhile
import os
import re
import threading
import sublime
from sublime_plugin ... |
walabot.py | import copy
import importlib.machinery
import logging
import os
from threading import Semaphore, Thread
import click
logger = logging.getLogger(__name__)
tracking_semaphore = None
tracking_info = {"objects": []}
vector_info = []
updated = False
def _get_targets(wlbt):
appStatus, calibrationProcess = wlbt.GetSt... |
tests.py | # -*- coding: utf-8 -*-
# Unit and doctests for specific database backends.
from __future__ import unicode_literals
import copy
import datetime
from decimal import Decimal, Rounded
import re
import threading
import unittest
import warnings
from django.conf import settings
from django.core.exceptions import Improperly... |
utils_test.py | from __future__ import annotations
import asyncio
import copy
import functools
import gc
import inspect
import io
import logging
import logging.config
import multiprocessing
import os
import re
import shutil
import signal
import socket
import subprocess
import sys
import tempfile
import threading
import uuid
import we... |
world.py | from terrain import *
from player import *
import threading
import random
def execute_with_delay(func, delay):
threading.Timer(delay, func).start()
class World:
def __init__(self, renderer, player):
self.parent = renderer
self.chunks = {}
self.blocks = {}
self.position = (0 * 16... |
main.py | import time
import logging
import yaml
import sys
import threading
from apistar import Component
from openzwave.network import ZWaveNetwork
from openzwave.option import ZWaveOption
from pydispatch import dispatcher
from zwave_mqtt_bridge.bridge import Bridge
from zwave_mqtt_bridge.hass_mqtt import HassMqtt
LOG = lo... |
twitter+gui.py | #twitter_music_poll
from Tkinter import *
from time import sleep
import os
import tweepy
import requests
import json
from pydora import player
from pandora import clientbuilder
import sys
import termios
import getpass
import subprocess
import time
import re
#import for gui
import Tkinter
import tkMessageBox
#import ... |
market.py | import time
import urllib.request
import urllib.error
import urllib.parse
import config
import logging
import sys
from fiatconverter import FiatConverter
from utils import log_exception
import traceback
import config
import threading
class Market(object):
def __init__(self, base_currency, market_currency, pair_cod... |
Prefetcher.py | import threading
import queue as Queue
import time
class Counter(object):
"""A thread safe counter."""
def __init__(self, val=0, max_val=0):
self._value = val
self.max_value = max_val
self._lock = threading.Lock()
def reset(self):
with self._lock:
self._value = 0
def set_max_value(sel... |
test_api.py | """
mbed SDK
Copyright (c) 2011-2014 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... |
keep_alive.py | # Use for hosting this bot in replit.com
from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "I'm alive"
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start() |
task.py | # Copyright (c) 2019 - The Procedural Generation for Gazebo authors
# For information on the respective copyright owner see the NOTICE file
#
# 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
#
#... |
ssh.py | from __future__ import absolute_import
import inspect
import logging
import os
import re
import shutil
import string
import sys
import tarfile
import tempfile
import threading
import time
import types
from pwnlib import term
from pwnlib.context import context
from pwnlib.log import Logger
from pwnlib.log import getLo... |
dask.py | # pylint: disable=too-many-arguments, too-many-locals
"""Dask extensions for distributed training. See
https://xgboost.readthedocs.io/en/latest/tutorials/dask.html for simple
tutorial. Also xgboost/demo/dask for some examples.
There are two sets of APIs in this module, one is the functional API including
``train`` an... |
nexmark_util.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... |
_curio.py | import inspect
import math
import socket
import sys
from collections import OrderedDict, defaultdict
from concurrent.futures import Future
from dataclasses import dataclass
from signal import signal
from socket import AddressFamily, SocketKind
from threading import Thread
from types import TracebackType
from typing imp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.