Python collections.MutableMapping.keys() Examples

The following are 29 code examples of collections.MutableMapping.keys(). 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 collections.MutableMapping , or try the search function .
Example #1
Source File: misc.py    From addon with GNU General Public License v3.0 5 votes vote down vote up
def popitem(self):
        'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.'
        try:
            return self.maps[0].popitem()
        except KeyError:
            raise KeyError('No keys found in the first mapping.') 
Example #2
Source File: misc.py    From V1EngineeringInc-Docs with Creative Commons Attribution Share Alike 4.0 International 5 votes vote down vote up
def popitem(self):
        'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.'
        try:
            return self.maps[0].popitem()
        except KeyError:
            raise KeyError('No keys found in the first mapping.') 
Example #3
Source File: misc.py    From V1EngineeringInc-Docs with Creative Commons Attribution Share Alike 4.0 International 5 votes vote down vote up
def fromkeys(cls, iterable, value=None):
        '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S.
        If not specified, the value defaults to None.

        '''
        self = cls()
        for key in iterable:
            self[key] = value
        return self 
Example #4
Source File: misc.py    From Tautulli with GNU General Public License v3.0 5 votes vote down vote up
def popitem(self):
        'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.'
        try:
            return self.maps[0].popitem()
        except KeyError:
            raise KeyError('No keys found in the first mapping.') 
Example #5
Source File: misc.py    From Tautulli with GNU General Public License v3.0 5 votes vote down vote up
def fromkeys(cls, iterable, value=None):
        '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S.
        If not specified, the value defaults to None.

        '''
        self = cls()
        for key in iterable:
            self[key] = value
        return self 
Example #6
Source File: misc.py    From arissploit with GNU General Public License v3.0 5 votes vote down vote up
def popitem(self):
        'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.'
        try:
            return self.maps[0].popitem()
        except KeyError:
            raise KeyError('No keys found in the first mapping.') 
Example #7
Source File: misc.py    From arissploit with GNU General Public License v3.0 5 votes vote down vote up
def fromkeys(cls, iterable, value=None):
        '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S.
        If not specified, the value defaults to None.

        '''
        self = cls()
        for key in iterable:
            self[key] = value
        return self 
Example #8
Source File: misc.py    From gimp-plugin-export-layers with GNU General Public License v3.0 5 votes vote down vote up
def popitem(self):
        'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.'
        try:
            return self.maps[0].popitem()
        except KeyError:
            raise KeyError('No keys found in the first mapping.') 
Example #9
Source File: misc.py    From gimp-plugin-export-layers with GNU General Public License v3.0 5 votes vote down vote up
def fromkeys(cls, iterable, value=None):
        '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S.
        If not specified, the value defaults to None.

        '''
        self = cls()
        for key in iterable:
            self[key] = value
        return self 
Example #10
Source File: functools32.py    From SA-ctf_scoreboard with Creative Commons Zero v1.0 Universal 5 votes vote down vote up
def fromkeys(cls, iterable, value=None):
        '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S.
        If not specified, the value defaults to None.

        '''
        self = cls()
        for key in iterable:
            self[key] = value
        return self 
Example #11
Source File: functools32.py    From Cloudmare with GNU General Public License v3.0 5 votes vote down vote up
def fromkeys(cls, iterable, value=None):
        '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S.
        If not specified, the value defaults to None.

        '''
        self = cls()
        for key in iterable:
            self[key] = value
        return self 
Example #12
Source File: functools32.py    From Splunking-Crime with GNU Affero General Public License v3.0 5 votes vote down vote up
def fromkeys(cls, iterable, value=None):
        '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S.
        If not specified, the value defaults to None.

        '''
        self = cls()
        for key in iterable:
            self[key] = value
        return self 
Example #13
Source File: misc.py    From blackmamba with MIT License 5 votes vote down vote up
def popitem(self):
        'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.'
        try:
            return self.maps[0].popitem()
        except KeyError:
            raise KeyError('No keys found in the first mapping.') 
Example #14
Source File: misc.py    From blackmamba with MIT License 5 votes vote down vote up
def fromkeys(cls, iterable, value=None):
        '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S.
        If not specified, the value defaults to None.

        '''
        self = cls()
        for key in iterable:
            self[key] = value
        return self 
