def shortest_path_from_list(file_name, name_list):
  """ Determines the shortest path to a file in a list of candidates.

  Args:
    file_name: A string specifying the name of the matching candidates.
    name_list: A list of strings specifying paths.
  Returns:
    A string specifying the candidate with the shortest path or None.
  """
  candidates = [path for path in name_list if path.split('/')[-1] == file_name]
  if not candidates:
    return None

  shortest_path = candidates[0]
  for candidate in candidates:
    if len(candidate.split('/')) < len(shortest_path.split('/')):
      shortest_path = candidate

  return shortest_path