<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_deprecated(cls, label, datacenter=None):
 """Check if image if flagged as deprecated."""

        images = cls.list(datacenter, label)
        images_visibility = dict([(image['label'], image['visibility'])
                                  for image in images])
        return images_visibility.get(label, 'all') == 'deprecated'