Generate tblCites string.
970090
def tblCites
      @headers = %w{TaxonNameID SeqNum RefID NomenclatorID LastUpdate ModifiedBy NewNameStatus CitePages Note TypeClarification CurrentConcept ConceptChange InfoFlags InfoFlagStatus PolynomialStatus}
      sql = []

      @name_collection.citations.keys.each do |name_id|
        seq_num = 1 
        @name_collection.citations[name_id].each do |ref_id, nomenclator_index, properties|
          cols = {
            TaxonNameID:       name_id,
            SeqNum:            seq_num,
            RefID:             ref_id,
            NomenclatorID:     nomenclator_index,
            LastUpdate:        @time, 
            ModifiedBy:        @authorized_user_id,
            CitePages:         (properties[:cite_pages] ? properties[:cite_pages] : @empty_quotes),
            NewNameStatus:     0,
            Note:              (properties[:note] ? properties[:note] : @empty_quotes),
            TypeClarification: 0,     # We might derive more data from this
            CurrentConcept:    (properties[:current_concept] == true ? 1 : 0),     # Boolean, right?
            ConceptChange:     0,     # Unspecified
            InfoFlags:         0,     # 
            InfoFlagStatus:    1,     # 1 => needs review
            PolynomialStatus:  0
          }
          sql << sql_insert_statement('tblCites', cols) 
          seq_num += 1
        end
      end
      sql.join("\n")
    end
339844
def generate(self):
    """"""
    header = ' '.join('=' * self.width[i] for i in range(self.w))
    lines = [
        ' '.join(row[i].ljust(self.width[i]) for i in range(self.w))
        for row in self.rows]
    return [header] + lines + [header]
60901
def construct(parts):
    """"""
    url = ''
    if parts.scheme:
        if parts.scheme in SCHEMES:
            url += parts.scheme + '://'
        else:
            url += parts.scheme + ':'
    if parts.username and parts.password:
        url += parts.username + ':' + parts.password + '@'
    elif parts.username:
        url += parts.username + '@'
    if parts.subdomain:
        url += parts.subdomain + '.'
    url += parts.domain
    if parts.tld:
        url += '.' + parts.tld
    if parts.port:
        url += ':' + parts.port
    if parts.path:
        url += parts.path
    if parts.query:
        url += '?' + parts.query
    if parts.fragment:
        url += '#' + parts.fragment
    return url
195431
def _generate_url(self, regex, arguments):
        
        regex_tokens = _split_regex(regex)
        result = ''
        for i in range(len(arguments)):
            result = result + str(regex_tokens[i]) + str(arguments[i])
        if len(regex_tokens) > len(arguments):
            result += regex_tokens[-1]
        return result
1006812
def _generate_content(self):
        """"""
        # concat into a dict
        dic = self.config
        dic['mode'] = self.language
        if self.theme:
            dic['theme'] = self.theme
        # dumps with json
        return json.dumps(dic, indent=8, separators=(',', ': '))
837169
def get_pltdotstr(self, **kws_usr):
        """"""
        dotstrs = self.get_pltdotstrs(**kws_usr)
        assert len(dotstrs) == 1
        return dotstrs[0]
789001
def dumps(self):
        """"""

        ret_str = self.path_type

        if self.options is not None:
            ret_str += self.options.dumps()

        return ret_str
707923
def contents(self):
        """"""
        rslt = []
        for (dpos, dlen, ulen, flag, typcd, nm) in self.toc:
            rslt.append(nm)
        return rslt
591840
def generate(self):
        """"""
        base = ''
        if self.xml_base:
            base = ' xml:base="%s"' % escape(self.xml_base, True)
        yield u'<entry%s>\n' % base
        yield u'  ' + _make_text_block('title', self.title, self.title_type)
        yield u'  <id>%s</id>\n' % escape(self.id)
        yield u'  <updated>%s</updated>\n' % format_iso8601(self.updated, self.timezone)
        if self.published:
            yield u'  <published>%s</published>\n' % \
                  format_iso8601(self.published, self.timezone)
        if self.url:
            yield u'  <link href="%s" />\n' % escape(self.url)
        for author in self.author:
            yield u'  <author>\n'
            yield u'    <name>%s</name>\n' % escape(author['name'])
            if 'uri' in author:
                yield u'    <uri>%s</uri>\n' % escape(author['uri'])
            if 'email' in author:
                yield u'    <email>%s</email>\n' % escape(author['email'])
            yield u'  </author>\n'
        for link in self.links:
            yield u'  <link %s/>\n' % ''.join('%s="%s" ' % \
                (k, escape(link[k], True)) for k in link)
        if self.summary:
            yield u'  ' + _make_text_block('summary', self.summary,
                                           self.summary_type)
        if self.content:
            if issubclass(self.content.__class__, dict):
                if "content" in self.content:
                    yield u'  <content %s>%s</content>\n' % (' '.join('%s="%s"' % \
                        (k, escape(self.content[k], True)) for k in self.content if k != "content"), escape(self.content["content"]))
                else:
                    yield u'  <content %s/>\n' % ' '.join('%s="%s" ' % \
                        (k, escape(self.content[k], True)) for k in self.content)
            else:
                yield u'  ' + _make_text_block('content', self.content,
                                           self.content_type)
        yield u'</entry>\n'
