def get_object_id_from_graph(access_token=None):
if access_token is None:<EOL><INDENT>access_token = get_graph_token_from_msi()<EOL><DEDENT>endpoint = '<STR_LIT>' + GRAPH_RESOURCE_HOST + '<STR_LIT>'<EOL>headers = {'<STR_LIT>': '<STR_LIT>' + access_token, '<STR_LIT>': GRAPH_RESOURCE_HOST}<EOL>ret = requests.get(endpoint, headers=headers)<EOL>return ret.json()['<STR_LIT:id>']<EOL>
Return the object ID for the Graph user who owns the access token.

    Args:
        access_token (str): A Microsoft Graph access token. (Not an Azure access token.)
                            If not provided, attempt to get it from MSI_ENDPOINT.

    Returns:
        An object ID string for a user or service principal.