def match(self, name):
        """
        Check if given name matches.

        Args:
            name (str): name to check.

        Returns:
            bool: matches name.
        """
        if self.method == Ex.Method.PREFIX:
            return name.startswith(self.value)
        elif self.method == Ex.Method.SUFFIX:
            return name.endswith(self.value)
        elif self.method == Ex.Method.CONTAINS:
            return self.value in name
        elif self.method == Ex.Method.EXACT:
            return self.value == name
        elif self.method == Ex.Method.REGEX:
            return re.search(self.value, name)
        return False
def match ( self , name ) : if self . method == Ex . Method . PREFIX : return name . startswith ( self . value ) elif self . method == Ex . Method . SUFFIX : return name . endswith ( self . value ) elif self . method == Ex . Method . CONTAINS : return self . value in name elif self . method == Ex . Method . EXACT : return self . value == name elif self . method == Ex . Method . REGEX : return re . search ( self . value , name ) return False
Check if given name matches.

        Args:
            name (str): name to check.

        Returns:
            bool: matches name.