id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
29,000 | apple/turicreate | src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/flexible_shape_utils.py | can_allow_multiple_input_shapes | def can_allow_multiple_input_shapes(spec):
"""
Examines a model specification and determines if it can compute results for more than one output shape.
:param spec: MLModel
The protobuf specification of the model.
:return: Bool
Returns True if the model can allow multiple input shapes, ... | python | def can_allow_multiple_input_shapes(spec):
"""
Examines a model specification and determines if it can compute results for more than one output shape.
:param spec: MLModel
The protobuf specification of the model.
:return: Bool
Returns True if the model can allow multiple input shapes, ... | [
"def",
"can_allow_multiple_input_shapes",
"(",
"spec",
")",
":",
"# First, check that the model actually has a neural network in it",
"try",
":",
"layers",
"=",
"_get_nn_layers",
"(",
"spec",
")",
"except",
":",
"raise",
"Exception",
"(",
"'Unable to verify that this model co... | Examines a model specification and determines if it can compute results for more than one output shape.
:param spec: MLModel
The protobuf specification of the model.
:return: Bool
Returns True if the model can allow multiple input shapes, False otherwise. | [
"Examines",
"a",
"model",
"specification",
"and",
"determines",
"if",
"it",
"can",
"compute",
"results",
"for",
"more",
"than",
"one",
"output",
"shape",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/flexible_shape_utils.py#L575-L607 |
29,001 | apple/turicreate | src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/flexible_shape_utils.py | NeuralNetworkMultiArrayShapeRange.isFlexible | def isFlexible(self):
"""
Returns true if any one of the channel, height, or width ranges of this shape allow more than one input value.
"""
for key, value in self.arrayShapeRange.items():
if key in _CONSTRAINED_KEYS:
if value.isFlexible:
r... | python | def isFlexible(self):
"""
Returns true if any one of the channel, height, or width ranges of this shape allow more than one input value.
"""
for key, value in self.arrayShapeRange.items():
if key in _CONSTRAINED_KEYS:
if value.isFlexible:
r... | [
"def",
"isFlexible",
"(",
"self",
")",
":",
"for",
"key",
",",
"value",
"in",
"self",
".",
"arrayShapeRange",
".",
"items",
"(",
")",
":",
"if",
"key",
"in",
"_CONSTRAINED_KEYS",
":",
"if",
"value",
".",
"isFlexible",
":",
"return",
"True",
"return",
"... | Returns true if any one of the channel, height, or width ranges of this shape allow more than one input value. | [
"Returns",
"true",
"if",
"any",
"one",
"of",
"the",
"channel",
"height",
"or",
"width",
"ranges",
"of",
"this",
"shape",
"allow",
"more",
"than",
"one",
"input",
"value",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/flexible_shape_utils.py#L220-L229 |
29,002 | apple/turicreate | deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py | define_macro | def define_macro(out_f, (name, args, body), undefine=False, check=True):
"""Generate a macro definition or undefinition"""
if undefine:
out_f.write(
'#undef {0}\n'
.format(macro_name(name))
)
else:
if args:
arg_list = '({0})'.format(', '.join(args)... | python | def define_macro(out_f, (name, args, body), undefine=False, check=True):
"""Generate a macro definition or undefinition"""
if undefine:
out_f.write(
'#undef {0}\n'
.format(macro_name(name))
)
else:
if args:
arg_list = '({0})'.format(', '.join(args)... | [
"def",
"define_macro",
"(",
"out_f",
",",
"(",
"name",
",",
"args",
",",
"body",
")",
",",
"undefine",
"=",
"False",
",",
"check",
"=",
"True",
")",
":",
"if",
"undefine",
":",
"out_f",
".",
"write",
"(",
"'#undef {0}\\n'",
".",
"format",
"(",
"macro... | Generate a macro definition or undefinition | [
"Generate",
"a",
"macro",
"definition",
"or",
"undefinition"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py#L92-L115 |
29,003 | apple/turicreate | deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py | filename | def filename(out_dir, name, undefine=False):
"""Generate the filename"""
if undefine:
prefix = 'undef_'
else:
prefix = ''
return os.path.join(out_dir, '{0}{1}.hpp'.format(prefix, name.lower())) | python | def filename(out_dir, name, undefine=False):
"""Generate the filename"""
if undefine:
prefix = 'undef_'
else:
prefix = ''
return os.path.join(out_dir, '{0}{1}.hpp'.format(prefix, name.lower())) | [
"def",
"filename",
"(",
"out_dir",
",",
"name",
",",
"undefine",
"=",
"False",
")",
":",
"if",
"undefine",
":",
"prefix",
"=",
"'undef_'",
"else",
":",
"prefix",
"=",
"''",
"return",
"os",
".",
"path",
".",
"join",
"(",
"out_dir",
",",
"'{0}{1}.hpp'",
... | Generate the filename | [
"Generate",
"the",
"filename"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py#L118-L124 |
29,004 | apple/turicreate | deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py | length_limits | def length_limits(max_length_limit, length_limit_step):
"""Generates the length limits"""
string_len = len(str(max_length_limit))
return [
str(i).zfill(string_len) for i in
xrange(
length_limit_step,
max_length_limit + length_limit_step - 1,
length_limit_s... | python | def length_limits(max_length_limit, length_limit_step):
"""Generates the length limits"""
string_len = len(str(max_length_limit))
return [
str(i).zfill(string_len) for i in
xrange(
length_limit_step,
max_length_limit + length_limit_step - 1,
length_limit_s... | [
"def",
"length_limits",
"(",
"max_length_limit",
",",
"length_limit_step",
")",
":",
"string_len",
"=",
"len",
"(",
"str",
"(",
"max_length_limit",
")",
")",
"return",
"[",
"str",
"(",
"i",
")",
".",
"zfill",
"(",
"string_len",
")",
"for",
"i",
"in",
"xr... | Generates the length limits | [
"Generates",
"the",
"length",
"limits"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py#L127-L137 |
29,005 | apple/turicreate | deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py | generate_take | def generate_take(out_f, steps, line_prefix):
"""Generate the take function"""
out_f.write(
'{0}constexpr inline int take(int n_)\n'
'{0}{{\n'
'{0} return {1} 0 {2};\n'
'{0}}}\n'
'\n'.format(
line_prefix,
''.join('n_ >= {0} ? {0} : ('.format(s) fo... | python | def generate_take(out_f, steps, line_prefix):
"""Generate the take function"""
out_f.write(
'{0}constexpr inline int take(int n_)\n'
'{0}{{\n'
'{0} return {1} 0 {2};\n'
'{0}}}\n'
'\n'.format(
line_prefix,
''.join('n_ >= {0} ? {0} : ('.format(s) fo... | [
"def",
"generate_take",
"(",
"out_f",
",",
"steps",
",",
"line_prefix",
")",
":",
"out_f",
".",
"write",
"(",
"'{0}constexpr inline int take(int n_)\\n'",
"'{0}{{\\n'",
"'{0} return {1} 0 {2};\\n'",
"'{0}}}\\n'",
"'\\n'",
".",
"format",
"(",
"line_prefix",
",",
"''",... | Generate the take function | [
"Generate",
"the",
"take",
"function"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py#L145-L157 |
29,006 | apple/turicreate | deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py | generate_make_string | def generate_make_string(out_f, max_step):
"""Generate the make_string template"""
steps = [2 ** n for n in xrange(int(math.log(max_step, 2)), -1, -1)]
with Namespace(
out_f,
['boost', 'metaparse', 'v{0}'.format(VERSION), 'impl']
) as nsp:
generate_take(out_f, steps, nsp.prefix(... | python | def generate_make_string(out_f, max_step):
"""Generate the make_string template"""
steps = [2 ** n for n in xrange(int(math.log(max_step, 2)), -1, -1)]
with Namespace(
out_f,
['boost', 'metaparse', 'v{0}'.format(VERSION), 'impl']
) as nsp:
generate_take(out_f, steps, nsp.prefix(... | [
"def",
"generate_make_string",
"(",
"out_f",
",",
"max_step",
")",
":",
"steps",
"=",
"[",
"2",
"**",
"n",
"for",
"n",
"in",
"xrange",
"(",
"int",
"(",
"math",
".",
"log",
"(",
"max_step",
",",
"2",
")",
")",
",",
"-",
"1",
",",
"-",
"1",
")",
... | Generate the make_string template | [
"Generate",
"the",
"make_string",
"template"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py#L160-L199 |
29,007 | apple/turicreate | deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py | generate_string | def generate_string(out_dir, limits):
"""Generate string.hpp"""
max_limit = max((int(v) for v in limits))
with open(filename(out_dir, 'string'), 'wb') as out_f:
with IncludeGuard(out_f):
out_f.write(
'\n'
'#include <boost/metaparse/v{0}/cpp11/impl/concat.... | python | def generate_string(out_dir, limits):
"""Generate string.hpp"""
max_limit = max((int(v) for v in limits))
with open(filename(out_dir, 'string'), 'wb') as out_f:
with IncludeGuard(out_f):
out_f.write(
'\n'
'#include <boost/metaparse/v{0}/cpp11/impl/concat.... | [
"def",
"generate_string",
"(",
"out_dir",
",",
"limits",
")",
":",
"max_limit",
"=",
"max",
"(",
"(",
"int",
"(",
"v",
")",
"for",
"v",
"in",
"limits",
")",
")",
"with",
"open",
"(",
"filename",
"(",
"out_dir",
",",
"'string'",
")",
",",
"'wb'",
")... | Generate string.hpp | [
"Generate",
"string",
".",
"hpp"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py#L202-L275 |
29,008 | apple/turicreate | deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py | existing_path | def existing_path(value):
"""Throws when the path does not exist"""
if os.path.exists(value):
return value
else:
raise argparse.ArgumentTypeError("Path {0} not found".format(value)) | python | def existing_path(value):
"""Throws when the path does not exist"""
if os.path.exists(value):
return value
else:
raise argparse.ArgumentTypeError("Path {0} not found".format(value)) | [
"def",
"existing_path",
"(",
"value",
")",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"value",
")",
":",
"return",
"value",
"else",
":",
"raise",
"argparse",
".",
"ArgumentTypeError",
"(",
"\"Path {0} not found\"",
".",
"format",
"(",
"value",
")",
... | Throws when the path does not exist | [
"Throws",
"when",
"the",
"path",
"does",
"not",
"exist"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py#L287-L292 |
29,009 | apple/turicreate | deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py | Namespace.end | def end(self):
"""Generate the closing part"""
for depth in xrange(len(self.names) - 1, -1, -1):
self.out_f.write('{0}}}\n'.format(self.prefix(depth))) | python | def end(self):
"""Generate the closing part"""
for depth in xrange(len(self.names) - 1, -1, -1):
self.out_f.write('{0}}}\n'.format(self.prefix(depth))) | [
"def",
"end",
"(",
"self",
")",
":",
"for",
"depth",
"in",
"xrange",
"(",
"len",
"(",
"self",
".",
"names",
")",
"-",
"1",
",",
"-",
"1",
",",
"-",
"1",
")",
":",
"self",
".",
"out_f",
".",
"write",
"(",
"'{0}}}\\n'",
".",
"format",
"(",
"sel... | Generate the closing part | [
"Generate",
"the",
"closing",
"part"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/metaparse/tools/string_headers.py#L33-L36 |
29,010 | apple/turicreate | src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py | get_deep_features | def get_deep_features(audio_data, verbose=True):
'''
Calculates the deep features used by the Sound Classifier.
Internally the Sound Classifier calculates deep features for both model
creation and predictions. If the same data will be used multiple times,
calculating the deep features just once wil... | python | def get_deep_features(audio_data, verbose=True):
'''
Calculates the deep features used by the Sound Classifier.
Internally the Sound Classifier calculates deep features for both model
creation and predictions. If the same data will be used multiple times,
calculating the deep features just once wil... | [
"def",
"get_deep_features",
"(",
"audio_data",
",",
"verbose",
"=",
"True",
")",
":",
"from",
".",
"_audio_feature_extractor",
"import",
"_get_feature_extractor",
"if",
"not",
"_is_audio_data_sarray",
"(",
"audio_data",
")",
":",
"raise",
"TypeError",
"(",
"\"Input ... | Calculates the deep features used by the Sound Classifier.
Internally the Sound Classifier calculates deep features for both model
creation and predictions. If the same data will be used multiple times,
calculating the deep features just once will result in a significant speed
up.
Parameters
-... | [
"Calculates",
"the",
"deep",
"features",
"used",
"by",
"the",
"Sound",
"Classifier",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py#L45-L75 |
29,011 | apple/turicreate | src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py | SoundClassifier._load_version | def _load_version(cls, state, version):
"""
A function to load a previously saved SoundClassifier instance.
"""
from ._audio_feature_extractor import _get_feature_extractor
from .._mxnet import _mxnet_utils
state['_feature_extractor'] = _get_feature_extractor(state['feat... | python | def _load_version(cls, state, version):
"""
A function to load a previously saved SoundClassifier instance.
"""
from ._audio_feature_extractor import _get_feature_extractor
from .._mxnet import _mxnet_utils
state['_feature_extractor'] = _get_feature_extractor(state['feat... | [
"def",
"_load_version",
"(",
"cls",
",",
"state",
",",
"version",
")",
":",
"from",
".",
"_audio_feature_extractor",
"import",
"_get_feature_extractor",
"from",
".",
".",
"_mxnet",
"import",
"_mxnet_utils",
"state",
"[",
"'_feature_extractor'",
"]",
"=",
"_get_fea... | A function to load a previously saved SoundClassifier instance. | [
"A",
"function",
"to",
"load",
"a",
"previously",
"saved",
"SoundClassifier",
"instance",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py#L363-L388 |
29,012 | apple/turicreate | src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py | SoundClassifier.classify | def classify(self, dataset, verbose=True, batch_size=64):
"""
Return the classification for each examples in the ``dataset``.
The output SFrame contains predicted class labels and its probability.
Parameters
----------
dataset : SFrame | SArray | dict
The aud... | python | def classify(self, dataset, verbose=True, batch_size=64):
"""
Return the classification for each examples in the ``dataset``.
The output SFrame contains predicted class labels and its probability.
Parameters
----------
dataset : SFrame | SArray | dict
The aud... | [
"def",
"classify",
"(",
"self",
",",
"dataset",
",",
"verbose",
"=",
"True",
",",
"batch_size",
"=",
"64",
")",
":",
"prob_vector",
"=",
"self",
".",
"predict",
"(",
"dataset",
",",
"output_type",
"=",
"'probability_vector'",
",",
"verbose",
"=",
"verbose"... | Return the classification for each examples in the ``dataset``.
The output SFrame contains predicted class labels and its probability.
Parameters
----------
dataset : SFrame | SArray | dict
The audio data to be classified.
If dataset is an SFrame, it must have a ... | [
"Return",
"the",
"classification",
"for",
"each",
"examples",
"in",
"the",
"dataset",
".",
"The",
"output",
"SFrame",
"contains",
"predicted",
"class",
"labels",
"and",
"its",
"probability",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/sound_classifier/sound_classifier.py#L447-L487 |
29,013 | apple/turicreate | src/unity/python/turicreate/toolkits/_mxnet/_mx_sframe_iter.py | _init_data | def _init_data(data, allow_empty, default_name):
"""Convert data into canonical form."""
assert (data is not None) or allow_empty
if data is None:
data = []
if isinstance(data, (np.ndarray, NDArray)):
data = [data]
if isinstance(data, list):
if not allow_empty:
a... | python | def _init_data(data, allow_empty, default_name):
"""Convert data into canonical form."""
assert (data is not None) or allow_empty
if data is None:
data = []
if isinstance(data, (np.ndarray, NDArray)):
data = [data]
if isinstance(data, list):
if not allow_empty:
a... | [
"def",
"_init_data",
"(",
"data",
",",
"allow_empty",
",",
"default_name",
")",
":",
"assert",
"(",
"data",
"is",
"not",
"None",
")",
"or",
"allow_empty",
"if",
"data",
"is",
"None",
":",
"data",
"=",
"[",
"]",
"if",
"isinstance",
"(",
"data",
",",
"... | Convert data into canonical form. | [
"Convert",
"data",
"into",
"canonical",
"form",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_mxnet/_mx_sframe_iter.py#L37-L62 |
29,014 | apple/turicreate | src/unity/python/turicreate/toolkits/_mxnet/_mx_sframe_iter.py | SFrameIter.provide_data | def provide_data(self):
"""The name and shape of data provided by this iterator"""
return [(k, tuple([self.batch_size] + list(v.shape[1:]))) for k, v in self.data] | python | def provide_data(self):
"""The name and shape of data provided by this iterator"""
return [(k, tuple([self.batch_size] + list(v.shape[1:]))) for k, v in self.data] | [
"def",
"provide_data",
"(",
"self",
")",
":",
"return",
"[",
"(",
"k",
",",
"tuple",
"(",
"[",
"self",
".",
"batch_size",
"]",
"+",
"list",
"(",
"v",
".",
"shape",
"[",
"1",
":",
"]",
")",
")",
")",
"for",
"k",
",",
"v",
"in",
"self",
".",
... | The name and shape of data provided by this iterator | [
"The",
"name",
"and",
"shape",
"of",
"data",
"provided",
"by",
"this",
"iterator"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_mxnet/_mx_sframe_iter.py#L134-L136 |
29,015 | apple/turicreate | src/unity/python/turicreate/toolkits/_mxnet/_mx_sframe_iter.py | SFrameIter.provide_label | def provide_label(self):
"""The name and shape of label provided by this iterator"""
return [(k, tuple([self.batch_size] + list(v.shape[1:]))) for k, v in self.label] | python | def provide_label(self):
"""The name and shape of label provided by this iterator"""
return [(k, tuple([self.batch_size] + list(v.shape[1:]))) for k, v in self.label] | [
"def",
"provide_label",
"(",
"self",
")",
":",
"return",
"[",
"(",
"k",
",",
"tuple",
"(",
"[",
"self",
".",
"batch_size",
"]",
"+",
"list",
"(",
"v",
".",
"shape",
"[",
"1",
":",
"]",
")",
")",
")",
"for",
"k",
",",
"v",
"in",
"self",
".",
... | The name and shape of label provided by this iterator | [
"The",
"name",
"and",
"shape",
"of",
"label",
"provided",
"by",
"this",
"iterator"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_mxnet/_mx_sframe_iter.py#L139-L141 |
29,016 | apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | register | def register (g):
""" Registers new generator instance 'g'.
"""
assert isinstance(g, Generator)
id = g.id()
__generators [id] = g
# A generator can produce several targets of the
# same type. We want unique occurence of that generator
# in .generators.$(t) in that case, otherwise, it w... | python | def register (g):
""" Registers new generator instance 'g'.
"""
assert isinstance(g, Generator)
id = g.id()
__generators [id] = g
# A generator can produce several targets of the
# same type. We want unique occurence of that generator
# in .generators.$(t) in that case, otherwise, it w... | [
"def",
"register",
"(",
"g",
")",
":",
"assert",
"isinstance",
"(",
"g",
",",
"Generator",
")",
"id",
"=",
"g",
".",
"id",
"(",
")",
"__generators",
"[",
"id",
"]",
"=",
"g",
"# A generator can produce several targets of the",
"# same type. We want unique occure... | Registers new generator instance 'g'. | [
"Registers",
"new",
"generator",
"instance",
"g",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L657-L706 |
29,017 | apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | override | def override (overrider_id, overridee_id):
"""Make generator 'overrider-id' be preferred to
'overridee-id'. If, when searching for generators
that could produce a target of certain type,
both those generators are amoung viable generators,
the overridden generator is immediately discarded.
The o... | python | def override (overrider_id, overridee_id):
"""Make generator 'overrider-id' be preferred to
'overridee-id'. If, when searching for generators
that could produce a target of certain type,
both those generators are amoung viable generators,
the overridden generator is immediately discarded.
The o... | [
"def",
"override",
"(",
"overrider_id",
",",
"overridee_id",
")",
":",
"assert",
"isinstance",
"(",
"overrider_id",
",",
"basestring",
")",
"assert",
"isinstance",
"(",
"overridee_id",
",",
"basestring",
")",
"__overrides",
".",
"setdefault",
"(",
"overrider_id",
... | Make generator 'overrider-id' be preferred to
'overridee-id'. If, when searching for generators
that could produce a target of certain type,
both those generators are amoung viable generators,
the overridden generator is immediately discarded.
The overridden generators are discarded immediately
... | [
"Make",
"generator",
"overrider",
"-",
"id",
"be",
"preferred",
"to",
"overridee",
"-",
"id",
".",
"If",
"when",
"searching",
"for",
"generators",
"that",
"could",
"produce",
"a",
"target",
"of",
"certain",
"type",
"both",
"those",
"generators",
"are",
"amou... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L747-L760 |
29,018 | apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | __viable_source_types_real | def __viable_source_types_real (target_type):
""" Returns a list of source type which can possibly be converted
to 'target_type' by some chain of generator invocation.
More formally, takes all generators for 'target_type' and
returns union of source types for those generators and result
... | python | def __viable_source_types_real (target_type):
""" Returns a list of source type which can possibly be converted
to 'target_type' by some chain of generator invocation.
More formally, takes all generators for 'target_type' and
returns union of source types for those generators and result
... | [
"def",
"__viable_source_types_real",
"(",
"target_type",
")",
":",
"assert",
"isinstance",
"(",
"target_type",
",",
"basestring",
")",
"generators",
"=",
"[",
"]",
"# 't0' is the initial list of target types we need to process to get a list",
"# of their viable source target type... | Returns a list of source type which can possibly be converted
to 'target_type' by some chain of generator invocation.
More formally, takes all generators for 'target_type' and
returns union of source types for those generators and result
of calling itself recusrively on source types. | [
"Returns",
"a",
"list",
"of",
"source",
"type",
"which",
"can",
"possibly",
"be",
"converted",
"to",
"target_type",
"by",
"some",
"chain",
"of",
"generator",
"invocation",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L762-L820 |
29,019 | apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | viable_source_types_for_generator | def viable_source_types_for_generator (generator):
""" Caches the result of 'viable_source_types_for_generator'.
"""
assert isinstance(generator, Generator)
if generator not in __viable_source_types_cache:
__vstg_cached_generators.append(generator)
__viable_source_types_cache[generator] ... | python | def viable_source_types_for_generator (generator):
""" Caches the result of 'viable_source_types_for_generator'.
"""
assert isinstance(generator, Generator)
if generator not in __viable_source_types_cache:
__vstg_cached_generators.append(generator)
__viable_source_types_cache[generator] ... | [
"def",
"viable_source_types_for_generator",
"(",
"generator",
")",
":",
"assert",
"isinstance",
"(",
"generator",
",",
"Generator",
")",
"if",
"generator",
"not",
"in",
"__viable_source_types_cache",
":",
"__vstg_cached_generators",
".",
"append",
"(",
"generator",
")... | Caches the result of 'viable_source_types_for_generator'. | [
"Caches",
"the",
"result",
"of",
"viable_source_types_for_generator",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L859-L867 |
29,020 | apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | try_one_generator_really | def try_one_generator_really (project, name, generator, target_type, properties, sources):
""" Returns usage requirements + list of created targets.
"""
if __debug__:
from .targets import ProjectTarget
assert isinstance(project, ProjectTarget)
assert isinstance(name, basestring) or n... | python | def try_one_generator_really (project, name, generator, target_type, properties, sources):
""" Returns usage requirements + list of created targets.
"""
if __debug__:
from .targets import ProjectTarget
assert isinstance(project, ProjectTarget)
assert isinstance(name, basestring) or n... | [
"def",
"try_one_generator_really",
"(",
"project",
",",
"name",
",",
"generator",
",",
"target_type",
",",
"properties",
",",
"sources",
")",
":",
"if",
"__debug__",
":",
"from",
".",
"targets",
"import",
"ProjectTarget",
"assert",
"isinstance",
"(",
"project",
... | Returns usage requirements + list of created targets. | [
"Returns",
"usage",
"requirements",
"+",
"list",
"of",
"created",
"targets",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L869-L907 |
29,021 | apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | try_one_generator | def try_one_generator (project, name, generator, target_type, properties, sources):
""" Checks if generator invocation can be pruned, because it's guaranteed
to fail. If so, quickly returns empty list. Otherwise, calls
try_one_generator_really.
"""
if __debug__:
from .targets import ... | python | def try_one_generator (project, name, generator, target_type, properties, sources):
""" Checks if generator invocation can be pruned, because it's guaranteed
to fail. If so, quickly returns empty list. Otherwise, calls
try_one_generator_really.
"""
if __debug__:
from .targets import ... | [
"def",
"try_one_generator",
"(",
"project",
",",
"name",
",",
"generator",
",",
"target_type",
",",
"properties",
",",
"sources",
")",
":",
"if",
"__debug__",
":",
"from",
".",
"targets",
"import",
"ProjectTarget",
"assert",
"isinstance",
"(",
"project",
",",
... | Checks if generator invocation can be pruned, because it's guaranteed
to fail. If so, quickly returns empty list. Otherwise, calls
try_one_generator_really. | [
"Checks",
"if",
"generator",
"invocation",
"can",
"be",
"pruned",
"because",
"it",
"s",
"guaranteed",
"to",
"fail",
".",
"If",
"so",
"quickly",
"returns",
"empty",
"list",
".",
"Otherwise",
"calls",
"try_one_generator_really",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L909-L940 |
29,022 | apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | __ensure_type | def __ensure_type (targets):
""" Ensures all 'targets' have types. If this is not so, exists with
error.
"""
assert is_iterable_typed(targets, virtual_target.VirtualTarget)
for t in targets:
if not t.type ():
get_manager().errors()("target '%s' has no type" % str (t)) | python | def __ensure_type (targets):
""" Ensures all 'targets' have types. If this is not so, exists with
error.
"""
assert is_iterable_typed(targets, virtual_target.VirtualTarget)
for t in targets:
if not t.type ():
get_manager().errors()("target '%s' has no type" % str (t)) | [
"def",
"__ensure_type",
"(",
"targets",
")",
":",
"assert",
"is_iterable_typed",
"(",
"targets",
",",
"virtual_target",
".",
"VirtualTarget",
")",
"for",
"t",
"in",
"targets",
":",
"if",
"not",
"t",
".",
"type",
"(",
")",
":",
"get_manager",
"(",
")",
".... | Ensures all 'targets' have types. If this is not so, exists with
error. | [
"Ensures",
"all",
"targets",
"have",
"types",
".",
"If",
"this",
"is",
"not",
"so",
"exists",
"with",
"error",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L978-L985 |
29,023 | apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | __construct_really | def __construct_really (project, name, target_type, prop_set, sources):
""" Attempts to construct target by finding viable generators, running them
and selecting the dependency graph.
"""
if __debug__:
from .targets import ProjectTarget
assert isinstance(project, ProjectTarget)
... | python | def __construct_really (project, name, target_type, prop_set, sources):
""" Attempts to construct target by finding viable generators, running them
and selecting the dependency graph.
"""
if __debug__:
from .targets import ProjectTarget
assert isinstance(project, ProjectTarget)
... | [
"def",
"__construct_really",
"(",
"project",
",",
"name",
",",
"target_type",
",",
"prop_set",
",",
"sources",
")",
":",
"if",
"__debug__",
":",
"from",
".",
"targets",
"import",
"ProjectTarget",
"assert",
"isinstance",
"(",
"project",
",",
"ProjectTarget",
")... | Attempts to construct target by finding viable generators, running them
and selecting the dependency graph. | [
"Attempts",
"to",
"construct",
"target",
"by",
"finding",
"viable",
"generators",
"running",
"them",
"and",
"selecting",
"the",
"dependency",
"graph",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L1091-L1136 |
29,024 | apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | Generator.match_rank | def match_rank (self, ps):
""" Returns true if the generator can be run with the specified
properties.
"""
# See if generator's requirements are satisfied by
# 'properties'. Treat a feature name in requirements
# (i.e. grist-only element), as matching any value of th... | python | def match_rank (self, ps):
""" Returns true if the generator can be run with the specified
properties.
"""
# See if generator's requirements are satisfied by
# 'properties'. Treat a feature name in requirements
# (i.e. grist-only element), as matching any value of th... | [
"def",
"match_rank",
"(",
"self",
",",
"ps",
")",
":",
"# See if generator's requirements are satisfied by",
"# 'properties'. Treat a feature name in requirements",
"# (i.e. grist-only element), as matching any value of the",
"# feature.",
"assert",
"isinstance",
"(",
"ps",
",",
"... | Returns true if the generator can be run with the specified
properties. | [
"Returns",
"true",
"if",
"the",
"generator",
"can",
"be",
"run",
"with",
"the",
"specified",
"properties",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L301-L325 |
29,025 | apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | Generator.determine_output_name | def determine_output_name(self, sources):
"""Determine the name of the produced target from the
names of the sources."""
assert is_iterable_typed(sources, virtual_target.VirtualTarget)
# The simple case if when a name
# of source has single dot. Then, we take the part before
... | python | def determine_output_name(self, sources):
"""Determine the name of the produced target from the
names of the sources."""
assert is_iterable_typed(sources, virtual_target.VirtualTarget)
# The simple case if when a name
# of source has single dot. Then, we take the part before
... | [
"def",
"determine_output_name",
"(",
"self",
",",
"sources",
")",
":",
"assert",
"is_iterable_typed",
"(",
"sources",
",",
"virtual_target",
".",
"VirtualTarget",
")",
"# The simple case if when a name",
"# of source has single dot. Then, we take the part before",
"# dot. Sever... | Determine the name of the produced target from the
names of the sources. | [
"Determine",
"the",
"name",
"of",
"the",
"produced",
"target",
"from",
"the",
"names",
"of",
"the",
"sources",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L451-L475 |
29,026 | apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | Generator.generated_targets | def generated_targets (self, sources, prop_set, project, name):
""" Constructs targets that are created after consuming 'sources'.
The result will be the list of virtual-target, which the same length
as 'target_types' attribute and with corresponding types.
When 'name' is em... | python | def generated_targets (self, sources, prop_set, project, name):
""" Constructs targets that are created after consuming 'sources'.
The result will be the list of virtual-target, which the same length
as 'target_types' attribute and with corresponding types.
When 'name' is em... | [
"def",
"generated_targets",
"(",
"self",
",",
"sources",
",",
"prop_set",
",",
"project",
",",
"name",
")",
":",
"if",
"__debug__",
":",
"from",
".",
"targets",
"import",
"ProjectTarget",
"assert",
"is_iterable_typed",
"(",
"sources",
",",
"virtual_target",
".... | Constructs targets that are created after consuming 'sources'.
The result will be the list of virtual-target, which the same length
as 'target_types' attribute and with corresponding types.
When 'name' is empty, all source targets must have the same value of
the 'name' a... | [
"Constructs",
"targets",
"that",
"are",
"created",
"after",
"consuming",
"sources",
".",
"The",
"result",
"will",
"be",
"the",
"list",
"of",
"virtual",
"-",
"target",
"which",
"the",
"same",
"length",
"as",
"target_types",
"attribute",
"and",
"with",
"correspo... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L478-L526 |
29,027 | apple/turicreate | deps/src/boost_1_68_0/tools/build/src/build/generators.py | Generator.convert_multiple_sources_to_consumable_types | def convert_multiple_sources_to_consumable_types (self, project, prop_set, sources):
""" Converts several files to consumable types.
"""
if __debug__:
from .targets import ProjectTarget
assert isinstance(project, ProjectTarget)
assert isinstance(prop_set, pro... | python | def convert_multiple_sources_to_consumable_types (self, project, prop_set, sources):
""" Converts several files to consumable types.
"""
if __debug__:
from .targets import ProjectTarget
assert isinstance(project, ProjectTarget)
assert isinstance(prop_set, pro... | [
"def",
"convert_multiple_sources_to_consumable_types",
"(",
"self",
",",
"project",
",",
"prop_set",
",",
"sources",
")",
":",
"if",
"__debug__",
":",
"from",
".",
"targets",
"import",
"ProjectTarget",
"assert",
"isinstance",
"(",
"project",
",",
"ProjectTarget",
... | Converts several files to consumable types. | [
"Converts",
"several",
"files",
"to",
"consumable",
"types",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/generators.py#L588-L619 |
29,028 | apple/turicreate | src/unity/python/turicreate/data_structures/sketch.py | Sketch.element_sub_sketch | def element_sub_sketch(self, keys = None):
"""
Returns the sketch summary for the given set of keys. This is only
applicable for sketch summary created from SArray of sarray or dict type.
For dict SArray, the keys are the keys in dict value.
For array Sarray, the keys are indexes... | python | def element_sub_sketch(self, keys = None):
"""
Returns the sketch summary for the given set of keys. This is only
applicable for sketch summary created from SArray of sarray or dict type.
For dict SArray, the keys are the keys in dict value.
For array Sarray, the keys are indexes... | [
"def",
"element_sub_sketch",
"(",
"self",
",",
"keys",
"=",
"None",
")",
":",
"single_val",
"=",
"False",
"if",
"keys",
"is",
"None",
":",
"keys",
"=",
"[",
"]",
"else",
":",
"if",
"not",
"isinstance",
"(",
"keys",
",",
"list",
")",
":",
"single_val"... | Returns the sketch summary for the given set of keys. This is only
applicable for sketch summary created from SArray of sarray or dict type.
For dict SArray, the keys are the keys in dict value.
For array Sarray, the keys are indexes into the array value.
The keys must be passed into or... | [
"Returns",
"the",
"sketch",
"summary",
"for",
"the",
"given",
"set",
"of",
"keys",
".",
"This",
"is",
"only",
"applicable",
"for",
"sketch",
"summary",
"created",
"from",
"SArray",
"of",
"sarray",
"or",
"dict",
"type",
".",
"For",
"dict",
"SArray",
"the",
... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sketch.py#L662-L740 |
29,029 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | _get_global_dbapi_info | def _get_global_dbapi_info(dbapi_module, conn):
"""
Fetches all needed information from the top-level DBAPI module,
guessing at the module if it wasn't passed as a parameter. Returns a
dictionary of all the needed variables. This is put in one place to
make sure the error message is clear if the mod... | python | def _get_global_dbapi_info(dbapi_module, conn):
"""
Fetches all needed information from the top-level DBAPI module,
guessing at the module if it wasn't passed as a parameter. Returns a
dictionary of all the needed variables. This is put in one place to
make sure the error message is clear if the mod... | [
"def",
"_get_global_dbapi_info",
"(",
"dbapi_module",
",",
"conn",
")",
":",
"module_given_msg",
"=",
"\"The DBAPI2 module given ({0}) is missing the global\\n\"",
"+",
"\"variable '{1}'. Please make sure you are supplying a module that\\n\"",
"+",
"\"conforms to the DBAPI 2.0 standard (... | Fetches all needed information from the top-level DBAPI module,
guessing at the module if it wasn't passed as a parameter. Returns a
dictionary of all the needed variables. This is put in one place to
make sure the error message is clear if the module "guess" is wrong. | [
"Fetches",
"all",
"needed",
"information",
"from",
"the",
"top",
"-",
"level",
"DBAPI",
"module",
"guessing",
"at",
"the",
"module",
"if",
"it",
"wasn",
"t",
"passed",
"as",
"a",
"parameter",
".",
"Returns",
"a",
"dictionary",
"of",
"all",
"the",
"needed",... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L86-L144 |
29,030 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.read_csv_with_errors | def read_csv_with_errors(cls,
url,
delimiter=',',
header=True,
comment_char='',
escape_char='\\',
double_quote=True,
... | python | def read_csv_with_errors(cls,
url,
delimiter=',',
header=True,
comment_char='',
escape_char='\\',
double_quote=True,
... | [
"def",
"read_csv_with_errors",
"(",
"cls",
",",
"url",
",",
"delimiter",
"=",
"','",
",",
"header",
"=",
"True",
",",
"comment_char",
"=",
"''",
",",
"escape_char",
"=",
"'\\\\'",
",",
"double_quote",
"=",
"True",
",",
"quote_char",
"=",
"'\\\"'",
",",
"... | Constructs an SFrame from a CSV file or a path to multiple CSVs, and
returns a pair containing the SFrame and a dict of filenames to SArrays
indicating for each file, what are the incorrectly parsed lines
encountered.
Parameters
----------
url : string
Locati... | [
"Constructs",
"an",
"SFrame",
"from",
"a",
"CSV",
"file",
"or",
"a",
"path",
"to",
"multiple",
"CSVs",
"and",
"returns",
"a",
"pair",
"containing",
"the",
"SFrame",
"and",
"a",
"dict",
"of",
"filenames",
"to",
"SArrays",
"indicating",
"for",
"each",
"file"... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L1066-L1228 |
29,031 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.read_json | def read_json(cls,
url,
orient='records'):
"""
Reads a JSON file representing a table into an SFrame.
Parameters
----------
url : string
Location of the CSV file or directory to load. If URL is a directory
or a "glob" p... | python | def read_json(cls,
url,
orient='records'):
"""
Reads a JSON file representing a table into an SFrame.
Parameters
----------
url : string
Location of the CSV file or directory to load. If URL is a directory
or a "glob" p... | [
"def",
"read_json",
"(",
"cls",
",",
"url",
",",
"orient",
"=",
"'records'",
")",
":",
"if",
"orient",
"==",
"\"records\"",
":",
"g",
"=",
"SArray",
".",
"read_json",
"(",
"url",
")",
"if",
"len",
"(",
"g",
")",
"==",
"0",
":",
"return",
"SFrame",
... | Reads a JSON file representing a table into an SFrame.
Parameters
----------
url : string
Location of the CSV file or directory to load. If URL is a directory
or a "glob" pattern, all matching files will be loaded.
orient : string, optional. Either "records" or ... | [
"Reads",
"a",
"JSON",
"file",
"representing",
"a",
"table",
"into",
"an",
"SFrame",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L1516-L1619 |
29,032 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.to_sql | def to_sql(self, conn, table_name, dbapi_module=None,
use_python_type_specifiers=False, use_exact_column_names=True):
"""
Convert an SFrame to a single table in a SQL database.
This function does not attempt to create the table or check if a table
named `table_name` exists i... | python | def to_sql(self, conn, table_name, dbapi_module=None,
use_python_type_specifiers=False, use_exact_column_names=True):
"""
Convert an SFrame to a single table in a SQL database.
This function does not attempt to create the table or check if a table
named `table_name` exists i... | [
"def",
"to_sql",
"(",
"self",
",",
"conn",
",",
"table_name",
",",
"dbapi_module",
"=",
"None",
",",
"use_python_type_specifiers",
"=",
"False",
",",
"use_exact_column_names",
"=",
"True",
")",
":",
"mod_info",
"=",
"_get_global_dbapi_info",
"(",
"dbapi_module",
... | Convert an SFrame to a single table in a SQL database.
This function does not attempt to create the table or check if a table
named `table_name` exists in the database. It simply assumes that
`table_name` exists in the database and appends to it.
`to_sql` can be thought of as a conveni... | [
"Convert",
"an",
"SFrame",
"to",
"a",
"single",
"table",
"in",
"a",
"SQL",
"database",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L1845-L1942 |
29,033 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.print_rows | def print_rows(self, num_rows=10, num_columns=40, max_column_width=30,
max_row_width=80, output_file=None):
"""
Print the first M rows and N columns of the SFrame in human readable
format.
Parameters
----------
num_rows : int, optional
Numb... | python | def print_rows(self, num_rows=10, num_columns=40, max_column_width=30,
max_row_width=80, output_file=None):
"""
Print the first M rows and N columns of the SFrame in human readable
format.
Parameters
----------
num_rows : int, optional
Numb... | [
"def",
"print_rows",
"(",
"self",
",",
"num_rows",
"=",
"10",
",",
"num_columns",
"=",
"40",
",",
"max_column_width",
"=",
"30",
",",
"max_row_width",
"=",
"80",
",",
"output_file",
"=",
"None",
")",
":",
"if",
"output_file",
"is",
"None",
":",
"output_f... | Print the first M rows and N columns of the SFrame in human readable
format.
Parameters
----------
num_rows : int, optional
Number of rows to print.
num_columns : int, optional
Number of columns to print.
max_column_width : int, optional
... | [
"Print",
"the",
"first",
"M",
"rows",
"and",
"N",
"columns",
"of",
"the",
"SFrame",
"in",
"human",
"readable",
"format",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2117-L2160 |
29,034 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame._row_selector | def _row_selector(self, other):
"""
Where other is an SArray of identical length as the current Frame,
this returns a selection of a subset of rows in the current SFrame
where the corresponding row in the selector is non-zero.
"""
if type(other) is SArray:
if ... | python | def _row_selector(self, other):
"""
Where other is an SArray of identical length as the current Frame,
this returns a selection of a subset of rows in the current SFrame
where the corresponding row in the selector is non-zero.
"""
if type(other) is SArray:
if ... | [
"def",
"_row_selector",
"(",
"self",
",",
"other",
")",
":",
"if",
"type",
"(",
"other",
")",
"is",
"SArray",
":",
"if",
"self",
".",
"__has_size__",
"(",
")",
"and",
"other",
".",
"__has_size__",
"(",
")",
"and",
"len",
"(",
"other",
")",
"!=",
"l... | Where other is an SArray of identical length as the current Frame,
this returns a selection of a subset of rows in the current SFrame
where the corresponding row in the selector is non-zero. | [
"Where",
"other",
"is",
"an",
"SArray",
"of",
"identical",
"length",
"as",
"the",
"current",
"Frame",
"this",
"returns",
"a",
"selection",
"of",
"a",
"subset",
"of",
"rows",
"in",
"the",
"current",
"SFrame",
"where",
"the",
"corresponding",
"row",
"in",
"t... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2268-L2278 |
29,035 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.to_dataframe | def to_dataframe(self):
"""
Convert this SFrame to pandas.DataFrame.
This operation will construct a pandas.DataFrame in memory. Care must
be taken when size of the returned object is big.
Returns
-------
out : pandas.DataFrame
The dataframe which co... | python | def to_dataframe(self):
"""
Convert this SFrame to pandas.DataFrame.
This operation will construct a pandas.DataFrame in memory. Care must
be taken when size of the returned object is big.
Returns
-------
out : pandas.DataFrame
The dataframe which co... | [
"def",
"to_dataframe",
"(",
"self",
")",
":",
"assert",
"HAS_PANDAS",
",",
"'pandas is not installed.'",
"df",
"=",
"pandas",
".",
"DataFrame",
"(",
")",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"num_columns",
"(",
")",
")",
":",
"column_name",
"=",
... | Convert this SFrame to pandas.DataFrame.
This operation will construct a pandas.DataFrame in memory. Care must
be taken when size of the returned object is big.
Returns
-------
out : pandas.DataFrame
The dataframe which contains all rows of SFrame | [
"Convert",
"this",
"SFrame",
"to",
"pandas",
".",
"DataFrame",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2376-L2395 |
29,036 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.to_numpy | def to_numpy(self):
"""
Converts this SFrame to a numpy array
This operation will construct a numpy array in memory. Care must
be taken when size of the returned object is big.
Returns
-------
out : numpy.ndarray
A Numpy Array containing all the valu... | python | def to_numpy(self):
"""
Converts this SFrame to a numpy array
This operation will construct a numpy array in memory. Care must
be taken when size of the returned object is big.
Returns
-------
out : numpy.ndarray
A Numpy Array containing all the valu... | [
"def",
"to_numpy",
"(",
"self",
")",
":",
"assert",
"HAS_NUMPY",
",",
"'numpy is not installed.'",
"import",
"numpy",
"return",
"numpy",
".",
"transpose",
"(",
"numpy",
".",
"asarray",
"(",
"[",
"self",
"[",
"x",
"]",
"for",
"x",
"in",
"self",
".",
"colu... | Converts this SFrame to a numpy array
This operation will construct a numpy array in memory. Care must
be taken when size of the returned object is big.
Returns
-------
out : numpy.ndarray
A Numpy Array containing all the values of the SFrame | [
"Converts",
"this",
"SFrame",
"to",
"a",
"numpy",
"array"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2397-L2412 |
29,037 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.flat_map | def flat_map(self, column_names, fn, column_types='auto', seed=None):
"""
Map each row of the SFrame to multiple rows in a new SFrame via a
function.
The output of `fn` must have type List[List[...]]. Each inner list
will be a single row in the new output, and the collection of... | python | def flat_map(self, column_names, fn, column_types='auto', seed=None):
"""
Map each row of the SFrame to multiple rows in a new SFrame via a
function.
The output of `fn` must have type List[List[...]]. Each inner list
will be a single row in the new output, and the collection of... | [
"def",
"flat_map",
"(",
"self",
",",
"column_names",
",",
"fn",
",",
"column_types",
"=",
"'auto'",
",",
"seed",
"=",
"None",
")",
":",
"assert",
"callable",
"(",
"fn",
")",
",",
"\"Input must be callable\"",
"if",
"seed",
"is",
"None",
":",
"seed",
"=",... | Map each row of the SFrame to multiple rows in a new SFrame via a
function.
The output of `fn` must have type List[List[...]]. Each inner list
will be a single row in the new output, and the collection of these
rows within the outer list make up the data for the output SFrame.
... | [
"Map",
"each",
"row",
"of",
"the",
"SFrame",
"to",
"multiple",
"rows",
"in",
"a",
"new",
"SFrame",
"via",
"a",
"function",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2502-L2599 |
29,038 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.sample | def sample(self, fraction, seed=None, exact=False):
"""
Sample a fraction of the current SFrame's rows.
Parameters
----------
fraction : float
Fraction of the rows to fetch. Must be between 0 and 1.
if exact is False (default), the number of rows returned... | python | def sample(self, fraction, seed=None, exact=False):
"""
Sample a fraction of the current SFrame's rows.
Parameters
----------
fraction : float
Fraction of the rows to fetch. Must be between 0 and 1.
if exact is False (default), the number of rows returned... | [
"def",
"sample",
"(",
"self",
",",
"fraction",
",",
"seed",
"=",
"None",
",",
"exact",
"=",
"False",
")",
":",
"if",
"seed",
"is",
"None",
":",
"seed",
"=",
"abs",
"(",
"hash",
"(",
"\"%0.20f\"",
"%",
"time",
".",
"time",
"(",
")",
")",
")",
"%... | Sample a fraction of the current SFrame's rows.
Parameters
----------
fraction : float
Fraction of the rows to fetch. Must be between 0 and 1.
if exact is False (default), the number of rows returned is
approximately the fraction times the number of rows.
... | [
"Sample",
"a",
"fraction",
"of",
"the",
"current",
"SFrame",
"s",
"rows",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2601-L2648 |
29,039 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.save | def save(self, filename, format=None):
"""
Save the SFrame to a file system for later use.
Parameters
----------
filename : string
The location to save the SFrame. Either a local directory or a
remote URL. If the format is 'binary', a directory will be cr... | python | def save(self, filename, format=None):
"""
Save the SFrame to a file system for later use.
Parameters
----------
filename : string
The location to save the SFrame. Either a local directory or a
remote URL. If the format is 'binary', a directory will be cr... | [
"def",
"save",
"(",
"self",
",",
"filename",
",",
"format",
"=",
"None",
")",
":",
"if",
"format",
"is",
"None",
":",
"if",
"filename",
".",
"endswith",
"(",
"(",
"'.csv'",
",",
"'.csv.gz'",
")",
")",
":",
"format",
"=",
"'csv'",
"elif",
"filename",
... | Save the SFrame to a file system for later use.
Parameters
----------
filename : string
The location to save the SFrame. Either a local directory or a
remote URL. If the format is 'binary', a directory will be created
at the location which will contain the sf... | [
"Save",
"the",
"SFrame",
"to",
"a",
"file",
"system",
"for",
"later",
"use",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2768-L2826 |
29,040 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.export_csv | def export_csv(self, filename, delimiter=',', line_terminator='\n',
header=True, quote_level=csv.QUOTE_NONNUMERIC, double_quote=True,
escape_char='\\', quote_char='\"', na_rep='',
file_header='', file_footer='', line_prefix='',
_no_prefix_on_first_value=False, **kwargs):
... | python | def export_csv(self, filename, delimiter=',', line_terminator='\n',
header=True, quote_level=csv.QUOTE_NONNUMERIC, double_quote=True,
escape_char='\\', quote_char='\"', na_rep='',
file_header='', file_footer='', line_prefix='',
_no_prefix_on_first_value=False, **kwargs):
... | [
"def",
"export_csv",
"(",
"self",
",",
"filename",
",",
"delimiter",
"=",
"','",
",",
"line_terminator",
"=",
"'\\n'",
",",
"header",
"=",
"True",
",",
"quote_level",
"=",
"csv",
".",
"QUOTE_NONNUMERIC",
",",
"double_quote",
"=",
"True",
",",
"escape_char",
... | Writes an SFrame to a CSV file.
Parameters
----------
filename : string
The location to save the CSV.
delimiter : string, optional
This describes the delimiter used for writing csv files.
line_terminator: string, optional
The newline charact... | [
"Writes",
"an",
"SFrame",
"to",
"a",
"CSV",
"file",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2828-L2917 |
29,041 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.export_json | def export_json(self,
filename,
orient='records'):
"""
Writes an SFrame to a JSON file.
Parameters
----------
filename : string
The location to save the JSON file.
orient : string, optional. Either "records" or "lines"... | python | def export_json(self,
filename,
orient='records'):
"""
Writes an SFrame to a JSON file.
Parameters
----------
filename : string
The location to save the JSON file.
orient : string, optional. Either "records" or "lines"... | [
"def",
"export_json",
"(",
"self",
",",
"filename",
",",
"orient",
"=",
"'records'",
")",
":",
"if",
"orient",
"==",
"\"records\"",
":",
"self",
".",
"pack_columns",
"(",
"dtype",
"=",
"dict",
")",
".",
"export_csv",
"(",
"filename",
",",
"file_header",
... | Writes an SFrame to a JSON file.
Parameters
----------
filename : string
The location to save the JSON file.
orient : string, optional. Either "records" or "lines"
If orient="records" the file is saved as a single JSON array.
If orient="lines", the f... | [
"Writes",
"an",
"SFrame",
"to",
"a",
"JSON",
"file",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2919-L2996 |
29,042 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame._save_reference | def _save_reference(self, filename):
"""
Performs an incomplete save of an existing SFrame into a directory.
This saved SFrame may reference SFrames in other locations in the same
filesystem for certain resources.
Parameters
----------
filename : string
... | python | def _save_reference(self, filename):
"""
Performs an incomplete save of an existing SFrame into a directory.
This saved SFrame may reference SFrames in other locations in the same
filesystem for certain resources.
Parameters
----------
filename : string
... | [
"def",
"_save_reference",
"(",
"self",
",",
"filename",
")",
":",
"## Save the SFrame",
"url",
"=",
"_make_internal_url",
"(",
"filename",
")",
"with",
"cython_context",
"(",
")",
":",
"self",
".",
"__proxy__",
".",
"save_reference",
"(",
"url",
")"
] | Performs an incomplete save of an existing SFrame into a directory.
This saved SFrame may reference SFrames in other locations in the same
filesystem for certain resources.
Parameters
----------
filename : string
The location to save the SFrame. Either a local direct... | [
"Performs",
"an",
"incomplete",
"save",
"of",
"an",
"existing",
"SFrame",
"into",
"a",
"directory",
".",
"This",
"saved",
"SFrame",
"may",
"reference",
"SFrames",
"in",
"other",
"locations",
"in",
"the",
"same",
"filesystem",
"for",
"certain",
"resources",
"."... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L2998-L3023 |
29,043 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.add_column | def add_column(self, data, column_name="", inplace=False):
"""
Returns an SFrame with a new column. The number of elements in the data
given must match the length of every other column of the SFrame.
If no name is given, a default name is chosen.
If inplace == False (default) th... | python | def add_column(self, data, column_name="", inplace=False):
"""
Returns an SFrame with a new column. The number of elements in the data
given must match the length of every other column of the SFrame.
If no name is given, a default name is chosen.
If inplace == False (default) th... | [
"def",
"add_column",
"(",
"self",
",",
"data",
",",
"column_name",
"=",
"\"\"",
",",
"inplace",
"=",
"False",
")",
":",
"# Check type for pandas dataframe or SArray?",
"if",
"not",
"isinstance",
"(",
"data",
",",
"SArray",
")",
":",
"if",
"isinstance",
"(",
... | Returns an SFrame with a new column. The number of elements in the data
given must match the length of every other column of the SFrame.
If no name is given, a default name is chosen.
If inplace == False (default) this operation does not modify the
current SFrame, returning a new SFrame... | [
"Returns",
"an",
"SFrame",
"with",
"a",
"new",
"column",
".",
"The",
"number",
"of",
"elements",
"in",
"the",
"data",
"given",
"must",
"match",
"the",
"length",
"of",
"every",
"other",
"column",
"of",
"the",
"SFrame",
".",
"If",
"no",
"name",
"is",
"gi... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3139-L3212 |
29,044 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.add_columns | def add_columns(self, data, column_names=None, inplace=False):
"""
Returns an SFrame with multiple columns added. The number of
elements in all columns must match the length of every other column of
the SFrame.
If inplace == False (default) this operation does not modify the
... | python | def add_columns(self, data, column_names=None, inplace=False):
"""
Returns an SFrame with multiple columns added. The number of
elements in all columns must match the length of every other column of
the SFrame.
If inplace == False (default) this operation does not modify the
... | [
"def",
"add_columns",
"(",
"self",
",",
"data",
",",
"column_names",
"=",
"None",
",",
"inplace",
"=",
"False",
")",
":",
"datalist",
"=",
"data",
"if",
"isinstance",
"(",
"data",
",",
"SFrame",
")",
":",
"other",
"=",
"data",
"datalist",
"=",
"[",
"... | Returns an SFrame with multiple columns added. The number of
elements in all columns must match the length of every other column of
the SFrame.
If inplace == False (default) this operation does not modify the
current SFrame, returning a new SFrame.
If inplace == True, this oper... | [
"Returns",
"an",
"SFrame",
"with",
"multiple",
"columns",
"added",
".",
"The",
"number",
"of",
"elements",
"in",
"all",
"columns",
"must",
"match",
"the",
"length",
"of",
"every",
"other",
"column",
"of",
"the",
"SFrame",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3214-L3293 |
29,045 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.remove_column | def remove_column(self, column_name, inplace=False):
"""
Returns an SFrame with a column removed.
If inplace == False (default) this operation does not modify the
current SFrame, returning a new SFrame.
If inplace == True, this operation modifies the current
SFrame, ret... | python | def remove_column(self, column_name, inplace=False):
"""
Returns an SFrame with a column removed.
If inplace == False (default) this operation does not modify the
current SFrame, returning a new SFrame.
If inplace == True, this operation modifies the current
SFrame, ret... | [
"def",
"remove_column",
"(",
"self",
",",
"column_name",
",",
"inplace",
"=",
"False",
")",
":",
"column_name",
"=",
"str",
"(",
"column_name",
")",
"if",
"column_name",
"not",
"in",
"self",
".",
"column_names",
"(",
")",
":",
"raise",
"KeyError",
"(",
"... | Returns an SFrame with a column removed.
If inplace == False (default) this operation does not modify the
current SFrame, returning a new SFrame.
If inplace == True, this operation modifies the current
SFrame, returning self.
Parameters
----------
column_name :... | [
"Returns",
"an",
"SFrame",
"with",
"a",
"column",
"removed",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3295-L3347 |
29,046 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.remove_columns | def remove_columns(self, column_names, inplace=False):
"""
Returns an SFrame with one or more columns removed.
If inplace == False (default) this operation does not modify the
current SFrame, returning a new SFrame.
If inplace == True, this operation modifies the current
... | python | def remove_columns(self, column_names, inplace=False):
"""
Returns an SFrame with one or more columns removed.
If inplace == False (default) this operation does not modify the
current SFrame, returning a new SFrame.
If inplace == True, this operation modifies the current
... | [
"def",
"remove_columns",
"(",
"self",
",",
"column_names",
",",
"inplace",
"=",
"False",
")",
":",
"column_names",
"=",
"list",
"(",
"column_names",
")",
"existing_columns",
"=",
"dict",
"(",
"(",
"k",
",",
"i",
")",
"for",
"i",
",",
"k",
"in",
"enumer... | Returns an SFrame with one or more columns removed.
If inplace == False (default) this operation does not modify the
current SFrame, returning a new SFrame.
If inplace == True, this operation modifies the current
SFrame, returning self.
Parameters
----------
co... | [
"Returns",
"an",
"SFrame",
"with",
"one",
"or",
"more",
"columns",
"removed",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3349-L3406 |
29,047 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.swap_columns | def swap_columns(self, column_name_1, column_name_2, inplace=False):
"""
Returns an SFrame with two column positions swapped.
If inplace == False (default) this operation does not modify the
current SFrame, returning a new SFrame.
If inplace == True, this operation modifies the... | python | def swap_columns(self, column_name_1, column_name_2, inplace=False):
"""
Returns an SFrame with two column positions swapped.
If inplace == False (default) this operation does not modify the
current SFrame, returning a new SFrame.
If inplace == True, this operation modifies the... | [
"def",
"swap_columns",
"(",
"self",
",",
"column_name_1",
",",
"column_name_2",
",",
"inplace",
"=",
"False",
")",
":",
"colnames",
"=",
"self",
".",
"column_names",
"(",
")",
"colid_1",
"=",
"colnames",
".",
"index",
"(",
"column_name_1",
")",
"colid_2",
... | Returns an SFrame with two column positions swapped.
If inplace == False (default) this operation does not modify the
current SFrame, returning a new SFrame.
If inplace == True, this operation modifies the current
SFrame, returning self.
Parameters
----------
c... | [
"Returns",
"an",
"SFrame",
"with",
"two",
"column",
"positions",
"swapped",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3409-L3462 |
29,048 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.rename | def rename(self, names, inplace=False):
"""
Returns an SFrame with columns renamed. ``names`` is expected to be a
dict specifying the old and new names. This changes the names of the
columns given as the keys and replaces them with the names given as the
values.
If inpla... | python | def rename(self, names, inplace=False):
"""
Returns an SFrame with columns renamed. ``names`` is expected to be a
dict specifying the old and new names. This changes the names of the
columns given as the keys and replaces them with the names given as the
values.
If inpla... | [
"def",
"rename",
"(",
"self",
",",
"names",
",",
"inplace",
"=",
"False",
")",
":",
"if",
"(",
"type",
"(",
"names",
")",
"is",
"not",
"dict",
")",
":",
"raise",
"TypeError",
"(",
"'names must be a dictionary: oldname -> newname'",
")",
"all_columns",
"=",
... | Returns an SFrame with columns renamed. ``names`` is expected to be a
dict specifying the old and new names. This changes the names of the
columns given as the keys and replaces them with the names given as the
values.
If inplace == False (default) this operation does not modify the
... | [
"Returns",
"an",
"SFrame",
"with",
"columns",
"renamed",
".",
"names",
"is",
"expected",
"to",
"be",
"a",
"dict",
"specifying",
"the",
"old",
"and",
"new",
"names",
".",
"This",
"changes",
"the",
"names",
"of",
"the",
"columns",
"given",
"as",
"the",
"ke... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3464-L3525 |
29,049 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.append | def append(self, other):
"""
Add the rows of an SFrame to the end of this SFrame.
Both SFrames must have the same set of columns with the same column
names and column types.
Parameters
----------
other : SFrame
Another SFrame whose rows are appended ... | python | def append(self, other):
"""
Add the rows of an SFrame to the end of this SFrame.
Both SFrames must have the same set of columns with the same column
names and column types.
Parameters
----------
other : SFrame
Another SFrame whose rows are appended ... | [
"def",
"append",
"(",
"self",
",",
"other",
")",
":",
"if",
"type",
"(",
"other",
")",
"is",
"not",
"SFrame",
":",
"raise",
"RuntimeError",
"(",
"\"SFrame append can only work with SFrame\"",
")",
"left_empty",
"=",
"len",
"(",
"self",
".",
"column_names",
"... | Add the rows of an SFrame to the end of this SFrame.
Both SFrames must have the same set of columns with the same column
names and column types.
Parameters
----------
other : SFrame
Another SFrame whose rows are appended to the current SFrame.
Returns
... | [
"Add",
"the",
"rows",
"of",
"an",
"SFrame",
"to",
"the",
"end",
"of",
"this",
"SFrame",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L3737-L3816 |
29,050 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.explore | 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 ... | python | 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",
")",
":",
"import",
"sys",
"import",
"os",
"if",
"sys",
".",
"platform",
"!=",
"'darwin'",
"and",
"sys",
".",
"platform",
"!=",
"'linux2'",
"and",
"sys",
".",
"platform",
"!=",
"'linux'",
":",
... | 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
-------
... | [
"Explore",
"the",
"SFrame",
"in",
"an",
"interactive",
"GUI",
".",
"Opens",
"a",
"new",
"app",
"window",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L4451-L4486 |
29,051 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.split_datetime | 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... | python | 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",
")",
":",
"if",
"column_name",
"not",
"in",
"self",
".",
"column_names",
"(",
")",
":",
"raise",
"... | 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 :... | [
"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... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L4780-L4862 |
29,052 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.stack | 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 ... | python | 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",
")",
":",
"# validate column_name",
"column_name",
"=",
"str",
"(",
"column_name",
")",
"if",
"column_name"... | 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... | [
"Convert",
"a",
"wide",
"column",
"of",
"an",
"SFrame",
"to",
"one",
"or",
"two",
"tall",
"columns",
"by",
"stacking",
"all",
"values",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L5041-L5235 |
29,053 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.unstack | 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... | python | 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",
")",
":",
"if",
"(",
"type",
"(",
"column_names",
")",
"!=",
"str",
"and",
"len",
"(",
"column_names",
")",
"!=",
"2",
")",
":",
"raise",
"TypeError",
"(",
"\"'col... | 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... | [
"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... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L5237-L5324 |
29,054 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.sort | 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... | python | 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_column_names",
"=",
"[",
"]",
"sort_column_orders",
"=",
"[",
"]",
"# validate key_column_names",
"if",
"(",
"type",
"(",
"key_column_names",
")",
"==",
"str",
... | 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... | [
"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",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L5373-L5511 |
29,055 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.dropna | 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 '... | python | 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'",
")",
":",
"# 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... | 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... | [
"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",
... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L5513-L5588 |
29,056 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.fillna | 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... | python | 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",
")",
":",
"# Normal error checking",
"if",
"type",
"(",
"column_name",
")",
"is",
"not",
"str",
":",
"raise",
"TypeError",
"(",
"\"column_name must be a str\"",
")",
"ret",
"=",
"self",
"[",
"se... | 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_... | [
"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... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L5684-L5728 |
29,057 | apple/turicreate | src/unity/python/turicreate/data_structures/sframe.py | SFrame.add_row_number | 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... | python | 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",
")",
":",
"if",
"type",
"(",
"column_name",
")",
"is",
"not",
"str",
":",
"raise",
"TypeError",
"(",
"\"Must give column_name as st... | 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... | [
"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",
... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/data_structures/sframe.py#L5730-L5801 |
29,058 | apple/turicreate | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py | DescriptorPool.AddSerializedFile | 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... | python | 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",
")",
":",
"# pylint: disable=g-import-not-at-top",
"from",
"google",
".",
"protobuf",
"import",
"descriptor_pb2",
"file_desc_proto",
"=",
"descriptor_pb2",
".",
"FileDescriptorProto",
".",
"FromStri... | Adds the FileDescriptorProto and its types to this pool.
Args:
serialized_file_desc_proto: A bytes string, serialization of the
FileDescriptorProto to add. | [
"Adds",
"the",
"FileDescriptorProto",
"and",
"its",
"types",
"to",
"this",
"pool",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L148-L160 |
29,059 | apple/turicreate | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py | DescriptorPool.AddDescriptor | 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... | python | 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",
")",
":",
"if",
"not",
"isinstance",
"(",
"desc",
",",
"descriptor",
".",
"Descriptor",
")",
":",
"raise",
"TypeError",
"(",
"'Expected instance of descriptor.Descriptor.'",
")",
"self",
".",
"_descriptors",
"[",... | 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. | [
"Adds",
"a",
"Descriptor",
"to",
"the",
"pool",
"non",
"-",
"recursively",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L162-L176 |
29,060 | apple/turicreate | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py | DescriptorPool.AddServiceDescriptor | 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... | python | 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",
")",
":",
"if",
"not",
"isinstance",
"(",
"service_desc",
",",
"descriptor",
".",
"ServiceDescriptor",
")",
":",
"raise",
"TypeError",
"(",
"'Expected instance of descriptor.ServiceDescriptor.'",
")",
"s... | Adds a ServiceDescriptor to the pool.
Args:
service_desc: A ServiceDescriptor. | [
"Adds",
"a",
"ServiceDescriptor",
"to",
"the",
"pool",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L193-L203 |
29,061 | apple/turicreate | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py | DescriptorPool.AddExtensionDescriptor | 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... | python | 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",
")",
":",
"if",
"not",
"(",
"isinstance",
"(",
"extension",
",",
"descriptor",
".",
"FieldDescriptor",
")",
"and",
"extension",
".",
"is_extension",
")",
":",
"raise",
"TypeError",
"(",
"'Expected... | 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. | [
"Adds",
"a",
"FieldDescriptor",
"describing",
"an",
"extension",
"to",
"the",
"pool",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L205-L245 |
29,062 | apple/turicreate | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py | DescriptorPool.FindFileByName | 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... | python | 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",
")",
":",
"try",
":",
"return",
"self",
".",
"_file_descriptors",
"[",
"file_name",
"]",
"except",
"KeyError",
":",
"pass",
"try",
":",
"file_proto",
"=",
"self",
".",
"_internal_db",
".",
"FindFileByNa... | 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. | [
"Gets",
"a",
"FileDescriptor",
"by",
"file",
"name",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L278-L305 |
29,063 | apple/turicreate | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py | DescriptorPool.FindFileContainingSymbol | 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... | python | 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",
")",
":",
"symbol",
"=",
"_NormalizeFullyQualifiedName",
"(",
"symbol",
")",
"try",
":",
"return",
"self",
".",
"_descriptors",
"[",
"symbol",
"]",
".",
"file",
"except",
"KeyError",
":",
"pass",
... | 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. | [
"Gets",
"the",
"FileDescriptor",
"for",
"the",
"file",
"containing",
"the",
"specified",
"symbol",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L307-L349 |
29,064 | apple/turicreate | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py | DescriptorPool.FindMessageTypeByName | 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... | python | 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",
")",
":",
"full_name",
"=",
"_NormalizeFullyQualifiedName",
"(",
"full_name",
")",
"if",
"full_name",
"not",
"in",
"self",
".",
"_descriptors",
":",
"self",
".",
"_FindFileContainingSymbolInDb",
"(",
"... | 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. | [
"Loads",
"the",
"named",
"descriptor",
"from",
"the",
"pool",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L351-L367 |
29,065 | apple/turicreate | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py | DescriptorPool.FindEnumTypeByName | 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... | python | 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",
")",
":",
"full_name",
"=",
"_NormalizeFullyQualifiedName",
"(",
"full_name",
")",
"if",
"full_name",
"not",
"in",
"self",
".",
"_enum_descriptors",
":",
"self",
".",
"_FindFileContainingSymbolInDb",
"(",
... | 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. | [
"Loads",
"the",
"named",
"enum",
"descriptor",
"from",
"the",
"pool",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L369-L385 |
29,066 | apple/turicreate | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py | DescriptorPool.FindFieldByName | 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... | python | 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",
")",
":",
"full_name",
"=",
"_NormalizeFullyQualifiedName",
"(",
"full_name",
")",
"message_name",
",",
"_",
",",
"field_name",
"=",
"full_name",
".",
"rpartition",
"(",
"'.'",
")",
"message_descriptor",
"... | 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. | [
"Loads",
"the",
"named",
"field",
"descriptor",
"from",
"the",
"pool",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L387-L402 |
29,067 | apple/turicreate | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py | DescriptorPool.FindServiceByName | 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.
"""... | python | 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",
")",
":",
"full_name",
"=",
"_NormalizeFullyQualifiedName",
"(",
"full_name",
")",
"if",
"full_name",
"not",
"in",
"self",
".",
"_service_descriptors",
":",
"self",
".",
"_FindFileContainingSymbolInDb",
"(",... | 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",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L467-L482 |
29,068 | apple/turicreate | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py | DescriptorPool._FindFileContainingSymbolInDb | 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... | python | 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",
")",
":",
"try",
":",
"file_proto",
"=",
"self",
".",
"_internal_db",
".",
"FindFileContainingSymbol",
"(",
"symbol",
")",
"except",
"KeyError",
"as",
"error",
":",
"if",
"self",
".",
"_descri... | 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. | [
"Finds",
"the",
"file",
"in",
"descriptor",
"DB",
"containing",
"the",
"specified",
"symbol",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L484-L505 |
29,069 | apple/turicreate | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py | DescriptorPool._ConvertFileProtoToFileDescriptor | 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.
... | python | 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",
")",
":",
"if",
"file_proto",
".",
"name",
"not",
"in",
"self",
".",
"_file_descriptors",
":",
"built_deps",
"=",
"list",
"(",
"self",
".",
"_GetDeps",
"(",
"file_proto",
".",
"depende... | 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. | [
"Creates",
"a",
"FileDescriptor",
"from",
"a",
"proto",
"or",
"returns",
"a",
"cached",
"copy",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L507-L589 |
29,070 | apple/turicreate | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py | DescriptorPool._ConvertMessageDescriptor | 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... | python | 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",
")",
":",
"if",
"package",
":",
"desc_name",
"=",
"'.'",
".",
"join",
... | 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.... | [
"Adds",
"the",
"proto",
"to",
"the",
"pool",
"in",
"the",
"specified",
"package",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L591-L670 |
29,071 | apple/turicreate | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py | DescriptorPool._SetAllFieldTypes | 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... | python | 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",
")",
":",
"package",
"=",
"_PrefixWithDot",
"(",
"package",
")",
"main_desc",
"=",
"self",
".",
"_GetTypeFromScope",
"(",
"package",
",",
"desc_proto",
".",
"name",
","... | 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. | [
"Sets",
"all",
"the",
"descriptor",
"s",
"fields",
"s",
"types",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L752-L782 |
29,072 | apple/turicreate | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py | DescriptorPool._SetFieldType | 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... | python | 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",
")",
":",
"if",
"field_proto",
".",
"type_name",
":",
"desc",
"=",
"self",
".",
"_GetTypeFromScope",
"(",
"package",
",",
"field_proto",
".",
"type_name... | 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. | [
"Sets",
"the",
"field",
"s",
"type",
"cpp_type",
"message_type",
"and",
"enum_type",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L784-L852 |
29,073 | apple/turicreate | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py | DescriptorPool._MakeEnumValueDescriptor | 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... | python | 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",
")",
":",
"return",
"descriptor",
".",
"EnumValueDescriptor",
"(",
"name",
"=",
"value_proto",
".",
"name",
",",
"index",
"=",
"index",
",",
"number",
"=",
"value_proto",
".",
... | 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. | [
"Creates",
"a",
"enum",
"value",
"descriptor",
"object",
"from",
"a",
"enum",
"value",
"proto",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L854-L870 |
29,074 | apple/turicreate | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py | DescriptorPool._MakeServiceDescriptor | 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... | python | 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",
")",
":",
"if",
"package",
":",
"service_name",
"=",
"'.'",
".",
"join",
"(",
"(",
"package",
",",
"service_proto",
".",... | 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... | [
"Make",
"a",
"protobuf",
"ServiceDescriptor",
"given",
"a",
"ServiceDescriptorProto",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L872-L902 |
29,075 | apple/turicreate | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py | DescriptorPool._MakeMethodDescriptor | 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... | python | 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",
")",
":",
"full_name",
"=",
"'.'",
".",
"join",
"(",
"(",
"service_name",
",",
"method_proto",
".",
"name",
")",
")",
"input_... | 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 ... | [
"Creates",
"a",
"method",
"descriptor",
"from",
"a",
"MethodDescriptorProto",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L904-L929 |
29,076 | apple/turicreate | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py | DescriptorPool._ExtractSymbols | 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... | python | 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",
")",
":",
"for",
"desc",
"in",
"descriptors",
":",
"yield",
"(",
"_PrefixWithDot",
"(",
"desc",
".",
"full_name",
")",
",",
"desc",
")",
"for",
"symbol",
"in",
"self",
".",
"_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. | [
"Pulls",
"out",
"all",
"the",
"symbols",
"from",
"descriptor",
"protos",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L931-L945 |
29,077 | apple/turicreate | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py | DescriptorPool._GetDeps | 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... | python | 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",
")",
":",
"for",
"dependency",
"in",
"dependencies",
":",
"dep_desc",
"=",
"self",
".",
"FindFileByName",
"(",
"dependency",
")",
"yield",
"dep_desc",
"for",
"parent_dep",
"in",
"dep_desc",
".",
"dependencie... | Recursively finds dependencies for file protos.
Args:
dependencies: The names of the files being depended on.
Yields:
Each direct and indirect dependency. | [
"Recursively",
"finds",
"dependencies",
"for",
"file",
"protos",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L947-L961 |
29,078 | apple/turicreate | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py | DescriptorPool._GetTypeFromScope | 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.
... | python | 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",
")",
":",
"if",
"type_name",
"not",
"in",
"scope",
":",
"components",
"=",
"_PrefixWithDot",
"(",
"package",
")",
".",
"split",
"(",
"'.'",
")",
"while",
"components",... | 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. | [
"Finds",
"a",
"given",
"type",
"name",
"in",
"the",
"current",
"scope",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L963-L983 |
29,079 | apple/turicreate | deps/src/boost_1_68_0/tools/build/src/util/sequence.py | max_element | 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]
... | python | 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",
")",
":",
"assert",
"is_iterable",
"(",
"elements",
")",
"assert",
"callable",
"(",
"ordered",
")",
"or",
"ordered",
"is",
"None",
"if",
"not",
"ordered",
":",
"ordered",
"=",
"operator",
... | Returns the maximum number in 'elements'. Uses 'ordered' for comparisons,
or '<' is none is provided. | [
"Returns",
"the",
"maximum",
"number",
"in",
"elements",
".",
"Uses",
"ordered",
"for",
"comparisons",
"or",
"<",
"is",
"none",
"is",
"provided",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/util/sequence.py#L24-L37 |
29,080 | apple/turicreate | deps/src/boost_1_68_0/tools/build/src/util/sequence.py | select_highest_ranked | 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... | python | 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",
")",
":",
"assert",
"is_iterable",
"(",
"elements",
")",
"assert",
"is_iterable",
"(",
"ranks",
")",
"if",
"not",
"elements",
":",
"return",
"[",
"]",
"max_rank",
"=",
"max_element",
"(",
"ranks"... | Returns all of 'elements' for which corresponding element in parallel
list 'rank' is equal to the maximum value in 'rank'. | [
"Returns",
"all",
"of",
"elements",
"for",
"which",
"corresponding",
"element",
"in",
"parallel",
"list",
"rank",
"is",
"equal",
"to",
"the",
"maximum",
"value",
"in",
"rank",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/util/sequence.py#L39-L58 |
29,081 | apple/turicreate | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/message.py | Message.CopyFrom | 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... | python | 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",
")",
":",
"if",
"self",
"is",
"other_msg",
":",
"return",
"self",
".",
"Clear",
"(",
")",
"self",
".",
"MergeFrom",
"(",
"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. | [
"Copies",
"the",
"content",
"of",
"the",
"specified",
"message",
"into",
"the",
"current",
"message",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/message.py#L106-L118 |
29,082 | apple/turicreate | src/external/coremltools_wrap/coremltools/coremltools/converters/xgboost/_tree_ensemble.py | convert_tree_ensemble | def convert_tree_ensemble(model, feature_names, target, force_32bit_float):
"""Convert a generic tree model to the protobuf spec.
This currently supports:
* Decision tree regression
Parameters
----------
model: str | Booster
Path on disk where the XGboost JSON representation of the m... | python | def convert_tree_ensemble(model, feature_names, target, force_32bit_float):
"""Convert a generic tree model to the protobuf spec.
This currently supports:
* Decision tree regression
Parameters
----------
model: str | Booster
Path on disk where the XGboost JSON representation of the m... | [
"def",
"convert_tree_ensemble",
"(",
"model",
",",
"feature_names",
",",
"target",
",",
"force_32bit_float",
")",
":",
"if",
"not",
"(",
"_HAS_XGBOOST",
")",
":",
"raise",
"RuntimeError",
"(",
"'xgboost not found. xgboost conversion API is disabled.'",
")",
"import",
... | Convert a generic tree model to the protobuf spec.
This currently supports:
* Decision tree regression
Parameters
----------
model: str | Booster
Path on disk where the XGboost JSON representation of the model is or
a handle to the XGboost model.
feature_names : list of stri... | [
"Convert",
"a",
"generic",
"tree",
"model",
"to",
"the",
"protobuf",
"spec",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/xgboost/_tree_ensemble.py#L75-L156 |
29,083 | apple/turicreate | src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_one_hot_encoder.py | update_dimension | def update_dimension(model, input_dimension):
"""
Given a model that takes an array of dimension input_dimension, returns
the output dimension.
"""
if not(_HAS_SKLEARN):
raise RuntimeError('scikit-learn not found. scikit-learn conversion API is disabled.')
_sklearn_util.check_fitted(mod... | python | def update_dimension(model, input_dimension):
"""
Given a model that takes an array of dimension input_dimension, returns
the output dimension.
"""
if not(_HAS_SKLEARN):
raise RuntimeError('scikit-learn not found. scikit-learn conversion API is disabled.')
_sklearn_util.check_fitted(mod... | [
"def",
"update_dimension",
"(",
"model",
",",
"input_dimension",
")",
":",
"if",
"not",
"(",
"_HAS_SKLEARN",
")",
":",
"raise",
"RuntimeError",
"(",
"'scikit-learn not found. scikit-learn conversion API is disabled.'",
")",
"_sklearn_util",
".",
"check_fitted",
"(",
"mo... | Given a model that takes an array of dimension input_dimension, returns
the output dimension. | [
"Given",
"a",
"model",
"that",
"takes",
"an",
"array",
"of",
"dimension",
"input_dimension",
"returns",
"the",
"output",
"dimension",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_one_hot_encoder.py#L192-L209 |
29,084 | apple/turicreate | src/unity/python/turicreate/toolkits/_mxnet/_mxnet_to_coreml/_layers.py | convert_elementwise_mul_scalar | def convert_elementwise_mul_scalar(net, node, module, builder):
"""Convert a scalar multiplication from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
module: module
An module for MXNet
builder: NeuralNetwo... | python | def convert_elementwise_mul_scalar(net, node, module, builder):
"""Convert a scalar multiplication from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
module: module
An module for MXNet
builder: NeuralNetwo... | [
"def",
"convert_elementwise_mul_scalar",
"(",
"net",
",",
"node",
",",
"module",
",",
"builder",
")",
":",
"import",
"numpy",
"input_name",
",",
"output_name",
"=",
"_get_input_output_name",
"(",
"net",
",",
"node",
")",
"name",
"=",
"node",
"[",
"'name'",
"... | Convert a scalar multiplication from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
module: module
An module for MXNet
builder: NeuralNetworkBuilder
A neural network builder object. | [
"Convert",
"a",
"scalar",
"multiplication",
"from",
"mxnet",
"to",
"coreml",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_mxnet/_mxnet_to_coreml/_layers.py#L224-L252 |
29,085 | apple/turicreate | src/unity/python/turicreate/toolkits/_mxnet/_mxnet_to_coreml/_layers.py | convert_dense | def convert_dense(net, node, module, builder):
"""Convert a dense layer from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
module: module
An module for MXNet
builder: NeuralNetworkBuilder
A neural ... | python | def convert_dense(net, node, module, builder):
"""Convert a dense layer from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
module: module
An module for MXNet
builder: NeuralNetworkBuilder
A neural ... | [
"def",
"convert_dense",
"(",
"net",
",",
"node",
",",
"module",
",",
"builder",
")",
":",
"input_name",
",",
"output_name",
"=",
"_get_input_output_name",
"(",
"net",
",",
"node",
")",
"has_bias",
"=",
"True",
"name",
"=",
"node",
"[",
"'name'",
"]",
"in... | Convert a dense layer from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
module: module
An module for MXNet
builder: NeuralNetworkBuilder
A neural network builder object. | [
"Convert",
"a",
"dense",
"layer",
"from",
"mxnet",
"to",
"coreml",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_mxnet/_mxnet_to_coreml/_layers.py#L286-L325 |
29,086 | apple/turicreate | src/unity/python/turicreate/toolkits/_mxnet/_mxnet_to_coreml/_layers.py | convert_padding | def convert_padding(net, node, module, builder):
"""Convert a padding layer from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
module: module
An module for MXNet
builder: NeuralNetworkBuilder
A neu... | python | def convert_padding(net, node, module, builder):
"""Convert a padding layer from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
module: module
An module for MXNet
builder: NeuralNetworkBuilder
A neu... | [
"def",
"convert_padding",
"(",
"net",
",",
"node",
",",
"module",
",",
"builder",
")",
":",
"input_name",
",",
"output_name",
"=",
"_get_input_output_name",
"(",
"net",
",",
"node",
")",
"name",
"=",
"node",
"[",
"'name'",
"]",
"param",
"=",
"_get_attr",
... | Convert a padding layer from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
module: module
An module for MXNet
builder: NeuralNetworkBuilder
A neural network builder object. | [
"Convert",
"a",
"padding",
"layer",
"from",
"mxnet",
"to",
"coreml",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_mxnet/_mxnet_to_coreml/_layers.py#L421-L462 |
29,087 | apple/turicreate | src/unity/python/turicreate/toolkits/_mxnet/_mxnet_to_coreml/_layers.py | convert_upsample | def convert_upsample(net, node, module, builder):
"""Convert a UpSampling layer from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
module: module
An module for MXNet
builder: NeuralNetworkBuilder
A... | python | def convert_upsample(net, node, module, builder):
"""Convert a UpSampling layer from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
module: module
An module for MXNet
builder: NeuralNetworkBuilder
A... | [
"def",
"convert_upsample",
"(",
"net",
",",
"node",
",",
"module",
",",
"builder",
")",
":",
"input_name",
",",
"output_name",
"=",
"_get_input_output_name",
"(",
"net",
",",
"node",
")",
"name",
"=",
"node",
"[",
"'name'",
"]",
"param",
"=",
"_get_attr",
... | Convert a UpSampling layer from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
module: module
An module for MXNet
builder: NeuralNetworkBuilder
A neural network builder object. | [
"Convert",
"a",
"UpSampling",
"layer",
"from",
"mxnet",
"to",
"coreml",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_mxnet/_mxnet_to_coreml/_layers.py#L704-L738 |
29,088 | apple/turicreate | src/unity/python/turicreate/toolkits/_mxnet/_mxnet_to_coreml/_layers.py | convert_custom | def convert_custom(net, node, module, builder):
"""Convert highly specific ops"""
input_name, output_name = _get_input_output_name(net, node)
name = node['name']
param = _get_attr(node)
if param['op_type'] == 'special-darknet-maxpool':
_add_pooling.add_pooling_with_padding_types(
... | python | def convert_custom(net, node, module, builder):
"""Convert highly specific ops"""
input_name, output_name = _get_input_output_name(net, node)
name = node['name']
param = _get_attr(node)
if param['op_type'] == 'special-darknet-maxpool':
_add_pooling.add_pooling_with_padding_types(
... | [
"def",
"convert_custom",
"(",
"net",
",",
"node",
",",
"module",
",",
"builder",
")",
":",
"input_name",
",",
"output_name",
"=",
"_get_input_output_name",
"(",
"net",
",",
"node",
")",
"name",
"=",
"node",
"[",
"'name'",
"]",
"param",
"=",
"_get_attr",
... | Convert highly specific ops | [
"Convert",
"highly",
"specific",
"ops"
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_mxnet/_mxnet_to_coreml/_layers.py#L808-L829 |
29,089 | apple/turicreate | src/unity/python/turicreate/toolkits/_mxnet/_mxnet_to_coreml/_layers.py | convert_embedding | def convert_embedding(net, node, model, builder):
"""Convert an embedding layer from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
model: model
An model for MXNet
builder: NeuralNetworkBuilder
A ne... | python | def convert_embedding(net, node, model, builder):
"""Convert an embedding layer from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
model: model
An model for MXNet
builder: NeuralNetworkBuilder
A ne... | [
"def",
"convert_embedding",
"(",
"net",
",",
"node",
",",
"model",
",",
"builder",
")",
":",
"input_name",
",",
"output_name",
"=",
"_get_input_output_name",
"(",
"net",
",",
"node",
")",
"name",
"=",
"node",
"[",
"'name'",
"]",
"inputs",
"=",
"node",
"[... | Convert an embedding layer from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
model: model
An model for MXNet
builder: NeuralNetworkBuilder
A neural network builder object. | [
"Convert",
"an",
"embedding",
"layer",
"from",
"mxnet",
"to",
"coreml",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_mxnet/_mxnet_to_coreml/_layers.py#L831-L875 |
29,090 | apple/turicreate | src/unity/python/turicreate/toolkits/_mxnet/_mxnet_to_coreml/_layers.py | convert_scalar_add | def convert_scalar_add(net, node, model, builder):
"""Convert a scalar add layer from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
model: model
An model for MXNet
builder: NeuralNetworkBuilder
A n... | python | def convert_scalar_add(net, node, model, builder):
"""Convert a scalar add layer from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
model: model
An model for MXNet
builder: NeuralNetworkBuilder
A n... | [
"def",
"convert_scalar_add",
"(",
"net",
",",
"node",
",",
"model",
",",
"builder",
")",
":",
"import",
"numpy",
"as",
"_np",
"input_name",
",",
"output_name",
"=",
"_get_input_output_name",
"(",
"net",
",",
"node",
")",
"name",
"=",
"node",
"[",
"'name'",... | Convert a scalar add layer from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
model: model
An model for MXNet
builder: NeuralNetworkBuilder
A neural network builder object. | [
"Convert",
"a",
"scalar",
"add",
"layer",
"from",
"mxnet",
"to",
"coreml",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_mxnet/_mxnet_to_coreml/_layers.py#L899-L923 |
29,091 | apple/turicreate | src/unity/python/turicreate/toolkits/_mxnet/_mxnet_to_coreml/_layers.py | convert_scalar_multiply | def convert_scalar_multiply(net, node, model, builder):
"""Convert a scalar multiply layer from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
model: model
An model for MXNet
builder: NeuralNetworkBuilder
... | python | def convert_scalar_multiply(net, node, model, builder):
"""Convert a scalar multiply layer from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
model: model
An model for MXNet
builder: NeuralNetworkBuilder
... | [
"def",
"convert_scalar_multiply",
"(",
"net",
",",
"node",
",",
"model",
",",
"builder",
")",
":",
"import",
"numpy",
"as",
"_np",
"input_name",
",",
"output_name",
"=",
"_get_input_output_name",
"(",
"net",
",",
"node",
")",
"name",
"=",
"node",
"[",
"'na... | Convert a scalar multiply layer from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
model: model
An model for MXNet
builder: NeuralNetworkBuilder
A neural network builder object. | [
"Convert",
"a",
"scalar",
"multiply",
"layer",
"from",
"mxnet",
"to",
"coreml",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_mxnet/_mxnet_to_coreml/_layers.py#L926-L949 |
29,092 | apple/turicreate | src/unity/python/turicreate/toolkits/_mxnet/_mxnet_to_coreml/_layers.py | convert_instancenorm | def convert_instancenorm(net, node, model, builder):
"""Convert an instance norm layer from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
model: model
An model for MXNet
builder: NeuralNetworkBuilder
... | python | def convert_instancenorm(net, node, model, builder):
"""Convert an instance norm layer from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
model: model
An model for MXNet
builder: NeuralNetworkBuilder
... | [
"def",
"convert_instancenorm",
"(",
"net",
",",
"node",
",",
"model",
",",
"builder",
")",
":",
"import",
"numpy",
"as",
"_np",
"input_name",
",",
"output_name",
"=",
"_get_input_output_name",
"(",
"net",
",",
"node",
")",
"name",
"=",
"node",
"[",
"'name'... | Convert an instance norm layer from mxnet to coreml.
Parameters
----------
net: network
A mxnet network object.
node: layer
Node to convert.
model: model
An model for MXNet
builder: NeuralNetworkBuilder
A neural network builder object. | [
"Convert",
"an",
"instance",
"norm",
"layer",
"from",
"mxnet",
"to",
"coreml",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_mxnet/_mxnet_to_coreml/_layers.py#L976-L1026 |
29,093 | apple/turicreate | src/unity/python/turicreate/util/__init__.py | _get_aws_credentials | def _get_aws_credentials():
"""
Returns the values stored in the AWS credential environment variables.
Returns the value stored in the AWS_ACCESS_KEY_ID environment variable and
the value stored in the AWS_SECRET_ACCESS_KEY environment variable.
Returns
-------
out : tuple [string]
... | python | def _get_aws_credentials():
"""
Returns the values stored in the AWS credential environment variables.
Returns the value stored in the AWS_ACCESS_KEY_ID environment variable and
the value stored in the AWS_SECRET_ACCESS_KEY environment variable.
Returns
-------
out : tuple [string]
... | [
"def",
"_get_aws_credentials",
"(",
")",
":",
"if",
"(",
"not",
"'AWS_ACCESS_KEY_ID'",
"in",
"_os",
".",
"environ",
")",
":",
"raise",
"KeyError",
"(",
"'No access key found. Please set the environment variable AWS_ACCESS_KEY_ID.'",
")",
"if",
"(",
"not",
"'AWS_SECRET_A... | Returns the values stored in the AWS credential environment variables.
Returns the value stored in the AWS_ACCESS_KEY_ID environment variable and
the value stored in the AWS_SECRET_ACCESS_KEY environment variable.
Returns
-------
out : tuple [string]
The first string of the tuple is the val... | [
"Returns",
"the",
"values",
"stored",
"in",
"the",
"AWS",
"credential",
"environment",
"variables",
".",
"Returns",
"the",
"value",
"stored",
"in",
"the",
"AWS_ACCESS_KEY_ID",
"environment",
"variable",
"and",
"the",
"value",
"stored",
"in",
"the",
"AWS_SECRET_ACC... | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/util/__init__.py#L47-L70 |
29,094 | apple/turicreate | src/unity/python/turicreate/util/__init__.py | is_directory_archive | def is_directory_archive(path):
"""
Utility function that returns True if the path provided is a directory that has an SFrame or SGraph in it.
SFrames are written to disk as a directory archive, this function identifies if a given directory is an archive
for an SFrame.
Parameters
----------
... | python | def is_directory_archive(path):
"""
Utility function that returns True if the path provided is a directory that has an SFrame or SGraph in it.
SFrames are written to disk as a directory archive, this function identifies if a given directory is an archive
for an SFrame.
Parameters
----------
... | [
"def",
"is_directory_archive",
"(",
"path",
")",
":",
"if",
"path",
"is",
"None",
":",
"return",
"False",
"if",
"not",
"_os",
".",
"path",
".",
"isdir",
"(",
"path",
")",
":",
"return",
"False",
"ini_path",
"=",
"'/'",
".",
"join",
"(",
"[",
"_conver... | Utility function that returns True if the path provided is a directory that has an SFrame or SGraph in it.
SFrames are written to disk as a directory archive, this function identifies if a given directory is an archive
for an SFrame.
Parameters
----------
path : string
Directory to evaluat... | [
"Utility",
"function",
"that",
"returns",
"True",
"if",
"the",
"path",
"provided",
"is",
"a",
"directory",
"that",
"has",
"an",
"SFrame",
"or",
"SGraph",
"in",
"it",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/util/__init__.py#L152-L181 |
29,095 | apple/turicreate | src/unity/python/turicreate/util/__init__.py | get_archive_type | def get_archive_type(path):
"""
Returns the contents type for the provided archive path.
Parameters
----------
path : string
Directory to evaluate.
Returns
-------
Returns a string of: sframe, sgraph, raises TypeError for anything else
"""
if not is_directory_archive(pa... | python | def get_archive_type(path):
"""
Returns the contents type for the provided archive path.
Parameters
----------
path : string
Directory to evaluate.
Returns
-------
Returns a string of: sframe, sgraph, raises TypeError for anything else
"""
if not is_directory_archive(pa... | [
"def",
"get_archive_type",
"(",
"path",
")",
":",
"if",
"not",
"is_directory_archive",
"(",
"path",
")",
":",
"raise",
"TypeError",
"(",
"'Unable to determine the type of archive at path: %s'",
"%",
"path",
")",
"try",
":",
"ini_path",
"=",
"'/'",
".",
"join",
"... | Returns the contents type for the provided archive path.
Parameters
----------
path : string
Directory to evaluate.
Returns
-------
Returns a string of: sframe, sgraph, raises TypeError for anything else | [
"Returns",
"the",
"contents",
"type",
"for",
"the",
"provided",
"archive",
"path",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/util/__init__.py#L183-L207 |
29,096 | apple/turicreate | src/unity/python/turicreate/util/__init__.py | crossproduct | def crossproduct(d):
"""
Create an SFrame containing the crossproduct of all provided options.
Parameters
----------
d : dict
Each key is the name of an option, and each value is a list
of the possible values for that option.
Returns
-------
out : SFrame
There w... | python | def crossproduct(d):
"""
Create an SFrame containing the crossproduct of all provided options.
Parameters
----------
d : dict
Each key is the name of an option, and each value is a list
of the possible values for that option.
Returns
-------
out : SFrame
There w... | [
"def",
"crossproduct",
"(",
"d",
")",
":",
"from",
".",
".",
"import",
"SArray",
"d",
"=",
"[",
"list",
"(",
"zip",
"(",
"list",
"(",
"d",
".",
"keys",
"(",
")",
")",
",",
"x",
")",
")",
"for",
"x",
"in",
"_itertools",
".",
"product",
"(",
"*... | Create an SFrame containing the crossproduct of all provided options.
Parameters
----------
d : dict
Each key is the name of an option, and each value is a list
of the possible values for that option.
Returns
-------
out : SFrame
There will be a column for each key in t... | [
"Create",
"an",
"SFrame",
"containing",
"the",
"crossproduct",
"of",
"all",
"provided",
"options",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/util/__init__.py#L209-L246 |
29,097 | apple/turicreate | src/unity/python/turicreate/util/__init__.py | _assert_sframe_equal | def _assert_sframe_equal(sf1,
sf2,
check_column_names=True,
check_column_order=True,
check_row_order=True,
float_column_delta=None):
"""
Assert the two SFrames are equal.
The default... | python | def _assert_sframe_equal(sf1,
sf2,
check_column_names=True,
check_column_order=True,
check_row_order=True,
float_column_delta=None):
"""
Assert the two SFrames are equal.
The default... | [
"def",
"_assert_sframe_equal",
"(",
"sf1",
",",
"sf2",
",",
"check_column_names",
"=",
"True",
",",
"check_column_order",
"=",
"True",
",",
"check_row_order",
"=",
"True",
",",
"float_column_delta",
"=",
"None",
")",
":",
"from",
".",
".",
"import",
"SFrame",
... | Assert the two SFrames are equal.
The default behavior of this function uses the strictest possible
definition of equality, where all columns must be in the same order, with
the same names and have the same data in the same order. Each of these
stipulations can be relaxed individually and in concert w... | [
"Assert",
"the",
"two",
"SFrames",
"are",
"equal",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/util/__init__.py#L263-L365 |
29,098 | apple/turicreate | src/unity/python/turicreate/util/__init__.py | _make_temp_directory | def _make_temp_directory(prefix):
'''
Generate a temporary directory that would not live beyond the lifetime of
unity_server.
Caller is expected to clean up the temp file as soon as the directory is no
longer needed. But the directory will be cleaned as unity_server restarts
'''
temp_dir = ... | python | def _make_temp_directory(prefix):
'''
Generate a temporary directory that would not live beyond the lifetime of
unity_server.
Caller is expected to clean up the temp file as soon as the directory is no
longer needed. But the directory will be cleaned as unity_server restarts
'''
temp_dir = ... | [
"def",
"_make_temp_directory",
"(",
"prefix",
")",
":",
"temp_dir",
"=",
"_make_temp_filename",
"(",
"prefix",
"=",
"str",
"(",
"prefix",
")",
")",
"_os",
".",
"makedirs",
"(",
"temp_dir",
")",
"return",
"temp_dir"
] | Generate a temporary directory that would not live beyond the lifetime of
unity_server.
Caller is expected to clean up the temp file as soon as the directory is no
longer needed. But the directory will be cleaned as unity_server restarts | [
"Generate",
"a",
"temporary",
"directory",
"that",
"would",
"not",
"live",
"beyond",
"the",
"lifetime",
"of",
"unity_server",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/util/__init__.py#L382-L392 |
29,099 | apple/turicreate | src/unity/python/turicreate/util/__init__.py | _make_temp_filename | def _make_temp_filename(prefix):
'''
Generate a temporary file that would not live beyond the lifetime of
unity_server.
Caller is expected to clean up the temp file as soon as the file is no
longer needed. But temp files created using this method will be cleaned up
when unity_server restarts
... | python | def _make_temp_filename(prefix):
'''
Generate a temporary file that would not live beyond the lifetime of
unity_server.
Caller is expected to clean up the temp file as soon as the file is no
longer needed. But temp files created using this method will be cleaned up
when unity_server restarts
... | [
"def",
"_make_temp_filename",
"(",
"prefix",
")",
":",
"temp_location",
"=",
"_get_temp_file_location",
"(",
")",
"temp_file_name",
"=",
"'/'",
".",
"join",
"(",
"[",
"temp_location",
",",
"str",
"(",
"prefix",
")",
"+",
"str",
"(",
"_uuid",
".",
"uuid4",
... | Generate a temporary file that would not live beyond the lifetime of
unity_server.
Caller is expected to clean up the temp file as soon as the file is no
longer needed. But temp files created using this method will be cleaned up
when unity_server restarts | [
"Generate",
"a",
"temporary",
"file",
"that",
"would",
"not",
"live",
"beyond",
"the",
"lifetime",
"of",
"unity_server",
"."
] | 74514c3f99e25b46f22c6e02977fe3da69221c2e | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/util/__init__.py#L394-L405 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.