code: def unstash_index(self, sync=False, branch=None):
          
  
          stash_list = self.git_exec(['stash', 'list'], no_verbose=True)
  
          if branch is None:
              branch = self.get_current_branch_name()
  
          for stash in stash_list.splitlines():
  
              verb = 'syncing' if sync else 'switching'
  
              if (
                  (('Legit' in stash) and
                   ('On {0}:'.format(branch) in stash) and
                   (verb in stash)
                   ) or
                  (('GitHub' in stash) and
                   ('On {0}:'.format(branch) in stash) and
                   (verb in stash)
                   )
              ):
                  return stash[7]
docs: Returns an unstash index if one is available.