<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def connect( project_id: Optional[str] = None, dataset_id: Optional[str] = None, credentials: Optional[google.auth.credentials.Credentials] = None, ) -> BigQueryClient: """Create a BigQueryClient for use with Ibis. Parameters project_id : str A BigQuery project id. dataset_id : str A dataset id that lives inside of the project indicated by `project_id`. credentials : google.auth.credentials.Credentials Returns ------- BigQueryClient """

    if credentials is None:
        credentials_cache = pydata_google_auth.cache.ReadWriteCredentialsCache(
            filename="ibis.json"
        )
        credentials, project_id = pydata_google_auth.default(
            SCOPES,
            client_id=CLIENT_ID,
            client_secret=CLIENT_SECRET,
            credentials_cache=credentials_cache,
        )

    return BigQueryClient(
        project_id, dataset_id=dataset_id, credentials=credentials
    )