<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 CM360 Report To Storage
Move existing CM report into a Storage bucket.
License
Copyright 2020 Google LLC,
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https
Step1:  2. Set Configuration
This code is required to initialize the project. Fill in required fields and press play.
If the recipe uses a Google Cloud Project
Step2:  3. Enter CM360 Report To Storage Recipe Parameters
Specify an account id.
Specify either report name or report id to move a report.
The most recent file will be moved to the bucket.
Schema is pulled from the official CM specification.
Modify the values below for your use case, can be done multiple times, then click play.
Step3:  4. Execute CM360 Report To Storage
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: CM360 Report To Storage
Move existing CM report into a Storage bucket.
License
Copyright 2020 Google LLC,
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Disclaimer
This is not an officially supported Google product. It is a reference implementation. There is absolutely NO WARRANTY provided for using this code. The code is Apache Licensed and CAN BE fully modified, white labeled, and disassembled by your team.
This code generated (see starthinker/scripts for possible source):
  - Command: "python starthinker_ui/manage.py colab"
  - Command: "python starthinker/tools/colab.py [JSON RECIPE]"
1. Install Dependencies
First install the libraries needed to execute recipes, this only needs to be done once, then click play.
End of explanation
from starthinker.util.configuration import Configuration
CONFIG = Configuration(
  project="",
  client={},
  service={},
  user="/content/user.json",
  verbose=True
)
Explanation: 2. Set Configuration
This code is required to initialize the project. Fill in required fields and press play.
If the recipe uses a Google Cloud Project:
Set the configuration project value to the project identifier from these instructions.
If the recipe has auth set to user:
If you have user credentials:
Set the configuration user value to your user credentials JSON.
If you DO NOT have user credentials:
Set the configuration client value to downloaded client credentials.
If the recipe has auth set to service:
Set the configuration service value to downloaded service credentials.
End of explanation
FIELDS = {
  'auth_read':'user',  # Credentials used for reading data.
  'auth_write':'service',  # Credentials used for writing data.
  'account':'',
  'report_id':'',
  'report_name':'',
  'bucket':'',
  'path':'CM_Report',
}
print("Parameters Set To: %s" % FIELDS)
Explanation: 3. Enter CM360 Report To Storage Recipe Parameters
Specify an account id.
Specify either report name or report id to move a report.
The most recent file will be moved to the bucket.
Schema is pulled from the official CM specification.
Modify the values below for your use case, can be done multiple times, then click play.
End of explanation
from starthinker.util.configuration import execute
from starthinker.util.recipe import json_set_fields
TASKS = [
  {
    'dcm':{
      'auth':{'field':{'name':'auth_read','kind':'authentication','order':1,'default':'user','description':'Credentials used for reading data.'}},
      'report':{
        'account':{'field':{'name':'account','kind':'integer','order':2,'default':''}},
        'report_id':{'field':{'name':'report_id','kind':'integer','order':3,'default':''}},
        'name':{'field':{'name':'report_name','kind':'string','order':4,'default':''}}
      },
      'out':{
        'storage':{
          'auth':{'field':{'name':'auth_write','kind':'authentication','order':1,'default':'service','description':'Credentials used for writing data.'}},
          'bucket':{'field':{'name':'bucket','kind':'string','order':5,'default':''}},
          'path':{'field':{'name':'path','kind':'string','order':6,'default':'CM_Report'}}
        }
      }
    }
  }
]
json_set_fields(TASKS, FIELDS)
execute(CONFIG, TASKS, force=True)
Explanation: 4. Execute CM360 Report To Storage
This does NOT need to be modified unless you are changing the recipe, click play.
End of explanation
<END_TASK>