def _layerIncludedInState(layer, state):
 layer_included = (len(layer.include) == 0)
 for exclude_rule in layer.exclude:
  if _stateMeetsRule(state, exclude_rule):
   layer_included = False
   break
 for include_rule in layer.include:
  if _stateMeetsRule(state, include_rule):
   layer_included = True
   break
 return layer_included

def _layerIncludedInState ( layer , state ) : layer_included = ( len ( layer . include ) == 0 ) for exclude_rule in layer . exclude : if _stateMeetsRule ( state , exclude_rule ) : layer_included = False break for include_rule in layer . include : if _stateMeetsRule ( state , include_rule ) : layer_included = True break return layer_included
returns true if this layer will be included in the given state logic copied from caffes net::filternet() .