
import sys

from enlighten._counter import Counter as _Counter
from enlighten._counter import SubCounter  # pylint: disable=unused-import # noqa: F401
from enlighten._manager import Manager


# Counter is defined here to avoid circular dependencies
class Counter(_Counter):  # pylint: disable=missing-docstring

    __doc__ = _Counter.__doc__

    def __init__(self, **kwargs):

        manager = kwargs.get('manager', None)
        if manager is None:
            manager = Manager(stream=kwargs.get('stream', sys.stdout),
                              counter_class=self.__class__, set_scroll=False)
            manager.counters[self] = 1
            kwargs['manager'] = manager

        super(Counter, self).__init__(**kwargs)


import sys

from enlighten._counter import Counter as _Counter
from enlighten._counter import SubCounter  # pylint: disable=unused-import # noqa: F401
from enlighten._manager import get_manager


# Counter is defined here to avoid circular dependencies
class Counter(_Counter):  # pylint: disable=missing-docstring

    __doc__ = _Counter.__doc__

    def __init__(self, **kwargs):

        manager = kwargs.get('manager', None)
        if manager is None:
            manager = get_manager(stream=kwargs.get('stream', sys.stdout),
                                  counter_class=self.__class__, set_scroll=False)
            manager.counters[self] = 1
            kwargs['manager'] = manager

        super(Counter, self).__init__(**kwargs)

Use get_manager() for Counter direct
Use get_manager() for Counter direct

  
  import sys
  
  from enlighten._counter import Counter as _Counter
  from enlighten._counter import SubCounter  # pylint: disable=unused-import # noqa: F401
- from enlighten._manager import Manager
+ from enlighten._manager import get_manager
  
  
  # Counter is defined here to avoid circular dependencies
  class Counter(_Counter):  # pylint: disable=missing-docstring
  
      __doc__ = _Counter.__doc__
  
      def __init__(self, **kwargs):
  
          manager = kwargs.get('manager', None)
          if manager is None:
-             manager = Manager(stream=kwargs.get('stream', sys.stdout),
+             manager = get_manager(stream=kwargs.get('stream', sys.stdout),
-                               counter_class=self.__class__, set_scroll=False)
+                                   counter_class=self.__class__, set_scroll=False)
              manager.counters[self] = 1
              kwargs['manager'] = manager
  
          super(Counter, self).__init__(**kwargs)
  
Use get_manager() for Counter direct
## Code Before:

import sys

from enlighten._counter import Counter as _Counter
from enlighten._counter import SubCounter  # pylint: disable=unused-import # noqa: F401
from enlighten._manager import Manager


# Counter is defined here to avoid circular dependencies
class Counter(_Counter):  # pylint: disable=missing-docstring

    __doc__ = _Counter.__doc__

    def __init__(self, **kwargs):

        manager = kwargs.get('manager', None)
        if manager is None:
            manager = Manager(stream=kwargs.get('stream', sys.stdout),
                              counter_class=self.__class__, set_scroll=False)
            manager.counters[self] = 1
            kwargs['manager'] = manager

        super(Counter, self).__init__(**kwargs)

## Instruction:
Use get_manager() for Counter direct
## Code After:

import sys

from enlighten._counter import Counter as _Counter
from enlighten._counter import SubCounter  # pylint: disable=unused-import # noqa: F401
from enlighten._manager import get_manager


# Counter is defined here to avoid circular dependencies
class Counter(_Counter):  # pylint: disable=missing-docstring

    __doc__ = _Counter.__doc__

    def __init__(self, **kwargs):

        manager = kwargs.get('manager', None)
        if manager is None:
            manager = get_manager(stream=kwargs.get('stream', sys.stdout),
                                  counter_class=self.__class__, set_scroll=False)
            manager.counters[self] = 1
            kwargs['manager'] = manager

        super(Counter, self).__init__(**kwargs)
