repo
stringlengths
7
54
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
20
28.4k
docstring
stringlengths
1
46.3k
docstring_tokens
listlengths
1
1.66k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
summary
stringlengths
4
350
obf_code
stringlengths
7.85k
764k
apple/turicreate
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/internal/well_known_types.py
_FieldMaskTree.MergeMessage
def MergeMessage( self, source, destination, replace_message, replace_repeated): """Merge all fields specified by this tree from source to destination.""" _MergeMessage( self._root, source, destination, replace_message, replace_repeated)
python
def MergeMessage( self, source, destination, replace_message, replace_repeated): """Merge all fields specified by this tree from source to destination.""" _MergeMessage( self._root, source, destination, replace_message, replace_repeated)
[ "def", "MergeMessage", "(", "self", ",", "source", ",", "destination", ",", "replace_message", ",", "replace_repeated", ")", ":", "_MergeMessage", "(", "self", ".", "_root", ",", "source", ",", "destination", ",", "replace_message", ",", "replace_repeated", ")" ...
Merge all fields specified by this tree from source to destination.
[ "Merge", "all", "fields", "specified", "by", "this", "tree", "from", "source", "to", "destination", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/internal/well_known_types.py#L615-L620
train
Merge all fields specified by this tree from source to destination.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_NuSVR.py
convert
def convert(model, feature_names, target): """Convert a Nu Support Vector Regression (NuSVR) model to the protobuf spec. Parameters ---------- model: NuSVR A trained NuSVR encoder model. feature_names: [str] Name of the input columns. target: str Name of the output colu...
python
def convert(model, feature_names, target): """Convert a Nu Support Vector Regression (NuSVR) model to the protobuf spec. Parameters ---------- model: NuSVR A trained NuSVR encoder model. feature_names: [str] Name of the input columns. target: str Name of the output colu...
[ "def", "convert", "(", "model", ",", "feature_names", ",", "target", ")", ":", "if", "not", "(", "_HAS_SKLEARN", ")", ":", "raise", "RuntimeError", "(", "'scikit-learn not found. scikit-learn conversion API is disabled.'", ")", "_sklearn_util", ".", "check_expected_type...
Convert a Nu Support Vector Regression (NuSVR) model to the protobuf spec. Parameters ---------- model: NuSVR A trained NuSVR encoder model. feature_names: [str] Name of the input columns. target: str Name of the output column. Returns ------- model_spec: An ob...
[ "Convert", "a", "Nu", "Support", "Vector", "Regression", "(", "NuSVR", ")", "model", "to", "the", "protobuf", "spec", ".", "Parameters", "----------", "model", ":", "NuSVR", "A", "trained", "NuSVR", "encoder", "model", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_NuSVR.py#L20-L42
train
Convert a Nu Support Vector Regression model to the protobuf spec.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/regression/linear_regression.py
create
def create(dataset, target, features=None, l2_penalty=1e-2, l1_penalty=0.0, solver='auto', feature_rescaling=True, convergence_threshold = _DEFAULT_SOLVER_OPTIONS['convergence_threshold'], step_size = _DEFAULT_SOLVER_OPTIONS['step_size'], lbfgs_memory_level = _DEFAULT_SOLVER_OPTIONS['lbfgs_memory_level'...
python
def create(dataset, target, features=None, l2_penalty=1e-2, l1_penalty=0.0, solver='auto', feature_rescaling=True, convergence_threshold = _DEFAULT_SOLVER_OPTIONS['convergence_threshold'], step_size = _DEFAULT_SOLVER_OPTIONS['step_size'], lbfgs_memory_level = _DEFAULT_SOLVER_OPTIONS['lbfgs_memory_level'...
[ "def", "create", "(", "dataset", ",", "target", ",", "features", "=", "None", ",", "l2_penalty", "=", "1e-2", ",", "l1_penalty", "=", "0.0", ",", "solver", "=", "'auto'", ",", "feature_rescaling", "=", "True", ",", "convergence_threshold", "=", "_DEFAULT_SOL...
Create a :class:`~turicreate.linear_regression.LinearRegression` to predict a scalar target variable as a linear function of one or more features. In addition to standard numeric and categorical types, features can also be extracted automatically from list- or dictionary-type SFrame columns. The li...
[ "Create", "a", ":", "class", ":", "~turicreate", ".", "linear_regression", ".", "LinearRegression", "to", "predict", "a", "scalar", "target", "variable", "as", "a", "linear", "function", "of", "one", "or", "more", "features", ".", "In", "addition", "to", "st...
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/regression/linear_regression.py#L28-L285
train
Creates a new LinearRegression model for a set of target variable values.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/regression/linear_regression.py
LinearRegression.export_coreml
def export_coreml(self, filename): """ Export the model in Core ML format. Parameters ---------- filename: str A valid filename where the model can be saved. Examples -------- >>> model.export_coreml("MyModel.mlmodel") """ from ...
python
def export_coreml(self, filename): """ Export the model in Core ML format. Parameters ---------- filename: str A valid filename where the model can be saved. Examples -------- >>> model.export_coreml("MyModel.mlmodel") """ from ...
[ "def", "export_coreml", "(", "self", ",", "filename", ")", ":", "from", "turicreate", ".", "extensions", "import", "_linear_regression_export_as_model_asset", "from", "turicreate", ".", "toolkits", "import", "_coreml_utils", "display_name", "=", "\"linear regression\"", ...
Export the model in Core ML format. Parameters ---------- filename: str A valid filename where the model can be saved. Examples -------- >>> model.export_coreml("MyModel.mlmodel")
[ "Export", "the", "model", "in", "Core", "ML", "format", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/regression/linear_regression.py#L427-L451
train
Export the model in Core ML format.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/regression/linear_regression.py
LinearRegression.predict
def predict(self, dataset, missing_value_action='auto'): """ Return target value predictions for ``dataset``, using the trained linear regression model. This method can be used to get fitted values for the model by inputting the training dataset. Parameters ---------- ...
python
def predict(self, dataset, missing_value_action='auto'): """ Return target value predictions for ``dataset``, using the trained linear regression model. This method can be used to get fitted values for the model by inputting the training dataset. Parameters ---------- ...
[ "def", "predict", "(", "self", ",", "dataset", ",", "missing_value_action", "=", "'auto'", ")", ":", "return", "super", "(", "LinearRegression", ",", "self", ")", ".", "predict", "(", "dataset", ",", "missing_value_action", "=", "missing_value_action", ")" ]
Return target value predictions for ``dataset``, using the trained linear regression model. This method can be used to get fitted values for the model by inputting the training dataset. Parameters ---------- dataset : SFrame | pandas.Dataframe Dataset of new observat...
[ "Return", "target", "value", "predictions", "for", "dataset", "using", "the", "trained", "linear", "regression", "model", ".", "This", "method", "can", "be", "used", "to", "get", "fitted", "values", "for", "the", "model", "by", "inputting", "the", "training", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/regression/linear_regression.py#L519-L564
train
Predict target value for each example in the dataset.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/regression/linear_regression.py
LinearRegression.evaluate
def evaluate(self, dataset, metric='auto', missing_value_action='auto'): r"""Evaluate the model by making target value predictions and comparing to actual values. Two metrics are used to evaluate linear regression models. The first is root-mean-squared error (RMSE) while the second is ...
python
def evaluate(self, dataset, metric='auto', missing_value_action='auto'): r"""Evaluate the model by making target value predictions and comparing to actual values. Two metrics are used to evaluate linear regression models. The first is root-mean-squared error (RMSE) while the second is ...
[ "def", "evaluate", "(", "self", ",", "dataset", ",", "metric", "=", "'auto'", ",", "missing_value_action", "=", "'auto'", ")", ":", "_raise_error_evaluation_metric_is_valid", "(", "metric", ",", "[", "'auto'", ",", "'rmse'", ",", "'max_error'", "]", ")", "retu...
r"""Evaluate the model by making target value predictions and comparing to actual values. Two metrics are used to evaluate linear regression models. The first is root-mean-squared error (RMSE) while the second is the absolute value of the maximum error between the actual and predicted ...
[ "r", "Evaluate", "the", "model", "by", "making", "target", "value", "predictions", "and", "comparing", "to", "actual", "values", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/regression/linear_regression.py#L567-L635
train
Evaluate the model by making target value predictions and comparing to actual values.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/sound_classifier/mel_features.py
frame
def frame(data, window_length, hop_length): """Convert array into a sequence of successive possibly overlapping frames. An n-dimensional array of shape (num_samples, ...) is converted into an (n+1)-D array of shape (num_frames, window_length, ...), where each frame starts hop_length points after the preceding ...
python
def frame(data, window_length, hop_length): """Convert array into a sequence of successive possibly overlapping frames. An n-dimensional array of shape (num_samples, ...) is converted into an (n+1)-D array of shape (num_frames, window_length, ...), where each frame starts hop_length points after the preceding ...
[ "def", "frame", "(", "data", ",", "window_length", ",", "hop_length", ")", ":", "num_samples", "=", "data", ".", "shape", "[", "0", "]", "num_frames", "=", "1", "+", "int", "(", "np", ".", "floor", "(", "(", "num_samples", "-", "window_length", ")", ...
Convert array into a sequence of successive possibly overlapping frames. An n-dimensional array of shape (num_samples, ...) is converted into an (n+1)-D array of shape (num_frames, window_length, ...), where each frame starts hop_length points after the preceding one. This is accomplished using stride_tricks,...
[ "Convert", "array", "into", "a", "sequence", "of", "successive", "possibly", "overlapping", "frames", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/sound_classifier/mel_features.py#L21-L45
train
Convert array into a sequence of successive possibly overlapping frames.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/sound_classifier/mel_features.py
periodic_hann
def periodic_hann(window_length): """Calculate a "periodic" Hann window. The classic Hann window is defined as a raised cosine that starts and ends on zero, and where every value appears twice, except the middle point for an odd-length window. Matlab calls this a "symmetric" window and np.hanning() returns ...
python
def periodic_hann(window_length): """Calculate a "periodic" Hann window. The classic Hann window is defined as a raised cosine that starts and ends on zero, and where every value appears twice, except the middle point for an odd-length window. Matlab calls this a "symmetric" window and np.hanning() returns ...
[ "def", "periodic_hann", "(", "window_length", ")", ":", "return", "0.5", "-", "(", "0.5", "*", "np", ".", "cos", "(", "2", "*", "np", ".", "pi", "/", "window_length", "*", "np", ".", "arange", "(", "window_length", ")", ")", ")" ]
Calculate a "periodic" Hann window. The classic Hann window is defined as a raised cosine that starts and ends on zero, and where every value appears twice, except the middle point for an odd-length window. Matlab calls this a "symmetric" window and np.hanning() returns it. However, for Fourier analysis, thi...
[ "Calculate", "a", "periodic", "Hann", "window", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/sound_classifier/mel_features.py#L48-L68
train
Calculates a periodic Hann window.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/sound_classifier/mel_features.py
stft_magnitude
def stft_magnitude(signal, fft_length, hop_length=None, window_length=None): """Calculate the short-time Fourier transform magnitude. Args: signal: 1D np.array of the input time-domain signal. fft_length: Size of the FFT to apply. hop_length: Advance (in samples) b...
python
def stft_magnitude(signal, fft_length, hop_length=None, window_length=None): """Calculate the short-time Fourier transform magnitude. Args: signal: 1D np.array of the input time-domain signal. fft_length: Size of the FFT to apply. hop_length: Advance (in samples) b...
[ "def", "stft_magnitude", "(", "signal", ",", "fft_length", ",", "hop_length", "=", "None", ",", "window_length", "=", "None", ")", ":", "frames", "=", "frame", "(", "signal", ",", "window_length", ",", "hop_length", ")", "# Apply frame window to each frame. We use...
Calculate the short-time Fourier transform magnitude. Args: signal: 1D np.array of the input time-domain signal. fft_length: Size of the FFT to apply. hop_length: Advance (in samples) between each frame passed to FFT. window_length: Length of each block of samples to pass to FFT. Returns: 2D n...
[ "Calculate", "the", "short", "-", "time", "Fourier", "transform", "magnitude", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/sound_classifier/mel_features.py#L71-L92
train
Calculate the short - time Fourier transform magnitude.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/sound_classifier/mel_features.py
spectrogram_to_mel_matrix
def spectrogram_to_mel_matrix(num_mel_bins=20, num_spectrogram_bins=129, audio_sample_rate=8000, lower_edge_hertz=125.0, upper_edge_hertz=3800.0): """Return a matrix that can post-multiply spectrogr...
python
def spectrogram_to_mel_matrix(num_mel_bins=20, num_spectrogram_bins=129, audio_sample_rate=8000, lower_edge_hertz=125.0, upper_edge_hertz=3800.0): """Return a matrix that can post-multiply spectrogr...
[ "def", "spectrogram_to_mel_matrix", "(", "num_mel_bins", "=", "20", ",", "num_spectrogram_bins", "=", "129", ",", "audio_sample_rate", "=", "8000", ",", "lower_edge_hertz", "=", "125.0", ",", "upper_edge_hertz", "=", "3800.0", ")", ":", "nyquist_hertz", "=", "audi...
Return a matrix that can post-multiply spectrogram rows to make mel. Returns a np.array matrix A that can be used to post-multiply a matrix S of spectrogram values (STFT magnitudes) arranged as frames x bins to generate a "mel spectrogram" M of frames x num_mel_bins. M = S A. The classic HTK algorithm exploi...
[ "Return", "a", "matrix", "that", "can", "post", "-", "multiply", "spectrogram", "rows", "to", "make", "mel", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/sound_classifier/mel_features.py#L114-L189
train
This function takes a spectrogram and returns a matrix that can post - multiply it into mel.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/sound_classifier/mel_features.py
log_mel_spectrogram
def log_mel_spectrogram(data, audio_sample_rate=8000, log_offset=0.0, window_length_secs=0.025, hop_length_secs=0.010, **kwargs): """Convert waveform to a log magnitude mel-frequency spectrogram. ...
python
def log_mel_spectrogram(data, audio_sample_rate=8000, log_offset=0.0, window_length_secs=0.025, hop_length_secs=0.010, **kwargs): """Convert waveform to a log magnitude mel-frequency spectrogram. ...
[ "def", "log_mel_spectrogram", "(", "data", ",", "audio_sample_rate", "=", "8000", ",", "log_offset", "=", "0.0", ",", "window_length_secs", "=", "0.025", ",", "hop_length_secs", "=", "0.010", ",", "*", "*", "kwargs", ")", ":", "window_length_samples", "=", "in...
Convert waveform to a log magnitude mel-frequency spectrogram. Args: data: 1D np.array of waveform data. audio_sample_rate: The sampling rate of data. log_offset: Add this to values when taking log to avoid -Infs. window_length_secs: Duration of each window to analyze. hop_length_secs: Advance be...
[ "Convert", "waveform", "to", "a", "log", "magnitude", "mel", "-", "frequency", "spectrogram", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/sound_classifier/mel_features.py#L192-L223
train
Convert a 1D array of data to a log magnitude mel - frequency spectrogram.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/util/_sframe_generation.py
generate_random_sframe
def generate_random_sframe(num_rows, column_codes, random_seed = 0): """ Creates a random SFrame with `num_rows` rows and randomly generated column types determined by `column_codes`. The output SFrame is deterministic based on `random_seed`. `column_types` is a string with each character denoti...
python
def generate_random_sframe(num_rows, column_codes, random_seed = 0): """ Creates a random SFrame with `num_rows` rows and randomly generated column types determined by `column_codes`. The output SFrame is deterministic based on `random_seed`. `column_types` is a string with each character denoti...
[ "def", "generate_random_sframe", "(", "num_rows", ",", "column_codes", ",", "random_seed", "=", "0", ")", ":", "from", ".", ".", "extensions", "import", "_generate_random_sframe", "assert", "isinstance", "(", "column_codes", ",", "str", ")", "assert", "isinstance"...
Creates a random SFrame with `num_rows` rows and randomly generated column types determined by `column_codes`. The output SFrame is deterministic based on `random_seed`. `column_types` is a string with each character denoting one type of column, with the output SFrame having one column for each ...
[ "Creates", "a", "random", "SFrame", "with", "num_rows", "rows", "and", "randomly", "generated", "column", "types", "determined", "by", "column_codes", ".", "The", "output", "SFrame", "is", "deterministic", "based", "on", "random_seed", ".", "column_types", "is", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/util/_sframe_generation.py#L13-L71
train
Generates a random SFrame with num_rows rows and column types determined by column_codes.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/util/_sframe_generation.py
generate_random_regression_sframe
def generate_random_regression_sframe(num_rows, column_codes, random_seed = 0, target_noise_level = 0.25): """ Creates a random SFrame with `num_rows` rows and randomly generated column types determined by `column_codes`. The output SFrame is deterministic based on `random_seed`. In addition, a ta...
python
def generate_random_regression_sframe(num_rows, column_codes, random_seed = 0, target_noise_level = 0.25): """ Creates a random SFrame with `num_rows` rows and randomly generated column types determined by `column_codes`. The output SFrame is deterministic based on `random_seed`. In addition, a ta...
[ "def", "generate_random_regression_sframe", "(", "num_rows", ",", "column_codes", ",", "random_seed", "=", "0", ",", "target_noise_level", "=", "0.25", ")", ":", "from", ".", ".", "extensions", "import", "_generate_random_sframe", "assert", "isinstance", "(", "colum...
Creates a random SFrame with `num_rows` rows and randomly generated column types determined by `column_codes`. The output SFrame is deterministic based on `random_seed`. In addition, a target column is generated with values dependent on the randomly generated features in a given row. `column_ty...
[ "Creates", "a", "random", "SFrame", "with", "num_rows", "rows", "and", "randomly", "generated", "column", "types", "determined", "by", "column_codes", ".", "The", "output", "SFrame", "is", "deterministic", "based", "on", "random_seed", ".", "In", "addition", "a"...
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/util/_sframe_generation.py#L73-L157
train
Generates a random SFrame with num_rows rows and column types determined by column_codes.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/util/_sframe_generation.py
generate_random_classification_sframe
def generate_random_classification_sframe(num_rows, column_codes, num_classes, misclassification_spread = 0.25, num_extra_class_bins = None, random_seed = 0): """ Creates a random SFrame...
python
def generate_random_classification_sframe(num_rows, column_codes, num_classes, misclassification_spread = 0.25, num_extra_class_bins = None, random_seed = 0): """ Creates a random SFrame...
[ "def", "generate_random_classification_sframe", "(", "num_rows", ",", "column_codes", ",", "num_classes", ",", "misclassification_spread", "=", "0.25", ",", "num_extra_class_bins", "=", "None", ",", "random_seed", "=", "0", ")", ":", "from", ".", ".", "extensions", ...
Creates a random SFrame with `num_rows` rows and randomly generated column types determined by `column_codes`. The output SFrame is deterministic based on `random_seed`. In addition, a target column is generated with values dependent on the randomly generated features in a given row. `column_ty...
[ "Creates", "a", "random", "SFrame", "with", "num_rows", "rows", "and", "randomly", "generated", "column", "types", "determined", "by", "column_codes", ".", "The", "output", "SFrame", "is", "deterministic", "based", "on", "random_seed", ".", "In", "addition", "a"...
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/util/_sframe_generation.py#L159-L255
train
Generates a random SFrame with num_rows rows and num_classes classes generated by column_codes.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/models/_infer_shapes_nn_mlmodel.py
infer_shapes
def infer_shapes(nn_spec, input_spec, input_shape_dict = None): """ Input: spec : mlmodel spec input_shape_dict: dictionary of string --> tuple string: input name tuple: input shape as a 5 length tuple in order (Seq, Batch, C, H, W) If inp...
python
def infer_shapes(nn_spec, input_spec, input_shape_dict = None): """ Input: spec : mlmodel spec input_shape_dict: dictionary of string --> tuple string: input name tuple: input shape as a 5 length tuple in order (Seq, Batch, C, H, W) If inp...
[ "def", "infer_shapes", "(", "nn_spec", ",", "input_spec", ",", "input_shape_dict", "=", "None", ")", ":", "shape_dict", "=", "{", "}", "if", "input_shape_dict", ":", "for", "key", ",", "value", "in", "input_shape_dict", ".", "items", "(", ")", ":", "assert...
Input: spec : mlmodel spec input_shape_dict: dictionary of string --> tuple string: input name tuple: input shape as a 5 length tuple in order (Seq, Batch, C, H, W) If input_shape_dict is not provided, input shapes are inferred from the input descr...
[ "Input", ":" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/_infer_shapes_nn_mlmodel.py#L402-L466
train
Infer the shapes of all blobs in the neural network from the input spec.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/converters/libsvm/_libsvm_converter.py
convert
def convert(libsvm_model, feature_names, target, input_length, probability): """Convert a svm model to the protobuf spec. This currently supports: * C-SVC * nu-SVC * Epsilon-SVR * nu-SVR Parameters ---------- model_path: libsvm_model Libsvm representation of the mode...
python
def convert(libsvm_model, feature_names, target, input_length, probability): """Convert a svm model to the protobuf spec. This currently supports: * C-SVC * nu-SVC * Epsilon-SVR * nu-SVR Parameters ---------- model_path: libsvm_model Libsvm representation of the mode...
[ "def", "convert", "(", "libsvm_model", ",", "feature_names", ",", "target", ",", "input_length", ",", "probability", ")", ":", "if", "not", "(", "HAS_LIBSVM", ")", ":", "raise", "RuntimeError", "(", "'libsvm not found. libsvm conversion API is disabled.'", ")", "imp...
Convert a svm model to the protobuf spec. This currently supports: * C-SVC * nu-SVC * Epsilon-SVR * nu-SVR Parameters ---------- model_path: libsvm_model Libsvm representation of the model. feature_names : [str] | str Names of each of the features. targ...
[ "Convert", "a", "svm", "model", "to", "the", "protobuf", "spec", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/libsvm/_libsvm_converter.py#L23-L176
train
Convert a libsvm model to the protobuf spec.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/activity_classifier/_activity_classifier.py
create
def create(dataset, session_id, target, features=None, prediction_window=100, validation_set='auto', max_iterations=10, batch_size=32, verbose=True): """ Create an :class:`ActivityClassifier` model. Parameters ---------- dataset : SFrame Input data which consists of `sessions` of...
python
def create(dataset, session_id, target, features=None, prediction_window=100, validation_set='auto', max_iterations=10, batch_size=32, verbose=True): """ Create an :class:`ActivityClassifier` model. Parameters ---------- dataset : SFrame Input data which consists of `sessions` of...
[ "def", "create", "(", "dataset", ",", "session_id", ",", "target", ",", "features", "=", "None", ",", "prediction_window", "=", "100", ",", "validation_set", "=", "'auto'", ",", "max_iterations", "=", "10", ",", "batch_size", "=", "32", ",", "verbose", "="...
Create an :class:`ActivityClassifier` model. Parameters ---------- dataset : SFrame Input data which consists of `sessions` of data where each session is a sequence of data. The data must be in `stacked` format, grouped by session. Within each session, the data is assumed to be sort...
[ "Create", "an", ":", "class", ":", "ActivityClassifier", "model", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/activity_classifier/_activity_classifier.py#L33-L286
train
Create an activity classifier model for the given dataset session_id and target.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/activity_classifier/_activity_classifier.py
_encode_target
def _encode_target(data, target, mapping=None): """ Encode targets to integers in [0, num_classes - 1] """ if mapping is None: mapping = {t: i for i, t in enumerate(sorted(data[target].unique()))} data[target] = data[target].apply(lambda t: mapping[t]) return data, mapping
python
def _encode_target(data, target, mapping=None): """ Encode targets to integers in [0, num_classes - 1] """ if mapping is None: mapping = {t: i for i, t in enumerate(sorted(data[target].unique()))} data[target] = data[target].apply(lambda t: mapping[t]) return data, mapping
[ "def", "_encode_target", "(", "data", ",", "target", ",", "mapping", "=", "None", ")", ":", "if", "mapping", "is", "None", ":", "mapping", "=", "{", "t", ":", "i", "for", "i", ",", "t", "in", "enumerate", "(", "sorted", "(", "data", "[", "target", ...
Encode targets to integers in [0, num_classes - 1]
[ "Encode", "targets", "to", "integers", "in", "[", "0", "num_classes", "-", "1", "]" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/activity_classifier/_activity_classifier.py#L289-L295
train
Encode targets to integers in [ 0 num_classes - 1 )
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/activity_classifier/_activity_classifier.py
ActivityClassifier.export_coreml
def export_coreml(self, filename): """ Export the model in Core ML format. Parameters ---------- filename: str A valid filename where the model can be saved. Examples -------- >>> model.export_coreml("MyModel.mlmodel") """ impor...
python
def export_coreml(self, filename): """ Export the model in Core ML format. Parameters ---------- filename: str A valid filename where the model can be saved. Examples -------- >>> model.export_coreml("MyModel.mlmodel") """ impor...
[ "def", "export_coreml", "(", "self", ",", "filename", ")", ":", "import", "coremltools", "as", "_cmt", "import", "mxnet", "as", "_mx", "from", ".", "_mx_model_architecture", "import", "_net_params", "prob_name", "=", "self", ".", "target", "+", "'Probability'", ...
Export the model in Core ML format. Parameters ---------- filename: str A valid filename where the model can be saved. Examples -------- >>> model.export_coreml("MyModel.mlmodel")
[ "Export", "the", "model", "in", "Core", "ML", "format", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/activity_classifier/_activity_classifier.py#L351-L485
train
Export the model in Core ML format.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/activity_classifier/_activity_classifier.py
ActivityClassifier.predict
def predict(self, dataset, output_type='class', output_frequency='per_row'): """ Return predictions for ``dataset``, using the trained activity classifier. Predictions can be generated as class labels, or as a probability vector with probabilities for each class. The activity cl...
python
def predict(self, dataset, output_type='class', output_frequency='per_row'): """ Return predictions for ``dataset``, using the trained activity classifier. Predictions can be generated as class labels, or as a probability vector with probabilities for each class. The activity cl...
[ "def", "predict", "(", "self", ",", "dataset", ",", "output_type", "=", "'class'", ",", "output_frequency", "=", "'per_row'", ")", ":", "_tkutl", ".", "_raise_error_if_not_sframe", "(", "dataset", ",", "'dataset'", ")", "_tkutl", ".", "_check_categorical_option_ty...
Return predictions for ``dataset``, using the trained activity classifier. Predictions can be generated as class labels, or as a probability vector with probabilities for each class. The activity classifier generates a single prediction for each ``prediction_window`` rows in ``dataset``...
[ "Return", "predictions", "for", "dataset", "using", "the", "trained", "activity", "classifier", ".", "Predictions", "can", "be", "generated", "as", "class", "labels", "or", "as", "a", "probability", "vector", "with", "probabilities", "for", "each", "class", "." ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/activity_classifier/_activity_classifier.py#L487-L664
train
Predict the unreplicated activity class for each entry in the dataset.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/activity_classifier/_activity_classifier.py
ActivityClassifier.evaluate
def evaluate(self, dataset, metric='auto'): """ Evaluate the model by making predictions of target values and comparing these to actual values. Parameters ---------- dataset : SFrame Dataset of new observations. Must include columns with the same ...
python
def evaluate(self, dataset, metric='auto'): """ Evaluate the model by making predictions of target values and comparing these to actual values. Parameters ---------- dataset : SFrame Dataset of new observations. Must include columns with the same ...
[ "def", "evaluate", "(", "self", ",", "dataset", ",", "metric", "=", "'auto'", ")", ":", "avail_metrics", "=", "[", "'accuracy'", ",", "'auc'", ",", "'precision'", ",", "'recall'", ",", "'f1_score'", ",", "'log_loss'", ",", "'confusion_matrix'", ",", "'roc_cu...
Evaluate the model by making predictions of target values and comparing these to actual values. Parameters ---------- dataset : SFrame Dataset of new observations. Must include columns with the same names as the session_id, target and features used for model trai...
[ "Evaluate", "the", "model", "by", "making", "predictions", "of", "target", "values", "and", "comparing", "these", "to", "actual", "values", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/activity_classifier/_activity_classifier.py#L666-L743
train
Evaluate the model by making predictions of target values and comparing them to actual values.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/activity_classifier/_activity_classifier.py
ActivityClassifier.classify
def classify(self, dataset, output_frequency='per_row'): """ Return a classification, for each ``prediction_window`` examples in the ``dataset``, using the trained activity classification model. The output SFrame contains predictions as both class labels as well as probabilities ...
python
def classify(self, dataset, output_frequency='per_row'): """ Return a classification, for each ``prediction_window`` examples in the ``dataset``, using the trained activity classification model. The output SFrame contains predictions as both class labels as well as probabilities ...
[ "def", "classify", "(", "self", ",", "dataset", ",", "output_frequency", "=", "'per_row'", ")", ":", "_tkutl", ".", "_check_categorical_option_type", "(", "'output_frequency'", ",", "output_frequency", ",", "[", "'per_window'", ",", "'per_row'", "]", ")", "id_targ...
Return a classification, for each ``prediction_window`` examples in the ``dataset``, using the trained activity classification model. The output SFrame contains predictions as both class labels as well as probabilities that the predicted value is the associated label. Parameters ...
[ "Return", "a", "classification", "for", "each", "prediction_window", "examples", "in", "the", "dataset", "using", "the", "trained", "activity", "classification", "model", ".", "The", "output", "SFrame", "contains", "predictions", "as", "both", "class", "labels", "...
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/activity_classifier/_activity_classifier.py#L745-L795
train
Return a classification for each prediction_window examples in the dataset.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/activity_classifier/_activity_classifier.py
ActivityClassifier.predict_topk
def predict_topk(self, dataset, output_type='probability', k=3, output_frequency='per_row'): """ Return top-k predictions for the ``dataset``, using the trained model. Predictions are returned as an SFrame with three columns: `prediction_id`, `class`, and `probability`, or `rank`, depen...
python
def predict_topk(self, dataset, output_type='probability', k=3, output_frequency='per_row'): """ Return top-k predictions for the ``dataset``, using the trained model. Predictions are returned as an SFrame with three columns: `prediction_id`, `class`, and `probability`, or `rank`, depen...
[ "def", "predict_topk", "(", "self", ",", "dataset", ",", "output_type", "=", "'probability'", ",", "k", "=", "3", ",", "output_frequency", "=", "'per_row'", ")", ":", "_tkutl", ".", "_check_categorical_option_type", "(", "'output_type'", ",", "output_type", ",",...
Return top-k predictions for the ``dataset``, using the trained model. Predictions are returned as an SFrame with three columns: `prediction_id`, `class`, and `probability`, or `rank`, depending on the ``output_type`` parameter. Parameters ---------- dataset : SFrame ...
[ "Return", "top", "-", "k", "predictions", "for", "the", "dataset", "using", "the", "trained", "model", ".", "Predictions", "are", "returned", "as", "an", "SFrame", "with", "three", "columns", ":", "prediction_id", "class", "and", "probability", "or", "rank", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/activity_classifier/_activity_classifier.py#L797-L891
train
Predicts the top - k class of the dataset using the trained model.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/libs/metaparse/tools/benchmark/char_stat.py
count_characters
def count_characters(root, out): """Count the occurrances of the different characters in the files""" if os.path.isfile(root): with open(root, 'rb') as in_f: for line in in_f: for char in line: if char not in out: out[char] = 0 ...
python
def count_characters(root, out): """Count the occurrances of the different characters in the files""" if os.path.isfile(root): with open(root, 'rb') as in_f: for line in in_f: for char in line: if char not in out: out[char] = 0 ...
[ "def", "count_characters", "(", "root", ",", "out", ")", ":", "if", "os", ".", "path", ".", "isfile", "(", "root", ")", ":", "with", "open", "(", "root", ",", "'rb'", ")", "as", "in_f", ":", "for", "line", "in", "in_f", ":", "for", "char", "in", ...
Count the occurrances of the different characters in the files
[ "Count", "the", "occurrances", "of", "the", "different", "characters", "in", "the", "files" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/metaparse/tools/benchmark/char_stat.py#L13-L24
train
Count the occurrances of the different characters in the files
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/libs/metaparse/tools/benchmark/char_stat.py
main
def main(): """The main function of the script""" desc = 'Generate character statistics from a source tree' parser = argparse.ArgumentParser(description=desc) parser.add_argument( '--src', dest='src', required=True, help='The root of the source tree' ) parser.add_...
python
def main(): """The main function of the script""" desc = 'Generate character statistics from a source tree' parser = argparse.ArgumentParser(description=desc) parser.add_argument( '--src', dest='src', required=True, help='The root of the source tree' ) parser.add_...
[ "def", "main", "(", ")", ":", "desc", "=", "'Generate character statistics from a source tree'", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "desc", ")", "parser", ".", "add_argument", "(", "'--src'", ",", "dest", "=", "'src'", ","...
The main function of the script
[ "The", "main", "function", "of", "the", "script" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/metaparse/tools/benchmark/char_stat.py#L34-L55
train
The main function of the script
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/models/utils.py
save_spec
def save_spec(spec, filename): """ Save a protobuf model specification to file. Parameters ---------- spec: Model_pb Protobuf representation of the model filename: str File path where the spec gets saved. Examples -------- .. sourcecode:: python >>> corem...
python
def save_spec(spec, filename): """ Save a protobuf model specification to file. Parameters ---------- spec: Model_pb Protobuf representation of the model filename: str File path where the spec gets saved. Examples -------- .. sourcecode:: python >>> corem...
[ "def", "save_spec", "(", "spec", ",", "filename", ")", ":", "name", ",", "ext", "=", "_os", ".", "path", ".", "splitext", "(", "filename", ")", "if", "not", "ext", ":", "filename", "=", "\"%s.mlmodel\"", "%", "filename", "else", ":", "if", "ext", "!=...
Save a protobuf model specification to file. Parameters ---------- spec: Model_pb Protobuf representation of the model filename: str File path where the spec gets saved. Examples -------- .. sourcecode:: python >>> coremltools.utils.save_spec(spec, 'HousePricer.m...
[ "Save", "a", "protobuf", "model", "specification", "to", "file", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/utils.py#L28-L59
train
Save a protobuf model specification to file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/models/utils.py
load_spec
def load_spec(filename): """ Load a protobuf model specification from file Parameters ---------- filename: str Location on disk (a valid filepath) from which the file is loaded as a protobuf spec. Returns ------- model_spec: Model_pb Protobuf representation of t...
python
def load_spec(filename): """ Load a protobuf model specification from file Parameters ---------- filename: str Location on disk (a valid filepath) from which the file is loaded as a protobuf spec. Returns ------- model_spec: Model_pb Protobuf representation of t...
[ "def", "load_spec", "(", "filename", ")", ":", "from", ".", ".", "proto", "import", "Model_pb2", "spec", "=", "Model_pb2", ".", "Model", "(", ")", "with", "open", "(", "filename", ",", "'rb'", ")", "as", "f", ":", "contents", "=", "f", ".", "read", ...
Load a protobuf model specification from file Parameters ---------- filename: str Location on disk (a valid filepath) from which the file is loaded as a protobuf spec. Returns ------- model_spec: Model_pb Protobuf representation of the model Examples -------- ...
[ "Load", "a", "protobuf", "model", "specification", "from", "file" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/utils.py#L62-L93
train
Loads a protobuf model specification from a file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/models/utils.py
_get_nn_layers
def _get_nn_layers(spec): """ Returns a list of neural network layers if the model contains any. Parameters ---------- spec: Model_pb A model protobuf specification. Returns ------- [NN layer] list of all layers (including layers from elements of a pipeline """ ...
python
def _get_nn_layers(spec): """ Returns a list of neural network layers if the model contains any. Parameters ---------- spec: Model_pb A model protobuf specification. Returns ------- [NN layer] list of all layers (including layers from elements of a pipeline """ ...
[ "def", "_get_nn_layers", "(", "spec", ")", ":", "layers", "=", "[", "]", "if", "spec", ".", "WhichOneof", "(", "'Type'", ")", "==", "'pipeline'", ":", "layers", "=", "[", "]", "for", "model_spec", "in", "spec", ".", "pipeline", ".", "models", ":", "i...
Returns a list of neural network layers if the model contains any. Parameters ---------- spec: Model_pb A model protobuf specification. Returns ------- [NN layer] list of all layers (including layers from elements of a pipeline
[ "Returns", "a", "list", "of", "neural", "network", "layers", "if", "the", "model", "contains", "any", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/utils.py#L96-L137
train
Returns a list of neural network layers in a single model.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/models/utils.py
evaluate_regressor
def evaluate_regressor(model, data, target="target", verbose=False): """ Evaluate a CoreML regression model and compare against predictions from the original framework (for testing correctness of conversion) Parameters ---------- filename: [str | MLModel] File path from which to load th...
python
def evaluate_regressor(model, data, target="target", verbose=False): """ Evaluate a CoreML regression model and compare against predictions from the original framework (for testing correctness of conversion) Parameters ---------- filename: [str | MLModel] File path from which to load th...
[ "def", "evaluate_regressor", "(", "model", ",", "data", ",", "target", "=", "\"target\"", ",", "verbose", "=", "False", ")", ":", "model", "=", "_get_model", "(", "model", ")", "if", "verbose", ":", "print", "(", "\"\"", ")", "print", "(", "\"Other Frame...
Evaluate a CoreML regression model and compare against predictions from the original framework (for testing correctness of conversion) Parameters ---------- filename: [str | MLModel] File path from which to load the MLModel from (OR) a loaded version of MLModel. data: [str | Datafr...
[ "Evaluate", "a", "CoreML", "regression", "model", "and", "compare", "against", "predictions", "from", "the", "original", "framework", "(", "for", "testing", "correctness", "of", "conversion", ")" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/utils.py#L386-L448
train
Evaluate a CoreML regression model and compare against predictions.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/models/utils.py
evaluate_classifier
def evaluate_classifier(model, data, target='target', verbose=False): """ Evaluate a CoreML classifier model and compare against predictions from the original framework (for testing correctness of conversion). Use this evaluation for models that don't deal with probabilities. Parameters -------...
python
def evaluate_classifier(model, data, target='target', verbose=False): """ Evaluate a CoreML classifier model and compare against predictions from the original framework (for testing correctness of conversion). Use this evaluation for models that don't deal with probabilities. Parameters -------...
[ "def", "evaluate_classifier", "(", "model", ",", "data", ",", "target", "=", "'target'", ",", "verbose", "=", "False", ")", ":", "model", "=", "_get_model", "(", "model", ")", "if", "verbose", ":", "print", "(", "\"\"", ")", "print", "(", "\"Other Framew...
Evaluate a CoreML classifier model and compare against predictions from the original framework (for testing correctness of conversion). Use this evaluation for models that don't deal with probabilities. Parameters ---------- filename: [str | MLModel] File from where to load the model from (...
[ "Evaluate", "a", "CoreML", "classifier", "model", "and", "compare", "against", "predictions", "from", "the", "original", "framework", "(", "for", "testing", "correctness", "of", "conversion", ")", ".", "Use", "this", "evaluation", "for", "models", "that", "don",...
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/utils.py#L451-L509
train
Evaluate a CoreML classifier model and compare against predictions.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/models/utils.py
evaluate_classifier_with_probabilities
def evaluate_classifier_with_probabilities(model, data, probabilities='probabilities', verbose = False): """ Evaluate a classifier specification for testing. Parameters ---------- filename: [str | Model] F...
python
def evaluate_classifier_with_probabilities(model, data, probabilities='probabilities', verbose = False): """ Evaluate a classifier specification for testing. Parameters ---------- filename: [str | Model] F...
[ "def", "evaluate_classifier_with_probabilities", "(", "model", ",", "data", ",", "probabilities", "=", "'probabilities'", ",", "verbose", "=", "False", ")", ":", "model", "=", "_get_model", "(", "model", ")", "if", "verbose", ":", "print", "(", "\"\"", ")", ...
Evaluate a classifier specification for testing. Parameters ---------- filename: [str | Model] File from where to load the model from (OR) a loaded version of the MLModel. data: [str | Dataframe] Test data on which to evaluate the models (dataframe, or path to a csv fil...
[ "Evaluate", "a", "classifier", "specification", "for", "testing", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/utils.py#L512-L571
train
Evaluate a classifier specification for testing.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/models/utils.py
rename_feature
def rename_feature(spec, current_name, new_name, rename_inputs=True, rename_outputs=True): """ Rename a feature in the specification. Parameters ---------- spec: Model_pb The specification containing the feature to rename. current_name: str Current name of th...
python
def rename_feature(spec, current_name, new_name, rename_inputs=True, rename_outputs=True): """ Rename a feature in the specification. Parameters ---------- spec: Model_pb The specification containing the feature to rename. current_name: str Current name of th...
[ "def", "rename_feature", "(", "spec", ",", "current_name", ",", "new_name", ",", "rename_inputs", "=", "True", ",", "rename_outputs", "=", "True", ")", ":", "from", "coremltools", ".", "models", "import", "MLModel", "if", "not", "rename_inputs", "and", "not", ...
Rename a feature in the specification. Parameters ---------- spec: Model_pb The specification containing the feature to rename. current_name: str Current name of the feature. If this feature doesn't exist, the rename is a no-op. new_name: str New name of the featur...
[ "Rename", "a", "feature", "in", "the", "specification", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/utils.py#L574-L674
train
Rename a feature in the specified specification.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/models/utils.py
_sanitize_value
def _sanitize_value(x): """ Performs cleaning steps on the data so various type comparisons can be performed correctly. """ if isinstance(x, _six.string_types + _six.integer_types + (float,)): return x elif _HAS_SKLEARN and _sp.issparse(x): return x.todense() elif isinstance(...
python
def _sanitize_value(x): """ Performs cleaning steps on the data so various type comparisons can be performed correctly. """ if isinstance(x, _six.string_types + _six.integer_types + (float,)): return x elif _HAS_SKLEARN and _sp.issparse(x): return x.todense() elif isinstance(...
[ "def", "_sanitize_value", "(", "x", ")", ":", "if", "isinstance", "(", "x", ",", "_six", ".", "string_types", "+", "_six", ".", "integer_types", "+", "(", "float", ",", ")", ")", ":", "return", "x", "elif", "_HAS_SKLEARN", "and", "_sp", ".", "issparse"...
Performs cleaning steps on the data so various type comparisons can be performed correctly.
[ "Performs", "cleaning", "steps", "on", "the", "data", "so", "various", "type", "comparisons", "can", "be", "performed", "correctly", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/utils.py#L677-L695
train
Recursively removes the type of the data and returns a copy of the data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/models/utils.py
_element_equal
def _element_equal(x, y): """ Performs a robust equality test between elements. """ if isinstance(x, _np.ndarray) or isinstance(y, _np.ndarray): try: return (abs(_np.asarray(x) - _np.asarray(y)) < 1e-5).all() except: return False elif isinstance(x, dict): ...
python
def _element_equal(x, y): """ Performs a robust equality test between elements. """ if isinstance(x, _np.ndarray) or isinstance(y, _np.ndarray): try: return (abs(_np.asarray(x) - _np.asarray(y)) < 1e-5).all() except: return False elif isinstance(x, dict): ...
[ "def", "_element_equal", "(", "x", ",", "y", ")", ":", "if", "isinstance", "(", "x", ",", "_np", ".", "ndarray", ")", "or", "isinstance", "(", "y", ",", "_np", ".", "ndarray", ")", ":", "try", ":", "return", "(", "abs", "(", "_np", ".", "asarray"...
Performs a robust equality test between elements.
[ "Performs", "a", "robust", "equality", "test", "between", "elements", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/utils.py#L698-L716
train
Performs a robust equality test between elements.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/models/utils.py
evaluate_transformer
def evaluate_transformer(model, input_data, reference_output, verbose=False): """ Evaluate a transformer specification for testing. Parameters ---------- spec: [str | MLModel] File from where to load the Model from (OR) a loaded version of MLModel. inpu...
python
def evaluate_transformer(model, input_data, reference_output, verbose=False): """ Evaluate a transformer specification for testing. Parameters ---------- spec: [str | MLModel] File from where to load the Model from (OR) a loaded version of MLModel. inpu...
[ "def", "evaluate_transformer", "(", "model", ",", "input_data", ",", "reference_output", ",", "verbose", "=", "False", ")", ":", "model", "=", "_get_model", "(", "model", ")", "if", "verbose", ":", "print", "(", "model", ")", "print", "(", "\"\"", ")", "...
Evaluate a transformer specification for testing. Parameters ---------- spec: [str | MLModel] File from where to load the Model from (OR) a loaded version of MLModel. input_data: list[dict] Test data on which to evaluate the models. reference_output: list[dict] Exp...
[ "Evaluate", "a", "transformer", "specification", "for", "testing", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/utils.py#L719-L786
train
Evaluate a transformer specification for testing.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/models/utils.py
_get_input_names
def _get_input_names(spec): """ Returns a list of the names of the inputs to this model. :param spec: The model protobuf specification :return: [str] A list of input feature names """ retval = [feature.name for feature in spec.description.input] return retval
python
def _get_input_names(spec): """ Returns a list of the names of the inputs to this model. :param spec: The model protobuf specification :return: [str] A list of input feature names """ retval = [feature.name for feature in spec.description.input] return retval
[ "def", "_get_input_names", "(", "spec", ")", ":", "retval", "=", "[", "feature", ".", "name", "for", "feature", "in", "spec", ".", "description", ".", "input", "]", "return", "retval" ]
Returns a list of the names of the inputs to this model. :param spec: The model protobuf specification :return: [str] A list of input feature names
[ "Returns", "a", "list", "of", "the", "names", "of", "the", "inputs", "to", "this", "model", ".", ":", "param", "spec", ":", "The", "model", "protobuf", "specification", ":", "return", ":", "[", "str", "]", "A", "list", "of", "input", "feature", "names"...
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/utils.py#L912-L919
train
Returns a list of the names of the inputs to this model.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/graph_analytics/degree_counting.py
create
def create(graph, verbose=True): """ Compute the in degree, out degree and total degree of each vertex. Parameters ---------- graph : SGraph The graph on which to compute degree counts. verbose : bool, optional If True, print progress updates. Returns ------- out :...
python
def create(graph, verbose=True): """ Compute the in degree, out degree and total degree of each vertex. Parameters ---------- graph : SGraph The graph on which to compute degree counts. verbose : bool, optional If True, print progress updates. Returns ------- out :...
[ "def", "create", "(", "graph", ",", "verbose", "=", "True", ")", ":", "from", "turicreate", ".", "_cython", ".", "cy_server", "import", "QuietProgress", "if", "not", "isinstance", "(", "graph", ",", "_SGraph", ")", ":", "raise", "TypeError", "(", "'\"graph...
Compute the in degree, out degree and total degree of each vertex. Parameters ---------- graph : SGraph The graph on which to compute degree counts. verbose : bool, optional If True, print progress updates. Returns ------- out : DegreeCountingModel Examples ------...
[ "Compute", "the", "in", "degree", "out", "degree", "and", "total", "degree", "of", "each", "vertex", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/graph_analytics/degree_counting.py#L57-L119
train
Create a new DegreeCountingModel from a graph.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/litre/cplusplus.py
Example.replace_emphasis
def replace_emphasis(self, s, index = 0): """replace the index'th emphasized text with s""" e = self.emphasized[index] self.body[e[0]:e[1]] = [s] del self.emphasized[index]
python
def replace_emphasis(self, s, index = 0): """replace the index'th emphasized text with s""" e = self.emphasized[index] self.body[e[0]:e[1]] = [s] del self.emphasized[index]
[ "def", "replace_emphasis", "(", "self", ",", "s", ",", "index", "=", "0", ")", ":", "e", "=", "self", ".", "emphasized", "[", "index", "]", "self", ".", "body", "[", "e", "[", "0", "]", ":", "e", "[", "1", "]", "]", "=", "[", "s", "]", "del...
replace the index'th emphasized text with s
[ "replace", "the", "index", "th", "emphasized", "text", "with", "s" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/litre/cplusplus.py#L90-L94
train
replace the index'th emphasized text with s
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/litre/cplusplus.py
CPlusPlusTranslator._execute
def _execute(self, code): """Override of litre._execute; sets up variable context before evaluating code """ self.globals['example'] = self.example eval(code, self.globals)
python
def _execute(self, code): """Override of litre._execute; sets up variable context before evaluating code """ self.globals['example'] = self.example eval(code, self.globals)
[ "def", "_execute", "(", "self", ",", "code", ")", ":", "self", ".", "globals", "[", "'example'", "]", "=", "self", ".", "example", "eval", "(", "code", ",", "self", ".", "globals", ")" ]
Override of litre._execute; sets up variable context before evaluating code
[ "Override", "of", "litre", ".", "_execute", ";", "sets", "up", "variable", "context", "before", "evaluating", "code" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/litre/cplusplus.py#L320-L325
train
Override of litre. _execute
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/project.py
ProjectRegistry.find
def find(self, name, current_location): """Given 'name' which can be project-id or plain directory name, return project module corresponding to that id or directory. Returns nothing of project is not found.""" assert isinstance(name, basestring) assert isinstance(current_location...
python
def find(self, name, current_location): """Given 'name' which can be project-id or plain directory name, return project module corresponding to that id or directory. Returns nothing of project is not found.""" assert isinstance(name, basestring) assert isinstance(current_location...
[ "def", "find", "(", "self", ",", "name", ",", "current_location", ")", ":", "assert", "isinstance", "(", "name", ",", "basestring", ")", "assert", "isinstance", "(", "current_location", ",", "basestring", ")", "project_module", "=", "None", "# Try interpreting n...
Given 'name' which can be project-id or plain directory name, return project module corresponding to that id or directory. Returns nothing of project is not found.
[ "Given", "name", "which", "can", "be", "project", "-", "id", "or", "plain", "directory", "name", "return", "project", "module", "corresponding", "to", "that", "id", "or", "directory", ".", "Returns", "nothing", "of", "project", "is", "not", "found", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/project.py#L192-L219
train
Given a project - id or plain directory name return the project module corresponding to that id or directory. Returns nothing of project is not found.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/project.py
ProjectRegistry.module_name
def module_name(self, jamfile_location): """Returns the name of module corresponding to 'jamfile-location'. If no module corresponds to location yet, associates default module name with that location.""" assert isinstance(jamfile_location, basestring) module = self.location2modul...
python
def module_name(self, jamfile_location): """Returns the name of module corresponding to 'jamfile-location'. If no module corresponds to location yet, associates default module name with that location.""" assert isinstance(jamfile_location, basestring) module = self.location2modul...
[ "def", "module_name", "(", "self", ",", "jamfile_location", ")", ":", "assert", "isinstance", "(", "jamfile_location", ",", "basestring", ")", "module", "=", "self", ".", "location2module", ".", "get", "(", "jamfile_location", ")", "if", "not", "module", ":", ...
Returns the name of module corresponding to 'jamfile-location'. If no module corresponds to location yet, associates default module name with that location.
[ "Returns", "the", "name", "of", "module", "corresponding", "to", "jamfile", "-", "location", ".", "If", "no", "module", "corresponds", "to", "location", "yet", "associates", "default", "module", "name", "with", "that", "location", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/project.py#L221-L235
train
Returns the name of module corresponding to jamfile - location.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/project.py
ProjectRegistry.load_standalone
def load_standalone(self, jamfile_module, file): """Loads 'file' as standalone project that has no location associated with it. This is mostly useful for user-config.jam, which should be able to define targets, but although it has some location in filesystem, we do not want any build to...
python
def load_standalone(self, jamfile_module, file): """Loads 'file' as standalone project that has no location associated with it. This is mostly useful for user-config.jam, which should be able to define targets, but although it has some location in filesystem, we do not want any build to...
[ "def", "load_standalone", "(", "self", ",", "jamfile_module", ",", "file", ")", ":", "assert", "isinstance", "(", "jamfile_module", ",", "basestring", ")", "assert", "isinstance", "(", "file", ",", "basestring", ")", "self", ".", "used_projects", "[", "jamfile...
Loads 'file' as standalone project that has no location associated with it. This is mostly useful for user-config.jam, which should be able to define targets, but although it has some location in filesystem, we do not want any build to happen in user's HOME, for example. The ca...
[ "Loads", "file", "as", "standalone", "project", "that", "has", "no", "location", "associated", "with", "it", ".", "This", "is", "mostly", "useful", "for", "user", "-", "config", ".", "jam", "which", "should", "be", "able", "to", "define", "targets", "but",...
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/project.py#L387-L402
train
Loads file as standalone project that has no location associated with it.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/project.py
ProjectRegistry.inherit_attributes
def inherit_attributes(self, project_module, parent_module): """Make 'project-module' inherit attributes of project root and parent module.""" assert isinstance(project_module, basestring) assert isinstance(parent_module, basestring) attributes = self.module2attributes[project_m...
python
def inherit_attributes(self, project_module, parent_module): """Make 'project-module' inherit attributes of project root and parent module.""" assert isinstance(project_module, basestring) assert isinstance(parent_module, basestring) attributes = self.module2attributes[project_m...
[ "def", "inherit_attributes", "(", "self", ",", "project_module", ",", "parent_module", ")", ":", "assert", "isinstance", "(", "project_module", ",", "basestring", ")", "assert", "isinstance", "(", "parent_module", ",", "basestring", ")", "attributes", "=", "self",...
Make 'project-module' inherit attributes of project root and parent module.
[ "Make", "project", "-", "module", "inherit", "attributes", "of", "project", "root", "and", "parent", "module", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/project.py#L511-L549
train
Make project - module inherit attributes of project root and parent module.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/project.py
ProjectRegistry.register_id
def register_id(self, id, module): """Associate the given id with the given project module.""" assert isinstance(id, basestring) assert isinstance(module, basestring) self.id2module[id] = module
python
def register_id(self, id, module): """Associate the given id with the given project module.""" assert isinstance(id, basestring) assert isinstance(module, basestring) self.id2module[id] = module
[ "def", "register_id", "(", "self", ",", "id", ",", "module", ")", ":", "assert", "isinstance", "(", "id", ",", "basestring", ")", "assert", "isinstance", "(", "module", ",", "basestring", ")", "self", ".", "id2module", "[", "id", "]", "=", "module" ]
Associate the given id with the given project module.
[ "Associate", "the", "given", "id", "with", "the", "given", "project", "module", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/project.py#L551-L555
train
Associate the given id with the given project module.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/project.py
ProjectRegistry.push_current
def push_current(self, project): """Temporary changes the current project to 'project'. Should be followed by 'pop-current'.""" if __debug__: from .targets import ProjectTarget assert isinstance(project, ProjectTarget) self.saved_current_project.append(self.curren...
python
def push_current(self, project): """Temporary changes the current project to 'project'. Should be followed by 'pop-current'.""" if __debug__: from .targets import ProjectTarget assert isinstance(project, ProjectTarget) self.saved_current_project.append(self.curren...
[ "def", "push_current", "(", "self", ",", "project", ")", ":", "if", "__debug__", ":", "from", ".", "targets", "import", "ProjectTarget", "assert", "isinstance", "(", "project", ",", "ProjectTarget", ")", "self", ".", "saved_current_project", ".", "append", "("...
Temporary changes the current project to 'project'. Should be followed by 'pop-current'.
[ "Temporary", "changes", "the", "current", "project", "to", "project", ".", "Should", "be", "followed", "by", "pop", "-", "current", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/project.py#L572-L579
train
Temporary changes the current project to project. Should be followed by pop - current.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/project.py
ProjectRegistry.attribute
def attribute(self, project, attribute): """Returns the value of the specified attribute in the specified jamfile module.""" assert isinstance(project, basestring) assert isinstance(attribute, basestring) try: return self.module2attributes[project].get(attribute) ...
python
def attribute(self, project, attribute): """Returns the value of the specified attribute in the specified jamfile module.""" assert isinstance(project, basestring) assert isinstance(attribute, basestring) try: return self.module2attributes[project].get(attribute) ...
[ "def", "attribute", "(", "self", ",", "project", ",", "attribute", ")", ":", "assert", "isinstance", "(", "project", ",", "basestring", ")", "assert", "isinstance", "(", "attribute", ",", "basestring", ")", "try", ":", "return", "self", ".", "module2attribut...
Returns the value of the specified attribute in the specified jamfile module.
[ "Returns", "the", "value", "of", "the", "specified", "attribute", "in", "the", "specified", "jamfile", "module", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/project.py#L593-L601
train
Returns the value of the specified attribute in the specified jamfile module.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/project.py
ProjectRegistry.attributeDefault
def attributeDefault(self, project, attribute, default): """Returns the value of the specified attribute in the specified jamfile module.""" assert isinstance(project, basestring) assert isinstance(attribute, basestring) assert isinstance(default, basestring) or default is None ...
python
def attributeDefault(self, project, attribute, default): """Returns the value of the specified attribute in the specified jamfile module.""" assert isinstance(project, basestring) assert isinstance(attribute, basestring) assert isinstance(default, basestring) or default is None ...
[ "def", "attributeDefault", "(", "self", ",", "project", ",", "attribute", ",", "default", ")", ":", "assert", "isinstance", "(", "project", ",", "basestring", ")", "assert", "isinstance", "(", "attribute", ",", "basestring", ")", "assert", "isinstance", "(", ...
Returns the value of the specified attribute in the specified jamfile module.
[ "Returns", "the", "value", "of", "the", "specified", "attribute", "in", "the", "specified", "jamfile", "module", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/project.py#L603-L609
train
Returns the value of the specified attribute in the specified jamfile module.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/project.py
ProjectRegistry.target
def target(self, project_module): """Returns the project target corresponding to the 'project-module'.""" assert isinstance(project_module, basestring) if project_module not in self.module2target: self.module2target[project_module] = \ b2.build.targets.ProjectTarget(p...
python
def target(self, project_module): """Returns the project target corresponding to the 'project-module'.""" assert isinstance(project_module, basestring) if project_module not in self.module2target: self.module2target[project_module] = \ b2.build.targets.ProjectTarget(p...
[ "def", "target", "(", "self", ",", "project_module", ")", ":", "assert", "isinstance", "(", "project_module", ",", "basestring", ")", "if", "project_module", "not", "in", "self", ".", "module2target", ":", "self", ".", "module2target", "[", "project_module", "...
Returns the project target corresponding to the 'project-module'.
[ "Returns", "the", "project", "target", "corresponding", "to", "the", "project", "-", "module", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/project.py#L611-L619
train
Returns the project target corresponding to the project - module.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/project.py
ProjectRegistry.add_rule
def add_rule(self, name, callable_): """Makes rule 'name' available to all subsequently loaded Jamfiles. Calling that rule wil relay to 'callable'.""" assert isinstance(name, basestring) assert callable(callable_) self.project_rules_.add_rule(name, callable_)
python
def add_rule(self, name, callable_): """Makes rule 'name' available to all subsequently loaded Jamfiles. Calling that rule wil relay to 'callable'.""" assert isinstance(name, basestring) assert callable(callable_) self.project_rules_.add_rule(name, callable_)
[ "def", "add_rule", "(", "self", ",", "name", ",", "callable_", ")", ":", "assert", "isinstance", "(", "name", ",", "basestring", ")", "assert", "callable", "(", "callable_", ")", "self", ".", "project_rules_", ".", "add_rule", "(", "name", ",", "callable_"...
Makes rule 'name' available to all subsequently loaded Jamfiles. Calling that rule wil relay to 'callable'.
[ "Makes", "rule", "name", "available", "to", "all", "subsequently", "loaded", "Jamfiles", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/project.py#L639-L645
train
Makes rule name available to all subsequently loaded Jamfiles.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/project.py
ProjectRegistry.__build_python_module_cache
def __build_python_module_cache(self): """Recursively walks through the b2/src subdirectories and creates an index of base module name to package name. The index is stored within self.__python_module_cache and allows for an O(1) module lookup. For example, given the base module ...
python
def __build_python_module_cache(self): """Recursively walks through the b2/src subdirectories and creates an index of base module name to package name. The index is stored within self.__python_module_cache and allows for an O(1) module lookup. For example, given the base module ...
[ "def", "__build_python_module_cache", "(", "self", ")", ":", "cache", "=", "{", "}", "for", "importer", ",", "mname", ",", "ispkg", "in", "pkgutil", ".", "walk_packages", "(", "b2", ".", "__path__", ",", "prefix", "=", "'b2.'", ")", ":", "basename", "=",...
Recursively walks through the b2/src subdirectories and creates an index of base module name to package name. The index is stored within self.__python_module_cache and allows for an O(1) module lookup. For example, given the base module name `toolset`, self.__python_module_cache...
[ "Recursively", "walks", "through", "the", "b2", "/", "src", "subdirectories", "and", "creates", "an", "index", "of", "base", "module", "name", "to", "package", "name", ".", "The", "index", "is", "stored", "within", "self", ".", "__python_module_cache", "and", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/project.py#L693-L724
train
Recursively walks through the b2 source directory and creates a cache of base module names to package names.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/project.py
ProjectRegistry.load_module
def load_module(self, name, extra_path=None): """Load a Python module that should be useable from Jamfiles. There are generally two types of modules Jamfiles might want to use: - Core Boost.Build. Those are imported using plain names, e.g. 'toolset', so this function checks if w...
python
def load_module(self, name, extra_path=None): """Load a Python module that should be useable from Jamfiles. There are generally two types of modules Jamfiles might want to use: - Core Boost.Build. Those are imported using plain names, e.g. 'toolset', so this function checks if w...
[ "def", "load_module", "(", "self", ",", "name", ",", "extra_path", "=", "None", ")", ":", "assert", "isinstance", "(", "name", ",", "basestring", ")", "assert", "is_iterable_typed", "(", "extra_path", ",", "basestring", ")", "or", "extra_path", "is", "None",...
Load a Python module that should be useable from Jamfiles. There are generally two types of modules Jamfiles might want to use: - Core Boost.Build. Those are imported using plain names, e.g. 'toolset', so this function checks if we have module named b2.package.module already. ...
[ "Load", "a", "Python", "module", "that", "should", "be", "useable", "from", "Jamfiles", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/project.py#L726-L806
train
Load a Python module that should be useable from Jamfiles.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/project.py
ProjectAttributes.set
def set(self, attribute, specification, exact=False): """Set the named attribute from the specification given by the user. The value actually set may be different.""" assert isinstance(attribute, basestring) assert isinstance(exact, (int, bool)) if __debug__ and not exact: ...
python
def set(self, attribute, specification, exact=False): """Set the named attribute from the specification given by the user. The value actually set may be different.""" assert isinstance(attribute, basestring) assert isinstance(exact, (int, bool)) if __debug__ and not exact: ...
[ "def", "set", "(", "self", ",", "attribute", ",", "specification", ",", "exact", "=", "False", ")", ":", "assert", "isinstance", "(", "attribute", ",", "basestring", ")", "assert", "isinstance", "(", "exact", ",", "(", "int", ",", "bool", ")", ")", "if...
Set the named attribute from the specification given by the user. The value actually set may be different.
[ "Set", "the", "named", "attribute", "from", "the", "specification", "given", "by", "the", "user", ".", "The", "value", "actually", "set", "may", "be", "different", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/project.py#L867-L944
train
Set the named attribute from the given specification.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/project.py
ProjectRules.make_wrapper
def make_wrapper(self, callable_): """Given a free-standing function 'callable', return a new callable that will call 'callable' and report all exceptins, using 'call_and_report_errors'.""" assert callable(callable_) def wrapper(*args, **kw): return self.call_and_repo...
python
def make_wrapper(self, callable_): """Given a free-standing function 'callable', return a new callable that will call 'callable' and report all exceptins, using 'call_and_report_errors'.""" assert callable(callable_) def wrapper(*args, **kw): return self.call_and_repo...
[ "def", "make_wrapper", "(", "self", ",", "callable_", ")", ":", "assert", "callable", "(", "callable_", ")", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kw", ")", ":", "return", "self", ".", "call_and_report_errors", "(", "callable_", ",", "*", ...
Given a free-standing function 'callable', return a new callable that will call 'callable' and report all exceptins, using 'call_and_report_errors'.
[ "Given", "a", "free", "-", "standing", "function", "callable", "return", "a", "new", "callable", "that", "will", "call", "callable", "and", "report", "all", "exceptins", "using", "call_and_report_errors", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/project.py#L1044-L1051
train
Given a free -standing function callable return a new callable that will call the callable and report all exceptins using call_and_report_errors.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/project.py
ProjectRules.constant
def constant(self, name, value): """Declare and set a project global constant. Project global constants are normal variables but should not be changed. They are applied to every child Jamfile.""" assert is_iterable_typed(name, basestring) assert is_iterable_typed(value, basestrin...
python
def constant(self, name, value): """Declare and set a project global constant. Project global constants are normal variables but should not be changed. They are applied to every child Jamfile.""" assert is_iterable_typed(name, basestring) assert is_iterable_typed(value, basestrin...
[ "def", "constant", "(", "self", ",", "name", ",", "value", ")", ":", "assert", "is_iterable_typed", "(", "name", ",", "basestring", ")", "assert", "is_iterable_typed", "(", "value", ",", "basestring", ")", "self", ".", "registry", ".", "current", "(", ")",...
Declare and set a project global constant. Project global constants are normal variables but should not be changed. They are applied to every child Jamfile.
[ "Declare", "and", "set", "a", "project", "global", "constant", ".", "Project", "global", "constants", "are", "normal", "variables", "but", "should", "not", "be", "changed", ".", "They", "are", "applied", "to", "every", "child", "Jamfile", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/project.py#L1136-L1142
train
Declare and set a project global constant.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/project.py
ProjectRules.path_constant
def path_constant(self, name, value): """Declare and set a project global constant, whose value is a path. The path is adjusted to be relative to the invocation directory. The given value path is taken to be either absolute, or relative to this project root.""" assert is_iterable...
python
def path_constant(self, name, value): """Declare and set a project global constant, whose value is a path. The path is adjusted to be relative to the invocation directory. The given value path is taken to be either absolute, or relative to this project root.""" assert is_iterable...
[ "def", "path_constant", "(", "self", ",", "name", ",", "value", ")", ":", "assert", "is_iterable_typed", "(", "name", ",", "basestring", ")", "assert", "is_iterable_typed", "(", "value", ",", "basestring", ")", "if", "len", "(", "value", ")", ">", "1", "...
Declare and set a project global constant, whose value is a path. The path is adjusted to be relative to the invocation directory. The given value path is taken to be either absolute, or relative to this project root.
[ "Declare", "and", "set", "a", "project", "global", "constant", "whose", "value", "is", "a", "path", ".", "The", "path", "is", "adjusted", "to", "be", "relative", "to", "the", "invocation", "directory", ".", "The", "given", "value", "path", "is", "taken", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/project.py#L1144-L1153
train
Declare and set a project global constant whose value is a path. The given name and value are assumed to be absolute relative to the invocation directory. The given value is assumed to be relative to the invocation directory. The given name and value are assumed to be absolute relative to the invocation directory.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/project.py
ProjectRules.conditional
def conditional(self, condition, requirements): """Calculates conditional requirements for multiple requirements at once. This is a shorthand to be reduce duplication and to keep an inline declarative syntax. For example: lib x : x.cpp : [ conditional <toolset>gcc <variant>debug : ...
python
def conditional(self, condition, requirements): """Calculates conditional requirements for multiple requirements at once. This is a shorthand to be reduce duplication and to keep an inline declarative syntax. For example: lib x : x.cpp : [ conditional <toolset>gcc <variant>debug : ...
[ "def", "conditional", "(", "self", ",", "condition", ",", "requirements", ")", ":", "assert", "is_iterable_typed", "(", "condition", ",", "basestring", ")", "assert", "is_iterable_typed", "(", "requirements", ",", "basestring", ")", "c", "=", "string", ".", "j...
Calculates conditional requirements for multiple requirements at once. This is a shorthand to be reduce duplication and to keep an inline declarative syntax. For example: lib x : x.cpp : [ conditional <toolset>gcc <variant>debug : <define>DEBUG_EXCEPTION <define>DEBUG_TRACE ...
[ "Calculates", "conditional", "requirements", "for", "multiple", "requirements", "at", "once", ".", "This", "is", "a", "shorthand", "to", "be", "reduce", "duplication", "and", "to", "keep", "an", "inline", "declarative", "syntax", ".", "For", "example", ":" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/project.py#L1262-L1276
train
Calculates conditional requirements for multiple requirements at once.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/models/array_feature_extractor.py
create_array_feature_extractor
def create_array_feature_extractor(input_features, output_name, extract_indices, output_type = None): """ Creates a feature extractor from an input array feature, return input_features is a list of one (name, array) tuple. extract_indices is either an integer or a li...
python
def create_array_feature_extractor(input_features, output_name, extract_indices, output_type = None): """ Creates a feature extractor from an input array feature, return input_features is a list of one (name, array) tuple. extract_indices is either an integer or a li...
[ "def", "create_array_feature_extractor", "(", "input_features", ",", "output_name", ",", "extract_indices", ",", "output_type", "=", "None", ")", ":", "# Make sure that our starting stuff is in the proper form.", "assert", "len", "(", "input_features", ")", "==", "1", "as...
Creates a feature extractor from an input array feature, return input_features is a list of one (name, array) tuple. extract_indices is either an integer or a list. If it's an integer, the output type is by default a double (but may also be an integer). If a list, the output type is an array.
[ "Creates", "a", "feature", "extractor", "from", "an", "input", "array", "feature", "return" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/array_feature_extractor.py#L16-L59
train
Creates a feature extractor from an input array feature return the resulting _Model_pb2. Model object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/libs/predef/tools/ci/build_log.py
BuildOutputProcessor.add_input
def add_input(self, input): ''' Add a single build XML output file to our data. ''' events = xml.dom.pulldom.parse(input) context = [] for (event,node) in events: if event == xml.dom.pulldom.START_ELEMENT: context.append(node) i...
python
def add_input(self, input): ''' Add a single build XML output file to our data. ''' events = xml.dom.pulldom.parse(input) context = [] for (event,node) in events: if event == xml.dom.pulldom.START_ELEMENT: context.append(node) i...
[ "def", "add_input", "(", "self", ",", "input", ")", ":", "events", "=", "xml", ".", "dom", ".", "pulldom", ".", "parse", "(", "input", ")", "context", "=", "[", "]", "for", "(", "event", ",", "node", ")", "in", "events", ":", "if", "event", "==",...
Add a single build XML output file to our data.
[ "Add", "a", "single", "build", "XML", "output", "file", "to", "our", "data", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/predef/tools/ci/build_log.py#L85-L103
train
Add a single build XML output file to our data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/libs/predef/tools/ci/build_log.py
BuildOutputProcessor.x_build_targets_target
def x_build_targets_target( self, node ): ''' Process the target dependency DAG into an ancestry tree so we can look up which top-level library and test targets specific build actions correspond to. ''' target_node = node name = self.get_child_data(target_node,tag='name',...
python
def x_build_targets_target( self, node ): ''' Process the target dependency DAG into an ancestry tree so we can look up which top-level library and test targets specific build actions correspond to. ''' target_node = node name = self.get_child_data(target_node,tag='name',...
[ "def", "x_build_targets_target", "(", "self", ",", "node", ")", ":", "target_node", "=", "node", "name", "=", "self", ".", "get_child_data", "(", "target_node", ",", "tag", "=", "'name'", ",", "strip", "=", "True", ")", "path", "=", "self", ".", "get_chi...
Process the target dependency DAG into an ancestry tree so we can look up which top-level library and test targets specific build actions correspond to.
[ "Process", "the", "target", "dependency", "DAG", "into", "an", "ancestry", "tree", "so", "we", "can", "look", "up", "which", "top", "-", "level", "library", "and", "test", "targets", "specific", "build", "actions", "correspond", "to", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/predef/tools/ci/build_log.py#L146-L167
train
Process the target dependency DAG into an ancestry tree so we can look up what top - level libraries and test targets specific build actions correspond to.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/libs/predef/tools/ci/build_log.py
BuildOutputProcessor.x_build_action
def x_build_action( self, node ): ''' Given a build action log, process into the corresponding test log and specific test log sub-part. ''' action_node = node name = self.get_child(action_node,tag='name') if name: name = self.get_data(name) ...
python
def x_build_action( self, node ): ''' Given a build action log, process into the corresponding test log and specific test log sub-part. ''' action_node = node name = self.get_child(action_node,tag='name') if name: name = self.get_data(name) ...
[ "def", "x_build_action", "(", "self", ",", "node", ")", ":", "action_node", "=", "node", "name", "=", "self", ".", "get_child", "(", "action_node", ",", "tag", "=", "'name'", ")", "if", "name", ":", "name", "=", "self", ".", "get_data", "(", "name", ...
Given a build action log, process into the corresponding test log and specific test log sub-part.
[ "Given", "a", "build", "action", "log", "process", "into", "the", "corresponding", "test", "log", "and", "specific", "test", "log", "sub", "-", "part", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/predef/tools/ci/build_log.py#L169-L233
train
Process into the corresponding test log and related test log sub - part.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/libs/predef/tools/ci/build_log.py
BuildOutputProcessor.x_build_timestamp
def x_build_timestamp( self, node ): ''' The time-stamp goes to the corresponding attribute in the result. ''' self.timestamps.append(self.get_data(node).strip()) return None
python
def x_build_timestamp( self, node ): ''' The time-stamp goes to the corresponding attribute in the result. ''' self.timestamps.append(self.get_data(node).strip()) return None
[ "def", "x_build_timestamp", "(", "self", ",", "node", ")", ":", "self", ".", "timestamps", ".", "append", "(", "self", ".", "get_data", "(", "node", ")", ".", "strip", "(", ")", ")", "return", "None" ]
The time-stamp goes to the corresponding attribute in the result.
[ "The", "time", "-", "stamp", "goes", "to", "the", "corresponding", "attribute", "in", "the", "result", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/predef/tools/ci/build_log.py#L235-L240
train
Build the time - stamp for the given node.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/libs/predef/tools/ci/build_log.py
BuildConsoleSummaryReport.print_action
def print_action(self, test_succeed, action): ''' Print the detailed info of failed or always print tests. ''' #self.info_print(">>> {0}",action.keys()) if not test_succeed or action['info']['always_show_run_output']: output = action['output'].strip() if o...
python
def print_action(self, test_succeed, action): ''' Print the detailed info of failed or always print tests. ''' #self.info_print(">>> {0}",action.keys()) if not test_succeed or action['info']['always_show_run_output']: output = action['output'].strip() if o...
[ "def", "print_action", "(", "self", ",", "test_succeed", ",", "action", ")", ":", "#self.info_print(\">>> {0}\",action.keys())", "if", "not", "test_succeed", "or", "action", "[", "'info'", "]", "[", "'always_show_run_output'", "]", ":", "output", "=", "action", "[...
Print the detailed info of failed or always print tests.
[ "Print", "the", "detailed", "info", "of", "failed", "or", "always", "print", "tests", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/libs/predef/tools/ci/build_log.py#L363-L378
train
Print the detailed info of failed or always print tests.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/printer.py
_get_weight_param_summary
def _get_weight_param_summary(wp): """Get a summary of _NeuralNetwork_pb2.WeightParams Args: wp : _NeuralNetwork_pb2.WeightParams - the _NeuralNetwork_pb2.WeightParams message to display Returns: a str summary for wp """ summary_str = '' if wp.HasField('quantization'): nbits = wp...
python
def _get_weight_param_summary(wp): """Get a summary of _NeuralNetwork_pb2.WeightParams Args: wp : _NeuralNetwork_pb2.WeightParams - the _NeuralNetwork_pb2.WeightParams message to display Returns: a str summary for wp """ summary_str = '' if wp.HasField('quantization'): nbits = wp...
[ "def", "_get_weight_param_summary", "(", "wp", ")", ":", "summary_str", "=", "''", "if", "wp", ".", "HasField", "(", "'quantization'", ")", ":", "nbits", "=", "wp", ".", "quantization", ".", "numberOfBits", "quant_type", "=", "'linearly'", "if", "wp", ".", ...
Get a summary of _NeuralNetwork_pb2.WeightParams Args: wp : _NeuralNetwork_pb2.WeightParams - the _NeuralNetwork_pb2.WeightParams message to display Returns: a str summary for wp
[ "Get", "a", "summary", "of", "_NeuralNetwork_pb2", ".", "WeightParams", "Args", ":", "wp", ":", "_NeuralNetwork_pb2", ".", "WeightParams", "-", "the", "_NeuralNetwork_pb2", ".", "WeightParams", "message", "to", "display", "Returns", ":", "a", "str", "summary", "...
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/printer.py#L8-L28
train
Get a summary of _NeuralNetwork_pb2. WeightParams
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/printer.py
_summarize_network_layer_info
def _summarize_network_layer_info(layer): """ Args: layer - an MLModel NeuralNetwork Layer protobuf message Returns: layer_type : str - type of layer layer_name : str - name of the layer layer_inputs : list[str] - a list of strings representing input blobs of the layer layer_outputs : li...
python
def _summarize_network_layer_info(layer): """ Args: layer - an MLModel NeuralNetwork Layer protobuf message Returns: layer_type : str - type of layer layer_name : str - name of the layer layer_inputs : list[str] - a list of strings representing input blobs of the layer layer_outputs : li...
[ "def", "_summarize_network_layer_info", "(", "layer", ")", ":", "layer_type_str", "=", "layer", ".", "WhichOneof", "(", "'layer'", ")", "layer_name", "=", "layer", ".", "name", "layer_inputs", "=", "list", "(", "layer", ".", "input", ")", "layer_outputs", "=",...
Args: layer - an MLModel NeuralNetwork Layer protobuf message Returns: layer_type : str - type of layer layer_name : str - name of the layer layer_inputs : list[str] - a list of strings representing input blobs of the layer layer_outputs : list[str] - a list of strings representing output blobs ...
[ "Args", ":", "layer", "-", "an", "MLModel", "NeuralNetwork", "Layer", "protobuf", "message", "Returns", ":", "layer_type", ":", "str", "-", "type", "of", "layer", "layer_name", ":", "str", "-", "name", "of", "the", "layer", "layer_inputs", ":", "list", "["...
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/printer.py#L67-L102
train
Returns a summary of the network layer info.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/printer.py
summarize_neural_network_spec
def summarize_neural_network_spec(mlmodel_spec): """ Summarize network into the following structure. Args: mlmodel_spec : mlmodel spec Returns: inputs : list[(str, str)] - a list of two tuple (name, descriptor) for each input blob. outputs : list[(str, str)] - a list of two tuple (name, descript...
python
def summarize_neural_network_spec(mlmodel_spec): """ Summarize network into the following structure. Args: mlmodel_spec : mlmodel spec Returns: inputs : list[(str, str)] - a list of two tuple (name, descriptor) for each input blob. outputs : list[(str, str)] - a list of two tuple (name, descript...
[ "def", "summarize_neural_network_spec", "(", "mlmodel_spec", ")", ":", "inputs", "=", "[", "(", "blob", ".", "name", ",", "_get_feature_description_summary", "(", "blob", ")", ")", "for", "blob", "in", "mlmodel_spec", ".", "description", ".", "input", "]", "ou...
Summarize network into the following structure. Args: mlmodel_spec : mlmodel spec Returns: inputs : list[(str, str)] - a list of two tuple (name, descriptor) for each input blob. outputs : list[(str, str)] - a list of two tuple (name, descriptor) for each output blob layers : list[(str, list[str...
[ "Summarize", "network", "into", "the", "following", "structure", ".", "Args", ":", "mlmodel_spec", ":", "mlmodel", "spec", "Returns", ":", "inputs", ":", "list", "[", "(", "str", "str", ")", "]", "-", "a", "list", "of", "two", "tuple", "(", "name", "de...
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/printer.py#L105-L127
train
Summarize the network into the following structure.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/printer.py
print_network_spec
def print_network_spec(mlmodel_spec, interface_only=False): """ Print the network information summary. Args: mlmodel_spec : the mlmodel spec interface_only : Shows only the input and output of the network """ inputs, outputs, layers_info = summarize_neural_network_spec(mlmodel_spec) print('...
python
def print_network_spec(mlmodel_spec, interface_only=False): """ Print the network information summary. Args: mlmodel_spec : the mlmodel spec interface_only : Shows only the input and output of the network """ inputs, outputs, layers_info = summarize_neural_network_spec(mlmodel_spec) print('...
[ "def", "print_network_spec", "(", "mlmodel_spec", ",", "interface_only", "=", "False", ")", ":", "inputs", ",", "outputs", ",", "layers_info", "=", "summarize_neural_network_spec", "(", "mlmodel_spec", ")", "print", "(", "'Inputs:'", ")", "for", "i", "in", "inpu...
Print the network information summary. Args: mlmodel_spec : the mlmodel spec interface_only : Shows only the input and output of the network
[ "Print", "the", "network", "information", "summary", ".", "Args", ":", "mlmodel_spec", ":", "the", "mlmodel", "spec", "interface_only", ":", "Shows", "only", "the", "input", "and", "output", "of", "the", "network" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/printer.py#L130-L163
train
Prints the network information summary.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_SVC.py
_generate_base_svm_classifier_spec
def _generate_base_svm_classifier_spec(model): """ Takes an SVM classifier produces a starting spec using the parts. that are shared between all SVMs. """ if not(_HAS_SKLEARN): raise RuntimeError('scikit-learn not found. scikit-learn conversion API is disabled.') check_fitted(model, la...
python
def _generate_base_svm_classifier_spec(model): """ Takes an SVM classifier produces a starting spec using the parts. that are shared between all SVMs. """ if not(_HAS_SKLEARN): raise RuntimeError('scikit-learn not found. scikit-learn conversion API is disabled.') check_fitted(model, la...
[ "def", "_generate_base_svm_classifier_spec", "(", "model", ")", ":", "if", "not", "(", "_HAS_SKLEARN", ")", ":", "raise", "RuntimeError", "(", "'scikit-learn not found. scikit-learn conversion API is disabled.'", ")", "check_fitted", "(", "model", ",", "lambda", "m", ":...
Takes an SVM classifier produces a starting spec using the parts. that are shared between all SVMs.
[ "Takes", "an", "SVM", "classifier", "produces", "a", "starting", "spec", "using", "the", "parts", ".", "that", "are", "shared", "between", "all", "SVMs", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_SVC.py#L24-L56
train
Generates a starting spec using the parts of the SVM classifier.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_SVC.py
convert
def convert(model, feature_names, target): """Convert a Support Vector Classtion (SVC) model to the protobuf spec. Parameters ---------- model: SVC A trained SVC encoder model. feature_names: [str], optional (default=None) Name of the input columns. target: str, optional (defau...
python
def convert(model, feature_names, target): """Convert a Support Vector Classtion (SVC) model to the protobuf spec. Parameters ---------- model: SVC A trained SVC encoder model. feature_names: [str], optional (default=None) Name of the input columns. target: str, optional (defau...
[ "def", "convert", "(", "model", ",", "feature_names", ",", "target", ")", ":", "if", "not", "(", "_HAS_SKLEARN", ")", ":", "raise", "RuntimeError", "(", "'scikit-learn not found. scikit-learn conversion API is disabled.'", ")", "spec", "=", "_generate_base_svm_classifie...
Convert a Support Vector Classtion (SVC) model to the protobuf spec. Parameters ---------- model: SVC A trained SVC encoder model. feature_names: [str], optional (default=None) Name of the input columns. target: str, optional (default=None) Name of the output column. R...
[ "Convert", "a", "Support", "Vector", "Classtion", "(", "SVC", ")", "model", "to", "the", "protobuf", "spec", ".", "Parameters", "----------", "model", ":", "SVC", "A", "trained", "SVC", "encoder", "model", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_SVC.py#L58-L97
train
Convert a SVC encoder model to a protobuf spec.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_topology.py
NetGraph.make_input_layers
def make_input_layers(self): """ Extract the ordering of the input layers. """ self.input_layers = [] if hasattr(self.model, 'input_layers'): input_keras_layers = self.model.input_layers[:] self.input_layers = [None] * len(input_keras_layers) f...
python
def make_input_layers(self): """ Extract the ordering of the input layers. """ self.input_layers = [] if hasattr(self.model, 'input_layers'): input_keras_layers = self.model.input_layers[:] self.input_layers = [None] * len(input_keras_layers) f...
[ "def", "make_input_layers", "(", "self", ")", ":", "self", ".", "input_layers", "=", "[", "]", "if", "hasattr", "(", "self", ".", "model", ",", "'input_layers'", ")", ":", "input_keras_layers", "=", "self", ".", "model", ".", "input_layers", "[", ":", "]...
Extract the ordering of the input layers.
[ "Extract", "the", "ordering", "of", "the", "input", "layers", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_topology.py#L107-L129
train
Extract the ordering of the input layers.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_topology.py
NetGraph.make_output_layers
def make_output_layers(self): """ Extract the ordering of output layers. """ # TODO # use successors == 0 as the criteria for output layer # will fail when some intermediate layers also generate output. # However, because the possibility of having inserted layers,...
python
def make_output_layers(self): """ Extract the ordering of output layers. """ # TODO # use successors == 0 as the criteria for output layer # will fail when some intermediate layers also generate output. # However, because the possibility of having inserted layers,...
[ "def", "make_output_layers", "(", "self", ")", ":", "# TODO", "# use successors == 0 as the criteria for output layer", "# will fail when some intermediate layers also generate output.", "# However, because the possibility of having inserted layers,", "# it's more difficult to tell which layer i...
Extract the ordering of output layers.
[ "Extract", "the", "ordering", "of", "output", "layers", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_topology.py#L131-L144
train
Extract the ordering of output layers.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_topology.py
NetGraph.generate_blob_names
def generate_blob_names(self): """ Generate blob names for each one of the edge. At this time, Keras does not support "fork" operation (a layer with more than 1 blob output). So we just use names of the src layer to identify a blob. We also assume all neural networks are singly...
python
def generate_blob_names(self): """ Generate blob names for each one of the edge. At this time, Keras does not support "fork" operation (a layer with more than 1 blob output). So we just use names of the src layer to identify a blob. We also assume all neural networks are singly...
[ "def", "generate_blob_names", "(", "self", ")", ":", "# generate blob names that represent edges in blob_name_map", "# because of the InputLayers, input blobs are also generated.", "# Generate each layer's input / output blob names", "for", "layer", "in", "self", ".", "layer_list", ":"...
Generate blob names for each one of the edge. At this time, Keras does not support "fork" operation (a layer with more than 1 blob output). So we just use names of the src layer to identify a blob. We also assume all neural networks are singly-connected graphs - which should be the case.
[ "Generate", "blob", "names", "for", "each", "one", "of", "the", "edge", ".", "At", "this", "time", "Keras", "does", "not", "support", "fork", "operation", "(", "a", "layer", "with", "more", "than", "1", "blob", "output", ")", ".", "So", "we", "just", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_topology.py#L152-L174
train
Generate blob names for each edge in the neural network.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_topology.py
NetGraph._remove_layer
def _remove_layer(self, layer): """ remove the layer and its input/output edges """ successors = self.get_successors(layer) predecessors = self.get_predecessors(layer) # remove all edges for succ in successors: self._remove_edge(layer, succ) fo...
python
def _remove_layer(self, layer): """ remove the layer and its input/output edges """ successors = self.get_successors(layer) predecessors = self.get_predecessors(layer) # remove all edges for succ in successors: self._remove_edge(layer, succ) fo...
[ "def", "_remove_layer", "(", "self", ",", "layer", ")", ":", "successors", "=", "self", ".", "get_successors", "(", "layer", ")", "predecessors", "=", "self", ".", "get_predecessors", "(", "layer", ")", "# remove all edges", "for", "succ", "in", "successors", ...
remove the layer and its input/output edges
[ "remove", "the", "layer", "and", "its", "input", "/", "output", "edges" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_topology.py#L295-L308
train
Remove the layer and its input and output edges.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_topology.py
NetGraph._insert_layer_after
def _insert_layer_after(self, layer_idx, new_layer, new_keras_layer): """ Insert the new_layer after layer, whose position is layer_idx. The new layer's parameter is stored in a Keras layer called new_keras_layer """ # reminder: new_keras_layer is not part of the original Keras n...
python
def _insert_layer_after(self, layer_idx, new_layer, new_keras_layer): """ Insert the new_layer after layer, whose position is layer_idx. The new layer's parameter is stored in a Keras layer called new_keras_layer """ # reminder: new_keras_layer is not part of the original Keras n...
[ "def", "_insert_layer_after", "(", "self", ",", "layer_idx", ",", "new_layer", ",", "new_keras_layer", ")", ":", "# reminder: new_keras_layer is not part of the original Keras network,", "# so it's input / output blob information is missing. It serves only as", "# a parameter holder.", ...
Insert the new_layer after layer, whose position is layer_idx. The new layer's parameter is stored in a Keras layer called new_keras_layer
[ "Insert", "the", "new_layer", "after", "layer", "whose", "position", "is", "layer_idx", ".", "The", "new", "layer", "s", "parameter", "is", "stored", "in", "a", "Keras", "layer", "called", "new_keras_layer" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_topology.py#L361-L378
train
Insert the new_layer after layer_idx.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_topology.py
NetGraph._insert_layer_between
def _insert_layer_between(self, src, snk, new_layer, new_keras_layer): """ Insert the new_layer before layer, whose position is layer_idx. The new layer's parameter is stored in a Keras layer called new_keras_layer """ if snk is None: insert_pos = self.layer_list.inde...
python
def _insert_layer_between(self, src, snk, new_layer, new_keras_layer): """ Insert the new_layer before layer, whose position is layer_idx. The new layer's parameter is stored in a Keras layer called new_keras_layer """ if snk is None: insert_pos = self.layer_list.inde...
[ "def", "_insert_layer_between", "(", "self", ",", "src", ",", "snk", ",", "new_layer", ",", "new_keras_layer", ")", ":", "if", "snk", "is", "None", ":", "insert_pos", "=", "self", ".", "layer_list", ".", "index", "(", "src", ")", "+", "1", "else", ":",...
Insert the new_layer before layer, whose position is layer_idx. The new layer's parameter is stored in a Keras layer called new_keras_layer
[ "Insert", "the", "new_layer", "before", "layer", "whose", "position", "is", "layer_idx", ".", "The", "new", "layer", "s", "parameter", "is", "stored", "in", "a", "Keras", "layer", "called", "new_keras_layer" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_topology.py#L380-L398
train
Insert the new_layer before layer between src and snk.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_topology.py
NetGraph.defuse_activation
def defuse_activation(self): """ Defuse the fused activation layers in the network. """ idx, nb_layers = 0, len(self.layer_list) while idx < nb_layers: layer = self.layer_list[idx] k_layer = self.keras_layer_map[layer] # unwrap time-distributed...
python
def defuse_activation(self): """ Defuse the fused activation layers in the network. """ idx, nb_layers = 0, len(self.layer_list) while idx < nb_layers: layer = self.layer_list[idx] k_layer = self.keras_layer_map[layer] # unwrap time-distributed...
[ "def", "defuse_activation", "(", "self", ")", ":", "idx", ",", "nb_layers", "=", "0", ",", "len", "(", "self", ".", "layer_list", ")", "while", "idx", "<", "nb_layers", ":", "layer", "=", "self", ".", "layer_list", "[", "idx", "]", "k_layer", "=", "s...
Defuse the fused activation layers in the network.
[ "Defuse", "the", "fused", "activation", "layers", "in", "the", "network", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_topology.py#L400-L430
train
Defuse the fused activation layers in the network.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_topology.py
NetGraph._get_1d_interface_edges
def _get_1d_interface_edges(self): """ Get edges that represents transition from not 1D to 1D, and 1D to not 1D A 'in_edge e(u,v)' means u operates on non-1D blobs, but v operates on 1D blobs. An 'out_edge e(u,v)' means u operates on 1D blobs, but v operates on non-1D blobs. """ ...
python
def _get_1d_interface_edges(self): """ Get edges that represents transition from not 1D to 1D, and 1D to not 1D A 'in_edge e(u,v)' means u operates on non-1D blobs, but v operates on 1D blobs. An 'out_edge e(u,v)' means u operates on 1D blobs, but v operates on non-1D blobs. """ ...
[ "def", "_get_1d_interface_edges", "(", "self", ")", ":", "in_edges", "=", "[", "]", "for", "layer", "in", "self", ".", "layer_list", ":", "if", "not", "self", ".", "is_1d_layer", "(", "layer", ")", ":", "continue", "preds", "=", "self", ".", "get_predece...
Get edges that represents transition from not 1D to 1D, and 1D to not 1D A 'in_edge e(u,v)' means u operates on non-1D blobs, but v operates on 1D blobs. An 'out_edge e(u,v)' means u operates on 1D blobs, but v operates on non-1D blobs.
[ "Get", "edges", "that", "represents", "transition", "from", "not", "1D", "to", "1D", "and", "1D", "to", "not", "1D", "A", "in_edge", "e", "(", "u", "v", ")", "means", "u", "operates", "on", "non", "-", "1D", "blobs", "but", "v", "operates", "on", "...
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_topology.py#L446-L490
train
Get edges that represents transition from 1D to 1D.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_topology.py
NetGraph.insert_1d_permute_layers
def insert_1d_permute_layers(self): """ Insert permutation layers before a 1D start point or after 1D end point """ idx, nb_layers = 0, len(self.layer_list) in_edges, out_edges = self._get_1d_interface_edges() # Hacky Warning: (1) use a 4-D permute, which is not likely t...
python
def insert_1d_permute_layers(self): """ Insert permutation layers before a 1D start point or after 1D end point """ idx, nb_layers = 0, len(self.layer_list) in_edges, out_edges = self._get_1d_interface_edges() # Hacky Warning: (1) use a 4-D permute, which is not likely t...
[ "def", "insert_1d_permute_layers", "(", "self", ")", ":", "idx", ",", "nb_layers", "=", "0", ",", "len", "(", "self", ".", "layer_list", ")", "in_edges", ",", "out_edges", "=", "self", ".", "_get_1d_interface_edges", "(", ")", "# Hacky Warning: (1) use a 4-D per...
Insert permutation layers before a 1D start point or after 1D end point
[ "Insert", "permutation", "layers", "before", "a", "1D", "start", "point", "or", "after", "1D", "end", "point" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_topology.py#L492-L518
train
Insert permutation layers before a 1D start point or after a 1D end point.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/meta/asttools/mutators/replace_mutator.py
replace_nodes
def replace_nodes(root, old, new): ''' Replace the old node with the new one. Old must be an indirect child of root :param root: ast node that contains an indirect reference to old :param old: node to replace :param new: node to replace `old` with ''' rep = Replacer(old, new) ...
python
def replace_nodes(root, old, new): ''' Replace the old node with the new one. Old must be an indirect child of root :param root: ast node that contains an indirect reference to old :param old: node to replace :param new: node to replace `old` with ''' rep = Replacer(old, new) ...
[ "def", "replace_nodes", "(", "root", ",", "old", ",", "new", ")", ":", "rep", "=", "Replacer", "(", "old", ",", "new", ")", "rep", ".", "visit", "(", "root", ")", "return" ]
Replace the old node with the new one. Old must be an indirect child of root :param root: ast node that contains an indirect reference to old :param old: node to replace :param new: node to replace `old` with
[ "Replace", "the", "old", "node", "with", "the", "new", "one", ".", "Old", "must", "be", "an", "indirect", "child", "of", "root", ":", "param", "root", ":", "ast", "node", "that", "contains", "an", "indirect", "reference", "to", "old", ":", "param", "ol...
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/meta/asttools/mutators/replace_mutator.py#L49-L62
train
Replace the old node with the new one.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/configure.py
log_component_configuration
def log_component_configuration(component, message): """Report something about component configuration that the user should better know.""" assert isinstance(component, basestring) assert isinstance(message, basestring) __component_logs.setdefault(component, []).append(message)
python
def log_component_configuration(component, message): """Report something about component configuration that the user should better know.""" assert isinstance(component, basestring) assert isinstance(message, basestring) __component_logs.setdefault(component, []).append(message)
[ "def", "log_component_configuration", "(", "component", ",", "message", ")", ":", "assert", "isinstance", "(", "component", ",", "basestring", ")", "assert", "isinstance", "(", "message", ",", "basestring", ")", "__component_logs", ".", "setdefault", "(", "compone...
Report something about component configuration that the user should better know.
[ "Report", "something", "about", "component", "configuration", "that", "the", "user", "should", "better", "know", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/configure.py#L52-L56
train
Report something about component configuration that the user should better know.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/_feature_engineering/__init__.py
create
def create(dataset, transformers): """ Create a Transformer object to transform data for feature engineering. Parameters ---------- dataset : SFrame The dataset to use for training the model. transformers: Transformer | list[Transformer] An Transformer or a list of Transformer...
python
def create(dataset, transformers): """ Create a Transformer object to transform data for feature engineering. Parameters ---------- dataset : SFrame The dataset to use for training the model. transformers: Transformer | list[Transformer] An Transformer or a list of Transformer...
[ "def", "create", "(", "dataset", ",", "transformers", ")", ":", "err_msg", "=", "\"The parameters 'transformers' must be a valid Transformer object.\"", "cls", "=", "transformers", ".", "__class__", "_raise_error_if_not_sframe", "(", "dataset", ",", "\"dataset\"", ")", "#...
Create a Transformer object to transform data for feature engineering. Parameters ---------- dataset : SFrame The dataset to use for training the model. transformers: Transformer | list[Transformer] An Transformer or a list of Transformers. See Also -------- turicreate.to...
[ "Create", "a", "Transformer", "object", "to", "transform", "data", "for", "feature", "engineering", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_feature_engineering/__init__.py#L47-L106
train
Create a Transformer object to transform data for training the model.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/sound_classifier/_audio_feature_extractor.py
VGGishFeatureExtractor._preprocess_data
def _preprocess_data(audio_data, verbose=True): ''' Preprocess each example, breaking it up into frames. Returns two numpy arrays: preprocessed frame and their indexes ''' from .vggish_input import waveform_to_examples last_progress_update = _time.time() progres...
python
def _preprocess_data(audio_data, verbose=True): ''' Preprocess each example, breaking it up into frames. Returns two numpy arrays: preprocessed frame and their indexes ''' from .vggish_input import waveform_to_examples last_progress_update = _time.time() progres...
[ "def", "_preprocess_data", "(", "audio_data", ",", "verbose", "=", "True", ")", ":", "from", ".", "vggish_input", "import", "waveform_to_examples", "last_progress_update", "=", "_time", ".", "time", "(", ")", "progress_header_printed", "=", "False", "# Can't run as ...
Preprocess each example, breaking it up into frames. Returns two numpy arrays: preprocessed frame and their indexes
[ "Preprocess", "each", "example", "breaking", "it", "up", "into", "frames", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/sound_classifier/_audio_feature_extractor.py#L40-L72
train
Preprocess each example breaking it up into frames. Returns two numpy arrays the preprocessed frame and their indexes.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/sound_classifier/_audio_feature_extractor.py
VGGishFeatureExtractor._extract_features
def _extract_features(self, preprocessed_data, verbose=True): """ Parameters ---------- preprocessed_data : SArray Returns ------- numpy array containing the deep features """ last_progress_update = _time.time() progress_header_printed = F...
python
def _extract_features(self, preprocessed_data, verbose=True): """ Parameters ---------- preprocessed_data : SArray Returns ------- numpy array containing the deep features """ last_progress_update = _time.time() progress_header_printed = F...
[ "def", "_extract_features", "(", "self", ",", "preprocessed_data", ",", "verbose", "=", "True", ")", ":", "last_progress_update", "=", "_time", ".", "time", "(", ")", "progress_header_printed", "=", "False", "deep_features", "=", "_tc", ".", "SArrayBuilder", "("...
Parameters ---------- preprocessed_data : SArray Returns ------- numpy array containing the deep features
[ "Parameters", "----------", "preprocessed_data", ":", "SArray" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/sound_classifier/_audio_feature_extractor.py#L112-L170
train
Extract deep features from preprocessed data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/sound_classifier/_audio_feature_extractor.py
VGGishFeatureExtractor.get_deep_features
def get_deep_features(self, audio_data, verbose): ''' Performs both audio preprocessing and VGGish deep feature extraction. ''' preprocessed_data, row_ids = self._preprocess_data(audio_data, verbose) deep_features = self._extract_features(preprocessed_data, verbose) outp...
python
def get_deep_features(self, audio_data, verbose): ''' Performs both audio preprocessing and VGGish deep feature extraction. ''' preprocessed_data, row_ids = self._preprocess_data(audio_data, verbose) deep_features = self._extract_features(preprocessed_data, verbose) outp...
[ "def", "get_deep_features", "(", "self", ",", "audio_data", ",", "verbose", ")", ":", "preprocessed_data", ",", "row_ids", "=", "self", ".", "_preprocess_data", "(", "audio_data", ",", "verbose", ")", "deep_features", "=", "self", ".", "_extract_features", "(", ...
Performs both audio preprocessing and VGGish deep feature extraction.
[ "Performs", "both", "audio", "preprocessing", "and", "VGGish", "deep", "feature", "extraction", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/sound_classifier/_audio_feature_extractor.py#L172-L190
train
Performs both audio preprocessing and VGGish deep feature extraction.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/sound_classifier/_audio_feature_extractor.py
VGGishFeatureExtractor.get_spec
def get_spec(self): """ Return the Core ML spec """ if _mac_ver() >= (10, 14): return self.vggish_model.get_spec() else: vggish_model_file = VGGish() coreml_model_path = vggish_model_file.get_model_path(format='coreml') return MLMod...
python
def get_spec(self): """ Return the Core ML spec """ if _mac_ver() >= (10, 14): return self.vggish_model.get_spec() else: vggish_model_file = VGGish() coreml_model_path = vggish_model_file.get_model_path(format='coreml') return MLMod...
[ "def", "get_spec", "(", "self", ")", ":", "if", "_mac_ver", "(", ")", ">=", "(", "10", ",", "14", ")", ":", "return", "self", ".", "vggish_model", ".", "get_spec", "(", ")", "else", ":", "vggish_model_file", "=", "VGGish", "(", ")", "coreml_model_path"...
Return the Core ML spec
[ "Return", "the", "Core", "ML", "spec" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/sound_classifier/_audio_feature_extractor.py#L192-L201
train
Return the Core ML spec
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/meta/asttools/mutators/remove_trivial.py
remove_trivial
def remove_trivial(root): ''' Remove redundant statements. The statement `a = 1` will be removed:: a = 1 a = 2 The statement `a = 1` will not be removed because `b` depends on it:: a = 1 b = a + 2 a = 2 :param root: ast node ...
python
def remove_trivial(root): ''' Remove redundant statements. The statement `a = 1` will be removed:: a = 1 a = 2 The statement `a = 1` will not be removed because `b` depends on it:: a = 1 b = a + 2 a = 2 :param root: ast node ...
[ "def", "remove_trivial", "(", "root", ")", ":", "gen", "=", "GatherAssignments", "(", ")", "gen", ".", "visit", "(", "root", ")", "to_remove", "=", "[", "]", "for", "symbol", ",", "assignments", "in", "gen", ".", "assign_id_map", ".", "items", "(", ")"...
Remove redundant statements. The statement `a = 1` will be removed:: a = 1 a = 2 The statement `a = 1` will not be removed because `b` depends on it:: a = 1 b = a + 2 a = 2 :param root: ast node
[ "Remove", "redundant", "statements", ".", "The", "statement", "a", "=", "1", "will", "be", "removed", "::", "a", "=", "1", "a", "=", "2" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/meta/asttools/mutators/remove_trivial.py#L78-L120
train
Remove redundant statements.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/util/__init__.py
safe_isinstance
def safe_isinstance(value, types=None, class_names=None): """To prevent circular imports, this extends isinstance() by checking also if `value` has a particular class name (or inherits from a particular class name). This check is safe in that an AttributeError is not raised in case `value` doesn't have ...
python
def safe_isinstance(value, types=None, class_names=None): """To prevent circular imports, this extends isinstance() by checking also if `value` has a particular class name (or inherits from a particular class name). This check is safe in that an AttributeError is not raised in case `value` doesn't have ...
[ "def", "safe_isinstance", "(", "value", ",", "types", "=", "None", ",", "class_names", "=", "None", ")", ":", "# inspect is being imported here because I seriously doubt", "# that this function will be used outside of the type", "# checking below.", "import", "inspect", "result...
To prevent circular imports, this extends isinstance() by checking also if `value` has a particular class name (or inherits from a particular class name). This check is safe in that an AttributeError is not raised in case `value` doesn't have a __class__ attribute.
[ "To", "prevent", "circular", "imports", "this", "extends", "isinstance", "()", "by", "checking", "also", "if", "value", "has", "a", "particular", "class", "name", "(", "or", "inherits", "from", "a", "particular", "class", "name", ")", ".", "This", "check", ...
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/util/__init__.py#L9-L36
train
This function checks if the given value is an instance of the given types or class_names.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/util/__init__.py
value_to_jam
def value_to_jam(value, methods=False): """Makes a token to refer to a Python value inside Jam language code. The token is merely a string that can be passed around in Jam code and eventually passed back. For example, we might want to pass PropertySet instance to a tag function and it might eventually ...
python
def value_to_jam(value, methods=False): """Makes a token to refer to a Python value inside Jam language code. The token is merely a string that can be passed around in Jam code and eventually passed back. For example, we might want to pass PropertySet instance to a tag function and it might eventually ...
[ "def", "value_to_jam", "(", "value", ",", "methods", "=", "False", ")", ":", "global", "__value_id", "r", "=", "__python_to_jam", ".", "get", "(", "value", ",", "None", ")", "if", "r", ":", "return", "r", "exported_name", "=", "'###_'", "+", "str", "("...
Makes a token to refer to a Python value inside Jam language code. The token is merely a string that can be passed around in Jam code and eventually passed back. For example, we might want to pass PropertySet instance to a tag function and it might eventually call back to virtual_target.add_suffix_and_...
[ "Makes", "a", "token", "to", "refer", "to", "a", "Python", "value", "inside", "Jam", "language", "code", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/util/__init__.py#L228-L261
train
Makes a token to refer to a Python value inside Jam language code.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/util/__init__.py
abbreviate_dashed
def abbreviate_dashed(s): """Abbreviates each part of string that is delimited by a '-'.""" r = [] for part in s.split('-'): r.append(abbreviate(part)) return '-'.join(r)
python
def abbreviate_dashed(s): """Abbreviates each part of string that is delimited by a '-'.""" r = [] for part in s.split('-'): r.append(abbreviate(part)) return '-'.join(r)
[ "def", "abbreviate_dashed", "(", "s", ")", ":", "r", "=", "[", "]", "for", "part", "in", "s", ".", "split", "(", "'-'", ")", ":", "r", ".", "append", "(", "abbreviate", "(", "part", ")", ")", "return", "'-'", ".", "join", "(", "r", ")" ]
Abbreviates each part of string that is delimited by a '-'.
[ "Abbreviates", "each", "part", "of", "string", "that", "is", "delimited", "by", "a", "-", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/util/__init__.py#L281-L286
train
Abbreviates each part of string that is delimited by a -.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/util/__init__.py
abbreviate
def abbreviate(s): """Apply a set of standard transformations to string to produce an abbreviation no more than 4 characters long. """ if not s: return '' # check the cache if s in abbreviate.abbreviations: return abbreviate.abbreviations[s] # anything less than 4 characters ...
python
def abbreviate(s): """Apply a set of standard transformations to string to produce an abbreviation no more than 4 characters long. """ if not s: return '' # check the cache if s in abbreviate.abbreviations: return abbreviate.abbreviations[s] # anything less than 4 characters ...
[ "def", "abbreviate", "(", "s", ")", ":", "if", "not", "s", ":", "return", "''", "# check the cache", "if", "s", "in", "abbreviate", ".", "abbreviations", ":", "return", "abbreviate", ".", "abbreviations", "[", "s", "]", "# anything less than 4 characters doesn't...
Apply a set of standard transformations to string to produce an abbreviation no more than 4 characters long.
[ "Apply", "a", "set", "of", "standard", "transformations", "to", "string", "to", "produce", "an", "abbreviation", "no", "more", "than", "4", "characters", "long", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/util/__init__.py#L289-L319
train
Apply a set of standard transformations to string to produce an anatomical version of the string.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/_decision_tree.py
Node.get_decision
def get_decision(self, child, is_missing = False): """ Get the decision from this node to a child node. Parameters ---------- child: Node A child node of this node. Returns ------- dict: A dictionary that describes how to get from this node t...
python
def get_decision(self, child, is_missing = False): """ Get the decision from this node to a child node. Parameters ---------- child: Node A child node of this node. Returns ------- dict: A dictionary that describes how to get from this node t...
[ "def", "get_decision", "(", "self", ",", "child", ",", "is_missing", "=", "False", ")", ":", "# Child does exist and there is a path to the child.", "value", "=", "self", ".", "value", "feature", "=", "self", ".", "split_feature_column", "index", "=", "self", ".",...
Get the decision from this node to a child node. Parameters ---------- child: Node A child node of this node. Returns ------- dict: A dictionary that describes how to get from this node to the child node.
[ "Get", "the", "decision", "from", "this", "node", "to", "a", "child", "node", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_decision_tree.py#L80-L123
train
Returns the decision from this node to a child node.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/_decision_tree.py
Node.to_dict
def to_dict(self): """ Return the node as a dictionary. Returns ------- dict: All the attributes of this node as a dictionary (minus the left and right). """ out = {} for key in self.__dict__.keys(): if key not in ['left', 'right...
python
def to_dict(self): """ Return the node as a dictionary. Returns ------- dict: All the attributes of this node as a dictionary (minus the left and right). """ out = {} for key in self.__dict__.keys(): if key not in ['left', 'right...
[ "def", "to_dict", "(", "self", ")", ":", "out", "=", "{", "}", "for", "key", "in", "self", ".", "__dict__", ".", "keys", "(", ")", ":", "if", "key", "not", "in", "[", "'left'", ",", "'right'", ",", "'missing'", ",", "'parent'", "]", ":", "out", ...
Return the node as a dictionary. Returns ------- dict: All the attributes of this node as a dictionary (minus the left and right).
[ "Return", "the", "node", "as", "a", "dictionary", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_decision_tree.py#L125-L138
train
Return the node as a dictionary.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/_decision_tree.py
DecisionTree.to_json
def to_json(self, root_id = 0, output = {}): """ Recursive function to dump this tree as a json blob. Parameters ---------- root_id: Root id of the sub-tree output: Carry over output from the previous sub-trees. Returns ------- dict: A tree in JS...
python
def to_json(self, root_id = 0, output = {}): """ Recursive function to dump this tree as a json blob. Parameters ---------- root_id: Root id of the sub-tree output: Carry over output from the previous sub-trees. Returns ------- dict: A tree in JS...
[ "def", "to_json", "(", "self", ",", "root_id", "=", "0", ",", "output", "=", "{", "}", ")", ":", "_raise_error_if_not_of_type", "(", "root_id", ",", "[", "int", ",", "long", "]", ",", "\"root_id\"", ")", "_numeric_param_check_range", "(", "\"root_id\"", ",...
Recursive function to dump this tree as a json blob. Parameters ---------- root_id: Root id of the sub-tree output: Carry over output from the previous sub-trees. Returns ------- dict: A tree in JSON format. Starts at the root node and recursively repres...
[ "Recursive", "function", "to", "dump", "this", "tree", "as", "a", "json", "blob", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_decision_tree.py#L300-L371
train
Recursive function to dump this tree as a json blob.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/_decision_tree.py
DecisionTree.get_prediction_score
def get_prediction_score(self, node_id): """ Return the prediction score (if leaf node) or None if its an intermediate node. Parameters ---------- node_id: id of the node to get the prediction value. Returns ------- float or None: returns float v...
python
def get_prediction_score(self, node_id): """ Return the prediction score (if leaf node) or None if its an intermediate node. Parameters ---------- node_id: id of the node to get the prediction value. Returns ------- float or None: returns float v...
[ "def", "get_prediction_score", "(", "self", ",", "node_id", ")", ":", "_raise_error_if_not_of_type", "(", "node_id", ",", "[", "int", ",", "long", "]", ",", "\"node_id\"", ")", "_numeric_param_check_range", "(", "\"node_id\"", ",", "node_id", ",", "0", ",", "s...
Return the prediction score (if leaf node) or None if its an intermediate node. Parameters ---------- node_id: id of the node to get the prediction value. Returns ------- float or None: returns float value of prediction if leaf node and None if not. ...
[ "Return", "the", "prediction", "score", "(", "if", "leaf", "node", ")", "or", "None", "if", "its", "an", "intermediate", "node", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_decision_tree.py#L373-L401
train
Get the prediction score of a node.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/_decision_tree.py
DecisionTree.get_prediction_path
def get_prediction_path(self, node_id, missing_id = []): """ Return the prediction path from this node to the parent node. Parameters ---------- node_id : id of the node to get the prediction path. missing_id : Additional info that contains nodes with missing features...
python
def get_prediction_path(self, node_id, missing_id = []): """ Return the prediction path from this node to the parent node. Parameters ---------- node_id : id of the node to get the prediction path. missing_id : Additional info that contains nodes with missing features...
[ "def", "get_prediction_path", "(", "self", ",", "node_id", ",", "missing_id", "=", "[", "]", ")", ":", "_raise_error_if_not_of_type", "(", "node_id", ",", "[", "int", ",", "long", "]", ",", "\"node_id\"", ")", "_numeric_param_check_range", "(", "\"node_id\"", ...
Return the prediction path from this node to the parent node. Parameters ---------- node_id : id of the node to get the prediction path. missing_id : Additional info that contains nodes with missing features. Returns ------- list: The list of decisions (top t...
[ "Return", "the", "prediction", "path", "from", "this", "node", "to", "the", "parent", "node", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/_decision_tree.py#L403-L484
train
Get the prediction path from this node to the parent node.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/toolkits/graph_analytics/label_propagation.py
create
def create(graph, label_field, threshold=1e-3, weight_field='', self_weight=1.0, undirected=False, max_iterations=None, _single_precision=False, _distributed='auto', verbose=True): """ Given a weighted graph with observed cl...
python
def create(graph, label_field, threshold=1e-3, weight_field='', self_weight=1.0, undirected=False, max_iterations=None, _single_precision=False, _distributed='auto', verbose=True): """ Given a weighted graph with observed cl...
[ "def", "create", "(", "graph", ",", "label_field", ",", "threshold", "=", "1e-3", ",", "weight_field", "=", "''", ",", "self_weight", "=", "1.0", ",", "undirected", "=", "False", ",", "max_iterations", "=", "None", ",", "_single_precision", "=", "False", "...
Given a weighted graph with observed class labels of a subset of vertices, infer the label probability for the unobserved vertices using the "label propagation" algorithm. The algorithm iteratively updates the label probability of current vertex as a weighted sum of label probability of self and the ne...
[ "Given", "a", "weighted", "graph", "with", "observed", "class", "labels", "of", "a", "subset", "of", "vertices", "infer", "the", "label", "probability", "for", "the", "unobserved", "vertices", "using", "the", "label", "propagation", "algorithm", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/graph_analytics/label_propagation.py#L131-L274
train
This function creates a new unobserved vertex - set with the given label field.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/_gl_pickle.py
_is_not_pickle_safe_gl_model_class
def _is_not_pickle_safe_gl_model_class(obj_class): """ Check if a Turi create model is pickle safe. The function does it by checking that _CustomModel is the base class. Parameters ---------- obj_class : Class to be checked. Returns ---------- True if the GLC class is a model a...
python
def _is_not_pickle_safe_gl_model_class(obj_class): """ Check if a Turi create model is pickle safe. The function does it by checking that _CustomModel is the base class. Parameters ---------- obj_class : Class to be checked. Returns ---------- True if the GLC class is a model a...
[ "def", "_is_not_pickle_safe_gl_model_class", "(", "obj_class", ")", ":", "if", "issubclass", "(", "obj_class", ",", "_toolkits", ".", "_model", ".", "CustomModel", ")", ":", "return", "not", "obj_class", ".", "_is_gl_pickle_safe", "(", ")", "return", "False" ]
Check if a Turi create model is pickle safe. The function does it by checking that _CustomModel is the base class. Parameters ---------- obj_class : Class to be checked. Returns ---------- True if the GLC class is a model and is pickle safe.
[ "Check", "if", "a", "Turi", "create", "model", "is", "pickle", "safe", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/_gl_pickle.py#L33-L50
train
Checks if a GLC class is pickle safe.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/_gl_pickle.py
_is_not_pickle_safe_gl_class
def _is_not_pickle_safe_gl_class(obj_class): """ Check if class is a Turi create model. The function does it by checking the method resolution order (MRO) of the class and verifies that _Model is the base class. Parameters ---------- obj_class : Class to be checked. Returns ---...
python
def _is_not_pickle_safe_gl_class(obj_class): """ Check if class is a Turi create model. The function does it by checking the method resolution order (MRO) of the class and verifies that _Model is the base class. Parameters ---------- obj_class : Class to be checked. Returns ---...
[ "def", "_is_not_pickle_safe_gl_class", "(", "obj_class", ")", ":", "gl_ds", "=", "[", "_SFrame", ",", "_SArray", ",", "_SGraph", "]", "# Object is GLC-DS or GLC-Model", "return", "(", "obj_class", "in", "gl_ds", ")", "or", "_is_not_pickle_safe_gl_model_class", "(", ...
Check if class is a Turi create model. The function does it by checking the method resolution order (MRO) of the class and verifies that _Model is the base class. Parameters ---------- obj_class : Class to be checked. Returns ---------- True if the class is a GLC Model.
[ "Check", "if", "class", "is", "a", "Turi", "create", "model", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/_gl_pickle.py#L52-L71
train
Checks if the class is a GLC - DS or GLC - Model.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/_gl_pickle.py
_get_gl_class_type
def _get_gl_class_type(obj_class): """ Internal util to get the type of the GLC class. The pickle file stores this name so that it knows how to construct the object on unpickling. Parameters ---------- obj_class : Class which has to be categorized. Returns ---------- A class typ...
python
def _get_gl_class_type(obj_class): """ Internal util to get the type of the GLC class. The pickle file stores this name so that it knows how to construct the object on unpickling. Parameters ---------- obj_class : Class which has to be categorized. Returns ---------- A class typ...
[ "def", "_get_gl_class_type", "(", "obj_class", ")", ":", "if", "obj_class", "==", "_SFrame", ":", "return", "\"SFrame\"", "elif", "obj_class", "==", "_SGraph", ":", "return", "\"SGraph\"", "elif", "obj_class", "==", "_SArray", ":", "return", "\"SArray\"", "elif"...
Internal util to get the type of the GLC class. The pickle file stores this name so that it knows how to construct the object on unpickling. Parameters ---------- obj_class : Class which has to be categorized. Returns ---------- A class type for the pickle file to save.
[ "Internal", "util", "to", "get", "the", "type", "of", "the", "GLC", "class", ".", "The", "pickle", "file", "stores", "this", "name", "so", "that", "it", "knows", "how", "to", "construct", "the", "object", "on", "unpickling", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/_gl_pickle.py#L73-L97
train
Internal utility to get the type of the GLC class.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/_gl_pickle.py
GLPickler.persistent_id
def persistent_id(self, obj): """ Provide a persistent ID for "saving" GLC objects by reference. Return None for all non GLC objects. Parameters ---------- obj: Name of the object whose persistent ID is extracted. Returns -------- None if the ob...
python
def persistent_id(self, obj): """ Provide a persistent ID for "saving" GLC objects by reference. Return None for all non GLC objects. Parameters ---------- obj: Name of the object whose persistent ID is extracted. Returns -------- None if the ob...
[ "def", "persistent_id", "(", "self", ",", "obj", ")", ":", "# Get the class of the object (if it can be done)", "obj_class", "=", "None", "if", "not", "hasattr", "(", "obj", ",", "'__class__'", ")", "else", "obj", ".", "__class__", "if", "obj_class", "is", "None...
Provide a persistent ID for "saving" GLC objects by reference. Return None for all non GLC objects. Parameters ---------- obj: Name of the object whose persistent ID is extracted. Returns -------- None if the object is not a GLC object. (ClassName, relative pat...
[ "Provide", "a", "persistent", "ID", "for", "saving", "GLC", "objects", "by", "reference", ".", "Return", "None", "for", "all", "non", "GLC", "objects", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/_gl_pickle.py#L287-L351
train
Provides a persistent ID for saving GLC objects by reference.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
apple/turicreate
src/unity/python/turicreate/_gl_pickle.py
GLPickler.close
def close(self): """ Close the pickle file, and the zip archive file. The single zip archive file can now be shipped around to be loaded by the unpickler. """ if self.file is None: return # Close the pickle file. self.file.close() self.file = ...
python
def close(self): """ Close the pickle file, and the zip archive file. The single zip archive file can now be shipped around to be loaded by the unpickler. """ if self.file is None: return # Close the pickle file. self.file.close() self.file = ...
[ "def", "close", "(", "self", ")", ":", "if", "self", ".", "file", "is", "None", ":", "return", "# Close the pickle file.", "self", ".", "file", ".", "close", "(", ")", "self", ".", "file", "=", "None", "for", "f", "in", "self", ".", "mark_for_delete", ...
Close the pickle file, and the zip archive file. The single zip archive file can now be shipped around to be loaded by the unpickler.
[ "Close", "the", "pickle", "file", "and", "the", "zip", "archive", "file", ".", "The", "single", "zip", "archive", "file", "can", "now", "be", "shipped", "around", "to", "be", "loaded", "by", "the", "unpickler", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/_gl_pickle.py#L353-L374
train
Close the pickle file and the zip archive file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...