<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def replace_project(self, project_key, **kwargs):
 """Replace an existing Project *Create a project with a given id or completely rewrite the project, including any previously added files or linked datasets, if one already exists with the given id.* :param project_key: Username and unique identifier of the creator of a project in the form of owner/id. :type project_key: str :param title: Project title :type title: str :param objective: Short project objective. :type objective: str, optional :param summary: Long-form project summary. :type summary: str, optional :param tags: Project tags. Letters numbers and spaces :type tags: list, optional :param license: Project license :type license: {'Public Domain', 'PDDL', 'CC-0', 'CC-BY', 'ODC-BY', 'CC-BY-SA', 'ODC-ODbL', 'CC BY-NC', 'CC BY-NC-SA', 'Other'} :param visibility: Project visibility :type visibility: {'OPEN', 'PRIVATE'} :param files: File name as dict, source URLs, description and labels() as properties :type files: dict, optional *Description and labels are optional* :param linked_datasets: Initial set of linked datasets. :type linked_datasets: list of object, optional :returns: project object :rtype: object :raises RestApiException: If a server error occurs Examples -------- """

        request = self.__build_project_obj(
            lambda: _swagger.ProjectCreateRequest(
                title=kwargs.get('title'),
                visibility=kwargs.get('visibility')
            ),
            lambda name, url, description, labels:
            _swagger.FileCreateRequest(
                name=name,
                source=_swagger.FileSourceCreateRequest(url=url),
                description=description,
                labels=labels),
            kwargs)
        try:
            project_owner_id, project_id = parse_dataset_key(project_key)
            self._projects_api.replace_project(project_owner_id,
                                               project_id,
                                               body=request)
        except _swagger.rest.ApiException as e:
            raise RestApiError(cause=e)