from functools import reduce


def _default_table_name(name):
    """Translate `MyModel` to `my_model`."""
    return reduce(
        lambda x, y: "_".join((x, y)) if y.isupper() else "".join((x, y)),
        list(name)).lower()