Advertisement
Guest User

Untitled

a guest
Mar 11th, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1.   def getBucketIndices(self, inputData):
  2.     """
  3.    Returns an array containing the sub-field bucket indices for
  4.    each sub-field of the inputData. To get the associated field names for each of
  5.    the buckets, call getScalarNames().
  6.    :param inputData: The data from the source. This is typically a object with
  7.                 members.
  8.    :return: array of bucket indices
  9.    """
  10.  
  11.     retVals = []
  12.  
  13.     if self.encoders is not None:
  14.       for (name, encoder, offset) in self.encoders:
  15.         values = encoder.getBucketIndices(self._getInputValue(inputData, name))
  16.         retVals.extend(values)
  17.     else:
  18.       assert False, "Should be implemented in base classes that are not " \
  19.         "containers for other encoders"
  20.  
  21. return retVals
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement