intro_zipline/winners.py
def before_trading_start(context, data):
    """
    Called every day before market open.
    """
    factors = algo.pipeline_output('pipeline')

    # Get the top and bottom 3 stocks by 1-year return
    returns = factors["1y_returns"].sort_values(ascending=False)
    context.winners = returns.index[:3]

    Called every day before market open.
    
Called every day before market open.
Called every day before market open .
def before_trading_start(context, data):
    factors = algo.pipeline_output('pipeline')
    returns = factors["1y_returns"].sort_values(ascending=False)
    context.winners = returns.index[:3]
def before_trading_start ( context , data ) : factors = algo . pipeline_output ( 'pipeline' ) returns = factors [ "1y_returns" ] . sort_values ( ascending = False ) context . winners = returns . index [ : 3 ]
Called every day before market open.
Called every day before market open .
"""
    Called every day before market open.
    """ # Get the top and bottom 3 stocks by 1-year return
context
data