Did I find the right examples for you? yes no

All Samples(12)  |  Call(12)  |  Derive(0)  |  Import(0)

        def legal_variable_name(name):
    regex = re.compile('^[_a-zA-Z][_a-zA-Z0-9]*$')
    if regex.match(str(name)):
        return True
    return False
        


src/m/o/monguo-0.1.13/monguo/validator.py   monguo(Download)
        value = field.validate(value)
        if (field.unique and not field.in_list 
                and util.legal_variable_name(name)):
            count = self.collection.find({name: value}).count()
            if count:
            name_error = NameError("%s is an illegal key!", key)
            for name in name_list:
                if not (util.legal_variable_name(name) or name.isdigit() or name == '$'):
                    raise name_error
 
            if name_list.count('$') > 1:
                raise name_error
 
            if not util.legal_variable_name(name_list[0]):
                            next_name = name_list[index + 1]
 
                            if util.legal_variable_name(next_name):
                                if isinstance(current_attr, DictField):
                                    current_attr = current_attr.document.fields_dict()[next_name]

src/m/o/Monguo-HEAD/monguo/validator.py   Monguo(Download)
        value = field.validate(value)
        if (field.unique and not field.in_list 
                and util.legal_variable_name(name)):
            count = self.collection.find({name: value}).count()
            if count:
            name_error = NameError("%s is an illegal key!", key)
            for name in name_list:
                if not (util.legal_variable_name(name) or name.isdigit() or name == '$'):
                    raise name_error
 
            if name_list.count('$') > 1:
                raise name_error
 
            if not util.legal_variable_name(name_list[0]):
                            next_name = name_list[index + 1]
 
                            if util.legal_variable_name(next_name):
                                if isinstance(current_attr, DictField):
                                    current_attr = current_attr.document.fields_dict()[next_name]

src/m/o/monguo-0.1.13/monguo/document.py   monguo(Download)
            for name, attr in base.__dict__.items():
                if isinstance(attr, Field):
                    if not util.legal_variable_name(name):
                        raise FieldNameError(field=name)
 
 
        for name, attr in document.items():
            if not util.legal_variable_name(name):
                raise NameError("%s named error." % name)
 

src/m/o/Monguo-HEAD/monguo/document.py   Monguo(Download)
            for name, attr in base.__dict__.items():
                if isinstance(attr, Field):
                    if not util.legal_variable_name(name):
                        raise FieldNameError(field=name)
 
 
        for name, attr in document.items():
            if not util.legal_variable_name(name):
                raise NameError("%s named error." % name)