<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def calculate_include_paths(targets, is_thrift_target):
 """Calculates the set of import paths for the given targets. :targets: The targets to examine. :is_thrift_target: A predicate to pick out thrift targets for consideration in the analysis. :returns: Include basedirs for the target. """


  basedirs = set()
  def collect_paths(target):
    basedirs.add(target.target_base)

  for target in targets:
    target.walk(collect_paths, predicate=is_thrift_target)
  return basedirs