def _run_as_pg(command):
 with cd('~postgres'):
  return sudo(command, user='postgres')

def _run_as_pg ( command ) : with cd ( '~postgres' ) : return sudo ( command , user = 'postgres' )
run command as postgres user .