import arcpy
import os
# all input data are in country.gdb and output will also go to this gdb
arcpy.env.workspace = os.path.join(os.getcwd(), "country.gdb")
try:
in_features_orig = "common_border"
in_features_copy = "common_border1"
# Make a copy of the original data
arcpy.CopyFeatures_management(in_features_orig, in_features_copy)
# Features to which input will be aligned
target_features = "country1_border"
search_dist = "100 Meters"
match_fields = "A_field B_field"
arcpy.AlignFeatures_edit(in_features_copy, target_features, search_dist, match_fields)
except arcpy.ExecuteError as aex:
print(arcpy.GetMessages(2))
except Exception as ex:
print(ex.args[0])