Example #15
Source File: util.py    From luscan-devel with GNU General Public License v2.0 5 votes vote down vote up
def fromkeys(cls, iterable, value=None):
        '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S
        and values equal to v (which defaults to None).

        '''
        d = cls()
        for key in iterable:
            d[key] = value
        return d 
Example #16
Source File: misc.py    From verge3d-blender-addon with GNU General Public License v3.0 5 votes vote down vote up
def fromkeys(cls, iterable, value=None):
        '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S.
        If not specified, the value defaults to None.

        '''
        self = cls()
        for key in iterable:
            self[key] = value
        return self 
Example #17
Source File: misc.py    From addon with GNU General Public License v3.0 5 votes vote down vote up
def fromkeys(cls, iterable, value=None):
        '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S.
        If not specified, the value defaults to None.

        '''
        self = cls()
        for key in iterable:
            self[key] = value
        return self 
Example #18
Source File: misc.py    From cadquery-freecad-module with GNU Lesser General Public License v3.0 5 votes vote down vote up
def popitem(self):
        'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.'
        try:
            return self.maps[0].popitem()
        except KeyError:
            raise KeyError('No keys found in the first mapping.') 
Example #19
Source File: misc.py    From cadquery-freecad-module with GNU Lesser General Public License v3.0 5 votes vote down vote up
def fromkeys(cls, iterable, value=None):
        '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S.
        If not specified, the value defaults to None.

        '''
        self = cls()
        for key in iterable:
            self[key] = value
        return self 
Example #20
Source File: misc.py    From telegram-robot-rss with Mozilla Public License 2.0 5 votes vote down vote up
def popitem(self):
        'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.'
        try:
            return self.maps[0].popitem()
        except KeyError:
            raise KeyError('No keys found in the first mapping.') 
Example #21
Source File: misc.py    From telegram-robot-rss with Mozilla Public License 2.0 5 votes vote down vote up
def fromkeys(cls, iterable, value=None):
        '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S.
        If not specified, the value defaults to None.

        '''
        self = cls()
        for key in iterable:
            self[key] = value
        return self 
Example #22
Source File: misc.py    From deepWordBug with Apache License 2.0 5 votes vote down vote up
def popitem(self):
        'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.'
        try:
            return self.maps[0].popitem()
        except KeyError:
            raise KeyError('No keys found in the first mapping.') 
Example #23
Source File: misc.py    From deepWordBug with Apache License 2.0 5 votes vote down vote up
def fromkeys(cls, iterable, value=None):
        '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S.
        If not specified, the value defaults to None.

        '''
        self = cls()
        for key in iterable:
            self[key] = value
        return self 
Example #24
Source File: misc.py    From misp42splunk with GNU Lesser General Public License v3.0 5 votes vote down vote up
def popitem(self):
        'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.'
        try:
            return self.maps[0].popitem()
        except KeyError:
            raise KeyError('No keys found in the first mapping.') 
Example #25
Source File: misc.py    From misp42splunk with GNU Lesser General Public License v3.0 5 votes vote down vote up
def fromkeys(cls, iterable, value=None):
        '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S.
        If not specified, the value defaults to None.

        '''
        self = cls()
        for key in iterable:
            self[key] = value
        return self 
Example #26
Source File: functools32.py    From misp42splunk with GNU Lesser General Public License v3.0 5 votes vote down vote up
def fromkeys(cls, iterable, value=None):
        '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S.
        If not specified, the value defaults to None.

        '''
        self = cls()
        for key in iterable:
            self[key] = value
        return self 
Example #27
Source File: misc.py    From misp42splunk with GNU Lesser General Public License v3.0 5 votes vote down vote up
def popitem(self):
        'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.'
        try:
            return self.maps[0].popitem()
        except KeyError:
            raise KeyError('No keys found in the first mapping.') 
Example #28
Source File: misc.py    From misp42splunk with GNU Lesser General Public License v3.0 5 votes vote down vote up
def fromkeys(cls, iterable, value=None):
        '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S.
        If not specified, the value defaults to None.

        '''
        self = cls()
        for key in iterable:
            self[key] = value
        return self 
Example #29
Source File: misc.py    From verge3d-blender-addon with GNU General Public License v3.0 5 votes vote down vote up
def popitem(self):
        'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.'
        try:
            return self.maps[0].popitem()
        except KeyError:
            raise KeyError('No keys found in the first mapping.')