code: def _map(expr, func, rtype=None, resources=None, args=(), **kwargs):
      
  
      name = None
      if isinstance(func, FunctionWrapper):
          if func.output_names:
              if len(func.output_names) > 1:
                  raise ValueError('Map column has more than one name')
              name = func.output_names[0]
          if func.output_types:
              rtype = rtype or func.output_types[0]
          func = func._func
  
      if rtype is None:
          rtype = utils.get_annotation_rtype(func)
  
      from ...models import Function
  
      rtype = rtype or expr.dtype
      output_type = types.validate_data_type(rtype)
  
      if isinstance(func, six.string_types):
          pass
      elif isinstance(func, Function):
          pass
      elif inspect.isclass(func):
          pass
      elif not callable(func):
          raise ValueError('`func` must be a function or a callable class')
  
      collection_resources = utils.get_collection_resources(resources)
  
      is_seq = isinstance(expr, SequenceExpr)
      if is_seq:
          return MappedExpr(_data_type=output_type, _func=func, _inputs=[expr, ],
                            _func_args=args, _func_kwargs=kwargs, _name=name,
                            _resources=resources, _collection_resources=collection_resources)
      else:
          return MappedExpr(_value_type=output_type, _func=func, _inputs=[expr, ],
                            _func_args=args, _func_kwargs=kwargs, _name=name,
                            _resources=resources, _collection_resources=collection_resources)
docs: Call func on each element of this sequence.
  
      :param func: lambda, function, :class:`odps.models.Function`,
                   or str which is the name of :class:`odps.models.Funtion`
      :param rtype: if not provided, will be the dtype of this sequence
      :return: a new sequence
  
      :Example:
  
      >>> df.id.map(lambda x: x + 1)