Export a single token
339922
public function answerExportAction()
    {
        if ($this->answerExportSnippets) {
            $params = $this->_processParameters($this->answerExportParameters + $this->defaultTokenParameters);

            $this->addSnippets($this->answerExportSnippets, $params);
        }
    }
406744
def dump_all(documents, stream=None, Dumper=Dumper,
        default_style=None, default_flow_style=None,
        canonical=None, indent=None, width=None,
        allow_unicode=None, line_break=None,
        encoding='utf-8', explicit_start=None, explicit_end=None,
        version=None, tags=None):
    
    getvalue = None
    if stream is None:
        if encoding is None:
            from StringIO import StringIO
        else:
            from cStringIO import StringIO
        stream = StringIO()
        getvalue = stream.getvalue
    dumper = Dumper(stream, default_style=default_style,
            default_flow_style=default_flow_style,
            canonical=canonical, indent=indent, width=width,
            allow_unicode=allow_unicode, line_break=line_break,
            encoding=encoding, version=version, tags=tags,
            explicit_start=explicit_start, explicit_end=explicit_end)
    try:
        dumper.open()
        for data in documents:
            dumper.represent(data)
        dumper.close()
    finally:
        dumper.dispose()
    if getvalue:
        return getvalue()
378765
def get_token(opts, tok):
    '''
    
    '''
    t_path = os.path.join(opts['token_dir'], tok)
    if not os.path.isfile(t_path):
        return {}
    serial = salt.payload.Serial(opts)
    try:
        with salt.utils.files.fopen(t_path, 'rb') as fp_:
            tdata = serial.loads(fp_.read())
            return tdata
    except (IOError, OSError):
        log.warning(
            'Authentication failure: can not read token file "%s".', t_path)
        return {}
1343561
def save_tokens(tokens)
      f = File.open(TOKEN_PATH, 'w')
      YAML::dump(tokens, f)
      f.close
    end
444907
def export(app, local, no_scrub):
    """"""
    log(header, chevrons=False)
    data.export(str(app), local=local, scrub_pii=(not no_scrub))
130250
function (token) {
	if (!token) {
		return '';
	}
	if (typeof token === 'string') {
		return token;
	}
	if (typeof token.content === 'string') {
		return token.content;
	}
	return token.content.map(stringifyToken).join('');
}
478566
def export_olx(self, tarball, root_path):
        """"""
        def append_asset_to_soup_and_export(asset_):
            if isinstance(asset_, Item):
                try:
                    unique_url = asset_.export_olx(tarball, root_path)
                except AttributeError:
                    pass
                else:
                    unique_name = get_file_name_without_extension(unique_url)
                    asset_type = asset_.genus_type.identifier
                    asset_tag = my_soup.new_tag(asset_type)
                    asset_tag['url_name'] = unique_name
                    getattr(my_soup, my_tag).append(asset_tag)
            else:
                try:
                    unique_urls = asset_.export_olx(tarball, root_path)
                except AttributeError:
                    pass
                else:
                    for index, ac in enumerate(asset_.get_asset_contents()):
                        asset_type = ac.genus_type.identifier

                        unique_url = unique_urls[index]
                        unique_name = get_file_name_without_extension(unique_url)
                        asset_tag = my_soup.new_tag(asset_type)

                        asset_tag['url_name'] = unique_name
                        getattr(my_soup, my_tag).append(asset_tag)

        def get_file_name_without_extension(filepath):
            return filepath.split('/')[-1].replace('.xml', '')

        my_path = None
        if self.my_osid_object.is_sequestered():
            # just export assets
            for asset in self.assets:
                try:
                    asset.export_olx(tarball, root_path)
                except AttributeError:
                    pass
        else:
            # also add to the /<tag>/ folder
            my_tag = self.my_osid_object.genus_type.identifier
            expected_name = self.get_unique_name(tarball, self.url, my_tag, root_path)
            my_path = '{0}{1}/{2}.xml'.format(root_path,
                                              my_tag,
                                              expected_name)
            my_soup = BeautifulSoup('<' + my_tag + '/>', 'xml')
            getattr(my_soup, my_tag)['display_name'] = self.my_osid_object.display_name.text

            if my_tag == 'split_test':
                getattr(my_soup, my_tag)['group_id_to_child'] = self.my_osid_object.group_id_to_child
                getattr(my_soup, my_tag)['user_partition_id'] = self.my_osid_object.user_partition_id.text

            rm = self.my_osid_object._get_provider_manager('REPOSITORY')
            if self.my_osid_object._proxy is None:
                cls = rm.get_composition_lookup_session()
            else:
                cls = rm.get_composition_lookup_session(proxy=self.my_osid_object._proxy)
            cls.use_federated_repository_view()
            cls.use_unsequestered_composition_view()
            for child_id in self.my_osid_object.get_child_ids():
                child = cls.get_composition(child_id)
                if child.is_sequestered():
                    # append its assets here
                    for asset in child.assets:
                        append_asset_to_soup_and_export(asset)
                else:
                    child_type = child.genus_type.identifier
                    child_tag = my_soup.new_tag(child_type)

                    child_path = child.export_olx(tarball, root_path)
                    if child_path is not None:
                        child_tag['url_name'] = get_file_name_without_extension(child_path)
                    getattr(my_soup, my_tag).append(child_tag)

            for asset in self.assets:
                append_asset_to_soup_and_export(asset)

            self.write_to_tarfile(tarball, my_path, my_soup)

        return my_path
84249
function process_token(token, index, tokens) {
	var last = (index === (tokens.length - 1));
	if (token[0] === "+") return process_single(token, last);
	else if (token[0] === "#") return process_multi(token, last);
	else return process_raw(token, last);
}
749633
function newToken(){ // check if the client has all the tokens
	var allRetrieved = true;
	var tokens = client.getTokens();
	
	['auth', 'gvx', 'rnr'].forEach(function(type){
		if(!tokens.hasOwnProperty(type)){
			allRetrieved = false;
		}
	});
	
	if(allRetrieved){ // save tokens once all have been retrieved
		fs.writeFileSync('./tokens.json', JSON.stringify(tokens));
		console.log('\n\nALL TOKENS SAVED TO tokens.json')
	}
}
779735
function export(){
		if( $this->is_terminal() ){
			if( $this->t === $this->value ){
				// scalar token
				return $this->value;
			}
			// PHP Tokenizer style array
			return array( $this->t, $this->value );
		}
		// else is a branch
		$a = array();
		foreach( $this->children as $Child ){
			$a[] = array( $this->t, $Child->export() );
		}
		return $a;
	}
1225904
private String escapeToken(String token) {
		String newToken = (String) escMap.get(token);
		if (newToken == null)
			return token;
		return newToken;
	}
1147598
function token() {
    if (re.lastIndex >= text.length) return EOF; // special case: end of file
    if (eol) { eol = false; return EOL; } // special case: end of line

    // special case: quotes
    var j = re.lastIndex;
    if (text.charCodeAt(j) === 34) {
      var i = j;
      while (i++ < text.length) {
        if (text.charCodeAt(i) === 34) {
          if (text.charCodeAt(i + 1) !== 34) break;
          i++;
        }
      }
      re.lastIndex = i + 2;
      var c = text.charCodeAt(i + 1);
      if (c === 13) {
        eol = true;
        if (text.charCodeAt(i + 2) === 10) re.lastIndex++;
      } else if (c === 10) {
        eol = true;
      }
      return text.substring(j + 1, i).replace(/""/g, "\"");
    }

    // common case
    var m = re.exec(text);
    if (m) {
      eol = m[0].charCodeAt(0) !== 44;
      return text.substring(j, m.index);
    }
    re.lastIndex = text.length;
    return text.substring(j);
  }
91980
def export_symbols(self):
        
        session = self.open_session()
        links = session.query(AssetClassStock).order_by(
            AssetClassStock.symbol).all()
        output = []
        for link in links:
            output.append(link.symbol + '\n')

        # Save output to a text file.
        with open("symbols.txt", mode='w') as file:
            file.writelines(output)

        print("Symbols exported to symbols.txt")
743511
def _process_token(cls, token):
        """"""
        assert type(token) is _TokenType or callable(token), \
            'token type must be simple type or callable, not %r' % (token,)
        return token
2608
def export(defn):
    """"""
    globals()[defn.__name__] = defn
    __all__.append(defn.__name__)
    return defn
962213
def get_token_and_data(self, data):
        '''
        
        '''
        token = ''
        for c in data:
            if c != ')':
                token = token + c
            else:
                break;

        return token, data.lstrip(token + '):')
1073683
def format_unencoded(self, tokensource, outfile):
        
        x = self.xoffset
        y = self.yoffset
        if not self.nowrap:
            if self.encoding:
                outfile.write('<?xml version="1.0" encoding="%s"?>\n' %
                              self.encoding)
            else:
                outfile.write('<?xml version="1.0"?>\n')
            outfile.write('<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" '
                          '"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/'
                          'svg10.dtd">\n')
            outfile.write('<svg xmlns="http://www.w3.org/2000/svg">\n')
            outfile.write('<g font-family="%s" font-size="%s">\n' %
                          (self.fontfamily, self.fontsize))
        outfile.write('<text x="%s" y="%s" xml:space="preserve">' % (x, y))
        for ttype, value in tokensource:
            style = self._get_style(ttype)
            tspan = style and '<tspan' + style + '>' or ''
            tspanend = tspan and '</tspan>' or ''
            value = escape_html(value)
            if self.spacehack:
                value = value.expandtabs().replace(' ', '&#160;')
            parts = value.split('\n')
            for part in parts[:-1]:
                outfile.write(tspan + part + tspanend)
                y += self.ystep
                outfile.write('</text>\n<text x="%s" y="%s" '
                              'xml:space="preserve">' % (x, y))
            outfile.write(tspan + parts[-1] + tspanend)
        outfile.write('</text>')

        if not self.nowrap:
            outfile.write('</g></svg>\n')