Parses copyright and set value
428367
def set_copyright(self):
        """"""
        try:
            self.copyright = self.soup.find('copyright').string
        except AttributeError:
            self.copyright = None
960094
def update_copyright(path, year):
    
    with open(path, "r") as fobj:
        text = fobj.read().rstrip()
    match = COPYRIGHT_REGEX.search(text)
    x = match.start("years")
    y = match.end("years")
    if text[y-1] == " ":  # don't strip trailing whitespace
        y -= 1
    yearstr = match.group("years")
    years = set(_parse_years(yearstr)) | {year}
    with open(path, "w") as fobj:
        print(text[:x] + _format_years(years) + text[y:], file=fobj)
93902
def raw_content
      return if pseudo_license?
      unless File.exist?(path)
        raise Licensee::InvalidLicense, "'#{key}' is not a valid license key"
      end

      @raw_content ||= File.read(path, encoding: 'utf-8')
    end
315471
function parseStoredType(value /* , context */) {
    const regex = /^(\w+)(\((.*?)\))?$/;
    const result = value.match(regex);
    if (!result) throw new ImplementationError(`Invalid storedType "${value}"`);

    const type = result[1];
    const options = {};
    if (result[2]) {
        const regexOptions = /^(\w+)=(.*)/;
        result[3].split(';').forEach(o => {
            const resultOptions = o.match(regexOptions);
            if (!resultOptions) throw new ImplementationError(`Invalid storedType "${value}"`);
            options[resultOptions[1]] = resultOptions[2];
        });
    }

    return { type, options };
}
816948
function styleParse (str, obj) {
  var chunks;
  var i;
  var item;
  var pos;
  var key;
  var val;

  obj = obj || {};

  chunks = getKeyValueChunks(str);
  for (i = 0; i < chunks.length; i++) {
    item = chunks[i];
    if (!item) { continue; }
    // Split with `.indexOf` rather than `.split` because the value may also contain colons.
    pos = item.indexOf(':');
    key = item.substr(0, pos).trim();
    val = item.substr(pos + 1).trim();
    obj[key] = val;
  }
  return obj;
}
956898
function parse_PtgName(blob, length, opts) {
	var type = (blob.read_shift(1) >>> 5) & 0x03;
	var w = (!opts || (opts.biff >= 8)) ? 4 : 2;
	var nameindex = blob.read_shift(w);
	switch(opts.biff) {
		case 2: blob.l += 5; break;
		case 3: case 4: blob.l += 8; break;
		case 5: blob.l += 12; break;
	}
	return [type, 0, nameindex];
}
288127
def parse(path, contents = nil)
      print_known_info if verbose

      contents ||= File.open(path, "r:utf-8", &:read)

      # Work around for Rubinius incomplete encoding in 1.9 mode
      if contents.respond_to?(:encoding) && contents.encoding.name != "UTF-8"
        contents.encode!("UTF-8")
      end

      if contents.tr!("“”‘’‛", %(""'''))
        # Changes have been made
        ui.puts "Your #{path.basename} has had smart quotes sanitised. " \
          "To avoid issues in the future, you should not use " \
          "TextEdit for editing it. If you are not using TextEdit, " \
          "you should turn off smart quotes in your editor of choice.".red
      end

      if contents.include?("puts")
        ui.puts "You used `puts` in your Dangerfile. To print out text to GitHub use `message` instead"
      end

      self.defined_in_file = path
      instance_eval do
        # rubocop:disable Lint/RescueException
        begin
          eval_file(contents, path)
        rescue Exception => e
          message = "Invalid `#{path.basename}` file: #{e.message}"
          raise DSLError.new(message, path, e.backtrace, contents)
        end
        # rubocop:enable Lint/RescueException
      end
    end
34907
def parse_resource(name):
    
    with closing(pkg_resources.resource_stream(__name__, name)) as fp:
        rbytes = fp.read()

    return _load(StringIO(rbytes.decode('utf-8')))
1260423
def _parse_value(cls, stream_rdr, offset, value_count, value_offset):
        
        if value_count == 1:
            return stream_rdr.read_long(offset, 8)
        else:  # pragma: no cover
            return 'Multi-value long integer NOT IMPLEMENTED'
1068621
def _parse_value(cls, stream_rdr, offset, value_count, value_offset):
        
        if value_count == 1:
            return stream_rdr.read_short(offset, 8)
        else:  # pragma: no cover
            return 'Multi-value short integer NOT IMPLEMENTED'
439032
def value(self, raw_value):
        """"""
        try:
            return base64.b64decode(bytes(raw_value, 'utf-8')).decode('utf-8')
        except binascii.Error as err:
            raise ValueError(str(err))
5973
function show_copyright(comments) {
        var ret = "";
        for (var i = 0; i < comments.length; ++i) {
                var c = comments[i];
                if (c.type == "comment1") {
                        ret += "//" + c.value + "\n";
                } else {
                        ret += "/*" + c.value + "*/";
                }
        }
        return ret;
}
833001
def get_copyright_metadata(self):
        
        # Implemented from template for osid.resource.ResourceForm.get_group_metadata_template
        metadata = dict(self._mdata['copyright'])
        metadata.update({'existing_string_values': self._my_map['copyright']})
        return Metadata(**metadata)
118305
function parse (metadata) {
  var rtn = {};
  if (Buffer.isBuffer(metadata)) {
    metadata = metadata.toString('utf8');
  }
  var pieces = metadata.replace(/\0*$/, '').split(';');

  for (var i = 0; i < pieces.length; i++) {
    var piece = pieces[i].trim();
    if (piece.length > 0) {
      var delimiter = /\=(['"])/.exec(piece);
      var name = piece.substring(0, delimiter.index);
      var value = piece.substring(delimiter.index + 2, piece.length - 1);
      rtn[name] = value;
    }
  }
  return rtn;
}
953304
def charset_from_meta_content(string)

      charset_match = string.match(/charset\s*\=\s*(.+)/i)

      if charset_match

        charset_value = charset_match[1]

        charset_value[/\A\"(.*)\"/, 1] ||
        charset_value[/\A\'(.*)\'/, 1] ||
        charset_value[/(.*)[\s;]/, 1] ||
        charset_value[/(.*)/, 1]
      else
        nil
      end

    end
468774
def is_copyright_model(instance, attribute, value):
    

    rights_of = value.get('rightsOf')
    if not isinstance(rights_of, str):
        instance_name = instance.__class__.__name__
        raise ModelDataError(("'rightsOf' must be given as a string in "
                              "the '{attr}' parameter of a '{cls}'. Given "
                              "'{value}'").format(attr=attribute.name,
                                                  cls=instance_name,
                                                  value=rights_of))
1194632
def parse_author(self, value):
        
        tokens = tuple([t.upper().strip() for t in value.split(',')])
        if len(tokens) == 1:
            tokens = value.split(' ')
        if len(tokens) > 0:
            if len(tokens) > 1:
                aulast, auinit = tokens[0:2]    # Ignore JR, II, III, etc.
            else:
                aulast = tokens[0]
                auinit = ''
        else:
            aulast, auinit = tokens[0], ''
        aulast = _strip_punctuation(aulast).upper()
        auinit = _strip_punctuation(auinit).upper()
        return aulast, auinit