Return a matching behavior if it exists, or None.

    If id is None, return the default for name.
484678
def getBehavior(name, id=None):
    
    name = name.upper()
    if name in __behaviorRegistry:
        if id:
            for n, behavior in __behaviorRegistry[name]:
                if n == id:
                    return behavior

        return __behaviorRegistry[name][0][1]
    return None
1319543
def get_item_with_id(self, uid):
        
        for item in self.get_items():
            if item.id == uid:
                return item

        return None
65778
def id_exists(api, search_id):
    
    response = utils.checked_api_call(api, 'get_specific', id=search_id)
    return response is not None
1176932
def _default(self, key, default=None):
        
        try:
            value = self.theme.themeables.property(key)
        except KeyError:
            value = None

        return value if value is not None else default
1272316
def setdefault(self, name, value):
        ''' '''
        if name in self:
            return self[name]
        self[name] = value
        return self[name]
871813
def param(self, name, default=None):
        ''''''
        if not name in self.params:
            return default
        return self.params[name]
340210
def get(self, name: str, default: Optional[Any]=None) -> Any:
        """"""
        return self.__dict__.get(name, default)
804473
def get(self, name, default=None, cache=False):
        
        if cache == True:
            for pane in self.cache:
                if pane.name == name:
                    return pane
            return default
        for pane in self:
            if pane.name == name:
                return pane
        return default
401340
async def get_default(cls):
        """"""
        data = await cls._handler.read(id=cls._default_space_id)
        return cls(data)
495681
def check_match(self, name):
        
        return any(pattern.match(name) for pattern in self.patterns)
31719
def check_name(self, name=None):
        '''
        
        '''
        if name:
            self.plugin_info['check_name'] = name

        if self.plugin_info['check_name'] is not None:
            return self.plugin_info['check_name']

        return self.__class__.__name__
25444
async def get_default(cls):
        
        data = await cls._handler.read(id=cls._default_fabric_id)
        return cls(data)
1366999
def get_flag_value(self, name, default):  # pylint: disable=invalid-name
    

    value = self.__getattr__(name)
    if value is not None:  # Can't do if not value, b/c value might be '0' or ""
      return value
    else:
      return default
465970
def get_configuration_set_by_id(self, id):
        '''

        '''
        for cs in self.configuration_sets:
            if cs.id == id:
                return cs
        return None
186343
def _get_uid(name):
    """"""
    if getpwnam is None or name is None:
        return None
    try:
        result = getpwnam(name)
    except KeyError:
        result = None
    if result is not None:
        return result[2]
    return None
641390
def hasDefault(self, param):
        
        param = self._resolveParam(param)
        return param in self._defaultParamMap
642508
def if_none_match(self):
        
        for option in self.options:
            if option.number == defines.OptionRegistry.IF_NONE_MATCH.number:
                return True
        return False