parameters: (bytecode_path)
return_statement: return source_path if _path_isfile(source_path) else bytecode_path
docstring: Convert a bytecode file path to a source path (if possible).
  
      This function exists purely for backwards-compatibility for
      PyImport_ExecCodeModuleWithFilenames() in the C API.
docstring_summary: Convert a bytecode file path to a source path (if possible).
docstring_tokens: Convert a bytecode file path to a source path ( if possible ) .
function: def _get_sourcefile(bytecode_path):
      """Convert a bytecode file path to a source path (if possible).
  
      This function exists purely for backwards-compatibility for
      PyImport_ExecCodeModuleWithFilenames() in the C API.
  
      """
      if len(bytecode_path) == 0:
          return None
      rest, _, extension = bytecode_path.rpartition('.')
      if not rest or extension.lower()[-3:-1] != 'py':
          return bytecode_path
      try:
          source_path = source_from_cache(bytecode_path)
      except (NotImplementedError, ValueError):
          source_path = bytecode_path[:-1]
      return source_path if _path_isfile(source_path) else bytecode_path
function_tokens: def _get_sourcefile ( bytecode_path ) : if len ( bytecode_path ) == 0 : return None rest , _ , extension = bytecode_path . rpartition ( '.' ) if not rest or extension . lower ( ) [ - 3 : - 1 ] != 'py' : return bytecode_path try : source_path = source_from_cache ( bytecode_path ) except ( NotImplementedError , ValueError ) : source_path = bytecode_path [ : - 1 ] return source_path if _path_isfile ( source_path ) else bytecode_path