# Name: ApplyEventBehaviors_Pro_ex3.py
# Description: Processes event behaviors using a feature service. It is recommended to work in a version and post it into the default version.
# Requires: ArcGIS Location Referencing
# Import arcpy module
import arcpy
# Check out any necessary licenses.
arcpy.CheckOutExtension("LocationReferencing")
## Input LRS route network is in feature service. Signing in portal is required to access the feature service.
arcpy.SignInToPortal('https://yourdomain.com/portal', 'username', 'password')
## Map the LRS network from the feature service. Here, 1 corresponds to the LRS network.
in_route_features = r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/1"
# Execute the tool
arcpy.locref.ApplyEventBehaviors(in_route_features)
# Check in licenses
arcpy.CheckInExtension('LocationReferencing')