Generate long description
482702
def get_readme():
    """"""
    pandoc = None
    for path in os.environ["PATH"].split(os.pathsep):
        path = path.strip('"')
        pandoc = os.path.join(path, 'pandoc')
        if os.path.isfile(pandoc) and os.access(pandoc, os.X_OK):
            break
        else:
            pandoc = None
    try:
        if pandoc:
            cmd = [pandoc, '-t', 'rst', 'README.md']
            long_description = os.popen(' '.join(cmd)).read()
        else:
            raise ValueError
    except BaseException:
        long_description = open("README.md").read()
    return long_description
734347
private static String[] determineDescription(CliDeclaredOptionSpec cliCommand, boolean fullDescription, int maxTextWidth) {
        final List<String> descriptions = formatOptionDescription(cliCommand, maxTextWidth);
        if (!fullDescription && descriptions.size() > 1) {
            return new String[] {getFirst(descriptions) + " (...more)"};
        } else {
            return descriptions.toArray(new String[]{});
        }
    }
1251562
def describe(cls) -> None:
        
        max_lengths = []
        for attr_name in cls.attr_names():
            attr_func = "%ss" % attr_name
            attr_list = list(map(str, getattr(cls, attr_func)())) + [attr_name]
            max_lengths.append(max(list(map(len, attr_list))))
        row_format = "{:>%d} | {:>%d} | {:>%d}" % tuple(max_lengths)
        headers = [attr_name.capitalize() for attr_name in cls.attr_names()]
        header_line = row_format.format(*headers)
        output = "Class: %s\n" % cls.__name__
        output += header_line + "\n"
        output += "-"*(len(header_line)) + "\n"
        for item in cls:
            format_list = [str(getattr(item, attr_name))
                           for attr_name in cls.attr_names()]
            output += row_format.format(*format_list) + "\n"
        print(output)
1216835
def process_description(description_fce):
    
    def inner(description):
        clear_description = \
            re.sub(r'\s+', ' ',  # multiple whitespaces
            # general URLs
            re.sub(r'\w+:\/{2}[\d\w-]+(\.[\d\w-]+)*(?:(?:\/[^\s/]*))*', '',
            # delimiters
            re.sub('(#|=|---|~|`)*', '',
            # very short lines, typically titles
            re.sub('((\r?\n)|^).{0,8}((\r?\n)|$)', '',
            # PyPI's version and downloads tags
            re.sub(
                '((\r*.. image::|:target:) https?|(:align:|:alt:))[^\n]*\n', '',
                description_fce(description))))))
        return ' '.join(textwrap.wrap(clear_description, 80))
    return inner
819116
def create_description(self, complib=None, complevel=None,
                           fletcher32=False, expectedrows=None):
        

        # provided expected rows if its passed
        if expectedrows is None:
            expectedrows = max(self.nrows_expected, 10000)

        d = dict(name='table', expectedrows=expectedrows)

        # description from the axes & values
        d['description'] = {a.cname: a.typ for a in self.axes}

        if complib:
            if complevel is None:
                complevel = self._complevel or 9
            filters = _tables().Filters(
                complevel=complevel, complib=complib,
                fletcher32=fletcher32 or self._fletcher32)
            d['filters'] = filters
        elif self._filters is not None:
            d['filters'] = self._filters

        return d
987511
def generate_headline_from_description(sender, instance, *args, **kwargs):
    '''
    
    '''
    lines = instance.description.split('\n')
    headline = truncatewords(lines[0], 20)
    if headline[:-3] == '...':
        headline = truncatechars(headline.replace(' ...', ''), 250)  # Just in case the words exceed char limit.
    else:
        headline = truncatechars(headline, 250)
    instance.headline = headline
663630
def short_description(self):
        
        if self.is_insertion:
            return "chr%s g.%d_%dins%s" % (
                self.contig,
                self.start,
                self.start + 1,
                self.alt)
        elif self.is_deletion:
            return "chr%s g.%d_%ddel%s" % (
                self.contig,
                self.start,
                self.end,
                self.ref)
        elif self.ref == self.alt:
            return "chr%s g.%d%s" % (self.contig, self.start, self.ref)
        else:
            # substitution
            return "chr%s g.%d%s>%s" % (
                self.contig,
                self.start,
                self.ref,
                self.alt)
