<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def array(data, tcoords=None, chcoords=None, scalarcoords=None, datacoords=None, attrs=None, name=None):
 """Create an array as an instance of xarray.DataArray with Decode accessor. Args: data (numpy.ndarray):
 2D (time x channel) array. tcoords (dict, optional):
 Dictionary of arrays that label time axis. chcoords (dict, optional):
 Dictionary of arrays that label channel axis. scalarcoords (dict, optional):
 Dictionary of values that don't label any axes (point-like). datacoords (dict, optional):
 Dictionary of arrays that label time and channel axes. attrs (dict, optional):
 Dictionary of attributes to add to the instance. name (str, optional):
 String that names the instance. Returns: array (decode.array):
 Deode array. """

    # initialize coords with default values
    array = xr.DataArray(data, dims=('t', 'ch'), attrs=attrs, name=name)
    array.dca._initcoords()

    # update coords with input values (if any)
    if tcoords is not None:
        array.coords.update({key: ('t', tcoords[key]) for key in tcoords})

    if chcoords is not None:
        array.coords.update({key: ('ch', chcoords[key]) for key in chcoords})

    if scalarcoords is not None:
        array.coords.update(scalarcoords)

    if datacoords is not None:
        array.coords.update({key: (('t', 'ch'), datacoords[key]) for key in datacoords})

    return array