source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
app.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
connector_upgrade.py | from kafka.producer import KafkaProducer
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)))
from lib.commonsplunk import check_events_from_splunk
from lib.commonkafka import *
from lib.helper import *
from datetime import datetime
import threading
import loggin... |
houndify.py | ##############################################################################
# Copyright 2020 SoundHound, Incorporated. All rights reserved.
##############################################################################
import base64
import hashlib
import hmac
import http.client
import json
import threading
import t... |
CntlrWebMain.py | '''
Created on Oct 3, 2010
Use this module to start Arelle in web server mode
@author: Mark V Systems Limited
(c) Copyright 2010 Mark V Systems Limited, All rights reserved.
'''
from arelle.webserver.bottle import Bottle, request, response, static_file
from arelle.Cntlr import LogFormatter
import os, io, sys, time, t... |
utils.py | import queue
import time
from threading import Thread
def threadify(fn, cache_result=False, delay=0):
if cache_result:
q = queue.SimpleQueue()
def thread(*args, **kwargs):
if delay:
time.sleep(delay)
r = fn(*args, **kwargs)
if cache_result:
q.put(r)
... |
getpages.py | from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from bs4 import BeautifulSoup as b
import time , threading
from urllib.reque... |
_channel.py | # Copyright 2016 gRPC authors.
#
# 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... |
teststand-opcua-server.py | from opcua import ua, Server
from opcua.server.user_manager import UserManager
import threading, time, schedule
import fmipp
import os
from pathlib import Path
class DETBTeststandServer:
'''
A simple server providing an OPC-UA-compliant interface to a
simulation model of a DH substation. This simulation m... |
__init__.py | # -*- coding: utf-8 -*-
"""The initialization file for the Pywikibot framework."""
#
# (C) Pywikibot team, 2008-2020
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, division, unicode_literals
__version__ = __release__ = '3.1.dev0'
__url__ = 'https://www.mediawiki.org/wiki/... |
buffer_client.py | #! /usr/bin/python
#***********************************************************
#* Software License Agreement (BSD License)
#*
#* Copyright (c) 2009, Willow Garage, Inc.
#* All rights reserved.
#*
#* Redistribution and use in source and binary forms, with or without
#* modification, are permitted provided that the ... |
zutrust.py | #!/usr/bin/env python
"""
zutrust
Called by AWS Lambda to run trust advisor checks
and track changes since the last run.
Copyright 2018 zulily, 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 ... |
y2017.py | #!/usr/bin/env python3
import adventofcode
import collections
import functools
import numpy as np
import operator
import re
import threading
def assembler(_prog, _env, _p, _regs=26):
_env[_p].code = 0
_env[_p].counter = collections.defaultdict(lambda: 0)
_oper = dict(set='=', add='+=', sub='-=', mul='*=', mod='%=')... |
Sailboat.py | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 24 13:06:23 2018
@author: fahad
@contributor: Lianxin Zhang
"""
import time
import tcpserver
import globalvar as gl
import threading
import sailing
# import RPi.GPIO as GPIO
import IMU
import sensor
# import matplotlib.pyplot as plt
if __name__ == "__main__":
... |
rawproxy.py | '''
SimConnect proxy server
'''
from . utils import *
import sys, socket, time, threading
import connection
class GV:
keepRunning = True
class ConnectionHandler:
nextID = 0
@staticmethod
def Create(sock, destIP, destPort):
c = ConnectionHandler(sock, destIP, destPort)
t = threading.Th... |
dist_autograd_test.py | import sys
import threading
import time
import unittest
from enum import Enum
import torch
from datetime import timedelta
import torch.distributed as dist
import torch.distributed.autograd as dist_autograd
import torch.distributed.rpc as rpc
import torch.testing._internal.dist_utils
from torch.autograd impor... |
device_serve.py | import argparse
import json
import threading
import time
from queue import Queue, Empty
import jax
import numpy as np
import optax
from mesh_transformer import util
from mesh_transformer.checkpoint import read_ckpt
from mesh_transformer.sampling import nucleaus_sample
from mesh_transformer.transformer_shard import Ca... |
test_file2k.py | import sys
import os
import errno
import unittest
import time
from array import array
from weakref import proxy
try:
import threading
except ImportError:
threading = None
from test import test_support
from test.test_support import TESTFN, run_unittest
from UserList import UserList
class AutoFileTests(unittest... |
val.py | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Validate a trained YOLOv5 model accuracy on a custom dataset
Usage:
$ python path/to/val.py --data coco128.yaml --weights yolov5s.pt --img 640
"""
import argparse
import json
import os
import sys
from pathlib import Path
from threading import Thread
import numpy as... |
threaded_generator.py | #!/usr/bin/env python3
"""Threaded generator. https://github.com/Lasagne/Lasagne/issues/12#issuecomment-59494251"""
def threaded_generator(generator, num_cached=50):
"""Implements threaded generator to produce batches in background thread.
# Arguments
generator: an object exposing generator i... |
trover.py | #!/usr/bin/env python3
import threading
import netifaces as ni
import numpy as np
import math
import time
import socket
import signal
from gpiozero import AngularServo
servo = AngularServo(26, min_angle=-45, max_angle=45)
waypoints_file = "....txt" # Text File with GPS waypoints
###############################
# Pur... |
schedule.py | import time
from multiprocessing import Process
import asyncio
import aiohttp
try:
from aiohttp.errors import ProxyConnectionError,ServerDisconnectedError,ClientResponseError,ClientConnectorError
except:
from aiohttp import ClientProxyConnectionError as ProxyConnectionError,ServerDisconnectedError,ClientRespons... |
labjack.py | #!/usr/bin/python3
# Copyright 2020 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 agr... |
threads.py | import logging
import socket
from os import kill
import signal
from multiprocessing import Process, Queue
from subprocess import Popen, STDOUT, PIPE
from PyQt5.QtCore import QThread, pyqtSignal, pyqtSlot, QProcess, QObject
from wifipumpkin3.core.packets.dhcpserver import DHCPProtocol
from wifipumpkin3.core.utility.prin... |
agent_new.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import threading
import sys
import time
import os
import commands
import psutil
import random
import urllib,urllib2
import socket
from optparse import OptionParser
from email import encoders
from email.header import Header
from email.mime.text import MIMEText
from email.uti... |
stores.py | import io
import os
import uuid
import time
import threading
import shutil
import logging
from datetime import datetime
from . import datestring
def zip_it(folder):
if os.path.isfile(folder + ".tar.gz"):
logging.getLogger("RawStore").info("The target zip file " + folder + ".tar.gz" + " already exists on t... |
client_udp_listener.py | import json
import socket
import threading
from club_controller import app_config
from club_controller.misc.config_manager import config_manager
from club_controller.protocol.message_ids import (ClientMessageId,
ServerMessageId)
from eventhandler import EventHandler
f... |
bilispider.py | #coding=utf-8
import requests
import time
import threading
import os
import queue
import logging
class spider():
'''
爬虫类
'''
#构造函数
def __init__(self,rid,config={}):
'''
爬虫类构造函数,接受参数:
\t tid:分区id
\t config:设置参数(dict类型)
'''
#更新状态
self.status = {'progress' : '__init__'}
from .version import version
... |
io.py | # coding: utf-8
# pylint: disable=invalid-name, protected-access, fixme, too-many-arguments, W0221, W0201, no-self-use, no-member
"""NDArray interface of mxnet"""
from __future__ import absolute_import
from collections import OrderedDict
import sys
import ctypes
import logging
import threading
import numpy as np
from... |
window_title.py | # -*- coding: utf-8 -*-
from i3pystatus import Module
from threading import Thread
import i3ipc
class WindowTitle(Module):
"""
Display the current window title with async update.
Uses asynchronous update via i3 IPC events.
Provides instant title update only when it required.
fork from window_tile... |
store.py | import datetime
import json
import threading
import uuid
from collections import defaultdict
from copy import deepcopy
from dictdiffer import diff
from inspect import signature
from threading import Lock
from pathlib import Path
from tzlocal import get_localzone
from .logger import logger
from .settings import CACHE_... |
imaplib2.py | #!/usr/bin/env python
"""Threaded IMAP4 client.
Based on RFC 3501 and original imaplib module.
Public classes: IMAP4
IMAP4_SSL
IMAP4_stream
Public functions: Internaldate2Time
ParseFlags
Time2Internaldate
"""
__all__ = ("IMAP4", "IMAP4_SSL"... |
mpi.py | """
DMLC submission script, MPI version
"""
# pylint: disable=invalid-name
import subprocess, logging
from threading import Thread
from . import tracker
def get_mpi_env(envs):
"""get the mpirun command for setting the envornment
support both openmpi and mpich2
"""
# decide MPI version.
(_, err) =... |
postprocess_old.py | """Postprocesses data across dates and simulation runs before aggregating at geographic levels (ADM0, ADM1, or ADM2)."""
import argparse
import gc
import glob
import logging
import os
from multiprocessing import JoinableQueue, Pool, Process
from pathlib import Path
import numpy as np
import pandas as pd
import tqdm
f... |
Context_test.py | # coding: utf-8
#########################################################################
# 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> #
# author yeeku.H.lee kongyeeku@163.com #
# #
# version... |
controls.py | ###############################################################################
# CONTROLS.PY: Module-thread qui gère les contrôles (clavier, souris) et les #
# associent à des fonctions ou à des variables #
###############################################################################
... |
prob_cond.py | # Modified by Daniel Gomez-Sanchez: adding portableQueue dependency for MacOS compatibility, and opening bgzipped pileups
from portableQueue import Queue
from multiprocessing import Process, Lock
import parse_pileup as pp
import numpy as np
import time
import sys
from scipy.stats import bernoulli
from prob_cond_true_fr... |
win_ctrl.py | #!/usr/bin/python
from win_touch_client import TouchListener
from interface import InterfaceWinCtrl
import wnck, gtk
import webbrowser
import threading
from threading import Thread
import time
class _WinTimer(object):
def __init__(self):
self.__lock = threading.Condition()
self.__reset = False
... |
syn_extraction.py | # ===============================================================================
# Copyright 2014 Jake Ross
#
# 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/licens... |
test_cmdline.py | import os
import sys
import time
import logging
import multiprocessing
import pytest
from clitest import CmdlineInterfaceTest
sys.path.insert(0, os.path.abspath('..'))
# If we want to measure code coverage across CLI invocations then we can do
# "coverage -x goeffel". Just need to figure out where to let coverage ... |
blebase.py | #!/usr/bin/env python3
import sys
from abc import abstractmethod
import time
import threading
import logging
import asyncio
# read data from notification
class BleBase():
lock = threading.Lock()
verbose = False
mac = None
name = None
mtuSize = None
disconnectAfterData = False;
upda... |
hanging_threads.py |
## The MIT License (MIT)
## ---------------------
##
## Copyright (C) 2014 Nicco Kunzmann
##
## https://gist.github.com/niccokunzmann/6038331
##
## 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 Sof... |
tests.py | import threading
import time
from unittest import mock
from multiple_database.routers import TestRouter
from django.core.exceptions import FieldError
from django.db import (
DatabaseError, NotSupportedError, connection, connections, router,
transaction,
)
from django.test import (
TransactionTestCase, ove... |
PC_Miner.py | #!/usr/bin/env python3
"""
Duino-Coin Official PC Miner 3.0 © MIT licensed
https://duinocoin.com
https://github.com/revoxhere/duino-coin
Duino-Coin Team & Community 2019-2021
"""
from threading import Semaphore
from time import time, sleep, strptime, ctime
from hashlib import sha1
from socket import socket
... |
test__xxsubinterpreters.py | from collections import namedtuple
import contextlib
import itertools
import os
import pickle
import sys
from textwrap import dedent
import threading
import time
import unittest
from test import support
from test.support import import_helper
from test.support import script_helper
interpreters = import_helper.import_... |
lineChart.py | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2013 Riverbank Computing Limited
## Copyright (C) 2012 Digia Plc
## All rights reserved.
##
## This file is part of the PyQtChart examples.
##
## $QT_BEGIN_LICENSE$
## Licensees holding valid Qt Com... |
04_cuda_async.py | #!/usr/bin/env python3
import gym
import ptan
import argparse
import torch
import torch.optim as optim
import torch.multiprocessing as mp
from tensorboardX import SummaryWriter
from lib import dqn_model, common
PLAY_STEPS = 4
def init(params):
env = gym.make(params['env_name'])
env = ptan.common.wrappers.... |
pubLITE.py | # Copyright (c) 2021 Andrei Sukhanov. All rights reserved.
#
# Licensed under the MIT License, (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://github.com/ASukhanov/apstrim/blob/main/LICENSE
#
"""Base class for accessing multi... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... |
mod_chatInfo.py | # -*- coding: utf-8 -*-
import datetime
import json
import threading
import urllib2
# noinspection PyUnresolvedReferences
from gui.mods.mod_mods_gui import g_gui, inject
# noinspection PyProtectedMember
from messenger.gui.Scaleform.channels.bw.lobby_controllers import _ChannelController
COLORS = ['#FE0E00', '#FE790... |
client.py | import collections
import logging
import os
import stat
import threading
import boltons.strutils
import boltons.timeutils
from . import tasks
from . import directory
from . import sftp_utilities
from . import editor
from king_phisher.client import gui_utilities
from gi.repository import Gtk
from gi.repository impor... |
manager.py | #!/usr/bin/env python3
# the manager should be simple
# it is quite specific, and will need heavy customization for the "real" incarnation
# its behavior depends heavily on whether or not this bot is for the treatment or control group
# import setup
import setup
# import tweet.py and measure.py
import tweet
import m... |
jucesp_consulta.py | import os
from selenium import webdriver
from selenium.webdriver import ChromeOptions
from selenium.webdriver.common.keys import Keys
from default.webdriver_utilities import *
from default.interact import press_keys_b4, press_key_b4
from default.settings import SetPaths
from default.data_treatment import ExcelToData
... |
core.py | # -*- coding: utf-8 -*-
import asyncio
import io
import os
import signal
import subprocess
import sys
import time
from collections import defaultdict
from collections import deque
from copy import deepcopy
from functools import partial
from typing import Any as AnyType
from typing import Awaitable
from typing import Ca... |
evaluation.py | # Copyright (c) 2020 DeNA Co., Ltd.
# Licensed under The MIT License [see LICENSE for details]
# evaluation of policies or planning algorithms
import random
import time
import multiprocessing as mp
from .environment import prepare_env, make_env
from .connection import send_recv, accept_socket_connections, connect_so... |
test_local_task_job.py | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
server.py | from scapy.all import sniff, send, IP, ICMP
from threading import Thread
from time import sleep
def check_for_answer(packet):
try:
icmp = packet[0][2]
if type(icmp) == ICMP:
payload = bytes(icmp.payload)
ligma_location = payload.find(b'BALLS')
if ligma_location !... |
coap.py | # -*- coding: utf-8 -*-
# pylint: disable=broad-except, bare-except, invalid-name
import threading
from datetime import datetime, timedelta
import time
import socket
import struct
from .compat import s
from .utils import exception_log
from .const import (
LOGGER,
COAP_IP,
COAP_PORT
)
cla... |
scheduler_job.py | # pylint: disable=no-name-in-module
#
# 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, Versio... |
exchange_rate.py | from datetime import datetime
import inspect
import requests
import sys
import os
import json
from threading import Thread
import time
import csv
import decimal
from decimal import Decimal
from .bitcoin import COIN
from .i18n import _
from .util import PrintError, ThreadJob, make_dir
# See https://en.wikipedia.org/w... |
control.py | import os
from time import sleep
import json
from multiprocessing import Process
states_json_path = "/workspace/go_proj/src/Ai_WebServer/algorithm_utils/model_states.json"
model_name = "deoldify"
def run_model_server():
os.system("python run.py")
if __name__ == '__main__':
running = False
while True:
... |
play_wav_in_sys_call.py | #!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
play audio via system call
Work on Mac and Linux Environments
alsa-utils: /usr/bin/aplay
"""
import os
import threading
import subprocess
import sys
if sys.platform == "darwin":
player_name = "afplay"
elif sys.platform == "linux2":
player_name = "aplay"
def... |
nginx.py | #!/usr/bin/python3
from subprocess import Popen, call
from threading import Thread, Event
import socket
class NGINX(object):
def __init__(self, upstreams=[], stop=Event()):
super(NGINX, self).__init__()
self._nginx="/usr/local/sbin/nginx"
self._stop=stop
self._thread=None
s... |
thread.py | """Threading utilities."""
import time
import threading
from .timing import TimeoutException
def execute_as_thread(target, args=None, kwargs=None, daemon=False, join=True,
break_join=None, join_sleep=0.01, timeout=None):
"""
Execute target callable in a separate thread.
:param tar... |
mailing.py | from telegram import Update, Message as TelegramMessage, TelegramError, Bot, PhotoSize, Animation, Video, ParseMode
from telegram.ext import CallbackContext, ConversationHandler
from threading import Thread
from contextlib import suppress
import logging
import time
from settings import ADMINS
from ..constants import... |
thermos_observer.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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... |
views.py | # -*- coding: UTF-8 -*-
import datetime
import re, io
import ast
import simplejson as json
from threading import Thread
from collections import OrderedDict
from django.db import connection, transaction
from django.utils import timezone
from django.conf import settings
from django.shortcuts import render, get_object_or... |
__init__.py | import threading
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
MODE_ANY = 1
MODE_ALL = 2
MODE_COUNT = 3
class ReuseCancelWaitError(Exception):
pass
class CancelWait(object):
def __init__(self):
self._event = None
def cancel(self):
if self.... |
web.py | '''
基于TCP服务器的静态Web服务器_返回指定页面数据.py
'''
# 导入模块
import socket
import threading
import sys
# 导入框架应用程序模块
from framework import application
# 实现这个类
class SocketServer(object):
# 实现初始化方法,在实现这个对象时,就将Socket的准备工作做好
def __init__(self,port):
self.__server = socket.socket()
self.__server.setsockopt(sock... |
kb_hmmerServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, Inva... |
twitter.py | # -*- coding: utf-8 -*-
from os import getenv
from simplejson import loads
from Queue import Queue
from threading import Event
from threading import Thread
from tweepy import API
from tweepy import OAuthHandler
from tweepy import Stream
from tweepy.streaming import StreamListener
from logs import Logs
# The keys for... |
stepper_motor_component.py | """This module contains the StepperMotorComponent type."""
import threading
from raspy.argument_null_exception import ArgumentNullException
from raspy.object_disposed_exception import ObjectDisposedException
from raspy.components.motors import motor_state
from raspy.components.motors.motor_rotate_event import MotorRo... |
test_poplib.py | """Test script for poplib module."""
# Modified by Giampaolo Rodola' to give poplib.POP3 and poplib.POP3_SSL
# a real test suite
import poplib
import socket
import os
import errno
import threading
import unittest
from unittest import TestCase, skipUnless
from test import support as test_support
from test.support imp... |
transaction_indexer.py | import csv
import random
import uuid
import time
import sys
from models import Transaction
from mongoengine import register_connection
from threading import Thread, Lock
from textblob import TextBlob
from elasticsearchcli import ElasticSearchCli
from searchresultoptimizer import SearchResultOptimizer
class Transacti... |
app.py | import Queue
import collections
import copy
import multiprocessing
import os
import socket
import threading
import time
import traceback
from threading import Thread
import logging
import jsonpickle
import psutil
from colorker.comm import messaging
from colorker.core import EngineProcess
from colorke... |
client.py | import socket
import threading
nickname = input("Your nickname: ")
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(('127.0.0.1', 14902))
def receive():
while True:
try:
message = client.recv(16384).decode('utf-8')
if message == 'NICK':
c... |
deploy.py | # Copyright (c) OpenMMLab. All rights reserved.
import argparse
import logging
import os.path as osp
import sys
import traceback
from functools import partial
import mmcv
import torch.multiprocessing as mp
from torch.multiprocessing import Process, set_start_method
from mmdeploy.apis import (create_calib_table, extra... |
bleak_wrapper.py | # bleak_wrapper.py/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro).
# This copyright was auto-generated on Tue Sep 7 21:35:53 UTC 2021
"""Manage a Bluetooth connection using bleak."""
import asyncio
import logging
import threading
from typing import Pattern, Dict, Any, Callable, O... |
training.py | import argparse
import os
import shutil
import threading
import numpy as np
import torch
import torch.nn.functional as F
import torch.optim as optim
import torch.utils.data as data
import torch.utils.tensorboard as tensorboard
import yaml
import mrf.data.dataset as ds
import mrf.data.definition as defs
import mrf.eva... |
clone_eight_eval_mini_srcgame_add_map_bn.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
USED_DEVICES = "0,1"
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = USED_DEVICES
import sys
import threading
import time
import tensorflow as tf
from absl import... |
metricscollection.py | #!/opt/local/bin/python3
version = 'v2022-01-20'
#########################################################################################
# #
# ... |
local_sgd.py | import copy
import torch
import threading
import torch.nn as nn
""" Class LocalSGD implements Vanilla Local SGD as described in
(arXiv:1808.07217) for multi-GPU training of sequential models.
-- model (nn.Sequential): input model for this component
-- iterations (int): local SGD iterations between merging up... |
draw.py | '''
Using opt4.py ,an Genetic Algorithm (GA), to estimate
the best contrast and brightness parameter for the input image. (judge by score)
Compare with all the possibility contrast and brightness combination to the input image,
output a 3D graph shows the whole combination score distributes ans where the GA score loc... |
pesa2.py | # This file is part of NEORL.
# Copyright (c) 2021 Exelon Corporation and MIT Nuclear Science and Engineering
# NEORL is free software: you can redistribute it and/or modify
# it under the terms of the MIT LICENSE
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# ... |
hotkey_process.py | import time
from multiprocessing import Process, Queue
from threading import Thread
from typing import Dict, Optional, Callable
from playsound import playsound
from fishy import helper
from fishy.helper.hotkey import process
from fishy.helper.hotkey.process import Key
# noinspection PyPep8Naming
class hotkey:
i... |
test_configuration.py | """
Copyright (c) 2015 SONATA-NFV
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 agreed to in... |
streaming.py | # Tweepy
# Copyright 2009-2020 Joshua Roesslein
# See LICENSE for details.
# Appengine users: https://developers.google.com/appengine/docs/python/sockets/#making_httplib_use_sockets
from __future__ import absolute_import
import json
import logging
import multiprocessing
import re
import requests
import ssl
import sy... |
test_output.py | import subprocess
import sys
import pytest
import re
import signal
import time
import os
import ray
from ray._private.test_utils import (
run_string_as_driver_nonblocking,
run_string_as_driver,
)
@pytest.mark.skipif(sys.platform == "win32", reason="Failing on Windows.")
def test_spill_logs():
script = "... |
pypubsub_entry_point.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import importlib.util
from threading import Thread
import time
from pubsub import pub
def run_app():
# need to import in thread (kivy breaks otherwise)
from clover.gui import CloverApp
# set up publish points
def on_leo(leo):
pub.sendM... |
process.py | import atexit
import logging
import os
from queue import Queue as PyQueue
import re
import threading
import weakref
import asyncio
import dask
from .utils import mp_context, TimeoutError
from tornado import gen
from tornado.concurrent import Future
from tornado.ioloop import IOLoop
logger = logging.getLogger(__name... |
lisp.py | # -----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com>
#
# 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... |
test_subprocess.py | import unittest
from test import script_helper
from test import support
import subprocess
import sys
import signal
import io
import locale
import os
import errno
import tempfile
import time
import re
import selectors
import sysconfig
import warnings
import select
import shutil
import gc
import textwrap
try:
import... |
views.py | import os
import signal
from django.shortcuts import render, HttpResponse
from .models import User, Question, Score
import subprocess
from subprocess import Popen, PIPE, STDOUT
import json
import random, math
# import pyperclip
# from subprocess import Popen, PIPE
import time
import threading
import signal, sys
time... |
io.py | # coding: utf-8
# pylint: disable=invalid-name, protected-access, fixme, too-many-arguments, W0221, W0201, no-self-use
"""NDArray interface of mxnet"""
from __future__ import absolute_import
from collections import namedtuple, OrderedDict
import ctypes
import sys
import numpy as np
import logging
import threading
fro... |
run.py | from google_trans_new import google_translator
import constant
import deepl
import json
import logging
import os
import pygame
import queue
import random
import re
import requests
import shutil
import signal
import sys
import threading
import time
from datetime import datetime
from gtts import gTTS
from twitchio impo... |
test_events.py | """Tests for events.py."""
import collections.abc
import functools
import gc
import io
import os
import platform
import re
import signal
import socket
try:
import ssl
except ImportError:
ssl = None
import subprocess
import sys
import threading
import time
import errno
import unittest
from unittest import mock
... |
kline_widgets.py | # -*- coding: utf-8 -*-
"""
基于uiKline扩展得widgets
华富资产/李来佳
"""
import os
import json
import traceback
import pandas as pd
from threading import Thread
from time import sleep
from pymongo import MongoClient
from pymongo.errors import ConnectionFailure, AutoReconnect
from vnpy.trader.ui.kline.kline import QtWidgets, KLine... |
test_channel.py | #!/usr/bin/python
#
# Server that will accept connections from a Vim channel.
# Used by test_channel.vim.
#
# This requires Python 2.6 or later.
from __future__ import print_function
import json
import socket
import sys
import time
import threading
try:
# Python 3
import socketserver
except ImportError:
#... |
pyshell.py | #! /usr/bin/env python3
try:
from tkinter import *
except ImportError:
print("** IDLE can't import Tkinter.\n"
"Your Python may not be configured for Tk. **", file=sys.__stderr__)
sys.exit(1)
import tkinter.messagebox as tkMessageBox
if TkVersion < 8.5:
root = Tk() # otherwise create root in... |
Self_Transport.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import cv2
import copy
import time
import math
import import_path
import Camera
import apriltag
import threading
import numpy as np
from LABConfig import *
import PickAction as Pick
import kinematics as kinematics
import HiwonderSDK.Misc as Misc
import HiwonderS... |
xcvrd.py | #!/usr/bin/env python2
"""
xcvrd
Transceiver information update daemon for SONiC
"""
try:
import ast
import copy
import functools
import json
import multiprocessing
import os
import signal
import sys
import threading
import time
import subprocess
from sonic_py... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.