def _qname_matches(tag, namespace, qname):
 if (qname is None):
  member_tag = None
  member_namespace = None
 elif qname.startswith('{'):
  member_namespace = qname[1:qname.index('}')]
  member_tag = qname[(qname.index('}') + 1):]
 else:
  member_namespace = None
  member_tag = qname
 return (((tag is None) and (namespace is None)) or ((namespace is None) and (member_tag == tag)) or ((tag is None) and (member_namespace == namespace)) or ((tag is None) and (namespace == '') and (member_namespace is None)) or ((tag == member_tag) and (namespace == member_namespace)) or ((tag == member_tag) and (namespace == '') and (member_namespace is None)))

def _qname_matches ( tag , namespace , qname ) : if ( qname is None ) : member_tag = None member_namespace = None elif qname . startswith ( '{' ) : member_namespace = qname [ 1 : qname . index ( '}' ) ] member_tag = qname [ ( qname . index ( '}' ) + 1 ) : ] else : member_namespace = None member_tag = qname return ( ( ( tag is None ) and ( namespace is None ) ) or ( ( namespace is None ) and ( member_tag == tag ) ) or ( ( tag is None ) and ( member_namespace == namespace ) ) or ( ( tag is None ) and ( namespace == '' ) and ( member_namespace is None ) ) or ( ( tag == member_tag ) and ( namespace == member_namespace ) ) or ( ( tag == member_tag ) and ( namespace == '' ) and ( member_namespace is None ) ) )
logic determines if a qname matches the desired local tag and namespace .