'Return a list of sizes (machineTypes) in a zone.
:keyword  location: Which data center to filter a sizes in.
:type     location: :class:`NodeLocation` or ``None``
:return:  List of NodeSize objects
:rtype:   ``list`` of :class:`NodeSize`'

def list_sizes(self, location=None):

    account = self.connection.request('hosting.account.info').object
    if account.get('rating_enabled'):
        return self.list_instance_type(location)
    available_res = account['resources']['available']
    if (available_res['shares'] == 0):
        return None
    else:
        share_def = account['share_definition']
        available_cores = available_res['cores']
        max_core = int((available_cores + 0.75))
        shares = []
        if (available_res['servers'] < 1):
            return shares
        for i in range(1, (max_core + 1)):
            share = {id: i}
            share_is_available = True
            for k in ['memory', 'disk', 'bandwidth']:
                if ((share_def[k] * i) > available_res[k]):
                    share_is_available = False
                else:
                    share[k] = (share_def[k] * i)
            if share_is_available:
                nb_core = i
                shares.append(self._to_size(nb_core, share))
        return shares
