code: def to_dade_matrix(M, annotations="", filename=None):
      
  
      n, m = M.shape
      A = np.zeros((n + 1, m + 1))
      A[1:, 1:] = M
      if not annotations:
          annotations = np.array(["" for _ in n], dtype=str)
      A[0, :] = annotations
      A[:, 0] = annotations.T
      if filename:
          try:
              np.savetxt(filename, A, fmt='%i')
              print("I saved input matrix in dade format as " + str(filename))
          except ValueError as e:
              print("I couldn't save input matrix.")
              print(str(e))
          finally:
              return A
  
      return A
docs: Returns a Dade matrix from input numpy matrix. Any annotations are added
      as header. If filename is provided and valid, said matrix is also saved
      as text.