Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def right_spinner(sleep=2):
with yaspin(text="Right spinner", side="right", color="cyan") as sp:
time.sleep(sleep)
# Switch to left spinner
sp.side = "left"
sp.text = "Left spinner"
time.sleep(sleep)
def colored_finalizer():
with yaspin(text="Processing...", color="yellow") as sp:
time.sleep(2)
sp.ok("☀️")
def custom_finalizers():
with yaspin(text="Processing...") as sp:
time.sleep(2)
# Make finalizer green
sp.green.ok("✔")
with yaspin(text="Processing...") as sp:
time.sleep(2)
# Make finalizer red
sp.red.fail("✘")
def context_manager_default():
with yaspin(text="Braille"):
time.sleep(3)
def ball():
# Set with arguments
with yaspin(
color="white",
on_color="on_magenta",
attrs=["dark", "blink", "concealed"],
).bouncingBall as sp:
sp.text = "Dark blink concealed white ball on magenta color"
time.sleep(5)
def default_finalizers():
with yaspin(text="Downloading...") as sp:
time.sleep(2)
sp.ok()
with yaspin(text="Downloading...") as sp:
time.sleep(2)
sp.fail()
def ignore_signal():
with yaspin(
sigmap={signal.SIGINT: signal.SIG_IGN}, text="You can't interrupt me!"
):
time.sleep(5)
@yaspin(text="Plotting word embeddings...")
def plot_embeddings(model, df, filename):
tsne_plot(model, df, filename)