code: def get_dirname(self, index):
          
          fname = self.get_filename(index)
          if fname:
              if osp.isdir(fname):
                  return fname
              else:
                  return osp.dirname(fname)
docs: Return dirname associated with *index*