class_docstr: NGT: Neighborhood Graph and Tree for Indexing High-dimensional Data
    NGT provides the functionality of searching for approximate nearest neighbors in high-dimensional data.
  
  Example:
  ```python
    from ngt import base as ngt
    import random
  
    dim = 10
    objects = []
    for i in range(0, 100) :
        vector = random.sample(range(100), dim)
        objects.append(vector)
  
    query = objects[0]
    index = ngt.Index.create(b"tmp", dim)
    index.insert(objects)
    # You can also insert objects from a file like this.
    # index.insert_from_tsv('list.dat')
  
    index.save()
    # You can load the saved index like this.
    # index = ngt.Index(b"tmp")
  
    result = index.search(query, 3)
  
    for i, o in enumerate(result) :
        print(str(i) + ": " + str(o.id) + ", " + str(o.distance))
        object = index.get_object(o.id)
        print(object)
  ```
class_docstr_tok: ["NGT",":","Neighborhood","Graph","and","Tree","for","Indexing","High-dimensional","Data","NGT","provides","the","functionality","of","searching","for","approximate","nearest","neighbors","in","high-dimensional","data",".","Example",":","``","`","python","from","ngt","import","base","as","ngt","import","random","dim","=","10","objects","=","[","]","for","i","in","range","(","0",",","100",")",":","vector","=","random.sample","(","range","(","100",")",",","dim",")","objects.append","(","vector",")","query","=","objects","[","0","]","index","=","ngt.Index.create","(","b","''","tmp","''",",","dim",")","index.insert","(","objects",")","#","You","can","also","insert","objects","from","a","file","like","this",".","#","index.insert_from_tsv","(","'list.dat","'",")","index.save","(",")","#","You","can","load","the","saved","index","like","this",".","#","index","=","ngt.Index","(","b","''","tmp","''",")","result","=","index.search","(","query",",","3",")","for","i",",","o","in","enumerate","(","result",")",":","print","(","str","(","i",")","+","``",":","``","+","str","(","o.id",")","+","``",",","``","+","str","(","o.distance",")",")","object","=","index.get_object","(","o.id",")","print","(","object",")","``","`"]
docstr: create an empty index with the specified parameters.
    edge_size_for_creation : Number of edges for each node in the graph.
    edge_size_for_search   : Number of edges to search.
    object_type            : Type of the data object. (Float, Integer [Integer is 1 byte])
    distance_type          : Type of the distance function. (L1,L2,Angle,Hamming,Cosine)
docstr_tok: ["create","an","empty","index","with","the","specified","parameters",".","edge_size_for_creation",":","Number","of","edges","for","each","node","in","the","graph",".","edge_size_for_search",":","Number","of","edges","to","search",".","object_type",":","Type","of","the","data","object",".","(","Float",",","Integer","[","Integer","is","1","byte","]",")","distance_type",":","Type","of","the","distance","function",".","(","L1",",","L2",",","Angle",",","Hamming",",","Cosine",")"]
code: def create(
      path,
      dimension,
      edge_size_for_creation=10,
      edge_size_for_search=40,
      object_type="Float",
      distance_type="L2",
  ):
      """
      create an empty index with the specified parameters.
        edge_size_for_creation : Number of edges for each node in the graph.
        edge_size_for_search   : Number of edges to search.
        object_type            : Type of the data object. (Float, Integer [Integer is 1 byte])
        distance_type          : Type of the distance function. (L1,L2,Angle,Hamming,Cosine)
      """
      err = None
      prop = None
      index = None
      try:
          err = Index.__ngt.ngt_create_error_object()
  
          prop = Index.__ngt.ngt_create_property(err)
          Index._check_error_obj(prop, err)
  
          stat = Index.__ngt.ngt_set_property_dimension(
              prop, dimension, err
          )
          Index._check_error_num(stat, err)
  
          stat = Index.__ngt.ngt_set_property_edge_size_for_creation(
              prop, edge_size_for_creation, err
          )
          Index._check_error_num(stat, err)
          stat = Index.__ngt.ngt_set_property_edge_size_for_search(
              prop, edge_size_for_search, err
          )
          Index._check_error_num(stat, err)
  
          if object_type == "Float":
              stat = Index.__ngt.ngt_set_property_object_type_float(
                  prop, err
              )
              Index._check_error_num(stat, err)
          elif object_type == "Integer":
              stat = Index.__ngt.ngt_set_property_object_type_integer(
                  prop, err
              )
              Index._check_error_num(stat, err)
  
          if distance_type == "L1":
              stat = Index.__ngt.ngt_set_property_distance_type_l1(
                  prop, err
              )
              Index._check_error_num(stat, err)
          elif distance_type == "L2":
              stat = Index.__ngt.ngt_set_property_distance_type_l2(
                  prop, err
              )
              Index._check_error_num(stat, err)
          elif distance_type == "Angle":
              stat = Index.__ngt.ngt_set_property_distance_type_angle(
                  prop, err
              )
              Index._check_error_num(stat, err)
          elif distance_type == "Hamming":
              stat = Index.__ngt.ngt_set_property_distance_type_hamming(
                  prop, err
              )
              Index._check_error_num(stat, err)
          elif distance_type == "Jaccard":
              stat = Index.__ngt.ngt_set_property_distance_type_jaccard(
                  prop, err
              )
              Index._check_error_num(stat, err)
          elif distance_type == "Cosine":
              stat = Index.__ngt.ngt_set_property_distance_type_cosine(
                  prop, err
              )
              Index._check_error_num(stat, err)
  
          index = Index.__ngt.ngt_create_graph_and_tree(path, prop, err)
          Index._check_error_obj(index, err)
  
          # close and delete the index object
          Index.__ngt.ngt_close_index(index)
          index = None
  
          obj = Index(path)
  
      finally:
          if err is not None:
              Index.__ngt.ngt_destroy_error_object(err)
          if prop is not None:
              Index.__ngt.ngt_destroy_property(prop)
          if index is not None:
              Index.__ngt.ngt_close_index(index)
  
      return obj
  
imports: from ctypes import Structure, POINTER, c_char, c_uint, c_uint8, c_void_p, c_char_p, c_int, c_double, c_float, cdll
  import ctypes.util
  import csv
label_desc: Use image node_id 4 for calling the Index obj's underlying member method code with example usage: obj.create(path, dimension, edge_size_for_creation, edge_size_for_search, object_type, distance_type) and returns: obj