components/policy/tools/template_writers/writers/template_writer.py
def IsPolicySupported(self, policy):
    '''Checks if the given policy is supported by the writer.
    In other words, the set of platforms supported by the writer
    has a common subset with the set of platforms that support
    the policy.

    Args:
      policy: The dictionary of the policy.

    Returns:
      True if the writer chooses to include 'policy' in its output.
    '''
    if ('deprecated' in policy and policy['deprecated'] is True and
        not self.IsDeprecatedPolicySupported(policy)):
      return False

    if ('future' in policy and policy['future'] is True and
        not self.IsFuturePolicySupported(policy)):
      return False

    if (self.IsCloudOnlyPolicy(policy)
        and not self.IsCloudOnlyPolicySupported(policy)):
      return False

    if (self.IsInternalOnlyPolicy(policy)
        and not self.IsInternalOnlyPolicySupported(policy)):
      return False

    for supported_on in policy['supported_on']:
      if not self.IsVersionSupported(policy, supported_on):
        continue
      if '*' in self.platforms or supported_on['platform'] in self.platforms:
        return True

    if self.IsFuturePolicySupported(policy):
      if '*' in self.platforms and policy['future_on']:
        return True
      for future in policy['future_on']:
        if future['platform'] in self.platforms:
          return True
    return False
Checks if the given policy is supported by the writer.
    In other words, the set of platforms supported by the writer
    has a common subset with the set of platforms that support
    the policy.

    Args:
      policy: The dictionary of the policy.

    Returns:
      True if the writer chooses to include 'policy' in its output.
    
Checks if the given policy is supported by the writer.
In other words, the set of platforms supported by the writer
has a common subset with the set of platforms that support
the policy.
Checks if the given policy is supported by the writer . In other words the set of platforms supported by the writer has a common subset with the set of platforms that support the policy .
def IsPolicySupported(self, policy):
    if ('deprecated' in policy and policy['deprecated'] is True and
        not self.IsDeprecatedPolicySupported(policy)):
      return False
    if ('future' in policy and policy['future'] is True and
        not self.IsFuturePolicySupported(policy)):
      return False
    if (self.IsCloudOnlyPolicy(policy)
        and not self.IsCloudOnlyPolicySupported(policy)):
      return False
    if (self.IsInternalOnlyPolicy(policy)
        and not self.IsInternalOnlyPolicySupported(policy)):
      return False
    for supported_on in policy['supported_on']:
      if not self.IsVersionSupported(policy, supported_on):
        continue
      if '*' in self.platforms or supported_on['platform'] in self.platforms:
        return True
    if self.IsFuturePolicySupported(policy):
      if '*' in self.platforms and policy['future_on']:
        return True
      for future in policy['future_on']:
        if future['platform'] in self.platforms:
          return True
    return False
def IsPolicySupported ( self , policy ) : if ( 'deprecated' in policy and policy [ 'deprecated' ] is True and not self . IsDeprecatedPolicySupported ( policy ) ) : return False if ( 'future' in policy and policy [ 'future' ] is True and not self . IsFuturePolicySupported ( policy ) ) : return False if ( self . IsCloudOnlyPolicy ( policy ) and not self . IsCloudOnlyPolicySupported ( policy ) ) : return False if ( self . IsInternalOnlyPolicy ( policy ) and not self . IsInternalOnlyPolicySupported ( policy ) ) : return False for supported_on in policy [ 'supported_on' ] : if not self . IsVersionSupported ( policy , supported_on ) : continue if '*' in self . platforms or supported_on [ 'platform' ] in self . platforms : return True if self . IsFuturePolicySupported ( policy ) : if '*' in self . platforms and policy [ 'future_on' ] : return True for future in policy [ 'future_on' ] : if future [ 'platform' ] in self . platforms : return True return False
Checks if the given policy is supported by the writer.
Checks if the given policy is supported by the writer .
'''Checks if the given policy is supported by the writer.
    In other words, the set of platforms supported by the writer
    has a common subset with the set of platforms that support
    the policy.

    Args:
      policy: The dictionary of the policy.

    Returns:
      True if the writer chooses to include 'policy' in its output.
    '''
True if the writer chooses to include 'policy' in its output.
True if the writer chooses to include ' policy ' in its output .
self
policy
The dictionary of the policy.
The dictionary of the policy .