<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 1. Install Dependencies
First install the libraries needed to execute recipes, this only needs to be done once, then click play.
Step1:  2. Get Cloud Project ID
To run this recipe requires a Google Cloud Project, this only needs to be done once, then click play.
Step2:  3. Get Client Credentials
To read and write to various endpoints requires downloading client credentials, this only needs to be done once, then click play.
Step3:  4. Enter Google Analytics Timeline Parameters
Download Google Analytics settings to a BigQuery table.
 1. Enter the dateset to which the Google Analytics settings will be downloaded.
 1. Add the starthinker service account email to the Google Analytics account(s) in which you are interested.
 1. Schedule the recipe to run once a day.
Modify the values below for your use case, can be done multiple times, then click play.
Step4:  5. Execute Google Analytics Timeline
This does NOT need to be modified unless you are changing the recipe, click play.
<ASSISTANT_TASK:>
Python Code:
!pip install git+https://github.com/google/starthinker
Explanation: 1. Install Dependencies
First install the libraries needed to execute recipes, this only needs to be done once, then click play.
End of explanation
CLOUD_PROJECT = 'PASTE PROJECT ID HERE'
print("Cloud Project Set To: %s" % CLOUD_PROJECT)
Explanation: 2. Get Cloud Project ID
To run this recipe requires a Google Cloud Project, this only needs to be done once, then click play.
End of explanation
CLIENT_CREDENTIALS = 'PASTE CREDENTIALS HERE'
print("Client Credentials Set To: %s" % CLIENT_CREDENTIALS)
Explanation: 3. Get Client Credentials
To read and write to various endpoints requires downloading client credentials, this only needs to be done once, then click play.
End of explanation
FIELDS = {
  'auth_read': 'user',  # Credentials used for reading data.
  'account_ids': [],
  'dataset': '',  # Dataset to be written to in BigQuery.
}
print("Parameters Set To: %s" % FIELDS)
Explanation: 4. Enter Google Analytics Timeline Parameters
Download Google Analytics settings to a BigQuery table.
 1. Enter the dateset to which the Google Analytics settings will be downloaded.
 1. Add the starthinker service account email to the Google Analytics account(s) in which you are interested.
 1. Schedule the recipe to run once a day.
Modify the values below for your use case, can be done multiple times, then click play.
End of explanation
from starthinker.util.project import project
from starthinker.script.parse import json_set_fields
USER_CREDENTIALS = '/content/user.json'
TASKS = [
  {
    'ga_settings_download': {
      'description': 'Will create tables with format ga_* to hold each endpoint via a call to the API list function.',
      'auth': 'user',
      'accounts': {'field': {'name': 'account_ids','kind': 'integer_list','order': 1,'default': []}},
      'dataset': {'field': {'name': 'dataset','kind': 'string','order': 2,'default': '','description': 'Dataset to be written to in BigQuery.'}}
    }
  }
]
json_set_fields(TASKS, FIELDS)
project.initialize(_recipe={ 'tasks':TASKS }, _project=CLOUD_PROJECT, _user=USER_CREDENTIALS, _client=CLIENT_CREDENTIALS, _verbose=True, _force=True)
project.execute(_force=True)
Explanation: 5. Execute Google Analytics Timeline
This does NOT need to be modified unless you are changing the recipe, click play.
End of explanation
<END_TASK>