Search is not available for this dataset
identifier stringlengths 1 155 | parameters stringlengths 2 6.09k | docstring stringlengths 11 63.4k | docstring_summary stringlengths 0 63.4k | function stringlengths 29 99.8k | function_tokens list | start_point list | end_point list | language stringclasses 1
value | docstring_language stringlengths 2 7 | docstring_language_predictions stringlengths 18 23 | is_langid_reliable stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
OrionDBExplorer.get_pipeline | (self, pipeline=None, name=None, template=None, created_by=None) | Get a Pipeline object from the database.
All the arguments are optional but empty queries are not allowed, so at
least one argument needs to be passed with a value different than ``None``.
Args:
pipeline (Template, ObjectID or str):
Pipeline object (or the correspon... | Get a Pipeline object from the database. | def get_pipeline(self, pipeline=None, name=None, template=None, created_by=None):
"""Get a Pipeline object from the database.
All the arguments are optional but empty queries are not allowed, so at
least one argument needs to be passed with a value different than ``None``.
Args:
... | [
"def",
"get_pipeline",
"(",
"self",
",",
"pipeline",
"=",
"None",
",",
"name",
"=",
"None",
",",
"template",
"=",
"None",
",",
"created_by",
"=",
"None",
")",
":",
"return",
"schema",
".",
"Pipeline",
".",
"get",
"(",
"pipeline",
"=",
"pipeline",
",",
... | [
560,
4
] | [
591,
9
] | python | en | ['en', 'en', 'en'] | True |
OrionDBExplorer.add_experiment | (self, name, template, dataset, signals=None, project=None) | Add a new Experiment object to the database.
The Experiment will have to be associated to a Template and a Dataset.
Optionally, a list of Signal objects or the corresponding ObjectIds have to
can be passed to associate this Experiment to only a subset of Signals from
the Dataset. In th... | Add a new Experiment object to the database. | def add_experiment(self, name, template, dataset, signals=None, project=None):
"""Add a new Experiment object to the database.
The Experiment will have to be associated to a Template and a Dataset.
Optionally, a list of Signal objects or the corresponding ObjectIds have to
can be passe... | [
"def",
"add_experiment",
"(",
"self",
",",
"name",
",",
"template",
",",
"dataset",
",",
"signals",
"=",
"None",
",",
"project",
"=",
"None",
")",
":",
"dataset",
"=",
"self",
".",
"get_dataset",
"(",
"dataset",
")",
"if",
"not",
"signals",
":",
"signa... | [
597,
4
] | [
650,
9
] | python | en | ['en', 'en', 'en'] | True |
OrionDBExplorer.get_experiments | (self, name=None, template=None, dataset=None,
signals=None, project=None, created_by=None) | Query the Experiments collection.
All the details about the matching Experiments will be returned in
a ``pandas.DataFrame``.
All the arguments are optional, so a call without arguments will
return a table with information about all the Experiments availabe.
Args:
n... | Query the Experiments collection. | def get_experiments(self, name=None, template=None, dataset=None,
signals=None, project=None, created_by=None):
"""Query the Experiments collection.
All the details about the matching Experiments will be returned in
a ``pandas.DataFrame``.
All the arguments are ... | [
"def",
"get_experiments",
"(",
"self",
",",
"name",
"=",
"None",
",",
"template",
"=",
"None",
",",
"dataset",
"=",
"None",
",",
"signals",
"=",
"None",
",",
"project",
"=",
"None",
",",
"created_by",
"=",
"None",
")",
":",
"return",
"schema",
".",
"... | [
652,
4
] | [
687,
9
] | python | en | ['en', 'en', 'en'] | True |
OrionDBExplorer.get_experiment | (self, experiment=None, name=None, project=None, template=None,
dataset=None, signals=None, created_by=None) | Get an Experiment object from the database.
All the arguments are optional but empty queries are not allowed, so at
least one argument needs to be passed with a value different than ``None``.
Args:
experiment (Experiment, ObjectID or str):
Experiment object (or the ... | Get an Experiment object from the database. | def get_experiment(self, experiment=None, name=None, project=None, template=None,
dataset=None, signals=None, created_by=None):
"""Get an Experiment object from the database.
All the arguments are optional but empty queries are not allowed, so at
least one argument needs ... | [
"def",
"get_experiment",
"(",
"self",
",",
"experiment",
"=",
"None",
",",
"name",
"=",
"None",
",",
"project",
"=",
"None",
",",
"template",
"=",
"None",
",",
"dataset",
"=",
"None",
",",
"signals",
"=",
"None",
",",
"created_by",
"=",
"None",
")",
... | [
689,
4
] | [
729,
9
] | python | en | ['en', 'en', 'en'] | True |
OrionDBExplorer.add_datarun | (self, experiment, pipeline) | Add a new Datarun object to the database.
The Datarun needs to be associated to an Experiment and a Pipeline.
Args:
experiment (Experiment or ObjectID or str):
Experiment object (or the corresponding ObjectID, or its string
representation) to which this Data... | Add a new Datarun object to the database. | def add_datarun(self, experiment, pipeline):
"""Add a new Datarun object to the database.
The Datarun needs to be associated to an Experiment and a Pipeline.
Args:
experiment (Experiment or ObjectID or str):
Experiment object (or the corresponding ObjectID, or its s... | [
"def",
"add_datarun",
"(",
"self",
",",
"experiment",
",",
"pipeline",
")",
":",
"return",
"schema",
".",
"Datarun",
".",
"insert",
"(",
"experiment",
"=",
"experiment",
",",
"pipeline",
"=",
"pipeline",
",",
")"
] | [
735,
4
] | [
754,
9
] | python | en | ['en', 'en', 'en'] | True |
OrionDBExplorer.get_dataruns | (self, experiment=None, pipeline=None, status=None) | Query the Dataruns collection.
All the details about the matching Dataruns will be returned in
a ``pandas.DataFrame``.
All the arguments are optional, so a call without arguments will
return a table with information about all the Dataruns availabe.
Args:
experiment... | Query the Dataruns collection. | def get_dataruns(self, experiment=None, pipeline=None, status=None):
"""Query the Dataruns collection.
All the details about the matching Dataruns will be returned in
a ``pandas.DataFrame``.
All the arguments are optional, so a call without arguments will
return a table with in... | [
"def",
"get_dataruns",
"(",
"self",
",",
"experiment",
"=",
"None",
",",
"pipeline",
"=",
"None",
",",
"status",
"=",
"None",
")",
":",
"return",
"schema",
".",
"Datarun",
".",
"find",
"(",
"as_df_",
"=",
"True",
",",
"experiment",
"=",
"experiment",
"... | [
756,
4
] | [
782,
9
] | python | en | ['en', 'en', 'en'] | True |
OrionDBExplorer.get_datarun | (self, datarun=None, experiment=None, pipeline=None, status=None) | Get a Datarun object from the database.
All the arguments are optional but empty queries are not allowed, so at
least one argument needs to be passed with a value different than ``None``.
Args:
datarun (Datarun, ObjectID or str):
Datarun object (or the corresponding... | Get a Datarun object from the database. | def get_datarun(self, datarun=None, experiment=None, pipeline=None, status=None):
"""Get a Datarun object from the database.
All the arguments are optional but empty queries are not allowed, so at
least one argument needs to be passed with a value different than ``None``.
Args:
... | [
"def",
"get_datarun",
"(",
"self",
",",
"datarun",
"=",
"None",
",",
"experiment",
"=",
"None",
",",
"pipeline",
"=",
"None",
",",
"status",
"=",
"None",
")",
":",
"return",
"schema",
".",
"Datarun",
".",
"get",
"(",
"experiment",
"=",
"experiment",
",... | [
784,
4
] | [
813,
9
] | python | en | ['en', 'en', 'en'] | True |
OrionDBExplorer.add_signalrun | (self, datarun, signal) | Add a new Signalrun object to the database.
The Signalrun needs to be associated to a Datarun and a Signal.
Args:
datarun (Datarun or ObjectID or str):
Datarun object (or the corresponding ObjectID, or its string
representation) to which this Signalrun belon... | Add a new Signalrun object to the database. | def add_signalrun(self, datarun, signal):
"""Add a new Signalrun object to the database.
The Signalrun needs to be associated to a Datarun and a Signal.
Args:
datarun (Datarun or ObjectID or str):
Datarun object (or the corresponding ObjectID, or its string
... | [
"def",
"add_signalrun",
"(",
"self",
",",
"datarun",
",",
"signal",
")",
":",
"return",
"schema",
".",
"Signalrun",
".",
"insert",
"(",
"datarun",
"=",
"datarun",
",",
"signal",
"=",
"signal",
",",
")"
] | [
819,
4
] | [
838,
9
] | python | en | ['en', 'en', 'en'] | True |
OrionDBExplorer.get_signalruns | (self, datarun=None, signal=None, status=None) | Query the Signalruns collection.
All the details about the matching Signalruns will be returned in
a ``pandas.DataFrame``.
All the arguments are optional, so a call without arguments will
return a table with information about all the Dataruns availabe.
Args:
dataru... | Query the Signalruns collection. | def get_signalruns(self, datarun=None, signal=None, status=None):
"""Query the Signalruns collection.
All the details about the matching Signalruns will be returned in
a ``pandas.DataFrame``.
All the arguments are optional, so a call without arguments will
return a table with i... | [
"def",
"get_signalruns",
"(",
"self",
",",
"datarun",
"=",
"None",
",",
"signal",
"=",
"None",
",",
"status",
"=",
"None",
")",
":",
"return",
"schema",
".",
"Signalrun",
".",
"find",
"(",
"as_df_",
"=",
"True",
",",
"datarun",
"=",
"datarun",
",",
"... | [
840,
4
] | [
865,
9
] | python | en | ['en', 'gl', 'en'] | True |
OrionDBExplorer.get_signalrun | (self, signalrun=None, datarun=None, signal=None, status=None) | Get a Signalrun object from the database.
All the arguments are optional but empty queries are not allowed, so at
least one argument needs to be passed with a value different than ``None``.
Args:
signalrun (Signalrun, ObjectID or str):
Signalrun object (or the corre... | Get a Signalrun object from the database. | def get_signalrun(self, signalrun=None, datarun=None, signal=None, status=None):
"""Get a Signalrun object from the database.
All the arguments are optional but empty queries are not allowed, so at
least one argument needs to be passed with a value different than ``None``.
Args:
... | [
"def",
"get_signalrun",
"(",
"self",
",",
"signalrun",
"=",
"None",
",",
"datarun",
"=",
"None",
",",
"signal",
"=",
"None",
",",
"status",
"=",
"None",
")",
":",
"return",
"schema",
".",
"Signalrun",
".",
"get",
"(",
"signalrun",
"=",
"signalrun",
","... | [
867,
4
] | [
897,
9
] | python | en | ['en', 'en', 'en'] | True |
OrionDBExplorer.add_event | (self, start_time, stop_time, source, severity=None,
signalrun=None, signal=None) | Add a new Event object to the database.
The Event needs to have at least a start_time and a stop_time,
and be associated to either a Signal or a Signalrun.
If a Signalrun is given but no Signal is, the created Event will
be associated to the Signalrun signal value.
If both a S... | Add a new Event object to the database. | def add_event(self, start_time, stop_time, source, severity=None,
signalrun=None, signal=None):
"""Add a new Event object to the database.
The Event needs to have at least a start_time and a stop_time,
and be associated to either a Signal or a Signalrun.
If a Signalru... | [
"def",
"add_event",
"(",
"self",
",",
"start_time",
",",
"stop_time",
",",
"source",
",",
"severity",
"=",
"None",
",",
"signalrun",
"=",
"None",
",",
"signal",
"=",
"None",
")",
":",
"if",
"signal",
"is",
"None",
"and",
"signalrun",
"is",
"None",
":",... | [
903,
4
] | [
954,
9
] | python | en | ['en', 'en', 'en'] | True |
OrionDBExplorer.get_events | (self, signalrun=None, signal=None, source=None) | Query the Events collection.
All the details about the matching Signalruns will be returned in
a ``pandas.DataFrame``.
All the arguments are optional, so a call without arguments will
return a table with information about all the Events availabe.
Args:
signalrun (S... | Query the Events collection. | def get_events(self, signalrun=None, signal=None, source=None):
"""Query the Events collection.
All the details about the matching Signalruns will be returned in
a ``pandas.DataFrame``.
All the arguments are optional, so a call without arguments will
return a table with informa... | [
"def",
"get_events",
"(",
"self",
",",
"signalrun",
"=",
"None",
",",
"signal",
"=",
"None",
",",
"source",
"=",
"None",
")",
":",
"return",
"schema",
".",
"Event",
".",
"find",
"(",
"as_df_",
"=",
"True",
",",
"signalrun",
"=",
"signalrun",
",",
"si... | [
956,
4
] | [
981,
9
] | python | en | ['en', 'en', 'en'] | True |
OrionDBExplorer.get_event | (self, event=None, signalrun=None, signal=None, source=None) | Get an Event object from the database.
All the arguments are optional but empty queries are not allowed, so at
least one argument needs to be passed with a value different than ``None``.
Args:
event (Event, ObjectID or str):
Event object (or the corresponding Object... | Get an Event object from the database. | def get_event(self, event=None, signalrun=None, signal=None, source=None):
"""Get an Event object from the database.
All the arguments are optional but empty queries are not allowed, so at
least one argument needs to be passed with a value different than ``None``.
Args:
eve... | [
"def",
"get_event",
"(",
"self",
",",
"event",
"=",
"None",
",",
"signalrun",
"=",
"None",
",",
"signal",
"=",
"None",
",",
"source",
"=",
"None",
")",
":",
"return",
"schema",
".",
"Event",
".",
"get",
"(",
"event",
"=",
"event",
",",
"signalrun",
... | [
983,
4
] | [
1013,
9
] | python | en | ['en', 'en', 'en'] | True |
OrionDBExplorer.add_annotation | (self, event, tag=None, comment=None) | Add a new Annotation object to the database.
The Event needs to be associated with an Event, and can be given a
``tag`` and a text comment.
Args:
event (Event or ObjectID or str):
Event object (or the corresponding ObjectID, or its string
representat... | Add a new Annotation object to the database. | def add_annotation(self, event, tag=None, comment=None):
"""Add a new Annotation object to the database.
The Event needs to be associated with an Event, and can be given a
``tag`` and a text comment.
Args:
event (Event or ObjectID or str):
Event object (or t... | [
"def",
"add_annotation",
"(",
"self",
",",
"event",
",",
"tag",
"=",
"None",
",",
"comment",
"=",
"None",
")",
":",
"return",
"schema",
".",
"Annotation",
".",
"insert",
"(",
"event",
"=",
"event",
",",
"tag",
"=",
"tag",
",",
"comment",
"=",
"commen... | [
1019,
4
] | [
1041,
9
] | python | en | ['en', 'en', 'en'] | True |
OrionDBExplorer.get_annotations | (self, event=None, tag=None, comment=None, created_by=None) | Query the Annotations collection.
All the details about the matching Annotations will be returned in
a ``pandas.DataFrame``.
All the arguments are optional, so a call without arguments will
return a table with information about all the Annotations availabe.
Args:
e... | Query the Annotations collection. | def get_annotations(self, event=None, tag=None, comment=None, created_by=None):
"""Query the Annotations collection.
All the details about the matching Annotations will be returned in
a ``pandas.DataFrame``.
All the arguments are optional, so a call without arguments will
retur... | [
"def",
"get_annotations",
"(",
"self",
",",
"event",
"=",
"None",
",",
"tag",
"=",
"None",
",",
"comment",
"=",
"None",
",",
"created_by",
"=",
"None",
")",
":",
"return",
"schema",
".",
"Annotation",
".",
"find",
"(",
"as_df_",
"=",
"True",
",",
"ev... | [
1043,
4
] | [
1070,
9
] | python | en | ['en', 'en', 'en'] | True |
OrionDBExplorer.get_annotation | (self, annotation=None, event=None, tag=None, created_by=None) | Get an Event object from the database.
All the arguments are optional but empty queries are not allowed, so at
least one argument needs to be passed with a value different than ``None``.
Args:
annotation (Annotation, ObjectID or str):
Annotation object (or the corre... | Get an Event object from the database. | def get_annotation(self, annotation=None, event=None, tag=None, created_by=None):
"""Get an Event object from the database.
All the arguments are optional but empty queries are not allowed, so at
least one argument needs to be passed with a value different than ``None``.
Args:
... | [
"def",
"get_annotation",
"(",
"self",
",",
"annotation",
"=",
"None",
",",
"event",
"=",
"None",
",",
"tag",
"=",
"None",
",",
"created_by",
"=",
"None",
")",
":",
"return",
"schema",
".",
"Annotation",
".",
"get",
"(",
"annotation",
"=",
"annotation",
... | [
1072,
4
] | [
1104,
9
] | python | en | ['en', 'en', 'en'] | True |
TransformersSummarizer.__init__ | (
self,
model_name_or_path: str = "google/pegasus-xsum",
model_version: Optional[str] = None,
tokenizer: Optional[str] = None,
max_length: int = 200,
min_length: int = 5,
use_gpu: int = 0,
clean_up_tokenization_spaces: bool ... |
Load a Summarization model from Transformers.
See the up-to-date list of available models on
`huggingface.co/models <https://huggingface.co/models?filter=summarization>`__
:param model_name_or_path: Directory of a saved model or the name of a public model e.g.
... |
Load a Summarization model from Transformers.
See the up-to-date list of available models on
`huggingface.co/models <https://huggingface.co/models?filter=summarization>`__ | def __init__(
self,
model_name_or_path: str = "google/pegasus-xsum",
model_version: Optional[str] = None,
tokenizer: Optional[str] = None,
max_length: int = 200,
min_length: int = 5,
use_gpu: int = 0,
clean_up_tokenization_s... | [
"def",
"__init__",
"(",
"self",
",",
"model_name_or_path",
":",
"str",
"=",
"\"google/pegasus-xsum\"",
",",
"model_version",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"tokenizer",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"max_length",
... | [
49,
4
] | [
86,
72
] | python | en | ['en', 'error', 'th'] | False |
TransformersSummarizer.predict | (self, documents: List[Document], generate_single_summary: bool = False) |
Produce the summarization from the supplied documents.
These document can for example be retrieved via the Retriever.
:param documents: Related documents (e.g. coming from a retriever) that the answer shall be conditioned on.
:param generate_single_summary: Whether to generate a single... |
Produce the summarization from the supplied documents.
These document can for example be retrieved via the Retriever. | def predict(self, documents: List[Document], generate_single_summary: bool = False) -> List[Document]:
"""
Produce the summarization from the supplied documents.
These document can for example be retrieved via the Retriever.
:param documents: Related documents (e.g. coming from a retrie... | [
"def",
"predict",
"(",
"self",
",",
"documents",
":",
"List",
"[",
"Document",
"]",
",",
"generate_single_summary",
":",
"bool",
"=",
"False",
")",
"->",
"List",
"[",
"Document",
"]",
":",
"if",
"self",
".",
"min_length",
">",
"self",
".",
"max_length",
... | [
88,
4
] | [
129,
21
] | python | en | ['en', 'error', 'th'] | False |
fit_pipeline | (data: Union[str, pd.DataFrame],
pipeline: Union[str, MLPipeline, dict] = None,
hyperparameters: Union[str, pd.DataFrame] = None,
save_path: str = None) | Fit an Orion pipeline to the data.
The pipeine can be passed as:
* An ``str`` with a path to a JSON file.
* An ``str`` with the name of a registered Orion pipeline.
* An ``MLPipeline`` instance.
* A ``dict`` with an ``MLPipeline`` specification.
If no pipeline is passed, the de... | Fit an Orion pipeline to the data. | def fit_pipeline(data: Union[str, pd.DataFrame],
pipeline: Union[str, MLPipeline, dict] = None,
hyperparameters: Union[str, pd.DataFrame] = None,
save_path: str = None) -> Orion:
"""Fit an Orion pipeline to the data.
The pipeine can be passed as:
* An ... | [
"def",
"fit_pipeline",
"(",
"data",
":",
"Union",
"[",
"str",
",",
"pd",
".",
"DataFrame",
"]",
",",
"pipeline",
":",
"Union",
"[",
"str",
",",
"MLPipeline",
",",
"dict",
"]",
"=",
"None",
",",
"hyperparameters",
":",
"Union",
"[",
"str",
",",
"pd",
... | [
58,
0
] | [
109,
20
] | python | en | ['en', 'en', 'en'] | True |
detect_anomalies | (data: Union[str, pd.DataFrame] = None,
pipeline: Union[Orion, str, MLPipeline, dict] = None,
hyperparameters: Union[str, pd.DataFrame] = None,
train_data: Union[str, pd.DataFrame] = None) | Detect anomalies on timeseries data.
The anomalies are detected using an Orion pipeline which can
be passed as:
* An ``Orion`` instance.
* An ``str`` with the path to an Orion pickle file.
* An ``str`` with a path to a JSON file.
* An ``str`` with the name of a registered Orion... | Detect anomalies on timeseries data. | def detect_anomalies(data: Union[str, pd.DataFrame] = None,
pipeline: Union[Orion, str, MLPipeline, dict] = None,
hyperparameters: Union[str, pd.DataFrame] = None,
train_data: Union[str, pd.DataFrame] = None) -> pd.DataFrame:
"""Detect anomalies on time... | [
"def",
"detect_anomalies",
"(",
"data",
":",
"Union",
"[",
"str",
",",
"pd",
".",
"DataFrame",
"]",
"=",
"None",
",",
"pipeline",
":",
"Union",
"[",
"Orion",
",",
"str",
",",
"MLPipeline",
",",
"dict",
"]",
"=",
"None",
",",
"hyperparameters",
":",
"... | [
112,
0
] | [
166,
29
] | python | en | ['en', 'sn', 'en'] | True |
evaluate_pipeline | (data: Union[str, pd.DataFrame],
truth: Union[str, pd.DataFrame],
pipeline: Union[str, dict, MLPipeline],
hyperparameters: Union[str, pd.DataFrame] = None,
metrics: List[Union[callable, str]] = None,
train_data... | Evaluate the performance of a pipeline.
The pipeline is evaluated by executing it on a signal
for which anomalies are known and then applying one or
more metrics to it to compute scores.
The pipeline can be passed as:
* An ``str`` with a path to a JSON file.
* An ``str`` with the path ... | Evaluate the performance of a pipeline. | def evaluate_pipeline(data: Union[str, pd.DataFrame],
truth: Union[str, pd.DataFrame],
pipeline: Union[str, dict, MLPipeline],
hyperparameters: Union[str, pd.DataFrame] = None,
metrics: List[Union[callable, str]] = None,
... | [
"def",
"evaluate_pipeline",
"(",
"data",
":",
"Union",
"[",
"str",
",",
"pd",
".",
"DataFrame",
"]",
",",
"truth",
":",
"Union",
"[",
"str",
",",
"pd",
".",
"DataFrame",
"]",
",",
"pipeline",
":",
"Union",
"[",
"str",
",",
"dict",
",",
"MLPipeline",
... | [
169,
0
] | [
227,
62
] | python | en | ['en', 'en', 'en'] | True |
test_render_datasource_new_notebook_with_pandas_Datasource | (
empty_data_context,
construct_datasource_new_notebook_assets,
) |
What does this test and why?
The DatasourceNewNotebookRenderer should generate a notebook with text based on the datasource we are trying to implement. Here we are testing pandas Datasource.
|
What does this test and why?
The DatasourceNewNotebookRenderer should generate a notebook with text based on the datasource we are trying to implement. Here we are testing pandas Datasource.
| def test_render_datasource_new_notebook_with_pandas_Datasource(
empty_data_context,
construct_datasource_new_notebook_assets,
):
"""
What does this test and why?
The DatasourceNewNotebookRenderer should generate a notebook with text based on the datasource we are trying to implement. Here we are tes... | [
"def",
"test_render_datasource_new_notebook_with_pandas_Datasource",
"(",
"empty_data_context",
",",
"construct_datasource_new_notebook_assets",
",",
")",
":",
"context",
":",
"DataContext",
"=",
"empty_data_context",
"datasource_name",
"=",
"\"my_pandas_datasource_name\"",
"dataso... | [
180,
0
] | [
231,
26
] | python | en | ['en', 'error', 'th'] | False |
test_render_datasource_new_notebook_with_spark_Datasource | (
empty_data_context,
construct_datasource_new_notebook_assets,
) |
What does this test and why?
The DatasourceNewNotebookRenderer should generate a notebook with text based on the datasource we are trying to implement. Here we are testing spark Datasource.
|
What does this test and why?
The DatasourceNewNotebookRenderer should generate a notebook with text based on the datasource we are trying to implement. Here we are testing spark Datasource.
| def test_render_datasource_new_notebook_with_spark_Datasource(
empty_data_context,
construct_datasource_new_notebook_assets,
):
"""
What does this test and why?
The DatasourceNewNotebookRenderer should generate a notebook with text based on the datasource we are trying to implement. Here we are test... | [
"def",
"test_render_datasource_new_notebook_with_spark_Datasource",
"(",
"empty_data_context",
",",
"construct_datasource_new_notebook_assets",
",",
")",
":",
"context",
":",
"DataContext",
"=",
"empty_data_context",
"datasource_name",
"=",
"\"my_spark_datasource_name\"",
"datasour... | [
234,
0
] | [
285,
26
] | python | en | ['en', 'error', 'th'] | False |
test_render_datasource_new_notebook_with_sql_Datasource | (
empty_data_context,
construct_datasource_new_notebook_assets,
) |
What does this test and why?
The DatasourceNewNotebookRenderer should generate a notebook with text based on the datasource we are trying to implement. Here we are testing sql Datasource.
|
What does this test and why?
The DatasourceNewNotebookRenderer should generate a notebook with text based on the datasource we are trying to implement. Here we are testing sql Datasource.
| def test_render_datasource_new_notebook_with_sql_Datasource(
empty_data_context,
construct_datasource_new_notebook_assets,
):
"""
What does this test and why?
The DatasourceNewNotebookRenderer should generate a notebook with text based on the datasource we are trying to implement. Here we are testin... | [
"def",
"test_render_datasource_new_notebook_with_sql_Datasource",
"(",
"empty_data_context",
",",
"construct_datasource_new_notebook_assets",
",",
")",
":",
"context",
":",
"DataContext",
"=",
"empty_data_context",
"datasource_name",
"=",
"\"my_sql_datasource_name\"",
"datasource_y... | [
288,
0
] | [
341,
26
] | python | en | ['en', 'error', 'th'] | False |
SmokeTestCase.test_xxx | (self) | XXX identity | XXX identity | def test_xxx(self):
"""XXX identity"""
pass | [
"def",
"test_xxx",
"(",
"self",
")",
":",
"pass"
] | [
3,
4
] | [
5,
12
] | python | en | ['en', 'pl', 'en'] | False |
_FindCommandInPath | (command) | If there are no slashes in the command given, this function
searches the PATH env to find the given command, and converts it
to an absolute path. We have to do this because MSVS is looking
for an actual file to launch a debugger on, not just a command
line. Note that this happens at GYP time, so a... | If there are no slashes in the command given, this function
searches the PATH env to find the given command, and converts it
to an absolute path. We have to do this because MSVS is looking
for an actual file to launch a debugger on, not just a command
line. Note that this happens at GYP time, so a... | def _FindCommandInPath(command):
"""If there are no slashes in the command given, this function
searches the PATH env to find the given command, and converts it
to an absolute path. We have to do this because MSVS is looking
for an actual file to launch a debugger on, not just a command
line. No... | [
"def",
"_FindCommandInPath",
"(",
"command",
")",
":",
"if",
"'/'",
"in",
"command",
"or",
"'\\\\'",
"in",
"command",
":",
"# If the command already has path elements (either relative or",
"# absolute), then assume it is constructed properly.",
"return",
"command",
"else",
":... | [
16,
0
] | [
35,
16
] | python | en | ['en', 'en', 'en'] | True |
Writer.__init__ | (self, user_file_path, version, name) | Initializes the user file.
Args:
user_file_path: Path to the user file.
version: Version info.
name: Name of the user file.
| Initializes the user file. | def __init__(self, user_file_path, version, name):
"""Initializes the user file.
Args:
user_file_path: Path to the user file.
version: Version info.
name: Name of the user file.
"""
self.user_file_path = user_file_path
self.version = version
self.name = name
self.configura... | [
"def",
"__init__",
"(",
"self",
",",
"user_file_path",
",",
"version",
",",
"name",
")",
":",
"self",
".",
"user_file_path",
"=",
"user_file_path",
"self",
".",
"version",
"=",
"version",
"self",
".",
"name",
"=",
"name",
"self",
".",
"configurations",
"="... | [
56,
2
] | [
67,
28
] | python | en | ['en', 'en', 'en'] | True |
Writer.AddConfig | (self, name) | Adds a configuration to the project.
Args:
name: Configuration name.
| Adds a configuration to the project. | def AddConfig(self, name):
"""Adds a configuration to the project.
Args:
name: Configuration name.
"""
self.configurations[name] = ['Configuration', {'Name': name}] | [
"def",
"AddConfig",
"(",
"self",
",",
"name",
")",
":",
"self",
".",
"configurations",
"[",
"name",
"]",
"=",
"[",
"'Configuration'",
",",
"{",
"'Name'",
":",
"name",
"}",
"]"
] | [
69,
2
] | [
75,
65
] | python | en | ['en', 'en', 'en'] | True |
Writer.AddDebugSettings | (self, config_name, command, environment = {},
working_directory="") | Adds a DebugSettings node to the user file for a particular config.
Args:
command: command line to run. First element in the list is the
executable. All elements of the command will be quoted if
necessary.
working_directory: other files which may trigger the rule. (optional)
| Adds a DebugSettings node to the user file for a particular config. | def AddDebugSettings(self, config_name, command, environment = {},
working_directory=""):
"""Adds a DebugSettings node to the user file for a particular config.
Args:
command: command line to run. First element in the list is the
executable. All elements of the command wi... | [
"def",
"AddDebugSettings",
"(",
"self",
",",
"config_name",
",",
"command",
",",
"environment",
"=",
"{",
"}",
",",
"working_directory",
"=",
"\"\"",
")",
":",
"command",
"=",
"_QuoteWin32CommandLineArgs",
"(",
"command",
")",
"abs_command",
"=",
"_FindCommandIn... | [
77,
2
] | [
132,
50
] | python | en | ['en', 'en', 'en'] | True |
Writer.WriteIfChanged | (self) | Writes the user file. | Writes the user file. | def WriteIfChanged(self):
"""Writes the user file."""
configs = ['Configurations']
for config, spec in sorted(self.configurations.iteritems()):
configs.append(spec)
content = ['VisualStudioUserFile',
{'Version': self.version.ProjectVersion(),
'Name': self.name
... | [
"def",
"WriteIfChanged",
"(",
"self",
")",
":",
"configs",
"=",
"[",
"'Configurations'",
"]",
"for",
"config",
",",
"spec",
"in",
"sorted",
"(",
"self",
".",
"configurations",
".",
"iteritems",
"(",
")",
")",
":",
"configs",
".",
"append",
"(",
"spec",
... | [
134,
2
] | [
146,
55
] | python | en | ['en', 'en', 'en'] | True |
test_metric_store_store_backend_id | (in_memory_param_store) |
What does this test and why?
A Store should be able to report it's store_backend_id
which is set when the StoreBackend is instantiated.
|
What does this test and why?
A Store should be able to report it's store_backend_id
which is set when the StoreBackend is instantiated.
| def test_metric_store_store_backend_id(in_memory_param_store):
"""
What does this test and why?
A Store should be able to report it's store_backend_id
which is set when the StoreBackend is instantiated.
"""
# Check that store_backend_id exists can be read
assert in_memory_param_store.store_b... | [
"def",
"test_metric_store_store_backend_id",
"(",
"in_memory_param_store",
")",
":",
"# Check that store_backend_id exists can be read",
"assert",
"in_memory_param_store",
".",
"store_backend_id",
"is",
"not",
"None",
"# Check that store_backend_id is a valid UUID",
"assert",
"test_u... | [
84,
0
] | [
93,
76
] | python | en | ['en', 'error', 'th'] | False |
is_union | (declaration) |
Returns True if declaration represents a C++ union
Args:
declaration (declaration_t): the declaration to be checked.
Returns:
bool: True if declaration represents a C++ union
|
Returns True if declaration represents a C++ union | def is_union(declaration):
"""
Returns True if declaration represents a C++ union
Args:
declaration (declaration_t): the declaration to be checked.
Returns:
bool: True if declaration represents a C++ union
"""
if not is_class(declaration):
return False
decl = class_... | [
"def",
"is_union",
"(",
"declaration",
")",
":",
"if",
"not",
"is_class",
"(",
"declaration",
")",
":",
"return",
"False",
"decl",
"=",
"class_traits",
".",
"get_declaration",
"(",
"declaration",
")",
"return",
"decl",
".",
"class_type",
"==",
"class_declarati... | [
17,
0
] | [
30,
65
] | python | en | ['en', 'error', 'th'] | False |
is_struct | (declaration) |
Returns True if declaration represents a C++ struct
Args:
declaration (declaration_t): the declaration to be checked.
Returns:
bool: True if declaration represents a C++ struct
|
Returns True if declaration represents a C++ struct | def is_struct(declaration):
"""
Returns True if declaration represents a C++ struct
Args:
declaration (declaration_t): the declaration to be checked.
Returns:
bool: True if declaration represents a C++ struct
"""
if not is_class(declaration):
return False
decl = cla... | [
"def",
"is_struct",
"(",
"declaration",
")",
":",
"if",
"not",
"is_class",
"(",
"declaration",
")",
":",
"return",
"False",
"decl",
"=",
"class_traits",
".",
"get_declaration",
"(",
"declaration",
")",
"return",
"decl",
".",
"class_type",
"==",
"class_declarat... | [
33,
0
] | [
46,
66
] | python | en | ['en', 'error', 'th'] | False |
find_trivial_constructor | (type_) |
Returns reference to trivial constructor.
Args:
type_ (declarations.class_t): the class to be searched.
Returns:
declarations.constructor_t: the trivial constructor
|
Returns reference to trivial constructor. | def find_trivial_constructor(type_):
"""
Returns reference to trivial constructor.
Args:
type_ (declarations.class_t): the class to be searched.
Returns:
declarations.constructor_t: the trivial constructor
"""
assert isinstance(type_, class_declaration.class_t)
trivial = ... | [
"def",
"find_trivial_constructor",
"(",
"type_",
")",
":",
"assert",
"isinstance",
"(",
"type_",
",",
"class_declaration",
".",
"class_t",
")",
"trivial",
"=",
"type_",
".",
"constructors",
"(",
"lambda",
"x",
":",
"is_trivial_constructor",
"(",
"x",
")",
",",... | [
110,
0
] | [
130,
19
] | python | en | ['en', 'error', 'th'] | False |
find_copy_constructor | (type_) |
Returns reference to copy constructor.
Args:
type_ (declarations.class_t): the class to be searched.
Returns:
declarations.constructor_t: the copy constructor
|
Returns reference to copy constructor. | def find_copy_constructor(type_):
"""
Returns reference to copy constructor.
Args:
type_ (declarations.class_t): the class to be searched.
Returns:
declarations.constructor_t: the copy constructor
"""
copy_ = type_.constructors(
lambda x: is_copy_constructor(x),
... | [
"def",
"find_copy_constructor",
"(",
"type_",
")",
":",
"copy_",
"=",
"type_",
".",
"constructors",
"(",
"lambda",
"x",
":",
"is_copy_constructor",
"(",
"x",
")",
",",
"recursive",
"=",
"False",
",",
"allow_empty",
"=",
"True",
")",
"if",
"copy_",
":",
"... | [
133,
0
] | [
151,
19
] | python | en | ['en', 'error', 'th'] | False |
find_noncopyable_vars | (type_, already_visited_cls_vars=None) |
Returns list of all `noncopyable` variables.
If an already_visited_cls_vars list is provided as argument, the returned
list will not contain these variables. This list will be extended with
whatever variables pointing to classes have been found.
Args:
type_ (declarations.class_t): the cla... |
Returns list of all `noncopyable` variables. | def find_noncopyable_vars(type_, already_visited_cls_vars=None):
"""
Returns list of all `noncopyable` variables.
If an already_visited_cls_vars list is provided as argument, the returned
list will not contain these variables. This list will be extended with
whatever variables pointing to classes h... | [
"def",
"find_noncopyable_vars",
"(",
"type_",
",",
"already_visited_cls_vars",
"=",
"None",
")",
":",
"assert",
"isinstance",
"(",
"type_",
",",
"class_declaration",
".",
"class_t",
")",
"logger",
"=",
"utils",
".",
"loggers",
".",
"cxx_parser",
"mvars",
"=",
... | [
154,
0
] | [
224,
27
] | python | en | ['en', 'error', 'th'] | False |
has_trivial_constructor | (class_) | if class has public trivial constructor, this function will return
reference to it, None otherwise | if class has public trivial constructor, this function will return
reference to it, None otherwise | def has_trivial_constructor(class_):
"""if class has public trivial constructor, this function will return
reference to it, None otherwise"""
class_ = class_traits.get_declaration(class_)
trivial = find_trivial_constructor(class_)
if trivial and trivial.access_type == 'public':
return trivia... | [
"def",
"has_trivial_constructor",
"(",
"class_",
")",
":",
"class_",
"=",
"class_traits",
".",
"get_declaration",
"(",
"class_",
")",
"trivial",
"=",
"find_trivial_constructor",
"(",
"class_",
")",
"if",
"trivial",
"and",
"trivial",
".",
"access_type",
"==",
"'p... | [
227,
0
] | [
233,
22
] | python | en | ['en', 'en', 'en'] | True |
has_copy_constructor | (class_) | if class has public copy constructor, this function will return
reference to it, None otherwise | if class has public copy constructor, this function will return
reference to it, None otherwise | def has_copy_constructor(class_):
"""if class has public copy constructor, this function will return
reference to it, None otherwise"""
class_ = class_traits.get_declaration(class_)
copy_constructor = find_copy_constructor(class_)
if copy_constructor and copy_constructor.access_type == 'public':
... | [
"def",
"has_copy_constructor",
"(",
"class_",
")",
":",
"class_",
"=",
"class_traits",
".",
"get_declaration",
"(",
"class_",
")",
"copy_constructor",
"=",
"find_copy_constructor",
"(",
"class_",
")",
"if",
"copy_constructor",
"and",
"copy_constructor",
".",
"access... | [
236,
0
] | [
242,
31
] | python | en | ['en', 'en', 'en'] | True |
has_destructor | (class_) | if class has destructor, this function will return reference to it,
None otherwise | if class has destructor, this function will return reference to it,
None otherwise | def has_destructor(class_):
"""if class has destructor, this function will return reference to it,
None otherwise"""
class_ = class_traits.get_declaration(class_)
destructor = class_.decls(
decl_type=calldef_members.destructor_t,
recursive=False,
allow_empty=True)
if destruct... | [
"def",
"has_destructor",
"(",
"class_",
")",
":",
"class_",
"=",
"class_traits",
".",
"get_declaration",
"(",
"class_",
")",
"destructor",
"=",
"class_",
".",
"decls",
"(",
"decl_type",
"=",
"calldef_members",
".",
"destructor_t",
",",
"recursive",
"=",
"False... | [
245,
0
] | [
254,
28
] | python | en | ['en', 'en', 'en'] | True |
has_public_constructor | (class_) | if class has any public constructor, this function will return list of
them, otherwise None | if class has any public constructor, this function will return list of
them, otherwise None | def has_public_constructor(class_):
"""if class has any public constructor, this function will return list of
them, otherwise None"""
class_ = class_traits.get_declaration(class_)
decls = class_.constructors(
lambda c: not is_copy_constructor(c) and c.access_type == 'public',
recursive=F... | [
"def",
"has_public_constructor",
"(",
"class_",
")",
":",
"class_",
"=",
"class_traits",
".",
"get_declaration",
"(",
"class_",
")",
"decls",
"=",
"class_",
".",
"constructors",
"(",
"lambda",
"c",
":",
"not",
"is_copy_constructor",
"(",
"c",
")",
"and",
"c"... | [
257,
0
] | [
266,
20
] | python | en | ['en', 'en', 'en'] | True |
has_public_assign | (class_) | returns True, if class has public assign operator, False otherwise | returns True, if class has public assign operator, False otherwise | def has_public_assign(class_):
"""returns True, if class has public assign operator, False otherwise"""
class_ = class_traits.get_declaration(class_)
decls = class_.member_operators(
lambda o: o.symbol == '=' and o.access_type == 'public',
recursive=False,
allow_empty=True)
retur... | [
"def",
"has_public_assign",
"(",
"class_",
")",
":",
"class_",
"=",
"class_traits",
".",
"get_declaration",
"(",
"class_",
")",
"decls",
"=",
"class_",
".",
"member_operators",
"(",
"lambda",
"o",
":",
"o",
".",
"symbol",
"==",
"'='",
"and",
"o",
".",
"a... | [
269,
0
] | [
276,
22
] | python | en | ['en', 'en', 'en'] | True |
has_public_destructor | (decl_type) | returns True, if class has public destructor, False otherwise | returns True, if class has public destructor, False otherwise | def has_public_destructor(decl_type):
"""returns True, if class has public destructor, False otherwise"""
d = has_destructor(decl_type)
return d and d.access_type == 'public' | [
"def",
"has_public_destructor",
"(",
"decl_type",
")",
":",
"d",
"=",
"has_destructor",
"(",
"decl_type",
")",
"return",
"d",
"and",
"d",
".",
"access_type",
"==",
"'public'"
] | [
279,
0
] | [
282,
42
] | python | en | ['en', 'fr', 'en'] | True |
has_vtable | (decl_type) | True, if class has virtual table, False otherwise | True, if class has virtual table, False otherwise | def has_vtable(decl_type):
"""True, if class has virtual table, False otherwise"""
assert isinstance(decl_type, class_declaration.class_t)
return bool(
decl_type.calldefs(
lambda f: isinstance(f, calldef_members.member_function_t) and
f.virtuality != calldef_types.VIRTUALITY_... | [
"def",
"has_vtable",
"(",
"decl_type",
")",
":",
"assert",
"isinstance",
"(",
"decl_type",
",",
"class_declaration",
".",
"class_t",
")",
"return",
"bool",
"(",
"decl_type",
".",
"calldefs",
"(",
"lambda",
"f",
":",
"isinstance",
"(",
"f",
",",
"calldef_memb... | [
285,
0
] | [
293,
30
] | python | en | ['en', 'en', 'en'] | True |
is_base_and_derived | (based, derived) | returns True, if there is "base and derived" relationship between
classes, False otherwise | returns True, if there is "base and derived" relationship between
classes, False otherwise | def is_base_and_derived(based, derived):
"""returns True, if there is "base and derived" relationship between
classes, False otherwise"""
assert isinstance(based, class_declaration.class_t)
assert isinstance(derived, (class_declaration.class_t, tuple))
if isinstance(derived, class_declaration.class... | [
"def",
"is_base_and_derived",
"(",
"based",
",",
"derived",
")",
":",
"assert",
"isinstance",
"(",
"based",
",",
"class_declaration",
".",
"class_t",
")",
"assert",
"isinstance",
"(",
"derived",
",",
"(",
"class_declaration",
".",
"class_t",
",",
"tuple",
")",... | [
296,
0
] | [
311,
16
] | python | en | ['en', 'en', 'en'] | True |
has_any_non_copyconstructor | (decl_type) | if class has any public constructor, which is not copy constructor,
this function will return list of them, otherwise None | if class has any public constructor, which is not copy constructor,
this function will return list of them, otherwise None | def has_any_non_copyconstructor(decl_type):
"""if class has any public constructor, which is not copy constructor,
this function will return list of them, otherwise None"""
class_ = class_traits.get_declaration(decl_type)
decls = class_.constructors(
lambda c: not is_copy_constructor(c) and c.ac... | [
"def",
"has_any_non_copyconstructor",
"(",
"decl_type",
")",
":",
"class_",
"=",
"class_traits",
".",
"get_declaration",
"(",
"decl_type",
")",
"decls",
"=",
"class_",
".",
"constructors",
"(",
"lambda",
"c",
":",
"not",
"is_copy_constructor",
"(",
"c",
")",
"... | [
314,
0
] | [
323,
20
] | python | en | ['en', 'en', 'en'] | True |
is_convertible | (source, target) | returns True, if source could be converted to target, otherwise False | returns True, if source could be converted to target, otherwise False | def is_convertible(source, target):
"""returns True, if source could be converted to target, otherwise False"""
return __is_convertible_t(source, target).is_convertible() | [
"def",
"is_convertible",
"(",
"source",
",",
"target",
")",
":",
"return",
"__is_convertible_t",
"(",
"source",
",",
"target",
")",
".",
"is_convertible",
"(",
")"
] | [
654,
0
] | [
656,
62
] | python | en | ['en', 'en', 'en'] | True |
__is_noncopyable_single | (class_, already_visited_cls_vars=None) |
Implementation detail.
Checks if the class is non copyable, without considering the base classes.
Args:
class_ (declarations.class_t): the class to be checked
already_visited_cls_vars (list): optional list of vars that should not
be checked a second time, to prevent infinite r... |
Implementation detail. | def __is_noncopyable_single(class_, already_visited_cls_vars=None):
"""
Implementation detail.
Checks if the class is non copyable, without considering the base classes.
Args:
class_ (declarations.class_t): the class to be checked
already_visited_cls_vars (list): optional list of vars ... | [
"def",
"__is_noncopyable_single",
"(",
"class_",
",",
"already_visited_cls_vars",
"=",
"None",
")",
":",
"# It is not enough to check base classes, we should also to check",
"# member variables.",
"logger",
"=",
"utils",
".",
"loggers",
".",
"cxx_parser",
"if",
"has_copy_cons... | [
659,
0
] | [
702,
20
] | python | en | ['en', 'error', 'th'] | False |
is_noncopyable | (class_, already_visited_cls_vars=None) |
Checks if class is non copyable
Args:
class_ (declarations.class_t): the class to be checked
already_visited_cls_vars (list): optional list of vars that should not
be checked a second time, to prevent infinite recursions.
In general you can ignore this argument, it is m... |
Checks if class is non copyable | def is_noncopyable(class_, already_visited_cls_vars=None):
"""
Checks if class is non copyable
Args:
class_ (declarations.class_t): the class to be checked
already_visited_cls_vars (list): optional list of vars that should not
be checked a second time, to prevent infinite recurs... | [
"def",
"is_noncopyable",
"(",
"class_",
",",
"already_visited_cls_vars",
"=",
"None",
")",
":",
"logger",
"=",
"utils",
".",
"loggers",
".",
"cxx_parser",
"class_decl",
"=",
"class_traits",
".",
"get_declaration",
"(",
"class_",
")",
"true_header",
"=",
"\"is_no... | [
705,
0
] | [
783,
76
] | python | en | ['en', 'error', 'th'] | False |
is_unary_operator | (oper) | returns True, if operator is unary operator, otherwise False | returns True, if operator is unary operator, otherwise False | def is_unary_operator(oper):
"""returns True, if operator is unary operator, otherwise False"""
# definition:
# memeber in class
# ret-type operator symbol()
# ret-type operator [++ --](int)
# globally
# ret-type operator symbol( arg )
# ret-type operator [++ --](X&, int)
symbols = [... | [
"def",
"is_unary_operator",
"(",
"oper",
")",
":",
"# definition:",
"# memeber in class",
"# ret-type operator symbol()",
"# ret-type operator [++ --](int)",
"# globally",
"# ret-type operator symbol( arg )",
"# ret-type operator [++ --](X&, int)",
"symbols",
"=",
"[",
"'!'",
",",
... | [
786,
0
] | [
818,
24
] | python | en | ['en', 'en', 'en'] | True |
is_binary_operator | (oper) | returns True, if operator is binary operator, otherwise False | returns True, if operator is binary operator, otherwise False | def is_binary_operator(oper):
"""returns True, if operator is binary operator, otherwise False"""
# definition:
# memeber in class
# ret-type operator symbol(arg)
# globally
# ret-type operator symbol( arg1, arg2 )
symbols = [
',', '()', '[]', '!=', '%', '%=', '&', '&&', '&=', '*', '... | [
"def",
"is_binary_operator",
"(",
"oper",
")",
":",
"# definition:",
"# memeber in class",
"# ret-type operator symbol(arg)",
"# globally",
"# ret-type operator symbol( arg1, arg2 )",
"symbols",
"=",
"[",
"','",
",",
"'()'",
",",
"'[]'",
",",
"'!='",
",",
"'%'",
",",
... | [
821,
0
] | [
845,
24
] | python | en | ['en', 'en', 'en'] | True |
is_copy_constructor | (constructor) |
Check if the declaration is a copy constructor,
Args:
constructor (declarations.constructor_t): the constructor
to be checked.
Returns:
bool: True if this is a copy constructor, False instead.
|
Check if the declaration is a copy constructor, | def is_copy_constructor(constructor):
"""
Check if the declaration is a copy constructor,
Args:
constructor (declarations.constructor_t): the constructor
to be checked.
Returns:
bool: True if this is a copy constructor, False instead.
"""
assert isinstance(construc... | [
"def",
"is_copy_constructor",
"(",
"constructor",
")",
":",
"assert",
"isinstance",
"(",
"constructor",
",",
"calldef_members",
".",
"constructor_t",
")",
"args",
"=",
"constructor",
".",
"arguments",
"parent",
"=",
"constructor",
".",
"parent",
"# A copy constructo... | [
848,
0
] | [
901,
56
] | python | en | ['en', 'error', 'th'] | False |
is_trivial_constructor | (constructor) |
Check if the declaration is a trivial constructor.
Args:
constructor (declarations.constructor_t): the constructor
to be checked.
Returns:
bool: True if this is a trivial constructor, False instead.
|
Check if the declaration is a trivial constructor. | def is_trivial_constructor(constructor):
"""
Check if the declaration is a trivial constructor.
Args:
constructor (declarations.constructor_t): the constructor
to be checked.
Returns:
bool: True if this is a trivial constructor, False instead.
"""
assert isinstance... | [
"def",
"is_trivial_constructor",
"(",
"constructor",
")",
":",
"assert",
"isinstance",
"(",
"constructor",
",",
"calldef_members",
".",
"constructor_t",
")",
"return",
"not",
"bool",
"(",
"constructor",
".",
"arguments",
")"
] | [
904,
0
] | [
917,
42
] | python | en | ['en', 'error', 'th'] | False |
declaration_xxx_traits.is_my_case | (self, type_) | returns True, if type represents the desired declaration,
False otherwise | returns True, if type represents the desired declaration,
False otherwise | def is_my_case(self, type_):
"""returns True, if type represents the desired declaration,
False otherwise"""
return (
isinstance(self.__apply_sequence(type_), self.declaration_class)
) | [
"def",
"is_my_case",
"(",
"self",
",",
"type_",
")",
":",
"return",
"(",
"isinstance",
"(",
"self",
".",
"__apply_sequence",
"(",
"type_",
")",
",",
"self",
".",
"declaration_class",
")",
")"
] | [
70,
4
] | [
75,
9
] | python | en | ['en', 'nl', 'en'] | True |
declaration_xxx_traits.get_declaration | (self, type_) | returns reference to the declaration
Precondition: self.is_my_case( type ) == True
| returns reference to the declaration | def get_declaration(self, type_):
"""returns reference to the declaration
Precondition: self.is_my_case( type ) == True
"""
return self.__apply_sequence(type_) | [
"def",
"get_declaration",
"(",
"self",
",",
"type_",
")",
":",
"return",
"self",
".",
"__apply_sequence",
"(",
"type_",
")"
] | [
77,
4
] | [
82,
43
] | python | en | ['en', 'en', 'en'] | True |
test_cli_init_on_existing_project_with_no_uncommitted_dirs_answering_yes_to_fixing_them | (
mock_webbrowser,
caplog,
tmp_path_factory,
) |
This test walks through the onboarding experience.
The user just checked an existing project out of source control and does
not yet have an uncommitted directory.
|
This test walks through the onboarding experience. | def test_cli_init_on_existing_project_with_no_uncommitted_dirs_answering_yes_to_fixing_them(
mock_webbrowser,
caplog,
tmp_path_factory,
):
"""
This test walks through the onboarding experience.
The user just checked an existing project out of source control and does
not yet have an uncommit... | [
"def",
"test_cli_init_on_existing_project_with_no_uncommitted_dirs_answering_yes_to_fixing_them",
"(",
"mock_webbrowser",
",",
"caplog",
",",
"tmp_path_factory",
",",
")",
":",
"root_dir",
"=",
"tmp_path_factory",
".",
"mktemp",
"(",
"\"hiya\"",
")",
"root_dir",
"=",
"str",... | [
17,
0
] | [
89,
60
] | python | en | ['en', 'error', 'th'] | False |
test_cli_init_on_complete_existing_project_all_uncommitted_dirs_exist | (
mock_webbrowser,
caplog,
tmp_path_factory,
) |
This test walks through the onboarding experience.
The user just checked an existing project out of source control and does
not yet have an uncommitted directory.
|
This test walks through the onboarding experience. | def test_cli_init_on_complete_existing_project_all_uncommitted_dirs_exist(
mock_webbrowser,
caplog,
tmp_path_factory,
):
"""
This test walks through the onboarding experience.
The user just checked an existing project out of source control and does
not yet have an uncommitted directory.
... | [
"def",
"test_cli_init_on_complete_existing_project_all_uncommitted_dirs_exist",
"(",
"mock_webbrowser",
",",
"caplog",
",",
"tmp_path_factory",
",",
")",
":",
"root_dir",
"=",
"tmp_path_factory",
".",
"mktemp",
"(",
"\"hiya\"",
")",
"root_dir",
"=",
"str",
"(",
"root_di... | [
93,
0
] | [
150,
60
] | python | en | ['en', 'error', 'th'] | False |
test_escape_all_config_variables | (empty_data_context_with_config_variables) |
Make sure that all types of input to escape_all_config_variables are escaped properly: str, dict, OrderedDict, list
Make sure that changing the escape string works as expected.
|
Make sure that all types of input to escape_all_config_variables are escaped properly: str, dict, OrderedDict, list
Make sure that changing the escape string works as expected.
| def test_escape_all_config_variables(empty_data_context_with_config_variables):
"""
Make sure that all types of input to escape_all_config_variables are escaped properly: str, dict, OrderedDict, list
Make sure that changing the escape string works as expected.
"""
context = empty_data_context_with_c... | [
"def",
"test_escape_all_config_variables",
"(",
"empty_data_context_with_config_variables",
")",
":",
"context",
"=",
"empty_data_context_with_config_variables",
"# str",
"value_str",
"=",
"\"pas$word1\"",
"escaped_value_str",
"=",
"r\"pas\\$word1\"",
"assert",
"context",
".",
... | [
382,
0
] | [
493,
5
] | python | en | ['en', 'error', 'th'] | False |
test_escape_all_config_variables_skip_substitution_vars | (
empty_data_context_with_config_variables,
) |
What does this test and why?
escape_all_config_variables(skip_if_substitution_variable=True/False) should function as documented.
|
What does this test and why?
escape_all_config_variables(skip_if_substitution_variable=True/False) should function as documented.
| def test_escape_all_config_variables_skip_substitution_vars(
empty_data_context_with_config_variables,
):
"""
What does this test and why?
escape_all_config_variables(skip_if_substitution_variable=True/False) should function as documented.
"""
context = empty_data_context_with_config_variables
... | [
"def",
"test_escape_all_config_variables_skip_substitution_vars",
"(",
"empty_data_context_with_config_variables",
",",
")",
":",
"context",
"=",
"empty_data_context_with_config_variables",
"# str",
"value_str",
"=",
"\"$VALUE_STR\"",
"escaped_value_str",
"=",
"r\"\\$VALUE_STR\"",
... | [
496,
0
] | [
738,
5
] | python | en | ['en', 'error', 'th'] | False |
test_create_data_context_and_config_vars_in_code | (tmp_path_factory, monkeypatch) |
What does this test and why?
Creating a DataContext via .create(), then using .save_config_variable() to save a variable that will eventually be substituted (e.g. ${SOME_VAR}) should result in the proper escaping of $.
This is in response to issue #2196
|
What does this test and why?
Creating a DataContext via .create(), then using .save_config_variable() to save a variable that will eventually be substituted (e.g. ${SOME_VAR}) should result in the proper escaping of $.
This is in response to issue #2196
| def test_create_data_context_and_config_vars_in_code(tmp_path_factory, monkeypatch):
"""
What does this test and why?
Creating a DataContext via .create(), then using .save_config_variable() to save a variable that will eventually be substituted (e.g. ${SOME_VAR}) should result in the proper escaping of $.
... | [
"def",
"test_create_data_context_and_config_vars_in_code",
"(",
"tmp_path_factory",
",",
"monkeypatch",
")",
":",
"project_path",
"=",
"str",
"(",
"tmp_path_factory",
".",
"mktemp",
"(",
"\"data_context\"",
")",
")",
"context",
"=",
"ge",
".",
"DataContext",
".",
"c... | [
741,
0
] | [
838,
72
] | python | en | ['en', 'error', 'th'] | False |
create_text_fc | (text) |
Creates :class:`parser.file_configuration_t` instance, configured to
contain Python string, that contains valid C++ code
:param text: C++ code
:type text: str
:rtype: :class:`parser.file_configuration_t`
|
Creates :class:`parser.file_configuration_t` instance, configured to
contain Python string, that contains valid C++ code | def create_text_fc(text):
"""
Creates :class:`parser.file_configuration_t` instance, configured to
contain Python string, that contains valid C++ code
:param text: C++ code
:type text: str
:rtype: :class:`parser.file_configuration_t`
"""
return file_configuration_t(
data=text,... | [
"def",
"create_text_fc",
"(",
"text",
")",
":",
"return",
"file_configuration_t",
"(",
"data",
"=",
"text",
",",
"content_type",
"=",
"file_configuration_t",
".",
"CONTENT_TYPE",
".",
"TEXT",
")"
] | [
98,
0
] | [
111,
60
] | python | en | ['en', 'error', 'th'] | False |
create_source_fc | (header) |
Creates :class:`parser.file_configuration_t` instance, configured to
contain path to C++ source file
:param header: path to C++ source file
:type header: str
:rtype: :class:`parser.file_configuration_t`
|
Creates :class:`parser.file_configuration_t` instance, configured to
contain path to C++ source file | def create_source_fc(header):
"""
Creates :class:`parser.file_configuration_t` instance, configured to
contain path to C++ source file
:param header: path to C++ source file
:type header: str
:rtype: :class:`parser.file_configuration_t`
"""
return file_configuration_t(
data=he... | [
"def",
"create_source_fc",
"(",
"header",
")",
":",
"return",
"file_configuration_t",
"(",
"data",
"=",
"header",
",",
"content_type",
"=",
"file_configuration_t",
".",
"CONTENT_TYPE",
".",
"STANDARD_SOURCE_FILE",
")"
] | [
114,
0
] | [
127,
76
] | python | en | ['en', 'error', 'th'] | False |
create_gccxml_fc | (xml_file) |
Creates :class:`parser.file_configuration_t` instance, configured to
contain path to GCC-XML generated XML file.
:param xml_file: path to GCC-XML generated XML file
:type xml_file: str
:rtype: :class:`parser.file_configuration_t`
|
Creates :class:`parser.file_configuration_t` instance, configured to
contain path to GCC-XML generated XML file. | def create_gccxml_fc(xml_file):
"""
Creates :class:`parser.file_configuration_t` instance, configured to
contain path to GCC-XML generated XML file.
:param xml_file: path to GCC-XML generated XML file
:type xml_file: str
:rtype: :class:`parser.file_configuration_t`
"""
return file_con... | [
"def",
"create_gccxml_fc",
"(",
"xml_file",
")",
":",
"return",
"file_configuration_t",
"(",
"data",
"=",
"xml_file",
",",
"content_type",
"=",
"file_configuration_t",
".",
"CONTENT_TYPE",
".",
"GCCXML_GENERATED_FILE",
")"
] | [
130,
0
] | [
143,
77
] | python | en | ['en', 'error', 'th'] | False |
create_cached_source_fc | (header, cached_source_file) |
Creates :class:`parser.file_configuration_t` instance, configured to
contain path to GCC-XML generated XML file and C++ source file. If XML file
does not exists, it will be created and used for parsing. If XML file
exists, it will be used for parsing.
:param header: path to C++ source file
:ty... |
Creates :class:`parser.file_configuration_t` instance, configured to
contain path to GCC-XML generated XML file and C++ source file. If XML file
does not exists, it will be created and used for parsing. If XML file
exists, it will be used for parsing. | def create_cached_source_fc(header, cached_source_file):
"""
Creates :class:`parser.file_configuration_t` instance, configured to
contain path to GCC-XML generated XML file and C++ source file. If XML file
does not exists, it will be created and used for parsing. If XML file
exists, it will be used ... | [
"def",
"create_cached_source_fc",
"(",
"header",
",",
"cached_source_file",
")",
":",
"return",
"file_configuration_t",
"(",
"data",
"=",
"header",
",",
"cached_source_file",
"=",
"cached_source_file",
",",
"content_type",
"=",
"file_configuration_t",
".",
"CONTENT_TYPE... | [
146,
0
] | [
165,
74
] | python | en | ['en', 'error', 'th'] | False |
project_reader_t.__init__ | (self, config, cache=None, decl_factory=None) |
:param config: GCCXML configuration
:type config: :class:xml_generator_configuration_t
:param cache: declaration cache, by default a cache functionality will
not be used
:type cache: :class:`cache_base_t` instance or `str`
:param decl_factory: declaration... |
:param config: GCCXML configuration
:type config: :class:xml_generator_configuration_t | def __init__(self, config, cache=None, decl_factory=None):
"""
:param config: GCCXML configuration
:type config: :class:xml_generator_configuration_t
:param cache: declaration cache, by default a cache functionality will
not be used
:type cache: :class:`cac... | [
"def",
"__init__",
"(",
"self",
",",
"config",
",",
"cache",
"=",
"None",
",",
"decl_factory",
"=",
"None",
")",
":",
"self",
".",
"__config",
"=",
"config",
"self",
".",
"__dcache",
"=",
"None",
"if",
"isinstance",
"(",
"cache",
",",
"declarations_cache... | [
172,
4
] | [
198,
49
] | python | en | ['en', 'error', 'th'] | False |
project_reader_t.xml_generator_from_xml_file | (self) |
Configuration object containing information about the xml generator
read from the xml file.
Returns:
utils.xml_generators: configuration object
|
Configuration object containing information about the xml generator
read from the xml file. | def xml_generator_from_xml_file(self):
"""
Configuration object containing information about the xml generator
read from the xml file.
Returns:
utils.xml_generators: configuration object
"""
return self.__xml_generator_from_xml_file | [
"def",
"xml_generator_from_xml_file",
"(",
"self",
")",
":",
"return",
"self",
".",
"__xml_generator_from_xml_file"
] | [
201,
4
] | [
209,
49
] | python | en | ['en', 'error', 'th'] | False |
project_reader_t.get_os_file_names | (files) |
returns file names
:param files: list of strings and\\or :class:`file_configuration_t`
instances.
:type files: list
|
returns file names | def get_os_file_names(files):
"""
returns file names
:param files: list of strings and\\or :class:`file_configuration_t`
instances.
:type files: list
"""
fnames = []
for f in files:
if utils.is_str(f):
fnames.app... | [
"def",
"get_os_file_names",
"(",
"files",
")",
":",
"fnames",
"=",
"[",
"]",
"for",
"f",
"in",
"files",
":",
"if",
"utils",
".",
"is_str",
"(",
"f",
")",
":",
"fnames",
".",
"append",
"(",
"f",
")",
"elif",
"isinstance",
"(",
"f",
",",
"file_config... | [
212,
4
] | [
233,
21
] | python | en | ['en', 'error', 'th'] | False |
project_reader_t.read_files | (
self,
files,
compilation_mode=COMPILATION_MODE.FILE_BY_FILE) |
parses a set of files
:param files: list of strings and\\or :class:`file_configuration_t`
instances.
:type files: list
:param compilation_mode: determines whether the files are parsed
individually or as one single chunk
:t... |
parses a set of files | def read_files(
self,
files,
compilation_mode=COMPILATION_MODE.FILE_BY_FILE):
"""
parses a set of files
:param files: list of strings and\\or :class:`file_configuration_t`
instances.
:type files: list
:param compilation_... | [
"def",
"read_files",
"(",
"self",
",",
"files",
",",
"compilation_mode",
"=",
"COMPILATION_MODE",
".",
"FILE_BY_FILE",
")",
":",
"if",
"compilation_mode",
"==",
"COMPILATION_MODE",
".",
"ALL_AT_ONCE",
"and",
"len",
"(",
"files",
")",
"==",
"len",
"(",
"self",
... | [
235,
4
] | [
263,
51
] | python | en | ['en', 'error', 'th'] | False |
project_reader_t.read_string | (self, content) | Parse a string containing C/C++ source code.
:param content: C/C++ source code.
:type content: str
:rtype: Declarations
| Parse a string containing C/C++ source code. | def read_string(self, content):
"""Parse a string containing C/C++ source code.
:param content: C/C++ source code.
:type content: str
:rtype: Declarations
"""
reader = source_reader.source_reader_t(
self.__config,
None,
self.__decl_fac... | [
"def",
"read_string",
"(",
"self",
",",
"content",
")",
":",
"reader",
"=",
"source_reader",
".",
"source_reader_t",
"(",
"self",
".",
"__config",
",",
"None",
",",
"self",
".",
"__decl_factory",
")",
"decls",
"=",
"reader",
".",
"read_string",
"(",
"conte... | [
357,
4
] | [
370,
20
] | python | en | ['en', 'en', 'en'] | True |
project_reader_t.read_xml | (self, file_configuration) | parses C++ code, defined on the file_configurations and returns
GCCXML generated file content | parses C++ code, defined on the file_configurations and returns
GCCXML generated file content | def read_xml(self, file_configuration):
"""parses C++ code, defined on the file_configurations and returns
GCCXML generated file content"""
xml_file_path = None
delete_xml_file = True
fc = file_configuration
reader = source_reader.source_reader_t(
self.__conf... | [
"def",
"read_xml",
"(",
"self",
",",
"file_configuration",
")",
":",
"xml_file_path",
"=",
"None",
"delete_xml_file",
"=",
"True",
"fc",
"=",
"file_configuration",
"reader",
"=",
"source_reader",
".",
"source_reader_t",
"(",
"self",
".",
"__config",
",",
"None",... | [
372,
4
] | [
416,
72
] | python | en | ['en', 'en', 'en'] | True |
column_aggregate_value | (
engine: Type[ExecutionEngine],
metric_fn_type="value",
domain_type="column",
**kwargs,
) | Return the column aggregate metric decorator for the specified engine.
Args:
engine:
**kwargs:
Returns:
| Return the column aggregate metric decorator for the specified engine. | def column_aggregate_value(
engine: Type[ExecutionEngine],
metric_fn_type="value",
domain_type="column",
**kwargs,
):
"""Return the column aggregate metric decorator for the specified engine.
Args:
engine:
**kwargs:
Returns:
"""
if issubclass(engine, PandasExecutio... | [
"def",
"column_aggregate_value",
"(",
"engine",
":",
"Type",
"[",
"ExecutionEngine",
"]",
",",
"metric_fn_type",
"=",
"\"value\"",
",",
"domain_type",
"=",
"\"column\"",
",",
"*",
"*",
"kwargs",
",",
")",
":",
"if",
"issubclass",
"(",
"engine",
",",
"PandasE... | [
28,
0
] | [
91,
9
] | python | en | ['en', 'en', 'en'] | True |
column_aggregate_partial | (engine: Type[ExecutionEngine], **kwargs) | Return the column aggregate metric decorator for the specified engine.
Args:
engine:
**kwargs:
Returns:
| Return the column aggregate metric decorator for the specified engine. | def column_aggregate_partial(engine: Type[ExecutionEngine], **kwargs):
"""Return the column aggregate metric decorator for the specified engine.
Args:
engine:
**kwargs:
Returns:
"""
partial_fn_type = MetricPartialFunctionTypes.AGGREGATE_FN
domain_type = MetricDomainTypes.COLUM... | [
"def",
"column_aggregate_partial",
"(",
"engine",
":",
"Type",
"[",
"ExecutionEngine",
"]",
",",
"*",
"*",
"kwargs",
")",
":",
"partial_fn_type",
"=",
"MetricPartialFunctionTypes",
".",
"AGGREGATE_FN",
"domain_type",
"=",
"MetricDomainTypes",
".",
"COLUMN",
"if",
... | [
94,
0
] | [
227,
75
] | python | en | ['en', 'en', 'en'] | True |
ExpectColumnDistinctValuesToEqualSet.validate_configuration | (self, configuration: Optional[ExpectationConfiguration]) | Validating that user has inputted a value set and that configuration has been initialized | Validating that user has inputted a value set and that configuration has been initialized | def validate_configuration(self, configuration: Optional[ExpectationConfiguration]):
"""Validating that user has inputted a value set and that configuration has been initialized"""
super().validate_configuration(configuration)
if configuration is None:
configuration = self.configurat... | [
"def",
"validate_configuration",
"(",
"self",
",",
"configuration",
":",
"Optional",
"[",
"ExpectationConfiguration",
"]",
")",
":",
"super",
"(",
")",
".",
"validate_configuration",
"(",
"configuration",
")",
"if",
"configuration",
"is",
"None",
":",
"configurati... | [
46,
4
] | [
62,
19
] | python | en | ['en', 'en', 'en'] | True |
V2Route.host_constraints | (self, prune_unreachable_routes: bool) | Return a set of hostglobs that match (a superset of) all hostnames that this route can
apply to.
An emtpy set means that this route cannot possibly apply to any hostnames.
This considers SNI information and (if prune_unreachable_routes) HeaderMatchers that
`exact_match` on the `:author... | Return a set of hostglobs that match (a superset of) all hostnames that this route can
apply to. | def host_constraints(self, prune_unreachable_routes: bool) -> Set[str]:
"""Return a set of hostglobs that match (a superset of) all hostnames that this route can
apply to.
An emtpy set means that this route cannot possibly apply to any hostnames.
This considers SNI information and (if ... | [
"def",
"host_constraints",
"(",
"self",
",",
"prune_unreachable_routes",
":",
"bool",
")",
"->",
"Set",
"[",
"str",
"]",
":",
"# Start by grabbing a list of all the SNI host globs for this route. If there aren't any,",
"# default to \"*\".",
"hostglobs",
"=",
"set",
"(",
"s... | [
422,
4
] | [
475,
24
] | python | en | ['en', 'en', 'en'] | True |
BaseGenerator.predict | (self, query: str, documents: List[Document], top_k: Optional[int]) |
Abstract method to generate answers.
:param query: Query
:param documents: Related documents (e.g. coming from a retriever) that the answer shall be conditioned on.
:param top_k: Number of returned answers
:return: Generated answers plus additional infos in a dict
|
Abstract method to generate answers. | def predict(self, query: str, documents: List[Document], top_k: Optional[int]) -> Dict:
"""
Abstract method to generate answers.
:param query: Query
:param documents: Related documents (e.g. coming from a retriever) that the answer shall be conditioned on.
:param top_k: Number o... | [
"def",
"predict",
"(",
"self",
",",
"query",
":",
"str",
",",
"documents",
":",
"List",
"[",
"Document",
"]",
",",
"top_k",
":",
"Optional",
"[",
"int",
"]",
")",
"->",
"Dict",
":",
"pass"
] | [
14,
4
] | [
23,
12
] | python | en | ['en', 'error', 'th'] | False |
Store.__init__ | (
self, store_backend=None, runtime_environment=None, store_name="no_store_name"
) |
Runtime environment may be necessary to instantiate store backend elements.
Args:
store_backend:
runtime_environment:
store_name: store name given in the DataContextConfig (via either in-code or yaml configuration)
|
Runtime environment may be necessary to instantiate store backend elements.
Args:
store_backend:
runtime_environment:
store_name: store name given in the DataContextConfig (via either in-code or yaml configuration)
| def __init__(
self, store_backend=None, runtime_environment=None, store_name="no_store_name"
):
"""
Runtime environment may be necessary to instantiate store backend elements.
Args:
store_backend:
runtime_environment:
store_name: store name given i... | [
"def",
"__init__",
"(",
"self",
",",
"store_backend",
"=",
"None",
",",
"runtime_environment",
"=",
"None",
",",
"store_name",
"=",
"\"no_store_name\"",
")",
":",
"if",
"store_backend",
"is",
"None",
":",
"store_backend",
"=",
"{",
"\"class_name\"",
":",
"\"In... | [
30,
4
] | [
61,
73
] | python | en | ['en', 'error', 'th'] | False |
Store.ge_cloud_response_json_to_object_dict | (self, response_json: Dict) |
This method takes full json response from GE cloud and outputs a dict appropriate for
deserialization into a GE object
|
This method takes full json response from GE cloud and outputs a dict appropriate for
deserialization into a GE object
| def ge_cloud_response_json_to_object_dict(self, response_json: Dict) -> Dict:
"""
This method takes full json response from GE cloud and outputs a dict appropriate for
deserialization into a GE object
"""
return response_json | [
"def",
"ge_cloud_response_json_to_object_dict",
"(",
"self",
",",
"response_json",
":",
"Dict",
")",
"->",
"Dict",
":",
"return",
"response_json"
] | [
63,
4
] | [
68,
28
] | python | en | ['en', 'error', 'th'] | False |
Store.store_backend_id | (self) |
Report the store_backend_id of the currently-configured StoreBackend
Returns:
store_backend_id which is a UUID(version=4)
|
Report the store_backend_id of the currently-configured StoreBackend
Returns:
store_backend_id which is a UUID(version=4)
| def store_backend_id(self) -> str:
"""
Report the store_backend_id of the currently-configured StoreBackend
Returns:
store_backend_id which is a UUID(version=4)
"""
return self._store_backend.store_backend_id | [
"def",
"store_backend_id",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"_store_backend",
".",
"store_backend_id"
] | [
89,
4
] | [
95,
51
] | python | en | ['en', 'error', 'th'] | False |
Store.store_backend_id_warnings_suppressed | (self) |
Report the store_backend_id of the currently-configured StoreBackend, suppressing warnings for invalid configurations.
Returns:
store_backend_id which is a UUID(version=4)
|
Report the store_backend_id of the currently-configured StoreBackend, suppressing warnings for invalid configurations.
Returns:
store_backend_id which is a UUID(version=4)
| def store_backend_id_warnings_suppressed(self):
"""
Report the store_backend_id of the currently-configured StoreBackend, suppressing warnings for invalid configurations.
Returns:
store_backend_id which is a UUID(version=4)
"""
return self._store_backend.store_backend... | [
"def",
"store_backend_id_warnings_suppressed",
"(",
"self",
")",
":",
"return",
"self",
".",
"_store_backend",
".",
"store_backend_id_warnings_suppressed"
] | [
98,
4
] | [
104,
71
] | python | en | ['en', 'error', 'th'] | False |
docs | () | Data Docs operations | Data Docs operations | def docs():
"""Data Docs operations"""
pass | [
"def",
"docs",
"(",
")",
":",
"pass"
] | [
12,
0
] | [
14,
8
] | python | en | ['en', 'bg', 'en'] | True |
docs_build | (directory, site_name, view=True, assume_yes=False) | Build Data Docs for a project. | Build Data Docs for a project. | def docs_build(directory, site_name, view=True, assume_yes=False):
"""Build Data Docs for a project."""
context = toolkit.load_data_context_with_error_handling(directory)
build_docs(context, site_name=site_name, view=view, assume_yes=assume_yes)
toolkit.send_usage_message(
data_context=context, ... | [
"def",
"docs_build",
"(",
"directory",
",",
"site_name",
",",
"view",
"=",
"True",
",",
"assume_yes",
"=",
"False",
")",
":",
"context",
"=",
"toolkit",
".",
"load_data_context_with_error_handling",
"(",
"directory",
")",
"build_docs",
"(",
"context",
",",
"si... | [
42,
0
] | [
48,
5
] | python | en | ['en', 'en', 'en'] | True |
docs_list | (directory) | List known Data Docs Sites. | List known Data Docs Sites. | def docs_list(directory):
"""List known Data Docs Sites."""
context = toolkit.load_data_context_with_error_handling(directory)
docs_sites_url_dicts = context.get_docs_sites_urls()
docs_sites_strings = [
" - <cyan>{}</cyan>: {}".format(
docs_site_dict["site_name"],
docs_s... | [
"def",
"docs_list",
"(",
"directory",
")",
":",
"context",
"=",
"toolkit",
".",
"load_data_context_with_error_handling",
"(",
"directory",
")",
"docs_sites_url_dicts",
"=",
"context",
".",
"get_docs_sites_urls",
"(",
")",
"docs_sites_strings",
"=",
"[",
"\" - <cyan>{}... | [
58,
0
] | [
81,
5
] | python | en | ['en', 'fr', 'en'] | True |
clean_data_docs | (directory, site_name=None, all=None) | Delete data docs | Delete data docs | def clean_data_docs(directory, site_name=None, all=None):
"""Delete data docs"""
context = toolkit.load_data_context_with_error_handling(directory)
failed = True
if site_name is None and all is None:
cli_message(
"<red>{}</red>".format(
"Please specify --all to remove... | [
"def",
"clean_data_docs",
"(",
"directory",
",",
"site_name",
"=",
"None",
",",
"all",
"=",
"None",
")",
":",
"context",
"=",
"toolkit",
".",
"load_data_context_with_error_handling",
"(",
"directory",
")",
"failed",
"=",
"True",
"if",
"site_name",
"is",
"None"... | [
97,
0
] | [
120,
9
] | python | it | ['it', 'sr', 'pt'] | False |
build_docs | (context, site_name=None, view=True, assume_yes=False) | Build documentation in a context | Build documentation in a context | def build_docs(context, site_name=None, view=True, assume_yes=False):
"""Build documentation in a context"""
logger.debug("Starting cli.datasource.build_docs")
if site_name is not None:
site_names = [site_name]
else:
site_names = None
index_page_locator_infos = context.build_data_do... | [
"def",
"build_docs",
"(",
"context",
",",
"site_name",
"=",
"None",
",",
"view",
"=",
"True",
",",
"assume_yes",
"=",
"False",
")",
":",
"logger",
".",
"debug",
"(",
"\"Starting cli.datasource.build_docs\"",
")",
"if",
"site_name",
"is",
"not",
"None",
":",
... | [
132,
0
] | [
159,
72
] | python | en | ['en', 'en', 'en'] | True |
byte_info.byte_size | (self) |
Size of this declaration/type in bytes
Returns:
int: Size of this declaration/type in bytes
|
Size of this declaration/type in bytes | def byte_size(self):
"""
Size of this declaration/type in bytes
Returns:
int: Size of this declaration/type in bytes
"""
return self._byte_size | [
"def",
"byte_size",
"(",
"self",
")",
":",
"return",
"self",
".",
"_byte_size"
] | [
19,
4
] | [
26,
30
] | python | en | ['en', 'error', 'th'] | False |
byte_info.byte_size | (self, new_byte_size) |
Set size of this declaration/type in bytes
Args:
new_byte_size (int): Size of this declaration/type in bytes
|
Set size of this declaration/type in bytes | def byte_size(self, new_byte_size):
"""
Set size of this declaration/type in bytes
Args:
new_byte_size (int): Size of this declaration/type in bytes
"""
self._byte_size = new_byte_size | [
"def",
"byte_size",
"(",
"self",
",",
"new_byte_size",
")",
":",
"self",
".",
"_byte_size",
"=",
"new_byte_size"
] | [
29,
4
] | [
36,
39
] | python | en | ['en', 'error', 'th'] | False |
byte_info.byte_align | (self) |
Alignment of this declaration/type in bytes
Returns:
int: Alignment of this declaration/type in bytes
|
Alignment of this declaration/type in bytes | def byte_align(self):
"""
Alignment of this declaration/type in bytes
Returns:
int: Alignment of this declaration/type in bytes
"""
return self._byte_align | [
"def",
"byte_align",
"(",
"self",
")",
":",
"return",
"self",
".",
"_byte_align"
] | [
39,
4
] | [
46,
31
] | python | en | ['en', 'error', 'th'] | False |
byte_info.byte_align | (self, new_byte_align) |
Set size of alignment of this declaration/type in bytes
Args:
new_byte_align (int): Alignment of this declaration/type in bytes
|
Set size of alignment of this declaration/type in bytes | def byte_align(self, new_byte_align):
"""
Set size of alignment of this declaration/type in bytes
Args:
new_byte_align (int): Alignment of this declaration/type in bytes
"""
self._byte_align = new_byte_align | [
"def",
"byte_align",
"(",
"self",
",",
"new_byte_align",
")",
":",
"self",
".",
"_byte_align",
"=",
"new_byte_align"
] | [
49,
4
] | [
56,
41
] | python | en | ['en', 'error', 'th'] | False |
BatchKwargsGenerator.get_available_data_asset_names | (self) | Return the list of asset names known by this batch kwargs generator.
Returns:
A list of available names
| Return the list of asset names known by this batch kwargs generator. | def get_available_data_asset_names(self):
"""Return the list of asset names known by this batch kwargs generator.
Returns:
A list of available names
"""
raise NotImplementedError | [
"def",
"get_available_data_asset_names",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | [
181,
4
] | [
187,
33
] | python | en | ['en', 'en', 'en'] | True |
BatchKwargsGenerator.get_available_partition_ids | (self, generator_asset=None, data_asset_name=None) |
Applies the current _partitioner to the batches available on data_asset_name and returns a list of valid
partition_id strings that can be used to identify batches of data.
Args:
data_asset_name: the data asset whose partitions should be returned.
Returns:
A lis... |
Applies the current _partitioner to the batches available on data_asset_name and returns a list of valid
partition_id strings that can be used to identify batches of data. | def get_available_partition_ids(self, generator_asset=None, data_asset_name=None):
"""
Applies the current _partitioner to the batches available on data_asset_name and returns a list of valid
partition_id strings that can be used to identify batches of data.
Args:
data_asset... | [
"def",
"get_available_partition_ids",
"(",
"self",
",",
"generator_asset",
"=",
"None",
",",
"data_asset_name",
"=",
"None",
")",
":",
"raise",
"NotImplementedError"
] | [
190,
4
] | [
201,
33
] | python | en | ['en', 'error', 'th'] | False |
BatchKwargsGenerator.build_batch_kwargs | (self, data_asset_name=None, partition_id=None, **kwargs) | The key workhorse. Docs forthcoming. | The key workhorse. Docs forthcoming. | def build_batch_kwargs(self, data_asset_name=None, partition_id=None, **kwargs):
if (not kwargs.get("name") and not data_asset_name) or (
kwargs.get("name") and data_asset_name
):
raise ValueError("Please provide either name or data_asset_name.")
if kwargs.get("name"):
... | [
"def",
"build_batch_kwargs",
"(",
"self",
",",
"data_asset_name",
"=",
"None",
",",
"partition_id",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"(",
"not",
"kwargs",
".",
"get",
"(",
"\"name\"",
")",
"and",
"not",
"data_asset_name",
")",
"or",
... | [
251,
4
] | [
287,
27
] | python | en | ['en', 'en', 'en'] | True |
MemcachedDiscovery._resync | (self) |
Check if the list of available nodes has changed. If any change is
detected, a new HashClient pointing to all currently available
nodes is returned, otherwise the current client is returned.
|
Check if the list of available nodes has changed. If any change is
detected, a new HashClient pointing to all currently available
nodes is returned, otherwise the current client is returned.
| def _resync(self):
"""
Check if the list of available nodes has changed. If any change is
detected, a new HashClient pointing to all currently available
nodes is returned, otherwise the current client is returned.
"""
# Collect the all Memcached pods' IP addresses
... | [
"def",
"_resync",
"(",
"self",
")",
":",
"# Collect the all Memcached pods' IP addresses",
"try",
":",
"_",
",",
"_",
",",
"ips",
"=",
"socket",
".",
"gethostbyname_ex",
"(",
"self",
".",
"host",
")",
"except",
"socket",
".",
"gaierror",
":",
"# The host could... | [
35,
4
] | [
56,
35
] | python | en | ['en', 'error', 'th'] | False |
Trading.make_trades | (self, companies) | Executes trades for the specified companies based on sentiment. | Executes trades for the specified companies based on sentiment. | def make_trades(self, companies):
"""Executes trades for the specified companies based on sentiment."""
# Determine whether the markets are open.
market_status = self.get_market_status()
if not market_status:
self.logs.error('Not trading without market status.')
... | [
"def",
"make_trades",
"(",
"self",
",",
"companies",
")",
":",
"# Determine whether the markets are open.",
"market_status",
"=",
"self",
".",
"get_market_status",
"(",
")",
"if",
"not",
"market_status",
":",
"self",
".",
"logs",
".",
"error",
"(",
"'Not trading w... | [
67,
4
] | [
118,
22
] | python | en | ['en', 'en', 'en'] | True |
Trading.get_strategy | (self, company, market_status) | Determines the strategy for trading a company based on sentiment and
market status.
| Determines the strategy for trading a company based on sentiment and
market status.
| def get_strategy(self, company, market_status):
"""Determines the strategy for trading a company based on sentiment and
market status.
"""
ticker = company['ticker']
sentiment = company['sentiment']
strategy = {}
strategy['name'] = company['name']
if 'ro... | [
"def",
"get_strategy",
"(",
"self",
",",
"company",
",",
"market_status",
")",
":",
"ticker",
"=",
"company",
"[",
"'ticker'",
"]",
"sentiment",
"=",
"company",
"[",
"'sentiment'",
"]",
"strategy",
"=",
"{",
"}",
"strategy",
"[",
"'name'",
"]",
"=",
"com... | [
120,
4
] | [
163,
27
] | python | en | ['en', 'en', 'en'] | True |
Trading.get_budget | (self, balance, num_strategies) | Calculates the budget per company based on the available balance. | Calculates the budget per company based on the available balance. | def get_budget(self, balance, num_strategies):
"""Calculates the budget per company based on the available balance."""
if num_strategies <= 0:
self.logs.warn('No budget without strategies.')
return 0.0
return round(max(0.0, balance - CASH_HOLD) / num_strategies, 2) | [
"def",
"get_budget",
"(",
"self",
",",
"balance",
",",
"num_strategies",
")",
":",
"if",
"num_strategies",
"<=",
"0",
":",
"self",
".",
"logs",
".",
"warn",
"(",
"'No budget without strategies.'",
")",
"return",
"0.0",
"return",
"round",
"(",
"max",
"(",
"... | [
165,
4
] | [
171,
71
] | python | en | ['en', 'en', 'en'] | True |
Trading.get_market_status | (self) | Finds out whether the markets are open right now. | Finds out whether the markets are open right now. | def get_market_status(self):
"""Finds out whether the markets are open right now."""
clock_url = TRADEKING_API_URL % 'market/clock'
response = self.make_request(url=clock_url)
if not response:
self.logs.error('No clock response.')
return None
try:
... | [
"def",
"get_market_status",
"(",
"self",
")",
":",
"clock_url",
"=",
"TRADEKING_API_URL",
"%",
"'market/clock'",
"response",
"=",
"self",
".",
"make_request",
"(",
"url",
"=",
"clock_url",
")",
"if",
"not",
"response",
":",
"self",
".",
"logs",
".",
"error",... | [
173,
4
] | [
195,
22
] | python | en | ['en', 'en', 'en'] | True |
Trading.get_historical_prices | (self, ticker, timestamp) | Finds the last price at or before a timestamp and at EOD. | Finds the last price at or before a timestamp and at EOD. | def get_historical_prices(self, ticker, timestamp):
"""Finds the last price at or before a timestamp and at EOD."""
# Start with today's quotes.
quotes = self.get_day_quotes(ticker, timestamp)
if not quotes:
self.logs.warn('No quotes for day: %s' % timestamp)
ret... | [
"def",
"get_historical_prices",
"(",
"self",
",",
"ticker",
",",
"timestamp",
")",
":",
"# Start with today's quotes.",
"quotes",
"=",
"self",
".",
"get_day_quotes",
"(",
"ticker",
",",
"timestamp",
")",
"if",
"not",
"quotes",
":",
"self",
".",
"logs",
".",
... | [
197,
4
] | [
244,
67
] | python | en | ['en', 'en', 'en'] | True |
Trading.get_day_quotes | (self, ticker, timestamp) | Collects all quotes from the day of the market timestamp. | Collects all quotes from the day of the market timestamp. | def get_day_quotes(self, ticker, timestamp):
"""Collects all quotes from the day of the market timestamp."""
polygon_client = PolygonClient(POLYGON_API_KEY)
quotes = []
# The timestamp is expected in market time.
day_str = timestamp.strftime('%Y-%m-%d')
try:
... | [
"def",
"get_day_quotes",
"(",
"self",
",",
"ticker",
",",
"timestamp",
")",
":",
"polygon_client",
"=",
"PolygonClient",
"(",
"POLYGON_API_KEY",
")",
"quotes",
"=",
"[",
"]",
"# The timestamp is expected in market time.",
"day_str",
"=",
"timestamp",
".",
"strftime"... | [
247,
4
] | [
283,
21
] | python | en | ['en', 'en', 'en'] | True |
Trading.is_trading_day | (self, timestamp) | Tests whether markets are open on a given day. | Tests whether markets are open on a given day. | def is_trading_day(self, timestamp):
"""Tests whether markets are open on a given day."""
# Markets are closed on holidays.
if timestamp in UnitedStates():
self.logs.debug('Identified holiday: %s' % timestamp)
return False
# Markets are closed on weekends.
... | [
"def",
"is_trading_day",
"(",
"self",
",",
"timestamp",
")",
":",
"# Markets are closed on holidays.",
"if",
"timestamp",
"in",
"UnitedStates",
"(",
")",
":",
"self",
".",
"logs",
".",
"debug",
"(",
"'Identified holiday: %s'",
"%",
"timestamp",
")",
"return",
"F... | [
285,
4
] | [
299,
19
] | python | en | ['en', 'en', 'en'] | True |
Trading.get_previous_day | (self, timestamp) | Finds the previous trading day. | Finds the previous trading day. | def get_previous_day(self, timestamp):
"""Finds the previous trading day."""
previous_day = timestamp - timedelta(days=1)
# Walk backwards until we hit a trading day.
while not self.is_trading_day(previous_day):
previous_day -= timedelta(days=1)
self.logs.debug('Pr... | [
"def",
"get_previous_day",
"(",
"self",
",",
"timestamp",
")",
":",
"previous_day",
"=",
"timestamp",
"-",
"timedelta",
"(",
"days",
"=",
"1",
")",
"# Walk backwards until we hit a trading day.",
"while",
"not",
"self",
".",
"is_trading_day",
"(",
"previous_day",
... | [
301,
4
] | [
312,
27
] | python | en | ['en', 'en', 'en'] | True |
Trading.get_next_day | (self, timestamp) | Finds the next trading day. | Finds the next trading day. | def get_next_day(self, timestamp):
"""Finds the next trading day."""
next_day = timestamp + timedelta(days=1)
# Walk forward until we hit a trading day.
while not self.is_trading_day(next_day):
next_day += timedelta(days=1)
self.logs.debug('Next trading day for %s:... | [
"def",
"get_next_day",
"(",
"self",
",",
"timestamp",
")",
":",
"next_day",
"=",
"timestamp",
"+",
"timedelta",
"(",
"days",
"=",
"1",
")",
"# Walk forward until we hit a trading day.",
"while",
"not",
"self",
".",
"is_trading_day",
"(",
"next_day",
")",
":",
... | [
314,
4
] | [
325,
23
] | python | en | ['en', 'en', 'en'] | True |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.