<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def list_documents(self, parent, page_size=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None):
 """ Returns the list of all documents of the knowledge base. Example: Args: parent (str):
 Required. The knowledge base to list all documents for. Format: ``projects/<Project ID>/knowledgeBases/<Knowledge Base ID>``. page_size (int):
 The maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page. retry (Optional[google.api_core.retry.Retry]):
 A retry object used to retry requests. If ``None`` is specified, requests will not be retried. timeout (Optional[float]):
 The amount of time, in seconds, to wait for the request to complete. Note that if ``retry`` is specified, the timeout applies to each individual attempt. metadata (Optional[Sequence[Tuple[str, str]]]):
 Additional metadata that is provided to the method. Returns: A :class:`~google.gax.PageIterator` instance. By default, this is an iterable of :class:`~google.cloud.dialogflow_v2beta1.types.Document` instances. This object can also be configured to iterate over the pages of the response through the `options` parameter. Raises: google.api_core.exceptions.GoogleAPICallError: If the request failed for any reason. google.api_core.exceptions.RetryError: If the request failed due to a retryable error and retry attempts failed. ValueError: If the parameters are invalid. """

        # Wrap the transport method to add retry and timeout logic.
        if 'list_documents' not in self._inner_api_calls:
            self._inner_api_calls[
                'list_documents'] = google.api_core.gapic_v1.method.wrap_method(
                    self.transport.list_documents,
                    default_retry=self._method_configs['ListDocuments'].retry,
                    default_timeout=self._method_configs['ListDocuments']
                    .timeout,
                    client_info=self._client_info,
                )

        request = document_pb2.ListDocumentsRequest(
            parent=parent,
            page_size=page_size,
        )
        iterator = google.api_core.page_iterator.GRPCIterator(
            client=None,
            method=functools.partial(
                self._inner_api_calls['list_documents'],
                retry=retry,
                timeout=timeout,
                metadata=metadata),
            request=request,
            items_field='documents',
            request_token_field='page_token',
            response_token_field='next_page_token',
        )
        return iterator