<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def publish_network(user=None, reset=False):
 """ Generate graph network for a user and plot it using Plotly """


    username = generate_network(user, reset)
    network_file = username_to_file(username)

    plot_data = prepare_plot_data(network_file)
    data = Data(plot_data)

    # hide axis line, grid, ticklabels and title
    axis = dict(showline=False,
                zeroline=False,
                showgrid=False,
                showticklabels=False,
                title=''
                )

    width = 800
    height = 800

    layout = Layout(title='GitHub Network for "{0}"'.format(username),
                    font=Font(size=12),
                    showlegend=False,
                    autosize=False,
                    width=width,
                    height=height,
                    xaxis=XAxis(axis),
                    yaxis=YAxis(axis),
                    margin=Margin(
                        l=40,
                        r=40,
                        b=85,
                        t=100,
                    ),
                    hovermode='closest',
                    annotations=Annotations([
                        Annotation(
                            showarrow=False,
                            text='This igraph.Graph has the graphopt layout',
                            xref='paper',
                            yref='paper',
                            x=0,
                            y=-0.1,
                            xanchor='left',
                            yanchor='bottom',
                            font=Font(
                                size=14
                            )
                        )
                    ]),
                    )

    fig = Figure(data=data, layout=layout)

    # use credentials of the bot "octogrid", if user isn't authenticated
    login_as_bot()

    try:
        plot_id = ''.join(choice(string.lowercase) for i in range(5))
        plot_url = plotly.plot(
            fig, filename='Octogrid: GitHub communities for {0} [v{1}]'.format(username, plot_id))

        print 'Published the network graph at {0}'.format(plot_url)
    except Exception, e:
        raise e