poetry new <project-name>
poetry init
import pygit2 | |
# open existing repository | |
repo = pygit2.Repository(pygit2.discover_repository('test_repos')) | |
# check if repos is newly created | |
if repo.head_is_unborn: | |
tb = repo.TreeBuilder() | |
parent = [] | |
else: |
$ FILE=/some/path/to/file.txt | |
################################### | |
### Remove matching suffix pattern | |
################################### | |
$ echo ${FILE%.*} # remove ext | |
/some/path/to/file | |
$ FILE=/some/path/to/file.txt.jpg.gpg # note various file exts |
class NoneDict: | |
def __truedive__(self, key): | |
return self | |
def __or__(self, key): | |
return self | |
def __repr__(self): | |
return "NoneDict" |
from typing import cast | |
import libcst as cst | |
import libcst.matchers as m | |
from libcst.codemod import VisitorBasedCodemodCommand | |
from libcst.codemod.visitors import AddImportsVisitor, RemoveImportsVisitor | |
class DatetimeUtcnow(VisitorBasedCodemodCommand): |