
from typing import Optional

from google.auth import credentials as auth_credentials
from google.cloud import aiplatform


#  [START aiplatform_sdk_init_sample]
def init_sample(
    project: Optional[str] = None,
    location: Optional[str] = None,
    experiment: Optional[str] = None,
    staging_bucket: Optional[str] = None,
    credentials: Optional[auth_credentials.Credentials] = None,
    encryption_spec_key_name: Optional[str] = None,
):
    aiplatform.init(
        project=project,
        location=location,
        experiment=experiment,
        staging_bucket=staging_bucket,
        credentials=credentials,
        encryption_spec_key_name=encryption_spec_key_name,
    )


#  [END aiplatform_sdk_init_sample]


from typing import Optional

from google.auth import credentials as auth_credentials


#  [START aiplatform_sdk_init_sample]
def init_sample(
    project: Optional[str] = None,
    location: Optional[str] = None,
    experiment: Optional[str] = None,
    staging_bucket: Optional[str] = None,
    credentials: Optional[auth_credentials.Credentials] = None,
    encryption_spec_key_name: Optional[str] = None,
):

    from google.cloud import aiplatform

    aiplatform.init(
        project=project,
        location=location,
        experiment=experiment,
        staging_bucket=staging_bucket,
        credentials=credentials,
        encryption_spec_key_name=encryption_spec_key_name,
    )


#  [END aiplatform_sdk_init_sample]

Update init sample to import inside of function.
chore: Update init sample to import inside of function.

PiperOrigin-RevId: 485079470

  
  from typing import Optional
  
  from google.auth import credentials as auth_credentials
- from google.cloud import aiplatform
  
  
  #  [START aiplatform_sdk_init_sample]
  def init_sample(
      project: Optional[str] = None,
      location: Optional[str] = None,
      experiment: Optional[str] = None,
      staging_bucket: Optional[str] = None,
      credentials: Optional[auth_credentials.Credentials] = None,
      encryption_spec_key_name: Optional[str] = None,
  ):
+ 
+     from google.cloud import aiplatform
+ 
      aiplatform.init(
          project=project,
          location=location,
          experiment=experiment,
          staging_bucket=staging_bucket,
          credentials=credentials,
          encryption_spec_key_name=encryption_spec_key_name,
      )
  
  
  #  [END aiplatform_sdk_init_sample]
  
Update init sample to import inside of function.
## Code Before:

from typing import Optional

from google.auth import credentials as auth_credentials
from google.cloud import aiplatform


#  [START aiplatform_sdk_init_sample]
def init_sample(
    project: Optional[str] = None,
    location: Optional[str] = None,
    experiment: Optional[str] = None,
    staging_bucket: Optional[str] = None,
    credentials: Optional[auth_credentials.Credentials] = None,
    encryption_spec_key_name: Optional[str] = None,
):
    aiplatform.init(
        project=project,
        location=location,
        experiment=experiment,
        staging_bucket=staging_bucket,
        credentials=credentials,
        encryption_spec_key_name=encryption_spec_key_name,
    )


#  [END aiplatform_sdk_init_sample]

## Instruction:
Update init sample to import inside of function.
## Code After:

from typing import Optional

from google.auth import credentials as auth_credentials


#  [START aiplatform_sdk_init_sample]
def init_sample(
    project: Optional[str] = None,
    location: Optional[str] = None,
    experiment: Optional[str] = None,
    staging_bucket: Optional[str] = None,
    credentials: Optional[auth_credentials.Credentials] = None,
    encryption_spec_key_name: Optional[str] = None,
):

    from google.cloud import aiplatform

    aiplatform.init(
        project=project,
        location=location,
        experiment=experiment,
        staging_bucket=staging_bucket,
        credentials=credentials,
        encryption_spec_key_name=encryption_spec_key_name,
    )


#  [END aiplatform_sdk_init_sample]
