code: def get_by_flat_key(i):
      
      # Check vars
      v=None
  
      a=i['dict']
      k=i['key']
  
      # Remove leading # if exists
      if len(k)>0 and k[0:1]=='#': k=k[1:]
  
      k1=''
      kt='' # type '#' or '@'
      x=0
      finish=False
  
      while not finish:
          y=k[x]
          x+=1
  
          if y=='#' or y=='@':
             if kt=='#':
                if k1 not in a: break
                a=a[k1]
             elif kt=='@':
                if len(a)<=type_long(k1): break
                a=a[type_long(k1)]
             k1=''
             kt=y
          else:
             k1+=y
  
          if x>=len(k): break
  
      if k1!='' and kt!='':
         if kt=='#':   
            if k1 in a: v=a[k1]
         else:         
            if len(a)>type_long(k1): v=a[type_long(k1)]
  
      return {'return':0, 'value': v}
docs: Input:  {
                dict  - dictionary
                key   - flat key
              }
  
      Output: {
                return  - return code =  0, if successful
                                      >  0, if error
                (error) - error text if return > 0
                value   - value or None, if doesn't exist
              }