#NEWLINE# def RegisterDefinition( self , artifact_definition ) : #NEWLINE# #INDENT# 'Registers an artifact definition.\n\n    The artifact definitiones are identified based on their lower case name.\n\n    Args:\n      artifact_definition: the artifact definitions (instance of\n                           ArtifactDefinition).\n\n    Raises:\n      KeyError: if artifact definition is already set for the corresponding\n                name.\n    ' #NEWLINE# artifact_definition_name = artifact_definition . name . lower ( ) #NEWLINE# if ( artifact_definition_name in self . _artifact_definitions ) : #NEWLINE# #INDENT# raise KeyError ( 'Artifact definition already set for name: {0}.' . format ( artifact_definition . name ) ) #NEWLINE# #UNINDENT# self . _artifact_definitions [ artifact_definition_name ] = artifact_definition #NEWLINE# self . _defined_artifact_names . add ( artifact_definition . name ) #NEWLINE# for source in artifact_definition . sources : #NEWLINE# #INDENT# if ( source . type_indicator == definitions . TYPE_INDICATOR_ARTIFACT_GROUP ) : #NEWLINE# #INDENT# self . _artifact_name_references . update ( source . names )