original_docstring: Add a component.
  
          A component is a part of the system that does something or is in some way
          acted on. It exists inside a threat boundary and is generally connected to
          other components. It can be defined using an @alias tag, or when using a threat
          tag, for example:
  
              @alias component @user:@session to Web session
              @exposes @user:Session to information disclosure with lack of TLS
  
          Args:
              boundary_id: A boundary id string.
              component: A component id or name string.
              component_id: An optional string containing a component identifier. If this is set, then component must contain a name and not an identifier.
  
          Returns:
              A component identifier.
          
docstring: Add a component.
  A component is a part of the system that does something or is in some way
  acted on. It exists inside a threat boundary and is generally connected to
  other components. It can be defined using an @alias tag, or when using a threat
  tag, for example.
  
  
docstring_tokens: Add a component . A component is a part of the system that does something or is in some way acted on . It exists inside a threat boundary and is generally connected to other components . It can be defined using an @alias tag or when using a threat tag for example .
code: def add_component(self, boundary_id, component, component_id=None):
          """Add a component.
  
          A component is a part of the system that does something or is in some way
          acted on. It exists inside a threat boundary and is generally connected to
          other components. It can be defined using an @alias tag, or when using a threat
          tag, for example:
  
              @alias component @user:@session to Web session
              @exposes @user:Session to information disclosure with lack of TLS
  
          Args:
              boundary_id: A boundary id string.
              component: A component id or name string.
              component_id: An optional string containing a component identifier. If this is set, then component must contain a name and not an identifier.
  
          Returns:
              A component identifier.
          """
  
          if component_id and is_identifier(component):
              raise ValueError("component_id has been set, but component contains an identifier")
  
          if not component_id and is_identifier(component):
              return component
  
          if not component_id:
              component_id = text_to_identifier(component)
  
          if boundary_id not in self.components:
              self.components[boundary_id] = {}
          if component_id not in self.components[boundary_id]:
              self.components[boundary_id][component_id] = PTSComponent(component)
          return component_id
code_tokens: def add_component ( self , boundary_id , component , component_id = None ) : if component_id and is_identifier ( component ) : raise ValueError ( "component_id has been set, but component contains an identifier" ) if not component_id and is_identifier ( component ) : return component if not component_id : component_id = text_to_identifier ( component ) if boundary_id not in self . components : self . components [ boundary_id ] = { } if component_id not in self . components [ boundary_id ] : self . components [ boundary_id ] [ component_id ] = PTSComponent ( component ) return component_id
short_docstring: Add a component.
short_docstring_tokens: Add a component .
comment: """Add a component.
  
          A component is a part of the system that does something or is in some way
          acted on. It exists inside a threat boundary and is generally connected to
          other components. It can be defined using an @alias tag, or when using a threat
          tag, for example:
  
              @alias component @user:@session to Web session
              @exposes @user:Session to information disclosure with lack of TLS
  
          Args:
              boundary_id: A boundary id string.
              component: A component id or name string.
              component_id: An optional string containing a component identifier. If this is set, then component must contain a name and not an identifier.
  
          Returns:
              A component identifier.
          """