<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _title_for_slice(self, truncate=50):
 """ If the dataarray has 1 dimensional coordinates or comes from a slice we can show that info in the title Parameters truncate : integer maximum number of characters for title Returns ------- title : string Can be used for plot titles """

        one_dims = []
        for dim, coord in self.coords.items():
            if coord.size == 1:
                one_dims.append('{dim} = {v}'.format(
                    dim=dim, v=format_item(coord.values)))

        title = ', '.join(one_dims)
        if len(title) > truncate:
            title = title[:(truncate - 3)] + '...'

        return title