parameters: (directory)
return_statement: return dev_path
docstring: Download the WMT en-fr training corpus to directory unless it's there.
docstring_summary: Download the WMT en-fr training corpus to directory unless it's there.
docstring_tokens: Download the WMT en - fr training corpus to directory unless it s there .
function: def get_wmt_enfr_dev_set(directory):
    """Download the WMT en-fr training corpus to directory unless it's there."""
    dev_name = "newstest2013"
    dev_path = os.path.join(directory, dev_name)
    if not (gfile.Exists(dev_path + ".fr") and gfile.Exists(dev_path + ".en")):
      dev_file = maybe_download(directory, "dev-v2.tgz", _WMT_ENFR_DEV_URL)
      print("Extracting tgz file %s" % dev_file)
      with tarfile.open(dev_file, "r:gz") as dev_tar:
        fr_dev_file = dev_tar.getmember("dev/" + dev_name + ".fr")
        en_dev_file = dev_tar.getmember("dev/" + dev_name + ".en")
        fr_dev_file.name = dev_name + ".fr"  # Extract without "dev/" prefix.
        en_dev_file.name = dev_name + ".en"
        dev_tar.extract(fr_dev_file, directory)
        dev_tar.extract(en_dev_file, directory)
    return dev_path
function_tokens: def get_wmt_enfr_dev_set ( directory ) : dev_name = "newstest2013" dev_path = os . path . join ( directory , dev_name ) if not ( gfile . Exists ( dev_path + ".fr" ) and gfile . Exists ( dev_path + ".en" ) ) : dev_file = maybe_download ( directory , "dev-v2.tgz" , _WMT_ENFR_DEV_URL ) print ( "Extracting tgz file %s" % dev_file ) with tarfile . open ( dev_file , "r:gz" ) as dev_tar : fr_dev_file = dev_tar . getmember ( "dev/" + dev_name + ".fr" ) en_dev_file = dev_tar . getmember ( "dev/" + dev_name + ".en" ) fr_dev_file . name = dev_name + ".fr" # Extract without "dev/" prefix. en_dev_file . name = dev_name + ".en" dev_tar . extract ( fr_dev_file , directory ) dev_tar . extract ( en_dev_file , directory ) return dev_path