code: def lookupPattern(self, name, layer):
          
          if (name, layer) in self.patterns:
              return self.patterns[(name, layer)]
          else:
              return self.patterns[name]
docs: See if there is a name/layer pattern combo, else return the name pattern.