text: #!/usr/bin/env python
  #
  # Licensed to the Apache Software Foundation (ASF) under one
  # or more contributor license agreements.  See the NOTICE file
  # distributed with this work for additional information
  # regarding copyright ownership.  The ASF licenses this file
  # to you under the Apache License, Version 2.0 (the
  # "License"); you may not use this file except in compliance
  # with the License.  You may obtain a copy of the License at
  #
  #   http://www.apache.org/licenses/LICENSE-2.0
  #
  # Unless required by applicable law or agreed to in writing,
  # software distributed under the License is distributed on an
  # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  # KIND, either express or implied.  See the License for the
  # specific language governing permissions and limitations
  # under the License.
  
  #
  # An example of usage:
  #
  # $ echo 6435399373400084500 | python convert-hybrid-timestamp.py
  # 2019-10-15 05:27:05.146505 L=20
  #
  
  import time
  import re
  import sys
  
  def convert_ts(ts_match):
    ts_i = int(ts_match.group(0))
    phys, logical = (ts_i >> 12, ts_i & ((1 << 12) - 1))
    phys_sec = phys / 1000000
    phys_micros = phys % 1000000
    f = time.strftime("%F %H:%M:%S", time.localtime(phys_sec))
    return "%s.%06d L=%d" % (f, phys_micros, logical)
  
  for l in sys.stdin.readlines():
    print(re.sub(r"\d{10,19}", convert_ts, l))
  