See Authentication for the default behavior of the DataSourceClient and TrainingSetClient.
To override the API key:
from domino.data_sources import DataSourceClient
custom_api_key = "VALID_API_KEY"
client = DataSourceClient(api_key=custom_api_key)
db = client.get_datasource("my-db")
To override the location of the token file:
from domino.data_sources import DataSourceClient
custom_token_file = "/valid/token/file/location"
client = DataSourceClient(token_file=custom_token_file)
db = client.get_datasource("my-db")
The training set client is a python module wrapping a set of API methods. To override authentication, you need to set the right environment variable with your own user API key.