def _AllowBuilderStyleCalls(node):

  def RecGetLeaves(node):
    if isinstance(node, pytree.Leaf):
      return [node]
    children = []
    for child in node.children:
      children += RecGetLeaves(child)
    return children

  list_of_children = RecGetLeaves(node)
  prev_child = None
  for child in list_of_children:
    if child.value == '.':
      if prev_child.lineno != child.lineno:
        pytree_utils.SetNodeAnnotation(child,
                                       pytree_utils.Annotation.SPLIT_PENALTY, 0)
    prev_child = child
Allow splitting before '.' if it's a builder style function call.
dataset/ETHPy150Open google/yapf/yapf/yapflib/split_penalty.py/_AllowBuilderStyleCalls