# Name: GenerateEvents_Ex3.py
# Description: Generate events in stand-alone mode 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 license
arcpy.CheckOutExtension("LocationReferencing")
## Input event is in feature service. Portal signin is required to access the feature service.
arcpy.SignInToPortal('https://yourdomain.com/portal', 'username', 'password')
## Map the input event from the feature service. Here, 3 corresponds to the input event
in_event_layer = r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/3"
# Process : Generate Events
arcpy.GenerateEvents_locref(in_event_layer)
# Check in license
arcpy.CheckInExtension('LocationReferencing')