How does cPanel calculate the quotas for a user?
Quota calculation is actually handled by the Operating System. Using the quota command, you can retrieve the same information that cPanel would utilize to display disk and inode usage for you.
[root@the ~]$ quota -svu $USER
Disk quotas for user blue (uid 1033):
Filesystem space quota limit grace files quota limit grace
/dev/vda1 3360K 10240M 10240M 91 0 0