code: def get_by_datetime_or_date(dict_, dateTimeOrDate):
      ret = dict_.get(dateTimeOrDate, [])
      if len(ret) == 0 and isinstance(
          dateTimeOrDate, datetime.datetime
      ):
          ret = dict_.get(dateTimeOrDate.date(), [])
      return ret
  
imports: import datetime
  from .None import common
  from pyalgotrade import strategy
  from pyalgotrade import broker
  from pyalgotrade.barfeed import yahoofeed
label_desc: Use image node_id 1 for calling a global function with example usage: get_by_datetime_or_date(dict_, dateTimeOrDate) and returns: ret