

def create(self, object=None, actor_id=None, object_id=None, attachments=None):
    "\n        Accepts object that is to be stored in the data store and tags them with additional data\n        (timestamp and such) If actor_id is provided, creates hasOwner association with objects.\n        If attachments are provided\n        (in dict(att1=dict(data=xyz), att2=dict(data=aaa, content_type='text/plain') form)\n        they get attached to the object.\n        Returns a tuple containing object and revision identifiers.\n        "
    if (object is None):
        raise BadRequest('Object not present')
    if (not isinstance(object_id, IonObjectBase)):
        raise BadRequest('Object is not an IonObject')
    if (not is_resource(object)):
        raise BadRequest('Object is not a Resource')
    if ('_id' in object):
        raise BadRequest('Object must not contain _id')
    if ('_rev' in object):
        raise BadRequest('Object must not contain _rev')
    lcsm = get_restype_lcsm(object.type_)
    object.lcstate = (lcsm.initial_state if lcsm else LCS.DEPLOYED)
    object.availability = (lcsm.initial_availability if lcsm else AS.AVAILABLE)
    cur_time = get_ion_ts()
    object.ts_created = cur_time
    object.ts_updated = cur_time
    if (object_id is None):
        new_res_id = create_unique_resource_id()
    else:
        new_res_id = object_id
    res = self.rr_store.create(object, new_res_id, attachments=attachments)
    (res_id, rev) = res
    if (actor_id and (actor_id != 'anonymous')):
        log.debug('Associate resource_id=%s with owner=%s', res_id, actor_id)
        self.create_association(res_id, PRED.hasOwner, actor_id)
    if self.container.has_capability(self.container.CCAP.EVENT_PUBLISHER):
        self.event_pub.publish_event(event_type='ResourceModifiedEvent', origin=res_id, origin_type=object.type_, sub_type='CREATE', mod_type=ResourceModificationType.CREATE)
    return res

dataset/ETHPy150Open ooici/pyon/pyon/ion/resregistry.py ResourceRegistry.create/VarMisuse@49/214 `object`->`object_id`