Apple's Address Book is *really* weird with images, it expects
        base64 data to have very specific whitespace.  It seems Address Book
        can handle PHOTO if it's not wrapped, so don't wrap it.
173477
def serialize(cls, obj, buf, lineLength, validate):
        
        if wacky_apple_photo_serialize:
            lineLength = REALLY_LARGE
        VCardTextBehavior.serialize(obj, buf, lineLength, validate)
235018
def delete_blob(address)
      unless address >= 0
        PEROBS.log.fatal "Blob address must be larger than 0, " +
          "not #{address}"
      end

      offset = address_to_offset(address)
      begin
        @f.seek(offset)
        if (marker = read_char) != 1 && marker != 2
          PEROBS.log.fatal "Cannot delete blob stored at address #{address} " +
            "of EquiBlobsFile #{@file_name}. Blob is " +
            (marker == 0 ? 'empty' : 'corrupted') + '.'
        end
        @f.seek(address_to_offset(address))
        write_char(0)
        write_unsigned_int(@first_space)
      rescue IOError => e
        PEROBS.log.fatal "Cannot delete blob at address #{address}: " +
          e.message
      end

      @first_space = offset
      @total_spaces += 1
      @total_entries -= 1 unless marker == 1
      write_header

      if offset == @f.size - 1 - @entry_bytes
        # We have deleted the last entry in the file. Make sure that all empty
        # entries are removed up to the now new last used entry.
        trim_file
      end
    end
75153
function _btoa(str) {
  let buffer;

  if (str instanceof Buffer) {
    buffer = str;
  } else {
    buffer = Buffer.from(str.toString(), "binary");
  }

  return buffer.toString("base64");
}
316038
def _image_to_data(img):
    
    # If the image is already encoded in Base64, we have nothing to do here
    if "src" not in img.attrs or img["src"].startswith("data:"):
        return
    elif re.match("https?://", img["src"]):
        img_data = _load_url(img["src"]).read()
    else:
        img_data = _load_file(img["src"]).read()
    img_type = imghdr.what("", img_data)
    img_b64 = base64.b64encode(img_data)
    src_data = "data:image/none;base64,"
    if img_type:
        src_data = "data:image/{};base64,{}".format(img_type, img_b64)
    img["src"] = src_data
454934
function process(data) {
  var companyIdentifierCode = data.substr(2,2);
  companyIdentifierCode += data.substr(0,2);

  var companyName = companyIdentifierCodes.companyNames[companyIdentifierCode];
  if(typeof companyName === 'undefined') {
    companyName = 'Unknown';
  }

  // NOTE: this is for legacy compatibility
  var advertiserData = {
    manufacturerSpecificData: {
      companyName : companyName,
      companyIdentifierCode: companyIdentifierCode,
      data: data.substr(4)
    }
  };

  // Handle the unique case of AltBeacon
  if(altbeacon.isAltBeacon(advertiserData)) {
    altbeacon.process(advertiserData);
    return advertiserData.manufacturerSpecificData;
  }

  // Interpret the manufacturer specific data, if possible
  // Kindly respect ascending order of company identifier codes 
  switch(companyIdentifierCode) {
    case '004c':
      apple.process(advertiserData);
      return advertiserData.manufacturerSpecificData;
    case '00f9':
      sticknfind.process(advertiserData);
      return advertiserData.manufacturerSpecificData;
    case '015d':
      estimote.process(advertiserData);
      return advertiserData.manufacturerSpecificData;
    case '0274':
      motsai.process(advertiserData);
      return advertiserData.manufacturerSpecificData;
    case '0583':
      codebluecommunications.process(advertiserData);
      return advertiserData.manufacturerSpecificData;
    default:
      return advertiserData.manufacturerSpecificData;
  }
}
808632
def _parse_photo(photo):
    """"""
    owner = User(photo.owner)
    title = photo.title
    ispublic = photo.ispublic
    isfriend = photo.isfriend
    isfamily = photo.isfamily
    secret = photo.secret
    server = photo.server
    p = Photo(photo.id, owner=owner, title=title, ispublic=ispublic,\
              isfriend=isfriend, isfamily=isfamily, secret=secret, \
              server=server)        
    return p
