repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_documentation_string stringlengths 1 47.2k | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|
ambitioninc/newrelic-api | newrelic_api/alert_policies.py | AlertPolicies.create | def create(self, name, incident_preference):
"""
This API endpoint allows you to create an alert policy
:type name: str
:param name: The name of the policy
:type incident_preference: str
:param incident_preference: Can be PER_POLICY, PER_CONDITION or
PER_CON... | python | def create(self, name, incident_preference):
"""
This API endpoint allows you to create an alert policy
:type name: str
:param name: The name of the policy
:type incident_preference: str
:param incident_preference: Can be PER_POLICY, PER_CONDITION or
PER_CON... | This API endpoint allows you to create an alert policy
:type name: str
:param name: The name of the policy
:type incident_preference: str
:param incident_preference: Can be PER_POLICY, PER_CONDITION or
PER_CONDITION_AND_TARGET
:rtype: dict
:return: The JSON... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/alert_policies.py#L49-L88 |
ambitioninc/newrelic-api | newrelic_api/alert_policies.py | AlertPolicies.update | def update(self, id, name, incident_preference):
"""
This API endpoint allows you to update an alert policy
:type id: integer
:param id: The id of the policy
:type name: str
:param name: The name of the policy
:type incident_preference: str
:param incid... | python | def update(self, id, name, incident_preference):
"""
This API endpoint allows you to update an alert policy
:type id: integer
:param id: The id of the policy
:type name: str
:param name: The name of the policy
:type incident_preference: str
:param incid... | This API endpoint allows you to update an alert policy
:type id: integer
:param id: The id of the policy
:type name: str
:param name: The name of the policy
:type incident_preference: str
:param incident_preference: Can be PER_POLICY, PER_CONDITION or
PER_C... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/alert_policies.py#L90-L132 |
ambitioninc/newrelic-api | newrelic_api/alert_policies.py | AlertPolicies.delete | def delete(self, id):
"""
This API endpoint allows you to delete an alert policy
:type id: integer
:param id: The id of the policy
:rtype: dict
:return: The JSON response of the API
::
{
"policy": {
"created_at":... | python | def delete(self, id):
"""
This API endpoint allows you to delete an alert policy
:type id: integer
:param id: The id of the policy
:rtype: dict
:return: The JSON response of the API
::
{
"policy": {
"created_at":... | This API endpoint allows you to delete an alert policy
:type id: integer
:param id: The id of the policy
:rtype: dict
:return: The JSON response of the API
::
{
"policy": {
"created_at": "time",
"id": "intege... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/alert_policies.py#L134-L161 |
ambitioninc/newrelic-api | newrelic_api/alert_policies.py | AlertPolicies.associate_with_notification_channel | def associate_with_notification_channel(self, id, channel_id):
"""
This API endpoint allows you to associate an alert policy with an
notification channel
:type id: integer
:param id: The id of the policy
:type channel_id: integer
:param channel_id: The id of... | python | def associate_with_notification_channel(self, id, channel_id):
"""
This API endpoint allows you to associate an alert policy with an
notification channel
:type id: integer
:param id: The id of the policy
:type channel_id: integer
:param channel_id: The id of... | This API endpoint allows you to associate an alert policy with an
notification channel
:type id: integer
:param id: The id of the policy
:type channel_id: integer
:param channel_id: The id of the notification channel
:rtype: dict
:return: The JSON response ... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/alert_policies.py#L163-L195 |
ambitioninc/newrelic-api | newrelic_api/alert_policies.py | AlertPolicies.dissociate_from_notification_channel | def dissociate_from_notification_channel(self, id, channel_id):
"""
This API endpoint allows you to dissociate an alert policy from an
notification channel
:type id: integer
:param id: The id of the policy
:type channel_id: integer
:param channel_id: The id ... | python | def dissociate_from_notification_channel(self, id, channel_id):
"""
This API endpoint allows you to dissociate an alert policy from an
notification channel
:type id: integer
:param id: The id of the policy
:type channel_id: integer
:param channel_id: The id ... | This API endpoint allows you to dissociate an alert policy from an
notification channel
:type id: integer
:param id: The id of the policy
:type channel_id: integer
:param channel_id: The id of the notification channel
:rtype: dict
:return: The JSON response... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/alert_policies.py#L197-L234 |
ambitioninc/newrelic-api | newrelic_api/alert_conditions.py | AlertConditions.list | def list(self, policy_id, page=None):
"""
This API endpoint returns a paginated list of alert conditions associated with the
given policy_id.
This API endpoint returns a paginated list of the alert conditions
associated with your New Relic account. Alert conditions can be filter... | python | def list(self, policy_id, page=None):
"""
This API endpoint returns a paginated list of alert conditions associated with the
given policy_id.
This API endpoint returns a paginated list of the alert conditions
associated with your New Relic account. Alert conditions can be filter... | This API endpoint returns a paginated list of alert conditions associated with the
given policy_id.
This API endpoint returns a paginated list of the alert conditions
associated with your New Relic account. Alert conditions can be filtered
by their name, list of IDs, type (application, ... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/alert_conditions.py#L9-L72 |
ambitioninc/newrelic-api | newrelic_api/alert_conditions.py | AlertConditions.update | def update(
self, alert_condition_id, policy_id,
type=None,
condition_scope=None,
name=None,
entities=None,
metric=None,
runbook_url=None,
terms=None,
user_defined=None,
enabled=None):
"""
... | python | def update(
self, alert_condition_id, policy_id,
type=None,
condition_scope=None,
name=None,
entities=None,
metric=None,
runbook_url=None,
terms=None,
user_defined=None,
enabled=None):
"""
... | Updates any of the optional parameters of the alert condition
:type alert_condition_id: int
:param alert_condition_id: Alerts condition id to update
:type policy_id: int
:param policy_id: Alert policy id where target alert condition belongs to
:type type: str
:param ty... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/alert_conditions.py#L74-L207 |
ambitioninc/newrelic-api | newrelic_api/alert_conditions.py | AlertConditions.create | def create(
self, policy_id,
type,
condition_scope,
name,
entities,
metric,
terms,
runbook_url=None,
user_defined=None,
enabled=True):
"""
Creates an alert condition
:type pol... | python | def create(
self, policy_id,
type,
condition_scope,
name,
entities,
metric,
terms,
runbook_url=None,
user_defined=None,
enabled=True):
"""
Creates an alert condition
:type pol... | Creates an alert condition
:type policy_id: int
:param policy_id: Alert policy id where target alert condition belongs to
:type type: str
:param type: The type of the condition, can be apm_app_metric,
apm_kt_metric, servers_metric, browser_metric, mobile_metric
:ty... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/alert_conditions.py#L209-L315 |
ambitioninc/newrelic-api | newrelic_api/alert_conditions.py | AlertConditions.delete | def delete(self, alert_condition_id):
"""
This API endpoint allows you to delete an alert condition
:type alert_condition_id: integer
:param alert_condition_id: Alert Condition ID
:rtype: dict
:return: The JSON response of the API
::
{
... | python | def delete(self, alert_condition_id):
"""
This API endpoint allows you to delete an alert condition
:type alert_condition_id: integer
:param alert_condition_id: Alert Condition ID
:rtype: dict
:return: The JSON response of the API
::
{
... | This API endpoint allows you to delete an alert condition
:type alert_condition_id: integer
:param alert_condition_id: Alert Condition ID
:rtype: dict
:return: The JSON response of the API
::
{
"condition": {
"id": "integer",
... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/alert_conditions.py#L317-L362 |
ambitioninc/newrelic-api | newrelic_api/key_transactions.py | KeyTransactions.show | def show(self, id):
"""
This API endpoint returns a single Key transaction, identified its ID.
:type id: int
:param id: Key transaction ID
:rtype: dict
:return: The JSON response of the API
::
{
"key_transaction": {
... | python | def show(self, id):
"""
This API endpoint returns a single Key transaction, identified its ID.
:type id: int
:param id: Key transaction ID
:rtype: dict
:return: The JSON response of the API
::
{
"key_transaction": {
... | This API endpoint returns a single Key transaction, identified its ID.
:type id: int
:param id: Key transaction ID
:rtype: dict
:return: The JSON response of the API
::
{
"key_transaction": {
"id": "integer",
... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/key_transactions.py#L78-L121 |
ambitioninc/newrelic-api | newrelic_api/alert_conditions_infra.py | AlertConditionsInfra.list | def list(self, policy_id, limit=None, offset=None):
"""
This API endpoint returns a paginated list of alert conditions for infrastucture
metrics associated with the given policy_id.
:type policy_id: int
:param policy_id: Alert policy id
:type limit: string
:para... | python | def list(self, policy_id, limit=None, offset=None):
"""
This API endpoint returns a paginated list of alert conditions for infrastucture
metrics associated with the given policy_id.
:type policy_id: int
:param policy_id: Alert policy id
:type limit: string
:para... | This API endpoint returns a paginated list of alert conditions for infrastucture
metrics associated with the given policy_id.
:type policy_id: int
:param policy_id: Alert policy id
:type limit: string
:param limit: Max amount of results to return
:type offset: string
... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/alert_conditions_infra.py#L13-L69 |
ambitioninc/newrelic-api | newrelic_api/alert_conditions_infra.py | AlertConditionsInfra.show | def show(self, alert_condition_infra_id):
"""
This API endpoint returns an alert condition for infrastucture, identified by its
ID.
:type alert_condition_infra_id: int
:param alert_condition_infra_id: Alert Condition Infra ID
:rtype: dict
:return: The JSON respo... | python | def show(self, alert_condition_infra_id):
"""
This API endpoint returns an alert condition for infrastucture, identified by its
ID.
:type alert_condition_infra_id: int
:param alert_condition_infra_id: Alert Condition Infra ID
:rtype: dict
:return: The JSON respo... | This API endpoint returns an alert condition for infrastucture, identified by its
ID.
:type alert_condition_infra_id: int
:param alert_condition_infra_id: Alert Condition Infra ID
:rtype: dict
:return: The JSON response of the API
::
{
"dat... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/alert_conditions_infra.py#L71-L106 |
ambitioninc/newrelic-api | newrelic_api/alert_conditions_infra.py | AlertConditionsInfra.create | def create(self, policy_id, name, condition_type, alert_condition_configuration, enabled=True):
"""
This API endpoint allows you to create an alert condition for infrastucture
:type policy_id: int
:param policy_id: Alert policy id
:type name: str
:param name: The name o... | python | def create(self, policy_id, name, condition_type, alert_condition_configuration, enabled=True):
"""
This API endpoint allows you to create an alert condition for infrastucture
:type policy_id: int
:param policy_id: Alert policy id
:type name: str
:param name: The name o... | This API endpoint allows you to create an alert condition for infrastucture
:type policy_id: int
:param policy_id: Alert policy id
:type name: str
:param name: The name of the alert condition
:type condition_type: str
:param condition_type: The type of the alert condit... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/alert_conditions_infra.py#L108-L166 |
ambitioninc/newrelic-api | newrelic_api/alert_conditions_infra.py | AlertConditionsInfra.update | def update(self, alert_condition_infra_id, policy_id,
name, condition_type, alert_condition_configuration, enabled=True):
"""
This API endpoint allows you to update an alert condition for infrastucture
:type alert_condition_infra_id: int
:param alert_condition_infra_id: A... | python | def update(self, alert_condition_infra_id, policy_id,
name, condition_type, alert_condition_configuration, enabled=True):
"""
This API endpoint allows you to update an alert condition for infrastucture
:type alert_condition_infra_id: int
:param alert_condition_infra_id: A... | This API endpoint allows you to update an alert condition for infrastucture
:type alert_condition_infra_id: int
:param alert_condition_infra_id: Alert Condition Infra ID
:type policy_id: int
:param policy_id: Alert policy id
:type name: str
:param name: The name of the... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/alert_conditions_infra.py#L168-L230 |
ambitioninc/newrelic-api | newrelic_api/alert_conditions_infra.py | AlertConditionsInfra.delete | def delete(self, alert_condition_infra_id):
"""
This API endpoint allows you to delete an alert condition for infrastucture
:type alert_condition_infra_id: integer
:param alert_condition_infra_id: Alert Condition Infra ID
:rtype: dict
:return: The JSON response of the A... | python | def delete(self, alert_condition_infra_id):
"""
This API endpoint allows you to delete an alert condition for infrastucture
:type alert_condition_infra_id: integer
:param alert_condition_infra_id: Alert Condition Infra ID
:rtype: dict
:return: The JSON response of the A... | This API endpoint allows you to delete an alert condition for infrastucture
:type alert_condition_infra_id: integer
:param alert_condition_infra_id: Alert Condition Infra ID
:rtype: dict
:return: The JSON response of the API
::
{} | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/alert_conditions_infra.py#L232-L251 |
ambitioninc/newrelic-api | newrelic_api/labels.py | Labels.create | def create(self, name, category, applications=None, servers=None):
"""
This API endpoint will create a new label with the provided name and
category
:type name: str
:param name: The name of the label
:type category: str
:param category: The Category
:ty... | python | def create(self, name, category, applications=None, servers=None):
"""
This API endpoint will create a new label with the provided name and
category
:type name: str
:param name: The name of the label
:type category: str
:param category: The Category
:ty... | This API endpoint will create a new label with the provided name and
category
:type name: str
:param name: The name of the label
:type category: str
:param category: The Category
:type applications: list of int
:param applications: An optional list of applicati... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/labels.py#L62-L117 |
ambitioninc/newrelic-api | newrelic_api/labels.py | Labels.delete | def delete(self, key):
"""
When applications are provided, this endpoint will remove those
applications from the label.
When no applications are provided, this endpoint will remove the label.
:type key: str
:param key: Label key. Example: 'Language:Java'
:rtype... | python | def delete(self, key):
"""
When applications are provided, this endpoint will remove those
applications from the label.
When no applications are provided, this endpoint will remove the label.
:type key: str
:param key: Label key. Example: 'Language:Java'
:rtype... | When applications are provided, this endpoint will remove those
applications from the label.
When no applications are provided, this endpoint will remove the label.
:type key: str
:param key: Label key. Example: 'Language:Java'
:rtype: dict
:return: The JSON response o... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/labels.py#L119-L156 |
ambitioninc/newrelic-api | newrelic_api/plugins.py | Plugins.list | def list(self, filter_guid=None, filter_ids=None, detailed=None, page=None):
"""
This API endpoint returns a paginated list of the plugins associated
with your New Relic account.
Plugins can be filtered by their name or by a list of IDs.
:type filter_guid: str
:param fi... | python | def list(self, filter_guid=None, filter_ids=None, detailed=None, page=None):
"""
This API endpoint returns a paginated list of the plugins associated
with your New Relic account.
Plugins can be filtered by their name or by a list of IDs.
:type filter_guid: str
:param fi... | This API endpoint returns a paginated list of the plugins associated
with your New Relic account.
Plugins can be filtered by their name or by a list of IDs.
:type filter_guid: str
:param filter_guid: Filter by name
:type filter_ids: list of ints
:param filter_ids: Filt... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/plugins.py#L8-L100 |
ambitioninc/newrelic-api | newrelic_api/plugins.py | Plugins.show | def show(self, id, detailed=None):
"""
This API endpoint returns a single Key transaction, identified its ID.
:type id: int
:param id: Key transaction ID
:type detailed: bool
:param detailed:
:rtype: dict
:return: The JSON response of the API
:... | python | def show(self, id, detailed=None):
"""
This API endpoint returns a single Key transaction, identified its ID.
:type id: int
:param id: Key transaction ID
:type detailed: bool
:param detailed:
:rtype: dict
:return: The JSON response of the API
:... | This API endpoint returns a single Key transaction, identified its ID.
:type id: int
:param id: Key transaction ID
:type detailed: bool
:param detailed:
:rtype: dict
:return: The JSON response of the API
::
{
"plugin": {
... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/plugins.py#L102-L171 |
ambitioninc/newrelic-api | newrelic_api/application_instances.py | ApplicationInstances.list | def list(
self, application_id, filter_hostname=None, filter_ids=None,
page=None):
"""
This API endpoint returns a paginated list of instances associated with the
given application.
Application instances can be filtered by hostname, or the list of
applica... | python | def list(
self, application_id, filter_hostname=None, filter_ids=None,
page=None):
"""
This API endpoint returns a paginated list of instances associated with the
given application.
Application instances can be filtered by hostname, or the list of
applica... | This API endpoint returns a paginated list of instances associated with the
given application.
Application instances can be filtered by hostname, or the list of
application instance IDs.
:type application_id: int
:param application_id: Application ID
:type filter_hostn... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/application_instances.py#L8-L88 |
ambitioninc/newrelic-api | newrelic_api/application_hosts.py | ApplicationHosts.show | def show(self, application_id, host_id):
"""
This API endpoint returns a single application host, identified by its
ID.
:type application_id: int
:param application_id: Application ID
:type host_id: int
:param host_id: Application host ID
:rtype: dict
... | python | def show(self, application_id, host_id):
"""
This API endpoint returns a single application host, identified by its
ID.
:type application_id: int
:param application_id: Application ID
:type host_id: int
:param host_id: Application host ID
:rtype: dict
... | This API endpoint returns a single application host, identified by its
ID.
:type application_id: int
:param application_id: Application ID
:type host_id: int
:param host_id: Application host ID
:rtype: dict
:return: The JSON response of the API
::
... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/application_hosts.py#L91-L143 |
ambitioninc/newrelic-api | newrelic_api/application_hosts.py | ApplicationHosts.metric_names | def metric_names(self, application_id, host_id, name=None, page=None):
"""
Return a list of known metrics and their value names for the given resource.
:type application_id: int
:param application_id: Application ID
:type host_id: int
:param host_id: Application Host ID... | python | def metric_names(self, application_id, host_id, name=None, page=None):
"""
Return a list of known metrics and their value names for the given resource.
:type application_id: int
:param application_id: Application ID
:type host_id: int
:param host_id: Application Host ID... | Return a list of known metrics and their value names for the given resource.
:type application_id: int
:param application_id: Application ID
:type host_id: int
:param host_id: Application Host ID
:type name: str
:param name: Filter metrics by name
:type page: ... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/application_hosts.py#L145-L203 |
ambitioninc/newrelic-api | newrelic_api/components.py | Components.metric_data | def metric_data(
self, id, names, values=None, from_dt=None, to_dt=None,
summarize=False):
"""
This API endpoint returns a list of values for each of the requested
metrics. The list of available metrics can be returned using the Metric
Name API endpoint.
... | python | def metric_data(
self, id, names, values=None, from_dt=None, to_dt=None,
summarize=False):
"""
This API endpoint returns a list of values for each of the requested
metrics. The list of available metrics can be returned using the Metric
Name API endpoint.
... | This API endpoint returns a list of values for each of the requested
metrics. The list of available metrics can be returned using the Metric
Name API endpoint.
Metric data can be filtered by a number of parameters, including
multiple names and values, and by time range. Metric names and... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/components.py#L176-L251 |
ambitioninc/newrelic-api | newrelic_api/base.py | Resource._get | def _get(self, *args, **kwargs):
"""
A wrapper for getting things
:returns: The response of your get
:rtype: dict
:raises: This will raise a
:class:`NewRelicAPIServerException<newrelic_api.exceptions.NewRelicAPIServerException>`
if there is an error from... | python | def _get(self, *args, **kwargs):
"""
A wrapper for getting things
:returns: The response of your get
:rtype: dict
:raises: This will raise a
:class:`NewRelicAPIServerException<newrelic_api.exceptions.NewRelicAPIServerException>`
if there is an error from... | A wrapper for getting things
:returns: The response of your get
:rtype: dict
:raises: This will raise a
:class:`NewRelicAPIServerException<newrelic_api.exceptions.NewRelicAPIServerException>`
if there is an error from New Relic | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/base.py#L34-L54 |
ambitioninc/newrelic-api | newrelic_api/base.py | Resource._put | def _put(self, *args, **kwargs):
"""
A wrapper for putting things. It will also json encode your 'data' parameter
:returns: The response of your put
:rtype: dict
:raises: This will raise a
:class:`NewRelicAPIServerException<newrelic_api.exceptions.NewRelicAPIServerE... | python | def _put(self, *args, **kwargs):
"""
A wrapper for putting things. It will also json encode your 'data' parameter
:returns: The response of your put
:rtype: dict
:raises: This will raise a
:class:`NewRelicAPIServerException<newrelic_api.exceptions.NewRelicAPIServerE... | A wrapper for putting things. It will also json encode your 'data' parameter
:returns: The response of your put
:rtype: dict
:raises: This will raise a
:class:`NewRelicAPIServerException<newrelic_api.exceptions.NewRelicAPIServerException>`
if there is an error from New ... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/base.py#L56-L73 |
ambitioninc/newrelic-api | newrelic_api/base.py | Resource._post | def _post(self, *args, **kwargs):
"""
A wrapper for posting things. It will also json encode your 'data' parameter
:returns: The response of your post
:rtype: dict
:raises: This will raise a
:class:`NewRelicAPIServerException<newrelic_api.exceptions.NewRelicAPIServe... | python | def _post(self, *args, **kwargs):
"""
A wrapper for posting things. It will also json encode your 'data' parameter
:returns: The response of your post
:rtype: dict
:raises: This will raise a
:class:`NewRelicAPIServerException<newrelic_api.exceptions.NewRelicAPIServe... | A wrapper for posting things. It will also json encode your 'data' parameter
:returns: The response of your post
:rtype: dict
:raises: This will raise a
:class:`NewRelicAPIServerException<newrelic_api.exceptions.NewRelicAPIServerException>`
if there is an error from New... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/base.py#L75-L92 |
ambitioninc/newrelic-api | newrelic_api/base.py | Resource._delete | def _delete(self, *args, **kwargs):
"""
A wrapper for deleting things
:returns: The response of your delete
:rtype: dict
:raises: This will raise a
:class:`NewRelicAPIServerException<newrelic_api.exceptions.NewRelicAPIServerException>`
if there is an err... | python | def _delete(self, *args, **kwargs):
"""
A wrapper for deleting things
:returns: The response of your delete
:rtype: dict
:raises: This will raise a
:class:`NewRelicAPIServerException<newrelic_api.exceptions.NewRelicAPIServerException>`
if there is an err... | A wrapper for deleting things
:returns: The response of your delete
:rtype: dict
:raises: This will raise a
:class:`NewRelicAPIServerException<newrelic_api.exceptions.NewRelicAPIServerException>`
if there is an error from New Relic | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/base.py#L94-L112 |
ambitioninc/newrelic-api | newrelic_api/dashboards.py | Dashboards.list | def list(self, filter_title=None, filter_ids=None, page=None):
"""
:type filter_title: str
:param filter_title: Filter by dashboard title
:type filter_ids: list of ints
:param filter_ids: Filter by dashboard ids
:type page: int
:param page: Pagination index
... | python | def list(self, filter_title=None, filter_ids=None, page=None):
"""
:type filter_title: str
:param filter_title: Filter by dashboard title
:type filter_ids: list of ints
:param filter_ids: Filter by dashboard ids
:type page: int
:param page: Pagination index
... | :type filter_title: str
:param filter_title: Filter by dashboard title
:type filter_ids: list of ints
:param filter_ids: Filter by dashboard ids
:type page: int
:param page: Pagination index
:rtype: dict
:return: The JSON response of the API, with an additional... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/dashboards.py#L8-L66 |
ambitioninc/newrelic-api | newrelic_api/dashboards.py | Dashboards.create | def create(self, dashboard_data):
"""
This API endpoint creates a dashboard and all defined widgets.
:type dashboard: dict
:param dashboard: Dashboard Dictionary
:rtype dict
:return: The JSON response of the API
::
{
"dashboard": {
... | python | def create(self, dashboard_data):
"""
This API endpoint creates a dashboard and all defined widgets.
:type dashboard: dict
:param dashboard: Dashboard Dictionary
:rtype dict
:return: The JSON response of the API
::
{
"dashboard": {
... | This API endpoint creates a dashboard and all defined widgets.
:type dashboard: dict
:param dashboard: Dashboard Dictionary
:rtype dict
:return: The JSON response of the API
::
{
"dashboard": {
"id": "integer",
... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/dashboards.py#L151-L209 |
ambitioninc/newrelic-api | newrelic_api/dashboards.py | Dashboards.update | def update(self, id, dashboard_data):
"""
This API endpoint updates a dashboard and all defined widgets.
:type id: int
:param id: Dashboard ID
:type dashboard: dict
:param dashboard: Dashboard Dictionary
:rtype dict
:return: The JSON response of the API... | python | def update(self, id, dashboard_data):
"""
This API endpoint updates a dashboard and all defined widgets.
:type id: int
:param id: Dashboard ID
:type dashboard: dict
:param dashboard: Dashboard Dictionary
:rtype dict
:return: The JSON response of the API... | This API endpoint updates a dashboard and all defined widgets.
:type id: int
:param id: Dashboard ID
:type dashboard: dict
:param dashboard: Dashboard Dictionary
:rtype dict
:return: The JSON response of the API
::
{
"dashboard": {
... | https://github.com/ambitioninc/newrelic-api/blob/07b4430aa6ae61e4704e2928a6e7a24c76f0f424/newrelic_api/dashboards.py#L211-L272 |
borntyping/python-dice | dice/grammar.py | operatorPrecedence | def operatorPrecedence(base, operators):
"""
This re-implements pyparsing's operatorPrecedence function.
It gets rid of a few annoying bugs, like always putting operators inside
a Group, and matching the whole grammar with Forward first (there may
actually be a reason for that, but I couldn't find ... | python | def operatorPrecedence(base, operators):
"""
This re-implements pyparsing's operatorPrecedence function.
It gets rid of a few annoying bugs, like always putting operators inside
a Group, and matching the whole grammar with Forward first (there may
actually be a reason for that, but I couldn't find ... | This re-implements pyparsing's operatorPrecedence function.
It gets rid of a few annoying bugs, like always putting operators inside
a Group, and matching the whole grammar with Forward first (there may
actually be a reason for that, but I couldn't find it). It doesn't
support trinary expressions, but ... | https://github.com/borntyping/python-dice/blob/88398c77534ebec19f1f18478e475d0b7a5bc717/dice/grammar.py#L25-L83 |
borntyping/python-dice | dice/utilities.py | addevensubodd | def addevensubodd(operator, operand):
"""Add even numbers, subtract odd ones. See http://1w6.org/w6 """
try:
for i, x in enumerate(operand):
if x % 2:
operand[i] = -x
return operand
except TypeError:
if operand % 2:
return -operand
retu... | python | def addevensubodd(operator, operand):
"""Add even numbers, subtract odd ones. See http://1w6.org/w6 """
try:
for i, x in enumerate(operand):
if x % 2:
operand[i] = -x
return operand
except TypeError:
if operand % 2:
return -operand
retu... | Add even numbers, subtract odd ones. See http://1w6.org/w6 | https://github.com/borntyping/python-dice/blob/88398c77534ebec19f1f18478e475d0b7a5bc717/dice/utilities.py#L60-L70 |
borntyping/python-dice | dice/command.py | main | def main(argv=None):
"""Run roll() from a command line interface"""
args = docopt.docopt(__doc__, argv=argv, version=__version__)
verbose = bool(args['--verbose'])
f_roll = dice.roll
kwargs = {}
if args['--min']:
f_roll = dice.roll_min
elif args['--max']:
f_roll = dice.roll... | python | def main(argv=None):
"""Run roll() from a command line interface"""
args = docopt.docopt(__doc__, argv=argv, version=__version__)
verbose = bool(args['--verbose'])
f_roll = dice.roll
kwargs = {}
if args['--min']:
f_roll = dice.roll_min
elif args['--max']:
f_roll = dice.roll... | Run roll() from a command line interface | https://github.com/borntyping/python-dice/blob/88398c77534ebec19f1f18478e475d0b7a5bc717/dice/command.py#L24-L60 |
borntyping/python-dice | dice/elements.py | Element.set_parse_attributes | def set_parse_attributes(self, string, location, tokens):
"Fluent API for setting parsed location"
self.string = string
self.location = location
self.tokens = tokens
return self | python | def set_parse_attributes(self, string, location, tokens):
"Fluent API for setting parsed location"
self.string = string
self.location = location
self.tokens = tokens
return self | Fluent API for setting parsed location | https://github.com/borntyping/python-dice/blob/88398c77534ebec19f1f18478e475d0b7a5bc717/dice/elements.py#L26-L31 |
borntyping/python-dice | dice/elements.py | Element.evaluate_object | def evaluate_object(obj, cls=None, cache=False, **kwargs):
"""Evaluates elements, and coerces objects to a class if needed"""
old_obj = obj
if isinstance(obj, Element):
if cache:
obj = obj.evaluate_cached(**kwargs)
else:
obj = obj.evaluate(... | python | def evaluate_object(obj, cls=None, cache=False, **kwargs):
"""Evaluates elements, and coerces objects to a class if needed"""
old_obj = obj
if isinstance(obj, Element):
if cache:
obj = obj.evaluate_cached(**kwargs)
else:
obj = obj.evaluate(... | Evaluates elements, and coerces objects to a class if needed | https://github.com/borntyping/python-dice/blob/88398c77534ebec19f1f18478e475d0b7a5bc717/dice/elements.py#L44-L60 |
borntyping/python-dice | dice/elements.py | Element.evaluate_cached | def evaluate_cached(self, **kwargs):
"""Wraps evaluate(), caching results"""
if not hasattr(self, 'result'):
self.result = self.evaluate(cache=True, **kwargs)
return self.result | python | def evaluate_cached(self, **kwargs):
"""Wraps evaluate(), caching results"""
if not hasattr(self, 'result'):
self.result = self.evaluate(cache=True, **kwargs)
return self.result | Wraps evaluate(), caching results | https://github.com/borntyping/python-dice/blob/88398c77534ebec19f1f18478e475d0b7a5bc717/dice/elements.py#L62-L67 |
networks-lab/metaknowledge | metaknowledge/graphHelpers.py | readGraph | def readGraph(edgeList, nodeList = None, directed = False, idKey = 'ID', eSource = 'From', eDest = 'To'):
"""Reads the files given by _edgeList_ and _nodeList_ and creates a networkx graph for the files.
This is designed only for the files produced by metaknowledge and is meant to be the reverse of [writeGraph... | python | def readGraph(edgeList, nodeList = None, directed = False, idKey = 'ID', eSource = 'From', eDest = 'To'):
"""Reads the files given by _edgeList_ and _nodeList_ and creates a networkx graph for the files.
This is designed only for the files produced by metaknowledge and is meant to be the reverse of [writeGraph... | Reads the files given by _edgeList_ and _nodeList_ and creates a networkx graph for the files.
This is designed only for the files produced by metaknowledge and is meant to be the reverse of [writeGraph()](#metaknowledge.graphHelpers.writeGraph), if this does not produce the desired results the networkx builtin [n... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/graphHelpers.py#L11-L94 |
networks-lab/metaknowledge | metaknowledge/graphHelpers.py | writeGraph | def writeGraph(grph, name, edgeInfo = True, typing = False, suffix = 'csv', overwrite = True, allSameAttribute = False):
"""Writes both the edge list and the node attribute list of _grph_ to files starting with _name_.
The output files start with _name_, the file type (edgeList, nodeAttributes) then if typing ... | python | def writeGraph(grph, name, edgeInfo = True, typing = False, suffix = 'csv', overwrite = True, allSameAttribute = False):
"""Writes both the edge list and the node attribute list of _grph_ to files starting with _name_.
The output files start with _name_, the file type (edgeList, nodeAttributes) then if typing ... | Writes both the edge list and the node attribute list of _grph_ to files starting with _name_.
The output files start with _name_, the file type (edgeList, nodeAttributes) then if typing is True the type of graph (directed or undirected) then the suffix, the default is as follows:
>> name_fileType.suffix
... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/graphHelpers.py#L96-L170 |
networks-lab/metaknowledge | metaknowledge/graphHelpers.py | writeEdgeList | def writeEdgeList(grph, name, extraInfo = True, allSameAttribute = False, _progBar = None):
"""Writes an edge list of _grph_ at the destination _name_.
The edge list has two columns for the source and destination of the edge, `'From'` and `'To'` respectively, then, if _edgeInfo_ is `True`, for each attribute o... | python | def writeEdgeList(grph, name, extraInfo = True, allSameAttribute = False, _progBar = None):
"""Writes an edge list of _grph_ at the destination _name_.
The edge list has two columns for the source and destination of the edge, `'From'` and `'To'` respectively, then, if _edgeInfo_ is `True`, for each attribute o... | Writes an edge list of _grph_ at the destination _name_.
The edge list has two columns for the source and destination of the edge, `'From'` and `'To'` respectively, then, if _edgeInfo_ is `True`, for each attribute of the node another column is created.
**Note**: If any edges are missing an attribute it will ... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/graphHelpers.py#L172-L267 |
networks-lab/metaknowledge | metaknowledge/graphHelpers.py | writeNodeAttributeFile | def writeNodeAttributeFile(grph, name, allSameAttribute = False, _progBar = None):
"""Writes a node attribute list of _grph_ to the file given by the path _name_.
The node list has one column call `'ID'` with the node ids used by networkx and all other columns are the node attributes.
**Note**: If any nod... | python | def writeNodeAttributeFile(grph, name, allSameAttribute = False, _progBar = None):
"""Writes a node attribute list of _grph_ to the file given by the path _name_.
The node list has one column call `'ID'` with the node ids used by networkx and all other columns are the node attributes.
**Note**: If any nod... | Writes a node attribute list of _grph_ to the file given by the path _name_.
The node list has one column call `'ID'` with the node ids used by networkx and all other columns are the node attributes.
**Note**: If any nodes are missing an attribute it will be left blank by default, enable _allSameAttribute_ to... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/graphHelpers.py#L269-L342 |
networks-lab/metaknowledge | metaknowledge/graphHelpers.py | writeTnetFile | def writeTnetFile(grph, name, modeNameString, weighted = False, sourceMode = None, timeString = None, nodeIndexString = 'tnet-ID', weightString = 'weight'):
"""Writes an edge list designed for reading by the _R_ package [tnet](https://toreopsahl.com/tnet/).
The _networkx_ graph provided must be a pure two-mode... | python | def writeTnetFile(grph, name, modeNameString, weighted = False, sourceMode = None, timeString = None, nodeIndexString = 'tnet-ID', weightString = 'weight'):
"""Writes an edge list designed for reading by the _R_ package [tnet](https://toreopsahl.com/tnet/).
The _networkx_ graph provided must be a pure two-mode... | Writes an edge list designed for reading by the _R_ package [tnet](https://toreopsahl.com/tnet/).
The _networkx_ graph provided must be a pure two-mode network, the modes must be 2 different values for the node attribute accessed by _modeNameString_ and all edges must be between different node types. Each node wil... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/graphHelpers.py#L344-L445 |
networks-lab/metaknowledge | metaknowledge/graphHelpers.py | getWeight | def getWeight(grph, nd1, nd2, weightString = "weight", returnType = int):
"""
A way of getting the weight of an edge with or without weight as a parameter
returns a the value of the weight parameter converted to returnType if it is given or 1 (also converted) if not
"""
if not weightString:
... | python | def getWeight(grph, nd1, nd2, weightString = "weight", returnType = int):
"""
A way of getting the weight of an edge with or without weight as a parameter
returns a the value of the weight parameter converted to returnType if it is given or 1 (also converted) if not
"""
if not weightString:
... | A way of getting the weight of an edge with or without weight as a parameter
returns a the value of the weight parameter converted to returnType if it is given or 1 (also converted) if not | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/graphHelpers.py#L447-L455 |
networks-lab/metaknowledge | metaknowledge/graphHelpers.py | getNodeDegrees | def getNodeDegrees(grph, weightString = "weight", strictMode = False, returnType = int, edgeType = 'bi'):
"""
Retunrs a dictionary of nodes to their degrees, the degree is determined by adding the weight of edge with the weight being the string weightString that gives the name of the attribute of each edge con... | python | def getNodeDegrees(grph, weightString = "weight", strictMode = False, returnType = int, edgeType = 'bi'):
"""
Retunrs a dictionary of nodes to their degrees, the degree is determined by adding the weight of edge with the weight being the string weightString that gives the name of the attribute of each edge con... | Retunrs a dictionary of nodes to their degrees, the degree is determined by adding the weight of edge with the weight being the string weightString that gives the name of the attribute of each edge containng thier weight. The Weights are then converted to the type returnType. If weightString is give as False instead ea... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/graphHelpers.py#L457-L486 |
networks-lab/metaknowledge | metaknowledge/graphHelpers.py | dropEdges | def dropEdges(grph, minWeight = - float('inf'), maxWeight = float('inf'), parameterName = 'weight', ignoreUnweighted = False, dropSelfLoops = False):
"""Modifies _grph_ by dropping edges whose weight is not within the inclusive bounds of _minWeight_ and _maxWeight_, i.e after running _grph_ will only have edges who... | python | def dropEdges(grph, minWeight = - float('inf'), maxWeight = float('inf'), parameterName = 'weight', ignoreUnweighted = False, dropSelfLoops = False):
"""Modifies _grph_ by dropping edges whose weight is not within the inclusive bounds of _minWeight_ and _maxWeight_, i.e after running _grph_ will only have edges who... | Modifies _grph_ by dropping edges whose weight is not within the inclusive bounds of _minWeight_ and _maxWeight_, i.e after running _grph_ will only have edges whose weights meet the following inequality: _minWeight_ <= edge's weight <= _maxWeight_. A `Keyerror` will be raised if the graph is unweighted unless _ignoreU... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/graphHelpers.py#L497-L561 |
networks-lab/metaknowledge | metaknowledge/graphHelpers.py | dropNodesByDegree | def dropNodesByDegree(grph, minDegree = -float('inf'), maxDegree = float('inf'), useWeight = True, parameterName = 'weight', includeUnweighted = True):
"""Modifies _grph_ by dropping nodes that do not have a degree that is within inclusive bounds of _minDegree_ and _maxDegree_, i.e after running _grph_ will only ha... | python | def dropNodesByDegree(grph, minDegree = -float('inf'), maxDegree = float('inf'), useWeight = True, parameterName = 'weight', includeUnweighted = True):
"""Modifies _grph_ by dropping nodes that do not have a degree that is within inclusive bounds of _minDegree_ and _maxDegree_, i.e after running _grph_ will only ha... | Modifies _grph_ by dropping nodes that do not have a degree that is within inclusive bounds of _minDegree_ and _maxDegree_, i.e after running _grph_ will only have nodes whose degrees meet the following inequality: _minDegree_ <= node's degree <= _maxDegree_.
Degree is determined in two ways, the default _useWeigh... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/graphHelpers.py#L563-L628 |
networks-lab/metaknowledge | metaknowledge/graphHelpers.py | dropNodesByCount | def dropNodesByCount(grph, minCount = -float('inf'), maxCount = float('inf'), parameterName = 'count', ignoreMissing = False):
"""Modifies _grph_ by dropping nodes that do not have a count that is within inclusive bounds of _minCount_ and _maxCount_, i.e after running _grph_ will only have nodes whose degrees meet ... | python | def dropNodesByCount(grph, minCount = -float('inf'), maxCount = float('inf'), parameterName = 'count', ignoreMissing = False):
"""Modifies _grph_ by dropping nodes that do not have a count that is within inclusive bounds of _minCount_ and _maxCount_, i.e after running _grph_ will only have nodes whose degrees meet ... | Modifies _grph_ by dropping nodes that do not have a count that is within inclusive bounds of _minCount_ and _maxCount_, i.e after running _grph_ will only have nodes whose degrees meet the following inequality: _minCount_ <= node's degree <= _maxCount_.
Count is determined by the count attribute, _parameterName_,... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/graphHelpers.py#L631-L689 |
networks-lab/metaknowledge | metaknowledge/graphHelpers.py | mergeGraphs | def mergeGraphs(targetGraph, addedGraph, incrementedNodeVal = 'count', incrementedEdgeVal = 'weight'):
"""A quick way of merging graphs, this is meant to be quick and is only intended for graphs generated by metaknowledge. This does not check anything and as such may cause unexpected results if the source and targe... | python | def mergeGraphs(targetGraph, addedGraph, incrementedNodeVal = 'count', incrementedEdgeVal = 'weight'):
"""A quick way of merging graphs, this is meant to be quick and is only intended for graphs generated by metaknowledge. This does not check anything and as such may cause unexpected results if the source and targe... | A quick way of merging graphs, this is meant to be quick and is only intended for graphs generated by metaknowledge. This does not check anything and as such may cause unexpected results if the source and target were not generated by the same method.
**mergeGraphs**() will **modify** _targetGraph_ in place by addi... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/graphHelpers.py#L691-L732 |
networks-lab/metaknowledge | metaknowledge/graphHelpers.py | graphStats | def graphStats(G, stats = ('nodes', 'edges', 'isolates', 'loops', 'density', 'transitivity'), makeString = True, sentenceString = False):
"""Returns a string or list containing statistics about the graph _G_.
**graphStats()** gives 6 different statistics: number of nodes, number of edges, number of isolates, n... | python | def graphStats(G, stats = ('nodes', 'edges', 'isolates', 'loops', 'density', 'transitivity'), makeString = True, sentenceString = False):
"""Returns a string or list containing statistics about the graph _G_.
**graphStats()** gives 6 different statistics: number of nodes, number of edges, number of isolates, n... | Returns a string or list containing statistics about the graph _G_.
**graphStats()** gives 6 different statistics: number of nodes, number of edges, number of isolates, number of loops, density and transitivity. The ones wanted can be given to _stats_. By default a string giving each stat on a different line it ca... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/graphHelpers.py#L734-L842 |
networks-lab/metaknowledge | metaknowledge/medline/tagProcessing/tagFunctions.py | AD | def AD(val):
"""Affiliation
Undoing what the parser does then splitting at the semicolons and dropping newlines extra fitlering is required beacuse some AD's end with a semicolon"""
retDict = {}
for v in val:
split = v.split(' : ')
retDict[split[0]] = [s for s in' : '.join(split[1:]).rep... | python | def AD(val):
"""Affiliation
Undoing what the parser does then splitting at the semicolons and dropping newlines extra fitlering is required beacuse some AD's end with a semicolon"""
retDict = {}
for v in val:
split = v.split(' : ')
retDict[split[0]] = [s for s in' : '.join(split[1:]).rep... | Affiliation
Undoing what the parser does then splitting at the semicolons and dropping newlines extra fitlering is required beacuse some AD's end with a semicolon | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/medline/tagProcessing/tagFunctions.py#L218-L225 |
networks-lab/metaknowledge | metaknowledge/medline/tagProcessing/tagFunctions.py | AUID | def AUID(val):
"""AuthorIdentifier
one line only just need to undo the parser's effects"""
retDict = {}
for v in val:
split = v.split(' : ')
retDict[split[0]] = ' : '.join(split[1:])
return retDict | python | def AUID(val):
"""AuthorIdentifier
one line only just need to undo the parser's effects"""
retDict = {}
for v in val:
split = v.split(' : ')
retDict[split[0]] = ' : '.join(split[1:])
return retDict | AuthorIdentifier
one line only just need to undo the parser's effects | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/medline/tagProcessing/tagFunctions.py#L322-L329 |
networks-lab/metaknowledge | metaknowledge/constants.py | isInteractive | def isInteractive():
"""
A basic check of if the program is running in interactive mode
"""
if sys.stdout.isatty() and os.name != 'nt':
#Hopefully everything but ms supports '\r'
try:
import threading
except ImportError:
return False
else:
... | python | def isInteractive():
"""
A basic check of if the program is running in interactive mode
"""
if sys.stdout.isatty() and os.name != 'nt':
#Hopefully everything but ms supports '\r'
try:
import threading
except ImportError:
return False
else:
... | A basic check of if the program is running in interactive mode | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/constants.py#L27-L40 |
networks-lab/metaknowledge | metaknowledge/WOS/recordWOS.py | recordParser | def recordParser(paper):
"""This is function that is used to create [Records](../classes/Record.html#metaknowledge.Record) from files.
**recordParser**() reads the file _paper_ until it reaches 'ER'. For each field tag it adds an entry to the returned dict with the tag as the key and a list of the entries as t... | python | def recordParser(paper):
"""This is function that is used to create [Records](../classes/Record.html#metaknowledge.Record) from files.
**recordParser**() reads the file _paper_ until it reaches 'ER'. For each field tag it adds an entry to the returned dict with the tag as the key and a list of the entries as t... | This is function that is used to create [Records](../classes/Record.html#metaknowledge.Record) from files.
**recordParser**() reads the file _paper_ until it reaches 'ER'. For each field tag it adds an entry to the returned dict with the tag as the key and a list of the entries as the value, the list has each line... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/WOS/recordWOS.py#L146-L201 |
networks-lab/metaknowledge | metaknowledge/WOS/recordWOS.py | WOSRecord.writeRecord | def writeRecord(self, infile):
"""Writes to _infile_ the original contents of the Record. This is intended for use by [RecordCollections](./RecordCollection.html#metaknowledge.RecordCollection) to write to file. What is written to _infile_ is bit for bit identical to the original record file (if utf-8 is used).... | python | def writeRecord(self, infile):
"""Writes to _infile_ the original contents of the Record. This is intended for use by [RecordCollections](./RecordCollection.html#metaknowledge.RecordCollection) to write to file. What is written to _infile_ is bit for bit identical to the original record file (if utf-8 is used).... | Writes to _infile_ the original contents of the Record. This is intended for use by [RecordCollections](./RecordCollection.html#metaknowledge.RecordCollection) to write to file. What is written to _infile_ is bit for bit identical to the original record file (if utf-8 is used). No newline is inserted above the write bu... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/WOS/recordWOS.py#L125-L144 |
networks-lab/metaknowledge | metaknowledge/grants/nsercGrant.py | NSERCGrant.getInstitutions | def getInstitutions(self, tags = None, seperator = ";", _getTag = False):
"""Returns a list with the names of the institution. The optional arguments are ignored
# Returns
`list [str]`
> A list with 1 entry the name of the institution
"""
if tags is None:
t... | python | def getInstitutions(self, tags = None, seperator = ";", _getTag = False):
"""Returns a list with the names of the institution. The optional arguments are ignored
# Returns
`list [str]`
> A list with 1 entry the name of the institution
"""
if tags is None:
t... | Returns a list with the names of the institution. The optional arguments are ignored
# Returns
`list [str]`
> A list with 1 entry the name of the institution | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/grants/nsercGrant.py#L46-L62 |
networks-lab/metaknowledge | metaknowledge/medline/recordMedline.py | medlineRecordParser | def medlineRecordParser(record):
"""The parser [`MedlineRecord`](../classes/MedlineRecord.html#metaknowledge.medline.MedlineRecord) use. This takes an entry from [medlineParser()](#metaknowledge.medline.medlineHandlers.medlineParser) and parses it a part of the creation of a `MedlineRecord`.
# Parameters
... | python | def medlineRecordParser(record):
"""The parser [`MedlineRecord`](../classes/MedlineRecord.html#metaknowledge.medline.MedlineRecord) use. This takes an entry from [medlineParser()](#metaknowledge.medline.medlineHandlers.medlineParser) and parses it a part of the creation of a `MedlineRecord`.
# Parameters
... | The parser [`MedlineRecord`](../classes/MedlineRecord.html#metaknowledge.medline.MedlineRecord) use. This takes an entry from [medlineParser()](#metaknowledge.medline.medlineHandlers.medlineParser) and parses it a part of the creation of a `MedlineRecord`.
# Parameters
_record_ : `enumerate object`
> a f... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/medline/recordMedline.py#L90-L127 |
networks-lab/metaknowledge | metaknowledge/medline/recordMedline.py | MedlineRecord.writeRecord | def writeRecord(self, f):
"""This is nearly identical to the original the FAU tag is the only tag not writen in the same place, doing so would require changing the parser and lots of extra logic.
"""
if self.bad:
raise BadPubmedRecord("This record cannot be converted to a file as the... | python | def writeRecord(self, f):
"""This is nearly identical to the original the FAU tag is the only tag not writen in the same place, doing so would require changing the parser and lots of extra logic.
"""
if self.bad:
raise BadPubmedRecord("This record cannot be converted to a file as the... | This is nearly identical to the original the FAU tag is the only tag not writen in the same place, doing so would require changing the parser and lots of extra logic. | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/medline/recordMedline.py#L66-L88 |
networks-lab/metaknowledge | metaknowledge/contour/plotting.py | quickVisual | def quickVisual(G, showLabel = False):
"""Just makes a simple _matplotlib_ figure and displays it, with each node coloured by its type. You can add labels with _showLabel_. This looks a bit nicer than the one provided my _networkx_'s defaults.
# Parameters
_showLabel_ : `optional [bool]`
> Default `F... | python | def quickVisual(G, showLabel = False):
"""Just makes a simple _matplotlib_ figure and displays it, with each node coloured by its type. You can add labels with _showLabel_. This looks a bit nicer than the one provided my _networkx_'s defaults.
# Parameters
_showLabel_ : `optional [bool]`
> Default `F... | Just makes a simple _matplotlib_ figure and displays it, with each node coloured by its type. You can add labels with _showLabel_. This looks a bit nicer than the one provided my _networkx_'s defaults.
# Parameters
_showLabel_ : `optional [bool]`
> Default `False`, if `True` labels will be added to the n... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/contour/plotting.py#L8-L38 |
networks-lab/metaknowledge | metaknowledge/contour/plotting.py | graphDensityContourPlot | def graphDensityContourPlot(G, iters = 50, layout = None, layoutScaleFactor = 1, overlay = False, nodeSize = 10, axisSamples = 100, blurringFactor = .1, contours = 15, graphType = 'coloured'):
"""Creates a 3D plot giving the density of nodes on a 2D plane, as a surface in 3D.
Most of the options are for tweaki... | python | def graphDensityContourPlot(G, iters = 50, layout = None, layoutScaleFactor = 1, overlay = False, nodeSize = 10, axisSamples = 100, blurringFactor = .1, contours = 15, graphType = 'coloured'):
"""Creates a 3D plot giving the density of nodes on a 2D plane, as a surface in 3D.
Most of the options are for tweaki... | Creates a 3D plot giving the density of nodes on a 2D plane, as a surface in 3D.
Most of the options are for tweaking the final appearance. _layout_ and _layoutScaleFactor_ allow a pre-layout graph to be provided. If a layout is not provided the [networkx.spring_layout()](https://networkx.github.io/documentation/l... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/contour/plotting.py#L40-L125 |
networks-lab/metaknowledge | metaknowledge/WOS/tagProcessing/helpFuncs.py | getMonth | def getMonth(s):
"""
Known formats:
Month ("%b")
Month Day ("%b %d")
Month-Month ("%b-%b") --- this gets coerced to the first %b, dropping the month range
Season ("%s") --- this gets coerced to use the first month of the given season
Month Day Year ("%b %d %Y")
Month Year ("%b %Y")
Y... | python | def getMonth(s):
"""
Known formats:
Month ("%b")
Month Day ("%b %d")
Month-Month ("%b-%b") --- this gets coerced to the first %b, dropping the month range
Season ("%s") --- this gets coerced to use the first month of the given season
Month Day Year ("%b %d %Y")
Month Year ("%b %Y")
Y... | Known formats:
Month ("%b")
Month Day ("%b %d")
Month-Month ("%b-%b") --- this gets coerced to the first %b, dropping the month range
Season ("%s") --- this gets coerced to use the first month of the given season
Month Day Year ("%b %d %Y")
Month Year ("%b %Y")
Year Month Day ("%Y %m %d") | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/WOS/tagProcessing/helpFuncs.py#L4-L25 |
networks-lab/metaknowledge | metaknowledge/WOS/tagProcessing/helpFuncs.py | makeBiDirectional | def makeBiDirectional(d):
"""
Helper for generating tagNameConverter
Makes dict that maps from key to value and back
"""
dTmp = d.copy()
for k in d:
dTmp[d[k]] = k
return dTmp | python | def makeBiDirectional(d):
"""
Helper for generating tagNameConverter
Makes dict that maps from key to value and back
"""
dTmp = d.copy()
for k in d:
dTmp[d[k]] = k
return dTmp | Helper for generating tagNameConverter
Makes dict that maps from key to value and back | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/WOS/tagProcessing/helpFuncs.py#L27-L35 |
networks-lab/metaknowledge | metaknowledge/WOS/tagProcessing/helpFuncs.py | reverseDict | def reverseDict(d):
"""
Helper for generating fullToTag
Makes dict of value to key
"""
retD = {}
for k in d:
retD[d[k]] = k
return retD | python | def reverseDict(d):
"""
Helper for generating fullToTag
Makes dict of value to key
"""
retD = {}
for k in d:
retD[d[k]] = k
return retD | Helper for generating fullToTag
Makes dict of value to key | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/WOS/tagProcessing/helpFuncs.py#L37-L45 |
networks-lab/metaknowledge | metaknowledge/proquest/recordProQuest.py | proQuestRecordParser | def proQuestRecordParser(enRecordFile, recNum):
"""The parser [ProQuestRecords](../classes/ProQuestRecord.html#metaknowledge.proquest.ProQuestRecord) use. This takes an entry from [proQuestParser()](#metaknowledge.proquest.proQuestHandlers.proQuestParser) and parses it a part of the creation of a `ProQuestRecord`.
... | python | def proQuestRecordParser(enRecordFile, recNum):
"""The parser [ProQuestRecords](../classes/ProQuestRecord.html#metaknowledge.proquest.ProQuestRecord) use. This takes an entry from [proQuestParser()](#metaknowledge.proquest.proQuestHandlers.proQuestParser) and parses it a part of the creation of a `ProQuestRecord`.
... | The parser [ProQuestRecords](../classes/ProQuestRecord.html#metaknowledge.proquest.ProQuestRecord) use. This takes an entry from [proQuestParser()](#metaknowledge.proquest.proQuestHandlers.proQuestParser) and parses it a part of the creation of a `ProQuestRecord`.
# Parameters
_enRecordFile_ : `enumerate obje... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/proquest/recordProQuest.py#L70-L108 |
networks-lab/metaknowledge | metaknowledge/recordCollection.py | addToNetwork | def addToNetwork(grph, nds, count, weighted, nodeType, nodeInfo, fullInfo, coreCitesDict, coreValues, detailedValues, addCR, recordToCite = True, headNd = None):
"""Addeds the citations _nds_ to _grph_, according to the rules give by _nodeType_, _fullInfo_, etc.
_headNd_ is the citation of the Record
"""
... | python | def addToNetwork(grph, nds, count, weighted, nodeType, nodeInfo, fullInfo, coreCitesDict, coreValues, detailedValues, addCR, recordToCite = True, headNd = None):
"""Addeds the citations _nds_ to _grph_, according to the rules give by _nodeType_, _fullInfo_, etc.
_headNd_ is the citation of the Record
"""
... | Addeds the citations _nds_ to _grph_, according to the rules give by _nodeType_, _fullInfo_, etc.
_headNd_ is the citation of the Record | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/recordCollection.py#L1618-L1698 |
networks-lab/metaknowledge | metaknowledge/recordCollection.py | makeNodeTuple | def makeNodeTuple(citation, idVal, nodeInfo, fullInfo, nodeType, count, coreCitesDict, coreValues, detailedValues, addCR):
"""Makes a tuple of idVal and a dict of the selected attributes"""
d = {}
if nodeInfo:
if nodeType == 'full':
if coreValues:
if citation in coreCites... | python | def makeNodeTuple(citation, idVal, nodeInfo, fullInfo, nodeType, count, coreCitesDict, coreValues, detailedValues, addCR):
"""Makes a tuple of idVal and a dict of the selected attributes"""
d = {}
if nodeInfo:
if nodeType == 'full':
if coreValues:
if citation in coreCites... | Makes a tuple of idVal and a dict of the selected attributes | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/recordCollection.py#L1709-L1760 |
networks-lab/metaknowledge | metaknowledge/recordCollection.py | expandRecs | def expandRecs(G, RecCollect, nodeType, weighted):
"""Expand all the citations from _RecCollect_"""
for Rec in RecCollect:
fullCiteList = [makeID(c, nodeType) for c in Rec.createCitation(multiCite = True)]
if len(fullCiteList) > 1:
for i, citeID1 in enumerate(fullCiteList):
... | python | def expandRecs(G, RecCollect, nodeType, weighted):
"""Expand all the citations from _RecCollect_"""
for Rec in RecCollect:
fullCiteList = [makeID(c, nodeType) for c in Rec.createCitation(multiCite = True)]
if len(fullCiteList) > 1:
for i, citeID1 in enumerate(fullCiteList):
... | Expand all the citations from _RecCollect_ | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/recordCollection.py#L1792-L1812 |
networks-lab/metaknowledge | metaknowledge/recordCollection.py | RecordCollection.dropNonJournals | def dropNonJournals(self, ptVal = 'J', dropBad = True, invert = False):
"""Drops the non journal type `Records` from the collection, this is done by checking _ptVal_ against the PT tag
# Parameters
_ptVal_ : `optional [str]`
> Default `'J'`, The value of the PT tag to be kept, default... | python | def dropNonJournals(self, ptVal = 'J', dropBad = True, invert = False):
"""Drops the non journal type `Records` from the collection, this is done by checking _ptVal_ against the PT tag
# Parameters
_ptVal_ : `optional [str]`
> Default `'J'`, The value of the PT tag to be kept, default... | Drops the non journal type `Records` from the collection, this is done by checking _ptVal_ against the PT tag
# Parameters
_ptVal_ : `optional [str]`
> Default `'J'`, The value of the PT tag to be kept, default is `'J'` the journal tag, other tags can be substituted.
_dropBad_ : `opt... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/recordCollection.py#L192-L214 |
networks-lab/metaknowledge | metaknowledge/recordCollection.py | RecordCollection.writeFile | def writeFile(self, fname = None):
"""Writes the `RecordCollection` to a file, the written file's format is identical to those download from WOS. The order of `Records` written is random.
# Parameters
_fname_ : `optional [str]`
> Default `None`, if given the output file will written t... | python | def writeFile(self, fname = None):
"""Writes the `RecordCollection` to a file, the written file's format is identical to those download from WOS. The order of `Records` written is random.
# Parameters
_fname_ : `optional [str]`
> Default `None`, if given the output file will written t... | Writes the `RecordCollection` to a file, the written file's format is identical to those download from WOS. The order of `Records` written is random.
# Parameters
_fname_ : `optional [str]`
> Default `None`, if given the output file will written to _fanme_, if `None` the `RecordCollection`'s ... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/recordCollection.py#L216-L245 |
networks-lab/metaknowledge | metaknowledge/recordCollection.py | RecordCollection.writeCSV | def writeCSV(self, fname = None, splitByTag = None, onlyTheseTags = None, numAuthors = True, genderCounts = True, longNames = False, firstTags = None, csvDelimiter = ',', csvQuote = '"', listDelimiter = '|'):
"""Writes all the `Records` from the collection into a csv file with each row a record and each column ... | python | def writeCSV(self, fname = None, splitByTag = None, onlyTheseTags = None, numAuthors = True, genderCounts = True, longNames = False, firstTags = None, csvDelimiter = ',', csvQuote = '"', listDelimiter = '|'):
"""Writes all the `Records` from the collection into a csv file with each row a record and each column ... | Writes all the `Records` from the collection into a csv file with each row a record and each column a tag.
# Parameters
_fname_ : `optional [str]`
> Default `None`, the name of the file to write to, if `None` it uses the collections name suffixed by .csv.
_splitByTag_ : `optional [st... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/recordCollection.py#L247-L371 |
networks-lab/metaknowledge | metaknowledge/recordCollection.py | RecordCollection.writeBib | def writeBib(self, fname = None, maxStringLength = 1000, wosMode = False, reducedOutput = False, niceIDs = True):
"""Writes a bibTex entry to _fname_ for each `Record` in the collection.
If the Record is of a journal article (PT J) the bibtext type is set to `'article'`, otherwise it is set to `'misc'`... | python | def writeBib(self, fname = None, maxStringLength = 1000, wosMode = False, reducedOutput = False, niceIDs = True):
"""Writes a bibTex entry to _fname_ for each `Record` in the collection.
If the Record is of a journal article (PT J) the bibtext type is set to `'article'`, otherwise it is set to `'misc'`... | Writes a bibTex entry to _fname_ for each `Record` in the collection.
If the Record is of a journal article (PT J) the bibtext type is set to `'article'`, otherwise it is set to `'misc'`. The ID of the entry is the WOS number and all the Record's fields are given as entries with their long names.
**No... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/recordCollection.py#L373-L418 |
networks-lab/metaknowledge | metaknowledge/recordCollection.py | RecordCollection.findProbableCopyright | def findProbableCopyright(self):
"""Finds the (likely) copyright string from all abstracts in the `RecordCollection`
# Returns
`list[str]`
> A deduplicated list of all the copyright strings
"""
retCopyrights = set()
for R in self:
begin, abS = findC... | python | def findProbableCopyright(self):
"""Finds the (likely) copyright string from all abstracts in the `RecordCollection`
# Returns
`list[str]`
> A deduplicated list of all the copyright strings
"""
retCopyrights = set()
for R in self:
begin, abS = findC... | Finds the (likely) copyright string from all abstracts in the `RecordCollection`
# Returns
`list[str]`
> A deduplicated list of all the copyright strings | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/recordCollection.py#L420-L434 |
networks-lab/metaknowledge | metaknowledge/recordCollection.py | RecordCollection.forBurst | def forBurst(self, tag, outputFile = None, dropList = None, lower = True, removeNumbers = True, removeNonWords = True, removeWhitespace = True, stemmer = None):
"""Creates a pandas friendly dictionary with 2 columns one `'year'` and the other `'word'`. Each row is a word that occurred in the field given by _tag... | python | def forBurst(self, tag, outputFile = None, dropList = None, lower = True, removeNumbers = True, removeNonWords = True, removeWhitespace = True, stemmer = None):
"""Creates a pandas friendly dictionary with 2 columns one `'year'` and the other `'word'`. Each row is a word that occurred in the field given by _tag... | Creates a pandas friendly dictionary with 2 columns one `'year'` and the other `'word'`. Each row is a word that occurred in the field given by _tag_ in a `Record` and the year of the record. Unfortunately getting the month or day with any type of accuracy has proved to be impossible so year is the only option.
... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/recordCollection.py#L436-L553 |
networks-lab/metaknowledge | metaknowledge/recordCollection.py | RecordCollection.forNLP | def forNLP(self, outputFile = None, extraColumns = None, dropList = None, lower = True, removeNumbers = True, removeNonWords = True, removeWhitespace = True, removeCopyright = False, stemmer = None):
"""Creates a pandas friendly dictionary with each row a `Record` in the `RecordCollection` and the columns field... | python | def forNLP(self, outputFile = None, extraColumns = None, dropList = None, lower = True, removeNumbers = True, removeNonWords = True, removeWhitespace = True, removeCopyright = False, stemmer = None):
"""Creates a pandas friendly dictionary with each row a `Record` in the `RecordCollection` and the columns field... | Creates a pandas friendly dictionary with each row a `Record` in the `RecordCollection` and the columns fields natural language processing uses (id, title, publication year, keywords and the abstract). The abstract is by default is processed to remove non-word, non-space characters and the case is lowered.
# P... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/recordCollection.py#L555-L696 |
networks-lab/metaknowledge | metaknowledge/recordCollection.py | RecordCollection.makeDict | def makeDict(self, onlyTheseTags = None, longNames = False, raw = False, numAuthors = True, genderCounts = True):
"""Returns a dict with each key a tag and the values being lists of the values for each of the Records in the collection, `None` is given when there is no value and they are in the same order across... | python | def makeDict(self, onlyTheseTags = None, longNames = False, raw = False, numAuthors = True, genderCounts = True):
"""Returns a dict with each key a tag and the values being lists of the values for each of the Records in the collection, `None` is given when there is no value and they are in the same order across... | Returns a dict with each key a tag and the values being lists of the values for each of the Records in the collection, `None` is given when there is no value and they are in the same order across each tag.
When used with pandas: `pandas.DataFrame(RC.makeDict())` returns a data frame with each column a tag and ... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/recordCollection.py#L698-L753 |
networks-lab/metaknowledge | metaknowledge/recordCollection.py | RecordCollection.rpys | def rpys(self, minYear = None, maxYear = None, dropYears = None, rankEmptyYears = False):
"""This implements _Referenced Publication Years Spectroscopy_ a techinique for finding import years in citation data. The authors of the original papers have a website with more information, found [here](http://www.leydes... | python | def rpys(self, minYear = None, maxYear = None, dropYears = None, rankEmptyYears = False):
"""This implements _Referenced Publication Years Spectroscopy_ a techinique for finding import years in citation data. The authors of the original papers have a website with more information, found [here](http://www.leydes... | This implements _Referenced Publication Years Spectroscopy_ a techinique for finding import years in citation data. The authors of the original papers have a website with more information, found [here](http://www.leydesdorff.net/software/rpys/).
This function computes the spectra of the `RecordCollection` and ... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/recordCollection.py#L755-L869 |
networks-lab/metaknowledge | metaknowledge/recordCollection.py | RecordCollection.genderStats | def genderStats(self, asFractions = False):
"""Creates a dict (`{'Male' : maleCount, 'Female' : femaleCount, 'Unknown' : unknownCount}`) with the numbers of male, female and unknown names in the collection.
# Parameters
_asFractions_ : `optional bool`
> Default `False`, if `True` the ... | python | def genderStats(self, asFractions = False):
"""Creates a dict (`{'Male' : maleCount, 'Female' : femaleCount, 'Unknown' : unknownCount}`) with the numbers of male, female and unknown names in the collection.
# Parameters
_asFractions_ : `optional bool`
> Default `False`, if `True` the ... | Creates a dict (`{'Male' : maleCount, 'Female' : femaleCount, 'Unknown' : unknownCount}`) with the numbers of male, female and unknown names in the collection.
# Parameters
_asFractions_ : `optional bool`
> Default `False`, if `True` the counts will be divided by the total number of names, gi... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/recordCollection.py#L871-L898 |
networks-lab/metaknowledge | metaknowledge/recordCollection.py | RecordCollection.getCitations | def getCitations(self, field = None, values = None, pandasFriendly = True, counts = True):
"""Creates a pandas ready dict with each row a different citation the contained Records and columns containing the original string, year, journal, author's name and the number of times it occured.
There are also ... | python | def getCitations(self, field = None, values = None, pandasFriendly = True, counts = True):
"""Creates a pandas ready dict with each row a different citation the contained Records and columns containing the original string, year, journal, author's name and the number of times it occured.
There are also ... | Creates a pandas ready dict with each row a different citation the contained Records and columns containing the original string, year, journal, author's name and the number of times it occured.
There are also options to filter the output citations with _field_ and _values_
# Parameters
_field... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/recordCollection.py#L900-L940 |
networks-lab/metaknowledge | metaknowledge/recordCollection.py | RecordCollection.networkCoAuthor | def networkCoAuthor(self, detailedInfo = False, weighted = True, dropNonJournals = False, count = True, useShortNames = False, citeProfile = False):
"""Creates a coauthorship network for the RecordCollection.
# Parameters
_detailedInfo_ : `optional [bool or iterable[WOS tag Strings]]`
... | python | def networkCoAuthor(self, detailedInfo = False, weighted = True, dropNonJournals = False, count = True, useShortNames = False, citeProfile = False):
"""Creates a coauthorship network for the RecordCollection.
# Parameters
_detailedInfo_ : `optional [bool or iterable[WOS tag Strings]]`
... | Creates a coauthorship network for the RecordCollection.
# Parameters
_detailedInfo_ : `optional [bool or iterable[WOS tag Strings]]`
> Default `False`, if `True` all nodes will be given info strings composed of information from the Record objects themselves. This is Equivalent to passing the... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/recordCollection.py#L942-L1073 |
networks-lab/metaknowledge | metaknowledge/recordCollection.py | RecordCollection.networkCoCitation | def networkCoCitation(self, dropAnon = True, nodeType = "full", nodeInfo = True, fullInfo = False, weighted = True, dropNonJournals = False, count = True, keyWords = None, detailedCore = True, detailedCoreAttributes = False, coreOnly = False, expandedCore = False, addCR = False):
"""Creates a co-citation networ... | python | def networkCoCitation(self, dropAnon = True, nodeType = "full", nodeInfo = True, fullInfo = False, weighted = True, dropNonJournals = False, count = True, keyWords = None, detailedCore = True, detailedCoreAttributes = False, coreOnly = False, expandedCore = False, addCR = False):
"""Creates a co-citation networ... | Creates a co-citation network for the RecordCollection.
# Parameters
_nodeType_ : `optional [str]`
> One of `"full"`, `"original"`, `"author"`, `"journal"` or `"year"`. Specifies the value of the nodes in the graph. The default `"full"` causes the citations to be compared holistically using t... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/recordCollection.py#L1075-L1177 |
networks-lab/metaknowledge | metaknowledge/recordCollection.py | RecordCollection.networkBibCoupling | def networkBibCoupling(self, weighted = True, fullInfo = False, addCR = False):
"""Creates a bibliographic coupling network based on citations for the RecordCollection.
# Parameters
_weighted_ : `optional bool`
> Default `True`, if `True` the weight of the edges will be added to the n... | python | def networkBibCoupling(self, weighted = True, fullInfo = False, addCR = False):
"""Creates a bibliographic coupling network based on citations for the RecordCollection.
# Parameters
_weighted_ : `optional bool`
> Default `True`, if `True` the weight of the edges will be added to the n... | Creates a bibliographic coupling network based on citations for the RecordCollection.
# Parameters
_weighted_ : `optional bool`
> Default `True`, if `True` the weight of the edges will be added to the network
_fullInfo_ : `optional bool`
> Default `False`, if `True` the full... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/recordCollection.py#L1294-L1348 |
networks-lab/metaknowledge | metaknowledge/recordCollection.py | RecordCollection.yearSplit | def yearSplit(self, startYear, endYear, dropMissingYears = True):
"""Creates a RecordCollection of Records from the years between _startYear_ and _endYear_ inclusive.
# Parameters
_startYear_ : `int`
> The smallest year to be included in the returned RecordCollection
_endYear... | python | def yearSplit(self, startYear, endYear, dropMissingYears = True):
"""Creates a RecordCollection of Records from the years between _startYear_ and _endYear_ inclusive.
# Parameters
_startYear_ : `int`
> The smallest year to be included in the returned RecordCollection
_endYear... | Creates a RecordCollection of Records from the years between _startYear_ and _endYear_ inclusive.
# Parameters
_startYear_ : `int`
> The smallest year to be included in the returned RecordCollection
_endYear_ : `int`
> The largest year to be included in the returned RecordCo... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/recordCollection.py#L1362-L1397 |
networks-lab/metaknowledge | metaknowledge/recordCollection.py | RecordCollection.localCiteStats | def localCiteStats(self, pandasFriendly = False, keyType = "citation"):
"""Returns a dict with all the citations in the CR field as keys and the number of times they occur as the values
# Parameters
_pandasFriendly_ : `optional [bool]`
> default `False`, makes the output be a dict wit... | python | def localCiteStats(self, pandasFriendly = False, keyType = "citation"):
"""Returns a dict with all the citations in the CR field as keys and the number of times they occur as the values
# Parameters
_pandasFriendly_ : `optional [bool]`
> default `False`, makes the output be a dict wit... | Returns a dict with all the citations in the CR field as keys and the number of times they occur as the values
# Parameters
_pandasFriendly_ : `optional [bool]`
> default `False`, makes the output be a dict with two keys one `'Citations'` is the citations the other is their occurrence counts ... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/recordCollection.py#L1399-L1457 |
networks-lab/metaknowledge | metaknowledge/recordCollection.py | RecordCollection.localCitesOf | def localCitesOf(self, rec):
"""Takes in a Record, WOS string, citation string or Citation and returns a RecordCollection of all records that cite it.
# Parameters
_rec_ : `Record, str or Citation`
> The object that is being cited
# Returns
`RecordCollection`
... | python | def localCitesOf(self, rec):
"""Takes in a Record, WOS string, citation string or Citation and returns a RecordCollection of all records that cite it.
# Parameters
_rec_ : `Record, str or Citation`
> The object that is being cited
# Returns
`RecordCollection`
... | Takes in a Record, WOS string, citation string or Citation and returns a RecordCollection of all records that cite it.
# Parameters
_rec_ : `Record, str or Citation`
> The object that is being cited
# Returns
`RecordCollection`
> A `RecordCollection` containing only... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/recordCollection.py#L1459-L1501 |
networks-lab/metaknowledge | metaknowledge/recordCollection.py | RecordCollection.citeFilter | def citeFilter(self, keyString = '', field = 'all', reverse = False, caseSensitive = False):
"""Filters `Records` by some string, _keyString_, in their citations and returns all `Records` with at least one citation possessing _keyString_ in the field given by _field_.
# Parameters
_keyString_ ... | python | def citeFilter(self, keyString = '', field = 'all', reverse = False, caseSensitive = False):
"""Filters `Records` by some string, _keyString_, in their citations and returns all `Records` with at least one citation possessing _keyString_ in the field given by _field_.
# Parameters
_keyString_ ... | Filters `Records` by some string, _keyString_, in their citations and returns all `Records` with at least one citation possessing _keyString_ in the field given by _field_.
# Parameters
_keyString_ : `optional [str]`
> Default `''`, gives the string to be searched for, if it is is blank then ... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/recordCollection.py#L1503-L1615 |
networks-lab/metaknowledge | metaknowledge/citation.py | filterNonJournals | def filterNonJournals(citesLst, invert = False):
"""Removes the `Citations` from _citesLst_ that are not journals
# Parameters
_citesLst_ : `list [Citation]`
> A list of citations to be filtered
_invert_ : `optional [bool]`
> Default `False`, if `True` non-journals will be kept instead of j... | python | def filterNonJournals(citesLst, invert = False):
"""Removes the `Citations` from _citesLst_ that are not journals
# Parameters
_citesLst_ : `list [Citation]`
> A list of citations to be filtered
_invert_ : `optional [bool]`
> Default `False`, if `True` non-journals will be kept instead of j... | Removes the `Citations` from _citesLst_ that are not journals
# Parameters
_citesLst_ : `list [Citation]`
> A list of citations to be filtered
_invert_ : `optional [bool]`
> Default `False`, if `True` non-journals will be kept instead of journals
# Returns
`list [Citation]`
> A f... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/citation.py#L364-L391 |
networks-lab/metaknowledge | metaknowledge/citation.py | Citation.allButDOI | def allButDOI(self):
"""
Returns a string of the normalized values from the Citation excluding the DOI number. Equivalent to getting the ID with [ID()](#metaknowledge.citation.Citation.ID) then appending the extra values from [Extra()](#metaknowledge.citation.Citation.Extra) and then removing the substr... | python | def allButDOI(self):
"""
Returns a string of the normalized values from the Citation excluding the DOI number. Equivalent to getting the ID with [ID()](#metaknowledge.citation.Citation.ID) then appending the extra values from [Extra()](#metaknowledge.citation.Citation.Extra) and then removing the substr... | Returns a string of the normalized values from the Citation excluding the DOI number. Equivalent to getting the ID with [ID()](#metaknowledge.citation.Citation.ID) then appending the extra values from [Extra()](#metaknowledge.citation.Citation.Extra) and then removing the substring containing the DOI number.
#... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/citation.py#L222-L241 |
networks-lab/metaknowledge | metaknowledge/citation.py | Citation.Extra | def Extra(self):
"""
Returns any `V`, `P`, `DOI` or `misc` values as a string. These are all the values not returned by [ID()](#metaknowledge.citation.Citation.ID), they are separated by `' ,'`.
# Returns
`str`
> A string containing the data not in the ID of the `Citation`.
... | python | def Extra(self):
"""
Returns any `V`, `P`, `DOI` or `misc` values as a string. These are all the values not returned by [ID()](#metaknowledge.citation.Citation.ID), they are separated by `' ,'`.
# Returns
`str`
> A string containing the data not in the ID of the `Citation`.
... | Returns any `V`, `P`, `DOI` or `misc` values as a string. These are all the values not returned by [ID()](#metaknowledge.citation.Citation.ID), they are separated by `' ,'`.
# Returns
`str`
> A string containing the data not in the ID of the `Citation`. | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/citation.py#L243-L261 |
networks-lab/metaknowledge | metaknowledge/citation.py | Citation.isJournal | def isJournal(self, dbname = abrevDBname, manualDB = manualDBname, returnDict ='both', checkIfExcluded = False):
"""Returns `True` if the `Citation`'s `journal` field is a journal abbreviation from the WOS listing found at [http://images.webofknowledge.com/WOK46/help/WOS/A_abrvjt.html](http://images.webofknowle... | python | def isJournal(self, dbname = abrevDBname, manualDB = manualDBname, returnDict ='both', checkIfExcluded = False):
"""Returns `True` if the `Citation`'s `journal` field is a journal abbreviation from the WOS listing found at [http://images.webofknowledge.com/WOK46/help/WOS/A_abrvjt.html](http://images.webofknowle... | Returns `True` if the `Citation`'s `journal` field is a journal abbreviation from the WOS listing found at [http://images.webofknowledge.com/WOK46/help/WOS/A_abrvjt.html](http://images.webofknowledge.com/WOK46/help/WOS/A_abrvjt.html), i.e. checks if the citation is citing a journal.
**Note**: Requires the [j9A... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/citation.py#L263-L311 |
networks-lab/metaknowledge | metaknowledge/citation.py | Citation.FullJournalName | def FullJournalName(self):
"""Returns the full name of the Citation's journal field. Requires the [j9Abbreviations](../modules/journalAbbreviations.html#metaknowledge.journalAbbreviations.backend.getj9dict) database file.
**Note**: Requires the [j9Abbreviations](../modules/journalAbbreviations.html#met... | python | def FullJournalName(self):
"""Returns the full name of the Citation's journal field. Requires the [j9Abbreviations](../modules/journalAbbreviations.html#metaknowledge.journalAbbreviations.backend.getj9dict) database file.
**Note**: Requires the [j9Abbreviations](../modules/journalAbbreviations.html#met... | Returns the full name of the Citation's journal field. Requires the [j9Abbreviations](../modules/journalAbbreviations.html#metaknowledge.journalAbbreviations.backend.getj9dict) database file.
**Note**: Requires the [j9Abbreviations](../modules/journalAbbreviations.html#metaknowledge.journalAbbreviations.backen... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/citation.py#L313-L330 |
networks-lab/metaknowledge | metaknowledge/citation.py | Citation.addToDB | def addToDB(self, manualName = None, manualDB = manualDBname, invert = False):
"""Adds the journal of this Citation to the user created database of journals. This will cause [isJournal()](#metaknowledge.citation.Citation.isJournal) to return `True` for this Citation and all others with its `journal`.
*... | python | def addToDB(self, manualName = None, manualDB = manualDBname, invert = False):
"""Adds the journal of this Citation to the user created database of journals. This will cause [isJournal()](#metaknowledge.citation.Citation.isJournal) to return `True` for this Citation and all others with its `journal`.
*... | Adds the journal of this Citation to the user created database of journals. This will cause [isJournal()](#metaknowledge.citation.Citation.isJournal) to return `True` for this Citation and all others with its `journal`.
**Note**: Requires the [j9Abbreviations](../modules/journalAbbreviations.html#metaknowledge... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/citation.py#L332-L362 |
networks-lab/metaknowledge | metaknowledge/mkCollection.py | Collection.add | def add(self, elem):
""" Adds _elem_ to the collection.
# Parameters
_elem_ : `object`
> The object to be added
"""
if isinstance(elem, self._allowedTypes):
self._collection.add(elem)
self._collectedTypes.add(type(elem).__name__)
else:
... | python | def add(self, elem):
""" Adds _elem_ to the collection.
# Parameters
_elem_ : `object`
> The object to be added
"""
if isinstance(elem, self._allowedTypes):
self._collection.add(elem)
self._collectedTypes.add(type(elem).__name__)
else:
... | Adds _elem_ to the collection.
# Parameters
_elem_ : `object`
> The object to be added | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/mkCollection.py#L120-L133 |
networks-lab/metaknowledge | metaknowledge/mkCollection.py | Collection.remove | def remove(self, elem):
"""Removes _elem_ from the collection, will raise a KeyError is _elem_ is missing
# Parameters
_elem_ : `object`
> The object to be removed
"""
try:
return self._collection.remove(elem)
except KeyError:
raise KeyE... | python | def remove(self, elem):
"""Removes _elem_ from the collection, will raise a KeyError is _elem_ is missing
# Parameters
_elem_ : `object`
> The object to be removed
"""
try:
return self._collection.remove(elem)
except KeyError:
raise KeyE... | Removes _elem_ from the collection, will raise a KeyError is _elem_ is missing
# Parameters
_elem_ : `object`
> The object to be removed | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/mkCollection.py#L147-L159 |
networks-lab/metaknowledge | metaknowledge/mkCollection.py | Collection.clear | def clear(self):
""""Removes all elements from the collection and resets the error handling
"""
self.bad = False
self.errors = {}
self._collection.clear() | python | def clear(self):
""""Removes all elements from the collection and resets the error handling
"""
self.bad = False
self.errors = {}
self._collection.clear() | Removes all elements from the collection and resets the error handling | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/mkCollection.py#L161-L166 |
networks-lab/metaknowledge | metaknowledge/mkCollection.py | Collection.pop | def pop(self):
"""Removes a random element from the collection and returns it
# Returns
`object`
> A random object from the collection
"""
try:
return self._collection.pop()
except KeyError:
raise KeyError("Nothing left in the {}: '{}'."... | python | def pop(self):
"""Removes a random element from the collection and returns it
# Returns
`object`
> A random object from the collection
"""
try:
return self._collection.pop()
except KeyError:
raise KeyError("Nothing left in the {}: '{}'."... | Removes a random element from the collection and returns it
# Returns
`object`
> A random object from the collection | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/mkCollection.py#L168-L180 |
networks-lab/metaknowledge | metaknowledge/mkCollection.py | Collection.copy | def copy(self):
"""Creates a shallow copy of the collection
# Returns
`Collection`
> A copy of the `Collection`
"""
collectedCopy = copy.copy(self)
collectedCopy._collection = copy.copy(collectedCopy._collection)
self._collectedTypes = copy.copy(self._c... | python | def copy(self):
"""Creates a shallow copy of the collection
# Returns
`Collection`
> A copy of the `Collection`
"""
collectedCopy = copy.copy(self)
collectedCopy._collection = copy.copy(collectedCopy._collection)
self._collectedTypes = copy.copy(self._c... | Creates a shallow copy of the collection
# Returns
`Collection`
> A copy of the `Collection` | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/mkCollection.py#L279-L293 |
networks-lab/metaknowledge | metaknowledge/mkCollection.py | Collection.chunk | def chunk(self, maxSize):
"""Splits the `Collection` into _maxSize_ size or smaller `Collections`
# Parameters
_maxSize_ : `int`
> The maximum number of elements in a retuned `Collection`
# Returns
`list [Collection]`
> A list of `Collections` that if all m... | python | def chunk(self, maxSize):
"""Splits the `Collection` into _maxSize_ size or smaller `Collections`
# Parameters
_maxSize_ : `int`
> The maximum number of elements in a retuned `Collection`
# Returns
`list [Collection]`
> A list of `Collections` that if all m... | Splits the `Collection` into _maxSize_ size or smaller `Collections`
# Parameters
_maxSize_ : `int`
> The maximum number of elements in a retuned `Collection`
# Returns
`list [Collection]`
> A list of `Collections` that if all merged (`|` operator) would create the... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/mkCollection.py#L309-L334 |
networks-lab/metaknowledge | metaknowledge/mkCollection.py | Collection.split | def split(self, maxSize):
"""Destructively, splits the `Collection` into _maxSize_ size or smaller `Collections`. The source `Collection` will be empty after this operation
# Parameters
_maxSize_ : `int`
> The maximum number of elements in a retuned `Collection`
# Returns
... | python | def split(self, maxSize):
"""Destructively, splits the `Collection` into _maxSize_ size or smaller `Collections`. The source `Collection` will be empty after this operation
# Parameters
_maxSize_ : `int`
> The maximum number of elements in a retuned `Collection`
# Returns
... | Destructively, splits the `Collection` into _maxSize_ size or smaller `Collections`. The source `Collection` will be empty after this operation
# Parameters
_maxSize_ : `int`
> The maximum number of elements in a retuned `Collection`
# Returns
`list [Collection]`
> ... | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/mkCollection.py#L336-L364 |
networks-lab/metaknowledge | metaknowledge/mkCollection.py | CollectionWithIDs.containsID | def containsID(self, idVal):
"""Checks if the collected items contains the give _idVal_
# Parameters
_idVal_ : `str`
> The queried id string
# Returns
`bool`
> `True` if the item is in the collection
"""
for i in self:
if i.id == ... | python | def containsID(self, idVal):
"""Checks if the collected items contains the give _idVal_
# Parameters
_idVal_ : `str`
> The queried id string
# Returns
`bool`
> `True` if the item is in the collection
"""
for i in self:
if i.id == ... | Checks if the collected items contains the give _idVal_
# Parameters
_idVal_ : `str`
> The queried id string
# Returns
`bool`
> `True` if the item is in the collection | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/mkCollection.py#L420-L438 |
networks-lab/metaknowledge | metaknowledge/mkCollection.py | CollectionWithIDs.discardID | def discardID(self, idVal):
"""Checks if the collected items contains the give _idVal_ and discards it if it is found, will not raise an exception if item is not found
# Parameters
_idVal_ : `str`
> The discarded id string
"""
for i in self:
if i.id == idVa... | python | def discardID(self, idVal):
"""Checks if the collected items contains the give _idVal_ and discards it if it is found, will not raise an exception if item is not found
# Parameters
_idVal_ : `str`
> The discarded id string
"""
for i in self:
if i.id == idVa... | Checks if the collected items contains the give _idVal_ and discards it if it is found, will not raise an exception if item is not found
# Parameters
_idVal_ : `str`
> The discarded id string | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/mkCollection.py#L440-L452 |
networks-lab/metaknowledge | metaknowledge/mkCollection.py | CollectionWithIDs.removeID | def removeID(self, idVal):
"""Checks if the collected items contains the give _idVal_ and removes it if it is found, will raise a `KeyError` if item is not found
# Parameters
_idVal_ : `str`
> The removed id string
"""
for i in self:
if i.id == idVal:
... | python | def removeID(self, idVal):
"""Checks if the collected items contains the give _idVal_ and removes it if it is found, will raise a `KeyError` if item is not found
# Parameters
_idVal_ : `str`
> The removed id string
"""
for i in self:
if i.id == idVal:
... | Checks if the collected items contains the give _idVal_ and removes it if it is found, will raise a `KeyError` if item is not found
# Parameters
_idVal_ : `str`
> The removed id string | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/mkCollection.py#L454-L467 |
networks-lab/metaknowledge | metaknowledge/mkCollection.py | CollectionWithIDs.badEntries | def badEntries(self):
"""Creates a new collection of the same type with only the bad entries
# Returns
`CollectionWithIDs`
> A collection of only the bad entries
"""
badEntries = set()
for i in self:
if i.bad:
badEntries.add(i)
... | python | def badEntries(self):
"""Creates a new collection of the same type with only the bad entries
# Returns
`CollectionWithIDs`
> A collection of only the bad entries
"""
badEntries = set()
for i in self:
if i.bad:
badEntries.add(i)
... | Creates a new collection of the same type with only the bad entries
# Returns
`CollectionWithIDs`
> A collection of only the bad entries | https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/mkCollection.py#L489-L502 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.