class_docstr: Buckets with linearly increasing width:
  :math:`w_i = \alpha * i + 1` for all :math:`i \geq 1`.
class_docstr_tok: ["Buckets","with","linearly","increasing","width",":",":","math",":","`","w_i","=","\\alpha","*","i","+","1","`","for","all",":","math",":","`","i","\\geq","1","`","."]
docstr: This function generates bucket keys with linearly increasing bucket width:
  
  Parameters
  ----------
  max_lengths
      Maximum of lengths of sequences.
  min_lengths
      Minimum of lengths of sequences.
  num_buckets
      Number of buckets
  
  Returns
  -------
  bucket_keys
      A list including the keys of the buckets.
docstr_tok: ["This","function","generates","bucket","keys","with","linearly","increasing","bucket","width",":","Parameters","--","--","--","--","--","max_lengths","Maximum","of","lengths","of","sequences",".","min_lengths","Minimum","of","lengths","of","sequences",".","num_buckets","Number","of","buckets","Returns","--","--","--","-","bucket_keys","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 function generates bucket keys with linearly increasing bucket width:
  
      Parameters
      ----------
      max_lengths
          Maximum of lengths of sequences.
      min_lengths
          Minimum of lengths of sequences.
      num_buckets
          Number of buckets
  
      Returns
      -------
      bucket_keys
          A list including the keys of the buckets.
      """
      if not isinstance(max_lengths, INT_TYPES):
          alpha_l = [
              2
              * float(max_len - min_len - num_buckets)
              / (num_buckets * (num_buckets + 1))
              for max_len, min_len in zip(max_lengths, min_lengths)
          ]
          bucket_keys = [
              tuple(
                  int(
                      round(
                          min_len
                          + alpha * (((i + 1) * (i + 2)) / 2)
                          + i
                          + 1
                      )
                  )
                  for min_len, alpha in zip(min_lengths, alpha_l)
              )
              for i in range(num_buckets)
          ]
          bucket_keys[-1] = tuple(
              max(max_bucket_key, max_len)
              for max_bucket_key, max_len in zip(
                  bucket_keys[-1], max_lengths
              )
          )
      else:
          alpha = (
              2
              * float(max_lengths - min_lengths - num_buckets)
              / (num_buckets * (num_buckets + 1))
          )
          bucket_keys = [
              int(
                  round(
                      min_lengths
                      + alpha * (((i + 1) * (i + 2)) / 2)
                      + i
                      + 1
                  )
              )
              for i in range(num_buckets)
          ]
          bucket_keys[-1] = max(bucket_keys[-1], max_lengths)
      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 LinearWidthBucket obj's underlying member method code with example usage: obj.__call__(max_lengths, min_lengths, num_buckets) and returns: bucket_keys