Return the 1-offset, right-open range of lines spanned by
        a particular context name.

        Parameters
        ----------
        context : str

        Raises
        ------
        ValueError, if context is not present in the file.

def context_range(self, context):
        """
        Return the 1-offset, right-open range of lines spanned by
        a particular context name.

        Parameters
        ----------
        context : str

        Raises
        ------
        ValueError, if context is not present in the file.
        """
        if not context.startswith(self.prefix):
            context = self.prefix + '.' + context

        lo = hi = None
        for idx, line_context in enumerate(self.lines, 1):

            # context is hierarchical -- context spans itself
            # and any suffix.
            if line_context.startswith(context):
                lo = lo or idx
                hi = idx

        if lo is None:
            raise ValueError("Context %s does not exist in file %s" %
                             (context, self.filename))

        return lo, hi + 1