def extract_component(self, name, action, default_entry_point_creator=None):
        """Return the class + component info to use for doing the action w/the component."""
        try:
            # Use a copy instead of the original since we will be
            # modifying this dictionary which may not be wanted for future
            # usages of this dictionary (so keep the original clean)...
            component_info = copy.deepcopy(self._components[name])
        except KeyError:
            component_info = {}
        action_classes = component_info.pop('action_classes', {})
        if default_entry_point_creator is not None:
            default_action_classes = default_entry_point_creator(name,
                                                                 copy.deepcopy(component_info))
            if default_action_classes:
                for (an_action, entry_point) in six.iteritems(default_action_classes):
                    if an_action not in action_classes:
                        action_classes[an_action] = entry_point
        try:
            entry_point = action_classes.pop(action)
        except __HOLE__:
            raise RuntimeError('No entrypoint configured/generated for'
                               ' %r %r for distribution %r' % (action, name, self.name))
        else:
            return Component(entry_point, component_info, action_classes)
dataset/ETHPy150Open openstack/anvil/anvil/distro.py/Distro.extract_component