from datetime import datetime from icalendar import Calendar, Event cal = Calendar() event = Event() event.add('summary', 'Team Meeting') event.add('dtstart', datetime(2022, 10, 1, 9, 0, 0)) event.add('dtend', datetime(2022, 10, 1, 10, 0, 0)) cal.add_component(event) ical_text = cal.to_ical()In this example, we create an iCalendar object using the `Calendar()` constructor, and then create a new `Event` component using the `Event()` constructor. We add a `summary` property and the `dtstart` and `dtend` properties, specifying the start and end times of the event using datetime objects. Finally, we add the event component to the calendar object using `cal.add_component(event)`. We then serialize the calendar object using `cal.to_ical()`. Overall, the `add_component` method allows us to easily add new calendar components to an existing iCalendar object using the python icalendar package library.