original_docstring: 
      Initializes the elasticsearch mapping for this pillow if it is not found.
      
docstring: Initializes the elasticsearch mapping for this pillow if it is not found.
docstring_tokens: Initializes the elasticsearch mapping for this pillow if it is not found .
code: def initialize_mapping_if_necessary(es, index_info):
      """
      Initializes the elasticsearch mapping for this pillow if it is not found.
      """
      if not mapping_exists(es, index_info):
          pillow_logging.info("Initializing elasticsearch mapping for [%s]" % index_info.type)
          mapping = copy(index_info.mapping)
          mapping['_meta']['created'] = datetime.isoformat(datetime.utcnow())
          mapping_res = es.indices.put_mapping(index_info.type, {index_info.type: mapping}, index=index_info.index)
          if mapping_res.get('ok', False) and mapping_res.get('acknowledged', False):
              # API confirms OK, trust it.
              pillow_logging.info("Mapping set: [%s] %s" % (index_info.type, mapping_res))
      else:
          pillow_logging.info("Elasticsearch mapping for [%s] was already present." % index_info.type)
code_tokens: def initialize_mapping_if_necessary ( es , index_info ) : if not mapping_exists ( es , index_info ) : pillow_logging . info ( "Initializing elasticsearch mapping for [%s]" % index_info . type ) mapping = copy ( index_info . mapping ) mapping [ '_meta' ] [ 'created' ] = datetime . isoformat ( datetime . utcnow ( ) ) mapping_res = es . indices . put_mapping ( index_info . type , { index_info . type : mapping } , index = index_info . index ) if mapping_res . get ( 'ok' , False ) and mapping_res . get ( 'acknowledged' , False ) : pillow_logging . info ( "Mapping set: [%s] %s" % ( index_info . type , mapping_res ) ) else : pillow_logging . info ( "Elasticsearch mapping for [%s] was already present." % index_info . type )
short_docstring: Initializes the elasticsearch mapping for this pillow if it is not found.
short_docstring_tokens: Initializes the elasticsearch mapping for this pillow if it is not found .
comment: """
      Initializes the elasticsearch mapping for this pillow if it is not found.
      """$SEP$# API confirms OK, trust it.