def _run_vw_command(cmd):
 LOG.info(u'Running Vowpal Wabbit command: %s', u' '.join(cmd))
 proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
 output = proc.communicate()[0].decode(u'utf-8')
 LOG.debug(u'Vowpal Wabbit output: %s', output)
 if (proc.returncode != 0):
  raise subprocess.CalledProcessError(proc.returncode, u' '.join(cmd), output=output)
 return output

def _run_vw_command ( cmd ) : LOG . info ( u'Running Vowpal Wabbit command: %s' , u' ' . join ( cmd ) ) proc = subprocess . Popen ( cmd , stdout = subprocess . PIPE , stderr = subprocess . STDOUT ) output = proc . communicate ( ) [ 0 ] . decode ( u'utf-8' ) LOG . debug ( u'Vowpal Wabbit output: %s' , output ) if ( proc . returncode != 0 ) : raise subprocess . CalledProcessError ( proc . returncode , u' ' . join ( cmd ) , output = output ) return output
execute given vowpal wabbit command .