docs: def get_orient(samp_data, er_sample_name, **kwargs):
      """
      samp_data : PmagPy list of dicts or pandas DataFrame
      er_sample_name : sample name
      """
      if isinstance(samp_data, pd.DataFrame):
          samp_data = (samp_data.T.apply(dict))
      # set orientation priorities
      EX = ["SO-ASC", "SO-POM"]
      samp_key, az_key, dip_key = 'er_sample_name', 'sample_azimuth', 'sample_dip'
      disc_key, or_key, meth_key = 'sample_description', 'sample_orientation_flag',\
          'magic_method_codes'
      if 'data_model' in list(kwargs.keys()) and kwargs['data_model'] == 3:
          samp_key, az_key, dip_key = 'sample', 'azimuth', 'dip'
          disc_key, or_key, meth_key = 'description', 'orientation_quality',\
              'method_codes'
      orient = {samp_key: er_sample_name, az_key: "",
                dip_key: "", disc_key: ""}
      # get all the orientation data for this sample
      orients = get_dictitem(samp_data, samp_key, er_sample_name, 'T')
      if len(orients) > 0 and or_key in list(orients[0].keys()):
          # exclude all samples with bad orientation flag
          orients = get_dictitem(orients, or_key, 'b', 'F')
      if len(orients) > 0:
          orient = orients[0]  # re-initialize to first one
      methods = get_dictitem(orients, meth_key, 'SO-', 'has')
      # get a list of all orientation methods for this sample
      methods = get_dictkey(methods, meth_key, '')
      SO_methods = []
      for methcode in methods:
          meths = methcode.split(":")
          for meth in meths:
              if (meth.strip() not in EX) and meth.startswith('SO-'):
                  SO_methods.append(meth.strip())
      # find top priority orientation method
      if len(SO_methods) == 0:
          print("no orientation data for sample ", er_sample_name)
          # preserve meta-data anyway even though orientation is bad
  # get all the orientation data for this sample
          orig_data = get_dictitem(samp_data, samp_key, er_sample_name, 'T')
          if len(orig_data) > 0:
              orig_data = orig_data[0]
          else:
              orig_data = []
          az_type = "SO-NO"
      else:
          SO_priorities = set_priorities(SO_methods, 0)
          az_type = SO_methods[SO_methods.index(SO_priorities[0])]
          orient = get_dictitem(orients, meth_key, az_type, 'has')[
              0]  # re-initialize to best one
      return orient, az_type