<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sort_dependencies(self, image, dependencies=None):
 """ Topologically sort the docker commands by their requirements Note: Circular "requires" dependencies are assumed to have already been checked in get_external_base_image, they are not checked here Args: image (str):
 process this docker image's dependencies dependencies (OrderedDict):
 running cache of sorted dependencies (ordered dict) Returns: List[str]: list of dependencies a topologically-sorted build order """

        if dependencies is None:
            dependencies = OrderedDict()  # using this as an ordered set - not storing any values

        if image in dependencies:
            return

        requires = self.ymldefs[image].get('requires', [])

        for dep in requires:
            self.sort_dependencies(dep, dependencies)

        dependencies[image] = None
        return dependencies.keys()