def _is_credit_requirement(xblock):
 required_methods = ['get_credit_requirement_namespace', 'get_credit_requirement_name', 'get_credit_requirement_display_name']
 for method_name in required_methods:
  if (not callable(getattr(xblock, method_name, None))):
   LOGGER.error('XBlock %s is marked as a credit requirement but does not implement %s', unicode(xblock), method_name)
   return False
 return True

def _is_credit_requirement ( xblock ) : required_methods = [ 'get_credit_requirement_namespace' , 'get_credit_requirement_name' , 'get_credit_requirement_display_name' ] for method_name in required_methods : if ( not callable ( getattr ( xblock , method_name , None ) ) ) : LOGGER . error ( 'XBlock %s is marked as a credit requirement but does not implement %s' , unicode ( xblock ) , method_name ) return False return True
check if the given xblock is a credit requirement .