Integrations/MicrosoftGraphFiles/MicrosoftGraphFiles.py
def remove_identity_key(source):
    """
    this function removes identity key (application, device or user) from LastModifiedBy and CreatedBy keys and
    convert it to "type" key.
    :param source: LastModifiedBy and CreatedBy dictionaries
    :return: camel case dictionary with identity key as type.
    """
    if not isinstance(source, dict):
        LOG("Input is not dictionary. Exist function.")
        return source

    dict_keys = list(source.keys())
    if len(dict_keys) != 1:
        demisto.log("Got more then one identity creator. Exit function")
        return source

    identity_key = dict_keys[0]
    new_source = {}
    if source[identity_key].get("ID"):
        new_source["ID"] = source[identity_key].get("ID")

    new_source["DisplayName"] = source[identity_key].get("DisplayName")
    new_source["Type"] = identity_key

    return new_source

    this function removes identity key (application, device or user) from LastModifiedBy and CreatedBy keys and
    convert it to "type" key.
    :param source: LastModifiedBy and CreatedBy dictionaries
    :return: camel case dictionary with identity key as type.
    
this function removes identity key (application, device or user) from LastModifiedBy and CreatedBy keys and
convert it to "type" key.
this function removes identity key ( application device or user ) from LastModifiedBy and CreatedBy keys and convert it to " type " key .
def remove_identity_key(source):
    if not isinstance(source, dict):
        LOG("Input is not dictionary. Exist function.")
        return source
    dict_keys = list(source.keys())
    if len(dict_keys) != 1:
        demisto.log("Got more then one identity creator. Exit function")
        return source
    identity_key = dict_keys[0]
    new_source = {}
    if source[identity_key].get("ID"):
        new_source["ID"] = source[identity_key].get("ID")
    new_source["DisplayName"] = source[identity_key].get("DisplayName")
    new_source["Type"] = identity_key
    return new_source
def remove_identity_key ( source ) : if not isinstance ( source , dict ) : LOG ( "Input is not dictionary. Exist function." ) return source dict_keys = list ( source . keys ( ) ) if len ( dict_keys ) != 1 : demisto . log ( "Got more then one identity creator. Exit function" ) return source identity_key = dict_keys [ 0 ] new_source = { } if source [ identity_key ] . get ( "ID" ) : new_source [ "ID" ] = source [ identity_key ] . get ( "ID" ) new_source [ "DisplayName" ] = source [ identity_key ] . get ( "DisplayName" ) new_source [ "Type" ] = identity_key return new_source
this function removes identity key (application, device or user) from LastModifiedBy and CreatedBy keys and
convert it to "type" key.
this function removes identity key ( application device or user ) from LastModifiedBy and CreatedBy keys and convert it to " type " key .
"""
    this function removes identity key (application, device or user) from LastModifiedBy and CreatedBy keys and
    convert it to "type" key.
    :param source: LastModifiedBy and CreatedBy dictionaries
    :return: camel case dictionary with identity key as type.
    """
camel case dictionary with identity key as type.
camel case dictionary with identity key as type .
source
LastModifiedBy and CreatedBy dictionaries
LastModifiedBy and CreatedBy dictionaries