def get_object_properties(vim, moref, properties_to_collect):
    if moref is None:
        return None

    client_factory = vim.client.factory
    all_properties = (properties_to_collect is None or
                      len(properties_to_collect) == 0)
    property_spec = build_property_spec(
        client_factory,
        type_=moref._type,
        properties_to_collect=properties_to_collect,
        all_properties=all_properties)
    object_spec = build_object_spec(client_factory, moref, [])
    property_filter_spec = build_property_filter_spec(client_factory,
                                                      [property_spec],
                                                      [object_spec])

    options = client_factory.create('ns0:RetrieveOptions')
    options.maxObjects = 1
    retrieve_result = vim.RetrievePropertiesEx(
        vim.service_content.propertyCollector,
        specSet=[property_filter_spec],
        options=options)
    cancel_retrieval(vim, retrieve_result)
    return retrieve_result.objects
Remove contributor from node subscriptions unless the user is an
dataset/ETHPy150Open openstack/oslo.vmware/oslo_vmware/vim_util.py/get_object_properties--crossover with--dataset/ETHPy150Open CenterForOpenScience/osf.io/website/notifications/utils.py/remove_contributor_from_subscriptions