code: def gen_filename(endpoint):
      
      now = datetime.now().strftime('%Y%m%d_%H%M%S%f')[:-4]
      base = endpoint.split('://', 1)[1]
      if base.startswith('localhost:'):
          base = gethostname().split('.')[0] + base[9:]
      base = base.replace(':', '_').replace('/', '_')
      return '{}_{}.h5'.format(base, now)
docs: Generate a filename from endpoint with timestamp.
  
      return: str
          hostname_port_YearMonthDay_HourMinSecFrac.h5