code: def count(expr):
      
  
      if isinstance(expr, SequenceExpr):
          unique_input = _extract_unique_input(expr)
          if unique_input:
              return nunique(unique_input).rename('count')
          else:
              return Count(_value_type=types.int64, _input=expr)
      elif isinstance(expr, SequenceGroupBy):
          return GroupedCount(_data_type=types.int64, _input=expr.to_column(),
                              _grouped=expr.input)
      elif isinstance(expr, CollectionExpr):
          return Count(_value_type=types.int64, _input=expr).rename('count')
      elif isinstance(expr, GroupBy):
          return GroupedCount(_data_type=types.int64, _input=expr.input,
                              _grouped=expr).rename('count')
docs: Value counts
  
      :param expr:
      :return: