code: def allowed_methods(self):
          
          return [
              method
              for method, allowed in (
                  ('GET', hasattr(self, 'on_get')),
                  ('POST', hasattr(self, 'on_post')),
                  ('PUT', hasattr(self, 'on_put')),
                  ('PATCH', hasattr(self, 'on_patch')),
                  ('DELETE', hasattr(self, 'on_delete')),
                  ('HEAD', hasattr(self, 'on_head')),
                  ('OPTIONS', hasattr(self, 'on_options')),
              ) if allowed
          ]
docs: Return list of allowed HTTP methods on this resource.
  
          This is only for purpose of making resource description.
  
          Returns:
              list: list of allowed HTTP method names (uppercase)