original_docstring: Produces a prompt asking about overwriting a file.
  
    Arguments:
        filepath: the path to the file to be overwritten.
  
    Returns:
        True if we can proceed with overwrite, False otherwise.
    
docstring: Produces a prompt asking about overwriting a file.
docstring_tokens: Produces a prompt asking about overwriting a file .
code: def ask_to_proceed_with_overwrite(filepath):
    """Produces a prompt asking about overwriting a file.
  
    Arguments:
        filepath: the path to the file to be overwritten.
  
    Returns:
        True if we can proceed with overwrite, False otherwise.
    """
    get_input = input
    if sys.version_info[:2] <= (2, 7):
      get_input = raw_input
    overwrite = get_input('[WARNING] %s already exists - overwrite? '
                          '[y/n]' % (filepath))
    while overwrite not in ['y', 'n']:
      overwrite = get_input('Enter "y" (overwrite) or "n" (cancel).')
    if overwrite == 'n':
      return False
    print('[TIP] Next time specify overwrite=True!')
    return True
code_tokens: def ask_to_proceed_with_overwrite ( filepath ) : get_input = input if sys . version_info [ : 2 ] <= ( 2 , 7 ) : get_input = raw_input overwrite = get_input ( '[WARNING] %s already exists - overwrite? ' '[y/n]' % ( filepath ) ) while overwrite not in [ 'y' , 'n' ] : overwrite = get_input ( 'Enter "y" (overwrite) or "n" (cancel).' ) if overwrite == 'n' : return False print ( '[TIP] Next time specify overwrite=True!' ) return True
short_docstring: Produces a prompt asking about overwriting a file.
short_docstring_tokens: Produces a prompt asking about overwriting a file .
comment: """Produces a prompt asking about overwriting a file.
  
    Arguments:
        filepath: the path to the file to be overwritten.
  
    Returns:
        True if we can proceed with overwrite, False otherwise.
    """