source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
latch_roundtrip.py | """
Measure latency of IPC between two local threads.
"""
import threading
import time
import mitogen
import mitogen.utils
import ansible_mitogen.affinity
mitogen.utils.setup_gil()
ansible_mitogen.affinity.policy.assign_worker()
X = 20000
def flip_flop(ready, inp, out):
ready.put(None)
for x in xrange(X):
... |
pywitch_tmi.py | from websocket import create_connection
import time
import threading
from .pywitch_functions import (
validate_token,
validate_callback,
get_user_info,
pywitch_log,
)
def get_display_name(string):
return string.split(';display-name=')[-1].split(';')[0].strip()
def get_user_id(string):
retur... |
gui.py | import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk as gtk
from gi.repository import Gdk as gdk
from gi.repository import GLib
import chess, chess.pgn, chess.polyglot, sys, subprocess, time, os, os.path, random, re, signal, threading, unicodedata, cairo, threading
import global_variables as G
from ... |
DataDogLogger.py | # -*- coding: utf-8 -*-
import datetime
import socket
import time
from threading import Event, Thread
from typing import Any, Optional, List
from pip_services3_commons.config import ConfigParams
from pip_services3_commons.refer import IReferenceable, IReferences, Descriptor
from pip_services3_commons.run import IOpena... |
plot.py | #!/usr/bin/env python3
import sys
import select
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib import style
import datetime
import threading
import time
import numpy as np
import math
style.use('ggplot')
max_sources = 8
max_data_points = 2000
refreshtime_ms = 100
killed = Fa... |
online-processing.py | # ----------------------------------------------------------------------------
# - Open3D: www.open3d.org -
# ----------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2018-2021 www.open3d.org
#
# Permission i... |
test_flight.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
battle_mode.py | import os
import random
import threading
import time
from extra.tools.os_initializer import init_os
if init_os() == 'Windows':
from msvcrt import getch, kbhit
else:
import curses
from extra.tools.linux_functions import set_normal_term, set_curses_term
from extra.tools.asker import complex_ask
from extra.to... |
CatTalk.py | from threading import Thread
from StreamRequest import StreamRequest
from CatStreamListener import CatStreamListener
streamRequest = StreamRequest.createStream("cat, cats", CatStreamListener());
tweetStream = Thread(target=streamRequest.startStream)
tweetStream.start()
blocking = True
while blocking:
s = input('-... |
dataTool.py | # from imports import *
import threading
import pandas as pd
# from plyfile import PlyData
from sklearn.decomposition import PCA
from multiprocessing import Process
import random
import os
from time import time
import numpy as np
import ezdxf
import open3d as o3d
from math import sqrt, floor
import laspy
from shapely.... |
test_browser.py | # coding=utf-8
# Copyright 2013 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
import argparse
import json
import multiprocessing
imp... |
portboozle.py | #!/usr/bin/python
import threading, socket, optparse, sys, json, signal, os, gzip
from queue import Queue
medium = {80, 443, 8000, 8080, 8443}
large = {80, 81, 443, 591, 2082, 2087, 2095, 2096, 3000, 8000, 8001, 8008, 8080, 8083, 8443, 8834, 8888}
huge = {80, 81, 300, 443, 591, 593, 832, 981, 1010, 1311, 2082, 2087,... |
cisd.py | #!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... |
basic_gpu_test.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
test_hardware.py | import __init__
import pytest
import threading
import time
from sistem_climatizare.hardware import Hardware
from sistem_climatizare.display import Display
test_passed = None
def test_hardware_loop():
hardware = Hardware()
t = threading.Thread(target=hardware.hardware_loop)
t.start()
time.sleep(5)
... |
bt_selfbot.py | # -*- coding: utf-8 -*-
import LINEBALI
from bs4 import BeautifulSoup
from gtts import gTTS
from LINEBALI.lib.curve.ttypes import *
from datetime import datetime
from time import sleep
import time, datetime, random, sys, json, codecs, threading, glob, re, string, os, requests, html5lib, subprocess, urllib, urllib2, go... |
test_ipc_provider.py | import os
import pathlib
import pytest
import socket
import tempfile
from threading import (
Thread,
)
import time
import uuid
from web3.auto.gethdev import (
w3,
)
from web3.middleware import (
construct_fixture_middleware,
)
from web3.providers.ipc import (
IPCProvider,
)
@pytest.fixture
def jsonrp... |
server.py | import flask
from flask import Flask
from threading import Thread
app = Flask("")
@app.route("/")
def index():
return "Tutti i sistemi sono tornati operativi."
def run():
app.run(host = "0.0.0.0", port = 8080)
def run_server():
t = Thread(target=run)
t.start() |
dprSniffer.py | """
Create a Server Server and socket client between AP and Daemon
> 1. Recording Packet,
"""
import wx
import wx.grid as Grid
import socket
import SocketServer
import threading
"""
TCP Forwarder and logger
This class Create the TCP Server and forward to assigned port
but it writes to Datab... |
commands.py | # These are the Mailpile commands, the public "API" we expose for searching,
# tagging and editing e-mail.
#
import copy
import datetime
import json
import os
import os.path
import random
import re
import shlex
import socket
import sys
import traceback
import threading
import time
import webbrowser
import mailpile.uti... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2018-2019 The Luascoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test luascoind shutdown."""
from test_framework.test_framework import LuascoinTestFramework
from test... |
option.py | #!/usr/bin/env python
"""
Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/)
See the file 'LICENSE' for copying permission
"""
import binascii
import cookielib
import glob
import inspect
import logging
import httplib
import os
import random
import re
import socket
import string
import sys
import tempfile
... |
core.py | # Copyright 2011-2013 James McCauley
#
# This file is part of POX.
#
# POX 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 3 of the License, or
# (at your option) any later version.
#
# POX is d... |
gdm.py | from __future__ import absolute_import
import threading
import socket
import traceback
import time
from . import util
from . import netif
from . import plexconnection
DISCOVERY_PORT = 32414
WIN_NL = chr(13) + chr(10)
class GDMDiscovery(object):
def __init__(self):
self._close = False
self.thread... |
localSaveServer.py | '''
Created on 18 Nov 2016
@author: twak
'''
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
from SocketServer import ThreadingMixIn
import threading
import argparse
import re
import cgi
import json
from os import listdir
import os
class LocalData(object):
records = {}
PATH = "/home/twak/Desktop/pa... |
mission.py | #!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
#
# This file is part of ewm-cloud-robotics
# (see https://github.com/SAP/ewm-cloud-robotics).
#
# This file is licensed under the Apache Software License, v. 2 except as noted
# otherwise in the LIC... |
train.py | # -*- coding: utf-8 -*-
#!/usr/bin/env python
import os
import json
import torch
import numpy as np
import queue
import pprint
import random
import argparse
import importlib
import threading
import traceback
from tqdm import tqdm
from utils import stdout_to_tqdm
from config import system_configs
from nnet.py_factory... |
socket_server.py | import select, socket, queue, json
from arduino import MIS_Arduino
from threading import Thread, Lock
from time import time
def socket_data_process(from_socket):
from_socket.strip()
#print(from_socket)
head, message = from_socket[:5], from_socket[6:]
#print(head, message)
head = int(head)
#prin... |
loppe.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
u"""
Desenvolvido por: @KleberCode
"""
import pygtk
import gtk
import datetime
import time
import requests
import os.path
import xlwt
from time import sleep
from os import mkdir
from BeautifulSoup import BeautifulSoup
from threading import Thread
pygtk.require('2.0')
gt... |
test_base.py | #!/usr/bin/env python
# Copyright (c) 2014-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same director... |
backtesting.py | from multiprocessing import Process
import time
from datetime import datetime, timedelta
import inspect
from apscheduler.jobstores.base import JobLookupError
from apscheduler.schedulers.background import BlockingScheduler, BackgroundScheduler
from stocklab.agent.ebest import EBest
from stocklab.agent.data import Dat... |
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
#... |
simulator.py | import threading
import simpy.rt as sp
from satsim import Logger, TimeKeeper, EventManager, Scheduler, Resolver,\
LinkRegistry, Component, Composite, Container, Publication,\
InvalidSimulatorState
class Simulator(Composite, Publication):
BUILDING = 0
CONNECTING = 1
INITIALISING = 2
STANDBY ... |
threading_study05.py | """
递归锁:
互斥锁如果嵌套了多个锁之后,会将自己锁死永远都出不来了。
这个时候可以使用递归锁,它相当于一个字典,记录了锁的门与锁的对应值,当开门的时候会根据对应来开锁。
"""
import threading,time
# 生成递归锁实例
lock = threading.RLock()
# run1第二道锁
def run1():
with lock: #在with语句中使用锁,条件和信号量
print("run1",threading.current_thread().getName(),time.ctime())
# run2第三道锁
def run2():
with lock... |
context.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... |
__init__.py | """CFNgin directed acyclic graph (DAG) implementation."""
import collections
import logging
from collections import OrderedDict, deque
from copy import copy, deepcopy
from threading import Thread
LOGGER = logging.getLogger(__name__)
class DAGValidationError(Exception):
"""Raised when DAG validation fails."""
c... |
test_capi.py | # Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
import os
import pickle
import random
import re
import subprocess
import sys
import sysconfig
import textwrap
import time
import unittest
from test import support
from te... |
_a4c_start.py |
from cloudify import ctx
from cloudify import utils
from cloudify.exceptions import NonRecoverableError
from StringIO import StringIO
import base64
import os
import platform
import re
import subprocess
import sys
import time
import threading
import platform
import json
def convert_env_value_to_string(envDict):
... |
main.py | import cv2 as cv
import numpy as np
import os
import pyautogui
from time import time, sleep
from screencapture import WindowCapture
from computervision import ComputerVision
from hsvfilter import HsvFilter
from threading import Thread
from tkinter import *
import entry
import win32api
#TKINTER ----------------------... |
multiprocessing_test.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# @File : multiprocessing_test.py
# @Time : 2019/2/26 21:47
# @Author : MaiXiaochai
# @Site : https://github.com/MaiXiaochai
import time
import multiprocessing
from concurrent.futures import ProcessPoolExecutor
def get_html(n):
time.sleep(n)
print("sub pro... |
begin.py | from util.listen_audio import listenAudioHandler as LAh
from util.get_time_interval import TimeHandler
import signal, threading, wave, os, shutil
from inspect import getsourcefile
export_file_name = 'audio'
export_file_ext = '.wav'
export_max_num = 1000
if __name__ == "__main__":
# instantiate timer class
t... |
test_WxPythonFromInit.py | import sys
import threading
import time
from time import sleep
from unittest import TestCase
import wx
import asn1editor
def delay():
sleep(1)
wx.GetApp().GetTopWindow().Close(True)
wx.GetApp().ExitMainLoop()
class WxPythonFromInit(TestCase):
@staticmethod
def test_open():
if wx.GetAp... |
test_gpio.py | import sys
import threading
import time
import periphery
from .asserts import AssertRaises
if sys.version_info[0] == 3:
raw_input = input
import queue
else:
import Queue as queue
pin_input = None
pin_output = None
def test_arguments():
print("Starting arguments test...")
# Invalid open types
... |
tbe_process.py | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
nvr.py | #!/usr/bin/env python3
"""
Copyright (c) 2015 - present Marco Hinz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modif... |
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... |
mini4tool.py | from os import read
import numpy as np
import serial
import configparser
import time
import datetime
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
import tkinter
import tkinter.ttk as ttk
import threading
import sys
config_pass = "./config.ini"
l... |
Client.py | import settings
import time
import Structs
import socket
from time import sleep
from select import select
from threading import Thread
class Client(object):
sock = None
running = False
dataThread = None
server = None
buf = 2048
nRid = 0
unrecievedMsg = []
connected = False
def ... |
MarketAnalysis.py | import os
import sys
import threading
import time
import traceback
import datetime
import pandas as pd
import sqlite3 as sqlite
from sqlite3 import Error
from modules.ExchangeApi import ApiError
# Bot libs
import modules.Configuration as Config
from modules.Data import truncate
try:
import numpy
use_numpy = Tr... |
ticker.py | # -*- coding: utf-8 -*-
"""
ticker.py
Websocket implementation for kite ticker
:copyright: (c) 2017 by Zerodha Technology.
:license: see LICENSE for details.
"""
import six
import sys
import time
import json
import struct
import logging
import threading
from datetime import datetime
from twisted.inter... |
run_websocket_server.py | from multiprocessing import Process
import argparse
import os
import logging
import syft as sy
from syft.workers.websocket_server import WebsocketServerWorker
import torch
import numpy as np
from torchvision import datasets
from torchvision import transforms
from syft.frameworks.torch.fl import utils
KEEP_LABELS_DICT ... |
client.py | #!/usr/bin/env python3
import socket
import argparse
import tkinter
from threading import Thread
from tkinter import messagebox
def message_handler(msg):
if msg.startswith("HAS LEFT THE CHAT "):
nname = msg[18:]
names = user_list.get(0, tkinter.END)
pos = -1
for i in range(len(na... |
nicolive.py | import json
import logging
import re
import websocket
import threading
import time
from streamlink.plugin import Plugin, PluginArguments, PluginArgument
from streamlink.plugin.api import useragents
from streamlink.stream import HLSStream
from streamlink.compat import urlparse, unquote_plus
_log = logging.getLogger(_... |
prediction.py | """ Script to run the actual online classification of data
"""
import os
import logging.handlers
import multiprocessing
import time
import numpy
import cPickle
import xmlrpclib
import sys
online_logger = logging.getLogger("OnlineLogger")
file_path = os.path.dirname(os.path.realpath(__file__))
pyspace_path = file_path... |
codec.py | #
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of ... |
self.py | # -*- coding: utf-8 -*-
import LINEPY
from LINEPY import *
from akad.ttypes import *
from multiprocessing import Pool, Process
from time import sleep
import pytz, datetime, pafy, time, timeit, random, sys, ast, re, os, json, subprocess, threading, string, codecs, requests, tweepy, ctypes, urllib, wikipedia
from dateti... |
main.py | #!/usr/bin/env pybricks-micropython
import struct, threading
from pybricks import ev3brick as brick
from pybricks.ev3devices import (
Motor,
TouchSensor,
ColorSensor,
InfraredSensor,
UltrasonicSensor,
GyroSensor,
)
from pybricks.parameters import (
Port,
Stop,
Direction,
Button... |
fifo_queue_test.py | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
pjit_test.py | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
ida_script.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import datetime
import threading
import xmlrpclib
from SimpleXMLRPCServer import SimpleXMLRPCServer
from xml.sax.saxutils import escape
import idaapi
import idautils
import idc
# Wait for any processing to get done
idaapi.autoWait()
... |
multiprocess_example.py | '''
Requires paramiko >=1.8.0 (paramiko had an issue with multiprocessing prior
to this)
Example code showing how to use netmiko for multiprocessing. Create a
separate process for each ssh connection. Each subprocess executes a
'show version' command on the remote device. Use a multiprocessing.queue to
pass data fro... |
testing_utils.py | """
weasyprint.tests.testing_utils
------------------------------
Helpers for tests.
"""
import contextlib
import functools
import logging
import os.path
import sys
import threading
import wsgiref.simple_server
from weasyprint import CSS, HTML, images
from weasyprint.css import get_all_computed_styles
f... |
app.py | from flask import Flask, render_template
import predict
import threading
app = Flask(__name__)
@app.route('/')
def home():
return render_template('index.html')
@app.route('/predictions_confirmed')
def predictions_confirmed():
return render_template('fig_c.html')
# @app.route('/predictions_deaths')
# def p... |
safe_shell_exec.py | # Copyright 2019 Uber Technologies, 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 applica... |
allocation_profiler_test.py |
import time
import unittest
import random
import threading
import stackimpact
from stackimpact.runtime import min_version, runtime_info
class AllocationProfilerTestCase(unittest.TestCase):
def test_record_allocation_profile(self):
if runtime_info.OS_WIN or not min_version(3, 4):
return
... |
combined.py | """\
This is a combination of a publisher and subscriber, modeling handling ML workload on the endpoint itself.
"""
import PIL.Image as Image
import tflite_runtime.interpreter as tflite
import numpy as np
import os
import time
import multiprocessing
CPU_THREADS = int(os.environ["CPU_THREADS"])
FREQUENCY = int(os.env... |
app.py | from wsgiref.simple_server import make_server
import sys
import functools
from avalon.vendor.bottle import route, template, run, WSGIRefServer
from avalon import photoshop
from threading import Thread
self = sys.modules[__name__]
self.app = None
@route("/")
def index():
"""The entry point when accessing 'http:/... |
server.py | import socket
from _thread import *
import threading
import os
import time
import sys
import colorama
from colorama import Fore, Back, Style, init
init()
HOST = '' # github : lubnc4261
PORT = 33000
BUFFER_SIZE = 1024
ADDR = (HOST, PORT)
CLIENTS = {}
ADDRESSES = {}
BANNER ='''
... |
pilot.py | from threading import Condition, Lock, Thread
import numpy as np
class Pilot:
def __init__(self, pathFinderInterface, simulator):
self._lock = Condition(Lock())
self._simulator = simulator
self._previousPosition = None
self._params = None
self._vehicle = None
self.... |
tcp_sender.py | # Copyright 2020 Unity Technologies
#
# 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... |
telemetry_dashboard.py | from IPython.core.display import HTML
from IPython.display import display, Image
import ipywidgets as widgets
import subprocess
import threading
import time
import os
from .query_nodes import getFreeJobSlots
loader = '''<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">... |
server.py | """Basic http server for tests to simulate PyPI or custom indexes
"""
import os
import time
import threading
from setuptools.extern.six.moves import BaseHTTPServer, SimpleHTTPServer
from setuptools.extern.six.moves.urllib_parse import urljoin
from setuptools.extern.six.moves.urllib.request import pathname2url
class... |
test_ibmq_job.py | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... |
analysis.py | """
NEW ANALYSIS SETUP:
* Initialize with an Init() function
* One function to update the FEN that is being analyzed
* One function for any importer to obtain the current analysis of the position
* Close everything with Close()
The above is the ONLY outside interaction that impo... |
api.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... |
main.py | # -*- coding: utf-8 -*-
from __future__ import print_function
import multiprocessing
import os
import datetime
import zipfile
import tempfile
import logging
import os.path
import sys
import io
import time
EDGAR_PREFIX = "https://www.sec.gov/Archives/"
SEP = "|"
IS_PY3 = sys.version_info[0] >= 3
MAX_NO_OF_CALLS_PER_PER... |
_9.19.py | #!/usr/bin/python3
import socket
import threading
def date_analysis(conn,add):
a = "3"
date = conn.recv(2024)
conn.send(a.encode("utf-8"))
conn.close()
def monitor():
sk = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
ip = "127.0.0.1"
port = 9999
sk.bind((ip,port))
sk.listen(... |
test_utils.py | # Copyright 2018 The TensorFlow Hub 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... |
button.py | #
# Copyright (c) 2014, Scott Silver Labs, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
__init__.py | # coding=utf-8
from __future__ import absolute_import
import threading
import time
from base64 import b64decode
from datetime import timedelta, datetime
import humanfriendly
import octoprint.plugin
import octoprint.settings
import os
import requests
import socket
import subprocess
import logging
from PIL import Image... |
xla_client_test.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
util.py | #
# Copyright (C) 2012-2013 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import codecs
from collections import deque
import contextlib
import csv
from glob import iglob as std_iglob
import io
import json
import logging
import os
import py_compile
import re
import shutil
import socket
import... |
pvctrls.py | import sys
import time
import traceback
import threading
import socket
import struct
from p4p.nt import NTScalar
from p4p.server.thread import SharedPV
from psdaq.pyxpm.pvseq import *
from psdaq.pyxpm.pvhandler import *
# db support
from psdaq.configdb.typed_json import cdict
import psdaq.configdb.configdb as cdb
from ... |
RtaExtractor.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This script:
1 - starts dcm4che to receive images from remote PACS.
2 - reads txt files containing feature list to identify research profiles consisting of the interesting attributes.
3 - grabs one instance per series and extract the metadata for the identi... |
test_SkLearnComparison.py | import warnings
from sklearn.exceptions import ConvergenceWarning
warnings.filterwarnings("ignore", category=ConvergenceWarning)
import numpy as np
from scipy.sparse import csr_matrix
import array as ar
from multiprocessing import Process
import time
from datetime import datetime
from sklearn.model_selection import... |
exalemao.py | import sys
import threading
from random import choice
from time import sleep
from g_python.gextension import Extension
from g_python.hdirection import Direction
from g_python.htools import RoomFurni
from PyQt5.QtWidgets import QApplication, QMainWindow, QMessageBox
from exalemao_gui import Ui_Exalemao
class Exalema... |
vpp_transport_socket.py | #
# VPP Unix Domain Socket Transport.
#
import socket
import struct
import threading
import select
import multiprocessing
try:
import queue as queue
except ImportError:
import Queue as queue
import logging
from . import vpp_papi
class VppTransportSocketIOError(IOError):
# TODO: Document different values o... |
test.py | #!/usr/bin/python3
import threading
import unittest
import logging
import time
import os
from dexbot.worker import WorkerInfrastructure
from bitshares.bitshares import BitShares
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s %(levelname)s %(message)s'
)
TEST_CONFIG = {
'node': 'wss://node... |
util.py | import math
import cv2
import tensorflow as tf
import os
import sys
'''
output states:
0: has rewards?
1: stopped?
2: num steps
3:
'''
STATE_REWARD_DIM = 0
STATE_STOPPED_DIM = 1
STATE_STEP_DIM = 2
STATE_DROPOUT_BEGIN = 3
def get_expert_file_path(expert):
expert_path = 'data/artists/fk_%s/' % exper... |
realsense_server_websocket.py | import asyncio
import json
from threading import Lock, Thread
from time import time
import numpy as np
import pyrealsense2 as rs
import websockets
# Declare pointcloud object, for calculating pointclouds and texture mappings
pc = rs.pointcloud()
# Keeping the depth frames in a global variable
last_pointcloud_points ... |
test_urllib.py | """Regresssion tests for urllib"""
import urllib
import httplib
import unittest
import os
import sys
import mimetools
import tempfile
import StringIO
from test import test_support
from base64 import b64encode
def hexescape(char):
"""Escape char as RFC 2396 specifies"""
hex_repr = hex(ord(ch... |
connmanager.py | import threading
import xmlrpclib
import select
import bsddb3
from SimpleXMLRPCServer import SimpleXMLRPCServer
from ConfigParser import ConfigParser
import cPickle
import subprocess
from common import *
from callbacks import Tag, ICallbackAcceptor
class ClientInfo(Unpickable(taglist=set,
... |
drawdown.py |
import Tkinter as tk
from Tkinter import *
import tkFileDialog
import numpy as np
width_end = 22 # pixel width of each rectangle in drawup
width_pick = 20 # pixel height of each rectange in drawup
class VerticalScrolledFrame(Frame):
"""A pure Tkinter scrollable frame that actually works!
* Use the 'in... |
foxy_qtl_pipeline.py | #/usr/bin/python
# import librariers
import sys
from optparse import OptionParser
import os.path
import subprocess
import re
import multiprocessing as mp
import glob
# Define variables used in the program
version = "1.10" # Version of the pipeline
pwd = os.getcwd()
# Get arguments
parser = OptionParser()
parser.add... |
prediction_service.py | from xbos import get_client
import threading
from bw2python import ponames
from bw2python.bwtypes import PayloadObject
from dateutil.parser import parse
import time
import msgpack
import config
from util import get_today
import datetime
def run_service(prediction_fxn, namespace, prediction_type, block=False):
"""... |
bot.py | # -*- coding: utf-8 -*-
import LineAlpha
from LineAlpha.lib.curve.ttypes import *
from datetime import datetime
from imgurpython import ImgurClient
import time,random,sys,json,codecs,threading,glob,os,subprocess,multiprocessing
cl = LineAlpha.LINE()
cl.login(token="Erg4Xv7UiJxBp7DZtjJ2.AZs3a8Vf+ipnhLTOmQbtuG.MUASow5sT... |
onnxruntime_test_python.py | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# -*- coding: UTF-8 -*-
import unittest
import os
import numpy as np
import onnxruntime as onnxrt
import threading
import sys
from helper import get_name
from onnxruntime.capi.onnxruntime_pybind11_state import Fail
class Te... |
agent_runner.py | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
recorder.py | #
# BSD LICENSE
#
# Copyright (c) Crane Chu <cranechu@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# ... |
test_delivery_herald.py | # Copyright (c) 2020 Seagate Technology LLC and/or its Affiliates
#
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.