parameters: (self, variables, default='')
return_statement: return smart_text(instance_id)
docstring: Retrieve the instance ID from the given dict of host variables.
  
          The instance ID variable may be specified as 'foo.bar', in which case
          the lookup will traverse into nested dicts, equivalent to:
  
          from_dict.get('foo', {}).get('bar', default)
  
          Multiple ID variables may be specified as 'foo.bar,foobar', so that
          it will first try to find 'bar' inside of 'foo', and if unable,
          will try to find 'foobar' as a fallback
docstring_summary: Retrieve the instance ID from the given dict of host variables.
docstring_tokens: Retrieve the instance ID from the given dict of host variables .
function: def _get_instance_id(self, variables, default=''):
          """
          Retrieve the instance ID from the given dict of host variables.
  
          The instance ID variable may be specified as 'foo.bar', in which case
          the lookup will traverse into nested dicts, equivalent to:
  
          from_dict.get('foo', {}).get('bar', default)
  
          Multiple ID variables may be specified as 'foo.bar,foobar', so that
          it will first try to find 'bar' inside of 'foo', and if unable,
          will try to find 'foobar' as a fallback
          """
          instance_id = default
          if getattr(self, 'instance_id_var', None):
              for single_instance_id in self.instance_id_var.split(','):
                  from_dict = variables
                  for key in single_instance_id.split('.'):
                      if not hasattr(from_dict, 'get'):
                          instance_id = default
                          break
                      instance_id = from_dict.get(key, default)
                      from_dict = instance_id
                  if instance_id:
                      break
          return smart_text(instance_id)
function_tokens: def _get_instance_id ( self , variables , default = '' ) : instance_id = default if getattr ( self , 'instance_id_var' , None ) : for single_instance_id in self . instance_id_var . split ( ',' ) : from_dict = variables for key in single_instance_id . split ( '.' ) : if not hasattr ( from_dict , 'get' ) : instance_id = default break instance_id = from_dict . get ( key , default ) from_dict = instance_id if instance_id : break return smart_text ( instance_id )