code: def hacking_has_license(physical_line, filename, lines, line_number):
      
      # don't work about init files for now
      # TODO(sdague): enforce license in init file if it's not empty of content
      license_found = False
  
      # skip files that are < 10 lines, which isn't enough for a license to fit
      # this allows us to handle empty files, as well as not fail on the Okay
      # doctests.
      if line_number is 1 and len(lines) > 10 and _project_is_apache():
          for idx, line in enumerate(lines):
              # if it's more than 10 characters in, it's probably not in the
              # header
              if 0 <= line.find('Licensed under the Apache License') < 10:
                      license_found = True
              if 0 <= line.find('SPDX-License-Identifier:') < 10:
                      license_found = True
          if not license_found:
              return (0, "H102: Apache 2.0 license header not found")
docs: Check for Apache 2.0 license.
  
      H102 license header not found