Parse the get_host_health_data() for essential properties

        :param data: the output returned by get_host_health_data()
        :returns: memory size in MB.
        :raises IloError, if unable to get the memory details.
970755
def _parse_memory_embedded_health(self, data):
        
        memory_mb = 0
        memory = self._get_memory_details_value_based_on_model(data)

        if memory is None:
            msg = "Unable to get memory data. Error: Data missing"
            raise exception.IloError(msg)

        total_memory_size = 0
        for memory_item in memory:
            memsize = memory_item[self.MEMORY_SIZE_TAG]["VALUE"]
            if memsize != self.MEMORY_SIZE_NOT_PRESENT_TAG:
                memory_bytes = (
                    strutils.string_to_bytes(
                        memsize.replace(' ', ''), return_int=True))
                memory_mb = int(memory_bytes / (1024 * 1024))
                total_memory_size = total_memory_size + memory_mb
        return total_memory_size
1283744
def memory_usage(self, string=False):
        
        if string:
            n = getsizeof(self)
            return ' '.join((str(s) for s in convert_bytes(n)))
        return self.info()['size']
32078
def data(self):
    
    try:
      return self._pyregf_value.data
    except IOError as exception:
      raise errors.WinRegistryValueError(
          'Unable to read data from value: {0:s} with error: {1!s}'.format(
              self._pyregf_value.name, exception))
953277
def value_from_datadict(self, data, files, name):
        
        value = super(FileSizeWidget, self).value_from_datadict(data, files, name)
        if value not in EMPTY_VALUES:
            try:
                return parse_size(value)
            except ValueError:
                pass
        return value
500233
def data(self):
        
        return self._buf[self.offset():self.offset() + self.size()]
1214377
def _loadData(self, data):
        
        self._data = data
        self.id = cast(int, data.attrib.get('id'))
        self.role = data.attrib.get('role')
        self.tag = data.attrib.get('tag')
        # additional attributes only from hub search
        self.key = data.attrib.get('key')
        self.librarySectionID = cast(int, data.attrib.get('librarySectionID'))
        self.librarySectionTitle = data.attrib.get('librarySectionTitle')
        self.librarySectionType = data.attrib.get('librarySectionType')
        self.tagType = cast(int, data.attrib.get('tagType'))
        self.thumb = data.attrib.get('thumb')
537171
def data(self):
        
        if self._data is None:
            # self._data is None if data segment is empty
            return np.empty((0, 1))
        if self._data_scaled is None:
            scale = scaling.get_scaling(self)
            if scale is None:
                self._data_scaled = self._data
            else:
                self._data_scaled = scale.scale(self._data)

        return self._data_scaled
858551
def get_data(self):
        
        data = []
        if self.counts:
            time_sec = self.duration
            memory_mb = self.mem / 1024. / 1024. if self.measuremem else 0
            data.append((self.operation, time_sec, memory_mb, self.counts))
        return numpy.array(data, perf_dt)
829050
def _get_firmware_embedded_health(self, data):
        
        firmware = self.get_value_as_list(data['GET_EMBEDDED_HEALTH_DATA'],
                                          'FIRMWARE_INFORMATION')
        if firmware is None:
            return None
        return dict((y['FIRMWARE_NAME']['VALUE'],
                     y['FIRMWARE_VERSION']['VALUE'])
                    for x in firmware for y in x.values())
1308001
def GetByteSize(self):
    
    if not self.element_data_type_definition:
      return None

    if self.elements_data_size:
      return self.elements_data_size

    if not self.number_of_elements:
      return None

    element_byte_size = self.element_data_type_definition.GetByteSize()
    if not element_byte_size:
      return None

    return element_byte_size * self.number_of_elements
541347
def health(self, **kwargs):
        '''
        
        '''
        if not len(kwargs):
            raise ValueError('no resource provided')
        for resource, name in kwargs.iteritems():
            endpoint = 'health/{}/{}'.format(resource, name)
        return self._get(endpoint)
685823
def get_abi_size(self, target_data, context=None):
        
        llty = self._get_ll_pointer_type(target_data, context)
        return target_data.get_pointee_abi_size(llty)
316251
def parse_result(self, data):
        
        # typedef struct {
        #   uint8_t numBytes;                   // Number of bytes in buffer now
        # } YSM_BUFFER_LOAD_RESP;
        count = ord(data[0])
        if self.offset == 0:
            # if offset was 0, the buffer was reset and
            # we can verify the length returned
            if count != self.data_len:
                raise pyhsm.exception.YHSM_Error("Incorrect number of bytes in buffer (got %i, expected %i)" \
                                               % (self.data_len, count))
        return count
188271
def _parse(self, data):
        
        super(Image, self)._parse(data)
        self.height = data['height']
        self.type = data['type']
        self.width = data['width']
659781
def get_health(self):
        
        summary = {'badreadings': [], 'health': const.Health.Ok}
        fallbackreadings = []
        try:
            self.oem_init()
            fallbackreadings = self._oem.get_health(summary)
            for reading in self.get_sensor_data():
                if reading.health != const.Health.Ok:
                    summary['health'] |= reading.health
                    summary['badreadings'].append(reading)
        except exc.BypassGenericBehavior:
            pass
        if not summary['badreadings']:
            summary['badreadings'] = fallbackreadings
        return summary
1346916
def unpack(data):
        
        length = struct.unpack('i', data[0:HEADER_SIZE])
        return length[0], data[HEADER_SIZE:]
1097912
private HostThreadData getData() {
        Thread thread = Thread.currentThread();
        if (!(thread instanceof XnioIoThread)) {
            throw UndertowMessages.MESSAGES.canOnlyBeCalledByIoThread();
        }
        XnioIoThread ioThread = (XnioIoThread) thread;
        HostThreadData data = hostThreadData.get(ioThread);
        if (data != null) {
            return data;
        }
        data = new HostThreadData();
        HostThreadData existing = hostThreadData.putIfAbsent(ioThread, data);
        if (existing != null) {
            return existing;
        }
        return data;
    }