parameters: (attributes)
return_statement: return attrs
docstring: Convert the keyword arguments into function_def attributes.
  
    Currently only support primitive types: bool, int, float and string.
  
    Args:
      attributes: the dictionary of attributes.
    Returns:
      A dict of attributes where the key is the name of attribute and the value
        is the AttrValue proto.
    Raises:
      ValueError: If the kwargs contains unwhitelisted name or unsupported value
        types.
docstring_summary: Convert the keyword arguments into function_def attributes.
docstring_tokens: Convert the keyword arguments into function_def attributes .
function: def _parse_func_attrs(attributes):
    """Convert the keyword arguments into function_def attributes.
  
    Currently only support primitive types: bool, int, float and string.
  
    Args:
      attributes: the dictionary of attributes.
    Returns:
      A dict of attributes where the key is the name of attribute and the value
        is the AttrValue proto.
    Raises:
      ValueError: If the kwargs contains unwhitelisted name or unsupported value
        types.
    """
    attrs = {}
    for key, value in attributes.items():
      if isinstance(value, attr_value_pb2.AttrValue):
        attrs[key] = value
      # bool type check has to happen before int since bool is a subclass of int.
      elif isinstance(value, bool):
        attrs[key] = attr_value_pb2.AttrValue(b=value)
      elif isinstance(value, int):
        attrs[key] = attr_value_pb2.AttrValue(i=value)
      elif isinstance(value, float):
        attrs[key] = attr_value_pb2.AttrValue(f=value)
      elif isinstance(value, (str, bytes, six.text_type)):
        attrs[key] = attr_value_pb2.AttrValue(s=compat.as_bytes(value))
      else:
        raise ValueError("Unsupported attribute type for %s with type %s" %
                         (key, type(value)))
    return attrs
function_tokens: def _parse_func_attrs ( attributes ) : attrs = { } for key , value in attributes . items ( ) : if isinstance ( value , attr_value_pb2 . AttrValue ) : attrs [ key ] = value # bool type check has to happen before int since bool is a subclass of int. elif isinstance ( value , bool ) : attrs [ key ] = attr_value_pb2 . AttrValue ( b = value ) elif isinstance ( value , int ) : attrs [ key ] = attr_value_pb2 . AttrValue ( i = value ) elif isinstance ( value , float ) : attrs [ key ] = attr_value_pb2 . AttrValue ( f = value ) elif isinstance ( value , ( str , bytes , six . text_type ) ) : attrs [ key ] = attr_value_pb2 . AttrValue ( s = compat . as_bytes ( value ) ) else : raise ValueError ( "Unsupported attribute type for %s with type %s" % ( key , type ( value ) ) ) return attrs