prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  'PathManagerBase' object has no attribute 'makedirs'
  In attempting to create the tensorboard directory with PathManager we're calling a nonexistent function.
  
  To repro:
  ```bash
  $ python -m parlai.scripts.train_model -t personachat -m transformer/ranker -mf /tmp/model_tr6 --n-layers 1 --embedding-size 300 --ffn-size 600 --n-heads 4 --num-epochs 2 -veps 0.25 -bs 64 -lr 0.001 --dropout 0.1 --embedding-type fasttext_cc --candidates batch --tensorboard-log true
  ```
  
  Exception hit:
  ```
  File "/Users/spoff/ParlAI/parlai/core/logs.py", line 56, in __init__
      PathManager.makedirs(tbpath)
  AttributeError: 'PathManagerBase' object has no attribute 'makedirs'
  ```
  
  </issue>
  <code>
  [start of setup.py]
  1 #!/usr/bin/env python3
  2 
  3 # Copyright (c) Facebook, Inc. and its affiliates.
  4 # This source code is licensed under the MIT license found in the
  5 # LICENSE file in the root directory of this source tree.
  6 
  7 
  8 import sys
  9 
  10 from setuptools import setup, find_packages
  11 
  12 VERSION = '0.9.1'  # if you update, update parlai/__init__.py too!
  13 
  14 if sys.version_info < (3, 6):
  15     sys.exit('Sorry, Python >=3.6 is required for ParlAI.')
  16 
  17 with open('README.md', encoding="utf8") as f:
  18     # strip the header and badges etc
  19     readme = f.read().split('--------------------')[-1]
  20 
  21 with open('requirements.txt') as f:
  22     reqs = []
  23     for line in f:
  24         line = line.strip()
  25         reqs.append(line.split('==')[0])
  26 
  27 
  28 if __name__ == '__main__':
  29     setup(
  30         name='parlai',
  31         version=VERSION,
  32         description='Unified platform for dialogue research.',
  33         long_description=readme,
  34         long_description_content_type='text/markdown',
  35         url='http://parl.ai/',
  36         python_requires='>=3.6',
  37         packages=find_packages(
  38             exclude=('data', 'docs', 'examples', 'tests', 'parlai_internal*')
  39         ),
  40         install_requires=reqs,
  41         include_package_data=True,
  42         package_data={'': ['*.txt', '*.md']},
  43         entry_points={
  44             "flake8.extension": ["PAI = parlai.utils.flake8:ParlAIChecker"],
  45             "console_scripts": ["parlai=parlai.__main__:main"],
  46         },
  47         classifiers=[
  48             "Programming Language :: Python :: 3",
  49             "License :: OSI Approved :: MIT License",
  50             "Topic :: Scientific/Engineering :: Artificial Intelligence",
  51             "Natural Language :: English",
  52         ],
  53     )
  54
  [end of setup.py]
  [start of parlai/core/logs.py]
  1 #!/usr/bin/env python3
  2 
  3 # Copyright (c) Facebook, Inc. and its affiliates.
  4 # This source code is licensed under the MIT license found in the
  5 # LICENSE file in the root directory of this source tree.
  6 """
  7 Log metrics to tensorboard.
  8 
  9 This file provides interface to log any metrics in tensorboard, could be
  10 extended to any other tool like visdom.
  11 
  12 .. code-block: none
  13 
  14    tensorboard --logdir <PARLAI_DATA/tensorboard> --port 8888.
  15 """
  16 
  17 import json
  18 import numbers
  19 from parlai.core.opt import Opt
  20 from parlai.core.metrics import Metric
  21 from parlai.utils.io import PathManager
  22 import parlai.utils.logging as logging
  23 
  24 
  25 class TensorboardLogger(object):
  26     """
  27     Log objects to tensorboard.
  28     """
  29 
  30     @staticmethod
  31     def add_cmdline_args(argparser):
  32         """
  33         Add tensorboard CLI args.
  34         """
  35         logger = argparser.add_argument_group('Tensorboard Arguments')
  36         logger.add_argument(
  37             '-tblog',
  38             '--tensorboard-log',
  39             type='bool',
  40             default=False,
  41             help="Tensorboard logging of metrics, default is %(default)s",
  42             hidden=False,
  43         )
  44 
  45     def __init__(self, opt: Opt):
  46         try:
  47             # tensorboard is a very expensive thing to import. Wait until the
  48             # last second to import it.
  49             from tensorboardX import SummaryWriter
  50         except ImportError:
  51             raise ImportError('Please run `pip install tensorboard tensorboardX`.')
  52 
  53         tbpath = opt['model_file'] + '.tensorboard'
  54         logging.debug(f'Saving tensorboard logs to: {tbpath}')
  55         if not PathManager.exists(tbpath):
  56             PathManager.makedirs(tbpath)
  57         self.writer = SummaryWriter(tbpath, comment=json.dumps(opt))
  58 
  59     def log_metrics(self, setting, step, report):
  60         """
  61         Add all metrics from tensorboard_metrics opt key.
  62 
  63         :param setting:
  64             One of train/valid/test. Will be used as the title for the graph.
  65         :param step:
  66             Number of parleys
  67         :param report:
  68             The report to log
  69         """
  70         for k, v in report.items():
  71             if isinstance(v, numbers.Number):
  72                 self.writer.add_scalar(f'{k}/{setting}', v, global_step=step)
  73             elif isinstance(v, Metric):
  74                 self.writer.add_scalar(f'{k}/{setting}', v.value(), global_step=step)
  75             else:
  76                 logging.error(f'k {k} v {v} is not a number')
  77 
  78     def flush(self):
  79         self.writer.flush()
  80
  [end of parlai/core/logs.py]
  [start of parlai/__init__.py]
  1 #!/usr/bin/env python3
  2 
  3 # Copyright (c) Facebook, Inc. and its affiliates.
  4 # This source code is licensed under the MIT license found in the
  5 # LICENSE file in the root directory of this source tree.
  6 
  7 __version__ = '0.9.1'
  8
  [end of parlai/__init__.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/parlai/__init__.py b/parlai/__init__.py
  --- a/parlai/__init__.py
  +++ b/parlai/__init__.py
  @@ -4,4 +4,4 @@
   # This source code is licensed under the MIT license found in the
   # LICENSE file in the root directory of this source tree.
   
  -__version__ = '0.9.1'
  +__version__ = '0.9.2'
  diff --git a/parlai/core/logs.py b/parlai/core/logs.py
  --- a/parlai/core/logs.py
  +++ b/parlai/core/logs.py
  @@ -53,7 +53,7 @@
           tbpath = opt['model_file'] + '.tensorboard'
           logging.debug(f'Saving tensorboard logs to: {tbpath}')
           if not PathManager.exists(tbpath):
  -            PathManager.makedirs(tbpath)
  +            PathManager.mkdirs(tbpath)
           self.writer = SummaryWriter(tbpath, comment=json.dumps(opt))
   
       def log_metrics(self, setting, step, report):
  diff --git a/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -9,7 +9,7 @@
   
   from setuptools import setup, find_packages
   
  -VERSION = '0.9.1'  # if you update, update parlai/__init__.py too!
  +VERSION = '0.9.2'  # if you update, update parlai/__init__.py too!
   
   if sys.version_info < (3, 6):
       sys.exit('Sorry, Python >=3.6 is required for ParlAI.')
  
verification_info: {"golden_diff": "diff --git a/parlai/__init__.py b/parlai/__init__.py\n--- a/parlai/__init__.py\n+++ b/parlai/__init__.py\n@@ -4,4 +4,4 @@\n # This source code is licensed under the MIT license found in the\n # LICENSE file in the root directory of this source tree.\n \n-__version__ = '0.9.1'\n+__version__ = '0.9.2'\ndiff --git a/parlai/core/logs.py b/parlai/core/logs.py\n--- a/parlai/core/logs.py\n+++ b/parlai/core/logs.py\n@@ -53,7 +53,7 @@\n         tbpath = opt['model_file'] + '.tensorboard'\n         logging.debug(f'Saving tensorboard logs to: {tbpath}')\n         if not PathManager.exists(tbpath):\n-            PathManager.makedirs(tbpath)\n+            PathManager.mkdirs(tbpath)\n         self.writer = SummaryWriter(tbpath, comment=json.dumps(opt))\n \n     def log_metrics(self, setting, step, report):\ndiff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -9,7 +9,7 @@\n \n from setuptools import setup, find_packages\n \n-VERSION = '0.9.1'  # if you update, update parlai/__init__.py too!\n+VERSION = '0.9.2'  # if you update, update parlai/__init__.py too!\n \n if sys.version_info < (3, 6):\n     sys.exit('Sorry, Python >=3.6 is required for ParlAI.')\n", "issue": "'PathManagerBase' object has no attribute 'makedirs'\nIn attempting to create the tensorboard directory with PathManager we're calling a nonexistent function.\r\n\r\nTo repro:\r\n```bash\r\n$ python -m parlai.scripts.train_model -t personachat -m transformer/ranker -mf /tmp/model_tr6 --n-layers 1 --embedding-size 300 --ffn-size 600 --n-heads 4 --num-epochs 2 -veps 0.25 -bs 64 -lr 0.001 --dropout 0.1 --embedding-type fasttext_cc --candidates batch --tensorboard-log true\r\n```\r\n\r\nException hit:\r\n```\r\nFile \"/Users/spoff/ParlAI/parlai/core/logs.py\", line 56, in __init__\r\n    PathManager.makedirs(tbpath)\r\nAttributeError: 'PathManagerBase' object has no attribute 'makedirs'\r\n```\n", "before_files": [{"content": "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\nimport sys\n\nfrom setuptools import setup, find_packages\n\nVERSION = '0.9.1'  # if you update, update parlai/__init__.py too!\n\nif sys.version_info < (3, 6):\n    sys.exit('Sorry, Python >=3.6 is required for ParlAI.')\n\nwith open('README.md', encoding=\"utf8\") as f:\n    # strip the header and badges etc\n    readme = f.read().split('--------------------')[-1]\n\nwith open('requirements.txt') as f:\n    reqs = []\n    for line in f:\n        line = line.strip()\n        reqs.append(line.split('==')[0])\n\n\nif __name__ == '__main__':\n    setup(\n        name='parlai',\n        version=VERSION,\n        description='Unified platform for dialogue research.',\n        long_description=readme,\n        long_description_content_type='text/markdown',\n        url='http://parl.ai/',\n        python_requires='>=3.6',\n        packages=find_packages(\n            exclude=('data', 'docs', 'examples', 'tests', 'parlai_internal*')\n        ),\n        install_requires=reqs,\n        include_package_data=True,\n        package_data={'': ['*.txt', '*.md']},\n        entry_points={\n            \"flake8.extension\": [\"PAI = parlai.utils.flake8:ParlAIChecker\"],\n            \"console_scripts\": [\"parlai=parlai.__main__:main\"],\n        },\n        classifiers=[\n            \"Programming Language :: Python :: 3\",\n            \"License :: OSI Approved :: MIT License\",\n            \"Topic :: Scientific/Engineering :: Artificial Intelligence\",\n            \"Natural Language :: English\",\n        ],\n    )\n", "path": "setup.py"}, {"content": "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\"\"\"\nLog metrics to tensorboard.\n\nThis file provides interface to log any metrics in tensorboard, could be\nextended to any other tool like visdom.\n\n.. code-block: none\n\n   tensorboard --logdir <PARLAI_DATA/tensorboard> --port 8888.\n\"\"\"\n\nimport json\nimport numbers\nfrom parlai.core.opt import Opt\nfrom parlai.core.metrics import Metric\nfrom parlai.utils.io import PathManager\nimport parlai.utils.logging as logging\n\n\nclass TensorboardLogger(object):\n    \"\"\"\n    Log objects to tensorboard.\n    \"\"\"\n\n    @staticmethod\n    def add_cmdline_args(argparser):\n        \"\"\"\n        Add tensorboard CLI args.\n        \"\"\"\n        logger = argparser.add_argument_group('Tensorboard Arguments')\n        logger.add_argument(\n            '-tblog',\n            '--tensorboard-log',\n            type='bool',\n            default=False,\n            help=\"Tensorboard logging of metrics, default is %(default)s\",\n            hidden=False,\n        )\n\n    def __init__(self, opt: Opt):\n        try:\n            # tensorboard is a very expensive thing to import. Wait until the\n            # last second to import it.\n            from tensorboardX import SummaryWriter\n        except ImportError:\n            raise ImportError('Please run `pip install tensorboard tensorboardX`.')\n\n        tbpath = opt['model_file'] + '.tensorboard'\n        logging.debug(f'Saving tensorboard logs to: {tbpath}')\n        if not PathManager.exists(tbpath):\n            PathManager.makedirs(tbpath)\n        self.writer = SummaryWriter(tbpath, comment=json.dumps(opt))\n\n    def log_metrics(self, setting, step, report):\n        \"\"\"\n        Add all metrics from tensorboard_metrics opt key.\n\n        :param setting:\n            One of train/valid/test. Will be used as the title for the graph.\n        :param step:\n            Number of parleys\n        :param report:\n            The report to log\n        \"\"\"\n        for k, v in report.items():\n            if isinstance(v, numbers.Number):\n                self.writer.add_scalar(f'{k}/{setting}', v, global_step=step)\n            elif isinstance(v, Metric):\n                self.writer.add_scalar(f'{k}/{setting}', v.value(), global_step=step)\n            else:\n                logging.error(f'k {k} v {v} is not a number')\n\n    def flush(self):\n        self.writer.flush()\n", "path": "parlai/core/logs.py"}, {"content": "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n__version__ = '0.9.1'\n", "path": "parlai/__init__.py"}]}