def _convert_value(self, value_orig):
        """
        things like 6 and 1.25 are converted with ast.literal_value

        Things like 'hello' are stripped of quotes
        """
        import ast
        if value_orig is None:
            return value_orig

        if value_orig.startswith("'") and value_orig.endswith("'"):
            value = value_orig[1:-1]
        else:

            try:
                avalue = ast.parse(value_orig).body[0].value
                if isinstance(avalue, ast.BinOp):
                    # this is probably a string that happens to look like
                    # a binary operation, e.g. '25-3'
                    value = value_orig
                else:
                    value = ast.literal_eval(value_orig)
            except Exception:
                value = self._convert_string(value_orig)

            if isinstance(value, int) and '_' in value_orig:
                value = value_orig

        return value
def _convert_value ( self , value_orig ) : import ast if value_orig is None : return value_orig if value_orig . startswith ( "'" ) and value_orig . endswith ( "'" ) : value = value_orig [ 1 : - 1 ] else : try : avalue = ast . parse ( value_orig ) . body [ 0 ] . value if isinstance ( avalue , ast . BinOp ) : value = value_orig else : value = ast . literal_eval ( value_orig ) except Exception : value = self . _convert_string ( value_orig ) if isinstance ( value , int ) and '_' in value_orig : value = value_orig return value
things like 6 and 1.25 are converted with ast.literal_value

        Things like 'hello' are stripped of quotes