def grab_filt(self, filt, analyte=None):
if isinstance(filt, str):<EOL><INDENT>if filt in self.components:<EOL><INDENT>if analyte is None:<EOL><INDENT>return self.components[filt]<EOL><DEDENT>else:<EOL><INDENT>if self.switches[analyte][filt]:<EOL><INDENT>return self.components[filt]<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>ind = self.make_fromkey(filt)<EOL><DEDENT>except KeyError:<EOL><INDENT>print(("<STR_LIT>"<EOL>"<STR_LIT>"))<EOL><DEDENT><DEDENT><DEDENT>elif isinstance(filt, dict):<EOL><INDENT>try:<EOL><INDENT>ind = self.make_fromkey(filt[analyte])<EOL><DEDENT>except ValueError:<EOL><INDENT>print(("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"))<EOL><DEDENT><DEDENT>elif filt:<EOL><INDENT>ind = self.make(analyte)<EOL><DEDENT>else:<EOL><INDENT>ind = ~np.zeros(self.size, dtype=bool)<EOL><DEDENT>return ind<EOL>
Flexible access to specific filter using any key format.

Parameters
----------
f : str, dict or bool
    either logical filter expression, dict of expressions,
    or a boolean
analyte : str
    name of analyte the filter is for.

Returns
-------
array_like
    boolean filter