def get_properties_storage(instance: object) -> dict:
    """
    Returns the dictionary into which the managed properties are recorded.

    If the object has an instance or class attribute named 'properties_storage', the value of
    this attribute is used as the storage for managed properties, provided that it is a dict.
    Otherwise an instance attribute with that name is created with an empty dictionary as its value.

    :param  instance: the instance of some class in which the property is living.
    :returns: the properties storage dictionary
    """
    storage_attr_name = 'properties_storage'
    try:
        storage = getattr(instance, storage_attr_name)
    except AttributeError:
        setattr(instance, storage_attr_name, {})
        storage = getattr(instance, storage_attr_name)
    return storage