def parse_dependencies_json(self, config_json, subprocess_runner,
                              working_copy, config_reader, parent_package):
    """Parse dependencies from a dictionary read from a config.json file.

    All dependencies are added to the "dependencies" attribute.

    Args:
      config_json: Dictionary parsed from config.json file.
      subprocess_runner: Subprocess instance used to run commands.
      working_copy: Directory to stage git changes in.
      config_reader: Callable that read_config()'s signature used to recursively
        read dependencies of the package.
      parent_package: Package instance which is a parent of the dependencies
        specified in config_json.

    Raises:
      ConfigJsonError: If an expected key isn't found in the JSON dictionary.
    """
    try:
      dependencies_list = config_json['dependencies']
    except __HOLE__ as e:
      raise ConfigJsonError('Dependencies not found: (%s)' % str(e))

    # Parse packages from the config and resolve all packages.
    additional_dependencies = parent_package.resolve_dependency_paths(
        [Package(dependency_dict, subprocess_runner, working_copy,
                 parent_package.config_path)
         for dependency_dict in dependencies_list])

    # Extend the list of dependencies with newly discovered packages.
    path_dependency_dict = dict([(d.path, d) for d in self.dependencies])
    new_dependencies = []
    for dependency in additional_dependencies:
      if (dependency.path not in path_dependency_dict and
          dependency.path != self.path):
        path_dependency_dict[dependency.path] = dependency
        new_dependencies.append(dependency)
    self.dependencies = path_dependency_dict.values()

    # Recursively read dependencies.
    for dependency in new_dependencies:
      if dependency.fetch_dependencies:
        self.parse_dependencies_json(
            config_reader(os.path.join(dependency.path,
                                       dependency.config_path)),
            subprocess_runner, working_copy, config_reader, dependency)
dataset/ETHPy150Open google/fplutil/disttools/push_package.py/Package.parse_dependencies_json