@web.removeslash
    def get(self):
        #
        # Get entity list
        #
        db_result = self.get_tag_cloud(
            definition = self.get_argument('definition', default=None, strip=True),
            limit      = self.get_argument('limit', default=None, strip=True),
        )

        if len(db_result) == 0:
            self.json({
                'time': round(self.request.request_time(), 3),
                'count': 0,
                'result': {
                    'tags': [{
                        'Count': 1,
                        'Tag': '(>< V ><)',
                        'nLog': 1,
                        'Log': 1,
                        'nCount': 1
                    },],
                    'range': {'min': 1, 'max': 1},
                    'logRange': {'min': 1, 'max': 1}
                }
            })
            return

        seq_count = [x['Count'] for x in db_result]
        seq_log = [x['Log'] for x in db_result]
        min_cnt = min(seq_count)
        max_cnt = max(seq_count)
        min_log = min(seq_log)
        max_log = max(seq_log)

        for row in db_result:
            row['nCount'] = 1.0 * (row['Count'] - min_cnt) / (max_cnt - min_cnt) if (max_cnt > min_cnt) else 1
            row['nLog'] = 1.0 * (row['Log'] - min_log) / (max_log - min_log) if (max_log > min_log) else 1

        self.json({
            'time': round(self.request.request_time(), 3),
            'count': len(db_result),
            'result': {
                'tags': db_result,
                'range': {'min': min_cnt, 'max': max_cnt},
                'logRange': {'min': min_log, 'max': max_log}
            }
        })
dataset/ETHPy150Open argoroots/Entu/app/api/api2.py/API2TagCloud.get/original