Retrieves the format specification.

    Returns:
      FormatSpecification: format specification or None if the format cannot
          be defined by a specification object.
550218
def GetFormatSpecification(self):
    
    format_specification = specification.FormatSpecification(
        self.type_indicator)

    # FAT volume header signature.
    format_specification.AddNewSignature(b'\x55\xaa', offset=510)

    if definitions.PREFERRED_NTFS_BACK_END == self.TYPE_INDICATOR:
      # NTFS file system signature.
      format_specification.AddNewSignature(b'NTFS    ', offset=3)

    # HFS boot block signature.
    format_specification.AddNewSignature(b'LK', offset=0)

    # HFS master directory block signature.
    format_specification.AddNewSignature(b'BD', offset=0)

    # HFS+ file system signature.
    format_specification.AddNewSignature(b'H+', offset=1024)

    # HFSX file system signature.
    format_specification.AddNewSignature(b'HX', offset=1024)

    # Ext file system signature.
    format_specification.AddNewSignature(b'\x53\xef', offset=1080)

    # ISO9660 file system signature.
    format_specification.AddNewSignature(b'CD001', offset=32769)

    # YAFFS file system signature.

    return format_specification
763230
def get_format(self):
        
        url = self.build_url(self._endpoints.get('get_format'))
        response = self.session.get(url)
        if not response:
            return None
        return self.range_format_constructor(parent=self, **{self._cloud_data_key: response.json()})
314100
def _get_formatted_data(cls, path, context=None, site=None, language=None):
        
        return FormattedMetadata(cls(), cls._get_instances(path, context, site, language), path, site, language)
186431
def get_format(self, name):
        

        formats = [format for format in self.list_formats(self.__root_node) if format in name]
        if not formats:
            return QTextCharFormat()

        name = max(formats)

        format = None
        current_node = self.__root_node
        for selector in name.split("."):
            nodes = [node for node in current_node.children if node.name == selector]
            format_node = nodes and nodes[0] or None
            if not format_node:
                break

            current_node = format_node

            if not format_node.format:
                continue

            format = format_node.format
        return format
834136
def get_description(self, with_size=True, with_index=True):
        

        desc = ''

        if with_size and self.size:
            desc += '{0} '.format(self.get_formatted_size())

        s = self.info.get('statfstype') or self.info.get('fsdescription') or '-'
        if with_index:
            desc += '{1}:{0}'.format(s, self.index)
        else:
            desc += s

        if self.info.get('label'):
            desc += ' {0}'.format(self.info.get('label'))

        if self.info.get('version'):  # NTFS
            desc += ' [{0}]'.format(self.info.get('version'))

        return desc
1285266
def GetFormatSpecification(cls):
    
    format_specification = specification.FormatSpecification(cls.NAME)
    format_specification.AddNewSignature(cls._DLS_V1_SIGNATURE, offset=0)
    format_specification.AddNewSignature(cls._DLS_V2_SIGNATURE, offset=0)
    return format_specification
533608
def format_value(self):
        
        return format_value(
            self.data_type,
            self.data,
            self.parent.stringpool_main.getString
        )
717920
def format_field(self, value, format_spec):
        
        if format_spec:
            spec, arg = format_spec[0], format_spec[1:]
            arg = arg or None
        else:
            spec = arg = None
        return self._format_field(spec, arg, value, self.numeric_locale)
1060870
def _format(self, method="sparql", dt_format="turtle"):
        

        try:
            return __FORMAT_OPTIONS__[method](self, dt_format=dt_format)
        except KeyError:
            raise NotImplementedError("'{}' is not a valid format method"
                                      "".format(method))
400036
def _extract_specification_parts(specification):
    # type: (str) -> Tuple[str, str]
    
    try:
        # Parse the URI-like string
        parsed = urlparse(specification)
    except:
        # Invalid URL
        raise ValueError("Invalid specification URL: {0}".format(specification))

    # Extract the interface name
    interface = parsed.path

    # Extract the language, if given
    language = parsed.scheme
    if not language:
        # Simple name, without scheme
        language = PYTHON_LANGUAGE
    else:
        # Formatted name: un-escape it, without the starting '/'
        interface = _unescape_specification(interface[1:])

    return language, interface
685352
def getFormat(self, formatId, vendorSpecific=None):
        
        response = self.getFormatResponse(formatId, vendorSpecific)
        return self._read_dataone_type_response(response, 'ObjectFormat')
411265
def GetEventFormatter(self, event):
    
    data_type = getattr(event, 'data_type', None)
    if not data_type:
      return None

    return formatters_manager.FormattersManager.GetFormatterObject(
        event.data_type)
306992
def get_format_suffix(self, **kwargs):
        
        if self.settings.FORMAT_SUFFIX_KWARG:
            return kwargs.get(self.settings.FORMAT_SUFFIX_KWARG)
242447
def get_buffer(self, format, output=None):
        
        return self.io.get_buffer(self._get_data(), self.get_header(),
                                  format, output=output)
552007
def define_data_format(self):
        
        data = javabridge.call(self.jobject, "defineDataFormat", "()Lweka/core/Instances;")
        if data is None:
            return None
        else:
            return Instances(data)
259735
def get_data(self, data_format):
        
        if data_format not in self.output_formats:
            raise Exception("Output format {0} not available with this class. Available formats are {1}.".format(data_format, self.output_formats))
        data_converter = getattr(self, "to_" + data_format)
        return data_converter()
186422
public String loadSpecification()
    {
        try
        {
            specification = gpUtil.getSpecification(spaceKey, getPage().getTitle());
        }
        catch (GreenPepperServerException e)
        {
            if(!e.getId().equals(GreenPepperServerErrorKey.SPECIFICATION_NOT_FOUND))
                addActionError(e.getId());
        }
        
        return SUCCESS; 
    }