def _decode_base64(self, data):
        if isinstance(data, six.binary_type) and hasattr(data, "decode"):
            try:
                data = data.decode("utf-8")
            except __HOLE__:
                return None
        data = re.sub(r'\s', '', data)
        if not self.B64_REGEX.match(data):
            return None
        try:
            return base64.b64decode(data)
        except TypeError:
            return None
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/api/openstack/compute/legacy_v2/servers.py/Controller._decode_base64