Call with Packer, nil, or IO. If +pk+ is nil, returns string. If +pk+ is
 a Packer, returns the Packer, which will need to be flushed. If +pk+ is
 IO, returns nil.
17221
def to_msgpack(pk = nil)
      case pk
      when MessagePack::Packer
        pk.write_array_header(6)
        pk.write @client_id
        pk.write @local_tick
        pk.write @global_tick
        pk.write @delta
        pk.write @tags
        pk.write @blob
        return pk

      else # nil or IO
        MessagePack.pack(self, pk)
      end
    end
106589
def getPointer(p)
      # puts "getPointer >> p=#{p}"
      return nil if p > @nitems || p < 0
      pos = SIZEOF_BLOCK_HEADER + (SIZEOF_KEY * @nitems) + (SIZEOF_POINTER * p)
      ptrdata = @data[pos, SIZEOF_POINTER]
      POINTER.decode(ptrdata)
    end
418264
def read(bytes = @length)
      return nil if @pos >= @length
      bytes = @length - @pos if bytes.nil?
      bytes = @length - @pos if @pos + bytes > @length

      out = @data[@pos, bytes]      if @data.kind_of?(String)
      out = @data.read(bytes)       if @data.kind_of?(NTFS::DataRun)

      @pos += out.size
      out
    end
279990
def _get_pk(self):
        
        pk = None
        if self._lazy_collection['pks']:
            if len(self._lazy_collection['pks']) > 1:
                raise ValueError('Too much pks !')
            pk = list(self._lazy_collection['pks'])[0]
        return pk
125975
def backward_char

      file   = @file
      result = nil

      if file.pos > 0
        file.seek(-1, IO::SEEK_CUR)
        result = file.getc
      end

      result
    end
1356787
def _pfp__pack_data(self):
        
        if self._pfp__pack_type is None:
            return

        tmp_stream = six.BytesIO()
        self._._pfp__build(bitwrap.BitwrappedStream(tmp_stream))
        raw_data = tmp_stream.getvalue()

        unpack_func = self._pfp__packer
        unpack_args = []
        if self._pfp__packer is not None:
            unpack_func = self._pfp__packer
            unpack_args = [true(), raw_data]
        elif self._pfp__pack is not None:
            unpack_func = self._pfp__pack
            unpack_args = [raw_data]

        # does not need to be converted to a char array
        if not isinstance(unpack_func, functions.NativeFunction):
            io_stream = bitwrap.BitwrappedStream(six.BytesIO(raw_data))
            unpack_args[-1] = Array(len(raw_data), Char, io_stream)

        res = unpack_func.call(unpack_args, *self._pfp__pack_func_call_info, no_cast=True)
        if isinstance(res, Array):
            res = res._pfp__build()

        io_stream = six.BytesIO(res)
        tmp_stream = bitwrap.BitwrappedStream(io_stream)

        self._pfp__no_unpack = True
        self._pfp__parse(tmp_stream)
        self._pfp__no_unpack = False
554807
def method_missing(m, *args, &block)
      return nil if @is_empty
      if m =~ /\?$/
        # query if a value exists, e.g., r.info.dp? or s.dp?
        v = values[fetch(m.to_s.upcase.chop)]
        return (not VcfValue::empty?(v))
      else
        v = values[fetch(m.to_s.upcase)]
        return nil if VcfValue::empty?(v)
        v = v.to_i if v =~ /^\d+$/
        v = v.to_f if v =~ /^\d+\.\d+$/
        v
      end
    end
561832
def method_missing(key, *args, &block)
      if key.to_s =~ /\A(.+)=\z/
        self[$1] = args.first
        return args.first
      end
      if key.to_s =~ /\A(.+)\?\z/
        return !!self[$1]
      end
      return self[key]  if has_key?(key)
      nil
    end
725791
def pack(type, payload=nil)
      size = payload ? payload.to_s.bytes.count : 0
      msg = MAGIC_STRING + [size, type].pack("LL")
      msg << payload.to_s if payload
      msg
    end
149927
function pkginfo( clbk ) {
	var root,
		file;

	if ( !isFunction( clbk ) ) {
		throw new TypeError( 'invalid input argument. Must provide a callback function. Value: `' + clbk + '`.' );
	}
	root = resolve();
	file = path.join( root, 'package.json' );

	readJSON( file, onData );

	/**
	* FUNCTION: onData( error, data )
	*	Callback invoked after attempting to read an application's `package.json`.
	*
	* @private
	* @param {Error|Null} error - error object
	* @param {Object} data - JSON data
	* @returns {Void}
	*/
	function onData( error, data ) {
		if ( error ) {
			return clbk( error );
		}
		clbk( null, data );
	}
}
105631
function (name, pkgDir) {
    if (!isString(name) || !isString(pkgDir) ||
         S(name).isEmpty() || S(pkgDir).isEmpty() || !isDirectory.sync(pkgDir)) {
      return 1
    }
    var scope = utils(name, pkgDir)
    try {
      scope.validateIsUnityRoot()
      scope.createModulesDirectoryInAssets()
      scope.createModuleDirectory()
      scope.copyModuleResources()
    } catch (err) {
      scope.cleanupOnPostInstallError()
      scope.printError(err)
      return 1
    }
    return 0
  }
279096
def pack(self, value=None):
        """"""
        if isinstance(value, Match):
            return value.pack()
        elif value is None:
            self._update_match_length()
            packet = super().pack()
            return self._complete_last_byte(packet)
        raise PackException(f'Match can\'t unpack "{value}".')
42203
def pack(o, default=encode,
         encoding='utf-8', unicode_errors='strict', use_single_float=False,
         autoreset=1, use_bin_type=1):
    

    return Packer(default=default, encoding=encoding,
                  unicode_errors=unicode_errors,
                  use_single_float=use_single_float,
                  autoreset=autoreset,
                  use_bin_type=use_bin_type).pack(o)
1228252
def text(*val)
      if val.empty?
        return getvalue()
      else
        return unless val # added 2010-11-17 20:11, dup will fail on nil
        return unless val[0]
        # 2013-04-20 - 19:02 dup failing on fixnum, set_buffer does a dup
        # so maybe i can do without it here
        #s = val[0].dup
        s = val[0]
        _set_buffer(s)
      end
    end
79921
def parse_package(self, inputstring, addhash=True):
        """"""
        if addhash:
            use_hash = self.genhash(True, inputstring)
        else:
            use_hash = None
        return self.parse(inputstring, self.file_parser, {"nl_at_eof_check": True}, {"header": "package", "use_hash": use_hash})
67659
def report data
      return nil if data.nil? || data.empty?
      result = ''
      data.each do |file_name, analysis|
        rel_path = File.join('.', File.expand_path(file_name).sub(Dir.pwd, ''))
        result += "\n#{rel_path}\n"
        analysis.each do |line_number, warning|
          result += "  #{line_number}: #{warning.join(',')}\n"
        end
      end
      result.strip!

      result.empty? ? nil : result
    end
1036441
def lint(commit = nil)
      files = pronto(commit)
      return if files.empty?

      markdown offenses_message(files)
    end