# 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_network_layer = r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/1"
# Execute the tool
arcpy.ApplyEventBehaviors_locref(in_network_layer)
# Check in licenses
arcpy.CheckInExtension('LocationReferencing')