def _gen_param_code(name, doc, defaultValueStr):
    """
    Generates Python code for a shared param class.

    :param name: param name
    :param doc: param doc
    :param defaultValueStr: string representation of the default value
    :return: code string
    """
    template = """
    def set$Name(self, value):
        ""\"
        Sets the value of :py:attr:`$name`.
        ""\"
        return self._set($name=value)

    def get$Name(self):
        ""\"
        Gets the value of $name or its default value.
        ""\"
        return self.getOrDefault(self.$name)"""
    Name = name[0].upper() + name[1:]
    return template.replace('$name', name).replace('$Name', Name).replace(
        '$doc', doc).replace('$defaultValueStr', str(defaultValueStr))