363478
function() {
		this.width = 256;
		this.height = 224;
		this.data = new Uint8Array( this.width * this.height * 4 );

		for ( var i = 0; i < this.data.length; i++  ) {
			this.data[ i ] = 0xff;
		}

		this.context = getContext( this.el );
		this.image = this.context.getImageData( 0, 0, this.width, this.height );

		this.index = 0;
	}
335253
function _storeMarginBottom()
    {
        $record  = 0x0029;                   // Record identifier
        $length  = 0x0008;                   // Bytes to follow

        $margin  = $this->_margin_bottom;     // Margin in inches

        $header    = pack("vv",  $record, $length);
        $data      = pack("d",   $margin);
        if ($this->_byte_order) { // if it's Big Endian
            $data = strrev($data);
        }

        $this->_prepend($header . $data);
    }
295345
def encode(value):
  

  if value > MAX_VALUE:
    raise ValueError('value {!r} exceeds MAC address range'.format(value))
  if value < 0:
    raise ValueError('value must not be negative')

  # todo: convert to the right byte order. the resulting
  # mac address is reversed on my machine compared to the
  # mac address displayed by the hello-myo SDK sample.
  # See issue #7

  string = ('%x' % value).rjust(12, '0')
  assert len(string) == 12

  result = ':'.join(''.join(pair) for pair in zip(*[iter(string)]*2))
  return result.upper()
656685
function parse(data){
			var out = {source: 'api'};
        	if(data.ok && data.ok === true){

        		var entry = data.user;

        		if(entry.username){ out.nickname = entry.username };
        		if(entry.name){ out.fn = entry.name };
				if(entry.short_bio){ out.note = [entry.short_bio] };

        		if(entry.web_url){ 
        			if(!out.url) {out.url = []};
        			out.url.push(entry.web_url);
        		};

        		if(entry.twitter_url){ 
        			if(!out.url) {out.url = []};
        			out.url.push(entry.twitter_url);
        		};

				if(entry.avatar_url){ 
				  	var large = entry.avatar_url.replace('s48','s300');
					out.photo = [large] 
				};

			}
			return {type: ['h-card'], properties: out};
		}
326664
function fixdata(data) {
		var o = '',
			l = 0,
			w = 10240;
		for (; l < data.byteLength / w; ++l)
			o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)));
		o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)));
		return o;
	}
1167777
function parse(data){
			var out = {};
     		if(data.entry){

	    		var entry = data.entry[0];
	    		
	    		// map data into ufData format from api json

	        	if(utils.getNodeVaue('name.givenName', entry) !== ''){
	        		out['given-name'] = utils.getNodeVaue('name.givenName', entry)
	        	}	

	        	if(utils.getNodeVaue('name.familyName', entry) !== ''){
	        		out['family-name'] = utils.getNodeVaue('name.familyName', entry)
	        	}	

	        	if(utils.getNodeVaue('name.formatted', entry) !== ''){
	        		out.name = utils.getNodeVaue('name.formatted', entry)
	        	}	

	        	if(entry.thumbnailUrl){
	        		out.photo = [entry.thumbnailUrl]
	        	}

	        	if(entry.aboutMe){
	        		out.note = [entry.aboutMe]
	        	}

	        	if(entry.urls){
	        		if(!out.url) {out.url = []};
	        		var i = entry.urls.length;
					var x = 0;
					while (x < i) {
					    out.url.push(entry.urls[x].value);
					    x++;
					}
				}

				if(entry.phoneNumbers){
	        		if(!out.tel) {out.tel = []};
	        		var i = entry.phoneNumbers.length;
					var x = 0;
					while (x < i) {
						if(entry.phoneNumbers[x].type === 'mobile'){
							entry.phoneNumbers[x].type = 'cell'
						}
					    out.tel.push(entry.phoneNumbers[x]);
					    x++;
					}
				}

				if(entry.emails){
	        		if(!out.email) {out.email = []};
	        		var i = entry.emails.length;
					var x = 0;
					while (x < i) {
						if(entry.emails[x].primary && entry.emails[x].primary == 'true'){
							entry.emails[x].type = 'pref';
							delete entry.emails[x].primary;
						}
					    out.email.push(entry.emails[x]);
					    x++;
					}
				}
			}
			return {type: ['h-card'], properties: out};
		}
