def time_to_datetime(x):
 if isinstance(x, time):
  return datetime.combine(date(1970, 1, 1), x)
 return x

def time_to_datetime ( x ) : if isinstance ( x , time ) : return datetime . combine ( date ( 1970 , 1 , 1 ) , x ) return x
convert a time into a datetime .