<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def list_components(self, dependency_order=True):
 """ Lists the Components by dependency resolving. Usage:: True [u'core.tests_component_a', u'core.tests_component_b'] :param dependency_order: Components are returned by dependency order. :type dependency_order: bool """


        if dependency_order:
            return list(itertools.chain.from_iterable([sorted(list(batch)) for batch in
                                                       foundations.common.dependency_resolver(
                                                           dict((key, value.require) for (key, value) in self))]))
        else:
            return [key for (key, value) in self]