MCPcopy Create free account
hub / github.com/ActiveState/code / blend

Method blend

recipes/Python/111969_Blender/recipe-111969.py:20–28  ·  view source on GitHub ↗

blends the values into the given pattern

(self, values = None, pattern = None)

Source from the content-addressed store, hash-verified

18 self.EndToken = endToken
19
20 def blend(self, values = None, pattern = None):
21 """blends the values into the given pattern"""
22 values = self.getValues(values)
23 pattern = self.getPattern(pattern, values)
24 for name in values.keys():
25 id = self.getTokenName(name)
26 value = values[name]
27 pattern = pattern.replace(id, str(value))
28 return pattern
29
30 def getValues(self, values):
31 """ returns the dictionary of values.

Callers 3

__str__Method · 0.95
normalizeFunction · 0.80
marksimilarFunction · 0.80

Calls 6

getValuesMethod · 0.95
getPatternMethod · 0.95
getTokenNameMethod · 0.95
strFunction · 0.85
keysMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected