parameters: (sd)
return_statement: return _optional_sd(sd_val)
docstring: 内部函数
docstring_summary: 内部函数
docstring_tokens: 内部函数
function: def _value_serde(sd):
      """ 内部函数 """
      if isinstance(sd, serde.Optional):
          sd = sd.origin_serde()
      sd_val = sd.get_args()[1]
      if isinstance(sd_val, serde.Optional):
          sd_val = sd_val.origin_serde()
      def _optional_sd(sd_val):
          """ 内部函数 """
          new_serde = []
          for fd in sd_val.get_args():
              new_fd = {}
              if isinstance(fd, serde.Optional):
                  fd = fd.origin_serde()
              for field, tp in fd.get_fields_to_types().items():
                  new_fd[field] = serde.Optional(serde.of(tp))
              new_serde.append(of(new_fd))
          return serde.of(tuple(new_serde))
      return _optional_sd(sd_val)
function_tokens: def _value_serde ( sd ) : if isinstance ( sd , serde . Optional ) : sd = sd . origin_serde ( ) sd_val = sd . get_args ( ) [ 1 ] if isinstance ( sd_val , serde . Optional ) : sd_val = sd_val . origin_serde ( ) def _optional_sd ( sd_val ) : """ 内部函数 """ new_serde = [ ] for fd in sd_val . get_args ( ) : new_fd = { } if isinstance ( fd , serde . Optional ) : fd = fd . origin_serde ( ) for field , tp in fd . get_fields_to_types ( ) . items ( ) : new_fd [ field ] = serde . Optional ( serde . of ( tp ) ) new_serde . append ( of ( new_fd ) ) return serde . of ( tuple ( new_serde ) ) return _optional_sd ( sd_val )