def dup_to_raw_dict(f, K=None, zero=False):
 if ((not f) and zero):
  return {0: K.zero}
 (n, result) = ((len(f) - 1), {})
 for k in range(0, (n + 1)):
  if f[(n - k)]:
   result[k] = f[(n - k)]
 return result

def dup_to_raw_dict ( f , K = None , zero = False ) : if ( ( not f ) and zero ) : return { 0 : K . zero } ( n , result ) = ( ( len ( f ) - 1 ) , { } ) for k in range ( 0 , ( n + 1 ) ) : if f [ ( n - k ) ] : result [ k ] = f [ ( n - k ) ] return result
convert a k[x] polynomial to a raw dict .