code: def get_os_ck(i):
      
  
      import os
      import platform
      import struct
  
      pbits=str(8 * struct.calcsize("P"))
  
      plat='linux'
      if platform.system().lower().startswith('win'): # pragma: no cover
         plat='win'
  
      obits=i.get('bits','')
      if obits=='':
         obits='32'
         if plat=='win':
            # Trying to get fast way to detect bits
            if os.environ.get('ProgramW6432','')!='' or os.environ.get('ProgramFiles(x86)','')!='': # pragma: no cover
               obits='64'
         else:
            # On Linux use first getconf LONG_BIT and if doesn't work use python bits
  
            obits=pbits
  
            r=gen_tmp_file({})
            if r['return']>0: return r
            fn=r['file_name']
  
            cmd='getconf LONG_BIT > '+fn
            rx=os.system(cmd)
            if rx==0:
               r=load_text_file({'text_file':fn, 
                                 'delete_after_read':'yes'})
               if r['return']==0:
                  s=r['string'].strip()
                  if len(s)>0 and len(s)<4:
                     obits=s
  
      return {'return':0, 'platform':plat, 'bits':obits, 'python_bits':pbits}
docs: Input:  {
                (bits)      - force OS bits
              }
  
      Output: {
                return      - return code =  0
                platform    - 'win' or 'linux'
                bits        - OS bits in string: 32 or 64
                python_bits - Python installation bits in string: 32 or 64
  
              }