#NEWLINE# def __init__( self , name , description = None , serialize = None , parse_value = None , parse_literal = None ) : #NEWLINE# #INDENT# assert name , 'Type must be named.' #NEWLINE# assert_valid_name ( name ) #NEWLINE# self . name = name #NEWLINE# self . description = description #NEWLINE# assert callable ( serialize ) , '{} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parse_value" and "parse_literal" functions are also provided.' . format ( self ) #NEWLINE# if ( ( parse_value is not None ) or ( parse_literal is not None ) ) : #NEWLINE# #INDENT# assert ( callable ( parse_value ) and callable ( parse_literal ) ) , '{} must provide both "parse_value" and "parse_literal" functions.' . format ( self ) #NEWLINE# #UNINDENT# self . _serialize = serialize #NEWLINE# self . _parse_value = parse_value #NEWLINE# self . _parse_literal = parse_literal