def dep_attrs(snippet, resource_name):
 if isinstance(snippet, Function):
  return snippet.dep_attrs(resource_name)
 elif isinstance(snippet, collections.Mapping):
  attrs = (dep_attrs(value, resource_name) for value in snippet.items())
  return itertools.chain.from_iterable(attrs)
 elif ((not isinstance(snippet, six.string_types)) and isinstance(snippet, collections.Iterable)):
  attrs = (dep_attrs(value, resource_name) for value in snippet)
  return itertools.chain.from_iterable(attrs)
 return []

def dep_attrs ( snippet , resource_name ) : if isinstance ( snippet , Function ) : return snippet . dep_attrs ( resource_name ) elif isinstance ( snippet , collections . Mapping ) : attrs = ( dep_attrs ( value , resource_name ) for value in snippet . items ( ) ) return itertools . chain . from_iterable ( attrs ) elif ( ( not isinstance ( snippet , six . string_types ) ) and isinstance ( snippet , collections . Iterable ) ) : attrs = ( dep_attrs ( value , resource_name ) for value in snippet ) return itertools . chain . from_iterable ( attrs ) return [ ]
iterator over dependent attrs of a resource in a template snippet .