repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens listlengths 20 707 | docstring stringlengths 3 17.3k | docstring_tokens listlengths 3 222 | sha stringlengths 40 40 | url stringlengths 87 242 | partition stringclasses 1
value | idx int64 0 252k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
wavefrontHQ/python-client | wavefront_api_client/models/search_query.py | SearchQuery.matching_method | def matching_method(self, matching_method):
"""Sets the matching_method of this SearchQuery.
The method by which search matching is performed. Default: CONTAINS # noqa: E501
:param matching_method: The matching_method of this SearchQuery. # noqa: E501
:type: str
"""
... | python | def matching_method(self, matching_method):
"""Sets the matching_method of this SearchQuery.
The method by which search matching is performed. Default: CONTAINS # noqa: E501
:param matching_method: The matching_method of this SearchQuery. # noqa: E501
:type: str
"""
... | [
"def",
"matching_method",
"(",
"self",
",",
"matching_method",
")",
":",
"allowed_values",
"=",
"[",
"\"CONTAINS\"",
",",
"\"STARTSWITH\"",
",",
"\"EXACT\"",
",",
"\"TAGPATH\"",
"]",
"# noqa: E501",
"if",
"matching_method",
"not",
"in",
"allowed_values",
":",
"rai... | Sets the matching_method of this SearchQuery.
The method by which search matching is performed. Default: CONTAINS # noqa: E501
:param matching_method: The matching_method of this SearchQuery. # noqa: E501
:type: str | [
"Sets",
"the",
"matching_method",
"of",
"this",
"SearchQuery",
"."
] | b0f1046a8f68c2c7d69e395f7167241f224c738a | https://github.com/wavefrontHQ/python-client/blob/b0f1046a8f68c2c7d69e395f7167241f224c738a/wavefront_api_client/models/search_query.py#L95-L110 | train | 28,200 |
wavefrontHQ/python-client | wavefront_api_client/models/alert.py | Alert.alert_type | def alert_type(self, alert_type):
"""Sets the alert_type of this Alert.
Alert type. # noqa: E501
:param alert_type: The alert_type of this Alert. # noqa: E501
:type: str
"""
allowed_values = ["CLASSIC", "THRESHOLD"] # noqa: E501
if alert_type not in allowed_v... | python | def alert_type(self, alert_type):
"""Sets the alert_type of this Alert.
Alert type. # noqa: E501
:param alert_type: The alert_type of this Alert. # noqa: E501
:type: str
"""
allowed_values = ["CLASSIC", "THRESHOLD"] # noqa: E501
if alert_type not in allowed_v... | [
"def",
"alert_type",
"(",
"self",
",",
"alert_type",
")",
":",
"allowed_values",
"=",
"[",
"\"CLASSIC\"",
",",
"\"THRESHOLD\"",
"]",
"# noqa: E501",
"if",
"alert_type",
"not",
"in",
"allowed_values",
":",
"raise",
"ValueError",
"(",
"\"Invalid value for `alert_type`... | Sets the alert_type of this Alert.
Alert type. # noqa: E501
:param alert_type: The alert_type of this Alert. # noqa: E501
:type: str | [
"Sets",
"the",
"alert_type",
"of",
"this",
"Alert",
"."
] | b0f1046a8f68c2c7d69e395f7167241f224c738a | https://github.com/wavefrontHQ/python-client/blob/b0f1046a8f68c2c7d69e395f7167241f224c738a/wavefront_api_client/models/alert.py#L395-L410 | train | 28,201 |
wavefrontHQ/python-client | wavefront_api_client/models/alert.py | Alert.severity_list | def severity_list(self, severity_list):
"""Sets the severity_list of this Alert.
Alert severity list for multi-threshold type. # noqa: E501
:param severity_list: The severity_list of this Alert. # noqa: E501
:type: list[str]
"""
allowed_values = ["INFO", "SMOKE", "WAR... | python | def severity_list(self, severity_list):
"""Sets the severity_list of this Alert.
Alert severity list for multi-threshold type. # noqa: E501
:param severity_list: The severity_list of this Alert. # noqa: E501
:type: list[str]
"""
allowed_values = ["INFO", "SMOKE", "WAR... | [
"def",
"severity_list",
"(",
"self",
",",
"severity_list",
")",
":",
"allowed_values",
"=",
"[",
"\"INFO\"",
",",
"\"SMOKE\"",
",",
"\"WARN\"",
",",
"\"SEVERE\"",
"]",
"# noqa: E501",
"if",
"not",
"set",
"(",
"severity_list",
")",
".",
"issubset",
"(",
"set"... | Sets the severity_list of this Alert.
Alert severity list for multi-threshold type. # noqa: E501
:param severity_list: The severity_list of this Alert. # noqa: E501
:type: list[str] | [
"Sets",
"the",
"severity_list",
"of",
"this",
"Alert",
"."
] | b0f1046a8f68c2c7d69e395f7167241f224c738a | https://github.com/wavefrontHQ/python-client/blob/b0f1046a8f68c2c7d69e395f7167241f224c738a/wavefront_api_client/models/alert.py#L1378-L1394 | train | 28,202 |
wavefrontHQ/python-client | wavefront_api_client/models/azure_activity_log_configuration.py | AzureActivityLogConfiguration.category_filter | def category_filter(self, category_filter):
"""Sets the category_filter of this AzureActivityLogConfiguration.
A list of Azure ActivityLog categories to pull events for.Allowable values are ADMINISTRATIVE, SERVICEHEALTH, ALERT, AUTOSCALE, SECURITY # noqa: E501
:param category_filter: The cate... | python | def category_filter(self, category_filter):
"""Sets the category_filter of this AzureActivityLogConfiguration.
A list of Azure ActivityLog categories to pull events for.Allowable values are ADMINISTRATIVE, SERVICEHEALTH, ALERT, AUTOSCALE, SECURITY # noqa: E501
:param category_filter: The cate... | [
"def",
"category_filter",
"(",
"self",
",",
"category_filter",
")",
":",
"allowed_values",
"=",
"[",
"\"ADMINISTRATIVE\"",
",",
"\"SERVICEHEALTH\"",
",",
"\"ALERT\"",
",",
"\"AUTOSCALE\"",
",",
"\"SECURITY\"",
"]",
"# noqa: E501",
"if",
"not",
"set",
"(",
"categor... | Sets the category_filter of this AzureActivityLogConfiguration.
A list of Azure ActivityLog categories to pull events for.Allowable values are ADMINISTRATIVE, SERVICEHEALTH, ALERT, AUTOSCALE, SECURITY # noqa: E501
:param category_filter: The category_filter of this AzureActivityLogConfiguration. # n... | [
"Sets",
"the",
"category_filter",
"of",
"this",
"AzureActivityLogConfiguration",
"."
] | b0f1046a8f68c2c7d69e395f7167241f224c738a | https://github.com/wavefrontHQ/python-client/blob/b0f1046a8f68c2c7d69e395f7167241f224c738a/wavefront_api_client/models/azure_activity_log_configuration.py#L90-L106 | train | 28,203 |
wavefrontHQ/python-client | wavefront_api_client/models/saved_search.py | SavedSearch.entity_type | def entity_type(self, entity_type):
"""Sets the entity_type of this SavedSearch.
The Wavefront entity type over which to search # noqa: E501
:param entity_type: The entity_type of this SavedSearch. # noqa: E501
:type: str
"""
if entity_type is None:
raise ... | python | def entity_type(self, entity_type):
"""Sets the entity_type of this SavedSearch.
The Wavefront entity type over which to search # noqa: E501
:param entity_type: The entity_type of this SavedSearch. # noqa: E501
:type: str
"""
if entity_type is None:
raise ... | [
"def",
"entity_type",
"(",
"self",
",",
"entity_type",
")",
":",
"if",
"entity_type",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Invalid value for `entity_type`, must not be `None`\"",
")",
"# noqa: E501",
"allowed_values",
"=",
"[",
"\"DASHBOARD\"",
",",
"\"AL... | Sets the entity_type of this SavedSearch.
The Wavefront entity type over which to search # noqa: E501
:param entity_type: The entity_type of this SavedSearch. # noqa: E501
:type: str | [
"Sets",
"the",
"entity_type",
"of",
"this",
"SavedSearch",
"."
] | b0f1046a8f68c2c7d69e395f7167241f224c738a | https://github.com/wavefrontHQ/python-client/blob/b0f1046a8f68c2c7d69e395f7167241f224c738a/wavefront_api_client/models/saved_search.py#L137-L154 | train | 28,204 |
wavefrontHQ/python-client | wavefront_api_client/models/chart.py | Chart.summarization | def summarization(self, summarization):
"""Sets the summarization of this Chart.
Summarization strategy for the chart. MEAN is default # noqa: E501
:param summarization: The summarization of this Chart. # noqa: E501
:type: str
"""
allowed_values = ["MEAN", "MEDIAN", ... | python | def summarization(self, summarization):
"""Sets the summarization of this Chart.
Summarization strategy for the chart. MEAN is default # noqa: E501
:param summarization: The summarization of this Chart. # noqa: E501
:type: str
"""
allowed_values = ["MEAN", "MEDIAN", ... | [
"def",
"summarization",
"(",
"self",
",",
"summarization",
")",
":",
"allowed_values",
"=",
"[",
"\"MEAN\"",
",",
"\"MEDIAN\"",
",",
"\"MIN\"",
",",
"\"MAX\"",
",",
"\"SUM\"",
",",
"\"COUNT\"",
",",
"\"LAST\"",
",",
"\"FIRST\"",
"]",
"# noqa: E501",
"if",
"s... | Sets the summarization of this Chart.
Summarization strategy for the chart. MEAN is default # noqa: E501
:param summarization: The summarization of this Chart. # noqa: E501
:type: str | [
"Sets",
"the",
"summarization",
"of",
"this",
"Chart",
"."
] | b0f1046a8f68c2c7d69e395f7167241f224c738a | https://github.com/wavefrontHQ/python-client/blob/b0f1046a8f68c2c7d69e395f7167241f224c738a/wavefront_api_client/models/chart.py#L323-L338 | train | 28,205 |
wavefrontHQ/python-client | wavefront_api_client/models/gcp_configuration.py | GCPConfiguration.categories_to_fetch | def categories_to_fetch(self, categories_to_fetch):
"""Sets the categories_to_fetch of this GCPConfiguration.
A list of Google Cloud Platform (GCP) services (such as ComputeEngine, PubSub, etc) from which to pull metrics. Allowable values are APPENGINE, BIGQUERY, BIGTABLE, CLOUDFUNCTIONS, CLOUDIOT, CL... | python | def categories_to_fetch(self, categories_to_fetch):
"""Sets the categories_to_fetch of this GCPConfiguration.
A list of Google Cloud Platform (GCP) services (such as ComputeEngine, PubSub, etc) from which to pull metrics. Allowable values are APPENGINE, BIGQUERY, BIGTABLE, CLOUDFUNCTIONS, CLOUDIOT, CL... | [
"def",
"categories_to_fetch",
"(",
"self",
",",
"categories_to_fetch",
")",
":",
"allowed_values",
"=",
"[",
"\"APPENGINE\"",
",",
"\"BIGQUERY\"",
",",
"\"BIGTABLE\"",
",",
"\"CLOUDFUNCTIONS\"",
",",
"\"CLOUDIOT\"",
",",
"\"CLOUDSQL\"",
",",
"\"CLOUDTASKS\"",
",",
"... | Sets the categories_to_fetch of this GCPConfiguration.
A list of Google Cloud Platform (GCP) services (such as ComputeEngine, PubSub, etc) from which to pull metrics. Allowable values are APPENGINE, BIGQUERY, BIGTABLE, CLOUDFUNCTIONS, CLOUDIOT, CLOUDSQL, CLOUDTASKS, COMPUTE, CONTAINER, DATAFLOW, DATASTORE, FI... | [
"Sets",
"the",
"categories_to_fetch",
"of",
"this",
"GCPConfiguration",
"."
] | b0f1046a8f68c2c7d69e395f7167241f224c738a | https://github.com/wavefrontHQ/python-client/blob/b0f1046a8f68c2c7d69e395f7167241f224c738a/wavefront_api_client/models/gcp_configuration.py#L75-L91 | train | 28,206 |
wavefrontHQ/python-client | wavefront_api_client/models/integration_status.py | IntegrationStatus.alert_statuses | def alert_statuses(self, alert_statuses):
"""Sets the alert_statuses of this IntegrationStatus.
A Map from the ids of the alerts contained in this integration to their install status. The install status can take on one of three values, `VISIBLE`, `HIDDEN`, and `NOT_LOADED` # noqa: E501
:para... | python | def alert_statuses(self, alert_statuses):
"""Sets the alert_statuses of this IntegrationStatus.
A Map from the ids of the alerts contained in this integration to their install status. The install status can take on one of three values, `VISIBLE`, `HIDDEN`, and `NOT_LOADED` # noqa: E501
:para... | [
"def",
"alert_statuses",
"(",
"self",
",",
"alert_statuses",
")",
":",
"if",
"alert_statuses",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Invalid value for `alert_statuses`, must not be `None`\"",
")",
"# noqa: E501",
"allowed_values",
"=",
"[",
"\"VISIBLE\"",
",... | Sets the alert_statuses of this IntegrationStatus.
A Map from the ids of the alerts contained in this integration to their install status. The install status can take on one of three values, `VISIBLE`, `HIDDEN`, and `NOT_LOADED` # noqa: E501
:param alert_statuses: The alert_statuses of this Integrat... | [
"Sets",
"the",
"alert_statuses",
"of",
"this",
"IntegrationStatus",
"."
] | b0f1046a8f68c2c7d69e395f7167241f224c738a | https://github.com/wavefrontHQ/python-client/blob/b0f1046a8f68c2c7d69e395f7167241f224c738a/wavefront_api_client/models/integration_status.py#L75-L93 | train | 28,207 |
wavefrontHQ/python-client | wavefront_api_client/models/integration_status.py | IntegrationStatus.content_status | def content_status(self, content_status):
"""Sets the content_status of this IntegrationStatus.
Status of integration content, e.g. dashboards # noqa: E501
:param content_status: The content_status of this IntegrationStatus. # noqa: E501
:type: str
"""
if content_stat... | python | def content_status(self, content_status):
"""Sets the content_status of this IntegrationStatus.
Status of integration content, e.g. dashboards # noqa: E501
:param content_status: The content_status of this IntegrationStatus. # noqa: E501
:type: str
"""
if content_stat... | [
"def",
"content_status",
"(",
"self",
",",
"content_status",
")",
":",
"if",
"content_status",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Invalid value for `content_status`, must not be `None`\"",
")",
"# noqa: E501",
"allowed_values",
"=",
"[",
"\"INVALID\"",
",... | Sets the content_status of this IntegrationStatus.
Status of integration content, e.g. dashboards # noqa: E501
:param content_status: The content_status of this IntegrationStatus. # noqa: E501
:type: str | [
"Sets",
"the",
"content_status",
"of",
"this",
"IntegrationStatus",
"."
] | b0f1046a8f68c2c7d69e395f7167241f224c738a | https://github.com/wavefrontHQ/python-client/blob/b0f1046a8f68c2c7d69e395f7167241f224c738a/wavefront_api_client/models/integration_status.py#L107-L124 | train | 28,208 |
wavefrontHQ/python-client | wavefront_api_client/models/integration_status.py | IntegrationStatus.install_status | def install_status(self, install_status):
"""Sets the install_status of this IntegrationStatus.
Whether the customer or an automated process has installed the dashboards for this integration # noqa: E501
:param install_status: The install_status of this IntegrationStatus. # noqa: E501
... | python | def install_status(self, install_status):
"""Sets the install_status of this IntegrationStatus.
Whether the customer or an automated process has installed the dashboards for this integration # noqa: E501
:param install_status: The install_status of this IntegrationStatus. # noqa: E501
... | [
"def",
"install_status",
"(",
"self",
",",
"install_status",
")",
":",
"if",
"install_status",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Invalid value for `install_status`, must not be `None`\"",
")",
"# noqa: E501",
"allowed_values",
"=",
"[",
"\"UNDECIDED\"",
... | Sets the install_status of this IntegrationStatus.
Whether the customer or an automated process has installed the dashboards for this integration # noqa: E501
:param install_status: The install_status of this IntegrationStatus. # noqa: E501
:type: str | [
"Sets",
"the",
"install_status",
"of",
"this",
"IntegrationStatus",
"."
] | b0f1046a8f68c2c7d69e395f7167241f224c738a | https://github.com/wavefrontHQ/python-client/blob/b0f1046a8f68c2c7d69e395f7167241f224c738a/wavefront_api_client/models/integration_status.py#L138-L155 | train | 28,209 |
wavefrontHQ/python-client | wavefront_api_client/models/dashboard.py | Dashboard.event_filter_type | def event_filter_type(self, event_filter_type):
"""Sets the event_filter_type of this Dashboard.
How charts belonging to this dashboard should display events. BYCHART is default if unspecified # noqa: E501
:param event_filter_type: The event_filter_type of this Dashboard. # noqa: E501
... | python | def event_filter_type(self, event_filter_type):
"""Sets the event_filter_type of this Dashboard.
How charts belonging to this dashboard should display events. BYCHART is default if unspecified # noqa: E501
:param event_filter_type: The event_filter_type of this Dashboard. # noqa: E501
... | [
"def",
"event_filter_type",
"(",
"self",
",",
"event_filter_type",
")",
":",
"allowed_values",
"=",
"[",
"\"BYCHART\"",
",",
"\"AUTOMATIC\"",
",",
"\"ALL\"",
",",
"\"NONE\"",
",",
"\"BYDASHBOARD\"",
",",
"\"BYCHARTANDDASHBOARD\"",
"]",
"# noqa: E501",
"if",
"event_f... | Sets the event_filter_type of this Dashboard.
How charts belonging to this dashboard should display events. BYCHART is default if unspecified # noqa: E501
:param event_filter_type: The event_filter_type of this Dashboard. # noqa: E501
:type: str | [
"Sets",
"the",
"event_filter_type",
"of",
"this",
"Dashboard",
"."
] | b0f1046a8f68c2c7d69e395f7167241f224c738a | https://github.com/wavefrontHQ/python-client/blob/b0f1046a8f68c2c7d69e395f7167241f224c738a/wavefront_api_client/models/dashboard.py#L596-L611 | train | 28,210 |
wavefrontHQ/python-client | wavefront_api_client/models/chart_source_query.py | ChartSourceQuery.scatter_plot_source | def scatter_plot_source(self, scatter_plot_source):
"""Sets the scatter_plot_source of this ChartSourceQuery.
For scatter plots, does this query source the X-axis or the Y-axis # noqa: E501
:param scatter_plot_source: The scatter_plot_source of this ChartSourceQuery. # noqa: E501
:ty... | python | def scatter_plot_source(self, scatter_plot_source):
"""Sets the scatter_plot_source of this ChartSourceQuery.
For scatter plots, does this query source the X-axis or the Y-axis # noqa: E501
:param scatter_plot_source: The scatter_plot_source of this ChartSourceQuery. # noqa: E501
:ty... | [
"def",
"scatter_plot_source",
"(",
"self",
",",
"scatter_plot_source",
")",
":",
"allowed_values",
"=",
"[",
"\"X\"",
",",
"\"Y\"",
"]",
"# noqa: E501",
"if",
"scatter_plot_source",
"not",
"in",
"allowed_values",
":",
"raise",
"ValueError",
"(",
"\"Invalid value for... | Sets the scatter_plot_source of this ChartSourceQuery.
For scatter plots, does this query source the X-axis or the Y-axis # noqa: E501
:param scatter_plot_source: The scatter_plot_source of this ChartSourceQuery. # noqa: E501
:type: str | [
"Sets",
"the",
"scatter_plot_source",
"of",
"this",
"ChartSourceQuery",
"."
] | b0f1046a8f68c2c7d69e395f7167241f224c738a | https://github.com/wavefrontHQ/python-client/blob/b0f1046a8f68c2c7d69e395f7167241f224c738a/wavefront_api_client/models/chart_source_query.py#L219-L234 | train | 28,211 |
wavefrontHQ/python-client | wavefront_api_client/models/notificant.py | Notificant.content_type | def content_type(self, content_type):
"""Sets the content_type of this Notificant.
The value of the Content-Type header of the webhook POST request. # noqa: E501
:param content_type: The content_type of this Notificant. # noqa: E501
:type: str
"""
allowed_values = ["a... | python | def content_type(self, content_type):
"""Sets the content_type of this Notificant.
The value of the Content-Type header of the webhook POST request. # noqa: E501
:param content_type: The content_type of this Notificant. # noqa: E501
:type: str
"""
allowed_values = ["a... | [
"def",
"content_type",
"(",
"self",
",",
"content_type",
")",
":",
"allowed_values",
"=",
"[",
"\"application/json\"",
",",
"\"text/html\"",
",",
"\"text/plain\"",
",",
"\"application/x-www-form-urlencoded\"",
",",
"\"\"",
"]",
"# noqa: E501",
"if",
"content_type",
"n... | Sets the content_type of this Notificant.
The value of the Content-Type header of the webhook POST request. # noqa: E501
:param content_type: The content_type of this Notificant. # noqa: E501
:type: str | [
"Sets",
"the",
"content_type",
"of",
"this",
"Notificant",
"."
] | b0f1046a8f68c2c7d69e395f7167241f224c738a | https://github.com/wavefrontHQ/python-client/blob/b0f1046a8f68c2c7d69e395f7167241f224c738a/wavefront_api_client/models/notificant.py#L131-L146 | train | 28,212 |
wavefrontHQ/python-client | wavefront_api_client/models/notificant.py | Notificant.method | def method(self, method):
"""Sets the method of this Notificant.
The notification method used for notification target. # noqa: E501
:param method: The method of this Notificant. # noqa: E501
:type: str
"""
if method is None:
raise ValueError("Invalid value... | python | def method(self, method):
"""Sets the method of this Notificant.
The notification method used for notification target. # noqa: E501
:param method: The method of this Notificant. # noqa: E501
:type: str
"""
if method is None:
raise ValueError("Invalid value... | [
"def",
"method",
"(",
"self",
",",
"method",
")",
":",
"if",
"method",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Invalid value for `method`, must not be `None`\"",
")",
"# noqa: E501",
"allowed_values",
"=",
"[",
"\"WEBHOOK\"",
",",
"\"EMAIL\"",
",",
"\"PA... | Sets the method of this Notificant.
The notification method used for notification target. # noqa: E501
:param method: The method of this Notificant. # noqa: E501
:type: str | [
"Sets",
"the",
"method",
"of",
"this",
"Notificant",
"."
] | b0f1046a8f68c2c7d69e395f7167241f224c738a | https://github.com/wavefrontHQ/python-client/blob/b0f1046a8f68c2c7d69e395f7167241f224c738a/wavefront_api_client/models/notificant.py#L338-L355 | train | 28,213 |
wavefrontHQ/python-client | wavefront_api_client/models/notificant.py | Notificant.triggers | def triggers(self, triggers):
"""Sets the triggers of this Notificant.
A list of occurrences on which this webhook will be fired. Valid values are ALERT_OPENED, ALERT_UPDATED, ALERT_RESOLVED, ALERT_MAINTENANCE, ALERT_SNOOZED # noqa: E501
:param triggers: The triggers of this Notificant. # n... | python | def triggers(self, triggers):
"""Sets the triggers of this Notificant.
A list of occurrences on which this webhook will be fired. Valid values are ALERT_OPENED, ALERT_UPDATED, ALERT_RESOLVED, ALERT_MAINTENANCE, ALERT_SNOOZED # noqa: E501
:param triggers: The triggers of this Notificant. # n... | [
"def",
"triggers",
"(",
"self",
",",
"triggers",
")",
":",
"if",
"triggers",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Invalid value for `triggers`, must not be `None`\"",
")",
"# noqa: E501",
"allowed_values",
"=",
"[",
"\"ALERT_OPENED\"",
",",
"\"ALERT_UPDAT... | Sets the triggers of this Notificant.
A list of occurrences on which this webhook will be fired. Valid values are ALERT_OPENED, ALERT_UPDATED, ALERT_RESOLVED, ALERT_MAINTENANCE, ALERT_SNOOZED # noqa: E501
:param triggers: The triggers of this Notificant. # noqa: E501
:type: list[str] | [
"Sets",
"the",
"triggers",
"of",
"this",
"Notificant",
"."
] | b0f1046a8f68c2c7d69e395f7167241f224c738a | https://github.com/wavefrontHQ/python-client/blob/b0f1046a8f68c2c7d69e395f7167241f224c738a/wavefront_api_client/models/notificant.py#L444-L462 | train | 28,214 |
wavefrontHQ/python-client | wavefront_api_client/models/event.py | Event.creator_type | def creator_type(self, creator_type):
"""Sets the creator_type of this Event.
:param creator_type: The creator_type of this Event. # noqa: E501
:type: list[str]
"""
allowed_values = ["USER", "ALERT", "SYSTEM"] # noqa: E501
if not set(creator_type).issubset(set(allowed... | python | def creator_type(self, creator_type):
"""Sets the creator_type of this Event.
:param creator_type: The creator_type of this Event. # noqa: E501
:type: list[str]
"""
allowed_values = ["USER", "ALERT", "SYSTEM"] # noqa: E501
if not set(creator_type).issubset(set(allowed... | [
"def",
"creator_type",
"(",
"self",
",",
"creator_type",
")",
":",
"allowed_values",
"=",
"[",
"\"USER\"",
",",
"\"ALERT\"",
",",
"\"SYSTEM\"",
"]",
"# noqa: E501",
"if",
"not",
"set",
"(",
"creator_type",
")",
".",
"issubset",
"(",
"set",
"(",
"allowed_valu... | Sets the creator_type of this Event.
:param creator_type: The creator_type of this Event. # noqa: E501
:type: list[str] | [
"Sets",
"the",
"creator_type",
"of",
"this",
"Event",
"."
] | b0f1046a8f68c2c7d69e395f7167241f224c738a | https://github.com/wavefrontHQ/python-client/blob/b0f1046a8f68c2c7d69e395f7167241f224c738a/wavefront_api_client/models/event.py#L288-L303 | train | 28,215 |
pywbem/pywbem | pywbem/_utils.py | _integerValue_to_int | def _integerValue_to_int(value_str):
"""
Convert a value string that conforms to DSP0004 `integerValue`, into
the corresponding integer and return it. The returned value has Python
type `int`, or in Python 2, type `long` if needed.
Note that DSP0207 and DSP0004 only allow US-ASCII decimal digits. H... | python | def _integerValue_to_int(value_str):
"""
Convert a value string that conforms to DSP0004 `integerValue`, into
the corresponding integer and return it. The returned value has Python
type `int`, or in Python 2, type `long` if needed.
Note that DSP0207 and DSP0004 only allow US-ASCII decimal digits. H... | [
"def",
"_integerValue_to_int",
"(",
"value_str",
")",
":",
"m",
"=",
"BINARY_VALUE",
".",
"match",
"(",
"value_str",
")",
"if",
"m",
":",
"value",
"=",
"int",
"(",
"m",
".",
"group",
"(",
"1",
")",
",",
"2",
")",
"elif",
"OCTAL_VALUE",
".",
"match",
... | Convert a value string that conforms to DSP0004 `integerValue`, into
the corresponding integer and return it. The returned value has Python
type `int`, or in Python 2, type `long` if needed.
Note that DSP0207 and DSP0004 only allow US-ASCII decimal digits. However,
the Python `int()` function supports ... | [
"Convert",
"a",
"value",
"string",
"that",
"conforms",
"to",
"DSP0004",
"integerValue",
"into",
"the",
"corresponding",
"integer",
"and",
"return",
"it",
".",
"The",
"returned",
"value",
"has",
"Python",
"type",
"int",
"or",
"in",
"Python",
"2",
"type",
"lon... | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_utils.py#L316-L342 | train | 28,216 |
pywbem/pywbem | pywbem/_utils.py | _realValue_to_float | def _realValue_to_float(value_str):
"""
Convert a value string that conforms to DSP0004 `realValue`, into
the corresponding float and return it.
The special values 'INF', '-INF', and 'NAN' are supported.
Note that the Python `float()` function supports a superset of input
formats compared to t... | python | def _realValue_to_float(value_str):
"""
Convert a value string that conforms to DSP0004 `realValue`, into
the corresponding float and return it.
The special values 'INF', '-INF', and 'NAN' are supported.
Note that the Python `float()` function supports a superset of input
formats compared to t... | [
"def",
"_realValue_to_float",
"(",
"value_str",
")",
":",
"if",
"REAL_VALUE",
".",
"match",
"(",
"value_str",
")",
":",
"value",
"=",
"float",
"(",
"value_str",
")",
"else",
":",
"value",
"=",
"None",
"return",
"value"
] | Convert a value string that conforms to DSP0004 `realValue`, into
the corresponding float and return it.
The special values 'INF', '-INF', and 'NAN' are supported.
Note that the Python `float()` function supports a superset of input
formats compared to the `realValue` definition in DSP0004. For exampl... | [
"Convert",
"a",
"value",
"string",
"that",
"conforms",
"to",
"DSP0004",
"realValue",
"into",
"the",
"corresponding",
"float",
"and",
"return",
"it",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_utils.py#L345-L365 | train | 28,217 |
pywbem/pywbem | examples/enumerator_generator.py | parse_cmdline | def parse_cmdline(argparser_):
""" Parse the command line. This tests for any required args"""
opts = argparser_.parse_args()
if not opts.server:
argparser_.error('No WBEM server specified')
return None
return opts | python | def parse_cmdline(argparser_):
""" Parse the command line. This tests for any required args"""
opts = argparser_.parse_args()
if not opts.server:
argparser_.error('No WBEM server specified')
return None
return opts | [
"def",
"parse_cmdline",
"(",
"argparser_",
")",
":",
"opts",
"=",
"argparser_",
".",
"parse_args",
"(",
")",
"if",
"not",
"opts",
".",
"server",
":",
"argparser_",
".",
"error",
"(",
"'No WBEM server specified'",
")",
"return",
"None",
"return",
"opts"
] | Parse the command line. This tests for any required args | [
"Parse",
"the",
"command",
"line",
".",
"This",
"tests",
"for",
"any",
"required",
"args"
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/examples/enumerator_generator.py#L170-L178 | train | 28,218 |
pywbem/pywbem | pywbem/cim_constants.py | _statuscode2name | def _statuscode2name(status_code):
"""Return the symbolic name for a CIM status code."""
try:
s = _STATUSCODE2NAME[status_code]
except KeyError:
s = _format("Invalid status code {0}", status_code)
return s | python | def _statuscode2name(status_code):
"""Return the symbolic name for a CIM status code."""
try:
s = _STATUSCODE2NAME[status_code]
except KeyError:
s = _format("Invalid status code {0}", status_code)
return s | [
"def",
"_statuscode2name",
"(",
"status_code",
")",
":",
"try",
":",
"s",
"=",
"_STATUSCODE2NAME",
"[",
"status_code",
"]",
"except",
"KeyError",
":",
"s",
"=",
"_format",
"(",
"\"Invalid status code {0}\"",
",",
"status_code",
")",
"return",
"s"
] | Return the symbolic name for a CIM status code. | [
"Return",
"the",
"symbolic",
"name",
"for",
"a",
"CIM",
"status",
"code",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/cim_constants.py#L208-L214 | train | 28,219 |
pywbem/pywbem | pywbem/cim_constants.py | _statuscode2string | def _statuscode2string(status_code):
"""Return a short message for a CIM status code."""
try:
s = _STATUSCODE2STRING[status_code]
except KeyError:
s = _format("Invalid status code {0}", status_code)
return s | python | def _statuscode2string(status_code):
"""Return a short message for a CIM status code."""
try:
s = _STATUSCODE2STRING[status_code]
except KeyError:
s = _format("Invalid status code {0}", status_code)
return s | [
"def",
"_statuscode2string",
"(",
"status_code",
")",
":",
"try",
":",
"s",
"=",
"_STATUSCODE2STRING",
"[",
"status_code",
"]",
"except",
"KeyError",
":",
"s",
"=",
"_format",
"(",
"\"Invalid status code {0}\"",
",",
"status_code",
")",
"return",
"s"
] | Return a short message for a CIM status code. | [
"Return",
"a",
"short",
"message",
"for",
"a",
"CIM",
"status",
"code",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/cim_constants.py#L246-L252 | train | 28,220 |
pywbem/pywbem | wbemcli.py | build_mock_repository | def build_mock_repository(conn_, file_path_list, verbose):
"""
Build the mock repository from the file_path list and fake connection
instance. This allows both mof files and python files to be used to
build the repository.
If verbose is True, it displays the respository after it is build as
mo... | python | def build_mock_repository(conn_, file_path_list, verbose):
"""
Build the mock repository from the file_path list and fake connection
instance. This allows both mof files and python files to be used to
build the repository.
If verbose is True, it displays the respository after it is build as
mo... | [
"def",
"build_mock_repository",
"(",
"conn_",
",",
"file_path_list",
",",
"verbose",
")",
":",
"for",
"file_path",
"in",
"file_path_list",
":",
"ext",
"=",
"_os",
".",
"path",
".",
"splitext",
"(",
"file_path",
")",
"[",
"1",
"]",
"if",
"not",
"_os",
"."... | Build the mock repository from the file_path list and fake connection
instance. This allows both mof files and python files to be used to
build the repository.
If verbose is True, it displays the respository after it is build as
mof. | [
"Build",
"the",
"mock",
"repository",
"from",
"the",
"file_path",
"list",
"and",
"fake",
"connection",
"instance",
".",
"This",
"allows",
"both",
"mof",
"files",
"and",
"python",
"files",
"to",
"be",
"used",
"to",
"build",
"the",
"repository",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/wbemcli.py#L132-L170 | train | 28,221 |
pywbem/pywbem | wbemcli.py | _remote_connection | def _remote_connection(server, opts, argparser_):
"""Initiate a remote connection, via PyWBEM. Arguments for
the request are part of the command line arguments and include
user name, password, namespace, etc.
"""
global CONN # pylint: disable=global-statement
if opts.timeout is not N... | python | def _remote_connection(server, opts, argparser_):
"""Initiate a remote connection, via PyWBEM. Arguments for
the request are part of the command line arguments and include
user name, password, namespace, etc.
"""
global CONN # pylint: disable=global-statement
if opts.timeout is not N... | [
"def",
"_remote_connection",
"(",
"server",
",",
"opts",
",",
"argparser_",
")",
":",
"global",
"CONN",
"# pylint: disable=global-statement",
"if",
"opts",
".",
"timeout",
"is",
"not",
"None",
":",
"if",
"opts",
".",
"timeout",
"<",
"0",
"or",
"opts",
".",
... | Initiate a remote connection, via PyWBEM. Arguments for
the request are part of the command line arguments and include
user name, password, namespace, etc. | [
"Initiate",
"a",
"remote",
"connection",
"via",
"PyWBEM",
".",
"Arguments",
"for",
"the",
"request",
"are",
"part",
"of",
"the",
"command",
"line",
"arguments",
"and",
"include",
"user",
"name",
"password",
"namespace",
"etc",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/wbemcli.py#L173-L241 | train | 28,222 |
pywbem/pywbem | wbemcli.py | _get_connection_info | def _get_connection_info():
"""Return a string with the connection info."""
info = 'Connection: %s,' % CONN.url
if CONN.creds is not None:
info += ' userid=%s,' % CONN.creds[0]
else:
info += ' no creds,'
info += ' cacerts=%s,' % ('sys-default' if CONN.ca_certs is None
... | python | def _get_connection_info():
"""Return a string with the connection info."""
info = 'Connection: %s,' % CONN.url
if CONN.creds is not None:
info += ' userid=%s,' % CONN.creds[0]
else:
info += ' no creds,'
info += ' cacerts=%s,' % ('sys-default' if CONN.ca_certs is None
... | [
"def",
"_get_connection_info",
"(",
")",
":",
"info",
"=",
"'Connection: %s,'",
"%",
"CONN",
".",
"url",
"if",
"CONN",
".",
"creds",
"is",
"not",
"None",
":",
"info",
"+=",
"' userid=%s,'",
"%",
"CONN",
".",
"creds",
"[",
"0",
"]",
"else",
":",
"info",... | Return a string with the connection info. | [
"Return",
"a",
"string",
"with",
"the",
"connection",
"info",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/wbemcli.py#L3074-L3108 | train | 28,223 |
pywbem/pywbem | wbemcli.py | _get_banner | def _get_banner():
"""Return a banner message for the interactive console."""
result = ''
result += '\nPython %s' % _sys.version
result += '\n\nWbemcli interactive shell'
result += '\n%s' % _get_connection_info()
# Give hint about exiting. Most people exit with 'quit()' which will
# not re... | python | def _get_banner():
"""Return a banner message for the interactive console."""
result = ''
result += '\nPython %s' % _sys.version
result += '\n\nWbemcli interactive shell'
result += '\n%s' % _get_connection_info()
# Give hint about exiting. Most people exit with 'quit()' which will
# not re... | [
"def",
"_get_banner",
"(",
")",
":",
"result",
"=",
"''",
"result",
"+=",
"'\\nPython %s'",
"%",
"_sys",
".",
"version",
"result",
"+=",
"'\\n\\nWbemcli interactive shell'",
"result",
"+=",
"'\\n%s'",
"%",
"_get_connection_info",
"(",
")",
"# Give hint about exiting... | Return a banner message for the interactive console. | [
"Return",
"a",
"banner",
"message",
"for",
"the",
"interactive",
"console",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/wbemcli.py#L3111-L3128 | train | 28,224 |
pywbem/pywbem | pywbem_mock/_dmtf_cim_schema.py | DMTFCIMSchema._setup_dmtf_schema | def _setup_dmtf_schema(self):
"""
Install the DMTF CIM schema from the DMTF web site if it is not already
installed. This includes downloading the DMTF CIM schema zip file from
the DMTF web site and expanding that file into a subdirectory defined
by `schema_mof_dir`.
Onc... | python | def _setup_dmtf_schema(self):
"""
Install the DMTF CIM schema from the DMTF web site if it is not already
installed. This includes downloading the DMTF CIM schema zip file from
the DMTF web site and expanding that file into a subdirectory defined
by `schema_mof_dir`.
Onc... | [
"def",
"_setup_dmtf_schema",
"(",
"self",
")",
":",
"def",
"print_verbose",
"(",
"msg",
")",
":",
"\"\"\"\n Inner method prints msg if self.verbose is `True`.\n \"\"\"",
"if",
"self",
".",
"verbose",
":",
"print",
"(",
"msg",
")",
"if",
"not",
"o... | Install the DMTF CIM schema from the DMTF web site if it is not already
installed. This includes downloading the DMTF CIM schema zip file from
the DMTF web site and expanding that file into a subdirectory defined
by `schema_mof_dir`.
Once the schema zip file is downloaded into `schema_r... | [
"Install",
"the",
"DMTF",
"CIM",
"schema",
"from",
"the",
"DMTF",
"web",
"site",
"if",
"it",
"is",
"not",
"already",
"installed",
".",
"This",
"includes",
"downloading",
"the",
"DMTF",
"CIM",
"schema",
"zip",
"file",
"from",
"the",
"DMTF",
"web",
"site",
... | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem_mock/_dmtf_cim_schema.py#L299-L384 | train | 28,225 |
pywbem/pywbem | pywbem_mock/_dmtf_cim_schema.py | DMTFCIMSchema.clean | def clean(self):
"""
Remove all of the MOF files and the `schema_mof_dir` for the defined
schema. This is useful because while the downloaded schema is a single
compressed zip file, it creates several thousand MOF files that take up
considerable space.
The next time the... | python | def clean(self):
"""
Remove all of the MOF files and the `schema_mof_dir` for the defined
schema. This is useful because while the downloaded schema is a single
compressed zip file, it creates several thousand MOF files that take up
considerable space.
The next time the... | [
"def",
"clean",
"(",
"self",
")",
":",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"self",
".",
"schema_mof_dir",
")",
":",
"shutil",
".",
"rmtree",
"(",
"self",
".",
"schema_mof_dir",
")"
] | Remove all of the MOF files and the `schema_mof_dir` for the defined
schema. This is useful because while the downloaded schema is a single
compressed zip file, it creates several thousand MOF files that take up
considerable space.
The next time the :class:`~pywbem_mock.DMTFCIMSchema` ... | [
"Remove",
"all",
"of",
"the",
"MOF",
"files",
"and",
"the",
"schema_mof_dir",
"for",
"the",
"defined",
"schema",
".",
"This",
"is",
"useful",
"because",
"while",
"the",
"downloaded",
"schema",
"is",
"a",
"single",
"compressed",
"zip",
"file",
"it",
"creates"... | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem_mock/_dmtf_cim_schema.py#L445-L457 | train | 28,226 |
pywbem/pywbem | pywbem_mock/_dmtf_cim_schema.py | DMTFCIMSchema.remove | def remove(self):
"""
The `schema_mof_dir` directory is removed if it esists and the
`schema_zip_file` is removed if it exists. If the `schema_root_dir` is
empty after these removals that directory is removed.
"""
self.clean()
if os.path.isfile(self.schema_zip_fil... | python | def remove(self):
"""
The `schema_mof_dir` directory is removed if it esists and the
`schema_zip_file` is removed if it exists. If the `schema_root_dir` is
empty after these removals that directory is removed.
"""
self.clean()
if os.path.isfile(self.schema_zip_fil... | [
"def",
"remove",
"(",
"self",
")",
":",
"self",
".",
"clean",
"(",
")",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"self",
".",
"schema_zip_file",
")",
":",
"os",
".",
"remove",
"(",
"self",
".",
"schema_zip_file",
")",
"if",
"os",
".",
"path",
... | The `schema_mof_dir` directory is removed if it esists and the
`schema_zip_file` is removed if it exists. If the `schema_root_dir` is
empty after these removals that directory is removed. | [
"The",
"schema_mof_dir",
"directory",
"is",
"removed",
"if",
"it",
"esists",
"and",
"the",
"schema_zip_file",
"is",
"removed",
"if",
"it",
"exists",
".",
"If",
"the",
"schema_root_dir",
"is",
"empty",
"after",
"these",
"removals",
"that",
"directory",
"is",
"r... | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem_mock/_dmtf_cim_schema.py#L459-L470 | train | 28,227 |
pywbem/pywbem | try/run_central_instances.py | print_table | def print_table(title, headers, rows, sort_columns=None):
"""
Print a table of rows with headers using tabulate.
Parameters:
title (:term: string):
String that will be output before the Table.
headers (list or tuple):
List of strings that defines the header for each ... | python | def print_table(title, headers, rows, sort_columns=None):
"""
Print a table of rows with headers using tabulate.
Parameters:
title (:term: string):
String that will be output before the Table.
headers (list or tuple):
List of strings that defines the header for each ... | [
"def",
"print_table",
"(",
"title",
",",
"headers",
",",
"rows",
",",
"sort_columns",
"=",
"None",
")",
":",
"if",
"sort_columns",
"is",
"not",
"None",
":",
"if",
"isinstance",
"(",
"sort_columns",
",",
"int",
")",
":",
"rows",
"=",
"sorted",
"(",
"row... | Print a table of rows with headers using tabulate.
Parameters:
title (:term: string):
String that will be output before the Table.
headers (list or tuple):
List of strings that defines the header for each row. Each string
in this list may be multiline by inserting... | [
"Print",
"a",
"table",
"of",
"rows",
"with",
"headers",
"using",
"tabulate",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/try/run_central_instances.py#L167-L204 | train | 28,228 |
pywbem/pywbem | try/run_central_instances.py | fold_list | def fold_list(input_list, max_width=None):
"""
Fold the entries in input_list. If max_width is not None, fold only if it
is longer than max_width. Otherwise fold each entry.
"""
if not input_list:
return ""
if not isinstance(input_list[0], six.string_types):
input_list = [str(ite... | python | def fold_list(input_list, max_width=None):
"""
Fold the entries in input_list. If max_width is not None, fold only if it
is longer than max_width. Otherwise fold each entry.
"""
if not input_list:
return ""
if not isinstance(input_list[0], six.string_types):
input_list = [str(ite... | [
"def",
"fold_list",
"(",
"input_list",
",",
"max_width",
"=",
"None",
")",
":",
"if",
"not",
"input_list",
":",
"return",
"\"\"",
"if",
"not",
"isinstance",
"(",
"input_list",
"[",
"0",
"]",
",",
"six",
".",
"string_types",
")",
":",
"input_list",
"=",
... | Fold the entries in input_list. If max_width is not None, fold only if it
is longer than max_width. Otherwise fold each entry. | [
"Fold",
"the",
"entries",
"in",
"input_list",
".",
"If",
"max_width",
"is",
"not",
"None",
"fold",
"only",
"if",
"it",
"is",
"longer",
"than",
"max_width",
".",
"Otherwise",
"fold",
"each",
"entry",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/try/run_central_instances.py#L207-L221 | train | 28,229 |
pywbem/pywbem | try/run_central_instances.py | fold_string | def fold_string(input_string, max_width):
"""
Fold a string within a maximum width.
Parameters:
input_string:
The string of data to go into the cell
max_width:
Maximum width of cell. Data is folded into multiple lines to
fit into this width.
Return:
... | python | def fold_string(input_string, max_width):
"""
Fold a string within a maximum width.
Parameters:
input_string:
The string of data to go into the cell
max_width:
Maximum width of cell. Data is folded into multiple lines to
fit into this width.
Return:
... | [
"def",
"fold_string",
"(",
"input_string",
",",
"max_width",
")",
":",
"new_string",
"=",
"input_string",
"if",
"isinstance",
"(",
"input_string",
",",
"six",
".",
"string_types",
")",
":",
"if",
"max_width",
"<",
"len",
"(",
"input_string",
")",
":",
"# use... | Fold a string within a maximum width.
Parameters:
input_string:
The string of data to go into the cell
max_width:
Maximum width of cell. Data is folded into multiple lines to
fit into this width.
Return:
String representing the folded string | [
"Fold",
"a",
"string",
"within",
"a",
"maximum",
"width",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/try/run_central_instances.py#L224-L245 | train | 28,230 |
pywbem/pywbem | try/run_central_instances.py | path_wo_ns | def path_wo_ns(obj):
"""
Return path of an instance or instance path without host or namespace.
Creates copy of the object so the original is not changed.
"""
if isinstance(obj, pywbem.CIMInstance):
path = obj.path.copy()
elif isinstance(obj, pywbem.CIMInstanceName):
path = obj.c... | python | def path_wo_ns(obj):
"""
Return path of an instance or instance path without host or namespace.
Creates copy of the object so the original is not changed.
"""
if isinstance(obj, pywbem.CIMInstance):
path = obj.path.copy()
elif isinstance(obj, pywbem.CIMInstanceName):
path = obj.c... | [
"def",
"path_wo_ns",
"(",
"obj",
")",
":",
"if",
"isinstance",
"(",
"obj",
",",
"pywbem",
".",
"CIMInstance",
")",
":",
"path",
"=",
"obj",
".",
"path",
".",
"copy",
"(",
")",
"elif",
"isinstance",
"(",
"obj",
",",
"pywbem",
".",
"CIMInstanceName",
"... | Return path of an instance or instance path without host or namespace.
Creates copy of the object so the original is not changed. | [
"Return",
"path",
"of",
"an",
"instance",
"or",
"instance",
"path",
"without",
"host",
"or",
"namespace",
".",
"Creates",
"copy",
"of",
"the",
"object",
"so",
"the",
"original",
"is",
"not",
"changed",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/try/run_central_instances.py#L291-L305 | train | 28,231 |
pywbem/pywbem | try/run_central_instances.py | connect | def connect(nickname, server_def, debug=None, timeout=10):
"""
Connect and confirm server works by testing for a known class in
the default namespace or if there is no default namespace defined,
in all the possible interop namespaces.
returns a WBEMConnection object or None if the connection fails.... | python | def connect(nickname, server_def, debug=None, timeout=10):
"""
Connect and confirm server works by testing for a known class in
the default namespace or if there is no default namespace defined,
in all the possible interop namespaces.
returns a WBEMConnection object or None if the connection fails.... | [
"def",
"connect",
"(",
"nickname",
",",
"server_def",
",",
"debug",
"=",
"None",
",",
"timeout",
"=",
"10",
")",
":",
"url",
"=",
"server_def",
".",
"url",
"conn",
"=",
"pywbem",
".",
"WBEMConnection",
"(",
"url",
",",
"(",
"server_def",
".",
"user",
... | Connect and confirm server works by testing for a known class in
the default namespace or if there is no default namespace defined,
in all the possible interop namespaces.
returns a WBEMConnection object or None if the connection fails. | [
"Connect",
"and",
"confirm",
"server",
"works",
"by",
"testing",
"for",
"a",
"known",
"class",
"in",
"the",
"default",
"namespace",
"or",
"if",
"there",
"is",
"no",
"default",
"namespace",
"defined",
"in",
"all",
"the",
"possible",
"interop",
"namespaces",
"... | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/try/run_central_instances.py#L351-L393 | train | 28,232 |
pywbem/pywbem | try/run_central_instances.py | overview | def overview(name, server):
"""
Overview of the server as seen through the properties of the server
class.
"""
print('%s OVERVIEW' % name)
print(" Interop namespace: %s" % server.interop_ns)
print(" Brand: %s" % server.brand)
print(" Version: %s" % server.version)
print(" Namespa... | python | def overview(name, server):
"""
Overview of the server as seen through the properties of the server
class.
"""
print('%s OVERVIEW' % name)
print(" Interop namespace: %s" % server.interop_ns)
print(" Brand: %s" % server.brand)
print(" Version: %s" % server.version)
print(" Namespa... | [
"def",
"overview",
"(",
"name",
",",
"server",
")",
":",
"print",
"(",
"'%s OVERVIEW'",
"%",
"name",
")",
"print",
"(",
"\" Interop namespace: %s\"",
"%",
"server",
".",
"interop_ns",
")",
"print",
"(",
"\" Brand: %s\"",
"%",
"server",
".",
"brand",
")",
... | Overview of the server as seen through the properties of the server
class. | [
"Overview",
"of",
"the",
"server",
"as",
"seen",
"through",
"the",
"properties",
"of",
"the",
"server",
"class",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/try/run_central_instances.py#L454-L485 | train | 28,233 |
pywbem/pywbem | try/run_central_instances.py | get_references | def get_references(profile_path, role, profile_name, server):
"""
Get display and return the References for the path provided, ResultClass
CIM_ReferencedProfile, and the role provided.
"""
references_for_profile = server.conn.References(
ObjectName=profile_path,
ResultClass="CIM_Refe... | python | def get_references(profile_path, role, profile_name, server):
"""
Get display and return the References for the path provided, ResultClass
CIM_ReferencedProfile, and the role provided.
"""
references_for_profile = server.conn.References(
ObjectName=profile_path,
ResultClass="CIM_Refe... | [
"def",
"get_references",
"(",
"profile_path",
",",
"role",
",",
"profile_name",
",",
"server",
")",
":",
"references_for_profile",
"=",
"server",
".",
"conn",
".",
"References",
"(",
"ObjectName",
"=",
"profile_path",
",",
"ResultClass",
"=",
"\"CIM_ReferencedProf... | Get display and return the References for the path provided, ResultClass
CIM_ReferencedProfile, and the role provided. | [
"Get",
"display",
"and",
"return",
"the",
"References",
"for",
"the",
"path",
"provided",
"ResultClass",
"CIM_ReferencedProfile",
"and",
"the",
"role",
"provided",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/try/run_central_instances.py#L525-L544 | train | 28,234 |
pywbem/pywbem | try/run_central_instances.py | show_profiles | def show_profiles(name, server, org_vm):
"""
Create a table of info about the profiles based on getting the
references, etc. both in the dependent and antecedent direction.
The resulting table is printed.
"""
rows = []
for profile_inst in server.profiles:
pn = profile_name(org_vm, p... | python | def show_profiles(name, server, org_vm):
"""
Create a table of info about the profiles based on getting the
references, etc. both in the dependent and antecedent direction.
The resulting table is printed.
"""
rows = []
for profile_inst in server.profiles:
pn = profile_name(org_vm, p... | [
"def",
"show_profiles",
"(",
"name",
",",
"server",
",",
"org_vm",
")",
":",
"rows",
"=",
"[",
"]",
"for",
"profile_inst",
"in",
"server",
".",
"profiles",
":",
"pn",
"=",
"profile_name",
"(",
"org_vm",
",",
"profile_inst",
")",
"deps",
"=",
"get_associa... | Create a table of info about the profiles based on getting the
references, etc. both in the dependent and antecedent direction.
The resulting table is printed. | [
"Create",
"a",
"table",
"of",
"info",
"about",
"the",
"profiles",
"based",
"on",
"getting",
"the",
"references",
"etc",
".",
"both",
"in",
"the",
"dependent",
"and",
"antecedent",
"direction",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/try/run_central_instances.py#L547-L588 | train | 28,235 |
pywbem/pywbem | try/run_central_instances.py | fold_path | def fold_path(path, width=30):
"""
Fold a string form of a path so that each element is on separate line
"""
assert isinstance(path, six.string_types)
if len(path) > width:
path.replace(".", ".\n ")
return path | python | def fold_path(path, width=30):
"""
Fold a string form of a path so that each element is on separate line
"""
assert isinstance(path, six.string_types)
if len(path) > width:
path.replace(".", ".\n ")
return path | [
"def",
"fold_path",
"(",
"path",
",",
"width",
"=",
"30",
")",
":",
"assert",
"isinstance",
"(",
"path",
",",
"six",
".",
"string_types",
")",
"if",
"len",
"(",
"path",
")",
">",
"width",
":",
"path",
".",
"replace",
"(",
"\".\"",
",",
"\".\\n \""... | Fold a string form of a path so that each element is on separate line | [
"Fold",
"a",
"string",
"form",
"of",
"a",
"path",
"so",
"that",
"each",
"element",
"is",
"on",
"separate",
"line"
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/try/run_central_instances.py#L591-L598 | train | 28,236 |
pywbem/pywbem | try/run_central_instances.py | count_ref_associators | def count_ref_associators(nickname, server, profile_insts, org_vm):
"""
Get dict of counts of associator returns for ResultRole == Dependent and
ResultRole == Antecedent for profiles in list. This method counts by
executing repeated AssociationName calls on CIM_ReferencedProfile for each
profile in... | python | def count_ref_associators(nickname, server, profile_insts, org_vm):
"""
Get dict of counts of associator returns for ResultRole == Dependent and
ResultRole == Antecedent for profiles in list. This method counts by
executing repeated AssociationName calls on CIM_ReferencedProfile for each
profile in... | [
"def",
"count_ref_associators",
"(",
"nickname",
",",
"server",
",",
"profile_insts",
",",
"org_vm",
")",
":",
"def",
"get_assoc_count",
"(",
"server",
",",
"profile_inst",
")",
":",
"\"\"\"\n Execute Associator names with ResultRole as 'Dependent' and then as\n ... | Get dict of counts of associator returns for ResultRole == Dependent and
ResultRole == Antecedent for profiles in list. This method counts by
executing repeated AssociationName calls on CIM_ReferencedProfile for each
profile instance in profile_insts with the result Role set to Dependent and
then Antec... | [
"Get",
"dict",
"of",
"counts",
"of",
"associator",
"returns",
"for",
"ResultRole",
"==",
"Dependent",
"and",
"ResultRole",
"==",
"Antecedent",
"for",
"profiles",
"in",
"list",
".",
"This",
"method",
"counts",
"by",
"executing",
"repeated",
"AssociationName",
"ca... | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/try/run_central_instances.py#L601-L651 | train | 28,237 |
pywbem/pywbem | try/run_central_instances.py | fast_count_associators | def fast_count_associators(server):
"""
Create count of associators for CIM_ReferencedProfile using the
antecedent and dependent reference properties as ResultRole for each profile
defined in server.profiles and return a dictionary of the count. This
code does a shortcut in executing EnumerateInstan... | python | def fast_count_associators(server):
"""
Create count of associators for CIM_ReferencedProfile using the
antecedent and dependent reference properties as ResultRole for each profile
defined in server.profiles and return a dictionary of the count. This
code does a shortcut in executing EnumerateInstan... | [
"def",
"fast_count_associators",
"(",
"server",
")",
":",
"try",
":",
"ref_insts",
"=",
"server",
".",
"conn",
".",
"EnumerateInstances",
"(",
"\"CIM_ReferencedProfile\"",
",",
"namespace",
"=",
"server",
".",
"interop_ns",
")",
"# Remove host from responses since the... | Create count of associators for CIM_ReferencedProfile using the
antecedent and dependent reference properties as ResultRole for each profile
defined in server.profiles and return a dictionary of the count. This
code does a shortcut in executing EnumerateInstances to get
CIM_ReferencedProfile and process... | [
"Create",
"count",
"of",
"associators",
"for",
"CIM_ReferencedProfile",
"using",
"the",
"antecedent",
"and",
"dependent",
"reference",
"properties",
"as",
"ResultRole",
"for",
"each",
"profile",
"defined",
"in",
"server",
".",
"profiles",
"and",
"return",
"a",
"di... | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/try/run_central_instances.py#L755-L819 | train | 28,238 |
pywbem/pywbem | try/run_central_instances.py | show_instances | def show_instances(server, cim_class):
"""
Display the instances of the CIM_Class defined by cim_class. If the
namespace is None, use the interop namespace. Search all namespaces for
instances except for CIM_RegisteredProfile
"""
if cim_class == 'CIM_RegisteredProfile':
for inst in serve... | python | def show_instances(server, cim_class):
"""
Display the instances of the CIM_Class defined by cim_class. If the
namespace is None, use the interop namespace. Search all namespaces for
instances except for CIM_RegisteredProfile
"""
if cim_class == 'CIM_RegisteredProfile':
for inst in serve... | [
"def",
"show_instances",
"(",
"server",
",",
"cim_class",
")",
":",
"if",
"cim_class",
"==",
"'CIM_RegisteredProfile'",
":",
"for",
"inst",
"in",
"server",
".",
"profiles",
":",
"print",
"(",
"inst",
".",
"tomof",
"(",
")",
")",
"return",
"for",
"ns",
"i... | Display the instances of the CIM_Class defined by cim_class. If the
namespace is None, use the interop namespace. Search all namespaces for
instances except for CIM_RegisteredProfile | [
"Display",
"the",
"instances",
"of",
"the",
"CIM_Class",
"defined",
"by",
"cim_class",
".",
"If",
"the",
"namespace",
"is",
"None",
"use",
"the",
"interop",
"namespace",
".",
"Search",
"all",
"namespaces",
"for",
"instances",
"except",
"for",
"CIM_RegisteredProf... | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/try/run_central_instances.py#L1096-L1118 | train | 28,239 |
pywbem/pywbem | try/run_central_instances.py | get_profiles_in_svr | def get_profiles_in_svr(nickname, server, all_profiles_dict, org_vm,
add_error_list=False):
"""
Test all profiles in server.profiles to determine if profile is in
the all_profiles_dict.
Returns list of profiles in the profile_dict and in the defined server.
If add_error_list... | python | def get_profiles_in_svr(nickname, server, all_profiles_dict, org_vm,
add_error_list=False):
"""
Test all profiles in server.profiles to determine if profile is in
the all_profiles_dict.
Returns list of profiles in the profile_dict and in the defined server.
If add_error_list... | [
"def",
"get_profiles_in_svr",
"(",
"nickname",
",",
"server",
",",
"all_profiles_dict",
",",
"org_vm",
",",
"add_error_list",
"=",
"False",
")",
":",
"profiles_in_dict",
"=",
"[",
"]",
"for",
"profile_inst",
"in",
"server",
".",
"profiles",
":",
"pn",
"=",
"... | Test all profiles in server.profiles to determine if profile is in
the all_profiles_dict.
Returns list of profiles in the profile_dict and in the defined server.
If add_error_list is True, it also adds profiles not found to
PROFILES_WITH_NO_DEFINITIONS. | [
"Test",
"all",
"profiles",
"in",
"server",
".",
"profiles",
"to",
"determine",
"if",
"profile",
"is",
"in",
"the",
"all_profiles_dict",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/try/run_central_instances.py#L1216-L1236 | train | 28,240 |
pywbem/pywbem | try/run_central_instances.py | possible_target_profiles | def possible_target_profiles(nickname, server, all_profiles_dict,
org_vm, autonomous=True, output='path'):
"""
Get list of possible autonomous or component profiles based on the list
of all profiles and the list of profiles in the defined server.
Returns list of *paths or i... | python | def possible_target_profiles(nickname, server, all_profiles_dict,
org_vm, autonomous=True, output='path'):
"""
Get list of possible autonomous or component profiles based on the list
of all profiles and the list of profiles in the defined server.
Returns list of *paths or i... | [
"def",
"possible_target_profiles",
"(",
"nickname",
",",
"server",
",",
"all_profiles_dict",
",",
"org_vm",
",",
"autonomous",
"=",
"True",
",",
"output",
"=",
"'path'",
")",
":",
"assert",
"output",
"in",
"[",
"'path'",
",",
"'name'",
"]",
"profiles_in_svr",
... | Get list of possible autonomous or component profiles based on the list
of all profiles and the list of profiles in the defined server.
Returns list of *paths or insts, or profile names depending on the value
of the output parameter. | [
"Get",
"list",
"of",
"possible",
"autonomous",
"or",
"component",
"profiles",
"based",
"on",
"the",
"list",
"of",
"all",
"profiles",
"and",
"the",
"list",
"of",
"profiles",
"in",
"the",
"defined",
"server",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/try/run_central_instances.py#L1286-L1317 | train | 28,241 |
pywbem/pywbem | try/run_central_instances.py | show_tree | def show_tree(nickname, server, org_vm, reference_direction='snia'):
"""
sShow a tree view of the registered profiles using the ECTP and
referencedprofile associations to define the tree. Starts with SMI-S
if it iexists
"""
scoping_result_role = "Dependent" if reference_direction == 'snia' \
... | python | def show_tree(nickname, server, org_vm, reference_direction='snia'):
"""
sShow a tree view of the registered profiles using the ECTP and
referencedprofile associations to define the tree. Starts with SMI-S
if it iexists
"""
scoping_result_role = "Dependent" if reference_direction == 'snia' \
... | [
"def",
"show_tree",
"(",
"nickname",
",",
"server",
",",
"org_vm",
",",
"reference_direction",
"=",
"'snia'",
")",
":",
"scoping_result_role",
"=",
"\"Dependent\"",
"if",
"reference_direction",
"==",
"'snia'",
"else",
"\"Antecedent\"",
"profiles",
"=",
"server",
"... | sShow a tree view of the registered profiles using the ECTP and
referencedprofile associations to define the tree. Starts with SMI-S
if it iexists | [
"sShow",
"a",
"tree",
"view",
"of",
"the",
"registered",
"profiles",
"using",
"the",
"ECTP",
"and",
"referencedprofile",
"associations",
"to",
"define",
"the",
"tree",
".",
"Starts",
"with",
"SMI",
"-",
"S",
"if",
"it",
"iexists"
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/try/run_central_instances.py#L1480-L1544 | train | 28,242 |
pywbem/pywbem | try/run_central_instances.py | display_servers | def display_servers(server_definitions_filename):
"""
display the defined servers information as a table.
"""
servers = ServerDefinitionFile2(server_definitions_filename)
title = 'List of all servers that can be tested'
headers = ['Name', 'Url', 'Default_namespace']
rows = []
for serve... | python | def display_servers(server_definitions_filename):
"""
display the defined servers information as a table.
"""
servers = ServerDefinitionFile2(server_definitions_filename)
title = 'List of all servers that can be tested'
headers = ['Name', 'Url', 'Default_namespace']
rows = []
for serve... | [
"def",
"display_servers",
"(",
"server_definitions_filename",
")",
":",
"servers",
"=",
"ServerDefinitionFile2",
"(",
"server_definitions_filename",
")",
"title",
"=",
"'List of all servers that can be tested'",
"headers",
"=",
"[",
"'Name'",
",",
"'Url'",
",",
"'Default_... | display the defined servers information as a table. | [
"display",
"the",
"defined",
"servers",
"information",
"as",
"a",
"table",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/try/run_central_instances.py#L1677-L1693 | train | 28,243 |
pywbem/pywbem | try/run_central_instances.py | ElapsedTimer.elapsed_ms | def elapsed_ms(self):
""" Get the elapsed time in milliseconds. returns floating
point representation of elapsed time in seconds.
"""
dt = datetime.datetime.now() - self.start_time
return ((dt.days * 24 * 3600) + dt.seconds) * 1000 \
+ dt.microseconds / 1000.0 | python | def elapsed_ms(self):
""" Get the elapsed time in milliseconds. returns floating
point representation of elapsed time in seconds.
"""
dt = datetime.datetime.now() - self.start_time
return ((dt.days * 24 * 3600) + dt.seconds) * 1000 \
+ dt.microseconds / 1000.0 | [
"def",
"elapsed_ms",
"(",
"self",
")",
":",
"dt",
"=",
"datetime",
".",
"datetime",
".",
"now",
"(",
")",
"-",
"self",
".",
"start_time",
"return",
"(",
"(",
"dt",
".",
"days",
"*",
"24",
"*",
"3600",
")",
"+",
"dt",
".",
"seconds",
")",
"*",
"... | Get the elapsed time in milliseconds. returns floating
point representation of elapsed time in seconds. | [
"Get",
"the",
"elapsed",
"time",
"in",
"milliseconds",
".",
"returns",
"floating",
"point",
"representation",
"of",
"elapsed",
"time",
"in",
"seconds",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/try/run_central_instances.py#L141-L147 | train | 28,244 |
pywbem/pywbem | try/run_central_instances.py | ServerDefinitionFile2.list_servers | def list_servers(self, nicknames=None):
"""
Iterate through the servers of the server group with the specified
nicknames, or the single server with the specified nickname, and yield
a `ServerDefinition` object for each server.
nicknames may be: None, string defining a nickname o... | python | def list_servers(self, nicknames=None):
"""
Iterate through the servers of the server group with the specified
nicknames, or the single server with the specified nickname, and yield
a `ServerDefinition` object for each server.
nicknames may be: None, string defining a nickname o... | [
"def",
"list_servers",
"(",
"self",
",",
"nicknames",
"=",
"None",
")",
":",
"if",
"not",
"nicknames",
":",
"return",
"self",
".",
"list_all_servers",
"(",
")",
"if",
"isinstance",
"(",
"nicknames",
",",
"six",
".",
"string_types",
")",
":",
"nicknames",
... | Iterate through the servers of the server group with the specified
nicknames, or the single server with the specified nickname, and yield
a `ServerDefinition` object for each server.
nicknames may be: None, string defining a nickname or list of nicknames | [
"Iterate",
"through",
"the",
"servers",
"of",
"the",
"server",
"group",
"with",
"the",
"specified",
"nicknames",
"or",
"the",
"single",
"server",
"with",
"the",
"specified",
"nickname",
"and",
"yield",
"a",
"ServerDefinition",
"object",
"for",
"each",
"server",
... | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/try/run_central_instances.py#L318-L348 | train | 28,245 |
pywbem/pywbem | examples/wbemcli_server.py | print_profile_info | def print_profile_info(org_vm, profile_instance):
"""
Print information on a profile defined by profile_instance.
Parameters:
org_vm: The value mapping for CIMRegisterdProfile and
RegisteredOrganization so that the value and not value mapping
is displayed.
profile_instance... | python | def print_profile_info(org_vm, profile_instance):
"""
Print information on a profile defined by profile_instance.
Parameters:
org_vm: The value mapping for CIMRegisterdProfile and
RegisteredOrganization so that the value and not value mapping
is displayed.
profile_instance... | [
"def",
"print_profile_info",
"(",
"org_vm",
",",
"profile_instance",
")",
":",
"org",
"=",
"org_vm",
".",
"tovalues",
"(",
"profile_instance",
"[",
"'RegisteredOrganization'",
"]",
")",
"name",
"=",
"profile_instance",
"[",
"'RegisteredName'",
"]",
"vers",
"=",
... | Print information on a profile defined by profile_instance.
Parameters:
org_vm: The value mapping for CIMRegisterdProfile and
RegisteredOrganization so that the value and not value mapping
is displayed.
profile_instance: instance of a profile to be printed | [
"Print",
"information",
"on",
"a",
"profile",
"defined",
"by",
"profile_instance",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/examples/wbemcli_server.py#L12-L27 | train | 28,246 |
pywbem/pywbem | examples/send_indications.py | create_indication_data | def create_indication_data(msg_id, sequence_number, source_id, delta_time, \
protocol_ver):
'''
Create a singled indication XML from the template and the included
sequence_number, delta_time, and protocol_ver
Returns the completed indication XML
'''
data_template = "... | python | def create_indication_data(msg_id, sequence_number, source_id, delta_time, \
protocol_ver):
'''
Create a singled indication XML from the template and the included
sequence_number, delta_time, and protocol_ver
Returns the completed indication XML
'''
data_template = "... | [
"def",
"create_indication_data",
"(",
"msg_id",
",",
"sequence_number",
",",
"source_id",
",",
"delta_time",
",",
"protocol_ver",
")",
":",
"data_template",
"=",
"\"\"\"<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n <CIM CIMVERSION=\"2.0\" DTDVERSION=\"2.4\">\n <MESSAGE ID=\"%... | Create a singled indication XML from the template and the included
sequence_number, delta_time, and protocol_ver
Returns the completed indication XML | [
"Create",
"a",
"singled",
"indication",
"XML",
"from",
"the",
"template",
"and",
"the",
"included",
"sequence_number",
"delta_time",
"and",
"protocol_ver"
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/examples/send_indications.py#L53-L91 | train | 28,247 |
pywbem/pywbem | examples/send_indications.py | send_indication | def send_indication(url, headers, payload, verbose, verify=None, keyfile=None,
timeout=4):
'''
Send indication using requests module.
Parameters:
url(:term:`string):
listener url including scheme, host name, port
headers:
All headers for the request
pyload:
... | python | def send_indication(url, headers, payload, verbose, verify=None, keyfile=None,
timeout=4):
'''
Send indication using requests module.
Parameters:
url(:term:`string):
listener url including scheme, host name, port
headers:
All headers for the request
pyload:
... | [
"def",
"send_indication",
"(",
"url",
",",
"headers",
",",
"payload",
",",
"verbose",
",",
"verify",
"=",
"None",
",",
"keyfile",
"=",
"None",
",",
"timeout",
"=",
"4",
")",
":",
"try",
":",
"response",
"=",
"requests",
".",
"post",
"(",
"url",
",",
... | Send indication using requests module.
Parameters:
url(:term:`string):
listener url including scheme, host name, port
headers:
All headers for the request
pyload:
XML payload containing the indication
verbose:
Flag for verbose responses
verify:
Either False o... | [
"Send",
"indication",
"using",
"requests",
"module",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/examples/send_indications.py#L94-L155 | train | 28,248 |
pywbem/pywbem | attic/cimxml_parse.py | _get_required_attribute | def _get_required_attribute(node, attr):
"""Return an attribute by name. Raise ParseError if not present."""
if not node.hasAttribute(attr):
raise ParseError(
'Expecting %s attribute in element %s' % (attr, node.tagName))
return node.getAttribute(attr) | python | def _get_required_attribute(node, attr):
"""Return an attribute by name. Raise ParseError if not present."""
if not node.hasAttribute(attr):
raise ParseError(
'Expecting %s attribute in element %s' % (attr, node.tagName))
return node.getAttribute(attr) | [
"def",
"_get_required_attribute",
"(",
"node",
",",
"attr",
")",
":",
"if",
"not",
"node",
".",
"hasAttribute",
"(",
"attr",
")",
":",
"raise",
"ParseError",
"(",
"'Expecting %s attribute in element %s'",
"%",
"(",
"attr",
",",
"node",
".",
"tagName",
")",
"... | Return an attribute by name. Raise ParseError if not present. | [
"Return",
"an",
"attribute",
"by",
"name",
".",
"Raise",
"ParseError",
"if",
"not",
"present",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/attic/cimxml_parse.py#L54-L61 | train | 28,249 |
pywbem/pywbem | attic/cimxml_parse.py | _get_end_event | def _get_end_event(parser, tagName):
"""Check that the next event is the end of a particular XML tag."""
(event, node) = six.next(parser)
if event != pulldom.END_ELEMENT or node.tagName != tagName:
raise ParseError(
'Expecting %s end tag, got %s %s' % (tagName, event, node.tagName)) | python | def _get_end_event(parser, tagName):
"""Check that the next event is the end of a particular XML tag."""
(event, node) = six.next(parser)
if event != pulldom.END_ELEMENT or node.tagName != tagName:
raise ParseError(
'Expecting %s end tag, got %s %s' % (tagName, event, node.tagName)) | [
"def",
"_get_end_event",
"(",
"parser",
",",
"tagName",
")",
":",
"(",
"event",
",",
"node",
")",
"=",
"six",
".",
"next",
"(",
"parser",
")",
"if",
"event",
"!=",
"pulldom",
".",
"END_ELEMENT",
"or",
"node",
".",
"tagName",
"!=",
"tagName",
":",
"ra... | Check that the next event is the end of a particular XML tag. | [
"Check",
"that",
"the",
"next",
"event",
"is",
"the",
"end",
"of",
"a",
"particular",
"XML",
"tag",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/attic/cimxml_parse.py#L71-L78 | train | 28,250 |
pywbem/pywbem | attic/cimxml_parse.py | make_parser | def make_parser(stream_or_string):
"""Create a xml.dom.pulldom parser."""
if isinstance(stream_or_string, six.string_types):
# XXX: the pulldom.parseString() function doesn't seem to
# like operating on unicode strings!
return pulldom.parseString(str(stream_or_string))
else:
... | python | def make_parser(stream_or_string):
"""Create a xml.dom.pulldom parser."""
if isinstance(stream_or_string, six.string_types):
# XXX: the pulldom.parseString() function doesn't seem to
# like operating on unicode strings!
return pulldom.parseString(str(stream_or_string))
else:
... | [
"def",
"make_parser",
"(",
"stream_or_string",
")",
":",
"if",
"isinstance",
"(",
"stream_or_string",
",",
"six",
".",
"string_types",
")",
":",
"# XXX: the pulldom.parseString() function doesn't seem to",
"# like operating on unicode strings!",
"return",
"pulldom",
".",
"p... | Create a xml.dom.pulldom parser. | [
"Create",
"a",
"xml",
".",
"dom",
".",
"pulldom",
"parser",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/attic/cimxml_parse.py#L999-L1011 | train | 28,251 |
pywbem/pywbem | attic/cimxml_parse.py | parse_any | def parse_any(stream_or_string):
"""Parse any XML string or stream. This function fabricates
the names of the parser functions by prepending parse_ to
the node name and then calling that function.
"""
parser = make_parser(stream_or_string)
(event, node) = six.next(parser)
if event !... | python | def parse_any(stream_or_string):
"""Parse any XML string or stream. This function fabricates
the names of the parser functions by prepending parse_ to
the node name and then calling that function.
"""
parser = make_parser(stream_or_string)
(event, node) = six.next(parser)
if event !... | [
"def",
"parse_any",
"(",
"stream_or_string",
")",
":",
"parser",
"=",
"make_parser",
"(",
"stream_or_string",
")",
"(",
"event",
",",
"node",
")",
"=",
"six",
".",
"next",
"(",
"parser",
")",
"if",
"event",
"!=",
"pulldom",
".",
"START_DOCUMENT",
":",
"r... | Parse any XML string or stream. This function fabricates
the names of the parser functions by prepending parse_ to
the node name and then calling that function. | [
"Parse",
"any",
"XML",
"string",
"or",
"stream",
".",
"This",
"function",
"fabricates",
"the",
"names",
"of",
"the",
"parser",
"functions",
"by",
"prepending",
"parse_",
"to",
"the",
"node",
"name",
"and",
"then",
"calling",
"that",
"function",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/attic/cimxml_parse.py#L1013-L1036 | train | 28,252 |
pywbem/pywbem | examples/listen.py | _process_indication | def _process_indication(indication, host):
'''This function gets called when an indication is received.'''
global RECEIVED_INDICATION_DICT
COUNTER_LOCK.acquire()
if host in RECEIVED_INDICATION_DICT:
RECEIVED_INDICATION_DICT[host] += 1
else:
RECEIVED_INDICATION_DICT[host] = 1
COU... | python | def _process_indication(indication, host):
'''This function gets called when an indication is received.'''
global RECEIVED_INDICATION_DICT
COUNTER_LOCK.acquire()
if host in RECEIVED_INDICATION_DICT:
RECEIVED_INDICATION_DICT[host] += 1
else:
RECEIVED_INDICATION_DICT[host] = 1
COU... | [
"def",
"_process_indication",
"(",
"indication",
",",
"host",
")",
":",
"global",
"RECEIVED_INDICATION_DICT",
"COUNTER_LOCK",
".",
"acquire",
"(",
")",
"if",
"host",
"in",
"RECEIVED_INDICATION_DICT",
":",
"RECEIVED_INDICATION_DICT",
"[",
"host",
"]",
"+=",
"1",
"e... | This function gets called when an indication is received. | [
"This",
"function",
"gets",
"called",
"when",
"an",
"indication",
"is",
"received",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/examples/listen.py#L34-L46 | train | 28,253 |
pywbem/pywbem | examples/listen.py | _get_argv | def _get_argv(index, default=None):
''' get the argv input argument defined by index. Return the default
attribute if that argument does not exist
'''
return _sys.argv[index] if len(_sys.argv) > index else default | python | def _get_argv(index, default=None):
''' get the argv input argument defined by index. Return the default
attribute if that argument does not exist
'''
return _sys.argv[index] if len(_sys.argv) > index else default | [
"def",
"_get_argv",
"(",
"index",
",",
"default",
"=",
"None",
")",
":",
"return",
"_sys",
".",
"argv",
"[",
"index",
"]",
"if",
"len",
"(",
"_sys",
".",
"argv",
")",
">",
"index",
"else",
"default"
] | get the argv input argument defined by index. Return the default
attribute if that argument does not exist | [
"get",
"the",
"argv",
"input",
"argument",
"defined",
"by",
"index",
".",
"Return",
"the",
"default",
"attribute",
"if",
"that",
"argument",
"does",
"not",
"exist"
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/examples/listen.py#L48-L52 | train | 28,254 |
pywbem/pywbem | examples/listen.py | status | def status(reset=None):
'''
Show status of indications received. If optional reset attribute
is True, reset the counter.
'''
global RECEIVED_INDICATION_DICT
for host, count in six.iteritems(RECEIVED_INDICATION_DICT):
print('Host %s Received %s indications' % (host, count))
... | python | def status(reset=None):
'''
Show status of indications received. If optional reset attribute
is True, reset the counter.
'''
global RECEIVED_INDICATION_DICT
for host, count in six.iteritems(RECEIVED_INDICATION_DICT):
print('Host %s Received %s indications' % (host, count))
... | [
"def",
"status",
"(",
"reset",
"=",
"None",
")",
":",
"global",
"RECEIVED_INDICATION_DICT",
"for",
"host",
",",
"count",
"in",
"six",
".",
"iteritems",
"(",
"RECEIVED_INDICATION_DICT",
")",
":",
"print",
"(",
"'Host %s Received %s indications'",
"%",
"(",
"host"... | Show status of indications received. If optional reset attribute
is True, reset the counter. | [
"Show",
"status",
"of",
"indications",
"received",
".",
"If",
"optional",
"reset",
"attribute",
"is",
"True",
"reset",
"the",
"counter",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/examples/listen.py#L55-L69 | train | 28,255 |
pywbem/pywbem | docs/conf.py | AutoAutoSummary._get_members | def _get_members(self, class_obj, member_type, include_in_public=None):
"""
Return class members of the specified type.
class_obj: Class object.
member_type: Member type ('method' or 'attribute').
include_in_public: set/list/tuple with member names that should be
inc... | python | def _get_members(self, class_obj, member_type, include_in_public=None):
"""
Return class members of the specified type.
class_obj: Class object.
member_type: Member type ('method' or 'attribute').
include_in_public: set/list/tuple with member names that should be
inc... | [
"def",
"_get_members",
"(",
"self",
",",
"class_obj",
",",
"member_type",
",",
"include_in_public",
"=",
"None",
")",
":",
"try",
":",
"app",
"=",
"self",
".",
"state",
".",
"document",
".",
"settings",
".",
"env",
".",
"app",
"except",
"AttributeError",
... | Return class members of the specified type.
class_obj: Class object.
member_type: Member type ('method' or 'attribute').
include_in_public: set/list/tuple with member names that should be
included in public members in addition to the public names (those
starting without un... | [
"Return",
"class",
"members",
"of",
"the",
"specified",
"type",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/docs/conf.py#L560-L595 | train | 28,256 |
pywbem/pywbem | docs/conf.py | AutoAutoSummary._get_def_class | def _get_def_class(self, class_obj, member_name):
"""
Return the class object in MRO order that defines a member.
class_obj: Class object that exposes (but not necessarily defines) the
member. I.e. starting point of the search.
member_name: Name of the member (method or attri... | python | def _get_def_class(self, class_obj, member_name):
"""
Return the class object in MRO order that defines a member.
class_obj: Class object that exposes (but not necessarily defines) the
member. I.e. starting point of the search.
member_name: Name of the member (method or attri... | [
"def",
"_get_def_class",
"(",
"self",
",",
"class_obj",
",",
"member_name",
")",
":",
"member_obj",
"=",
"getattr",
"(",
"class_obj",
",",
"member_name",
")",
"for",
"def_class_obj",
"in",
"inspect",
".",
"getmro",
"(",
"class_obj",
")",
":",
"if",
"member_n... | Return the class object in MRO order that defines a member.
class_obj: Class object that exposes (but not necessarily defines) the
member. I.e. starting point of the search.
member_name: Name of the member (method or attribute).
Returns:
Class object that defines the membe... | [
"Return",
"the",
"class",
"object",
"in",
"MRO",
"order",
"that",
"defines",
"a",
"member",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/docs/conf.py#L597-L620 | train | 28,257 |
pywbem/pywbem | pywbem/_statistics.py | OperationStatistic.reset | def reset(self):
"""
Reset the statistics data for this object.
"""
self._count = 0
self._exception_count = 0
self._stat_start_time = None
self._time_sum = float(0)
self._time_min = float('inf')
self._time_max = float(0)
self._server_time_... | python | def reset(self):
"""
Reset the statistics data for this object.
"""
self._count = 0
self._exception_count = 0
self._stat_start_time = None
self._time_sum = float(0)
self._time_min = float('inf')
self._time_max = float(0)
self._server_time_... | [
"def",
"reset",
"(",
"self",
")",
":",
"self",
".",
"_count",
"=",
"0",
"self",
".",
"_exception_count",
"=",
"0",
"self",
".",
"_stat_start_time",
"=",
"None",
"self",
".",
"_time_sum",
"=",
"float",
"(",
"0",
")",
"self",
".",
"_time_min",
"=",
"fl... | Reset the statistics data for this object. | [
"Reset",
"the",
"statistics",
"data",
"for",
"this",
"object",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_statistics.py#L359-L381 | train | 28,258 |
pywbem/pywbem | pywbem/_statistics.py | OperationStatistic.start_timer | def start_timer(self):
"""
This is a low-level method that is called by pywbem at the begin of an
operation. It starts the measurement for that operation, if statistics
is enabled for the connection.
A subsequent invocation of :meth:`~pywbem.OperationStatistic.stop_timer`
... | python | def start_timer(self):
"""
This is a low-level method that is called by pywbem at the begin of an
operation. It starts the measurement for that operation, if statistics
is enabled for the connection.
A subsequent invocation of :meth:`~pywbem.OperationStatistic.stop_timer`
... | [
"def",
"start_timer",
"(",
"self",
")",
":",
"if",
"self",
".",
"container",
".",
"enabled",
":",
"self",
".",
"_start_time",
"=",
"time",
".",
"time",
"(",
")",
"if",
"not",
"self",
".",
"_stat_start_time",
":",
"self",
".",
"_stat_start_time",
"=",
"... | This is a low-level method that is called by pywbem at the begin of an
operation. It starts the measurement for that operation, if statistics
is enabled for the connection.
A subsequent invocation of :meth:`~pywbem.OperationStatistic.stop_timer`
will complete the measurement for that op... | [
"This",
"is",
"a",
"low",
"-",
"level",
"method",
"that",
"is",
"called",
"by",
"pywbem",
"at",
"the",
"begin",
"of",
"an",
"operation",
".",
"It",
"starts",
"the",
"measurement",
"for",
"that",
"operation",
"if",
"statistics",
"is",
"enabled",
"for",
"t... | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_statistics.py#L383-L396 | train | 28,259 |
pywbem/pywbem | pywbem/_statistics.py | OperationStatistic.stop_timer | def stop_timer(self, request_len, reply_len, server_time=None,
exception=False):
"""
This is a low-level method is called by pywbem at the end of an
operation. It completes the measurement for that operation by capturing
the needed data, and updates the statistics data... | python | def stop_timer(self, request_len, reply_len, server_time=None,
exception=False):
"""
This is a low-level method is called by pywbem at the end of an
operation. It completes the measurement for that operation by capturing
the needed data, and updates the statistics data... | [
"def",
"stop_timer",
"(",
"self",
",",
"request_len",
",",
"reply_len",
",",
"server_time",
"=",
"None",
",",
"exception",
"=",
"False",
")",
":",
"if",
"not",
"self",
".",
"container",
".",
"enabled",
":",
"return",
"None",
"# stop the timer",
"if",
"self... | This is a low-level method is called by pywbem at the end of an
operation. It completes the measurement for that operation by capturing
the needed data, and updates the statistics data, if statistics is
enabled for the connection.
Parameters:
request_len (:term:`integer`)
... | [
"This",
"is",
"a",
"low",
"-",
"level",
"method",
"is",
"called",
"by",
"pywbem",
"at",
"the",
"end",
"of",
"an",
"operation",
".",
"It",
"completes",
"the",
"measurement",
"for",
"that",
"operation",
"by",
"capturing",
"the",
"needed",
"data",
"and",
"u... | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_statistics.py#L398-L470 | train | 28,260 |
pywbem/pywbem | pywbem/_statistics.py | OperationStatistic.formatted | def formatted(self, include_server_time):
"""
Return a formatted one-line string with the statistics
values for the operation for which this statistics object
maintains data.
This is a low-level method that is called by
:meth:`pywbem.Statistics.formatted`.
"""
... | python | def formatted(self, include_server_time):
"""
Return a formatted one-line string with the statistics
values for the operation for which this statistics object
maintains data.
This is a low-level method that is called by
:meth:`pywbem.Statistics.formatted`.
"""
... | [
"def",
"formatted",
"(",
"self",
",",
"include_server_time",
")",
":",
"if",
"include_server_time",
":",
"# pylint: disable=no-else-return",
"return",
"(",
"'{0:5d} {1:5d} '",
"'{2:7.3f} {3:7.3f} {4:7.3f} '",
"'{5:7.3f} {6:7.3f} {7:7.3f} '",
"'{8:6.0f} {9:6.0f} {10:6.0f} '",
"'{1... | Return a formatted one-line string with the statistics
values for the operation for which this statistics object
maintains data.
This is a low-level method that is called by
:meth:`pywbem.Statistics.formatted`. | [
"Return",
"a",
"formatted",
"one",
"-",
"line",
"string",
"with",
"the",
"statistics",
"values",
"for",
"the",
"operation",
"for",
"which",
"this",
"statistics",
"object",
"maintains",
"data",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_statistics.py#L508-L543 | train | 28,261 |
pywbem/pywbem | pywbem/_statistics.py | Statistics.formatted | def formatted(self):
# pylint: disable=line-too-long
"""
Return a human readable string with the statistics for this container.
The operations are sorted by decreasing average time.
The three columns for `ServerTime` are included only if the WBEM server
has returned WBEM... | python | def formatted(self):
# pylint: disable=line-too-long
"""
Return a human readable string with the statistics for this container.
The operations are sorted by decreasing average time.
The three columns for `ServerTime` are included only if the WBEM server
has returned WBEM... | [
"def",
"formatted",
"(",
"self",
")",
":",
"# pylint: disable=line-too-long",
"# noqa: E501",
"# pylint: enable=line-too-long",
"ret",
"=",
"\"Statistics (times in seconds, lengths in Bytes):\\n\"",
"if",
"self",
".",
"enabled",
":",
"snapshot",
"=",
"sorted",
"(",
"self",
... | Return a human readable string with the statistics for this container.
The operations are sorted by decreasing average time.
The three columns for `ServerTime` are included only if the WBEM server
has returned WBEM server response times.
Example if statistics are enabled::
... | [
"Return",
"a",
"human",
"readable",
"string",
"with",
"the",
"statistics",
"for",
"this",
"container",
".",
"The",
"operations",
"are",
"sorted",
"by",
"decreasing",
"average",
"time",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_statistics.py#L676-L722 | train | 28,262 |
pywbem/pywbem | pywbem/_statistics.py | Statistics.reset | def reset(self):
"""
Reset all statistics and clear any statistic names.
All statistics must be inactive before a reset will execute
Returns: True if reset, False if not
"""
# Test for any stats being currently timed.
for stat in six.itervalues(self._op_stats):
... | python | def reset(self):
"""
Reset all statistics and clear any statistic names.
All statistics must be inactive before a reset will execute
Returns: True if reset, False if not
"""
# Test for any stats being currently timed.
for stat in six.itervalues(self._op_stats):
... | [
"def",
"reset",
"(",
"self",
")",
":",
"# Test for any stats being currently timed.",
"for",
"stat",
"in",
"six",
".",
"itervalues",
"(",
"self",
".",
"_op_stats",
")",
":",
"if",
"stat",
".",
"_start_time",
"is",
"not",
"None",
":",
"# pylint: disable=protected... | Reset all statistics and clear any statistic names.
All statistics must be inactive before a reset will execute
Returns: True if reset, False if not | [
"Reset",
"all",
"statistics",
"and",
"clear",
"any",
"statistic",
"names",
".",
"All",
"statistics",
"must",
"be",
"inactive",
"before",
"a",
"reset",
"will",
"execute"
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/_statistics.py#L724-L738 | train | 28,263 |
pywbem/pywbem | remove_duplicate_setuptools.py | remove_duplicate_metadata_dirs | def remove_duplicate_metadata_dirs(package_name):
"""Remove duplicate metadata directories of a package."""
print("Removing duplicate metadata directories of package: %s" %
package_name)
module = importlib.import_module(package_name)
py_mn = "%s.%s" % (sys.version_info[0], sys.version_info[... | python | def remove_duplicate_metadata_dirs(package_name):
"""Remove duplicate metadata directories of a package."""
print("Removing duplicate metadata directories of package: %s" %
package_name)
module = importlib.import_module(package_name)
py_mn = "%s.%s" % (sys.version_info[0], sys.version_info[... | [
"def",
"remove_duplicate_metadata_dirs",
"(",
"package_name",
")",
":",
"print",
"(",
"\"Removing duplicate metadata directories of package: %s\"",
"%",
"package_name",
")",
"module",
"=",
"importlib",
".",
"import_module",
"(",
"package_name",
")",
"py_mn",
"=",
"\"%s.%s... | Remove duplicate metadata directories of a package. | [
"Remove",
"duplicate",
"metadata",
"directories",
"of",
"a",
"package",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/remove_duplicate_setuptools.py#L18-L56 | train | 28,264 |
pywbem/pywbem | examples/wbemcli_clean_subscriptions.py | display_path_info | def display_path_info(descriptor, class_, namespace):
"""
Display info on the instance names of the class parameter retrieved
from the interop namespace of the server defined by CONN.
The descriptor is text defining the class(ex. Filter)).
Returns a list of the paths
"""
paths = CONN.Enumer... | python | def display_path_info(descriptor, class_, namespace):
"""
Display info on the instance names of the class parameter retrieved
from the interop namespace of the server defined by CONN.
The descriptor is text defining the class(ex. Filter)).
Returns a list of the paths
"""
paths = CONN.Enumer... | [
"def",
"display_path_info",
"(",
"descriptor",
",",
"class_",
",",
"namespace",
")",
":",
"paths",
"=",
"CONN",
".",
"EnumerateInstanceNames",
"(",
"class_",
",",
"namespace",
"=",
"interop",
")",
"# noqa: F821",
"print",
"(",
"'%ss: count=%s'",
"%",
"(",
"des... | Display info on the instance names of the class parameter retrieved
from the interop namespace of the server defined by CONN.
The descriptor is text defining the class(ex. Filter)).
Returns a list of the paths | [
"Display",
"info",
"on",
"the",
"instance",
"names",
"of",
"the",
"class",
"parameter",
"retrieved",
"from",
"the",
"interop",
"namespace",
"of",
"the",
"server",
"defined",
"by",
"CONN",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/examples/wbemcli_clean_subscriptions.py#L9-L21 | train | 28,265 |
pywbem/pywbem | pywbem/tupleparse.py | kids | def kids(tup_tree):
"""
Return a list with the child elements of tup_tree.
The child elements are represented as tupletree nodes.
Child nodes that are not XML elements (e.g. text nodes) in tup_tree are
filtered out.
"""
k = tup_tree[2]
if k is None:
return []
# pylint: disa... | python | def kids(tup_tree):
"""
Return a list with the child elements of tup_tree.
The child elements are represented as tupletree nodes.
Child nodes that are not XML elements (e.g. text nodes) in tup_tree are
filtered out.
"""
k = tup_tree[2]
if k is None:
return []
# pylint: disa... | [
"def",
"kids",
"(",
"tup_tree",
")",
":",
"k",
"=",
"tup_tree",
"[",
"2",
"]",
"if",
"k",
"is",
"None",
":",
"return",
"[",
"]",
"# pylint: disable=unidiomatic-typecheck",
"return",
"[",
"x",
"for",
"x",
"in",
"k",
"if",
"type",
"(",
"x",
")",
"==",
... | Return a list with the child elements of tup_tree.
The child elements are represented as tupletree nodes.
Child nodes that are not XML elements (e.g. text nodes) in tup_tree are
filtered out. | [
"Return",
"a",
"list",
"with",
"the",
"child",
"elements",
"of",
"tup_tree",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L117-L130 | train | 28,266 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.pcdata | def pcdata(self, tup_tree):
"""
Return the concatenated character data within the child nodes of a
tuple tree node, as a unicode string. Whitespace is preserved.
The child nodes must be text nodes (no element nodes).
"""
try:
data = u''.join(tup_tree[2])
... | python | def pcdata(self, tup_tree):
"""
Return the concatenated character data within the child nodes of a
tuple tree node, as a unicode string. Whitespace is preserved.
The child nodes must be text nodes (no element nodes).
"""
try:
data = u''.join(tup_tree[2])
... | [
"def",
"pcdata",
"(",
"self",
",",
"tup_tree",
")",
":",
"try",
":",
"data",
"=",
"u''",
".",
"join",
"(",
"tup_tree",
"[",
"2",
"]",
")",
"except",
"TypeError",
":",
"raise",
"CIMXMLParseError",
"(",
"_format",
"(",
"\"Element {0!A} has unexpected child ele... | Return the concatenated character data within the child nodes of a
tuple tree node, as a unicode string. Whitespace is preserved.
The child nodes must be text nodes (no element nodes). | [
"Return",
"the",
"concatenated",
"character",
"data",
"within",
"the",
"child",
"nodes",
"of",
"a",
"tuple",
"tree",
"node",
"as",
"a",
"unicode",
"string",
".",
"Whitespace",
"is",
"preserved",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L145-L162 | train | 28,267 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.check_node | def check_node(self, tup_tree, nodename, required_attrs=None,
optional_attrs=None, allowed_children=None,
allow_pcdata=False):
# pylint: disable=too-many-branches
"""
Check static local constraints on a tuple tree node.
The node must have the given ... | python | def check_node(self, tup_tree, nodename, required_attrs=None,
optional_attrs=None, allowed_children=None,
allow_pcdata=False):
# pylint: disable=too-many-branches
"""
Check static local constraints on a tuple tree node.
The node must have the given ... | [
"def",
"check_node",
"(",
"self",
",",
"tup_tree",
",",
"nodename",
",",
"required_attrs",
"=",
"None",
",",
"optional_attrs",
"=",
"None",
",",
"allowed_children",
"=",
"None",
",",
"allow_pcdata",
"=",
"False",
")",
":",
"# pylint: disable=too-many-branches",
... | Check static local constraints on a tuple tree node.
The node must have the given nodename.
Required_attrs is a list/tuple of attribute names that must be present.
None means the same as an empty list: No attributes are required.
Optional_attrs is a list/tuple of attribute names that ... | [
"Check",
"static",
"local",
"constraints",
"on",
"a",
"tuple",
"tree",
"node",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L165-L249 | train | 28,268 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.one_child | def one_child(self, tup_tree, acceptable):
"""
Parse children of a node with exactly one child node.
acceptable is a list/tuple of acceptable child nodes
PCData is ignored.
"""
k = kids(tup_tree)
if not k:
raise CIMXMLParseError(
_f... | python | def one_child(self, tup_tree, acceptable):
"""
Parse children of a node with exactly one child node.
acceptable is a list/tuple of acceptable child nodes
PCData is ignored.
"""
k = kids(tup_tree)
if not k:
raise CIMXMLParseError(
_f... | [
"def",
"one_child",
"(",
"self",
",",
"tup_tree",
",",
"acceptable",
")",
":",
"k",
"=",
"kids",
"(",
"tup_tree",
")",
"if",
"not",
"k",
":",
"raise",
"CIMXMLParseError",
"(",
"_format",
"(",
"\"Element {0!A} missing required child element {1!A}\"",
",",
"name",... | Parse children of a node with exactly one child node.
acceptable is a list/tuple of acceptable child nodes
PCData is ignored. | [
"Parse",
"children",
"of",
"a",
"node",
"with",
"exactly",
"one",
"child",
"node",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L251-L283 | train | 28,269 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.notimplemented | def notimplemented(self, tup_tree):
"""
Raise exception for not implemented function.
"""
raise CIMXMLParseError(
_format("Internal Error: Parsing support for element {0!A} is "
"not implemented", name(tup_tree)),
conn_id=self.conn_id) | python | def notimplemented(self, tup_tree):
"""
Raise exception for not implemented function.
"""
raise CIMXMLParseError(
_format("Internal Error: Parsing support for element {0!A} is "
"not implemented", name(tup_tree)),
conn_id=self.conn_id) | [
"def",
"notimplemented",
"(",
"self",
",",
"tup_tree",
")",
":",
"raise",
"CIMXMLParseError",
"(",
"_format",
"(",
"\"Internal Error: Parsing support for element {0!A} is \"",
"\"not implemented\"",
",",
"name",
"(",
"tup_tree",
")",
")",
",",
"conn_id",
"=",
"self",
... | Raise exception for not implemented function. | [
"Raise",
"exception",
"for",
"not",
"implemented",
"function",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L376-L383 | train | 28,270 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_value | def parse_value(self, tup_tree):
"""
Parse a VALUE element and return its text content as a unicode string.
Whitespace is preserved.
The conversion of the text representation of the value to a CIM data
type object requires CIM type information which is not available on the
... | python | def parse_value(self, tup_tree):
"""
Parse a VALUE element and return its text content as a unicode string.
Whitespace is preserved.
The conversion of the text representation of the value to a CIM data
type object requires CIM type information which is not available on the
... | [
"def",
"parse_value",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'VALUE'",
",",
"(",
")",
",",
"(",
")",
",",
"(",
")",
",",
"allow_pcdata",
"=",
"True",
")",
"return",
"self",
".",
"pcdata",
"(",
"tup... | Parse a VALUE element and return its text content as a unicode string.
Whitespace is preserved.
The conversion of the text representation of the value to a CIM data
type object requires CIM type information which is not available on the
VALUE element and therefore will be done when pars... | [
"Parse",
"a",
"VALUE",
"element",
"and",
"return",
"its",
"text",
"content",
"as",
"a",
"unicode",
"string",
".",
"Whitespace",
"is",
"preserved",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L455-L472 | train | 28,271 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_value_array | def parse_value_array(self, tup_tree):
"""
Parse a VALUE.ARRAY element and return the items in the array as a list
of unicode strings, or None for NULL items. Whitespace is preserved.
::
<!ELEMENT VALUE.ARRAY (VALUE | VALUE.NULL)*>
"""
self.check_node(tup... | python | def parse_value_array(self, tup_tree):
"""
Parse a VALUE.ARRAY element and return the items in the array as a list
of unicode strings, or None for NULL items. Whitespace is preserved.
::
<!ELEMENT VALUE.ARRAY (VALUE | VALUE.NULL)*>
"""
self.check_node(tup... | [
"def",
"parse_value_array",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'VALUE.ARRAY'",
")",
"children",
"=",
"self",
".",
"list_of_various",
"(",
"tup_tree",
",",
"(",
"'VALUE'",
",",
"'VALUE.NULL'",
")",
")",
... | Parse a VALUE.ARRAY element and return the items in the array as a list
of unicode strings, or None for NULL items. Whitespace is preserved.
::
<!ELEMENT VALUE.ARRAY (VALUE | VALUE.NULL)*> | [
"Parse",
"a",
"VALUE",
".",
"ARRAY",
"element",
"and",
"return",
"the",
"items",
"in",
"the",
"array",
"as",
"a",
"list",
"of",
"unicode",
"strings",
"or",
"None",
"for",
"NULL",
"items",
".",
"Whitespace",
"is",
"preserved",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L474-L488 | train | 28,272 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_value_reference | def parse_value_reference(self, tup_tree):
"""
Parse a VALUE.REFERENCE element and return the instance path or class
path it represents as a CIMInstanceName or CIMClassName object,
respectively.
::
<!ELEMENT VALUE.REFERENCE (CLASSPATH | LOCALCLASSPATH | CLASSNAME ... | python | def parse_value_reference(self, tup_tree):
"""
Parse a VALUE.REFERENCE element and return the instance path or class
path it represents as a CIMInstanceName or CIMClassName object,
respectively.
::
<!ELEMENT VALUE.REFERENCE (CLASSPATH | LOCALCLASSPATH | CLASSNAME ... | [
"def",
"parse_value_reference",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'VALUE.REFERENCE'",
")",
"child",
"=",
"self",
".",
"one_child",
"(",
"tup_tree",
",",
"(",
"'CLASSPATH'",
",",
"'LOCALCLASSPATH'",
",",
... | Parse a VALUE.REFERENCE element and return the instance path or class
path it represents as a CIMInstanceName or CIMClassName object,
respectively.
::
<!ELEMENT VALUE.REFERENCE (CLASSPATH | LOCALCLASSPATH | CLASSNAME |
INSTANCEPATH | LOCALIN... | [
"Parse",
"a",
"VALUE",
".",
"REFERENCE",
"element",
"and",
"return",
"the",
"instance",
"path",
"or",
"class",
"path",
"it",
"represents",
"as",
"a",
"CIMInstanceName",
"or",
"CIMClassName",
"object",
"respectively",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L490-L510 | train | 28,273 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_value_refarray | def parse_value_refarray(self, tup_tree):
"""
Parse a VALUE.REFARRAY element and return the array of instance paths
or class paths it represents as a list of CIMInstanceName or
CIMClassName objects, respectively.
::
<!ELEMENT VALUE.REFARRAY (VALUE.REFERENCE | VALU... | python | def parse_value_refarray(self, tup_tree):
"""
Parse a VALUE.REFARRAY element and return the array of instance paths
or class paths it represents as a list of CIMInstanceName or
CIMClassName objects, respectively.
::
<!ELEMENT VALUE.REFARRAY (VALUE.REFERENCE | VALU... | [
"def",
"parse_value_refarray",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'VALUE.REFARRAY'",
")",
"children",
"=",
"self",
".",
"list_of_various",
"(",
"tup_tree",
",",
"(",
"'VALUE.REFERENCE'",
",",
"'VALUE.NULL'",... | Parse a VALUE.REFARRAY element and return the array of instance paths
or class paths it represents as a list of CIMInstanceName or
CIMClassName objects, respectively.
::
<!ELEMENT VALUE.REFARRAY (VALUE.REFERENCE | VALUE.NULL)*> | [
"Parse",
"a",
"VALUE",
".",
"REFARRAY",
"element",
"and",
"return",
"the",
"array",
"of",
"instance",
"paths",
"or",
"class",
"paths",
"it",
"represents",
"as",
"a",
"list",
"of",
"CIMInstanceName",
"or",
"CIMClassName",
"objects",
"respectively",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L512-L528 | train | 28,274 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_value_instancewithpath | def parse_value_instancewithpath(self, tup_tree):
"""
The VALUE.INSTANCEWITHPATH is used to define a value that comprises
a single CIMInstance with additional information that defines the
absolute path to that object.
::
<!ELEMENT VALUE.INSTANCEWITHPATH (INSTANCEP... | python | def parse_value_instancewithpath(self, tup_tree):
"""
The VALUE.INSTANCEWITHPATH is used to define a value that comprises
a single CIMInstance with additional information that defines the
absolute path to that object.
::
<!ELEMENT VALUE.INSTANCEWITHPATH (INSTANCEP... | [
"def",
"parse_value_instancewithpath",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'VALUE.INSTANCEWITHPATH'",
")",
"k",
"=",
"kids",
"(",
"tup_tree",
")",
"if",
"len",
"(",
"k",
")",
"!=",
"2",
":",
"raise",
... | The VALUE.INSTANCEWITHPATH is used to define a value that comprises
a single CIMInstance with additional information that defines the
absolute path to that object.
::
<!ELEMENT VALUE.INSTANCEWITHPATH (INSTANCEPATH, INSTANCE)> | [
"The",
"VALUE",
".",
"INSTANCEWITHPATH",
"is",
"used",
"to",
"define",
"a",
"value",
"that",
"comprises",
"a",
"single",
"CIMInstance",
"with",
"additional",
"information",
"that",
"defines",
"the",
"absolute",
"path",
"to",
"that",
"object",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L570-L596 | train | 28,275 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_localnamespacepath | def parse_localnamespacepath(self, tup_tree):
"""
Parse a LOCALNAMESPACEPATH element and return the namespace it
represents as a unicode string.
The namespace is formed by joining the namespace components (one from
each NAMESPACE child element) with a slash (e.g. to "root/cimv2"... | python | def parse_localnamespacepath(self, tup_tree):
"""
Parse a LOCALNAMESPACEPATH element and return the namespace it
represents as a unicode string.
The namespace is formed by joining the namespace components (one from
each NAMESPACE child element) with a slash (e.g. to "root/cimv2"... | [
"def",
"parse_localnamespacepath",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'LOCALNAMESPACEPATH'",
",",
"(",
")",
",",
"(",
")",
",",
"(",
"'NAMESPACE'",
",",
")",
")",
"if",
"not",
"kids",
"(",
"tup_tree"... | Parse a LOCALNAMESPACEPATH element and return the namespace it
represents as a unicode string.
The namespace is formed by joining the namespace components (one from
each NAMESPACE child element) with a slash (e.g. to "root/cimv2").
::
<!ELEMENT LOCALNAMESPACEPATH (NAMESP... | [
"Parse",
"a",
"LOCALNAMESPACEPATH",
"element",
"and",
"return",
"the",
"namespace",
"it",
"represents",
"as",
"a",
"unicode",
"string",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L757-L783 | train | 28,276 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_host | def parse_host(self, tup_tree):
"""
Parse a HOST element and return its text content as a unicode string.
::
<!ELEMENT HOST (#PCDATA)>
"""
self.check_node(tup_tree, 'HOST', (), (), (), allow_pcdata=True)
return self.pcdata(tup_tree) | python | def parse_host(self, tup_tree):
"""
Parse a HOST element and return its text content as a unicode string.
::
<!ELEMENT HOST (#PCDATA)>
"""
self.check_node(tup_tree, 'HOST', (), (), (), allow_pcdata=True)
return self.pcdata(tup_tree) | [
"def",
"parse_host",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'HOST'",
",",
"(",
")",
",",
"(",
")",
",",
"(",
")",
",",
"allow_pcdata",
"=",
"True",
")",
"return",
"self",
".",
"pcdata",
"(",
"tup_t... | Parse a HOST element and return its text content as a unicode string.
::
<!ELEMENT HOST (#PCDATA)> | [
"Parse",
"a",
"HOST",
"element",
"and",
"return",
"its",
"text",
"content",
"as",
"a",
"unicode",
"string",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L785-L796 | train | 28,277 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_classpath | def parse_classpath(self, tup_tree):
"""
Parse a CLASSPATH element and return the class path it represents as a
CIMClassName object.
::
<!ELEMENT CLASSPATH (NAMESPACEPATH, CLASSNAME)>
"""
self.check_node(tup_tree, 'CLASSPATH')
k = kids(tup_tree)
... | python | def parse_classpath(self, tup_tree):
"""
Parse a CLASSPATH element and return the class path it represents as a
CIMClassName object.
::
<!ELEMENT CLASSPATH (NAMESPACEPATH, CLASSNAME)>
"""
self.check_node(tup_tree, 'CLASSPATH')
k = kids(tup_tree)
... | [
"def",
"parse_classpath",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'CLASSPATH'",
")",
"k",
"=",
"kids",
"(",
"tup_tree",
")",
"if",
"len",
"(",
"k",
")",
"!=",
"2",
":",
"raise",
"CIMXMLParseError",
"(",... | Parse a CLASSPATH element and return the class path it represents as a
CIMClassName object.
::
<!ELEMENT CLASSPATH (NAMESPACEPATH, CLASSNAME)> | [
"Parse",
"a",
"CLASSPATH",
"element",
"and",
"return",
"the",
"class",
"path",
"it",
"represents",
"as",
"a",
"CIMClassName",
"object",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L814-L840 | train | 28,278 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_localclasspath | def parse_localclasspath(self, tup_tree):
"""
Parse a LOCALCLASSPATH element and return the class path it represents
as a CIMClassName object.
::
<!ELEMENT LOCALCLASSPATH (LOCALNAMESPACEPATH, CLASSNAME)>
"""
self.check_node(tup_tree, 'LOCALCLASSPATH')
... | python | def parse_localclasspath(self, tup_tree):
"""
Parse a LOCALCLASSPATH element and return the class path it represents
as a CIMClassName object.
::
<!ELEMENT LOCALCLASSPATH (LOCALNAMESPACEPATH, CLASSNAME)>
"""
self.check_node(tup_tree, 'LOCALCLASSPATH')
... | [
"def",
"parse_localclasspath",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'LOCALCLASSPATH'",
")",
"k",
"=",
"kids",
"(",
"tup_tree",
")",
"if",
"len",
"(",
"k",
")",
"!=",
"2",
":",
"raise",
"CIMXMLParseErro... | Parse a LOCALCLASSPATH element and return the class path it represents
as a CIMClassName object.
::
<!ELEMENT LOCALCLASSPATH (LOCALNAMESPACEPATH, CLASSNAME)> | [
"Parse",
"a",
"LOCALCLASSPATH",
"element",
"and",
"return",
"the",
"class",
"path",
"it",
"represents",
"as",
"a",
"CIMClassName",
"object",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L842-L867 | train | 28,279 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_classname | def parse_classname(self, tup_tree):
"""
Parse a CLASSNAME element and return the class path it represents as a
CIMClassName object.
::
<!ELEMENT CLASSNAME EMPTY>
<!ATTLIST CLASSNAME
%CIMName;>
Returns:
CIMClassName object ... | python | def parse_classname(self, tup_tree):
"""
Parse a CLASSNAME element and return the class path it represents as a
CIMClassName object.
::
<!ELEMENT CLASSNAME EMPTY>
<!ATTLIST CLASSNAME
%CIMName;>
Returns:
CIMClassName object ... | [
"def",
"parse_classname",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'CLASSNAME'",
",",
"(",
"'NAME'",
",",
")",
",",
"(",
")",
",",
"(",
")",
")",
"classname",
"=",
"attrs",
"(",
"tup_tree",
")",
"[",
... | Parse a CLASSNAME element and return the class path it represents as a
CIMClassName object.
::
<!ELEMENT CLASSNAME EMPTY>
<!ATTLIST CLASSNAME
%CIMName;>
Returns:
CIMClassName object (without namespace or host) | [
"Parse",
"a",
"CLASSNAME",
"element",
"and",
"return",
"the",
"class",
"path",
"it",
"represents",
"as",
"a",
"CIMClassName",
"object",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L869-L889 | train | 28,280 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_instancepath | def parse_instancepath(self, tup_tree):
"""
Parse an INSTANCEPATH element and return the instance path it
represents as a CIMInstanceName object.
::
<!ELEMENT INSTANCEPATH (NAMESPACEPATH, INSTANCENAME)>
"""
self.check_node(tup_tree, 'INSTANCEPATH')
... | python | def parse_instancepath(self, tup_tree):
"""
Parse an INSTANCEPATH element and return the instance path it
represents as a CIMInstanceName object.
::
<!ELEMENT INSTANCEPATH (NAMESPACEPATH, INSTANCENAME)>
"""
self.check_node(tup_tree, 'INSTANCEPATH')
... | [
"def",
"parse_instancepath",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'INSTANCEPATH'",
")",
"k",
"=",
"kids",
"(",
"tup_tree",
")",
"if",
"len",
"(",
"k",
")",
"!=",
"2",
":",
"raise",
"CIMXMLParseError",
... | Parse an INSTANCEPATH element and return the instance path it
represents as a CIMInstanceName object.
::
<!ELEMENT INSTANCEPATH (NAMESPACEPATH, INSTANCENAME)> | [
"Parse",
"an",
"INSTANCEPATH",
"element",
"and",
"return",
"the",
"instance",
"path",
"it",
"represents",
"as",
"a",
"CIMInstanceName",
"object",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L891-L917 | train | 28,281 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_localinstancepath | def parse_localinstancepath(self, tup_tree):
"""
Parse a LOCALINSTANCEPATH element and return the instance path it
represents as a CIMInstanceName object.
::
<!ELEMENT LOCALINSTANCEPATH (LOCALNAMESPACEPATH, INSTANCENAME)>
"""
self.check_node(tup_tree, 'LO... | python | def parse_localinstancepath(self, tup_tree):
"""
Parse a LOCALINSTANCEPATH element and return the instance path it
represents as a CIMInstanceName object.
::
<!ELEMENT LOCALINSTANCEPATH (LOCALNAMESPACEPATH, INSTANCENAME)>
"""
self.check_node(tup_tree, 'LO... | [
"def",
"parse_localinstancepath",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'LOCALINSTANCEPATH'",
")",
"k",
"=",
"kids",
"(",
"tup_tree",
")",
"if",
"len",
"(",
"k",
")",
"!=",
"2",
":",
"raise",
"CIMXMLPar... | Parse a LOCALINSTANCEPATH element and return the instance path it
represents as a CIMInstanceName object.
::
<!ELEMENT LOCALINSTANCEPATH (LOCALNAMESPACEPATH, INSTANCENAME)> | [
"Parse",
"a",
"LOCALINSTANCEPATH",
"element",
"and",
"return",
"the",
"instance",
"path",
"it",
"represents",
"as",
"a",
"CIMInstanceName",
"object",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L919-L945 | train | 28,282 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_instancename | def parse_instancename(self, tup_tree):
"""
Parse an INSTANCENAME element and return the instance path it
represents as a CIMInstanceName object.
::
<!ELEMENT INSTANCENAME (KEYBINDING* | KEYVALUE? |
VALUE.REFERENCE?)>
<!ATTL... | python | def parse_instancename(self, tup_tree):
"""
Parse an INSTANCENAME element and return the instance path it
represents as a CIMInstanceName object.
::
<!ELEMENT INSTANCENAME (KEYBINDING* | KEYVALUE? |
VALUE.REFERENCE?)>
<!ATTL... | [
"def",
"parse_instancename",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'INSTANCENAME'",
",",
"(",
"'CLASSNAME'",
",",
")",
")",
"k",
"=",
"kids",
"(",
"tup_tree",
")",
"if",
"not",
"k",
":",
"# probably not... | Parse an INSTANCENAME element and return the instance path it
represents as a CIMInstanceName object.
::
<!ELEMENT INSTANCENAME (KEYBINDING* | KEYVALUE? |
VALUE.REFERENCE?)>
<!ATTLIST INSTANCENAME
%ClassName;> | [
"Parse",
"an",
"INSTANCENAME",
"element",
"and",
"return",
"the",
"instance",
"path",
"it",
"represents",
"as",
"a",
"CIMInstanceName",
"object",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L947-L999 | train | 28,283 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_keybinding | def parse_keybinding(self, tup_tree):
"""
Parse a KEYBINDING element and return the keybinding as a one-item
dictionary from name to value, where the value is a CIM data type
object, based upon the type information in the child elements, if
present. If no type information is pres... | python | def parse_keybinding(self, tup_tree):
"""
Parse a KEYBINDING element and return the keybinding as a one-item
dictionary from name to value, where the value is a CIM data type
object, based upon the type information in the child elements, if
present. If no type information is pres... | [
"def",
"parse_keybinding",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'KEYBINDING'",
",",
"(",
"'NAME'",
",",
")",
")",
"child",
"=",
"self",
".",
"one_child",
"(",
"tup_tree",
",",
"(",
"'KEYVALUE'",
",",
... | Parse a KEYBINDING element and return the keybinding as a one-item
dictionary from name to value, where the value is a CIM data type
object, based upon the type information in the child elements, if
present. If no type information is present, numeric values are returned
as int or float.
... | [
"Parse",
"a",
"KEYBINDING",
"element",
"and",
"return",
"the",
"keybinding",
"as",
"a",
"one",
"-",
"item",
"dictionary",
"from",
"name",
"to",
"value",
"where",
"the",
"value",
"is",
"a",
"CIM",
"data",
"type",
"object",
"based",
"upon",
"the",
"type",
... | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L1018-L1037 | train | 28,284 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_keyvalue | def parse_keyvalue(self, tup_tree):
"""
Parse a KEYVALUE element and return the keybinding value as a CIM data
type object, based upon the type information in its VALUETYPE and TYPE
attributes, if present.
If TYPE is specified, its value is used to create the corresponding CIM
... | python | def parse_keyvalue(self, tup_tree):
"""
Parse a KEYVALUE element and return the keybinding value as a CIM data
type object, based upon the type information in its VALUETYPE and TYPE
attributes, if present.
If TYPE is specified, its value is used to create the corresponding CIM
... | [
"def",
"parse_keyvalue",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'KEYVALUE'",
",",
"(",
")",
",",
"(",
"'VALUETYPE'",
",",
"'TYPE'",
")",
",",
"(",
")",
",",
"allow_pcdata",
"=",
"True",
")",
"data",
... | Parse a KEYVALUE element and return the keybinding value as a CIM data
type object, based upon the type information in its VALUETYPE and TYPE
attributes, if present.
If TYPE is specified, its value is used to create the corresponding CIM
data type object. in this case, VALUETYPE is igno... | [
"Parse",
"a",
"KEYVALUE",
"element",
"and",
"return",
"the",
"keybinding",
"value",
"as",
"a",
"CIM",
"data",
"type",
"object",
"based",
"upon",
"the",
"type",
"information",
"in",
"its",
"VALUETYPE",
"and",
"TYPE",
"attributes",
"if",
"present",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L1039-L1094 | train | 28,285 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_class | def parse_class(self, tup_tree):
"""
Parse CLASS element returning a CIMClass if the parse was successful.
::
<!ELEMENT CLASS (QUALIFIER*, (PROPERTY | PROPERTY.ARRAY |
PROPERTY.REFERENCE)*, METHOD*)>
<!ATTLIST CLASS
... | python | def parse_class(self, tup_tree):
"""
Parse CLASS element returning a CIMClass if the parse was successful.
::
<!ELEMENT CLASS (QUALIFIER*, (PROPERTY | PROPERTY.ARRAY |
PROPERTY.REFERENCE)*, METHOD*)>
<!ATTLIST CLASS
... | [
"def",
"parse_class",
"(",
"self",
",",
"tup_tree",
")",
":",
"# Doesn't check ordering of elements, but it's not very important",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'CLASS'",
",",
"(",
"'NAME'",
",",
")",
",",
"(",
"'SUPERCLASS'",
",",
")",
",",
... | Parse CLASS element returning a CIMClass if the parse was successful.
::
<!ELEMENT CLASS (QUALIFIER*, (PROPERTY | PROPERTY.ARRAY |
PROPERTY.REFERENCE)*, METHOD*)>
<!ATTLIST CLASS
%CIMName;
%SuperClass;> | [
"Parse",
"CLASS",
"element",
"returning",
"a",
"CIMClass",
"if",
"the",
"parse",
"was",
"successful",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L1100-L1131 | train | 28,286 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_instance | def parse_instance(self, tup_tree):
"""
Return a CIMInstance.
The instance contains the properties, qualifiers and classname for
the instance.
::
<!ELEMENT INSTANCE (QUALIFIER*, (PROPERTY | PROPERTY.ARRAY |
PROPERTY.RE... | python | def parse_instance(self, tup_tree):
"""
Return a CIMInstance.
The instance contains the properties, qualifiers and classname for
the instance.
::
<!ELEMENT INSTANCE (QUALIFIER*, (PROPERTY | PROPERTY.ARRAY |
PROPERTY.RE... | [
"def",
"parse_instance",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'INSTANCE'",
",",
"(",
"'CLASSNAME'",
",",
")",
",",
"(",
"'xml:lang'",
",",
")",
",",
"(",
"'QUALIFIER'",
",",
"'PROPERTY'",
",",
"'PROPER... | Return a CIMInstance.
The instance contains the properties, qualifiers and classname for
the instance.
::
<!ELEMENT INSTANCE (QUALIFIER*, (PROPERTY | PROPERTY.ARRAY |
PROPERTY.REFERENCE)*)>
<!ATTLIST INSTANCE
... | [
"Return",
"a",
"CIMInstance",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L1133-L1169 | train | 28,287 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_scope | def parse_scope(self, tup_tree):
"""
Parse a SCOPE element and return a dictionary with an item for each
specified scope attribute.
The keys of the dictionary items are the scope names in upper case; the
values are the Python boolean values True or False.
Unspecified sc... | python | def parse_scope(self, tup_tree):
"""
Parse a SCOPE element and return a dictionary with an item for each
specified scope attribute.
The keys of the dictionary items are the scope names in upper case; the
values are the Python boolean values True or False.
Unspecified sc... | [
"def",
"parse_scope",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'SCOPE'",
",",
"(",
")",
",",
"(",
"'CLASS'",
",",
"'ASSOCIATION'",
",",
"'REFERENCE'",
",",
"'PROPERTY'",
",",
"'METHOD'",
",",
"'PARAMETER'",
... | Parse a SCOPE element and return a dictionary with an item for each
specified scope attribute.
The keys of the dictionary items are the scope names in upper case; the
values are the Python boolean values True or False.
Unspecified scope attributes are not represented in the returned
... | [
"Parse",
"a",
"SCOPE",
"element",
"and",
"return",
"a",
"dictionary",
"with",
"an",
"item",
"for",
"each",
"specified",
"scope",
"attribute",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L1171-L1215 | train | 28,288 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_qualifier_declaration | def parse_qualifier_declaration(self, tup_tree):
"""
Parse QUALIFIER.DECLARATION element.
::
<!ELEMENT QUALIFIER.DECLARATION (SCOPE?, (VALUE | VALUE.ARRAY)?)>
<!ATTLIST QUALIFIER.DECLARATION
%CIMName;
%CIMType; #REQUIRED
... | python | def parse_qualifier_declaration(self, tup_tree):
"""
Parse QUALIFIER.DECLARATION element.
::
<!ELEMENT QUALIFIER.DECLARATION (SCOPE?, (VALUE | VALUE.ARRAY)?)>
<!ATTLIST QUALIFIER.DECLARATION
%CIMName;
%CIMType; #REQUIRED
... | [
"def",
"parse_qualifier_declaration",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'QUALIFIER.DECLARATION'",
",",
"(",
"'NAME'",
",",
"'TYPE'",
")",
",",
"(",
"'ISARRAY'",
",",
"'ARRAYSIZE'",
",",
"'OVERRIDABLE'",
"... | Parse QUALIFIER.DECLARATION element.
::
<!ELEMENT QUALIFIER.DECLARATION (SCOPE?, (VALUE | VALUE.ARRAY)?)>
<!ATTLIST QUALIFIER.DECLARATION
%CIMName;
%CIMType; #REQUIRED
ISARRAY (true|false) #IMPLIED
%Arra... | [
"Parse",
"QUALIFIER",
".",
"DECLARATION",
"element",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L1217-L1280 | train | 28,289 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_qualifier | def parse_qualifier(self, tup_tree):
"""
Parse QUALIFIER element returning CIMQualifier.
::
<!ELEMENT QUALIFIER (VALUE | VALUE.ARRAY)>
<!ATTLIST QUALIFIER
%CIMName;
%CIMType; #REQUIRED
%Propagated;
... | python | def parse_qualifier(self, tup_tree):
"""
Parse QUALIFIER element returning CIMQualifier.
::
<!ELEMENT QUALIFIER (VALUE | VALUE.ARRAY)>
<!ATTLIST QUALIFIER
%CIMName;
%CIMType; #REQUIRED
%Propagated;
... | [
"def",
"parse_qualifier",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'QUALIFIER'",
",",
"(",
"'NAME'",
",",
"'TYPE'",
")",
",",
"(",
"'OVERRIDABLE'",
",",
"'TOSUBCLASS'",
",",
"'TOINSTANCE'",
",",
"'TRANSLATABLE... | Parse QUALIFIER element returning CIMQualifier.
::
<!ELEMENT QUALIFIER (VALUE | VALUE.ARRAY)>
<!ATTLIST QUALIFIER
%CIMName;
%CIMType; #REQUIRED
%Propagated;
%QualifierFlavor;
xml:lang NMTOKEN... | [
"Parse",
"QUALIFIER",
"element",
"returning",
"CIMQualifier",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L1282-L1321 | train | 28,290 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_property | def parse_property(self, tup_tree):
"""
Parse PROPERTY into a CIMProperty object.
VAL is just the pcdata of the enclosed VALUE node.
::
<!ELEMENT PROPERTY (QUALIFIER*, VALUE?)>
<!ATTLIST PROPERTY
%CIMName;
%CIMType; ... | python | def parse_property(self, tup_tree):
"""
Parse PROPERTY into a CIMProperty object.
VAL is just the pcdata of the enclosed VALUE node.
::
<!ELEMENT PROPERTY (QUALIFIER*, VALUE?)>
<!ATTLIST PROPERTY
%CIMName;
%CIMType; ... | [
"def",
"parse_property",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'PROPERTY'",
",",
"(",
"'TYPE'",
",",
"'NAME'",
")",
",",
"(",
"'CLASSORIGIN'",
",",
"'PROPAGATED'",
",",
"'EmbeddedObject'",
",",
"'EMBEDDEDOB... | Parse PROPERTY into a CIMProperty object.
VAL is just the pcdata of the enclosed VALUE node.
::
<!ELEMENT PROPERTY (QUALIFIER*, VALUE?)>
<!ATTLIST PROPERTY
%CIMName;
%CIMType; #REQUIRED
%ClassOrigin;
... | [
"Parse",
"PROPERTY",
"into",
"a",
"CIMProperty",
"object",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L1323-L1378 | train | 28,291 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_paramvalue | def parse_paramvalue(self, tup_tree):
"""
Parse PARAMVALUE element.
::
<!ELEMENT PARAMVALUE (VALUE | VALUE.REFERENCE | VALUE.ARRAY |
VALUE.REFARRAY | CLASSNAME | INSTANCENAME |
CLASS | INSTANCE | VALUE.NAMEDINSTA... | python | def parse_paramvalue(self, tup_tree):
"""
Parse PARAMVALUE element.
::
<!ELEMENT PARAMVALUE (VALUE | VALUE.REFERENCE | VALUE.ARRAY |
VALUE.REFARRAY | CLASSNAME | INSTANCENAME |
CLASS | INSTANCE | VALUE.NAMEDINSTA... | [
"def",
"parse_paramvalue",
"(",
"self",
",",
"tup_tree",
")",
":",
"# Version 2.4 of DSP0201 added CLASSNAME, INSTANCENAME, CLASS,",
"# INSTANCE, and VALUE.NAMEDINSTANCE.",
"# Version 2.1.1 of DSP0201 lacks the %ParamType entity but it is",
"# present as optional (for backwards compatibility) ... | Parse PARAMVALUE element.
::
<!ELEMENT PARAMVALUE (VALUE | VALUE.REFERENCE | VALUE.ARRAY |
VALUE.REFARRAY | CLASSNAME | INSTANCENAME |
CLASS | INSTANCE | VALUE.NAMEDINSTANCE)?>
<!ATTLIST PARAMVALUE
%C... | [
"Parse",
"PARAMVALUE",
"element",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L1707-L1752 | train | 28,292 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_expparamvalue | def parse_expparamvalue(self, tup_tree):
"""
Parse for EXPPARMVALUE Element. I.e.
::
<!ELEMENT EXPPARAMVALUE (INSTANCE?)>
<!ATTLIST EXPPARAMVALUE
%CIMName;>
"""
self.check_node(tup_tree, 'EXPPARAMVALUE', ('NAME',), (), ('INSTANCE',))
... | python | def parse_expparamvalue(self, tup_tree):
"""
Parse for EXPPARMVALUE Element. I.e.
::
<!ELEMENT EXPPARAMVALUE (INSTANCE?)>
<!ATTLIST EXPPARAMVALUE
%CIMName;>
"""
self.check_node(tup_tree, 'EXPPARAMVALUE', ('NAME',), (), ('INSTANCE',))
... | [
"def",
"parse_expparamvalue",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'EXPPARAMVALUE'",
",",
"(",
"'NAME'",
",",
")",
",",
"(",
")",
",",
"(",
"'INSTANCE'",
",",
")",
")",
"child",
"=",
"self",
".",
"... | Parse for EXPPARMVALUE Element. I.e.
::
<!ELEMENT EXPPARAMVALUE (INSTANCE?)>
<!ATTLIST EXPPARAMVALUE
%CIMName;> | [
"Parse",
"for",
"EXPPARMVALUE",
"Element",
".",
"I",
".",
"e",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L1754-L1770 | train | 28,293 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_simplersp | def parse_simplersp(self, tup_tree):
"""
Parse for SIMPLERSP Element.
::
<!ELEMENT SIMPLERSP (METHODRESPONSE | IMETHODRESPONSE)>
"""
self.check_node(tup_tree, 'SIMPLERSP')
child = self.one_child(tup_tree, ('METHODRESPONSE', 'IMETHODRESPONSE'))
r... | python | def parse_simplersp(self, tup_tree):
"""
Parse for SIMPLERSP Element.
::
<!ELEMENT SIMPLERSP (METHODRESPONSE | IMETHODRESPONSE)>
"""
self.check_node(tup_tree, 'SIMPLERSP')
child = self.one_child(tup_tree, ('METHODRESPONSE', 'IMETHODRESPONSE'))
r... | [
"def",
"parse_simplersp",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'SIMPLERSP'",
")",
"child",
"=",
"self",
".",
"one_child",
"(",
"tup_tree",
",",
"(",
"'METHODRESPONSE'",
",",
"'IMETHODRESPONSE'",
")",
")",
... | Parse for SIMPLERSP Element.
::
<!ELEMENT SIMPLERSP (METHODRESPONSE | IMETHODRESPONSE)> | [
"Parse",
"for",
"SIMPLERSP",
"Element",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L1794-L1807 | train | 28,294 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_methodresponse | def parse_methodresponse(self, tup_tree):
"""
Parse expected METHODRESPONSE ELEMENT. I.e.
::
<!ELEMENT METHODRESPONSE (ERROR | (RETURNVALUE?, PARAMVALUE*))>
<!ATTLIST METHODRESPONSE
%CIMName;>
"""
self.check_node(tup_tree, 'METHODRESPO... | python | def parse_methodresponse(self, tup_tree):
"""
Parse expected METHODRESPONSE ELEMENT. I.e.
::
<!ELEMENT METHODRESPONSE (ERROR | (RETURNVALUE?, PARAMVALUE*))>
<!ATTLIST METHODRESPONSE
%CIMName;>
"""
self.check_node(tup_tree, 'METHODRESPO... | [
"def",
"parse_methodresponse",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'METHODRESPONSE'",
",",
"(",
"'NAME'",
",",
")",
")",
"return",
"(",
"name",
"(",
"tup_tree",
")",
",",
"attrs",
"(",
"tup_tree",
")"... | Parse expected METHODRESPONSE ELEMENT. I.e.
::
<!ELEMENT METHODRESPONSE (ERROR | (RETURNVALUE?, PARAMVALUE*))>
<!ATTLIST METHODRESPONSE
%CIMName;> | [
"Parse",
"expected",
"METHODRESPONSE",
"ELEMENT",
".",
"I",
".",
"e",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L1821-L1837 | train | 28,295 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_expmethodresponse | def parse_expmethodresponse(self, tup_tree):
# pylint: disable=unused-argument
"""
This function not implemented.
"""
raise CIMXMLParseError(
_format("Internal Error: Parsing support for element {0!A} is not "
"implemented", name(tup_tree)),
... | python | def parse_expmethodresponse(self, tup_tree):
# pylint: disable=unused-argument
"""
This function not implemented.
"""
raise CIMXMLParseError(
_format("Internal Error: Parsing support for element {0!A} is not "
"implemented", name(tup_tree)),
... | [
"def",
"parse_expmethodresponse",
"(",
"self",
",",
"tup_tree",
")",
":",
"# pylint: disable=unused-argument",
"raise",
"CIMXMLParseError",
"(",
"_format",
"(",
"\"Internal Error: Parsing support for element {0!A} is not \"",
"\"implemented\"",
",",
"name",
"(",
"tup_tree",
"... | This function not implemented. | [
"This",
"function",
"not",
"implemented",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L1839-L1847 | train | 28,296 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_imethodresponse | def parse_imethodresponse(self, tup_tree):
"""
Parse the tuple for an IMETHODRESPONE Element. I.e.
::
<!ELEMENT IMETHODRESPONSE (ERROR | (IRETURNVALUE?, PARAMVALUE*))>
<!ATTLIST IMETHODRESPONSE
%CIMName;>
"""
self.check_node(tup_tree, ... | python | def parse_imethodresponse(self, tup_tree):
"""
Parse the tuple for an IMETHODRESPONE Element. I.e.
::
<!ELEMENT IMETHODRESPONSE (ERROR | (IRETURNVALUE?, PARAMVALUE*))>
<!ATTLIST IMETHODRESPONSE
%CIMName;>
"""
self.check_node(tup_tree, ... | [
"def",
"parse_imethodresponse",
"(",
"self",
",",
"tup_tree",
")",
":",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'IMETHODRESPONSE'",
",",
"(",
"'NAME'",
",",
")",
")",
"return",
"(",
"name",
"(",
"tup_tree",
")",
",",
"attrs",
"(",
"tup_tree",
"... | Parse the tuple for an IMETHODRESPONE Element. I.e.
::
<!ELEMENT IMETHODRESPONSE (ERROR | (IRETURNVALUE?, PARAMVALUE*))>
<!ATTLIST IMETHODRESPONSE
%CIMName;> | [
"Parse",
"the",
"tuple",
"for",
"an",
"IMETHODRESPONE",
"Element",
".",
"I",
".",
"e",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L1849-L1864 | train | 28,297 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_returnvalue | def parse_returnvalue(self, tup_tree):
"""
Parse the RETURNVALUE element. Returns name, attributes, and
one child as a tuple.
::
<!ELEMENT RETURNVALUE (VALUE | VALUE.REFERENCE)?>
<!ATTLIST RETURNVALUE
%EmbeddedObject;
%ParamType... | python | def parse_returnvalue(self, tup_tree):
"""
Parse the RETURNVALUE element. Returns name, attributes, and
one child as a tuple.
::
<!ELEMENT RETURNVALUE (VALUE | VALUE.REFERENCE)?>
<!ATTLIST RETURNVALUE
%EmbeddedObject;
%ParamType... | [
"def",
"parse_returnvalue",
"(",
"self",
",",
"tup_tree",
")",
":",
"# Version 2.1.1 of the DTD lacks the %ParamType attribute but it",
"# is present in version 2.2. Make it optional to be backwards",
"# compatible.",
"self",
".",
"check_node",
"(",
"tup_tree",
",",
"'RETURNVALUE'... | Parse the RETURNVALUE element. Returns name, attributes, and
one child as a tuple.
::
<!ELEMENT RETURNVALUE (VALUE | VALUE.REFERENCE)?>
<!ATTLIST RETURNVALUE
%EmbeddedObject;
%ParamType; #IMPLIED> | [
"Parse",
"the",
"RETURNVALUE",
"element",
".",
"Returns",
"name",
"attributes",
"and",
"one",
"child",
"as",
"a",
"tuple",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L1888-L1914 | train | 28,298 |
pywbem/pywbem | pywbem/tupleparse.py | TupleParser.parse_ireturnvalue | def parse_ireturnvalue(self, tup_tree):
"""
Parse IRETURNVALUE element. Returns name, attributes and values of the
tup_tree.
::
<!ELEMENT IRETURNVALUE (CLASSNAME* | INSTANCENAME* | VALUE* |
VALUE.OBJECTWITHPATH* |
... | python | def parse_ireturnvalue(self, tup_tree):
"""
Parse IRETURNVALUE element. Returns name, attributes and values of the
tup_tree.
::
<!ELEMENT IRETURNVALUE (CLASSNAME* | INSTANCENAME* | VALUE* |
VALUE.OBJECTWITHPATH* |
... | [
"def",
"parse_ireturnvalue",
"(",
"self",
",",
"tup_tree",
")",
":",
"# Note: The self.check_node() below does not enforce any child elements",
"# from the DTD, and the processing further down does not enforce that",
"# VALUE.ARRAY and VALUE.REFERENCE may appear at most once.",
"# Checking tha... | Parse IRETURNVALUE element. Returns name, attributes and values of the
tup_tree.
::
<!ELEMENT IRETURNVALUE (CLASSNAME* | INSTANCENAME* | VALUE* |
VALUE.OBJECTWITHPATH* |
VALUE.OBJECTWITHLOCALPATH* |
... | [
"Parse",
"IRETURNVALUE",
"element",
".",
"Returns",
"name",
"attributes",
"and",
"values",
"of",
"the",
"tup_tree",
"."
] | e54ecb82c2211e289a268567443d60fdd489f1e4 | https://github.com/pywbem/pywbem/blob/e54ecb82c2211e289a268567443d60fdd489f1e4/pywbem/tupleparse.py#L1916-L1953 | train | 28,299 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.