search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``igraph`.`Cover``

class documentation

`class Cover: (source)`

Known subclasses: `igraph.VertexCover`

Constructor: `Cover(clusters, n)`

View In Hierarchy

Class representing a cover of an arbitrary ordered set.

Covers are similar to clusterings, but each element of the set may belong to more than one cluster in a cover, and elements not belonging to any cluster are also allowed.

`Cover` instances provide a similar API as `Clustering` instances; for instance, iterating over a `Cover` will iterate over the clusters just like with a regular `Clustering` instance. However, they are not derived from each other or from a common superclass, and there might be functions that exist only in one of them or the other.

Clusters of an individual cover can be accessed by the `[]` operator:

    >>> cl = Cover([[0,1,2,3], [2,3,4], [0,1,6]])
    >>> cl[0]
    [0, 1, 2, 3]

The membership vector can be accessed by the `membership` property. Note that contrary to `Clustering` instances, the membership vector will contain lists that contain the cluster indices each item belongs to:

    >>> cl.membership
    [[0, 2], [0, 2], [0, 1], [0, 1], [1], [], [2]]

The number of clusters can be retrieved by the `len` function:

    >>> len(cl)
    3

You can iterate over the cover as if it were a regular list of clusters:

    >>> for cluster in cl:
    ...     print(" ".join(str(idx) for idx in cluster))
    ...
    0 1 2 3
    2 3 4
    0 1 6

If you need all the clusters at once as lists, you can simply convert the cover to a list:

    >>> cluster_list = list(cl)
    >>> print(cluster_list)
    [[0, 1, 2, 3], [2, 3, 4], [0, 1, 6]]

`Clustering` objects can readily be converted to `Cover` objects using the constructor:

    >>> clustering = Clustering([0, 0, 0, 0, 1, 1, 1, 2, 2, 2])
    >>> cover = Cover(clustering)
    >>> list(clustering) == list(cover)
    True

Method | `__getitem__` | Returns the cluster with the given index.
Method | `__init__` | Constructs a cover with the given clusters.
Method | `__iter__` | Iterates over the clusters in this cover.
Method | `__len__` | Returns the number of clusters in this cover.
Method | `__str__` | Returns a string representation of the cover.
Method | `size` | Returns the size of a given cluster.
Method | `size_histogram` | Returns the histogram of cluster sizes.
Method | `sizes` | Returns the size of given clusters.
Method | `summary` | Returns the summary of the cover.
Property | `membership` | Returns the membership vector of this cover.
Property | `n` | Returns the number of elements in the set covered by this cover.
Method | `_formatted_cluster_iterator` | Iterates over the clusters and formats them into a string to be presented in the summary.
Instance Variable | `_clusters` | Undocumented
Instance Variable | `_n` | Undocumented

def __getitem__(self, index): (source)

Returns the cluster with the given index.

def __init__(self, clusters, n=0): (source)
overridden in `igraph.VertexCover`

Constructs a cover with the given clusters.

Parameters
clusters | the clusters in this cover, as a list or iterable. Each cluster is specified by a list or tuple that contains the IDs of the items in this cluster. IDs start from zero.
n | the total number of elements in the set that is covered by this cover. If it is less than the number of unique elements found in all the clusters, we will simply use the number of unique elements, so it is safe to leave this at zero. You only have to specify this parameter if there are some elements that are covered by none of the clusters.

def __iter__(self): (source)

Iterates over the clusters in this cover.

def __len__(self): (source)

Returns the number of clusters in this cover.

def __str__(self): (source)

Returns a string representation of the cover.

def size(self, idx): (source)

Returns the size of a given cluster.

Parameters
idx | the cluster in which we are interested.

def size_histogram(self, bin_width=1): (source)

Returns the histogram of cluster sizes.

Parameters
bin_width | the bin width of the histogram
Returns
a `Histogram` object

def sizes(self, *args): (source)

Returns the size of given clusters.

The indices are given as positional arguments. If there are no positional arguments, the function will return the sizes of all clusters.

def summary(self, verbosity=0, width=None): (source)

Returns the summary of the cover.

The summary includes the number of items and clusters, and also the list of members for each of the clusters if the verbosity is nonzero.

Parameters
verbosity | determines whether the cluster members should be printed. Zero verbosity prints the number of items and clusters only.
width | Undocumented
Returns
the summary of the cover as a string.

@property
membership = (source)

Returns the membership vector of this cover.

The membership vector of a cover covering n elements is a list of length n, where element i contains the cluster indices of the ith item.

@property
n = (source)

Returns the number of elements in the set covered by this cover.

def _formatted_cluster_iterator(self): (source)
overridden in `igraph.VertexCover`

Iterates over the clusters and formats them into a string to be presented in the summary.

_clusters = (source)

Undocumented

_n = (source)

Undocumented