def _status_apf():
 status = 0
 table = iptc.Table(iptc.Table.FILTER)
 for chain in table.chains:
  if ('sanity' in chain.name.lower()):
   status = 1
 return (True if status else False)

def _status_apf ( ) : status = 0 table = iptc . Table ( iptc . Table . FILTER ) for chain in table . chains : if ( 'sanity' in chain . name . lower ( ) ) : status = 1 return ( True if status else False )
return true if apf is running otherwise return false .