def get(self, asset_name):
    """Serve out the contents of a file to self.response.

    Args:
      asset_name: The name of the static asset to serve. Must be in ASSETS_PATH.
    """
    with self._asset_name_to_path_lock:
      if self._asset_name_to_path is None:
        self._initialize_asset_map()

    if asset_name in self._asset_name_to_path:
      asset_path = self._asset_name_to_path[asset_name]
      try:
        with open(asset_path, 'rb') as f:
          data = f.read()
      except (OSError, __HOLE__):
        logging.exception('Error reading file %s', asset_path)
        self.response.set_status(500)
      else:
        content_type, _ = mimetypes.guess_type(asset_path)
        assert content_type, (
            'cannot determine content-type for %r' % asset_path
        )
        self.response.headers['Content-Type'] = content_type
        self.response.out.write(data)
    else:
      self.response.set_status(404)
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/tools/devappserver2/admin/static_file_handler.py/StaticFileHandler.get