source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
btcproxy.py | """ A zcored proxy that allows instrumentation and canned responses
"""
from flask import Flask, request
from zcore.rpc import JSONRPCError
from zcore.rpc import RawProxy as ZCoreProxy
from cheroot.wsgi import Server
from cheroot.wsgi import PathInfoDispatcher
import decimal
import flask
import json
import logging
imp... |
sublimegdb.py | """
Copyright (c) 2012 Fredrik Ehnbom
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, ... |
rocket.py | # -*- coding: utf-8 -*-
# This file is part of the Rocket Web Server
# Copyright (c) 2011 Timothy Farrell
# Import System Modules
import sys
import errno
import socket
import logging
import platform
# Define Constants
VERSION = '1.2.3'
SERVER_NAME = socket.gethostname()
SERVER_SOFTWARE = 'Rocket %s' % VERSION
HTTP_S... |
client.py | import socket
import threading
conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server = '127.0.0.1', 8001
conn.connect(server)
username = input('Choose your username: ')
def recv_msg():
while True:
msg = conn.recv(2000).decode()
if msg == 'username':
conn.sen... |
screenshoter.py | # -*- coding: utf-8 -*-
from datetime import datetime
import logging
from multiprocessing import Process
import os
import time
from PIL import ImageGrab
import wx
from loghandlers import NotificationHandler
sh_logger = logging.getLogger('Screenshot')
sh_logger.setLevel(logging.INFO)
sh_logger.addHandler(Notificatio... |
qt_root.py | import os
import pathlib
import sys
from PyQt5.QtCore import QTimer
from PyQt5 import QtCore, QtGui
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QFileDialog, QMainWindow, QApplication, QWidget, QComboBox, QLineEdit, QRadioButton, QSlider, QCheckBox, QMessageBox
import threading
import configparser
from rl... |
test_realtime.py | import json
import re
import threading
from src.kshalopy import AppCredentials, Config, RealtimeClient
from src.kshalopy.models.models import Device
config = Config(
host="fake.execute-api.us-east-1.amazonaws.fake",
port=443,
use_ssl=True,
region="us-east-1",
user_pool_id="fake_user_pool_id",
... |
task.py | import gym
import sys
import numpy as np
import os.path as osp
import multiprocessing as mp
import sys
import torch
from IPython import embed
class BasicTask:
def __init__(self, max_steps=sys.maxsize):
self.steps = 0
self.max_steps = max_steps
def reset(self, *args):
self.steps = 0
state = self.... |
client.py | import socket
import threading
import tkinter
import tkinter.scrolledtext
from tkinter import simpledialog
HOST = "127.0.0.1"
PORT = 9090
class Client:
def __init__(self, host, port):
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.connect((host, port))
msg = tki... |
history.py | # Copyright 2021 HTCondor Team, Computer Sciences Department,
# University of Wisconsin-Madison, WI.
#
# 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/LICE... |
test_hnsw.py | import numpy
import sys
import nmslib
import time
import math
from multiprocessing import Process
from xclib.data import data_utils
def write_knn_out(out_dir,write_dist,num_inst,nbrs,batch_no,metric_space):
with open('%s/%d'%(out_dir,batch_no),'w') as fp:
fp.write('%d %d\n'%(len(nbrs),num_inst))
if write_dist == ... |
worker.py | # PyAlgoTrade
#
# Copyright 2011-2014 Gabriel Martin Becedillas Ruiz
#
# 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 ap... |
create_digest_list.py | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
import os
import sys
import time
from os.path import join, getsize
import argparse
import hashlib
from multiprocessing import Process, Value, Queue, Lock, cpu_count
import multiprocessing
from ctypes import c_wchar_p
import traceback
import PythonColorConsole.color_con... |
PyPotter.py | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHET... |
map_dataset_op_test.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
PlatformManagerDarwin.py | """ Platform-specific code for Darwin is encapsulated in this module. """
import os
import re
import tempfile
import threading
import subprocess
try:
import Tkinter as tk
import Queue as queue
except ImportError:
import tkinter as tk
import queue
import numpy
import AppKit
import Quartz
from PIL impor... |
TestCollectors.py | import sys
sys.path.append('.')
from unittest.mock import MagicMock
from threading import Thread
from exporter import run_prometheus_server
from tools.helper import yaml_read
from tools.Vrops import Vrops
from InventoryBuilder import InventoryBuilder
from BaseCollector import BaseCollector
from resources.Resourceskind... |
autoreload.py | import functools
import itertools
import logging
import os
import signal
import subprocess
import sys
import threading
import time
import traceback
import weakref
from collections import defaultdict
from pathlib import Path
from types import ModuleType
from zipimport import zipimporter
from django.conf import settings
... |
service.py | import base64
import glob
import itertools
import json
import multiprocessing
import os
import re
import ssl
import socket
import subprocess
import tarfile
import textwrap
import tempfile
import threading
import traceback
import urllib.parse as urlparse
import zipfile
from typing import List, Dict
from enum import En... |
serialtube.py | from .. import log, term
from ..context import context
from . import tube
import serial, time, threading, sys
class serialtube(tube.tube):
def __init__(
self, port = '/dev/ttyUSB0', baudrate = 115200,
convert_newlines = True,
bytesize = 8, parity='N', stopbits=1, xonxoff = False... |
tumblr-crawler.py | # coding:utf-8
"""
Created by tzw0745 at 18-9-28
"""
# region import
import json
import os
import re
import shutil
import time
from datetime import datetime
from threading import Thread
import requests
from lxml import etree, html
try:
# Python3 import
from urllib.parse import urlsplit
from queue import Q... |
UsePytdxImportToH5Thread.py | # coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2010-2017 fasiondog/hikyuu
#
# 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 r... |
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_'.
from __future__ import with_statement
import os
import pickle
import random
import subprocess
import sys
import time
import unittest
from test import support
try:
imp... |
writer.py | import os
import threading
import queue
import imageio
class ImageWriter:
__instance = None
def __new__(cls, *args, **kwargs):
if cls.__instance is None:
ImageWriter.__instance = super().__new__(cls)
return cls.__instance
def __init__(self, max_num_threads=1, max_queue_size=64... |
http_server.py | # -*- coding: utf-8 -*-
import socket
from multiprocessing import Process,current_process,Queue
import sys,time
def log (Qlog):
print(current_process().name)
while True:
if Qlog.qsize()>0:
queueData=Qlog.get()
if queueData[0]=="ACCESS":
... |
daemon.py | # Copyright 2015 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 agr... |
view_image_tests.py | '''
Script for viewing image test results.
'''
import sys
import time
import datetime
import threading
import re
import json
import argparse
import webbrowser
from pathlib import Path
import libs.bottle as bottle
from libs.bottle import route, view, request, run, template, static_file
from core import Environment, c... |
run_fetcher.py | # encoding: utf-8
"""
定时运行爬取器
"""
import sys
import threading
from queue import Queue
import logging
import time
from db import conn
from fetchers import fetchers
from config import PROC_FETCHER_SLEEP
logging.basicConfig(stream=sys.stdout, format="%(asctime)s-%(levelname)s:%(name)s:%(message)s", level='INFO')
def ma... |
wsdump.py | #!/home/r68bux/betaupdate_bot/venv/bin/python3
import argparse
import code
import sys
import threading
import time
import six
from six.moves.urllib.parse import urlparse
import websocket
try:
import readline
except ImportError:
pass
def get_encoding():
encoding = getattr(sys.stdin, "encoding", "")
... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import asyncio
from typing import TYPE_CHECKING, Optional, Union, Callable, Sequence
from electrum.storage import WalletStorage, StorageReadWriteError
from electrum.wallet_db import WalletDB
from el... |
server.py | from pymol import cmd, util
from threading import Thread
from xmlrpc.server import SimpleXMLRPCServer
import pickle
import os
import re
import string
def start_pymol_server():
print(
"========================= Loading PyMOL XML-RPC extensions =============================")
server = pymol_interface()
pr... |
main.py | import os
import sys
import json
import codecs
import shutil
import time
from datetime import datetime, date
import multiprocessing
import threading
if getattr(sys, 'frozen', False):
if sys.platform == "darwin":
rootdir = os.getcwd()
else:
rootdir = os.path.dirname(sys.executable)
else:
roo... |
kernel-generator.py | #!/usr/bin/env python3
"""rocFFT kernel generator.
It accept two sub-commands:
1. list - lists files that will be generated
2. generate - generate them!
"""
import argparse
import collections
import functools
import itertools
import subprocess
import sys
import os
from copy import deepcopy
from pathlib import Path
... |
test_closing.py | from fixtures import * # noqa: F401,F403
from flaky import flaky
from pyln.client import RpcError
from shutil import copyfile
from utils import (
only_one, sync_blockheight, wait_for, DEVELOPER, TIMEOUT, VALGRIND,
SLOW_MACHINE, account_balance, first_channel_id
)
import os
import queue
import pytest
import re... |
rts2.bak.py |
from Tkinter import *
import tkMessageBox
from PIL import Image, ImageTk
import socket, threading, sys, traceback, os
from RtpPacket import RtpPacket
CACHE_FILE_NAME = "cache-"
CACHE_FILE_EXT = ".jpg"
class Client:
INIT = 0
READY = 1
PLAYING = 2
state = INIT
SETUP = 0
PLAY = 1
PAUSE = 2
TEARDOWN =... |
stream_queue.py | """
MIT License
Copyright (C) 2021 ROCKY4546
https://github.com/rocky4546
This file is part of Cabernet
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 lim... |
url2kindle.py | import argparse
import configparser
import hashlib
import logging
import logging.config
import multiprocessing
import os
import pathlib
import re
import sys
import time
import requests
__VERSION__ = "0.7"
DEBUG = os.getenv("U2K_DEBUG")
CONFIG_FILE = os.path.join(
os.getenv("XDG_CONFIG_HOME", os.path.join(os.pat... |
build_tfrecords.py | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
main.py | from vk import VK
from telegram_bot import Telegram
from parser_bot import ParserAniDubLife, ParserAnimedubRu
import asyncio
vkObj = VK('', '')
telegramObj = Telegram('')
parserObj_AnimedubRu = ParserAnimedubRu()
parserObj_AnimedubLife = ParserAniDubLife()
def messages_VK():
"""Принимает и отправляет сообщения... |
gitfs.py | # -*- coding: utf-8 -*-
'''
Base classes for gitfs/git_pillar integration tests
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import sys
import copy
import errno
import logging
import os
import pprint
import shutil
import tempfile
import textwrap
import threading
imp... |
energy_profiling.py | import os
from threading import Thread
import time
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
import torch.utils.data as Data
import numpy as np
from multiprocessing import Process
from numpy import *
import torch.multiprocessing as... |
transfer.py | #!/usr/bin/env python
#
# Copyright 2015 Google 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 o... |
runner.py | #!/usr/bin/env python2
# This Python file uses the following encoding: utf-8
'''
Simple test runner.
'''
# XXX Use EM_ALL_ENGINES=1 in the env to test all engines!
from __future__ import print_function
from subprocess import Popen, PIPE, STDOUT
import os, unittest, tempfile, shutil, time, inspect, sys, math, glob, ... |
rulebot_server.py | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import copy
from pprint import pprint
from queue import PriorityQueue
from threading import Thread
from convlab.modules.nlu.multiwoz.mlst.nlu import MlstNLU
from flask import Flask, request, jsonify
from convlab import RuleBasedMulti... |
server.py | from http.server import HTTPServer, SimpleHTTPRequestHandler
from threading import Thread
class Handler(SimpleHTTPRequestHandler):
def log_request(code="-", size="-"):
pass
class Server:
def __init__(self, port):
server_address = ('', port)
self.httpd = HTTPServer(server_address, Handler)
def run(s... |
transaction.py | #!/usr/bin/env python3
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# 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 withou... |
simple_scheduler.py | # Copyright (c) 2016, Daniele Venzano
#
# 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 w... |
subproc_vec_env.py | # coding=utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from multiprocessing import Process, Pipe
from third_party.baselines.common.vec_env import VecEnv, CloudpickleWrapper
from third_party.baselines.common.tile_images import tile... |
test_v2_0_0_image.py | import json
import unittest
from multiprocessing import Process
import requests
from dateutil.parser import parse
from .fixtures import APITestCase
class ImageTestCase(APITestCase):
def test_list(self):
r = requests.get(self.podman_url + "/v1.40/images/json")
self.assertEqual(r.status_code, 200, ... |
imageMaker.py | from PIL import Image, ImageDraw, ImageFont
import os
import time
import threading
def makeImage(photoWidth, photoHeight, Background, Text):
# make background
img = Image.new('RGB', (photoWidth, photoHeight), color = (Background["color"][0], Background["color"][1], Background["color"][2]))
# select font
... |
framework.py | #!/usr/bin/env python
from __future__ import print_function
import gc
import sys
import os
import select
import unittest
import tempfile
import time
import faulthandler
import random
import copy
import psutil
import platform
from collections import deque
from threading import Thread, Event
from inspect import getdoc, ... |
Main_Program_v8.py | '''
Main Program v8
--- Features:
- Support for reading GPS position values through LCM
- Support for reading GPS command values through LCM
- Support for Mode change
- Support for infrared lane following - Transfered to uno
- Support for Odometry.
- Serial interface with the Arduino has been disabled
- Fuse ... |
SoftwareUserStatus.py | import sublime
import webbrowser
import urllib
import re, uuid
from .SoftwareUtil import *
from .SoftwareFileDataManager import *
from .SoftwareHttp import *
from .SoftwareSettings import *
from .CommonUtil import *
from .SoftwareSessionApp import *
from .SlackHttp import *
from .Logger import *
try:
#python2
f... |
coref_model.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import operator
import random
import math
import json
import threading
import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
import h5py
import util
import coref_ops
import conll
im... |
HiwinRA605_socket_ros_test_20190625185456.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 HiwinRA605_s... |
dask.py | # pylint: disable=wrong-import-position,wrong-import-order,import-error
"""Dask extensions for distributed training. See xgboost/demo/dask for examples."""
import os
import sys
import math
import platform
import logging
from threading import Thread
from . import rabit
from .core import DMatrix
from .compat im... |
SublimeLinter.py | from functools import partial
import os
import re
import sys
import time
import threading
import sublime
import sublime_plugin
from sublimelinter.loader import Loader
from sublimelinter.modules.base_linter import INPUT_METHOD_FILE
LINTERS = {} # mapping of language name to linter module
QUEUE = {} # views ... |
test_ssl.py | # Test the support for SSL and sockets
import sys
import unittest
from test import test_support
import asyncore
import socket
import select
import time
import gc
import os
import errno
import pprint
import urllib, urlparse
import traceback
import weakref
import functools
import platform
from BaseHTTPServer import HTT... |
session.py | from __future__ import absolute_import
import logging
import os
import shutil
import subprocess
import sys
import threading
import time
import typing
from typing import Any, Optional
import shamiko
import shamiko.gdb_rpc
if typing.TYPE_CHECKING:
import shamiko.simple_rpc.client
_logger = logging.getLogger(__nam... |
task_queue.py | # Copyright (C) The Arvados Authors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
from future import standard_library
standard_library.install_aliases()
from builtins import range
from builtins import object
import queue
import threading
import logging
logger = logging.getLogger('arvados.cwl-runner')... |
example_stream_signal.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: example_stream_signal.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api
# Documentation: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api
# PyPI: https://pyp... |
dockerTest.py | # Copyright (C) 2015-2018 Regents of the University of California
#
# 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... |
windows.py | from ...third_party import WebsocketServer # type: ignore
from .configurations import ConfigManager
from .configurations import WindowConfigManager
from .diagnostics import ensure_diagnostics_panel
from .logging import debug
from .logging import exception_log
from .message_request_handler import MessageRequestHandler
... |
caching_test.py | # -*- coding: utf-8 -*-
# Copyright 2018-2019 Streamlit 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 applicabl... |
skeleton_QT5.py | import sys
from PyQt5.QtWidgets import QMainWindow, QApplication, QPushButton, QFileDialog
from PyQt5.QtGui import QIcon
from PyQt5.uic import loadUi
from PyQt5.QtCore import pyqtSlot
from test import Ui_MainWindow
from QT5_function import openFileNameDialog
import os
import threading
import time
from sklearn... |
start.py | #!/usr/bin/python3
import jinja2
import os
import socket
import glob
import shutil
import tenacity
import multiprocessing
from tenacity import retry
from podop import run_server
def start_podop():
os.setuid(100)
run_server(3 if "DEBUG" in os.environ else 0, "postfix", "/tmp/podop.socket", [
("transport", ... |
test_fetcher.py | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import hashlib
import http.server
import os
import socketserver
import unittest
import unittest.mock
from contextlib import closing, contextmanager
from functools import reduce
from io imp... |
arbiter.py | # =============================================================================
# periscope-ps (blipp)
#
# Copyright (c) 2013-2016, Trustees of Indiana University,
# All rights reserved.
#
# This software may be modified and distributed under the terms of the BSD
# license. See the COPYING file for details.
#
# ... |
qr_upload.py | import os
import sys
import fileinput
import hashlib
from PIL import Image, ImageDraw
from ftplib import FTP
import qrcode
import requests
import json
import base64
from pibooth.utils import LOGGER
import threading
from pibooth import fonts
import zlib
import datetime
def generate_qr_code(data,filepath, inverted = F... |
SCARA_Main.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
RASPBERRY-SCARA-ROBOT-PYTHON
ScaraRobot class
'''
import math
from time import sleep
import threading
from BufferInterface import BufferInterface
class ScaraRobot:
def __init__(self):
'''Initialize robot'''
# Robot configuration
self.a = ... |
test_thread.py | """TestCases for multi-threaded access to a DB.
"""
import os
import sys
import time
import errno
import shutil
import tempfile
from pprint import pprint
from whrandom import random
try:
True, False
except NameError:
True = 1
False = 0
DASH = '-'
try:
from threading import Thread, currentThread
... |
get_yahoo_data.py | '''
This code is to obtain key statistics given stock tickers using yahoofinancials.
The result is a pd.DataFrame with key statistics.
'''
import numpy as np
import pandas as pd
import threading
from pprint import pprint
import time
from yahoofinancials import YahooFinancials
from common import join_thre... |
system_profiler.py | # Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0
"""Profiler to record system level metrics."""
from __future__ import annotations
import threading
import time
from typing import TYPE_CHECKING, Dict, cast
import psutil
from composer.core.callback import Callback
if TYPE_CHECKING:
... |
local_planner.py | #!/usr/bin/env python
#coding:utf-8
import rospy
import tf
from nav_msgs.msg import Path
from geometry_msgs.msg import PoseStamped,Twist
from std_msgs.msg import Header
from threading import Lock,Thread
import numpy as np
import math
import time
class LocalPlanner(object):# the object Base is necessary
tracking_th... |
master_discovery.py | # Software License Agreement (BSD License)
#
# Copyright (c) 2012, Fraunhofer FKIE/US, Alexander Tiderko
# 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 mus... |
test_base.py | import asyncio
import fcntl
import logging
import os
import sys
import threading
import time
import uvloop
import unittest
import weakref
from unittest import mock
from uvloop._testbase import UVTestCase, AIOTestCase
class _TestBase:
def test_close(self):
self.assertFalse(self.loop._closed)
self... |
test_comms.py | import asyncio
import os
import sys
import threading
import types
import warnings
from functools import partial
import distributed
import pkg_resources
import pytest
from distributed.comm import (
CommClosedError,
connect,
get_address_host,
get_local_address_for,
inproc,
listen,
parse_addre... |
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... |
_flaskserver.py | """
Serve web page and handle web sockets using Flask.
"""
# Improvements to be done in the future:
# 1) Code from MainHandler, AppHandler and WSHandler should be moved in
# _serverHandlers.py. Only RequestHandler and MyWebSocketHandler
# 2) manager should be overloadable from _flaskserver.py to allow MainHandler,
... |
network.py |
# Wampum - Lightweight Bitcoin Client
# Copyright (c) 2011-2016 Thomas Voegtlin
#
# 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 righ... |
labview_mqtt.py |
from mqttClient import mqttClientDemo
from urllib.parse import urlparse
import json
from time import sleep
import threading
from guiDemo import run_demo_gui
command_topic = r'system/target'
state_topic = r'system/state'
# LabVIEW cannot call directly a class method, so calls must be abstracted in a module (.py)
'Us... |
SublimeCodeIntel.py | # -*- coding: utf-8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (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.moz... |
monitor.py | # From https://code.google.com/p/modwsgi/wiki/ReloadingSourceCode
import os
import sys
import time
import signal
import threading
import atexit
import Queue
_interval = 1.0
_times = {}
_files = []
_running = False
_queue = Queue.Queue()
_lock = threading.Lock()
def _restart(path):
_queue.put(True)
prefix = '... |
option_picker.py | import math
import traceback
from tkinter import *
from multiprocessing import Queue
from tkinter.colorchooser import askcolor
import json
import re
import tkinter.ttk
import pygame.sysfont
from options import Options
import urllib.request, urllib.error, urllib.parse
import webbrowser
import platform
import threading
i... |
FFmpegPipeline.py | '''
* Copyright (C) 2019 Intel Corporation.
*
* SPDX-License-Identifier: BSD-3-Clause
'''
from modules.Pipeline import Pipeline # pylint: disable=import-error
from modules.PipelineManager import PipelineManager # pylint: disable=import-error
from modules.ModelManager import ModelManager # pylint: disable=import-err... |
swiftlm_check.py | # (c) Copyright 2015,2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE 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.... |
executor.py | # Copyright 2019 The Meson development team
# 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 ... |
m1013x2_sync.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ##
# @brief [py demo] muliti robot sync test
# @author Kab Kyoum Kim (kabkyoum.kim@doosan.com)
import rospy
import os
import threading, time
import sys
sys.dont_write_bytecode = True
sys.path.append( os.path.abspath(os.path.join(os.path.dirname(__file__),"../../... |
imageScraper.py | # Name: Anju Ito
import requests, time, os
import bs4 as bs
from PIL import Image
from io import BytesIO
import threading
from queue import Queue
from selenium.webdriver.common.keys import Keys
from selenium.webdriver import Chrome
# Inputs keyword that you want to look up, and returns list of sample images
# contai... |
main.py | from __future__ import print_function
import argparse
import os
import sys
import torch
import torch.optim as optim
import torch.multiprocessing as mp
import torch.nn as nn
import torch.nn.functional as F
from envs import create_atari_env
from model import ActorCritic
from train import train
from test import test
imp... |
Scheduler.py | #!/bin/env python3
'''
'''
# 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 ... |
rc_driver.py |
import sys
import threading
import socketserver
import numpy as np
from model import NeuralNetwork
from rc_driver_helper import *
# distance data measured by ultrasonic sensor
sensor_data = None
class SensorDataHandler(socketserver.BaseRequestHandler):
data = " "
def handle(self):
global sensor_... |
5pro.py | # -*- coding: utf-8 -*-
import KRIS
from KRIS.lib.curve.ttypes import *
from datetime import datetime
import time, random, sys, ast, re, os, io, json, subprocess, threading, string, codecs, requests, ctypes, urllib, urllib2, urllib3, wikipedia, tempfile
from bs4 import BeautifulSoup
from urllib import urlopen
import r... |
slave_station.py | # encoding=utf-8
import socket # 引入套接字
import threading # 引入并行
import numpy as np
import pymysql
import struct
import serial
import matplotlib.pyplot as plt
import datetime
import math
import sys
import time
sys.path.append(r'D:\OneDrive\Python_project\Github\AntiUAV_Python\Python')
# from DBInfo import *
plt.ion... |
add_random_user_ali.py | #!/usr/bin/python
#coding=utf-8
import os
import sys
import MySQLdb
from DBUtils.PooledDB import PooledDB
import hashlib
import time
import random
import threading
import logging
from multiprocessing.pool import ThreadPool
from Queue import Queue
try:
pid = os.fork()
if pid > 0:
sy... |
client.py | from simulate_stream_event import eventlog, config
from simulate_stream_event.client_logging import ClientLogging
from simulate_stream_event.exception import ReadFileException, ConnectionException, ServerRequestException, ThreadException
from simulate_stream_event.eventthread import ok, alertM, alertT
from multiprocess... |
test_server.py | """Tests for the HTTP server."""
# -*- coding: utf-8 -*-
# vim: set fileencoding=utf-8 :
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import os
import socket
import tempfile
import threading
import uuid
import pytest
import requests
import requests_unixsocket
import six
from... |
index.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import hashlib
import logging
import os
import shutil
import subprocess
import tempfile
try:
from threading import Thread
except ImportEr... |
test_c10d_nccl.py | import copy
import math
import os
import random
import signal
import sys
import tempfile
import threading
import time
import unittest
from contextlib import contextmanager
from datetime import timedelta
from itertools import product
from unittest import mock
import torch
import torch.distributed as c10d
if not c10d.i... |
test_state.py | import glob
import logging
import os
import shutil
import threading
import time
import pytest
from saltfactories.utils.tempfiles import temp_file
from tests.support.case import SSHCase
from tests.support.runtests import RUNTIME_VARS
SSH_SLS = "ssh_state_tests"
SSH_SLS_FILE = "/tmp/salt_test_file"
log = logging.getLo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.