def from_json(json, cutout=None):
if type(json) is str:<EOL><INDENT>json = jsonlib.loads(json)<EOL><DEDENT>out_ramons = []<EOL>for (rid, rdata) in six.iteritems(json):<EOL><INDENT>_md = rdata['<STR_LIT>']<EOL>r = AnnotationType.RAMON(rdata['<STR_LIT:type>'])(<EOL>id=rid,<EOL>author=_md['<STR_LIT>'],<EOL>status=_md['<STR_LIT:status>'],<EOL>confidence=_md['<STR_LIT>'],<EOL>kvpairs=copy.deepcopy(_md['<STR_LIT>'])<EOL>)<EOL>if rdata['<STR_LIT:type>'] == '<STR_LIT>':<EOL><INDENT>r.segmentclass = _md.get('<STR_LIT>')<EOL>r.neuron = _md.get('<STR_LIT>')<EOL>if '<STR_LIT>' in _md:<EOL><INDENT>r.synapses = _md['<STR_LIT>'][:]<EOL><DEDENT>if '<STR_LIT>' in _md:<EOL><INDENT>r.organelles = _md['<STR_LIT>'][:]<EOL><DEDENT><DEDENT>elif rdata['<STR_LIT:type>'] in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>if '<STR_LIT>' in _md:<EOL><INDENT>r.segments = _md['<STR_LIT>'][:]<EOL><DEDENT><DEDENT>elif rdata['<STR_LIT:type>'] == '<STR_LIT>':<EOL><INDENT>r.organelle_class = _md['<STR_LIT>'][:]<EOL><DEDENT>elif rdata['<STR_LIT:type>'] == '<STR_LIT>':<EOL><INDENT>r.synapse_type = _md.get('<STR_LIT>')<EOL>r.weight = _md.get('<STR_LIT>')<EOL><DEDENT>out_ramons.append(r)<EOL><DEDENT>return out_ramons<EOL>
Converts JSON to a python list of RAMON objects. if `cutout` is provided,
the `cutout` attribute of the RAMON object is populated. Otherwise, it's
left empty. `json` should be an ID-level dictionary, like so:

    {
        16: {
            type: "segment",
            metadata: {
                . . .
            }
        },
    }

NOTE: If more than one item is in the dictionary, then a Python list of
RAMON objects is returned instead of a single RAMON.

Arguments:
    json (str or dict): The JSON to import to RAMON objects
    cutout: Currently not supported.

Returns:
    [RAMON]