@UserExist(uid_key='user')
    def user(self, arg, opts):
        headers = ["#Item", "Type", "Value"]

        table = []

        user = self.pb['router'].getUser(opts.user)
        # SMPP Server stats
        for k, v in user.getCnxStatus().smpps.iteritems():
            if isinstance(v, dict):
                v = json.dumps(v)

            row = []
            row.append('#%s' % k)
            row.append('SMPP Server')
            if k[-3:] == '_at':
                row.append(formatDateTime(v))
            else:
                row.append(v)

            table.append(row)

        # HTTP API stats
        for k, v in user.getCnxStatus().httpapi.iteritems():
            if isinstance(v, dict):
                v = json.dumps(v)

            row = []
            row.append('#%s' % k)
            row.append('HTTP Api')
            if k[-3:] == '_at':
                row.append(formatDateTime(v))
            else:
                row.append(v)

            table.append(row)

        self.protocol.sendData(
            tabulate(table, headers, tablefmt="plain", numalign="left").encode('ascii'))
dataset/ETHPy150Open jookies/jasmin/jasmin/protocols/cli/statsm.py/StatsManager.user/original