<commit_before>import click
from pprint import pprint
from prettytable import PrettyTable
from bitshares.amount import Amount
from bitshares.account import Account
from bitshares.price import Price, Order
from bitshares.vesting import Vesting
from .decorators import (
    onlineChain,
    unlockWallet,
    online,
    unlock
)
from .main import main


@main.command()
@click.argument("account")
@click.pass_context
@online
def vesting(ctx, account):
    """ List accounts vesting balances
    """
    account = Account(account, full=True)
    t = PrettyTable(["vesting_id", "claimable"])
    t.align = 'r'
    for vest in account["vesting_balances"]:
        vesting = Vesting(vest)
        t.add_row([
            vesting["id"],
            str(vesting.claimable)
        ])
    click.echo(str(t))


@main.command()
@click.option("--account", default=None)
@click.argument("vestingid")
@click.argument("amount", default=0)
@click.pass_context
@online
@unlock
def claim(ctx, vestingid, account, amount):
    """ Claim funds from the vesting balance
    """
    vesting = Vesting(vestingid)
    if amount:
        amount = Amount(float(amount), "BTS")
    else:
        amount = vesting.claimable
    pprint(ctx.bitshares.vesting_balance_withdraw(
        vesting["id"],
        amount=amount,
        account=vesting["owner"]
    ))


@main.command()
@click.option("--account", default=None)
@click.argument(
    "amount",
    type=float
)
@click.argument(
    "symbol",
    type=str
)
@click.pass_context
@online
@unlock
def reserve(ctx, amount, symbol, account):
    pprint(ctx.bitshares.reserve(
        Amount(amount, symbol, bitshares_instance=ctx.bitshares)))<commit_msg>AAArrgg<commit_after>import click
from pprint import pprint
from prettytable import PrettyTable
from bitshares.amount import Amount
from bitshares.account import Account
from bitshares.price import Price, Order
from bitshares.vesting import Vesting
from .decorators import (
    onlineChain,
    unlockWallet,
    online,
    unlock
)
from .main import main


@main.command()
@click.argument("account")
@click.pass_context
@online
def vesting(ctx, account):
    """ List accounts vesting balances
    """
    account = Account(account, full=True)
    t = PrettyTable(["vesting_id", "claimable"])
    t.align = 'r'
    for vest in account["vesting_balances"]:
        vesting = Vesting(vest)
        t.add_row([
            vesting["id"],
            str(vesting.claimable)
        ])
    click.echo(str(t))


@main.command()
@click.option("--account", default=None)
@click.argument("vestingid")
@click.argument("amount", default=0)
@click.pass_context
@online
@unlock
def claim(ctx, vestingid, account, amount):
    """ Claim funds from the vesting balance
    """
    vesting = Vesting(vestingid)
    if amount:
        amount = Amount(float(amount), "BTS")
    else:
        amount = vesting.claimable
    pprint(ctx.bitshares.vesting_balance_withdraw(
        vesting["id"],
        amount=amount,
        account=vesting["owner"]
    ))


@main.command()
@click.option("--account", default=None)
@click.argument(
    "amount",
    type=float
)
@click.argument(
    "symbol",
    type=str
)
@click.pass_context
@online
@unlock
def reserve(ctx, amount, symbol, account):
    pprint(ctx.bitshares.reserve(
        Amount(amount, symbol, bitshares_instance=ctx.bitshares),
        account=account))
{'fraction_non_alphanumeric': 0.12614746816701214, 'fraction_numerical': 0.0005922416345869114, 'mean_word_length': 3.5648648648648646, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2178246', 'n_tokens_mistral': 1083, 'n_tokens_neox': 1070, 'n_words': 244}