Create a pattern (e.g., a star pyramid or palindrome check) to demonstrate basic algorithmic control flow.
Implement the star-pyramid version using the function below. Return a single string containing rows centered lines, with no trailing newline.
Function: star_pyramid(rows)
Input: A non-negative integer rows.
Output: A string where line i contains leading spaces followed by 2 * i + 1 stars, for i from 0 to rows - 1.
def star_pyramid(rows):