title: Maya Python Script : Return True or False if an attribute is keyframed at that specific frame
body: <p>I'm trying to complete my script and I had some issues.
  Here is my script:</p>
  
  <pre><code>from maya import cmds
  def correct_value(selection=None, prefix='', suffix=''):
  
      newSel = []
      if selection is None: 
          selection = cmds.ls ('*_control') 
  
      if selection and not isinstance(selection, list):
          newSel = [selection]
  
      for each_obj in selection:
          if each_obj.startswith(prefix) and each_obj.endswith(suffix) :
          newSel.append(each_obj)
          return newSel
  
  def save_pose(selection):
  
       pose_dictionary = {}
  
       for each_obj in selection:
            pose_dictionary[each_obj] = {}
       for each_attribute in cmds.listAttr (each_obj, k=True):
            pose_dictionary[each_obj][each_attribute] = cmds.getAttr (each_obj + "." + each_attribute)
  
    return pose_dictionary
  
  
  controller = correct_value(None,'left' ,'control' )
  
  
  save_pose(controller)
  
  
  def save_animation(selection, **keywords ):
       if "framesWithKeys" not in keywords:
           keywords["framesWithKeys"] = [0,1,2,3]
  
       animation_dictionary = {}
       for each_frame in keywords["framesWithKeys"]:
            cmds.currentTime(each_frame)
            animation_dictionary[each_frame] = save_pose(selection)
  
       return animation_dictionary
  
  frames = save_animation (save_pose(controller) ) 
  print frames
  </code></pre>
  
  <p>Now when I'm querying an attribute, I want to store a <code>True</code> or <code>False</code> value in the dictionary that says if that attribute has a keyframe at that frame you are checking, but only if it has a key on that frame.</p>
  
  <p>For example,  let us say I have keys on my control's tx attribute at frames 1 and 5 and I want to have a dictionary key that I can check later to see if there were keys at those frames: when there is a key at that frame, return <code>true</code>; when there isn't, return <code>false</code>.
  If <code>True</code>, I also want to save the tangent types of the keys.</p>