<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _detach_dim_scale(self, name):
 """Detach the dimension scale corresponding to a dimension name."""

        for var in self.variables.values():
            for n, dim in enumerate(var.dimensions):
                if dim == name:
                    var._h5ds.dims[n].detach_scale(self._all_h5groups[dim])

        for subgroup in self.groups.values():
            if dim not in subgroup._h5group:
                subgroup._detach_dim_scale(name)