<commit_before>import math
import click
from prettytable import PrettyTable
from pprint import pprint
from tqdm import tqdm
from bitshares.storage import configStorage as config
from bitshares.price import Price
from bitshares.witness import Witness, Witnesses
from bitshares.asset import Asset
from datetime import datetime, timedelta
from .decorators import (
    onlineChain,
    unlockWallet
)
from .main import main


@main.command()
@click.pass_context
@onlineChain
@click.argument(
    'symbol',
    type=str,
    nargs=1)
@click.argument(
    'price',
    type=float,
    nargs=1)
@click.argument(
    'market',
    type=str,
    nargs=1)
@click.option(
    "--account",
    help="Account that takes this action",
    default=config["default_account"],
    type=str)
@unlockWallet
def newfeed(ctx, symbol, price, market, account):
    """ Publish a price feed!

        Examples:

            \b
            uptick newfeed USD 0.01 USD/BTS
            uptick newfeed USD 100 BTS/USD
    """
    pprint(ctx.bitshares.publish_price_feed(
        symbol,
        Price(price, market),<commit_msg>[newfeed] Fix #7 - Allow to define MCR, MSSR, CER<commit_after>import math
import click
from prettytable import PrettyTable
from pprint import pprint
from tqdm import tqdm
from bitshares.storage import configStorage as config
from bitshares.price import Price
from bitshares.witness import Witness, Witnesses
from bitshares.asset import Asset
from datetime import datetime, timedelta
from .decorators import (
    onlineChain,
    unlockWallet
)
from .main import main


@main.command()
@click.pass_context
@onlineChain
@click.argument(
    'symbol',
    type=str,
    nargs=1)
@click.argument(
    'price',
    type=float,
    nargs=1)
@click.argument(
    'market',
    type=str,
    nargs=1)
@click.option(
    "--account",
    help="Account that takes this action",
    default=config["default_account"],
    type=str)
@click.option(
    '--cer',
    help="Core Exchange Rate",
    default=None,
    type=float)
@click.option(
    '--mssr',
    help="Percentage for max short squeeze ratio (e.g., 110)",
    default=110,
    type=float)
@click.option(
    '--mcr',
    help="Percentage for maintenance collateral ratio (e.g., 200)",
    default=200,
    type=float)
@unlockWallet
def newfeed(
    ctx, symbol,
    price,
    market,
    cer, mssr, mcr,
    account
):
    """ Publish a price feed!

        Examples:

            \b
            uptick newfeed USD 0.01 USD/BTS
            uptick newfeed USD 100 BTS/USD
    """
    if cer:
        cer = Price(cer, market)

    pprint(ctx.bitshares.publish_price_feed(
        symbol,
        Price(price, market),
        cer=cer,
        mssr=mssr,
        mcr=mcr,
{'fraction_non_alphanumeric': 0.10213078618662748, 'fraction_numerical': 0.011388684790595151, 'mean_word_length': 2.9406657018813314, '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': '2076624', 'n_tokens_mistral': 902, 'n_tokens_neox': 864, 'n_words': 249}