1141125
def prepare_to_generate(self, data_dir, tmp_dir):
    """"""
    self.get_or_create_vocab(data_dir, tmp_dir)
    self.train_text_filepaths(tmp_dir)
    self.dev_text_filepaths(tmp_dir)
402607
function generateSite(config, useServer) {
  var fileMap = new FileMap(config)
    , siteBuilder = new SiteBuilder(config)
    , server = require(__dirname + '/server')(siteBuilder);

  fileMap.walk();
  fileMap.on('ready', function() {
    siteBuilder.fileMap = fileMap;
    siteBuilder.build();
  });

  siteBuilder.once('ready', function() {
    if (useServer) {
      server.run();
      server.watch();
    }
  });

  return siteBuilder;
}
987612
def generate_lines(text, ext=['.txt', '.md', '.rst', '.asciidoc', '.asc']):
    
    """

    if isinstance(text, basestring):
        if len(text) <= 256:
            if os.path.isfile(text) and os.path.splitext(text)[-1].lower() in ext:
                return open(text)
            elif os.path.isdir(text):
                return chain.from_iterable(generate_lines(stat['path']) for stat in find_files(text, ext=ext))
            else:
                return (line for line in Split(text=text))
        else:
            return Split(text=text)
    return chain.from_iterable(generate_lines(obj) for obj in text)
119229
def generate_route(self, route):
        """"""
        self.emit('')
        self.emit('route %s (%s, %s, %s)' % (
            route.name,
            self.format_data_type(route.arg_data_type),
            self.format_data_type(route.result_data_type),
            self.format_data_type(route.error_data_type)
        ))
        # Output the docstring.
        with self.indent():
            if route.doc is not None:
                self.emit(self.format_string(route.doc))
1343378
def generate_item_urls(self):
        """"""
        item_urls = {}
        for i in self.dataset.identifiers:
            relpath = self.dataset.item_properties(i)["relpath"]
            url = self.generate_url("data/" + relpath)
            item_urls[i] = url
        return item_urls
1135533
def generate_dataset(self, cdl_path):
        '''
        
        '''
        if '.cdl' in cdl_path:  # it's possible the filename doesn't have the .cdl extension
            ds_str = cdl_path.replace('.cdl', '.nc')
        else:
            ds_str = cdl_path + '.nc'
        subprocess.call(['ncgen', '-o', ds_str, cdl_path])
        return ds_str
165644
def generate(self, **kwargs: Any) -> bytes:
        """"""
        namespace = {
            "escape": escape.xhtml_escape,
            "xhtml_escape": escape.xhtml_escape,
            "url_escape": escape.url_escape,
            "json_encode": escape.json_encode,
            "squeeze": escape.squeeze,
            "linkify": escape.linkify,
            "datetime": datetime,
            "_tt_utf8": escape.utf8,  # for internal use
            "_tt_string_types": (unicode_type, bytes),
            # __name__ and __loader__ allow the traceback mechanism to find
            # the generated source code.
            "__name__": self.name.replace(".", "_"),
            "__loader__": ObjectDict(get_source=lambda name: self.code),
        }
        namespace.update(self.namespace)
        namespace.update(kwargs)
        exec_in(self.compiled, namespace)
        execute = typing.cast(Callable[[], bytes], namespace["_tt_execute"])
        # Clear the traceback module's cache of source data now that
        # we've generated a new template (mainly for this module's
        # unittests, where different tests reuse the same name).
        linecache.clearcache()
        return execute()
718392
def generate_temporary_file(folder='/tmp', prefix='helpme', ext='json'):
    '''

    '''        
    tmp = next(tempfile._get_candidate_names())
    return '%s/%s.%s.%s' %(folder, prefix, tmp, ext)