Return string with a citation for the record, formatted as:
        '{first_author} - {year} - {journal}'
979701
def cite_mini(self):
        
        citation_data = [self.first_author]

        if len(self._author_list) > 1:
            citation_data.append(self.last_author)

        citation_data.extend([self.year, self.journal])

        return " - ".join(citation_data)
1260401
def __generate_study_name(self):
        
        study_name = ""
        _exist = False
        try:
            if self.noaa_data_sorted["Top"]["Study_Name"]:
                _exist = True
        except KeyError:
            pass

        if not _exist:
            try:
                _site = self.noaa_data_sorted["Site_Information"]["properties"]["siteName"]
                _year = self.noaa_data_sorted["Publication"][0]["pubYear"]
                _author = self.noaa_data_sorted["Publication"][0]["author"]
                _author = self.__get_author_last_name(_author)
                study_name = "{}.{}.{}".format(_author, _site,  _year)
                study_name = study_name.replace(" ", "_").replace(",", "_")
            except (KeyError, Exception):
                pass
            self.noaa_data_sorted["Top"]["Study_Name"] = study_name
            self.noaa_data_sorted["Title"]["Study_Name"] = study_name
        return
167435
def format(self, record):
        """"""
        if hasattr(record, 'data'):
            return "%s. DEBUG DATA=%s" % (
                logging.Formatter.format(self, record),
                record.__dict__['data'])
        return logging.Formatter.format(self, record)
884473
def __create_author_investigator_str(self):
        
        _author = ""
        try:
            for pub in self.noaa_data_sorted["Publication"]:
                if "author" in pub:
                    if pub["author"]:
                        _author_src = pub["author"]
                        if isinstance(_author_src, str):
                            try:
                                if " and " in _author_src:
                                    _author = _author_src.replace(" and ", "; ")
                                elif ";" in _author_src:
                                    # If there is a semi-colon, add a space after it, just in case it didn't have one
                                    _author = _author_src.replace(";", "; ")
                                break
                            except Exception as e:
                                _author = ""
                        elif isinstance(_author_src, list):
                            try:
                                for _entry in _author_src:
                                    _author += _entry["name"].split(",")[0] + ", "
                            except Exception as e:
                                _author = ""
        except Exception:
            _author = ""
        return _author
777826
def getFirstUrn(self, reference=None):
        
        if reference is not None:
            if ":" in reference:
                urn = reference
            else:
                urn = "{}:{}".format(
                    str(URN(str(self.urn)).upTo(URN.NO_PASSAGE)),
                    str(reference)
                )
        else:
            urn = str(self.urn)
        _first = _SharedMethod.firstUrn(
            self.retriever.getFirstUrn(
                urn
            )
        )
        return _first
582330
def ayjid(self):
        

        try:    # TODO: make this less terrible.
            return self._ayjid
        except:
            pass

        if hasattr(self, 'authors_init') and len(self.authors_init) > 0:
            al, ai = self.authors_init[0]
        elif hasattr(self, 'authors_full') and len(self.authors_full) > 0:
            al, af = self.authors_full[0]
            ai = u''.join([i[0] for i in af.split(' ')])
        else:
            al, ai = u'', u''
        if hasattr(self, 'date'):
            date = unicode(self.date)
        else:
            date = u''
        if hasattr(self, 'journal'):
            journal = self.journal
        else:
            journal = u''

        self._ayjid = u' '.join([al, ai.replace(' ', ''), date, journal]).strip().replace(' ', '_').upper()
        return self._ayjid
79250
def lookup(self):
        
        print "%s by %s, size: %s, uploaded %s ago" % (self.name, self.author,
                                                       self.size, self.age)
889799
def _get_first_last(details):
    
    if "first_name" in details and "last_name" in details:
        return details["first_name"], details["last_name"]
    elif "first_name" in details:
        lst = details["first_name"].rsplit(" ", 1)
        if len(lst) == 2:
            return lst
        else:
            return lst[0], ""
    elif "last_name" in details:
        return "", details["last_name"]

    return "", ""
1318143
def format_references(references)
      return {record_references: references, id_references: []} if references.is_a?(Array)

      references[:record_references] ||= []
      references[:id_references] ||= []
      references
    end
