code: def with_cardinality(cls, cardinality, converter, pattern=None,
                           listsep=','):
          
          if cardinality is Cardinality.one:
              return converter
          # -- NORMAL-CASE
          builder_func = getattr(cls, "with_%s" % cardinality.name)
          if cardinality is Cardinality.zero_or_one:
              return builder_func(converter, pattern)
          else:
              # -- MANY CASE: 0..*, 1..*
              return builder_func(converter, pattern, listsep=listsep)
docs: Creates a type converter for the specified cardinality
          by using the type converter for T.
  
          :param cardinality: Cardinality to use (0..1, 0..*, 1..*).
          :param converter: Type converter (function) for data type T.
          :param pattern:  Regexp pattern for an item (=converter.pattern).
          :return: type-converter for optional<T> (T or None).