# Path: tensorboardX/torchvis.py
# class TorchVis:
#     def __init__(self, *args, **init_kwargs):
#         """
#         Args:
#             args (list of strings): The name of the visualization target(s).
#               Accepted targets are 'tensorboard' and 'visdom'.
#             init_kwargs: Additional keyword parameters for the visdom writer (For example, server IP).
#               See `visdom doc <https://github.com/facebookresearch/visdom/blob
#               /master/README.md#visdom-arguments-python-only>`_ for more.
#         """
#         self.subscribers = {}
#         self.register(*args, **init_kwargs)
# 
#     def register(self, *args, **init_kwargs):
#         # Sets tensorboard as the default visualization format if not specified
#         formats = ['tensorboard'] if not args else args
#         for format in formats:
#             if self.subscribers.get(format) is None and format in vis_formats.keys():
#                 self.subscribers[format] = vis_formats[format](**init_kwargs.get(format, {}))
# 
#     def unregister(self, *args):
#         for format in args:
#             self.subscribers[format].close()
#             del self.subscribers[format]
#             gc.collect()
# 
#     def __getattr__(self, attr):
#         for _, subscriber in six.iteritems(self.subscribers):
#             def wrapper(*args, **kwargs):
#                 for _, subscriber in six.iteritems(self.subscribers):
#                     if hasattr(subscriber, attr):
#                         getattr(subscriber, attr)(*args, **kwargs)
#             return wrapper
#         raise AttributeError
# 
#     # Handle writer management (open/close) for the user
#     def __del__(self):
#         for _, subscriber in six.iteritems(self.subscribers):
#             subscriber.close()


from tensorboardX import TorchVis
import numpy as np
import pytest
import unittest


true_positive_counts = [75, 64, 21, 5, 0]
false_positive_counts = [150, 105, 18, 0, 0]
true_negative_counts = [0, 45, 132, 150, 150]
false_negative_counts = [0, 11, 54, 70, 75]
precision = [0.3333333, 0.3786982, 0.5384616, 1.0, 0.0]
recall = [1.0, 0.8533334, 0.28, 0.0666667, 0.0]


class VisdomTest(unittest.TestCase):
    def test_TorchVis(self):

# Path: tensorboardX/torchvis.py
# class TorchVis:
#     def __init__(self, *args, **init_kwargs):
#         """
#         Args:
#             args (list of strings): The name of the visualization target(s).
#               Accepted targets are 'tensorboard' and 'visdom'.
#             init_kwargs: Additional keyword parameters for the visdom writer (For example, server IP).
#               See `visdom doc <https://github.com/facebookresearch/visdom/blob
#               /master/README.md#visdom-arguments-python-only>`_ for more.
#         """
#         self.subscribers = {}
#         self.register(*args, **init_kwargs)
# 
#     def register(self, *args, **init_kwargs):
#         # Sets tensorboard as the default visualization format if not specified
#         formats = ['tensorboard'] if not args else args
#         for format in formats:
#             if self.subscribers.get(format) is None and format in vis_formats.keys():
#                 self.subscribers[format] = vis_formats[format](**init_kwargs.get(format, {}))
# 
#     def unregister(self, *args):
#         for format in args:
#             self.subscribers[format].close()
#             del self.subscribers[format]
#             gc.collect()
# 
#     def __getattr__(self, attr):
#         for _, subscriber in six.iteritems(self.subscribers):
#             def wrapper(*args, **kwargs):
#                 for _, subscriber in six.iteritems(self.subscribers):
#                     if hasattr(subscriber, attr):
#                         getattr(subscriber, attr)(*args, **kwargs)
#             return wrapper
#         raise AttributeError
# 
#     # Handle writer management (open/close) for the user
#     def __del__(self):
#         for _, subscriber in six.iteritems(self.subscribers):
#             subscriber.close()


# Path: tests/test_visdom.py
from tensorboardX import TorchVis
import numpy as np
import pytest
import unittest



true_positive_counts = [75, 64, 21, 5, 0]
false_positive_counts = [150, 105, 18, 0, 0]
true_negative_counts = [0, 45, 132, 150, 150]
false_negative_counts = [0, 11, 54, 70, 75]
precision = [0.3333333, 0.3786982, 0.5384616, 1.0, 0.0]
recall = [1.0, 0.8533334, 0.28, 0.0666667, 0.0]


class VisdomTest(unittest.TestCase):
    def test_TorchVis(self):

        w = TorchVis('visdom')