Complement other parameters by using file parameter.
976743
def complement
      if @id.nil?
        @id = @file.gsub(%r{[\\/\. ]}, '-')
      end
      if @id =~ /\A[^a-z]/i
        @id = "rv-#{@id}"
      end

      if !@file.nil? && @media.nil?
        @media = @file.sub(/.+\./, '').downcase
      end

      case @media
      when 'xhtml', 'xml', 'html'
        @media = 'application/xhtml+xml'
      when 'css'
        @media = 'text/css'
      when 'jpg', 'jpeg', 'image/jpg'
        @media = 'image/jpeg'
      when 'png'
        @media = 'image/png'
      when 'gif'
        @media = 'image/gif'
      when 'svg', 'image/svg'
        @media = 'image/svg+xml'
      when 'ttf', 'otf'
        @media = 'application/vnd.ms-opentype'
      when 'woff'
        @media = 'application/font-woff'
      end

      if @id.nil? || @file.nil? || @media.nil?
        raise "Type error: #{id}, #{file}, #{media}, #{title}, #{notoc}"
      end
    end
1272422
def add_file(self, file, filename):
        
        self.files['_{}'.format(filename)] = (filename, file)
177701
def add_param(self, param_name, layer_index, blob_index):
        """"""
        blobs = self.layers[layer_index].blobs
        self.dict_param[param_name] = mx.nd.array(caffe.io.blobproto_to_array(blobs[blob_index]))
1231911
def load_parameters(self, filename, ctx=mx.cpu()): # pylint: disable=arguments-differ
        
        self.lm_model.load_parameters(filename, ctx=ctx)
111692
def add_file(self, f):
        """"""

        if not self.files:
            self.files = set()

        self.files.add(f)

        self.locations.set(f.type_)
591748
def append_to_file(file_name, line_data):
    """"""
    with open(file_name, mode='a', encoding='utf-8') as f1:
        f1.write(line_data)
        f1.write("\n")
183932
def _append_value(self, value, _file, _name):
        
        _tabs = '\t' * self._tctr
        _cmma = ',\n' if self._vctr[self._tctr] else ''
        _keys = '{cmma}{tabs}"{name}" :'.format(cmma=_cmma, tabs=_tabs, name=_name)

        _file.seek(self._sptr, os.SEEK_SET)
        _file.write(_keys)

        self._vctr[self._tctr] += 1
        self._append_object(value, _file)
240585
def prepare_post_parameters(self, post_params=None, files=None):
        
        params = post_params or []
        for key, values in (files or {}).items():
            for maybe_file_or_path in values if isinstance(values, list) else [values]:
                try:
                    # use the parameter as if it was an open file object
                    data = maybe_file_or_path.read()
                    maybe_file_or_path = maybe_file_or_path.name
                except AttributeError:
                    # then it is presumably a file path
                    with open(maybe_file_or_path, 'rb') as fh:
                        data = fh.read()
                basepath = os.path.basename(maybe_file_or_path)
                mimetype = mimetypes.guess_type(basepath)[0] or 'application/octet-stream'
                params.append((key, (basepath, data, mimetype)))
        return params
289228
def resolve_file(fname, paths):
  """"""
  fpath = path.abspath(fname)
  for p in paths:
    spath = path.abspath(p)
    if fpath.startswith(spath):
      return fpath[len(spath) + 1:]
  return fname
282360
def append_file(self, file):
		""""""
		self.files.append(file)

		if self.transformer:
			future = asyncio.ensure_future(self.transformer.transform(file))
			future.add_done_callback(self.handle_transform)
26115
def _attach_arguments(self):
        """"""
        for arg in self.arguments:
            self.parser.add_argument(*arg[0], **arg[1])
212796
def _expand_possible_file_value(self, value):
    """"""
    if value and os.path.isfile(str(value)):
      with open(value, 'r') as f:
        return f.read()
    return value
109064
def _setfile(self, filename, length, offset):
        """"""
        source = open(filename, 'rb')
        if offset is None:
            offset = 0
        if length is None:
            length = os.path.getsize(source.name) * 8 - offset
        byteoffset, offset = divmod(offset, 8)
        bytelength = (length + byteoffset * 8 + offset + 7) // 8 - byteoffset
        m = MmapByteArray(source, bytelength, byteoffset)
        if length + byteoffset * 8 + offset > m.filelength * 8:
            raise CreationError("File is not long enough for specified "
                                "length and offset.")
        self._datastore = ConstByteStore(m, length, offset)
581988
public void setParamTabDiCopyFileMode(String value) {

        try {
            m_userSettings.setDialogCopyFileMode(CmsResourceCopyMode.valueOf(Integer.parseInt(value)));
        } catch (Throwable t) {
            // should usually never happen
        }
    }
376215
public void addFile(int level, long fileNumber,
            long fileSize,
            InternalKey smallest,
            InternalKey largest)
    {
        FileMetaData fileMetaData = new FileMetaData(fileNumber, fileSize, smallest, largest);
        addFile(level, fileMetaData);
    }
492468
public void addFile(String filename) {
        synchronized (files) {
            if (!files.contains(filename)) {
                files.add(filename);
            }
        }
    }
1312149
def add_parameter(self, parameter):
        """"""
        if parameter.name.lower() not in self.paramorder:
            self.paramorder.append(parameter.name.lower())
        self._parameters[parameter.name.lower()] = parameter