original_docstring: 
          Return the names of remote refs (stripped of the remote name) and tags
          which are exposed as environments. If a branch or tag matches
          
docstring: Return the names of remote refs (stripped of the remote name) and tags
  which are exposed as environments. If a branch or tag matches
docstring_tokens: Return the names of remote refs ( stripped of the remote name ) and tags which are exposed as environments . If a branch or tag matches
code: def _get_envs_from_ref_paths(self, refs):
          '''
          Return the names of remote refs (stripped of the remote name) and tags
          which are exposed as environments. If a branch or tag matches
          '''
          def _check_ref(env_set, base_ref, rname):
              '''
              Check the ref and resolve it as the base_ref if it matches. If the
              resulting env is exposed via whitelist/blacklist, add it to the
              env_set.
              '''
              _envs = []
              if rname in self.saltenv_revmap:
                  _envs.extend(self.saltenv_revmap[rname])
                  if base_ref == rname:
                      _envs.append('base')
              else:
                  if base_ref == rname:
                      _envs.append('base')
                  else:
                      _envs.append(rname)
              for env_name in _envs:
                  if self.env_is_exposed(env_name):
                      env_set.add(env_name)
  
          ret = set()
          base_ref = getattr(self, 'base', None)
          for ref in refs:
              ref = re.sub('^refs/', '', ref)
              rtype, rname = ref.split('/', 1)
              if rtype == 'remotes':
                  parted = rname.partition('/')
                  rname = parted[2] if parted[2] else parted[0]
                  _check_ref(ret, base_ref, rname)
              elif rtype == 'tags':
                  _check_ref(ret, base_ref, rname)
          return ret
code_tokens: def _get_envs_from_ref_paths ( self , refs ) : def _check_ref ( env_set , base_ref , rname ) : '''
              Check the ref and resolve it as the base_ref if it matches. If the
              resulting env is exposed via whitelist/blacklist, add it to the
              env_set.
              ''' _envs = [ ] if rname in self . saltenv_revmap : _envs . extend ( self . saltenv_revmap [ rname ] ) if base_ref == rname : _envs . append ( 'base' ) else : if base_ref == rname : _envs . append ( 'base' ) else : _envs . append ( rname ) for env_name in _envs : if self . env_is_exposed ( env_name ) : env_set . add ( env_name ) ret = set ( ) base_ref = getattr ( self , 'base' , None ) for ref in refs : ref = re . sub ( '^refs/' , '' , ref ) rtype , rname = ref . split ( '/' , 1 ) if rtype == 'remotes' : parted = rname . partition ( '/' ) rname = parted [ 2 ] if parted [ 2 ] else parted [ 0 ] _check_ref ( ret , base_ref , rname ) elif rtype == 'tags' : _check_ref ( ret , base_ref , rname ) return ret
short_docstring: Return the names of remote refs (stripped of the remote name) and tags
  which are exposed as environments.
short_docstring_tokens: Return the names of remote refs ( stripped of the remote name ) and tags which are exposed as environments .
comment: '''
          Return the names of remote refs (stripped of the remote name) and tags
          which are exposed as environments. If a branch or tag matches
          '''$SEP$'''
              Check the ref and resolve it as the base_ref if it matches. If the
              resulting env is exposed via whitelist/blacklist, add it to the
              env_set.
              '''