<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def creditusage(cls):
 """Get credit usage per hour"""

        rating = cls.call('hosting.rating.list')
        if not rating:
            return 0

        rating = rating.pop()
        usage = [sum(resource.values())
                 for resource in rating.values()
                 if isinstance(resource, dict)]
        return sum(usage)