<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_data_flow_id(self, data_flow_id):
 """ Check the data flow id and calculate a new one if its None :param data_flow_id: The data flow id to check :return: The new data flow id :raises exceptions.AttributeError: if data_flow.data_flow_id already exists """

        if data_flow_id is not None:
            if data_flow_id in self._data_flows.keys():
                raise AttributeError("The data_flow id %s already exists. Cannot add data_flow!", data_flow_id)
        else:
            data_flow_id = generate_data_flow_id()
            while data_flow_id in self._data_flows.keys():
                data_flow_id = generate_data_flow_id()
        return data_flow_id