def _area_tables_binning_parallel(source_df, target_df, n_jobs=(- 1)):
    'Construct area allocation and source-target correspondence tables using\n    a parallel spatial indexing approach\n    ...\n\n    NOTE: currently, the largest df is chunked and the other one is shipped in\n    full to each core; within each process, the spatial index is built for the\n    largest set of geometries, and the other one used for `query_bulk`\n\n    Parameters\n    ----------\n    source_df : geopandas.GeoDataFrame\n        GeoDataFrame containing input data and polygons\n    target_df : geopandas.GeoDataFramee\n        GeoDataFrame defining the output geometries\n    n_jobs : int\n        [Optional. Default=-1] Number of processes to run in parallel. If -1,\n        this is set to the number of CPUs available\n\n    Returns\n    -------\n    tables : scipy.sparse.dok_matrix\n\n    '
    from joblib import Parallel, delayed, parallel_backend
    if _check_crs(source_df, target_df):
        pass
    else:
        return None
    if (n_jobs == (- 1)):
        n_jobs = os.cpu_count()
    df1 = source_df.copy()
    df2 = target_df.copy()
    if (df1.shape[0] > df2.shape[1]):
        to_chunk = df1
        df_full = df2
    else:
        to_chunk = df2
        df_full = df1
    to_workers = _chunk_dfs(gpd.GeoSeries(to_chunk.geometry.values, crs=to_chunk.crs), gpd.GeoSeries(df_full.geometry.values, crs=df_full.crs), n_jobs)
    with parallel_backend('loky', inner_max_num_threads=1):
        worker_out = Parallel(n_jobs=n_jobs)((delayed(_index_n_query)(*chunk_pair) for chunk_pair in to_workers))
    (ids_src, ids_tgt) = np.concatenate(worker_out).T
    chunks_to_intersection = _chunk_polys(np.vstack([ids_src, ids_tgt]).T, df1.geometry, df2.geometry, n_jobs)
    with parallel_backend('loky', inner_max_num_threads=1):
        worker_out = Parallel(n_jobs=n_jobs)((delayed(_intersect_area_on_chunk)(*chunk_pair) for chunk_pair in chunks_to_intersection))
    areas = np.concatenate(worker_out)
    table = coo_matrix((areas, (ids_src, ids_tgt)), shape=(df1.shape[0], df2.shape[0]), dtype=np.float32)
    table = table.todok()
    return table
Construct area allocation and source-target correspondence tables using
a parallel spatial indexing approach
...

NOTE: currently, the largest df is chunked and the other one is shipped in
full to each core; within each process, the spatial index is built for the
largest set of geometries, and the other one used for `query_bulk`

Parameters
----------
source_df : geopandas.GeoDataFrame
    GeoDataFrame containing input data and polygons
target_df : geopandas.GeoDataFramee
    GeoDataFrame defining the output geometries
n_jobs : int
    [Optional. Default=-1] Number of processes to run in parallel. If -1,
    this is set to the number of CPUs available

Returns
-------
tables : scipy.sparse.dok_matrix
def _area_tables_binning_parallel(source_df, target_df, n_jobs=(- 1)):
    'Construct area allocation and source-target correspondence tables using\n    a parallel spatial indexing approach\n    ...\n\n    NOTE: currently, the largest df is chunked and the other one is shipped in\n    full to each core; within each process, the spatial index is built for the\n    largest set of geometries, and the other one used for `query_bulk`\n\n    Parameters\n    ----------\n    source_df : geopandas.GeoDataFrame\n        GeoDataFrame containing input data and polygons\n    target_df : geopandas.GeoDataFramee\n        GeoDataFrame defining the output geometries\n    n_jobs : int\n        [Optional. Default=-1] Number of processes to run in parallel. If -1,\n        this is set to the number of CPUs available\n\n    Returns\n    -------\n    tables : scipy.sparse.dok_matrix\n\n    '
    from joblib import Parallel, delayed, parallel_backend
    if _check_crs(source_df, target_df):
        pass
    else:
        return None
    if (n_jobs == (- 1)):
        n_jobs = os.cpu_count()
    df1 = source_df.copy()
    df2 = target_df.copy()
    if (df1.shape[0] > df2.shape[1]):
        to_chunk = df1
        df_full = df2
    else:
        to_chunk = df2
        df_full = df1
    to_workers = _chunk_dfs(gpd.GeoSeries(to_chunk.geometry.values, crs=to_chunk.crs), gpd.GeoSeries(df_full.geometry.values, crs=df_full.crs), n_jobs)
    with parallel_backend('loky', inner_max_num_threads=1):
        worker_out = Parallel(n_jobs=n_jobs)((delayed(_index_n_query)(*chunk_pair) for chunk_pair in to_workers))
    (ids_src, ids_tgt) = np.concatenate(worker_out).T
    chunks_to_intersection = _chunk_polys(np.vstack([ids_src, ids_tgt]).T, df1.geometry, df2.geometry, n_jobs)
    with parallel_backend('loky', inner_max_num_threads=1):
        worker_out = Parallel(n_jobs=n_jobs)((delayed(_intersect_area_on_chunk)(*chunk_pair) for chunk_pair in chunks_to_intersection))
    areas = np.concatenate(worker_out)
    table = coo_matrix((areas, (ids_src, ids_tgt)), shape=(df1.shape[0], df2.shape[0]), dtype=np.float32)
    table = table.todok()
    return table