partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
SoundClassifier.predict
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 ...
src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py
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): """ Return predictions for ``dataset``. Predictions can be generated as class labels or probabilities. Parameters ---------- dataset : SFrame | SArray | dict The audio data to be cl...
[ "Return", "predictions", "for", "dataset", ".", "Predictions", "can", "be", "generated", "as", "class", "labels", "or", "probabilities", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py#L723-L851
[ "def", "predict", "(", "self", ",", "dataset", ",", "output_type", "=", "'class'", ",", "verbose", "=", "True", ",", "batch_size", "=", "64", ")", ":", "from", ".", ".", "_mxnet", "import", "_mxnet_utils", "import", "mxnet", "as", "mx", "if", "not", "i...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SoundClassifier.predict_topk
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...
src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py
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): """ 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...
[ "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...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py#L853-L932
[ "def", "predict_topk", "(", "self", ",", "dataset", ",", "output_type", "=", "'probability'", ",", "k", "=", "3", ",", "verbose", "=", "True", ",", "batch_size", "=", "64", ")", ":", "prob_vector", "=", "self", ".", "predict", "(", "dataset", ",", "out...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
_init_data
Convert data into canonical form.
src/unity/python/turicreate/toolkits/_mxnet/_mx_sframe_iter.py
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): """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...
[ "Convert", "data", "into", "canonical", "form", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_mxnet/_mx_sframe_iter.py#L37-L62
[ "def", "_init_data", "(", "data", ",", "allow_empty", ",", "default_name", ")", ":", "assert", "(", "data", "is", "not", "None", ")", "or", "allow_empty", "if", "data", "is", "None", ":", "data", "=", "[", "]", "if", "isinstance", "(", "data", ",", "...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrameIter.provide_data
The name and shape of data provided by this iterator
src/unity/python/turicreate/toolkits/_mxnet/_mx_sframe_iter.py
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): """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]
[ "The", "name", "and", "shape", "of", "data", "provided", "by", "this", "iterator" ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_mxnet/_mx_sframe_iter.py#L134-L136
[ "def", "provide_data", "(", "self", ")", ":", "return", "[", "(", "k", ",", "tuple", "(", "[", "self", ".", "batch_size", "]", "+", "list", "(", "v", ".", "shape", "[", "1", ":", "]", ")", ")", ")", "for", "k", ",", "v", "in", "self", ".", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrameIter.provide_label
The name and shape of label provided by this iterator
src/unity/python/turicreate/toolkits/_mxnet/_mx_sframe_iter.py
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): """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]
[ "The", "name", "and", "shape", "of", "label", "provided", "by", "this", "iterator" ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_mxnet/_mx_sframe_iter.py#L139-L141
[ "def", "provide_label", "(", "self", ")", ":", "return", "[", "(", "k", ",", "tuple", "(", "[", "self", ".", "batch_size", "]", "+", "list", "(", "v", ".", "shape", "[", "1", ":", "]", ")", ")", ")", "for", "k", ",", "v", "in", "self", ".", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
reset
Clear the module state. This is mainly for testing purposes.
deps/src/boost_1_68_0/tools/build/src/build/generators.py
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 (): """ 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...
[ "Clear", "the", "module", "state", ".", "This", "is", "mainly", "for", "testing", "purposes", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L65-L85
[ "def", "reset", "(", ")", ":", "global", "__generators", ",", "__type_to_generators", ",", "__generators_for_toolset", ",", "__construct_stack", "global", "__overrides", ",", "__active_generators", "global", "__viable_generators_cache", ",", "__viable_source_types_cache", "...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
register
Registers new generator instance 'g'.
deps/src/boost_1_68_0/tools/build/src/build/generators.py
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): """ 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...
[ "Registers", "new", "generator", "instance", "g", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L657-L706
[ "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...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
register_standard
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.
deps/src/boost_1_68_0/tools/build/src/build/generators.py
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 = []): """ 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...
[ "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...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L723-L732
[ "def", "register_standard", "(", "id", ",", "source_types", ",", "target_types", ",", "requirements", "=", "[", "]", ")", ":", "g", "=", "Generator", "(", "id", ",", "False", ",", "source_types", ",", "target_types", ",", "requirements", ")", "register", "...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
override
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 ...
deps/src/boost_1_68_0/tools/build/src/build/generators.py
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): """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...
[ "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...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L747-L760
[ "def", "override", "(", "overrider_id", ",", "overridee_id", ")", ":", "assert", "isinstance", "(", "overrider_id", ",", "basestring", ")", "assert", "isinstance", "(", "overridee_id", ",", "basestring", ")", "__overrides", ".", "setdefault", "(", "overrider_id", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
__viable_source_types_real
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.
deps/src/boost_1_68_0/tools/build/src/build/generators.py
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): """ 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 ...
[ "Returns", "a", "list", "of", "source", "type", "which", "can", "possibly", "be", "converted", "to", "target_type", "by", "some", "chain", "of", "generator", "invocation", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L762-L820
[ "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...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
viable_source_types
Helper rule, caches the result of '__viable_source_types_real'.
deps/src/boost_1_68_0/tools/build/src/build/generators.py
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): """ 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] = ...
[ "Helper", "rule", "caches", "the", "result", "of", "__viable_source_types_real", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L823-L830
[ "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...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
viable_source_types_for_generator_real
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)
deps/src/boost_1_68_0/tools/build/src/build/generators.py
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): """ 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...
[ "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", ")" ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L832-L857
[ "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...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
viable_source_types_for_generator
Caches the result of 'viable_source_types_for_generator'.
deps/src/boost_1_68_0/tools/build/src/build/generators.py
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): """ 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] ...
[ "Caches", "the", "result", "of", "viable_source_types_for_generator", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L859-L867
[ "def", "viable_source_types_for_generator", "(", "generator", ")", ":", "assert", "isinstance", "(", "generator", ",", "Generator", ")", "if", "generator", "not", "in", "__viable_source_types_cache", ":", "__vstg_cached_generators", ".", "append", "(", "generator", ")...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
try_one_generator_really
Returns usage requirements + list of created targets.
deps/src/boost_1_68_0/tools/build/src/build/generators.py
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): """ Returns usage requirements + list of created targets. """ if __debug__: from .targets import ProjectTarget assert isinstance(project, ProjectTarget) assert isinstance(name, basestring) or n...
[ "Returns", "usage", "requirements", "+", "list", "of", "created", "targets", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L869-L907
[ "def", "try_one_generator_really", "(", "project", ",", "name", ",", "generator", ",", "target_type", ",", "properties", ",", "sources", ")", ":", "if", "__debug__", ":", "from", ".", "targets", "import", "ProjectTarget", "assert", "isinstance", "(", "project", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
try_one_generator
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.
deps/src/boost_1_68_0/tools/build/src/build/generators.py
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): """ 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 ...
[ "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", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L909-L940
[ "def", "try_one_generator", "(", "project", ",", "name", ",", "generator", ",", "target_type", ",", "properties", ",", "sources", ")", ":", "if", "__debug__", ":", "from", ".", "targets", "import", "ProjectTarget", "assert", "isinstance", "(", "project", ",", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
__ensure_type
Ensures all 'targets' have types. If this is not so, exists with error.
deps/src/boost_1_68_0/tools/build/src/build/generators.py
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): """ 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))
[ "Ensures", "all", "targets", "have", "types", ".", "If", "this", "is", "not", "so", "exists", "with", "error", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L978-L985
[ "def", "__ensure_type", "(", "targets", ")", ":", "assert", "is_iterable_typed", "(", "targets", ",", "virtual_target", ".", "VirtualTarget", ")", "for", "t", "in", "targets", ":", "if", "not", "t", ".", "type", "(", ")", ":", "get_manager", "(", ")", "....
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
find_viable_generators_aux
Returns generators which can be used to construct target of specified type with specified properties. Uses the following algorithm: - iterates over requested target_type and all it's bases (in the order returned bt type.all-bases. - for each type find all generators that generate that ...
deps/src/boost_1_68_0/tools/build/src/build/generators.py
def find_viable_generators_aux (target_type, prop_set): """ Returns generators which can be used to construct target of specified type with specified properties. Uses the following algorithm: - iterates over requested target_type and all it's bases (in the order returned bt type.all-bases....
def find_viable_generators_aux (target_type, prop_set): """ Returns generators which can be used to construct target of specified type with specified properties. Uses the following algorithm: - iterates over requested target_type and all it's bases (in the order returned bt type.all-bases....
[ "Returns", "generators", "which", "can", "be", "used", "to", "construct", "target", "of", "specified", "type", "with", "specified", "properties", ".", "Uses", "the", "following", "algorithm", ":", "-", "iterates", "over", "requested", "target_type", "and", "all"...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L987-L1045
[ "def", "find_viable_generators_aux", "(", "target_type", ",", "prop_set", ")", ":", "assert", "isinstance", "(", "target_type", ",", "basestring", ")", "assert", "isinstance", "(", "prop_set", ",", "property_set", ".", "PropertySet", ")", "# Select generators that can...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
__construct_really
Attempts to construct target by finding viable generators, running them and selecting the dependency graph.
deps/src/boost_1_68_0/tools/build/src/build/generators.py
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): """ 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) ...
[ "Attempts", "to", "construct", "target", "by", "finding", "viable", "generators", "running", "them", "and", "selecting", "the", "dependency", "graph", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L1091-L1136
[ "def", "__construct_really", "(", "project", ",", "name", ",", "target_type", ",", "prop_set", ",", "sources", ")", ":", "if", "__debug__", ":", "from", ".", "targets", "import", "ProjectTarget", "assert", "isinstance", "(", "project", ",", "ProjectTarget", ")...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
construct
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'. ...
deps/src/boost_1_68_0/tools/build/src/build/generators.py
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): """ 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...
[ "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",...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L1139-L1194
[ "def", "construct", "(", "project", ",", "name", ",", "target_type", ",", "prop_set", ",", "sources", ",", "top_level", "=", "False", ")", ":", "if", "__debug__", ":", "from", ".", "targets", "import", "ProjectTarget", "assert", "isinstance", "(", "project",...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
Generator.clone
Returns another generator which differers from $(self) in - id - value to <toolset> feature in properties
deps/src/boost_1_68_0/tools/build/src/build/generators.py
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): """ 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...
[ "Returns", "another", "generator", "which", "differers", "from", "$", "(", "self", ")", "in", "-", "id", "-", "value", "to", "<toolset", ">", "feature", "in", "properties" ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L238-L251
[ "def", "clone", "(", "self", ",", "new_id", ",", "new_toolset_properties", ")", ":", "assert", "isinstance", "(", "new_id", ",", "basestring", ")", "assert", "is_iterable_typed", "(", "new_toolset_properties", ",", "basestring", ")", "return", "self", ".", "__cl...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
Generator.clone_and_change_target_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.
deps/src/boost_1_68_0/tools/build/src/build/generators.py
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): """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...
[ "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...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L253-L275
[ "def", "clone_and_change_target_type", "(", "self", ",", "base", ",", "type", ")", ":", "assert", "isinstance", "(", "base", ",", "basestring", ")", "assert", "isinstance", "(", "type", ",", "basestring", ")", "target_types", "=", "[", "]", "for", "t", "in...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
Generator.match_rank
Returns true if the generator can be run with the specified properties.
deps/src/boost_1_68_0/tools/build/src/build/generators.py
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): """ 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...
[ "Returns", "true", "if", "the", "generator", "can", "be", "run", "with", "the", "specified", "properties", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L301-L325
[ "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", ",", "...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
Generator.run
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...
deps/src/boost_1_68_0/tools/build/src/build/generators.py
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): """ 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...
[ "Tries", "to", "invoke", "this", "generator", "on", "the", "given", "sources", ".", "Returns", "a", "list", "of", "generated", "targets", "(", "instances", "of", "virtual", "-", "target", ")", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L327-L373
[ "def", "run", "(", "self", ",", "project", ",", "name", ",", "prop_set", ",", "sources", ")", ":", "if", "__debug__", ":", "from", ".", "targets", "import", "ProjectTarget", "assert", "isinstance", "(", "project", ",", "ProjectTarget", ")", "# intermediary t...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
Generator.construct_result
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...
deps/src/boost_1_68_0/tools/build/src/build/generators.py
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): """ 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...
[ "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...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L403-L430
[ "def", "construct_result", "(", "self", ",", "consumed", ",", "project", ",", "name", ",", "prop_set", ")", ":", "if", "__debug__", ":", "from", ".", "targets", "import", "ProjectTarget", "assert", "is_iterable_typed", "(", "consumed", ",", "virtual_target", "...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
Generator.determine_output_name
Determine the name of the produced target from the names of the sources.
deps/src/boost_1_68_0/tools/build/src/build/generators.py
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): """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 ...
[ "Determine", "the", "name", "of", "the", "produced", "target", "from", "the", "names", "of", "the", "sources", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L451-L475
[ "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...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
Generator.generated_targets
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...
deps/src/boost_1_68_0/tools/build/src/build/generators.py
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): """ 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...
[ "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...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L478-L526
[ "def", "generated_targets", "(", "self", ",", "sources", ",", "prop_set", ",", "project", ",", "name", ")", ":", "if", "__debug__", ":", "from", ".", "targets", "import", "ProjectTarget", "assert", "is_iterable_typed", "(", "sources", ",", "virtual_target", "....
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
Generator.convert_to_consumable_types
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...
deps/src/boost_1_68_0/tools/build/src/build/generators.py
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): """ 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...
[ "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", ".", ...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L528-L585
[ "def", "convert_to_consumable_types", "(", "self", ",", "project", ",", "name", ",", "prop_set", ",", "sources", ",", "only_one", "=", "False", ")", ":", "if", "__debug__", ":", "from", ".", "targets", "import", "ProjectTarget", "assert", "isinstance", "(", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
Generator.convert_multiple_sources_to_consumable_types
Converts several files to consumable types.
deps/src/boost_1_68_0/tools/build/src/build/generators.py
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): """ Converts several files to consumable types. """ if __debug__: from .targets import ProjectTarget assert isinstance(project, ProjectTarget) assert isinstance(prop_set, pro...
[ "Converts", "several", "files", "to", "consumable", "types", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L588-L619
[ "def", "convert_multiple_sources_to_consumable_types", "(", "self", ",", "project", ",", "prop_set", ",", "sources", ")", ":", "if", "__debug__", ":", "from", ".", "targets", "import", "ProjectTarget", "assert", "isinstance", "(", "project", ",", "ProjectTarget", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
Sketch.element_sub_sketch
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...
src/unity/python/turicreate/data_structures/sketch.py
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): """ 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...
[ "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", ...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sketch.py#L662-L740
[ "def", "element_sub_sketch", "(", "self", ",", "keys", "=", "None", ")", ":", "single_val", "=", "False", "if", "keys", "is", "None", ":", "keys", "=", "[", "]", "else", ":", "if", "not", "isinstance", "(", "keys", ",", "list", ")", ":", "single_val"...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
convert
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 ...
src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_NuSVC.py
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): """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...
[ "Convert", "a", "Nu", "-", "Support", "Vector", "Classification", "(", "NuSVC", ")", "model", "to", "the", "protobuf", "spec", ".", "Parameters", "----------", "model", ":", "NuSVC", "A", "trained", "NuSVC", "encoder", "model", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_NuSVC.py#L18-L41
[ "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...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
convert
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...
src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_linear_regression.py
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): """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...
[ "Convert", "a", "linear", "regression", "model", "to", "the", "protobuf", "spec", ".", "Parameters", "----------", "model", ":", "LinearRegression", "A", "trained", "linear", "regression", "encoder", "model", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_linear_regression.py#L23-L49
[ "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"...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
_get_global_dbapi_info
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.
src/unity/python/turicreate/data_structures/sframe.py
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): """ 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...
[ "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",...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L86-L144
[ "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 (...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame._read_csv_impl
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 --------...
src/unity/python/turicreate/data_structures/sframe.py
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", "fil...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L866-L1063
[ "def", "_read_csv_impl", "(", "cls", ",", "url", ",", "delimiter", "=", "','", ",", "header", "=", "True", ",", "error_bad_lines", "=", "False", ",", "comment_char", "=", "''", ",", "escape_char", "=", "'\\\\'", ",", "double_quote", "=", "True", ",", "qu...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.read_csv_with_errors
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...
src/unity/python/turicreate/data_structures/sframe.py
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, ...
[ "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"...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L1066-L1228
[ "def", "read_csv_with_errors", "(", "cls", ",", "url", ",", "delimiter", "=", "','", ",", "header", "=", "True", ",", "comment_char", "=", "''", ",", "escape_char", "=", "'\\\\'", ",", "double_quote", "=", "True", ",", "quote_char", "=", "'\\\"'", ",", "...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.read_json
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 ...
src/unity/python/turicreate/data_structures/sframe.py
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'): """ 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...
[ "Reads", "a", "JSON", "file", "representing", "a", "table", "into", "an", "SFrame", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L1516-L1619
[ "def", "read_json", "(", "cls", ",", "url", ",", "orient", "=", "'records'", ")", ":", "if", "orient", "==", "\"records\"", ":", "g", "=", "SArray", ".", "read_json", "(", "url", ")", "if", "len", "(", "g", ")", "==", "0", ":", "return", "SFrame", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.from_sql
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...
src/unity/python/turicreate/data_structures/sframe.py
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 c...
[ "Convert", "the", "result", "of", "a", "SQL", "database", "query", "to", "an", "SFrame", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L1623-L1843
[ "def", "from_sql", "(", "cls", ",", "conn", ",", "sql_statement", ",", "params", "=", "None", ",", "type_inference_rows", "=", "100", ",", "dbapi_module", "=", "None", ",", "column_type_hints", "=", "None", ",", "cursor_arraysize", "=", "128", ")", ":", "#...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.to_sql
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...
src/unity/python/turicreate/data_structures/sframe.py
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): """ 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...
[ "Convert", "an", "SFrame", "to", "a", "single", "table", "in", "a", "SQL", "database", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L1845-L1942
[ "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", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.print_rows
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 ...
src/unity/python/turicreate/data_structures/sframe.py
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): """ Print the first M rows and N columns of the SFrame in human readable format. Parameters ---------- num_rows : int, optional Numb...
[ "Print", "the", "first", "M", "rows", "and", "N", "columns", "of", "the", "SFrame", "in", "human", "readable", "format", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2117-L2160
[ "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...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame._row_selector
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.
src/unity/python/turicreate/data_structures/sframe.py
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): """ 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 ...
[ "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...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2268-L2278
[ "def", "_row_selector", "(", "self", ",", "other", ")", ":", "if", "type", "(", "other", ")", "is", "SArray", ":", "if", "self", ".", "__has_size__", "(", ")", "and", "other", ".", "__has_size__", "(", ")", "and", "len", "(", "other", ")", "!=", "l...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.to_dataframe
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
src/unity/python/turicreate/data_structures/sframe.py
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): """ 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...
[ "Convert", "this", "SFrame", "to", "pandas", ".", "DataFrame", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2376-L2395
[ "def", "to_dataframe", "(", "self", ")", ":", "assert", "HAS_PANDAS", ",", "'pandas is not installed.'", "df", "=", "pandas", ".", "DataFrame", "(", ")", "for", "i", "in", "range", "(", "self", ".", "num_columns", "(", ")", ")", ":", "column_name", "=", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.to_numpy
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
src/unity/python/turicreate/data_structures/sframe.py
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): """ 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...
[ "Converts", "this", "SFrame", "to", "a", "numpy", "array" ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2397-L2412
[ "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...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.apply
Transform each row to an :class:`~turicreate.SArray` according to a specified function. Returns a new SArray of ``dtype`` where each element in this SArray is transformed by `fn(x)` where `x` is a single row in the sframe represented as a dictionary. The ``fn`` should return exactly one...
src/unity/python/turicreate/data_structures/sframe.py
def apply(self, fn, dtype=None, seed=None): """ Transform each row to an :class:`~turicreate.SArray` according to a specified function. Returns a new SArray of ``dtype`` where each element in this SArray is transformed by `fn(x)` where `x` is a single row in the sframe represente...
def apply(self, fn, dtype=None, seed=None): """ Transform each row to an :class:`~turicreate.SArray` according to a specified function. Returns a new SArray of ``dtype`` where each element in this SArray is transformed by `fn(x)` where `x` is a single row in the sframe represente...
[ "Transform", "each", "row", "to", "an", ":", "class", ":", "~turicreate", ".", "SArray", "according", "to", "a", "specified", "function", ".", "Returns", "a", "new", "SArray", "of", "dtype", "where", "each", "element", "in", "this", "SArray", "is", "transf...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2434-L2500
[ "def", "apply", "(", "self", ",", "fn", ",", "dtype", "=", "None", ",", "seed", "=", "None", ")", ":", "assert", "callable", "(", "fn", ")", ",", "\"Input must be callable\"", "test_sf", "=", "self", "[", ":", "10", "]", "dryrun", "=", "[", "fn", "...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.flat_map
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. ...
src/unity/python/turicreate/data_structures/sframe.py
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): """ 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...
[ "Map", "each", "row", "of", "the", "SFrame", "to", "multiple", "rows", "in", "a", "new", "SFrame", "via", "a", "function", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2502-L2599
[ "def", "flat_map", "(", "self", ",", "column_names", ",", "fn", ",", "column_types", "=", "'auto'", ",", "seed", "=", "None", ")", ":", "assert", "callable", "(", "fn", ")", ",", "\"Input must be callable\"", "if", "seed", "is", "None", ":", "seed", "=",...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.sample
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. ...
src/unity/python/turicreate/data_structures/sframe.py
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): """ 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...
[ "Sample", "a", "fraction", "of", "the", "current", "SFrame", "s", "rows", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2601-L2648
[ "def", "sample", "(", "self", ",", "fraction", ",", "seed", "=", "None", ",", "exact", "=", "False", ")", ":", "if", "seed", "is", "None", ":", "seed", "=", "abs", "(", "hash", "(", "\"%0.20f\"", "%", "time", ".", "time", "(", ")", ")", ")", "%...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.random_split
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 ...
src/unity/python/turicreate/data_structures/sframe.py
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): """ 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...
[ "Randomly", "split", "the", "rows", "of", "an", "SFrame", "into", "two", "SFrames", ".", "The", "first", "SFrame", "contains", "*", "M", "*", "rows", "sampled", "uniformly", "(", "without", "replacement", ")", "from", "the", "original", "SFrame", ".", "*",...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2650-L2708
[ "def", "random_split", "(", "self", ",", "fraction", ",", "seed", "=", "None", ",", "exact", "=", "False", ")", ":", "if", "(", "fraction", ">", "1", "or", "fraction", "<", "0", ")", ":", "raise", "ValueError", "(", "'Invalid sampling rate: '", "+", "s...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.topk
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 ...
src/unity/python/turicreate/data_structures/sframe.py
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): """ 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 --------...
[ "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",...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2710-L2766
[ "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", "=", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.save
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...
src/unity/python/turicreate/data_structures/sframe.py
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): """ 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...
[ "Save", "the", "SFrame", "to", "a", "file", "system", "for", "later", "use", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2768-L2826
[ "def", "save", "(", "self", ",", "filename", ",", "format", "=", "None", ")", ":", "if", "format", "is", "None", ":", "if", "filename", ".", "endswith", "(", "(", "'.csv'", ",", "'.csv.gz'", ")", ")", ":", "format", "=", "'csv'", "elif", "filename", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.export_csv
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...
src/unity/python/turicreate/data_structures/sframe.py
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='\\', quote_char='\"', na_rep='', file_header='', file_footer='', line_prefix='', _no_prefix_on_first_value=False, **kwargs): ...
[ "Writes", "an", "SFrame", "to", "a", "CSV", "file", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2828-L2917
[ "def", "export_csv", "(", "self", ",", "filename", ",", "delimiter", "=", "','", ",", "line_terminator", "=", "'\\n'", ",", "header", "=", "True", ",", "quote_level", "=", "csv", ".", "QUOTE_NONNUMERIC", ",", "double_quote", "=", "True", ",", "escape_char", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.export_json
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...
src/unity/python/turicreate/data_structures/sframe.py
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'): """ Writes an SFrame to a JSON file. Parameters ---------- filename : string The location to save the JSON file. orient : string, optional. Either "records" or "lines"...
[ "Writes", "an", "SFrame", "to", "a", "JSON", "file", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2919-L2996
[ "def", "export_json", "(", "self", ",", "filename", ",", "orient", "=", "'records'", ")", ":", "if", "orient", "==", "\"records\"", ":", "self", ".", "pack_columns", "(", "dtype", "=", "dict", ")", ".", "export_csv", "(", "filename", ",", "file_header", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame._save_reference
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...
src/unity/python/turicreate/data_structures/sframe.py
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): """ 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 ...
[ "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", "."...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2998-L3023
[ "def", "_save_reference", "(", "self", ",", "filename", ")", ":", "## Save the SFrame", "url", "=", "_make_internal_url", "(", "filename", ")", "with", "cython_context", "(", ")", ":", "self", ".", "__proxy__", ".", "save_reference", "(", "url", ")" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.select_column
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. ...
src/unity/python/turicreate/data_structures/sframe.py
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): """ 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 ---------- ...
[ "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...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3026-L3060
[ "def", "select_column", "(", "self", ",", "column_name", ")", ":", "if", "not", "isinstance", "(", "column_name", ",", "str", ")", ":", "raise", "TypeError", "(", "\"Invalid column_nametype: must be str\"", ")", "with", "cython_context", "(", ")", ":", "return",...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.select_columns
Selects all columns where the name of the column or the type of column is included in the column_names. An exception is raised if duplicate columns are selected i.e. sf.select_columns(['a','a']), or non-existent columns are selected. Throws an exception for all other input types. ...
src/unity/python/turicreate/data_structures/sframe.py
def select_columns(self, column_names): """ Selects all columns where the name of the column or the type of column is included in the column_names. An exception is raised if duplicate columns are selected i.e. sf.select_columns(['a','a']), or non-existent columns are selected. ...
def select_columns(self, column_names): """ Selects all columns where the name of the column or the type of column is included in the column_names. An exception is raised if duplicate columns are selected i.e. sf.select_columns(['a','a']), or non-existent columns are selected. ...
[ "Selects", "all", "columns", "where", "the", "name", "of", "the", "column", "or", "the", "type", "of", "column", "is", "included", "in", "the", "column_names", ".", "An", "exception", "is", "raised", "if", "duplicate", "columns", "are", "selected", "i", "....
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3062-L3137
[ "def", "select_columns", "(", "self", ",", "column_names", ")", ":", "if", "not", "_is_non_string_iterable", "(", "column_names", ")", ":", "raise", "TypeError", "(", "\"column_names must be an iterable\"", ")", "if", "not", "(", "all", "(", "[", "isinstance", "...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.add_column
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...
src/unity/python/turicreate/data_structures/sframe.py
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): """ 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...
[ "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...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3139-L3212
[ "def", "add_column", "(", "self", ",", "data", ",", "column_name", "=", "\"\"", ",", "inplace", "=", "False", ")", ":", "# Check type for pandas dataframe or SArray?", "if", "not", "isinstance", "(", "data", ",", "SArray", ")", ":", "if", "isinstance", "(", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.add_columns
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...
src/unity/python/turicreate/data_structures/sframe.py
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): """ 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 ...
[ "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", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3214-L3293
[ "def", "add_columns", "(", "self", ",", "data", ",", "column_names", "=", "None", ",", "inplace", "=", "False", ")", ":", "datalist", "=", "data", "if", "isinstance", "(", "data", ",", "SFrame", ")", ":", "other", "=", "data", "datalist", "=", "[", "...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.remove_column
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 :...
src/unity/python/turicreate/data_structures/sframe.py
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): """ 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...
[ "Returns", "an", "SFrame", "with", "a", "column", "removed", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3295-L3347
[ "def", "remove_column", "(", "self", ",", "column_name", ",", "inplace", "=", "False", ")", ":", "column_name", "=", "str", "(", "column_name", ")", "if", "column_name", "not", "in", "self", ".", "column_names", "(", ")", ":", "raise", "KeyError", "(", "...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.remove_columns
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...
src/unity/python/turicreate/data_structures/sframe.py
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): """ 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 ...
[ "Returns", "an", "SFrame", "with", "one", "or", "more", "columns", "removed", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3349-L3406
[ "def", "remove_columns", "(", "self", ",", "column_names", ",", "inplace", "=", "False", ")", ":", "column_names", "=", "list", "(", "column_names", ")", "existing_columns", "=", "dict", "(", "(", "k", ",", "i", ")", "for", "i", ",", "k", "in", "enumer...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.swap_columns
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...
src/unity/python/turicreate/data_structures/sframe.py
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): """ 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...
[ "Returns", "an", "SFrame", "with", "two", "column", "positions", "swapped", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3409-L3462
[ "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", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.rename
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 ...
src/unity/python/turicreate/data_structures/sframe.py
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): """ 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...
[ "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...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3464-L3525
[ "def", "rename", "(", "self", ",", "names", ",", "inplace", "=", "False", ")", ":", "if", "(", "type", "(", "names", ")", "is", "not", "dict", ")", ":", "raise", "TypeError", "(", "'names must be a dictionary: oldname -> newname'", ")", "all_columns", "=", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.append
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 ...
src/unity/python/turicreate/data_structures/sframe.py
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): """ 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 ...
[ "Add", "the", "rows", "of", "an", "SFrame", "to", "the", "end", "of", "this", "SFrame", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3737-L3816
[ "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", "...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.groupby
Perform a group on the key_column_names followed by aggregations on the columns listed in operations. The operations parameter is a dictionary that indicates which aggregation operators to use and which columns to use them on. The available operators are SUM, MAX, MIN, COUNT, AVG, VAR, ...
src/unity/python/turicreate/data_structures/sframe.py
def groupby(self, key_column_names, operations, *args): """ Perform a group on the key_column_names followed by aggregations on the columns listed in operations. The operations parameter is a dictionary that indicates which aggregation operators to use and which columns to use t...
def groupby(self, key_column_names, operations, *args): """ Perform a group on the key_column_names followed by aggregations on the columns listed in operations. The operations parameter is a dictionary that indicates which aggregation operators to use and which columns to use t...
[ "Perform", "a", "group", "on", "the", "key_column_names", "followed", "by", "aggregations", "on", "the", "columns", "listed", "in", "operations", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3818-L4217
[ "def", "groupby", "(", "self", ",", "key_column_names", ",", "operations", ",", "*", "args", ")", ":", "# some basic checking first", "# make sure key_column_names is a list", "if", "isinstance", "(", "key_column_names", ",", "str", ")", ":", "key_column_names", "=", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.join
Merge two SFrames. Merges the current (left) SFrame with the given (right) SFrame using a SQL-style equi-join operation by columns. Parameters ---------- right : SFrame The SFrame to join. on : None | str | list | dict, optional The column name(s) repres...
src/unity/python/turicreate/data_structures/sframe.py
def join(self, right, on=None, how='inner'): """ Merge two SFrames. Merges the current (left) SFrame with the given (right) SFrame using a SQL-style equi-join operation by columns. Parameters ---------- right : SFrame The SFrame to join. on : None | ...
def join(self, right, on=None, how='inner'): """ Merge two SFrames. Merges the current (left) SFrame with the given (right) SFrame using a SQL-style equi-join operation by columns. Parameters ---------- right : SFrame The SFrame to join. on : None | ...
[ "Merge", "two", "SFrames", ".", "Merges", "the", "current", "(", "left", ")", "SFrame", "with", "the", "given", "(", "right", ")", "SFrame", "using", "a", "SQL", "-", "style", "equi", "-", "join", "operation", "by", "columns", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L4219-L4352
[ "def", "join", "(", "self", ",", "right", ",", "on", "=", "None", ",", "how", "=", "'inner'", ")", ":", "available_join_types", "=", "[", "'left'", ",", "'right'", ",", "'outer'", ",", "'inner'", "]", "if", "not", "isinstance", "(", "right", ",", "SF...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.filter_by
Filter an SFrame by values inside an iterable object. Result is an SFrame that only includes (or excludes) the rows that have a column with the given ``column_name`` which holds one of the values in the given ``values`` :class:`~turicreate.SArray`. If ``values`` is not an SArray, we atte...
src/unity/python/turicreate/data_structures/sframe.py
def filter_by(self, values, column_name, exclude=False): """ Filter an SFrame by values inside an iterable object. Result is an SFrame that only includes (or excludes) the rows that have a column with the given ``column_name`` which holds one of the values in the given ``values``...
def filter_by(self, values, column_name, exclude=False): """ Filter an SFrame by values inside an iterable object. Result is an SFrame that only includes (or excludes) the rows that have a column with the given ``column_name`` which holds one of the values in the given ``values``...
[ "Filter", "an", "SFrame", "by", "values", "inside", "an", "iterable", "object", ".", "Result", "is", "an", "SFrame", "that", "only", "includes", "(", "or", "excludes", ")", "the", "rows", "that", "have", "a", "column", "with", "the", "given", "column_name"...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L4354-L4449
[ "def", "filter_by", "(", "self", ",", "values", ",", "column_name", ",", "exclude", "=", "False", ")", ":", "if", "type", "(", "column_name", ")", "is", "not", "str", ":", "raise", "TypeError", "(", "\"Must pass a str as column_name\"", ")", "existing_columns"...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.explore
Explore the SFrame in an interactive GUI. Opens a new app window. Parameters ---------- title : str The plot title to show for the resulting visualization. Defaults to None. If the title is None, a default title will be provided. Returns ------- ...
src/unity/python/turicreate/data_structures/sframe.py
def explore(self, title=None): """ Explore the SFrame in an interactive GUI. Opens a new app window. Parameters ---------- title : str The plot title to show for the resulting visualization. Defaults to None. If the title is None, a default title will be ...
def explore(self, title=None): """ Explore the SFrame in an interactive GUI. Opens a new app window. Parameters ---------- title : str The plot title to show for the resulting visualization. Defaults to None. If the title is None, a default title will be ...
[ "Explore", "the", "SFrame", "in", "an", "interactive", "GUI", ".", "Opens", "a", "new", "app", "window", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L4451-L4486
[ "def", "explore", "(", "self", ",", "title", "=", "None", ")", ":", "import", "sys", "import", "os", "if", "sys", ".", "platform", "!=", "'darwin'", "and", "sys", ".", "platform", "!=", "'linux2'", "and", "sys", ".", "platform", "!=", "'linux'", ":", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.pack_columns
Pack columns of the current SFrame into one single column. The result is a new SFrame with the unaffected columns from the original SFrame plus the newly created column. The list of columns that are packed is chosen through either the ``column_names`` or ``column_name_prefix`` parameter...
src/unity/python/turicreate/data_structures/sframe.py
def pack_columns(self, column_names=None, column_name_prefix=None, dtype=list, fill_na=None, remove_prefix=True, new_column_name=None): """ Pack columns of the current SFrame into one single column. The result is a new SFrame with the unaffected columns from the original SFr...
def pack_columns(self, column_names=None, column_name_prefix=None, dtype=list, fill_na=None, remove_prefix=True, new_column_name=None): """ Pack columns of the current SFrame into one single column. The result is a new SFrame with the unaffected columns from the original SFr...
[ "Pack", "columns", "of", "the", "current", "SFrame", "into", "one", "single", "column", ".", "The", "result", "is", "a", "new", "SFrame", "with", "the", "unaffected", "columns", "from", "the", "original", "SFrame", "plus", "the", "newly", "created", "column"...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L4541-L4777
[ "def", "pack_columns", "(", "self", ",", "column_names", "=", "None", ",", "column_name_prefix", "=", "None", ",", "dtype", "=", "list", ",", "fill_na", "=", "None", ",", "remove_prefix", "=", "True", ",", "new_column_name", "=", "None", ")", ":", "if", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.split_datetime
Splits a datetime column of SFrame to multiple columns, with each value in a separate column. Returns a new SFrame with the expanded column replaced with a list of new columns. The expanded column must be of datetime type. For more details regarding name generation and other, refer to :...
src/unity/python/turicreate/data_structures/sframe.py
def split_datetime(self, column_name, column_name_prefix=None, limit=None, timezone=False): """ Splits a datetime column of SFrame to multiple columns, with each value in a separate column. Returns a new SFrame with the expanded column replaced with a list of new columns. The expanded co...
def split_datetime(self, column_name, column_name_prefix=None, limit=None, timezone=False): """ Splits a datetime column of SFrame to multiple columns, with each value in a separate column. Returns a new SFrame with the expanded column replaced with a list of new columns. The expanded co...
[ "Splits", "a", "datetime", "column", "of", "SFrame", "to", "multiple", "columns", "with", "each", "value", "in", "a", "separate", "column", ".", "Returns", "a", "new", "SFrame", "with", "the", "expanded", "column", "replaced", "with", "a", "list", "of", "n...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L4780-L4862
[ "def", "split_datetime", "(", "self", ",", "column_name", ",", "column_name_prefix", "=", "None", ",", "limit", "=", "None", ",", "timezone", "=", "False", ")", ":", "if", "column_name", "not", "in", "self", ".", "column_names", "(", ")", ":", "raise", "...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.unpack
Expand one column of this SFrame to multiple columns with each value in a separate column. Returns a new SFrame with the unpacked column replaced with a list of new columns. The column must be of list/array/dict type. For more details regarding name generation, missing value handling a...
src/unity/python/turicreate/data_structures/sframe.py
def unpack(self, column_name=None, column_name_prefix=None, column_types=None, na_value=None, limit=None): """ Expand one column of this SFrame to multiple columns with each value in a separate column. Returns a new SFrame with the unpacked column replaced with a list of n...
def unpack(self, column_name=None, column_name_prefix=None, column_types=None, na_value=None, limit=None): """ Expand one column of this SFrame to multiple columns with each value in a separate column. Returns a new SFrame with the unpacked column replaced with a list of n...
[ "Expand", "one", "column", "of", "this", "SFrame", "to", "multiple", "columns", "with", "each", "value", "in", "a", "separate", "column", ".", "Returns", "a", "new", "SFrame", "with", "the", "unpacked", "column", "replaced", "with", "a", "list", "of", "new...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L4864-L5039
[ "def", "unpack", "(", "self", ",", "column_name", "=", "None", ",", "column_name_prefix", "=", "None", ",", "column_types", "=", "None", ",", "na_value", "=", "None", ",", "limit", "=", "None", ")", ":", "if", "column_name", "is", "None", ":", "if", "s...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.stack
Convert a "wide" column of an SFrame to one or two "tall" columns by stacking all values. The stack works only for columns of dict, list, or array type. If the column is dict type, two new columns are created as a result of stacking: one column holds the key and another column holds th...
src/unity/python/turicreate/data_structures/sframe.py
def stack(self, column_name, new_column_name=None, drop_na=False, new_column_type=None): """ Convert a "wide" column of an SFrame to one or two "tall" columns by stacking all values. The stack works only for columns of dict, list, or array type. If the column is dict type, two ...
def stack(self, column_name, new_column_name=None, drop_na=False, new_column_type=None): """ Convert a "wide" column of an SFrame to one or two "tall" columns by stacking all values. The stack works only for columns of dict, list, or array type. If the column is dict type, two ...
[ "Convert", "a", "wide", "column", "of", "an", "SFrame", "to", "one", "or", "two", "tall", "columns", "by", "stacking", "all", "values", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L5041-L5235
[ "def", "stack", "(", "self", ",", "column_name", ",", "new_column_name", "=", "None", ",", "drop_na", "=", "False", ",", "new_column_type", "=", "None", ")", ":", "# validate column_name", "column_name", "=", "str", "(", "column_name", ")", "if", "column_name"...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.unstack
Concatenate values from one or two columns into one column, grouping by all other columns. The resulting column could be of type list, array or dictionary. If ``column_names`` is a numeric column, the result will be of array.array type. If ``column_names`` is a non-numeric column, the new colu...
src/unity/python/turicreate/data_structures/sframe.py
def unstack(self, column_names, new_column_name=None): """ Concatenate values from one or two columns into one column, grouping by all other columns. The resulting column could be of type list, array or dictionary. If ``column_names`` is a numeric column, the result will be of a...
def unstack(self, column_names, new_column_name=None): """ Concatenate values from one or two columns into one column, grouping by all other columns. The resulting column could be of type list, array or dictionary. If ``column_names`` is a numeric column, the result will be of a...
[ "Concatenate", "values", "from", "one", "or", "two", "columns", "into", "one", "column", "grouping", "by", "all", "other", "columns", ".", "The", "resulting", "column", "could", "be", "of", "type", "list", "array", "or", "dictionary", ".", "If", "column_name...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L5237-L5324
[ "def", "unstack", "(", "self", ",", "column_names", ",", "new_column_name", "=", "None", ")", ":", "if", "(", "type", "(", "column_names", ")", "!=", "str", "and", "len", "(", "column_names", ")", "!=", "2", ")", ":", "raise", "TypeError", "(", "\"'col...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.sort
Sort current SFrame by the given columns, using the given sort order. Only columns that are type of str, int and float can be sorted. Parameters ---------- key_column_names : str | list of str | list of (str, bool) pairs Names of columns to be sorted. The result will be sor...
src/unity/python/turicreate/data_structures/sframe.py
def sort(self, key_column_names, ascending=True): """ Sort current SFrame by the given columns, using the given sort order. Only columns that are type of str, int and float can be sorted. Parameters ---------- key_column_names : str | list of str | list of (str, bool) pa...
def sort(self, key_column_names, ascending=True): """ Sort current SFrame by the given columns, using the given sort order. Only columns that are type of str, int and float can be sorted. Parameters ---------- key_column_names : str | list of str | list of (str, bool) pa...
[ "Sort", "current", "SFrame", "by", "the", "given", "columns", "using", "the", "given", "sort", "order", ".", "Only", "columns", "that", "are", "type", "of", "str", "int", "and", "float", "can", "be", "sorted", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L5373-L5511
[ "def", "sort", "(", "self", ",", "key_column_names", ",", "ascending", "=", "True", ")", ":", "sort_column_names", "=", "[", "]", "sort_column_orders", "=", "[", "]", "# validate key_column_names", "if", "(", "type", "(", "key_column_names", ")", "==", "str", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.dropna
Remove missing values from an SFrame. A missing value is either ``None`` or ``NaN``. If ``how`` is 'any', a row will be removed if any of the columns in the ``columns`` parameter contains at least one missing value. If ``how`` is 'all', a row will be removed if all of the columns in th...
src/unity/python/turicreate/data_structures/sframe.py
def dropna(self, columns=None, how='any'): """ Remove missing values from an SFrame. A missing value is either ``None`` or ``NaN``. If ``how`` is 'any', a row will be removed if any of the columns in the ``columns`` parameter contains at least one missing value. If ``how`` is '...
def dropna(self, columns=None, how='any'): """ Remove missing values from an SFrame. A missing value is either ``None`` or ``NaN``. If ``how`` is 'any', a row will be removed if any of the columns in the ``columns`` parameter contains at least one missing value. If ``how`` is '...
[ "Remove", "missing", "values", "from", "an", "SFrame", ".", "A", "missing", "value", "is", "either", "None", "or", "NaN", ".", "If", "how", "is", "any", "a", "row", "will", "be", "removed", "if", "any", "of", "the", "columns", "in", "the", "columns", ...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L5513-L5588
[ "def", "dropna", "(", "self", ",", "columns", "=", "None", ",", "how", "=", "'any'", ")", ":", "# If the user gives me an empty list (the indicator to use all columns)", "# NA values being dropped would not be the expected behavior. This", "# is a NOOP, so let's not bother the server...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.dropna_split
Split rows with missing values from this SFrame. This function has the same functionality as :py:func:`~turicreate.SFrame.dropna`, but returns a tuple of two SFrames. The first item is the expected output from :py:func:`~turicreate.SFrame.dropna`, and the second item contains all the ro...
src/unity/python/turicreate/data_structures/sframe.py
def dropna_split(self, columns=None, how='any'): """ Split rows with missing values from this SFrame. This function has the same functionality as :py:func:`~turicreate.SFrame.dropna`, but returns a tuple of two SFrames. The first item is the expected output from :py:func:`~turic...
def dropna_split(self, columns=None, how='any'): """ Split rows with missing values from this SFrame. This function has the same functionality as :py:func:`~turicreate.SFrame.dropna`, but returns a tuple of two SFrames. The first item is the expected output from :py:func:`~turic...
[ "Split", "rows", "with", "missing", "values", "from", "this", "SFrame", ".", "This", "function", "has", "the", "same", "functionality", "as", ":", "py", ":", "func", ":", "~turicreate", ".", "SFrame", ".", "dropna", "but", "returns", "a", "tuple", "of", ...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L5590-L5655
[ "def", "dropna_split", "(", "self", ",", "columns", "=", "None", ",", "how", "=", "'any'", ")", ":", "# If the user gives me an empty list (the indicator to use all columns)", "# NA values being dropped would not be the expected behavior. This", "# is a NOOP, so let's not bother the ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.fillna
Fill all missing values with a given value in a given column. If the ``value`` is not the same type as the values in ``column_name``, this method attempts to convert the value to the original column's type. If this fails, an error is raised. Parameters ---------- column_...
src/unity/python/turicreate/data_structures/sframe.py
def fillna(self, column_name, value): """ Fill all missing values with a given value in a given column. If the ``value`` is not the same type as the values in ``column_name``, this method attempts to convert the value to the original column's type. If this fails, an error is rais...
def fillna(self, column_name, value): """ Fill all missing values with a given value in a given column. If the ``value`` is not the same type as the values in ``column_name``, this method attempts to convert the value to the original column's type. If this fails, an error is rais...
[ "Fill", "all", "missing", "values", "with", "a", "given", "value", "in", "a", "given", "column", ".", "If", "the", "value", "is", "not", "the", "same", "type", "as", "the", "values", "in", "column_name", "this", "method", "attempts", "to", "convert", "th...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L5684-L5728
[ "def", "fillna", "(", "self", ",", "column_name", ",", "value", ")", ":", "# Normal error checking", "if", "type", "(", "column_name", ")", "is", "not", "str", ":", "raise", "TypeError", "(", "\"column_name must be a str\"", ")", "ret", "=", "self", "[", "se...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
SFrame.add_row_number
Returns an SFrame with a new column that numbers each row sequentially. By default the count starts at 0, but this can be changed to a positive or negative number. The new column will be named with the given column name. An error will be raised if the given column name already exists i...
src/unity/python/turicreate/data_structures/sframe.py
def add_row_number(self, column_name='id', start=0, inplace=False): """ Returns an SFrame with a new column that numbers each row sequentially. By default the count starts at 0, but this can be changed to a positive or negative number. The new column will be named with the given...
def add_row_number(self, column_name='id', start=0, inplace=False): """ Returns an SFrame with a new column that numbers each row sequentially. By default the count starts at 0, but this can be changed to a positive or negative number. The new column will be named with the given...
[ "Returns", "an", "SFrame", "with", "a", "new", "column", "that", "numbers", "each", "row", "sequentially", ".", "By", "default", "the", "count", "starts", "at", "0", "but", "this", "can", "be", "changed", "to", "a", "positive", "or", "negative", "number", ...
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L5730-L5801
[ "def", "add_row_number", "(", "self", ",", "column_name", "=", "'id'", ",", "start", "=", "0", ",", "inplace", "=", "False", ")", ":", "if", "type", "(", "column_name", ")", "is", "not", "str", ":", "raise", "TypeError", "(", "\"Must give column_name as st...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool.AddSerializedFile
Adds the FileDescriptorProto and its types to this pool. Args: serialized_file_desc_proto: A bytes string, serialization of the FileDescriptorProto to add.
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def AddSerializedFile(self, serialized_file_desc_proto): """Adds the FileDescriptorProto and its types to this pool. Args: serialized_file_desc_proto: A bytes string, serialization of the FileDescriptorProto to add. """ # pylint: disable=g-import-not-at-top from google.protobuf impor...
def AddSerializedFile(self, serialized_file_desc_proto): """Adds the FileDescriptorProto and its types to this pool. Args: serialized_file_desc_proto: A bytes string, serialization of the FileDescriptorProto to add. """ # pylint: disable=g-import-not-at-top from google.protobuf impor...
[ "Adds", "the", "FileDescriptorProto", "and", "its", "types", "to", "this", "pool", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L148-L160
[ "def", "AddSerializedFile", "(", "self", ",", "serialized_file_desc_proto", ")", ":", "# pylint: disable=g-import-not-at-top", "from", "google", ".", "protobuf", "import", "descriptor_pb2", "file_desc_proto", "=", "descriptor_pb2", ".", "FileDescriptorProto", ".", "FromStri...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool.AddDescriptor
Adds a Descriptor to the pool, non-recursively. If the Descriptor contains nested messages or enums, the caller must explicitly register them. This method also registers the FileDescriptor associated with the message. Args: desc: A Descriptor.
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def AddDescriptor(self, desc): """Adds a Descriptor to the pool, non-recursively. If the Descriptor contains nested messages or enums, the caller must explicitly register them. This method also registers the FileDescriptor associated with the message. Args: desc: A Descriptor. """ if...
def AddDescriptor(self, desc): """Adds a Descriptor to the pool, non-recursively. If the Descriptor contains nested messages or enums, the caller must explicitly register them. This method also registers the FileDescriptor associated with the message. Args: desc: A Descriptor. """ if...
[ "Adds", "a", "Descriptor", "to", "the", "pool", "non", "-", "recursively", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L162-L176
[ "def", "AddDescriptor", "(", "self", ",", "desc", ")", ":", "if", "not", "isinstance", "(", "desc", ",", "descriptor", ".", "Descriptor", ")", ":", "raise", "TypeError", "(", "'Expected instance of descriptor.Descriptor.'", ")", "self", ".", "_descriptors", "[",...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool.AddServiceDescriptor
Adds a ServiceDescriptor to the pool. Args: service_desc: A ServiceDescriptor.
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def AddServiceDescriptor(self, service_desc): """Adds a ServiceDescriptor to the pool. Args: service_desc: A ServiceDescriptor. """ if not isinstance(service_desc, descriptor.ServiceDescriptor): raise TypeError('Expected instance of descriptor.ServiceDescriptor.') self._service_descri...
def AddServiceDescriptor(self, service_desc): """Adds a ServiceDescriptor to the pool. Args: service_desc: A ServiceDescriptor. """ if not isinstance(service_desc, descriptor.ServiceDescriptor): raise TypeError('Expected instance of descriptor.ServiceDescriptor.') self._service_descri...
[ "Adds", "a", "ServiceDescriptor", "to", "the", "pool", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L193-L203
[ "def", "AddServiceDescriptor", "(", "self", ",", "service_desc", ")", ":", "if", "not", "isinstance", "(", "service_desc", ",", "descriptor", ".", "ServiceDescriptor", ")", ":", "raise", "TypeError", "(", "'Expected instance of descriptor.ServiceDescriptor.'", ")", "s...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool.AddExtensionDescriptor
Adds a FieldDescriptor describing an extension to the pool. Args: extension: A FieldDescriptor. Raises: AssertionError: when another extension with the same number extends the same message. TypeError: when the specified extension is not a descriptor.FieldDescriptor.
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def AddExtensionDescriptor(self, extension): """Adds a FieldDescriptor describing an extension to the pool. Args: extension: A FieldDescriptor. Raises: AssertionError: when another extension with the same number extends the same message. TypeError: when the specified extension is...
def AddExtensionDescriptor(self, extension): """Adds a FieldDescriptor describing an extension to the pool. Args: extension: A FieldDescriptor. Raises: AssertionError: when another extension with the same number extends the same message. TypeError: when the specified extension is...
[ "Adds", "a", "FieldDescriptor", "describing", "an", "extension", "to", "the", "pool", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L205-L245
[ "def", "AddExtensionDescriptor", "(", "self", ",", "extension", ")", ":", "if", "not", "(", "isinstance", "(", "extension", ",", "descriptor", ".", "FieldDescriptor", ")", "and", "extension", ".", "is_extension", ")", ":", "raise", "TypeError", "(", "'Expected...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool.AddFileDescriptor
Adds a FileDescriptor to the pool, non-recursively. If the FileDescriptor contains messages or enums, the caller must explicitly register them. Args: file_desc: A FileDescriptor.
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def AddFileDescriptor(self, file_desc): """Adds a FileDescriptor to the pool, non-recursively. If the FileDescriptor contains messages or enums, the caller must explicitly register them. Args: file_desc: A FileDescriptor. """ self._AddFileDescriptor(file_desc) # TODO(jieluo): This i...
def AddFileDescriptor(self, file_desc): """Adds a FileDescriptor to the pool, non-recursively. If the FileDescriptor contains messages or enums, the caller must explicitly register them. Args: file_desc: A FileDescriptor. """ self._AddFileDescriptor(file_desc) # TODO(jieluo): This i...
[ "Adds", "a", "FileDescriptor", "to", "the", "pool", "non", "-", "recursively", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L247-L262
[ "def", "AddFileDescriptor", "(", "self", ",", "file_desc", ")", ":", "self", ".", "_AddFileDescriptor", "(", "file_desc", ")", "# TODO(jieluo): This is a temporary solution for FieldDescriptor.file.", "# Remove it when FieldDescriptor.file is added in code gen.", "for", "extension"...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool._AddFileDescriptor
Adds a FileDescriptor to the pool, non-recursively. If the FileDescriptor contains messages or enums, the caller must explicitly register them. Args: file_desc: A FileDescriptor.
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def _AddFileDescriptor(self, file_desc): """Adds a FileDescriptor to the pool, non-recursively. If the FileDescriptor contains messages or enums, the caller must explicitly register them. Args: file_desc: A FileDescriptor. """ if not isinstance(file_desc, descriptor.FileDescriptor): ...
def _AddFileDescriptor(self, file_desc): """Adds a FileDescriptor to the pool, non-recursively. If the FileDescriptor contains messages or enums, the caller must explicitly register them. Args: file_desc: A FileDescriptor. """ if not isinstance(file_desc, descriptor.FileDescriptor): ...
[ "Adds", "a", "FileDescriptor", "to", "the", "pool", "non", "-", "recursively", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L264-L276
[ "def", "_AddFileDescriptor", "(", "self", ",", "file_desc", ")", ":", "if", "not", "isinstance", "(", "file_desc", ",", "descriptor", ".", "FileDescriptor", ")", ":", "raise", "TypeError", "(", "'Expected instance of descriptor.FileDescriptor.'", ")", "self", ".", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool.FindFileByName
Gets a FileDescriptor by file name. Args: file_name: The path to the file to get a descriptor for. Returns: A FileDescriptor for the named file. Raises: KeyError: if the file cannot be found in the pool.
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def FindFileByName(self, file_name): """Gets a FileDescriptor by file name. Args: file_name: The path to the file to get a descriptor for. Returns: A FileDescriptor for the named file. Raises: KeyError: if the file cannot be found in the pool. """ try: return self._fi...
def FindFileByName(self, file_name): """Gets a FileDescriptor by file name. Args: file_name: The path to the file to get a descriptor for. Returns: A FileDescriptor for the named file. Raises: KeyError: if the file cannot be found in the pool. """ try: return self._fi...
[ "Gets", "a", "FileDescriptor", "by", "file", "name", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L278-L305
[ "def", "FindFileByName", "(", "self", ",", "file_name", ")", ":", "try", ":", "return", "self", ".", "_file_descriptors", "[", "file_name", "]", "except", "KeyError", ":", "pass", "try", ":", "file_proto", "=", "self", ".", "_internal_db", ".", "FindFileByNa...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool.FindFileContainingSymbol
Gets the FileDescriptor for the file containing the specified symbol. Args: symbol: The name of the symbol to search for. Returns: A FileDescriptor that contains the specified symbol. Raises: KeyError: if the file cannot be found in the pool.
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def FindFileContainingSymbol(self, symbol): """Gets the FileDescriptor for the file containing the specified symbol. Args: symbol: The name of the symbol to search for. Returns: A FileDescriptor that contains the specified symbol. Raises: KeyError: if the file cannot be found in the...
def FindFileContainingSymbol(self, symbol): """Gets the FileDescriptor for the file containing the specified symbol. Args: symbol: The name of the symbol to search for. Returns: A FileDescriptor that contains the specified symbol. Raises: KeyError: if the file cannot be found in the...
[ "Gets", "the", "FileDescriptor", "for", "the", "file", "containing", "the", "specified", "symbol", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L307-L349
[ "def", "FindFileContainingSymbol", "(", "self", ",", "symbol", ")", ":", "symbol", "=", "_NormalizeFullyQualifiedName", "(", "symbol", ")", "try", ":", "return", "self", ".", "_descriptors", "[", "symbol", "]", ".", "file", "except", "KeyError", ":", "pass", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool.FindMessageTypeByName
Loads the named descriptor from the pool. Args: full_name: The full name of the descriptor to load. Returns: The descriptor for the named type. Raises: KeyError: if the message cannot be found in the pool.
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def FindMessageTypeByName(self, full_name): """Loads the named descriptor from the pool. Args: full_name: The full name of the descriptor to load. Returns: The descriptor for the named type. Raises: KeyError: if the message cannot be found in the pool. """ full_name = _Norm...
def FindMessageTypeByName(self, full_name): """Loads the named descriptor from the pool. Args: full_name: The full name of the descriptor to load. Returns: The descriptor for the named type. Raises: KeyError: if the message cannot be found in the pool. """ full_name = _Norm...
[ "Loads", "the", "named", "descriptor", "from", "the", "pool", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L351-L367
[ "def", "FindMessageTypeByName", "(", "self", ",", "full_name", ")", ":", "full_name", "=", "_NormalizeFullyQualifiedName", "(", "full_name", ")", "if", "full_name", "not", "in", "self", ".", "_descriptors", ":", "self", ".", "_FindFileContainingSymbolInDb", "(", "...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool.FindEnumTypeByName
Loads the named enum descriptor from the pool. Args: full_name: The full name of the enum descriptor to load. Returns: The enum descriptor for the named type. Raises: KeyError: if the enum cannot be found in the pool.
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def FindEnumTypeByName(self, full_name): """Loads the named enum descriptor from the pool. Args: full_name: The full name of the enum descriptor to load. Returns: The enum descriptor for the named type. Raises: KeyError: if the enum cannot be found in the pool. """ full_nam...
def FindEnumTypeByName(self, full_name): """Loads the named enum descriptor from the pool. Args: full_name: The full name of the enum descriptor to load. Returns: The enum descriptor for the named type. Raises: KeyError: if the enum cannot be found in the pool. """ full_nam...
[ "Loads", "the", "named", "enum", "descriptor", "from", "the", "pool", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L369-L385
[ "def", "FindEnumTypeByName", "(", "self", ",", "full_name", ")", ":", "full_name", "=", "_NormalizeFullyQualifiedName", "(", "full_name", ")", "if", "full_name", "not", "in", "self", ".", "_enum_descriptors", ":", "self", ".", "_FindFileContainingSymbolInDb", "(", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool.FindFieldByName
Loads the named field descriptor from the pool. Args: full_name: The full name of the field descriptor to load. Returns: The field descriptor for the named field. Raises: KeyError: if the field cannot be found in the pool.
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def FindFieldByName(self, full_name): """Loads the named field descriptor from the pool. Args: full_name: The full name of the field descriptor to load. Returns: The field descriptor for the named field. Raises: KeyError: if the field cannot be found in the pool. """ full_na...
def FindFieldByName(self, full_name): """Loads the named field descriptor from the pool. Args: full_name: The full name of the field descriptor to load. Returns: The field descriptor for the named field. Raises: KeyError: if the field cannot be found in the pool. """ full_na...
[ "Loads", "the", "named", "field", "descriptor", "from", "the", "pool", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L387-L402
[ "def", "FindFieldByName", "(", "self", ",", "full_name", ")", ":", "full_name", "=", "_NormalizeFullyQualifiedName", "(", "full_name", ")", "message_name", ",", "_", ",", "field_name", "=", "full_name", ".", "rpartition", "(", "'.'", ")", "message_descriptor", "...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool.FindServiceByName
Loads the named service descriptor from the pool. Args: full_name: The full name of the service descriptor to load. Returns: The service descriptor for the named service. Raises: KeyError: if the service cannot be found in the pool.
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def FindServiceByName(self, full_name): """Loads the named service descriptor from the pool. Args: full_name: The full name of the service descriptor to load. Returns: The service descriptor for the named service. Raises: KeyError: if the service cannot be found in the pool. """...
def FindServiceByName(self, full_name): """Loads the named service descriptor from the pool. Args: full_name: The full name of the service descriptor to load. Returns: The service descriptor for the named service. Raises: KeyError: if the service cannot be found in the pool. """...
[ "Loads", "the", "named", "service", "descriptor", "from", "the", "pool", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L467-L482
[ "def", "FindServiceByName", "(", "self", ",", "full_name", ")", ":", "full_name", "=", "_NormalizeFullyQualifiedName", "(", "full_name", ")", "if", "full_name", "not", "in", "self", ".", "_service_descriptors", ":", "self", ".", "_FindFileContainingSymbolInDb", "(",...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool._FindFileContainingSymbolInDb
Finds the file in descriptor DB containing the specified symbol. Args: symbol: The name of the symbol to search for. Returns: A FileDescriptor that contains the specified symbol. Raises: KeyError: if the file cannot be found in the descriptor database.
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def _FindFileContainingSymbolInDb(self, symbol): """Finds the file in descriptor DB containing the specified symbol. Args: symbol: The name of the symbol to search for. Returns: A FileDescriptor that contains the specified symbol. Raises: KeyError: if the file cannot be found in the...
def _FindFileContainingSymbolInDb(self, symbol): """Finds the file in descriptor DB containing the specified symbol. Args: symbol: The name of the symbol to search for. Returns: A FileDescriptor that contains the specified symbol. Raises: KeyError: if the file cannot be found in the...
[ "Finds", "the", "file", "in", "descriptor", "DB", "containing", "the", "specified", "symbol", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L484-L505
[ "def", "_FindFileContainingSymbolInDb", "(", "self", ",", "symbol", ")", ":", "try", ":", "file_proto", "=", "self", ".", "_internal_db", ".", "FindFileContainingSymbol", "(", "symbol", ")", "except", "KeyError", "as", "error", ":", "if", "self", ".", "_descri...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool._ConvertFileProtoToFileDescriptor
Creates a FileDescriptor from a proto or returns a cached copy. This method also has the side effect of loading all the symbols found in the file into the appropriate dictionaries in the pool. Args: file_proto: The proto to convert. Returns: A FileDescriptor matching the passed in proto.
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def _ConvertFileProtoToFileDescriptor(self, file_proto): """Creates a FileDescriptor from a proto or returns a cached copy. This method also has the side effect of loading all the symbols found in the file into the appropriate dictionaries in the pool. Args: file_proto: The proto to convert. ...
def _ConvertFileProtoToFileDescriptor(self, file_proto): """Creates a FileDescriptor from a proto or returns a cached copy. This method also has the side effect of loading all the symbols found in the file into the appropriate dictionaries in the pool. Args: file_proto: The proto to convert. ...
[ "Creates", "a", "FileDescriptor", "from", "a", "proto", "or", "returns", "a", "cached", "copy", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L507-L589
[ "def", "_ConvertFileProtoToFileDescriptor", "(", "self", ",", "file_proto", ")", ":", "if", "file_proto", ".", "name", "not", "in", "self", ".", "_file_descriptors", ":", "built_deps", "=", "list", "(", "self", ".", "_GetDeps", "(", "file_proto", ".", "depende...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool._ConvertMessageDescriptor
Adds the proto to the pool in the specified package. Args: desc_proto: The descriptor_pb2.DescriptorProto protobuf message. package: The package the proto should be located in. file_desc: The file containing this message. scope: Dict mapping short and full symbols to message and enum types....
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def _ConvertMessageDescriptor(self, desc_proto, package=None, file_desc=None, scope=None, syntax=None): """Adds the proto to the pool in the specified package. Args: desc_proto: The descriptor_pb2.DescriptorProto protobuf message. package: The package the proto shoul...
def _ConvertMessageDescriptor(self, desc_proto, package=None, file_desc=None, scope=None, syntax=None): """Adds the proto to the pool in the specified package. Args: desc_proto: The descriptor_pb2.DescriptorProto protobuf message. package: The package the proto shoul...
[ "Adds", "the", "proto", "to", "the", "pool", "in", "the", "specified", "package", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L591-L670
[ "def", "_ConvertMessageDescriptor", "(", "self", ",", "desc_proto", ",", "package", "=", "None", ",", "file_desc", "=", "None", ",", "scope", "=", "None", ",", "syntax", "=", "None", ")", ":", "if", "package", ":", "desc_name", "=", "'.'", ".", "join", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool._SetAllFieldTypes
Sets all the descriptor's fields's types. This method also sets the containing types on any extensions. Args: package: The current package of desc_proto. desc_proto: The message descriptor to update. scope: Enclosing scope of available types.
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def _SetAllFieldTypes(self, package, desc_proto, scope): """Sets all the descriptor's fields's types. This method also sets the containing types on any extensions. Args: package: The current package of desc_proto. desc_proto: The message descriptor to update. scope: Enclosing scope of av...
def _SetAllFieldTypes(self, package, desc_proto, scope): """Sets all the descriptor's fields's types. This method also sets the containing types on any extensions. Args: package: The current package of desc_proto. desc_proto: The message descriptor to update. scope: Enclosing scope of av...
[ "Sets", "all", "the", "descriptor", "s", "fields", "s", "types", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L752-L782
[ "def", "_SetAllFieldTypes", "(", "self", ",", "package", ",", "desc_proto", ",", "scope", ")", ":", "package", "=", "_PrefixWithDot", "(", "package", ")", "main_desc", "=", "self", ".", "_GetTypeFromScope", "(", "package", ",", "desc_proto", ".", "name", ","...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool._SetFieldType
Sets the field's type, cpp_type, message_type and enum_type. Args: field_proto: Data about the field in proto format. field_desc: The descriptor to modiy. package: The package the field's container is in. scope: Enclosing scope of available types.
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def _SetFieldType(self, field_proto, field_desc, package, scope): """Sets the field's type, cpp_type, message_type and enum_type. Args: field_proto: Data about the field in proto format. field_desc: The descriptor to modiy. package: The package the field's container is in. scope: Enclos...
def _SetFieldType(self, field_proto, field_desc, package, scope): """Sets the field's type, cpp_type, message_type and enum_type. Args: field_proto: Data about the field in proto format. field_desc: The descriptor to modiy. package: The package the field's container is in. scope: Enclos...
[ "Sets", "the", "field", "s", "type", "cpp_type", "message_type", "and", "enum_type", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L784-L852
[ "def", "_SetFieldType", "(", "self", ",", "field_proto", ",", "field_desc", ",", "package", ",", "scope", ")", ":", "if", "field_proto", ".", "type_name", ":", "desc", "=", "self", ".", "_GetTypeFromScope", "(", "package", ",", "field_proto", ".", "type_name...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool._MakeEnumValueDescriptor
Creates a enum value descriptor object from a enum value proto. Args: value_proto: The proto describing the enum value. index: The index of the enum value. Returns: An initialized EnumValueDescriptor object.
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def _MakeEnumValueDescriptor(self, value_proto, index): """Creates a enum value descriptor object from a enum value proto. Args: value_proto: The proto describing the enum value. index: The index of the enum value. Returns: An initialized EnumValueDescriptor object. """ return d...
def _MakeEnumValueDescriptor(self, value_proto, index): """Creates a enum value descriptor object from a enum value proto. Args: value_proto: The proto describing the enum value. index: The index of the enum value. Returns: An initialized EnumValueDescriptor object. """ return d...
[ "Creates", "a", "enum", "value", "descriptor", "object", "from", "a", "enum", "value", "proto", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L854-L870
[ "def", "_MakeEnumValueDescriptor", "(", "self", ",", "value_proto", ",", "index", ")", ":", "return", "descriptor", ".", "EnumValueDescriptor", "(", "name", "=", "value_proto", ".", "name", ",", "index", "=", "index", ",", "number", "=", "value_proto", ".", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool._MakeServiceDescriptor
Make a protobuf ServiceDescriptor given a ServiceDescriptorProto. Args: service_proto: The descriptor_pb2.ServiceDescriptorProto protobuf message. service_index: The index of the service in the File. scope: Dict mapping short and full symbols to message and enum types. package: Optional pac...
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def _MakeServiceDescriptor(self, service_proto, service_index, scope, package, file_desc): """Make a protobuf ServiceDescriptor given a ServiceDescriptorProto. Args: service_proto: The descriptor_pb2.ServiceDescriptorProto protobuf message. service_index: The index of t...
def _MakeServiceDescriptor(self, service_proto, service_index, scope, package, file_desc): """Make a protobuf ServiceDescriptor given a ServiceDescriptorProto. Args: service_proto: The descriptor_pb2.ServiceDescriptorProto protobuf message. service_index: The index of t...
[ "Make", "a", "protobuf", "ServiceDescriptor", "given", "a", "ServiceDescriptorProto", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L872-L902
[ "def", "_MakeServiceDescriptor", "(", "self", ",", "service_proto", ",", "service_index", ",", "scope", ",", "package", ",", "file_desc", ")", ":", "if", "package", ":", "service_name", "=", "'.'", ".", "join", "(", "(", "package", ",", "service_proto", ".",...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool._MakeMethodDescriptor
Creates a method descriptor from a MethodDescriptorProto. Args: method_proto: The proto describing the method. service_name: The name of the containing service. package: Optional package name to look up for types. scope: Scope containing available types. index: Index of the method in ...
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def _MakeMethodDescriptor(self, method_proto, service_name, package, scope, index): """Creates a method descriptor from a MethodDescriptorProto. Args: method_proto: The proto describing the method. service_name: The name of the containing service. package: Optional...
def _MakeMethodDescriptor(self, method_proto, service_name, package, scope, index): """Creates a method descriptor from a MethodDescriptorProto. Args: method_proto: The proto describing the method. service_name: The name of the containing service. package: Optional...
[ "Creates", "a", "method", "descriptor", "from", "a", "MethodDescriptorProto", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L904-L929
[ "def", "_MakeMethodDescriptor", "(", "self", ",", "method_proto", ",", "service_name", ",", "package", ",", "scope", ",", "index", ")", ":", "full_name", "=", "'.'", ".", "join", "(", "(", "service_name", ",", "method_proto", ".", "name", ")", ")", "input_...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool._ExtractSymbols
Pulls out all the symbols from descriptor protos. Args: descriptors: The messages to extract descriptors from. Yields: A two element tuple of the type name and descriptor object.
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def _ExtractSymbols(self, descriptors): """Pulls out all the symbols from descriptor protos. Args: descriptors: The messages to extract descriptors from. Yields: A two element tuple of the type name and descriptor object. """ for desc in descriptors: yield (_PrefixWithDot(desc.fu...
def _ExtractSymbols(self, descriptors): """Pulls out all the symbols from descriptor protos. Args: descriptors: The messages to extract descriptors from. Yields: A two element tuple of the type name and descriptor object. """ for desc in descriptors: yield (_PrefixWithDot(desc.fu...
[ "Pulls", "out", "all", "the", "symbols", "from", "descriptor", "protos", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L931-L945
[ "def", "_ExtractSymbols", "(", "self", ",", "descriptors", ")", ":", "for", "desc", "in", "descriptors", ":", "yield", "(", "_PrefixWithDot", "(", "desc", ".", "full_name", ")", ",", "desc", ")", "for", "symbol", "in", "self", ".", "_ExtractSymbols", "(", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool._GetDeps
Recursively finds dependencies for file protos. Args: dependencies: The names of the files being depended on. Yields: Each direct and indirect dependency.
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def _GetDeps(self, dependencies): """Recursively finds dependencies for file protos. Args: dependencies: The names of the files being depended on. Yields: Each direct and indirect dependency. """ for dependency in dependencies: dep_desc = self.FindFileByName(dependency) yi...
def _GetDeps(self, dependencies): """Recursively finds dependencies for file protos. Args: dependencies: The names of the files being depended on. Yields: Each direct and indirect dependency. """ for dependency in dependencies: dep_desc = self.FindFileByName(dependency) yi...
[ "Recursively", "finds", "dependencies", "for", "file", "protos", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L947-L961
[ "def", "_GetDeps", "(", "self", ",", "dependencies", ")", ":", "for", "dependency", "in", "dependencies", ":", "dep_desc", "=", "self", ".", "FindFileByName", "(", "dependency", ")", "yield", "dep_desc", "for", "parent_dep", "in", "dep_desc", ".", "dependencie...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
DescriptorPool._GetTypeFromScope
Finds a given type name in the current scope. Args: package: The package the proto should be located in. type_name: The name of the type to be found in the scope. scope: Dict mapping short and full symbols to message and enum types. Returns: The descriptor for the requested type.
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
def _GetTypeFromScope(self, package, type_name, scope): """Finds a given type name in the current scope. Args: package: The package the proto should be located in. type_name: The name of the type to be found in the scope. scope: Dict mapping short and full symbols to message and enum types. ...
def _GetTypeFromScope(self, package, type_name, scope): """Finds a given type name in the current scope. Args: package: The package the proto should be located in. type_name: The name of the type to be found in the scope. scope: Dict mapping short and full symbols to message and enum types. ...
[ "Finds", "a", "given", "type", "name", "in", "the", "current", "scope", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L963-L983
[ "def", "_GetTypeFromScope", "(", "self", ",", "package", ",", "type_name", ",", "scope", ")", ":", "if", "type_name", "not", "in", "scope", ":", "components", "=", "_PrefixWithDot", "(", "package", ")", ".", "split", "(", "'.'", ")", "while", "components",...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
max_element
Returns the maximum number in 'elements'. Uses 'ordered' for comparisons, or '<' is none is provided.
deps/src/boost_1_68_0/tools/build/src/util/sequence.py
def max_element (elements, ordered = None): """ Returns the maximum number in 'elements'. Uses 'ordered' for comparisons, or '<' is none is provided. """ assert is_iterable(elements) assert callable(ordered) or ordered is None if not ordered: ordered = operator.lt max = elements [0] ...
def max_element (elements, ordered = None): """ Returns the maximum number in 'elements'. Uses 'ordered' for comparisons, or '<' is none is provided. """ assert is_iterable(elements) assert callable(ordered) or ordered is None if not ordered: ordered = operator.lt max = elements [0] ...
[ "Returns", "the", "maximum", "number", "in", "elements", ".", "Uses", "ordered", "for", "comparisons", "or", "<", "is", "none", "is", "provided", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/util/sequence.py#L24-L37
[ "def", "max_element", "(", "elements", ",", "ordered", "=", "None", ")", ":", "assert", "is_iterable", "(", "elements", ")", "assert", "callable", "(", "ordered", ")", "or", "ordered", "is", "None", "if", "not", "ordered", ":", "ordered", "=", "operator", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
select_highest_ranked
Returns all of 'elements' for which corresponding element in parallel list 'rank' is equal to the maximum value in 'rank'.
deps/src/boost_1_68_0/tools/build/src/util/sequence.py
def select_highest_ranked (elements, ranks): """ Returns all of 'elements' for which corresponding element in parallel list 'rank' is equal to the maximum value in 'rank'. """ assert is_iterable(elements) assert is_iterable(ranks) if not elements: return [] max_rank = max_elemen...
def select_highest_ranked (elements, ranks): """ Returns all of 'elements' for which corresponding element in parallel list 'rank' is equal to the maximum value in 'rank'. """ assert is_iterable(elements) assert is_iterable(ranks) if not elements: return [] max_rank = max_elemen...
[ "Returns", "all", "of", "elements", "for", "which", "corresponding", "element", "in", "parallel", "list", "rank", "is", "equal", "to", "the", "maximum", "value", "in", "rank", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/util/sequence.py#L39-L58
[ "def", "select_highest_ranked", "(", "elements", ",", "ranks", ")", ":", "assert", "is_iterable", "(", "elements", ")", "assert", "is_iterable", "(", "ranks", ")", "if", "not", "elements", ":", "return", "[", "]", "max_rank", "=", "max_element", "(", "ranks"...
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
Message.CopyFrom
Copies the content of the specified message into the current message. The method clears the current message and then merges the specified message using MergeFrom. Args: other_msg: Message to copy into the current one.
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/message.py
def CopyFrom(self, other_msg): """Copies the content of the specified message into the current message. The method clears the current message and then merges the specified message using MergeFrom. Args: other_msg: Message to copy into the current one. """ if self is other_msg: retu...
def CopyFrom(self, other_msg): """Copies the content of the specified message into the current message. The method clears the current message and then merges the specified message using MergeFrom. Args: other_msg: Message to copy into the current one. """ if self is other_msg: retu...
[ "Copies", "the", "content", "of", "the", "specified", "message", "into", "the", "current", "message", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/message.py#L106-L118
[ "def", "CopyFrom", "(", "self", ",", "other_msg", ")", ":", "if", "self", "is", "other_msg", ":", "return", "self", ".", "Clear", "(", ")", "self", ".", "MergeFrom", "(", "other_msg", ")" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
train
recurse_json
Traverse through the tree and append to the tree spec.
src/external/coremltools_wrap/coremltools/coremltools/converters/xgboost/_tree_ensemble.py
def recurse_json(mlkit_tree, xgb_tree_json, tree_id, node_id, feature_map, force_32bit_float): """Traverse through the tree and append to the tree spec. """ relative_hit_rate = None try: relative_hit_rate = xgb_tree_json['cover'] except KeyError: pass # Fill node attri...
def recurse_json(mlkit_tree, xgb_tree_json, tree_id, node_id, feature_map, force_32bit_float): """Traverse through the tree and append to the tree spec. """ relative_hit_rate = None try: relative_hit_rate = xgb_tree_json['cover'] except KeyError: pass # Fill node attri...
[ "Traverse", "through", "the", "tree", "and", "append", "to", "the", "tree", "spec", "." ]
apple/turicreate
python
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/xgboost/_tree_ensemble.py#L15-L73
[ "def", "recurse_json", "(", "mlkit_tree", ",", "xgb_tree_json", ",", "tree_id", ",", "node_id", ",", "feature_map", ",", "force_32bit_float", ")", ":", "relative_hit_rate", "=", "None", "try", ":", "relative_hit_rate", "=", "xgb_tree_json", "[", "'cover'", "]", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e