code: def write_layout(_path):
      
  
      path.mkdir_uchroot("/etc/portage/metadata")
      path.mkfile_uchroot("/etc/portage/metadata/layout.conf")
      with open(_path, 'w') as layoutconf:
          lines = '''masters = gentoo'''
          layoutconf.write(lines)
docs: Write a valid gentoo layout file to :path:.
  
      Args:
          path - The output path of the layout.conf