<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_or_create_fact_term(iobject_family_name, fact_term_name, fact_term_attribute, iobject_type_name, iobject_type_namespace_uri, fact_dt_name=DINGOS_DEFAULT_FACT_DATATYPE, fact_dt_namespace_name=None, fact_dt_kind=FactDataType.UNKNOWN_KIND, fact_dt_namespace_uri=DINGOS_NAMESPACE_URI, dingos_class_map=dingos_class_map ):
 """ Get or create a fact term. """


    if not fact_term_attribute:
        fact_term_attribute = ''

    # create or retrieve the enrichment type and revision

    iobject_family, created = dingos_class_map['InfoObjectFamily'].objects.get_or_create(name=iobject_family_name)

    # create or retrieve namespace of data type

    fact_dt_namespace, created = dingos_class_map['DataTypeNameSpace'].objects.get_or_create(uri=fact_dt_namespace_uri)

    # create or retrieve namespace of the infoobject type

    iobject_type_namespace, created = dingos_class_map['DataTypeNameSpace'].objects.get_or_create(uri=iobject_type_namespace_uri)

    if created and fact_dt_namespace_name:
        fact_dt_namespace.name = fact_dt_namespace_name
        fact_dt_namespace.save()


    # create or retrieve the fact-value data type object
    fact_dt, created = dingos_class_map['FactDataType'].objects.get_or_create(name=fact_dt_name,
                                                                              namespace=fact_dt_namespace)

    if created:
        fact_dt.kind = fact_dt_kind
        fact_dt.save()

    # create or retreive the iobject type
    iobject_type, created = dingos_class_map['InfoObjectType'].objects.get_or_create(name=iobject_type_name,
                                                                                    iobject_family=iobject_family,
                                                                                    namespace=iobject_type_namespace)

    fact_term, created = dingos_class_map['FactTerm'].objects.get_or_create(term=fact_term_name,
                                                                           attribute=fact_term_attribute)

    fact_term_2_type, dummy = dingos_class_map['FactTerm2Type'].objects.get_or_create(fact_term=fact_term,
                                                                                     iobject_type=iobject_type,
                                                                                     )

    fact_term_2_type.fact_data_types.add(fact_dt)

    fact_term_2_type.save()

    return fact_term, created