507769
def get_long_description():
    
    here = path.abspath(path.dirname(__file__))
    with open(path.join(here, 'README.rst')) as readme:
        return readme.read()
    return None
222458
def descriptions(self):
        """"""
        descs = []
        for postag, form in zip(self.postags, self.forms):
            desc = VERB_TYPES.get(form, '')
            if len(desc) == 0:
                toks = form.split(' ')
                if len(toks) == 2:
                    plur_desc = PLURALITY.get(toks[0], None)
                    case_desc = CASES.get(toks[1], None)
                    toks = []
                    if plur_desc is not None:
                        toks.append(plur_desc)
                    if case_desc is not None:
                        toks.append(case_desc)
                    desc = ' '.join(toks)
            descs.append(desc)
        return descs
310824
def get_long_description():
    """"""
    try:
        fpath = os.path.join(os.path.dirname(__file__), "README.md")
        with io.open(fpath, encoding="utf-8") as f:
            readme = f.read()
            desc = readme.partition("<!-- start_ppi_description -->")[2]
            desc = desc.partition("<!-- stop_ppi_description -->")[0]
            return desc.strip()
    except IOError:
        return None
1312478
def read_long_description(readme_file):
    
    try:
        import pypandoc
    except (ImportError, OSError) as exception:
        print('No pypandoc or pandoc: %s' % (exception,))
        if sys.version_info.major == 3:
            handle = open(readme_file, encoding='utf-8')
        else:
            handle = open(readme_file)
        long_description = handle.read()
        handle.close()
        return long_description
    else:
        return pypandoc.convert(readme_file, 'rst')
1351232
def parse_readme():
    """"""
    # Get the long description from the relevant file
    here = os.path.abspath(os.path.dirname(__file__))
    readme_path = os.path.join(here, 'README.md')
    with codecs.open(readme_path, encoding='utf-8') as handle:
        long_description = handle.read()

    return long_description
987754
def get_long_description():
    """"""
    try:
        with open('README.md', 'r') as f:
            description = f.read()
    except OSError as e:
        if e.errno != errno.ENOENT:
            raise
        return None

    try:
        process = subprocess.Popen([
                'pandoc',
                '-f', 'markdown_github',
                '-t', 'rst',
            ],
            stdin=subprocess.PIPE,
            stdout=subprocess.PIPE,
            universal_newlines=True,
            )
    except OSError as e:
        if e.errno == errno.ENOENT:
            return None
        raise

    description, __ = process.communicate(input=description)
    if process.poll() is None:
        process.kill()
        raise Exception("pandoc did not terminate")
    if process.poll():
        raise Exception("pandoc terminated abnormally")

    return description
168545
@Restricted(NoExternalUse.class)
    public final String getLongDescription() {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        PrintStream ps = new PrintStream(out);

        printUsageSummary(ps);
        ps.close();
        return out.toString();
    }
235009
def CleanDescription(description):
    """"""
    if not isinstance(description, six.string_types):
        return description
    if six.PY3:
        # https://docs.python.org/3/reference/lexical_analysis.html#index-18
        description = description.replace('\\N', '\\\\N')
        description = description.replace('\\u', '\\\\u')
        description = description.replace('\\U', '\\\\U')
    description = ReplaceHomoglyphs(description)
    return description.replace('"""', '" " "')
935335
def get_description(self, description_type='Abstract'):
        """"""
        if 'descriptions' in self.xml:
            if isinstance(self.xml['descriptions']['description'], list):
                for description in self.xml['descriptions']['description']:
                    if description_type in description:
                        return description[description_type]
            elif isinstance(self.xml['descriptions']['description'], dict):
                description = self.xml['descriptions']['description']
                if description_type in description:
                    return description[description_type]
                elif len(description) == 1:
                    # return the only description
                    return description.values()[0]

        return None
254547
def format_help(self, description):
        
        for bold in ("``", "*"):
            parts = []
            if description is None:
                description = ""
            for i, s in enumerate(description.split(bold)):
                parts.append(s if i % 2 == 0 else "<b>%s</b>" % s)
            description = "".join(parts)
        description = urlize(description, autoescape=False)
        return mark_safe(description.replace("\n", "<br>"))