class_docstr: Buckets with constant width.
class_docstr_tok: ["Buckets","with","constant","width","."]
docstr: This generate bucket keys given that all the buckets have the same width.
  
  Parameters
  ----------
  max_lengths
      Maximum of lengths of sequences.
  min_lengths
      Minimum of lengths of sequences.
  num_buckets
      Number of buckets
  
  Returns
  -------
  bucket_keys : list of int
      A list including the keys of the buckets.
docstr_tok: ["This","generate","bucket","keys","given","that","all","the","buckets","have","the","same","width",".","Parameters","--","--","--","--","--","max_lengths","Maximum","of","lengths","of","sequences",".","min_lengths","Minimum","of","lengths","of","sequences",".","num_buckets","Number","of","buckets","Returns","--","--","--","-","bucket_keys",":","list","of","int","A","list","including","the","keys","of","the","buckets","."]
code: def __call__(
      self,
      max_lengths: Union[int, Sequence[int]],
      min_lengths: Union[int, Sequence[int]],
      num_buckets: int,
  ) -> List[int]:
      r"""This generate bucket keys given that all the buckets have the same width.
  
      Parameters
      ----------
      max_lengths
          Maximum of lengths of sequences.
      min_lengths
          Minimum of lengths of sequences.
      num_buckets
          Number of buckets
  
      Returns
      -------
      bucket_keys : list of int
          A list including the keys of the buckets.
      """
      if not isinstance(max_lengths, INT_TYPES):
          bucket_width_l = [
              max((1 + max_len - min_len) // num_buckets, 1)
              for max_len, min_len in zip(max_lengths, min_lengths)
          ]
          bucket_keys = [
              tuple(
                  max(max_len - i * width, min_len)
                  for max_len, min_len, width in zip(
                      max_lengths, min_lengths, bucket_width_l
                  )
              )
              for i in range(num_buckets)
          ]
      else:
          bucket_width = max(
              (1 + max_lengths - min_lengths) // num_buckets, 1
          )
          bucket_keys = [
              max(max_lengths - i * bucket_width, min_lengths)
              for i in range(num_buckets)
          ]
      return bucket_keys
  
imports: import math
  import random
  import warnings
  import numpy
  import abc
  import logging
  from typing import Union, Sequence, Optional, List
  from ..base import INT_TYPES
label_desc: Use image node_id 1 for calling the ConstWidthBucket obj's underlying member method code with example usage: obj.__call__(max_lengths, min_lengths, num_buckets) and returns: bucket_keys