def _convert_codecs(template, byte_order):
 codecs = {}
 postfix = (((byte_order == '<') and '_le') or '_be')
 for (k, v) in template.items():
  codec = v['codec']
  try:
   ' '.encode(codec)
  except LookupError:
   codecs[k] = None
   continue
  if (v['width'] > 1):
   codec += postfix
  codecs[k] = codec
 return codecs.copy()

def _convert_codecs ( template , byte_order ) : codecs = { } postfix = ( ( ( byte_order == '<' ) and '_le' ) or '_be' ) for ( k , v ) in template . items ( ) : codec = v [ 'codec' ] try : . encode ( codec ) except LookupError : codecs [ k ] = None continue if ( v [ 'width' ] > 1 ) : codec += postfix codecs [ k ] = codec return codecs . copy ( )
convert codec template mapping to byte order set codecs not on this system to none parameters template : mapping key .