code: def from_datetimes(datetimes):
      """Creates DateTensor from a sequence of Python datetime objects.
  
      Args:
        datetimes: Sequence of Python datetime objects.
  
      Returns:
        DateTensor object.
  
      #### Example
  
      ```python
      import datetime
  
      dates = [datetime.date(2015, 4, 15), datetime.date(2017, 12, 30)]
      date_tensor = tff.datetime.dates_from_datetimes(dates)
      ```
      """
      if isinstance(datetimes, (datetime.date, datetime.datetime)):
          return from_year_month_day(
              datetimes.year,
              datetimes.month,
              datetimes.day,
              validate=False,
          )
      years = tf.constant([dt.year for dt in datetimes], dtype=tf.int32)
      months = tf.constant(
          [dt.month for dt in datetimes], dtype=tf.int32
      )
      days = tf.constant([dt.day for dt in datetimes], dtype=tf.int32)
  
      # datetime stores year, month and day internally, and datetime.toordinal()
      # performs calculations. We use a tf routine to perform these calculations
      # instead.
      return from_year_month_day(years, months, days, validate=False)
  
imports: import collections.abc
  import datetime
  import numpy
  import tensorflow.compat.v2
  from tf_quant_finance.datetime import constants
  from tf_quant_finance.datetime import date_utils
  from tf_quant_finance.datetime import periods
  from tf_quant_finance.datetime import tensor_wrapper
label_desc: Use image node_id 3 for calling a global function with example usage: from_datetimes(datetimes) and returns: from_year_month_day, from_year_month_day