Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)

        def is_valid_identifier(name):
    '''Returns True if `name` a valid Python identifier.

    .. note:: Only Python 2's version of valid identifier. This means that some
              Python 3 valid identifiers are not considered valid.  This helps
              to keep things working the same in Python 2 and 3.

    return isinstance(name, string_types) and _IDENTIFIER_REGEX.match(name)

src/x/o/xoutil-1.5.4/xoutil/collections.py   xoutil(Download)
            def k2a(key):
                from xoutil.validators.identifiers import is_valid_identifier
                res = key
                seps = type(self).__separators__
                for sep in seps:
                    res = res.replace(sep, seps[sep])
                return str(res) if is_valid_identifier(res) else None

src/x/o/xoutil-1.5.4/xoutil/objects.py   xoutil(Download)
    from xoutil.types import DictProxyType
    from xoutil.data import adapt_exception
    from xoutil.validators.identifiers import is_valid_identifier
    defaults = kwargs.pop('defaults', Unset)
    if kwargs:
        def setter(key, val):
            if is_valid_identifier(key):
                setattr(target, key, val)
    is_mapping = isinstance(defaults, Mapping)
    if is_mapping or is_collection(defaults):