Returns a dictionary of attachment information
772444
def get_attachment_info(self, attachment):
        

        attachment_uid = api.get_uid(attachment)
        attachment_file = attachment.getAttachmentFile()
        attachment_type = attachment.getAttachmentType()
        attachment_icon = attachment_file.icon

        if callable(attachment_icon):
            attachment_icon = attachment_icon()

        return {
            'keywords': attachment.getAttachmentKeys(),
            'size': self.get_attachment_size(attachment),
            'name': attachment_file.filename,
            'Icon': attachment_icon,
            'type': api.get_uid(attachment_type) if attachment_type else '',
            'absolute_url': attachment.absolute_url(),
            'UID': attachment_uid,
            'report_option': attachment.getReportOption(),
            'analysis': '',
        }
532100
def list_properties(cls):
    
    rtn_dict = {}
    for attr in dir(cls):
        if attr not in ["properties", "__doc__", "doc"]:
            attr_val = getattr(cls, attr)

            if isinstance(attr_val, MODULE.rdfclass.RdfPropertyMeta):
                rtn_dict[attr] = attr_val
    return rtn_dict
1354151
def get_attachment_content(self, request, queryset):
        

        return self.dump_report_content(request, self.get_report_data_rows(request, queryset))
500028
def get_attachment(self, id, filename, file):
        
        data = self.get_attachment_data(id, filename)
        file.write(data)
        return len(data)
34891
def data(self):
        """"""
        d = {}
        self.token = ''
        try:
            d = self.viz.data
            self.token = d.get('token')
        except Exception as e:
            logging.exception(e)
            d['error'] = str(e)
        return {
            'datasource': self.datasource_name,
            'description': self.description,
            'description_markeddown': self.description_markeddown,
            'edit_url': self.edit_url,
            'form_data': self.form_data,
            'slice_id': self.id,
            'slice_name': self.slice_name,
            'slice_url': self.slice_url,
            'modified': self.modified(),
            'changed_on_humanized': self.changed_on_humanized,
            'changed_on': self.changed_on.isoformat(),
        }
210667
def describe(self):
        
        return {
            "name": self.name,
            "params": self.params,
            "returns": self.returns,
            "description": self.description,
        }
313504
def from_dict(doc):
        
        return ModelOutputs(
            ModelOutputFile.from_dict(doc['prediction']),
            [ModelOutputFile.from_dict(a) for a in doc['attachments']]
        )
1055123
def attachments(self):
        

        resource = copy(self)
        resource._url_builder = URLBuilder(self._base_url, self._base_path, '/attachment')

        path = self._api_path.strip('/').split('/')

        if path[0] != 'table':
            raise InvalidUsage('The attachment API can only be used with the table API')

        return Attachment(resource, path[1])
908503
def info(self):
        
        return {
            'key': self.key,
            'processor': self.processor,
            'extractor': self.extractor,
            'output_path': self.output_path,
            'output_format': self.output_format,
            'template': self.template,
            'type': type(self)
        }
361949
def attachments
      return @builder.object.send(attribute_name).to_a unless multiple?
      @builder.object.send(attribute_name).sort_by { |a| @builder.object.send(relation_key).index(a.id) }
    end
1154433
def _export_module_attachments(meta_graph):
  """"""
  added_attachments = tf_v1.get_collection(_ATTACHMENT_COLLECTION_INTERNAL)
  if not added_attachments: return  # Don't touch `meta_graph`.
  unique_attachments = collections.OrderedDict(  # Avoid indeterminism.
      (attachment.key, attachment)
      for attachment in added_attachments)
  meta_graph.collection_def[ATTACHMENT_COLLECTION_SAVED].bytes_list.value[:] = [
      attachment.SerializeToString()
      for attachment in unique_attachments.values()]
229576
def pickAttachment(self):
        
        filename = QFileDialog.getOpenFileName(self.window(),
                                               'Select Attachment',
                                               '',
                                               'All Files (*.*)')
        
        if type(filename) == tuple:
            filename = nativestring(filename[0])
        
        filename = nativestring(filename)
        if filename:
            self.addAttachment(os.path.basename(filename), filename)
1022085
def to_api_data(self):
        
        data = {'@odata.type': self._gk(
            '{}_attachment_type'.format(self.attachment_type)),
            self._cc('name'): self.name}

        if self.attachment_type == 'file':
            data[self._cc('contentBytes')] = self.content
        else:
            data[self._cc('item')] = self.content

        return data
964710
def doc_dict(self):
        """"""
        doc = {
            'type': self.value_type,
            'description': self.description,
            'extended_description': self.details
        }
        return doc
71344
def get_attachment_formset_kwargs(self):
        
        kwargs = {
            'prefix': 'attachment',
        }

        if self.request.method in ('POST', 'PUT'):
            kwargs.update({
                'data': self.request.POST,
                'files': self.request.FILES,
            })
        else:
            post = self.get_post()
            attachment_queryset = Attachment.objects.filter(post=post)
            kwargs.update({
                'queryset': attachment_queryset,
            })
        return kwargs
541045
def getAttachments(self):
        

        attachment_tag = ("rtc_cm:com.ibm.team.workitem.linktype."
                          "attachment.attachment")
        return (self.rtc_obj
                    ._get_paged_resources("Attachment",
                                          workitem_id=self.identifier,
                                          customized_attr=attachment_tag,
                                          page_size="10"))
282547
def AsDict(self, dt=True):
        
        data = {}

        if self.id:
            data['id'] = self.id
        if self.name:
            data['name'] = self.name
        if self.owner:
            data['owner'] = self.owner.AsDict()
        if self.url:
            data['url'] = self.url
        if self.thumbnail_url:
            data['thumbnail_url'] = self.thumbnail_url
        if self.description:
            data['description'] = self.description
        if self.type:
            data['type'] = self.type

        if dt:
            if self.created_at:
                data['created_at'] = self.created_at
            if self.updated_at:
                data['updated_at'] = self.updated_at
        else:
            if self.created_at:
                data['created_at'] = self.created_at_iso
            if self.updated_at:
                data['updated_at'] = self.updated_at_iso

        return data