Pattern Create python Implementation