def set_names(self, names, level=None, inplace=False):
        if level is not None and self.nlevels == 1:
            raise ValueError('Level must be None for non-MultiIndex')

        if level is not None and not is_list_like(level) and is_list_like(
                names):
            raise TypeError("Names must be a string")

        if not is_list_like(names) and level is None and self.nlevels > 1:
            raise TypeError("Must pass list-like as `names`.")

        if not is_list_like(names):
            names = [names]
        if level is not None and not is_list_like(level):
            level = [level]

        if inplace:
            idx = self
        else:
            idx = self._shallow_copy()
        idx._set_names(names, level=level)
        if not inplace:
            return idx
Create a fake security group rule.
dataset/ETHPy150Open pydata/pandas/pandas/indexes/base.py/Index.set_names--crossover with--dataset/ETHPy150Open dtroyer/python-openstackclient/openstackclient/tests/compute/v2/fakes.py/FakeSecurityGroupRule.create_one_security_group_rule