def METHOD_NAME(self, item, identity_field=None):
    """ Return a Sorting Hat identity using bugzilla user data """
    def fill_list_identity(identity, user_list_data):
        """ Fill identity with user data in first item in list """
        identity['username'] = user_list_data[0]['__text__']
        if '@' in identity['username']:
            identity['email'] = identity['username']
        if 'name' in user_list_data[0]:
            identity['name'] = user_list_data[0]['name']
        return identity
    identity = {}
    for field in ['name', 'email', 'username']:
        # Basic fields in Sorting Hat
        identity[field] = None
    user = item  # by default a specific user dict is used
    if isinstance(item, dict) and 'data' in item:
        user = item['data'][identity_field]
    identity = fill_list_identity(identity, user)
    return identity