# Path: pysc2/lib/stopwatch.py
# class Stat(object):
# class StopWatchContext(object):
# class TracingStopWatchContext(StopWatchContext):
# class FakeStopWatchContext(object):
# class StopWatch(object):
#   def __init__(self):
#   def reset(self):
#   def add(self, val):
#   def avg(self):
#   def dev(self):
#   def merge(self, other):
#   def build(summation, average, standard_deviation, minimum, maximum, number):
#   def parse(s):
#   def __str__(self):
#   def __init__(self, stopwatch, name):
#   def __enter__(self):
#   def __exit__(self, unused_exception_type, unused_exc_value, unused_traceback):
#   def __enter__(self):
#   def __exit__(self, *args, **kwargs):
#   def _log(self, s):
#   def __enter__(self):
#   def __exit__(self, unused_exception_type, unused_exc_value, unused_traceback):
#   def __init__(self, enabled=True, trace=False):
#   def disable(self):
#   def enable(self):
#   def trace(self):
#   def custom(self, factory):
#   def __call__(self, name):
#   def decorate(self, name_or_func):
#     def decorator(name, func):
#       def _stopwatch(*args, **kwargs):
#   def push(self, name):
#   def pop(self):
#   def cur_stack(self):
#   def clear(self):
#   def add(self, name, duration):
#   def __getitem__(self, name):
#   def times(self):
#   def merge(self, other):
#   def parse(s):
#   def str(self, threshold=0.1):
#   def __str__(self):


import os
import mock
from absl.testing import absltest
from future.builtins import range  # pylint: disable=redefined-builtin
from pysc2.lib import stopwatch
# 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, software
# distributed under the License is distributed on an "AS-IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for stopwatch."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function





def ham_dist(str1, str2):
  """Hamming distance. Count the number of differences between str1 and str2."""
  assert len(str1) == len(str2)
  return sum(c1 != c2 for c1, c2 in zip(str1, str2))


class StatTest(absltest.TestCase):

  def testRange(self):

# Path: pysc2/lib/stopwatch.py
# class Stat(object):
# class StopWatchContext(object):
# class TracingStopWatchContext(StopWatchContext):
# class FakeStopWatchContext(object):
# class StopWatch(object):
#   def __init__(self):
#   def reset(self):
#   def add(self, val):
#   def avg(self):
#   def dev(self):
#   def merge(self, other):
#   def build(summation, average, standard_deviation, minimum, maximum, number):
#   def parse(s):
#   def __str__(self):
#   def __init__(self, stopwatch, name):
#   def __enter__(self):
#   def __exit__(self, unused_exception_type, unused_exc_value, unused_traceback):
#   def __enter__(self):
#   def __exit__(self, *args, **kwargs):
#   def _log(self, s):
#   def __enter__(self):
#   def __exit__(self, unused_exception_type, unused_exc_value, unused_traceback):
#   def __init__(self, enabled=True, trace=False):
#   def disable(self):
#   def enable(self):
#   def trace(self):
#   def custom(self, factory):
#   def __call__(self, name):
#   def decorate(self, name_or_func):
#     def decorator(name, func):
#       def _stopwatch(*args, **kwargs):
#   def push(self, name):
#   def pop(self):
#   def cur_stack(self):
#   def clear(self):
#   def add(self, name, duration):
#   def __getitem__(self, name):
#   def times(self):
#   def merge(self, other):
#   def parse(s):
#   def str(self, threshold=0.1):
#   def __str__(self):


# Path: pysc2/lib/stopwatch_test.py
import os
import mock
from absl.testing import absltest
from future.builtins import range  # pylint: disable=redefined-builtin
from pysc2.lib import stopwatch

# 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, software
# distributed under the License is distributed on an "AS-IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for stopwatch."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function





def ham_dist(str1, str2):
  """Hamming distance. Count the number of differences between str1 and str2."""
  assert len(str1) == len(str2)
  return sum(c1 != c2 for c1, c2 in zip(str1, str2))


class StatTest(absltest.TestCase):

  def testRange(self):

    stat = stopwatch.Stat()