def METHOD_NAME(array_data: lldb.SBValue) -> typing.Optional[lldb.SBValue]:
    utils.debug_print(f"array_data_size(array_data=0x{array_data.load_addr:x} (type={array_data.type.name}))")
    # Get non-synthetic because we've defined this type to have synthetic children
    array_data = array_data.GetNonSyntheticValue()
    if utils.has_array_kind(array_data, 'Vec'):
        m_size = utils.get(array_data, "m_size")
        return m_size
    elif utils.has_array_kind(array_data, 'Dict', 'Keyset'):
        array_data = utils.cast_as_specialized_array_data_kind(array_data)
        m_used = utils.get(array_data.children[1].children[0].children[0], "m_used")
        return m_used
    else:
        print("Invalid array type!", file=sys.stderr)
        return None