Path.stem

Path.stem(...)

Description

Documentation for Path.stem.

Python Python Pathlib Official Docs

Real-World Examples

Practical code examples showing how Path.stem is used in real projects.

for filepath in output_dir.glob("*.lua"):
            if filepath.name.endswith(".meta"):
                continue
            # Filename format: owner__name.lua
            stem = filepath.stem
            if "__" in stem:
                owner, name = stem.split("__", 1)
                cached.add(f"{owner}/{name}")
        return cached

    def fetch_configs(
        self,
        query: str = "filename:init.lua path:nvim",
        max_repos: int = 500,
        progress_callback=None,
    ) -> Iterator[ConfigFile]:
        """
        Fetch Neovim configurations from GitHub.

        This is an alias for search_configs() for backwards compatibility.
        """
        yield from self.search_configs(query, max_repos, progress_callback)
response = self.client.chat.completions.create(
                model="gpt-4.1-mini", 
                messages=[
                    {
                        "role": "system",
                        "content": "You are an expert in programming and technology trends. You must provide exactly ...
                    },
                    {
                        "role": "user",
                        "content": f"Please provide exactly {n} of the most popular programming and software developm...
                    }
                ],
                tools=tools,
                tool_choice={"type": "function", "function": {"name": "get_popular_topics"}}
            )

            tool_calls = response.choices[0].message.tool_calls
            if tool_calls and tool_calls[0].function.name == "get_popular_topics":
                result = json.loads(tool_calls[0].function.arguments)
                topics = result.get("topics", [])

                valid_topics = [topic.strip() for topic in topics if topic and topic.strip()]
                print(f"Valid topics: {valid_topics}")
                if len(valid_topics) >= n: