def get_access_path(key, parts):
 path = []
 for (is_attribute, specifier) in parts:
  if is_attribute:
   path.append('.{}'.format(specifier))
  else:
   path.append('[{!r}]'.format(specifier))
 return (str(key) + ''.join(path))

def get_access_path ( key , parts ) : path = [ ] for ( is_attribute , specifier ) in parts : if is_attribute : path . append ( '.{}' . format ( specifier ) ) else : path . append ( '[{!r}]' . format ( specifier ) ) return ( str ( key ) + '' . join ( path ) )
given a list of format specifiers .