def add_named_range(self, name, reference, comment='<STR_LIT>', is_formula=False):
if is_formula:<EOL><INDENT>url = self.build_url(self._endpoints.get('<STR_LIT>'))<EOL><DEDENT>else:<EOL><INDENT>url = self.build_url(self._endpoints.get('<STR_LIT>'))<EOL><DEDENT>params = {<EOL>'<STR_LIT:name>': name,<EOL>'<STR_LIT>': reference,<EOL>'<STR_LIT>': comment<EOL>}<EOL>response = self.session.post(url, data=params)<EOL>if not response:<EOL><INDENT>return None<EOL><DEDENT>return self.named_range_constructor(parent=self, **{self._cloud_data_key: response.json()})<EOL>
Adds a new name to the collection of the given scope using the user's locale for the formula
:param str name: the name of this range
:param str reference: the reference for this range or formula
:param str comment: a comment to describe this named range
:param bool is_formula: True if the reference is a formula
:return: NamedRange instance