Create `is_pip()` function (#3391)
Returns `True` if file is part of pip package. Useful for contextual behavior modification.
```python
def is_pip():
# Is file in a pip package?
return 'site-packages' in Path(__file__).absolute().parts
```
正在显示
请
注册
或者
登录
后发表评论