<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def setup_directories(self, use_sudo=True):
 """Create the minimal required directories for deploying multiple releases of a project. By default, creation of directories is done with the Fabric ``sudo`` function but can optionally use the ``run`` function. This method performs one network operation. :param bool use_sudo: If ``True``, use ``sudo()`` to create required directories. If ``False`` try to create directories using the ``run()`` command. """

        runner = self._runner.sudo if use_sudo else self._runner.run
        runner("mkdir -p '{0}'".format(self._releases))