def map_relation_type(relation_type):
 if isinstance(relation_type, ProductCrossSellType):
  return relation_type
 attr_name = force_ascii(relation_type).upper()
 try:
  return getattr(ProductCrossSellType, attr_name)
 except AttributeError:
  raise LookupError(('Unknown ProductCrossSellType %r' % (relation_type,)))

def map_relation_type ( relation_type ) : if isinstance ( relation_type , ProductCrossSellType ) : return relation_type attr_name = force_ascii ( relation_type ) . upper ( ) try : return getattr ( ProductCrossSellType , attr_name ) except AttributeError : raise LookupError ( ( 'Unknown ProductCrossSellType %r' % ( relation_type , ) ) )
map relation type to enum value .