def getData(self, key, create_sub_data = False):
        self.need_open()
        if key in self.db:
            if self.verbose > 1:
                print("getData key exists")
                
            t, v = self.get_value_and_value_type(key)
 
            if t == TYPE_SUB: 
                sub_db_name = v['name']
            
                if self.verbose > 1:
                    print("return subData stored as key", key, "using name", sub_db_name)
                return PersistentDataStructure(name = sub_db_name, path = os.path.join(self._dirname) , verbose = self.verbose)
            elif t == TYPE_NPA:
                if self.verbose > 1:
                    print("return nparray value")
                return self._loadNPA(v['fname'])
            else:
                if self.verbose > 1:
                    print("return normal value")
                return v 
        else:
            if not create_sub_data:
                raise KeyError("key not found\n{}".format(key_to_str(key)))
            else:
                if self.verbose > 1:
                    print("getData key does NOT exists -> create subData")
                return self.newSubData(key)
dataset/ETHPy150Open cimatosa/jobmanager/jobmanager/persistentData.py/PersistentDataStructure.getData/original