class_docstr: Additional methods;
  Public methods that can be used for test cases.
class_docstr_tok: ["Additional","methods",";","Public","methods","that","can","be","used","for","test","cases","."]
docstr: target: create specified collections
  method: 1. create collections (binary/non-binary, default/all data type, auto_id or not)
          2. create partitions if specified
          3. insert specified (binary/non-binary, default/all data type) data
             into each partition if any
          4. not load if specifying is_index as True
  expected: return collection and raw data, insert ids
docstr_tok: ["target",":","create","specified","collections","method",":","1.","create","collections","(","binary\/non-binary",",","default\/all","data","type",",","auto_id","or","not",")","2.","create","partitions","if","specified","3.","insert","specified","(","binary\/non-binary",",","default\/all","data","type",")","data","into","each","partition","if","any","4.","not","load","if","specifying","is_index","as","True","expected",":","return","collection","and","raw","data",",","insert","ids"]
code: def init_collection_general(
      self,
      prefix="test",
      insert_data=False,
      nb=ct.default_nb,
      partition_num=0,
      is_binary=False,
      is_all_data_type=False,
      auto_id=False,
      dim=ct.default_dim,
      is_index=True,
      primary_field=ct.default_int64_field_name,
      is_flush=True,
      name=None,
      enable_dynamic_field=False,
      with_json=True,
      random_primary_key=False,
      **kwargs,
  ):
      """
      target: create specified collections
      method: 1. create collections (binary/non-binary, default/all data type, auto_id or not)
              2. create partitions if specified
              3. insert specified (binary/non-binary, default/all data type) data
                 into each partition if any
              4. not load if specifying is_index as True
      expected: return collection and raw data, insert ids
      """
      log.info(
          "Test case of search interface: initialize before test case"
      )
      self._connect()
      collection_name = cf.gen_unique_str(prefix)
      if name is not None:
          collection_name = name
      vectors = []
      binary_raw_vectors = []
      insert_ids = []
      time_stamp = 0
      # 1 create collection
      default_schema = cf.gen_default_collection_schema(
          auto_id=auto_id,
          dim=dim,
          primary_field=primary_field,
          enable_dynamic_field=enable_dynamic_field,
          with_json=with_json,
      )
      if is_binary:
          default_schema = cf.gen_default_binary_collection_schema(
              auto_id=auto_id, dim=dim, primary_field=primary_field
          )
      if is_all_data_type:
          default_schema = cf.gen_collection_schema_all_datatype(
              auto_id=auto_id,
              dim=dim,
              primary_field=primary_field,
              enable_dynamic_field=enable_dynamic_field,
              with_json=with_json,
          )
      log.info("init_collection_general: collection creation")
      collection_w = self.init_collection_wrap(
          name=collection_name, schema=default_schema, **kwargs
      )
      # 2 add extra partitions if specified (default is 1 partition named "_default")
      if partition_num > 0:
          cf.gen_partitions(collection_w, partition_num)
      # 3 insert data if specified
      if insert_data:
          (
              collection_w,
              vectors,
              binary_raw_vectors,
              insert_ids,
              time_stamp,
          ) = cf.insert_data(
              collection_w,
              nb,
              is_binary,
              is_all_data_type,
              auto_id=auto_id,
              dim=dim,
              enable_dynamic_field=enable_dynamic_field,
              with_json=with_json,
              random_primary_key=random_primary_key,
          )
          if is_flush:
              assert collection_w.is_empty is False
              assert collection_w.num_entities == nb
          # This condition will be removed after auto index feature
          if is_index:
              if is_binary:
                  collection_w.create_index(
                      ct.default_binary_vec_field_name,
                      ct.default_bin_flat_index,
                  )
              else:
                  collection_w.create_index(
                      ct.default_float_vec_field_name,
                      ct.default_flat_index,
                  )
              collection_w.load()
      elif is_index:
          if is_binary:
              collection_w.create_index(
                  ct.default_binary_vec_field_name,
                  ct.default_bin_flat_index,
              )
          else:
              collection_w.create_index(
                  ct.default_float_vec_field_name, ct.default_flat_index
              )
  
      return (
          collection_w,
          vectors,
          binary_raw_vectors,
          insert_ids,
          time_stamp,
      )
  
imports: from numpy.core.fromnumeric import _partition_dispatcher
  import pytest
  import sys
  from pymilvus import DefaultConfig
  from base.database_wrapper import ApiDatabaseWrapper
  from base.connections_wrapper import ApiConnectionsWrapper
  from base.collection_wrapper import ApiCollectionWrapper
  from base.partition_wrapper import ApiPartitionWrapper
  from base.index_wrapper import ApiIndexWrapper
  from base.utility_wrapper import ApiUtilityWrapper
  from base.schema_wrapper import ApiCollectionSchemaWrapper, ApiFieldSchemaWrapper
  from base.high_level_api_wrapper import HighLevelApiWrapper
  from utils.util_log import test_log
  from common import common_func
  from common import common_type
  from pymilvus import ResourceGroupInfo
label_desc: Use image node_id 6 for calling the TestcaseBase obj's underlying member method code with example usage: obj.init_collection_general(prefix, insert_data, nb, partition_num, is_binary, is_all_data_type, auto_id, dim, is_index, primary_field, is_flush, name, enable_dynamic_field, with_json, random_primary_key) and returns: collection_w,  vectors,  binary_raw_vectors,  insert_ids,  time_stamp