docstr: Returns list of bucket keys based on the specified bucket key
  and minimum result size N.
docstr_tok: ["Returns","list","of","bucket","keys","based","on","the","specified","bucket","key","and","minimum","result","size","N","."]
code: def bucket_keys_to_guarantee_result_set_size(
      self, bucket_key, N, tree_depth
  ):
      """
      Returns list of bucket keys based on the specified bucket key
      and minimum result size N.
      """
  
      if tree_depth == len(bucket_key):
          # print 'Returning leaf bucket key %s with %d vectors' % (self.bucket_key, self.vector_count)
          # This is a leaf so just return the bucket key (we reached the bucket leaf)
          return [self.bucket_key]
  
      # If not leaf, this is a subtree node.
  
      hash_char = bucket_key[tree_depth]
      if hash_char == "0":
          other_hash_char = "1"
      else:
          other_hash_char = "0"
  
      # Check if child has enough results
      if hash_char in self.childs:
          if self.childs[hash_char].vector_count < N:
              # If not combine buckets of both child subtrees
              listA = self.childs[hash_char].collect_all_bucket_keys()
              listB = self.childs[
                  other_hash_char
              ].collect_all_bucket_keys()
              return listA + listB
          else:
              # Child subtree has enough results, so call method on child
              return self.childs[
                  hash_char
              ].bucket_keys_to_guarantee_result_set_size(
                  bucket_key, N, tree_depth + 1
              )
      else:
          # That subtree is not existing, so just follow the other side
          return self.childs[
              other_hash_char
          ].bucket_keys_to_guarantee_result_set_size(
              bucket_key, N, tree_depth + 1
          )
  
file_path: NearPy/nearpy/hashes/randombinaryprojectiontree.py
imports: import numpy
  import scipy
  import scipy.sparse
  from nearpy.hashes.lshash import LSHash
label_desc: Use image node_id 4 for calling the RandomBinaryProjectionTreeNode obj's underlying member method code with example usage: obj.bucket_keys_to_guarantee_result_set_size(bucket_key, N, tree_depth) and returns: list, self, unknown, self