source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
posevr.py | # external modules
from cv2 import VideoCapture, VideoWriter, VideoWriter_fourcc, FONT_HERSHEY_SIMPLEX, flip, transpose, cvtColor, COLOR_RGB2BGR
import time
import mediapipe as mp
import win32pipe
import win32file
import pywintypes
import os
import sys
from threading import Thread
from tkinter import Tk, Frame, Label, ... |
_threading_local.py | """Thread-local objects.
(Note that this module provides a Python version of the threading.local
class. Depending on the version of Python you're using, there may be a
faster one available. You should always import the `local` class from
`threading`.)
Thread-local objects support the management of thread-local d... |
vehicle_detection_node_test.py | #!/usr/bin/env python
from cv_bridge import CvBridge, CvBridgeError
from duckietown_msgs.msg import VehicleCorners
from geometry_msgs.msg import Point32
from sensor_msgs.msg import CompressedImage, Image
import cv2
import io
import numpy as np
import rospy
import threading
class VehicleDetectionTestNode(object):
def ... |
display.py | import curses
import glob
import importlib
import threading
from typing import List
import subprocess
from os.path import dirname, basename, isfile
import castero
from castero import helpers
from castero.config import Config
from castero.database import Database
from castero.downloadqueue import DownloadQueue
from cas... |
variable_scope.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... |
__init__.py | """
objectstore package, abstraction for storing blobs of data for use in Galaxy.
all providers ensure that data can be accessed on the filesystem for running
tools
"""
import logging
import os
import random
import shutil
import threading
import time
from xml.etree import ElementTree
import yaml
try:
from sqlalc... |
test_proxy.py | ########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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... |
tasks.py | from __future__ import absolute_import
import json
import logging
from datetime import datetime
from threading import Thread
from tornado import web
from tornado import gen
from tornado.escape import json_decode
from tornado.web import HTTPError
from celery import states
from celery.result import AsyncResult
from c... |
texpack.py | #!/bin/env python
# -*- encoding: utf-8 -*-
################################################################################
## TexPack - Free and open-source TexturePacker alternative
## Copyright (c) 2015 criptych
##
## Released under the MIT License. See LICENSE file for terms.
##
## Disclaimer: This tool was not ... |
test_urllib.py | """Regression tests for what was in Python 2's "urllib" module"""
import urllib.parse
import urllib.request
import urllib.error
import http.client
import email.message
import io
import unittest
from unittest.mock import patch
from test import support
import os
try:
import ssl
except ImportError:
... |
train_graph.py | import argparse
from others.logging import *
import random
from pytorch_transformers import BertTokenizer
from model_graph.generator import AbsSummarizer
from model_graph.split_generator import splitAbsSummarizer
from model_graph.copyAfterGen import SentCopySummarizer
from model_graph.classsifyGenerator import classsif... |
Hasher.py | from threading import Thread
from cryptography.hazmat.backends import default_backend
from cryptography.fernet import Fernet
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
from base64 import urlsafe_b64encode
from os.path import expanduser, join, exist... |
multi_thread_processor.py | '''A processor which will run the executors in parallel'''
import threading
try:
from Queue import Queue, Empty
except ImportError:
from queue import Queue, Empty
from paradag.error import VertexExecutionError
def _dag_execution(dag_queue, vertex, execute_func, param):
'''Thread function for parallel e... |
multibrowser.py | from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.... |
views.py | from django.core.exceptions import ObjectDoesNotExist
from django.shortcuts import render, get_object_or_404
from rest_framework import viewsets, exceptions, status
from rest_framework.response import Response
from laice.utils import spacy_ner
from laice.core.viewsets import ViewMappingMixin
from stories.models import... |
img_arranger.py | import os
import sys
from threading import Thread
from glob import glob
def move_pics(file_list, directory):
for file in file_list:
name = os.path.basename(file)
destination = os.path.join(directory, name)
file = os.path.abspath(file)
os.rename(file, destination)
print(f"Moved ... |
default.py | """ Default Runner & Worker components
Local Runner
Memmap Interface (numpy)
Template Preprocessor
JSON Postprocessor
NumpytxtPostprocessor
HDF5Postprocessor
"""
from .runner import Runner, RunnerInterface
from .worker import Interface, Preprocessor, Postprocessor, Worker
import subprocess
from multiprocessing impor... |
friends_frame.py | # coding=utf-8
"""好友列表窗口"""
import json
import threading
import sys
import wx.lib.scrolledpanel as scrolled
from com.qq.client.chat_frame import ChatFrame
from com.qq.client.my_frame import *
class FriendsFrame(MyFrame):
def __init__(self, user):
super().__init__(title='我的好友', size=(26... |
test_normalization.py | # MIT License
#
# Copyright (c) 2020 Airbyte
#
# 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, modify, merge, publ... |
twitter+gui_backup_nov8.py | #Titter + gui
from Tkinter import *
from time import sleep
import os
import tweepy
import requests
import json
from pydora import player
from pandora import clientbuilder
import sys
import termios
import getpass
import subprocess
import time
#import for gui
import Tkinter
import tkMessageBox
#import for processes us... |
overdrive.py | import struct
import threading
import queue
import logging
import bluepy.btle as btle
class Overdrive:
def __init__(self, addr):
"""Initiate an Anki Overdrive connection object,
and call connect() function.
Parameters:
addr -- Bluetooth MAC address for desired Anki Overdrive car.
... |
common.py | from ..common import * # NOQA
import inspect
import json
import os
import random
import subprocess
import ssl
import time
import requests
import ast
import paramiko
import rancher
import pytest
from urllib.parse import urlparse
from rancher import ApiError
from lib.aws import AmazonWebServices
from copy import deepcop... |
channeltest.py | # Copyright (C) 2019-2020 The Xaya developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Integration tests running channel daemons in addition to Xaya Core
on regtest and a GSP.
"""
from . import rpcbroadcast
from xayag... |
TawkunProxy.py | import urllib.request
import re
import random
from bs4 import BeautifulSoup
import threading
useragents=["AdsBot-Google ( http://www.google.com/adsbot.html)",
"Avant Browser/1.2.789rel1 (http://www.avantbrowser.com)",
"Baiduspider ( http://www.baidu.com/search/spider.htm)",
"BlackBerry7100i/4.1.0 P... |
ewelink_client.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
N Waterton 11th Jan 2019 V1.0 First release
N. Waterton 18th April 20201 V 1.2 Updated login method.
N. Waterton 19th April 20201 V 1.2.1 Added region selector to constructor.
'''
'''
Client class for connecting to iTEAD ewelink devices.
uses Itead's IoTgo framework ... |
test_xmlrpc.py | import base64
import datetime
import gc
import sys
import time
import unittest
import xmlrpc.client
import xmlrpc.server
import mimetools
import http.client
import socket
import io
import os
import re
from test import support
try:
import threading
except ImportError:
threading = None
try:
str
except NameE... |
cnn_util_test.py | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
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... |
task_execution.py | from airflow.models import Variable
import os
import time
import traceback
import threading
import queue
import socket
import json
import click
from kombu import Connection
from kombu.simple import SimpleQueue
import psutil
import custom_worker
@click.command()
@click.option('--tag', default='', help='kind of task t... |
server_app_old.py | #!/usr/bin/env python
"""Main app"""
import webbrowser
import threading
import locale
import logging
import calendar
from datetime import time
from importlib import import_module
import os
from flask import (Flask,
render_template,
Response,
request,
... |
plugin.py | import threading
from binascii import hexlify, unhexlify
from electrum_ltc import constants
from electrum_ltc.util import bfh, bh2u
from electrum_ltc.bitcoin import (b58_address_to_hash160, xpub_from_pubkey,
TYPE_ADDRESS, TYPE_SCRIPT)
from electrum_ltc.i18n import _
from electrum_ltc... |
run.py | from multiprocessing import Process
from collections import defaultdict
import pipedream.utils as utils
import numpy as np
import importlib
import argparse
import inspect
import shutil
import signal
import pprint
import tqdm
import os
import re
DEFAULT_RUN_DIR = 'runs'
def signal_handler(signum, frame):
raise u... |
bot.py | # -*- coding: iso-8859-1 -*-
from datetime import datetime
from os import listdir
import src.quote as quote
import src.birthday as birthday
import threading
import time
import urllib2
import re
import telepot
from telepot.loop import MessageLoop
import hashlib
import src.tsclient.tsclient as ts
import logging
import su... |
ltipy.py | import re
import os
import sys
import subprocess
import signal
import threading
import time
import ltmain
import pickle
import json
def noop():
pass
ipy = None
respond = None
requests = {}
connected = noop
disconnected = noop
def km_from_string(s=''):
"""create kernel manager from IPKernelApp string
such a... |
seabird.py | from queue import Queue
from threading import Thread
import threading
import pandas as pd
import numpy as np
import xml.etree.cElementTree as ET
import os
import sys
import serial
import time
import datetime
class SBE9Plus():
def __init__(self):
# Responsible for managing serial communication
self... |
datasets.py | import glob
import math
import os
import random
import shutil
import time
from pathlib import Path
from threading import Thread
import cv2
import numpy as np
import torch
from PIL import Image, ExifTags
from torch.utils.data import Dataset
from tqdm import tqdm
from utils.general import xyxy2xywh, xyw... |
test_local_task_job.py | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
console_manager.py | import logging
import time
import threading
import data as d
from data import store as store
from data import manager as manager
from utils import ui
_logger = ui.get_logger(logging.WARNING, logfile='output')
class Interface:
def __init__(self, ticker: str = '', update: str = '', quick: bool = False):
... |
run-spec-test.py | #!/usr/bin/env python3
# Author: Volodymyr Shymanskyy
# Usage:
# ./run-spec-test.py
# ./run-spec-test.py ./core/i32.json
# ./run-spec-test.py ./core/float_exprs.json --line 2070
# ./run-spec-test.py ./proposals/tail-call/*.json
# ./run-spec-test.py --exec "../build-custom/wasm3 --repl"
#
# Running WASI versi... |
TemplateSpaceParallelBaseSearch.py | import logging
import queue
import time
import threading
import traceback
import typing
from d3m.metadata.problem import Problem
from d3m.container.dataset import Dataset
from dsbox.JobManager.DistributedJobManager import DistributedJobManager
from dsbox.combinatorial_search.ConfigurationSpaceBaseSearch import Config... |
BufferMan.py | '''
.. module BufferMan of picoDAQ
.. author: Guenter Quast <guenter.quast@online.de>
'''
#
from __future__ import print_function, division, unicode_literals
from __future__ import absolute_import
# - class BufferMan
import numpy as np, sys, time, threading
from multiprocessing import Process
from multiprocessing.sh... |
ann_embedding.py | # coding=utf-8
# Copyright 2021-2022, Ontocord, 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... |
test_providers.py | # -*- coding: utf-8 -*-
import unittest
import time
from Tea.vendored import requests
from alibabacloud_credentials import providers, models, credentials, exceptions
from alibabacloud_credentials.utils import auth_util
from . import ini_file
import threading
from BaseHTTPServer import HTTPServer, BaseHTTPRe... |
gdaltest_python2.py | # -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Python Library supporting GDAL/OGR Test Suite
# Author: Even Rouault, <even dot rouault at mines dash paris dot org>
#
##########################################... |
numpyvisdomlogger.py | from __future__ import division, print_function
import atexit
from collections import defaultdict
import inspect
import os
if os.name == "nt":
IS_WINDOWS = True
from queue import Queue
from threading import Thread as Process
else:
IS_WINDOWS = False
from pathos.helpers import mp
Queue = mp.Qu... |
updater.py | #!/usr/bin/env python3
# Copyright (c) 2019, Alchemy Meister
# 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 notice,
# ... |
HawkHunter.py | #!/usr/bin/env python2
from socket import *
import multiprocessing
import threading
import time
import paramiko
import sys
import os
import logging
import argparse
import random
# print our nice banner ;)
def banner():
print '--==[ HawkHunter.py ]==--'
# print version
def version():
print '[+] HawkHunter.p... |
daemon.py | import os
import errno
import threading
import tuned.logs
from tuned.exceptions import TunedException
from tuned.profiles.exceptions import InvalidProfileException
import tuned.consts as consts
from tuned.utils.commands import commands
from tuned import exports
from tuned.utils.profile_recommender import ProfileRecomme... |
Switch.py | import threading
from threading import Thread
import socket
import ssl
from pyof.v0x01.common.utils import unpack_message
from pyof.v0x01.symmetric.hello import Hello
from pyof.v0x01.common.header import Type
from MessageGenerator import MessageGenerator
from datetime import datetime
import select
import time
from thre... |
fastcov.py | #!/usr/bin/env python3
# SPDX-License-Identifier: MIT
# Copyright 2018-present, Bryan Gillespie
"""
Author: Bryan Gillespie
https://github.com/RPGillespie6/fastcov
A massively parallel gcov wrapper for generating intermediate coverage formats fast
The goal of fastcov is to generate code coverage inter... |
launch_ipykernel.py | import argparse
import base64
import json
import logging
import os
import socket
import tempfile
import uuid
from multiprocessing import Process
from random import random
from threading import Thread
from Crypto.Cipher import AES
from ipython_genutils.py3compat import str_to_bytes
from jupyter_client.connect import wr... |
rllib_compatibility.py | # init_rllib_compatibility_server() must be called prior to launching training with the airsim environment
from init_ip_port_and_json_files import init_ip_port_and_json_files
import zmq
from multiprocessing import Process
import time
class Locker():
def __init__(self, timeout=20.0):
self.locked = False
... |
sensordata.py | """
Slixmpp: The Slick XMPP Library
Implementation of xeps for Internet of Things
http://wiki.xmpp.org/web/Tech_pages/IoT_systems
Copyright (C) 2013 Sustainable Innovation, Joachim.lindborg@sust.se, bjorn.westrom@consoden.se
This file is part of Slixmpp.
See the file LICENSE for copying permiss... |
load.py | # -*- coding: utf-8 -*-
#
# Display the "habitable-zone" (i.e. the range of distances in which you might find an Earth-Like World)
#
from __future__ import print_function
from collections import defaultdict
import requests
import sys
import threading
try:
# Python 2
from urllib2 import quote
import Tkinte... |
metrics.py | from __future__ import absolute_import
__all__ = ['timing', 'incr']
import logging
from contextlib import contextmanager
from django.conf import settings
from random import random
from time import time
from threading import Thread
from six.moves.queue import Queue
def get_default_backend():
from sentry.utils.i... |
manager.py | #!/usr/bin/env python3.7
import os
import time
import sys
import fcntl
import errno
import signal
import subprocess
import datetime
from common.basedir import BASEDIR
sys.path.append(os.path.join(BASEDIR, "pyextra"))
os.environ['BASEDIR'] = BASEDIR
TOTAL_SCONS_NODES = 1170
prebuilt = os.path.exists(os.path.join(BASED... |
exchange_rate.py | from datetime import datetime
import inspect
import requests
import sys
import os
import json
from threading import Thread
import time
import csv
import decimal
from decimal import Decimal
from .bitcoin import COIN
from .i18n import _
from .util import PrintError, ThreadJob
# See https://en.wikipedia.org/wiki/ISO_42... |
test_nntplib.py | import io
import socket
import datetime
import textwrap
import unittest
import functools
import contextlib
import os.path
import re
import threading
from test import support
from nntplib import NNTP, GroupInfo
import nntplib
from unittest.mock import patch
try:
import ssl
except ImportError:
ssl = None
certf... |
batcher.py | # -*- coding: utf-8 -*-
import queue as Queue
from random import shuffle
from threading import Thread
from frpg import data
import time
import numpy as np
import tensorflow as tf
class Example(object):
"""Class representing a train/val/test example for text summarization."""
def __init__(self, article, abs... |
video_capture.py | """
The MIT License (MIT)
Copyright (c) 2021 NVIDIA CORPORATION
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, modify, ... |
test_lib.py | #!/usr/bin/env python
"""A library for tests."""
import datetime
import doctest
import email
import functools
import itertools
import logging
import os
import shutil
import threading
import time
import unittest
from unittest import mock
from absl.testing import absltest
import pkg_resources
from grr_response_core i... |
e2e.py | """
This is an end to end release test automation script used to kick off periodic
release tests, running on Anyscale.
The tool leverages app configs and compute templates.
Calling this script will run a single release test.
Example:
python e2e.py --test-config ~/ray/release/xgboost_tests/xgboost_tests.yaml --test-... |
telemetry.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
filament_load_cell.py | #!/usr/bin/env python3
import os
import statistics
import struct
import threading
import time
import traceback
from dsf.commands.basecommands import HttpEndpointType
from dsf.http import HttpEndpointConnection
from dsf.connections import CommandConnection
import smbus
BOWDEN_WASTE = 10.0
SPOOL_WEIGHT = 230.0
AVERAG... |
test_config.py | import asyncio
import copy
import pytest
import random
import yaml
from aedge.util.config import create_default_aedge_config, initial_config_file, load_config, save_config
from aedge.util.path import mkdir
from multiprocessing import Pool
from pathlib import Path
from threading import Thread
from time import sleep
fro... |
lvapmanager.py | #!/usr/bin/env python3
#
# Copyright (c) 2020 Pedro Heleno Isolani
#
# 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... |
vfs_test.py | #!/usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
"""Tests for API client and VFS-related API calls."""
from __future__ import absolute_import
from __future__ import unicode_literals
import io
import threading
import time
import zipfile
from grr_response_core.lib import flags
from grr_response_core.lib i... |
run_noui_test.py | import os
import sys
ROOT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
sys.path.append(ROOT_PATH)
if not os.path.exists(".vntrader"):
os.mkdir(".vntrader")
import multiprocessing
from time import sleep
from datetime import datetime, time
from logging import INFO, DEBUG
from vnpy.trad... |
example_demo.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: example_demo.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api
# Documentation: https://lucit-systems-and-development.github.io/unicorn-binance-websocket-api
# PyPI: ht... |
tasks.py | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
# Python
from collections import OrderedDict, namedtuple
import errno
import functools
import importlib
import json
import logging
import os
import shutil
import stat
import tempfile
import time
import traceback
from distutils.dir_util ... |
MakerBr.py | '''
classes and methods to analyze observations of astrophysical spectra
'''
import os
from datetime import date
from datetime import datetime
import pickle
import warnings
try:
import multiprocessing as mp
except:
print(' your version of Python does not support multiprocessing \n you will not be able to use m... |
jenkins_service.py | import logging
from queue import Queue
import re
from threading import Thread, Timer
from bot.exceptions import JenkinsStartingError, JenkinsStoppingError
from bot.driven.repositories import JenkinsRepository, ParamsRepository
logger = logging.getLogger(__name__).parent
class JenkinsService():
def __init__(sel... |
engine_automl.py | # Main function for black box learning
#Damir Jajetic, 2015
from sklearn.externals import joblib
from sklearn import linear_model, naive_bayes, neighbors, cross_validation, feature_selection
from sklearn import metrics, ensemble, decomposition, preprocessing, svm, manifold, mixture, neural_network
from sklearn import c... |
cache.py | """Definitions related to caching the song."""
import os
import threading
import glob
import sys
import json
import urllib.request
from json.decoder import JSONDecodeError
from playx.stringutils import (
remove_multiple_spaces,
remove_punct,
compute_jaccard,
remove_stopwords,
check_keywords,
... |
vdb.py | import sys
import pdb
from bdb import BdbQuit
from pdb import Pdb
import os
import signal
from functools import partial
import traceback
#from vsi.tools import static
if os.name == 'nt':
from vsi.windows.named_pipes import Pipe
import threading
import ctypes
ATTACH_SIGNAL = signal.SIGINT
else:
ATTACH_SIGNAL... |
process.py | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""RPC compatible subprocess-type module.
This module defined both a task-side process class as well as a controller-side
process wrapper for easier access ... |
draw_test.py | # coding: utf-8
#########################################################################
# 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> #
# author yeeku.H.lee kongyeeku@163.com #
# #
# version... |
pretty_progress.py | # coding=utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
try:
from Queue import Empty # for python 2
except ImportError:
from queue import Empty # for python 3
from multiprocessing import Process, Queue
from os import environ
from os.path import join
from re import su... |
import_thread.py | from collections import defaultdict
import threading
import traceback
import redis
import grpc
import ray
from ray import ray_constants
from ray import cloudpickle as pickle
import ray._private.profiling as profiling
import logging
logger = logging.getLogger(__name__)
class ImportThread:
"""A thread used to im... |
GUI_URL.py | '''
May 2017
@author: Burkhard A. Meier
'''
#======================
# imports
#======================
import tkinter as tk
from tkinter import ttk
from tkinter import scrolledtext
from tkinter import Menu
from tkinter import messagebox as msg
from tkinter import Spinbox
from tkinter import filedialog as fd
from os impo... |
core.py | import re
import struct
import time
import socket, select
import Queue, threading
from collections import namedtuple
import commands
class ISCPMessage(object):
"""Deals with formatting and parsing data wrapped in an ISCP
containers. The docs say:
ISCP (Integra Serial Control Protocol) consists of th... |
tensorFI.py | #!/usr/bin/python
# Library for performing fault injections into TensorFlow graphs (in place)
# Uses the fault injection functions defined in modifyGraph and ficonfig
import tensorflow as tf
import printGraph as pg
import modifyGraph as mg
from injectFault import initFIConfig, initFILog, logRun, turnOffConfigFault, t... |
AutoUpdateThread.py | # -*- coding: utf-8 -*-
import threading
import traceback
from time import sleep
class AutoUpdateThread:
def __init__(self, update_function):
self.update_function = update_function
t = threading.Thread(target=self.dispatch_update)
t.setDaemon(True)
t.start()
def dispatch_upda... |
penv.py | from multiprocessing import Process, Pipe
import gym
def worker(conn, env):
while True:
cmd, data = conn.recv()
if cmd == "step":
obs, reward, done, info = env.step(data)
if done:
obs, info = env.reset()
conn.send((obs, reward, done, info))
... |
authcode.py | # Note: This docstring is also used by this script's command line help.
"""A one-stop helper for desktop app to acquire an authorization code.
It starts a web server to listen redirect_uri, waiting for auth code.
It optionally opens a browser window to guide a human user to manually login.
After obtaining an auth code... |
base.py | # (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2020
"""
A Collector launches a background thread and continually collects & reports data. The data
can be any combination of metrics, snapshot data and spans.
"""
import sys
import threading
from ..log import logger
from ..singletons import env_is_test
fro... |
main_screen.py | import hashlib
import json
import logging
import os
import time
import urllib
import urllib2
from threading import Thread
from base_screen import BaseScreen
import mopidy.core
import pygame
from ..graphic_utils import Progressbar, \
ScreenObjectsManager, TextItem, TouchAndTextItem
from ..input import InputMana... |
server.py | #!/usr/bin/env python
"""
Dummy server used for unit testing.
"""
from __future__ import print_function
import logging
import os
import random
import string
import sys
import threading
import socket
import warnings
import ssl
from datetime import datetime
from urllib3.exceptions import HTTPWarning
from cryptography... |
tasks.py | #!/usr/local/bin/python3
# coding: utf-8
# ytdlbot - tasks.py
# 12/29/21 14:57
#
__author__ = "Benny <benny.think@gmail.com>"
import logging
import os
import pathlib
import tempfile
import threading
from celery import Celery
from pyrogram import idle
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMa... |
standalone_test.py | """Tests for acme.standalone."""
import http.client as http_client
import socket
import socketserver
import threading
import unittest
from typing import Set
from unittest import mock
import josepy as jose
import requests
from acme import challenges
from acme import crypto_util
from acme import errors
import test_uti... |
module1.py | #-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: Rajesh
#
# Created: 23-12-2019
# Copyright: (c) Rajesh 2019
# Licence: <your licence>
#-------------------------------------------------------------------------------
import os
i... |
proxy.py | #!/usr/bin/env python3
import queue
import os
import socket
import sys
import threading
from select import select
# returns anonymous pipes (readableFromClient, writableToClient)
def proxy(bindAddr, listenPort):
sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, soc... |
mrn_console_app.py | # |-----------------------------------------------------------------------------
# | This source code is provided under the Apache 2.0 license --
# | and is provided AS IS with no warranty or guarantee of fit for purpose. --
# | See the project's LICENSE.md for details. ... |
cluster_coordinator_test.py | # Copyright 2020 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 applicable ... |
libraries.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from sublime import active_window
from os import path
from json import loads
from glob import glob
from threading import Th... |
main.py | # -*- coding: utf-8 -*-
import socket
import serial
import serial.tools.list_ports
import threading
import sys
import os
from time import sleep
from requests import Session, exceptions
from PyQt5.QtWidgets import (
QApplication, QMainWindow, QMessageBox
)
from PyQt5 import QtGui
from main_window_ui import Ui_oMa... |
jutil.py | # Copyright (c) 2014-2018, Adam Karpierz
# Licensed under the BSD license
# http://opensource.org/licenses/BSD-3-Clause
from __future__ import absolute_import
import gc
import inspect
import logging
import os
import threading
import traceback
import re
import subprocess
import uuid
import weakref
import sys
try:
... |
scheduler_job.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
#... |
__init__.py | __author__ = "Johannes Köster"
__copyright__ = "Copyright 2021, Johannes Köster"
__email__ = "johannes.koester@uni-due.de"
__license__ = "MIT"
import os
import sys
import contextlib
import time
import datetime
import json
import textwrap
import stat
import shutil
import shlex
import threading
import concurrent.futures... |
async_policy_saver.py | # coding=utf-8
# Copyright 2020 The TF-Agents Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.