code: def looks_like_a_filename(kernel_source):
      
      logging.debug('looks_like_a_filename called')
      result = False
      if isinstance(kernel_source, str):
          result = True
          #test if not too long
          if len(kernel_source) > 250:
              result = False
          #test if not contains special characters
          for c in "();{}\\":
              if c in kernel_source:
                  result = False
          #just a safeguard for stuff that looks like code
          for s in ["__global__ ", "__kernel ", "void ", "float "]:
              if s in kernel_source:
                  result = False
          #string must contain substring ".c", ".opencl", or ".F"
          result = result and any([s in kernel_source for s in (".c", ".opencl", ".F")])
      logging.debug('kernel_source is a filename: %s' % str(result))
      return result
docs: attempt to detect whether source code or a filename was passed