<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 Line Item From BigQuery Parameters
Upload Line Items From BigQuery To DV360.
 1. Specify the table or view where the lineitem data is defined.
 1. The schema should match <a href='https
Step4:  5. Execute Line Item From BigQuery
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.
  'dataset': '',
  'query': 'SELECT * FROM `Dataset.Table`;',
  'legacy': False,
}
print("Parameters Set To: %s" % FIELDS)
Explanation: 4. Enter Line Item From BigQuery Parameters
Upload Line Items From BigQuery To DV360.
 1. Specify the table or view where the lineitem data is defined.
 1. The schema should match <a href='https://developers.google.com/bid-manager/guides/entity-write/format' target='_blank'>Entity Write Format</a>.
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 = [
  {
    'lineitem': {
      'auth': 'user',
      'write': {
        'dry_run': False,
        'bigquery': {
          'dataset': {'field': {'name': 'dataset','kind': 'string','order': 1,'default': ''}},
          'query': {'field': {'name': 'query','kind': 'string','order': 2,'default': 'SELECT * FROM `Dataset.Table`;'}},
          'legacy': {'field': {'name': 'legacy','kind': 'boolean','order': 3,'default': False}}
        }
      }
    }
  }
]
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 Line Item From BigQuery
This does NOT need to be modified unless you are changing the recipe, click play.
End of explanation
<END_TASK>