def METHOD_NAME(
    table,
    engine,
    limit=None,
    offset=None,
    order_by=None,
    filter=None,
    group_by=None,
    search=None,
    duplicate_only=None,
    fallback_to_default_ordering=False,
):
    """
    Returns annotated records from a table.
    Args:
        table:           SQLAlchemy table object
        engine:          SQLAlchemy engine object
        limit:           int, gives number of rows to return
        offset:          int, gives number of rows to skip
        order_by:        list of dictionaries, where each dictionary has a 'field' and
                         'direction' field.
        search:          list of dictionaries, where each dictionary has a 'column' and
                         'literal' field.
                         See: https://github.com/centerofci/sqlalchemy-filters#sort-format
        filter:          a dictionary with one key-value pair, where the key is the filter id and
                         the value is a list of parameters; supports composition/nesting.
                         See: https://github.com/centerofci/sqlalchemy-filters#filters-format
        group_by:        group.GroupBy object
        duplicate_only:  list of column names; only rows that have duplicates across those rows
                         will be returned
    """
    if order_by is None:
        order_by = []
    if search is None:
        search = []
    relation = apply_transformations_deprecated(
        table=table,
        limit=limit,
        offset=offset,
        order_by=order_by,
        fallback_to_default_ordering=fallback_to_default_ordering,
        filter=filter,
        group_by=group_by,
        search=search,
        duplicate_only=duplicate_only,
    )
    return execute_pg_query(engine, relation)