repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apple/turicreate | deps/src/boost_1_68_0/libs/predef/tools/ci/common.py | utils.git_clone | def git_clone(sub_repo, branch, commit = None, cwd = None, no_submodules = False):
'''
This clone mimicks the way Travis-CI clones a project's repo. So far
Travis-CI is the most limiting in the sense of only fetching partial
history of the repo.
'''
if not cwd:
... | python | def git_clone(sub_repo, branch, commit = None, cwd = None, no_submodules = False):
'''
This clone mimicks the way Travis-CI clones a project's repo. So far
Travis-CI is the most limiting in the sense of only fetching partial
history of the repo.
'''
if not cwd:
... | [
"def",
"git_clone",
"(",
"sub_repo",
",",
"branch",
",",
"commit",
"=",
"None",
",",
"cwd",
"=",
"None",
",",
"no_submodules",
"=",
"False",
")",
":",
"if",
"not",
"cwd",
":",
"cwd",
"=",
"cwd",
"=",
"os",
".",
"getcwd",
"(",
")",
"root_dir",
"=",
... | This clone mimicks the way Travis-CI clones a project's repo. So far
Travis-CI is the most limiting in the sense of only fetching partial
history of the repo. | [
"This",
"clone",
"mimicks",
"the",
"way",
"Travis",
"-",
"CI",
"clones",
"a",
"project",
"s",
"repo",
".",
"So",
"far",
"Travis",
"-",
"CI",
"is",
"the",
"most",
"limiting",
"in",
"the",
"sense",
"of",
"only",
"fetching",
"partial",
"history",
"of",
"t... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/predef/tools/ci/common.py#L438-L471 | train | This function clones a project s repo and returns the path to the cloned repo. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/libs/predef/tools/ci/common.py | ci_travis.install_toolset | def install_toolset(self, toolset):
'''
Installs specific toolset on CI system.
'''
info = toolset_info[toolset]
if sys.platform.startswith('linux'):
os.chdir(self.work_dir)
if 'ppa' in info:
for ppa in info['ppa']:
util... | python | def install_toolset(self, toolset):
'''
Installs specific toolset on CI system.
'''
info = toolset_info[toolset]
if sys.platform.startswith('linux'):
os.chdir(self.work_dir)
if 'ppa' in info:
for ppa in info['ppa']:
util... | [
"def",
"install_toolset",
"(",
"self",
",",
"toolset",
")",
":",
"info",
"=",
"toolset_info",
"[",
"toolset",
"]",
"if",
"sys",
".",
"platform",
".",
"startswith",
"(",
"'linux'",
")",
":",
"os",
".",
"chdir",
"(",
"self",
".",
"work_dir",
")",
"if",
... | Installs specific toolset on CI system. | [
"Installs",
"specific",
"toolset",
"on",
"CI",
"system",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/predef/tools/ci/common.py#L683-L709 | train | Installs specific toolset on CI system. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/toolkits/classifier/svm_classifier.py | create | def create(dataset, target, features=None,
penalty=1.0, solver='auto',
feature_rescaling=True,
convergence_threshold = _DEFAULT_SOLVER_OPTIONS['convergence_threshold'],
lbfgs_memory_level = _DEFAULT_SOLVER_OPTIONS['lbfgs_memory_level'],
max_iterations = _DEFAULT_SOLVER_OPTIONS['max_iterations'],
... | python | def create(dataset, target, features=None,
penalty=1.0, solver='auto',
feature_rescaling=True,
convergence_threshold = _DEFAULT_SOLVER_OPTIONS['convergence_threshold'],
lbfgs_memory_level = _DEFAULT_SOLVER_OPTIONS['lbfgs_memory_level'],
max_iterations = _DEFAULT_SOLVER_OPTIONS['max_iterations'],
... | [
"def",
"create",
"(",
"dataset",
",",
"target",
",",
"features",
"=",
"None",
",",
"penalty",
"=",
"1.0",
",",
"solver",
"=",
"'auto'",
",",
"feature_rescaling",
"=",
"True",
",",
"convergence_threshold",
"=",
"_DEFAULT_SOLVER_OPTIONS",
"[",
"'convergence_thresh... | Create a :class:`~turicreate.svm_classifier.SVMClassifier` to predict the class of a binary
target variable based on a model of which side of a hyperplane the example
falls on. In addition to standard numeric and categorical types, features
can also be extracted automatically from list- or dictionary-type S... | [
"Create",
"a",
":",
"class",
":",
"~turicreate",
".",
"svm_classifier",
".",
"SVMClassifier",
"to",
"predict",
"the",
"class",
"of",
"a",
"binary",
"target",
"variable",
"based",
"on",
"a",
"model",
"of",
"which",
"side",
"of",
"a",
"hyperplane",
"the",
"e... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/classifier/svm_classifier.py#L27-L226 | train | Creates a binary version of the SVM classifier. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/toolkits/classifier/svm_classifier.py | SVMClassifier.classify | def classify(self, dataset, missing_value_action='auto'):
"""
Return a classification, for each example in the ``dataset``, using the
trained SVM model. The output SFrame contains predictions
as class labels (0 or 1) associated with the the example.
Parameters
----------... | python | def classify(self, dataset, missing_value_action='auto'):
"""
Return a classification, for each example in the ``dataset``, using the
trained SVM model. The output SFrame contains predictions
as class labels (0 or 1) associated with the the example.
Parameters
----------... | [
"def",
"classify",
"(",
"self",
",",
"dataset",
",",
"missing_value_action",
"=",
"'auto'",
")",
":",
"return",
"super",
"(",
"SVMClassifier",
",",
"self",
")",
".",
"classify",
"(",
"dataset",
",",
"missing_value_action",
"=",
"missing_value_action",
")"
] | Return a classification, for each example in the ``dataset``, using the
trained SVM model. The output SFrame contains predictions
as class labels (0 or 1) associated with the the example.
Parameters
----------
dataset : SFrame
Dataset of new observations. Must includ... | [
"Return",
"a",
"classification",
"for",
"each",
"example",
"in",
"the",
"dataset",
"using",
"the",
"trained",
"SVM",
"model",
".",
"The",
"output",
"SFrame",
"contains",
"predictions",
"as",
"class",
"labels",
"(",
"0",
"or",
"1",
")",
"associated",
"with",
... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/classifier/svm_classifier.py#L521-L566 | train | Return a classification for each example in the dataset using the SVM model. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_keras2_converter.py | _get_layer_converter_fn | def _get_layer_converter_fn(layer, add_custom_layers = False):
"""Get the right converter function for Keras
"""
layer_type = type(layer)
if layer_type in _KERAS_LAYER_REGISTRY:
convert_func = _KERAS_LAYER_REGISTRY[layer_type]
if convert_func is _layers2.convert_activation:
a... | python | def _get_layer_converter_fn(layer, add_custom_layers = False):
"""Get the right converter function for Keras
"""
layer_type = type(layer)
if layer_type in _KERAS_LAYER_REGISTRY:
convert_func = _KERAS_LAYER_REGISTRY[layer_type]
if convert_func is _layers2.convert_activation:
a... | [
"def",
"_get_layer_converter_fn",
"(",
"layer",
",",
"add_custom_layers",
"=",
"False",
")",
":",
"layer_type",
"=",
"type",
"(",
"layer",
")",
"if",
"layer_type",
"in",
"_KERAS_LAYER_REGISTRY",
":",
"convert_func",
"=",
"_KERAS_LAYER_REGISTRY",
"[",
"layer_type",
... | Get the right converter function for Keras | [
"Get",
"the",
"right",
"converter",
"function",
"for",
"Keras"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_keras2_converter.py#L117-L131 | train | Get the right converter function for Keras layer. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_keras2_converter.py | _load_keras_model | def _load_keras_model(model_network_path, model_weight_path, custom_objects=None):
"""Load a keras model from disk
Parameters
----------
model_network_path: str
Path where the model network path is (json file)
model_weight_path: str
Path where the model network weights are (hd5 fil... | python | def _load_keras_model(model_network_path, model_weight_path, custom_objects=None):
"""Load a keras model from disk
Parameters
----------
model_network_path: str
Path where the model network path is (json file)
model_weight_path: str
Path where the model network weights are (hd5 fil... | [
"def",
"_load_keras_model",
"(",
"model_network_path",
",",
"model_weight_path",
",",
"custom_objects",
"=",
"None",
")",
":",
"from",
"keras",
".",
"models",
"import",
"model_from_json",
"import",
"json",
"# Load the model network",
"json_file",
"=",
"open",
"(",
"... | Load a keras model from disk
Parameters
----------
model_network_path: str
Path where the model network path is (json file)
model_weight_path: str
Path where the model network weights are (hd5 file)
custom_objects:
A dictionary of layers or other custom classes
or ... | [
"Load",
"a",
"keras",
"model",
"from",
"disk"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_keras2_converter.py#L134-L168 | train | Loads a keras model from disk and returns it | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/visualization/_plot.py | Plot.show | def show(self):
"""
A method for displaying the Plot object
Notes
-----
- The plot will render either inline in a Jupyter Notebook, or in a
native GUI window, depending on the value provided in
`turicreate.visualization.set_target` (defaults to 'auto').
... | python | def show(self):
"""
A method for displaying the Plot object
Notes
-----
- The plot will render either inline in a Jupyter Notebook, or in a
native GUI window, depending on the value provided in
`turicreate.visualization.set_target` (defaults to 'auto').
... | [
"def",
"show",
"(",
"self",
")",
":",
"global",
"_target",
"display",
"=",
"False",
"try",
":",
"if",
"_target",
"==",
"'auto'",
"and",
"get_ipython",
"(",
")",
".",
"__class__",
".",
"__name__",
"==",
"\"ZMQInteractiveShell\"",
":",
"self",
".",
"_repr_ja... | A method for displaying the Plot object
Notes
-----
- The plot will render either inline in a Jupyter Notebook, or in a
native GUI window, depending on the value provided in
`turicreate.visualization.set_target` (defaults to 'auto').
Examples
--------
... | [
"A",
"method",
"for",
"displaying",
"the",
"Plot",
"object"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/visualization/_plot.py#L104-L142 | train | A method for displaying the Plot object containing the current state of the object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/visualization/_plot.py | Plot.save | def save(self, filepath):
"""
A method for saving the Plot object in a vega representation
Parameters
----------
filepath: string
The destination filepath where the plot object must be saved as.
The extension of this filepath determines what format the pl... | python | def save(self, filepath):
"""
A method for saving the Plot object in a vega representation
Parameters
----------
filepath: string
The destination filepath where the plot object must be saved as.
The extension of this filepath determines what format the pl... | [
"def",
"save",
"(",
"self",
",",
"filepath",
")",
":",
"if",
"type",
"(",
"filepath",
")",
"!=",
"str",
":",
"raise",
"ValueError",
"(",
"\"filepath provided is not a string\"",
")",
"if",
"filepath",
".",
"endswith",
"(",
"\".json\"",
")",
":",
"# save as v... | A method for saving the Plot object in a vega representation
Parameters
----------
filepath: string
The destination filepath where the plot object must be saved as.
The extension of this filepath determines what format the plot will
be saved as. Currently sup... | [
"A",
"method",
"for",
"saving",
"the",
"Plot",
"object",
"in",
"a",
"vega",
"representation"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/visualization/_plot.py#L144-L248 | train | Save the current object in a vega representation. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/external/xgboost/subtree/rabit/tracker/rabit_demo.py | mthread_submit | def mthread_submit(nslave, worker_args, worker_envs):
"""
customized submit script, that submit nslave jobs, each must contain args as parameter
note this can be a lambda function containing additional parameters in input
Parameters
nslave number of slave process to start up
args... | python | def mthread_submit(nslave, worker_args, worker_envs):
"""
customized submit script, that submit nslave jobs, each must contain args as parameter
note this can be a lambda function containing additional parameters in input
Parameters
nslave number of slave process to start up
args... | [
"def",
"mthread_submit",
"(",
"nslave",
",",
"worker_args",
",",
"worker_envs",
")",
":",
"procs",
"=",
"{",
"}",
"for",
"i",
"in",
"range",
"(",
"nslave",
")",
":",
"procs",
"[",
"i",
"]",
"=",
"Thread",
"(",
"target",
"=",
"exec_cmd",
",",
"args",
... | customized submit script, that submit nslave jobs, each must contain args as parameter
note this can be a lambda function containing additional parameters in input
Parameters
nslave number of slave process to start up
args arguments to launch each job
this usually includes th... | [
"customized",
"submit",
"script",
"that",
"submit",
"nslave",
"jobs",
"each",
"must",
"contain",
"args",
"as",
"parameter",
"note",
"this",
"can",
"be",
"a",
"lambda",
"function",
"containing",
"additional",
"parameters",
"in",
"input",
"Parameters",
"nslave",
"... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/xgboost/subtree/rabit/tracker/rabit_demo.py#L78-L93 | train | Customized submit script that submit nslave jobs | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_tree_ensemble.py | _get_value | def _get_value(scikit_value, mode = 'regressor', scaling = 1.0, n_classes = 2, tree_index = 0):
""" Get the right value from the scikit-tree
"""
# Regression
if mode == 'regressor':
return scikit_value[0] * scaling
# Binary classification
if n_classes == 2:
# Decision tree
... | python | def _get_value(scikit_value, mode = 'regressor', scaling = 1.0, n_classes = 2, tree_index = 0):
""" Get the right value from the scikit-tree
"""
# Regression
if mode == 'regressor':
return scikit_value[0] * scaling
# Binary classification
if n_classes == 2:
# Decision tree
... | [
"def",
"_get_value",
"(",
"scikit_value",
",",
"mode",
"=",
"'regressor'",
",",
"scaling",
"=",
"1.0",
",",
"n_classes",
"=",
"2",
",",
"tree_index",
"=",
"0",
")",
":",
"# Regression",
"if",
"mode",
"==",
"'regressor'",
":",
"return",
"scikit_value",
"[",... | Get the right value from the scikit-tree | [
"Get",
"the",
"right",
"value",
"from",
"the",
"scikit",
"-",
"tree"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_tree_ensemble.py#L16-L42 | train | Get the right value from the scikit - tree
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_tree_ensemble.py | _recurse | def _recurse(coreml_tree, scikit_tree, tree_id, node_id, scaling = 1.0, mode = 'regressor',
n_classes = 2, tree_index = 0):
"""Traverse through the tree and append to the tree spec.
"""
if not(HAS_SKLEARN):
raise RuntimeError('scikit-learn not found. scikit-learn conversion API is disab... | python | def _recurse(coreml_tree, scikit_tree, tree_id, node_id, scaling = 1.0, mode = 'regressor',
n_classes = 2, tree_index = 0):
"""Traverse through the tree and append to the tree spec.
"""
if not(HAS_SKLEARN):
raise RuntimeError('scikit-learn not found. scikit-learn conversion API is disab... | [
"def",
"_recurse",
"(",
"coreml_tree",
",",
"scikit_tree",
",",
"tree_id",
",",
"node_id",
",",
"scaling",
"=",
"1.0",
",",
"mode",
"=",
"'regressor'",
",",
"n_classes",
"=",
"2",
",",
"tree_index",
"=",
"0",
")",
":",
"if",
"not",
"(",
"HAS_SKLEARN",
... | Traverse through the tree and append to the tree spec. | [
"Traverse",
"through",
"the",
"tree",
"and",
"append",
"to",
"the",
"tree",
"spec",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_tree_ensemble.py#L44-L77 | train | Recursively add a leaf node to the tree. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_tree_ensemble.py | convert_tree_ensemble | def convert_tree_ensemble(model, input_features,
output_features = ('predicted_class', float),
mode = 'regressor',
base_prediction = None,
class_labels = None,
post_evaluation_transform = No... | python | def convert_tree_ensemble(model, input_features,
output_features = ('predicted_class', float),
mode = 'regressor',
base_prediction = None,
class_labels = None,
post_evaluation_transform = No... | [
"def",
"convert_tree_ensemble",
"(",
"model",
",",
"input_features",
",",
"output_features",
"=",
"(",
"'predicted_class'",
",",
"float",
")",
",",
"mode",
"=",
"'regressor'",
",",
"base_prediction",
"=",
"None",
",",
"class_labels",
"=",
"None",
",",
"post_eval... | Convert a generic tree regressor model to the protobuf spec.
This currently supports:
* Decision tree regression
* Gradient boosted tree regression
* Random forest regression
* Decision tree classifier.
* Gradient boosted tree classifier.
* Random forest classifier.
-------... | [
"Convert",
"a",
"generic",
"tree",
"regressor",
"model",
"to",
"the",
"protobuf",
"spec",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_tree_ensemble.py#L97-L199 | train | Convert a generic tree regressor model to the protobuf spec. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/toolkits/style_transfer/style_transfer.py | _vgg16_data_prep | def _vgg16_data_prep(batch):
"""
Takes images scaled to [0, 1] and returns them appropriately scaled and
mean-subtracted for VGG-16
"""
from mxnet import nd
mean = nd.array([123.68, 116.779, 103.939], ctx=batch.context)
return nd.broadcast_sub(255 * batch, mean.reshape((-1, 1, 1))) | python | def _vgg16_data_prep(batch):
"""
Takes images scaled to [0, 1] and returns them appropriately scaled and
mean-subtracted for VGG-16
"""
from mxnet import nd
mean = nd.array([123.68, 116.779, 103.939], ctx=batch.context)
return nd.broadcast_sub(255 * batch, mean.reshape((-1, 1, 1))) | [
"def",
"_vgg16_data_prep",
"(",
"batch",
")",
":",
"from",
"mxnet",
"import",
"nd",
"mean",
"=",
"nd",
".",
"array",
"(",
"[",
"123.68",
",",
"116.779",
",",
"103.939",
"]",
",",
"ctx",
"=",
"batch",
".",
"context",
")",
"return",
"nd",
".",
"broadca... | Takes images scaled to [0, 1] and returns them appropriately scaled and
mean-subtracted for VGG-16 | [
"Takes",
"images",
"scaled",
"to",
"[",
"0",
"1",
"]",
"and",
"returns",
"them",
"appropriately",
"scaled",
"and",
"mean",
"-",
"subtracted",
"for",
"VGG",
"-",
"16"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/style_transfer/style_transfer.py#L26-L33 | train | Prepare data for VGG - 16 | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/toolkits/style_transfer/style_transfer.py | create | def create(style_dataset, content_dataset, style_feature=None,
content_feature=None, max_iterations=None, model='resnet-16',
verbose=True, batch_size = 6, **kwargs):
"""
Create a :class:`StyleTransfer` model.
Parameters
----------
style_dataset: SFrame
Input style images. Th... | python | def create(style_dataset, content_dataset, style_feature=None,
content_feature=None, max_iterations=None, model='resnet-16',
verbose=True, batch_size = 6, **kwargs):
"""
Create a :class:`StyleTransfer` model.
Parameters
----------
style_dataset: SFrame
Input style images. Th... | [
"def",
"create",
"(",
"style_dataset",
",",
"content_dataset",
",",
"style_feature",
"=",
"None",
",",
"content_feature",
"=",
"None",
",",
"max_iterations",
"=",
"None",
",",
"model",
"=",
"'resnet-16'",
",",
"verbose",
"=",
"True",
",",
"batch_size",
"=",
... | Create a :class:`StyleTransfer` model.
Parameters
----------
style_dataset: SFrame
Input style images. The columns named by the ``style_feature`` parameters will
be extracted for training the model.
content_dataset : SFrame
Input content images. The columns named by the ``conte... | [
"Create",
"a",
":",
"class",
":",
"StyleTransfer",
"model",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/style_transfer/style_transfer.py#L35-L402 | train | Create a new style transfer model. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/toolkits/style_transfer/style_transfer.py | StyleTransfer._canonize_content_input | def _canonize_content_input(self, dataset, single_style):
"""
Takes input and returns tuple of the input in canonical form (SFrame)
along with an unpack callback function that can be applied to
prediction results to "undo" the canonization.
"""
unpack = lambda x: x
... | python | def _canonize_content_input(self, dataset, single_style):
"""
Takes input and returns tuple of the input in canonical form (SFrame)
along with an unpack callback function that can be applied to
prediction results to "undo" the canonization.
"""
unpack = lambda x: x
... | [
"def",
"_canonize_content_input",
"(",
"self",
",",
"dataset",
",",
"single_style",
")",
":",
"unpack",
"=",
"lambda",
"x",
":",
"x",
"if",
"isinstance",
"(",
"dataset",
",",
"_tc",
".",
"SArray",
")",
":",
"dataset",
"=",
"_tc",
".",
"SFrame",
"(",
"{... | Takes input and returns tuple of the input in canonical form (SFrame)
along with an unpack callback function that can be applied to
prediction results to "undo" the canonization. | [
"Takes",
"input",
"and",
"returns",
"tuple",
"of",
"the",
"input",
"in",
"canonical",
"form",
"(",
"SFrame",
")",
"along",
"with",
"an",
"unpack",
"callback",
"function",
"that",
"can",
"be",
"applied",
"to",
"prediction",
"results",
"to",
"undo",
"the",
"... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/style_transfer/style_transfer.py#L542-L557 | train | Takes input and returns tuple of the input in canonical form ( SFrame unpack callback function that can be applied to canonization results to undo the canonization. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/toolkits/style_transfer/style_transfer.py | StyleTransfer.stylize | def stylize(self, images, style=None, verbose=True, max_size=800, batch_size = 4):
"""
Stylize an SFrame of Images given a style index or a list of
styles.
Parameters
----------
images : SFrame | Image
A dataset that has the same content image column that was... | python | def stylize(self, images, style=None, verbose=True, max_size=800, batch_size = 4):
"""
Stylize an SFrame of Images given a style index or a list of
styles.
Parameters
----------
images : SFrame | Image
A dataset that has the same content image column that was... | [
"def",
"stylize",
"(",
"self",
",",
"images",
",",
"style",
"=",
"None",
",",
"verbose",
"=",
"True",
",",
"max_size",
"=",
"800",
",",
"batch_size",
"=",
"4",
")",
":",
"if",
"(",
"batch_size",
"<",
"1",
")",
":",
"raise",
"_ToolkitError",
"(",
"\... | Stylize an SFrame of Images given a style index or a list of
styles.
Parameters
----------
images : SFrame | Image
A dataset that has the same content image column that was used
during training.
style : int or list, optional
The selected styl... | [
"Stylize",
"an",
"SFrame",
"of",
"Images",
"given",
"a",
"style",
"index",
"or",
"a",
"list",
"of",
"styles",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/style_transfer/style_transfer.py#L559-L754 | train | This function stlizes an SFrame of Images given a list of style indexes or list of styles. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/toolkits/style_transfer/style_transfer.py | StyleTransfer.export_coreml | def export_coreml(self, path, image_shape=(256, 256),
include_flexible_shape=True):
"""
Save the model in Core ML format. The Core ML model takes an image of
fixed size, and a style index inputs and produces an output
of an image of fixed size
Parameters
-------... | python | def export_coreml(self, path, image_shape=(256, 256),
include_flexible_shape=True):
"""
Save the model in Core ML format. The Core ML model takes an image of
fixed size, and a style index inputs and produces an output
of an image of fixed size
Parameters
-------... | [
"def",
"export_coreml",
"(",
"self",
",",
"path",
",",
"image_shape",
"=",
"(",
"256",
",",
"256",
")",
",",
"include_flexible_shape",
"=",
"True",
")",
":",
"import",
"mxnet",
"as",
"_mx",
"from",
".",
".",
"_mxnet",
".",
"_mxnet_to_coreml",
"import",
"... | Save the model in Core ML format. The Core ML model takes an image of
fixed size, and a style index inputs and produces an output
of an image of fixed size
Parameters
----------
path : string
A string to the path for saving the Core ML model.
image_shape: tu... | [
"Save",
"the",
"model",
"in",
"Core",
"ML",
"format",
".",
"The",
"Core",
"ML",
"model",
"takes",
"an",
"image",
"of",
"fixed",
"size",
"and",
"a",
"style",
"index",
"inputs",
"and",
"produces",
"an",
"output",
"of",
"an",
"image",
"of",
"fixed",
"size... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/style_transfer/style_transfer.py#L770-L874 | train | Exports the Core ML model of the style transfer. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/toolkits/style_transfer/style_transfer.py | StyleTransfer.get_styles | def get_styles(self, style=None):
"""
Returns SFrame of style images used for training the model
Parameters
----------
style: int or list, optional
The selected style or list of styles to return. If `None`, all
styles will be returned
See Also
... | python | def get_styles(self, style=None):
"""
Returns SFrame of style images used for training the model
Parameters
----------
style: int or list, optional
The selected style or list of styles to return. If `None`, all
styles will be returned
See Also
... | [
"def",
"get_styles",
"(",
"self",
",",
"style",
"=",
"None",
")",
":",
"style",
",",
"_",
"=",
"self",
".",
"_style_input_check",
"(",
"style",
")",
"return",
"self",
".",
"styles",
".",
"filter_by",
"(",
"style",
",",
"self",
".",
"_index_column",
")"... | Returns SFrame of style images used for training the model
Parameters
----------
style: int or list, optional
The selected style or list of styles to return. If `None`, all
styles will be returned
See Also
--------
stylize
Examples
... | [
"Returns",
"SFrame",
"of",
"style",
"images",
"used",
"for",
"training",
"the",
"model"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/style_transfer/style_transfer.py#L876-L911 | train | Returns the SFrame of style images used for training the model. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/toolkits/_mxnet/_mxnet_to_coreml/_mxnet_converter.py | convert | def convert(model, input_shape, class_labels=None, mode=None,
preprocessor_args=None, builder=None, verbose=True):
"""Convert an MXNet model to the protobuf spec.
Parameters
----------
model: MXNet model
A trained MXNet neural network model.
input_shape: list of tuples
... | python | def convert(model, input_shape, class_labels=None, mode=None,
preprocessor_args=None, builder=None, verbose=True):
"""Convert an MXNet model to the protobuf spec.
Parameters
----------
model: MXNet model
A trained MXNet neural network model.
input_shape: list of tuples
... | [
"def",
"convert",
"(",
"model",
",",
"input_shape",
",",
"class_labels",
"=",
"None",
",",
"mode",
"=",
"None",
",",
"preprocessor_args",
"=",
"None",
",",
"builder",
"=",
"None",
",",
"verbose",
"=",
"True",
")",
":",
"if",
"not",
"isinstance",
"(",
"... | Convert an MXNet model to the protobuf spec.
Parameters
----------
model: MXNet model
A trained MXNet neural network model.
input_shape: list of tuples
A list of (name, shape) tuples, defining the input names and their
shapes. The list also serves to define the desired order of... | [
"Convert",
"an",
"MXNet",
"model",
"to",
"the",
"protobuf",
"spec",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_mxnet/_mxnet_to_coreml/_mxnet_converter.py#L127-L272 | train | Convert an MXNet model to the protobuf spec. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/external/coremltools_wrap/coremltools/coremltools/converters/libsvm/_libsvm_util.py | load_model | def load_model(model_path):
"""Load a libsvm model from a path on disk.
This currently supports:
* C-SVC
* NU-SVC
* Epsilon-SVR
* NU-SVR
Parameters
----------
model_path: str
Path on disk where the libsvm model representation is.
Returns
-------
model: ... | python | def load_model(model_path):
"""Load a libsvm model from a path on disk.
This currently supports:
* C-SVC
* NU-SVC
* Epsilon-SVR
* NU-SVR
Parameters
----------
model_path: str
Path on disk where the libsvm model representation is.
Returns
-------
model: ... | [
"def",
"load_model",
"(",
"model_path",
")",
":",
"if",
"not",
"(",
"HAS_LIBSVM",
")",
":",
"raise",
"RuntimeError",
"(",
"'libsvm not found. libsvm conversion API is disabled.'",
")",
"from",
"svmutil",
"import",
"svm_load_model",
"# From libsvm",
"import",
"os",
"if... | Load a libsvm model from a path on disk.
This currently supports:
* C-SVC
* NU-SVC
* Epsilon-SVR
* NU-SVR
Parameters
----------
model_path: str
Path on disk where the libsvm model representation is.
Returns
-------
model: libsvm_model
A model of the... | [
"Load",
"a",
"libsvm",
"model",
"from",
"a",
"path",
"on",
"disk",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/libsvm/_libsvm_util.py#L8-L34 | train | Loads a libsvm model from a path on disk. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/flexible_shape_utils.py | add_enumerated_multiarray_shapes | def add_enumerated_multiarray_shapes(spec, feature_name, shapes):
"""
Annotate an input or output multiArray feature in a Neural Network spec to
to accommodate a list of enumerated array shapes
:param spec: MLModel
The MLModel spec containing the feature
:param feature_name: str
Th... | python | def add_enumerated_multiarray_shapes(spec, feature_name, shapes):
"""
Annotate an input or output multiArray feature in a Neural Network spec to
to accommodate a list of enumerated array shapes
:param spec: MLModel
The MLModel spec containing the feature
:param feature_name: str
Th... | [
"def",
"add_enumerated_multiarray_shapes",
"(",
"spec",
",",
"feature_name",
",",
"shapes",
")",
":",
"if",
"not",
"isinstance",
"(",
"shapes",
",",
"list",
")",
":",
"shapes",
"=",
"[",
"shapes",
"]",
"for",
"shape",
"in",
"shapes",
":",
"if",
"not",
"i... | Annotate an input or output multiArray feature in a Neural Network spec to
to accommodate a list of enumerated array shapes
:param spec: MLModel
The MLModel spec containing the feature
:param feature_name: str
The name of the image feature for which to add shape information.
If the... | [
"Annotate",
"an",
"input",
"or",
"output",
"multiArray",
"feature",
"in",
"a",
"Neural",
"Network",
"spec",
"to",
"to",
"accommodate",
"a",
"list",
"of",
"enumerated",
"array",
"shapes"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/flexible_shape_utils.py#L291-L370 | train | Annotate an input or output multiArray feature in a Neural Network spec to accommodate a list of enumerated array shapes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/flexible_shape_utils.py | add_enumerated_image_sizes | def add_enumerated_image_sizes(spec, feature_name, sizes):
"""
Annotate an input or output image feature in a Neural Network spec to
to accommodate a list of enumerated image sizes
:param spec: MLModel
The MLModel spec containing the feature
:param feature_name: str
The name of the... | python | def add_enumerated_image_sizes(spec, feature_name, sizes):
"""
Annotate an input or output image feature in a Neural Network spec to
to accommodate a list of enumerated image sizes
:param spec: MLModel
The MLModel spec containing the feature
:param feature_name: str
The name of the... | [
"def",
"add_enumerated_image_sizes",
"(",
"spec",
",",
"feature_name",
",",
"sizes",
")",
":",
"if",
"not",
"isinstance",
"(",
"sizes",
",",
"list",
")",
":",
"sizes",
"=",
"[",
"sizes",
"]",
"for",
"size",
"in",
"sizes",
":",
"if",
"not",
"isinstance",
... | Annotate an input or output image feature in a Neural Network spec to
to accommodate a list of enumerated image sizes
:param spec: MLModel
The MLModel spec containing the feature
:param feature_name: str
The name of the image feature for which to add size information.
If the featur... | [
"Annotate",
"an",
"input",
"or",
"output",
"image",
"feature",
"in",
"a",
"Neural",
"Network",
"spec",
"to",
"to",
"accommodate",
"a",
"list",
"of",
"enumerated",
"image",
"sizes"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/flexible_shape_utils.py#L373-L437 | train | Annotate an input or output image feature in a Neural Network spec to accommodate a list of enumerated image sizes | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/flexible_shape_utils.py | update_image_size_range | def update_image_size_range(spec, feature_name, size_range):
"""
Annotate an input or output Image feature in a Neural Network spec to
to accommodate a range of image sizes
:param spec: MLModel
The MLModel spec containing the feature
:param feature_name: str
The name of the Image f... | python | def update_image_size_range(spec, feature_name, size_range):
"""
Annotate an input or output Image feature in a Neural Network spec to
to accommodate a range of image sizes
:param spec: MLModel
The MLModel spec containing the feature
:param feature_name: str
The name of the Image f... | [
"def",
"update_image_size_range",
"(",
"spec",
",",
"feature_name",
",",
"size_range",
")",
":",
"if",
"not",
"isinstance",
"(",
"size_range",
",",
"NeuralNetworkImageSizeRange",
")",
":",
"raise",
"Exception",
"(",
"'Shape ranges should be of type NeuralNetworkImageSizeR... | Annotate an input or output Image feature in a Neural Network spec to
to accommodate a range of image sizes
:param spec: MLModel
The MLModel spec containing the feature
:param feature_name: str
The name of the Image feature for which to add shape information.
If the feature is not ... | [
"Annotate",
"an",
"input",
"or",
"output",
"Image",
"feature",
"in",
"a",
"Neural",
"Network",
"spec",
"to",
"to",
"accommodate",
"a",
"range",
"of",
"image",
"sizes"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/flexible_shape_utils.py#L440-L490 | train | Annotate an input or output Image feature in a Neural Network spec to accommodate a range of image sizes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/flexible_shape_utils.py | update_multiarray_shape_range | def update_multiarray_shape_range(spec, feature_name, shape_range):
"""
Annotate an input or output MLMultiArray feature in a Neural Network spec
to accommodate a range of shapes
:param spec: MLModel
The MLModel spec containing the feature
:param feature_name: str
The name of the f... | python | def update_multiarray_shape_range(spec, feature_name, shape_range):
"""
Annotate an input or output MLMultiArray feature in a Neural Network spec
to accommodate a range of shapes
:param spec: MLModel
The MLModel spec containing the feature
:param feature_name: str
The name of the f... | [
"def",
"update_multiarray_shape_range",
"(",
"spec",
",",
"feature_name",
",",
"shape_range",
")",
":",
"if",
"not",
"isinstance",
"(",
"shape_range",
",",
"NeuralNetworkMultiArrayShapeRange",
")",
":",
"raise",
"Exception",
"(",
"'Shape range should be of type MultiArray... | Annotate an input or output MLMultiArray feature in a Neural Network spec
to accommodate a range of shapes
:param spec: MLModel
The MLModel spec containing the feature
:param feature_name: str
The name of the feature for which to add shape range
information. If the feature is not f... | [
"Annotate",
"an",
"input",
"or",
"output",
"MLMultiArray",
"feature",
"in",
"a",
"Neural",
"Network",
"spec",
"to",
"accommodate",
"a",
"range",
"of",
"shapes"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/flexible_shape_utils.py#L493-L556 | train | Annotate an input or output MLMultiArray feature in a Neural Network spec containing a range of shapes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/flexible_shape_utils.py | get_allowed_shape_ranges | def get_allowed_shape_ranges(spec):
"""
For a given model specification, returns a dictionary with a shape range object for each input feature name.
"""
shaper = NeuralNetworkShaper(spec, False)
inputs = _get_input_names(spec)
output = {}
for input in inputs:
output[input] = shaper... | python | def get_allowed_shape_ranges(spec):
"""
For a given model specification, returns a dictionary with a shape range object for each input feature name.
"""
shaper = NeuralNetworkShaper(spec, False)
inputs = _get_input_names(spec)
output = {}
for input in inputs:
output[input] = shaper... | [
"def",
"get_allowed_shape_ranges",
"(",
"spec",
")",
":",
"shaper",
"=",
"NeuralNetworkShaper",
"(",
"spec",
",",
"False",
")",
"inputs",
"=",
"_get_input_names",
"(",
"spec",
")",
"output",
"=",
"{",
"}",
"for",
"input",
"in",
"inputs",
":",
"output",
"["... | For a given model specification, returns a dictionary with a shape range object for each input feature name. | [
"For",
"a",
"given",
"model",
"specification",
"returns",
"a",
"dictionary",
"with",
"a",
"shape",
"range",
"object",
"for",
"each",
"input",
"feature",
"name",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/flexible_shape_utils.py#L559-L571 | train | Returns a dictionary with a shape range object for each input feature name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/flexible_shape_utils.py | can_allow_multiple_input_shapes | def can_allow_multiple_input_shapes(spec):
"""
Examines a model specification and determines if it can compute results for more than one output shape.
:param spec: MLModel
The protobuf specification of the model.
:return: Bool
Returns True if the model can allow multiple input shapes, ... | python | def can_allow_multiple_input_shapes(spec):
"""
Examines a model specification and determines if it can compute results for more than one output shape.
:param spec: MLModel
The protobuf specification of the model.
:return: Bool
Returns True if the model can allow multiple input shapes, ... | [
"def",
"can_allow_multiple_input_shapes",
"(",
"spec",
")",
":",
"# First, check that the model actually has a neural network in it",
"try",
":",
"layers",
"=",
"_get_nn_layers",
"(",
"spec",
")",
"except",
":",
"raise",
"Exception",
"(",
"'Unable to verify that this model co... | Examines a model specification and determines if it can compute results for more than one output shape.
:param spec: MLModel
The protobuf specification of the model.
:return: Bool
Returns True if the model can allow multiple input shapes, False otherwise. | [
"Examines",
"a",
"model",
"specification",
"and",
"determines",
"if",
"it",
"can",
"compute",
"results",
"for",
"more",
"than",
"one",
"output",
"shape",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/flexible_shape_utils.py#L575-L607 | train | Returns True if the model can compute multiple input shapes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/flexible_shape_utils.py | NeuralNetworkMultiArrayShapeRange.isFlexible | def isFlexible(self):
"""
Returns true if any one of the channel, height, or width ranges of this shape allow more than one input value.
"""
for key, value in self.arrayShapeRange.items():
if key in _CONSTRAINED_KEYS:
if value.isFlexible:
r... | python | def isFlexible(self):
"""
Returns true if any one of the channel, height, or width ranges of this shape allow more than one input value.
"""
for key, value in self.arrayShapeRange.items():
if key in _CONSTRAINED_KEYS:
if value.isFlexible:
r... | [
"def",
"isFlexible",
"(",
"self",
")",
":",
"for",
"key",
",",
"value",
"in",
"self",
".",
"arrayShapeRange",
".",
"items",
"(",
")",
":",
"if",
"key",
"in",
"_CONSTRAINED_KEYS",
":",
"if",
"value",
".",
"isFlexible",
":",
"return",
"True",
"return",
"... | Returns true if any one of the channel, height, or width ranges of this shape allow more than one input value. | [
"Returns",
"true",
"if",
"any",
"one",
"of",
"the",
"channel",
"height",
"or",
"width",
"ranges",
"of",
"this",
"shape",
"allow",
"more",
"than",
"one",
"input",
"value",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/flexible_shape_utils.py#L220-L229 | train | Returns true if any of the channel height or width ranges of this shape allow more than one input value. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py | define_macro | def define_macro(out_f, (name, args, body), undefine=False, check=True):
"""Generate a macro definition or undefinition"""
if undefine:
out_f.write(
'#undef {0}\n'
.format(macro_name(name))
)
else:
if args:
arg_list = '({0})'.format(', '.join(args)... | python | def define_macro(out_f, (name, args, body), undefine=False, check=True):
"""Generate a macro definition or undefinition"""
if undefine:
out_f.write(
'#undef {0}\n'
.format(macro_name(name))
)
else:
if args:
arg_list = '({0})'.format(', '.join(args)... | [
"def",
"define_macro",
"(",
"out_f",
",",
"(",
"name",
",",
"args",
",",
"body",
")",
",",
"undefine",
"=",
"False",
",",
"check",
"=",
"True",
")",
":",
"if",
"undefine",
":",
"out_f",
".",
"write",
"(",
"'#undef {0}\\n'",
".",
"format",
"(",
"macro... | Generate a macro definition or undefinition | [
"Generate",
"a",
"macro",
"definition",
"or",
"undefinition"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py#L92-L115 | train | Generate a macro definition or undefinition | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py | filename | def filename(out_dir, name, undefine=False):
"""Generate the filename"""
if undefine:
prefix = 'undef_'
else:
prefix = ''
return os.path.join(out_dir, '{0}{1}.hpp'.format(prefix, name.lower())) | python | def filename(out_dir, name, undefine=False):
"""Generate the filename"""
if undefine:
prefix = 'undef_'
else:
prefix = ''
return os.path.join(out_dir, '{0}{1}.hpp'.format(prefix, name.lower())) | [
"def",
"filename",
"(",
"out_dir",
",",
"name",
",",
"undefine",
"=",
"False",
")",
":",
"if",
"undefine",
":",
"prefix",
"=",
"'undef_'",
"else",
":",
"prefix",
"=",
"''",
"return",
"os",
".",
"path",
".",
"join",
"(",
"out_dir",
",",
"'{0}{1}.hpp'",
... | Generate the filename | [
"Generate",
"the",
"filename"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py#L118-L124 | train | Generate the filename | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py | length_limits | def length_limits(max_length_limit, length_limit_step):
"""Generates the length limits"""
string_len = len(str(max_length_limit))
return [
str(i).zfill(string_len) for i in
xrange(
length_limit_step,
max_length_limit + length_limit_step - 1,
length_limit_s... | python | def length_limits(max_length_limit, length_limit_step):
"""Generates the length limits"""
string_len = len(str(max_length_limit))
return [
str(i).zfill(string_len) for i in
xrange(
length_limit_step,
max_length_limit + length_limit_step - 1,
length_limit_s... | [
"def",
"length_limits",
"(",
"max_length_limit",
",",
"length_limit_step",
")",
":",
"string_len",
"=",
"len",
"(",
"str",
"(",
"max_length_limit",
")",
")",
"return",
"[",
"str",
"(",
"i",
")",
".",
"zfill",
"(",
"string_len",
")",
"for",
"i",
"in",
"xr... | Generates the length limits | [
"Generates",
"the",
"length",
"limits"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py#L127-L137 | train | Generates the length limits for the current language. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py | generate_take | def generate_take(out_f, steps, line_prefix):
"""Generate the take function"""
out_f.write(
'{0}constexpr inline int take(int n_)\n'
'{0}{{\n'
'{0} return {1} 0 {2};\n'
'{0}}}\n'
'\n'.format(
line_prefix,
''.join('n_ >= {0} ? {0} : ('.format(s) fo... | python | def generate_take(out_f, steps, line_prefix):
"""Generate the take function"""
out_f.write(
'{0}constexpr inline int take(int n_)\n'
'{0}{{\n'
'{0} return {1} 0 {2};\n'
'{0}}}\n'
'\n'.format(
line_prefix,
''.join('n_ >= {0} ? {0} : ('.format(s) fo... | [
"def",
"generate_take",
"(",
"out_f",
",",
"steps",
",",
"line_prefix",
")",
":",
"out_f",
".",
"write",
"(",
"'{0}constexpr inline int take(int n_)\\n'",
"'{0}{{\\n'",
"'{0} return {1} 0 {2};\\n'",
"'{0}}}\\n'",
"'\\n'",
".",
"format",
"(",
"line_prefix",
",",
"''",... | Generate the take function | [
"Generate",
"the",
"take",
"function"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py#L145-L157 | train | Generate the take function | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py | generate_make_string | def generate_make_string(out_f, max_step):
"""Generate the make_string template"""
steps = [2 ** n for n in xrange(int(math.log(max_step, 2)), -1, -1)]
with Namespace(
out_f,
['boost', 'metaparse', 'v{0}'.format(VERSION), 'impl']
) as nsp:
generate_take(out_f, steps, nsp.prefix(... | python | def generate_make_string(out_f, max_step):
"""Generate the make_string template"""
steps = [2 ** n for n in xrange(int(math.log(max_step, 2)), -1, -1)]
with Namespace(
out_f,
['boost', 'metaparse', 'v{0}'.format(VERSION), 'impl']
) as nsp:
generate_take(out_f, steps, nsp.prefix(... | [
"def",
"generate_make_string",
"(",
"out_f",
",",
"max_step",
")",
":",
"steps",
"=",
"[",
"2",
"**",
"n",
"for",
"n",
"in",
"xrange",
"(",
"int",
"(",
"math",
".",
"log",
"(",
"max_step",
",",
"2",
")",
")",
",",
"-",
"1",
",",
"-",
"1",
")",
... | Generate the make_string template | [
"Generate",
"the",
"make_string",
"template"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py#L160-L199 | train | Generate the make_string template | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py | generate_string | def generate_string(out_dir, limits):
"""Generate string.hpp"""
max_limit = max((int(v) for v in limits))
with open(filename(out_dir, 'string'), 'wb') as out_f:
with IncludeGuard(out_f):
out_f.write(
'\n'
'#include <boost/metaparse/v{0}/cpp11/impl/concat.... | python | def generate_string(out_dir, limits):
"""Generate string.hpp"""
max_limit = max((int(v) for v in limits))
with open(filename(out_dir, 'string'), 'wb') as out_f:
with IncludeGuard(out_f):
out_f.write(
'\n'
'#include <boost/metaparse/v{0}/cpp11/impl/concat.... | [
"def",
"generate_string",
"(",
"out_dir",
",",
"limits",
")",
":",
"max_limit",
"=",
"max",
"(",
"(",
"int",
"(",
"v",
")",
"for",
"v",
"in",
"limits",
")",
")",
"with",
"open",
"(",
"filename",
"(",
"out_dir",
",",
"'string'",
")",
",",
"'wb'",
")... | Generate string.hpp | [
"Generate",
"string",
".",
"hpp"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py#L202-L275 | train | Generate string. hpp file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py | existing_path | def existing_path(value):
"""Throws when the path does not exist"""
if os.path.exists(value):
return value
else:
raise argparse.ArgumentTypeError("Path {0} not found".format(value)) | python | def existing_path(value):
"""Throws when the path does not exist"""
if os.path.exists(value):
return value
else:
raise argparse.ArgumentTypeError("Path {0} not found".format(value)) | [
"def",
"existing_path",
"(",
"value",
")",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"value",
")",
":",
"return",
"value",
"else",
":",
"raise",
"argparse",
".",
"ArgumentTypeError",
"(",
"\"Path {0} not found\"",
".",
"format",
"(",
"value",
")",
... | Throws when the path does not exist | [
"Throws",
"when",
"the",
"path",
"does",
"not",
"exist"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py#L287-L292 | train | Raises when the path does not exist | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py | main | def main():
"""The main function of the script"""
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
'--boost_dir',
required=False,
type=existing_path,
help='The path to the include/boost directory of Metaparse'
)
parser.add_argument(
'... | python | def main():
"""The main function of the script"""
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
'--boost_dir',
required=False,
type=existing_path,
help='The path to the include/boost directory of Metaparse'
)
parser.add_argument(
'... | [
"def",
"main",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"__doc__",
")",
"parser",
".",
"add_argument",
"(",
"'--boost_dir'",
",",
"required",
"=",
"False",
",",
"type",
"=",
"existing_path",
",",
"help",
"="... | The main function of the script | [
"The",
"main",
"function",
"of",
"the",
"script"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py#L295-L343 | train | The main function of the script | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py | Namespace.begin | def begin(self):
"""Generate the beginning part"""
self.out_f.write('\n')
for depth, name in enumerate(self.names):
self.out_f.write(
'{0}namespace {1}\n{0}{{\n'.format(self.prefix(depth), name)
) | python | def begin(self):
"""Generate the beginning part"""
self.out_f.write('\n')
for depth, name in enumerate(self.names):
self.out_f.write(
'{0}namespace {1}\n{0}{{\n'.format(self.prefix(depth), name)
) | [
"def",
"begin",
"(",
"self",
")",
":",
"self",
".",
"out_f",
".",
"write",
"(",
"'\\n'",
")",
"for",
"depth",
",",
"name",
"in",
"enumerate",
"(",
"self",
".",
"names",
")",
":",
"self",
".",
"out_f",
".",
"write",
"(",
"'{0}namespace {1}\\n{0}{{\\n'",... | Generate the beginning part | [
"Generate",
"the",
"beginning",
"part"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py#L25-L31 | train | Generate the beginning part of the file | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py | Namespace.end | def end(self):
"""Generate the closing part"""
for depth in xrange(len(self.names) - 1, -1, -1):
self.out_f.write('{0}}}\n'.format(self.prefix(depth))) | python | def end(self):
"""Generate the closing part"""
for depth in xrange(len(self.names) - 1, -1, -1):
self.out_f.write('{0}}}\n'.format(self.prefix(depth))) | [
"def",
"end",
"(",
"self",
")",
":",
"for",
"depth",
"in",
"xrange",
"(",
"len",
"(",
"self",
".",
"names",
")",
"-",
"1",
",",
"-",
"1",
",",
"-",
"1",
")",
":",
"self",
".",
"out_f",
".",
"write",
"(",
"'{0}}}\\n'",
".",
"format",
"(",
"sel... | Generate the closing part | [
"Generate",
"the",
"closing",
"part"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py#L33-L36 | train | Generate the closing part of the log file | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py | IncludeGuard.begin | def begin(self):
"""Generate the beginning part"""
name = 'BOOST_METAPARSE_V1_CPP11_IMPL_STRING_HPP'
self.out_f.write('#ifndef {0}\n#define {0}\n'.format(name))
write_autogen_info(self.out_f) | python | def begin(self):
"""Generate the beginning part"""
name = 'BOOST_METAPARSE_V1_CPP11_IMPL_STRING_HPP'
self.out_f.write('#ifndef {0}\n#define {0}\n'.format(name))
write_autogen_info(self.out_f) | [
"def",
"begin",
"(",
"self",
")",
":",
"name",
"=",
"'BOOST_METAPARSE_V1_CPP11_IMPL_STRING_HPP'",
"self",
".",
"out_f",
".",
"write",
"(",
"'#ifndef {0}\\n#define {0}\\n'",
".",
"format",
"(",
"name",
")",
")",
"write_autogen_info",
"(",
"self",
".",
"out_f",
")... | Generate the beginning part | [
"Generate",
"the",
"beginning",
"part"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py#L69-L73 | train | Generate the beginning part of the module definition | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py | get_deep_features | def get_deep_features(audio_data, verbose=True):
'''
Calculates the deep features used by the Sound Classifier.
Internally the Sound Classifier calculates deep features for both model
creation and predictions. If the same data will be used multiple times,
calculating the deep features just once wil... | python | def get_deep_features(audio_data, verbose=True):
'''
Calculates the deep features used by the Sound Classifier.
Internally the Sound Classifier calculates deep features for both model
creation and predictions. If the same data will be used multiple times,
calculating the deep features just once wil... | [
"def",
"get_deep_features",
"(",
"audio_data",
",",
"verbose",
"=",
"True",
")",
":",
"from",
".",
"_audio_feature_extractor",
"import",
"_get_feature_extractor",
"if",
"not",
"_is_audio_data_sarray",
"(",
"audio_data",
")",
":",
"raise",
"TypeError",
"(",
"\"Input ... | Calculates the deep features used by the Sound Classifier.
Internally the Sound Classifier calculates deep features for both model
creation and predictions. If the same data will be used multiple times,
calculating the deep features just once will result in a significant speed
up.
Parameters
-... | [
"Calculates",
"the",
"deep",
"features",
"used",
"by",
"the",
"Sound",
"Classifier",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py#L45-L75 | train | Calculates the deep features used by the Sound Classifier. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py | create | def create(dataset, target, feature, max_iterations=10,
custom_layer_sizes=[100, 100], verbose=True,
validation_set='auto', batch_size=64):
'''
Creates a :class:`SoundClassifier` model.
Parameters
----------
dataset : SFrame
Input data. The column named by the 'feature... | python | def create(dataset, target, feature, max_iterations=10,
custom_layer_sizes=[100, 100], verbose=True,
validation_set='auto', batch_size=64):
'''
Creates a :class:`SoundClassifier` model.
Parameters
----------
dataset : SFrame
Input data. The column named by the 'feature... | [
"def",
"create",
"(",
"dataset",
",",
"target",
",",
"feature",
",",
"max_iterations",
"=",
"10",
",",
"custom_layer_sizes",
"=",
"[",
"100",
",",
"100",
"]",
",",
"verbose",
"=",
"True",
",",
"validation_set",
"=",
"'auto'",
",",
"batch_size",
"=",
"64"... | Creates a :class:`SoundClassifier` model.
Parameters
----------
dataset : SFrame
Input data. The column named by the 'feature' parameter will be
extracted for modeling.
target : string or int
Name of the column containing the target variable. The values in this
column m... | [
"Creates",
"a",
":",
"class",
":",
"SoundClassifier",
"model",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py#L78-L303 | train | Creates a new SoundClassifier model from the provided data. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py | SoundClassifier._load_version | def _load_version(cls, state, version):
"""
A function to load a previously saved SoundClassifier instance.
"""
from ._audio_feature_extractor import _get_feature_extractor
from .._mxnet import _mxnet_utils
state['_feature_extractor'] = _get_feature_extractor(state['feat... | python | def _load_version(cls, state, version):
"""
A function to load a previously saved SoundClassifier instance.
"""
from ._audio_feature_extractor import _get_feature_extractor
from .._mxnet import _mxnet_utils
state['_feature_extractor'] = _get_feature_extractor(state['feat... | [
"def",
"_load_version",
"(",
"cls",
",",
"state",
",",
"version",
")",
":",
"from",
".",
"_audio_feature_extractor",
"import",
"_get_feature_extractor",
"from",
".",
".",
"_mxnet",
"import",
"_mxnet_utils",
"state",
"[",
"'_feature_extractor'",
"]",
"=",
"_get_fea... | A function to load a previously saved SoundClassifier instance. | [
"A",
"function",
"to",
"load",
"a",
"previously",
"saved",
"SoundClassifier",
"instance",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py#L363-L388 | train | Loads a SoundClassifier instance from a state dictionary. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py | SoundClassifier.classify | def classify(self, dataset, verbose=True, batch_size=64):
"""
Return the classification for each examples in the ``dataset``.
The output SFrame contains predicted class labels and its probability.
Parameters
----------
dataset : SFrame | SArray | dict
The aud... | python | def classify(self, dataset, verbose=True, batch_size=64):
"""
Return the classification for each examples in the ``dataset``.
The output SFrame contains predicted class labels and its probability.
Parameters
----------
dataset : SFrame | SArray | dict
The aud... | [
"def",
"classify",
"(",
"self",
",",
"dataset",
",",
"verbose",
"=",
"True",
",",
"batch_size",
"=",
"64",
")",
":",
"prob_vector",
"=",
"self",
".",
"predict",
"(",
"dataset",
",",
"output_type",
"=",
"'probability_vector'",
",",
"verbose",
"=",
"verbose"... | Return the classification for each examples in the ``dataset``.
The output SFrame contains predicted class labels and its probability.
Parameters
----------
dataset : SFrame | SArray | dict
The audio data to be classified.
If dataset is an SFrame, it must have a ... | [
"Return",
"the",
"classification",
"for",
"each",
"examples",
"in",
"the",
"dataset",
".",
"The",
"output",
"SFrame",
"contains",
"predicted",
"class",
"labels",
"and",
"its",
"probability",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py#L447-L487 | train | Return the classification for each examples in the dataset. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py | SoundClassifier.evaluate | def evaluate(self, dataset, metric='auto', verbose=True, batch_size=64):
"""
Evaluate the model by making predictions of target values and comparing
these to actual values.
Parameters
----------
dataset : SFrame
Dataset to use for evaluation, must include a c... | python | def evaluate(self, dataset, metric='auto', verbose=True, batch_size=64):
"""
Evaluate the model by making predictions of target values and comparing
these to actual values.
Parameters
----------
dataset : SFrame
Dataset to use for evaluation, must include a c... | [
"def",
"evaluate",
"(",
"self",
",",
"dataset",
",",
"metric",
"=",
"'auto'",
",",
"verbose",
"=",
"True",
",",
"batch_size",
"=",
"64",
")",
":",
"from",
"turicreate",
".",
"toolkits",
"import",
"evaluation",
"# parameter checking",
"if",
"not",
"isinstance... | Evaluate the model by making predictions of target values and comparing
these to actual values.
Parameters
----------
dataset : SFrame
Dataset to use for evaluation, must include a column with the same
name as the features used for model training. Additional colu... | [
"Evaluate",
"the",
"model",
"by",
"making",
"predictions",
"of",
"target",
"values",
"and",
"comparing",
"these",
"to",
"actual",
"values",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py#L489-L600 | train | Evaluate the model by making predictions of target values and comparing them to actual values. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py | SoundClassifier.export_coreml | def export_coreml(self, filename):
"""
Save the model in Core ML format.
See Also
--------
save
Examples
--------
>>> model.export_coreml('./myModel.mlmodel')
"""
import coremltools
from coremltools.proto.FeatureTypes_pb2 import A... | python | def export_coreml(self, filename):
"""
Save the model in Core ML format.
See Also
--------
save
Examples
--------
>>> model.export_coreml('./myModel.mlmodel')
"""
import coremltools
from coremltools.proto.FeatureTypes_pb2 import A... | [
"def",
"export_coreml",
"(",
"self",
",",
"filename",
")",
":",
"import",
"coremltools",
"from",
"coremltools",
".",
"proto",
".",
"FeatureTypes_pb2",
"import",
"ArrayFeatureType",
"from",
".",
".",
"_mxnet",
"import",
"_mxnet_utils",
"prob_name",
"=",
"self",
"... | Save the model in Core ML format.
See Also
--------
save
Examples
--------
>>> model.export_coreml('./myModel.mlmodel') | [
"Save",
"the",
"model",
"in",
"Core",
"ML",
"format",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py#L602-L721 | train | Export the Core ML model to a file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py | SoundClassifier.predict | def predict(self, dataset, output_type='class', verbose=True, batch_size=64):
"""
Return predictions for ``dataset``. Predictions can be generated
as class labels or probabilities.
Parameters
----------
dataset : SFrame | SArray | dict
The audio data to be cl... | python | def predict(self, dataset, output_type='class', verbose=True, batch_size=64):
"""
Return predictions for ``dataset``. Predictions can be generated
as class labels or probabilities.
Parameters
----------
dataset : SFrame | SArray | dict
The audio data to be cl... | [
"def",
"predict",
"(",
"self",
",",
"dataset",
",",
"output_type",
"=",
"'class'",
",",
"verbose",
"=",
"True",
",",
"batch_size",
"=",
"64",
")",
":",
"from",
".",
".",
"_mxnet",
"import",
"_mxnet_utils",
"import",
"mxnet",
"as",
"mx",
"if",
"not",
"i... | Return predictions for ``dataset``. Predictions can be generated
as class labels or probabilities.
Parameters
----------
dataset : SFrame | SArray | dict
The audio data to be classified.
If dataset is an SFrame, it must have a column with the same name as
... | [
"Return",
"predictions",
"for",
"dataset",
".",
"Predictions",
"can",
"be",
"generated",
"as",
"class",
"labels",
"or",
"probabilities",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py#L723-L851 | train | Predict the audio data for the specified dataset. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py | SoundClassifier.predict_topk | def predict_topk(self, dataset, output_type='probability', k=3, verbose=True, batch_size=64):
"""
Return top-k predictions for the ``dataset``.
Predictions are returned as an SFrame with three columns: `id`,
`class`, and `probability` or `rank` depending on the ``output_type``
pa... | python | def predict_topk(self, dataset, output_type='probability', k=3, verbose=True, batch_size=64):
"""
Return top-k predictions for the ``dataset``.
Predictions are returned as an SFrame with three columns: `id`,
`class`, and `probability` or `rank` depending on the ``output_type``
pa... | [
"def",
"predict_topk",
"(",
"self",
",",
"dataset",
",",
"output_type",
"=",
"'probability'",
",",
"k",
"=",
"3",
",",
"verbose",
"=",
"True",
",",
"batch_size",
"=",
"64",
")",
":",
"prob_vector",
"=",
"self",
".",
"predict",
"(",
"dataset",
",",
"out... | Return top-k predictions for the ``dataset``.
Predictions are returned as an SFrame with three columns: `id`,
`class`, and `probability` or `rank` depending on the ``output_type``
parameter.
Parameters
----------
dataset : SFrame | SArray | dict
The audio dat... | [
"Return",
"top",
"-",
"k",
"predictions",
"for",
"the",
"dataset",
".",
"Predictions",
"are",
"returned",
"as",
"an",
"SFrame",
"with",
"three",
"columns",
":",
"id",
"class",
"and",
"probability",
"or",
"rank",
"depending",
"on",
"the",
"output_type",
"para... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py#L853-L932 | train | Predicts the top - k class of the dataset. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/toolkits/_mxnet/_mx_sframe_iter.py | _init_data | def _init_data(data, allow_empty, default_name):
"""Convert data into canonical form."""
assert (data is not None) or allow_empty
if data is None:
data = []
if isinstance(data, (np.ndarray, NDArray)):
data = [data]
if isinstance(data, list):
if not allow_empty:
a... | python | def _init_data(data, allow_empty, default_name):
"""Convert data into canonical form."""
assert (data is not None) or allow_empty
if data is None:
data = []
if isinstance(data, (np.ndarray, NDArray)):
data = [data]
if isinstance(data, list):
if not allow_empty:
a... | [
"def",
"_init_data",
"(",
"data",
",",
"allow_empty",
",",
"default_name",
")",
":",
"assert",
"(",
"data",
"is",
"not",
"None",
")",
"or",
"allow_empty",
"if",
"data",
"is",
"None",
":",
"data",
"=",
"[",
"]",
"if",
"isinstance",
"(",
"data",
",",
"... | Convert data into canonical form. | [
"Convert",
"data",
"into",
"canonical",
"form",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_mxnet/_mx_sframe_iter.py#L37-L62 | train | Convert data into canonical form. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/toolkits/_mxnet/_mx_sframe_iter.py | SFrameIter.provide_data | def provide_data(self):
"""The name and shape of data provided by this iterator"""
return [(k, tuple([self.batch_size] + list(v.shape[1:]))) for k, v in self.data] | python | def provide_data(self):
"""The name and shape of data provided by this iterator"""
return [(k, tuple([self.batch_size] + list(v.shape[1:]))) for k, v in self.data] | [
"def",
"provide_data",
"(",
"self",
")",
":",
"return",
"[",
"(",
"k",
",",
"tuple",
"(",
"[",
"self",
".",
"batch_size",
"]",
"+",
"list",
"(",
"v",
".",
"shape",
"[",
"1",
":",
"]",
")",
")",
")",
"for",
"k",
",",
"v",
"in",
"self",
".",
... | The name and shape of data provided by this iterator | [
"The",
"name",
"and",
"shape",
"of",
"data",
"provided",
"by",
"this",
"iterator"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_mxnet/_mx_sframe_iter.py#L134-L136 | train | The name and shape of data provided by this iterator | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/toolkits/_mxnet/_mx_sframe_iter.py | SFrameIter.provide_label | def provide_label(self):
"""The name and shape of label provided by this iterator"""
return [(k, tuple([self.batch_size] + list(v.shape[1:]))) for k, v in self.label] | python | def provide_label(self):
"""The name and shape of label provided by this iterator"""
return [(k, tuple([self.batch_size] + list(v.shape[1:]))) for k, v in self.label] | [
"def",
"provide_label",
"(",
"self",
")",
":",
"return",
"[",
"(",
"k",
",",
"tuple",
"(",
"[",
"self",
".",
"batch_size",
"]",
"+",
"list",
"(",
"v",
".",
"shape",
"[",
"1",
":",
"]",
")",
")",
")",
"for",
"k",
",",
"v",
"in",
"self",
".",
... | The name and shape of label provided by this iterator | [
"The",
"name",
"and",
"shape",
"of",
"label",
"provided",
"by",
"this",
"iterator"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_mxnet/_mx_sframe_iter.py#L139-L141 | train | The name and shape of label provided by this iterator | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | reset | def reset ():
""" Clear the module state. This is mainly for testing purposes.
"""
global __generators, __type_to_generators, __generators_for_toolset, __construct_stack
global __overrides, __active_generators
global __viable_generators_cache, __viable_source_types_cache
global __vstg_cached_gen... | python | def reset ():
""" Clear the module state. This is mainly for testing purposes.
"""
global __generators, __type_to_generators, __generators_for_toolset, __construct_stack
global __overrides, __active_generators
global __viable_generators_cache, __viable_source_types_cache
global __vstg_cached_gen... | [
"def",
"reset",
"(",
")",
":",
"global",
"__generators",
",",
"__type_to_generators",
",",
"__generators_for_toolset",
",",
"__construct_stack",
"global",
"__overrides",
",",
"__active_generators",
"global",
"__viable_generators_cache",
",",
"__viable_source_types_cache",
"... | Clear the module state. This is mainly for testing purposes. | [
"Clear",
"the",
"module",
"state",
".",
"This",
"is",
"mainly",
"for",
"testing",
"purposes",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L65-L85 | train | Clears the module state. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | register | def register (g):
""" Registers new generator instance 'g'.
"""
assert isinstance(g, Generator)
id = g.id()
__generators [id] = g
# A generator can produce several targets of the
# same type. We want unique occurence of that generator
# in .generators.$(t) in that case, otherwise, it w... | python | def register (g):
""" Registers new generator instance 'g'.
"""
assert isinstance(g, Generator)
id = g.id()
__generators [id] = g
# A generator can produce several targets of the
# same type. We want unique occurence of that generator
# in .generators.$(t) in that case, otherwise, it w... | [
"def",
"register",
"(",
"g",
")",
":",
"assert",
"isinstance",
"(",
"g",
",",
"Generator",
")",
"id",
"=",
"g",
".",
"id",
"(",
")",
"__generators",
"[",
"id",
"]",
"=",
"g",
"# A generator can produce several targets of the",
"# same type. We want unique occure... | Registers new generator instance 'g'. | [
"Registers",
"new",
"generator",
"instance",
"g",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L657-L706 | train | Registers a new generator instance g. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | register_standard | def register_standard (id, source_types, target_types, requirements = []):
""" Creates new instance of the 'generator' class and registers it.
Returns the creates instance.
Rationale: the instance is returned so that it's possible to first register
a generator and then call 'run' method on t... | python | def register_standard (id, source_types, target_types, requirements = []):
""" Creates new instance of the 'generator' class and registers it.
Returns the creates instance.
Rationale: the instance is returned so that it's possible to first register
a generator and then call 'run' method on t... | [
"def",
"register_standard",
"(",
"id",
",",
"source_types",
",",
"target_types",
",",
"requirements",
"=",
"[",
"]",
")",
":",
"g",
"=",
"Generator",
"(",
"id",
",",
"False",
",",
"source_types",
",",
"target_types",
",",
"requirements",
")",
"register",
"... | Creates new instance of the 'generator' class and registers it.
Returns the creates instance.
Rationale: the instance is returned so that it's possible to first register
a generator and then call 'run' method on that generator, bypassing all
generator selection. | [
"Creates",
"new",
"instance",
"of",
"the",
"generator",
"class",
"and",
"registers",
"it",
".",
"Returns",
"the",
"creates",
"instance",
".",
"Rationale",
":",
"the",
"instance",
"is",
"returned",
"so",
"that",
"it",
"s",
"possible",
"to",
"first",
"register... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L723-L732 | train | Registers a standard generator. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | override | def override (overrider_id, overridee_id):
"""Make generator 'overrider-id' be preferred to
'overridee-id'. If, when searching for generators
that could produce a target of certain type,
both those generators are amoung viable generators,
the overridden generator is immediately discarded.
The o... | python | def override (overrider_id, overridee_id):
"""Make generator 'overrider-id' be preferred to
'overridee-id'. If, when searching for generators
that could produce a target of certain type,
both those generators are amoung viable generators,
the overridden generator is immediately discarded.
The o... | [
"def",
"override",
"(",
"overrider_id",
",",
"overridee_id",
")",
":",
"assert",
"isinstance",
"(",
"overrider_id",
",",
"basestring",
")",
"assert",
"isinstance",
"(",
"overridee_id",
",",
"basestring",
")",
"__overrides",
".",
"setdefault",
"(",
"overrider_id",
... | Make generator 'overrider-id' be preferred to
'overridee-id'. If, when searching for generators
that could produce a target of certain type,
both those generators are amoung viable generators,
the overridden generator is immediately discarded.
The overridden generators are discarded immediately
... | [
"Make",
"generator",
"overrider",
"-",
"id",
"be",
"preferred",
"to",
"overridee",
"-",
"id",
".",
"If",
"when",
"searching",
"for",
"generators",
"that",
"could",
"produce",
"a",
"target",
"of",
"certain",
"type",
"both",
"those",
"generators",
"are",
"amou... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L747-L760 | train | Make generator overridden to overridee_id. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | __viable_source_types_real | def __viable_source_types_real (target_type):
""" Returns a list of source type which can possibly be converted
to 'target_type' by some chain of generator invocation.
More formally, takes all generators for 'target_type' and
returns union of source types for those generators and result
... | python | def __viable_source_types_real (target_type):
""" Returns a list of source type which can possibly be converted
to 'target_type' by some chain of generator invocation.
More formally, takes all generators for 'target_type' and
returns union of source types for those generators and result
... | [
"def",
"__viable_source_types_real",
"(",
"target_type",
")",
":",
"assert",
"isinstance",
"(",
"target_type",
",",
"basestring",
")",
"generators",
"=",
"[",
"]",
"# 't0' is the initial list of target types we need to process to get a list",
"# of their viable source target type... | Returns a list of source type which can possibly be converted
to 'target_type' by some chain of generator invocation.
More formally, takes all generators for 'target_type' and
returns union of source types for those generators and result
of calling itself recusrively on source types. | [
"Returns",
"a",
"list",
"of",
"source",
"type",
"which",
"can",
"possibly",
"be",
"converted",
"to",
"target_type",
"by",
"some",
"chain",
"of",
"generator",
"invocation",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L762-L820 | train | Returns a list of source types which can possibly be converted to target_type by some chain of generators. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | viable_source_types | def viable_source_types (target_type):
""" Helper rule, caches the result of '__viable_source_types_real'.
"""
assert isinstance(target_type, basestring)
if target_type not in __viable_source_types_cache:
__vst_cached_types.append(target_type)
__viable_source_types_cache [target_type] = ... | python | def viable_source_types (target_type):
""" Helper rule, caches the result of '__viable_source_types_real'.
"""
assert isinstance(target_type, basestring)
if target_type not in __viable_source_types_cache:
__vst_cached_types.append(target_type)
__viable_source_types_cache [target_type] = ... | [
"def",
"viable_source_types",
"(",
"target_type",
")",
":",
"assert",
"isinstance",
"(",
"target_type",
",",
"basestring",
")",
"if",
"target_type",
"not",
"in",
"__viable_source_types_cache",
":",
"__vst_cached_types",
".",
"append",
"(",
"target_type",
")",
"__via... | Helper rule, caches the result of '__viable_source_types_real'. | [
"Helper",
"rule",
"caches",
"the",
"result",
"of",
"__viable_source_types_real",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L823-L830 | train | Helper rule for viable_source_types_real. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | viable_source_types_for_generator_real | def viable_source_types_for_generator_real (generator):
""" Returns the list of source types, which, when passed to 'run'
method of 'generator', has some change of being eventually used
(probably after conversion by other generators)
"""
assert isinstance(generator, Generator)
source_typ... | python | def viable_source_types_for_generator_real (generator):
""" Returns the list of source types, which, when passed to 'run'
method of 'generator', has some change of being eventually used
(probably after conversion by other generators)
"""
assert isinstance(generator, Generator)
source_typ... | [
"def",
"viable_source_types_for_generator_real",
"(",
"generator",
")",
":",
"assert",
"isinstance",
"(",
"generator",
",",
"Generator",
")",
"source_types",
"=",
"generator",
".",
"source_types",
"(",
")",
"if",
"not",
"source_types",
":",
"# If generator does not sp... | Returns the list of source types, which, when passed to 'run'
method of 'generator', has some change of being eventually used
(probably after conversion by other generators) | [
"Returns",
"the",
"list",
"of",
"source",
"types",
"which",
"when",
"passed",
"to",
"run",
"method",
"of",
"generator",
"has",
"some",
"change",
"of",
"being",
"eventually",
"used",
"(",
"probably",
"after",
"conversion",
"by",
"other",
"generators",
")"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L832-L857 | train | Returns the list of source types which are used by generator real generators. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | viable_source_types_for_generator | def viable_source_types_for_generator (generator):
""" Caches the result of 'viable_source_types_for_generator'.
"""
assert isinstance(generator, Generator)
if generator not in __viable_source_types_cache:
__vstg_cached_generators.append(generator)
__viable_source_types_cache[generator] ... | python | def viable_source_types_for_generator (generator):
""" Caches the result of 'viable_source_types_for_generator'.
"""
assert isinstance(generator, Generator)
if generator not in __viable_source_types_cache:
__vstg_cached_generators.append(generator)
__viable_source_types_cache[generator] ... | [
"def",
"viable_source_types_for_generator",
"(",
"generator",
")",
":",
"assert",
"isinstance",
"(",
"generator",
",",
"Generator",
")",
"if",
"generator",
"not",
"in",
"__viable_source_types_cache",
":",
"__vstg_cached_generators",
".",
"append",
"(",
"generator",
")... | Caches the result of 'viable_source_types_for_generator'. | [
"Caches",
"the",
"result",
"of",
"viable_source_types_for_generator",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L859-L867 | train | Caches the result of viable_source_types_for_generator. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | try_one_generator_really | def try_one_generator_really (project, name, generator, target_type, properties, sources):
""" Returns usage requirements + list of created targets.
"""
if __debug__:
from .targets import ProjectTarget
assert isinstance(project, ProjectTarget)
assert isinstance(name, basestring) or n... | python | def try_one_generator_really (project, name, generator, target_type, properties, sources):
""" Returns usage requirements + list of created targets.
"""
if __debug__:
from .targets import ProjectTarget
assert isinstance(project, ProjectTarget)
assert isinstance(name, basestring) or n... | [
"def",
"try_one_generator_really",
"(",
"project",
",",
"name",
",",
"generator",
",",
"target_type",
",",
"properties",
",",
"sources",
")",
":",
"if",
"__debug__",
":",
"from",
".",
"targets",
"import",
"ProjectTarget",
"assert",
"isinstance",
"(",
"project",
... | Returns usage requirements + list of created targets. | [
"Returns",
"usage",
"requirements",
"+",
"list",
"of",
"created",
"targets",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L869-L907 | train | Try one generator and return usage requirements + list of created targets. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | try_one_generator | def try_one_generator (project, name, generator, target_type, properties, sources):
""" Checks if generator invocation can be pruned, because it's guaranteed
to fail. If so, quickly returns empty list. Otherwise, calls
try_one_generator_really.
"""
if __debug__:
from .targets import ... | python | def try_one_generator (project, name, generator, target_type, properties, sources):
""" Checks if generator invocation can be pruned, because it's guaranteed
to fail. If so, quickly returns empty list. Otherwise, calls
try_one_generator_really.
"""
if __debug__:
from .targets import ... | [
"def",
"try_one_generator",
"(",
"project",
",",
"name",
",",
"generator",
",",
"target_type",
",",
"properties",
",",
"sources",
")",
":",
"if",
"__debug__",
":",
"from",
".",
"targets",
"import",
"ProjectTarget",
"assert",
"isinstance",
"(",
"project",
",",
... | Checks if generator invocation can be pruned, because it's guaranteed
to fail. If so, quickly returns empty list. Otherwise, calls
try_one_generator_really. | [
"Checks",
"if",
"generator",
"invocation",
"can",
"be",
"pruned",
"because",
"it",
"s",
"guaranteed",
"to",
"fail",
".",
"If",
"so",
"quickly",
"returns",
"empty",
"list",
".",
"Otherwise",
"calls",
"try_one_generator_really",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L909-L940 | train | Checks if generator invocation can be pruned because it s guaranteed
to fail. If so returns empty list. Otherwise returns a list of generator instances that can be used to generate new ones. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | __ensure_type | def __ensure_type (targets):
""" Ensures all 'targets' have types. If this is not so, exists with
error.
"""
assert is_iterable_typed(targets, virtual_target.VirtualTarget)
for t in targets:
if not t.type ():
get_manager().errors()("target '%s' has no type" % str (t)) | python | def __ensure_type (targets):
""" Ensures all 'targets' have types. If this is not so, exists with
error.
"""
assert is_iterable_typed(targets, virtual_target.VirtualTarget)
for t in targets:
if not t.type ():
get_manager().errors()("target '%s' has no type" % str (t)) | [
"def",
"__ensure_type",
"(",
"targets",
")",
":",
"assert",
"is_iterable_typed",
"(",
"targets",
",",
"virtual_target",
".",
"VirtualTarget",
")",
"for",
"t",
"in",
"targets",
":",
"if",
"not",
"t",
".",
"type",
"(",
")",
":",
"get_manager",
"(",
")",
".... | Ensures all 'targets' have types. If this is not so, exists with
error. | [
"Ensures",
"all",
"targets",
"have",
"types",
".",
"If",
"this",
"is",
"not",
"so",
"exists",
"with",
"error",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L978-L985 | train | Ensures that all targets have types. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | __construct_really | def __construct_really (project, name, target_type, prop_set, sources):
""" Attempts to construct target by finding viable generators, running them
and selecting the dependency graph.
"""
if __debug__:
from .targets import ProjectTarget
assert isinstance(project, ProjectTarget)
... | python | def __construct_really (project, name, target_type, prop_set, sources):
""" Attempts to construct target by finding viable generators, running them
and selecting the dependency graph.
"""
if __debug__:
from .targets import ProjectTarget
assert isinstance(project, ProjectTarget)
... | [
"def",
"__construct_really",
"(",
"project",
",",
"name",
",",
"target_type",
",",
"prop_set",
",",
"sources",
")",
":",
"if",
"__debug__",
":",
"from",
".",
"targets",
"import",
"ProjectTarget",
"assert",
"isinstance",
"(",
"project",
",",
"ProjectTarget",
")... | Attempts to construct target by finding viable generators, running them
and selecting the dependency graph. | [
"Attempts",
"to",
"construct",
"target",
"by",
"finding",
"viable",
"generators",
"running",
"them",
"and",
"selecting",
"the",
"dependency",
"graph",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L1091-L1136 | train | Given a project target name target_type prop_set and sources return a list of virtual targets that can be used to construct the target. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | construct | def construct (project, name, target_type, prop_set, sources, top_level=False):
""" Attempts to create target of 'target-type' with 'properties'
from 'sources'. The 'sources' are treated as a collection of
*possible* ingridients -- i.e. it is not required to consume
them all. If 'multiple' i... | python | def construct (project, name, target_type, prop_set, sources, top_level=False):
""" Attempts to create target of 'target-type' with 'properties'
from 'sources'. The 'sources' are treated as a collection of
*possible* ingridients -- i.e. it is not required to consume
them all. If 'multiple' i... | [
"def",
"construct",
"(",
"project",
",",
"name",
",",
"target_type",
",",
"prop_set",
",",
"sources",
",",
"top_level",
"=",
"False",
")",
":",
"if",
"__debug__",
":",
"from",
".",
"targets",
"import",
"ProjectTarget",
"assert",
"isinstance",
"(",
"project",... | Attempts to create target of 'target-type' with 'properties'
from 'sources'. The 'sources' are treated as a collection of
*possible* ingridients -- i.e. it is not required to consume
them all. If 'multiple' is true, the rule is allowed to return
several targets of 'target-type'.
... | [
"Attempts",
"to",
"create",
"target",
"of",
"target",
"-",
"type",
"with",
"properties",
"from",
"sources",
".",
"The",
"sources",
"are",
"treated",
"as",
"a",
"collection",
"of",
"*",
"possible",
"*",
"ingridients",
"--",
"i",
".",
"e",
".",
"it",
"is",... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L1139-L1194 | train | Creates a new target of target_type with properties set from sources. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | Generator.clone | def clone (self, new_id, new_toolset_properties):
""" Returns another generator which differers from $(self) in
- id
- value to <toolset> feature in properties
"""
assert isinstance(new_id, basestring)
assert is_iterable_typed(new_toolset_properties, basestrin... | python | def clone (self, new_id, new_toolset_properties):
""" Returns another generator which differers from $(self) in
- id
- value to <toolset> feature in properties
"""
assert isinstance(new_id, basestring)
assert is_iterable_typed(new_toolset_properties, basestrin... | [
"def",
"clone",
"(",
"self",
",",
"new_id",
",",
"new_toolset_properties",
")",
":",
"assert",
"isinstance",
"(",
"new_id",
",",
"basestring",
")",
"assert",
"is_iterable_typed",
"(",
"new_toolset_properties",
",",
"basestring",
")",
"return",
"self",
".",
"__cl... | Returns another generator which differers from $(self) in
- id
- value to <toolset> feature in properties | [
"Returns",
"another",
"generator",
"which",
"differers",
"from",
"$",
"(",
"self",
")",
"in",
"-",
"id",
"-",
"value",
"to",
"<toolset",
">",
"feature",
"in",
"properties"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L238-L251 | train | Returns a new generator which differers from this one with the given id and new_toolset_properties. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | Generator.clone_and_change_target_type | def clone_and_change_target_type(self, base, type):
"""Creates another generator that is the same as $(self), except that
if 'base' is in target types of $(self), 'type' will in target types
of the new generator."""
assert isinstance(base, basestring)
assert isinstance(type, base... | python | def clone_and_change_target_type(self, base, type):
"""Creates another generator that is the same as $(self), except that
if 'base' is in target types of $(self), 'type' will in target types
of the new generator."""
assert isinstance(base, basestring)
assert isinstance(type, base... | [
"def",
"clone_and_change_target_type",
"(",
"self",
",",
"base",
",",
"type",
")",
":",
"assert",
"isinstance",
"(",
"base",
",",
"basestring",
")",
"assert",
"isinstance",
"(",
"type",
",",
"basestring",
")",
"target_types",
"=",
"[",
"]",
"for",
"t",
"in... | Creates another generator that is the same as $(self), except that
if 'base' is in target types of $(self), 'type' will in target types
of the new generator. | [
"Creates",
"another",
"generator",
"that",
"is",
"the",
"same",
"as",
"$",
"(",
"self",
")",
"except",
"that",
"if",
"base",
"is",
"in",
"target",
"types",
"of",
"$",
"(",
"self",
")",
"type",
"will",
"in",
"target",
"types",
"of",
"the",
"new",
"gen... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L253-L275 | train | Creates a new generator that is the same as this one except that base is in target types of the new generator. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | Generator.match_rank | def match_rank (self, ps):
""" Returns true if the generator can be run with the specified
properties.
"""
# See if generator's requirements are satisfied by
# 'properties'. Treat a feature name in requirements
# (i.e. grist-only element), as matching any value of th... | python | def match_rank (self, ps):
""" Returns true if the generator can be run with the specified
properties.
"""
# See if generator's requirements are satisfied by
# 'properties'. Treat a feature name in requirements
# (i.e. grist-only element), as matching any value of th... | [
"def",
"match_rank",
"(",
"self",
",",
"ps",
")",
":",
"# See if generator's requirements are satisfied by",
"# 'properties'. Treat a feature name in requirements",
"# (i.e. grist-only element), as matching any value of the",
"# feature.",
"assert",
"isinstance",
"(",
"ps",
",",
"... | Returns true if the generator can be run with the specified
properties. | [
"Returns",
"true",
"if",
"the",
"generator",
"can",
"be",
"run",
"with",
"the",
"specified",
"properties",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L301-L325 | train | Returns true if the generator can be run with the specified
properties. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | Generator.run | def run (self, project, name, prop_set, sources):
""" Tries to invoke this generator on the given sources. Returns a
list of generated targets (instances of 'virtual-target').
project: Project for which the targets are generated.
name: Determines the name o... | python | def run (self, project, name, prop_set, sources):
""" Tries to invoke this generator on the given sources. Returns a
list of generated targets (instances of 'virtual-target').
project: Project for which the targets are generated.
name: Determines the name o... | [
"def",
"run",
"(",
"self",
",",
"project",
",",
"name",
",",
"prop_set",
",",
"sources",
")",
":",
"if",
"__debug__",
":",
"from",
".",
"targets",
"import",
"ProjectTarget",
"assert",
"isinstance",
"(",
"project",
",",
"ProjectTarget",
")",
"# intermediary t... | Tries to invoke this generator on the given sources. Returns a
list of generated targets (instances of 'virtual-target').
project: Project for which the targets are generated.
name: Determines the name of 'name' attribute for
all generat... | [
"Tries",
"to",
"invoke",
"this",
"generator",
"on",
"the",
"given",
"sources",
".",
"Returns",
"a",
"list",
"of",
"generated",
"targets",
"(",
"instances",
"of",
"virtual",
"-",
"target",
")",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L327-L373 | train | Runs the generator on the given sources. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | Generator.construct_result | def construct_result (self, consumed, project, name, prop_set):
""" Constructs the dependency graph that will be returned by this
generator.
consumed: Already prepared list of consumable targets
If generator requires several source files will c... | python | def construct_result (self, consumed, project, name, prop_set):
""" Constructs the dependency graph that will be returned by this
generator.
consumed: Already prepared list of consumable targets
If generator requires several source files will c... | [
"def",
"construct_result",
"(",
"self",
",",
"consumed",
",",
"project",
",",
"name",
",",
"prop_set",
")",
":",
"if",
"__debug__",
":",
"from",
".",
"targets",
"import",
"ProjectTarget",
"assert",
"is_iterable_typed",
"(",
"consumed",
",",
"virtual_target",
"... | Constructs the dependency graph that will be returned by this
generator.
consumed: Already prepared list of consumable targets
If generator requires several source files will contain
exactly len $(self.source_types_) ta... | [
"Constructs",
"the",
"dependency",
"graph",
"that",
"will",
"be",
"returned",
"by",
"this",
"generator",
".",
"consumed",
":",
"Already",
"prepared",
"list",
"of",
"consumable",
"targets",
"If",
"generator",
"requires",
"several",
"source",
"files",
"will",
"con... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L403-L430 | train | Constructs the dependency graph that will be returned by this
generator. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | Generator.determine_output_name | def determine_output_name(self, sources):
"""Determine the name of the produced target from the
names of the sources."""
assert is_iterable_typed(sources, virtual_target.VirtualTarget)
# The simple case if when a name
# of source has single dot. Then, we take the part before
... | python | def determine_output_name(self, sources):
"""Determine the name of the produced target from the
names of the sources."""
assert is_iterable_typed(sources, virtual_target.VirtualTarget)
# The simple case if when a name
# of source has single dot. Then, we take the part before
... | [
"def",
"determine_output_name",
"(",
"self",
",",
"sources",
")",
":",
"assert",
"is_iterable_typed",
"(",
"sources",
",",
"virtual_target",
".",
"VirtualTarget",
")",
"# The simple case if when a name",
"# of source has single dot. Then, we take the part before",
"# dot. Sever... | Determine the name of the produced target from the
names of the sources. | [
"Determine",
"the",
"name",
"of",
"the",
"produced",
"target",
"from",
"the",
"names",
"of",
"the",
"sources",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L451-L475 | train | Determine the name of the produced target from the names of the sources. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | Generator.generated_targets | def generated_targets (self, sources, prop_set, project, name):
""" Constructs targets that are created after consuming 'sources'.
The result will be the list of virtual-target, which the same length
as 'target_types' attribute and with corresponding types.
When 'name' is em... | python | def generated_targets (self, sources, prop_set, project, name):
""" Constructs targets that are created after consuming 'sources'.
The result will be the list of virtual-target, which the same length
as 'target_types' attribute and with corresponding types.
When 'name' is em... | [
"def",
"generated_targets",
"(",
"self",
",",
"sources",
",",
"prop_set",
",",
"project",
",",
"name",
")",
":",
"if",
"__debug__",
":",
"from",
".",
"targets",
"import",
"ProjectTarget",
"assert",
"is_iterable_typed",
"(",
"sources",
",",
"virtual_target",
".... | Constructs targets that are created after consuming 'sources'.
The result will be the list of virtual-target, which the same length
as 'target_types' attribute and with corresponding types.
When 'name' is empty, all source targets must have the same value of
the 'name' a... | [
"Constructs",
"targets",
"that",
"are",
"created",
"after",
"consuming",
"sources",
".",
"The",
"result",
"will",
"be",
"the",
"list",
"of",
"virtual",
"-",
"target",
"which",
"the",
"same",
"length",
"as",
"target_types",
"attribute",
"and",
"with",
"correspo... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L478-L526 | train | Constructs targets that are created after consuming sources. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | Generator.convert_to_consumable_types | def convert_to_consumable_types (self, project, name, prop_set, sources, only_one=False):
""" Attempts to convert 'source' to the types that this generator can
handle. The intention is to produce the set of targets can should be
used when generator is run.
only_one: convert... | python | def convert_to_consumable_types (self, project, name, prop_set, sources, only_one=False):
""" Attempts to convert 'source' to the types that this generator can
handle. The intention is to produce the set of targets can should be
used when generator is run.
only_one: convert... | [
"def",
"convert_to_consumable_types",
"(",
"self",
",",
"project",
",",
"name",
",",
"prop_set",
",",
"sources",
",",
"only_one",
"=",
"False",
")",
":",
"if",
"__debug__",
":",
"from",
".",
"targets",
"import",
"ProjectTarget",
"assert",
"isinstance",
"(",
... | Attempts to convert 'source' to the types that this generator can
handle. The intention is to produce the set of targets can should be
used when generator is run.
only_one: convert 'source' to only one of source types
if there's more that one possibility, re... | [
"Attempts",
"to",
"convert",
"source",
"to",
"the",
"types",
"that",
"this",
"generator",
"can",
"handle",
".",
"The",
"intention",
"is",
"to",
"produce",
"the",
"set",
"of",
"targets",
"can",
"should",
"be",
"used",
"when",
"generator",
"is",
"run",
".",
... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L528-L585 | train | Converts source to the types that this generator can handle. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | Generator.convert_multiple_sources_to_consumable_types | def convert_multiple_sources_to_consumable_types (self, project, prop_set, sources):
""" Converts several files to consumable types.
"""
if __debug__:
from .targets import ProjectTarget
assert isinstance(project, ProjectTarget)
assert isinstance(prop_set, pro... | python | def convert_multiple_sources_to_consumable_types (self, project, prop_set, sources):
""" Converts several files to consumable types.
"""
if __debug__:
from .targets import ProjectTarget
assert isinstance(project, ProjectTarget)
assert isinstance(prop_set, pro... | [
"def",
"convert_multiple_sources_to_consumable_types",
"(",
"self",
",",
"project",
",",
"prop_set",
",",
"sources",
")",
":",
"if",
"__debug__",
":",
"from",
".",
"targets",
"import",
"ProjectTarget",
"assert",
"isinstance",
"(",
"project",
",",
"ProjectTarget",
... | Converts several files to consumable types. | [
"Converts",
"several",
"files",
"to",
"consumable",
"types",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L588-L619 | train | Converts several sources to consumable types. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sketch.py | Sketch.element_sub_sketch | def element_sub_sketch(self, keys = None):
"""
Returns the sketch summary for the given set of keys. This is only
applicable for sketch summary created from SArray of sarray or dict type.
For dict SArray, the keys are the keys in dict value.
For array Sarray, the keys are indexes... | python | def element_sub_sketch(self, keys = None):
"""
Returns the sketch summary for the given set of keys. This is only
applicable for sketch summary created from SArray of sarray or dict type.
For dict SArray, the keys are the keys in dict value.
For array Sarray, the keys are indexes... | [
"def",
"element_sub_sketch",
"(",
"self",
",",
"keys",
"=",
"None",
")",
":",
"single_val",
"=",
"False",
"if",
"keys",
"is",
"None",
":",
"keys",
"=",
"[",
"]",
"else",
":",
"if",
"not",
"isinstance",
"(",
"keys",
",",
"list",
")",
":",
"single_val"... | Returns the sketch summary for the given set of keys. This is only
applicable for sketch summary created from SArray of sarray or dict type.
For dict SArray, the keys are the keys in dict value.
For array Sarray, the keys are indexes into the array value.
The keys must be passed into or... | [
"Returns",
"the",
"sketch",
"summary",
"for",
"the",
"given",
"set",
"of",
"keys",
".",
"This",
"is",
"only",
"applicable",
"for",
"sketch",
"summary",
"created",
"from",
"SArray",
"of",
"sarray",
"or",
"dict",
"type",
".",
"For",
"dict",
"SArray",
"the",
... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sketch.py#L662-L740 | train | Returns the summary for the given set of keys. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_NuSVC.py | convert | def convert(model, feature_names, target):
"""Convert a Nu-Support Vector Classification (NuSVC) model to the protobuf spec.
Parameters
----------
model: NuSVC
A trained NuSVC encoder model.
feature_names: [str], optional (default=None)
Name of the input columns.
target: str, o... | python | def convert(model, feature_names, target):
"""Convert a Nu-Support Vector Classification (NuSVC) model to the protobuf spec.
Parameters
----------
model: NuSVC
A trained NuSVC encoder model.
feature_names: [str], optional (default=None)
Name of the input columns.
target: str, o... | [
"def",
"convert",
"(",
"model",
",",
"feature_names",
",",
"target",
")",
":",
"if",
"not",
"(",
"_HAS_SKLEARN",
")",
":",
"raise",
"RuntimeError",
"(",
"'scikit-learn not found. scikit-learn conversion API is disabled.'",
")",
"_sklearn_util",
".",
"check_expected_type... | Convert a Nu-Support Vector Classification (NuSVC) model to the protobuf spec.
Parameters
----------
model: NuSVC
A trained NuSVC encoder model.
feature_names: [str], optional (default=None)
Name of the input columns.
target: str, optional (default=None)
Name of the output ... | [
"Convert",
"a",
"Nu",
"-",
"Support",
"Vector",
"Classification",
"(",
"NuSVC",
")",
"model",
"to",
"the",
"protobuf",
"spec",
".",
"Parameters",
"----------",
"model",
":",
"NuSVC",
"A",
"trained",
"NuSVC",
"encoder",
"model",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_NuSVC.py#L18-L41 | train | Convert a Nu - Support Vector Classification model to the protobuf spec. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_linear_regression.py | convert | def convert(model, features, target):
"""Convert a linear regression model to the protobuf spec.
Parameters
----------
model: LinearRegression
A trained linear regression encoder model.
feature_names: [str]
Name of the input columns.
target: str
Name of the output colu... | python | def convert(model, features, target):
"""Convert a linear regression model to the protobuf spec.
Parameters
----------
model: LinearRegression
A trained linear regression encoder model.
feature_names: [str]
Name of the input columns.
target: str
Name of the output colu... | [
"def",
"convert",
"(",
"model",
",",
"features",
",",
"target",
")",
":",
"if",
"not",
"(",
"_HAS_SKLEARN",
")",
":",
"raise",
"RuntimeError",
"(",
"'scikit-learn not found. scikit-learn conversion API is disabled.'",
")",
"# Check the scikit learn model",
"_sklearn_util"... | Convert a linear regression model to the protobuf spec.
Parameters
----------
model: LinearRegression
A trained linear regression encoder model.
feature_names: [str]
Name of the input columns.
target: str
Name of the output column.
Returns
-------
model_spec: A... | [
"Convert",
"a",
"linear",
"regression",
"model",
"to",
"the",
"protobuf",
"spec",
".",
"Parameters",
"----------",
"model",
":",
"LinearRegression",
"A",
"trained",
"linear",
"regression",
"encoder",
"model",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_linear_regression.py#L23-L49 | train | Convert a linear regression encoder model to the protobuf spec. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | _get_global_dbapi_info | def _get_global_dbapi_info(dbapi_module, conn):
"""
Fetches all needed information from the top-level DBAPI module,
guessing at the module if it wasn't passed as a parameter. Returns a
dictionary of all the needed variables. This is put in one place to
make sure the error message is clear if the mod... | python | def _get_global_dbapi_info(dbapi_module, conn):
"""
Fetches all needed information from the top-level DBAPI module,
guessing at the module if it wasn't passed as a parameter. Returns a
dictionary of all the needed variables. This is put in one place to
make sure the error message is clear if the mod... | [
"def",
"_get_global_dbapi_info",
"(",
"dbapi_module",
",",
"conn",
")",
":",
"module_given_msg",
"=",
"\"The DBAPI2 module given ({0}) is missing the global\\n\"",
"+",
"\"variable '{1}'. Please make sure you are supplying a module that\\n\"",
"+",
"\"conforms to the DBAPI 2.0 standard (... | Fetches all needed information from the top-level DBAPI module,
guessing at the module if it wasn't passed as a parameter. Returns a
dictionary of all the needed variables. This is put in one place to
make sure the error message is clear if the module "guess" is wrong. | [
"Fetches",
"all",
"needed",
"information",
"from",
"the",
"top",
"-",
"level",
"DBAPI",
"module",
"guessing",
"at",
"the",
"module",
"if",
"it",
"wasn",
"t",
"passed",
"as",
"a",
"parameter",
".",
"Returns",
"a",
"dictionary",
"of",
"all",
"the",
"needed",... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L86-L144 | train | Returns a dictionary of all needed information from the top - level DBAPI module. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame._read_csv_impl | def _read_csv_impl(cls,
url,
delimiter=',',
header=True,
error_bad_lines=False,
comment_char='',
escape_char='\\',
double_quote=True,
qu... | python | def _read_csv_impl(cls,
url,
delimiter=',',
header=True,
error_bad_lines=False,
comment_char='',
escape_char='\\',
double_quote=True,
qu... | [
"def",
"_read_csv_impl",
"(",
"cls",
",",
"url",
",",
"delimiter",
"=",
"','",
",",
"header",
"=",
"True",
",",
"error_bad_lines",
"=",
"False",
",",
"comment_char",
"=",
"''",
",",
"escape_char",
"=",
"'\\\\'",
",",
"double_quote",
"=",
"True",
",",
"qu... | Constructs an SFrame from a CSV file or a path to multiple CSVs, and
returns a pair containing the SFrame and optionally
(if store_errors=True) a dict of filenames to SArrays
indicating for each file, what are the incorrectly parsed lines
encountered.
Parameters
--------... | [
"Constructs",
"an",
"SFrame",
"from",
"a",
"CSV",
"file",
"or",
"a",
"path",
"to",
"multiple",
"CSVs",
"and",
"returns",
"a",
"pair",
"containing",
"the",
"SFrame",
"and",
"optionally",
"(",
"if",
"store_errors",
"=",
"True",
")",
"a",
"dict",
"of",
"fil... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L866-L1063 | train | Read a CSV file or path to multiple CSVs and return a SFrame containing the SFrame and SArrays that are returned. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.read_csv_with_errors | def read_csv_with_errors(cls,
url,
delimiter=',',
header=True,
comment_char='',
escape_char='\\',
double_quote=True,
... | python | def read_csv_with_errors(cls,
url,
delimiter=',',
header=True,
comment_char='',
escape_char='\\',
double_quote=True,
... | [
"def",
"read_csv_with_errors",
"(",
"cls",
",",
"url",
",",
"delimiter",
"=",
"','",
",",
"header",
"=",
"True",
",",
"comment_char",
"=",
"''",
",",
"escape_char",
"=",
"'\\\\'",
",",
"double_quote",
"=",
"True",
",",
"quote_char",
"=",
"'\\\"'",
",",
"... | Constructs an SFrame from a CSV file or a path to multiple CSVs, and
returns a pair containing the SFrame and a dict of filenames to SArrays
indicating for each file, what are the incorrectly parsed lines
encountered.
Parameters
----------
url : string
Locati... | [
"Constructs",
"an",
"SFrame",
"from",
"a",
"CSV",
"file",
"or",
"a",
"path",
"to",
"multiple",
"CSVs",
"and",
"returns",
"a",
"pair",
"containing",
"the",
"SFrame",
"and",
"a",
"dict",
"of",
"filenames",
"to",
"SArrays",
"indicating",
"for",
"each",
"file"... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L1066-L1228 | train | Reads a CSV file or directory and returns a SFrame containing the contents of the file and a dict of filenames to SArrays containing the values of each file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.read_json | def read_json(cls,
url,
orient='records'):
"""
Reads a JSON file representing a table into an SFrame.
Parameters
----------
url : string
Location of the CSV file or directory to load. If URL is a directory
or a "glob" p... | python | def read_json(cls,
url,
orient='records'):
"""
Reads a JSON file representing a table into an SFrame.
Parameters
----------
url : string
Location of the CSV file or directory to load. If URL is a directory
or a "glob" p... | [
"def",
"read_json",
"(",
"cls",
",",
"url",
",",
"orient",
"=",
"'records'",
")",
":",
"if",
"orient",
"==",
"\"records\"",
":",
"g",
"=",
"SArray",
".",
"read_json",
"(",
"url",
")",
"if",
"len",
"(",
"g",
")",
"==",
"0",
":",
"return",
"SFrame",
... | Reads a JSON file representing a table into an SFrame.
Parameters
----------
url : string
Location of the CSV file or directory to load. If URL is a directory
or a "glob" pattern, all matching files will be loaded.
orient : string, optional. Either "records" or ... | [
"Reads",
"a",
"JSON",
"file",
"representing",
"a",
"table",
"into",
"an",
"SFrame",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L1516-L1619 | train | Reads a JSON file representing a table into an SFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.from_sql | def from_sql(cls, conn, sql_statement, params=None, type_inference_rows=100,
dbapi_module=None, column_type_hints=None, cursor_arraysize=128):
"""
Convert the result of a SQL database query to an SFrame.
Parameters
----------
conn : dbapi2.Connection
A DBAPI2 c... | python | def from_sql(cls, conn, sql_statement, params=None, type_inference_rows=100,
dbapi_module=None, column_type_hints=None, cursor_arraysize=128):
"""
Convert the result of a SQL database query to an SFrame.
Parameters
----------
conn : dbapi2.Connection
A DBAPI2 c... | [
"def",
"from_sql",
"(",
"cls",
",",
"conn",
",",
"sql_statement",
",",
"params",
"=",
"None",
",",
"type_inference_rows",
"=",
"100",
",",
"dbapi_module",
"=",
"None",
",",
"column_type_hints",
"=",
"None",
",",
"cursor_arraysize",
"=",
"128",
")",
":",
"#... | Convert the result of a SQL database query to an SFrame.
Parameters
----------
conn : dbapi2.Connection
A DBAPI2 connection object. Any connection object originating from
the 'connect' method of a DBAPI2-compliant package can be used.
sql_statement : str
T... | [
"Convert",
"the",
"result",
"of",
"a",
"SQL",
"database",
"query",
"to",
"an",
"SFrame",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L1623-L1843 | train | Convert the result of a SQL database query to an SFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.to_sql | def to_sql(self, conn, table_name, dbapi_module=None,
use_python_type_specifiers=False, use_exact_column_names=True):
"""
Convert an SFrame to a single table in a SQL database.
This function does not attempt to create the table or check if a table
named `table_name` exists i... | python | def to_sql(self, conn, table_name, dbapi_module=None,
use_python_type_specifiers=False, use_exact_column_names=True):
"""
Convert an SFrame to a single table in a SQL database.
This function does not attempt to create the table or check if a table
named `table_name` exists i... | [
"def",
"to_sql",
"(",
"self",
",",
"conn",
",",
"table_name",
",",
"dbapi_module",
"=",
"None",
",",
"use_python_type_specifiers",
"=",
"False",
",",
"use_exact_column_names",
"=",
"True",
")",
":",
"mod_info",
"=",
"_get_global_dbapi_info",
"(",
"dbapi_module",
... | Convert an SFrame to a single table in a SQL database.
This function does not attempt to create the table or check if a table
named `table_name` exists in the database. It simply assumes that
`table_name` exists in the database and appends to it.
`to_sql` can be thought of as a conveni... | [
"Convert",
"an",
"SFrame",
"to",
"a",
"single",
"table",
"in",
"a",
"SQL",
"database",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L1845-L1942 | train | Convert an SFrame to a SQL table in a SQL database. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.print_rows | def print_rows(self, num_rows=10, num_columns=40, max_column_width=30,
max_row_width=80, output_file=None):
"""
Print the first M rows and N columns of the SFrame in human readable
format.
Parameters
----------
num_rows : int, optional
Numb... | python | def print_rows(self, num_rows=10, num_columns=40, max_column_width=30,
max_row_width=80, output_file=None):
"""
Print the first M rows and N columns of the SFrame in human readable
format.
Parameters
----------
num_rows : int, optional
Numb... | [
"def",
"print_rows",
"(",
"self",
",",
"num_rows",
"=",
"10",
",",
"num_columns",
"=",
"40",
",",
"max_column_width",
"=",
"30",
",",
"max_row_width",
"=",
"80",
",",
"output_file",
"=",
"None",
")",
":",
"if",
"output_file",
"is",
"None",
":",
"output_f... | Print the first M rows and N columns of the SFrame in human readable
format.
Parameters
----------
num_rows : int, optional
Number of rows to print.
num_columns : int, optional
Number of columns to print.
max_column_width : int, optional
... | [
"Print",
"the",
"first",
"M",
"rows",
"and",
"N",
"columns",
"of",
"the",
"SFrame",
"in",
"human",
"readable",
"format",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2117-L2160 | train | Print the first M and N columns of the SFrame in human readable format. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame._row_selector | def _row_selector(self, other):
"""
Where other is an SArray of identical length as the current Frame,
this returns a selection of a subset of rows in the current SFrame
where the corresponding row in the selector is non-zero.
"""
if type(other) is SArray:
if ... | python | def _row_selector(self, other):
"""
Where other is an SArray of identical length as the current Frame,
this returns a selection of a subset of rows in the current SFrame
where the corresponding row in the selector is non-zero.
"""
if type(other) is SArray:
if ... | [
"def",
"_row_selector",
"(",
"self",
",",
"other",
")",
":",
"if",
"type",
"(",
"other",
")",
"is",
"SArray",
":",
"if",
"self",
".",
"__has_size__",
"(",
")",
"and",
"other",
".",
"__has_size__",
"(",
")",
"and",
"len",
"(",
"other",
")",
"!=",
"l... | Where other is an SArray of identical length as the current Frame,
this returns a selection of a subset of rows in the current SFrame
where the corresponding row in the selector is non-zero. | [
"Where",
"other",
"is",
"an",
"SArray",
"of",
"identical",
"length",
"as",
"the",
"current",
"Frame",
"this",
"returns",
"a",
"selection",
"of",
"a",
"subset",
"of",
"rows",
"in",
"the",
"current",
"SFrame",
"where",
"the",
"corresponding",
"row",
"in",
"t... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2268-L2278 | train | Return a selection of rows in the current SFrame with rows in the other SFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.to_dataframe | def to_dataframe(self):
"""
Convert this SFrame to pandas.DataFrame.
This operation will construct a pandas.DataFrame in memory. Care must
be taken when size of the returned object is big.
Returns
-------
out : pandas.DataFrame
The dataframe which co... | python | def to_dataframe(self):
"""
Convert this SFrame to pandas.DataFrame.
This operation will construct a pandas.DataFrame in memory. Care must
be taken when size of the returned object is big.
Returns
-------
out : pandas.DataFrame
The dataframe which co... | [
"def",
"to_dataframe",
"(",
"self",
")",
":",
"assert",
"HAS_PANDAS",
",",
"'pandas is not installed.'",
"df",
"=",
"pandas",
".",
"DataFrame",
"(",
")",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"num_columns",
"(",
")",
")",
":",
"column_name",
"=",
... | Convert this SFrame to pandas.DataFrame.
This operation will construct a pandas.DataFrame in memory. Care must
be taken when size of the returned object is big.
Returns
-------
out : pandas.DataFrame
The dataframe which contains all rows of SFrame | [
"Convert",
"this",
"SFrame",
"to",
"pandas",
".",
"DataFrame",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2376-L2395 | train | Convert this SFrame to pandas. DataFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.to_numpy | def to_numpy(self):
"""
Converts this SFrame to a numpy array
This operation will construct a numpy array in memory. Care must
be taken when size of the returned object is big.
Returns
-------
out : numpy.ndarray
A Numpy Array containing all the valu... | python | def to_numpy(self):
"""
Converts this SFrame to a numpy array
This operation will construct a numpy array in memory. Care must
be taken when size of the returned object is big.
Returns
-------
out : numpy.ndarray
A Numpy Array containing all the valu... | [
"def",
"to_numpy",
"(",
"self",
")",
":",
"assert",
"HAS_NUMPY",
",",
"'numpy is not installed.'",
"import",
"numpy",
"return",
"numpy",
".",
"transpose",
"(",
"numpy",
".",
"asarray",
"(",
"[",
"self",
"[",
"x",
"]",
"for",
"x",
"in",
"self",
".",
"colu... | Converts this SFrame to a numpy array
This operation will construct a numpy array in memory. Care must
be taken when size of the returned object is big.
Returns
-------
out : numpy.ndarray
A Numpy Array containing all the values of the SFrame | [
"Converts",
"this",
"SFrame",
"to",
"a",
"numpy",
"array"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2397-L2412 | train | Converts this SFrame to a NumPy array. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.flat_map | def flat_map(self, column_names, fn, column_types='auto', seed=None):
"""
Map each row of the SFrame to multiple rows in a new SFrame via a
function.
The output of `fn` must have type List[List[...]]. Each inner list
will be a single row in the new output, and the collection of... | python | def flat_map(self, column_names, fn, column_types='auto', seed=None):
"""
Map each row of the SFrame to multiple rows in a new SFrame via a
function.
The output of `fn` must have type List[List[...]]. Each inner list
will be a single row in the new output, and the collection of... | [
"def",
"flat_map",
"(",
"self",
",",
"column_names",
",",
"fn",
",",
"column_types",
"=",
"'auto'",
",",
"seed",
"=",
"None",
")",
":",
"assert",
"callable",
"(",
"fn",
")",
",",
"\"Input must be callable\"",
"if",
"seed",
"is",
"None",
":",
"seed",
"=",... | Map each row of the SFrame to multiple rows in a new SFrame via a
function.
The output of `fn` must have type List[List[...]]. Each inner list
will be a single row in the new output, and the collection of these
rows within the outer list make up the data for the output SFrame.
... | [
"Map",
"each",
"row",
"of",
"the",
"SFrame",
"to",
"multiple",
"rows",
"in",
"a",
"new",
"SFrame",
"via",
"a",
"function",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2502-L2599 | train | This function maps each row of the SFrame to multiple rows in a new SFrame and returns a new SFrame containing the results of the function fn applied to each of the columns in column_names. The function fn must return a list of lists. The output of fn must have the same length and order as the input SFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.sample | def sample(self, fraction, seed=None, exact=False):
"""
Sample a fraction of the current SFrame's rows.
Parameters
----------
fraction : float
Fraction of the rows to fetch. Must be between 0 and 1.
if exact is False (default), the number of rows returned... | python | def sample(self, fraction, seed=None, exact=False):
"""
Sample a fraction of the current SFrame's rows.
Parameters
----------
fraction : float
Fraction of the rows to fetch. Must be between 0 and 1.
if exact is False (default), the number of rows returned... | [
"def",
"sample",
"(",
"self",
",",
"fraction",
",",
"seed",
"=",
"None",
",",
"exact",
"=",
"False",
")",
":",
"if",
"seed",
"is",
"None",
":",
"seed",
"=",
"abs",
"(",
"hash",
"(",
"\"%0.20f\"",
"%",
"time",
".",
"time",
"(",
")",
")",
")",
"%... | Sample a fraction of the current SFrame's rows.
Parameters
----------
fraction : float
Fraction of the rows to fetch. Must be between 0 and 1.
if exact is False (default), the number of rows returned is
approximately the fraction times the number of rows.
... | [
"Sample",
"a",
"fraction",
"of",
"the",
"current",
"SFrame",
"s",
"rows",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2601-L2648 | train | Return a new SFrame containing the rows sampled by the specified fraction of the current SFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.random_split | def random_split(self, fraction, seed=None, exact=False):
"""
Randomly split the rows of an SFrame into two SFrames. The first SFrame
contains *M* rows, sampled uniformly (without replacement) from the
original SFrame. *M* is approximately the fraction times the original
number o... | python | def random_split(self, fraction, seed=None, exact=False):
"""
Randomly split the rows of an SFrame into two SFrames. The first SFrame
contains *M* rows, sampled uniformly (without replacement) from the
original SFrame. *M* is approximately the fraction times the original
number o... | [
"def",
"random_split",
"(",
"self",
",",
"fraction",
",",
"seed",
"=",
"None",
",",
"exact",
"=",
"False",
")",
":",
"if",
"(",
"fraction",
">",
"1",
"or",
"fraction",
"<",
"0",
")",
":",
"raise",
"ValueError",
"(",
"'Invalid sampling rate: '",
"+",
"s... | Randomly split the rows of an SFrame into two SFrames. The first SFrame
contains *M* rows, sampled uniformly (without replacement) from the
original SFrame. *M* is approximately the fraction times the original
number of rows. The second SFrame contains the remaining rows of the
original ... | [
"Randomly",
"split",
"the",
"rows",
"of",
"an",
"SFrame",
"into",
"two",
"SFrames",
".",
"The",
"first",
"SFrame",
"contains",
"*",
"M",
"*",
"rows",
"sampled",
"uniformly",
"(",
"without",
"replacement",
")",
"from",
"the",
"original",
"SFrame",
".",
"*",... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2650-L2708 | train | Randomly split the rows of an SFrame into two SFrames. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.topk | def topk(self, column_name, k=10, reverse=False):
"""
Get top k rows according to the given column. Result is according to and
sorted by `column_name` in the given order (default is descending).
When `k` is small, `topk` is more efficient than `sort`.
Parameters
--------... | python | def topk(self, column_name, k=10, reverse=False):
"""
Get top k rows according to the given column. Result is according to and
sorted by `column_name` in the given order (default is descending).
When `k` is small, `topk` is more efficient than `sort`.
Parameters
--------... | [
"def",
"topk",
"(",
"self",
",",
"column_name",
",",
"k",
"=",
"10",
",",
"reverse",
"=",
"False",
")",
":",
"if",
"type",
"(",
"column_name",
")",
"is",
"not",
"str",
":",
"raise",
"TypeError",
"(",
"\"column_name must be a string\"",
")",
"sf",
"=",
... | Get top k rows according to the given column. Result is according to and
sorted by `column_name` in the given order (default is descending).
When `k` is small, `topk` is more efficient than `sort`.
Parameters
----------
column_name : string
The column to sort on
... | [
"Get",
"top",
"k",
"rows",
"according",
"to",
"the",
"given",
"column",
".",
"Result",
"is",
"according",
"to",
"and",
"sorted",
"by",
"column_name",
"in",
"the",
"given",
"order",
"(",
"default",
"is",
"descending",
")",
".",
"When",
"k",
"is",
"small",... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2710-L2766 | train | Return the top k rows according to the given column. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.save | def save(self, filename, format=None):
"""
Save the SFrame to a file system for later use.
Parameters
----------
filename : string
The location to save the SFrame. Either a local directory or a
remote URL. If the format is 'binary', a directory will be cr... | python | def save(self, filename, format=None):
"""
Save the SFrame to a file system for later use.
Parameters
----------
filename : string
The location to save the SFrame. Either a local directory or a
remote URL. If the format is 'binary', a directory will be cr... | [
"def",
"save",
"(",
"self",
",",
"filename",
",",
"format",
"=",
"None",
")",
":",
"if",
"format",
"is",
"None",
":",
"if",
"filename",
".",
"endswith",
"(",
"(",
"'.csv'",
",",
"'.csv.gz'",
")",
")",
":",
"format",
"=",
"'csv'",
"elif",
"filename",
... | Save the SFrame to a file system for later use.
Parameters
----------
filename : string
The location to save the SFrame. Either a local directory or a
remote URL. If the format is 'binary', a directory will be created
at the location which will contain the sf... | [
"Save",
"the",
"SFrame",
"to",
"a",
"file",
"system",
"for",
"later",
"use",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2768-L2826 | train | Save the SFrame to a file system for later use. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.export_csv | def export_csv(self, filename, delimiter=',', line_terminator='\n',
header=True, quote_level=csv.QUOTE_NONNUMERIC, double_quote=True,
escape_char='\\', quote_char='\"', na_rep='',
file_header='', file_footer='', line_prefix='',
_no_prefix_on_first_value=False, **kwargs):
... | python | def export_csv(self, filename, delimiter=',', line_terminator='\n',
header=True, quote_level=csv.QUOTE_NONNUMERIC, double_quote=True,
escape_char='\\', quote_char='\"', na_rep='',
file_header='', file_footer='', line_prefix='',
_no_prefix_on_first_value=False, **kwargs):
... | [
"def",
"export_csv",
"(",
"self",
",",
"filename",
",",
"delimiter",
"=",
"','",
",",
"line_terminator",
"=",
"'\\n'",
",",
"header",
"=",
"True",
",",
"quote_level",
"=",
"csv",
".",
"QUOTE_NONNUMERIC",
",",
"double_quote",
"=",
"True",
",",
"escape_char",
... | Writes an SFrame to a CSV file.
Parameters
----------
filename : string
The location to save the CSV.
delimiter : string, optional
This describes the delimiter used for writing csv files.
line_terminator: string, optional
The newline charact... | [
"Writes",
"an",
"SFrame",
"to",
"a",
"CSV",
"file",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2828-L2917 | train | Writes an SFrame to a CSV file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.export_json | def export_json(self,
filename,
orient='records'):
"""
Writes an SFrame to a JSON file.
Parameters
----------
filename : string
The location to save the JSON file.
orient : string, optional. Either "records" or "lines"... | python | def export_json(self,
filename,
orient='records'):
"""
Writes an SFrame to a JSON file.
Parameters
----------
filename : string
The location to save the JSON file.
orient : string, optional. Either "records" or "lines"... | [
"def",
"export_json",
"(",
"self",
",",
"filename",
",",
"orient",
"=",
"'records'",
")",
":",
"if",
"orient",
"==",
"\"records\"",
":",
"self",
".",
"pack_columns",
"(",
"dtype",
"=",
"dict",
")",
".",
"export_csv",
"(",
"filename",
",",
"file_header",
... | Writes an SFrame to a JSON file.
Parameters
----------
filename : string
The location to save the JSON file.
orient : string, optional. Either "records" or "lines"
If orient="records" the file is saved as a single JSON array.
If orient="lines", the f... | [
"Writes",
"an",
"SFrame",
"to",
"a",
"JSON",
"file",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2919-L2996 | train | Writes an SFrame to a JSON file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame._save_reference | def _save_reference(self, filename):
"""
Performs an incomplete save of an existing SFrame into a directory.
This saved SFrame may reference SFrames in other locations in the same
filesystem for certain resources.
Parameters
----------
filename : string
... | python | def _save_reference(self, filename):
"""
Performs an incomplete save of an existing SFrame into a directory.
This saved SFrame may reference SFrames in other locations in the same
filesystem for certain resources.
Parameters
----------
filename : string
... | [
"def",
"_save_reference",
"(",
"self",
",",
"filename",
")",
":",
"## Save the SFrame",
"url",
"=",
"_make_internal_url",
"(",
"filename",
")",
"with",
"cython_context",
"(",
")",
":",
"self",
".",
"__proxy__",
".",
"save_reference",
"(",
"url",
")"
] | Performs an incomplete save of an existing SFrame into a directory.
This saved SFrame may reference SFrames in other locations in the same
filesystem for certain resources.
Parameters
----------
filename : string
The location to save the SFrame. Either a local direct... | [
"Performs",
"an",
"incomplete",
"save",
"of",
"an",
"existing",
"SFrame",
"into",
"a",
"directory",
".",
"This",
"saved",
"SFrame",
"may",
"reference",
"SFrames",
"in",
"other",
"locations",
"in",
"the",
"same",
"filesystem",
"for",
"certain",
"resources",
"."... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2998-L3023 | train | Save an existing SFrame into a directory. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.select_column | def select_column(self, column_name):
"""
Get a reference to the :class:`~turicreate.SArray` that corresponds with
the given column_name. Throws an exception if the column_name is
something other than a string or if the column name is not found.
Parameters
----------
... | python | def select_column(self, column_name):
"""
Get a reference to the :class:`~turicreate.SArray` that corresponds with
the given column_name. Throws an exception if the column_name is
something other than a string or if the column name is not found.
Parameters
----------
... | [
"def",
"select_column",
"(",
"self",
",",
"column_name",
")",
":",
"if",
"not",
"isinstance",
"(",
"column_name",
",",
"str",
")",
":",
"raise",
"TypeError",
"(",
"\"Invalid column_nametype: must be str\"",
")",
"with",
"cython_context",
"(",
")",
":",
"return",... | Get a reference to the :class:`~turicreate.SArray` that corresponds with
the given column_name. Throws an exception if the column_name is
something other than a string or if the column name is not found.
Parameters
----------
column_name: str
The column name.
... | [
"Get",
"a",
"reference",
"to",
"the",
":",
"class",
":",
"~turicreate",
".",
"SArray",
"that",
"corresponds",
"with",
"the",
"given",
"column_name",
".",
"Throws",
"an",
"exception",
"if",
"the",
"column_name",
"is",
"something",
"other",
"than",
"a",
"strin... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3026-L3060 | train | Returns a reference to the SArray that corresponds with the given column_name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.add_column | def add_column(self, data, column_name="", inplace=False):
"""
Returns an SFrame with a new column. The number of elements in the data
given must match the length of every other column of the SFrame.
If no name is given, a default name is chosen.
If inplace == False (default) th... | python | def add_column(self, data, column_name="", inplace=False):
"""
Returns an SFrame with a new column. The number of elements in the data
given must match the length of every other column of the SFrame.
If no name is given, a default name is chosen.
If inplace == False (default) th... | [
"def",
"add_column",
"(",
"self",
",",
"data",
",",
"column_name",
"=",
"\"\"",
",",
"inplace",
"=",
"False",
")",
":",
"# Check type for pandas dataframe or SArray?",
"if",
"not",
"isinstance",
"(",
"data",
",",
"SArray",
")",
":",
"if",
"isinstance",
"(",
... | Returns an SFrame with a new column. The number of elements in the data
given must match the length of every other column of the SFrame.
If no name is given, a default name is chosen.
If inplace == False (default) this operation does not modify the
current SFrame, returning a new SFrame... | [
"Returns",
"an",
"SFrame",
"with",
"a",
"new",
"column",
".",
"The",
"number",
"of",
"elements",
"in",
"the",
"data",
"given",
"must",
"match",
"the",
"length",
"of",
"every",
"other",
"column",
"of",
"the",
"SFrame",
".",
"If",
"no",
"name",
"is",
"gi... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3139-L3212 | train | Add a column to the current SFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.add_columns | def add_columns(self, data, column_names=None, inplace=False):
"""
Returns an SFrame with multiple columns added. The number of
elements in all columns must match the length of every other column of
the SFrame.
If inplace == False (default) this operation does not modify the
... | python | def add_columns(self, data, column_names=None, inplace=False):
"""
Returns an SFrame with multiple columns added. The number of
elements in all columns must match the length of every other column of
the SFrame.
If inplace == False (default) this operation does not modify the
... | [
"def",
"add_columns",
"(",
"self",
",",
"data",
",",
"column_names",
"=",
"None",
",",
"inplace",
"=",
"False",
")",
":",
"datalist",
"=",
"data",
"if",
"isinstance",
"(",
"data",
",",
"SFrame",
")",
":",
"other",
"=",
"data",
"datalist",
"=",
"[",
"... | Returns an SFrame with multiple columns added. The number of
elements in all columns must match the length of every other column of
the SFrame.
If inplace == False (default) this operation does not modify the
current SFrame, returning a new SFrame.
If inplace == True, this oper... | [
"Returns",
"an",
"SFrame",
"with",
"multiple",
"columns",
"added",
".",
"The",
"number",
"of",
"elements",
"in",
"all",
"columns",
"must",
"match",
"the",
"length",
"of",
"every",
"other",
"column",
"of",
"the",
"SFrame",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3214-L3293 | train | Add columns to the current SFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.remove_column | def remove_column(self, column_name, inplace=False):
"""
Returns an SFrame with a column removed.
If inplace == False (default) this operation does not modify the
current SFrame, returning a new SFrame.
If inplace == True, this operation modifies the current
SFrame, ret... | python | def remove_column(self, column_name, inplace=False):
"""
Returns an SFrame with a column removed.
If inplace == False (default) this operation does not modify the
current SFrame, returning a new SFrame.
If inplace == True, this operation modifies the current
SFrame, ret... | [
"def",
"remove_column",
"(",
"self",
",",
"column_name",
",",
"inplace",
"=",
"False",
")",
":",
"column_name",
"=",
"str",
"(",
"column_name",
")",
"if",
"column_name",
"not",
"in",
"self",
".",
"column_names",
"(",
")",
":",
"raise",
"KeyError",
"(",
"... | Returns an SFrame with a column removed.
If inplace == False (default) this operation does not modify the
current SFrame, returning a new SFrame.
If inplace == True, this operation modifies the current
SFrame, returning self.
Parameters
----------
column_name :... | [
"Returns",
"an",
"SFrame",
"with",
"a",
"column",
"removed",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3295-L3347 | train | Returns an SFrame with a column removed. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.remove_columns | def remove_columns(self, column_names, inplace=False):
"""
Returns an SFrame with one or more columns removed.
If inplace == False (default) this operation does not modify the
current SFrame, returning a new SFrame.
If inplace == True, this operation modifies the current
... | python | def remove_columns(self, column_names, inplace=False):
"""
Returns an SFrame with one or more columns removed.
If inplace == False (default) this operation does not modify the
current SFrame, returning a new SFrame.
If inplace == True, this operation modifies the current
... | [
"def",
"remove_columns",
"(",
"self",
",",
"column_names",
",",
"inplace",
"=",
"False",
")",
":",
"column_names",
"=",
"list",
"(",
"column_names",
")",
"existing_columns",
"=",
"dict",
"(",
"(",
"k",
",",
"i",
")",
"for",
"i",
",",
"k",
"in",
"enumer... | Returns an SFrame with one or more columns removed.
If inplace == False (default) this operation does not modify the
current SFrame, returning a new SFrame.
If inplace == True, this operation modifies the current
SFrame, returning self.
Parameters
----------
co... | [
"Returns",
"an",
"SFrame",
"with",
"one",
"or",
"more",
"columns",
"removed",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3349-L3406 | train | Returns an SFrame with one or more columns removed. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.swap_columns | def swap_columns(self, column_name_1, column_name_2, inplace=False):
"""
Returns an SFrame with two column positions swapped.
If inplace == False (default) this operation does not modify the
current SFrame, returning a new SFrame.
If inplace == True, this operation modifies the... | python | def swap_columns(self, column_name_1, column_name_2, inplace=False):
"""
Returns an SFrame with two column positions swapped.
If inplace == False (default) this operation does not modify the
current SFrame, returning a new SFrame.
If inplace == True, this operation modifies the... | [
"def",
"swap_columns",
"(",
"self",
",",
"column_name_1",
",",
"column_name_2",
",",
"inplace",
"=",
"False",
")",
":",
"colnames",
"=",
"self",
".",
"column_names",
"(",
")",
"colid_1",
"=",
"colnames",
".",
"index",
"(",
"column_name_1",
")",
"colid_2",
... | Returns an SFrame with two column positions swapped.
If inplace == False (default) this operation does not modify the
current SFrame, returning a new SFrame.
If inplace == True, this operation modifies the current
SFrame, returning self.
Parameters
----------
c... | [
"Returns",
"an",
"SFrame",
"with",
"two",
"column",
"positions",
"swapped",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3409-L3462 | train | Returns an SFrame with two column positions swapped. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.rename | def rename(self, names, inplace=False):
"""
Returns an SFrame with columns renamed. ``names`` is expected to be a
dict specifying the old and new names. This changes the names of the
columns given as the keys and replaces them with the names given as the
values.
If inpla... | python | def rename(self, names, inplace=False):
"""
Returns an SFrame with columns renamed. ``names`` is expected to be a
dict specifying the old and new names. This changes the names of the
columns given as the keys and replaces them with the names given as the
values.
If inpla... | [
"def",
"rename",
"(",
"self",
",",
"names",
",",
"inplace",
"=",
"False",
")",
":",
"if",
"(",
"type",
"(",
"names",
")",
"is",
"not",
"dict",
")",
":",
"raise",
"TypeError",
"(",
"'names must be a dictionary: oldname -> newname'",
")",
"all_columns",
"=",
... | Returns an SFrame with columns renamed. ``names`` is expected to be a
dict specifying the old and new names. This changes the names of the
columns given as the keys and replaces them with the names given as the
values.
If inplace == False (default) this operation does not modify the
... | [
"Returns",
"an",
"SFrame",
"with",
"columns",
"renamed",
".",
"names",
"is",
"expected",
"to",
"be",
"a",
"dict",
"specifying",
"the",
"old",
"and",
"new",
"names",
".",
"This",
"changes",
"the",
"names",
"of",
"the",
"columns",
"given",
"as",
"the",
"ke... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3464-L3525 | train | Returns an SFrame with columns renamed. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.append | def append(self, other):
"""
Add the rows of an SFrame to the end of this SFrame.
Both SFrames must have the same set of columns with the same column
names and column types.
Parameters
----------
other : SFrame
Another SFrame whose rows are appended ... | python | def append(self, other):
"""
Add the rows of an SFrame to the end of this SFrame.
Both SFrames must have the same set of columns with the same column
names and column types.
Parameters
----------
other : SFrame
Another SFrame whose rows are appended ... | [
"def",
"append",
"(",
"self",
",",
"other",
")",
":",
"if",
"type",
"(",
"other",
")",
"is",
"not",
"SFrame",
":",
"raise",
"RuntimeError",
"(",
"\"SFrame append can only work with SFrame\"",
")",
"left_empty",
"=",
"len",
"(",
"self",
".",
"column_names",
"... | Add the rows of an SFrame to the end of this SFrame.
Both SFrames must have the same set of columns with the same column
names and column types.
Parameters
----------
other : SFrame
Another SFrame whose rows are appended to the current SFrame.
Returns
... | [
"Add",
"the",
"rows",
"of",
"an",
"SFrame",
"to",
"the",
"end",
"of",
"this",
"SFrame",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3737-L3816 | train | Append the rows of an SFrame to the end of this SFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.