def extract_capabilities(text):
 if (not ('\x00' in text)):
  return (text, [])
 (text, capabilities) = text.rstrip().split('\x00')
 return (text, capabilities.strip().split(' '))

def extract_capabilities ( text ) : if ( not ( '\x00' in text ) ) : return ( text , [ ] ) ( text , capabilities ) = text . rstrip ( ) . split ( '\x00' ) return ( text , capabilities . strip ( ) . split ( ' ' ) )
extract a capabilities list from a string .