def _compute_bgid(self, bg=None):
if bg is None:<EOL><INDENT>bg = self._bgdata<EOL><DEDENT>if isinstance(bg, qpimage.QPImage):<EOL><INDENT>if "<STR_LIT>" in bg:<EOL><INDENT>return bg["<STR_LIT>"]<EOL><DEDENT>else:<EOL><INDENT>data = [bg.amp, bg.pha]<EOL>for key in sorted(list(bg.meta.keys())):<EOL><INDENT>val = bg.meta[key]<EOL>data.append("<STR_LIT>".format(key, val))<EOL><DEDENT>return hash_obj(data)<EOL><DEDENT><DEDENT>elif (isinstance(bg, list) and<EOL>isinstance(bg[<NUM_LIT:0>], qpimage.QPImage)):<EOL><INDENT>data = []<EOL>for bgii in bg:<EOL><INDENT>data.append(self._compute_bgid(bgii))<EOL><DEDENT>return hash_obj(data)<EOL><DEDENT>elif (isinstance(bg, SeriesData) and<EOL>(len(bg) == <NUM_LIT:1> or<EOL>len(bg) == len(self))):<EOL><INDENT>return bg.identifier<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>".format(bg))<EOL><DEDENT>
Return a unique identifier for the background data