def __determine_resource_obj(service, resource):
  """Find the desired resource object method container from the service.

  Args:
    service: [stub] Google API stub object.
    resource: [string]  '.' delimited resource name in service API.
  """
  path = resource.split('.')
  node = service
  for elem in path:
    try:
      node = getattr(node, elem)()
    except AttributeError:
      raise AttributeError('"{0}" has no attribute "{1}"'.format(
          '.'.join(path[0:path.index(elem)]), elem))
  return node