def check_shape(to_check, expected):
    """Checks that shape matches expectations.

    In practice, the function simply check whether the two lists
    are the same and raise an AssertionError if not.

    Args:
        to_check: [int], the shape to check.
        expected: [int], the expected shape.
    """
    try:
        assert to_check == expected
    except AssertionError:
        message = (
            "Shape doesn't meet expecations. I'm afraid {to_check} != {expected}"
            .format(to_check=to_check, expected=expected))
        raise AssertionError(message)
