Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def maybe_create_user(username: str):
if username in existing_usernames:
typer.echo("The user already exists")
raise typer.Exit()
else:
typer.echo(f"User created: {username}")
def info(protocol: str):
"""Print protocol detailed information"""
p = get_protocol(protocol)
if isinstance(p, SpeakerDiarizationProtocol):
subsets = ["train", "development", "test"]
skip_annotation = False
skip_annotated = False
elif isinstance(p, CollectionProtocol):
subsets = ["files"]
skip_annotation = True
skip_annotated = True
else:
typer.echo("Only collections and speaker diarization protocols are supported.")
typer.Exit(code=1)
for subset in subsets:
num_files = 0
speakers = set()
duration = 0.0
speech = 0.0
def iterate():
try:
for file in getattr(p, subset)():
yield file
except (AttributeError, NotImplementedError):
return
for file in iterate():
def main(username: str):
if username == "root":
typer.echo("The root user is reserved")
raise typer.Exit(code=1)
typer.echo(f"New user created: {username}")
def version_callback(value: bool):
if value:
typer.echo(f"Awesome CLI Version: {__version__}")
raise typer.Exit()
def version_callback(value: bool):
if value:
typer.echo(f"Awesome CLI Version: {__version__}")
raise typer.Exit()