'Upload Metadata to a Plotly grid.
Metadata is any JSON-encodable object. For example,
a dictionary, string, or list.
Only one of `grid` or `grid_url` needs to be specified.
`grid` is a plotly.grid_objs.Grid object that has already
been uploaded to Plotly.
`grid_url` is the URL of the Plotly grid to attach Metadata to.
Usage example 1: Upload a grid to Plotly, then attach Metadata to it
from plotly.grid_objs import Grid, Column
import plotly.plotly as py
column_1 = Column([1, 2, 3], \'time\')
column_2 = Column([4, 2, 5], \'voltage\')
grid = Grid([column_1, column_2])
py.grid_ops.upload(grid, \'time vs voltage\')
# now attach Metadata to the grid
meta = {\'experment\': \'GaAs\'}
py.meta_ops.upload(meta, grid=grid)
Usage example 2: Upload Metadata to an existing Plotly grid
import plotly.plotly as py
grid_url = \'https://plot.ly/~chris/3143\'
meta = {\'experment\': \'GaAs\'}
py.meta_ops.upload(meta, grid_url=grid_Url)'

@classmethod
def upload(cls, meta, grid=None, grid_url=None):

    fid = parse_grid_id_args(grid, grid_url)
    return v2.grids.update(fid, {'metadata': meta}).json()
