def fix_ncesid(ncesid, mode):
    """
    Applies standard formatting (zero padding and typecasting) to
    both schools' and districts' NCES IDs.
  
    Args:
        ncesid (int): Target NCES ID to fix (e.g. 100005).
        mode (str): Should be either "school" or "district".
    
    Returns:
        str: Standardized NCES ID (does not perform zero padding if
            unknown mode is porvided).
    """
    padding = {
        "school": 12,
        "district": 7
    }.get(mode, 0)
    return str(ncesid).zfill(padding)