def find_entry_point_for_command(command_name):
    """Return an entry point for the given rbtools command.

    If no entry point is found, None is returned.
    """
    # Attempt to retrieve the command class from the entry points. We
    # first look in rbtools for the commands, and failing that, we look
    # for third-party commands.
    entry_point = pkg_resources.get_entry_info('rbtools', 'rbtools_commands',
                                               command_name)

    if not entry_point:
        try:
            entry_point = next(pkg_resources.iter_entry_points(
                'rbtools_commands', command_name))
        except __HOLE__:
            # There aren't any custom entry points defined.
            pass

    return entry_point
dataset/ETHPy150Open reviewboard/rbtools/rbtools/commands/__init__.py/find_entry_point_for_command