def _construct_return_type(self, result, axes=None):
ndim = getattr(result, '<STR_LIT>', None)<EOL>if ndim is None:<EOL><INDENT>if isinstance(result, dict):<EOL><INDENT>ndim = getattr(list(result.values())[<NUM_LIT:0>], '<STR_LIT>', <NUM_LIT:0>)<EOL>if ndim != <NUM_LIT:0>:<EOL><INDENT>ndim += <NUM_LIT:1><EOL><DEDENT><DEDENT><DEDENT>if ndim == <NUM_LIT:0>:<EOL><INDENT>return Series(result)<EOL><DEDENT>elif self.ndim == ndim:<EOL><INDENT>if axes is None:<EOL><INDENT>return self._constructor(result)<EOL><DEDENT>return self._constructor(result, **self._construct_axes_dict())<EOL><DEDENT>elif self.ndim == ndim + <NUM_LIT:1>:<EOL><INDENT>if axes is None:<EOL><INDENT>return self._constructor_sliced(result)<EOL><DEDENT>return self._constructor_sliced(<EOL>result, **self._extract_axes_for_slice(self, axes))<EOL><DEDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>'.format(self=self, result=result))<EOL>
Return the type for the ndim of the result.