code: def adjust_requirements(
      requirements: PipelineComposerRequirements,
  ) -> PipelineComposerRequirements:
      """Function returns modified copy of the requirements if necessary.
      Example: Graph with only one primary node should consist of only one primary node
      without duplication, because this causes errors. Therefore minimum and maximum arity
      become equal to one.
      """
      requirements = deepcopy(requirements)
      if len(requirements.primary) == 1 and requirements.max_arity > 1:
          requirements.min_arity = requirements.max_arity = 1
      return requirements
  
file_path: FEDOT/fedot/core/pipelines/random_pipeline_factory.py
imports: import random
  from copy import deepcopy
  from random import randint
  from typing import Optional
  from golem.core.constants import MAX_GRAPH_GEN_ATTEMPTS
  from golem.core.dag.graph_utils import distance_to_root_level
  from golem.core.dag.graph_verifier import GraphVerifier
  from golem.core.optimisers.graph import OptGraph, OptNode
  from golem.core.optimisers.random_graph_factory import RandomGraphFactory
  from fedot.core.pipelines.pipeline_composer_requirements import PipelineComposerRequirements
  from fedot.core.pipelines.pipeline_node_factory import PipelineOptNodeFactory
label_desc: Use image node_id 2 for calling a global function with example usage: adjust_requirements(requirements) and returns: requirements