source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
callbacks.py | # -*- coding: utf8 -*-
###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2014, James McCoy
# 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... |
jupyter.py | from tissuumaps import views
from IPython.display import HTML, Javascript, clear_output
from IPython.core.display import display
import threading
import logging
import json
import click
import warnings
import os, time
from pathlib import Path
import uuid
def secho(text, file=None, nl=None, err=None, color=None, **st... |
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... |
worker_pool_main.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... |
v1_station_b_S14_magmax_200ulinput.py | from opentrons.types import Point
import json
import os
import math
import threading
from time import sleep
metadata = {
'protocolName': 'Version 1 S14 Station B MagMax (200µl sample input)',
'author': 'Nick <ndiehl@opentrons.com',
'apiLevel': '2.3'
}
NUM_SAMPLES = 8 # start with 8 samples, slowly increa... |
old_install.py | #!/usr/bin/env python
# TODO: add installer support for membasez
import Queue
import copy
import getopt
import os
import re
import socket
import sys
from datetime import datetime
from threading import Thread
from Cb_constants import CbServer
sys.path = [".", "lib", "pytests", "pysystests", "couchbase_utils",
... |
test__triangle_intersection.py | # 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, software
# distributed under t... |
dataloader_iter.py | # Copyright (c) 2020 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 appli... |
utils.py | from collections import namedtuple
import asyncio
import os
import sys
import signal
import operator
import uuid
from functools import reduce
from weakref import ref, WeakKeyDictionary
import types
import inspect
from inspect import Parameter, Signature
import itertools
import abc
from collections.abc import Iterable
i... |
tasks.py | from __future__ import absolute_import
import subprocess
import tarfile
import os
import zipfile
import six
import sys
import traceback
from threading import Thread
from django.utils.text import get_valid_filename
from django.core.files import File
from django.conf import settings
from celery import Task
from celery... |
local_network.py | import os
import re
import socket
import sys
import threading
from logic.file_handler import make_dirs, get_newest_datetime, zip_articles, unzip_articles, DIR_TRANSFER
from datetime import datetime
DEFAULT_PORT = 55111
BUFFER_SIZE = 1024
SERVER_TIMEOUT = 15
CLIENT_TIMEOUT = 10
def get_devices():
with os.popen('ar... |
config.py | # Copyright (c) The Diem Core Contributors
# SPDX-License-Identifier: Apache-2.0
from dataclasses import dataclass, field, asdict
from typing import Dict, Any
from .client import RestClient
from .app import App, falcon_api
from ... import offchain, testnet, jsonrpc, LocalAccount
import waitress, threading, logging, fa... |
test_instrumented_app.py | # Copyright (C) 2020 SignalFx. All rights reserved.
from time import sleep
from wsgiref import simple_server
from opentracing.mocktracer import MockTracer
from threading import Thread
import requests
import pytest
from signalfx_tracing import instrument
base_url = "http://127.0.0.1:32321/"
endpoint = "{0}hello".fo... |
vnrpc.py | # encoding: UTF-8
import threading
import traceback
import signal
import zmq
from msgpack import packb, unpackb
from json import dumps, loads
import pickle as cPickle
pDumps = cPickle.dumps
pLoads = cPickle.loads
# 实现Ctrl-c中断recv
signal.signal(signal.SIGINT, signal.SIG_DFL)
######################################... |
data_paral_batcher.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Modifications Copyright 2017 Abigail See
# Modifications Copyright 2018 Ming-Fan Li
#
# 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 Licens... |
busy_thread.py | import obspython as obs
import threading
from time import sleep
def hook(obs_htk_id, htk_id, callback):
json_data = '{"%s":[{"key":"%s"}]}' % (htk_id, obs_htk_id)
s = obs.obs_data_create_from_json(json_data)
a = obs.obs_data_get_array(s, htk_id)
h = obs.obs_hotkey_register_frontend(htk_id, ... |
test_memusage.py | import decimal
import gc
import itertools
import multiprocessing
import weakref
import sqlalchemy as sa
from sqlalchemy import ForeignKey
from sqlalchemy import inspect
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import test... |
config.py | import json
import os
import threading
import pymongo
import redis
import sentry_sdk
from dotenv import load_dotenv
from lotify.client import Client
from rich.console import Console
# Load environment variables
load_dotenv()
console = Console()
profile = os.getenv("profile", "production")
run_env = os.getenv("run_en... |
diskover.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""diskover - Elasticsearch file system crawler
diskover is a file system crawler that index's
your file metadata into Elasticsearch.
See README.md or https://github.com/shirosaidev/diskover
for more information.
Copyright (C) Chris Park 2017-2020
diskover is released unde... |
master_panel.py | import csv
import threading
import webbrowser
from datetime import datetime, timedelta
from MiddleKey.redis_IO import RedisClient
from config import *
try:
import easygui
import paramiko
import pyperclip
import requests
from bs4 import BeautifulSoup
except ImportError:
def init_requirements():
... |
AVR_Miner.py | #!/usr/bin/env python3
##########################################
# Duino-Coin Python AVR Miner (v2.6.4)
# https://github.com/revoxhere/duino-coin
# Distributed under MIT license
# © Duino-Coin Community 2019-2021
##########################################
# Import libraries
import sys
from configparser import ConfigPa... |
postproc.py | #!/usr/bin/python3 -OO
# Copyright 2007-2020 The SABnzbd-Team <team@sabnzbd.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any late... |
manager.py | import argparse
import webbrowser
import json
import traceback
import socket
import threading
import signal
import os
from pathlib import Path
from lyrebird import log
from lyrebird import application
from lyrebird.config import Rescource, ConfigManager
from lyrebird.mock.mock_server import LyrebirdMockServer
from lyre... |
persister.py | # (C) Copyright 2014-2017 Hewlett Packard Enterprise Development LP
# Copyright 2017 FUJITSU 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... |
reader.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#############################################################################
## This file is part of Tango Control System: http://www.tango-controls.org/
##
## $Author: Sergi Rubio Manrique, srubio@cells.es
## copyleft : ALBA Synchrotron Controls Section, www.cells.es... |
okta.py | """
Copyright 2016-present Nike, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... |
online.py | import asyncio
import websockets
import json
import queue # refer to https://docs.python.org/3/library/queue.html for cross threading communication
import uuid
from typing import Dict, List
from threading import Thread
from tetri5.util import ConfigurationManager
class MultiplayerService():
_thread = None
_cur... |
tasktrack.py | '''
Web browser GUI-launched tasks run in a separate process. This module provides
mechanisms for interacting withe the task running in another process, e.g.,
calling functions to start/stop the task, enabling/disabling decoder adaptation, etc.
'''
import os
import sys
import time
import xmlrpc.client
import multipro... |
base.py | """
Module containing base classes that represent object entities that can accept
configuration, start/stop/run/abort, create results and have some state.
"""
import os
import sys
import signal
import time
import uuid
import threading
import psutil
import functools
from collections import deque, OrderedDict
import tra... |
file_stream.py | import base64
import binascii
import collections
import logging
import threading
import requests
import time
import wandb
import itertools
from six.moves import queue
from wandb import util
from wandb import env
logger = logging.getLogger(__name__)
Chunk = collections.namedtuple('Chunk', ('filename', 'data'))
class... |
shellcore.py | import socket
import threading
import typing
import sys
from abc import ABCMeta, abstractmethod
from pytoolcore import style
from pytoolcore import netutils
from pytoolcore import utils
from core import exploitcore, scriptercore
class Shell:
__metaclass__ = ABCMeta
AUTHOR: str = "Danakane"
def __init_... |
audio_preprocessing.py | # When running this tutorial in Google Colab, install the required packages
# with the following.
# !pip install torchaudio librosa boto3
import torch
import torchaudio
import torchaudio.functional as F
import torchaudio.transforms as T
# print(torch.__version__)
# print(torchaudio.__version__)
# In[]
... |
control.py | import mouse
import threading
import time
import keyboard
import sys
import pyautogui
if sys.platform.startswith("win"):
import pydirectinput
pydirectinput.PAUSE = 0
pydirectinput.FAILSAFE = False
else:
pyautogui.PAUSE = 0
class MouseControl:
freeze = False
def __init__(self, method, **params... |
pull_transaction.py | import requests
import login
import functions
import threading
import time
global date
date = '20161026'
global page
page=0
global lock
lock = threading.Lock()
global lock1
lock1 = threading.Lock()
global flag
flag=1
global fout
fout = open(('Database/' + date[4:8]+'.txt'),'a')
global count
count=0
def fuc():
gl... |
shell.py | # Date: 06/04/2018
# Author: Pure-L0G1C
# Description: Communicate with server
import sys
import subprocess
from os import chdir
from time import sleep
from queue import Queue
from tasks.dos import Cyclops
from threading import Thread, RLock
from . import ssh, sftp, screen, keylogger
class Shell(object):... |
cmd_command.py | import subprocess, threading, os
__id__ = 'shell'
PATH = os.getcwd()
VERBOSE = False
class Command:
def __init__(self, cmd):
self.cmd = cmd
self.process = None
def run(self, timeout):
output = None
def target():
nonlocal output
if VERBOSE: print('[%s]: T... |
webhost.py |
def find_chromium():
import shutil
import platform
import os
uname = platform.system()
if uname == 'Windows':
executables = ['chrome.exe', 'msedge.exe']
prefixes = [
os.getenv('ProgramFiles', os.devnull),
os.getenv('ProgramFiles(X86)', os.devnull),
... |
start.py | import json
import logging
import os
import threading
import time
from jupyter_core.paths import jupyter_runtime_dir
from . import CMD_ARGS, get_parser
from .ssh_client import ParamikoClient
from .sync import ParamikoSync
logger = logging.getLogger('remote_kernel.start')
def generate_config():
"""
Generate a ... |
serial_spawn.py | '''This is like pexpect, but it will work with serial port that you
pass it. You are reponsible for opening and close the serial port.
This allows you to use Pexpect with Serial port which pyserial supports.
PEXPECT LICENSE
This license is approved by the OSI and FSF as GPL-compatible.
https://opensource.... |
mp_tasks.py | # ActivitySim
# See full license in LICENSE.txt.
import sys
import os
import time
import logging
import multiprocessing
import traceback
from collections import OrderedDict
import yaml
import numpy as np
import pandas as pd
from activitysim.core import inject
from activitysim.core import tracing
from activitysim.cor... |
_server.py | """
A Simple server used to show mpld3 images.
"""
import sys
import threading
import webbrowser
import socket
import itertools
import random
IPYTHON_WARNING = """
Note: if you're in the IPython notebook, mpld3.show() is not the best command
to use. Consider using mpld3.display(), or mpld3.enable_notebook().
... |
core.py | """
Background Tasks
Some tasks, such as sending mails or sending HTTP requests to other servers,
may need to be performed asynchronously to prevent the frontend from being
blocked for their duration. This module allows posting tasks to be handled
in the background, as well as querying tasks to check their status or r... |
common.py | import time
from functools import wraps
import logging
import sys
import os
import threading
def setup_logger(name: str, default_level:int=logging.DEBUG):
logger = logging.getLogger(name)
fmt = '[%(asctime)-15s %(levelname)s %(filename)s:%(lineno)s] %(message)s'
formatter = logging.Formatter(fmt)
hand... |
framework.py | #!/usr/bin/env python
from __future__ import print_function
import gc
import sys
import os
import select
import unittest
import tempfile
import time
import faulthandler
import random
import copy
import psutil
from collections import deque
from threading import Thread, Event
from inspect import getdoc, isclass
from tra... |
common.py | """Test the helper method for writing tests."""
import asyncio
import functools as ft
import os
import sys
from unittest.mock import patch, MagicMock, Mock
from io import StringIO
import logging
import threading
from contextlib import contextmanager
from aiohttp import web
from homeassistant import core as ha, loader... |
leo_cloud.py | """
leo_cloud.py - synchronize Leo subtrees with remote central server
Terry N. Brown, terrynbrown@gmail.com, Fri Sep 22 10:34:10 2017
This plugin allows subtrees within a .leo file to be stored in the cloud. It
should be possible to support various cloud platforms, currently git and systems
like DropBox are supporte... |
minion.py | # -*- coding: utf-8 -*-
'''
Routines to set up a minion
'''
# Import python libs
from __future__ import absolute_import, print_function, with_statement
import os
import re
import sys
import copy
import time
import types
import signal
import fnmatch
import logging
import threading
import traceback
import contextlib
impo... |
zdrun.py | #!python
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribut... |
launch_dataset_dynamic.py | import random
import numpy as np
import time
import pickle
from multiprocessing import Process, Manager
from instance_mcnf import generate_instance, mutate_instance
from mcnf_dynamic import *
def launch_dataset(global_path, dataset_name, algorithm_list, nb_repetitions, nb_workers, duration_before_timeout):
# Laun... |
HTTPControl.py | import mimetypes
import os
import pathlib
from http.server import HTTPServer, BaseHTTPRequestHandler
from socketserver import ThreadingMixIn
from termcolor import colored
from datetime import datetime, timedelta
import jinja2
import json
import re
import threading
import time
import urllib.parse
import math
from ww imp... |
test_channels.py | """Tests for payment channel functionality."""
import time
import codecs
import pytest
import collections
import multiprocessing
import two1.bitcoin.utils as utils
from two1.bitcoin import Script, Hash
from two1.bitcoin import PrivateKey
from two1.bitcoin import Transaction, TransactionInput, TransactionOutput
from tw... |
client.py | # Copyright (c) 2020 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 appli... |
convert_to_records.py | # 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 by applicable law or a... |
test_disconnection.py | import logging
from multiprocessing import Process
import socks
from aiohttp import web
from aiohttp.test_utils import AioHTTPTestCase, unittest_run_loop
from meross_iot.controller.device import BaseDevice
from meross_iot.controller.mixins.toggle import ToggleXMixin
from meross_iot.manager import MerossManager
from m... |
A2C.py | import jax as jx
import jax.numpy as jnp
from jax import grad, jit
import haiku as hk
import json
import argparse
import time
from jax.experimental import optimizers
from minatar import Environment
from multiprocessing import Pipe, Process
import pickle as pkl
##################################################... |
__init__.py | """
This is the test dispatcher.
It will dispatch tests against any registered test runners when the repo
observer sends it a 'dispatch' message with the commit ID to be used. It
will store results when the test runners have completed running the tests and
send back the results in a 'results' messagee
It can register... |
test_execution.py | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2015-2018 by Exopy Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full license is in the file LICENCE, distributed with this software.
# ---------------... |
monitor.py | import threading
import time
import subprocess
import os.path
import logging
from glob import glob
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s", datefmt="%d-%b-%y %H:%M:%S")
def squeue():
return subprocess.getoutput("squeue -l")
class Job:
def __init__(self, jobid... |
datasets.py | import glob
import math
import os
import random
import shutil
import time
from pathlib import Path
from threading import Thread
import cv2
import numpy as np
import torch
from PIL import Image, ExifTags
from torch.utils.data import Dataset
from tqdm import tqdm
from utils.utils import xyxy2xywh, xywh2... |
combat.py | import math
import string
import os
from datetime import datetime, timedelta
from util.logger import Logger
from util.utils import Region, Utils
from threading import Thread
class CombatModule(object):
def __init__(self, config, stats, retirement_module, enhancement_module):
"""Initializes the Combat modu... |
__init__.py | from datetime import datetime, timedelta
'''
#Event Example:
from pymonster import EventBase
class Event(EventBase):
def log(self, msg):
print '[CustomEventLogger][%s] %s' % (self.collection_name,msg)
EventBase.log(self, msg)
#Consumer Example
from pymonster import ConsumerBase
class Consumer(Cons... |
b_drone_landing_assistant.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# setting up modules used in the program
import a_prefix_variable as apv
from pygame.locals import *
from socket import socket
import pygame.display
import numpy as np
import threading
import pygame
import socket
import time
import cv2
import sys
import os
# threading ... |
my_dataloader.py | # -*- coding:utf-8 -*-
import math
import multiprocessing
from torch.utils.data import DataLoader
from torch.utils.data.dataloader import default_collate
from prefetch_generator import BackgroundGenerator
from datasets.sliced_dataset import SlicedDataset
class DataLoaderX(DataLoader):
# https://github.com/justh... |
test_html.py | from functools import partial
from importlib import reload
from io import BytesIO, StringIO
import os
import re
import threading
from urllib.error import URLError
import numpy as np
from numpy.random import rand
import pytest
from pandas.compat import is_platform_windows
from pandas.errors import ParserError
import p... |
06-receive_data_closed_conn.py | #!/usr/bin/env python3
# Copyright (C) 2019 Simon Brummer <simon.brummer@posteo.de>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import os
import sys
import threading
from testrunner import ... |
sub_worker_process.py | # Copyright (c) 2021-2022, NVIDIA CORPORATION. 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 ... |
trainer.py | import os
from datetime import datetime
import torch.multiprocessing as mp
from utils import Logger
from .ddp import dist_process
from .dp import process
from .test import test
class Trainer(object):
def __init__(self, para):
self.para = para
os.environ['MASTER_ADDR'] = 'localhost'
os.en... |
test_cli.py | """Tests for cli.py."""
import json
import shutil
import sys
from multiprocessing import Process
from os import getpid, kill
from pathlib import Path
from signal import SIGINT
from threading import Timer
from time import sleep
from urllib.error import URLError
from urllib.request import urlopen
import pytest
from clic... |
CPlayer.py | import os,sys,shutil,random,ctypes,winreg,chardet,platform
from threading import Thread
from PyQt5.QtCore import Qt,QTimer
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QMenu,QAction,QMessageBox,QApplication,QMainWindow,QSystemTrayIcon,QFileDialog,QDesktopWidget
from Ui_CPlayer import Ui_MainWindow
class Wi... |
utils.py | import json
import time
import unittest
from threading import Thread
from six.moves import BaseHTTPServer
import bugsnag
class IntegrationTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.server = FakeBugsnagServer()
def setUp(self):
self.server.received = []
def tear... |
test_grpc_gateway_runtime.py | import multiprocessing
import time
from jina.parsers import set_gateway_parser
from jina.peapods.runtimes.gateway.grpc import GRPCRuntime
def test_grpc_gateway_runtime_init_close():
def create_runtime():
with GRPCRuntime(
set_gateway_parser().parse_args(['--grpc-data-requests'])
) as ... |
integration_base.py | #!/usr/bin/python
# Base imports for all integrations, only remove these at your own risk!
import json
import sys
import os
import time
import pandas as pd
from collections import OrderedDict
from IPython.core.magic import (Magics, magics_class, line_magic, cell_magic, line_cell_magic)
from IPython.core.display impo... |
caches.py | #!/usr/bin/env python3
import time
import threading
import queue
import weakref
from collections import defaultdict
from .util import PrintError
class ExpiringCache:
''' A fast cache useful for storing tens of thousands of lightweight items.
Use this class to cache the results of functions or other computati... |
example_interactive_mode.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: example_interactive_mode.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://www.lucit.tech/unicorn-binance-websocket-api.html
# Github: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api
# Documentation: https://... |
main.py | import time
import speedflux
from multiprocessing import Process
from speedflux import data
def main():
speedflux.initialize()
speedflux.LOG.info('Speedtest CLI data logger to InfluxDB started...')
pPing = Process(target=data.pingtest, args=())
pSpeed = Process(target=data.speedtest, args=... |
arp_scan.py | """
Continuously sends out ARP discover packets.
"""
import scapy.all as sc
import threading
import time
from host_state import HostState
import utils
# pylint: disable=no-member
FAST_SCAN_SLEEP_TIME = 0.1
SLOW_SCAN_SLEEP_TIME = 0.5
class ArpScan(object):
def __init__(self, host_state):
assert isi... |
avnav_server.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: ts=2 sw=2 et ai
###############################################################################
# Copyright (c) 2012,2021 Andreas Vogel andreas@wellenvogel.net
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and ... |
it.py | from multiprocessing import *
import time
def s():
time.sleep(1)
print('hi!')
class Main():
def do(self):
print('hi!')
time.sleep(1)
def start(self):
def a():
pass
self.s = Process(target=a)
self.s.start()
if __name__ == '__main__':
Main().... |
test_dist_graph_store.py | import os
os.environ['OMP_NUM_THREADS'] = '1'
import dgl
import sys
import numpy as np
import time
import socket
from scipy import sparse as spsp
from numpy.testing import assert_array_equal
from multiprocessing import Process, Manager, Condition, Value
import multiprocessing as mp
from dgl.heterograph_index import cre... |
ranger.py | #!/usr/bin/env python
'''
Libraries
'''
import base64, sys, argparse, re, subprocess, os, time, logging, signal, urllib2, cmd, ntpath, string, random, ConfigParser, hashlib, traceback, tempfile, collections, ast, datetime, sets
import xml.etree.ElementTree as etree
from threading import Thread, Lock, Event
from Queue i... |
paraproc.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2018 herrlich10@gmail.com
#
# 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 ... |
GUI.py | from tkinter import *
from tkinter import filedialog
from tkinter import ttk
import threading
from threading import Thread
import math, os, shutil, time
from numpy import *
import re
global value
global i, xmin,xmax,ymin,ymax, valxprev,valyprev,valxnew,valynew, vali,valj, xMin,xMax,yMin,yMax, flag, valg, scale... |
main.py | # WearMask3D
# Copyright 2021 Hanjo Kim and Minsoo Kim. All rights reserved.
# http://github.com/jhh37/wearmask3d
#
# 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, includ... |
computeresourceserver.py | import time
import multiprocessing
import traceback
from .mountainjob import MountainJob
from .executebatch import executeBatch
from mountaintools import client as mt
import mtlogging
class ComputeResourceServer():
def __init__(self, *, resource_name=None, collection=None, kachery_name=None):
self._resour... |
test_util.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... |
run_pool.py | import os
from multiprocessing import Process
import sys
from indy_common.config_util import getConfig
from indy_node.utils.node_runner import run_node
config = getConfig()
num_nodes = 7
details = [
('Node1', 9701, 9702),
('Node2', 9703, 9704),
('Node3', 9705, 9706),
('Node4', 9707, 9708),
('Nod... |
mainmenu.py | # Released under the MIT License. See LICENSE for details.
#
"""Implements the main menu window."""
# pylint: disable=too-many-lines
from __future__ import annotations
from typing import TYPE_CHECKING
import ba
import _ba
if TYPE_CHECKING:
from typing import Any, Callable, List, Dict, Tuple, Optional, Union
c... |
tcpServer.py | # coding=utf-8
import socket
import threading
# 绑定ip:这里代表任何ip地址
bind_ip = "0.0.0.0"
bind_port = 80
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((bind_ip, bind_port))
# 最大连接数为5
server.listen(5)
print "[*] Listening on %s:%d" % (bind_ip, bind_port)
# 这是客户处理进程
def handle_client(client_soc... |
upload_test.py | # -*- coding: utf-8 -*-
import boto3
import json
import os
import re
import requests
import six
import threading
from six.moves import range
from girder import events
from girder.models.assetstore import Assetstore
from girder.models.file import File
from girder.models.folder import Folder
from girder.models.upload im... |
mission_commands2.py | #!/usr/bin/env python3
# Decription:
# This program takes user input commands and sends them
# to a seperate program that deals with making the motors
# on the ROSPerch move.
# Adapted Sources:
# Motor command code in auto_driver.py is adapted
# from the UTAP 2020 code at
# https://github.com/jdicecco/UTAP/
# License... |
no_terminal.py | """Run commands within the Porcupine window."""
from __future__ import annotations
import locale
import logging
import queue
import re
import signal
import subprocess
import sys
import threading
import tkinter
from functools import partial
from pathlib import Path
from tkinter import ttk
from typing import Callable
i... |
visualizer.py | from time import sleep
import tkinter as tk
import multiprocessing as mp
from envs.oware import Oware
class Visualizer:
def __init__(self, initial_state: Oware):
other_end, self.__connection = mp.Pipe()
self.__process = mp.Process(target=self.start, args=(initial_state, other_end))
self.__... |
query_by_free.py | import sys
import time
import importlib
import urllib
import urllib.request
import requests
from bs4 import BeautifulSoup
import pymysql
import numpy as np
import threading
import redis
from fake_useragent import UserAgent
import math
db_ = redis.Redis(host="localhost",password=123, port=6379,decode_responses=True)
... |
manager.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... |
Google.py | # This file contains program which can make teacher directly go to google (using webbrowser module)
# Importing necessary libraries
print('Importing necessary libraries for google button...')
import threading
from Classes import *
from tkinter import ttk
from tkinter import *
lock = threading.Lock()
def imports():
... |
remote_websocket.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import base64
import logging
import threading
import ssl
import websocket
import requests
import time
import json
import socket
from . import exceptions
from . import application
from . import websocket_base
from . import wake_on_lan
from .... |
mempool_accept.py | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Unlimited developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import test_framework.loginit
# This test exercises the mempool acceptance data path.
from threading impo... |
fts_throttler.py | # Copyright 2019 CERN for the benefit of the ATLAS collaboration.
#
# 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 appl... |
test_autograd.py | # Owner(s): ["module: autograd"]
import contextlib
import gc
import io
import math
import os
import random
import sys
import tempfile
import threading
import time
import unittest
import uuid
import warnings
import operator
import subprocess
from copy import deepcopy
from collections import OrderedDict
from itertools i... |
multiprocessing.py | import multiprocessing as mp
from multiprocessing import Process
from more_itertools import chunked
from tqdm import tqdm
__all__ = ["batch_multiprocess"]
def batch_multiprocess(function_list, n_cores=mp.cpu_count(), show_progress=True):
"""
Run a list of functions on `n_cores` (default: all CPU cores),
w... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.