<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def factory(cls, target_type, alias=None):
 """Creates an addressable factory for the given target type and alias. :returns: A factory that can capture :class:`TargetAddressable` instances. :rtype: :class:`Addressable.Factory` """

    class Factory(Addressable.Factory):
      @property
      def target_types(self):
        return (target_type,)

      def capture(self, *args, **kwargs):
        return TargetAddressable(alias, target_type, *args, **kwargs)
    return Factory()