human
I wrote the below code

    decoding_map_code = python_mapdef_code('decoding_map', map, comments=comments)
    decoding_table_code = python_tabledef_code('decoding_table', map, comments=comments)
    encoding_map_code = python_mapdef_code('encoding_map', codecs.make_encoding_map(map), comments=comments, precisions=(4, 2))
    if decoding_table_code:
        suffix = 'table'
    else:
        suffix = 'map'
    l = [('"""    Python    Character    Mapping    Codec    %s    generated    from    \'%s\'    with    gencodec.py.\n\n"""#"\n\nimport    codecs\n\n###    Codec    APIs\n\nclass    Codec(codecs.Codec):\n\n                def    encode(self,    input,    errors=\'strict\'):\n                                return    codecs.charmap_encode(input,    errors,    encoding_%s)\n\n                def    decode(self,    input,    errors=\'strict\'):\n                                return    codecs.charmap_decode(input,    errors,    decoding_%s)\n' % (encodingname, name, suffix, suffix))]
    l.append(('class    IncrementalEncoder(codecs.IncrementalEncoder):\n                def    encode(self,    input,    final=False):\n                                return    codecs.charmap_encode(input,    self.errors,    encoding_%s)[0]\n\nclass    IncrementalDecoder(codecs.IncrementalDecoder):\n                def    decode(self,    input,    final=False):\n                                return    codecs.charmap_decode(input,    self.errors,    decoding_%s)[0]' % (suffix, suffix)))
    l.append(('\nclass    StreamWriter(Codec,    codecs.StreamWriter):\n                pass\n\nclass    StreamReader(Codec,    codecs.StreamReader):\n                pass\n\n###    encodings    module    API\n\ndef    getregentry():\n                return    codecs.CodecInfo(\n                                name=%r,\n                                encode=Codec().encode,\n                                decode=Codec().decode,\n                                incrementalencoder=IncrementalEncoder,\n                               ...

What's a good function header?

Give me a Python code to fix = 'table'?
assistant
#Here is Python code to fix = 'table'
.

def codegen(name, map, encodingname, comments=1):