source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
test_gen_nccl_id_op.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... |
test_fx.py | import builtins
import contextlib
import copy
import functools
import inspect
import math
import numbers
import operator
import os
import pickle
import sys
import torch
import traceback
import warnings
import unittest
from math import sqrt
from torch.multiprocessing import Process
from torch.testing import FileCheck
fr... |
csfd_get_user_ratings__threading2.py | from datetime import datetime
from pprint import pprint
import concurrent.futures
import queue
import requests
from bs4 import BeautifulSoup as bs
import time
from multiprocessing import Pool, cpu_count
import threading
from csfd_functions import get_csfd_ratings_from_url, get_csfd_max_page
BASE_URL = "https://www.c... |
chromectrl.py | from __future__ import print_function
import json, threading, itertools
try:
import websocket
except ImportError:
websocket = None
# Python 3 compatibility
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
try:
input = raw_input
except NameError:
pass
cl... |
comm.py | """
comm.py:
This is the F prime communications adapter. This allows the F prime ground tool suite to interact with running F prime
deployments that exist on the other end of a "wire" (some communication bus). This is done with the following mechanics:
1. An adapter is instantiated to handle "read" and "write" functi... |
xmlstream.py | """
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2010 Nathanael C. Fritz
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
from __future__ import with_statement, unicode_literals
import base64
import copy
import logging
import signal
import socket as Socket
import s... |
map_reduce.py | import miner_globals
from base import *
import io_command
from m.common import *
import for_command
def p_source_map_source(p):
'''source : map_source'''
p[0] = p[1]
def p_map_source_rread(p):
'''map_source : MAP INTEGER file_source CURLY_OPEN command_chain '}' '''
p[0] = MapReduce(p[2])
p[0].init... |
x11window.py | # coding: utf-8
"""
Contains code for the X11 window list/interaction interface.
"""
from gi.repository import GdkPixbuf
from ewmh import EWMH
import threading
import Xlib
from Xlib import X
from aspinwall.shell.interfaces.window import Window, ProtocolSpecificInterface
class X11Window(Window):
"""Represents an X11 ... |
pdfminer_multiprocess_timed.py | # PDF to HTML (or TXT or XML- commented out) formats with pdfminer.six
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.converter import HTMLConverter,TextConverter,XMLConverter
from pdfminer.layout import LAParams
from pdfminer.pdfpage import PDFPage
import io
import csv, re, os, sys... |
test_utils_test.py | from __future__ import print_function, division, absolute_import
from contextlib import contextmanager
import socket
import sys
import threading
from time import sleep
import pytest
from tornado import gen
from distributed import Scheduler, Worker, Client, config, default_client
from distributed.core import rpc
from... |
test_fx.py | # Owner(s): ["oncall: fx"]
import builtins
import contextlib
import copy
import functools
import inspect
import math
import numbers
import operator
import os
import pickle
import sys
import torch
import traceback
import typing
import types
import warnings
import unittest
from math import sqrt
from torch.multiprocessin... |
ExpressVpn_Monitor.py | #!/usr/bin/env python3
from common_functions import *
class ExpressStatus:
def __init__(self):
notify.init(APPINDICATOR_ID)
self.indicator = appindicator.Indicator.new(APPINDICATOR_ID, error_image,
appindicator.IndicatorCategory.APPLICATION_STAT... |
driver_util.py | """Scripts for drivers of Galaxy functional tests."""
import http.client
import json
import logging
import os
import random
import shutil
import socket
import string
import subprocess
import sys
import tempfile
import threading
import time
from pathlib import Path
from typing import Optional
from urllib.parse import u... |
minion.py | # -*- coding: utf-8 -*-
'''
Routines to set up a minion
'''
# Import python libs
import logging
import getpass
import multiprocessing
import fnmatch
import os
import hashlib
import re
import threading
import time
import traceback
import sys
# Import third party libs
import zmq
# Import salt libs
from salt.exceptions... |
test_serial.py | # To run: $ env/bin/python googlesamples/bartender/test_serial.py
import serial
from threading import Thread
num_bottles = 2
bottle_on = []
for i in range(0, num_bottles):
bottle_on.append(False)
ser = serial.Serial('/dev/ttyACM0', 9600)
def write_loop():
while True:
serial_str = input('Enter string to sen... |
test_keepitfresh.py | import http.server
import os
import pathlib
import stat
import zipfile
from platform import system
from threading import Thread
import keepitfresh
import mock
def test_get_file_urls(tmpdir):
test_func = keepitfresh.get_file_urls
tmpdir.ensure('example-0.1.0.zip', file=True)
tmpdir.ensure('example-0.1.1.... |
server.py | #!/usr/bin/python
import socket
import os
import sys
import subprocess
import Queue
import threading
import signal
children = Queue.Queue(7)
child_args = ['clojure', os.path.abspath(os.path.join(os.path.dirname(__file__), 'stub.clj'))]
if os.environ.get('CLASSPATH'):
os.environ['CLASSPATH'] += ':'
else:
os.en... |
ThreadingProp.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
ThreadingProp.py
MIT License (c) Faure Systems <dev at faure dot systems>
Add asyncio periodic tasks handling to Props base class.
"""
from constants import *
from PropApp import PropApp
import threading, time
class ThreadingProp(PropApp):
# __________________... |
autoSubmitter.py | from __future__ import print_function
import configparser as ConfigParser
import argparse
import shelve
import sys
import os
import subprocess
import threading
import shutil
import time
import re
import ROOT
from helpers import *
sys.path.append("../plottingTools")
shelve_name = "dump.shelve" # contains all the measur... |
io.py | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
berrymq.py | # -*- coding: utf-8 -*-
import re
import sys
import heapq
import queue
import types
import weakref
import threading
import xmlrpc.client
import itertools
import functools
def _dummy(message):
"""Dummy guard condition function.
It always matches.
@param message: passed values from exp... |
variable_scope_test.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
noise_shaping.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2017 Tomoki Hayashi (Nagoya University)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
from __future__ import division
import argparse
import logging
import multiprocessing as mp
import os
import sys
from distutils.util import strtobool
import ... |
journal.py | # Copyright (c) 2015 OpenStack Foundation
# 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 ... |
test_util_test.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
phaselink_dataset.py | #!/home/zross/bin/python
import numpy as np
import multiprocessing as mp
import pickle
import sys
import json
from obspy.geodetics.base import gps2dist_azimuth
bounds_scaler = 1
limit_max_distance = True
random_sta_locs = False
def output_thread(out_q, params):
none_count = 0
X = []
Y = []
while True:... |
websocket_client.py | # gdax/WebsocketClient.py
# original author: Daniel Paquin
# mongo "support" added by Drew Rice
#
#
# Template object to receive messages from the gdax Websocket Feed
from __future__ import print_function
import json
import base64
import hmac
import hashlib
import time
from threading import Thread
from websocket impor... |
launch.py | ###############################################################################
# Caleydo - Visualization for Molecular Biology - http://caleydo.org
# Copyright (c) The Caleydo Team. All rights reserved.
# Licensed under the new BSD license, available at http://caleydo.org/license
######################################... |
Hiwin_socket_ros_20190521124604.py | #!/usr/bin/env python3
# license removed for brevity
#接收策略端命令 用Socket傳輸至控制端電腦
import socket
##多執行序
import threading
import time
##
import sys
import os
import numpy as np
import rospy
import matplotlib as plot
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import Hiwin_socke... |
test_http_download.py | __author__ = 'wenjusun'
from httplib import HTTPConnection
from httplib import HTTPSConnection
import threading
import time
import sys
def download(host,path,n):
file_name = path.split('/')[-1] +'_' +str(n)
httpcon = HTTPConnection(host)
httpcon.connect()
httpcon.request('GET',path)
resp = htt... |
04.thread_inseguranca.py | import random
import time
from threading import Thread
from typing import List
import colorama
class Conta:
def __init__(self, saldo=0) -> None:
self.saldo = saldo
def criar_contas() -> List[Conta]:
return [Conta(saldo=random.randint(5_000, 10_000)) for _ in range(10)]
def transferir(origem: Con... |
alexa_audio.py | #!/usr/bin/env python3
import threading
import math
import struct
import time
import alexa_audio_device
import logging
from subprocess import Popen, PIPE, STDOUT
from pocketsphinx import *
DETECT_HYSTERESIS = 1.2 # level should fall lower that background noise
DETECT_MIN_LENGTH_S = 2.5 # minimal length of... |
enlaceRx.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#####################################################
# Camada Física da Computação
#Carareto
#17/02/2018
# Camada de Enlace
####################################################
# Importa pacote de tempo
import time
# Threads
import threading
# Class
class RX(object):
... |
Bot.py | import sys
from Finder import Finder
from ImageDict import ImageDict
from ScreenReader import ScreenReader
from MouseController import MouseController
import time
import multiprocessing
import numpy
import json
import logging
from directkeys import release_key, press_key
translate = []
class Bot:
def __init__(sel... |
threadrunner.py | from threading import Thread, Lock
from queue import Queue
import threading
q = Queue(maxsize=0)
mq = Queue(maxsize=0)
def execute_next():
global q, lock
while True:
(fn, args) = q.get()
fn(args)
q.task_done()
def execute_mq():
global mq, lock
while True:
(fn, args) ... |
run_schedule.py | #!/usr/bin/python3.6
# -*- coding:utf-8 -*-
import json
import threading
import time
from subprocess import Popen
import requests
import schedule
from lxml import etree
from db import redis_connection
VIDEO_URL = "https://api.bilibili.com/x/article/archives?ids={aid}"
VIDEO_KEY = "videoRedis:start_urls"
AUTHOR_URL ... |
solve_command.py | """Implements the solve command"""
import subprocess
import threading
import sys
import os
import math
import logging
import codecs
import json
from rows.parser import Parser
from rows.util.file_system import real_path
def memory_to_human_readable(value):
UNIT = 1024
if value < UNIT:
return '{0} B'.... |
connection_test.py | import demistomock as demisto
from Active_Directory_Query import main
import socket
import ssl
from threading import Thread
import time
import os
import pytest
BASE_TEST_PARAMS = {
'server_ip': '127.0.0.1',
'secure_connection': 'None',
'page_size': '500',
'credentials': {'identifier': 'bad', 'password'... |
dokku-installer.py | #!/usr/bin/env python3
import cgi
import json
import os
import re
import shutil
try:
import SimpleHTTPServer
import SocketServer
except ImportError:
import http.server as SimpleHTTPServer
import socketserver as SocketServer
import subprocess
import sys
import threading
VERSION = 'v0.24.7'
def bytes_t... |
eoxserver-atpd.py | #!/usr/bin/env python
#-----------------------------------------------------------------------
#
# Description:
#
# asynchronous processing master daemon
#
# This is the master server which keeps track of the aynchronous tasks in the
# queue and distributes task to the workers
#
#----------------------------... |
controller.py | """
:module: OpenDrive.client_side.gui.controller
:synopsis: Controlling the opening and closing of the gui
:author: Julian Sobott
Modules outside of this package should only use this module to access the gui!
public functions
----------------
.. autofunction:: start_gui_thread
.. autofunction:: stop
.. autofunctio... |
RMQAsyncComm.py | import threading
from yggdrasil import backwards, tools
from yggdrasil.communication import RMQComm
if RMQComm._rmq_installed:
import pika
_pika_version_maj = int(float(pika.__version__.split('.')[0]))
if _pika_version_maj >= 1: # pragma: debug
raise ImportError("pika version 1.0 not yet supported.... |
restoSvcTest.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Test Tools
"""
import argparse
import socket
import threading
import requests
import sys
import time
from src.utils import decode, TestError
from src.telemaxUtils import BuildTelemax, ParseTelemaxAnswer
__author__ = 'cdc'
__email__ = 'cdc@restomax.com'
__version__ = ... |
example.py | import PollableQueue.PollableQueue as PollableQueue
import select
import threading
import time
import random
def writeThread(pollqueues, fin):
flag = True
while flag:
try:
"""
You can use select.select(pollqueue, [], [], 0) for never block,
note due to C level impl... |
Eventbus.py | #!/usr/bin/python
# Jayamine Alupotha
import socket
import json
import struct
import time
import types
import threading
# Eventbus constructor
# input parameters
# 1) instance
# 1) host - String
# 2) port - integer(>2^10-1)
# 3) TimeOut - float- receive TimeOut
# 4) TimeInterval -float -sleep time
# inside param... |
feeder.py | import os
import threading
import time
import traceback
import numpy as np
import tensorflow as tf
from infolog import log
from sklearn.model_selection import train_test_split
from tacotron.utils.text import text_to_sequence
_batches_per_group = 32
class Feeder:
"""
Feeds batches of data into queue on a backgroun... |
auto_test.py | """Tests for letsencrypt-auto"""
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from contextlib import contextmanager
from functools import partial
from json import dumps
from os import chmod, environ, makedirs, stat
from os.path import abspath, dirname, exists, join
import re
from shutil import copy, r... |
processes.py | """
process.py
Created by Thomas Mangin on 2011-05-02.
Copyright (c) 2009-2017 Exa Networks. All rights reserved.
License: 3-clause BSD. (See the COPYRIGHT file)
"""
import os
import errno
import time
import subprocess
import select
import fcntl
from exabgp.util import str_ascii
from exabgp.util import bytes_ascii
f... |
repair_test.py | import os
import os.path
import threading
import time
import re
import pytest
import logging
from collections import namedtuple
from threading import Thread
from cassandra import ConsistencyLevel
from cassandra.query import SimpleStatement
from ccmlib.node import ToolError
from dtest import FlakyRetryPolicy, Tester,... |
test_lib_test.py | #!/usr/bin/env python
from __future__ import absolute_import
import threading
import time
import unittest
from grr_response_core.lib import rdfvalue
from grr.test_lib import test_lib
class FakeTimelineTest(unittest.TestCase):
def testRunSingleSleep(self):
log = []
def foo():
while True:
lo... |
_app.py | import selectors
import sys
import threading
import time
import traceback
from ._abnf import ABNF
from ._core import WebSocket, getdefaulttimeout
from ._exceptions import *
from . import _logging
"""
_app.py
websocket - WebSocket client library for Python
Copyright 2022 engn33r
Licensed under the Apache License, Ver... |
smtpAudit.py | #!/usr/bin/python3
#
# SMTP Server configuration black-box testing/audit tool, capable of auditing
# SPF/Accepted Domains, DKIM, DMARC, SSL/TLS, SMTP services, banner, Authentication (AUTH, X-EXPS)
# user enumerations (VRFY, EXPN, RCPT TO), and others.
#
# Currently supported tests:
# 01) 'spf' ... |
durationFeeder.py | import os
import threading
import time
import traceback
import numpy as np
import tensorflow as tf
from infolog import log
from sklearn.model_selection import train_test_split
import tacotron.utils.pinyin as py
from tacotron.utils.symbols import duration_symbols
_batches_per_group = 64
class Feeder:
"""
Feeds bat... |
test_cli_task.py | # Copyright 2013: Mirantis 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 b... |
fs.py | #!/usr/bin/env python
import os
import threading
from hashlib import md5
import time
import glob
from basescript import init_logger
from deeputil import Dummy
from deeputil import AttrDict
from deeputil import ExpiringCache
import fuse
from fuse import Fuse
from .mirrorfs import MirrorFS, MirrorFSFile, logit
from .... |
multiprocesstest.py | import wx
import multiprocessing
import os
import threading
#from task.TaskManager import TaskManager
from task.task import Task
import uuid
import time
def proxy(cls, wpipe):
cls.__run__(wpipe)
class Hello(object):
def __init__(self):
self.pool = multiprocessing.Pool()
def __run__(self, wpipe):... |
pyterm.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Oliver Hahm <oliver.hahm@inria.fr>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of ... |
socket_connector.py | # Copyright 2022. ThingsBoard
#
# 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 ... |
tutorial_views.py | """
msui.tutorials.tutorial_views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This python script generates an automatic demonstration of how to use the top view, side view, table view and
linear view section of Mission Support System in creating a operation and planning the flightrack.
This file is part of MSS.
... |
libinput-replay.py | #!/usr/bin/env python3
# vim: set expandtab shiftwidth=4:
# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
#
# Copyright © 2018 Red Hat, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal ... |
main.py | import os
import sys
from flask import request
import requests
path = sys.argv[0][:-7]
os.chdir(path)
print("Change work dir:", path)
from core import InitSystem, Responses
import core.tools
import api
codes = (403, 404, 405, 500)
iapp = InitSystem("config.json")
endpoints = iapp.endpoints
app = ia... |
conductor.py | # Copyright (c) 2014 Rackspace, 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 writ... |
catoolshelper.py | import threading
from malcolm.core import Queue
from malcolm.compat import maybe_import_cothread
def _import_cothread(q):
import cothread
from cothread import catools
from cothread.input_hook import _install_readline_hook
_install_readline_hook(None)
q.put((cothread, catools))
# Wait forever
... |
test_http.py | #!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import http_server_port
from youtube_dl import YoutubeDL
from youtube_dl.compat i... |
multi_ping.py | #!/usr/bin/env python
import argparse
import shlex
import subprocess
import ipaddress
import re
#from multiprocessing import Process
#from threading import Thread
import threading
BASE_IP='10.1.1.2'
NUM_THREADS=32
def get_ip_range(base_ip, num):
try:
base_ip = ipaddress.ip_address(unicode(base_ip))
... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
client_executor.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 ... |
music.py | from __future__ import division
try:
import Queue as queue
except ImportError:
import queue
import random
import threading
import time
from pygame import midi
BASE_REST_CHANCE = 0.05
PIANO = 0
CELLO = 42
CONSONANT = (0, 2, 4, 5) # root, 3rd, 5th, 6th
DISSONANT = (1, 3, 6) # 2nd, 4th, 7th
SCALES = ((0, 2, 4... |
ds_client.py | # validated: 2018-11-27 DS 18c8cce6a78d cpp/DsClient.cpp cpp/DsClient.h
# ----------------------------------------------------------------------------
# Copyright (c) FIRST 2017. All Rights Reserved.
# Open Source Software - may be modified and shared by FRC teams. The code
# must be accompanied by the FIRST BSD licens... |
nntest.py | import tensorflow as tf
from utils.nn import linearND, linear
from mol_graph import atom_fdim as adim, bond_fdim as bdim, max_nb, smiles2graph_list as _s2g
from models import *
from ioutils import *
import math, sys, random
from collections import Counter
from optparse import OptionParser
from functools import partial
... |
align_seq_with_structure_multithread.py | #!/usr/bin/python
# coding=UTF-8
# -*- coding: UTF-8 -*-
# This file is part of the StructureMapper algorithm.
# Please cite the authors if you find this software useful
#
# https://academic.oup.com/bioinformatics/advance-article/doi/10.1093/bioinformatics/bty086/4857361
# MIT License
#
# Copyright 2018 Anssi Nurmin... |
main.py | import sublime
import sublime_plugin
import webbrowser
import urllib
import re
import os
import sys
import shutil
import zipfile
import json
import pprint
import time
from . import requests
from . import processor
from . import context
from . import util
from .salesforce.lib.panel import Printer
from .salesforce impo... |
ppa6ctl.py | '''
name: ppa6ctl
description: Python module to control PeriPage A6 printer
author: Kevin Mader, Alexander Weigl
website: https://www.elektronikundco.de
git: https://github.com/linglingltd/peripage-a6-control
Credits to Elias Weingaertner
for reverse engineering the protocol
... |
etapa9-MultiplosProcessos-2.py | import threading, time, random
def somaThread(lista,soma_parcial,id):
soma = 0
for i in lista:
soma = soma + i
soma_parcial[id] = soma
N = int(input("Entre com o tamanho do vetor:"))
# Gera lista com valores aleatórios
lista = []
for i in range(N):
lista.append(random.randint(-50,51))
Nthrea... |
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_ca.py |
# for standalone-test
import sys
sys.path.append(".")
import unittest
import time
import threading
try:
# Python27
import Queue as queue
except ImportError:
# Python35
import queue
import j1939
class TestCA(unittest.TestCase):
# TODO: should we change the async_can_feeder to use the can backend... |
SAC_run_v9.py | #!/usr/bin/env python3
import threading, queue
import time
import os
import shutil
import numpy as np
import math
import rospy
import tensorflow as tf
from sac_v16 import SAC
from env_v23 import Test
from manipulator_h_base_module_msgs.msg import P2PPose
MAX_EPISODES = 100000
MAX_EP_STEPS = 600
MEMORY_CAPACITY = 100... |
app.py | import versionCheck
#^This fixes a really common problem I'm getting messages about. It checks for python 2.x
from flask import Flask, render_template, request, url_for, redirect, Markup, jsonify, make_response, send_from_directory, session
import requests
import sys
import bs4
import RandomHeaders
import re
import u... |
evaluate.py | #! /usr/bin/env python3
import argparse
import concurrent.futures
import glob
import itertools
import os
import signal
import subprocess
import sys
import threading
import time
import traceback
MODEL = "A3C"
def monitor_process(cmd, timeout, output_file, error_file, max_retries=3):
last_write = time.time()
... |
trecho.py | from threading import Semaphore
from random import random
class Trecho:
def __init__(self, saida:str, destino:str, custo:float, tempo:float, empresa:str, quantidade_maxima_de_vagas:int, quantidade_de_vagas_ocupadas:int=0, *args, **kargs):
self.saida = saida
self.destino = destino
self.custo ... |
CORE_MoreThanThreeEffects_ThreadsOutputs.py | # SMART JUGGLING CLUB - CORE CODE
# Interprets data read from IMU as sound effects played on a song in real time
# Bryan Beider 12/4/2016
#****************************** INTRO NOTES *****************************
# 1.- Data is transmitted from the imu sensor at a sampling time of 20ms --> 50 samples/sec
# 2.- The... |
test_telluric_context.py | from telluric.context import local_context, TelluricContext
def test_context_in_one_level():
with TelluricContext(a=1, b=2, c='stam', d={'a': 'a', 'b': 'b'}):
assert local_context.get('a') == 1
assert local_context.get('b') == 2
assert local_context.get('c') == 'stam'
assert local_... |
__init__.py | #!/usr/bin/python3 -OO
# Copyright 2007-2021 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... |
_darwinmouse.py | import os
import datetime
import threading
import Quartz
from ._mouse_event import ButtonEvent, WheelEvent, MoveEvent, LEFT, RIGHT, MIDDLE, X, X2, UP, DOWN
_button_mapping = {
LEFT: (Quartz.kCGMouseButtonLeft, Quartz.kCGEventLeftMouseDown, Quartz.kCGEventLeftMouseUp, Quartz.kCGEventLeftMouseDragged),
R... |
hangman.py | """
This is a hangman game, where a player chooses
a word that another player has to guess correctly
either by using letters to piece together the word
or just by guessing whole words directly. The game
ends when the man is fully drawn.
By: Aaron T****
2/21/18 - 2/25/18
Made with PyCharm
"""
import time
from threadi... |
core.py | # -*- coding: utf-8 -*-
#
# 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
#... |
drivers.py | #!/usr/bin/env python
'''
This ROS node combines many actuator activations that typically require python drivers.
'''
import rospy
import time
import traceback
import threading
### robot wheel motors
# Adapted from https://github.com/dusty-nv/jetbot_ros/blob/master/scripts/jetbot_motors.py
# Adapted by R. Kent Jam... |
trezor.py | import traceback
import sys
from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING
from electrum_ltc.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException
from electrum_ltc.bip32 import BIP32Node, convert_bip32_path_to_list_of_uint32 as parse_path
from electrum_ltc impo... |
depth_camera_server.py | import socket
import json
import threading
import base64
def main():
"""
Main function where you can test how VideoCameraServer works
"""
# Placing imports here so it will be imported only if user want to test algorithm, not when importing
# Class DepthCameraServer
import matplotlib.pyplot as... |
sound.py | from mumble import MumbleAdapter
from pymumble_py3.constants import *
from collections import deque
from threading import Thread
class SoundManager():
def __init__(self, mumble):
"""
Constructor for the Sound Manager
mumble: an instance of MumbleAdapter
"""
self.mu... |
BFR.py | # -*- coding: utf-8 -*-
import urllib2
import urllib
import base64
from control import settings
import cv2
import time
import json
import threading
# 二进制方式打开图片文件
class BFR(settings.BFRFather):
message={
'location':{'left':0,'top':0,'height':0,'width':0},
'name':'null',
'age':'nul... |
thread_communication_with_events.py | import threading
event = threading.Event()
def fire():
print('Firing eveent')
event.set()
def listen():
event.wait()
print('Event fireed')
t1 = threading.Thread(target=fire)
t2 = threading.Thread(target=listen)
t2.start() # listener first
t1.start()
|
learner.py | import glob
import os
import shutil
import signal
import threading
import time
from collections import OrderedDict, deque
from os.path import join
from queue import Empty, Queue, Full
from threading import Thread
import numpy as np
import psutil
import torch
from torch.multiprocessing import Process, Event as Multipro... |
CalculateImpVol.py | # Copyright (C) 2021 LYNX B.V. All rights reserved.
# Import ibapi deps
from ibapi.client import EClient
from ibapi.wrapper import EWrapper
from ibapi.contract import *
import threading
import time
class App(EWrapper, EClient):
def __init__(self, ipaddress, portid, clientid):
EClient.__init__(self,self)
... |
multi.py | '''
Script to perform simple floating point and integer benchmarking in python
@author: Nate Suver and Kam Larkins
'''
import multiprocessing
import datetime
import csv
import sys
import time
beginTest=False #a global flag we can use to tell all of the processes that we should begin testing
endTest=False #a global fl... |
train.py | import numpy as np
import scipy.misc,scipy.io
import time,os,sys
import threading
import util
print(util.toYellow("======================================================="))
print(util.toYellow("train.py (train with joint 2D optimization with novel viewpoints)"))
print(util.toYellow("==================================... |
data_reader.py | import math
import threading
import time
from typing import Dict, Generator, List, NoReturn, Tuple
import queue
import feast
from google.cloud import bigquery
from google.oauth2 import service_account
from google.cloud.bigquery.job import QueryJob
import pandas as pd
from retry import retry
import torch
from .preproc... |
preprocess.py | #!/usr/bin/env python
"""
Usage:
preprocess.py [options] TAR_FILES TARGET_FOLDER
Options:
-h --help Show this screen.
--shard-size=<int> shard size [default: 3000]
--test-file=<file> test file
--no-filtering do not filter files
"""
import glob
import mu... |
new_alpha_cams_test.py | # ===============================================================================================================================
#
# Name : mavlinkSonyCamWriteVals.py
# Desc : Global memory value class for use to write mavlink to sony cam
# Auth : AIR-obots Ai-Robots
#
# ===============================================... |
new_evc.py | '''
Written by Debojit Kaushik (Timestamp)
'''
import os
import sys
import traceback
import json
from multiprocessing import Queue, Process, Lock
from threading import Thread
from random import randint
from time import sleep
from numpy.random import choice
def EVC(t_id, q, prime, max_size, p1, p2):
try:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.