Python UserDict.DictMixin.update() Examples

The following are 30 code examples of UserDict.DictMixin.update(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module UserDict.DictMixin , or try the search function .
Example #1
Source File: python2x.py    From attention-lvcsr with MIT License 6 votes vote down vote up
def __init__(self, iterable=None, **kwds):
            '''Create a new, empty Counter object.

            And if given, count elements from an input iterable.  Or,
            initialize the count from another mapping of elements to
            their counts.

            A new, empty counter:
            >>> c = Counter()

            A new counter from an iterable
            >>> c = Counter('gallahad')

            A new counter from a mapping
            >>> c = Counter({'a': 4, 'b': 2})

            A new counter from keyword args
            >>> c = Counter(a=4, b=2)
            '''
            self.update(iterable, **kwds) 
Example #2
Source File: inirama.py    From linter-pylama with MIT License 6 votes vote down vote up
def read(self, *files, **params):
        """ Read and parse INI files.

        :param *files: Files for reading
        :param **params: Params for parsing

        Set `update=False` for prevent values redefinition.

        """
        for f in files:
            try:
                with io.open(f, encoding='utf-8') as ff:
                    NS_LOGGER.info('Read from `{0}`'.format(ff.name))
                    self.parse(ff.read(), **params)
            except (IOError, TypeError, SyntaxError, io.UnsupportedOperation):
                if not self.silent_read:
                    NS_LOGGER.error('Reading error `{0}`'.format(ff.name))
                    raise 
Example #3
Source File: python2x.py    From D-VAE with MIT License 6 votes vote down vote up
def __init__(self, iterable=None, **kwds):
            '''Create a new, empty Counter object.

            And if given, count elements from an input iterable.  Or,
            initialize the count from another mapping of elements to
            their counts.

            A new, empty counter:
            >>> c = Counter()

            A new counter from an iterable
            >>> c = Counter('gallahad')

            A new counter from a mapping
            >>> c = Counter({'a': 4, 'b': 2})

            A new counter from keyword args
            >>> c = Counter(a=4, b=2)
            '''
            self.update(iterable, **kwds) 
Example #4
Source File: ordereddict.py    From PhonePi_SampleServer with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #5
Source File: py2ordereddict.py    From python-fields with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #6
Source File: ordereddict.py    From suricata-update with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #7
Source File: ordereddict.py    From maltrail with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #8
Source File: ordereddict.py    From jarvis with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #9
Source File: ordered_dict.py    From termite-visualizations with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #10
Source File: ordereddict.py    From termite-visualizations with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #11
Source File: ordered_dict.py    From python-scripts with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #12
Source File: ordereddict.py    From qgisSpaceSyntaxToolkit with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #13
Source File: ordereddict.py    From syntheticmass with Apache License 2.0 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #14
Source File: _ordereddict.py    From quickstart-git2s3 with Apache License 2.0 5 votes vote down vote up
def __init__(self, *args, **kwds):
            if len(args) > 1:
                raise TypeError('expected at most 1 arguments, got %d' % len(args))
            try:
                self.__end
            except AttributeError:
                self.clear()
            self.update(*args, **kwds) 
Example #15
Source File: ordereddict.py    From pydal with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError("expected at most 1 arguments, got %d" % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #16
Source File: ordered_dict.py    From komodo-wakatime with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #17
Source File: ordereddict.py    From komodo-wakatime with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #18
Source File: ordereddict.py    From soapy with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #19
Source File: ordered_dict.py    From pylada-light with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, *args, **kwds):
            if len(args) > 1:
                raise TypeError('expected at most 1 arguments, got %d' % len(args))
            try:
                self.__end
            except AttributeError:
                self.clear()
            self.update(*args, **kwds) 
Example #20
Source File: ordered_dict.py    From ru with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #21
Source File: ordereddict.py    From Ansible with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #22
Source File: ordereddict.py    From python2017 with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #23
Source File: compat_ordereddict.py    From opsbro with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        if kwds:
            self.update(*args, **kwds) 
Example #24
Source File: ordereddict.py    From splunk-elasticsearch with Apache License 2.0 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #25
Source File: ordereddict.py    From planespotter with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #26
Source File: ordereddict.py    From python with Apache License 2.0 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #27
Source File: ordereddict.py    From Financial-Portfolio-Flask with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #28
Source File: ordereddict.py    From lollipop with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #29
Source File: odict.py    From piSociEty with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, *args, **kwds):
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        try:
            self.__end
        except AttributeError:
            self.clear()
        self.update(*args, **kwds) 
Example #30
Source File: _ordereddict.py    From scalyr-agent-2 with Apache License 2.0 5 votes vote down vote up
def __init__(self, *args, **kwds):
            if len(args) > 1:
                raise TypeError('expected at most 1 arguments, got %d' % len(args))
            try:
                self.__end
            except AttributeError:
                self.clear()
            self.update(*args, **kwds)