def METHOD_NAME(tiles, method=REGISTER_GLOBAL_SHIFT):
    """
    tiles (list of DataArray of shape YX or tuples of DataArrays): The tiles to compute the registration. 
    If it's tuples, the first tile of each tuple is the “main tile”, and the following ones are 
    dependent tiles.
    method (REGISTER_*): REGISTER_SHIFT → ShiftRegistrar, REGISTER_IDENTITY → IdentityRegistrar
    returns:
        tiles (list of DataArray of shape YX or tuples of DataArrays): The tiles as passed, but with updated 
        MD_POS metadata
    """
    if method == REGISTER_SHIFT:
        registrar = ShiftRegistrar()
    elif method == REGISTER_IDENTITY:
        registrar = IdentityRegistrar()
    elif method == REGISTER_GLOBAL_SHIFT:
        registrar = GlobalShiftRegistrar()
    else:
        raise ValueError("Invalid registrar %s" % (method,))
    # Register tiles
    updatedTiles = []
    for ts in tiles:
        # Separate tile and dependent_tiles
        if isinstance(ts, tuple):
            tile = ts[0]
            dep_tiles = ts[1:]
        else:
            tile = ts
            dep_tiles = None
        registrar.addTile(tile, dep_tiles)
    # Compute the positions
    positions, dep_positions = registrar.getPositions()
    # Update positions, by creating DataArrays with the same data, but different MD_POS
    for i, ts in enumerate(tiles):
        # Return tuple of positions if dependent tiles are present
        if isinstance(ts, tuple):
            tile = ts[0]
            dep_tiles = ts[1:]
            # Update main tile
            md = copy.deepcopy(tile.metadata)
            md[model.MD_POS] = positions[i]
            tileUpd = model.DataArray(tile, md)
            # Update dependent tiles
            tilesNew = [tileUpd]
            for j, t in enumerate(dep_tiles):
                md = copy.deepcopy(t.metadata)
                md[model.MD_POS] = dep_positions[i][j]
                tilesNew.append(model.DataArray(t, md))
            tileUpd = tuple(tilesNew)
        else:
            md = copy.deepcopy(ts.metadata)
            md[model.MD_POS] = positions[i]
            tileUpd = model.DataArray(ts, md)
        updatedTiles.append(tileUpd)
    return updatedTiles