293f90f5460e8f7ba06965d5c1b1304925b5a142,examples/tsf/utils.py,,get_batches,#Any#Any#Any#Any#Any#,51

Before Change


    x1 = makeup(x1, len(x0))
  n = len(x0)

  if shuffle:
    random.shuffle(x0)
    random.shuffle(x1)

  // order0 = range(n)
  // z = sorted(zip(order0, x0), key=lambda i:len(i[1]))
  // order0, x0 = zip(*z)

  // order1 = range(n)
  // z = sorted(zip(order1, x1), key=lambda i:len(i[1]))
  // order1, x1 = zip(*z)

  batches = []
  s = 0
  while s < n:
    t = min(s + batch_size, n)

After Change


  //   random.shuffle(x0)
  //   random.shuffle(x1)

  if shuffle:
    order0 = range(n)
    z = sorted(zip(order0, x0), key=lambda i:len(i[1]))
    order0, x0 = zip(*z)

    order1 = range(n)
    z = sorted(zip(order1, x1), key=lambda i:len(i[1]))
    order1, x1 = zip(*z)

  batches = []
  s = 0
  while s < n:
    t = min(s + batch_size, n)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: asyml/texar
Commit Name: 293f90f5460e8f7ba06965d5c1b1304925b5a142
Time: 2017-12-02
Author: zichaoy@cs.cmu.edu
File Name: examples/tsf/utils.py
Class Name:
Method Name: get_batches


Project Name: keras-team/keras
Commit Name: 403b4fc7a25da5d957b24f1c269103ef6e290bd6
Time: 2016-01-26
Author: udi@benreuven.com
File Name: keras/preprocessing/image.py
Class Name: ImageDataGenerator
Method Name: flow


Project Name: PetrochukM/PyTorch-NLP
Commit Name: 2a1a6851344172e0134f3c5f4f5c1021975f2812
Time: 2018-03-11
Author: petrochukm@gmail.com
File Name: torchnlp/samplers/bucket_batch_sampler.py
Class Name: BucketBatchSampler
Method Name: __iter__