code: def sort(self, key_column_names, ascending=True):
          sort_column_names = []
          sort_column_orders = []
          if (type(key_column_names) == str):
              sort_column_names = [key_column_names]
          elif (type(key_column_names) == list):
              if (len(key_column_names) == 0):
                  raise ValueError("Please provide at least one column to sort")
              first_param_types = set([type(i) for i in key_column_names])
              if (len(first_param_types) != 1):
                  raise ValueError("key_column_names element are not of the same type")
              first_param_type = first_param_types.pop()
              if (first_param_type == tuple):
                  sort_column_names = [i[0] for i in key_column_names]
                  sort_column_orders = [i[1] for i in key_column_names]
              elif(first_param_type == str):
                  sort_column_names = key_column_names
              else:
                  raise TypeError("key_column_names type is not supported")
          else:
              raise TypeError("key_column_names type is not correct. Supported types are str, list of str or list of (str,bool) pair.")
          if (len(sort_column_orders) == 0):
              sort_column_orders = [ascending for i in sort_column_names]
          my_column_names = set(self.column_names())
          for column in sort_column_names:
              if (type(column) != str):
                  raise TypeError("Only string parameter can be passed in as column names")
              if (column not in my_column_names):
                  raise ValueError("SFrame has no column named: '" + str(column) + "'")
              if (self[column].dtype not in (str, int, float,datetime.datetime)):
                  raise TypeError("Only columns of type (str, int, float) can be sorted")
          with cython_context():
              return SFrame(_proxy=self.__proxy__.sort(sort_column_names, sort_column_orders))