Return parent resource

        :rtype: Resource
        :raises ResourceNotFound: parent resource doesn't exists
        :raises ResourceMissing: parent resource is not defined
974486
def parent(self):
        
        try:
            return Resource(self['parent_type'], uuid=self['parent_uuid'], check=True)
        except KeyError:
            raise ResourceMissing('%s has no parent resource' % self)
945828
def parent(self):
        
        family = self.repository.get_parent_package_family(self.resource)
        return PackageFamily(family) if family else None
71499
def get_parent(self):
        
        if not self.parent:
            parent = self._safe_get_element('ParentASIN')
            if parent:
                self.parent = self.api.lookup(ItemId=parent)
        return self.parent
1361594
def _save(self):
        """"""
        yield self.validate()

        try:
            self._parent = yield self.parent_resource.get(self.parent_id)
        except couch.NotFound:
            msg = '{}_id {} not found'.format(
                self.parent_resource.resource_type,
                self.parent_id)
            raise exceptions.ValidationError(msg)

        yield self._parent.save_subresource(self)
678111
def parent(self):
        
        parent_impl_node = self.adapter.get_node_parent(self.impl_node)
        return self.adapter.wrap_node(
            parent_impl_node, self.adapter.impl_document, self.adapter)
1320522
def add_resource(self, resource_id, attributes, parents=[],
            issuer='default'):
        
        # MAINT: consider test to avoid adding duplicate resource id
        assert isinstance(attributes, (dict)), "attributes expected to be dict"

        attrs = []
        for key in attributes.keys():
            attrs.append({
                'issuer': issuer,
                'name': key,
                'value': attributes[key]
                })

        body = {
            "resourceIdentifier": resource_id,
            "parents": parents,
            "attributes": attrs,
        }

        return self._put_resource(resource_id, body)
1118180
def children_resources(parent_id)
      http_get(url('/resources/%s/children', parent_id))['results'].map { |r| Resource.new(r) }
    end
1293447
def create(cls, user, **kwargs):
        """"""
        parent_id = kwargs.get(cls.parent_resource.resource_type + '_id')
        try:
            parent = yield cls.parent_resource.get(parent_id)
        except couch.NotFound:
            msg = 'Parent {} with id {} not found'.format(
                cls.parent_resource.resource_type,
                parent_id)
            raise exceptions.ValidationError(msg)

        if not parent.editable:
            err = 'Cannot create child of {} resource'.format(parent.state.name)
            raise exceptions.Unauthorized(err)

        resource = yield super(SubResource, cls).create(user, **kwargs)
        resource._parent = parent

        raise Return(resource)
1034103
def get_parent(self):
        """"""
        if self.is_entity():
            return self.get_index_url(**self.default_kwargs_for_urls())
        elif self._parent is not None:
            resource = self._parent.rsplit('_', 1)[0]
            parts = self.default_kwargs_for_urls()

            if '{}_id'.format(resource) in parts:
                id = parts.pop('{}_id'.format(resource))
                parts['id'] = id
            return self.get_full_url(
                self.app.reverse(
                    self._parent, **parts
                )
            )
1220989
def parent(self):
        
        if self._parent is not None:
            return self._parent

        try:
            package = self.repository.get_parent_package(self.resource)
            self._parent = Package(package, context=self.context)
        except AttributeError as e:
            reraise(e, ValueError)

        return self._parent
1364283
def create_resource(self, parent_id=""):
        
        resource_name = self.trigger_settings.get('resource', '')
        resource_name = resource_name.replace('/', '')
        if not self.resource_id:
            created_resource = self.client.create_resource(
                restApiId=self.api_id, parentId=parent_id, pathPart=resource_name)
            self.resource_id = created_resource['id']
            self.log.info("Successfully created resource")
        else:
            self.log.info("Resource already exists. To update resource please delete existing resource: %s",
                          resource_name)
453680
def belongs_to(parent_resource)
        parent_resource = parent_resource.to_sym
        parent_resources << parent_resource unless parent_resource.in?(parent_resources)
      end
156578
def resource(self):
        
        if self._resource:
            return self._resource
        elif self.binding:
            return self.binding.resource
88054
def get_parent_objects(self, context):
        
        parent_object = api.get_parent(context)
        portal_type = api.get_portal_type(context)
        return parent_object.objectValues(portal_type)
400614
def get_parent
      raise UnknownParentError, "Genesis block has no parent" if number == 0
      Block.find env, prevhash
    rescue KeyError
      raise UnknownParentError, Utils.encode_hex(prevhash)
    end
1181666
def custom_resource(self, name, restype, factclass, props):
	
		
		
		return CustomResource(self.__endpoint, name, restype, factclass, props)
72527
def parent(self):
        
        p = self._lib.dirname(self.path)
        p = self.__class__(p)
        return p