code: def runUncertainLocations(missingLoc=None, profile=False):
    
    if missingLoc is None:
      missingLoc = {}
  
    exp = L4L2Experiment(
      "uncertain_location",
      enableLateralSP = True,
      enableFeedForwardSP=True
    )
  
    pairs = createThreeObjects()
    objects = createObjectMachine(
      machineType="simple",
      numInputBits=20,
      sensorInputSize=1024,
      externalInputSize=1024
    )
    for object in pairs:
      objects.addObject(object)
  
    exp.learnObjects(objects.provideObjectsToLearn())
  
    # create pairs with missing locations
    objectA = objects[0]
    for key, val in missingLoc.iteritems():
      objectA[key] = (val, key)
  
    inferConfig = {
      "numSteps": 10,
      "pairs": {
        0: objectA
      }
    }
  
    exp.infer(objects.provideObjectToInfer(inferConfig), objectName=0)
    if profile:
      exp.printProfile()
  
    exp.plotInferenceStats(
      fields=["L2 Representation",
              "Overlap L2 with object",
              "L4 Representation",
              "L4 Predictive"],
    )
docs: Runs the same experiment as above, with missing locations at some timesteps
    during inference (if it was not successfully computed by the rest of the
    network for example).
  
    @param   missingLoc (dict)
             A dictionary mapping indices in the object to location index to
             replace with during inference (-1 means no location, a tuple means
             an union of locations).
  
    @param   profile (bool)
             If True, the network will be profiled after learning and inference