<?xml version="1.0" encoding="UTF-8"?>
<metadata xml:lang="en"><Esri><CreaDate>20240919</CreaDate><CreaTime>15455200</CreaTime><ArcGISFormat>1.0</ArcGISFormat><SyncOnce>FALSE</SyncOnce><DataProperties><itemProps><itemLocation><linkage Sync="TRUE">file://\\igskmncnfs016\fewsfs1\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\FEWSNET_Admin0</linkage><protocol Sync="TRUE">Local Area Network</protocol></itemLocation><itemName Sync="TRUE">World_Admin0_GAUL2008</itemName><imsContentType Sync="TRUE">002</imsContentType><itemSize Sync="TRUE">0.000</itemSize></itemProps><copyHistory><copy source="M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\FEWSNET_Admin0\FEWSNET_Admin0" dest="\\igskmncnfs016\fewsfs1\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\FEWSNET_Admin0" date="20240919" time="15455200"></copy></copyHistory><lineage><Process ToolSource="c:\program files\arcgis\pro\Resources\ArcToolbox\Toolboxes\Data Management Tools.tbx\Copy" Date="20240702" Time="094818">Copy "M:\00. Chemonics Internal Archive\Boundary Processing\ET\Downloads\World_Admin0_GAUL2008_2024\World_Admin0_GAUL2008_2024.shp" "M:\00. Chemonics Internal Archive\Boundary Processing\ET\Shapefiles\World_Admin0_GAUL2008_2024.shp" Shapefile #</Process><Process ToolSource="c:\program files\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\Copy" Date="20240702" Time="101012">Copy "M:\00. Chemonics Internal Archive\Boundary Processing\ET\Shapefiles\World_Admin0_GAUL2008_2024.shp" "M:\00. Chemonics Internal Archive\Boundary Processing\ET\Shapefiles\World\World_Admin0_GAUL2008_2024.shp" Shapefile #</Process><Process ToolSource="c:\program files\arcgis\pro\Resources\ArcToolbox\toolboxes\Conversion Tools.tbx\ExportFeatures" Date="20240906" Time="103227">ExportFeatures World_Admin0_GAUL2008_2024 "M:\Verified Shapefiles\World\World_Admin0_GAUL2008.shp" # NOT_USE_ALIAS "OBJECTID "OBJECTID" true true false 18 Double 0 18,First,#,World_Admin0_GAUL2008_2024,OBJECTID,-1,-1;ADM0_CODE "ADM0_CODE" true true false 18 Double 0 18,First,#,World_Admin0_GAUL2008_2024,ADM0_CODE,-1,-1;ADM0_NAME "ADM0_NAME" true true false 80 Text 0 0,First,#,World_Admin0_GAUL2008_2024,ADM0_NAME,0,79;Shape_area "Shape_area" true true false 24 Double 15 23,First,#,World_Admin0_GAUL2008_2024,Shape_area,-1,-1;Shape_len "Shape_len" true true false 24 Double 15 23,First,#,World_Admin0_GAUL2008_2024,Shape_len,-1,-1;ADM0_NA_FR "ADM0_NA_FR" true true false 80 Text 0 0,First,#,World_Admin0_GAUL2008_2024,ADM0_NA_FR,0,79;ADM0_NA_PT "ADM0_NA_PT" true true false 80 Text 0 0,First,#,World_Admin0_GAUL2008_2024,ADM0_NA_PT,0,79;ADM0_NA_SP "ADM0_NA_SP" true true false 80 Text 0 0,First,#,World_Admin0_GAUL2008_2024,ADM0_NA_SP,0,79;NAME_0 "NAME_0" true true false 80 Text 0 0,First,#,World_Admin0_GAUL2008_2024,NAME_0,0,79;row_number "row_number" true true false 10 Long 0 10,First,#,World_Admin0_GAUL2008_2024,row_number,-1,-1;fnid "fnid" true true false 254 Text 0 0,First,#,World_Admin0_GAUL2008_2024,fnid,0,253;country "country" true true false 254 Text 0 0,First,#,World_Admin0_GAUL2008_2024,country,0,253;iso3166a2 "iso3166a2" true true false 254 Text 0 0,First,#,World_Admin0_GAUL2008_2024,iso3166a2,0,253" #</Process><Process ToolSource="c:\program files\arcgis\pro\Resources\ArcToolbox\Toolboxes\Data Management Tools.tbx\Copy" Date="20240909" Time="134139">Copy "M:\Verified Shapefiles\World\World_Admin0_GAUL2008.shp" "M:\Verified Shapefiles\World\World_Admin0_GAUL2008_1.shp" Shapefile #</Process><Process ToolSource="c:\program files\arcgis\pro\Resources\ArcToolbox\Toolboxes\Data Management Tools.tbx\Rename" Date="20240909" Time="134153">Rename "M:\Verified Shapefiles\World\World_Admin0_GAUL2008_1.shp" "M:\Verified Shapefiles\World\FEWSNET_Admin0.shp" ShapeFile</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\Toolboxes\Data Management Tools.tbx\Copy" Date="20240919" Time="154552">Copy M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\FEWSNET_Admin0\FEWSNET_Admin0.shp M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\FEWSNET_Admin0.shp Shapefile #</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\Toolboxes\Data Management Tools.tbx\Rename" Date="20240919" Time="154632">Rename M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\FEWSNET_Admin0.shp M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp ShapeFile</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\AddField" Date="20240924" Time="144505">AddField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID Text # # 50 # NULLABLE NON_REQUIRED #</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240924" Time="144506">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID calcValue(!ADM0_CODE!, None, None, None, None,'POLY_ID') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in [1] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\AddField" Date="20240924" Time="144506">AddField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp WS_START "Short (16-bit integer)" # # # # NULLABLE NON_REQUIRED #</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\AddField" Date="20240924" Time="144506">AddField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp GS_START "Short (16-bit integer)" # # # # NULLABLE NON_REQUIRED #</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240924" Time="144654">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID calcValue(!ADM0_CODE!, None, None, None, None,'POLY_ID') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in [1] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\AddField" Date="20240924" Time="144654">AddField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_NAME Text # # 150 # NULLABLE NON_REQUIRED #</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240924" Time="144654">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_NAME calcValue(!ADM0_NAME!, None, None, None, None,'POLY_NAME') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in [1] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240924" Time="144655">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp WS_START calcValue(!ADM0_NAME!, None, None, None, None,'WS_START') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in [1] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240924" Time="144655">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp GS_START calcValue(!ADM0_NAME!, None, None, None, None,'GS_START') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in [1] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\Toolboxes\Data Management Tools.tbx\DeleteField" Date="20240924" Time="145043">DeleteField "NEW viewer_G5\static_data\g2008_0" POLY_ID;WS_START;GS_START;POLY_NAME "Delete Fields"</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\AddField" Date="20240924" Time="145829">AddField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID Text # # 50 # NULLABLE NON_REQUIRED #</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240924" Time="145829">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID calcValue(!ADM0_CODE!, None, None, None, None,'POLY_ID') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            if fld0 == 'ADM0_CODE':
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in [1] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\AddField" Date="20240924" Time="145829">AddField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_NAME Text # # 150 # NULLABLE NON_REQUIRED #</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240924" Time="145829">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_NAME calcValue(!ADM0_NAME!, None, None, None, None,'POLY_NAME') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            if fld0 == 'ADM0_CODE':
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in [1] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\AddField" Date="20240924" Time="145830">AddField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp WS_START "Short (16-bit integer)" # # # # NULLABLE NON_REQUIRED #</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240924" Time="145830">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp WS_START calcValue(!ADM0_NAME!, None, None, None, None,'WS_START') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            if fld0 == 'ADM0_CODE':
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in [1] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\AddField" Date="20240924" Time="145830">AddField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp GS_START "Short (16-bit integer)" # # # # NULLABLE NON_REQUIRED #</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240924" Time="145830">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp GS_START calcValue(!ADM0_NAME!, None, None, None, None,'GS_START') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            if fld0 == 'ADM0_CODE':
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in [1] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240925" Time="095723">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID calcValue(!ADM0_CODE!, None, None, None, None,'POLY_ID') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            if fld0 == 'ADM0_CODE':
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in [1] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\Toolboxes\Data Management Tools.tbx\DeleteField" Date="20240925" Time="110926">DeleteField "NEW viewer_G5\static_data\g2008_0" POLY_ID;POLY_NAME;WS_START;GS_START "Delete Fields"</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\AddField" Date="20240925" Time="111103">AddField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID Text # # 50 # NULLABLE NON_REQUIRED #</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240925" Time="111103">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID calcValue(!ADM0_CODE!, None, None, None, None,'POLY_ID') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            if fld0 == 'ADM0_CODE':
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in [1] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\AddField" Date="20240925" Time="111103">AddField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp WS_START "Short (16-bit integer)" # # # # NULLABLE NON_REQUIRED #</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\AddField" Date="20240925" Time="111103">AddField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp GS_START "Short (16-bit integer)" # # # # NULLABLE NON_REQUIRED #</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\Toolboxes\Data Management Tools.tbx\DeleteField" Date="20240925" Time="115550">DeleteField "NEW viewer_G5\static_data\g2008_0" POLY_ID;WS_START;GS_START "Delete Fields"</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\AddField" Date="20240925" Time="135935">AddField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID Text # # 50 # NULLABLE NON_REQUIRED #</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240925" Time="135936">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID calcValue(!ADM0_CODE!, None, None, None, None,'POLY_ID') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            if fld0 == 'ADM0_CODE':
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in [1] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\AddField" Date="20240925" Time="135936">AddField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_NAME Text # # 150 # NULLABLE NON_REQUIRED #</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240925" Time="135936">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_NAME calcValue(!ADM0_NAME!, None, None, None, None,'POLY_NAME') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            if fld0 == 'ADM0_CODE':
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in [1] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\AddField" Date="20240925" Time="135936">AddField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp WS_START "Short (16-bit integer)" # # # # NULLABLE NON_REQUIRED #</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\AddField" Date="20240925" Time="135936">AddField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp GS_START "Short (16-bit integer)" # # # # NULLABLE NON_REQUIRED #</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="132759">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID calcValue(!ADM0_CODE!, None, None, None, None,'POLY_ID') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            if fld0 == 'ADM0_CODE':
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="132759">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_NAME calcValue(!ADM0_NAME!, None, None, None, None,'POLY_NAME') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            if fld0 == 'ADM0_CODE':
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="132759">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp WS_START calcValue(!ADM0_NAME!, None, None, None, None,'WS_START') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            if fld0 == 'ADM0_CODE':
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="132759">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp GS_START calcValue(!ADM0_NAME!, None, None, None, None,'GS_START') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            if fld0 == 'ADM0_CODE':
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="141939">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID calcValue(!ADM0_CODE!, None, None, None, None,'POLY_ID') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            print(fld0)
            if fld0 == 'ADM0_CODE':
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="141939">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_NAME calcValue(!ADM0_NAME!, None, None, None, None,'POLY_NAME') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            print(fld0)
            if fld0 == 'ADM0_CODE':
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="141939">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp WS_START calcValue(!ADM0_NAME!, None, None, None, None,'WS_START') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            print(fld0)
            if fld0 == 'ADM0_CODE':
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="141940">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp GS_START calcValue(!ADM0_NAME!, None, None, None, None,'GS_START') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            print(fld0)
            if fld0 == 'ADM0_CODE':
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="142449">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID calcValue(!ADM0_CODE!, None, None, None, None,'POLY_ID') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            print(fld0)
            if fld0 == 'ADM0_CODE':
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
            print(calc_exp_res)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="142449">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_NAME calcValue(!ADM0_NAME!, None, None, None, None,'POLY_NAME') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            print(fld0)
            if fld0 == 'ADM0_CODE':
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
            print(calc_exp_res)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="142449">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp WS_START calcValue(!ADM0_NAME!, None, None, None, None,'WS_START') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            print(fld0)
            if fld0 == 'ADM0_CODE':
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
            print(calc_exp_res)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="142450">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp GS_START calcValue(!ADM0_NAME!, None, None, None, None,'GS_START') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            print(fld0)
            if fld0 == 'ADM0_CODE':
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
            print(calc_exp_res)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="144410">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID calcValue(!ADM0_CODE!, None, None, None, None,'POLY_ID') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            print(fld0)
            if str(fld0).isnumeric():
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
            print(calc_exp_res)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="144410">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_NAME calcValue(!ADM0_NAME!, None, None, None, None,'POLY_NAME') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            print(fld0)
            if str(fld0).isnumeric():
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
            print(calc_exp_res)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="144410">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp WS_START calcValue(!ADM0_NAME!, None, None, None, None,'WS_START') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            print(fld0)
            if str(fld0).isnumeric():
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
            print(calc_exp_res)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="144410">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp GS_START calcValue(!ADM0_NAME!, None, None, None, None,'GS_START') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:
            print(fld0)
            if str(fld0).isnumeric():
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
            print(calc_exp_res)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="144548">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_NAME calcValue(!ADM0_NAME!, None, None, None, None,'POLY_NAME') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if str(fld0).isnumeric():
                calc_exp_res = str(int(str(fld0)))
            else:
                calc_exp_res = str(fld0)
            print("fld0 = " + fld0 + "calc_exp_res = " + calc_exp_res)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="144548">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp WS_START calcValue(!ADM0_NAME!, None, None, None, None,'WS_START') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if str(fld0).isnumeric():
                calc_exp_res = str(int(str(fld0)))
            else:
                calc_exp_res = str(fld0)
            print("fld0 = " + fld0 + "calc_exp_res = " + calc_exp_res)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="144548">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp GS_START calcValue(!ADM0_NAME!, None, None, None, None,'GS_START') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if str(fld0).isnumeric():
                calc_exp_res = str(int(str(fld0)))
            else:
                calc_exp_res = str(fld0)
            print("fld0 = " + fld0 + "calc_exp_res = " + calc_exp_res)
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="144706">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID calcValue(!ADM0_CODE!, None, None, None, None,'POLY_ID') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if str(fld0).isnumeric():
                calc_exp_res = str(int(str(fld0)))
            else:
                calc_exp_res = str(fld0)
            print("fld0 = " + str(fld0) + "calc_exp_res = " + str(
                  calc_exp_res))
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="144707">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_NAME calcValue(!ADM0_NAME!, None, None, None, None,'POLY_NAME') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if str(fld0).isnumeric():
                calc_exp_res = str(int(str(fld0)))
            else:
                calc_exp_res = str(fld0)
            print("fld0 = " + str(fld0) + "calc_exp_res = " + str(
                  calc_exp_res))
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="144707">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp WS_START calcValue(!ADM0_NAME!, None, None, None, None,'WS_START') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if str(fld0).isnumeric():
                calc_exp_res = str(int(str(fld0)))
            else:
                calc_exp_res = str(fld0)
            print("fld0 = " + str(fld0) + "calc_exp_res = " + str(
                  calc_exp_res))
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="144707">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp GS_START calcValue(!ADM0_NAME!, None, None, None, None,'GS_START') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if str(fld0).isnumeric():
                calc_exp_res = str(int(str(fld0)))
            else:
                calc_exp_res = str(fld0)
            print("fld0 = " + str(fld0) + "calc_exp_res = " + str(
                  calc_exp_res))
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="144845">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID calcValue(!ADM0_CODE!, None, None, None, None,'POLY_ID') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if str(fld0).isnumeric():
                calc_exp_res = int(str(fld0))
            else:
                calc_exp_res = str(fld0)
            print("fld0 = " + str(fld0) + " calc_exp_res = " + str(
                  calc_exp_res))
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="144845">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_NAME calcValue(!ADM0_NAME!, None, None, None, None,'POLY_NAME') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if str(fld0).isnumeric():
                calc_exp_res = int(str(fld0))
            else:
                calc_exp_res = str(fld0)
            print("fld0 = " + str(fld0) + " calc_exp_res = " + str(
                  calc_exp_res))
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="144845">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp WS_START calcValue(!ADM0_NAME!, None, None, None, None,'WS_START') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if str(fld0).isnumeric():
                calc_exp_res = int(str(fld0))
            else:
                calc_exp_res = str(fld0)
            print("fld0 = " + str(fld0) + " calc_exp_res = " + str(
                  calc_exp_res))
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="144845">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp GS_START calcValue(!ADM0_NAME!, None, None, None, None,'GS_START') PYTHON_9.3 "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if str(fld0).isnumeric():
                calc_exp_res = int(str(fld0))
            else:
                calc_exp_res = str(fld0)
            print("fld0 = " + str(fld0) + " calc_exp_res = " + str(
                  calc_exp_res))
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="145506">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID calcValue(!ADM0_CODE!, None, None, None, None,'POLY_ID') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if str(fld0).isnumeric():
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
            print("fld0 = " + str(fld0) + " calc_exp_res = " + str(
                  calc_exp_res))
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="145507">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_NAME calcValue(!ADM0_NAME!, None, None, None, None,'POLY_NAME') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if str(fld0).isnumeric():
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
            print("fld0 = " + str(fld0) + " calc_exp_res = " + str(
                  calc_exp_res))
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="145507">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp WS_START calcValue(!ADM0_NAME!, None, None, None, None,'WS_START') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if str(fld0).isnumeric():
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
            print("fld0 = " + str(fld0) + " calc_exp_res = " + str(
                  calc_exp_res))
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="145507">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp GS_START calcValue(!ADM0_NAME!, None, None, None, None,'GS_START') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if str(fld0).isnumeric():
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
            print("fld0 = " + str(fld0) + " calc_exp_res = " + str(
                  calc_exp_res))
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="151213">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID calcValue(!ADM0_CODE!, None, None, None, None,'POLY_ID') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
            print("fld0 = " + str(fld0) + " calc_exp_res = " + 
                  str(calc_exp_res))
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="151213">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_NAME calcValue(!ADM0_NAME!, None, None, None, None,'POLY_NAME') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
            print("fld0 = " + str(fld0) + " calc_exp_res = " + 
                  str(calc_exp_res))
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="151213">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp WS_START calcValue(!ADM0_NAME!, None, None, None, None,'WS_START') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
            print("fld0 = " + str(fld0) + " calc_exp_res = " + 
                  str(calc_exp_res))
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="151214">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp GS_START calcValue(!ADM0_NAME!, None, None, None, None,'GS_START') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana'
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon'
        'Glorioso Island'
        'Juan de Nova Island'
        'Lesotho'
        'Madagascar'
        'Malawi'
        'Mauritius'
        'Mayotte'
        'Mozambique'
        'Namibia'
        'Reunion'
        'Rwanda'
        'Saint Helena'
        'Seychelles'
        'South Africa'
        'Tromelin Island'
        'Tanzania'
        'Zambia'
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen ',   
    ]
    south_america_amd0_list = [
        'Argentina'
        'Bolivia'
        'Brazil'
        'Chile'
        'Colombia'
        'Ecuador'
        'French Guiana'
        'Guyana'
        'Paraguay'
        'Peru'
        'Suriname'
        'Uruguay'
        'Venezuela'
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam'
        'Fiji'
        'Indonesia'
        'Malaysia'
        'New Caledonia'
        'New Zealand'
        'Papua New Guinea'
        'Singapore'
        'Solomon Islands'
        'Timor-Leste'
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)
            print("fld0 = " + str(fld0) + " calc_exp_res = " + 
                  str(calc_exp_res))
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="151801">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID calcValue(!ADM0_CODE!, None, None, None, None,'POLY_ID') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana',
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon',
        'Glorioso Island',
        'Juan de Nova Island',
        'Lesotho',
        'Madagascar',
        'Malawi',
        'Mauritius',
        'Mayotte',
        'Mozambique',
        'Namibia',
        'Reunion',
        'Rwanda',
        'Saint Helena',
        'Seychelles',
        'South Africa',
        'Tromelin Island',
        'Tanzania',
        'Zambia',
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen',   
    ]
    south_america_amd0_list = [
        'Argentina',
        'Bolivia',
        'Brazil',
        'Chile',
        'Colombia',
        'Ecuador',
        'French Guiana',
        'Guyana',
        'Paraguay',
        'Peru',
        'Suriname',
        'Uruguay',
        'Venezuela',
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam',
        'Fiji',
        'Indonesia',
        'Malaysia',
        'New Caledonia',
        'New Zealand',
        'Papua New Guinea',
        'Singapore',
        'Solomon Islands',
        'Timor-Leste',
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)            
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="151801">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_NAME calcValue(!ADM0_NAME!, None, None, None, None,'POLY_NAME') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana',
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon',
        'Glorioso Island',
        'Juan de Nova Island',
        'Lesotho',
        'Madagascar',
        'Malawi',
        'Mauritius',
        'Mayotte',
        'Mozambique',
        'Namibia',
        'Reunion',
        'Rwanda',
        'Saint Helena',
        'Seychelles',
        'South Africa',
        'Tromelin Island',
        'Tanzania',
        'Zambia',
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen',   
    ]
    south_america_amd0_list = [
        'Argentina',
        'Bolivia',
        'Brazil',
        'Chile',
        'Colombia',
        'Ecuador',
        'French Guiana',
        'Guyana',
        'Paraguay',
        'Peru',
        'Suriname',
        'Uruguay',
        'Venezuela',
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam',
        'Fiji',
        'Indonesia',
        'Malaysia',
        'New Caledonia',
        'New Zealand',
        'Papua New Guinea',
        'Singapore',
        'Solomon Islands',
        'Timor-Leste',
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)            
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="151801">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp WS_START calcValue(!ADM0_NAME!, None, None, None, None,'WS_START') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana',
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon',
        'Glorioso Island',
        'Juan de Nova Island',
        'Lesotho',
        'Madagascar',
        'Malawi',
        'Mauritius',
        'Mayotte',
        'Mozambique',
        'Namibia',
        'Reunion',
        'Rwanda',
        'Saint Helena',
        'Seychelles',
        'South Africa',
        'Tromelin Island',
        'Tanzania',
        'Zambia',
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen',   
    ]
    south_america_amd0_list = [
        'Argentina',
        'Bolivia',
        'Brazil',
        'Chile',
        'Colombia',
        'Ecuador',
        'French Guiana',
        'Guyana',
        'Paraguay',
        'Peru',
        'Suriname',
        'Uruguay',
        'Venezuela',
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam',
        'Fiji',
        'Indonesia',
        'Malaysia',
        'New Caledonia',
        'New Zealand',
        'Papua New Guinea',
        'Singapore',
        'Solomon Islands',
        'Timor-Leste',
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)            
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="151801">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp GS_START calcValue(!ADM0_NAME!, None, None, None, None,'GS_START') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana',
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon',
        'Glorioso Island',
        'Juan de Nova Island',
        'Lesotho',
        'Madagascar',
        'Malawi',
        'Mauritius',
        'Mayotte',
        'Mozambique',
        'Namibia',
        'Reunion',
        'Rwanda',
        'Saint Helena',
        'Seychelles',
        'South Africa',
        'Tromelin Island',
        'Tanzania',
        'Zambia',
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',
        'Yemen',   
    ]
    south_america_amd0_list = [
        'Argentina',
        'Bolivia',
        'Brazil',
        'Chile',
        'Colombia',
        'Ecuador',
        'French Guiana',
        'Guyana',
        'Paraguay',
        'Peru',
        'Suriname',
        'Uruguay',
        'Venezuela',
    ]
    cip_adm0_list = [
        'Australia'
        'Brunei Darussalam',
        'Fiji',
        'Indonesia',
        'Malaysia',
        'New Caledonia',
        'New Zealand',
        'Papua New Guinea',
        'Singapore',
        'Solomon Islands',
        'Timor-Leste',
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)            
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="155514">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID calcValue(!ADM0_CODE!, None, None, None, None,'POLY_ID') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana',
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon',
        'Glorioso Island',
        'Juan de Nova Island',
        'Lesotho',
        'Madagascar',
        'Malawi',
        'Mauritius',
        'Mayotte',
        'Mozambique',
        'Namibia',
        'Reunion',
        'Rwanda',
        'Saint Helena',
        'Seychelles',
        'South Africa',
        'Tromelin Island',
        'Tanzania',
        'Zambia',
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',   
    ]
    south_america_amd0_list = [
        'Argentina',
        'Bolivia',
        'Brazil',
        'Chile',
        'Ecuador',
        'Paraguay',
        'Peru',
        'Uruguay',
    ]
    cip_adm0_list = [
        'Australia',
        'Fiji',
        'Indonesia',
        'New Caledonia',
        'New Zealand',
        'Papua New Guinea',
        'Solomon Islands',
        'Timor-Leste',
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)            
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="155515">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_NAME calcValue(!ADM0_NAME!, None, None, None, None,'POLY_NAME') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana',
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon',
        'Glorioso Island',
        'Juan de Nova Island',
        'Lesotho',
        'Madagascar',
        'Malawi',
        'Mauritius',
        'Mayotte',
        'Mozambique',
        'Namibia',
        'Reunion',
        'Rwanda',
        'Saint Helena',
        'Seychelles',
        'South Africa',
        'Tromelin Island',
        'Tanzania',
        'Zambia',
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',   
    ]
    south_america_amd0_list = [
        'Argentina',
        'Bolivia',
        'Brazil',
        'Chile',
        'Ecuador',
        'Paraguay',
        'Peru',
        'Uruguay',
    ]
    cip_adm0_list = [
        'Australia',
        'Fiji',
        'Indonesia',
        'New Caledonia',
        'New Zealand',
        'Papua New Guinea',
        'Solomon Islands',
        'Timor-Leste',
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)            
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="155515">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp WS_START calcValue(!ADM0_NAME!, None, None, None, None,'WS_START') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana',
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon',
        'Glorioso Island',
        'Juan de Nova Island',
        'Lesotho',
        'Madagascar',
        'Malawi',
        'Mauritius',
        'Mayotte',
        'Mozambique',
        'Namibia',
        'Reunion',
        'Rwanda',
        'Saint Helena',
        'Seychelles',
        'South Africa',
        'Tromelin Island',
        'Tanzania',
        'Zambia',
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',   
    ]
    south_america_amd0_list = [
        'Argentina',
        'Bolivia',
        'Brazil',
        'Chile',
        'Ecuador',
        'Paraguay',
        'Peru',
        'Uruguay',
    ]
    cip_adm0_list = [
        'Australia',
        'Fiji',
        'Indonesia',
        'New Caledonia',
        'New Zealand',
        'Papua New Guinea',
        'Solomon Islands',
        'Timor-Leste',
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)            
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="155515">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp GS_START calcValue(!ADM0_NAME!, None, None, None, None,'GS_START') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana',
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'Gabon',
        'Glorioso Island',
        'Juan de Nova Island',
        'Lesotho',
        'Madagascar',
        'Malawi',
        'Mauritius',
        'Mayotte',
        'Mozambique',
        'Namibia',
        'Reunion',
        'Rwanda',
        'Saint Helena',
        'Seychelles',
        'South Africa',
        'Tromelin Island',
        'Tanzania',
        'Zambia',
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran'
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',   
    ]
    south_america_amd0_list = [
        'Argentina',
        'Bolivia',
        'Brazil',
        'Chile',
        'Ecuador',
        'Paraguay',
        'Peru',
        'Uruguay',
    ]
    cip_adm0_list = [
        'Australia',
        'Fiji',
        'Indonesia',
        'New Caledonia',
        'New Zealand',
        'Papua New Guinea',
        'Solomon Islands',
        'Timor-Leste',
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)            
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="160547">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID calcValue(!ADM0_CODE!, None, None, None, None,'POLY_ID') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana',
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'eSwatini'
        'Europa Island',
        'French Southern and Antarctic Territories',
        'Heard Island and McDonald Islands',
        'Gabon',
        'Glorioso Island',
        'Juan de Nova Island',
        'Lesotho',
        'Madagascar',
        'Malawi',
        'Mauritius',
        'Mayotte',
        'Mozambique',
        'Namibia',
        'Réunion',
        'Rwanda',
        'Saint Helena',
        'Seychelles',
        'South Africa',
        'Tromelin Island',
        'Tanzania',
        'Zambia',
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran',
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',   
    ]
    south_america_amd0_list = [
        'Argentina',
        'Bolivia',
        'Brazil',
        'Chile',
        'Ecuador',
        'Falkland Islands (Malvinas)'
        'Paraguay',
        'Peru',
        'South Georgia and the South Sandwich Islands',
        'Uruguay',
    ]
    cip_adm0_list = [
        'Australia',
        'Fiji',
        'Indonesia',
        'New Caledonia',
        'New Zealand',
        'Papua New Guinea',
        'Solomon Islands',
        'Timor-Leste',
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)            
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="160547">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_NAME calcValue(!ADM0_NAME!, None, None, None, None,'POLY_NAME') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana',
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'eSwatini'
        'Europa Island',
        'French Southern and Antarctic Territories',
        'Heard Island and McDonald Islands',
        'Gabon',
        'Glorioso Island',
        'Juan de Nova Island',
        'Lesotho',
        'Madagascar',
        'Malawi',
        'Mauritius',
        'Mayotte',
        'Mozambique',
        'Namibia',
        'Réunion',
        'Rwanda',
        'Saint Helena',
        'Seychelles',
        'South Africa',
        'Tromelin Island',
        'Tanzania',
        'Zambia',
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran',
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',   
    ]
    south_america_amd0_list = [
        'Argentina',
        'Bolivia',
        'Brazil',
        'Chile',
        'Ecuador',
        'Falkland Islands (Malvinas)'
        'Paraguay',
        'Peru',
        'South Georgia and the South Sandwich Islands',
        'Uruguay',
    ]
    cip_adm0_list = [
        'Australia',
        'Fiji',
        'Indonesia',
        'New Caledonia',
        'New Zealand',
        'Papua New Guinea',
        'Solomon Islands',
        'Timor-Leste',
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)            
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="160547">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp WS_START calcValue(!ADM0_NAME!, None, None, None, None,'WS_START') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana',
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'eSwatini'
        'Europa Island',
        'French Southern and Antarctic Territories',
        'Heard Island and McDonald Islands',
        'Gabon',
        'Glorioso Island',
        'Juan de Nova Island',
        'Lesotho',
        'Madagascar',
        'Malawi',
        'Mauritius',
        'Mayotte',
        'Mozambique',
        'Namibia',
        'Réunion',
        'Rwanda',
        'Saint Helena',
        'Seychelles',
        'South Africa',
        'Tromelin Island',
        'Tanzania',
        'Zambia',
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran',
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',   
    ]
    south_america_amd0_list = [
        'Argentina',
        'Bolivia',
        'Brazil',
        'Chile',
        'Ecuador',
        'Falkland Islands (Malvinas)'
        'Paraguay',
        'Peru',
        'South Georgia and the South Sandwich Islands',
        'Uruguay',
    ]
    cip_adm0_list = [
        'Australia',
        'Fiji',
        'Indonesia',
        'New Caledonia',
        'New Zealand',
        'Papua New Guinea',
        'Solomon Islands',
        'Timor-Leste',
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)            
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="160547">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp GS_START calcValue(!ADM0_NAME!, None, None, None, None,'GS_START') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana',
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'eSwatini'
        'Europa Island',
        'French Southern and Antarctic Territories',
        'Heard Island and McDonald Islands',
        'Gabon',
        'Glorioso Island',
        'Juan de Nova Island',
        'Lesotho',
        'Madagascar',
        'Malawi',
        'Mauritius',
        'Mayotte',
        'Mozambique',
        'Namibia',
        'Réunion',
        'Rwanda',
        'Saint Helena',
        'Seychelles',
        'South Africa',
        'Tromelin Island',
        'Tanzania',
        'Zambia',
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran',
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',   
    ]
    south_america_amd0_list = [
        'Argentina',
        'Bolivia',
        'Brazil',
        'Chile',
        'Ecuador',
        'Falkland Islands (Malvinas)'
        'Paraguay',
        'Peru',
        'South Georgia and the South Sandwich Islands',
        'Uruguay',
    ]
    cip_adm0_list = [
        'Australia',
        'Fiji',
        'Indonesia',
        'New Caledonia',
        'New Zealand',
        'Papua New Guinea',
        'Solomon Islands',
        'Timor-Leste',
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)            
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="160816">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID calcValue(!ADM0_CODE!, None, None, None, None,'POLY_ID') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana',
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'eSwatini',
        'Europa Island',
        'French Southern and Antarctic Territories',
        'Heard Island and McDonald Islands',
        'Gabon',
        'Glorioso Island',
        'Juan de Nova Island',
        'Lesotho',
        'Madagascar',
        'Malawi',
        'Mauritius',
        'Mayotte',
        'Mozambique',
        'Namibia',
        'Réunion',
        'Rwanda',
        'Saint Helena',
        'Seychelles',
        'South Africa',
        'Tromelin Island',
        'Tanzania',
        'Zambia',
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran',
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',   
    ]
    south_america_amd0_list = [
        'Argentina',
        'Bolivia',
        'Brazil',
        'Chile',
        'Ecuador',
        'Falkland Islands (Malvinas)',
        'Paraguay',
        'Peru',
        'South Georgia and the South Sandwich Islands',
        'Uruguay',
    ]
    cip_adm0_list = [
        'Australia',
        'Fiji',
        'Indonesia',
        'New Caledonia',
        'New Zealand',
        'Papua New Guinea',
        'Solomon Islands',
        'Timor-Leste',
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)            
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="160816">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_NAME calcValue(!ADM0_NAME!, None, None, None, None,'POLY_NAME') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana',
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'eSwatini',
        'Europa Island',
        'French Southern and Antarctic Territories',
        'Heard Island and McDonald Islands',
        'Gabon',
        'Glorioso Island',
        'Juan de Nova Island',
        'Lesotho',
        'Madagascar',
        'Malawi',
        'Mauritius',
        'Mayotte',
        'Mozambique',
        'Namibia',
        'Réunion',
        'Rwanda',
        'Saint Helena',
        'Seychelles',
        'South Africa',
        'Tromelin Island',
        'Tanzania',
        'Zambia',
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran',
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',   
    ]
    south_america_amd0_list = [
        'Argentina',
        'Bolivia',
        'Brazil',
        'Chile',
        'Ecuador',
        'Falkland Islands (Malvinas)',
        'Paraguay',
        'Peru',
        'South Georgia and the South Sandwich Islands',
        'Uruguay',
    ]
    cip_adm0_list = [
        'Australia',
        'Fiji',
        'Indonesia',
        'New Caledonia',
        'New Zealand',
        'Papua New Guinea',
        'Solomon Islands',
        'Timor-Leste',
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)            
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="160816">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp WS_START calcValue(!ADM0_NAME!, None, None, None, None,'WS_START') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana',
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'eSwatini',
        'Europa Island',
        'French Southern and Antarctic Territories',
        'Heard Island and McDonald Islands',
        'Gabon',
        'Glorioso Island',
        'Juan de Nova Island',
        'Lesotho',
        'Madagascar',
        'Malawi',
        'Mauritius',
        'Mayotte',
        'Mozambique',
        'Namibia',
        'Réunion',
        'Rwanda',
        'Saint Helena',
        'Seychelles',
        'South Africa',
        'Tromelin Island',
        'Tanzania',
        'Zambia',
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran',
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',   
    ]
    south_america_amd0_list = [
        'Argentina',
        'Bolivia',
        'Brazil',
        'Chile',
        'Ecuador',
        'Falkland Islands (Malvinas)',
        'Paraguay',
        'Peru',
        'South Georgia and the South Sandwich Islands',
        'Uruguay',
    ]
    cip_adm0_list = [
        'Australia',
        'Fiji',
        'Indonesia',
        'New Caledonia',
        'New Zealand',
        'Papua New Guinea',
        'Solomon Islands',
        'Timor-Leste',
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)            
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240926" Time="160817">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp GS_START calcValue(!ADM0_NAME!, None, None, None, None,'GS_START') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana',
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'eSwatini',
        'Europa Island',
        'French Southern and Antarctic Territories',
        'Heard Island and McDonald Islands',
        'Gabon',
        'Glorioso Island',
        'Juan de Nova Island',
        'Lesotho',
        'Madagascar',
        'Malawi',
        'Mauritius',
        'Mayotte',
        'Mozambique',
        'Namibia',
        'Réunion',
        'Rwanda',
        'Saint Helena',
        'Seychelles',
        'South Africa',
        'Tromelin Island',
        'Tanzania',
        'Zambia',
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran',
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',   
    ]
    south_america_amd0_list = [
        'Argentina',
        'Bolivia',
        'Brazil',
        'Chile',
        'Ecuador',
        'Falkland Islands (Malvinas)',
        'Paraguay',
        'Peru',
        'South Georgia and the South Sandwich Islands',
        'Uruguay',
    ]
    cip_adm0_list = [
        'Australia',
        'Fiji',
        'Indonesia',
        'New Caledonia',
        'New Zealand',
        'Papua New Guinea',
        'Solomon Islands',
        'Timor-Leste',
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)            
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240930" Time="104015">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_ID calcValue(!ADM0_CODE!, None, None, None, None,'POLY_ID') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana',
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'French Southern and Antarctic Territories',
        'Heard Island and McDonald Islands',
        'Gabon',
        'Glorioso Island',
        'Juan de Nova Island',
        'Lesotho',
        'Madagascar',
        'Malawi',
        'Mauritius',
        'Mayotte',
        'Mozambique',
        'Namibia',
        'Réunion',
        'Rwanda',
        'Saint Helena',
        'Seychelles',
        'South Africa',
        'Tromelin Island',
        'Tanzania',
        'Zambia',
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran',
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',   
    ]
    south_america_amd0_list = [
        'Argentina',
        'Bolivia',
        'Brazil',
        'Chile',
        'Ecuador',
        'Falkland Islands (Malvinas)',
        'Paraguay',
        'Peru',
        'South Georgia and the South Sandwich Islands',
        'Uruguay',
    ]
    cip_adm0_list = [
        'Australia',
        'Fiji',
        'Indonesia',
        'New Caledonia',
        'New Zealand',
        'Papua New Guinea',
        'Solomon Islands',
        'Timor-Leste',
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)            
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240930" Time="104015">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp POLY_NAME calcValue(!ADM0_NAME!, None, None, None, None,'POLY_NAME') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana',
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'French Southern and Antarctic Territories',
        'Heard Island and McDonald Islands',
        'Gabon',
        'Glorioso Island',
        'Juan de Nova Island',
        'Lesotho',
        'Madagascar',
        'Malawi',
        'Mauritius',
        'Mayotte',
        'Mozambique',
        'Namibia',
        'Réunion',
        'Rwanda',
        'Saint Helena',
        'Seychelles',
        'South Africa',
        'Tromelin Island',
        'Tanzania',
        'Zambia',
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran',
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',   
    ]
    south_america_amd0_list = [
        'Argentina',
        'Bolivia',
        'Brazil',
        'Chile',
        'Ecuador',
        'Falkland Islands (Malvinas)',
        'Paraguay',
        'Peru',
        'South Georgia and the South Sandwich Islands',
        'Uruguay',
    ]
    cip_adm0_list = [
        'Australia',
        'Fiji',
        'Indonesia',
        'New Caledonia',
        'New Zealand',
        'Papua New Guinea',
        'Solomon Islands',
        'Timor-Leste',
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)            
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240930" Time="104015">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp WS_START calcValue(!ADM0_NAME!, None, None, None, None,'WS_START') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana',
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'French Southern and Antarctic Territories',
        'Heard Island and McDonald Islands',
        'Gabon',
        'Glorioso Island',
        'Juan de Nova Island',
        'Lesotho',
        'Madagascar',
        'Malawi',
        'Mauritius',
        'Mayotte',
        'Mozambique',
        'Namibia',
        'Réunion',
        'Rwanda',
        'Saint Helena',
        'Seychelles',
        'South Africa',
        'Tromelin Island',
        'Tanzania',
        'Zambia',
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran',
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',   
    ]
    south_america_amd0_list = [
        'Argentina',
        'Bolivia',
        'Brazil',
        'Chile',
        'Ecuador',
        'Falkland Islands (Malvinas)',
        'Paraguay',
        'Peru',
        'South Georgia and the South Sandwich Islands',
        'Uruguay',
    ]
    cip_adm0_list = [
        'Australia',
        'Fiji',
        'Indonesia',
        'New Caledonia',
        'New Zealand',
        'Papua New Guinea',
        'Solomon Islands',
        'Timor-Leste',
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)            
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\CalculateField" Date="20240930" Time="104015">CalculateField M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates\static_data\Global_adm0_v2\g2008_0.shp GS_START calcValue(!ADM0_NAME!, None, None, None, None,'GS_START') Python "
def calcValue(fld0, fld1, fld2, fld3, fld4, new_fld_name):
    # Admin level codes with GS_START or WS_START =7
    africa_adm0_list = [        
        'Angola', 
        'Bassas da India',
        'Botswana',
        'British Indian Ocean Territory',
        'Burundi',        
        'Comoros',
        'Congo',
        'Democratic Republic of the Congo',
        'Eswatini',
        'Europa Island',
        'French Southern and Antarctic Territories',
        'Heard Island and McDonald Islands',
        'Gabon',
        'Glorioso Island',
        'Juan de Nova Island',
        'Lesotho',
        'Madagascar',
        'Malawi',
        'Mauritius',
        'Mayotte',
        'Mozambique',
        'Namibia',
        'Réunion',
        'Rwanda',
        'Saint Helena',
        'Seychelles',
        'South Africa',
        'Tromelin Island',
        'Tanzania',
        'Zambia',
        'Zimbabwe'
    ]
    middle_east_adm0_list = [
        'Iran',
        'Iraq',
        'Israel',
        'Jordan',
        'Kuwait',
        'Lebanon',
        'Oman',
        'Qatar',
        'Saudi Arabia',
        'Syrian Arab Republic',
        'Turkey',
        'United Arab Emirates',
        'West Bank',   
    ]
    south_america_amd0_list = [
        'Argentina',
        'Bolivia',
        'Brazil',
        'Chile',
        'Ecuador',
        'Falkland Islands (Malvinas)',
        'Paraguay',
        'Peru',
        'South Georgia and the South Sandwich Islands',
        'Uruguay',
    ]
    cip_adm0_list = [
        'Australia',
        'Fiji',
        'Indonesia',
        'New Caledonia',
        'New Zealand',
        'Papua New Guinea',
        'Solomon Islands',
        'Timor-Leste',
        'Vanuatu'
    ]
    calc_exp_res = ''
    if new_fld_name == 'POLY_ID':
        if fld0 is not None and fld1 is not None and fld2 is not None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif fld0 is not None and fld1 is not None and fld2 is None:
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif fld0 is not None and fld1 is None and fld2 is None:            
            if isinstance(fld0, int) or isinstance(fld0, float):
                calc_exp_res = str(int(fld0))
            else:
                calc_exp_res = str(fld0)            
    elif new_fld_name == 'POLY_NAME':
        if (fld0 is not None and fld1 is not None and fld2 is not None
                and fld3 is not None and fld4 is not None):
            if fld1 == ' ' and fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld4))
            elif fld2 == ' ' and fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld4))
            elif fld3 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld4))
            elif fld3 == ' ' and fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2))
            elif fld4 == ' ':
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3))
            else:
                calc_exp_res = (str(fld0) + '+' +
                                str(fld1) + '+' +
                                str(fld2) + '+' +
                                str(fld3) + '+' +
                                str(fld4))
        elif (fld0 is not None and fld1 is not None and fld2 is not
              None and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1) + '+' +
                            str(fld2))
        elif (fld0 is not None and fld1 is not None and fld2 is None
              and fld3 is None and fld4 is None):
            calc_exp_res = (str(fld0) + '+' +
                            str(fld1))
        elif (fld0 is not None and fld1 is None and fld2 is None and
              fld3 is None and fld4 is None):
            calc_exp_res = str(fld0)        
    elif new_fld_name == 'GS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    elif new_fld_name == 'WS_START':
        if (fld0 in africa_adm0_list + south_america_amd0_list +
                cip_adm0_list):
            calc_exp_res = 7
        elif fld0 in ['Afghanistan'] + middle_east_adm0_list:
            calc_exp_res = 10
        else:
            calc_exp_res = 1
    return calc_exp_res
    " Text NO_ENFORCE_DOMAINS</Process><Process ToolSource="c:\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\RepairGeometry" Date="20241121" Time="103201">RepairGeometry M:\FEWS\Users\Claudia\G5_shapefiles\CY-SCIGEOENG5-1900\viewer_G5_updates_workspace\static_data\Global_adm0_v2\g2008_0.shp DELETE_NULL Esri</Process></lineage><coordRef><type Sync="TRUE">Geographic</type><geogcsn Sync="TRUE">GCS_WGS_1984</geogcsn><csUnits Sync="TRUE">Angular Unit: Degree (0.017453)</csUnits><peXml Sync="TRUE">&lt;GeographicCoordinateSystem xsi:type='typens:GeographicCoordinateSystem' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:typens='http://www.esri.com/schemas/ArcGIS/3.2.0'&gt;&lt;WKT&gt;GEOGCS[&amp;quot;GCS_WGS_1984&amp;quot;,DATUM[&amp;quot;D_WGS_1984&amp;quot;,SPHEROID[&amp;quot;WGS_1984&amp;quot;,6378137.0,298.257223563]],PRIMEM[&amp;quot;Greenwich&amp;quot;,0.0],UNIT[&amp;quot;Degree&amp;quot;,0.0174532925199433],AUTHORITY[&amp;quot;EPSG&amp;quot;,4326]]&lt;/WKT&gt;&lt;XOrigin&gt;-400&lt;/XOrigin&gt;&lt;YOrigin&gt;-400&lt;/YOrigin&gt;&lt;XYScale&gt;11258999068426.238&lt;/XYScale&gt;&lt;ZOrigin&gt;-100000&lt;/ZOrigin&gt;&lt;ZScale&gt;10000&lt;/ZScale&gt;&lt;MOrigin&gt;-100000&lt;/MOrigin&gt;&lt;MScale&gt;10000&lt;/MScale&gt;&lt;XYTolerance&gt;8.983152841195215e-09&lt;/XYTolerance&gt;&lt;ZTolerance&gt;0.001&lt;/ZTolerance&gt;&lt;MTolerance&gt;0.001&lt;/MTolerance&gt;&lt;HighPrecision&gt;true&lt;/HighPrecision&gt;&lt;LeftLongitude&gt;-180&lt;/LeftLongitude&gt;&lt;WKID&gt;4326&lt;/WKID&gt;&lt;LatestWKID&gt;4326&lt;/LatestWKID&gt;&lt;/GeographicCoordinateSystem&gt;</peXml></coordRef></DataProperties><SyncDate>20240906</SyncDate><SyncTime>10322500</SyncTime><ModDate>20240906</ModDate><ModTime>10322500</ModTime></Esri><dataIdInfo><envirDesc Sync="TRUE">Microsoft Windows 10 Version 10.0 (Build 19045) ; Esri ArcGIS 13.2.2.49743</envirDesc><dataLang><languageCode value="eng" Sync="TRUE"></languageCode><countryCode value="USA" Sync="TRUE"></countryCode></dataLang><idCitation><resTitle Sync="TRUE">World_Admin0_GAUL2008</resTitle><presForm><PresFormCd value="005" Sync="TRUE"></PresFormCd></presForm></idCitation><spatRpType><SpatRepTypCd value="001" Sync="TRUE"></SpatRepTypCd></spatRpType></dataIdInfo><mdLang><languageCode value="eng" Sync="TRUE"></languageCode><countryCode value="USA" Sync="TRUE"></countryCode></mdLang><mdChar><CharSetCd value="004" Sync="TRUE"></CharSetCd></mdChar><distInfo><distFormat><formatName Sync="TRUE">Shapefile</formatName></distFormat><distTranOps><transSize Sync="TRUE">0.000</transSize></distTranOps></distInfo><mdHrLv><ScopeCd value="005" Sync="TRUE"></ScopeCd></mdHrLv><mdHrLvName Sync="TRUE">dataset</mdHrLvName><refSysInfo><RefSystem><refSysID><identCode code="4326" Sync="TRUE"></identCode><idCodeSpace Sync="TRUE">EPSG</idCodeSpace><idVersion Sync="TRUE">6.2(3.0.1)</idVersion></refSysID></RefSystem></refSysInfo><spatRepInfo><VectSpatRep><geometObjs Name="World_Admin0_GAUL2008"><geoObjTyp><GeoObjTypCd value="002" Sync="TRUE"></GeoObjTypCd></geoObjTyp><geoObjCnt Sync="TRUE">0</geoObjCnt></geometObjs><topLvl><TopoLevCd value="001" Sync="TRUE"></TopoLevCd></topLvl></VectSpatRep></spatRepInfo><spdoinfo><ptvctinf><esriterm Name="World_Admin0_GAUL2008"><efeatyp Sync="TRUE">Simple</efeatyp><efeageom code="4" Sync="TRUE"></efeageom><esritopo Sync="TRUE">FALSE</esritopo><efeacnt Sync="TRUE">0</efeacnt><spindex Sync="TRUE">FALSE</spindex><linrefer Sync="TRUE">FALSE</linrefer></esriterm></ptvctinf></spdoinfo><eainfo><detailed Name="World_Admin0_GAUL2008"><enttyp><enttypl Sync="TRUE">World_Admin0_GAUL2008</enttypl><enttypt Sync="TRUE">Feature Class</enttypt><enttypc Sync="TRUE">0</enttypc></enttyp><attr><attrlabl Sync="TRUE">FID</attrlabl><attalias Sync="TRUE">FID</attalias><attrtype Sync="TRUE">OID</attrtype><attwidth Sync="TRUE">4</attwidth><atprecis Sync="TRUE">0</atprecis><attscale Sync="TRUE">0</attscale><attrdef Sync="TRUE">Internal feature number.</attrdef><attrdefs Sync="TRUE">Esri</attrdefs><attrdomv><udom Sync="TRUE">Sequential unique whole numbers that are automatically generated.</udom></attrdomv></attr><attr><attrlabl Sync="TRUE">Shape</attrlabl><attalias Sync="TRUE">Shape</attalias><attrtype Sync="TRUE">Geometry</attrtype><attwidth Sync="TRUE">0</attwidth><atprecis Sync="TRUE">0</atprecis><attscale Sync="TRUE">0</attscale><attrdef Sync="TRUE">Feature geometry.</attrdef><attrdefs Sync="TRUE">Esri</attrdefs><attrdomv><udom Sync="TRUE">Coordinates defining the features.</udom></attrdomv></attr><attr><attrlabl Sync="TRUE">OBJECTID</attrlabl><attalias Sync="TRUE">OBJECTID</attalias><attrtype Sync="TRUE">Double</attrtype><attwidth Sync="TRUE">18</attwidth><atprecis Sync="TRUE">18</atprecis><attscale Sync="TRUE">0</attscale></attr><attr><attrlabl Sync="TRUE">ADM0_CODE</attrlabl><attalias Sync="TRUE">ADM0_CODE</attalias><attrtype Sync="TRUE">Double</attrtype><attwidth Sync="TRUE">18</attwidth><atprecis Sync="TRUE">18</atprecis><attscale Sync="TRUE">0</attscale></attr><attr><attrlabl Sync="TRUE">ADM0_NAME</attrlabl><attalias Sync="TRUE">ADM0_NAME</attalias><attrtype Sync="TRUE">String</attrtype><attwidth Sync="TRUE">80</attwidth><atprecis Sync="TRUE">0</atprecis><attscale Sync="TRUE">0</attscale></attr><attr><attrlabl Sync="TRUE">Shape_area</attrlabl><attalias Sync="TRUE">Shape_area</attalias><attrtype Sync="TRUE">Double</attrtype><attwidth Sync="TRUE">19</attwidth><atprecis Sync="TRUE">18</atprecis><attscale Sync="TRUE">15</attscale><attrdef Sync="TRUE">Area of feature in internal units squared.</attrdef><attrdefs Sync="TRUE">Esri</attrdefs><attrdomv><udom Sync="TRUE">Positive real numbers that are automatically generated.</udom></attrdomv></attr><attr><attrlabl Sync="TRUE">Shape_len</attrlabl><attalias Sync="TRUE">Shape_len</attalias><attrtype Sync="TRUE">Double</attrtype><attwidth Sync="TRUE">19</attwidth><atprecis Sync="TRUE">18</atprecis><attscale Sync="TRUE">15</attscale></attr><attr><attrlabl Sync="TRUE">ADM0_NA_FR</attrlabl><attalias Sync="TRUE">ADM0_NA_FR</attalias><attrtype Sync="TRUE">String</attrtype><attwidth Sync="TRUE">80</attwidth><atprecis Sync="TRUE">0</atprecis><attscale Sync="TRUE">0</attscale></attr><attr><attrlabl Sync="TRUE">ADM0_NA_PT</attrlabl><attalias Sync="TRUE">ADM0_NA_PT</attalias><attrtype Sync="TRUE">String</attrtype><attwidth Sync="TRUE">80</attwidth><atprecis Sync="TRUE">0</atprecis><attscale Sync="TRUE">0</attscale></attr><attr><attrlabl Sync="TRUE">ADM0_NA_SP</attrlabl><attalias Sync="TRUE">ADM0_NA_SP</attalias><attrtype Sync="TRUE">String</attrtype><attwidth Sync="TRUE">80</attwidth><atprecis Sync="TRUE">0</atprecis><attscale Sync="TRUE">0</attscale></attr><attr><attrlabl Sync="TRUE">NAME_0</attrlabl><attalias Sync="TRUE">NAME_0</attalias><attrtype Sync="TRUE">String</attrtype><attwidth Sync="TRUE">80</attwidth><atprecis Sync="TRUE">0</atprecis><attscale Sync="TRUE">0</attscale></attr><attr><attrlabl Sync="TRUE">row_number</attrlabl><attalias Sync="TRUE">row_number</attalias><attrtype Sync="TRUE">Integer</attrtype><attwidth Sync="TRUE">10</attwidth><atprecis Sync="TRUE">10</atprecis><attscale Sync="TRUE">0</attscale></attr><attr><attrlabl Sync="TRUE">fnid</attrlabl><attalias Sync="TRUE">fnid</attalias><attrtype Sync="TRUE">String</attrtype><attwidth Sync="TRUE">254</attwidth><atprecis Sync="TRUE">0</atprecis><attscale Sync="TRUE">0</attscale></attr><attr><attrlabl Sync="TRUE">country</attrlabl><attalias Sync="TRUE">country</attalias><attrtype Sync="TRUE">String</attrtype><attwidth Sync="TRUE">254</attwidth><atprecis Sync="TRUE">0</atprecis><attscale Sync="TRUE">0</attscale></attr><attr><attrlabl Sync="TRUE">iso3166a2</attrlabl><attalias Sync="TRUE">iso3166a2</attalias><attrtype Sync="TRUE">String</attrtype><attwidth Sync="TRUE">254</attwidth><atprecis Sync="TRUE">0</atprecis><attscale Sync="TRUE">0</attscale></attr></detailed></eainfo><mdDateSt Sync="TRUE">20240906</mdDateSt></metadata>