374862
function blobToString (blob) {
  return blobUtil
    .blobToArrayBuffer(blob)
    .then(function (buffer) {
      return String.fromCharCode.apply(null, new Uint16Array(buffer))
    })
}
3530
function() {

    var _buffer = 0;
    var _buflen = 0;
    var _length = 0;
    var _base64 = '';

    var _this = {};

    var writeEncoded = function(b) {
      _base64 += String.fromCharCode(encode(b & 0x3f) );
    };

    var encode = function(n) {
      if (n < 0) {
        // error.
      } else if (n < 26) {
        return 0x41 + n;
      } else if (n < 52) {
        return 0x61 + (n - 26);
      } else if (n < 62) {
        return 0x30 + (n - 52);
      } else if (n == 62) {
        return 0x2b;
      } else if (n == 63) {
        return 0x2f;
      }
      throw 'n:' + n;
    };

    _this.writeByte = function(n) {

      _buffer = (_buffer << 8) | (n & 0xff);
      _buflen += 8;
      _length += 1;

      while (_buflen >= 6) {
        writeEncoded(_buffer >>> (_buflen - 6) );
        _buflen -= 6;
      }
    };

    _this.flush = function() {

      if (_buflen > 0) {
        writeEncoded(_buffer << (6 - _buflen) );
        _buffer = 0;
        _buflen = 0;
      }

      if (_length % 3 != 0) {
        // padding
        var padlen = 3 - _length % 3;
        for (var i = 0; i < padlen; i += 1) {
          _base64 += '=';
        }
      }
    };

    _this.toString = function() {
      return _base64;
    };

    return _this;
  }
758394
function dataURLToBlob(dataURL) {
                    var BASE64_MARKER = ';base64,',
                        contentType,
                        parts,
                        raw;
                    if (dataURL.indexOf(BASE64_MARKER) === -1) {
                        parts = dataURL.split(',');
                        contentType = parts[0].split(':')[1];
                        raw = parts[1];

                        return new Blob([raw], {type: contentType});
                    }

                    parts = dataURL.split(BASE64_MARKER);
                    contentType = parts[0].split(':')[1];
                    raw = window.atob(parts[1]);
                    var rawLength = raw.length;
                    var uInt8Array = new Uint8Array(rawLength);

                    for (var i = 0; i < rawLength; ++i) {
                        uInt8Array[i] = raw.charCodeAt(i);
                    }
                    return new Blob([uInt8Array.buffer], {type: contentType});
                }
739981
function() {
					// don't create more object URLs than needed
					if (blob_changed || !object_url) {
						object_url = get_URL().createObjectURL(blob);
					}
					if (target_view) {
						target_view.location.href = object_url;
					} else {
						var new_tab = view.open(object_url, "_blank");
						if (new_tab == undefined && typeof safari !== "undefined") {
							//Apple do not allow window.open, see http://bit.ly/1kZffRI
							view.location.href = object_url
						}
					}
					filesaver.readyState = filesaver.DONE;
					dispatch_all();
					revoke(object_url);
				}
153362
function dataURItoBlob(dataURI) {
    // convert base64 to raw binary data held in a string
    var byteString = atob(dataURI.split(',')[1]),
        // separate out the mime component
        mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0],
        // write the bytes of the string to an ArrayBuffer
        arrayBuffer = new ArrayBuffer(byteString.length),
        _ia = new Uint8Array(arrayBuffer),
        i, dataView, blob;

    for (i = 0; i < byteString.length; i++) {
        _ia[i] = byteString.charCodeAt(i);
    }

    dataView = new DataView(arrayBuffer);
    blob = new Blob([dataView], { type: mimeString });

    return blob;
}