title: Mapping Commands in Python Dictionary Based Around Default Parameters
body: <p>I'm looking to be able to use a specific system call depending on which key is accessed in a dictionary. 
  Function might look like: </p>
  
  <pre><code>def query_ec2(self, region=None, instanceId=None):
  
      if region == None and instanceId == None:
          return json.loads(subprocess.check_output("aws ec2 describe-instances", shell=True))
  
      elif region != None and instanceId == None:
          return json.loads(subprocess.check_output(("aws ec2 describe-instances --region {}").format(region), shell=True))
  
      elif instanceId != None and region == None:
          return json.loads(subprocess.check_output(("aws ec2 describe-instances --instance-id {}").format(instanceId), shell=True))
  
      else:
          return json.loads(subprocess.check_output(("aws ec2 describe-instances --region {}--instance-id {}").format(region, instanceId), shell=True))
  </code></pre>
  
  <p>I'm wondering if there is any way to get rid of conditionals here and use a standard dictionary to map the specific system calls to the supplied parameters.</p>