code: def set_default_names(data):
      """Sets index names to 'index' for regular, or 'level_x' for Multi"""
      if com._all_not_none(*data.index.names):
          nms = data.index.names
          if len(nms) == 1 and data.index.name == "index":
              warnings.warn(
                  "Index name of 'index' is not round-trippable"
              )
          elif len(nms) > 1 and any(
              x.startswith("level_") for x in nms
          ):
              warnings.warn(
                  "Index names beginning with 'level_' are not "
                  "round-trippable"
              )
          return data
  
      data = data.copy()
      if data.index.nlevels > 1:
          names = [
              name if name is not None else "level_{}".format(i)
              for i, name in enumerate(data.index.names)
          ]
          data.index.names = names
      else:
          data.index.name = data.index.name or "index"
      return data
  
file_path: catboost/contrib/python/pandas/py2/pandas/io/json/table_schema.py
imports: import warnings
  import pandas._libs.json
  from pandas.core.dtypes.common import is_bool_dtype, is_categorical_dtype, is_datetime64_dtype, is_datetime64tz_dtype, is_integer_dtype, is_numeric_dtype, is_period_dtype, is_string_dtype, is_timedelta64_dtype
  from pandas import DataFrame
  from pandas.api.types import CategoricalDtype
  import pandas.core.common
label_desc: Use image node_id 2 for calling a global function with example usage: set_default_names(data) and returns: data, data