parameters: (df)
docstring: Construct the new task graph and make a new dask.dataframe around it.
docstring_summary: Construct the new task graph and make a new dask.dataframe around it.
docstring_tokens: Construct the new task graph and make a new dask . dataframe around it .
function: def _construct_dask_df_with_divisions(df):
    """Construct the new task graph and make a new dask.dataframe around it."""
    divisions = _get_divisions(df)
    # pylint: disable=protected-access
    name = 'csv-index' + df._name
    dsk = {(name, i): (_add_to_index, (df._name, i), divisions[i])
           for i in range(df.npartitions)}
    # pylint: enable=protected-access
    from toolz import merge  # pylint: disable=g-import-not-at-top
    if isinstance(df, dd.DataFrame):
      return dd.DataFrame(merge(dsk, df.dask), name, df.columns, divisions)
    elif isinstance(df, dd.Series):
      return dd.Series(merge(dsk, df.dask), name, df.name, divisions)
function_tokens: def _construct_dask_df_with_divisions ( df ) : divisions = _get_divisions ( df ) # pylint: disable=protected-access name = 'csv-index' + df . _name dsk = { ( name , i ) : ( _add_to_index , ( df . _name , i ) , divisions [ i ] ) for i in range ( df . npartitions ) } # pylint: enable=protected-access from toolz import merge # pylint: disable=g-import-not-at-top if isinstance ( df , dd . DataFrame ) : return dd . DataFrame ( merge ( dsk , df . dask ) , name , df . columns , divisions ) elif isinstance ( df , dd . Series ) : return dd . Series ( merge ( dsk , df . dask ) , name , df . name , divisions )