446894
def write_bib(refs):
    '''
    '''

    full_str = ''

    lib_citation_desc, lib_citations = get_library_citation()

    full_str += '%' * 80 + '\n'
    full_str += textwrap.indent(lib_citation_desc, '% ')
    full_str += '%' * 80 + '\n\n'

    for k, r in lib_citations.items():
        full_str += _ref_bib(k, r) + '\n\n'

    full_str += '%' * 80 + '\n'
    full_str += "% References for the basis set\n"
    full_str += '%' * 80 + '\n'

    # First, write out the element, description -> key mapping
    # Also make a dict of unique reference to output
    unique_refs = {}

    for ref in refs:
        full_str += '% {}\n'.format(compact_elements(ref['elements']))

        for ri in ref['reference_info']:
            full_str += '%     {}\n'.format(ri['reference_description'])

            refdata = ri['reference_data']

            if len(refdata) == 0:
                full_str += '%     (...no reference...)\n%\n'
            else:
                rkeys = [x[0] for x in ri['reference_data']]
                full_str += '%         {}\n%\n'.format(' '.join(rkeys))

            for k, r in refdata:
                unique_refs[k] = r

    full_str += '\n\n'

    # Go through them sorted alphabetically by key
    for k, r in sorted(unique_refs.items(), key=lambda x: x[0]):
        full_str += '{}\n\n'.format(_ref_bib(k, r))

    return full_str
870822
def format(self, record):
    
    if (not FLAGS['showprefixforinfo'].value and
        FLAGS['verbosity'].value == converter.ABSL_INFO and
        record.levelno == logging.INFO and
        _absl_handler.python_handler.stream == sys.stderr):
      prefix = ''
    else:
      prefix = get_absl_log_prefix(record)
    return prefix + super(PythonFormatter, self).format(record)
1372998
def process_citation(citation_str: str) -> dict:
    """"""

    citation_obj = {}

    citation_list = convert_csv_str_to_list(citation_str)
    (citation_type, name, doc_id, pub_date, authors, comment, *extra) = (
        citation_list + [None] * 7
    )
    # print(f'citation_type: {citation_type}, name: {name}, doc_id: {doc_id}, pub_date: {pub_date}, authors: {authors}, comment: {comment}')

    authors_list = []
    if authors:
        authors_list = authors.split("|")
        citation_obj["authors"] = authors_list

    if name and re.match("http?://", name):
        citation_obj["uri"] = name

    elif citation_type and citation_type.upper() == "PUBMED":
        citation_obj["database"] = {"name": "PubMed", "id": doc_id}
        if name:
            citation_obj["reference"] = name
    elif name:
        citation_obj["reference"] = name

    else:
        citation_obj["reference"] = "No reference found"

    if pub_date:
        citation_obj["date_published"] = pub_date

    if comment:
        citation_obj["comment"] = comment

    return citation_obj
1079648
def format_author_line(author_names):
    """"""
    author_line = None
    if not author_names:
        return author_line
    if len(author_names) <= 2:
        author_line = ", ".join(author_names)
    elif len(author_names) > 2:
        author_line = author_names[0] + " et al."
    return author_line
1347571
def format(self, record):
        
        formatted = super(IndentingFormatter, self).format(record)
        prefix = ''
        if self.add_timestamp:
            prefix = self.formatTime(record, "%Y-%m-%dT%H:%M:%S ")
        prefix += " " * get_indentation()
        formatted = "".join([
            prefix + line
            for line in formatted.splitlines(True)
        ])
        return formatted
402376
def _citation_sort_key(t: EdgeTuple) -> str:
    """"""
    return '"{}", "{}"'.format(t[3][CITATION][CITATION_TYPE], t[3][CITATION][CITATION_REFERENCE])
433979
def first_name_capture(records):
    
    logging.info('Applying _first_name_capture generator: '
                 'making sure ID only contains the first whitespace-delimited '
                 'word.')
    whitespace = re.compile(r'\s+')
    for record in records:
        if whitespace.search(record.description):
            yield SeqRecord(record.seq, id=record.id,
                            description="")
        else:
            yield record
1335219
function bibTex()
    {
        $bibtex = '';
        foreach ($this->data as $entry) {
            //Intro
            $bibtex .= '@' . strtolower($entry['entryType']) . ' { ' . $entry['cite'] . ",\n";
            //Other fields except author
            foreach ($entry as $key => $val) {
                if ($this->_options['wordWrapWidth'] > 0) {
                    $val = $this->_wordWrap($val);
                }
                if (!in_array($key, array('cite', 'entryType', 'author'))) {
                    $bibtex .= "\t" . $key . ' = {' . $this->_escape_tex($val) . "},\n";
                }
            }
            //Author
            $author = null;

            if (array_key_exists('author', $entry)) {
                if ($this->_options['extractAuthors']) {
                    $tmparray = array(); //In this array the authors are saved and the joind with an and
                    foreach ($entry['author'] as $authorentry) {
                        $tmparray[] = $this->_formatAuthor($authorentry);
                    }
                    $author = join(' and ', $tmparray);
                } else {
                    $author = $entry['author'];
                }

            } else {
                $author = '';
            }
            $bibtex .= "\tauthor = {" . $this->_escape_tex($author) . "}\n";
            $bibtex .= "}\n\n";
        }
        return $bibtex;
    }