<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def run_edisgo_basic(ding0_filepath, generator_scenario=None, analysis='worst-case', *edisgo_grid):
 """ Analyze edisgo grid extension cost as reference scenario Parameters ding0_filepath : str Path to ding0 data ending typically `/path/to/ding0_data/"ding0_grids__" + str(``grid_district``) + ".xxx"` analysis : str Either 'worst-case' or 'timeseries' generator_scenario : None or :obj:`str` If provided defines which scenario of future generator park to use and invokes import of these generators. Possible options are 'nep2035' and 'ego100'. Returns ------- edisgo_grid : :class:`~.grid.network.EDisGo` eDisGo network container costs : :pandas:`pandas.Dataframe<dataframe>` Cost of grid extension grid_issues : dict Grids resulting in an error including error message """


    grid_district = _get_griddistrict(ding0_filepath)

    grid_issues = {}

    logging.info('Grid expansion for MV grid district {}'.format(grid_district))

    if edisgo_grid: # if an edisgo_grid is passed in arg then ignore everything else
        edisgo_grid = edisgo_grid[0]
    else:
        try:
            if 'worst-case' in analysis:
                edisgo_grid = EDisGo(ding0_grid=ding0_filepath,
                                     worst_case_analysis=analysis)
            elif 'timeseries' in analysis:
                edisgo_grid = EDisGo(ding0_grid=ding0_filepath,
                                     timeseries_generation_fluctuating='oedb',
                                     timeseries_load='demandlib')
        except FileNotFoundError as e:
            return None, pd.DataFrame(), {'grid': grid_district, 'msg': str(e)}

    # Import generators
    if generator_scenario:
        logging.info('Grid expansion for scenario \'{}\'.'.format(generator_scenario))
        edisgo_grid.import_generators(generator_scenario=generator_scenario)
    else:
        logging.info('Grid expansion with no generator imports based on scenario')

    try:
        # Do grid reinforcement
        edisgo_grid.reinforce()

        # Get costs
        costs_grouped = \
            edisgo_grid.network.results.grid_expansion_costs.groupby(
                ['type']).sum()
        costs = pd.DataFrame(costs_grouped.values,
                             columns=costs_grouped.columns,
                             index=[[edisgo_grid.network.id] * len(costs_grouped),
                                    costs_grouped.index]).reset_index()
        costs.rename(columns={'level_0': 'grid'}, inplace=True)

        grid_issues['grid'] = None
        grid_issues['msg'] = None

        logging.info('SUCCESS!')
    except MaximumIterationError:
        grid_issues['grid'] = edisgo_grid.network.id
        grid_issues['msg'] = str(edisgo_grid.network.results.unresolved_issues)
        costs = pd.DataFrame()
        logging.warning('Unresolved issues left after grid expansion.')
    except Exception as e:
        grid_issues['grid'] = edisgo_grid.network.id
        grid_issues['msg'] = repr(e)
        costs = pd.DataFrame()
        logging.exception()

    return edisgo_grid, costs, grid_issues