code: def sortBy(self, col, *cols):
          if isinstance(col, (list, tuple)):
              if cols:
                  raise ValueError("col is a {0} but cols are not empty".format(type(col)))
              col, cols = col[0], col[1:]
          if not all(isinstance(c, basestring) for c in cols) or not(isinstance(col, basestring)):
              raise TypeError("all names should be `str`")
          self._jwrite = self._jwrite.sortBy(col, _to_seq(self._spark._sc, cols))
          return self