Return a Cartesian of atoms in the n-th coordination sphere.

        Connected means that a path along covalent bonds exists.

        Args:
            index_of_atom (int):
            give_only_index (bool): If ``True`` a set of indices is
                returned. Otherwise a new Cartesian instance.
            n_sphere (int): Determines the number of the coordination sphere.
            only_surface (bool): Return only the surface of the coordination
                sphere.
            exclude (set): A set of indices that should be ignored
                for the path finding.
            use_lookup (bool): Use a lookup variable for
                :meth:`~chemcoord.Cartesian.get_bonds`. The default is
                specified in ``settings['defaults']['use_lookup']``

        Returns:
            A set of indices or a new Cartesian instance.

def get_coordination_sphere(
            self, index_of_atom, n_sphere=1, give_only_index=False,
            only_surface=True, exclude=None,
            use_lookup=None):
        """Return a Cartesian of atoms in the n-th coordination sphere.

        Connected means that a path along covalent bonds exists.

        Args:
            index_of_atom (int):
            give_only_index (bool): If ``True`` a set of indices is
                returned. Otherwise a new Cartesian instance.
            n_sphere (int): Determines the number of the coordination sphere.
            only_surface (bool): Return only the surface of the coordination
                sphere.
            exclude (set): A set of indices that should be ignored
                for the path finding.
            use_lookup (bool): Use a lookup variable for
                :meth:`~chemcoord.Cartesian.get_bonds`. The default is
                specified in ``settings['defaults']['use_lookup']``

        Returns:
            A set of indices or a new Cartesian instance.
        """
        if use_lookup is None:
            use_lookup = settings['defaults']['use_lookup']
        exclude = set() if exclude is None else exclude
        bond_dict = self.get_bonds(use_lookup=use_lookup)
        i = index_of_atom
        if n_sphere != 0:
            visited = set([i]) | exclude
            try:
                tmp_bond_dict = {j: (bond_dict[j] - visited)
                                 for j in bond_dict[i]}
            except KeyError:
                tmp_bond_dict = {}
            n = 0
            while tmp_bond_dict and (n + 1) < n_sphere:
                new_tmp_bond_dict = {}
                for i in tmp_bond_dict:
                    if i in visited:
                        continue
                    visited.add(i)
                    for j in tmp_bond_dict[i]:
                        new_tmp_bond_dict[j] = bond_dict[j] - visited
                tmp_bond_dict = new_tmp_bond_dict
                n += 1
            if only_surface:
                index_out = set(tmp_bond_dict.keys())
            else:
                index_out = visited | set(tmp_bond_dict.keys())
        else:
            index_out = {i}

        if give_only_index:
            return index_out - exclude
        else:
            return self.loc[index_out - exclude]