docs: def read_result(path, name, i=None, j=None, s=0, N=None,
                  excluded_mu=[], use_netcdf=True, clone=None):
      r"""This function reads the results stored in path under file name.dat
      returning them as a list of N^2 lists of the form
      [frequency, rho22, rho33, ... rho_N,N-1]. Alternatively it can return only
      two lists [frequency, rho_i,j,s] where s must be 1 for the real part and
      -1 for the imaginary part.
      """
      if clone is not None:
          clone = '_'+str(clone)
      else:
          clone = ''
  
      if use_netcdf:
          ncfile = Dataset(path+name+clone+'.nc', 'r')
          matrix = ncfile.variables['matrix'][:]
          vector = ncfile.variables['vector'][:]
          Nrho, n_points = len(matrix), len(matrix[0])
          ncfile.close()
  
          if i is not None:
              mu = Mu(i, j, s, N, excluded_mu)
              if sage_included:
                  return [(vector[k], matrix[mu-1][k]) for k in range(n_points)]
              else:
                  return vector, matrix[mu-1]
          else:
              return [vector] + [matrix[k] for k in range(Nrho)]
          # ln=[for i in range(m)]
      else:
          r = file(path+name+clone+'.dat', 'r')
          l = r.readlines()
          r.close()
  
          try:
              ln = [[float(num) for num in li.split()] for li in l]
          except:
              print(num)
              print([l[0]])
              print([l[-2]])
              print([l[-1]])
              raise ValueError
  
          if i is not None:
              mu = Mu(i, j, s, N, excluded_mu)
              if sage_included:
                  return [(li[0], li[mu]) for li in ln]
              else:
                  x = [li[0] for li in ln]
                  y = [li[mu] for li in ln]
                  return x, y
          else:
              dat = [[ln[ii][0] for ii in range(len(ln))]]
              dat += [[ln[ii][mu+1] for ii in range(len(ln))]
                      for mu in range(N**2-1)]
              return dat