str.lower

str.lower(...)

Description

Documentation for str.lower.

Python Python String Methods Official Docs

Real-World Examples

Practical code examples showing how str.lower is used in real projects.

query_type = self._extract_tag(extracted_responses[self.BASIC_QUERY_INDEX], "query_type")
            if not query_type:
                print(
                    f"Debug - Failed to extract query_type. Response was: {extracted_responses[self.BASIC_QUERY_INDEX...
                raise Exception("无法提取query_type标签内容")
            query_type = query_type.lower()

            main_topic = self._extract_tag(extracted_responses[self.BASIC_QUERY_INDEX], "main_topic")
            if not main_topic:
                print(f"Debug - Failed to extract main_topic. Using query as fallback.")
                main_topic = query

            query_type = self._normalize_query_type(query_type, query)

            # 提取子主题
            sub_topics = []
            sub_topics_text = self._extract_tag(extracted_responses[self.BASIC_QUERY_INDEX], "sub_topics")
            if sub_topics_text:
                sub_topics = [topic.strip() for topic in sub_topics_text.split(",")]

            # 提取语言
            language = self._extract_tag(extracted_responses[self.BASIC_QUERY_INDEX], "language")

            # 提取最低星标数
            min_stars = 0
if event.get("type") != "PushEvent":
                    continue
                for commit in event.get("payload", {}).get("commits", []):
                    author = commit.get("author", {})
                    email = author.get("email", "")
                    if email and "@" in email and "noreply" not in email.lower():
                        emails[email] = "commit"

        return {
            "username": username,
            "emails": [{"email": e, "source": s} for e, s in emails.items()],
            "total": len(emails),
        }

def register_tools(
    mcp: FastMCP,
    credentials: CredentialStoreAdapter | None = None,
) -> None:
    """Register GitHub tools with the MCP server."""

    def _get_token() -> str | None:
        """Get GitHub token from credential manager or environment."""
        if credentials is not None:
            token = credentials.get("github")