(input_path)
return (source_tree, output_path)
Given input_path, returns a tuple with sourceTree and path values.

  Examples:
    input_path     (source_tree, output_path)
    '$(VAR)/path'  ('VAR', 'path')
    '$(VAR)'       ('VAR', None)
    'path'         (None, 'path')
Given input_path, returns a tuple with sourceTree and path values.
Given input_path returns a tuple with sourceTree and path values .
def SourceTreeAndPathFromPath(input_path):
  """Given input_path, returns a tuple with sourceTree and path values.

  Examples:
    input_path     (source_tree, output_path)
    '$(VAR)/path'  ('VAR', 'path')
    '$(VAR)'       ('VAR', None)
    'path'         (None, 'path')
  """

  source_group_match = _path_leading_variable.match(input_path)
  if source_group_match:
    source_tree = source_group_match.group(1)
    output_path = source_group_match.group(3)  # This may be None.
  else:
    source_tree = None
    output_path = input_path

  return (source_tree, output_path)
def SourceTreeAndPathFromPath ( input_path ) : source_group_match = _path_leading_variable . match ( input_path ) if source_group_match : source_tree = source_group_match . group ( 1 ) output_path = source_group_match . group ( 3 ) # This may be None. else : source_tree = None output_path = input_path return ( source_tree , output_path )