diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Exp.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Exp.ts new file mode 100644 index 000000000..ecfd1212d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Exp.ts @@ -0,0 +1,32 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {Exp, ExpInputs, KernelConfig, Tensor} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const expConfig: KernelConfig = { + kernelName: Exp, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as ExpInputs; + const backend = args.backend as NodeJSKernelBackend; + + const xTensor = x.dtype === 'int32' ? (x as Tensor).toFloat() : x; + return backend.executeSingleInput(Exp, xTensor); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ExpandDims.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ExpandDims.ts new file mode 100644 index 000000000..51ed2122b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ExpandDims.ts @@ -0,0 +1,36 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {ExpandDims, ExpandDimsAttrs, ExpandDimsInputs, KernelConfig, scalar} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const expandDimsConfig: KernelConfig = { + kernelName: ExpandDims, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {input} = args.inputs as ExpandDimsInputs; + const backend = args.backend as NodeJSKernelBackend; + const {dim} = args.attrs as {} as ExpandDimsAttrs; + + const dimTensor = scalar(dim, 'int32'); + + const res = backend.executeSingleOutput(ExpandDims, [], [input, dimTensor]); + dimTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Expm1.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Expm1.ts new file mode 100644 index 000000000..121c4fd68 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Expm1.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {Expm1, Expm1Inputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const expm1Config: KernelConfig = { + kernelName: Expm1, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as Expm1Inputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Expm1, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FFT.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FFT.ts new file mode 100644 index 000000000..2c7a77b3f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FFT.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {FFT, FFTInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +// tslint:disable-next-line: variable-name +export const FFTConfig: KernelConfig = { + kernelName: FFT, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {input} = args.inputs as FFTInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr('Tcomplex', input.dtype)]; + return backend.executeSingleOutput(FFT, opAttrs, [input]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Fill.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Fill.ts new file mode 100644 index 000000000..fd1a78183 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Fill.ts @@ -0,0 +1,60 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {Fill, FillAttrs, KernelConfig, scalar, tensor1d} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const fillConfig: KernelConfig = { + kernelName: Fill, + backendName: 'tensorflow', + kernelFunc: (args) => { + const backend = args.backend as NodeJSKernelBackend; + const {shape, value} = args.attrs as {} as FillAttrs; + let {dtype} = args.attrs as {} as FillAttrs; + + // TODO(cais, nkreeger): Investigate whether backend can be made into + // a dtype helper method. The underlying op kernel doesn't accept undefined + // or null dtype. + if (dtype == null) { + if (typeof value === 'number') { + dtype = 'float32'; + } else { + dtype = 'string'; + } + } + const shapeTensor = tensor1d(shape, 'int32'); + const valueTensor = scalar(value, dtype); + const opAttrs = [ + { + name: 'T', + type: backend.binding.TF_ATTR_TYPE, + value: backend.getDTypeInteger(dtype) + }, + { + name: 'index_type', + type: backend.binding.TF_ATTR_TYPE, + value: backend.binding.TF_INT32 + } + ]; + const res = + backend.executeSingleOutput(Fill, opAttrs, [shapeTensor, valueTensor]); + shapeTensor.dispose(); + valueTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Floor.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Floor.ts new file mode 100644 index 000000000..39616538e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Floor.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {Floor, FloorInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const floorConfig: KernelConfig = { + kernelName: Floor, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as FloorInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Floor, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FloorDiv.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FloorDiv.ts new file mode 100644 index 000000000..3752e2c0f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FloorDiv.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util, FloorDiv, FloorDivInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const floorDivConfig: KernelConfig = { + kernelName: FloorDiv, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as FloorDivInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(FloorDiv, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FusedBatchNorm.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FusedBatchNorm.ts new file mode 100644 index 000000000..4e0f0b313 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FusedBatchNorm.ts @@ -0,0 +1,70 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {add, fill, FusedBatchNorm, FusedBatchNormAttrs, FusedBatchNormInputs, KernelConfig, mul, Rank, rsqrt, scalar, sub, Tensor, Tensor4D, tidy} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const fusedBatchNormConfig: KernelConfig = { + kernelName: FusedBatchNorm, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x, mean, variance} = args.inputs as FusedBatchNormInputs; + let {scale, offset} = args.inputs as FusedBatchNormInputs; + const backend = args.backend as NodeJSKernelBackend; + const {varianceEpsilon} = args.attrs as {} as FusedBatchNormAttrs; + + return tidy(() => { + if ((mean as Tensor).rank > 1) { + // Fused batch norm doesn't work with high-dim mean/var/scale/offset. + let inv = rsqrt(add(variance as Tensor, scalar(varianceEpsilon))); + if (scale != null) { + inv = mul(inv, scale as Tensor); + } + const xNorm: Tensor4D = mul(sub(x as Tensor, mean as Tensor), inv); + return offset != null ? add(xNorm, offset as Tensor) : xNorm; + } + const dataFormat = 'NHWC'; + const depth = x.shape[3]; + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + { + name: 'epsilon', + type: backend.binding.TF_ATTR_FLOAT, + value: varianceEpsilon + }, + { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + }, + {name: 'is_training', type: backend.binding.TF_ATTR_BOOL, value: false}, + ]; + const numOutputs = 5; + + if (scale == null) { + scale = fill([depth], 1); + } + if (offset == null) { + offset = fill([depth], 0); + } + return backend.executeMultipleOutputs( + FusedBatchNorm, opAttrs, [x, scale, offset, mean, variance], + numOutputs)[0]; + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FusedConv2D.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FusedConv2D.ts new file mode 100644 index 000000000..27b390e79 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FusedConv2D.ts @@ -0,0 +1,65 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {add, backend_util, FusedConv2D, FusedConv2DAttrs, FusedConv2DInputs, KernelConfig, Tensor} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +import {conv2dImpl} from './Conv2D'; + +export const fusedConv2DConfig: KernelConfig = { + kernelName: FusedConv2D, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x, filter, bias, preluActivationWeights} = + args.inputs as FusedConv2DInputs; + const backend = args.backend as NodeJSKernelBackend; + const { + strides, + pad, + dataFormat, + dilations, + dimRoundingMode, + activation, + leakyreluAlpha + } = args.attrs as {} as FusedConv2DAttrs; + + const $dataFormat = backend_util.convertConv2DDataFormat(dataFormat); + const convInfo = backend_util.computeConv2DInfo( + x.shape as [number, number, number, number], + filter.shape as [number, number, number, number], strides, dilations, + pad, dimRoundingMode, false /* depthwise */, $dataFormat); + + let result = conv2dImpl(x, filter, convInfo, backend); + + const toDispose = []; + if (bias != null) { + toDispose.push(result); + result = add(result, bias as Tensor); + } + + const temp = result; + result = backend.applyActivation( + result, activation, preluActivationWeights as Tensor, leakyreluAlpha); + if (temp !== result) { + toDispose.push(temp); + } + + toDispose.forEach(t => t.dispose()); + return result; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FusedDepthwiseConv2D.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FusedDepthwiseConv2D.ts new file mode 100644 index 000000000..d626c6c7f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FusedDepthwiseConv2D.ts @@ -0,0 +1,68 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {add, backend_util, FusedDepthwiseConv2D, FusedDepthwiseConv2DAttrs, FusedDepthwiseConv2DInputs, KernelConfig, Tensor} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +import {depthwiseConv2dNativeImpl} from './DepthwiseConv2dNative'; + +export const fusedDepthwiseConv2DConfig: KernelConfig = { + kernelName: FusedDepthwiseConv2D, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x, filter, bias, preluActivationWeights} = + args.inputs as FusedDepthwiseConv2DInputs; + const backend = args.backend as NodeJSKernelBackend; + const { + strides, + pad, + dilations, + dimRoundingMode, + activation, + leakyreluAlpha + } = args.attrs as {} as FusedDepthwiseConv2DAttrs; + + let $dilations = dilations; + if ($dilations == null) { + $dilations = [1, 1]; + } + + const convInfo = backend_util.computeConv2DInfo( + x.shape as [number, number, number, number], + filter.shape as [number, number, number, number], strides, $dilations, + pad, dimRoundingMode, true /* depthwise */); + + let result = depthwiseConv2dNativeImpl(x, filter, convInfo, backend); + + const toDispose = []; + if (bias != null) { + toDispose.push(result); + result = add(result, bias as Tensor); + } + + const temp = result; + result = backend.applyActivation( + result, activation, preluActivationWeights as Tensor, leakyreluAlpha); + if (temp !== result) { + toDispose.push(temp); + } + + toDispose.forEach(t => t.dispose()); + return result; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/GatherNd.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/GatherNd.ts new file mode 100644 index 000000000..326b4eaf2 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/GatherNd.ts @@ -0,0 +1,35 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {GatherNd, GatherNdInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const gatherNdConfig: KernelConfig = { + kernelName: GatherNd, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {params, indices} = args.inputs as GatherNdInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [ + createTensorsTypeOpAttr('Tparams', params.dtype), + createTensorsTypeOpAttr('Tindices', 'int32') + ]; + return backend.executeSingleOutput(GatherNd, opAttrs, [params, indices]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/GatherV2.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/GatherV2.ts new file mode 100644 index 000000000..7aea08f91 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/GatherV2.ts @@ -0,0 +1,47 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util, GatherV2, GatherV2Attrs, GatherV2Inputs, KernelConfig, scalar, Tensor} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const gatherV2Config: KernelConfig = { + kernelName: GatherV2, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x, indices} = args.inputs as GatherV2Inputs; + const backend = args.backend as NodeJSKernelBackend; + const {axis, batchDims} = args.attrs as {} as GatherV2Attrs; + + // validate the inputs + backend_util.segment_util.collectGatherOpShapeInfo( + x as Tensor, indices as Tensor, axis, batchDims); + + const axisTensor = scalar(axis, 'int32'); + const opAttrs = [ + {name: 'batch_dims', type: backend.binding.TF_ATTR_INT, value: batchDims}, + createTensorsTypeOpAttr('Tparams', x.dtype), + createTensorsTypeOpAttr('Tindices', indices.dtype), + createTensorsTypeOpAttr('Taxis', 'int32') + ]; + + const res = backend.executeSingleOutput( + GatherV2, opAttrs, [x, indices, axisTensor]); + axisTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Greater.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Greater.ts new file mode 100644 index 000000000..7effb2e23 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Greater.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util, Greater, GreaterInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const greaterConfig: KernelConfig = { + kernelName: Greater, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as GreaterInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(Greater, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/GreaterEqual.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/GreaterEqual.ts new file mode 100644 index 000000000..7f70d2961 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/GreaterEqual.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util, GreaterEqual, GreaterEqualInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const greaterEqualConfig: KernelConfig = { + kernelName: GreaterEqual, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as GreaterEqualInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(GreaterEqual, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IFFT.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IFFT.ts new file mode 100644 index 000000000..6ca476d9f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IFFT.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {IFFT, IFFTInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +// tslint:disable-next-line: variable-name +export const IFFTConfig: KernelConfig = { + kernelName: IFFT, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {input} = args.inputs as IFFTInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr('Tcomplex', input.dtype)]; + return backend.executeSingleOutput(IFFT, opAttrs, [input]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Identity.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Identity.ts new file mode 100644 index 000000000..0e55493a5 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Identity.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {Identity, IdentityInputs, KernelConfig} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const identityConfig: KernelConfig = { + kernelName: Identity, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as IdentityInputs; + // Backend needs to track refCount for the dataId for identity op + (args.backend as NodeJSKernelBackend).incRef(x.dataId); + return {dataId: x.dataId, shape: x.shape, dtype: x.dtype}; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Imag.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Imag.ts new file mode 100644 index 000000000..99b2e6b9a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Imag.ts @@ -0,0 +1,44 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {Imag, ImagInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const imagConfig: KernelConfig = { + kernelName: Imag, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {input} = args.inputs as ImagInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [ + { + name: 'T', + type: backend.binding.TF_ATTR_TYPE, + value: backend.binding.TF_COMPLEX64 + }, + { + name: 'Tout', + type: backend.binding.TF_ATTR_TYPE, + value: backend.binding.TF_FLOAT + } + ]; + const inputs = [input]; + return backend.executeSingleOutput(Imag, opAttrs, inputs); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IsFinite.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IsFinite.ts new file mode 100644 index 000000000..522a0ea62 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IsFinite.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {IsFinite, IsFiniteInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const isFiniteConfig: KernelConfig = { + kernelName: IsFinite, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as IsFiniteInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(IsFinite, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IsInf.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IsInf.ts new file mode 100644 index 000000000..4b1eead48 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IsInf.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {IsInf, IsInfInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const isInfConfig: KernelConfig = { + kernelName: IsInf, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as IsInfInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(IsInf, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IsNan.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IsNan.ts new file mode 100644 index 000000000..36a9c339f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IsNan.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {IsNan, IsNanInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const isNanConfig: KernelConfig = { + kernelName: IsNan, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as IsNanInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(IsNan, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LRN.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LRN.ts new file mode 100644 index 000000000..b460004db --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LRN.ts @@ -0,0 +1,44 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, LRN, LRNAttrs, LRNInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +// tslint:disable-next-line: variable-name +export const LRNConfig: KernelConfig = { + kernelName: LRN, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as LRNInputs; + const backend = args.backend as NodeJSKernelBackend; + const {depthRadius, bias, alpha, beta} = args.attrs as {} as LRNAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + { + name: 'depth_radius', + type: backend.binding.TF_ATTR_INT, + value: depthRadius + }, + {name: 'bias', type: backend.binding.TF_ATTR_FLOAT, value: bias}, + {name: 'alpha', type: backend.binding.TF_ATTR_FLOAT, value: alpha}, + {name: 'beta', type: backend.binding.TF_ATTR_FLOAT, value: beta}, + ]; + return backend.executeSingleOutput(LRN, opAttrs, [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LRNGrad.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LRNGrad.ts new file mode 100644 index 000000000..cb5950b3b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LRNGrad.ts @@ -0,0 +1,44 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, LRNGrad, LRNGradAttrs, LRNGradInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +// tslint:disable-next-line: variable-name +export const LRNGradConfig: KernelConfig = { + kernelName: LRNGrad, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x, y, dy} = args.inputs as LRNGradInputs; + const backend = args.backend as NodeJSKernelBackend; + const {depthRadius, bias, alpha, beta} = args.attrs as {} as LRNGradAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', dy.dtype), + { + name: 'depth_radius', + type: backend.binding.TF_ATTR_INT, + value: depthRadius + }, + {name: 'bias', type: backend.binding.TF_ATTR_FLOAT, value: bias}, + {name: 'alpha', type: backend.binding.TF_ATTR_FLOAT, value: alpha}, + {name: 'beta', type: backend.binding.TF_ATTR_FLOAT, value: beta}, + ]; + return backend.executeSingleOutput(LRNGrad, opAttrs, [dy, x, y]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LeakyRelu.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LeakyRelu.ts new file mode 100644 index 000000000..7b43b7181 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LeakyRelu.ts @@ -0,0 +1,38 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, LeakyRelu, LeakyReluAttrs, LeakyReluInputs, Tensor} from '@tensorflow/tfjs'; +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const leakyReluConfig: KernelConfig = { + kernelName: LeakyRelu, + backendName: 'tensorflow', + kernelFunc: (args) => { + const inputs = args.inputs as LeakyReluInputs; + const attrs = args.attrs as {} as LeakyReluAttrs; + const backend = args.backend as NodeJSKernelBackend; + const x = inputs.x as Tensor; + const alpha = attrs.alpha; + + const opAttrs = [ + {name: 'alpha', type: backend.binding.TF_ATTR_FLOAT, value: alpha}, + createTensorsTypeOpAttr('T', x.dtype) + ]; + + return backend.executeSingleOutput(LeakyRelu, opAttrs, [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Less.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Less.ts new file mode 100644 index 000000000..9d45a6a7e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Less.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util, KernelConfig, Less, LessInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const lessConfig: KernelConfig = { + kernelName: Less, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as LessInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(Less, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LessEqual.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LessEqual.ts new file mode 100644 index 000000000..01d24faac --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LessEqual.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util, KernelConfig, LessEqual, LessEqualInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const lessEqualConfig: KernelConfig = { + kernelName: LessEqual, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as LessEqualInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(LessEqual, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LinSpace.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LinSpace.ts new file mode 100644 index 000000000..768122cfd --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LinSpace.ts @@ -0,0 +1,41 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, LinSpace, LinSpaceAttrs, scalar, tidy} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const linSpaceConfig: KernelConfig = { + kernelName: LinSpace, + backendName: 'tensorflow', + kernelFunc: (args) => { + const backend = args.backend as NodeJSKernelBackend; + const {start, stop, num} = args.attrs as {} as LinSpaceAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', 'float32'), + createTensorsTypeOpAttr('Tidx', 'int32') + ]; + + return tidy(() => { + const inputs = [ + scalar(start, 'float32'), scalar(stop, 'float32'), scalar(num, 'int32') + ]; + return backend.executeSingleOutput(LinSpace, opAttrs, inputs); + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Log.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Log.ts new file mode 100644 index 000000000..9d2db8c59 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Log.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Log, LogInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const logConfig: KernelConfig = { + kernelName: Log, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as LogInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Log, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Log1p.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Log1p.ts new file mode 100644 index 000000000..ae49842dd --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Log1p.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Log1p, Log1pInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const log1pConfig: KernelConfig = { + kernelName: Log1p, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as Log1pInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Log1p, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LogicalAnd.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LogicalAnd.ts new file mode 100644 index 000000000..9c9ab427d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LogicalAnd.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, LogicalAnd, LogicalAndInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const logicalAndConfig: KernelConfig = { + kernelName: LogicalAnd, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as LogicalAndInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleOutput(LogicalAnd, [], [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LogicalNot.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LogicalNot.ts new file mode 100644 index 000000000..4d78164a7 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LogicalNot.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, LogicalNot, LogicalNotInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const logicalNotConfig: KernelConfig = { + kernelName: LogicalNot, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as LogicalNotInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleOutput(LogicalNot, [], [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LogicalOr.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LogicalOr.ts new file mode 100644 index 000000000..2da97e04c --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LogicalOr.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, LogicalOr, LogicalOrInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const logicalOrConfig: KernelConfig = { + kernelName: LogicalOr, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as LogicalOrInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleOutput(LogicalOr, [], [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Max.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Max.ts new file mode 100644 index 000000000..c8fe5c017 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Max.ts @@ -0,0 +1,37 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Max, MaxAttrs, MaxInputs, tensor1d, util} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const maxConfig: KernelConfig = { + kernelName: Max, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as MaxInputs; + const backend = args.backend as NodeJSKernelBackend; + const {reductionIndices, keepDims} = args.attrs as {} as MaxAttrs; + + const axes = util.parseAxisParam(reductionIndices, x.shape); + const axesTensor = tensor1d(axes, 'int32'); + const res = backend.executeSingleOutput( + Max, backend.createReductionOpAttrs(x, keepDims), [x, axesTensor]); + axesTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPool.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPool.ts new file mode 100644 index 000000000..2ff7da19a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPool.ts @@ -0,0 +1,56 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util, KernelConfig, MaxPool, MaxPoolAttrs, MaxPoolInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const maxPoolConfig: KernelConfig = { + kernelName: MaxPool, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as MaxPoolInputs; + const backend = args.backend as NodeJSKernelBackend; + const {filterSize, strides, pad, dimRoundingMode} = + args.attrs as {} as MaxPoolAttrs; + + const convInfo = backend_util.computePool2DInfo( + x.shape as [number, number, number, number], filterSize, strides, + 1 /* dilations */, pad, dimRoundingMode); + + if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { + throw new Error( + `TF Backend supports only 'valid' and 'same' padding ` + + `while padding was ${convInfo.padInfo.type}`); + } + const ksize = [1, convInfo.filterHeight, convInfo.filterWidth, 1]; + const $strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; + const padding = convInfo.padInfo.type; + const dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + {name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize}, + {name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides}, + {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + } + ]; + return backend.executeSingleOutput(MaxPool, opAttrs, [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPool3D.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPool3D.ts new file mode 100644 index 000000000..b5d4c46f0 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPool3D.ts @@ -0,0 +1,60 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util, KernelConfig, MaxPool3D, MaxPool3DAttrs, MaxPool3DInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const maxPool3DConfig: KernelConfig = { + kernelName: MaxPool3D, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as MaxPool3DInputs; + const backend = args.backend as NodeJSKernelBackend; + const {filterSize, strides, pad, dataFormat, dimRoundingMode} = + args.attrs as {} as MaxPool3DAttrs; + + const convInfo = backend_util.computePool3DInfo( + x.shape as [number, number, number, number, number], filterSize, + strides, 1 /* dilations */, pad, dimRoundingMode, dataFormat); + if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { + throw new Error( + `TF Backend supports only 'valid' and 'same' padding ` + + `while padding was ${convInfo.padInfo.type}`); + } + const ksize = [ + 1, convInfo.filterDepth, convInfo.filterHeight, convInfo.filterWidth, 1 + ]; + const $strides = [ + 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 + ]; + const padding = convInfo.padInfo.type; + const $dataFormat = + convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + {name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize}, + {name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides}, + {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: $dataFormat + } + ]; + return backend.executeSingleOutput(MaxPool3D, opAttrs, [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPool3DGrad.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPool3DGrad.ts new file mode 100644 index 000000000..71d60fcec --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPool3DGrad.ts @@ -0,0 +1,63 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util, KernelConfig, MaxPool3DGrad, MaxPool3DGradAttrs, MaxPool3DGradInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const maxPool3DGradConfig: KernelConfig = { + kernelName: MaxPool3DGrad, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {dy, input, output} = args.inputs as MaxPool3DGradInputs; + const backend = args.backend as NodeJSKernelBackend; + const {filterSize, strides, pad, dimRoundingMode} = + args.attrs as {} as MaxPool3DGradAttrs; + + const convInfo = backend_util.computePool3DInfo( + input.shape as [number, number, number, number, number], filterSize, + strides, 1 /* dilations */, pad, dimRoundingMode); + + if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { + throw new Error( + `TF Backend supports only 'valid' and 'same' padding ` + + `while padding type was ${convInfo.padInfo.type}`); + } + const ksize = [ + 1, convInfo.filterDepth, convInfo.filterHeight, convInfo.filterWidth, 1 + ]; + const $strides = [ + 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 + ]; + const padding = convInfo.padInfo.type; + const dataFormat = + convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; + const opAttrs = [ + createTensorsTypeOpAttr('T', input.dtype), + {name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize}, + {name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides}, + {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, + { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + }, + ]; + return backend.executeSingleOutput( + MaxPool3DGrad, opAttrs, [input, output, dy]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPoolGrad.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPoolGrad.ts new file mode 100644 index 000000000..2d3193382 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPoolGrad.ts @@ -0,0 +1,58 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util, KernelConfig, MaxPoolGrad, MaxPoolGradAttrs, MaxPoolGradInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const maxPoolGradConfig: KernelConfig = { + kernelName: MaxPoolGrad, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {dy, input, output} = args.inputs as MaxPoolGradInputs; + const backend = args.backend as NodeJSKernelBackend; + const {filterSize, strides, pad, dimRoundingMode} = + args.attrs as {} as MaxPoolGradAttrs; + + const convInfo = backend_util.computePool2DInfo( + input.shape as [number, number, number, number], filterSize, strides, + 1 /* dilations */, pad, dimRoundingMode); + + if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { + throw new Error( + `TF Backend supports only 'valid' and 'same' padding ` + + `while padding type was ${convInfo.padInfo.type}`); + } + const ksize = [1, convInfo.filterHeight, convInfo.filterWidth, 1]; + const $strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; + const padding = convInfo.padInfo.type; + const dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; + const opAttrs = [ + createTensorsTypeOpAttr('T', input.dtype), + {name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize}, + {name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides}, + {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, + { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + }, + ]; + return backend.executeSingleOutput( + MaxPoolGrad, opAttrs, [input, output, dy]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Maximum.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Maximum.ts new file mode 100644 index 000000000..94b06e65c --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Maximum.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util, KernelConfig, Maximum, MaximumInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const maximumConfig: KernelConfig = { + kernelName: Maximum, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as MaximumInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(Maximum, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Mean.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Mean.ts new file mode 100644 index 000000000..63062cd16 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Mean.ts @@ -0,0 +1,42 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {cast, KernelConfig, Mean, MeanAttrs, MeanInputs, Tensor, tensor1d, util} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const meanConfig: KernelConfig = { + kernelName: Mean, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as MeanInputs; + const backend = args.backend as NodeJSKernelBackend; + const {axis, keepDims} = args.attrs as {} as MeanAttrs; + const axes = util.parseAxisParam(axis, x.shape); + const axesTensor = tensor1d(axes, 'int32'); + + // Cast to float32 to match existing tfjs implementation/tests. + const asFloat32 = cast(x as Tensor, 'float32'); + const res = backend.executeSingleOutput( + Mean, backend.createReductionOpAttrs(x, keepDims), + [asFloat32, axesTensor]); + + asFloat32.dispose(); + axesTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Min.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Min.ts new file mode 100644 index 000000000..cc35bf477 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Min.ts @@ -0,0 +1,36 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Min, MinAttrs, MinInputs, tensor1d, util} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const minConfig: KernelConfig = { + kernelName: Min, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as MinInputs; + const backend = args.backend as NodeJSKernelBackend; + const {axis, keepDims} = args.attrs as {} as MinAttrs; + const axes = util.parseAxisParam(axis, x.shape); + const axesTensor = tensor1d(axes, 'int32'); + const res = backend.executeSingleOutput( + Min, backend.createReductionOpAttrs(x, keepDims), [x, axesTensor]); + axesTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Minimum.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Minimum.ts new file mode 100644 index 000000000..8b6805a54 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Minimum.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util, KernelConfig, Minimum, MinimumInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const minimumConfig: KernelConfig = { + kernelName: Minimum, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as MinimumInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(Minimum, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MirrorPad.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MirrorPad.ts new file mode 100644 index 000000000..e72667ac0 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MirrorPad.ts @@ -0,0 +1,49 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, MirrorPad, MirrorPadAttrs, MirrorPadInputs, tensor2d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const mirrorPadConfig: KernelConfig = { + kernelName: MirrorPad, + backendName: 'tensorflow', + kernelFunc: ({inputs, backend, attrs}) => { + const {x} = inputs as MirrorPadInputs; + const {paddings, mode} = attrs as {} as MirrorPadAttrs; + + const nodeBackend = backend as NodeJSKernelBackend; + + const paddingsTensor = tensor2d(paddings, [paddings.length, 2], 'int32'); + + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + createTensorsTypeOpAttr('Tpaddings', paddingsTensor.dtype), { + name: 'mode', + type: nodeBackend.binding.TF_ATTR_STRING, + value: mode.toUpperCase() + } + ]; + + const output = nodeBackend.executeSingleOutput( + 'MirrorPad', opAttrs, [x, paddingsTensor]); + + paddingsTensor.dispose(); + + return output; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Mod.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Mod.ts new file mode 100644 index 000000000..5999d5bc6 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Mod.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Mod, ModInputs} from '@tensorflow/tfjs'; +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const modConfig: KernelConfig = { + kernelName: Mod, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as ModInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr('T', a.dtype)]; + return backend.executeSingleOutput('FloorMod', opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Multinomial.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Multinomial.ts new file mode 100644 index 000000000..1f0540054 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Multinomial.ts @@ -0,0 +1,47 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Multinomial, MultinomialAttrs, MultinomialInputs, scalar} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const multinomialConfig: KernelConfig = { + kernelName: Multinomial, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {logits} = args.inputs as MultinomialInputs; + const backend = args.backend as NodeJSKernelBackend; + const {numSamples, seed, normalized} = args.attrs as {} as MultinomialAttrs; + + if (normalized) { + throw new Error( + 'TF Node backend does not support normalized logits ' + + 'passed to multinomial'); + } + const opAttrs = [ + createTensorsTypeOpAttr('T', logits.dtype), + createTensorsTypeOpAttr('output_dtype', 'int32'), + {name: 'seed', type: backend.binding.TF_ATTR_INT, value: seed}, + {name: 'seed2', type: backend.binding.TF_ATTR_INT, value: seed * seed}, + ]; + const numSamplesTensor = scalar(numSamples, 'int32'); + const res = backend.executeSingleOutput( + Multinomial, opAttrs, [logits, numSamplesTensor]); + numSamplesTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Multiply.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Multiply.ts new file mode 100644 index 000000000..2252e30a5 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Multiply.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util, KernelConfig, Multiply, MultiplyInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const multiplyConfig: KernelConfig = { + kernelName: Multiply, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as MultiplyInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput('Mul', opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Neg.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Neg.ts new file mode 100644 index 000000000..83736ed6a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Neg.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Neg, NegInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const negConfig: KernelConfig = { + kernelName: Neg, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as NegInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Neg, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NonMaxSuppressionV3.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NonMaxSuppressionV3.ts new file mode 100644 index 000000000..e97dc1c94 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NonMaxSuppressionV3.ts @@ -0,0 +1,45 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, NonMaxSuppressionV3, NonMaxSuppressionV3Attrs, NonMaxSuppressionV3Inputs, scalar} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const nonMaxSuppressionV3Config: KernelConfig = { + kernelName: NonMaxSuppressionV3, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {boxes, scores} = args.inputs as NonMaxSuppressionV3Inputs; + const backend = args.backend as NodeJSKernelBackend; + const {maxOutputSize, iouThreshold, scoreThreshold} = + args.attrs as {} as NonMaxSuppressionV3Attrs; + + const opAttrs = [createTensorsTypeOpAttr('T', boxes.dtype)]; + + const maxOutputSizeTensor = scalar(maxOutputSize, 'int32'); + const iouThresholdTensor = scalar(iouThreshold); + const scoreThresholdTensor = scalar(scoreThreshold); + const res = backend.executeSingleOutput(NonMaxSuppressionV3, opAttrs, [ + boxes, scores, maxOutputSizeTensor, iouThresholdTensor, + scoreThresholdTensor + ]); + maxOutputSizeTensor.dispose(); + iouThresholdTensor.dispose(); + scoreThresholdTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NonMaxSuppressionV4.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NonMaxSuppressionV4.ts new file mode 100644 index 000000000..e98e15f1c --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NonMaxSuppressionV4.ts @@ -0,0 +1,59 @@ +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, NonMaxSuppressionV4, NonMaxSuppressionV4Attrs, NonMaxSuppressionV4Inputs, scalar, Tensor1D, Tensor2D} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +// TODO(nsthorat, dsmilkov): Remove dependency on tensors, use dataId. +export const nonMaxSuppressionV4Config: KernelConfig = { + kernelName: NonMaxSuppressionV4, + backendName: 'tensorflow', + kernelFunc: ({inputs, backend, attrs}) => { + const {boxes, scores} = inputs as NonMaxSuppressionV4Inputs; + const {maxOutputSize, iouThreshold, scoreThreshold, padToMaxOutputSize} = + attrs as {} as NonMaxSuppressionV4Attrs; + const maxOutputSizeTensor = scalar(maxOutputSize, 'int32'); + const iouThresholdTensor = scalar(iouThreshold, 'float32'); + const scoreThresholdTensor = scalar(scoreThreshold, 'float32'); + + const nodeBackend = backend as NodeJSKernelBackend; + + const opAttrs = [ + createTensorsTypeOpAttr('T', boxes.dtype), + createTensorsTypeOpAttr('T_threshold', 'float32'), { + name: 'pad_to_max_output_size', + type: nodeBackend.binding.TF_ATTR_BOOL, + value: padToMaxOutputSize + } + ]; + + const [selectedIndices, validOutputs] = nodeBackend.executeMultipleOutputs( + 'NonMaxSuppressionV4', opAttrs, + [ + boxes as Tensor2D, scores as Tensor1D, maxOutputSizeTensor, + iouThresholdTensor, scoreThresholdTensor + ], + 2); + + maxOutputSizeTensor.dispose(); + iouThresholdTensor.dispose(); + scoreThresholdTensor.dispose(); + + return [selectedIndices, validOutputs]; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NonMaxSuppressionV5.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NonMaxSuppressionV5.ts new file mode 100644 index 000000000..51cd0a6df --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NonMaxSuppressionV5.ts @@ -0,0 +1,67 @@ +/** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, NamedAttrMap, NamedTensorInfoMap, scalar, Tensor1D, Tensor2D, TensorInfo} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +interface NonMaxSuppressionWithScoreInputs extends NamedTensorInfoMap { + boxes: TensorInfo; + scores: TensorInfo; +} + +interface NonMaxSuppressionWithScoreAttrs extends NamedAttrMap { + maxOutputSize: number; + iouThreshold: number; + scoreThreshold: number; + softNmsSigma: number; +} + +// TODO(nsthorat, dsmilkov): Remove dependency on tensors, use dataId. +export const nonMaxSuppressionV5Config: KernelConfig = { + kernelName: 'NonMaxSuppressionV5', + backendName: 'tensorflow', + kernelFunc: ({inputs, backend, attrs}) => { + const {boxes, scores} = inputs as NonMaxSuppressionWithScoreInputs; + const {maxOutputSize, iouThreshold, scoreThreshold, softNmsSigma} = + attrs as NonMaxSuppressionWithScoreAttrs; + const maxOutputSizeTensor = scalar(maxOutputSize, 'int32'); + const iouThresholdTensor = scalar(iouThreshold); + const scoreThresholdTensor = scalar(scoreThreshold); + const softNmsSigmaTensor = scalar(softNmsSigma); + const opAttrs = [createTensorsTypeOpAttr('T', boxes.dtype)]; + + const nodeBackend = backend as NodeJSKernelBackend; + + const [selectedIndices, selectedScores, validOutputs] = + nodeBackend.executeMultipleOutputs( + 'NonMaxSuppressionV5', opAttrs, + [ + boxes as Tensor2D, scores as Tensor1D, maxOutputSizeTensor, + iouThresholdTensor, scoreThresholdTensor, softNmsSigmaTensor + ], + 3); + + maxOutputSizeTensor.dispose(); + iouThresholdTensor.dispose(); + scoreThresholdTensor.dispose(); + softNmsSigmaTensor.dispose(); + validOutputs.dispose(); + + return [selectedIndices, selectedScores]; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NotEqual.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NotEqual.ts new file mode 100644 index 000000000..174a125f8 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NotEqual.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util, KernelConfig, NotEqual, NotEqualInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const notEqualConfig: KernelConfig = { + kernelName: NotEqual, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as NotEqualInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(NotEqual, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/OneHot.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/OneHot.ts new file mode 100644 index 000000000..331f4e64a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/OneHot.ts @@ -0,0 +1,47 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, OneHot, OneHotAttrs, OneHotInputs, scalar} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const oneHotConfig: KernelConfig = { + kernelName: OneHot, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {indices} = args.inputs as OneHotInputs; + const backend = args.backend as NodeJSKernelBackend; + const {depth, onValue, offValue} = args.attrs as {} as OneHotAttrs; + + const depthTensor = scalar(depth, 'int32'); + const onValueTensor = scalar(onValue, 'int32'); + const offValueTensor = scalar(offValue, 'int32'); + + const opAttrs = [ + {name: 'axis', type: backend.binding.TF_ATTR_INT, value: -1}, + createTensorsTypeOpAttr('T', indices.dtype), + createTensorsTypeOpAttr('TI', indices.dtype) + ]; + + const res = backend.executeSingleOutput( + OneHot, opAttrs, [indices, depthTensor, onValueTensor, offValueTensor]); + depthTensor.dispose(); + onValueTensor.dispose(); + offValueTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/OnesLike.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/OnesLike.ts new file mode 100644 index 000000000..3e71f3f67 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/OnesLike.ts @@ -0,0 +1,35 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, OnesLike, OnesLikeInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const onesLikeConfig: KernelConfig = { + kernelName: OnesLike, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as OnesLikeInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [{ + name: 'T', + type: backend.binding.TF_ATTR_TYPE, + value: backend.getDTypeInteger(x.dtype) + }]; + return backend.executeSingleOutput(OnesLike, opAttrs, [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Pack.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Pack.ts new file mode 100644 index 000000000..0e39cd21b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Pack.ts @@ -0,0 +1,41 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, KernelFunc, Pack, PackAttrs, PackInputs, Tensor, TensorInfo} from '@tensorflow/tfjs'; +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export function pack( + args: {inputs: PackInputs, backend: NodeJSKernelBackend, attrs: PackAttrs}): + TensorInfo { + const {inputs, backend, attrs} = args; + const {axis} = attrs; + + const opAttrs = [ + {name: 'N', type: backend.binding.TF_ATTR_INT, value: inputs.length}, + createTensorsTypeOpAttr('T', inputs as Tensor[]), + {name: 'axis', type: backend.binding.TF_ATTR_INT, value: axis} + ]; + + const res = backend.executeSingleOutput(Pack, opAttrs, inputs); + return res; +} + +export const packConfig: KernelConfig = { + kernelName: Pack, + backendName: 'tensorflow', + kernelFunc: pack as {} as KernelFunc +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/PadV2.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/PadV2.ts new file mode 100644 index 000000000..b2580065b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/PadV2.ts @@ -0,0 +1,47 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, PadV2, PadV2Attrs, PadV2Inputs, scalar, tensor2d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const padV2Config: KernelConfig = { + kernelName: PadV2, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as PadV2Inputs; + const backend = args.backend as NodeJSKernelBackend; + const {paddings, constantValue} = args.attrs as {} as PadV2Attrs; + + // Bind tensor values + const paddingsTensor = tensor2d(paddings, [paddings.length, 2], 'int32'); + const constantTensor = scalar(constantValue, x.dtype); + + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + createTensorsTypeOpAttr('Tpaddings', paddingsTensor.dtype) + ]; + + const res = backend.executeSingleOutput( + PadV2, opAttrs, [x, paddingsTensor, constantTensor]); + + paddingsTensor.dispose(); + constantTensor.dispose(); + + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Pow.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Pow.ts new file mode 100644 index 000000000..aca2c005b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Pow.ts @@ -0,0 +1,36 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util, cast, KernelConfig, Pow, PowInputs, Tensor, tidy} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const powConfig: KernelConfig = { + kernelName: Pow, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as PowInputs; + const backend = args.backend as NodeJSKernelBackend; + + const dtype = backend_util.upcastType(a.dtype, b.dtype); + const opAttrs = [createTensorsTypeOpAttr('T', dtype)]; + return tidy(() => { + return backend.executeSingleOutput( + Pow, opAttrs, [cast(a as Tensor, dtype), cast(b as Tensor, dtype)]); + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Prelu.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Prelu.ts new file mode 100644 index 000000000..84cd1c03d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Prelu.ts @@ -0,0 +1,34 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {abs, KernelConfig, Prelu, PreluInputs, relu, Tensor, tidy} from '@tensorflow/tfjs'; + +export const preluConfig: KernelConfig = { + kernelName: Prelu, + backendName: 'tensorflow', + kernelFunc: (args) => { + const inputs = args.inputs as PreluInputs; + const x = inputs.x as Tensor; + const alpha = inputs.alpha as Tensor; + + return tidy(() => { + const pos = relu(x); + const neg = alpha.mul(x.sub(abs(x))).mul(0.5); + return pos.add(neg); + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Prod.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Prod.ts new file mode 100644 index 000000000..c7851e163 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Prod.ts @@ -0,0 +1,40 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Prod, ProdAttrs, ProdInputs, tensor1d, util} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const prodConfig: KernelConfig = { + kernelName: Prod, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as ProdInputs; + const backend = args.backend as NodeJSKernelBackend; + const {axis, keepDims} = args.attrs as {} as ProdAttrs; + const axes = util.parseAxisParam(axis, x.shape); + const axesTensor = tensor1d(axes, 'int32'); + const opAttrs = [ + {name: 'keep_dims', type: backend.binding.TF_ATTR_BOOL, value: keepDims}, + createTensorsTypeOpAttr('T', x.dtype), + createTensorsTypeOpAttr('Tidx', 'int32') + ]; + const res = backend.executeSingleOutput(Prod, opAttrs, [x, axesTensor]); + axesTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Range.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Range.ts new file mode 100644 index 000000000..39a5a1754 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Range.ts @@ -0,0 +1,61 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Range, RangeAttrs, scalar, zeros} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const rangeConfig: KernelConfig = { + kernelName: Range, + backendName: 'tensorflow', + kernelFunc: (args) => { + const backend = args.backend as NodeJSKernelBackend; + const {start, stop, dtype} = args.attrs as {} as RangeAttrs; + let {step} = args.attrs as {} as RangeAttrs; + + // TensorFlow.js specific allowances + const sameStartStop = start === stop; + const increasingRangeNegativeStep = start < stop && step < 0; + const decreasingRangePositiveStep = stop < start && step > 1; + + if (sameStartStop || increasingRangeNegativeStep || + decreasingRangePositiveStep) { + return zeros([0], dtype); + } + + if (stop < start && step === 1) { + // Auto adjust the step's sign if it hasn't been set + // (or was set to 1) + step = -1; + } + + const opAttrs = [createTensorsTypeOpAttr('Tidx', dtype)]; + const startTensor = scalar(start); + const stopTensor = scalar(stop); + const stepTensor = scalar(step); + const res = backend.executeSingleOutput( + Range, opAttrs, [startTensor, stopTensor, stepTensor]); + const castedRes = res.cast(dtype); + + startTensor.dispose(); + stopTensor.dispose(); + stepTensor.dispose(); + res.dispose(); + + return castedRes; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Real.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Real.ts new file mode 100644 index 000000000..a4064923f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Real.ts @@ -0,0 +1,38 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Real, RealInputs, Tensor} from '@tensorflow/tfjs'; +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const realConfig: KernelConfig = { + kernelName: Real, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {input} = args.inputs as RealInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [ + createTensorsTypeOpAttr('T', input as Tensor), { + name: 'Tout', + type: backend.binding.TF_ATTR_TYPE, + value: backend.binding.TF_FLOAT + } + ]; + const inputs = [input]; + return backend.executeSingleOutput(Real, opAttrs, inputs); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/RealDiv.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/RealDiv.ts new file mode 100644 index 000000000..872747ec9 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/RealDiv.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util, KernelConfig, RealDiv, RealDivInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const realDivConfig: KernelConfig = { + kernelName: RealDiv, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as RealDivInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(RealDiv, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Reciprocal.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Reciprocal.ts new file mode 100644 index 000000000..76ab5c3d1 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Reciprocal.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Reciprocal, ReciprocalInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const reciprocalConfig: KernelConfig = { + kernelName: Reciprocal, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as ReciprocalInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Reciprocal, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Relu.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Relu.ts new file mode 100644 index 000000000..170a56a48 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Relu.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Relu, ReluInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const reluConfig: KernelConfig = { + kernelName: Relu, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as ReluInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Relu, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Relu6.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Relu6.ts new file mode 100644 index 000000000..db266545d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Relu6.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Relu6, Relu6Inputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const relu6Config: KernelConfig = { + kernelName: Relu6, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as Relu6Inputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Relu6, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Reshape.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Reshape.ts new file mode 100644 index 000000000..a19d15879 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Reshape.ts @@ -0,0 +1,40 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Reshape, ReshapeAttrs, ReshapeInputs, tensor1d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const reshapeConfig: KernelConfig = { + kernelName: Reshape, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as ReshapeInputs; + const backend = args.backend as NodeJSKernelBackend; + const {shape} = args.attrs as {} as ReshapeAttrs; + + const shapeTensor = tensor1d(shape, 'int32'); + + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + createTensorsTypeOpAttr('Tshape', shapeTensor.dtype) + ]; + const res = backend.executeSingleOutput(Reshape, opAttrs, [x, shapeTensor]); + shapeTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeBilinear.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeBilinear.ts new file mode 100644 index 000000000..9d9a9eda5 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeBilinear.ts @@ -0,0 +1,51 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, ResizeBilinear, ResizeBilinearAttrs, ResizeBilinearInputs, tensor1d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const resizeBilinearConfig: KernelConfig = { + kernelName: ResizeBilinear, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {images} = args.inputs as ResizeBilinearInputs; + const backend = args.backend as NodeJSKernelBackend; + const {alignCorners, halfPixelCenters, size} = + args.attrs as {} as ResizeBilinearAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', images.dtype), + { + name: 'align_corners', + type: backend.binding.TF_ATTR_BOOL, + value: alignCorners + }, + { + name: 'half_pixel_centers', + type: backend.binding.TF_ATTR_BOOL, + value: halfPixelCenters + }, + ]; + const [newHeight, newWidth] = size; + const sizeTensor = tensor1d([newHeight, newWidth], 'int32'); + const ret = backend.executeSingleOutput( + ResizeBilinear, opAttrs, [images, sizeTensor]); + sizeTensor.dispose(); + return ret; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeBilinearGrad.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeBilinearGrad.ts new file mode 100644 index 000000000..10bc8b05a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeBilinearGrad.ts @@ -0,0 +1,40 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, ResizeBilinearGrad, ResizeBilinearGradAttrs, ResizeBilinearGradInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const resizeBilinearGradConfig: KernelConfig = { + kernelName: ResizeBilinearGrad, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {images, dy} = args.inputs as ResizeBilinearGradInputs; + const backend = args.backend as NodeJSKernelBackend; + const {alignCorners} = args.attrs as {} as ResizeBilinearGradAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', images.dtype), { + name: 'align_corners', + type: backend.binding.TF_ATTR_BOOL, + value: alignCorners + } + ]; + return backend.executeSingleOutput( + ResizeBilinearGrad, opAttrs, [dy, images]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeNearestNeighbor.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeNearestNeighbor.ts new file mode 100644 index 000000000..a7d1786e5 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeNearestNeighbor.ts @@ -0,0 +1,51 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, ResizeNearestNeighbor, ResizeNearestNeighborAttrs, ResizeNearestNeighborInputs, tensor1d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const resizeNearestNeighborConfig: KernelConfig = { + kernelName: ResizeNearestNeighbor, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {images} = args.inputs as ResizeNearestNeighborInputs; + const backend = args.backend as NodeJSKernelBackend; + const {alignCorners, halfPixelCenters, size} = + args.attrs as {} as ResizeNearestNeighborAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', images.dtype), + { + name: 'align_corners', + type: backend.binding.TF_ATTR_BOOL, + value: alignCorners + }, + { + name: 'half_pixel_centers', + type: backend.binding.TF_ATTR_BOOL, + value: halfPixelCenters + }, + ]; + const [newHeight, newWidth] = size; + const sizeTensor = tensor1d([newHeight, newWidth], 'int32'); + const res = backend.executeSingleOutput( + ResizeNearestNeighbor, opAttrs, [images, sizeTensor]); + sizeTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeNearestNeighborGrad.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeNearestNeighborGrad.ts new file mode 100644 index 000000000..43bc13c15 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeNearestNeighborGrad.ts @@ -0,0 +1,44 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, ResizeNearestNeighborGrad, ResizeNearestNeighborGradAttrs, ResizeNearestNeighborGradInputs, tensor1d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const resizeNearestNeighborGradConfig: KernelConfig = { + kernelName: ResizeNearestNeighborGrad, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {images, dy} = args.inputs as ResizeNearestNeighborGradInputs; + const backend = args.backend as NodeJSKernelBackend; + const {alignCorners} = args.attrs as {} as ResizeNearestNeighborGradAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', images.dtype), { + name: 'align_corners', + type: backend.binding.TF_ATTR_BOOL, + value: alignCorners + } + ]; + const [, origHeight, origWidth, ] = images.shape; + const sizeTensor = tensor1d([origHeight, origWidth], 'int32'); + const res = backend.executeSingleOutput( + ResizeNearestNeighborGrad, opAttrs, [dy, sizeTensor]); + sizeTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Reverse.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Reverse.ts new file mode 100644 index 000000000..2513c3cbc --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Reverse.ts @@ -0,0 +1,42 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Reverse, ReverseAttrs, ReverseInputs, tensor1d, util} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const reverseConfig: KernelConfig = { + kernelName: Reverse, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as ReverseInputs; + const backend = args.backend as NodeJSKernelBackend; + const {dims} = args.attrs as {} as ReverseAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('Tidx', 'int32'), + createTensorsTypeOpAttr('T', x.dtype) + ]; + + const axes = util.parseAxisParam(dims, x.shape); + const axisTensor = tensor1d(axes, 'int32'); + const res = + backend.executeSingleOutput('ReverseV2', opAttrs, [x, axisTensor]); + axisTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Round.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Round.ts new file mode 100644 index 000000000..bc8a0634d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Round.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Round, RoundInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const roundConfig: KernelConfig = { + kernelName: Round, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as RoundInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Round, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Rsqrt.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Rsqrt.ts new file mode 100644 index 000000000..92f16f8d1 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Rsqrt.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Rsqrt, RsqrtInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const rsqrtConfig: KernelConfig = { + kernelName: Rsqrt, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as RsqrtInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Rsqrt, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ScatterNd.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ScatterNd.ts new file mode 100644 index 000000000..3eff751f9 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ScatterNd.ts @@ -0,0 +1,42 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, ScatterNd, ScatterNdAttrs, ScatterNdInputs, tensor1d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const scatterNdConfig: KernelConfig = { + kernelName: ScatterNd, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {indices, updates} = args.inputs as ScatterNdInputs; + const backend = args.backend as NodeJSKernelBackend; + const {shape} = args.attrs as {} as ScatterNdAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', updates.dtype), + createTensorsTypeOpAttr('Tindices', 'int32') + ]; + const shapeTensor = tensor1d(shape, 'int32'); + const ret = backend.executeSingleOutput( + ScatterNd, opAttrs, [indices, updates, shapeTensor]); + + shapeTensor.dispose(); + + return ret; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Select.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Select.ts new file mode 100644 index 000000000..72854e066 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Select.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util, KernelConfig, Select, SelectInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const selectConfig: KernelConfig = { + kernelName: Select, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {condition, t, e} = args.inputs as SelectInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(t.dtype, e.dtype))]; + return backend.executeSingleOutput(Select, opAttrs, [condition, t, e]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Selu.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Selu.ts new file mode 100644 index 000000000..5e04a1f33 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Selu.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Selu, SeluInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const seluConfig: KernelConfig = { + kernelName: Selu, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SeluInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Selu, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sigmoid.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sigmoid.ts new file mode 100644 index 000000000..9d637b340 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sigmoid.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Sigmoid, SigmoidInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const sigmoidConfig: KernelConfig = { + kernelName: Sigmoid, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SigmoidInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Sigmoid, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sign.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sign.ts new file mode 100644 index 000000000..0e99f3997 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sign.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Sign, SignInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const signConfig: KernelConfig = { + kernelName: Sign, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SignInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Sign, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sin.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sin.ts new file mode 100644 index 000000000..9fcf1ec2a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sin.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Sin, SinInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const sinConfig: KernelConfig = { + kernelName: Sin, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SinInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Sin, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sinh.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sinh.ts new file mode 100644 index 000000000..7c1386241 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sinh.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Sinh, SinhInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const sinhConfig: KernelConfig = { + kernelName: Sinh, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SinhInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Sinh, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Slice.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Slice.ts new file mode 100644 index 000000000..6060a90f1 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Slice.ts @@ -0,0 +1,48 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util, KernelConfig, Slice, SliceAttrs, SliceInputs, tensor1d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const sliceConfig: KernelConfig = { + kernelName: Slice, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SliceInputs; + const backend = args.backend as NodeJSKernelBackend; + const {begin, size} = args.attrs as {} as SliceAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + createTensorsTypeOpAttr('Index', 'int32') + ]; + + // Bind tensor values + const [begin_, size_] = + backend_util.slice_util.parseSliceParams(x, begin, size); + const beginTensor = tensor1d(begin_, 'int32'); + const sizeTensor = tensor1d(size_, 'int32'); + + const res = backend.executeSingleOutput( + Slice, opAttrs, [x, beginTensor, sizeTensor]); + beginTensor.dispose(); + sizeTensor.dispose(); + + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Softmax.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Softmax.ts new file mode 100644 index 000000000..594da3bfd --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Softmax.ts @@ -0,0 +1,37 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, NamedTensorInfoMap, TensorInfo} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +interface SoftmaxInputs extends NamedTensorInfoMap { + logits: TensorInfo; +} + +export const softmaxConfig: KernelConfig = { + kernelName: 'Softmax', + backendName: 'tensorflow', + kernelFunc: ({inputs, backend}) => { + const {logits} = inputs as SoftmaxInputs; + const opAttrs = [createTensorsTypeOpAttr('T', logits.dtype)]; + + const nodeBackend = backend as NodeJSKernelBackend; + + return nodeBackend.executeSingleOutput('Softmax', opAttrs, [logits]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Softplus.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Softplus.ts new file mode 100644 index 000000000..75110850f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Softplus.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Softplus, SoftplusInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const softplusConfig: KernelConfig = { + kernelName: Softplus, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SoftplusInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Softplus, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SpaceToBatchND.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SpaceToBatchND.ts new file mode 100644 index 000000000..0e5a8499c --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SpaceToBatchND.ts @@ -0,0 +1,46 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, SpaceToBatchND, SpaceToBatchNDAttrs, SpaceToBatchNDInputs, tensor1d, tensor2d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const spaceToBatchNDConfig: KernelConfig = { + kernelName: SpaceToBatchND, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SpaceToBatchNDInputs; + const backend = args.backend as NodeJSKernelBackend; + const {blockShape, paddings} = args.attrs as {} as SpaceToBatchNDAttrs; + + const blockShapeTensor = tensor1d(blockShape, 'int32'); + const paddingsTensor = + tensor2d(paddings, [paddings.length, paddings[0].length], 'int32'); + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + createTensorsTypeOpAttr('Tblock_shape', 'int32'), + createTensorsTypeOpAttr('Tpaddings', paddingsTensor.dtype) + ]; + const res = backend.executeSingleOutput( + SpaceToBatchND, opAttrs, [x, blockShapeTensor, paddingsTensor]); + + blockShapeTensor.dispose(); + paddingsTensor.dispose(); + + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SparseToDense.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SparseToDense.ts new file mode 100644 index 000000000..df5a6b89a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SparseToDense.ts @@ -0,0 +1,47 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, SparseToDense, SparseToDenseAttrs, SparseToDenseInputs, tensor1d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const sparseToDenseConfig: KernelConfig = { + kernelName: SparseToDense, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {sparseIndices, sparseValues, defaultValue} = + args.inputs as SparseToDenseInputs; + const backend = args.backend as NodeJSKernelBackend; + const {outputShape} = args.attrs as {} as SparseToDenseAttrs; + + const opAttrs = [ + { + name: 'validate_indices', + type: backend.binding.TF_ATTR_BOOL, + value: true + }, + createTensorsTypeOpAttr('T', sparseValues.dtype), + createTensorsTypeOpAttr('Tindices', sparseIndices.dtype) + ]; + const outputShapeTensor = tensor1d(outputShape, 'int32'); + const res = backend.executeSingleOutput( + SparseToDense, opAttrs, + [sparseIndices, outputShapeTensor, sparseValues, defaultValue]); + outputShapeTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SplitV.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SplitV.ts new file mode 100644 index 000000000..a330e84d4 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SplitV.ts @@ -0,0 +1,53 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util, KernelConfig, scalar, SplitV, SplitVAttrs, SplitVInputs, Tensor, tensor1d, tidy, util} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const splitVConfig: KernelConfig = { + kernelName: SplitV, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SplitVInputs; + const backend = args.backend as NodeJSKernelBackend; + const {numOrSizeSplits, axis} = args.attrs as {} as SplitVAttrs; + + const $axis = util.parseAxisParam(axis, x.shape)[0]; + const splitSizes = backend_util.prepareSplitSize(x, numOrSizeSplits, $axis); + + const opAttrs = [ + { + name: 'num_split', + type: backend.binding.TF_ATTR_INT, + value: splitSizes.length + }, + createTensorsTypeOpAttr('T', x as Tensor), { + name: 'Tlen', + type: backend.binding.TF_ATTR_TYPE, + value: backend.binding.TF_INT32 + } + ]; + const inputs = [x]; + return tidy(() => { + inputs.push(tensor1d(splitSizes, 'int32')); + inputs.push(scalar($axis, 'int32')); + return backend.executeMultipleOutputs( + SplitV, opAttrs, inputs, splitSizes.length); + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sqrt.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sqrt.ts new file mode 100644 index 000000000..066660511 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sqrt.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Sqrt, SqrtInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const sqrtConfig: KernelConfig = { + kernelName: Sqrt, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SqrtInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Sqrt, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Square.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Square.ts new file mode 100644 index 000000000..84524c7b1 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Square.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Square, SquareInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const squareConfig: KernelConfig = { + kernelName: Square, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SquareInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Square, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SquaredDifference.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SquaredDifference.ts new file mode 100644 index 000000000..9b5e1ed4f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SquaredDifference.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, SquaredDifference, SquaredDifferenceInputs} from '@tensorflow/tfjs'; +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const squaredDifferenceConfig: KernelConfig = { + kernelName: SquaredDifference, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as SquaredDifferenceInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr('T', a.dtype)]; + return backend.executeSingleOutput(SquaredDifference, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Step.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Step.ts new file mode 100644 index 000000000..e898fff81 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Step.ts @@ -0,0 +1,43 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util, fill, greater, isNaN as tfIsNan, KernelConfig, ones, scalar, Step, StepAttrs, StepInputs, Tensor, tidy, where} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const stepConfig: KernelConfig = { + kernelName: Step, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as StepInputs; + const backend = args.backend as NodeJSKernelBackend; + const {alpha} = args.attrs as {} as StepAttrs; + + const dtype = x.dtype; + return tidy(() => { + const nans = tfIsNan(x as Tensor); + const stepNoNans = where( + greater(x as Tensor, scalar(0, dtype)), ones(x.shape), + fill(x.shape, alpha, dtype)); + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(x.dtype, stepNoNans.dtype))]; + return backend.executeSingleOutput( + 'Select', opAttrs, [nans, x, stepNoNans]); + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/StridedSlice.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/StridedSlice.ts new file mode 100644 index 000000000..7838e42c6 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/StridedSlice.ts @@ -0,0 +1,125 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util, KernelConfig, reshape, slice, StridedSlice, StridedSliceAttrs, StridedSliceInputs, Tensor, tensor1d, tidy} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const stridedSliceConfig: KernelConfig = { + kernelName: StridedSlice, + backendName: 'tensorflow', + kernelFunc: (args) => { + let {x} = args.inputs as StridedSliceInputs; + const backend = args.backend as NodeJSKernelBackend; + const {beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask} = + args.attrs as {} as StridedSliceAttrs; + + let {begin, end, strides} = args.attrs as {} as StridedSliceAttrs; + // make a copy because it may be modified in-place further down. + begin = begin.slice(); + end = end.slice(); + if (strides == null) { + strides = new Array(begin.length); + } + + const ellipsisAxes = backend_util.slice_util.maskToAxes(ellipsisMask); + if (ellipsisAxes.length > 1) { + throw new Error('Multiple ellipses in slice is not allowed.'); + } + + if (ellipsisMask !== 0 && newAxisMask !== 0) { + throw new Error( + 'Using both ellipsisMask and newAxisMask is not yet supported.'); + } + + if (ellipsisMask !== 0 && shrinkAxisMask !== 0) { + throw new Error( + 'Using both ellipsisMask and shrinkAxisMask is not yet supported.'); + } + + return tidy(() => { + const numInterpolatedAxes = (x as Tensor).rank - begin.length; + + // Expand the dims of x based on the newAxisMask. + const expandAxes = backend_util.slice_util.maskToAxes(newAxisMask); + const newShape = x.shape.slice(); + expandAxes.forEach(axis => { + begin[axis] = 0; + end[axis] = 1; + newShape.splice(axis, 0, 1); + }); + x = reshape(x as Tensor, newShape); + + const { + begin: normalizedBegin, + end: normalizedEnd, + strides: normalizedStrides + } = + backend_util.slice_util.getNormalizedAxes( + x.shape, ellipsisAxes, numInterpolatedAxes, begin, end, strides, + beginMask, endMask, ellipsisMask); + begin = normalizedBegin; + end = normalizedEnd; + strides = normalizedStrides; + + const shrinkAxes = backend_util.slice_util.maskToAxes(shrinkAxisMask); + // Adjust the ends based on the shrink mask. + shrinkAxes.forEach(axis => { + end[axis] = begin[axis] + 1; + strides[axis] = 1; + }); + + // Figure out the output shape. + const size = backend_util.slice_util.computeOutShape(begin, end, strides); + // Remove the axes based on shrinkMask. + const outShape = + size.filter((_, axis) => shrinkAxes.indexOf(axis) === -1); + + const nonStrided = strides.every(v => v === 1); + if (nonStrided) { + return reshape(slice(x as Tensor, begin, size), outShape); + } + + const beginTensor = tensor1d(begin, 'int32'); + for (let axis = 0; axis < end.length; axis++) { + // Unlike Numpy, when the strides are negative, TF C uses -n-1 instead + // of -1 as the "end" in order to include the first element. + if (strides[axis] < 0 && end[axis] === -1) { + end[axis] -= x.shape[axis]; + } + } + const endTensor = tensor1d(end, 'int32'); + const stridesTensor = tensor1d(strides, 'int32'); + + // Because tfjs allows begin, end and strides to be of different lengths + // It has custom code (see above to handle the masking), so we do not + // pass the mask info to the tensorflow backend. + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + createTensorsTypeOpAttr('Index', 'int32'), + {name: 'begin_mask', type: backend.binding.TF_ATTR_INT, value: 0}, + {name: 'end_mask', type: backend.binding.TF_ATTR_INT, value: 0}, + {name: 'ellipsis_mask', type: backend.binding.TF_ATTR_INT, value: 0}, + {name: 'new_axis_mask', type: backend.binding.TF_ATTR_INT, value: 0}, + {name: 'shrink_axis_mask', type: backend.binding.TF_ATTR_INT, value: 0} + ]; + const res = backend.executeSingleOutput( + StridedSlice, opAttrs, [x, beginTensor, endTensor, stridesTensor]); + return reshape(res, outShape); + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sub.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sub.ts new file mode 100644 index 000000000..976b23f44 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sub.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {backend_util, KernelConfig, Sub, SubInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const subConfig: KernelConfig = { + kernelName: Sub, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as SubInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(Sub, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sum.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sum.ts new file mode 100644 index 000000000..0ca67e835 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sum.ts @@ -0,0 +1,36 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Sum, SumAttrs, SumInputs, tensor1d, util} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const sumConfig: KernelConfig = { + kernelName: Sum, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SumInputs; + const backend = args.backend as NodeJSKernelBackend; + const {axis, keepDims} = args.attrs as {} as SumAttrs; + const axes = util.parseAxisParam(axis, x.shape); + const axisTensor = tensor1d(axes, 'int32'); + const res = backend.executeSingleOutput( + Sum, backend.createReductionOpAttrs(x, keepDims), [x, axisTensor]); + axisTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Tan.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Tan.ts new file mode 100644 index 000000000..88e7542d9 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Tan.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Tan, TanInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const tanConfig: KernelConfig = { + kernelName: Tan, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as TanInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Tan, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Tanh.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Tanh.ts new file mode 100644 index 000000000..cde564a58 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Tanh.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Tanh, TanhInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const tanhConfig: KernelConfig = { + kernelName: Tanh, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as TanhInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Tanh, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Tile.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Tile.ts new file mode 100644 index 000000000..fdf4d12f0 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Tile.ts @@ -0,0 +1,39 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, tensor1d, Tile, TileAttrs, TileInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const tileConfig: KernelConfig = { + kernelName: Tile, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as TileInputs; + const backend = args.backend as NodeJSKernelBackend; + const {reps} = args.attrs as {} as TileAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + createTensorsTypeOpAttr('Tmultiples', 'int32') + ]; + const multiples = tensor1d(reps, 'int32'); + const res = backend.executeSingleOutput(Tile, opAttrs, [x, multiples]); + multiples.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/TopK.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/TopK.ts new file mode 100644 index 000000000..72c18fe62 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/TopK.ts @@ -0,0 +1,46 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, scalar, TopK, TopKAttrs, TopKInputs} from '@tensorflow/tfjs'; +import {isNullOrUndefined} from 'util'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const topKConfig: KernelConfig = { + kernelName: TopK, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as TopKInputs; + const backend = args.backend as NodeJSKernelBackend; + const {k, sorted} = args.attrs as {} as TopKAttrs; + + const kCount = isNullOrUndefined(k) ? 1 : k; + const isSorted = isNullOrUndefined(sorted) ? true : sorted; + const opAttrs = [ + {name: 'sorted', type: backend.binding.TF_ATTR_BOOL, value: isSorted}, + createTensorsTypeOpAttr('T', x.dtype), + ]; + const kTensor = scalar(kCount, 'int32'); + + // 'TopKV2' has two-hard coded output attributes: + // TODO(yassogba) consider renamine constant in kernel names; + const res = + backend.executeMultipleOutputs('TopKV2', opAttrs, [x, kTensor], 2); + kTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Transpose.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Transpose.ts new file mode 100644 index 000000000..156be4d2d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Transpose.ts @@ -0,0 +1,40 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, tensor1d, Transpose, TransposeAttrs, TransposeInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const transposeConfig: KernelConfig = { + kernelName: Transpose, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as TransposeInputs; + const backend = args.backend as NodeJSKernelBackend; + const {perm} = args.attrs as {} as TransposeAttrs; + + const permTensor = tensor1d(perm, 'int32'); + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + createTensorsTypeOpAttr('Tperm', 'int32') + ]; + const res = + backend.executeSingleOutput(Transpose, opAttrs, [x, permTensor]); + permTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Unpack.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Unpack.ts new file mode 100644 index 000000000..a7e7c929f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Unpack.ts @@ -0,0 +1,46 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, Unpack, UnpackAttrs, UnpackInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const unpackConfig: KernelConfig = { + kernelName: Unpack, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {value} = args.inputs as UnpackInputs; + const backend = args.backend as NodeJSKernelBackend; + let {axis} = args.attrs as {} as UnpackAttrs; + + if (axis < 0) { + axis += value.shape.length; + } + + if (axis >= value.shape.length) { + throw new Error( + `Invalid axis supplied: ${axis} shape length: ${value.shape.length}`); + } + const num = value.shape[axis]; + const opAttrs = [ + {name: 'num', type: backend.binding.TF_ATTR_INT, value: num}, + createTensorsTypeOpAttr('T', value.dtype), + {name: 'axis', type: backend.binding.TF_ATTR_INT, value: axis} + ]; + return backend.executeMultipleOutputs(Unpack, opAttrs, [value], num); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/UnsortedSegmentSum.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/UnsortedSegmentSum.ts new file mode 100644 index 000000000..39969a666 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/UnsortedSegmentSum.ts @@ -0,0 +1,41 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, scalar, UnsortedSegmentSum, UnsortedSegmentSumAttrs, UnsortedSegmentSumInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const unsortedSegmentSumConfig: KernelConfig = { + kernelName: UnsortedSegmentSum, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x, segmentIds} = args.inputs as UnsortedSegmentSumInputs; + const backend = args.backend as NodeJSKernelBackend; + const {numSegments} = args.attrs as {} as UnsortedSegmentSumAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + createTensorsTypeOpAttr('Tindices', 'int32'), + createTensorsTypeOpAttr('Tnumsegments', 'int32') + ]; + const numSegmentsT = scalar(numSegments, 'int32'); + const res = backend.executeSingleOutput( + UnsortedSegmentSum, opAttrs, [x, segmentIds, numSegmentsT]); + numSegmentsT.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ZerosLike.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ZerosLike.ts new file mode 100644 index 000000000..e1c26144b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ZerosLike.ts @@ -0,0 +1,35 @@ +/** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {KernelConfig, ZerosLike, ZerosLikeInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const zerosLikeConfig: KernelConfig = { + kernelName: ZerosLike, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as ZerosLikeInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [{ + name: 'T', + type: backend.binding.TF_ATTR_TYPE, + value: backend.getDTypeInteger(x.dtype) + }]; + return backend.executeSingleOutput(ZerosLike, opAttrs, [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/proto/api.proto b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/proto/api.proto new file mode 100644 index 000000000..9bbf35ca6 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/proto/api.proto @@ -0,0 +1,360 @@ +// api.proto +// Definition of various TensorFlow protobuf messages for use with the TensorFlow API. +// +// Assembled from these relevant proto sources: +// https://github.com/google/protobuf/blob/master/src/google/protobuf/any.proto +// https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/types.proto +// https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/tensor.proto +// https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/tensor_shape.proto +// https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/attr_value.proto +// https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/versions.proto +// https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/graph.proto +// https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/node_def.proto +// https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/op_def.proto +// https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/protobuf/saver.proto +// https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/protobuf/meta_graph.proto +// https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/protobuf/saved_model.proto +// https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/function.proto + + +// This file is used to generate the api_pb.js file with the JavaScript Protocol +// Buffers runtime library (https://github.com/protocolbuffers/protobuf/tree/master/js). +// The protocol compiler (https://github.com/protocolbuffers/protobuf/releases) +// translated this file (same as proto file in tfjs-converter: +// https://github.com/tensorflow/tfjs/blob/master/tfjs-converter/src/data/api.proto) +// into the api_pb.js file with command: +// +// ``` +// $ protoc --js_out=import_style=commonjs,binary:. api.proto +// ``` + + +syntax = "proto3"; +package tensorflow; + +message Any { + string type_url = 1; + bytes value = 2; +} + +enum DataType { + // Not a legal value for DataType. Used to indicate a DataType field + // has not been set. + DT_INVALID = 0; + + // Data types that all computation devices are expected to be + // capable to support. + DT_FLOAT = 1; + DT_DOUBLE = 2; + DT_INT32 = 3; + DT_UINT8 = 4; + DT_INT16 = 5; + DT_INT8 = 6; + DT_STRING = 7; + DT_COMPLEX64 = 8; // Single-precision complex + DT_INT64 = 9; + DT_BOOL = 10; + DT_QINT8 = 11; // Quantized int8 + DT_QUINT8 = 12; // Quantized uint8 + DT_QINT32 = 13; // Quantized int32 + DT_BFLOAT16 = 14; // Float32 truncated to 16 bits. Only for cast ops. + + // Do not use! These are only for parameters. Every enum above + // should have a corresponding value below (verified by types_test). + DT_FLOAT_REF = 101; + DT_DOUBLE_REF = 102; + DT_INT32_REF = 103; + DT_UINT8_REF = 104; + DT_INT16_REF = 105; + DT_INT8_REF = 106; + DT_STRING_REF = 107; + DT_COMPLEX64_REF = 108; + DT_INT64_REF = 109; + DT_BOOL_REF = 110; + DT_QINT8_REF = 111; + DT_QUINT8_REF = 112; + DT_QINT32_REF = 113; + DT_BFLOAT16_REF = 114; +} + +message TensorShape { + // One dimension of the tensor. + message Dim { + // Size of the tensor in that dimension. + int64 size = 1; + + // Optional name of the tensor dimension. + string name = 2; + } + + // Dimensions of the tensor, such as {"input", 30}, {"output", 40} for a 30 x + // 40 2D tensor. The names are optional. + // + // The order of entries in "dim" matters: It indicates the layout of the + // values in the tensor in-memory representation. + // + // The first entry in "dim" is the outermost dimension used to layout the + // values, the last entry is the innermost dimension. This matches the + // in-memory layout of RowMajor Eigen tensors. + repeated Dim dim = 2; + + bool unknown_rank = 3; +} + +message Tensor { + DataType dtype = 1; + + // Shape of the tensor. TODO(touts): sort out the 0-rank issues. + TensorShape tensor_shape = 2; + + // Only one of the representations below is set, one of "tensor_contents" and + // the "xxx_val" attributes. We are not using oneof because as oneofs cannot + // contain repeated fields it would require another extra set of messages. + + // Version number. + // + // In version 0, if the "repeated xxx" representations contain only one + // element, that element is repeated to fill the shape. This makes it easy + // to represent a constant Tensor with a single value. + int32 version_number = 3; + + // Serialized content from TensorBase::Serialize() This representation can be + // used for all tensor types. + bytes tensor_content = 4; + + // Type specific representations that make it easy to create tensor protos in + // all languages. Only the representation corresponding to "dtype" can + // be set. The values hold the flattened representation of the tensor in + // row major order. + + // DT_FLOAT. + repeated float float_val = 5 [packed = true]; + + // DT_DOUBLE. + repeated double double_val = 6 [packed = true]; + + // DT_INT32, DT_INT16, DT_INT8, DT_UINT8. + repeated int32 int_val = 7 [packed = true]; + + // DT_STRING + repeated bytes string_val = 8; + + // DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real + // and imaginary parts of i-th single precision complex. + repeated float scomplex_val = 9 [packed = true]; + + // DT_INT64 + repeated int64 int64_val = 10 [packed = true]; + + // DT_BOOL + repeated bool bool_val = 11 [packed = true]; + + // DT_UINT32 + repeated uint32 uint32_val = 16 [packed = true]; + + // DT_UINT64 + repeated uint64 uint64_val = 17 [packed = true]; +} + +message AttrValue { + message ListValue { + repeated bytes s = 2; + repeated int64 i = 3 [packed = true]; + repeated float f = 4 [packed = true]; + repeated bool b = 5 [packed = true]; + repeated DataType type = 6 [packed = true]; + repeated TensorShape shape = 7; + repeated Tensor tensor = 8; + repeated NameAttrList func = 9; + } + + oneof value { + ListValue list = 1; + bytes s = 2; + int64 i = 3; + float f = 4; + bool b = 5; + DataType type = 6; + TensorShape shape = 7; + Tensor tensor = 8; + string placeholder = 9; + NameAttrList func = 10; + } +} + +message NameAttrList { + string name = 1; + map attr = 2; +} + +message NodeDef { + string name = 1; + string op = 2; + repeated string input = 3; + string device = 4; + map attr = 5; +} + +message VersionDef { + int32 producer = 1; + int32 min_consumer = 2; + repeated int32 bad_consumers = 3; +} + +message GraphDef { + repeated NodeDef node = 1; + VersionDef versions = 4; + FunctionDefLibrary library = 2; +} + +message CollectionDef { + message NodeList { + repeated string value = 1; + } + message BytesList { + repeated bytes value = 1; + } + message Int64List { + repeated int64 value = 1 [packed = true]; + } + message FloatList { + repeated float value = 1 [packed = true]; + } + message AnyList { + repeated Any value = 1; + } + + oneof kind { + NodeList node_list = 1; + BytesList bytes_list = 2; + Int64List int64_list = 3; + FloatList float_list = 4; + AnyList any_list = 5; + } +} + +message SaverDef { + string filename_tensor_name = 1; + string save_tensor_name = 2; + string restore_op_name = 3; + int32 max_to_keep = 4; + bool sharded = 5; + float keep_checkpoint_every_n_hours = 6; + + enum CheckpointFormatVersion { + LEGACY = 0; + V1 = 1; + V2 = 2; + } + CheckpointFormatVersion version = 7; +} + +message TensorInfo { + message CooSparse { + string values_tensor_name = 1; + string indices_tensor_name = 2; + string dense_shape_tensor_name = 3; + } + + oneof encoding { + string name = 1; + CooSparse coo_sparse = 4; + } + DataType dtype = 2; + TensorShape tensor_shape = 3; +} + +message SignatureDef { + map inputs = 1; + map outputs = 2; + string method_name = 3; +} + +message AssetFileDef { + TensorInfo tensor_info = 1; + string filename = 2; +} + +message OpDef { + string name = 1; + + message ArgDef { + string name = 1; + string description = 2; + DataType type = 3; + string type_attr = 4; // if specified, attr must have type "type" + string number_attr = 5; // if specified, attr must have type "int" + string type_list_attr = 6; + bool is_ref = 16; + } + repeated ArgDef input_arg = 2; + repeated ArgDef output_arg = 3; + + message AttrDef { + string name = 1; + string type = 2; + AttrValue default_value = 3; + string description = 4; + bool has_minimum = 5; + int64 minimum = 6; + AttrValue allowed_values = 7; + } + repeated AttrDef attr = 4; + + message OpDeprecation { + int32 version = 1; + string explanation = 2; + } + OpDeprecation deprecation = 8; + + string summary = 5; + string description = 6; + bool is_commutative = 18; + bool is_aggregate = 16; // for things like add + bool is_stateful = 17; // for things like variables, queue + bool allows_uninitialized_input = 19; // for Assign, etc. +} + +message OpList { + repeated OpDef op = 1; +} + +message MetaGraphDef { + message MetaInfoDef { + string meta_graph_version = 1; + OpList stripped_op_list = 2; + Any any_info = 3; + repeated string tags = 4; + string tensorflow_version = 5; + string tensorflow_git_version = 6; + } + MetaInfoDef meta_info_def = 1; + GraphDef graph_def = 2; + SaverDef saver_def = 3; + map collection_def = 4; + map signature_def = 5; + repeated AssetFileDef asset_file_def = 6; +} + +message SavedModel { + int64 saved_model_schema_version = 1; + repeated MetaGraphDef meta_graphs = 2; +} + +message FunctionDefLibrary { + repeated FunctionDef function = 1; + repeated GradientDef gradient = 2; +} + +message FunctionDef { + OpDef signature = 1; + map attr = 5; + reserved 2; + repeated NodeDef node_def = 3; + map ret = 4; +} + +message GradientDef { + string function_name = 1; // The function name. + string gradient_func = 2; // The gradient function's name. +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/proto/api_pb.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/proto/api_pb.js new file mode 100644 index 000000000..7088a13a2 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/proto/api_pb.js @@ -0,0 +1,9136 @@ +// source: api.proto +/** + * @fileoverview + * @enhanceable + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +goog.exportSymbol('proto.tensorflow.Any', null, global); +goog.exportSymbol('proto.tensorflow.AssetFileDef', null, global); +goog.exportSymbol('proto.tensorflow.AttrValue', null, global); +goog.exportSymbol('proto.tensorflow.AttrValue.ListValue', null, global); +goog.exportSymbol('proto.tensorflow.AttrValue.ValueCase', null, global); +goog.exportSymbol('proto.tensorflow.CollectionDef', null, global); +goog.exportSymbol('proto.tensorflow.CollectionDef.AnyList', null, global); +goog.exportSymbol('proto.tensorflow.CollectionDef.BytesList', null, global); +goog.exportSymbol('proto.tensorflow.CollectionDef.FloatList', null, global); +goog.exportSymbol('proto.tensorflow.CollectionDef.Int64List', null, global); +goog.exportSymbol('proto.tensorflow.CollectionDef.KindCase', null, global); +goog.exportSymbol('proto.tensorflow.CollectionDef.NodeList', null, global); +goog.exportSymbol('proto.tensorflow.DataType', null, global); +goog.exportSymbol('proto.tensorflow.FunctionDef', null, global); +goog.exportSymbol('proto.tensorflow.FunctionDefLibrary', null, global); +goog.exportSymbol('proto.tensorflow.GradientDef', null, global); +goog.exportSymbol('proto.tensorflow.GraphDef', null, global); +goog.exportSymbol('proto.tensorflow.MetaGraphDef', null, global); +goog.exportSymbol('proto.tensorflow.MetaGraphDef.MetaInfoDef', null, global); +goog.exportSymbol('proto.tensorflow.NameAttrList', null, global); +goog.exportSymbol('proto.tensorflow.NodeDef', null, global); +goog.exportSymbol('proto.tensorflow.OpDef', null, global); +goog.exportSymbol('proto.tensorflow.OpDef.ArgDef', null, global); +goog.exportSymbol('proto.tensorflow.OpDef.AttrDef', null, global); +goog.exportSymbol('proto.tensorflow.OpDef.OpDeprecation', null, global); +goog.exportSymbol('proto.tensorflow.OpList', null, global); +goog.exportSymbol('proto.tensorflow.SavedModel', null, global); +goog.exportSymbol('proto.tensorflow.SaverDef', null, global); +goog.exportSymbol('proto.tensorflow.SaverDef.CheckpointFormatVersion', null, global); +goog.exportSymbol('proto.tensorflow.SignatureDef', null, global); +goog.exportSymbol('proto.tensorflow.Tensor', null, global); +goog.exportSymbol('proto.tensorflow.TensorInfo', null, global); +goog.exportSymbol('proto.tensorflow.TensorInfo.CooSparse', null, global); +goog.exportSymbol('proto.tensorflow.TensorInfo.EncodingCase', null, global); +goog.exportSymbol('proto.tensorflow.TensorShape', null, global); +goog.exportSymbol('proto.tensorflow.TensorShape.Dim', null, global); +goog.exportSymbol('proto.tensorflow.VersionDef', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.Any = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.tensorflow.Any, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.Any.displayName = 'proto.tensorflow.Any'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.TensorShape = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.TensorShape.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.TensorShape, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.TensorShape.displayName = 'proto.tensorflow.TensorShape'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.TensorShape.Dim = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.tensorflow.TensorShape.Dim, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.TensorShape.Dim.displayName = 'proto.tensorflow.TensorShape.Dim'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.Tensor = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.Tensor.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.Tensor, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.Tensor.displayName = 'proto.tensorflow.Tensor'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.AttrValue = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.tensorflow.AttrValue.oneofGroups_); +}; +goog.inherits(proto.tensorflow.AttrValue, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.AttrValue.displayName = 'proto.tensorflow.AttrValue'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.AttrValue.ListValue = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.AttrValue.ListValue.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.AttrValue.ListValue, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.AttrValue.ListValue.displayName = 'proto.tensorflow.AttrValue.ListValue'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.NameAttrList = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.tensorflow.NameAttrList, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.NameAttrList.displayName = 'proto.tensorflow.NameAttrList'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.NodeDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.NodeDef.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.NodeDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.NodeDef.displayName = 'proto.tensorflow.NodeDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.VersionDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.VersionDef.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.VersionDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.VersionDef.displayName = 'proto.tensorflow.VersionDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.GraphDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.GraphDef.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.GraphDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.GraphDef.displayName = 'proto.tensorflow.GraphDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.CollectionDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.tensorflow.CollectionDef.oneofGroups_); +}; +goog.inherits(proto.tensorflow.CollectionDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.CollectionDef.displayName = 'proto.tensorflow.CollectionDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.CollectionDef.NodeList = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.CollectionDef.NodeList.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.CollectionDef.NodeList, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.CollectionDef.NodeList.displayName = 'proto.tensorflow.CollectionDef.NodeList'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.CollectionDef.BytesList = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.CollectionDef.BytesList.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.CollectionDef.BytesList, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.CollectionDef.BytesList.displayName = 'proto.tensorflow.CollectionDef.BytesList'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.CollectionDef.Int64List = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.CollectionDef.Int64List.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.CollectionDef.Int64List, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.CollectionDef.Int64List.displayName = 'proto.tensorflow.CollectionDef.Int64List'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.CollectionDef.FloatList = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.CollectionDef.FloatList.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.CollectionDef.FloatList, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.CollectionDef.FloatList.displayName = 'proto.tensorflow.CollectionDef.FloatList'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.CollectionDef.AnyList = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.CollectionDef.AnyList.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.CollectionDef.AnyList, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.CollectionDef.AnyList.displayName = 'proto.tensorflow.CollectionDef.AnyList'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.SaverDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.tensorflow.SaverDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.SaverDef.displayName = 'proto.tensorflow.SaverDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.TensorInfo = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.tensorflow.TensorInfo.oneofGroups_); +}; +goog.inherits(proto.tensorflow.TensorInfo, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.TensorInfo.displayName = 'proto.tensorflow.TensorInfo'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.TensorInfo.CooSparse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.tensorflow.TensorInfo.CooSparse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.TensorInfo.CooSparse.displayName = 'proto.tensorflow.TensorInfo.CooSparse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.SignatureDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.tensorflow.SignatureDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.SignatureDef.displayName = 'proto.tensorflow.SignatureDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.AssetFileDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.tensorflow.AssetFileDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.AssetFileDef.displayName = 'proto.tensorflow.AssetFileDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.OpDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.OpDef.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.OpDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.OpDef.displayName = 'proto.tensorflow.OpDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.OpDef.ArgDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.tensorflow.OpDef.ArgDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.OpDef.ArgDef.displayName = 'proto.tensorflow.OpDef.ArgDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.OpDef.AttrDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.tensorflow.OpDef.AttrDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.OpDef.AttrDef.displayName = 'proto.tensorflow.OpDef.AttrDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.OpDef.OpDeprecation = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.tensorflow.OpDef.OpDeprecation, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.OpDef.OpDeprecation.displayName = 'proto.tensorflow.OpDef.OpDeprecation'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.OpList = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.OpList.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.OpList, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.OpList.displayName = 'proto.tensorflow.OpList'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.MetaGraphDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.MetaGraphDef.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.MetaGraphDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.MetaGraphDef.displayName = 'proto.tensorflow.MetaGraphDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.MetaGraphDef.MetaInfoDef.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.MetaGraphDef.MetaInfoDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.MetaGraphDef.MetaInfoDef.displayName = 'proto.tensorflow.MetaGraphDef.MetaInfoDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.SavedModel = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.SavedModel.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.SavedModel, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.SavedModel.displayName = 'proto.tensorflow.SavedModel'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.FunctionDefLibrary = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.FunctionDefLibrary.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.FunctionDefLibrary, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.FunctionDefLibrary.displayName = 'proto.tensorflow.FunctionDefLibrary'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.FunctionDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.FunctionDef.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.FunctionDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.FunctionDef.displayName = 'proto.tensorflow.FunctionDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.GradientDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.tensorflow.GradientDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.GradientDef.displayName = 'proto.tensorflow.GradientDef'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.Any.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.Any.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.Any} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.Any.toObject = function(includeInstance, msg) { + var f, obj = { + typeUrl: jspb.Message.getFieldWithDefault(msg, 1, ""), + value: msg.getValue_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.Any} + */ +proto.tensorflow.Any.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.Any; + return proto.tensorflow.Any.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.Any} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.Any} + */ +proto.tensorflow.Any.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setTypeUrl(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.Any.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.Any.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.Any} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.Any.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTypeUrl(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getValue_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional string type_url = 1; + * @return {string} + */ +proto.tensorflow.Any.prototype.getTypeUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.Any.prototype.setTypeUrl = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional bytes value = 2; + * @return {!(string|Uint8Array)} + */ +proto.tensorflow.Any.prototype.getValue = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes value = 2; + * This is a type-conversion wrapper around `getValue()` + * @return {string} + */ +proto.tensorflow.Any.prototype.getValue_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getValue())); +}; + + +/** + * optional bytes value = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getValue()` + * @return {!Uint8Array} + */ +proto.tensorflow.Any.prototype.getValue_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getValue())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.tensorflow.Any.prototype.setValue = function(value) { + jspb.Message.setProto3BytesField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.TensorShape.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.TensorShape.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.TensorShape.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.TensorShape} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.TensorShape.toObject = function(includeInstance, msg) { + var f, obj = { + dimList: jspb.Message.toObjectList(msg.getDimList(), + proto.tensorflow.TensorShape.Dim.toObject, includeInstance), + unknownRank: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.TensorShape} + */ +proto.tensorflow.TensorShape.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.TensorShape; + return proto.tensorflow.TensorShape.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.TensorShape} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.TensorShape} + */ +proto.tensorflow.TensorShape.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 2: + var value = new proto.tensorflow.TensorShape.Dim; + reader.readMessage(value,proto.tensorflow.TensorShape.Dim.deserializeBinaryFromReader); + msg.addDim(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setUnknownRank(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.TensorShape.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.TensorShape.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.TensorShape} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.TensorShape.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDimList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.tensorflow.TensorShape.Dim.serializeBinaryToWriter + ); + } + f = message.getUnknownRank(); + if (f) { + writer.writeBool( + 3, + f + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.TensorShape.Dim.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.TensorShape.Dim.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.TensorShape.Dim} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.TensorShape.Dim.toObject = function(includeInstance, msg) { + var f, obj = { + size: jspb.Message.getFieldWithDefault(msg, 1, 0), + name: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.TensorShape.Dim} + */ +proto.tensorflow.TensorShape.Dim.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.TensorShape.Dim; + return proto.tensorflow.TensorShape.Dim.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.TensorShape.Dim} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.TensorShape.Dim} + */ +proto.tensorflow.TensorShape.Dim.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setSize(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.TensorShape.Dim.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.TensorShape.Dim.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.TensorShape.Dim} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.TensorShape.Dim.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSize(); + if (f !== 0) { + writer.writeInt64( + 1, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional int64 size = 1; + * @return {number} + */ +proto.tensorflow.TensorShape.Dim.prototype.getSize = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.tensorflow.TensorShape.Dim.prototype.setSize = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.tensorflow.TensorShape.Dim.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.TensorShape.Dim.prototype.setName = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * repeated Dim dim = 2; + * @return {!Array} + */ +proto.tensorflow.TensorShape.prototype.getDimList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.TensorShape.Dim, 2)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.TensorShape.prototype.setDimList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.tensorflow.TensorShape.Dim=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.TensorShape.Dim} + */ +proto.tensorflow.TensorShape.prototype.addDim = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.tensorflow.TensorShape.Dim, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.TensorShape.prototype.clearDimList = function() { + this.setDimList([]); +}; + + +/** + * optional bool unknown_rank = 3; + * @return {boolean} + */ +proto.tensorflow.TensorShape.prototype.getUnknownRank = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); +}; + + +/** @param {boolean} value */ +proto.tensorflow.TensorShape.prototype.setUnknownRank = function(value) { + jspb.Message.setProto3BooleanField(this, 3, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.Tensor.repeatedFields_ = [5,6,7,8,9,10,11,16,17]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.Tensor.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.Tensor.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.Tensor} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.Tensor.toObject = function(includeInstance, msg) { + var f, obj = { + dtype: jspb.Message.getFieldWithDefault(msg, 1, 0), + tensorShape: (f = msg.getTensorShape()) && proto.tensorflow.TensorShape.toObject(includeInstance, f), + versionNumber: jspb.Message.getFieldWithDefault(msg, 3, 0), + tensorContent: msg.getTensorContent_asB64(), + floatValList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 5)) == null ? undefined : f, + doubleValList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 6)) == null ? undefined : f, + intValList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : f, + stringValList: msg.getStringValList_asB64(), + scomplexValList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 9)) == null ? undefined : f, + int64ValList: (f = jspb.Message.getRepeatedField(msg, 10)) == null ? undefined : f, + boolValList: (f = jspb.Message.getRepeatedBooleanField(msg, 11)) == null ? undefined : f, + uint32ValList: (f = jspb.Message.getRepeatedField(msg, 16)) == null ? undefined : f, + uint64ValList: (f = jspb.Message.getRepeatedField(msg, 17)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.Tensor} + */ +proto.tensorflow.Tensor.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.Tensor; + return proto.tensorflow.Tensor.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.Tensor} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.Tensor} + */ +proto.tensorflow.Tensor.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.tensorflow.DataType} */ (reader.readEnum()); + msg.setDtype(value); + break; + case 2: + var value = new proto.tensorflow.TensorShape; + reader.readMessage(value,proto.tensorflow.TensorShape.deserializeBinaryFromReader); + msg.setTensorShape(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt32()); + msg.setVersionNumber(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setTensorContent(value); + break; + case 5: + var value = /** @type {!Array} */ (reader.readPackedFloat()); + msg.setFloatValList(value); + break; + case 6: + var value = /** @type {!Array} */ (reader.readPackedDouble()); + msg.setDoubleValList(value); + break; + case 7: + var value = /** @type {!Array} */ (reader.readPackedInt32()); + msg.setIntValList(value); + break; + case 8: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addStringVal(value); + break; + case 9: + var value = /** @type {!Array} */ (reader.readPackedFloat()); + msg.setScomplexValList(value); + break; + case 10: + var value = /** @type {!Array} */ (reader.readPackedInt64()); + msg.setInt64ValList(value); + break; + case 11: + var value = /** @type {!Array} */ (reader.readPackedBool()); + msg.setBoolValList(value); + break; + case 16: + var value = /** @type {!Array} */ (reader.readPackedUint32()); + msg.setUint32ValList(value); + break; + case 17: + var value = /** @type {!Array} */ (reader.readPackedUint64()); + msg.setUint64ValList(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.Tensor.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.Tensor.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.Tensor} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.Tensor.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDtype(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getTensorShape(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.tensorflow.TensorShape.serializeBinaryToWriter + ); + } + f = message.getVersionNumber(); + if (f !== 0) { + writer.writeInt32( + 3, + f + ); + } + f = message.getTensorContent_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, + f + ); + } + f = message.getFloatValList(); + if (f.length > 0) { + writer.writePackedFloat( + 5, + f + ); + } + f = message.getDoubleValList(); + if (f.length > 0) { + writer.writePackedDouble( + 6, + f + ); + } + f = message.getIntValList(); + if (f.length > 0) { + writer.writePackedInt32( + 7, + f + ); + } + f = message.getStringValList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 8, + f + ); + } + f = message.getScomplexValList(); + if (f.length > 0) { + writer.writePackedFloat( + 9, + f + ); + } + f = message.getInt64ValList(); + if (f.length > 0) { + writer.writePackedInt64( + 10, + f + ); + } + f = message.getBoolValList(); + if (f.length > 0) { + writer.writePackedBool( + 11, + f + ); + } + f = message.getUint32ValList(); + if (f.length > 0) { + writer.writePackedUint32( + 16, + f + ); + } + f = message.getUint64ValList(); + if (f.length > 0) { + writer.writePackedUint64( + 17, + f + ); + } +}; + + +/** + * optional DataType dtype = 1; + * @return {!proto.tensorflow.DataType} + */ +proto.tensorflow.Tensor.prototype.getDtype = function() { + return /** @type {!proto.tensorflow.DataType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {!proto.tensorflow.DataType} value */ +proto.tensorflow.Tensor.prototype.setDtype = function(value) { + jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional TensorShape tensor_shape = 2; + * @return {?proto.tensorflow.TensorShape} + */ +proto.tensorflow.Tensor.prototype.getTensorShape = function() { + return /** @type{?proto.tensorflow.TensorShape} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.TensorShape, 2)); +}; + + +/** @param {?proto.tensorflow.TensorShape|undefined} value */ +proto.tensorflow.Tensor.prototype.setTensorShape = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.Tensor.prototype.clearTensorShape = function() { + this.setTensorShape(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.Tensor.prototype.hasTensorShape = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional int32 version_number = 3; + * @return {number} + */ +proto.tensorflow.Tensor.prototype.getVersionNumber = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {number} value */ +proto.tensorflow.Tensor.prototype.setVersionNumber = function(value) { + jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional bytes tensor_content = 4; + * @return {!(string|Uint8Array)} + */ +proto.tensorflow.Tensor.prototype.getTensorContent = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * optional bytes tensor_content = 4; + * This is a type-conversion wrapper around `getTensorContent()` + * @return {string} + */ +proto.tensorflow.Tensor.prototype.getTensorContent_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getTensorContent())); +}; + + +/** + * optional bytes tensor_content = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getTensorContent()` + * @return {!Uint8Array} + */ +proto.tensorflow.Tensor.prototype.getTensorContent_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getTensorContent())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.tensorflow.Tensor.prototype.setTensorContent = function(value) { + jspb.Message.setProto3BytesField(this, 4, value); +}; + + +/** + * repeated float float_val = 5; + * @return {!Array} + */ +proto.tensorflow.Tensor.prototype.getFloatValList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 5)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.Tensor.prototype.setFloatValList = function(value) { + jspb.Message.setField(this, 5, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.Tensor.prototype.addFloatVal = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 5, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.Tensor.prototype.clearFloatValList = function() { + this.setFloatValList([]); +}; + + +/** + * repeated double double_val = 6; + * @return {!Array} + */ +proto.tensorflow.Tensor.prototype.getDoubleValList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 6)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.Tensor.prototype.setDoubleValList = function(value) { + jspb.Message.setField(this, 6, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.Tensor.prototype.addDoubleVal = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 6, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.Tensor.prototype.clearDoubleValList = function() { + this.setDoubleValList([]); +}; + + +/** + * repeated int32 int_val = 7; + * @return {!Array} + */ +proto.tensorflow.Tensor.prototype.getIntValList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.Tensor.prototype.setIntValList = function(value) { + jspb.Message.setField(this, 7, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.Tensor.prototype.addIntVal = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 7, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.Tensor.prototype.clearIntValList = function() { + this.setIntValList([]); +}; + + +/** + * repeated bytes string_val = 8; + * @return {!(Array|Array)} + */ +proto.tensorflow.Tensor.prototype.getStringValList = function() { + return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 8)); +}; + + +/** + * repeated bytes string_val = 8; + * This is a type-conversion wrapper around `getStringValList()` + * @return {!Array} + */ +proto.tensorflow.Tensor.prototype.getStringValList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getStringValList())); +}; + + +/** + * repeated bytes string_val = 8; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getStringValList()` + * @return {!Array} + */ +proto.tensorflow.Tensor.prototype.getStringValList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getStringValList())); +}; + + +/** @param {!(Array|Array)} value */ +proto.tensorflow.Tensor.prototype.setStringValList = function(value) { + jspb.Message.setField(this, 8, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + */ +proto.tensorflow.Tensor.prototype.addStringVal = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 8, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.Tensor.prototype.clearStringValList = function() { + this.setStringValList([]); +}; + + +/** + * repeated float scomplex_val = 9; + * @return {!Array} + */ +proto.tensorflow.Tensor.prototype.getScomplexValList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 9)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.Tensor.prototype.setScomplexValList = function(value) { + jspb.Message.setField(this, 9, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.Tensor.prototype.addScomplexVal = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 9, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.Tensor.prototype.clearScomplexValList = function() { + this.setScomplexValList([]); +}; + + +/** + * repeated int64 int64_val = 10; + * @return {!Array} + */ +proto.tensorflow.Tensor.prototype.getInt64ValList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 10)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.Tensor.prototype.setInt64ValList = function(value) { + jspb.Message.setField(this, 10, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.Tensor.prototype.addInt64Val = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 10, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.Tensor.prototype.clearInt64ValList = function() { + this.setInt64ValList([]); +}; + + +/** + * repeated bool bool_val = 11; + * @return {!Array} + */ +proto.tensorflow.Tensor.prototype.getBoolValList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedBooleanField(this, 11)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.Tensor.prototype.setBoolValList = function(value) { + jspb.Message.setField(this, 11, value || []); +}; + + +/** + * @param {boolean} value + * @param {number=} opt_index + */ +proto.tensorflow.Tensor.prototype.addBoolVal = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 11, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.Tensor.prototype.clearBoolValList = function() { + this.setBoolValList([]); +}; + + +/** + * repeated uint32 uint32_val = 16; + * @return {!Array} + */ +proto.tensorflow.Tensor.prototype.getUint32ValList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 16)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.Tensor.prototype.setUint32ValList = function(value) { + jspb.Message.setField(this, 16, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.Tensor.prototype.addUint32Val = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 16, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.Tensor.prototype.clearUint32ValList = function() { + this.setUint32ValList([]); +}; + + +/** + * repeated uint64 uint64_val = 17; + * @return {!Array} + */ +proto.tensorflow.Tensor.prototype.getUint64ValList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 17)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.Tensor.prototype.setUint64ValList = function(value) { + jspb.Message.setField(this, 17, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.Tensor.prototype.addUint64Val = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 17, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.Tensor.prototype.clearUint64ValList = function() { + this.setUint64ValList([]); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.tensorflow.AttrValue.oneofGroups_ = [[1,2,3,4,5,6,7,8,9,10]]; + +/** + * @enum {number} + */ +proto.tensorflow.AttrValue.ValueCase = { + VALUE_NOT_SET: 0, + LIST: 1, + S: 2, + I: 3, + F: 4, + B: 5, + TYPE: 6, + SHAPE: 7, + TENSOR: 8, + PLACEHOLDER: 9, + FUNC: 10 +}; + +/** + * @return {proto.tensorflow.AttrValue.ValueCase} + */ +proto.tensorflow.AttrValue.prototype.getValueCase = function() { + return /** @type {proto.tensorflow.AttrValue.ValueCase} */(jspb.Message.computeOneofCase(this, proto.tensorflow.AttrValue.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.AttrValue.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.AttrValue.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.AttrValue} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.AttrValue.toObject = function(includeInstance, msg) { + var f, obj = { + list: (f = msg.getList()) && proto.tensorflow.AttrValue.ListValue.toObject(includeInstance, f), + s: msg.getS_asB64(), + i: jspb.Message.getFieldWithDefault(msg, 3, 0), + f: jspb.Message.getFloatingPointFieldWithDefault(msg, 4, 0.0), + b: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), + type: jspb.Message.getFieldWithDefault(msg, 6, 0), + shape: (f = msg.getShape()) && proto.tensorflow.TensorShape.toObject(includeInstance, f), + tensor: (f = msg.getTensor()) && proto.tensorflow.Tensor.toObject(includeInstance, f), + placeholder: jspb.Message.getFieldWithDefault(msg, 9, ""), + func: (f = msg.getFunc()) && proto.tensorflow.NameAttrList.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.AttrValue} + */ +proto.tensorflow.AttrValue.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.AttrValue; + return proto.tensorflow.AttrValue.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.AttrValue} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.AttrValue} + */ +proto.tensorflow.AttrValue.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.tensorflow.AttrValue.ListValue; + reader.readMessage(value,proto.tensorflow.AttrValue.ListValue.deserializeBinaryFromReader); + msg.setList(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setS(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setI(value); + break; + case 4: + var value = /** @type {number} */ (reader.readFloat()); + msg.setF(value); + break; + case 5: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setB(value); + break; + case 6: + var value = /** @type {!proto.tensorflow.DataType} */ (reader.readEnum()); + msg.setType(value); + break; + case 7: + var value = new proto.tensorflow.TensorShape; + reader.readMessage(value,proto.tensorflow.TensorShape.deserializeBinaryFromReader); + msg.setShape(value); + break; + case 8: + var value = new proto.tensorflow.Tensor; + reader.readMessage(value,proto.tensorflow.Tensor.deserializeBinaryFromReader); + msg.setTensor(value); + break; + case 9: + var value = /** @type {string} */ (reader.readString()); + msg.setPlaceholder(value); + break; + case 10: + var value = new proto.tensorflow.NameAttrList; + reader.readMessage(value,proto.tensorflow.NameAttrList.deserializeBinaryFromReader); + msg.setFunc(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.AttrValue.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.AttrValue.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.AttrValue} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.AttrValue.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getList(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.tensorflow.AttrValue.ListValue.serializeBinaryToWriter + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeBytes( + 2, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeInt64( + 3, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeFloat( + 4, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 5)); + if (f != null) { + writer.writeBool( + 5, + f + ); + } + f = /** @type {!proto.tensorflow.DataType} */ (jspb.Message.getField(message, 6)); + if (f != null) { + writer.writeEnum( + 6, + f + ); + } + f = message.getShape(); + if (f != null) { + writer.writeMessage( + 7, + f, + proto.tensorflow.TensorShape.serializeBinaryToWriter + ); + } + f = message.getTensor(); + if (f != null) { + writer.writeMessage( + 8, + f, + proto.tensorflow.Tensor.serializeBinaryToWriter + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 9)); + if (f != null) { + writer.writeString( + 9, + f + ); + } + f = message.getFunc(); + if (f != null) { + writer.writeMessage( + 10, + f, + proto.tensorflow.NameAttrList.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.AttrValue.ListValue.repeatedFields_ = [2,3,4,5,6,7,8,9]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.AttrValue.ListValue.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.AttrValue.ListValue.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.AttrValue.ListValue} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.AttrValue.ListValue.toObject = function(includeInstance, msg) { + var f, obj = { + sList: msg.getSList_asB64(), + iList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f, + fList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 4)) == null ? undefined : f, + bList: (f = jspb.Message.getRepeatedBooleanField(msg, 5)) == null ? undefined : f, + typeList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f, + shapeList: jspb.Message.toObjectList(msg.getShapeList(), + proto.tensorflow.TensorShape.toObject, includeInstance), + tensorList: jspb.Message.toObjectList(msg.getTensorList(), + proto.tensorflow.Tensor.toObject, includeInstance), + funcList: jspb.Message.toObjectList(msg.getFuncList(), + proto.tensorflow.NameAttrList.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.AttrValue.ListValue} + */ +proto.tensorflow.AttrValue.ListValue.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.AttrValue.ListValue; + return proto.tensorflow.AttrValue.ListValue.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.AttrValue.ListValue} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.AttrValue.ListValue} + */ +proto.tensorflow.AttrValue.ListValue.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addS(value); + break; + case 3: + var value = /** @type {!Array} */ (reader.readPackedInt64()); + msg.setIList(value); + break; + case 4: + var value = /** @type {!Array} */ (reader.readPackedFloat()); + msg.setFList(value); + break; + case 5: + var value = /** @type {!Array} */ (reader.readPackedBool()); + msg.setBList(value); + break; + case 6: + var value = /** @type {!Array} */ (reader.readPackedEnum()); + msg.setTypeList(value); + break; + case 7: + var value = new proto.tensorflow.TensorShape; + reader.readMessage(value,proto.tensorflow.TensorShape.deserializeBinaryFromReader); + msg.addShape(value); + break; + case 8: + var value = new proto.tensorflow.Tensor; + reader.readMessage(value,proto.tensorflow.Tensor.deserializeBinaryFromReader); + msg.addTensor(value); + break; + case 9: + var value = new proto.tensorflow.NameAttrList; + reader.readMessage(value,proto.tensorflow.NameAttrList.deserializeBinaryFromReader); + msg.addFunc(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.AttrValue.ListValue.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.AttrValue.ListValue.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.AttrValue.ListValue} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.AttrValue.ListValue.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 2, + f + ); + } + f = message.getIList(); + if (f.length > 0) { + writer.writePackedInt64( + 3, + f + ); + } + f = message.getFList(); + if (f.length > 0) { + writer.writePackedFloat( + 4, + f + ); + } + f = message.getBList(); + if (f.length > 0) { + writer.writePackedBool( + 5, + f + ); + } + f = message.getTypeList(); + if (f.length > 0) { + writer.writePackedEnum( + 6, + f + ); + } + f = message.getShapeList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 7, + f, + proto.tensorflow.TensorShape.serializeBinaryToWriter + ); + } + f = message.getTensorList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 8, + f, + proto.tensorflow.Tensor.serializeBinaryToWriter + ); + } + f = message.getFuncList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 9, + f, + proto.tensorflow.NameAttrList.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated bytes s = 2; + * @return {!(Array|Array)} + */ +proto.tensorflow.AttrValue.ListValue.prototype.getSList = function() { + return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * repeated bytes s = 2; + * This is a type-conversion wrapper around `getSList()` + * @return {!Array} + */ +proto.tensorflow.AttrValue.ListValue.prototype.getSList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getSList())); +}; + + +/** + * repeated bytes s = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getSList()` + * @return {!Array} + */ +proto.tensorflow.AttrValue.ListValue.prototype.getSList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getSList())); +}; + + +/** @param {!(Array|Array)} value */ +proto.tensorflow.AttrValue.ListValue.prototype.setSList = function(value) { + jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + */ +proto.tensorflow.AttrValue.ListValue.prototype.addS = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.AttrValue.ListValue.prototype.clearSList = function() { + this.setSList([]); +}; + + +/** + * repeated int64 i = 3; + * @return {!Array} + */ +proto.tensorflow.AttrValue.ListValue.prototype.getIList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.AttrValue.ListValue.prototype.setIList = function(value) { + jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.AttrValue.ListValue.prototype.addI = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.AttrValue.ListValue.prototype.clearIList = function() { + this.setIList([]); +}; + + +/** + * repeated float f = 4; + * @return {!Array} + */ +proto.tensorflow.AttrValue.ListValue.prototype.getFList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 4)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.AttrValue.ListValue.prototype.setFList = function(value) { + jspb.Message.setField(this, 4, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.AttrValue.ListValue.prototype.addF = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 4, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.AttrValue.ListValue.prototype.clearFList = function() { + this.setFList([]); +}; + + +/** + * repeated bool b = 5; + * @return {!Array} + */ +proto.tensorflow.AttrValue.ListValue.prototype.getBList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedBooleanField(this, 5)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.AttrValue.ListValue.prototype.setBList = function(value) { + jspb.Message.setField(this, 5, value || []); +}; + + +/** + * @param {boolean} value + * @param {number=} opt_index + */ +proto.tensorflow.AttrValue.ListValue.prototype.addB = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 5, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.AttrValue.ListValue.prototype.clearBList = function() { + this.setBList([]); +}; + + +/** + * repeated DataType type = 6; + * @return {!Array} + */ +proto.tensorflow.AttrValue.ListValue.prototype.getTypeList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 6)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.AttrValue.ListValue.prototype.setTypeList = function(value) { + jspb.Message.setField(this, 6, value || []); +}; + + +/** + * @param {!proto.tensorflow.DataType} value + * @param {number=} opt_index + */ +proto.tensorflow.AttrValue.ListValue.prototype.addType = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 6, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.AttrValue.ListValue.prototype.clearTypeList = function() { + this.setTypeList([]); +}; + + +/** + * repeated TensorShape shape = 7; + * @return {!Array} + */ +proto.tensorflow.AttrValue.ListValue.prototype.getShapeList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.TensorShape, 7)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.AttrValue.ListValue.prototype.setShapeList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 7, value); +}; + + +/** + * @param {!proto.tensorflow.TensorShape=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.TensorShape} + */ +proto.tensorflow.AttrValue.ListValue.prototype.addShape = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, proto.tensorflow.TensorShape, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.AttrValue.ListValue.prototype.clearShapeList = function() { + this.setShapeList([]); +}; + + +/** + * repeated Tensor tensor = 8; + * @return {!Array} + */ +proto.tensorflow.AttrValue.ListValue.prototype.getTensorList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.Tensor, 8)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.AttrValue.ListValue.prototype.setTensorList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 8, value); +}; + + +/** + * @param {!proto.tensorflow.Tensor=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.Tensor} + */ +proto.tensorflow.AttrValue.ListValue.prototype.addTensor = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 8, opt_value, proto.tensorflow.Tensor, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.AttrValue.ListValue.prototype.clearTensorList = function() { + this.setTensorList([]); +}; + + +/** + * repeated NameAttrList func = 9; + * @return {!Array} + */ +proto.tensorflow.AttrValue.ListValue.prototype.getFuncList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.NameAttrList, 9)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.AttrValue.ListValue.prototype.setFuncList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 9, value); +}; + + +/** + * @param {!proto.tensorflow.NameAttrList=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.NameAttrList} + */ +proto.tensorflow.AttrValue.ListValue.prototype.addFunc = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 9, opt_value, proto.tensorflow.NameAttrList, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.AttrValue.ListValue.prototype.clearFuncList = function() { + this.setFuncList([]); +}; + + +/** + * optional ListValue list = 1; + * @return {?proto.tensorflow.AttrValue.ListValue} + */ +proto.tensorflow.AttrValue.prototype.getList = function() { + return /** @type{?proto.tensorflow.AttrValue.ListValue} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.AttrValue.ListValue, 1)); +}; + + +/** @param {?proto.tensorflow.AttrValue.ListValue|undefined} value */ +proto.tensorflow.AttrValue.prototype.setList = function(value) { + jspb.Message.setOneofWrapperField(this, 1, proto.tensorflow.AttrValue.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.AttrValue.prototype.clearList = function() { + this.setList(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.AttrValue.prototype.hasList = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bytes s = 2; + * @return {!(string|Uint8Array)} + */ +proto.tensorflow.AttrValue.prototype.getS = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes s = 2; + * This is a type-conversion wrapper around `getS()` + * @return {string} + */ +proto.tensorflow.AttrValue.prototype.getS_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getS())); +}; + + +/** + * optional bytes s = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getS()` + * @return {!Uint8Array} + */ +proto.tensorflow.AttrValue.prototype.getS_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getS())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.tensorflow.AttrValue.prototype.setS = function(value) { + jspb.Message.setOneofField(this, 2, proto.tensorflow.AttrValue.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + */ +proto.tensorflow.AttrValue.prototype.clearS = function() { + jspb.Message.setOneofField(this, 2, proto.tensorflow.AttrValue.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.AttrValue.prototype.hasS = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional int64 i = 3; + * @return {number} + */ +proto.tensorflow.AttrValue.prototype.getI = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {number} value */ +proto.tensorflow.AttrValue.prototype.setI = function(value) { + jspb.Message.setOneofField(this, 3, proto.tensorflow.AttrValue.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + */ +proto.tensorflow.AttrValue.prototype.clearI = function() { + jspb.Message.setOneofField(this, 3, proto.tensorflow.AttrValue.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.AttrValue.prototype.hasI = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional float f = 4; + * @return {number} + */ +proto.tensorflow.AttrValue.prototype.getF = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 0.0)); +}; + + +/** @param {number} value */ +proto.tensorflow.AttrValue.prototype.setF = function(value) { + jspb.Message.setOneofField(this, 4, proto.tensorflow.AttrValue.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + */ +proto.tensorflow.AttrValue.prototype.clearF = function() { + jspb.Message.setOneofField(this, 4, proto.tensorflow.AttrValue.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.AttrValue.prototype.hasF = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional bool b = 5; + * @return {boolean} + */ +proto.tensorflow.AttrValue.prototype.getB = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); +}; + + +/** @param {boolean} value */ +proto.tensorflow.AttrValue.prototype.setB = function(value) { + jspb.Message.setOneofField(this, 5, proto.tensorflow.AttrValue.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + */ +proto.tensorflow.AttrValue.prototype.clearB = function() { + jspb.Message.setOneofField(this, 5, proto.tensorflow.AttrValue.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.AttrValue.prototype.hasB = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional DataType type = 6; + * @return {!proto.tensorflow.DataType} + */ +proto.tensorflow.AttrValue.prototype.getType = function() { + return /** @type {!proto.tensorflow.DataType} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +}; + + +/** @param {!proto.tensorflow.DataType} value */ +proto.tensorflow.AttrValue.prototype.setType = function(value) { + jspb.Message.setOneofField(this, 6, proto.tensorflow.AttrValue.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + */ +proto.tensorflow.AttrValue.prototype.clearType = function() { + jspb.Message.setOneofField(this, 6, proto.tensorflow.AttrValue.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.AttrValue.prototype.hasType = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * optional TensorShape shape = 7; + * @return {?proto.tensorflow.TensorShape} + */ +proto.tensorflow.AttrValue.prototype.getShape = function() { + return /** @type{?proto.tensorflow.TensorShape} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.TensorShape, 7)); +}; + + +/** @param {?proto.tensorflow.TensorShape|undefined} value */ +proto.tensorflow.AttrValue.prototype.setShape = function(value) { + jspb.Message.setOneofWrapperField(this, 7, proto.tensorflow.AttrValue.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.AttrValue.prototype.clearShape = function() { + this.setShape(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.AttrValue.prototype.hasShape = function() { + return jspb.Message.getField(this, 7) != null; +}; + + +/** + * optional Tensor tensor = 8; + * @return {?proto.tensorflow.Tensor} + */ +proto.tensorflow.AttrValue.prototype.getTensor = function() { + return /** @type{?proto.tensorflow.Tensor} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.Tensor, 8)); +}; + + +/** @param {?proto.tensorflow.Tensor|undefined} value */ +proto.tensorflow.AttrValue.prototype.setTensor = function(value) { + jspb.Message.setOneofWrapperField(this, 8, proto.tensorflow.AttrValue.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.AttrValue.prototype.clearTensor = function() { + this.setTensor(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.AttrValue.prototype.hasTensor = function() { + return jspb.Message.getField(this, 8) != null; +}; + + +/** + * optional string placeholder = 9; + * @return {string} + */ +proto.tensorflow.AttrValue.prototype.getPlaceholder = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.AttrValue.prototype.setPlaceholder = function(value) { + jspb.Message.setOneofField(this, 9, proto.tensorflow.AttrValue.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + */ +proto.tensorflow.AttrValue.prototype.clearPlaceholder = function() { + jspb.Message.setOneofField(this, 9, proto.tensorflow.AttrValue.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.AttrValue.prototype.hasPlaceholder = function() { + return jspb.Message.getField(this, 9) != null; +}; + + +/** + * optional NameAttrList func = 10; + * @return {?proto.tensorflow.NameAttrList} + */ +proto.tensorflow.AttrValue.prototype.getFunc = function() { + return /** @type{?proto.tensorflow.NameAttrList} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.NameAttrList, 10)); +}; + + +/** @param {?proto.tensorflow.NameAttrList|undefined} value */ +proto.tensorflow.AttrValue.prototype.setFunc = function(value) { + jspb.Message.setOneofWrapperField(this, 10, proto.tensorflow.AttrValue.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.AttrValue.prototype.clearFunc = function() { + this.setFunc(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.AttrValue.prototype.hasFunc = function() { + return jspb.Message.getField(this, 10) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.NameAttrList.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.NameAttrList.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.NameAttrList} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.NameAttrList.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + attrMap: (f = msg.getAttrMap()) ? f.toObject(includeInstance, proto.tensorflow.AttrValue.toObject) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.NameAttrList} + */ +proto.tensorflow.NameAttrList.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.NameAttrList; + return proto.tensorflow.NameAttrList.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.NameAttrList} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.NameAttrList} + */ +proto.tensorflow.NameAttrList.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = msg.getAttrMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.tensorflow.AttrValue.deserializeBinaryFromReader, ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.NameAttrList.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.NameAttrList.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.NameAttrList} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.NameAttrList.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getAttrMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.tensorflow.AttrValue.serializeBinaryToWriter); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.tensorflow.NameAttrList.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.NameAttrList.prototype.setName = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * map attr = 2; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.tensorflow.NameAttrList.prototype.getAttrMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 2, opt_noLazyCreate, + proto.tensorflow.AttrValue)); +}; + + +/** + * Clears values from the map. The map will be non-null. + */ +proto.tensorflow.NameAttrList.prototype.clearAttrMap = function() { + this.getAttrMap().clear(); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.NodeDef.repeatedFields_ = [3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.NodeDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.NodeDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.NodeDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.NodeDef.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + op: jspb.Message.getFieldWithDefault(msg, 2, ""), + inputList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f, + device: jspb.Message.getFieldWithDefault(msg, 4, ""), + attrMap: (f = msg.getAttrMap()) ? f.toObject(includeInstance, proto.tensorflow.AttrValue.toObject) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.NodeDef} + */ +proto.tensorflow.NodeDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.NodeDef; + return proto.tensorflow.NodeDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.NodeDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.NodeDef} + */ +proto.tensorflow.NodeDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setOp(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.addInput(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setDevice(value); + break; + case 5: + var value = msg.getAttrMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.tensorflow.AttrValue.deserializeBinaryFromReader, ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.NodeDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.NodeDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.NodeDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.NodeDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getOp(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getInputList(); + if (f.length > 0) { + writer.writeRepeatedString( + 3, + f + ); + } + f = message.getDevice(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getAttrMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.tensorflow.AttrValue.serializeBinaryToWriter); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.tensorflow.NodeDef.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.NodeDef.prototype.setName = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string op = 2; + * @return {string} + */ +proto.tensorflow.NodeDef.prototype.getOp = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.NodeDef.prototype.setOp = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * repeated string input = 3; + * @return {!Array} + */ +proto.tensorflow.NodeDef.prototype.getInputList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.NodeDef.prototype.setInputList = function(value) { + jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + */ +proto.tensorflow.NodeDef.prototype.addInput = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.NodeDef.prototype.clearInputList = function() { + this.setInputList([]); +}; + + +/** + * optional string device = 4; + * @return {string} + */ +proto.tensorflow.NodeDef.prototype.getDevice = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.NodeDef.prototype.setDevice = function(value) { + jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * map attr = 5; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.tensorflow.NodeDef.prototype.getAttrMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 5, opt_noLazyCreate, + proto.tensorflow.AttrValue)); +}; + + +/** + * Clears values from the map. The map will be non-null. + */ +proto.tensorflow.NodeDef.prototype.clearAttrMap = function() { + this.getAttrMap().clear(); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.VersionDef.repeatedFields_ = [3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.VersionDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.VersionDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.VersionDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.VersionDef.toObject = function(includeInstance, msg) { + var f, obj = { + producer: jspb.Message.getFieldWithDefault(msg, 1, 0), + minConsumer: jspb.Message.getFieldWithDefault(msg, 2, 0), + badConsumersList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.VersionDef} + */ +proto.tensorflow.VersionDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.VersionDef; + return proto.tensorflow.VersionDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.VersionDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.VersionDef} + */ +proto.tensorflow.VersionDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setProducer(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt32()); + msg.setMinConsumer(value); + break; + case 3: + var value = /** @type {!Array} */ (reader.readPackedInt32()); + msg.setBadConsumersList(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.VersionDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.VersionDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.VersionDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.VersionDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProducer(); + if (f !== 0) { + writer.writeInt32( + 1, + f + ); + } + f = message.getMinConsumer(); + if (f !== 0) { + writer.writeInt32( + 2, + f + ); + } + f = message.getBadConsumersList(); + if (f.length > 0) { + writer.writePackedInt32( + 3, + f + ); + } +}; + + +/** + * optional int32 producer = 1; + * @return {number} + */ +proto.tensorflow.VersionDef.prototype.getProducer = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.tensorflow.VersionDef.prototype.setProducer = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional int32 min_consumer = 2; + * @return {number} + */ +proto.tensorflow.VersionDef.prototype.getMinConsumer = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.tensorflow.VersionDef.prototype.setMinConsumer = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * repeated int32 bad_consumers = 3; + * @return {!Array} + */ +proto.tensorflow.VersionDef.prototype.getBadConsumersList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.VersionDef.prototype.setBadConsumersList = function(value) { + jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.VersionDef.prototype.addBadConsumers = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.VersionDef.prototype.clearBadConsumersList = function() { + this.setBadConsumersList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.GraphDef.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.GraphDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.GraphDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.GraphDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.GraphDef.toObject = function(includeInstance, msg) { + var f, obj = { + nodeList: jspb.Message.toObjectList(msg.getNodeList(), + proto.tensorflow.NodeDef.toObject, includeInstance), + versions: (f = msg.getVersions()) && proto.tensorflow.VersionDef.toObject(includeInstance, f), + library: (f = msg.getLibrary()) && proto.tensorflow.FunctionDefLibrary.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.GraphDef} + */ +proto.tensorflow.GraphDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.GraphDef; + return proto.tensorflow.GraphDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.GraphDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.GraphDef} + */ +proto.tensorflow.GraphDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.tensorflow.NodeDef; + reader.readMessage(value,proto.tensorflow.NodeDef.deserializeBinaryFromReader); + msg.addNode(value); + break; + case 4: + var value = new proto.tensorflow.VersionDef; + reader.readMessage(value,proto.tensorflow.VersionDef.deserializeBinaryFromReader); + msg.setVersions(value); + break; + case 2: + var value = new proto.tensorflow.FunctionDefLibrary; + reader.readMessage(value,proto.tensorflow.FunctionDefLibrary.deserializeBinaryFromReader); + msg.setLibrary(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.GraphDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.GraphDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.GraphDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.GraphDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getNodeList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.tensorflow.NodeDef.serializeBinaryToWriter + ); + } + f = message.getVersions(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.tensorflow.VersionDef.serializeBinaryToWriter + ); + } + f = message.getLibrary(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.tensorflow.FunctionDefLibrary.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated NodeDef node = 1; + * @return {!Array} + */ +proto.tensorflow.GraphDef.prototype.getNodeList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.NodeDef, 1)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.GraphDef.prototype.setNodeList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.tensorflow.NodeDef=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.NodeDef} + */ +proto.tensorflow.GraphDef.prototype.addNode = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.tensorflow.NodeDef, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.GraphDef.prototype.clearNodeList = function() { + this.setNodeList([]); +}; + + +/** + * optional VersionDef versions = 4; + * @return {?proto.tensorflow.VersionDef} + */ +proto.tensorflow.GraphDef.prototype.getVersions = function() { + return /** @type{?proto.tensorflow.VersionDef} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.VersionDef, 4)); +}; + + +/** @param {?proto.tensorflow.VersionDef|undefined} value */ +proto.tensorflow.GraphDef.prototype.setVersions = function(value) { + jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.GraphDef.prototype.clearVersions = function() { + this.setVersions(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.GraphDef.prototype.hasVersions = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional FunctionDefLibrary library = 2; + * @return {?proto.tensorflow.FunctionDefLibrary} + */ +proto.tensorflow.GraphDef.prototype.getLibrary = function() { + return /** @type{?proto.tensorflow.FunctionDefLibrary} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.FunctionDefLibrary, 2)); +}; + + +/** @param {?proto.tensorflow.FunctionDefLibrary|undefined} value */ +proto.tensorflow.GraphDef.prototype.setLibrary = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.GraphDef.prototype.clearLibrary = function() { + this.setLibrary(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.GraphDef.prototype.hasLibrary = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.tensorflow.CollectionDef.oneofGroups_ = [[1,2,3,4,5]]; + +/** + * @enum {number} + */ +proto.tensorflow.CollectionDef.KindCase = { + KIND_NOT_SET: 0, + NODE_LIST: 1, + BYTES_LIST: 2, + INT64_LIST: 3, + FLOAT_LIST: 4, + ANY_LIST: 5 +}; + +/** + * @return {proto.tensorflow.CollectionDef.KindCase} + */ +proto.tensorflow.CollectionDef.prototype.getKindCase = function() { + return /** @type {proto.tensorflow.CollectionDef.KindCase} */(jspb.Message.computeOneofCase(this, proto.tensorflow.CollectionDef.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.CollectionDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.CollectionDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.CollectionDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.toObject = function(includeInstance, msg) { + var f, obj = { + nodeList: (f = msg.getNodeList()) && proto.tensorflow.CollectionDef.NodeList.toObject(includeInstance, f), + bytesList: (f = msg.getBytesList()) && proto.tensorflow.CollectionDef.BytesList.toObject(includeInstance, f), + int64List: (f = msg.getInt64List()) && proto.tensorflow.CollectionDef.Int64List.toObject(includeInstance, f), + floatList: (f = msg.getFloatList()) && proto.tensorflow.CollectionDef.FloatList.toObject(includeInstance, f), + anyList: (f = msg.getAnyList()) && proto.tensorflow.CollectionDef.AnyList.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.CollectionDef} + */ +proto.tensorflow.CollectionDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.CollectionDef; + return proto.tensorflow.CollectionDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.CollectionDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.CollectionDef} + */ +proto.tensorflow.CollectionDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.tensorflow.CollectionDef.NodeList; + reader.readMessage(value,proto.tensorflow.CollectionDef.NodeList.deserializeBinaryFromReader); + msg.setNodeList(value); + break; + case 2: + var value = new proto.tensorflow.CollectionDef.BytesList; + reader.readMessage(value,proto.tensorflow.CollectionDef.BytesList.deserializeBinaryFromReader); + msg.setBytesList(value); + break; + case 3: + var value = new proto.tensorflow.CollectionDef.Int64List; + reader.readMessage(value,proto.tensorflow.CollectionDef.Int64List.deserializeBinaryFromReader); + msg.setInt64List(value); + break; + case 4: + var value = new proto.tensorflow.CollectionDef.FloatList; + reader.readMessage(value,proto.tensorflow.CollectionDef.FloatList.deserializeBinaryFromReader); + msg.setFloatList(value); + break; + case 5: + var value = new proto.tensorflow.CollectionDef.AnyList; + reader.readMessage(value,proto.tensorflow.CollectionDef.AnyList.deserializeBinaryFromReader); + msg.setAnyList(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.CollectionDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.CollectionDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.CollectionDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getNodeList(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.tensorflow.CollectionDef.NodeList.serializeBinaryToWriter + ); + } + f = message.getBytesList(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.tensorflow.CollectionDef.BytesList.serializeBinaryToWriter + ); + } + f = message.getInt64List(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.tensorflow.CollectionDef.Int64List.serializeBinaryToWriter + ); + } + f = message.getFloatList(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.tensorflow.CollectionDef.FloatList.serializeBinaryToWriter + ); + } + f = message.getAnyList(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.tensorflow.CollectionDef.AnyList.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.CollectionDef.NodeList.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.CollectionDef.NodeList.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.CollectionDef.NodeList.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.CollectionDef.NodeList} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.NodeList.toObject = function(includeInstance, msg) { + var f, obj = { + valueList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.CollectionDef.NodeList} + */ +proto.tensorflow.CollectionDef.NodeList.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.CollectionDef.NodeList; + return proto.tensorflow.CollectionDef.NodeList.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.CollectionDef.NodeList} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.CollectionDef.NodeList} + */ +proto.tensorflow.CollectionDef.NodeList.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.addValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.CollectionDef.NodeList.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.CollectionDef.NodeList.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.CollectionDef.NodeList} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.NodeList.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValueList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string value = 1; + * @return {!Array} + */ +proto.tensorflow.CollectionDef.NodeList.prototype.getValueList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.CollectionDef.NodeList.prototype.setValueList = function(value) { + jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + */ +proto.tensorflow.CollectionDef.NodeList.prototype.addValue = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.CollectionDef.NodeList.prototype.clearValueList = function() { + this.setValueList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.CollectionDef.BytesList.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.CollectionDef.BytesList.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.CollectionDef.BytesList.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.CollectionDef.BytesList} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.BytesList.toObject = function(includeInstance, msg) { + var f, obj = { + valueList: msg.getValueList_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.CollectionDef.BytesList} + */ +proto.tensorflow.CollectionDef.BytesList.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.CollectionDef.BytesList; + return proto.tensorflow.CollectionDef.BytesList.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.CollectionDef.BytesList} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.CollectionDef.BytesList} + */ +proto.tensorflow.CollectionDef.BytesList.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.CollectionDef.BytesList.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.CollectionDef.BytesList.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.CollectionDef.BytesList} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.BytesList.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValueList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } +}; + + +/** + * repeated bytes value = 1; + * @return {!(Array|Array)} + */ +proto.tensorflow.CollectionDef.BytesList.prototype.getValueList = function() { + return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * repeated bytes value = 1; + * This is a type-conversion wrapper around `getValueList()` + * @return {!Array} + */ +proto.tensorflow.CollectionDef.BytesList.prototype.getValueList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getValueList())); +}; + + +/** + * repeated bytes value = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getValueList()` + * @return {!Array} + */ +proto.tensorflow.CollectionDef.BytesList.prototype.getValueList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getValueList())); +}; + + +/** @param {!(Array|Array)} value */ +proto.tensorflow.CollectionDef.BytesList.prototype.setValueList = function(value) { + jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + */ +proto.tensorflow.CollectionDef.BytesList.prototype.addValue = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.CollectionDef.BytesList.prototype.clearValueList = function() { + this.setValueList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.CollectionDef.Int64List.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.CollectionDef.Int64List.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.CollectionDef.Int64List.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.CollectionDef.Int64List} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.Int64List.toObject = function(includeInstance, msg) { + var f, obj = { + valueList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.CollectionDef.Int64List} + */ +proto.tensorflow.CollectionDef.Int64List.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.CollectionDef.Int64List; + return proto.tensorflow.CollectionDef.Int64List.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.CollectionDef.Int64List} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.CollectionDef.Int64List} + */ +proto.tensorflow.CollectionDef.Int64List.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Array} */ (reader.readPackedInt64()); + msg.setValueList(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.CollectionDef.Int64List.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.CollectionDef.Int64List.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.CollectionDef.Int64List} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.Int64List.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValueList(); + if (f.length > 0) { + writer.writePackedInt64( + 1, + f + ); + } +}; + + +/** + * repeated int64 value = 1; + * @return {!Array} + */ +proto.tensorflow.CollectionDef.Int64List.prototype.getValueList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.CollectionDef.Int64List.prototype.setValueList = function(value) { + jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.CollectionDef.Int64List.prototype.addValue = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.CollectionDef.Int64List.prototype.clearValueList = function() { + this.setValueList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.CollectionDef.FloatList.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.CollectionDef.FloatList.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.CollectionDef.FloatList.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.CollectionDef.FloatList} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.FloatList.toObject = function(includeInstance, msg) { + var f, obj = { + valueList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.CollectionDef.FloatList} + */ +proto.tensorflow.CollectionDef.FloatList.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.CollectionDef.FloatList; + return proto.tensorflow.CollectionDef.FloatList.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.CollectionDef.FloatList} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.CollectionDef.FloatList} + */ +proto.tensorflow.CollectionDef.FloatList.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Array} */ (reader.readPackedFloat()); + msg.setValueList(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.CollectionDef.FloatList.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.CollectionDef.FloatList.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.CollectionDef.FloatList} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.FloatList.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValueList(); + if (f.length > 0) { + writer.writePackedFloat( + 1, + f + ); + } +}; + + +/** + * repeated float value = 1; + * @return {!Array} + */ +proto.tensorflow.CollectionDef.FloatList.prototype.getValueList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 1)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.CollectionDef.FloatList.prototype.setValueList = function(value) { + jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.CollectionDef.FloatList.prototype.addValue = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.CollectionDef.FloatList.prototype.clearValueList = function() { + this.setValueList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.CollectionDef.AnyList.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.CollectionDef.AnyList.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.CollectionDef.AnyList.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.CollectionDef.AnyList} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.AnyList.toObject = function(includeInstance, msg) { + var f, obj = { + valueList: jspb.Message.toObjectList(msg.getValueList(), + proto.tensorflow.Any.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.CollectionDef.AnyList} + */ +proto.tensorflow.CollectionDef.AnyList.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.CollectionDef.AnyList; + return proto.tensorflow.CollectionDef.AnyList.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.CollectionDef.AnyList} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.CollectionDef.AnyList} + */ +proto.tensorflow.CollectionDef.AnyList.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.tensorflow.Any; + reader.readMessage(value,proto.tensorflow.Any.deserializeBinaryFromReader); + msg.addValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.CollectionDef.AnyList.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.CollectionDef.AnyList.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.CollectionDef.AnyList} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.AnyList.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValueList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.tensorflow.Any.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated Any value = 1; + * @return {!Array} + */ +proto.tensorflow.CollectionDef.AnyList.prototype.getValueList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.Any, 1)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.CollectionDef.AnyList.prototype.setValueList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.tensorflow.Any=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.Any} + */ +proto.tensorflow.CollectionDef.AnyList.prototype.addValue = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.tensorflow.Any, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.CollectionDef.AnyList.prototype.clearValueList = function() { + this.setValueList([]); +}; + + +/** + * optional NodeList node_list = 1; + * @return {?proto.tensorflow.CollectionDef.NodeList} + */ +proto.tensorflow.CollectionDef.prototype.getNodeList = function() { + return /** @type{?proto.tensorflow.CollectionDef.NodeList} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.CollectionDef.NodeList, 1)); +}; + + +/** @param {?proto.tensorflow.CollectionDef.NodeList|undefined} value */ +proto.tensorflow.CollectionDef.prototype.setNodeList = function(value) { + jspb.Message.setOneofWrapperField(this, 1, proto.tensorflow.CollectionDef.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.CollectionDef.prototype.clearNodeList = function() { + this.setNodeList(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.CollectionDef.prototype.hasNodeList = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional BytesList bytes_list = 2; + * @return {?proto.tensorflow.CollectionDef.BytesList} + */ +proto.tensorflow.CollectionDef.prototype.getBytesList = function() { + return /** @type{?proto.tensorflow.CollectionDef.BytesList} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.CollectionDef.BytesList, 2)); +}; + + +/** @param {?proto.tensorflow.CollectionDef.BytesList|undefined} value */ +proto.tensorflow.CollectionDef.prototype.setBytesList = function(value) { + jspb.Message.setOneofWrapperField(this, 2, proto.tensorflow.CollectionDef.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.CollectionDef.prototype.clearBytesList = function() { + this.setBytesList(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.CollectionDef.prototype.hasBytesList = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional Int64List int64_list = 3; + * @return {?proto.tensorflow.CollectionDef.Int64List} + */ +proto.tensorflow.CollectionDef.prototype.getInt64List = function() { + return /** @type{?proto.tensorflow.CollectionDef.Int64List} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.CollectionDef.Int64List, 3)); +}; + + +/** @param {?proto.tensorflow.CollectionDef.Int64List|undefined} value */ +proto.tensorflow.CollectionDef.prototype.setInt64List = function(value) { + jspb.Message.setOneofWrapperField(this, 3, proto.tensorflow.CollectionDef.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.CollectionDef.prototype.clearInt64List = function() { + this.setInt64List(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.CollectionDef.prototype.hasInt64List = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional FloatList float_list = 4; + * @return {?proto.tensorflow.CollectionDef.FloatList} + */ +proto.tensorflow.CollectionDef.prototype.getFloatList = function() { + return /** @type{?proto.tensorflow.CollectionDef.FloatList} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.CollectionDef.FloatList, 4)); +}; + + +/** @param {?proto.tensorflow.CollectionDef.FloatList|undefined} value */ +proto.tensorflow.CollectionDef.prototype.setFloatList = function(value) { + jspb.Message.setOneofWrapperField(this, 4, proto.tensorflow.CollectionDef.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.CollectionDef.prototype.clearFloatList = function() { + this.setFloatList(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.CollectionDef.prototype.hasFloatList = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional AnyList any_list = 5; + * @return {?proto.tensorflow.CollectionDef.AnyList} + */ +proto.tensorflow.CollectionDef.prototype.getAnyList = function() { + return /** @type{?proto.tensorflow.CollectionDef.AnyList} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.CollectionDef.AnyList, 5)); +}; + + +/** @param {?proto.tensorflow.CollectionDef.AnyList|undefined} value */ +proto.tensorflow.CollectionDef.prototype.setAnyList = function(value) { + jspb.Message.setOneofWrapperField(this, 5, proto.tensorflow.CollectionDef.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.CollectionDef.prototype.clearAnyList = function() { + this.setAnyList(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.CollectionDef.prototype.hasAnyList = function() { + return jspb.Message.getField(this, 5) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.SaverDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.SaverDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.SaverDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.SaverDef.toObject = function(includeInstance, msg) { + var f, obj = { + filenameTensorName: jspb.Message.getFieldWithDefault(msg, 1, ""), + saveTensorName: jspb.Message.getFieldWithDefault(msg, 2, ""), + restoreOpName: jspb.Message.getFieldWithDefault(msg, 3, ""), + maxToKeep: jspb.Message.getFieldWithDefault(msg, 4, 0), + sharded: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), + keepCheckpointEveryNHours: jspb.Message.getFloatingPointFieldWithDefault(msg, 6, 0.0), + version: jspb.Message.getFieldWithDefault(msg, 7, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.SaverDef} + */ +proto.tensorflow.SaverDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.SaverDef; + return proto.tensorflow.SaverDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.SaverDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.SaverDef} + */ +proto.tensorflow.SaverDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setFilenameTensorName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setSaveTensorName(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setRestoreOpName(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt32()); + msg.setMaxToKeep(value); + break; + case 5: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSharded(value); + break; + case 6: + var value = /** @type {number} */ (reader.readFloat()); + msg.setKeepCheckpointEveryNHours(value); + break; + case 7: + var value = /** @type {!proto.tensorflow.SaverDef.CheckpointFormatVersion} */ (reader.readEnum()); + msg.setVersion(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.SaverDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.SaverDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.SaverDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.SaverDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFilenameTensorName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getSaveTensorName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getRestoreOpName(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getMaxToKeep(); + if (f !== 0) { + writer.writeInt32( + 4, + f + ); + } + f = message.getSharded(); + if (f) { + writer.writeBool( + 5, + f + ); + } + f = message.getKeepCheckpointEveryNHours(); + if (f !== 0.0) { + writer.writeFloat( + 6, + f + ); + } + f = message.getVersion(); + if (f !== 0.0) { + writer.writeEnum( + 7, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.tensorflow.SaverDef.CheckpointFormatVersion = { + LEGACY: 0, + V1: 1, + V2: 2 +}; + +/** + * optional string filename_tensor_name = 1; + * @return {string} + */ +proto.tensorflow.SaverDef.prototype.getFilenameTensorName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.SaverDef.prototype.setFilenameTensorName = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string save_tensor_name = 2; + * @return {string} + */ +proto.tensorflow.SaverDef.prototype.getSaveTensorName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.SaverDef.prototype.setSaveTensorName = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string restore_op_name = 3; + * @return {string} + */ +proto.tensorflow.SaverDef.prototype.getRestoreOpName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.SaverDef.prototype.setRestoreOpName = function(value) { + jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional int32 max_to_keep = 4; + * @return {number} + */ +proto.tensorflow.SaverDef.prototype.getMaxToKeep = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** @param {number} value */ +proto.tensorflow.SaverDef.prototype.setMaxToKeep = function(value) { + jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * optional bool sharded = 5; + * @return {boolean} + */ +proto.tensorflow.SaverDef.prototype.getSharded = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); +}; + + +/** @param {boolean} value */ +proto.tensorflow.SaverDef.prototype.setSharded = function(value) { + jspb.Message.setProto3BooleanField(this, 5, value); +}; + + +/** + * optional float keep_checkpoint_every_n_hours = 6; + * @return {number} + */ +proto.tensorflow.SaverDef.prototype.getKeepCheckpointEveryNHours = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 6, 0.0)); +}; + + +/** @param {number} value */ +proto.tensorflow.SaverDef.prototype.setKeepCheckpointEveryNHours = function(value) { + jspb.Message.setProto3FloatField(this, 6, value); +}; + + +/** + * optional CheckpointFormatVersion version = 7; + * @return {!proto.tensorflow.SaverDef.CheckpointFormatVersion} + */ +proto.tensorflow.SaverDef.prototype.getVersion = function() { + return /** @type {!proto.tensorflow.SaverDef.CheckpointFormatVersion} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); +}; + + +/** @param {!proto.tensorflow.SaverDef.CheckpointFormatVersion} value */ +proto.tensorflow.SaverDef.prototype.setVersion = function(value) { + jspb.Message.setProto3EnumField(this, 7, value); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.tensorflow.TensorInfo.oneofGroups_ = [[1,4]]; + +/** + * @enum {number} + */ +proto.tensorflow.TensorInfo.EncodingCase = { + ENCODING_NOT_SET: 0, + NAME: 1, + COO_SPARSE: 4 +}; + +/** + * @return {proto.tensorflow.TensorInfo.EncodingCase} + */ +proto.tensorflow.TensorInfo.prototype.getEncodingCase = function() { + return /** @type {proto.tensorflow.TensorInfo.EncodingCase} */(jspb.Message.computeOneofCase(this, proto.tensorflow.TensorInfo.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.TensorInfo.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.TensorInfo.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.TensorInfo} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.TensorInfo.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + cooSparse: (f = msg.getCooSparse()) && proto.tensorflow.TensorInfo.CooSparse.toObject(includeInstance, f), + dtype: jspb.Message.getFieldWithDefault(msg, 2, 0), + tensorShape: (f = msg.getTensorShape()) && proto.tensorflow.TensorShape.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.TensorInfo} + */ +proto.tensorflow.TensorInfo.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.TensorInfo; + return proto.tensorflow.TensorInfo.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.TensorInfo} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.TensorInfo} + */ +proto.tensorflow.TensorInfo.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 4: + var value = new proto.tensorflow.TensorInfo.CooSparse; + reader.readMessage(value,proto.tensorflow.TensorInfo.CooSparse.deserializeBinaryFromReader); + msg.setCooSparse(value); + break; + case 2: + var value = /** @type {!proto.tensorflow.DataType} */ (reader.readEnum()); + msg.setDtype(value); + break; + case 3: + var value = new proto.tensorflow.TensorShape; + reader.readMessage(value,proto.tensorflow.TensorShape.deserializeBinaryFromReader); + msg.setTensorShape(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.TensorInfo.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.TensorInfo.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.TensorInfo} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.TensorInfo.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = message.getCooSparse(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.tensorflow.TensorInfo.CooSparse.serializeBinaryToWriter + ); + } + f = message.getDtype(); + if (f !== 0.0) { + writer.writeEnum( + 2, + f + ); + } + f = message.getTensorShape(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.tensorflow.TensorShape.serializeBinaryToWriter + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.TensorInfo.CooSparse.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.TensorInfo.CooSparse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.TensorInfo.CooSparse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.TensorInfo.CooSparse.toObject = function(includeInstance, msg) { + var f, obj = { + valuesTensorName: jspb.Message.getFieldWithDefault(msg, 1, ""), + indicesTensorName: jspb.Message.getFieldWithDefault(msg, 2, ""), + denseShapeTensorName: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.TensorInfo.CooSparse} + */ +proto.tensorflow.TensorInfo.CooSparse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.TensorInfo.CooSparse; + return proto.tensorflow.TensorInfo.CooSparse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.TensorInfo.CooSparse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.TensorInfo.CooSparse} + */ +proto.tensorflow.TensorInfo.CooSparse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setValuesTensorName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setIndicesTensorName(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setDenseShapeTensorName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.TensorInfo.CooSparse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.TensorInfo.CooSparse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.TensorInfo.CooSparse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.TensorInfo.CooSparse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValuesTensorName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getIndicesTensorName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getDenseShapeTensorName(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional string values_tensor_name = 1; + * @return {string} + */ +proto.tensorflow.TensorInfo.CooSparse.prototype.getValuesTensorName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.TensorInfo.CooSparse.prototype.setValuesTensorName = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string indices_tensor_name = 2; + * @return {string} + */ +proto.tensorflow.TensorInfo.CooSparse.prototype.getIndicesTensorName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.TensorInfo.CooSparse.prototype.setIndicesTensorName = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string dense_shape_tensor_name = 3; + * @return {string} + */ +proto.tensorflow.TensorInfo.CooSparse.prototype.getDenseShapeTensorName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.TensorInfo.CooSparse.prototype.setDenseShapeTensorName = function(value) { + jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.tensorflow.TensorInfo.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.TensorInfo.prototype.setName = function(value) { + jspb.Message.setOneofField(this, 1, proto.tensorflow.TensorInfo.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + */ +proto.tensorflow.TensorInfo.prototype.clearName = function() { + jspb.Message.setOneofField(this, 1, proto.tensorflow.TensorInfo.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.TensorInfo.prototype.hasName = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional CooSparse coo_sparse = 4; + * @return {?proto.tensorflow.TensorInfo.CooSparse} + */ +proto.tensorflow.TensorInfo.prototype.getCooSparse = function() { + return /** @type{?proto.tensorflow.TensorInfo.CooSparse} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.TensorInfo.CooSparse, 4)); +}; + + +/** @param {?proto.tensorflow.TensorInfo.CooSparse|undefined} value */ +proto.tensorflow.TensorInfo.prototype.setCooSparse = function(value) { + jspb.Message.setOneofWrapperField(this, 4, proto.tensorflow.TensorInfo.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.TensorInfo.prototype.clearCooSparse = function() { + this.setCooSparse(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.TensorInfo.prototype.hasCooSparse = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional DataType dtype = 2; + * @return {!proto.tensorflow.DataType} + */ +proto.tensorflow.TensorInfo.prototype.getDtype = function() { + return /** @type {!proto.tensorflow.DataType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {!proto.tensorflow.DataType} value */ +proto.tensorflow.TensorInfo.prototype.setDtype = function(value) { + jspb.Message.setProto3EnumField(this, 2, value); +}; + + +/** + * optional TensorShape tensor_shape = 3; + * @return {?proto.tensorflow.TensorShape} + */ +proto.tensorflow.TensorInfo.prototype.getTensorShape = function() { + return /** @type{?proto.tensorflow.TensorShape} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.TensorShape, 3)); +}; + + +/** @param {?proto.tensorflow.TensorShape|undefined} value */ +proto.tensorflow.TensorInfo.prototype.setTensorShape = function(value) { + jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.TensorInfo.prototype.clearTensorShape = function() { + this.setTensorShape(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.TensorInfo.prototype.hasTensorShape = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.SignatureDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.SignatureDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.SignatureDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.SignatureDef.toObject = function(includeInstance, msg) { + var f, obj = { + inputsMap: (f = msg.getInputsMap()) ? f.toObject(includeInstance, proto.tensorflow.TensorInfo.toObject) : [], + outputsMap: (f = msg.getOutputsMap()) ? f.toObject(includeInstance, proto.tensorflow.TensorInfo.toObject) : [], + methodName: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.SignatureDef} + */ +proto.tensorflow.SignatureDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.SignatureDef; + return proto.tensorflow.SignatureDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.SignatureDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.SignatureDef} + */ +proto.tensorflow.SignatureDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getInputsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.tensorflow.TensorInfo.deserializeBinaryFromReader, ""); + }); + break; + case 2: + var value = msg.getOutputsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.tensorflow.TensorInfo.deserializeBinaryFromReader, ""); + }); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setMethodName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.SignatureDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.SignatureDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.SignatureDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.SignatureDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getInputsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.tensorflow.TensorInfo.serializeBinaryToWriter); + } + f = message.getOutputsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.tensorflow.TensorInfo.serializeBinaryToWriter); + } + f = message.getMethodName(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * map inputs = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.tensorflow.SignatureDef.prototype.getInputsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + proto.tensorflow.TensorInfo)); +}; + + +/** + * Clears values from the map. The map will be non-null. + */ +proto.tensorflow.SignatureDef.prototype.clearInputsMap = function() { + this.getInputsMap().clear(); +}; + + +/** + * map outputs = 2; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.tensorflow.SignatureDef.prototype.getOutputsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 2, opt_noLazyCreate, + proto.tensorflow.TensorInfo)); +}; + + +/** + * Clears values from the map. The map will be non-null. + */ +proto.tensorflow.SignatureDef.prototype.clearOutputsMap = function() { + this.getOutputsMap().clear(); +}; + + +/** + * optional string method_name = 3; + * @return {string} + */ +proto.tensorflow.SignatureDef.prototype.getMethodName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.SignatureDef.prototype.setMethodName = function(value) { + jspb.Message.setProto3StringField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.AssetFileDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.AssetFileDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.AssetFileDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.AssetFileDef.toObject = function(includeInstance, msg) { + var f, obj = { + tensorInfo: (f = msg.getTensorInfo()) && proto.tensorflow.TensorInfo.toObject(includeInstance, f), + filename: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.AssetFileDef} + */ +proto.tensorflow.AssetFileDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.AssetFileDef; + return proto.tensorflow.AssetFileDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.AssetFileDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.AssetFileDef} + */ +proto.tensorflow.AssetFileDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.tensorflow.TensorInfo; + reader.readMessage(value,proto.tensorflow.TensorInfo.deserializeBinaryFromReader); + msg.setTensorInfo(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setFilename(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.AssetFileDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.AssetFileDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.AssetFileDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.AssetFileDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTensorInfo(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.tensorflow.TensorInfo.serializeBinaryToWriter + ); + } + f = message.getFilename(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional TensorInfo tensor_info = 1; + * @return {?proto.tensorflow.TensorInfo} + */ +proto.tensorflow.AssetFileDef.prototype.getTensorInfo = function() { + return /** @type{?proto.tensorflow.TensorInfo} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.TensorInfo, 1)); +}; + + +/** @param {?proto.tensorflow.TensorInfo|undefined} value */ +proto.tensorflow.AssetFileDef.prototype.setTensorInfo = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.AssetFileDef.prototype.clearTensorInfo = function() { + this.setTensorInfo(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.AssetFileDef.prototype.hasTensorInfo = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string filename = 2; + * @return {string} + */ +proto.tensorflow.AssetFileDef.prototype.getFilename = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.AssetFileDef.prototype.setFilename = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.OpDef.repeatedFields_ = [2,3,4]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.OpDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.OpDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.OpDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.OpDef.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + inputArgList: jspb.Message.toObjectList(msg.getInputArgList(), + proto.tensorflow.OpDef.ArgDef.toObject, includeInstance), + outputArgList: jspb.Message.toObjectList(msg.getOutputArgList(), + proto.tensorflow.OpDef.ArgDef.toObject, includeInstance), + attrList: jspb.Message.toObjectList(msg.getAttrList(), + proto.tensorflow.OpDef.AttrDef.toObject, includeInstance), + deprecation: (f = msg.getDeprecation()) && proto.tensorflow.OpDef.OpDeprecation.toObject(includeInstance, f), + summary: jspb.Message.getFieldWithDefault(msg, 5, ""), + description: jspb.Message.getFieldWithDefault(msg, 6, ""), + isCommutative: jspb.Message.getBooleanFieldWithDefault(msg, 18, false), + isAggregate: jspb.Message.getBooleanFieldWithDefault(msg, 16, false), + isStateful: jspb.Message.getBooleanFieldWithDefault(msg, 17, false), + allowsUninitializedInput: jspb.Message.getBooleanFieldWithDefault(msg, 19, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.OpDef} + */ +proto.tensorflow.OpDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.OpDef; + return proto.tensorflow.OpDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.OpDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.OpDef} + */ +proto.tensorflow.OpDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = new proto.tensorflow.OpDef.ArgDef; + reader.readMessage(value,proto.tensorflow.OpDef.ArgDef.deserializeBinaryFromReader); + msg.addInputArg(value); + break; + case 3: + var value = new proto.tensorflow.OpDef.ArgDef; + reader.readMessage(value,proto.tensorflow.OpDef.ArgDef.deserializeBinaryFromReader); + msg.addOutputArg(value); + break; + case 4: + var value = new proto.tensorflow.OpDef.AttrDef; + reader.readMessage(value,proto.tensorflow.OpDef.AttrDef.deserializeBinaryFromReader); + msg.addAttr(value); + break; + case 8: + var value = new proto.tensorflow.OpDef.OpDeprecation; + reader.readMessage(value,proto.tensorflow.OpDef.OpDeprecation.deserializeBinaryFromReader); + msg.setDeprecation(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setSummary(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setDescription(value); + break; + case 18: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsCommutative(value); + break; + case 16: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsAggregate(value); + break; + case 17: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsStateful(value); + break; + case 19: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setAllowsUninitializedInput(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.OpDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.OpDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.OpDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.OpDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getInputArgList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.tensorflow.OpDef.ArgDef.serializeBinaryToWriter + ); + } + f = message.getOutputArgList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.tensorflow.OpDef.ArgDef.serializeBinaryToWriter + ); + } + f = message.getAttrList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 4, + f, + proto.tensorflow.OpDef.AttrDef.serializeBinaryToWriter + ); + } + f = message.getDeprecation(); + if (f != null) { + writer.writeMessage( + 8, + f, + proto.tensorflow.OpDef.OpDeprecation.serializeBinaryToWriter + ); + } + f = message.getSummary(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getDescription(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getIsCommutative(); + if (f) { + writer.writeBool( + 18, + f + ); + } + f = message.getIsAggregate(); + if (f) { + writer.writeBool( + 16, + f + ); + } + f = message.getIsStateful(); + if (f) { + writer.writeBool( + 17, + f + ); + } + f = message.getAllowsUninitializedInput(); + if (f) { + writer.writeBool( + 19, + f + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.OpDef.ArgDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.OpDef.ArgDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.OpDef.ArgDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.OpDef.ArgDef.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + description: jspb.Message.getFieldWithDefault(msg, 2, ""), + type: jspb.Message.getFieldWithDefault(msg, 3, 0), + typeAttr: jspb.Message.getFieldWithDefault(msg, 4, ""), + numberAttr: jspb.Message.getFieldWithDefault(msg, 5, ""), + typeListAttr: jspb.Message.getFieldWithDefault(msg, 6, ""), + isRef: jspb.Message.getBooleanFieldWithDefault(msg, 16, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.OpDef.ArgDef} + */ +proto.tensorflow.OpDef.ArgDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.OpDef.ArgDef; + return proto.tensorflow.OpDef.ArgDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.OpDef.ArgDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.OpDef.ArgDef} + */ +proto.tensorflow.OpDef.ArgDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setDescription(value); + break; + case 3: + var value = /** @type {!proto.tensorflow.DataType} */ (reader.readEnum()); + msg.setType(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setTypeAttr(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setNumberAttr(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setTypeListAttr(value); + break; + case 16: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsRef(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.OpDef.ArgDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.OpDef.ArgDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.OpDef.ArgDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.OpDef.ArgDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getDescription(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getType(); + if (f !== 0.0) { + writer.writeEnum( + 3, + f + ); + } + f = message.getTypeAttr(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getNumberAttr(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getTypeListAttr(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getIsRef(); + if (f) { + writer.writeBool( + 16, + f + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.tensorflow.OpDef.ArgDef.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.ArgDef.prototype.setName = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string description = 2; + * @return {string} + */ +proto.tensorflow.OpDef.ArgDef.prototype.getDescription = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.ArgDef.prototype.setDescription = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional DataType type = 3; + * @return {!proto.tensorflow.DataType} + */ +proto.tensorflow.OpDef.ArgDef.prototype.getType = function() { + return /** @type {!proto.tensorflow.DataType} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {!proto.tensorflow.DataType} value */ +proto.tensorflow.OpDef.ArgDef.prototype.setType = function(value) { + jspb.Message.setProto3EnumField(this, 3, value); +}; + + +/** + * optional string type_attr = 4; + * @return {string} + */ +proto.tensorflow.OpDef.ArgDef.prototype.getTypeAttr = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.ArgDef.prototype.setTypeAttr = function(value) { + jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string number_attr = 5; + * @return {string} + */ +proto.tensorflow.OpDef.ArgDef.prototype.getNumberAttr = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.ArgDef.prototype.setNumberAttr = function(value) { + jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string type_list_attr = 6; + * @return {string} + */ +proto.tensorflow.OpDef.ArgDef.prototype.getTypeListAttr = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.ArgDef.prototype.setTypeListAttr = function(value) { + jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional bool is_ref = 16; + * @return {boolean} + */ +proto.tensorflow.OpDef.ArgDef.prototype.getIsRef = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 16, false)); +}; + + +/** @param {boolean} value */ +proto.tensorflow.OpDef.ArgDef.prototype.setIsRef = function(value) { + jspb.Message.setProto3BooleanField(this, 16, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.OpDef.AttrDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.OpDef.AttrDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.OpDef.AttrDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.OpDef.AttrDef.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + type: jspb.Message.getFieldWithDefault(msg, 2, ""), + defaultValue: (f = msg.getDefaultValue()) && proto.tensorflow.AttrValue.toObject(includeInstance, f), + description: jspb.Message.getFieldWithDefault(msg, 4, ""), + hasMinimum: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), + minimum: jspb.Message.getFieldWithDefault(msg, 6, 0), + allowedValues: (f = msg.getAllowedValues()) && proto.tensorflow.AttrValue.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.OpDef.AttrDef} + */ +proto.tensorflow.OpDef.AttrDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.OpDef.AttrDef; + return proto.tensorflow.OpDef.AttrDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.OpDef.AttrDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.OpDef.AttrDef} + */ +proto.tensorflow.OpDef.AttrDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setType(value); + break; + case 3: + var value = new proto.tensorflow.AttrValue; + reader.readMessage(value,proto.tensorflow.AttrValue.deserializeBinaryFromReader); + msg.setDefaultValue(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setDescription(value); + break; + case 5: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setHasMinimum(value); + break; + case 6: + var value = /** @type {number} */ (reader.readInt64()); + msg.setMinimum(value); + break; + case 7: + var value = new proto.tensorflow.AttrValue; + reader.readMessage(value,proto.tensorflow.AttrValue.deserializeBinaryFromReader); + msg.setAllowedValues(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.OpDef.AttrDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.OpDef.AttrDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.OpDef.AttrDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.OpDef.AttrDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getType(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getDefaultValue(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.tensorflow.AttrValue.serializeBinaryToWriter + ); + } + f = message.getDescription(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getHasMinimum(); + if (f) { + writer.writeBool( + 5, + f + ); + } + f = message.getMinimum(); + if (f !== 0) { + writer.writeInt64( + 6, + f + ); + } + f = message.getAllowedValues(); + if (f != null) { + writer.writeMessage( + 7, + f, + proto.tensorflow.AttrValue.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.tensorflow.OpDef.AttrDef.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.AttrDef.prototype.setName = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string type = 2; + * @return {string} + */ +proto.tensorflow.OpDef.AttrDef.prototype.getType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.AttrDef.prototype.setType = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional AttrValue default_value = 3; + * @return {?proto.tensorflow.AttrValue} + */ +proto.tensorflow.OpDef.AttrDef.prototype.getDefaultValue = function() { + return /** @type{?proto.tensorflow.AttrValue} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.AttrValue, 3)); +}; + + +/** @param {?proto.tensorflow.AttrValue|undefined} value */ +proto.tensorflow.OpDef.AttrDef.prototype.setDefaultValue = function(value) { + jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.OpDef.AttrDef.prototype.clearDefaultValue = function() { + this.setDefaultValue(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.OpDef.AttrDef.prototype.hasDefaultValue = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional string description = 4; + * @return {string} + */ +proto.tensorflow.OpDef.AttrDef.prototype.getDescription = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.AttrDef.prototype.setDescription = function(value) { + jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional bool has_minimum = 5; + * @return {boolean} + */ +proto.tensorflow.OpDef.AttrDef.prototype.getHasMinimum = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); +}; + + +/** @param {boolean} value */ +proto.tensorflow.OpDef.AttrDef.prototype.setHasMinimum = function(value) { + jspb.Message.setProto3BooleanField(this, 5, value); +}; + + +/** + * optional int64 minimum = 6; + * @return {number} + */ +proto.tensorflow.OpDef.AttrDef.prototype.getMinimum = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +}; + + +/** @param {number} value */ +proto.tensorflow.OpDef.AttrDef.prototype.setMinimum = function(value) { + jspb.Message.setProto3IntField(this, 6, value); +}; + + +/** + * optional AttrValue allowed_values = 7; + * @return {?proto.tensorflow.AttrValue} + */ +proto.tensorflow.OpDef.AttrDef.prototype.getAllowedValues = function() { + return /** @type{?proto.tensorflow.AttrValue} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.AttrValue, 7)); +}; + + +/** @param {?proto.tensorflow.AttrValue|undefined} value */ +proto.tensorflow.OpDef.AttrDef.prototype.setAllowedValues = function(value) { + jspb.Message.setWrapperField(this, 7, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.OpDef.AttrDef.prototype.clearAllowedValues = function() { + this.setAllowedValues(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.OpDef.AttrDef.prototype.hasAllowedValues = function() { + return jspb.Message.getField(this, 7) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.OpDef.OpDeprecation.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.OpDef.OpDeprecation.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.OpDef.OpDeprecation} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.OpDef.OpDeprecation.toObject = function(includeInstance, msg) { + var f, obj = { + version: jspb.Message.getFieldWithDefault(msg, 1, 0), + explanation: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.OpDef.OpDeprecation} + */ +proto.tensorflow.OpDef.OpDeprecation.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.OpDef.OpDeprecation; + return proto.tensorflow.OpDef.OpDeprecation.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.OpDef.OpDeprecation} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.OpDef.OpDeprecation} + */ +proto.tensorflow.OpDef.OpDeprecation.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setVersion(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setExplanation(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.OpDef.OpDeprecation.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.OpDef.OpDeprecation.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.OpDef.OpDeprecation} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.OpDef.OpDeprecation.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVersion(); + if (f !== 0) { + writer.writeInt32( + 1, + f + ); + } + f = message.getExplanation(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional int32 version = 1; + * @return {number} + */ +proto.tensorflow.OpDef.OpDeprecation.prototype.getVersion = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.tensorflow.OpDef.OpDeprecation.prototype.setVersion = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional string explanation = 2; + * @return {string} + */ +proto.tensorflow.OpDef.OpDeprecation.prototype.getExplanation = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.OpDeprecation.prototype.setExplanation = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.tensorflow.OpDef.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.prototype.setName = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * repeated ArgDef input_arg = 2; + * @return {!Array} + */ +proto.tensorflow.OpDef.prototype.getInputArgList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.OpDef.ArgDef, 2)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.OpDef.prototype.setInputArgList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.tensorflow.OpDef.ArgDef=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.OpDef.ArgDef} + */ +proto.tensorflow.OpDef.prototype.addInputArg = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.tensorflow.OpDef.ArgDef, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.OpDef.prototype.clearInputArgList = function() { + this.setInputArgList([]); +}; + + +/** + * repeated ArgDef output_arg = 3; + * @return {!Array} + */ +proto.tensorflow.OpDef.prototype.getOutputArgList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.OpDef.ArgDef, 3)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.OpDef.prototype.setOutputArgList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.tensorflow.OpDef.ArgDef=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.OpDef.ArgDef} + */ +proto.tensorflow.OpDef.prototype.addOutputArg = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.tensorflow.OpDef.ArgDef, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.OpDef.prototype.clearOutputArgList = function() { + this.setOutputArgList([]); +}; + + +/** + * repeated AttrDef attr = 4; + * @return {!Array} + */ +proto.tensorflow.OpDef.prototype.getAttrList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.OpDef.AttrDef, 4)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.OpDef.prototype.setAttrList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 4, value); +}; + + +/** + * @param {!proto.tensorflow.OpDef.AttrDef=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.OpDef.AttrDef} + */ +proto.tensorflow.OpDef.prototype.addAttr = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.tensorflow.OpDef.AttrDef, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.OpDef.prototype.clearAttrList = function() { + this.setAttrList([]); +}; + + +/** + * optional OpDeprecation deprecation = 8; + * @return {?proto.tensorflow.OpDef.OpDeprecation} + */ +proto.tensorflow.OpDef.prototype.getDeprecation = function() { + return /** @type{?proto.tensorflow.OpDef.OpDeprecation} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.OpDef.OpDeprecation, 8)); +}; + + +/** @param {?proto.tensorflow.OpDef.OpDeprecation|undefined} value */ +proto.tensorflow.OpDef.prototype.setDeprecation = function(value) { + jspb.Message.setWrapperField(this, 8, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.OpDef.prototype.clearDeprecation = function() { + this.setDeprecation(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.OpDef.prototype.hasDeprecation = function() { + return jspb.Message.getField(this, 8) != null; +}; + + +/** + * optional string summary = 5; + * @return {string} + */ +proto.tensorflow.OpDef.prototype.getSummary = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.prototype.setSummary = function(value) { + jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string description = 6; + * @return {string} + */ +proto.tensorflow.OpDef.prototype.getDescription = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.prototype.setDescription = function(value) { + jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional bool is_commutative = 18; + * @return {boolean} + */ +proto.tensorflow.OpDef.prototype.getIsCommutative = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 18, false)); +}; + + +/** @param {boolean} value */ +proto.tensorflow.OpDef.prototype.setIsCommutative = function(value) { + jspb.Message.setProto3BooleanField(this, 18, value); +}; + + +/** + * optional bool is_aggregate = 16; + * @return {boolean} + */ +proto.tensorflow.OpDef.prototype.getIsAggregate = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 16, false)); +}; + + +/** @param {boolean} value */ +proto.tensorflow.OpDef.prototype.setIsAggregate = function(value) { + jspb.Message.setProto3BooleanField(this, 16, value); +}; + + +/** + * optional bool is_stateful = 17; + * @return {boolean} + */ +proto.tensorflow.OpDef.prototype.getIsStateful = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 17, false)); +}; + + +/** @param {boolean} value */ +proto.tensorflow.OpDef.prototype.setIsStateful = function(value) { + jspb.Message.setProto3BooleanField(this, 17, value); +}; + + +/** + * optional bool allows_uninitialized_input = 19; + * @return {boolean} + */ +proto.tensorflow.OpDef.prototype.getAllowsUninitializedInput = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 19, false)); +}; + + +/** @param {boolean} value */ +proto.tensorflow.OpDef.prototype.setAllowsUninitializedInput = function(value) { + jspb.Message.setProto3BooleanField(this, 19, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.OpList.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.OpList.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.OpList.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.OpList} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.OpList.toObject = function(includeInstance, msg) { + var f, obj = { + opList: jspb.Message.toObjectList(msg.getOpList(), + proto.tensorflow.OpDef.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.OpList} + */ +proto.tensorflow.OpList.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.OpList; + return proto.tensorflow.OpList.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.OpList} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.OpList} + */ +proto.tensorflow.OpList.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.tensorflow.OpDef; + reader.readMessage(value,proto.tensorflow.OpDef.deserializeBinaryFromReader); + msg.addOp(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.OpList.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.OpList.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.OpList} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.OpList.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOpList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.tensorflow.OpDef.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated OpDef op = 1; + * @return {!Array} + */ +proto.tensorflow.OpList.prototype.getOpList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.OpDef, 1)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.OpList.prototype.setOpList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.tensorflow.OpDef=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.OpDef} + */ +proto.tensorflow.OpList.prototype.addOp = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.tensorflow.OpDef, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.OpList.prototype.clearOpList = function() { + this.setOpList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.MetaGraphDef.repeatedFields_ = [6]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.MetaGraphDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.MetaGraphDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.MetaGraphDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.MetaGraphDef.toObject = function(includeInstance, msg) { + var f, obj = { + metaInfoDef: (f = msg.getMetaInfoDef()) && proto.tensorflow.MetaGraphDef.MetaInfoDef.toObject(includeInstance, f), + graphDef: (f = msg.getGraphDef()) && proto.tensorflow.GraphDef.toObject(includeInstance, f), + saverDef: (f = msg.getSaverDef()) && proto.tensorflow.SaverDef.toObject(includeInstance, f), + collectionDefMap: (f = msg.getCollectionDefMap()) ? f.toObject(includeInstance, proto.tensorflow.CollectionDef.toObject) : [], + signatureDefMap: (f = msg.getSignatureDefMap()) ? f.toObject(includeInstance, proto.tensorflow.SignatureDef.toObject) : [], + assetFileDefList: jspb.Message.toObjectList(msg.getAssetFileDefList(), + proto.tensorflow.AssetFileDef.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.MetaGraphDef} + */ +proto.tensorflow.MetaGraphDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.MetaGraphDef; + return proto.tensorflow.MetaGraphDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.MetaGraphDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.MetaGraphDef} + */ +proto.tensorflow.MetaGraphDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.tensorflow.MetaGraphDef.MetaInfoDef; + reader.readMessage(value,proto.tensorflow.MetaGraphDef.MetaInfoDef.deserializeBinaryFromReader); + msg.setMetaInfoDef(value); + break; + case 2: + var value = new proto.tensorflow.GraphDef; + reader.readMessage(value,proto.tensorflow.GraphDef.deserializeBinaryFromReader); + msg.setGraphDef(value); + break; + case 3: + var value = new proto.tensorflow.SaverDef; + reader.readMessage(value,proto.tensorflow.SaverDef.deserializeBinaryFromReader); + msg.setSaverDef(value); + break; + case 4: + var value = msg.getCollectionDefMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.tensorflow.CollectionDef.deserializeBinaryFromReader, ""); + }); + break; + case 5: + var value = msg.getSignatureDefMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.tensorflow.SignatureDef.deserializeBinaryFromReader, ""); + }); + break; + case 6: + var value = new proto.tensorflow.AssetFileDef; + reader.readMessage(value,proto.tensorflow.AssetFileDef.deserializeBinaryFromReader); + msg.addAssetFileDef(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.MetaGraphDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.MetaGraphDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.MetaGraphDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.MetaGraphDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMetaInfoDef(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.tensorflow.MetaGraphDef.MetaInfoDef.serializeBinaryToWriter + ); + } + f = message.getGraphDef(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.tensorflow.GraphDef.serializeBinaryToWriter + ); + } + f = message.getSaverDef(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.tensorflow.SaverDef.serializeBinaryToWriter + ); + } + f = message.getCollectionDefMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.tensorflow.CollectionDef.serializeBinaryToWriter); + } + f = message.getSignatureDefMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.tensorflow.SignatureDef.serializeBinaryToWriter); + } + f = message.getAssetFileDefList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 6, + f, + proto.tensorflow.AssetFileDef.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.repeatedFields_ = [4]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.MetaGraphDef.MetaInfoDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.MetaGraphDef.MetaInfoDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.toObject = function(includeInstance, msg) { + var f, obj = { + metaGraphVersion: jspb.Message.getFieldWithDefault(msg, 1, ""), + strippedOpList: (f = msg.getStrippedOpList()) && proto.tensorflow.OpList.toObject(includeInstance, f), + anyInfo: (f = msg.getAnyInfo()) && proto.tensorflow.Any.toObject(includeInstance, f), + tagsList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f, + tensorflowVersion: jspb.Message.getFieldWithDefault(msg, 5, ""), + tensorflowGitVersion: jspb.Message.getFieldWithDefault(msg, 6, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.MetaGraphDef.MetaInfoDef} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.MetaGraphDef.MetaInfoDef; + return proto.tensorflow.MetaGraphDef.MetaInfoDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.MetaGraphDef.MetaInfoDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.MetaGraphDef.MetaInfoDef} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setMetaGraphVersion(value); + break; + case 2: + var value = new proto.tensorflow.OpList; + reader.readMessage(value,proto.tensorflow.OpList.deserializeBinaryFromReader); + msg.setStrippedOpList(value); + break; + case 3: + var value = new proto.tensorflow.Any; + reader.readMessage(value,proto.tensorflow.Any.deserializeBinaryFromReader); + msg.setAnyInfo(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.addTags(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setTensorflowVersion(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setTensorflowGitVersion(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.MetaGraphDef.MetaInfoDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.MetaGraphDef.MetaInfoDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMetaGraphVersion(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getStrippedOpList(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.tensorflow.OpList.serializeBinaryToWriter + ); + } + f = message.getAnyInfo(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.tensorflow.Any.serializeBinaryToWriter + ); + } + f = message.getTagsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 4, + f + ); + } + f = message.getTensorflowVersion(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getTensorflowGitVersion(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } +}; + + +/** + * optional string meta_graph_version = 1; + * @return {string} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.getMetaGraphVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.setMetaGraphVersion = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional OpList stripped_op_list = 2; + * @return {?proto.tensorflow.OpList} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.getStrippedOpList = function() { + return /** @type{?proto.tensorflow.OpList} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.OpList, 2)); +}; + + +/** @param {?proto.tensorflow.OpList|undefined} value */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.setStrippedOpList = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.clearStrippedOpList = function() { + this.setStrippedOpList(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.hasStrippedOpList = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional Any any_info = 3; + * @return {?proto.tensorflow.Any} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.getAnyInfo = function() { + return /** @type{?proto.tensorflow.Any} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.Any, 3)); +}; + + +/** @param {?proto.tensorflow.Any|undefined} value */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.setAnyInfo = function(value) { + jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.clearAnyInfo = function() { + this.setAnyInfo(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.hasAnyInfo = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * repeated string tags = 4; + * @return {!Array} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.getTagsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 4)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.setTagsList = function(value) { + jspb.Message.setField(this, 4, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.addTags = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 4, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.clearTagsList = function() { + this.setTagsList([]); +}; + + +/** + * optional string tensorflow_version = 5; + * @return {string} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.getTensorflowVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.setTensorflowVersion = function(value) { + jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string tensorflow_git_version = 6; + * @return {string} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.getTensorflowGitVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.setTensorflowGitVersion = function(value) { + jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional MetaInfoDef meta_info_def = 1; + * @return {?proto.tensorflow.MetaGraphDef.MetaInfoDef} + */ +proto.tensorflow.MetaGraphDef.prototype.getMetaInfoDef = function() { + return /** @type{?proto.tensorflow.MetaGraphDef.MetaInfoDef} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.MetaGraphDef.MetaInfoDef, 1)); +}; + + +/** @param {?proto.tensorflow.MetaGraphDef.MetaInfoDef|undefined} value */ +proto.tensorflow.MetaGraphDef.prototype.setMetaInfoDef = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.MetaGraphDef.prototype.clearMetaInfoDef = function() { + this.setMetaInfoDef(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.MetaGraphDef.prototype.hasMetaInfoDef = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional GraphDef graph_def = 2; + * @return {?proto.tensorflow.GraphDef} + */ +proto.tensorflow.MetaGraphDef.prototype.getGraphDef = function() { + return /** @type{?proto.tensorflow.GraphDef} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.GraphDef, 2)); +}; + + +/** @param {?proto.tensorflow.GraphDef|undefined} value */ +proto.tensorflow.MetaGraphDef.prototype.setGraphDef = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.MetaGraphDef.prototype.clearGraphDef = function() { + this.setGraphDef(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.MetaGraphDef.prototype.hasGraphDef = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional SaverDef saver_def = 3; + * @return {?proto.tensorflow.SaverDef} + */ +proto.tensorflow.MetaGraphDef.prototype.getSaverDef = function() { + return /** @type{?proto.tensorflow.SaverDef} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.SaverDef, 3)); +}; + + +/** @param {?proto.tensorflow.SaverDef|undefined} value */ +proto.tensorflow.MetaGraphDef.prototype.setSaverDef = function(value) { + jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.MetaGraphDef.prototype.clearSaverDef = function() { + this.setSaverDef(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.MetaGraphDef.prototype.hasSaverDef = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * map collection_def = 4; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.tensorflow.MetaGraphDef.prototype.getCollectionDefMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 4, opt_noLazyCreate, + proto.tensorflow.CollectionDef)); +}; + + +/** + * Clears values from the map. The map will be non-null. + */ +proto.tensorflow.MetaGraphDef.prototype.clearCollectionDefMap = function() { + this.getCollectionDefMap().clear(); +}; + + +/** + * map signature_def = 5; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.tensorflow.MetaGraphDef.prototype.getSignatureDefMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 5, opt_noLazyCreate, + proto.tensorflow.SignatureDef)); +}; + + +/** + * Clears values from the map. The map will be non-null. + */ +proto.tensorflow.MetaGraphDef.prototype.clearSignatureDefMap = function() { + this.getSignatureDefMap().clear(); +}; + + +/** + * repeated AssetFileDef asset_file_def = 6; + * @return {!Array} + */ +proto.tensorflow.MetaGraphDef.prototype.getAssetFileDefList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.AssetFileDef, 6)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.MetaGraphDef.prototype.setAssetFileDefList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 6, value); +}; + + +/** + * @param {!proto.tensorflow.AssetFileDef=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.AssetFileDef} + */ +proto.tensorflow.MetaGraphDef.prototype.addAssetFileDef = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.tensorflow.AssetFileDef, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.MetaGraphDef.prototype.clearAssetFileDefList = function() { + this.setAssetFileDefList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.SavedModel.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.SavedModel.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.SavedModel.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.SavedModel} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.SavedModel.toObject = function(includeInstance, msg) { + var f, obj = { + savedModelSchemaVersion: jspb.Message.getFieldWithDefault(msg, 1, 0), + metaGraphsList: jspb.Message.toObjectList(msg.getMetaGraphsList(), + proto.tensorflow.MetaGraphDef.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.SavedModel} + */ +proto.tensorflow.SavedModel.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.SavedModel; + return proto.tensorflow.SavedModel.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.SavedModel} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.SavedModel} + */ +proto.tensorflow.SavedModel.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setSavedModelSchemaVersion(value); + break; + case 2: + var value = new proto.tensorflow.MetaGraphDef; + reader.readMessage(value,proto.tensorflow.MetaGraphDef.deserializeBinaryFromReader); + msg.addMetaGraphs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.SavedModel.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.SavedModel.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.SavedModel} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.SavedModel.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSavedModelSchemaVersion(); + if (f !== 0) { + writer.writeInt64( + 1, + f + ); + } + f = message.getMetaGraphsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.tensorflow.MetaGraphDef.serializeBinaryToWriter + ); + } +}; + + +/** + * optional int64 saved_model_schema_version = 1; + * @return {number} + */ +proto.tensorflow.SavedModel.prototype.getSavedModelSchemaVersion = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.tensorflow.SavedModel.prototype.setSavedModelSchemaVersion = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * repeated MetaGraphDef meta_graphs = 2; + * @return {!Array} + */ +proto.tensorflow.SavedModel.prototype.getMetaGraphsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.MetaGraphDef, 2)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.SavedModel.prototype.setMetaGraphsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.tensorflow.MetaGraphDef=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.MetaGraphDef} + */ +proto.tensorflow.SavedModel.prototype.addMetaGraphs = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.tensorflow.MetaGraphDef, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.SavedModel.prototype.clearMetaGraphsList = function() { + this.setMetaGraphsList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.FunctionDefLibrary.repeatedFields_ = [1,2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.FunctionDefLibrary.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.FunctionDefLibrary.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.FunctionDefLibrary} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.FunctionDefLibrary.toObject = function(includeInstance, msg) { + var f, obj = { + functionList: jspb.Message.toObjectList(msg.getFunctionList(), + proto.tensorflow.FunctionDef.toObject, includeInstance), + gradientList: jspb.Message.toObjectList(msg.getGradientList(), + proto.tensorflow.GradientDef.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.FunctionDefLibrary} + */ +proto.tensorflow.FunctionDefLibrary.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.FunctionDefLibrary; + return proto.tensorflow.FunctionDefLibrary.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.FunctionDefLibrary} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.FunctionDefLibrary} + */ +proto.tensorflow.FunctionDefLibrary.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.tensorflow.FunctionDef; + reader.readMessage(value,proto.tensorflow.FunctionDef.deserializeBinaryFromReader); + msg.addFunction(value); + break; + case 2: + var value = new proto.tensorflow.GradientDef; + reader.readMessage(value,proto.tensorflow.GradientDef.deserializeBinaryFromReader); + msg.addGradient(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.FunctionDefLibrary.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.FunctionDefLibrary.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.FunctionDefLibrary} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.FunctionDefLibrary.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFunctionList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.tensorflow.FunctionDef.serializeBinaryToWriter + ); + } + f = message.getGradientList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.tensorflow.GradientDef.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated FunctionDef function = 1; + * @return {!Array} + */ +proto.tensorflow.FunctionDefLibrary.prototype.getFunctionList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.FunctionDef, 1)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.FunctionDefLibrary.prototype.setFunctionList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.tensorflow.FunctionDef=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.FunctionDef} + */ +proto.tensorflow.FunctionDefLibrary.prototype.addFunction = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.tensorflow.FunctionDef, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.FunctionDefLibrary.prototype.clearFunctionList = function() { + this.setFunctionList([]); +}; + + +/** + * repeated GradientDef gradient = 2; + * @return {!Array} + */ +proto.tensorflow.FunctionDefLibrary.prototype.getGradientList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.GradientDef, 2)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.FunctionDefLibrary.prototype.setGradientList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.tensorflow.GradientDef=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.GradientDef} + */ +proto.tensorflow.FunctionDefLibrary.prototype.addGradient = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.tensorflow.GradientDef, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.FunctionDefLibrary.prototype.clearGradientList = function() { + this.setGradientList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.FunctionDef.repeatedFields_ = [3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.FunctionDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.FunctionDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.FunctionDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.FunctionDef.toObject = function(includeInstance, msg) { + var f, obj = { + signature: (f = msg.getSignature()) && proto.tensorflow.OpDef.toObject(includeInstance, f), + attrMap: (f = msg.getAttrMap()) ? f.toObject(includeInstance, proto.tensorflow.AttrValue.toObject) : [], + nodeDefList: jspb.Message.toObjectList(msg.getNodeDefList(), + proto.tensorflow.NodeDef.toObject, includeInstance), + retMap: (f = msg.getRetMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.FunctionDef} + */ +proto.tensorflow.FunctionDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.FunctionDef; + return proto.tensorflow.FunctionDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.FunctionDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.FunctionDef} + */ +proto.tensorflow.FunctionDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.tensorflow.OpDef; + reader.readMessage(value,proto.tensorflow.OpDef.deserializeBinaryFromReader); + msg.setSignature(value); + break; + case 5: + var value = msg.getAttrMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.tensorflow.AttrValue.deserializeBinaryFromReader, ""); + }); + break; + case 3: + var value = new proto.tensorflow.NodeDef; + reader.readMessage(value,proto.tensorflow.NodeDef.deserializeBinaryFromReader); + msg.addNodeDef(value); + break; + case 4: + var value = msg.getRetMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.FunctionDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.FunctionDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.FunctionDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.FunctionDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSignature(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.tensorflow.OpDef.serializeBinaryToWriter + ); + } + f = message.getAttrMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.tensorflow.AttrValue.serializeBinaryToWriter); + } + f = message.getNodeDefList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.tensorflow.NodeDef.serializeBinaryToWriter + ); + } + f = message.getRetMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional OpDef signature = 1; + * @return {?proto.tensorflow.OpDef} + */ +proto.tensorflow.FunctionDef.prototype.getSignature = function() { + return /** @type{?proto.tensorflow.OpDef} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.OpDef, 1)); +}; + + +/** @param {?proto.tensorflow.OpDef|undefined} value */ +proto.tensorflow.FunctionDef.prototype.setSignature = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.FunctionDef.prototype.clearSignature = function() { + this.setSignature(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.FunctionDef.prototype.hasSignature = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * map attr = 5; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.tensorflow.FunctionDef.prototype.getAttrMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 5, opt_noLazyCreate, + proto.tensorflow.AttrValue)); +}; + + +/** + * Clears values from the map. The map will be non-null. + */ +proto.tensorflow.FunctionDef.prototype.clearAttrMap = function() { + this.getAttrMap().clear(); +}; + + +/** + * repeated NodeDef node_def = 3; + * @return {!Array} + */ +proto.tensorflow.FunctionDef.prototype.getNodeDefList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.NodeDef, 3)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.FunctionDef.prototype.setNodeDefList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.tensorflow.NodeDef=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.NodeDef} + */ +proto.tensorflow.FunctionDef.prototype.addNodeDef = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.tensorflow.NodeDef, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.FunctionDef.prototype.clearNodeDefList = function() { + this.setNodeDefList([]); +}; + + +/** + * map ret = 4; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.tensorflow.FunctionDef.prototype.getRetMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 4, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + */ +proto.tensorflow.FunctionDef.prototype.clearRetMap = function() { + this.getRetMap().clear(); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.GradientDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.GradientDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.GradientDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.GradientDef.toObject = function(includeInstance, msg) { + var f, obj = { + functionName: jspb.Message.getFieldWithDefault(msg, 1, ""), + gradientFunc: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.GradientDef} + */ +proto.tensorflow.GradientDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.GradientDef; + return proto.tensorflow.GradientDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.GradientDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.GradientDef} + */ +proto.tensorflow.GradientDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setFunctionName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setGradientFunc(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.GradientDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.GradientDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.GradientDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.GradientDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFunctionName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getGradientFunc(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string function_name = 1; + * @return {string} + */ +proto.tensorflow.GradientDef.prototype.getFunctionName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.GradientDef.prototype.setFunctionName = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string gradient_func = 2; + * @return {string} + */ +proto.tensorflow.GradientDef.prototype.getGradientFunc = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.GradientDef.prototype.setGradientFunc = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * @enum {number} + */ +proto.tensorflow.DataType = { + DT_INVALID: 0, + DT_FLOAT: 1, + DT_DOUBLE: 2, + DT_INT32: 3, + DT_UINT8: 4, + DT_INT16: 5, + DT_INT8: 6, + DT_STRING: 7, + DT_COMPLEX64: 8, + DT_INT64: 9, + DT_BOOL: 10, + DT_QINT8: 11, + DT_QUINT8: 12, + DT_QINT32: 13, + DT_BFLOAT16: 14, + DT_FLOAT_REF: 101, + DT_DOUBLE_REF: 102, + DT_INT32_REF: 103, + DT_UINT8_REF: 104, + DT_INT16_REF: 105, + DT_INT8_REF: 106, + DT_STRING_REF: 107, + DT_COMPLEX64_REF: 108, + DT_INT64_REF: 109, + DT_BOOL_REF: 110, + DT_QINT8_REF: 111, + DT_QUINT8_REF: 112, + DT_QINT32_REF: 113, + DT_BFLOAT16_REF: 114 +}; + +goog.object.extend(exports, proto.tensorflow); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node-fetch/LICENSE b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node-fetch/LICENSE new file mode 100755 index 000000000..9e841e7a2 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node-fetch/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node-fetch/README.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node-fetch/README.md new file mode 100755 index 000000000..967d38948 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node-fetch/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/node-fetch` + +# Summary +This package contains type definitions for node-fetch (https://github.com/bitinn/node-fetch). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-fetch. + +### Additional Details + * Last updated: Wed, 07 Apr 2021 23:31:26 GMT + * Dependencies: [@types/form-data](https://npmjs.com/package/@types/form-data), [@types/node](https://npmjs.com/package/@types/node) + * Global values: none + +# Credits +These definitions were written by [Torsten Werner](https://github.com/torstenwerner), [Niklas Lindgren](https://github.com/nikcorg), [Vinay Bedre](https://github.com/vinaybedre), [Antonio Román](https://github.com/kyranet), [Andrew Leedham](https://github.com/AndrewLeedham), [Jason Li](https://github.com/JasonLi914), [Steve Faulkner](https://github.com/southpolesteve), [ExE Boss](https://github.com/ExE-Boss), [Alex Savin](https://github.com/alexandrusavin), [Alexis Tyler](https://github.com/OmgImAlexis), and [Jakub Kisielewski](https://github.com/kbkk). diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node-fetch/externals.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node-fetch/externals.d.ts new file mode 100755 index 000000000..8bd7b3175 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node-fetch/externals.d.ts @@ -0,0 +1,21 @@ +// `AbortSignal` is defined here to prevent a dependency on a particular +// implementation like the `abort-controller` package, and to avoid requiring +// the `dom` library in `tsconfig.json`. + +export interface AbortSignal { + aborted: boolean; + + addEventListener: (type: "abort", listener: ((this: AbortSignal, event: any) => any), options?: boolean | { + capture?: boolean, + once?: boolean, + passive?: boolean + }) => void; + + removeEventListener: (type: "abort", listener: ((this: AbortSignal, event: any) => any), options?: boolean | { + capture?: boolean + }) => void; + + dispatchEvent: (event: any) => boolean; + + onabort: null | ((this: AbortSignal, event: any) => void); +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node-fetch/index.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node-fetch/index.d.ts new file mode 100755 index 000000000..a35486169 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node-fetch/index.d.ts @@ -0,0 +1,223 @@ +// Type definitions for node-fetch 2.5 +// Project: https://github.com/bitinn/node-fetch +// Definitions by: Torsten Werner +// Niklas Lindgren +// Vinay Bedre +// Antonio Román +// Andrew Leedham +// Jason Li +// Steve Faulkner +// ExE Boss +// Alex Savin +// Alexis Tyler +// Jakub Kisielewski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import FormData = require('form-data'); +import { Agent } from "http"; +import { URLSearchParams, URL } from "url"; +import { AbortSignal } from "./externals"; + +export class Request extends Body { + constructor(input: RequestInfo, init?: RequestInit); + clone(): Request; + context: RequestContext; + headers: Headers; + method: string; + redirect: RequestRedirect; + referrer: string; + url: string; + + // node-fetch extensions to the whatwg/fetch spec + agent?: Agent | ((parsedUrl: URL) => Agent); + compress: boolean; + counter: number; + follow: number; + hostname: string; + port?: number; + protocol: string; + size: number; + timeout: number; +} + +export interface RequestInit { + // whatwg/fetch standard options + body?: BodyInit; + headers?: HeadersInit; + method?: string; + redirect?: RequestRedirect; + signal?: AbortSignal | null; + + // node-fetch extensions + agent?: Agent | ((parsedUrl: URL) => Agent); // =null http.Agent instance, allows custom proxy, certificate etc. + compress?: boolean; // =true support gzip/deflate content encoding. false to disable + follow?: number; // =20 maximum redirect count. 0 to not follow redirect + size?: number; // =0 maximum response body size in bytes. 0 to disable + timeout?: number; // =0 req/res timeout in ms, it resets on redirect. 0 to disable (OS limit applies) + + // node-fetch does not support mode, cache or credentials options +} + +export type RequestContext = + "audio" + | "beacon" + | "cspreport" + | "download" + | "embed" + | "eventsource" + | "favicon" + | "fetch" + | "font" + | "form" + | "frame" + | "hyperlink" + | "iframe" + | "image" + | "imageset" + | "import" + | "internal" + | "location" + | "manifest" + | "object" + | "ping" + | "plugin" + | "prefetch" + | "script" + | "serviceworker" + | "sharedworker" + | "style" + | "subresource" + | "track" + | "video" + | "worker" + | "xmlhttprequest" + | "xslt"; +export type RequestMode = "cors" | "no-cors" | "same-origin"; +export type RequestRedirect = "error" | "follow" | "manual"; +export type RequestCredentials = "omit" | "include" | "same-origin"; + +export type RequestCache = + "default" + | "force-cache" + | "no-cache" + | "no-store" + | "only-if-cached" + | "reload"; + +export class Headers implements Iterable<[string, string]> { + constructor(init?: HeadersInit); + forEach(callback: (value: string, name: string) => void): void; + append(name: string, value: string): void; + delete(name: string): void; + get(name: string): string | null; + has(name: string): boolean; + raw(): { [k: string]: string[] }; + set(name: string, value: string): void; + + // Iterable methods + entries(): IterableIterator<[string, string]>; + keys(): IterableIterator; + values(): IterableIterator<[string]>; + [Symbol.iterator](): Iterator<[string, string]>; +} + +type BlobPart = ArrayBuffer | ArrayBufferView | Blob | string; + +interface BlobOptions { + type?: string; + endings?: "transparent" | "native"; +} + +export class Blob { + constructor(blobParts?: BlobPart[], options?: BlobOptions); + readonly type: string; + readonly size: number; + slice(start?: number, end?: number): Blob; + text(): Promise; +} + +export class Body { + constructor(body?: any, opts?: { size?: number; timeout?: number }); + arrayBuffer(): Promise; + blob(): Promise; + body: NodeJS.ReadableStream; + bodyUsed: boolean; + buffer(): Promise; + json(): Promise; + size: number; + text(): Promise; + textConverted(): Promise; + timeout: number; +} + +interface SystemError extends Error { + code?: string; +} + +export class FetchError extends Error { + name: "FetchError"; + constructor(message: string, type: string, systemError?: SystemError); + type: string; + code?: string; + errno?: string; +} + +export class Response extends Body { + constructor(body?: BodyInit, init?: ResponseInit); + static error(): Response; + static redirect(url: string, status: number): Response; + clone(): Response; + headers: Headers; + ok: boolean; + redirected: boolean; + status: number; + statusText: string; + type: ResponseType; + url: string; +} + +export type ResponseType = + "basic" + | "cors" + | "default" + | "error" + | "opaque" + | "opaqueredirect"; + +export interface ResponseInit { + headers?: HeadersInit; + size?: number; + status?: number; + statusText?: string; + timeout?: number; + url?: string; +} + +interface URLLike { + href: string; +} + +export type HeadersInit = Headers | string[][] | { [key: string]: string }; +// HeaderInit is exported to support backwards compatibility. See PR #34382 +export type HeaderInit = HeadersInit; +export type BodyInit = + ArrayBuffer + | ArrayBufferView + | NodeJS.ReadableStream + | string + | URLSearchParams + | FormData; +export type RequestInfo = string | URLLike | Request; + +declare function fetch( + url: RequestInfo, + init?: RequestInit +): Promise; + +declare namespace fetch { + function isRedirect(code: number): boolean; +} + +export default fetch; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node-fetch/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node-fetch/package.json new file mode 100755 index 000000000..26ba56349 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node-fetch/package.json @@ -0,0 +1,99 @@ +{ + "_args": [ + [ + "@types/node-fetch@2.5.10", + "/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning" + ] + ], + "_from": "@types/node-fetch@2.5.10", + "_id": "@types/node-fetch@2.5.10", + "_inBundle": false, + "_integrity": "sha512-IpkX0AasN44hgEad0gEF/V6EgR5n69VEqPEgnmoM8GsIGro3PowbWs4tR6IhxUTyPLpOn+fiGG6nrQhcmoCuIQ==", + "_location": "/@types/node-fetch", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@types/node-fetch@2.5.10", + "name": "@types/node-fetch", + "escapedName": "@types%2fnode-fetch", + "scope": "@types", + "rawSpec": "2.5.10", + "saveSpec": null, + "fetchSpec": "2.5.10" + }, + "_requiredBy": [ + "/@tensorflow/tfjs-data" + ], + "_resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.10.tgz", + "_spec": "2.5.10", + "_where": "/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning", + "bugs": { + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues" + }, + "contributors": [ + { + "name": "Torsten Werner", + "url": "https://github.com/torstenwerner" + }, + { + "name": "Niklas Lindgren", + "url": "https://github.com/nikcorg" + }, + { + "name": "Vinay Bedre", + "url": "https://github.com/vinaybedre" + }, + { + "name": "Antonio Román", + "url": "https://github.com/kyranet" + }, + { + "name": "Andrew Leedham", + "url": "https://github.com/AndrewLeedham" + }, + { + "name": "Jason Li", + "url": "https://github.com/JasonLi914" + }, + { + "name": "Steve Faulkner", + "url": "https://github.com/southpolesteve" + }, + { + "name": "ExE Boss", + "url": "https://github.com/ExE-Boss" + }, + { + "name": "Alex Savin", + "url": "https://github.com/alexandrusavin" + }, + { + "name": "Alexis Tyler", + "url": "https://github.com/OmgImAlexis" + }, + { + "name": "Jakub Kisielewski", + "url": "https://github.com/kbkk" + } + ], + "dependencies": { + "@types/node": "*", + "form-data": "^3.0.0" + }, + "description": "TypeScript definitions for node-fetch", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme", + "license": "MIT", + "main": "", + "name": "@types/node-fetch", + "repository": { + "type": "git", + "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/node-fetch" + }, + "scripts": {}, + "typeScriptVersion": "3.5", + "types": "index.d.ts", + "typesPublisherContentHash": "ba41bf0033e6f7864b7650dfea3f54b42695e03d6c533f710dc4d12604a8f249", + "version": "2.5.10" +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/LICENSE b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/LICENSE new file mode 100755 index 000000000..9e841e7a2 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/README.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/README.md new file mode 100755 index 000000000..0ca3518a8 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/node` + +# Summary +This package contains type definitions for Node.js (http://nodejs.org/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. + +### Additional Details + * Last updated: Tue, 25 May 2021 00:01:37 GMT + * Dependencies: none + * Global values: `AbortController`, `AbortSignal`, `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout` + +# Credits +These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Hoàng Văn Khải](https://github.com/KSXGitHub), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Minh Son Nguyen](https://github.com/nguymin4), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Surasak Chaisurin](https://github.com/Ryan-Willpower), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Jason Kwok](https://github.com/JasonHK), [Victor Perin](https://github.com/victorperin), and [Yongsheng Zhang](https://github.com/ZYSzys). diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/assert.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/assert.d.ts new file mode 100755 index 000000000..e9e358523 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/assert.d.ts @@ -0,0 +1,124 @@ +declare module 'assert' { + /** An alias of `assert.ok()`. */ + function assert(value: any, message?: string | Error): asserts value; + namespace assert { + class AssertionError extends Error { + actual: any; + expected: any; + operator: string; + generatedMessage: boolean; + code: 'ERR_ASSERTION'; + + constructor(options?: { + /** If provided, the error message is set to this value. */ + message?: string; + /** The `actual` property on the error instance. */ + actual?: any; + /** The `expected` property on the error instance. */ + expected?: any; + /** The `operator` property on the error instance. */ + operator?: string; + /** If provided, the generated stack trace omits frames before this function. */ + // tslint:disable-next-line:ban-types + stackStartFn?: Function; + }); + } + + class CallTracker { + calls(exact?: number): () => void; + calls any>(fn?: Func, exact?: number): Func; + report(): CallTrackerReportInformation[]; + verify(): void; + } + interface CallTrackerReportInformation { + message: string; + /** The actual number of times the function was called. */ + actual: number; + /** The number of times the function was expected to be called. */ + expected: number; + /** The name of the function that is wrapped. */ + operator: string; + /** A stack trace of the function. */ + stack: object; + } + + type AssertPredicate = RegExp | (new () => object) | ((thrown: any) => boolean) | object | Error; + + function fail(message?: string | Error): never; + /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */ + function fail( + actual: any, + expected: any, + message?: string | Error, + operator?: string, + // tslint:disable-next-line:ban-types + stackStartFn?: Function, + ): never; + function ok(value: any, message?: string | Error): asserts value; + /** @deprecated since v9.9.0 - use strictEqual() instead. */ + function equal(actual: any, expected: any, message?: string | Error): void; + /** @deprecated since v9.9.0 - use notStrictEqual() instead. */ + function notEqual(actual: any, expected: any, message?: string | Error): void; + /** @deprecated since v9.9.0 - use deepStrictEqual() instead. */ + function deepEqual(actual: any, expected: any, message?: string | Error): void; + /** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */ + function notDeepEqual(actual: any, expected: any, message?: string | Error): void; + function strictEqual(actual: any, expected: T, message?: string | Error): asserts actual is T; + function notStrictEqual(actual: any, expected: any, message?: string | Error): void; + function deepStrictEqual(actual: any, expected: T, message?: string | Error): asserts actual is T; + function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void; + + function throws(block: () => any, message?: string | Error): void; + function throws(block: () => any, error: AssertPredicate, message?: string | Error): void; + function doesNotThrow(block: () => any, message?: string | Error): void; + function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void; + + function ifError(value: any): asserts value is null | undefined; + + function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise; + function rejects( + block: (() => Promise) | Promise, + error: AssertPredicate, + message?: string | Error, + ): Promise; + function doesNotReject(block: (() => Promise) | Promise, message?: string | Error): Promise; + function doesNotReject( + block: (() => Promise) | Promise, + error: AssertPredicate, + message?: string | Error, + ): Promise; + + function match(value: string, regExp: RegExp, message?: string | Error): void; + function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void; + + const strict: Omit< + typeof assert, + | 'equal' + | 'notEqual' + | 'deepEqual' + | 'notDeepEqual' + | 'ok' + | 'strictEqual' + | 'deepStrictEqual' + | 'ifError' + | 'strict' + > & { + (value: any, message?: string | Error): asserts value; + equal: typeof strictEqual; + notEqual: typeof notStrictEqual; + deepEqual: typeof deepStrictEqual; + notDeepEqual: typeof notDeepStrictEqual; + + // Mapped types and assertion functions are incompatible? + // TS2775: Assertions require every name in the call target + // to be declared with an explicit type annotation. + ok: typeof ok; + strictEqual: typeof strictEqual; + deepStrictEqual: typeof deepStrictEqual; + ifError: typeof ifError; + strict: typeof strict; + }; + } + + export = assert; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/assert/strict.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/assert/strict.d.ts new file mode 100755 index 000000000..bc3b2a76c --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/assert/strict.d.ts @@ -0,0 +1,4 @@ +declare module 'assert/strict' { + import { strict } from 'assert'; + export = strict; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/async_hooks.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/async_hooks.d.ts new file mode 100755 index 000000000..92cc9ad68 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/async_hooks.d.ts @@ -0,0 +1,226 @@ +/** + * Async Hooks module: https://nodejs.org/api/async_hooks.html + */ +declare module 'async_hooks' { + /** + * Returns the asyncId of the current execution context. + */ + function executionAsyncId(): number; + + /** + * The resource representing the current execution. + * Useful to store data within the resource. + * + * Resource objects returned by `executionAsyncResource()` are most often internal + * Node.js handle objects with undocumented APIs. Using any functions or properties + * on the object is likely to crash your application and should be avoided. + * + * Using `executionAsyncResource()` in the top-level execution context will + * return an empty object as there is no handle or request object to use, + * but having an object representing the top-level can be helpful. + */ + function executionAsyncResource(): object; + + /** + * Returns the ID of the resource responsible for calling the callback that is currently being executed. + */ + function triggerAsyncId(): number; + + interface HookCallbacks { + /** + * Called when a class is constructed that has the possibility to emit an asynchronous event. + * @param asyncId a unique ID for the async resource + * @param type the type of the async resource + * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created + * @param resource reference to the resource representing the async operation, needs to be released during destroy + */ + init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void; + + /** + * When an asynchronous operation is initiated or completes a callback is called to notify the user. + * The before callback is called just before said callback is executed. + * @param asyncId the unique identifier assigned to the resource about to execute the callback. + */ + before?(asyncId: number): void; + + /** + * Called immediately after the callback specified in before is completed. + * @param asyncId the unique identifier assigned to the resource which has executed the callback. + */ + after?(asyncId: number): void; + + /** + * Called when a promise has resolve() called. This may not be in the same execution id + * as the promise itself. + * @param asyncId the unique id for the promise that was resolve()d. + */ + promiseResolve?(asyncId: number): void; + + /** + * Called after the resource corresponding to asyncId is destroyed + * @param asyncId a unique ID for the async resource + */ + destroy?(asyncId: number): void; + } + + interface AsyncHook { + /** + * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop. + */ + enable(): this; + + /** + * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled. + */ + disable(): this; + } + + /** + * Registers functions to be called for different lifetime events of each async operation. + * @param options the callbacks to register + * @return an AsyncHooks instance used for disabling and enabling hooks + */ + function createHook(options: HookCallbacks): AsyncHook; + + interface AsyncResourceOptions { + /** + * The ID of the execution context that created this async event. + * @default executionAsyncId() + */ + triggerAsyncId?: number; + + /** + * Disables automatic `emitDestroy` when the object is garbage collected. + * This usually does not need to be set (even if `emitDestroy` is called + * manually), unless the resource's `asyncId` is retrieved and the + * sensitive API's `emitDestroy` is called with it. + * @default false + */ + requireManualDestroy?: boolean; + } + + /** + * The class AsyncResource was designed to be extended by the embedder's async resources. + * Using this users can easily trigger the lifetime events of their own resources. + */ + class AsyncResource { + /** + * AsyncResource() is meant to be extended. Instantiating a + * new AsyncResource() also triggers init. If triggerAsyncId is omitted then + * async_hook.executionAsyncId() is used. + * @param type The type of async event. + * @param triggerAsyncId The ID of the execution context that created + * this async event (default: `executionAsyncId()`), or an + * AsyncResourceOptions object (since 9.3) + */ + constructor(type: string, triggerAsyncId?: number|AsyncResourceOptions); + + /** + * Binds the given function to the current execution context. + * @param fn The function to bind to the current execution context. + * @param type An optional name to associate with the underlying `AsyncResource`. + */ + static bind any>(fn: Func, type?: string): Func & { asyncResource: AsyncResource }; + + /** + * Binds the given function to execute to this `AsyncResource`'s scope. + * @param fn The function to bind to the current `AsyncResource`. + */ + bind any>(fn: Func): Func & { asyncResource: AsyncResource }; + + /** + * Call the provided function with the provided arguments in the + * execution context of the async resource. This will establish the + * context, trigger the AsyncHooks before callbacks, call the function, + * trigger the AsyncHooks after callbacks, and then restore the original + * execution context. + * @param fn The function to call in the execution context of this + * async resource. + * @param thisArg The receiver to be used for the function call. + * @param args Optional arguments to pass to the function. + */ + runInAsyncScope(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result; + + /** + * Call AsyncHooks destroy callbacks. + */ + emitDestroy(): this; + + /** + * @return the unique ID assigned to this AsyncResource instance. + */ + asyncId(): number; + + /** + * @return the trigger ID for this AsyncResource instance. + */ + triggerAsyncId(): number; + } + + /** + * When having multiple instances of `AsyncLocalStorage`, they are independent + * from each other. It is safe to instantiate this class multiple times. + */ + class AsyncLocalStorage { + /** + * This method disables the instance of `AsyncLocalStorage`. All subsequent calls + * to `asyncLocalStorage.getStore()` will return `undefined` until + * `asyncLocalStorage.run()` is called again. + * + * When calling `asyncLocalStorage.disable()`, all current contexts linked to the + * instance will be exited. + * + * Calling `asyncLocalStorage.disable()` is required before the + * `asyncLocalStorage` can be garbage collected. This does not apply to stores + * provided by the `asyncLocalStorage`, as those objects are garbage collected + * along with the corresponding async resources. + * + * This method is to be used when the `asyncLocalStorage` is not in use anymore + * in the current process. + */ + disable(): void; + + /** + * This method returns the current store. If this method is called outside of an + * asynchronous context initialized by calling `asyncLocalStorage.run`, it will + * return `undefined`. + */ + getStore(): T | undefined; + + /** + * This methods runs a function synchronously within a context and return its + * return value. The store is not accessible outside of the callback function or + * the asynchronous operations created within the callback. + * + * Optionally, arguments can be passed to the function. They will be passed to the + * callback function. + * + * I the callback function throws an error, it will be thrown by `run` too. The + * stacktrace will not be impacted by this call and the context will be exited. + */ + // TODO: Apply generic vararg once available + run(store: T, callback: (...args: any[]) => R, ...args: any[]): R; + + /** + * This methods runs a function synchronously outside of a context and return its + * return value. The store is not accessible within the callback function or the + * asynchronous operations created within the callback. + * + * Optionally, arguments can be passed to the function. They will be passed to the + * callback function. + * + * If the callback function throws an error, it will be thrown by `exit` too. The + * stacktrace will not be impacted by this call and the context will be + * re-entered. + */ + // TODO: Apply generic vararg once available + exit(callback: (...args: any[]) => R, ...args: any[]): R; + + /** + * Calling `asyncLocalStorage.enterWith(store)` will transition into the context + * for the remainder of the current synchronous execution and will persist + * through any following asynchronous calls. + */ + enterWith(store: T): void; + } +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/base.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/base.d.ts new file mode 100755 index 000000000..fa671790e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/base.d.ts @@ -0,0 +1,19 @@ +// NOTE: These definitions support NodeJS and TypeScript 3.7. + +// NOTE: TypeScript version-specific augmentations can be found in the following paths: +// - ~/base.d.ts - Shared definitions common to all TypeScript versions +// - ~/index.d.ts - Definitions specific to TypeScript 2.1 +// - ~/ts3.7/base.d.ts - Definitions specific to TypeScript 3.7 +// - ~/ts3.7/index.d.ts - Definitions specific to TypeScript 3.7 with assert pulled in + +// Reference required types from the default lib: +/// +/// +/// +/// + +// Base definitions for all NodeJS modules that are not specific to any version of TypeScript: +/// + +// TypeScript 3.7-specific augmentations: +/// diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/buffer.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/buffer.d.ts new file mode 100755 index 000000000..0aa039c56 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/buffer.d.ts @@ -0,0 +1,22 @@ +declare module 'buffer' { + export const INSPECT_MAX_BYTES: number; + export const kMaxLength: number; + export const kStringMaxLength: number; + export const constants: { + MAX_LENGTH: number; + MAX_STRING_LENGTH: number; + }; + const BuffType: typeof Buffer; + + export type TranscodeEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "latin1" | "binary"; + + export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer; + + export const SlowBuffer: { + /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */ + new(size: number): Buffer; + prototype: Buffer; + }; + + export { BuffType as Buffer }; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/child_process.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/child_process.d.ts new file mode 100755 index 000000000..1fa211f1d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/child_process.d.ts @@ -0,0 +1,521 @@ +declare module 'child_process' { + import { BaseEncodingOptions } from 'fs'; + import { EventEmitter, Abortable } from 'events'; + import * as net from 'net'; + import { Writable, Readable, Stream, Pipe } from 'stream'; + + type Serializable = string | object | number | boolean; + type SendHandle = net.Socket | net.Server; + + interface ChildProcess extends EventEmitter { + stdin: Writable | null; + stdout: Readable | null; + stderr: Readable | null; + readonly channel?: Pipe | null; + readonly stdio: [ + Writable | null, // stdin + Readable | null, // stdout + Readable | null, // stderr + Readable | Writable | null | undefined, // extra + Readable | Writable | null | undefined // extra + ]; + readonly killed: boolean; + readonly pid: number; + readonly connected: boolean; + readonly exitCode: number | null; + readonly signalCode: NodeJS.Signals | null; + readonly spawnargs: string[]; + readonly spawnfile: string; + kill(signal?: NodeJS.Signals | number): boolean; + send(message: Serializable, callback?: (error: Error | null) => void): boolean; + send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean; + send(message: Serializable, sendHandle?: SendHandle, options?: MessageOptions, callback?: (error: Error | null) => void): boolean; + disconnect(): void; + unref(): void; + ref(): void; + + /** + * events.EventEmitter + * 1. close + * 2. disconnect + * 3. error + * 4. exit + * 5. message + * 6. spawn + */ + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + addListener(event: "disconnect", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + addListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; + addListener(event: "spawn", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close", code: number | null, signal: NodeJS.Signals | null): boolean; + emit(event: "disconnect"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "exit", code: number | null, signal: NodeJS.Signals | null): boolean; + emit(event: "message", message: Serializable, sendHandle: SendHandle): boolean; + emit(event: "spawn", listener: () => void): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + on(event: "disconnect", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + on(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; + on(event: "spawn", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + once(event: "disconnect", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + once(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; + once(event: "spawn", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + prependListener(event: "disconnect", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + prependListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; + prependListener(event: "spawn", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + prependOnceListener(event: "disconnect", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + prependOnceListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this; + prependOnceListener(event: "spawn", listener: () => void): this; + } + + // return this object when stdio option is undefined or not specified + interface ChildProcessWithoutNullStreams extends ChildProcess { + stdin: Writable; + stdout: Readable; + stderr: Readable; + readonly stdio: [ + Writable, // stdin + Readable, // stdout + Readable, // stderr + Readable | Writable | null | undefined, // extra, no modification + Readable | Writable | null | undefined // extra, no modification + ]; + } + + // return this object when stdio option is a tuple of 3 + interface ChildProcessByStdio< + I extends null | Writable, + O extends null | Readable, + E extends null | Readable, + > extends ChildProcess { + stdin: I; + stdout: O; + stderr: E; + readonly stdio: [ + I, + O, + E, + Readable | Writable | null | undefined, // extra, no modification + Readable | Writable | null | undefined // extra, no modification + ]; + } + + interface MessageOptions { + keepOpen?: boolean; + } + + type IOType = "overlapped" | "pipe" | "ignore" | "inherit"; + + type StdioOptions = IOType | Array<(IOType | "ipc" | Stream | number | null | undefined)>; + + type SerializationType = 'json' | 'advanced'; + + interface MessagingOptions { + /** + * Specify the kind of serialization used for sending messages between processes. + * @default 'json' + */ + serialization?: SerializationType; + } + + interface ProcessEnvOptions { + uid?: number; + gid?: number; + cwd?: string; + env?: NodeJS.ProcessEnv; + } + + interface CommonOptions extends ProcessEnvOptions { + /** + * @default true + */ + windowsHide?: boolean; + /** + * @default 0 + */ + timeout?: number; + } + + interface CommonSpawnOptions extends CommonOptions, MessagingOptions, Abortable { + argv0?: string; + stdio?: StdioOptions; + shell?: boolean | string; + windowsVerbatimArguments?: boolean; + } + + interface SpawnOptions extends CommonSpawnOptions { + detached?: boolean; + } + + interface SpawnOptionsWithoutStdio extends SpawnOptions { + stdio?: StdioPipeNamed | StdioPipe[]; + } + + type StdioNull = 'inherit' | 'ignore' | Stream; + type StdioPipeNamed = 'pipe' | 'overlapped'; + type StdioPipe = undefined | null | StdioPipeNamed; + + interface SpawnOptionsWithStdioTuple< + Stdin extends StdioNull | StdioPipe, + Stdout extends StdioNull | StdioPipe, + Stderr extends StdioNull | StdioPipe, + > extends SpawnOptions { + stdio: [Stdin, Stdout, Stderr]; + } + + // overloads of spawn without 'args' + function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; + + function spawn( + command: string, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + + function spawn(command: string, options: SpawnOptions): ChildProcess; + + // overloads of spawn with 'args' + function spawn(command: string, args?: ReadonlyArray, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; + + function spawn( + command: string, + args: ReadonlyArray, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + args: ReadonlyArray, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + args: ReadonlyArray, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + args: ReadonlyArray, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + args: ReadonlyArray, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + args: ReadonlyArray, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + args: ReadonlyArray, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + function spawn( + command: string, + args: ReadonlyArray, + options: SpawnOptionsWithStdioTuple, + ): ChildProcessByStdio; + + function spawn(command: string, args: ReadonlyArray, options: SpawnOptions): ChildProcess; + + interface ExecOptions extends CommonOptions { + shell?: string; + maxBuffer?: number; + killSignal?: NodeJS.Signals | number; + } + + interface ExecOptionsWithStringEncoding extends ExecOptions { + encoding: BufferEncoding; + } + + interface ExecOptionsWithBufferEncoding extends ExecOptions { + encoding: BufferEncoding | null; // specify `null`. + } + + interface ExecException extends Error { + cmd?: string; + killed?: boolean; + code?: number; + signal?: NodeJS.Signals; + } + + // no `options` definitely means stdout/stderr are `string`. + function exec(command: string, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; + + // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. + function exec(command: string, options: { encoding: "buffer" | null } & ExecOptions, callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + + // `options` with well known `encoding` means stdout/stderr are definitely `string`. + function exec(command: string, options: { encoding: BufferEncoding } & ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; + + // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. + // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. + function exec( + command: string, + options: { encoding: BufferEncoding } & ExecOptions, + callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void, + ): ChildProcess; + + // `options` without an `encoding` means stdout/stderr are definitely `string`. + function exec(command: string, options: ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; + + // fallback if nothing else matches. Worst case is always `string | Buffer`. + function exec( + command: string, + options: (BaseEncodingOptions & ExecOptions) | undefined | null, + callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void, + ): ChildProcess; + + interface PromiseWithChild extends Promise { + child: ChildProcess; + } + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace exec { + function __promisify__(command: string): PromiseWithChild<{ stdout: string, stderr: string }>; + function __promisify__(command: string, options: { encoding: "buffer" | null } & ExecOptions): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>; + function __promisify__(command: string, options: { encoding: BufferEncoding } & ExecOptions): PromiseWithChild<{ stdout: string, stderr: string }>; + function __promisify__(command: string, options: ExecOptions): PromiseWithChild<{ stdout: string, stderr: string }>; + function __promisify__(command: string, options?: (BaseEncodingOptions & ExecOptions) | null): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>; + } + + interface ExecFileOptions extends CommonOptions, Abortable { + maxBuffer?: number; + killSignal?: NodeJS.Signals | number; + windowsVerbatimArguments?: boolean; + shell?: boolean | string; + signal?: AbortSignal; + } + interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { + encoding: BufferEncoding; + } + interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { + encoding: 'buffer' | null; + } + interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions { + encoding: BufferEncoding; + } + type ExecFileException = ExecException & NodeJS.ErrnoException; + + function execFile(file: string): ChildProcess; + function execFile(file: string, options: (BaseEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess; + function execFile(file: string, args?: ReadonlyArray | null): ChildProcess; + function execFile(file: string, args: ReadonlyArray | undefined | null, options: (BaseEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess; + + // no `options` definitely means stdout/stderr are `string`. + function execFile(file: string, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; + function execFile(file: string, args: ReadonlyArray | undefined | null, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; + + // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. + function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithBufferEncoding, + callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void, + ): ChildProcess; + + // `options` with well known `encoding` means stdout/stderr are definitely `string`. + function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithStringEncoding, + callback: (error: ExecFileException | null, stdout: string, stderr: string) => void, + ): ChildProcess; + + // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. + // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. + function execFile( + file: string, + options: ExecFileOptionsWithOtherEncoding, + callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void, + ): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithOtherEncoding, + callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void, + ): ChildProcess; + + // `options` without an `encoding` means stdout/stderr are definitely `string`. + function execFile(file: string, options: ExecFileOptions, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptions, + callback: (error: ExecFileException | null, stdout: string, stderr: string) => void + ): ChildProcess; + + // fallback if nothing else matches. Worst case is always `string | Buffer`. + function execFile( + file: string, + options: (BaseEncodingOptions & ExecFileOptions) | undefined | null, + callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null, + ): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: (BaseEncodingOptions & ExecFileOptions) | undefined | null, + callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null, + ): ChildProcess; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace execFile { + function __promisify__(file: string): PromiseWithChild<{ stdout: string, stderr: string }>; + function __promisify__(file: string, args: ReadonlyArray | undefined | null): PromiseWithChild<{ stdout: string, stderr: string }>; + function __promisify__(file: string, options: ExecFileOptionsWithBufferEncoding): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>; + function __promisify__(file: string, args: ReadonlyArray | undefined | null, options: ExecFileOptionsWithBufferEncoding): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>; + function __promisify__(file: string, options: ExecFileOptionsWithStringEncoding): PromiseWithChild<{ stdout: string, stderr: string }>; + function __promisify__(file: string, args: ReadonlyArray | undefined | null, options: ExecFileOptionsWithStringEncoding): PromiseWithChild<{ stdout: string, stderr: string }>; + function __promisify__(file: string, options: ExecFileOptionsWithOtherEncoding): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithOtherEncoding, + ): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>; + function __promisify__(file: string, options: ExecFileOptions): PromiseWithChild<{ stdout: string, stderr: string }>; + function __promisify__(file: string, args: ReadonlyArray | undefined | null, options: ExecFileOptions): PromiseWithChild<{ stdout: string, stderr: string }>; + function __promisify__(file: string, options: (BaseEncodingOptions & ExecFileOptions) | undefined | null): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null, + options: (BaseEncodingOptions & ExecFileOptions) | undefined | null, + ): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>; + } + + interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable { + execPath?: string; + execArgv?: string[]; + silent?: boolean; + stdio?: StdioOptions; + detached?: boolean; + windowsVerbatimArguments?: boolean; + } + function fork(modulePath: string, options?: ForkOptions): ChildProcess; + function fork(modulePath: string, args?: ReadonlyArray, options?: ForkOptions): ChildProcess; + + interface SpawnSyncOptions extends CommonSpawnOptions { + input?: string | NodeJS.ArrayBufferView; + killSignal?: NodeJS.Signals | number; + maxBuffer?: number; + encoding?: BufferEncoding | 'buffer' | null; + } + interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { + encoding: BufferEncoding; + } + interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { + encoding?: 'buffer' | null; + } + interface SpawnSyncReturns { + pid: number; + output: string[]; + stdout: T; + stderr: T; + status: number | null; + signal: NodeJS.Signals | null; + error?: Error; + } + function spawnSync(command: string): SpawnSyncReturns; + function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; + function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptions): SpawnSyncReturns; + + interface ExecSyncOptions extends CommonOptions { + input?: string | Uint8Array; + stdio?: StdioOptions; + shell?: string; + killSignal?: NodeJS.Signals | number; + maxBuffer?: number; + encoding?: BufferEncoding | 'buffer' | null; + } + interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { + encoding: BufferEncoding; + } + interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { + encoding?: 'buffer' | null; + } + function execSync(command: string): Buffer; + function execSync(command: string, options?: ExecSyncOptionsWithStringEncoding): string; + function execSync(command: string, options?: ExecSyncOptionsWithBufferEncoding): Buffer; + function execSync(command: string, options?: ExecSyncOptions): Buffer; + + interface ExecFileSyncOptions extends CommonOptions { + input?: string | NodeJS.ArrayBufferView; + stdio?: StdioOptions; + killSignal?: NodeJS.Signals | number; + maxBuffer?: number; + encoding?: BufferEncoding; + shell?: boolean | string; + } + interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { + encoding: BufferEncoding; + } + interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { + encoding: BufferEncoding; // specify `null`. + } + function execFileSync(command: string): Buffer; + function execFileSync(command: string, options?: ExecFileSyncOptionsWithStringEncoding): string; + function execFileSync(command: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer; + function execFileSync(command: string, options?: ExecFileSyncOptions): Buffer; + function execFileSync(command: string, args?: ReadonlyArray, options?: ExecFileSyncOptionsWithStringEncoding): string; + function execFileSync(command: string, args?: ReadonlyArray, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer; + function execFileSync(command: string, args?: ReadonlyArray, options?: ExecFileSyncOptions): Buffer; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/cluster.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/cluster.d.ts new file mode 100755 index 000000000..511763934 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/cluster.d.ts @@ -0,0 +1,262 @@ +declare module 'cluster' { + import * as child from 'child_process'; + import EventEmitter = require('events'); + import * as net from 'net'; + + // interfaces + interface ClusterSettings { + execArgv?: string[]; // default: process.execArgv + exec?: string; + args?: string[]; + silent?: boolean; + stdio?: any[]; + uid?: number; + gid?: number; + inspectPort?: number | (() => number); + } + + interface Address { + address: string; + port: number; + addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6" + } + + class Worker extends EventEmitter { + id: number; + process: child.ChildProcess; + send(message: child.Serializable, sendHandle?: child.SendHandle, callback?: (error: Error | null) => void): boolean; + kill(signal?: string): void; + destroy(signal?: string): void; + disconnect(): void; + isConnected(): boolean; + isDead(): boolean; + exitedAfterDisconnect: boolean; + + /** + * events.EventEmitter + * 1. disconnect + * 2. error + * 3. exit + * 4. listening + * 5. message + * 6. online + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "disconnect", listener: () => void): this; + addListener(event: "error", listener: (error: Error) => void): this; + addListener(event: "exit", listener: (code: number, signal: string) => void): this; + addListener(event: "listening", listener: (address: Address) => void): this; + addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + addListener(event: "online", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "disconnect"): boolean; + emit(event: "error", error: Error): boolean; + emit(event: "exit", code: number, signal: string): boolean; + emit(event: "listening", address: Address): boolean; + emit(event: "message", message: any, handle: net.Socket | net.Server): boolean; + emit(event: "online"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "disconnect", listener: () => void): this; + on(event: "error", listener: (error: Error) => void): this; + on(event: "exit", listener: (code: number, signal: string) => void): this; + on(event: "listening", listener: (address: Address) => void): this; + on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + on(event: "online", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "disconnect", listener: () => void): this; + once(event: "error", listener: (error: Error) => void): this; + once(event: "exit", listener: (code: number, signal: string) => void): this; + once(event: "listening", listener: (address: Address) => void): this; + once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + once(event: "online", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "disconnect", listener: () => void): this; + prependListener(event: "error", listener: (error: Error) => void): this; + prependListener(event: "exit", listener: (code: number, signal: string) => void): this; + prependListener(event: "listening", listener: (address: Address) => void): this; + prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependListener(event: "online", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "disconnect", listener: () => void): this; + prependOnceListener(event: "error", listener: (error: Error) => void): this; + prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this; + prependOnceListener(event: "listening", listener: (address: Address) => void): this; + prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependOnceListener(event: "online", listener: () => void): this; + } + + interface Cluster extends EventEmitter { + Worker: Worker; + disconnect(callback?: () => void): void; + fork(env?: any): Worker; + isMaster: boolean; + isWorker: boolean; + schedulingPolicy: number; + settings: ClusterSettings; + setupMaster(settings?: ClusterSettings): void; + worker?: Worker; + workers?: NodeJS.Dict; + + readonly SCHED_NONE: number; + readonly SCHED_RR: number; + + /** + * events.EventEmitter + * 1. disconnect + * 2. exit + * 3. fork + * 4. listening + * 5. message + * 6. online + * 7. setup + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "disconnect", listener: (worker: Worker) => void): this; + addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + addListener(event: "fork", listener: (worker: Worker) => void): this; + addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; + addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + addListener(event: "online", listener: (worker: Worker) => void): this; + addListener(event: "setup", listener: (settings: ClusterSettings) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "disconnect", worker: Worker): boolean; + emit(event: "exit", worker: Worker, code: number, signal: string): boolean; + emit(event: "fork", worker: Worker): boolean; + emit(event: "listening", worker: Worker, address: Address): boolean; + emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean; + emit(event: "online", worker: Worker): boolean; + emit(event: "setup", settings: ClusterSettings): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "disconnect", listener: (worker: Worker) => void): this; + on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + on(event: "fork", listener: (worker: Worker) => void): this; + on(event: "listening", listener: (worker: Worker, address: Address) => void): this; + on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + on(event: "online", listener: (worker: Worker) => void): this; + on(event: "setup", listener: (settings: ClusterSettings) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "disconnect", listener: (worker: Worker) => void): this; + once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + once(event: "fork", listener: (worker: Worker) => void): this; + once(event: "listening", listener: (worker: Worker, address: Address) => void): this; + once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + once(event: "online", listener: (worker: Worker) => void): this; + once(event: "setup", listener: (settings: ClusterSettings) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "disconnect", listener: (worker: Worker) => void): this; + prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + prependListener(event: "fork", listener: (worker: Worker) => void): this; + prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; + prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependListener(event: "online", listener: (worker: Worker) => void): this; + prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this; + prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + prependOnceListener(event: "fork", listener: (worker: Worker) => void): this; + prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; + // the handle is a net.Socket or net.Server object, or undefined. + prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; + prependOnceListener(event: "online", listener: (worker: Worker) => void): this; + prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this; + } + + const SCHED_NONE: number; + const SCHED_RR: number; + + function disconnect(callback?: () => void): void; + function fork(env?: any): Worker; + const isMaster: boolean; + const isWorker: boolean; + let schedulingPolicy: number; + const settings: ClusterSettings; + function setupMaster(settings?: ClusterSettings): void; + const worker: Worker; + const workers: NodeJS.Dict; + + /** + * events.EventEmitter + * 1. disconnect + * 2. exit + * 3. fork + * 4. listening + * 5. message + * 6. online + * 7. setup + */ + function addListener(event: string, listener: (...args: any[]) => void): Cluster; + function addListener(event: "disconnect", listener: (worker: Worker) => void): Cluster; + function addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + function addListener(event: "fork", listener: (worker: Worker) => void): Cluster; + function addListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + // the handle is a net.Socket or net.Server object, or undefined. + function addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; + function addListener(event: "online", listener: (worker: Worker) => void): Cluster; + function addListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster; + + function emit(event: string | symbol, ...args: any[]): boolean; + function emit(event: "disconnect", worker: Worker): boolean; + function emit(event: "exit", worker: Worker, code: number, signal: string): boolean; + function emit(event: "fork", worker: Worker): boolean; + function emit(event: "listening", worker: Worker, address: Address): boolean; + function emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean; + function emit(event: "online", worker: Worker): boolean; + function emit(event: "setup", settings: ClusterSettings): boolean; + + function on(event: string, listener: (...args: any[]) => void): Cluster; + function on(event: "disconnect", listener: (worker: Worker) => void): Cluster; + function on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + function on(event: "fork", listener: (worker: Worker) => void): Cluster; + function on(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + function on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + function on(event: "online", listener: (worker: Worker) => void): Cluster; + function on(event: "setup", listener: (settings: ClusterSettings) => void): Cluster; + + function once(event: string, listener: (...args: any[]) => void): Cluster; + function once(event: "disconnect", listener: (worker: Worker) => void): Cluster; + function once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + function once(event: "fork", listener: (worker: Worker) => void): Cluster; + function once(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + function once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + function once(event: "online", listener: (worker: Worker) => void): Cluster; + function once(event: "setup", listener: (settings: ClusterSettings) => void): Cluster; + + function removeListener(event: string, listener: (...args: any[]) => void): Cluster; + function removeAllListeners(event?: string): Cluster; + function setMaxListeners(n: number): Cluster; + function getMaxListeners(): number; + function listeners(event: string): Function[]; + function listenerCount(type: string): number; + + function prependListener(event: string, listener: (...args: any[]) => void): Cluster; + function prependListener(event: "disconnect", listener: (worker: Worker) => void): Cluster; + function prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + function prependListener(event: "fork", listener: (worker: Worker) => void): Cluster; + function prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + // the handle is a net.Socket or net.Server object, or undefined. + function prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; + function prependListener(event: "online", listener: (worker: Worker) => void): Cluster; + function prependListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster; + + function prependOnceListener(event: string, listener: (...args: any[]) => void): Cluster; + function prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): Cluster; + function prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + function prependOnceListener(event: "fork", listener: (worker: Worker) => void): Cluster; + function prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + // the handle is a net.Socket or net.Server object, or undefined. + function prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; + function prependOnceListener(event: "online", listener: (worker: Worker) => void): Cluster; + function prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster; + + function eventNames(): string[]; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/console.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/console.d.ts new file mode 100755 index 000000000..102042cc7 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/console.d.ts @@ -0,0 +1,133 @@ +declare module 'console' { + import { InspectOptions } from 'util'; + + global { + // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build + interface Console { + Console: NodeJS.ConsoleConstructor; + /** + * A simple assertion test that verifies whether `value` is truthy. + * If it is not, an `AssertionError` is thrown. + * If provided, the error `message` is formatted using `util.format()` and used as the error message. + */ + assert(value: any, message?: string, ...optionalParams: any[]): void; + /** + * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the TTY. + * When `stdout` is not a TTY, this method does nothing. + */ + clear(): void; + /** + * Maintains an internal counter specific to `label` and outputs to `stdout` the number of times `console.count()` has been called with the given `label`. + */ + count(label?: string): void; + /** + * Resets the internal counter specific to `label`. + */ + countReset(label?: string): void; + /** + * The `console.debug()` function is an alias for {@link console.log()}. + */ + debug(message?: any, ...optionalParams: any[]): void; + /** + * Uses {@link util.inspect()} on `obj` and prints the resulting string to `stdout`. + * This function bypasses any custom `inspect()` function defined on `obj`. + */ + dir(obj: any, options?: InspectOptions): void; + /** + * This method calls {@link console.log()} passing it the arguments received. Please note that this method does not produce any XML formatting + */ + dirxml(...data: any[]): void; + /** + * Prints to `stderr` with newline. + */ + error(message?: any, ...optionalParams: any[]): void; + /** + * Increases indentation of subsequent lines by two spaces. + * If one or more `label`s are provided, those are printed first without the additional indentation. + */ + group(...label: any[]): void; + /** + * The `console.groupCollapsed()` function is an alias for {@link console.group()}. + */ + groupCollapsed(...label: any[]): void; + /** + * Decreases indentation of subsequent lines by two spaces. + */ + groupEnd(): void; + /** + * The {@link console.info()} function is an alias for {@link console.log()}. + */ + info(message?: any, ...optionalParams: any[]): void; + /** + * Prints to `stdout` with newline. + */ + log(message?: any, ...optionalParams: any[]): void; + /** + * This method does not display anything unless used in the inspector. + * Prints to `stdout` the array `array` formatted as a table. + */ + table(tabularData: any, properties?: ReadonlyArray): void; + /** + * Starts a timer that can be used to compute the duration of an operation. Timers are identified by a unique `label`. + */ + time(label?: string): void; + /** + * Stops a timer that was previously started by calling {@link console.time()} and prints the result to `stdout`. + */ + timeEnd(label?: string): void; + /** + * For a timer that was previously started by calling {@link console.time()}, prints the elapsed time and other `data` arguments to `stdout`. + */ + timeLog(label?: string, ...data: any[]): void; + /** + * Prints to `stderr` the string 'Trace :', followed by the {@link util.format()} formatted message and stack trace to the current position in the code. + */ + trace(message?: any, ...optionalParams: any[]): void; + /** + * The {@link console.warn()} function is an alias for {@link console.error()}. + */ + warn(message?: any, ...optionalParams: any[]): void; + + // --- Inspector mode only --- + /** + * This method does not display anything unless used in the inspector. + * Starts a JavaScript CPU profile with an optional label. + */ + profile(label?: string): void; + /** + * This method does not display anything unless used in the inspector. + * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector. + */ + profileEnd(label?: string): void; + /** + * This method does not display anything unless used in the inspector. + * Adds an event with the label `label` to the Timeline panel of the inspector. + */ + timeStamp(label?: string): void; + } + + var console: Console; + + namespace NodeJS { + interface ConsoleConstructorOptions { + stdout: WritableStream; + stderr?: WritableStream; + ignoreErrors?: boolean; + colorMode?: boolean | 'auto'; + inspectOptions?: InspectOptions; + } + + interface ConsoleConstructor { + prototype: Console; + new(stdout: WritableStream, stderr?: WritableStream, ignoreErrors?: boolean): Console; + new(options: ConsoleConstructorOptions): Console; + } + + interface Global { + console: typeof console; + } + } + } + + export = console; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/constants.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/constants.d.ts new file mode 100755 index 000000000..98ff97602 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/constants.d.ts @@ -0,0 +1,13 @@ +/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */ +declare module 'constants' { + import { constants as osConstants, SignalConstants } from 'os'; + import { constants as cryptoConstants } from 'crypto'; + import { constants as fsConstants } from 'fs'; + + const exp: typeof osConstants.errno & + typeof osConstants.priority & + SignalConstants & + typeof cryptoConstants & + typeof fsConstants; + export = exp; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/crypto.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/crypto.d.ts new file mode 100755 index 000000000..030a54386 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/crypto.d.ts @@ -0,0 +1,1456 @@ +declare module 'crypto' { + import * as stream from 'stream'; + import { PeerCertificate } from 'tls'; + + interface Certificate { + /** + * @deprecated + * @param spkac + * @returns The challenge component of the `spkac` data structure, + * which includes a public key and a challenge. + */ + exportChallenge(spkac: BinaryLike): Buffer; + /** + * @deprecated + * @param spkac + * @param encoding The encoding of the spkac string. + * @returns The public key component of the `spkac` data structure, + * which includes a public key and a challenge. + */ + exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; + /** + * @deprecated + * @param spkac + * @returns `true` if the given `spkac` data structure is valid, + * `false` otherwise. + */ + verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; + } + const Certificate: Certificate & { + /** @deprecated since v14.9.0 - Use static methods of `crypto.Certificate` instead. */ + new(): Certificate; + /** @deprecated since v14.9.0 - Use static methods of `crypto.Certificate` instead. */ + (): Certificate; + + /** + * @param spkac + * @returns The challenge component of the `spkac` data structure, + * which includes a public key and a challenge. + */ + exportChallenge(spkac: BinaryLike): Buffer; + /** + * @param spkac + * @param encoding The encoding of the spkac string. + * @returns The public key component of the `spkac` data structure, + * which includes a public key and a challenge. + */ + exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; + /** + * @param spkac + * @returns `true` if the given `spkac` data structure is valid, + * `false` otherwise. + */ + verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; + }; + + namespace constants { + // https://nodejs.org/dist/latest-v10.x/docs/api/crypto.html#crypto_crypto_constants + const OPENSSL_VERSION_NUMBER: number; + + /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */ + const SSL_OP_ALL: number; + /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ + const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; + /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ + const SSL_OP_CIPHER_SERVER_PREFERENCE: number; + /** Instructs OpenSSL to use Cisco's "speshul" version of DTLS_BAD_VER. */ + const SSL_OP_CISCO_ANYCONNECT: number; + /** Instructs OpenSSL to turn on cookie exchange. */ + const SSL_OP_COOKIE_EXCHANGE: number; + /** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */ + const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; + /** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */ + const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; + /** Instructs OpenSSL to always use the tmp_rsa key when performing RSA operations. */ + const SSL_OP_EPHEMERAL_RSA: number; + /** Allows initial connection to servers that do not support RI. */ + const SSL_OP_LEGACY_SERVER_CONNECT: number; + const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number; + const SSL_OP_MICROSOFT_SESS_ID_BUG: number; + /** Instructs OpenSSL to disable the workaround for a man-in-the-middle protocol-version vulnerability in the SSL 2.0 server implementation. */ + const SSL_OP_MSIE_SSLV2_RSA_PADDING: number; + const SSL_OP_NETSCAPE_CA_DN_BUG: number; + const SSL_OP_NETSCAPE_CHALLENGE_BUG: number; + const SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number; + const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number; + /** Instructs OpenSSL to disable support for SSL/TLS compression. */ + const SSL_OP_NO_COMPRESSION: number; + const SSL_OP_NO_QUERY_MTU: number; + /** Instructs OpenSSL to always start a new session when performing renegotiation. */ + const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; + const SSL_OP_NO_SSLv2: number; + const SSL_OP_NO_SSLv3: number; + const SSL_OP_NO_TICKET: number; + const SSL_OP_NO_TLSv1: number; + const SSL_OP_NO_TLSv1_1: number; + const SSL_OP_NO_TLSv1_2: number; + const SSL_OP_PKCS1_CHECK_1: number; + const SSL_OP_PKCS1_CHECK_2: number; + /** Instructs OpenSSL to always create a new key when using temporary/ephemeral DH parameters. */ + const SSL_OP_SINGLE_DH_USE: number; + /** Instructs OpenSSL to always create a new key when using temporary/ephemeral ECDH parameters. */ + const SSL_OP_SINGLE_ECDH_USE: number; + const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number; + const SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number; + const SSL_OP_TLS_BLOCK_PADDING_BUG: number; + const SSL_OP_TLS_D5_BUG: number; + /** Instructs OpenSSL to disable version rollback attack detection. */ + const SSL_OP_TLS_ROLLBACK_BUG: number; + + const ENGINE_METHOD_RSA: number; + const ENGINE_METHOD_DSA: number; + const ENGINE_METHOD_DH: number; + const ENGINE_METHOD_RAND: number; + const ENGINE_METHOD_EC: number; + const ENGINE_METHOD_CIPHERS: number; + const ENGINE_METHOD_DIGESTS: number; + const ENGINE_METHOD_PKEY_METHS: number; + const ENGINE_METHOD_PKEY_ASN1_METHS: number; + const ENGINE_METHOD_ALL: number; + const ENGINE_METHOD_NONE: number; + + const DH_CHECK_P_NOT_SAFE_PRIME: number; + const DH_CHECK_P_NOT_PRIME: number; + const DH_UNABLE_TO_CHECK_GENERATOR: number; + const DH_NOT_SUITABLE_GENERATOR: number; + + const ALPN_ENABLED: number; + + const RSA_PKCS1_PADDING: number; + const RSA_SSLV23_PADDING: number; + const RSA_NO_PADDING: number; + const RSA_PKCS1_OAEP_PADDING: number; + const RSA_X931_PADDING: number; + const RSA_PKCS1_PSS_PADDING: number; + /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */ + const RSA_PSS_SALTLEN_DIGEST: number; + /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */ + const RSA_PSS_SALTLEN_MAX_SIGN: number; + /** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */ + const RSA_PSS_SALTLEN_AUTO: number; + + const POINT_CONVERSION_COMPRESSED: number; + const POINT_CONVERSION_UNCOMPRESSED: number; + const POINT_CONVERSION_HYBRID: number; + + /** Specifies the built-in default cipher list used by Node.js (colon-separated values). */ + const defaultCoreCipherList: string; + /** Specifies the active default cipher list used by the current Node.js process (colon-separated values). */ + const defaultCipherList: string; + } + + interface HashOptions extends stream.TransformOptions { + /** + * For XOF hash functions such as `shake256`, the + * outputLength option can be used to specify the desired output length in bytes. + */ + outputLength?: number; + } + + /** @deprecated since v10.0.0 */ + const fips: boolean; + + function createHash(algorithm: string, options?: HashOptions): Hash; + function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac; + + // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings + type BinaryToTextEncoding = 'base64' | 'hex'; + type CharacterEncoding = 'utf8' | 'utf-8' | 'utf16le' | 'latin1'; + type LegacyCharacterEncoding = 'ascii' | 'binary' | 'ucs2' | 'ucs-2'; + + type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding; + + type ECDHKeyFormat = 'compressed' | 'uncompressed' | 'hybrid'; + + class Hash extends stream.Transform { + private constructor(); + copy(): Hash; + update(data: BinaryLike): Hash; + update(data: string, input_encoding: Encoding): Hash; + digest(): Buffer; + digest(encoding: BinaryToTextEncoding): string; + } + class Hmac extends stream.Transform { + private constructor(); + update(data: BinaryLike): Hmac; + update(data: string, input_encoding: Encoding): Hmac; + digest(): Buffer; + digest(encoding: BinaryToTextEncoding): string; + } + + type KeyObjectType = 'secret' | 'public' | 'private'; + + interface KeyExportOptions { + type: 'pkcs1' | 'spki' | 'pkcs8' | 'sec1'; + format: T; + cipher?: string; + passphrase?: string | Buffer; + } + + class KeyObject { + private constructor(); + asymmetricKeyType?: KeyType; + /** + * For asymmetric keys, this property represents the size of the embedded key in + * bytes. This property is `undefined` for symmetric keys. + */ + asymmetricKeySize?: number; + export(options: KeyExportOptions<'pem'>): string | Buffer; + export(options?: KeyExportOptions<'der'>): Buffer; + symmetricKeySize?: number; + type: KeyObjectType; + } + + type CipherCCMTypes = 'aes-128-ccm' | 'aes-192-ccm' | 'aes-256-ccm' | 'chacha20-poly1305'; + type CipherGCMTypes = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm'; + + type BinaryLike = string | NodeJS.ArrayBufferView; + + type CipherKey = BinaryLike | KeyObject; + + interface CipherCCMOptions extends stream.TransformOptions { + authTagLength: number; + } + interface CipherGCMOptions extends stream.TransformOptions { + authTagLength?: number; + } + /** @deprecated since v10.0.0 use `createCipheriv()` */ + function createCipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): CipherCCM; + /** @deprecated since v10.0.0 use `createCipheriv()` */ + function createCipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): CipherGCM; + /** @deprecated since v10.0.0 use `createCipheriv()` */ + function createCipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Cipher; + + function createCipheriv( + algorithm: CipherCCMTypes, + key: CipherKey, + iv: BinaryLike | null, + options: CipherCCMOptions, + ): CipherCCM; + function createCipheriv( + algorithm: CipherGCMTypes, + key: CipherKey, + iv: BinaryLike | null, + options?: CipherGCMOptions, + ): CipherGCM; + function createCipheriv( + algorithm: string, + key: CipherKey, + iv: BinaryLike | null, + options?: stream.TransformOptions, + ): Cipher; + + class Cipher extends stream.Transform { + private constructor(); + update(data: BinaryLike): Buffer; + update(data: string, input_encoding: Encoding): Buffer; + update(data: NodeJS.ArrayBufferView, input_encoding: undefined, output_encoding: Encoding): string; + update(data: string, input_encoding: Encoding | undefined, output_encoding: Encoding): string; + final(): Buffer; + final(output_encoding: BufferEncoding): string; + setAutoPadding(auto_padding?: boolean): this; + // getAuthTag(): Buffer; + // setAAD(buffer: NodeJS.ArrayBufferView): this; + } + interface CipherCCM extends Cipher { + setAAD(buffer: NodeJS.ArrayBufferView, options: { plaintextLength: number }): this; + getAuthTag(): Buffer; + } + interface CipherGCM extends Cipher { + setAAD(buffer: NodeJS.ArrayBufferView, options?: { plaintextLength: number }): this; + getAuthTag(): Buffer; + } + /** @deprecated since v10.0.0 use `createDecipheriv()` */ + function createDecipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): DecipherCCM; + /** @deprecated since v10.0.0 use `createDecipheriv()` */ + function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM; + /** @deprecated since v10.0.0 use `createDecipheriv()` */ + function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher; + + function createDecipheriv( + algorithm: CipherCCMTypes, + key: CipherKey, + iv: BinaryLike | null, + options: CipherCCMOptions, + ): DecipherCCM; + function createDecipheriv( + algorithm: CipherGCMTypes, + key: CipherKey, + iv: BinaryLike | null, + options?: CipherGCMOptions, + ): DecipherGCM; + function createDecipheriv( + algorithm: string, + key: CipherKey, + iv: BinaryLike | null, + options?: stream.TransformOptions, + ): Decipher; + + class Decipher extends stream.Transform { + private constructor(); + update(data: NodeJS.ArrayBufferView): Buffer; + update(data: string, input_encoding: Encoding): Buffer; + update(data: NodeJS.ArrayBufferView, input_encoding: undefined, output_encoding: Encoding): string; + update(data: string, input_encoding: Encoding | undefined, output_encoding: Encoding): string; + final(): Buffer; + final(output_encoding: BufferEncoding): string; + setAutoPadding(auto_padding?: boolean): this; + // setAuthTag(tag: NodeJS.ArrayBufferView): this; + // setAAD(buffer: NodeJS.ArrayBufferView): this; + } + interface DecipherCCM extends Decipher { + setAuthTag(buffer: NodeJS.ArrayBufferView): this; + setAAD(buffer: NodeJS.ArrayBufferView, options: { plaintextLength: number }): this; + } + interface DecipherGCM extends Decipher { + setAuthTag(buffer: NodeJS.ArrayBufferView): this; + setAAD(buffer: NodeJS.ArrayBufferView, options?: { plaintextLength: number }): this; + } + + interface PrivateKeyInput { + key: string | Buffer; + format?: KeyFormat; + type?: 'pkcs1' | 'pkcs8' | 'sec1'; + passphrase?: string | Buffer; + } + + interface PublicKeyInput { + key: string | Buffer; + format?: KeyFormat; + type?: 'pkcs1' | 'spki'; + } + + function createPrivateKey(key: PrivateKeyInput | string | Buffer): KeyObject; + function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject): KeyObject; + function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject; + + function createSign(algorithm: string, options?: stream.WritableOptions): Signer; + + type DSAEncoding = 'der' | 'ieee-p1363'; + + interface SigningOptions { + /** + * @See crypto.constants.RSA_PKCS1_PADDING + */ + padding?: number; + saltLength?: number; + dsaEncoding?: DSAEncoding; + } + + interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions { } + interface SignKeyObjectInput extends SigningOptions { + key: KeyObject; + } + interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions { } + interface VerifyKeyObjectInput extends SigningOptions { + key: KeyObject; + } + + type KeyLike = string | Buffer | KeyObject; + + class Signer extends stream.Writable { + private constructor(); + + update(data: BinaryLike): Signer; + update(data: string, input_encoding: Encoding): Signer; + sign(private_key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; + sign( + private_key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, + output_format: BinaryToTextEncoding, + ): string; + } + + function createVerify(algorithm: string, options?: stream.WritableOptions): Verify; + class Verify extends stream.Writable { + private constructor(); + + update(data: BinaryLike): Verify; + update(data: string, input_encoding: Encoding): Verify; + verify( + object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, + signature: NodeJS.ArrayBufferView, + ): boolean; + verify( + object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, + signature: string, + signature_format?: BinaryToTextEncoding, + ): boolean; + // https://nodejs.org/api/crypto.html#crypto_verifier_verify_object_signature_signature_format + // The signature field accepts a TypedArray type, but it is only available starting ES2017 + } + function createDiffieHellman(prime_length: number, generator?: number | NodeJS.ArrayBufferView): DiffieHellman; + function createDiffieHellman(prime: NodeJS.ArrayBufferView): DiffieHellman; + function createDiffieHellman(prime: string, prime_encoding: BinaryToTextEncoding): DiffieHellman; + function createDiffieHellman( + prime: string, + prime_encoding: BinaryToTextEncoding, + generator: number | NodeJS.ArrayBufferView, + ): DiffieHellman; + function createDiffieHellman( + prime: string, + prime_encoding: BinaryToTextEncoding, + generator: string, + generator_encoding: BinaryToTextEncoding, + ): DiffieHellman; + class DiffieHellman { + private constructor(); + generateKeys(): Buffer; + generateKeys(encoding: BinaryToTextEncoding): string; + computeSecret(other_public_key: NodeJS.ArrayBufferView): Buffer; + computeSecret(other_public_key: string, input_encoding: BinaryToTextEncoding): Buffer; + computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: BinaryToTextEncoding): string; + computeSecret( + other_public_key: string, + input_encoding: BinaryToTextEncoding, + output_encoding: BinaryToTextEncoding, + ): string; + getPrime(): Buffer; + getPrime(encoding: BinaryToTextEncoding): string; + getGenerator(): Buffer; + getGenerator(encoding: BinaryToTextEncoding): string; + getPublicKey(): Buffer; + getPublicKey(encoding: BinaryToTextEncoding): string; + getPrivateKey(): Buffer; + getPrivateKey(encoding: BinaryToTextEncoding): string; + setPublicKey(public_key: NodeJS.ArrayBufferView): void; + setPublicKey(public_key: string, encoding: BufferEncoding): void; + setPrivateKey(private_key: NodeJS.ArrayBufferView): void; + setPrivateKey(private_key: string, encoding: BufferEncoding): void; + verifyError: number; + } + function getDiffieHellman(group_name: string): DiffieHellman; + function pbkdf2( + password: BinaryLike, + salt: BinaryLike, + iterations: number, + keylen: number, + digest: string, + callback: (err: Error | null, derivedKey: Buffer) => any, + ): void; + function pbkdf2Sync( + password: BinaryLike, + salt: BinaryLike, + iterations: number, + keylen: number, + digest: string, + ): Buffer; + + function randomBytes(size: number): Buffer; + function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; + function pseudoRandomBytes(size: number): Buffer; + function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; + + function randomInt(max: number): number; + function randomInt(min: number, max: number): number; + function randomInt(max: number, callback: (err: Error | null, value: number) => void): void; + function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void; + + function randomFillSync(buffer: T, offset?: number, size?: number): T; + function randomFill( + buffer: T, + callback: (err: Error | null, buf: T) => void, + ): void; + function randomFill( + buffer: T, + offset: number, + callback: (err: Error | null, buf: T) => void, + ): void; + function randomFill( + buffer: T, + offset: number, + size: number, + callback: (err: Error | null, buf: T) => void, + ): void; + + interface ScryptOptions { + cost?: number; + blockSize?: number; + parallelization?: number; + N?: number; + r?: number; + p?: number; + maxmem?: number; + } + function scrypt( + password: BinaryLike, + salt: BinaryLike, + keylen: number, + callback: (err: Error | null, derivedKey: Buffer) => void, + ): void; + function scrypt( + password: BinaryLike, + salt: BinaryLike, + keylen: number, + options: ScryptOptions, + callback: (err: Error | null, derivedKey: Buffer) => void, + ): void; + function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer; + + interface RsaPublicKey { + key: KeyLike; + padding?: number; + } + interface RsaPrivateKey { + key: KeyLike; + passphrase?: string; + /** + * @default 'sha1' + */ + oaepHash?: string; + oaepLabel?: NodeJS.TypedArray; + padding?: number; + } + function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; + function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; + function privateDecrypt(private_key: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; + function privateEncrypt(private_key: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; + function getCiphers(): string[]; + function getCurves(): string[]; + function getFips(): 1 | 0; + function getHashes(): string[]; + class ECDH { + private constructor(); + static convertKey( + key: BinaryLike, + curve: string, + inputEncoding?: BinaryToTextEncoding, + outputEncoding?: 'latin1' | 'hex' | 'base64', + format?: 'uncompressed' | 'compressed' | 'hybrid', + ): Buffer | string; + generateKeys(): Buffer; + generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; + computeSecret(other_public_key: NodeJS.ArrayBufferView): Buffer; + computeSecret(other_public_key: string, input_encoding: BinaryToTextEncoding): Buffer; + computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: BinaryToTextEncoding): string; + computeSecret( + other_public_key: string, + input_encoding: BinaryToTextEncoding, + output_encoding: BinaryToTextEncoding, + ): string; + getPrivateKey(): Buffer; + getPrivateKey(encoding: BinaryToTextEncoding): string; + getPublicKey(): Buffer; + getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; + setPrivateKey(private_key: NodeJS.ArrayBufferView): void; + setPrivateKey(private_key: string, encoding: BinaryToTextEncoding): void; + } + function createECDH(curve_name: string): ECDH; + function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean; + /** @deprecated since v10.0.0 */ + const DEFAULT_ENCODING: BufferEncoding; + + type KeyType = 'rsa' | 'dsa' | 'ec' | 'ed25519' | 'ed448' | 'x25519' | 'x448'; + type KeyFormat = 'pem' | 'der'; + + interface BasePrivateKeyEncodingOptions { + format: T; + cipher?: string; + passphrase?: string; + } + + interface KeyPairKeyObjectResult { + publicKey: KeyObject; + privateKey: KeyObject; + } + + interface ED25519KeyPairKeyObjectOptions { + /** + * No options. + */ + } + + interface ED448KeyPairKeyObjectOptions { + /** + * No options. + */ + } + + interface X25519KeyPairKeyObjectOptions { + /** + * No options. + */ + } + + interface X448KeyPairKeyObjectOptions { + /** + * No options. + */ + } + + interface ECKeyPairKeyObjectOptions { + /** + * Name of the curve to use. + */ + namedCurve: string; + } + + interface RSAKeyPairKeyObjectOptions { + /** + * Key size in bits + */ + modulusLength: number; + + /** + * @default 0x10001 + */ + publicExponent?: number; + } + + interface DSAKeyPairKeyObjectOptions { + /** + * Key size in bits + */ + modulusLength: number; + + /** + * Size of q in bits + */ + divisorLength: number; + } + + interface RSAKeyPairOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * @default 0x10001 + */ + publicExponent?: number; + + publicKeyEncoding: { + type: 'pkcs1' | 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs1' | 'pkcs8'; + }; + } + + interface DSAKeyPairOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Size of q in bits + */ + divisorLength: number; + + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + + interface ECKeyPairOptions { + /** + * Name of the curve to use. + */ + namedCurve: string; + + publicKeyEncoding: { + type: 'pkcs1' | 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'sec1' | 'pkcs8'; + }; + } + + interface ED25519KeyPairOptions { + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + + interface ED448KeyPairOptions { + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + + interface X25519KeyPairOptions { + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + + interface X448KeyPairOptions { + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + + interface KeyPairSyncResult { + publicKey: T1; + privateKey: T2; + } + + function generateKeyPairSync( + type: 'rsa', + options: RSAKeyPairOptions<'pem', 'pem'>, + ): KeyPairSyncResult; + function generateKeyPairSync( + type: 'rsa', + options: RSAKeyPairOptions<'pem', 'der'>, + ): KeyPairSyncResult; + function generateKeyPairSync( + type: 'rsa', + options: RSAKeyPairOptions<'der', 'pem'>, + ): KeyPairSyncResult; + function generateKeyPairSync( + type: 'rsa', + options: RSAKeyPairOptions<'der', 'der'>, + ): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; + + function generateKeyPairSync( + type: 'dsa', + options: DSAKeyPairOptions<'pem', 'pem'>, + ): KeyPairSyncResult; + function generateKeyPairSync( + type: 'dsa', + options: DSAKeyPairOptions<'pem', 'der'>, + ): KeyPairSyncResult; + function generateKeyPairSync( + type: 'dsa', + options: DSAKeyPairOptions<'der', 'pem'>, + ): KeyPairSyncResult; + function generateKeyPairSync( + type: 'dsa', + options: DSAKeyPairOptions<'der', 'der'>, + ): KeyPairSyncResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; + + function generateKeyPairSync( + type: 'ec', + options: ECKeyPairOptions<'pem', 'pem'>, + ): KeyPairSyncResult; + function generateKeyPairSync( + type: 'ec', + options: ECKeyPairOptions<'pem', 'der'>, + ): KeyPairSyncResult; + function generateKeyPairSync( + type: 'ec', + options: ECKeyPairOptions<'der', 'pem'>, + ): KeyPairSyncResult; + function generateKeyPairSync( + type: 'ec', + options: ECKeyPairOptions<'der', 'der'>, + ): KeyPairSyncResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult; + + function generateKeyPairSync( + type: 'ed25519', + options: ED25519KeyPairOptions<'pem', 'pem'>, + ): KeyPairSyncResult; + function generateKeyPairSync( + type: 'ed25519', + options: ED25519KeyPairOptions<'pem', 'der'>, + ): KeyPairSyncResult; + function generateKeyPairSync( + type: 'ed25519', + options: ED25519KeyPairOptions<'der', 'pem'>, + ): KeyPairSyncResult; + function generateKeyPairSync( + type: 'ed25519', + options: ED25519KeyPairOptions<'der', 'der'>, + ): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; + + function generateKeyPairSync( + type: 'ed448', + options: ED448KeyPairOptions<'pem', 'pem'>, + ): KeyPairSyncResult; + function generateKeyPairSync( + type: 'ed448', + options: ED448KeyPairOptions<'pem', 'der'>, + ): KeyPairSyncResult; + function generateKeyPairSync( + type: 'ed448', + options: ED448KeyPairOptions<'der', 'pem'>, + ): KeyPairSyncResult; + function generateKeyPairSync( + type: 'ed448', + options: ED448KeyPairOptions<'der', 'der'>, + ): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; + + function generateKeyPairSync( + type: 'x25519', + options: X25519KeyPairOptions<'pem', 'pem'>, + ): KeyPairSyncResult; + function generateKeyPairSync( + type: 'x25519', + options: X25519KeyPairOptions<'pem', 'der'>, + ): KeyPairSyncResult; + function generateKeyPairSync( + type: 'x25519', + options: X25519KeyPairOptions<'der', 'pem'>, + ): KeyPairSyncResult; + function generateKeyPairSync( + type: 'x25519', + options: X25519KeyPairOptions<'der', 'der'>, + ): KeyPairSyncResult; + function generateKeyPairSync(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; + + function generateKeyPairSync( + type: 'x448', + options: X448KeyPairOptions<'pem', 'pem'>, + ): KeyPairSyncResult; + function generateKeyPairSync( + type: 'x448', + options: X448KeyPairOptions<'pem', 'der'>, + ): KeyPairSyncResult; + function generateKeyPairSync( + type: 'x448', + options: X448KeyPairOptions<'der', 'pem'>, + ): KeyPairSyncResult; + function generateKeyPairSync( + type: 'x448', + options: X448KeyPairOptions<'der', 'der'>, + ): KeyPairSyncResult; + function generateKeyPairSync(type: 'x448', options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; + + function generateKeyPair( + type: 'rsa', + options: RSAKeyPairOptions<'pem', 'pem'>, + callback: (err: Error | null, publicKey: string, privateKey: string) => void, + ): void; + function generateKeyPair( + type: 'rsa', + options: RSAKeyPairOptions<'pem', 'der'>, + callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, + ): void; + function generateKeyPair( + type: 'rsa', + options: RSAKeyPairOptions<'der', 'pem'>, + callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, + ): void; + function generateKeyPair( + type: 'rsa', + options: RSAKeyPairOptions<'der', 'der'>, + callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, + ): void; + function generateKeyPair( + type: 'rsa', + options: RSAKeyPairKeyObjectOptions, + callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, + ): void; + + function generateKeyPair( + type: 'dsa', + options: DSAKeyPairOptions<'pem', 'pem'>, + callback: (err: Error | null, publicKey: string, privateKey: string) => void, + ): void; + function generateKeyPair( + type: 'dsa', + options: DSAKeyPairOptions<'pem', 'der'>, + callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, + ): void; + function generateKeyPair( + type: 'dsa', + options: DSAKeyPairOptions<'der', 'pem'>, + callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, + ): void; + function generateKeyPair( + type: 'dsa', + options: DSAKeyPairOptions<'der', 'der'>, + callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, + ): void; + function generateKeyPair( + type: 'dsa', + options: DSAKeyPairKeyObjectOptions, + callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, + ): void; + + function generateKeyPair( + type: 'ec', + options: ECKeyPairOptions<'pem', 'pem'>, + callback: (err: Error | null, publicKey: string, privateKey: string) => void, + ): void; + function generateKeyPair( + type: 'ec', + options: ECKeyPairOptions<'pem', 'der'>, + callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, + ): void; + function generateKeyPair( + type: 'ec', + options: ECKeyPairOptions<'der', 'pem'>, + callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, + ): void; + function generateKeyPair( + type: 'ec', + options: ECKeyPairOptions<'der', 'der'>, + callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, + ): void; + function generateKeyPair( + type: 'ec', + options: ECKeyPairKeyObjectOptions, + callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, + ): void; + + function generateKeyPair( + type: 'ed25519', + options: ED25519KeyPairOptions<'pem', 'pem'>, + callback: (err: Error | null, publicKey: string, privateKey: string) => void, + ): void; + function generateKeyPair( + type: 'ed25519', + options: ED25519KeyPairOptions<'pem', 'der'>, + callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, + ): void; + function generateKeyPair( + type: 'ed25519', + options: ED25519KeyPairOptions<'der', 'pem'>, + callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, + ): void; + function generateKeyPair( + type: 'ed25519', + options: ED25519KeyPairOptions<'der', 'der'>, + callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, + ): void; + function generateKeyPair( + type: 'ed25519', + options: ED25519KeyPairKeyObjectOptions | undefined, + callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, + ): void; + + function generateKeyPair( + type: 'ed448', + options: ED448KeyPairOptions<'pem', 'pem'>, + callback: (err: Error | null, publicKey: string, privateKey: string) => void, + ): void; + function generateKeyPair( + type: 'ed448', + options: ED448KeyPairOptions<'pem', 'der'>, + callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, + ): void; + function generateKeyPair( + type: 'ed448', + options: ED448KeyPairOptions<'der', 'pem'>, + callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, + ): void; + function generateKeyPair( + type: 'ed448', + options: ED448KeyPairOptions<'der', 'der'>, + callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, + ): void; + function generateKeyPair( + type: 'ed448', + options: ED448KeyPairKeyObjectOptions | undefined, + callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, + ): void; + + function generateKeyPair( + type: 'x25519', + options: X25519KeyPairOptions<'pem', 'pem'>, + callback: (err: Error | null, publicKey: string, privateKey: string) => void, + ): void; + function generateKeyPair( + type: 'x25519', + options: X25519KeyPairOptions<'pem', 'der'>, + callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, + ): void; + function generateKeyPair( + type: 'x25519', + options: X25519KeyPairOptions<'der', 'pem'>, + callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, + ): void; + function generateKeyPair( + type: 'x25519', + options: X25519KeyPairOptions<'der', 'der'>, + callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, + ): void; + function generateKeyPair( + type: 'x25519', + options: X25519KeyPairKeyObjectOptions | undefined, + callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, + ): void; + + function generateKeyPair( + type: 'x448', + options: X448KeyPairOptions<'pem', 'pem'>, + callback: (err: Error | null, publicKey: string, privateKey: string) => void, + ): void; + function generateKeyPair( + type: 'x448', + options: X448KeyPairOptions<'pem', 'der'>, + callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void, + ): void; + function generateKeyPair( + type: 'x448', + options: X448KeyPairOptions<'der', 'pem'>, + callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void, + ): void; + function generateKeyPair( + type: 'x448', + options: X448KeyPairOptions<'der', 'der'>, + callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void, + ): void; + function generateKeyPair( + type: 'x448', + options: X448KeyPairKeyObjectOptions | undefined, + callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void, + ): void; + + namespace generateKeyPair { + function __promisify__( + type: 'rsa', + options: RSAKeyPairOptions<'pem', 'pem'>, + ): Promise<{ publicKey: string; privateKey: string }>; + function __promisify__( + type: 'rsa', + options: RSAKeyPairOptions<'pem', 'der'>, + ): Promise<{ publicKey: string; privateKey: Buffer }>; + function __promisify__( + type: 'rsa', + options: RSAKeyPairOptions<'der', 'pem'>, + ): Promise<{ publicKey: Buffer; privateKey: string }>; + function __promisify__( + type: 'rsa', + options: RSAKeyPairOptions<'der', 'der'>, + ): Promise<{ publicKey: Buffer; privateKey: Buffer }>; + function __promisify__(type: 'rsa', options: RSAKeyPairKeyObjectOptions): Promise; + + function __promisify__( + type: 'dsa', + options: DSAKeyPairOptions<'pem', 'pem'>, + ): Promise<{ publicKey: string; privateKey: string }>; + function __promisify__( + type: 'dsa', + options: DSAKeyPairOptions<'pem', 'der'>, + ): Promise<{ publicKey: string; privateKey: Buffer }>; + function __promisify__( + type: 'dsa', + options: DSAKeyPairOptions<'der', 'pem'>, + ): Promise<{ publicKey: Buffer; privateKey: string }>; + function __promisify__( + type: 'dsa', + options: DSAKeyPairOptions<'der', 'der'>, + ): Promise<{ publicKey: Buffer; privateKey: Buffer }>; + function __promisify__(type: 'dsa', options: DSAKeyPairKeyObjectOptions): Promise; + + function __promisify__( + type: 'ec', + options: ECKeyPairOptions<'pem', 'pem'>, + ): Promise<{ publicKey: string; privateKey: string }>; + function __promisify__( + type: 'ec', + options: ECKeyPairOptions<'pem', 'der'>, + ): Promise<{ publicKey: string; privateKey: Buffer }>; + function __promisify__( + type: 'ec', + options: ECKeyPairOptions<'der', 'pem'>, + ): Promise<{ publicKey: Buffer; privateKey: string }>; + function __promisify__( + type: 'ec', + options: ECKeyPairOptions<'der', 'der'>, + ): Promise<{ publicKey: Buffer; privateKey: Buffer }>; + function __promisify__(type: 'ec', options: ECKeyPairKeyObjectOptions): Promise; + + function __promisify__( + type: 'ed25519', + options: ED25519KeyPairOptions<'pem', 'pem'>, + ): Promise<{ publicKey: string; privateKey: string }>; + function __promisify__( + type: 'ed25519', + options: ED25519KeyPairOptions<'pem', 'der'>, + ): Promise<{ publicKey: string; privateKey: Buffer }>; + function __promisify__( + type: 'ed25519', + options: ED25519KeyPairOptions<'der', 'pem'>, + ): Promise<{ publicKey: Buffer; privateKey: string }>; + function __promisify__( + type: 'ed25519', + options: ED25519KeyPairOptions<'der', 'der'>, + ): Promise<{ publicKey: Buffer; privateKey: Buffer }>; + function __promisify__( + type: 'ed25519', + options?: ED25519KeyPairKeyObjectOptions, + ): Promise; + + function __promisify__( + type: 'ed448', + options: ED448KeyPairOptions<'pem', 'pem'>, + ): Promise<{ publicKey: string; privateKey: string }>; + function __promisify__( + type: 'ed448', + options: ED448KeyPairOptions<'pem', 'der'>, + ): Promise<{ publicKey: string; privateKey: Buffer }>; + function __promisify__( + type: 'ed448', + options: ED448KeyPairOptions<'der', 'pem'>, + ): Promise<{ publicKey: Buffer; privateKey: string }>; + function __promisify__( + type: 'ed448', + options: ED448KeyPairOptions<'der', 'der'>, + ): Promise<{ publicKey: Buffer; privateKey: Buffer }>; + function __promisify__(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): Promise; + + function __promisify__( + type: 'x25519', + options: X25519KeyPairOptions<'pem', 'pem'>, + ): Promise<{ publicKey: string; privateKey: string }>; + function __promisify__( + type: 'x25519', + options: X25519KeyPairOptions<'pem', 'der'>, + ): Promise<{ publicKey: string; privateKey: Buffer }>; + function __promisify__( + type: 'x25519', + options: X25519KeyPairOptions<'der', 'pem'>, + ): Promise<{ publicKey: Buffer; privateKey: string }>; + function __promisify__( + type: 'x25519', + options: X25519KeyPairOptions<'der', 'der'>, + ): Promise<{ publicKey: Buffer; privateKey: Buffer }>; + function __promisify__( + type: 'x25519', + options?: X25519KeyPairKeyObjectOptions, + ): Promise; + + function __promisify__( + type: 'x448', + options: X448KeyPairOptions<'pem', 'pem'>, + ): Promise<{ publicKey: string; privateKey: string }>; + function __promisify__( + type: 'x448', + options: X448KeyPairOptions<'pem', 'der'>, + ): Promise<{ publicKey: string; privateKey: Buffer }>; + function __promisify__( + type: 'x448', + options: X448KeyPairOptions<'der', 'pem'>, + ): Promise<{ publicKey: Buffer; privateKey: string }>; + function __promisify__( + type: 'x448', + options: X448KeyPairOptions<'der', 'der'>, + ): Promise<{ publicKey: Buffer; privateKey: Buffer }>; + function __promisify__(type: 'x448', options?: X448KeyPairKeyObjectOptions): Promise; + } + + /** + * Calculates and returns the signature for `data` using the given private key and + * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is + * dependent upon the key type (especially Ed25519 and Ed448). + * + * If `key` is not a [`KeyObject`][], this function behaves as if `key` had been + * passed to [`crypto.createPrivateKey()`][]. + */ + function sign( + algorithm: string | null | undefined, + data: NodeJS.ArrayBufferView, + key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, + ): Buffer; + + /** + * Calculates and returns the signature for `data` using the given private key and + * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is + * dependent upon the key type (especially Ed25519 and Ed448). + * + * If `key` is not a [`KeyObject`][], this function behaves as if `key` had been + * passed to [`crypto.createPublicKey()`][]. + */ + function verify( + algorithm: string | null | undefined, + data: NodeJS.ArrayBufferView, + key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, + signature: NodeJS.ArrayBufferView, + ): boolean; + + /** + * Computes the Diffie-Hellman secret based on a privateKey and a publicKey. + * Both keys must have the same asymmetricKeyType, which must be one of + * 'dh' (for Diffie-Hellman), 'ec' (for ECDH), 'x448', or 'x25519' (for ECDH-ES). + */ + function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer; + + type CipherMode = 'cbc' | 'ccm' | 'cfb' | 'ctr' | 'ecb' | 'gcm' | 'ocb' | 'ofb' | 'stream' | 'wrap' | 'xts'; + + interface CipherInfoOptions { + /** + * A test key length. + */ + keyLength?: number; + /** + * A test IV length. + */ + ivLength?: number; + } + + interface CipherInfo { + /** + * The name of the cipher. + */ + name: string; + /** + * The nid of the cipher. + */ + nid: number; + /** + * The block size of the cipher in bytes. + * This property is omitted when mode is 'stream'. + */ + blockSize?: number; + /** + * The expected or default initialization vector length in bytes. + * This property is omitted if the cipher does not use an initialization vector. + */ + ivLength?: number; + /** + * The expected or default key length in bytes. + */ + keyLength: number; + /** + * The cipher mode. + */ + mode: CipherMode; + } + + /** + * Returns information about a given cipher. + * + * Some ciphers accept variable length keys and initialization vectors. + * By default, the `crypto.getCipherInfo()` method will return the default + * values for these ciphers. To test if a given key length or iv length + * is acceptable for given cipher, use the `keyLenth` and `ivLenth` options. + * If the given values are unacceptable, `undefined` will be returned. + * @param nameOrNid The name or nid of the cipher to query. + */ + function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined; + + /** + * HKDF is a simple key derivation function defined in RFC 5869. + * The given `key`, `salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. + * + * The supplied `callback` function is called with two arguments: `err` and `derivedKey`. + * If an errors occurs while deriving the key, `err` will be set; otherwise `err` will be `null`. + * The successfully generated `derivedKey` will be passed to the callback as an [`ArrayBuffer`][]. + * An error will be thrown if any of the input aguments specify invalid values or types. + */ + function hkdf(digest: string, key: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: ArrayBuffer) => any): void; + + /** + * Provides a synchronous HKDF key derivation function as defined in RFC 5869. + * The given `key`, `salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. + * + * The successfully generated `derivedKey` will be returned as an [`ArrayBuffer`][]. + * An error will be thrown if any of the input aguments specify invalid values or types, + * or if the derived key cannot be generated. + */ + function hkdfSync(digest: string, key: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number): ArrayBuffer; + + interface SecureHeapUsage { + /** + * The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag. + */ + total: number; + + /** + * The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag. + */ + min: number; + + /** + * The total number of bytes currently allocated from the secure heap. + */ + used: number; + + /** + * The calculated ratio of `used` to `total` allocated bytes. + */ + utilization: number; + } + + function secureHeapUsed(): SecureHeapUsage; + + // TODO: X509Certificate + + interface RandomUUIDOptions { + /** + * By default, to improve performance, + * Node.js will pre-emptively generate and persistently cache enough + * random data to generate up to 128 random UUIDs. To generate a UUID + * without using the cache, set `disableEntropyCache` to `true`. + * + * @default `false` + */ + disableEntropyCache?: boolean; + } + + function randomUUID(options?: RandomUUIDOptions): string; + + interface X509CheckOptions { + /** + * @default 'always' + */ + subject: 'always' | 'never'; + + /** + * @default true + */ + wildcards: boolean; + + /** + * @default true + */ + partialWildcards: boolean; + + /** + * @default false + */ + multiLabelWildcards: boolean; + + /** + * @default false + */ + singleLabelSubdomains: boolean; + } + + class X509Certificate { + /** + * Will be `true` if this is a Certificate Authority (ca) certificate. + */ + readonly ca: boolean; + + /** + * The SHA-1 fingerprint of this certificate. + */ + readonly fingerprint: string; + + /** + * The SHA-256 fingerprint of this certificate. + */ + readonly fingerprint256: string; + + /** + * The complete subject of this certificate. + */ + readonly subject: string; + + /** + * The subject alternative name specified for this certificate. + */ + readonly subjectAltName: string; + + /** + * The information access content of this certificate. + */ + readonly infoAccess: string; + + /** + * An array detailing the key usages for this certificate. + */ + readonly keyUsage: string[]; + + /** + * The public key for this certificate. + */ + readonly publicKey: KeyObject; + + /** + * A `Buffer` containing the DER encoding of this certificate. + */ + readonly raw: Buffer; + + /** + * The serial number of this certificate. + */ + readonly serialNumber: string; + + /** + * Returns the PEM-encoded certificate. + */ + readonly validFrom: string; + + /** + * The date/time from which this certificate is considered valid. + */ + readonly validTo: string; + + constructor(buffer: BinaryLike); + + /** + * Checks whether the certificate matches the given email address. + * + * Returns `email` if the certificate matches,`undefined` if it does not. + */ + checkEmail(email: string, options?: X509CheckOptions): string | undefined; + + /** + * Checks whether the certificate matches the given host name. + * + * Returns `name` if the certificate matches, `undefined` if it does not. + */ + checkHost(name: string, options?: X509CheckOptions): string | undefined; + + /** + * Checks whether the certificate matches the given IP address (IPv4 or IPv6). + * + * Returns `ip` if the certificate matches, `undefined` if it does not. + */ + checkIP(ip: string, options?: X509CheckOptions): string | undefined; + + /** + * Checks whether this certificate was issued by the given `otherCert`. + */ + checkIssued(otherCert: X509Certificate): boolean; + + /** + * Checks whether this certificate was issued by the given `otherCert`. + */ + checkPrivateKey(privateKey: KeyObject): boolean; + + /** + * There is no standard JSON encoding for X509 certificates. The + * `toJSON()` method returns a string containing the PEM encoded + * certificate. + */ + toJSON(): string; + + /** + * Returns information about this certificate using the legacy [certificate object][] encoding. + */ + toLegacyObject(): PeerCertificate; + + /** + * Returns the PEM-encoded certificate. + */ + toString(): string; + + /** + * Verifies that this certificate was signed by the given public key. + * Does not perform any other validation checks on the certificate. + */ + verify(publicKey: KeyObject): boolean; + } +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/dgram.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/dgram.d.ts new file mode 100755 index 000000000..c94eb4aed --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/dgram.d.ts @@ -0,0 +1,141 @@ +declare module 'dgram' { + import { AddressInfo } from 'net'; + import * as dns from 'dns'; + import EventEmitter = require('events'); + + interface RemoteInfo { + address: string; + family: 'IPv4' | 'IPv6'; + port: number; + size: number; + } + + interface BindOptions { + port?: number; + address?: string; + exclusive?: boolean; + fd?: number; + } + + type SocketType = "udp4" | "udp6"; + + interface SocketOptions { + type: SocketType; + reuseAddr?: boolean; + /** + * @default false + */ + ipv6Only?: boolean; + recvBufferSize?: number; + sendBufferSize?: number; + lookup?: (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void; + } + + function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + + class Socket extends EventEmitter { + addMembership(multicastAddress: string, multicastInterface?: string): void; + address(): AddressInfo; + bind(port?: number, address?: string, callback?: () => void): void; + bind(port?: number, callback?: () => void): void; + bind(callback?: () => void): void; + bind(options: BindOptions, callback?: () => void): void; + close(callback?: () => void): void; + connect(port: number, address?: string, callback?: () => void): void; + connect(port: number, callback: () => void): void; + disconnect(): void; + dropMembership(multicastAddress: string, multicastInterface?: string): void; + getRecvBufferSize(): number; + getSendBufferSize(): number; + ref(): this; + remoteAddress(): AddressInfo; + send(msg: string | Uint8Array | ReadonlyArray, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array | ReadonlyArray, port?: number, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array | ReadonlyArray, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array, offset: number, length: number, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array, offset: number, length: number, port?: number, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array, offset: number, length: number, callback?: (error: Error | null, bytes: number) => void): void; + setBroadcast(flag: boolean): void; + setMulticastInterface(multicastInterface: string): void; + setMulticastLoopback(flag: boolean): void; + setMulticastTTL(ttl: number): void; + setRecvBufferSize(size: number): void; + setSendBufferSize(size: number): void; + setTTL(ttl: number): void; + unref(): this; + /** + * Tells the kernel to join a source-specific multicast channel at the given + * `sourceAddress` and `groupAddress`, using the `multicastInterface` with the + * `IP_ADD_SOURCE_MEMBERSHIP` socket option. + * If the `multicastInterface` argument + * is not specified, the operating system will choose one interface and will add + * membership to it. + * To add membership to every available interface, call + * `socket.addSourceSpecificMembership()` multiple times, once per interface. + */ + addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; + + /** + * Instructs the kernel to leave a source-specific multicast channel at the given + * `sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP` + * socket option. This method is automatically called by the kernel when the + * socket is closed or the process terminates, so most apps will never have + * reason to call this. + * + * If `multicastInterface` is not specified, the operating system will attempt to + * drop membership on all valid interfaces. + */ + dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; + + /** + * events.EventEmitter + * 1. close + * 2. connect + * 3. error + * 4. listening + * 5. message + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "connect", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "listening", listener: () => void): this; + addListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "connect"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "listening"): boolean; + emit(event: "message", msg: Buffer, rinfo: RemoteInfo): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "connect", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "listening", listener: () => void): this; + on(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "connect", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "listening", listener: () => void): this; + once(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "connect", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "listening", listener: () => void): this; + prependListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "connect", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "listening", listener: () => void): this; + prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + } +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/diagnostic_channel.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/diagnostic_channel.d.ts new file mode 100755 index 000000000..952c94dc8 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/diagnostic_channel.d.ts @@ -0,0 +1,34 @@ +/** + * @experimental + */ +declare module 'diagnostic_channel' { + /** + * Returns wether a named channel has subscribers or not. + */ + function hasSubscribers(name: string): boolean; + + /** + * Gets or create a diagnostic channel by name. + */ + function channel(name: string): Channel; + + type ChannelListener = (name: string, message: unknown) => void; + + /** + * Simple diagnostic channel that allows + */ + class Channel { + readonly name: string; + readonly hashSubscribers: boolean; + private constructor(name: string); + + /** + * Add a listener to the message channel. + */ + subscribe(listener: ChannelListener): void; + /** + * Removes a previously registered listener. + */ + unsubscribe(listener: ChannelListener): void; + } +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/dns.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/dns.d.ts new file mode 100755 index 000000000..62c75ef5a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/dns.d.ts @@ -0,0 +1,322 @@ +declare module 'dns' { + import * as dnsPromises from "dns/promises"; + + // Supported getaddrinfo flags. + export const ADDRCONFIG: number; + export const V4MAPPED: number; + /** + * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as + * well as IPv4 mapped IPv6 addresses. + */ + export const ALL: number; + + export interface LookupOptions { + family?: number; + hints?: number; + all?: boolean; + verbatim?: boolean; + } + + export interface LookupOneOptions extends LookupOptions { + all?: false; + } + + export interface LookupAllOptions extends LookupOptions { + all: true; + } + + export interface LookupAddress { + address: string; + family: number; + } + + export function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; + export function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; + export function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void): void; + export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void): void; + export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace lookup { + function __promisify__(hostname: string, options: LookupAllOptions): Promise; + function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise; + function __promisify__(hostname: string, options: LookupOptions): Promise; + } + + export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void; + + export namespace lookupService { + function __promisify__(address: string, port: number): Promise<{ hostname: string, service: string }>; + } + + export interface ResolveOptions { + ttl: boolean; + } + + export interface ResolveWithTtlOptions extends ResolveOptions { + ttl: true; + } + + export interface RecordWithTtl { + address: string; + ttl: number; + } + + /** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */ + export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord; + + export interface AnyARecord extends RecordWithTtl { + type: "A"; + } + + export interface AnyAaaaRecord extends RecordWithTtl { + type: "AAAA"; + } + + export interface CaaRecord { + critial: number; + issue?: string; + issuewild?: string; + iodef?: string; + contactemail?: string; + contactphone?: string; + } + + export interface MxRecord { + priority: number; + exchange: string; + } + + export interface AnyMxRecord extends MxRecord { + type: "MX"; + } + + export interface NaptrRecord { + flags: string; + service: string; + regexp: string; + replacement: string; + order: number; + preference: number; + } + + export interface AnyNaptrRecord extends NaptrRecord { + type: "NAPTR"; + } + + export interface SoaRecord { + nsname: string; + hostmaster: string; + serial: number; + refresh: number; + retry: number; + expire: number; + minttl: number; + } + + export interface AnySoaRecord extends SoaRecord { + type: "SOA"; + } + + export interface SrvRecord { + priority: number; + weight: number; + port: number; + name: string; + } + + export interface AnySrvRecord extends SrvRecord { + type: "SRV"; + } + + export interface AnyTxtRecord { + type: "TXT"; + entries: string[]; + } + + export interface AnyNsRecord { + type: "NS"; + value: string; + } + + export interface AnyPtrRecord { + type: "PTR"; + value: string; + } + + export interface AnyCnameRecord { + type: "CNAME"; + value: string; + } + + export type AnyRecord = AnyARecord | + AnyAaaaRecord | + AnyCnameRecord | + AnyMxRecord | + AnyNaptrRecord | + AnyNsRecord | + AnyPtrRecord | + AnySoaRecord | + AnySrvRecord | + AnyTxtRecord; + + export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "A", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "AAAA", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "ANY", callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void; + export function resolve(hostname: string, rrtype: "CNAME", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void; + export function resolve(hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void; + export function resolve(hostname: string, rrtype: "NS", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "PTR", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "SOA", callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void): void; + export function resolve(hostname: string, rrtype: "SRV", callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void; + export function resolve(hostname: string, rrtype: "TXT", callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void; + export function resolve( + hostname: string, + rrtype: string, + callback: (err: NodeJS.ErrnoException | null, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void, + ): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace resolve { + function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise; + function __promisify__(hostname: string, rrtype: "ANY"): Promise; + function __promisify__(hostname: string, rrtype: "MX"): Promise; + function __promisify__(hostname: string, rrtype: "NAPTR"): Promise; + function __promisify__(hostname: string, rrtype: "SOA"): Promise; + function __promisify__(hostname: string, rrtype: "SRV"): Promise; + function __promisify__(hostname: string, rrtype: "TXT"): Promise; + function __promisify__(hostname: string, rrtype: string): Promise; + } + + export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void; + export function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace resolve4 { + function __promisify__(hostname: string): Promise; + function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; + function __promisify__(hostname: string, options?: ResolveOptions): Promise; + } + + export function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void; + export function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace resolve6 { + function __promisify__(hostname: string): Promise; + function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; + function __promisify__(hostname: string, options?: ResolveOptions): Promise; + } + + export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export namespace resolveCname { + function __promisify__(hostname: string): Promise; + } + + export function resolveCaa(hostname: string, callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void): void; + export namespace resolveCaa { + function __promisify__(hostname: string): Promise; + } + + export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void; + export namespace resolveMx { + function __promisify__(hostname: string): Promise; + } + + export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void; + export namespace resolveNaptr { + function __promisify__(hostname: string): Promise; + } + + export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export namespace resolveNs { + function __promisify__(hostname: string): Promise; + } + + export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export namespace resolvePtr { + function __promisify__(hostname: string): Promise; + } + + export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void; + export namespace resolveSoa { + function __promisify__(hostname: string): Promise; + } + + export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void; + export namespace resolveSrv { + function __promisify__(hostname: string): Promise; + } + + export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void; + export namespace resolveTxt { + function __promisify__(hostname: string): Promise; + } + + export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void; + export namespace resolveAny { + function __promisify__(hostname: string): Promise; + } + + export function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void; + export function setServers(servers: ReadonlyArray): void; + export function getServers(): string[]; + + // Error codes + export const NODATA: string; + export const FORMERR: string; + export const SERVFAIL: string; + export const NOTFOUND: string; + export const NOTIMP: string; + export const REFUSED: string; + export const BADQUERY: string; + export const BADNAME: string; + export const BADFAMILY: string; + export const BADRESP: string; + export const CONNREFUSED: string; + export const TIMEOUT: string; + export const EOF: string; + export const FILE: string; + export const NOMEM: string; + export const DESTRUCTION: string; + export const BADSTR: string; + export const BADFLAGS: string; + export const NONAME: string; + export const BADHINTS: string; + export const NOTINITIALIZED: string; + export const LOADIPHLPAPI: string; + export const ADDRGETNETWORKPARAMS: string; + export const CANCELLED: string; + + export interface ResolverOptions { + timeout?: number; + } + + export class Resolver { + constructor(options?: ResolverOptions); + + cancel(): void; + getServers: typeof getServers; + resolve: typeof resolve; + resolve4: typeof resolve4; + resolve6: typeof resolve6; + resolveAny: typeof resolveAny; + resolveCname: typeof resolveCname; + resolveMx: typeof resolveMx; + resolveNaptr: typeof resolveNaptr; + resolveNs: typeof resolveNs; + resolvePtr: typeof resolvePtr; + resolveSoa: typeof resolveSoa; + resolveSrv: typeof resolveSrv; + resolveTxt: typeof resolveTxt; + reverse: typeof reverse; + setLocalAddress(ipv4?: string, ipv6?: string): void; + setServers: typeof setServers; + } + + export { dnsPromises as promises }; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/dns/promises.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/dns/promises.d.ts new file mode 100755 index 000000000..2feb87434 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/dns/promises.d.ts @@ -0,0 +1,97 @@ +declare module "dns/promises" { + import { + LookupAddress, + LookupOneOptions, + LookupAllOptions, + LookupOptions, + AnyRecord, + CaaRecord, + MxRecord, + NaptrRecord, + SoaRecord, + SrvRecord, + ResolveWithTtlOptions, + RecordWithTtl, + ResolveOptions, + ResolverOptions, + } from "dns"; + + function getServers(): string[]; + + function lookup(hostname: string, family: number): Promise; + function lookup(hostname: string, options: LookupOneOptions): Promise; + function lookup(hostname: string, options: LookupAllOptions): Promise; + function lookup(hostname: string, options: LookupOptions): Promise; + function lookup(hostname: string): Promise; + + function lookupService(address: string, port: number): Promise<{ hostname: string, service: string }>; + + function resolve(hostname: string): Promise; + function resolve(hostname: string, rrtype: "A"): Promise; + function resolve(hostname: string, rrtype: "AAAA"): Promise; + function resolve(hostname: string, rrtype: "ANY"): Promise; + function resolve(hostname: string, rrtype: "CAA"): Promise; + function resolve(hostname: string, rrtype: "CNAME"): Promise; + function resolve(hostname: string, rrtype: "MX"): Promise; + function resolve(hostname: string, rrtype: "NAPTR"): Promise; + function resolve(hostname: string, rrtype: "NS"): Promise; + function resolve(hostname: string, rrtype: "PTR"): Promise; + function resolve(hostname: string, rrtype: "SOA"): Promise; + function resolve(hostname: string, rrtype: "SRV"): Promise; + function resolve(hostname: string, rrtype: "TXT"): Promise; + function resolve(hostname: string, rrtype: string): Promise; + + function resolve4(hostname: string): Promise; + function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise; + function resolve4(hostname: string, options: ResolveOptions): Promise; + + function resolve6(hostname: string): Promise; + function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise; + function resolve6(hostname: string, options: ResolveOptions): Promise; + + function resolveAny(hostname: string): Promise; + + function resolveCaa(hostname: string): Promise; + + function resolveCname(hostname: string): Promise; + + function resolveMx(hostname: string): Promise; + + function resolveNaptr(hostname: string): Promise; + + function resolveNs(hostname: string): Promise; + + function resolvePtr(hostname: string): Promise; + + function resolveSoa(hostname: string): Promise; + + function resolveSrv(hostname: string): Promise; + + function resolveTxt(hostname: string): Promise; + + function reverse(ip: string): Promise; + + function setServers(servers: ReadonlyArray): void; + + class Resolver { + constructor(options?: ResolverOptions); + + cancel(): void; + getServers: typeof getServers; + resolve: typeof resolve; + resolve4: typeof resolve4; + resolve6: typeof resolve6; + resolveAny: typeof resolveAny; + resolveCname: typeof resolveCname; + resolveMx: typeof resolveMx; + resolveNaptr: typeof resolveNaptr; + resolveNs: typeof resolveNs; + resolvePtr: typeof resolvePtr; + resolveSoa: typeof resolveSoa; + resolveSrv: typeof resolveSrv; + resolveTxt: typeof resolveTxt; + reverse: typeof reverse; + setLocalAddress(ipv4?: string, ipv6?: string): void; + setServers: typeof setServers; + } +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/domain.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/domain.d.ts new file mode 100755 index 000000000..6423ebfce --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/domain.d.ts @@ -0,0 +1,24 @@ +declare module 'domain' { + import EventEmitter = require('events'); + + global { + namespace NodeJS { + interface Domain extends EventEmitter { + run(fn: (...args: any[]) => T, ...args: any[]): T; + add(emitter: EventEmitter | Timer): void; + remove(emitter: EventEmitter | Timer): void; + bind(cb: T): T; + intercept(cb: T): T; + } + } + } + + interface Domain extends NodeJS.Domain {} + class Domain extends EventEmitter { + members: Array; + enter(): void; + exit(): void; + } + + function create(): Domain; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/events.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/events.d.ts new file mode 100755 index 000000000..0d5d2479c --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/events.d.ts @@ -0,0 +1,93 @@ +declare module 'events' { + interface EventEmitterOptions { + /** + * Enables automatic capturing of promise rejection. + */ + captureRejections?: boolean; + } + + interface NodeEventTarget { + once(event: string | symbol, listener: (...args: any[]) => void): this; + } + + interface DOMEventTarget { + addEventListener(event: string, listener: (...args: any[]) => void, opts?: { once: boolean }): any; + } + + interface StaticEventEmitterOptions { + signal?: AbortSignal; + } + + interface EventEmitter extends NodeJS.EventEmitter {} + class EventEmitter { + constructor(options?: EventEmitterOptions); + + static once(emitter: NodeEventTarget, event: string | symbol, options?: StaticEventEmitterOptions): Promise; + static once(emitter: DOMEventTarget, event: string, options?: StaticEventEmitterOptions): Promise; + static on(emitter: NodeJS.EventEmitter, event: string, options?: StaticEventEmitterOptions): AsyncIterableIterator; + + /** @deprecated since v4.0.0 */ + static listenerCount(emitter: NodeJS.EventEmitter, event: string | symbol): number; + /** + * Returns a list listener for a specific emitter event name. + */ + static getEventListener(emitter: DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[]; + + /** + * This symbol shall be used to install a listener for only monitoring `'error'` + * events. Listeners installed using this symbol are called before the regular + * `'error'` listeners are called. + * + * Installing a listener using this symbol does not change the behavior once an + * `'error'` event is emitted, therefore the process will still crash if no + * regular `'error'` listener is installed. + */ + static readonly errorMonitor: unique symbol; + static readonly captureRejectionSymbol: unique symbol; + + /** + * Sets or gets the default captureRejection value for all emitters. + */ + // TODO: These should be described using static getter/setter pairs: + static captureRejections: boolean; + static defaultMaxListeners: number; + } + + import internal = require('events'); + namespace EventEmitter { + // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4 + export { internal as EventEmitter }; + + export interface Abortable { + /** + * When provided the corresponding `AbortController` can be used to cancel an asynchronous action. + */ + signal?: AbortSignal; + } + } + + global { + namespace NodeJS { + interface EventEmitter { + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + off(event: string | symbol, listener: (...args: any[]) => void): this; + removeAllListeners(event?: string | symbol): this; + setMaxListeners(n: number): this; + getMaxListeners(): number; + listeners(event: string | symbol): Function[]; + rawListeners(event: string | symbol): Function[]; + emit(event: string | symbol, ...args: any[]): boolean; + listenerCount(event: string | symbol): number; + // Added in Node 6... + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + eventNames(): Array; + } + } + } + + export = EventEmitter; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/fs.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/fs.d.ts new file mode 100755 index 000000000..dd01a7bba --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/fs.d.ts @@ -0,0 +1,2266 @@ +declare module 'fs' { + import * as stream from 'stream'; + import { Abortable, EventEmitter } from 'events'; + import { URL } from 'url'; + import * as promises from 'fs/promises'; + + export { promises }; + /** + * Valid types for path values in "fs". + */ + export type PathLike = string | Buffer | URL; + + export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void; + + export type BufferEncodingOption = 'buffer' | { encoding: 'buffer' }; + + export interface BaseEncodingOptions { + encoding?: BufferEncoding | null; + } + + export type OpenMode = number | string; + + export type Mode = number | string; + + export interface StatsBase { + isFile(): boolean; + isDirectory(): boolean; + isBlockDevice(): boolean; + isCharacterDevice(): boolean; + isSymbolicLink(): boolean; + isFIFO(): boolean; + isSocket(): boolean; + + dev: T; + ino: T; + mode: T; + nlink: T; + uid: T; + gid: T; + rdev: T; + size: T; + blksize: T; + blocks: T; + atimeMs: T; + mtimeMs: T; + ctimeMs: T; + birthtimeMs: T; + atime: Date; + mtime: Date; + ctime: Date; + birthtime: Date; + } + + export interface Stats extends StatsBase { + } + + export class Stats { + } + + export class Dirent { + isFile(): boolean; + isDirectory(): boolean; + isBlockDevice(): boolean; + isCharacterDevice(): boolean; + isSymbolicLink(): boolean; + isFIFO(): boolean; + isSocket(): boolean; + name: string; + } + + /** + * A class representing a directory stream. + */ + export class Dir { + readonly path: string; + + /** + * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read. + */ + [Symbol.asyncIterator](): AsyncIterableIterator; + + /** + * Asynchronously close the directory's underlying resource handle. + * Subsequent reads will result in errors. + */ + close(): Promise; + close(cb: NoParamCallback): void; + + /** + * Synchronously close the directory's underlying resource handle. + * Subsequent reads will result in errors. + */ + closeSync(): void; + + /** + * Asynchronously read the next directory entry via `readdir(3)` as an `Dirent`. + * After the read is completed, a value is returned that will be resolved with an `Dirent`, or `null` if there are no more directory entries to read. + * Directory entries returned by this function are in no particular order as provided by the operating system's underlying directory mechanisms. + */ + read(): Promise; + read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void; + + /** + * Synchronously read the next directory entry via `readdir(3)` as a `Dirent`. + * If there are no more directory entries to read, null will be returned. + * Directory entries returned by this function are in no particular order as provided by the operating system's underlying directory mechanisms. + */ + readSync(): Dirent | null; + } + + export interface FSWatcher extends EventEmitter { + close(): void; + + /** + * events.EventEmitter + * 1. change + * 2. error + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + addListener(event: "error", listener: (error: Error) => void): this; + addListener(event: "close", listener: () => void): this; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + on(event: "error", listener: (error: Error) => void): this; + on(event: "close", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + once(event: "error", listener: (error: Error) => void): this; + once(event: "close", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + prependListener(event: "error", listener: (error: Error) => void): this; + prependListener(event: "close", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + prependOnceListener(event: "error", listener: (error: Error) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + } + + export class ReadStream extends stream.Readable { + close(): void; + bytesRead: number; + path: string | Buffer; + pending: boolean; + + /** + * events.EventEmitter + * 1. open + * 2. close + * 3. ready + */ + addListener(event: "close", listener: () => void): this; + addListener(event: "data", listener: (chunk: Buffer | string) => void): this; + addListener(event: "end", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "open", listener: (fd: number) => void): this; + addListener(event: "pause", listener: () => void): this; + addListener(event: "readable", listener: () => void): this; + addListener(event: "ready", listener: () => void): this; + addListener(event: "resume", listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + on(event: "close", listener: () => void): this; + on(event: "data", listener: (chunk: Buffer | string) => void): this; + on(event: "end", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "open", listener: (fd: number) => void): this; + on(event: "pause", listener: () => void): this; + on(event: "readable", listener: () => void): this; + on(event: "ready", listener: () => void): this; + on(event: "resume", listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "close", listener: () => void): this; + once(event: "data", listener: (chunk: Buffer | string) => void): this; + once(event: "end", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "open", listener: (fd: number) => void): this; + once(event: "pause", listener: () => void): this; + once(event: "readable", listener: () => void): this; + once(event: "ready", listener: () => void): this; + once(event: "resume", listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "close", listener: () => void): this; + prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; + prependListener(event: "end", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "open", listener: (fd: number) => void): this; + prependListener(event: "pause", listener: () => void): this; + prependListener(event: "readable", listener: () => void): this; + prependListener(event: "ready", listener: () => void): this; + prependListener(event: "resume", listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: "end", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "open", listener: (fd: number) => void): this; + prependOnceListener(event: "pause", listener: () => void): this; + prependOnceListener(event: "readable", listener: () => void): this; + prependOnceListener(event: "ready", listener: () => void): this; + prependOnceListener(event: "resume", listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + export class WriteStream extends stream.Writable { + close(): void; + bytesWritten: number; + path: string | Buffer; + pending: boolean; + + /** + * events.EventEmitter + * 1. open + * 2. close + * 3. ready + */ + addListener(event: "close", listener: () => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "finish", listener: () => void): this; + addListener(event: "open", listener: (fd: number) => void): this; + addListener(event: "pipe", listener: (src: stream.Readable) => void): this; + addListener(event: "ready", listener: () => void): this; + addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + on(event: "close", listener: () => void): this; + on(event: "drain", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "finish", listener: () => void): this; + on(event: "open", listener: (fd: number) => void): this; + on(event: "pipe", listener: (src: stream.Readable) => void): this; + on(event: "ready", listener: () => void): this; + on(event: "unpipe", listener: (src: stream.Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "close", listener: () => void): this; + once(event: "drain", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "finish", listener: () => void): this; + once(event: "open", listener: (fd: number) => void): this; + once(event: "pipe", listener: (src: stream.Readable) => void): this; + once(event: "ready", listener: () => void): this; + once(event: "unpipe", listener: (src: stream.Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "close", listener: () => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "finish", listener: () => void): this; + prependListener(event: "open", listener: (fd: number) => void): this; + prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; + prependListener(event: "ready", listener: () => void): this; + prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "finish", listener: () => void): this; + prependOnceListener(event: "open", listener: (fd: number) => void): this; + prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; + prependOnceListener(event: "ready", listener: () => void): this; + prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + /** + * Asynchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace rename { + /** + * Asynchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(oldPath: PathLike, newPath: PathLike): Promise; + } + + /** + * Synchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function renameSync(oldPath: PathLike, newPath: PathLike): void; + + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void; + + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function truncate(path: PathLike, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace truncate { + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + function __promisify__(path: PathLike, len?: number | null): Promise; + } + + /** + * Synchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + export function truncateSync(path: PathLike, len?: number | null): void; + + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + * @param len If not specified, defaults to `0`. + */ + export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void; + + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + */ + export function ftruncate(fd: number, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace ftruncate { + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + * @param len If not specified, defaults to `0`. + */ + function __promisify__(fd: number, len?: number | null): Promise; + } + + /** + * Synchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + * @param len If not specified, defaults to `0`. + */ + export function ftruncateSync(fd: number, len?: number | null): void; + + /** + * Asynchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace chown { + /** + * Asynchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike, uid: number, gid: number): Promise; + } + + /** + * Synchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function chownSync(path: PathLike, uid: number, gid: number): void; + + /** + * Asynchronous fchown(2) - Change ownership of a file. + * @param fd A file descriptor. + */ + export function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace fchown { + /** + * Asynchronous fchown(2) - Change ownership of a file. + * @param fd A file descriptor. + */ + function __promisify__(fd: number, uid: number, gid: number): Promise; + } + + /** + * Synchronous fchown(2) - Change ownership of a file. + * @param fd A file descriptor. + */ + export function fchownSync(fd: number, uid: number, gid: number): void; + + /** + * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace lchown { + /** + * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike, uid: number, gid: number): Promise; + } + + /** + * Synchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function lchownSync(path: PathLike, uid: number, gid: number): void; + + /** + * Changes the access and modification times of a file in the same way as `fs.utimes()`, + * with the difference that if the path refers to a symbolic link, then the link is not + * dereferenced: instead, the timestamps of the symbolic link itself are changed. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function lutimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace lutimes { + /** + * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, + * with the difference that if the path refers to a symbolic link, then the link is not + * dereferenced: instead, the timestamps of the symbolic link itself are changed. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function __promisify__(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise; + } + + /** + * Change the file system timestamps of the symbolic link referenced by `path`. Returns `undefined`, + * or throws an exception when parameters are incorrect or the operation fails. + * This is the synchronous version of `fs.lutimes()`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function lutimesSync(path: PathLike, atime: string | number | Date, mtime: string | number | Date): void; + + /** + * Asynchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace chmod { + /** + * Asynchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function __promisify__(path: PathLike, mode: Mode): Promise; + } + + /** + * Synchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function chmodSync(path: PathLike, mode: Mode): void; + + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param fd A file descriptor. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace fchmod { + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param fd A file descriptor. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function __promisify__(fd: number, mode: Mode): Promise; + } + + /** + * Synchronous fchmod(2) - Change permissions of a file. + * @param fd A file descriptor. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function fchmodSync(fd: number, mode: Mode): void; + + /** + * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace lchmod { + /** + * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function __promisify__(path: PathLike, mode: Mode): Promise; + } + + /** + * Synchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function lchmodSync(path: PathLike, mode: Mode): void; + + /** + * Asynchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + export function stat(path: PathLike, options: StatOptions & { bigint?: false } | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + export function stat(path: PathLike, options: StatOptions & { bigint: true }, callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void): void; + export function stat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace stat { + /** + * Asynchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike, options?: StatOptions & { bigint?: false }): Promise; + function __promisify__(path: PathLike, options: StatOptions & { bigint: true }): Promise; + function __promisify__(path: PathLike, options?: StatOptions): Promise; + } + + export interface StatSyncFn extends Function { + (path: TDescriptor, options?: undefined): Stats; + (path: TDescriptor, options?: StatOptions & { bigint?: false; throwIfNoEntry: false }): Stats | undefined; + (path: TDescriptor, options: StatOptions & { bigint: true; throwIfNoEntry: false }): BigIntStats | undefined; + (path: TDescriptor, options?: StatOptions & { bigint?: false }): Stats; + (path: TDescriptor, options: StatOptions & { bigint: true }): BigIntStats; + (path: TDescriptor, options: StatOptions & { bigint: boolean; throwIfNoEntry?: false }): Stats | BigIntStats; + (path: TDescriptor, options?: StatOptions): Stats | BigIntStats | undefined; + } + + /** + * Synchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export const statSync: StatSyncFn; + + /** + * Asynchronous fstat(2) - Get file status. + * @param fd A file descriptor. + */ + export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + export function fstat(fd: number, options: StatOptions & { bigint?: false } | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + export function fstat(fd: number, options: StatOptions & { bigint: true }, callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void): void; + export function fstat(fd: number, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace fstat { + /** + * Asynchronous fstat(2) - Get file status. + * @param fd A file descriptor. + */ + function __promisify__(fd: number, options?: StatOptions & { bigint?: false }): Promise; + function __promisify__(fd: number, options: StatOptions & { bigint: true }): Promise; + function __promisify__(fd: number, options?: StatOptions): Promise; + } + + /** + * Synchronous fstat(2) - Get file status. + * @param fd A file descriptor. + */ + export const fstatSync: StatSyncFn; + + /** + * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + export function lstat(path: PathLike, options: StatOptions & { bigint?: false } | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + export function lstat(path: PathLike, options: StatOptions & { bigint: true }, callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void): void; + export function lstat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace lstat { + /** + * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike, options?: StatOptions & { bigint?: false }): Promise; + function __promisify__(path: PathLike, options: StatOptions & { bigint: true }): Promise; + function __promisify__(path: PathLike, options?: StatOptions): Promise; + } + + /** + * Synchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export const lstatSync: StatSyncFn; + /** + * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace link { + /** + * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(existingPath: PathLike, newPath: PathLike): Promise; + } + + /** + * Synchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function linkSync(existingPath: PathLike, newPath: PathLike): void; + + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + export function symlink(target: PathLike, path: PathLike, type: symlink.Type | undefined | null, callback: NoParamCallback): void; + + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + */ + export function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace symlink { + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise; + + type Type = "dir" | "file" | "junction"; + } + + /** + * Synchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlink( + path: PathLike, + options: BaseEncodingOptions | BufferEncoding | undefined | null, + callback: (err: NodeJS.ErrnoException | null, linkString: string) => void + ): void; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlink(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: Buffer) => void): void; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlink(path: PathLike, options: BaseEncodingOptions | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void): void; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace readlink { + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: BaseEncodingOptions | BufferEncoding | null): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: BaseEncodingOptions | string | null): Promise; + } + + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlinkSync(path: PathLike, options?: BaseEncodingOptions | BufferEncoding | null): string; + + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlinkSync(path: PathLike, options: BufferEncodingOption): Buffer; + + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlinkSync(path: PathLike, options?: BaseEncodingOptions | string | null): string | Buffer; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpath( + path: PathLike, + options: BaseEncodingOptions | BufferEncoding | undefined | null, + callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void + ): void; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpath(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpath(path: PathLike, options: BaseEncodingOptions | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace realpath { + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: BaseEncodingOptions | BufferEncoding | null): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: BaseEncodingOptions | string | null): Promise; + + function native( + path: PathLike, + options: BaseEncodingOptions | BufferEncoding | undefined | null, + callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void + ): void; + function native(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void; + function native(path: PathLike, options: BaseEncodingOptions | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void; + function native(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; + } + + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpathSync(path: PathLike, options?: BaseEncodingOptions | BufferEncoding | null): string; + + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpathSync(path: PathLike, options: BufferEncodingOption): Buffer; + + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpathSync(path: PathLike, options?: BaseEncodingOptions | string | null): string | Buffer; + + export namespace realpathSync { + function native(path: PathLike, options?: BaseEncodingOptions | BufferEncoding | null): string; + function native(path: PathLike, options: BufferEncodingOption): Buffer; + function native(path: PathLike, options?: BaseEncodingOptions | string | null): string | Buffer; + } + + /** + * Asynchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function unlink(path: PathLike, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace unlink { + /** + * Asynchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike): Promise; + } + + /** + * Synchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function unlinkSync(path: PathLike): void; + + export interface RmDirOptions { + /** + * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or + * `EPERM` error is encountered, Node.js will retry the operation with a linear + * backoff wait of `retryDelay` ms longer on each try. This option represents the + * number of retries. This option is ignored if the `recursive` option is not + * `true`. + * @default 0 + */ + maxRetries?: number; + /** + * @deprecated since v14.14.0 In future versions of Node.js, + * `fs.rmdir(path, { recursive: true })` will throw if `path` does not exist or is a file. + * Use `fs.rm(path, { recursive: true, force: true })` instead. + * + * If `true`, perform a recursive directory removal. In + * recursive mode, errors are not reported if `path` does not exist, and + * operations are retried on failure. + * @default false + */ + recursive?: boolean; + /** + * The amount of time in milliseconds to wait between retries. + * This option is ignored if the `recursive` option is not `true`. + * @default 100 + */ + retryDelay?: number; + } + + /** + * Asynchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function rmdir(path: PathLike, callback: NoParamCallback): void; + export function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace rmdir { + /** + * Asynchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike, options?: RmDirOptions): Promise; + } + + /** + * Synchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function rmdirSync(path: PathLike, options?: RmDirOptions): void; + + export interface RmOptions { + /** + * When `true`, exceptions will be ignored if `path` does not exist. + * @default false + */ + force?: boolean; + /** + * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or + * `EPERM` error is encountered, Node.js will retry the operation with a linear + * backoff wait of `retryDelay` ms longer on each try. This option represents the + * number of retries. This option is ignored if the `recursive` option is not + * `true`. + * @default 0 + */ + maxRetries?: number; + /** + * If `true`, perform a recursive directory removal. In + * recursive mode, errors are not reported if `path` does not exist, and + * operations are retried on failure. + * @default false + */ + recursive?: boolean; + /** + * The amount of time in milliseconds to wait between retries. + * This option is ignored if the `recursive` option is not `true`. + * @default 100 + */ + retryDelay?: number; + } + + /** + * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). + */ + export function rm(path: PathLike, callback: NoParamCallback): void; + export function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace rm { + /** + * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). + */ + function __promisify__(path: PathLike, options?: RmOptions): Promise; + } + + /** + * Synchronously removes files and directories (modeled on the standard POSIX `rm` utility). + */ + export function rmSync(path: PathLike, options?: RmOptions): void; + + export interface MakeDirectoryOptions { + /** + * Indicates whether parent folders should be created. + * If a folder was created, the path to the first created folder will be returned. + * @default false + */ + recursive?: boolean; + /** + * A file mode. If a string is passed, it is parsed as an octal integer. If not specified + * @default 0o777 + */ + mode?: Mode; + } + + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true }, callback: (err: NodeJS.ErrnoException | null, path?: string) => void): void; + + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdir(path: PathLike, options: Mode | (MakeDirectoryOptions & { recursive?: false; }) | null | undefined, callback: NoParamCallback): void; + + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdir(path: PathLike, options: Mode | MakeDirectoryOptions | null | undefined, callback: (err: NodeJS.ErrnoException | null, path?: string) => void): void; + + /** + * Asynchronous mkdir(2) - create a directory with a mode of `0o777`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function mkdir(path: PathLike, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace mkdir { + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function __promisify__(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): Promise; + + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function __promisify__(path: PathLike, options?: Mode | (MakeDirectoryOptions & { recursive?: false; }) | null): Promise; + + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function __promisify__(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; + } + + /** + * Synchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdirSync(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): string | undefined; + + /** + * Synchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdirSync(path: PathLike, options?: Mode | (MakeDirectoryOptions & { recursive?: false; }) | null): void; + + /** + * Synchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtemp(prefix: string, options: BaseEncodingOptions | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtemp(prefix: string, options: "buffer" | { encoding: "buffer" }, callback: (err: NodeJS.ErrnoException | null, folder: Buffer) => void): void; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtemp(prefix: string, options: BaseEncodingOptions | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, folder: string | Buffer) => void): void; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + */ + export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace mkdtemp { + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(prefix: string, options?: BaseEncodingOptions | BufferEncoding | null): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(prefix: string, options: BufferEncodingOption): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(prefix: string, options?: BaseEncodingOptions | string | null): Promise; + } + + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtempSync(prefix: string, options?: BaseEncodingOptions | BufferEncoding | null): string; + + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtempSync(prefix: string, options: BufferEncodingOption): Buffer; + + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtempSync(prefix: string, options?: BaseEncodingOptions | string | null): string | Buffer; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir( + path: PathLike, + options: { encoding: BufferEncoding | null; withFileTypes?: false } | BufferEncoding | undefined | null, + callback: (err: NodeJS.ErrnoException | null, files: string[]) => void, + ): void; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir(path: PathLike, options: { encoding: "buffer"; withFileTypes?: false } | "buffer", callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void): void; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir( + path: PathLike, + options: BaseEncodingOptions & { withFileTypes?: false } | BufferEncoding | undefined | null, + callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void, + ): void; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null, files: string[]) => void): void; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. + */ + export function readdir(path: PathLike, options: BaseEncodingOptions & { withFileTypes: true }, callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace readdir { + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: { encoding: BufferEncoding | null; withFileTypes?: false } | BufferEncoding | null): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options: "buffer" | { encoding: "buffer"; withFileTypes?: false }): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: BaseEncodingOptions & { withFileTypes?: false } | BufferEncoding | null): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent + */ + function __promisify__(path: PathLike, options: BaseEncodingOptions & { withFileTypes: true }): Promise; + } + + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync(path: PathLike, options?: { encoding: BufferEncoding | null; withFileTypes?: false } | BufferEncoding | null): string[]; + + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync(path: PathLike, options: { encoding: "buffer"; withFileTypes?: false } | "buffer"): Buffer[]; + + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync(path: PathLike, options?: BaseEncodingOptions & { withFileTypes?: false } | BufferEncoding | null): string[] | Buffer[]; + + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. + */ + export function readdirSync(path: PathLike, options: BaseEncodingOptions & { withFileTypes: true }): Dirent[]; + + /** + * Asynchronous close(2) - close a file descriptor. + * @param fd A file descriptor. + */ + export function close(fd: number, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace close { + /** + * Asynchronous close(2) - close a file descriptor. + * @param fd A file descriptor. + */ + function __promisify__(fd: number): Promise; + } + + /** + * Synchronous close(2) - close a file descriptor. + * @param fd A file descriptor. + */ + export function closeSync(fd: number): void; + + /** + * Asynchronous open(2) - open and possibly create a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. + */ + export function open(path: PathLike, flags: OpenMode, mode: Mode | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; + + /** + * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function open(path: PathLike, flags: OpenMode, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace open { + /** + * Asynchronous open(2) - open and possibly create a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. + */ + function __promisify__(path: PathLike, flags: OpenMode, mode?: Mode | null): Promise; + } + + /** + * Synchronous open(2) - open and possibly create a file, returning a file descriptor.. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. + */ + export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number; + + /** + * Asynchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace utimes { + /** + * Asynchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function __promisify__(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise; + } + + /** + * Synchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function utimesSync(path: PathLike, atime: string | number | Date, mtime: string | number | Date): void; + + /** + * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function futimes(fd: number, atime: string | number | Date, mtime: string | number | Date, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace futimes { + /** + * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function __promisify__(fd: number, atime: string | number | Date, mtime: string | number | Date): Promise; + } + + /** + * Synchronously change file timestamps of the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function futimesSync(fd: number, atime: string | number | Date, mtime: string | number | Date): void; + + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param fd A file descriptor. + */ + export function fsync(fd: number, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace fsync { + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param fd A file descriptor. + */ + function __promisify__(fd: number): Promise; + } + + /** + * Synchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param fd A file descriptor. + */ + export function fsyncSync(fd: number): void; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + export function write( + fd: number, + buffer: TBuffer, + offset: number | undefined | null, + length: number | undefined | null, + position: number | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, + ): void; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + */ + export function write( + fd: number, + buffer: TBuffer, + offset: number | undefined | null, + length: number | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, + ): void; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + */ + export function write( + fd: number, + buffer: TBuffer, + offset: number | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void + ): void; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + */ + export function write(fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void): void; + + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + export function write( + fd: number, + string: string, + position: number | undefined | null, + encoding: BufferEncoding | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, + ): void; + + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + export function write(fd: number, string: string, position: number | undefined | null, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; + + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + */ + export function write(fd: number, string: string, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace write { + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + function __promisify__( + fd: number, + buffer?: TBuffer, + offset?: number, + length?: number, + position?: number | null, + ): Promise<{ bytesWritten: number, buffer: TBuffer }>; + + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + function __promisify__(fd: number, string: string, position?: number | null, encoding?: BufferEncoding | null): Promise<{ bytesWritten: number, buffer: string }>; + } + + /** + * Synchronously writes `buffer` to the file referenced by the supplied file descriptor, returning the number of bytes written. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + export function writeSync(fd: number, buffer: NodeJS.ArrayBufferView, offset?: number | null, length?: number | null, position?: number | null): number; + + /** + * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + export function writeSync(fd: number, string: string, position?: number | null, encoding?: BufferEncoding | null): number; + + /** + * Asynchronously reads data from the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + export function read( + fd: number, + buffer: TBuffer, + offset: number, + length: number, + position: number | null, + callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, + ): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace read { + /** + * @param fd A file descriptor. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + function __promisify__( + fd: number, + buffer: TBuffer, + offset: number, + length: number, + position: number | null + ): Promise<{ bytesRead: number, buffer: TBuffer }>; + } + + export interface ReadSyncOptions { + /** + * @default 0 + */ + offset?: number; + /** + * @default `length of buffer` + */ + length?: number; + /** + * @default null + */ + position?: number | null; + } + + /** + * Synchronously reads data from the file referenced by the supplied file descriptor, returning the number of bytes read. + * @param fd A file descriptor. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, offset: number, length: number, position: number | null): number; + + /** + * Similar to the above `fs.readSync` function, this version takes an optional `options` object. + * If no `options` object is specified, it will default with the above values. + */ + export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadSyncOptions): number; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFile( + path: PathLike | number, + options: { encoding?: null; flag?: string; } & Abortable | undefined | null, + callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void, + ): void; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFile( + path: PathLike | number, + options: { encoding: BufferEncoding; flag?: string; } & Abortable | string, + callback: (err: NodeJS.ErrnoException | null, data: string) => void, + ): void; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFile( + path: PathLike | number, + // TODO: unify the options across all readfile functions + options: BaseEncodingOptions & { flag?: string; } & Abortable | string | undefined | null, + callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void, + ): void; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + */ + export function readFile(path: PathLike | number, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace readFile { + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function __promisify__(path: PathLike | number, options?: { encoding?: null; flag?: string; } | null): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function __promisify__(path: PathLike | number, options: { encoding: BufferEncoding; flag?: string; } | string): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function __promisify__(path: PathLike | number, options?: BaseEncodingOptions & { flag?: string; } | string | null): Promise; + } + + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. If a flag is not provided, it defaults to `'r'`. + */ + export function readFileSync(path: PathLike | number, options?: { encoding?: null; flag?: string; } | null): Buffer; + + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFileSync(path: PathLike | number, options: { encoding: BufferEncoding; flag?: string; } | BufferEncoding): string; + + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFileSync(path: PathLike | number, options?: BaseEncodingOptions & { flag?: string; } | BufferEncoding | null): string | Buffer; + + export type WriteFileOptions = (BaseEncodingOptions & Abortable & { mode?: Mode; flag?: string; }) | string | null; + + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + export function writeFile(path: PathLike | number, data: string | NodeJS.ArrayBufferView, options: WriteFileOptions, callback: NoParamCallback): void; + + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + */ + export function writeFile(path: PathLike | number, data: string | NodeJS.ArrayBufferView, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace writeFile { + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + function __promisify__(path: PathLike | number, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): Promise; + } + + /** + * Synchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + export function writeFileSync(path: PathLike | number, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): void; + + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + export function appendFile(file: PathLike | number, data: string | Uint8Array, options: WriteFileOptions, callback: NoParamCallback): void; + + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + */ + export function appendFile(file: PathLike | number, data: string | Uint8Array, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace appendFile { + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + function __promisify__(file: PathLike | number, data: string | Uint8Array, options?: WriteFileOptions): Promise; + } + + /** + * Synchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + export function appendFileSync(file: PathLike | number, data: string | Uint8Array, options?: WriteFileOptions): void; + + /** + * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. + */ + export function watchFile(filename: PathLike, options: { persistent?: boolean; interval?: number; } | undefined, listener: (curr: Stats, prev: Stats) => void): void; + + /** + * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function watchFile(filename: PathLike, listener: (curr: Stats, prev: Stats) => void): void; + + /** + * Stop watching for changes on `filename`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function unwatchFile(filename: PathLike, listener?: (curr: Stats, prev: Stats) => void): void; + + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + export function watch( + filename: PathLike, + options: { encoding?: BufferEncoding | null, persistent?: boolean, recursive?: boolean } | BufferEncoding | undefined | null, + listener?: (event: "rename" | "change", filename: string) => void, + ): FSWatcher; + + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + export function watch( + filename: PathLike, + options: { encoding: "buffer", persistent?: boolean, recursive?: boolean; } | "buffer", + listener?: (event: "rename" | "change", filename: Buffer) => void + ): FSWatcher; + + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + export function watch( + filename: PathLike, + options: { encoding?: BufferEncoding | null, persistent?: boolean, recursive?: boolean } | string | null, + listener?: (event: "rename" | "change", filename: string | Buffer) => void, + ): FSWatcher; + + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function watch(filename: PathLike, listener?: (event: "rename" | "change", filename: string) => any): FSWatcher; + + /** + * Asynchronously tests whether or not the given path exists by checking with the file system. + * @deprecated since v1.0.0 Use `fs.stat()` or `fs.access()` instead + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function exists(path: PathLike, callback: (exists: boolean) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace exists { + /** + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(path: PathLike): Promise; + } + + /** + * Synchronously tests whether or not the given path exists by checking with the file system. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function existsSync(path: PathLike): boolean; + + export namespace constants { + // File Access Constants + + /** Constant for fs.access(). File is visible to the calling process. */ + const F_OK: number; + + /** Constant for fs.access(). File can be read by the calling process. */ + const R_OK: number; + + /** Constant for fs.access(). File can be written by the calling process. */ + const W_OK: number; + + /** Constant for fs.access(). File can be executed by the calling process. */ + const X_OK: number; + + // File Copy Constants + + /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */ + const COPYFILE_EXCL: number; + + /** + * Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink. + * If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used. + */ + const COPYFILE_FICLONE: number; + + /** + * Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink. + * If the underlying platform does not support copy-on-write, then the operation will fail with an error. + */ + const COPYFILE_FICLONE_FORCE: number; + + // File Open Constants + + /** Constant for fs.open(). Flag indicating to open a file for read-only access. */ + const O_RDONLY: number; + + /** Constant for fs.open(). Flag indicating to open a file for write-only access. */ + const O_WRONLY: number; + + /** Constant for fs.open(). Flag indicating to open a file for read-write access. */ + const O_RDWR: number; + + /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */ + const O_CREAT: number; + + /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */ + const O_EXCL: number; + + /** + * Constant for fs.open(). Flag indicating that if path identifies a terminal device, + * opening the path shall not cause that terminal to become the controlling terminal for the process + * (if the process does not already have one). + */ + const O_NOCTTY: number; + + /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */ + const O_TRUNC: number; + + /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */ + const O_APPEND: number; + + /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */ + const O_DIRECTORY: number; + + /** + * constant for fs.open(). + * Flag indicating reading accesses to the file system will no longer result in + * an update to the atime information associated with the file. + * This flag is available on Linux operating systems only. + */ + const O_NOATIME: number; + + /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */ + const O_NOFOLLOW: number; + + /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */ + const O_SYNC: number; + + /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */ + const O_DSYNC: number; + + /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */ + const O_SYMLINK: number; + + /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */ + const O_DIRECT: number; + + /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */ + const O_NONBLOCK: number; + + // File Type Constants + + /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */ + const S_IFMT: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */ + const S_IFREG: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */ + const S_IFDIR: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */ + const S_IFCHR: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */ + const S_IFBLK: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */ + const S_IFIFO: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */ + const S_IFLNK: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */ + const S_IFSOCK: number; + + // File Mode Constants + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */ + const S_IRWXU: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */ + const S_IRUSR: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */ + const S_IWUSR: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */ + const S_IXUSR: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */ + const S_IRWXG: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */ + const S_IRGRP: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */ + const S_IWGRP: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */ + const S_IXGRP: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */ + const S_IRWXO: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */ + const S_IROTH: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */ + const S_IWOTH: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */ + const S_IXOTH: number; + + /** + * When set, a memory file mapping is used to access the file. This flag + * is available on Windows operating systems only. On other operating systems, + * this flag is ignored. + */ + const UV_FS_O_FILEMAP: number; + } + + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void; + + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function access(path: PathLike, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace access { + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(path: PathLike, mode?: number): Promise; + } + + /** + * Synchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function accessSync(path: PathLike, mode?: number): void; + + interface StreamOptions { + flags?: string; + encoding?: BufferEncoding; + fd?: number | promises.FileHandle; + mode?: number; + autoClose?: boolean; + /** + * @default false + */ + emitClose?: boolean; + start?: number; + highWaterMark?: number; + } + + interface ReadStreamOptions extends StreamOptions { + end?: number; + } + + /** + * Returns a new `ReadStream` object. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function createReadStream(path: PathLike, options?: string | ReadStreamOptions): ReadStream; + + /** + * Returns a new `WriteStream` object. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function createWriteStream(path: PathLike, options?: string | StreamOptions): WriteStream; + + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param fd A file descriptor. + */ + export function fdatasync(fd: number, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace fdatasync { + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param fd A file descriptor. + */ + function __promisify__(fd: number): Promise; + } + + /** + * Synchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param fd A file descriptor. + */ + export function fdatasyncSync(fd: number): void; + + /** + * Asynchronously copies src to dest. By default, dest is overwritten if it already exists. + * No arguments other than a possible exception are given to the callback function. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + */ + export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void; + /** + * Asynchronously copies src to dest. By default, dest is overwritten if it already exists. + * No arguments other than a possible exception are given to the callback function. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + * @param flags An integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists. + */ + export function copyFile(src: PathLike, dest: PathLike, flags: number, callback: NoParamCallback): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace copyFile { + /** + * Asynchronously copies src to dest. By default, dest is overwritten if it already exists. + * No arguments other than a possible exception are given to the callback function. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + * @param flags An optional integer that specifies the behavior of the copy operation. + * The only supported flag is fs.constants.COPYFILE_EXCL, + * which causes the copy operation to fail if dest already exists. + */ + function __promisify__(src: PathLike, dst: PathLike, flags?: number): Promise; + } + + /** + * Synchronously copies src to dest. By default, dest is overwritten if it already exists. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + * @param flags An optional integer that specifies the behavior of the copy operation. + * The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists. + */ + export function copyFileSync(src: PathLike, dest: PathLike, flags?: number): void; + + /** + * Write an array of ArrayBufferViews to the file specified by fd using writev(). + * position is the offset from the beginning of the file where this data should be written. + * It is unsafe to use fs.writev() multiple times on the same file without waiting for the callback. For this scenario, use fs.createWriteStream(). + * On Linux, positional writes don't work when the file is opened in append mode. + * The kernel ignores the position argument and always appends the data to the end of the file. + */ + export function writev( + fd: number, + buffers: ReadonlyArray, + cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void + ): void; + export function writev( + fd: number, + buffers: ReadonlyArray, + position: number, + cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void + ): void; + + export interface WriteVResult { + bytesWritten: number; + buffers: NodeJS.ArrayBufferView[]; + } + + export namespace writev { + function __promisify__(fd: number, buffers: ReadonlyArray, position?: number): Promise; + } + + /** + * See `writev`. + */ + export function writevSync(fd: number, buffers: ReadonlyArray, position?: number): number; + + export function readv( + fd: number, + buffers: ReadonlyArray, + cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void + ): void; + export function readv( + fd: number, + buffers: ReadonlyArray, + position: number, + cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void + ): void; + + export interface ReadVResult { + bytesRead: number; + buffers: NodeJS.ArrayBufferView[]; + } + + export namespace readv { + function __promisify__(fd: number, buffers: ReadonlyArray, position?: number): Promise; + } + + /** + * See `readv`. + */ + export function readvSync(fd: number, buffers: ReadonlyArray, position?: number): number; + + export interface OpenDirOptions { + encoding?: BufferEncoding; + /** + * Number of directory entries that are buffered + * internally when reading from the directory. Higher values lead to better + * performance but higher memory usage. + * @default 32 + */ + bufferSize?: number; + } + + export function opendirSync(path: string, options?: OpenDirOptions): Dir; + + export function opendir(path: string, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; + export function opendir(path: string, options: OpenDirOptions, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; + + export namespace opendir { + function __promisify__(path: string, options?: OpenDirOptions): Promise; + } + + export interface BigIntStats extends StatsBase { + } + + export class BigIntStats { + atimeNs: bigint; + mtimeNs: bigint; + ctimeNs: bigint; + birthtimeNs: bigint; + } + + export interface BigIntOptions { + bigint: true; + } + + export interface StatOptions { + bigint?: boolean; + throwIfNoEntry?: boolean; + } +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/fs/promises.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/fs/promises.d.ts new file mode 100755 index 000000000..b54e21a99 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/fs/promises.d.ts @@ -0,0 +1,558 @@ +declare module 'fs/promises' { + import { Abortable } from 'events'; + import { + Stats, + BigIntStats, + StatOptions, + WriteVResult, + ReadVResult, + PathLike, + RmDirOptions, + RmOptions, + MakeDirectoryOptions, + Dirent, + OpenDirOptions, + Dir, + BaseEncodingOptions, + BufferEncodingOption, + OpenMode, + Mode, + } from 'fs'; + + interface FileHandle { + /** + * Gets the file descriptor for this file handle. + */ + readonly fd: number; + + /** + * Asynchronously append data to a file, creating the file if it does not exist. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for appending. + * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + appendFile(data: string | Uint8Array, options?: BaseEncodingOptions & { mode?: Mode, flag?: OpenMode } | BufferEncoding | null): Promise; + + /** + * Asynchronous fchown(2) - Change ownership of a file. + */ + chown(uid: number, gid: number): Promise; + + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + chmod(mode: Mode): Promise; + + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + */ + datasync(): Promise; + + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + */ + sync(): Promise; + + /** + * Asynchronously reads data from the file. + * The `FileHandle` must have been opened for reading. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + read(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesRead: number, buffer: TBuffer }>; + + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile(options?: { encoding?: null, flag?: OpenMode } | null): Promise; + + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile(options: { encoding: BufferEncoding, flag?: OpenMode } | BufferEncoding): Promise; + + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile(options?: BaseEncodingOptions & { flag?: OpenMode } | BufferEncoding | null): Promise; + + /** + * Asynchronous fstat(2) - Get file status. + */ + stat(opts?: StatOptions & { bigint?: false }): Promise; + stat(opts: StatOptions & { bigint: true }): Promise; + stat(opts?: StatOptions): Promise; + + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param len If not specified, defaults to `0`. + */ + truncate(len?: number): Promise; + + /** + * Asynchronously change file timestamps of the file. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + utimes(atime: string | number | Date, mtime: string | number | Date): Promise; + + /** + * Asynchronously writes `buffer` to the file. + * The `FileHandle` must have been opened for writing. + * @param buffer The buffer that the data will be written to. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + write(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>; + + /** + * Asynchronously writes `string` to the file. + * The `FileHandle` must have been opened for writing. + * It is unsafe to call `write()` multiple times on the same file without waiting for the `Promise` + * to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + write(data: string | Uint8Array, position?: number | null, encoding?: BufferEncoding | null): Promise<{ bytesWritten: number, buffer: string }>; + + /** + * Asynchronously writes data to a file, replacing the file if it already exists. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for writing. + * It is unsafe to call `writeFile()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). + * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + writeFile(data: string | Uint8Array, options?: BaseEncodingOptions & { mode?: Mode, flag?: OpenMode } & Abortable | BufferEncoding | null): Promise; + + /** + * See `fs.writev` promisified version. + */ + writev(buffers: ReadonlyArray, position?: number): Promise; + + /** + * See `fs.readv` promisified version. + */ + readv(buffers: ReadonlyArray, position?: number): Promise; + + /** + * Asynchronous close(2) - close a `FileHandle`. + */ + close(): Promise; + } + + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function access(path: PathLike, mode?: number): Promise; + + /** + * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it already exists. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + * @param flags An optional integer that specifies the behavior of the copy operation. The only + * supported flag is `fs.constants.COPYFILE_EXCL`, which causes the copy operation to fail if + * `dest` already exists. + */ + function copyFile(src: PathLike, dest: PathLike, flags?: number): Promise; + + /** + * Asynchronous open(2) - open and possibly create a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not + * supplied, defaults to `0o666`. + */ + function open(path: PathLike, flags: string | number, mode?: Mode): Promise; + + /** + * Asynchronously reads data from the file referenced by the supplied `FileHandle`. + * @param handle A `FileHandle`. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If + * `null`, data will be read from the current position. + */ + function read( + handle: FileHandle, + buffer: TBuffer, + offset?: number | null, + length?: number | null, + position?: number | null, + ): Promise<{ bytesRead: number, buffer: TBuffer }>; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied `FileHandle`. + * It is unsafe to call `fsPromises.write()` multiple times on the same file without waiting for the `Promise` + * to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended. + * @param handle A `FileHandle`. + * @param buffer The buffer that the data will be written to. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + function write( + handle: FileHandle, + buffer: TBuffer, + offset?: number | null, + length?: number | null, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>; + + /** + * Asynchronously writes `string` to the file referenced by the supplied `FileHandle`. + * It is unsafe to call `fsPromises.write()` multiple times on the same file without waiting for the `Promise` + * to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended. + * @param handle A `FileHandle`. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + function write(handle: FileHandle, string: string, position?: number | null, encoding?: BufferEncoding | null): Promise<{ bytesWritten: number, buffer: string }>; + + /** + * Asynchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function rename(oldPath: PathLike, newPath: PathLike): Promise; + + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + function truncate(path: PathLike, len?: number): Promise; + + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param handle A `FileHandle`. + * @param len If not specified, defaults to `0`. + */ + function ftruncate(handle: FileHandle, len?: number): Promise; + + /** + * Asynchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function rmdir(path: PathLike, options?: RmDirOptions): Promise; + + /** + * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). + */ + function rm(path: PathLike, options?: RmOptions): Promise; + + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param handle A `FileHandle`. + */ + function fdatasync(handle: FileHandle): Promise; + + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param handle A `FileHandle`. + */ + function fsync(handle: FileHandle): Promise; + + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): Promise; + + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdir(path: PathLike, options?: Mode | (MakeDirectoryOptions & { recursive?: false; }) | null): Promise; + + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdir(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir(path: PathLike, options?: BaseEncodingOptions & { withFileTypes?: false } | BufferEncoding | null): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir(path: PathLike, options: { encoding: "buffer"; withFileTypes?: false } | "buffer"): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir(path: PathLike, options?: BaseEncodingOptions & { withFileTypes?: false } | BufferEncoding | null): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. + */ + function readdir(path: PathLike, options: BaseEncodingOptions & { withFileTypes: true }): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options?: BaseEncodingOptions | BufferEncoding | null): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options: BufferEncodingOption): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options?: BaseEncodingOptions | string | null): Promise; + + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + function symlink(target: PathLike, path: PathLike, type?: string | null): Promise; + + /** + * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function lstat(path: PathLike, opts?: StatOptions & { bigint?: false }): Promise; + function lstat(path: PathLike, opts: StatOptions & { bigint: true }): Promise; + function lstat(path: PathLike, opts?: StatOptions): Promise; + + /** + * Asynchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function stat(path: PathLike, opts?: StatOptions & { bigint?: false }): Promise; + function stat(path: PathLike, opts: StatOptions & { bigint: true }): Promise; + function stat(path: PathLike, opts?: StatOptions): Promise; + + /** + * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function link(existingPath: PathLike, newPath: PathLike): Promise; + + /** + * Asynchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function unlink(path: PathLike): Promise; + + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param handle A `FileHandle`. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function fchmod(handle: FileHandle, mode: Mode): Promise; + + /** + * Asynchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function chmod(path: PathLike, mode: Mode): Promise; + + /** + * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function lchmod(path: PathLike, mode: Mode): Promise; + + /** + * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function lchown(path: PathLike, uid: number, gid: number): Promise; + + /** + * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, + * with the difference that if the path refers to a symbolic link, then the link is not + * dereferenced: instead, the timestamps of the symbolic link itself are changed. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function lutimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise; + + /** + * Asynchronous fchown(2) - Change ownership of a file. + * @param handle A `FileHandle`. + */ + function fchown(handle: FileHandle, uid: number, gid: number): Promise; + + /** + * Asynchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function chown(path: PathLike, uid: number, gid: number): Promise; + + /** + * Asynchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise; + + /** + * Asynchronously change file timestamps of the file referenced by the supplied `FileHandle`. + * @param handle A `FileHandle`. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function futimes(handle: FileHandle, atime: string | number | Date, mtime: string | number | Date): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options?: BaseEncodingOptions | BufferEncoding | null): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options: BufferEncodingOption): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options?: BaseEncodingOptions | BufferEncoding | null): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options?: BaseEncodingOptions | BufferEncoding | null): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options: BufferEncodingOption): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options?: BaseEncodingOptions | BufferEncoding | null): Promise; + + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * It is unsafe to call `fsPromises.writeFile()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + function writeFile(path: PathLike | FileHandle, data: string | Uint8Array, options?: BaseEncodingOptions & { mode?: Mode, flag?: OpenMode } & Abortable | BufferEncoding | null): Promise; + + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + function appendFile(path: PathLike | FileHandle, data: string | Uint8Array, options?: BaseEncodingOptions & { mode?: Mode, flag?: OpenMode } | BufferEncoding | null): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile(path: PathLike | FileHandle, options?: { encoding?: null, flag?: OpenMode } & Abortable | null): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile(path: PathLike | FileHandle, options: { encoding: BufferEncoding, flag?: OpenMode } & Abortable | BufferEncoding): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile(path: PathLike | FileHandle, options?: BaseEncodingOptions & Abortable & { flag?: OpenMode } | BufferEncoding | null): Promise; + + function opendir(path: string, options?: OpenDirOptions): Promise; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/globals.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/globals.d.ts new file mode 100755 index 000000000..3933f6833 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/globals.d.ts @@ -0,0 +1,653 @@ +// Declare "static" methods in Error +interface ErrorConstructor { + /** Create .stack property on a target object */ + captureStackTrace(targetObject: object, constructorOpt?: Function): void; + + /** + * Optional override for formatting stack traces + * + * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces + */ + prepareStackTrace?: (err: Error, stackTraces: NodeJS.CallSite[]) => any; + + stackTraceLimit: number; +} + +// Node.js ESNEXT support +interface String { + /** Removes whitespace from the left end of a string. */ + trimLeft(): string; + /** Removes whitespace from the right end of a string. */ + trimRight(): string; + + /** Returns a copy with leading whitespace removed. */ + trimStart(): string; + /** Returns a copy with trailing whitespace removed. */ + trimEnd(): string; +} + +interface ImportMeta { + url: string; +} + +/*-----------------------------------------------* + * * + * GLOBAL * + * * + ------------------------------------------------*/ + +// For backwards compability +interface NodeRequire extends NodeJS.Require {} +interface RequireResolve extends NodeJS.RequireResolve {} +interface NodeModule extends NodeJS.Module {} + +declare var process: NodeJS.Process; +declare var console: Console; + +declare var __filename: string; +declare var __dirname: string; + +declare function setTimeout(callback: (...args: any[]) => void, ms?: number, ...args: any[]): NodeJS.Timeout; +declare namespace setTimeout { + function __promisify__(ms: number): Promise; + function __promisify__(ms: number, value: T): Promise; +} +declare function clearTimeout(timeoutId: NodeJS.Timeout): void; +declare function setInterval(callback: (...args: any[]) => void, ms?: number, ...args: any[]): NodeJS.Timeout; +declare function clearInterval(intervalId: NodeJS.Timeout): void; +declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate; +declare namespace setImmediate { + function __promisify__(): Promise; + function __promisify__(value: T): Promise; +} +declare function clearImmediate(immediateId: NodeJS.Immediate): void; + +declare function queueMicrotask(callback: () => void): void; + +declare var require: NodeRequire; +declare var module: NodeModule; + +// Same as module.exports +declare var exports: any; + +// Buffer class +type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex"; + +type WithImplicitCoercion = T | { valueOf(): T }; + +/** + * Raw data is stored in instances of the Buffer class. + * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. + * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + */ +declare class Buffer extends Uint8Array { + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead. + */ + constructor(str: string, encoding?: BufferEncoding); + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`). + */ + constructor(size: number); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. + */ + constructor(array: Uint8Array); + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}/{SharedArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead. + */ + constructor(arrayBuffer: ArrayBuffer | SharedArrayBuffer); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. + */ + constructor(array: ReadonlyArray); + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead. + */ + constructor(buffer: Buffer); + /** + * When passed a reference to the .buffer property of a TypedArray instance, + * the newly created Buffer will share the same allocated memory as the TypedArray. + * The optional {byteOffset} and {length} arguments specify a memory range + * within the {arrayBuffer} that will be shared by the Buffer. + * + * @param arrayBuffer The .buffer property of any TypedArray or a new ArrayBuffer() + */ + static from(arrayBuffer: WithImplicitCoercion, byteOffset?: number, length?: number): Buffer; + /** + * Creates a new Buffer using the passed {data} + * @param data data to create a new Buffer + */ + static from(data: Uint8Array | ReadonlyArray): Buffer; + static from(data: WithImplicitCoercion | string>): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + */ + static from(str: WithImplicitCoercion | { [Symbol.toPrimitive](hint: 'string'): string }, encoding?: BufferEncoding): Buffer; + /** + * Creates a new Buffer using the passed {data} + * @param values to create a new Buffer + */ + static of(...items: number[]): Buffer; + /** + * Returns true if {obj} is a Buffer + * + * @param obj object to test. + */ + static isBuffer(obj: any): obj is Buffer; + /** + * Returns true if {encoding} is a valid encoding argument. + * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + * + * @param encoding string to test. + */ + static isEncoding(encoding: string): encoding is BufferEncoding; + /** + * Gives the actual byte length of a string. encoding defaults to 'utf8'. + * This is not the same as String.prototype.length since that returns the number of characters in a string. + * + * @param string string to test. + * @param encoding encoding used to evaluate (defaults to 'utf8') + */ + static byteLength( + string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, + encoding?: BufferEncoding + ): number; + /** + * Returns a buffer which is the result of concatenating all the buffers in the list together. + * + * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. + * If the list has exactly one item, then the first item of the list is returned. + * If the list has more than one item, then a new Buffer is created. + * + * @param list An array of Buffer objects to concatenate + * @param totalLength Total length of the buffers when concatenated. + * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + */ + static concat(list: ReadonlyArray, totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + static compare(buf1: Uint8Array, buf2: Uint8Array): number; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @param fill if specified, buffer will be initialized by calling buf.fill(fill). + * If parameter is omitted, buffer will be filled with zeros. + * @param encoding encoding used for call to buf.fill while initalizing + */ + static alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer; + /** + * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafe(size: number): Buffer; + /** + * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafeSlow(size: number): Buffer; + /** + * This is the number of bytes used to determine the size of pre-allocated, internal Buffer instances used for pooling. This value may be modified. + */ + static poolSize: number; + + write(string: string, encoding?: BufferEncoding): number; + write(string: string, offset: number, encoding?: BufferEncoding): number; + write(string: string, offset: number, length: number, encoding?: BufferEncoding): number; + toString(encoding?: BufferEncoding, start?: number, end?: number): string; + toJSON(): { type: 'Buffer'; data: number[] }; + equals(otherBuffer: Uint8Array): boolean; + compare( + otherBuffer: Uint8Array, + targetStart?: number, + targetEnd?: number, + sourceStart?: number, + sourceEnd?: number + ): number; + copy(targetBuffer: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + /** + * Returns a new `Buffer` that references **the same memory as the original**, but offset and cropped by the start and end indices. + * + * This method is incompatible with `Uint8Array#slice()`, which returns a copy of the original memory. + * + * @param begin Where the new `Buffer` will start. Default: `0`. + * @param end Where the new `Buffer` will end (not inclusive). Default: `buf.length`. + */ + slice(begin?: number, end?: number): Buffer; + /** + * Returns a new `Buffer` that references **the same memory as the original**, but offset and cropped by the start and end indices. + * + * This method is compatible with `Uint8Array#subarray()`. + * + * @param begin Where the new `Buffer` will start. Default: `0`. + * @param end Where the new `Buffer` will end (not inclusive). Default: `buf.length`. + */ + subarray(begin?: number, end?: number): Buffer; + writeBigInt64BE(value: bigint, offset?: number): number; + writeBigInt64LE(value: bigint, offset?: number): number; + writeBigUInt64BE(value: bigint, offset?: number): number; + writeBigUInt64LE(value: bigint, offset?: number): number; + writeUIntLE(value: number, offset: number, byteLength: number): number; + writeUIntBE(value: number, offset: number, byteLength: number): number; + writeIntLE(value: number, offset: number, byteLength: number): number; + writeIntBE(value: number, offset: number, byteLength: number): number; + readBigUInt64BE(offset?: number): bigint; + readBigUInt64LE(offset?: number): bigint; + readBigInt64BE(offset?: number): bigint; + readBigInt64LE(offset?: number): bigint; + readUIntLE(offset: number, byteLength: number): number; + readUIntBE(offset: number, byteLength: number): number; + readIntLE(offset: number, byteLength: number): number; + readIntBE(offset: number, byteLength: number): number; + readUInt8(offset?: number): number; + readUInt16LE(offset?: number): number; + readUInt16BE(offset?: number): number; + readUInt32LE(offset?: number): number; + readUInt32BE(offset?: number): number; + readInt8(offset?: number): number; + readInt16LE(offset?: number): number; + readInt16BE(offset?: number): number; + readInt32LE(offset?: number): number; + readInt32BE(offset?: number): number; + readFloatLE(offset?: number): number; + readFloatBE(offset?: number): number; + readDoubleLE(offset?: number): number; + readDoubleBE(offset?: number): number; + reverse(): this; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; + writeUInt8(value: number, offset?: number): number; + writeUInt16LE(value: number, offset?: number): number; + writeUInt16BE(value: number, offset?: number): number; + writeUInt32LE(value: number, offset?: number): number; + writeUInt32BE(value: number, offset?: number): number; + writeInt8(value: number, offset?: number): number; + writeInt16LE(value: number, offset?: number): number; + writeInt16BE(value: number, offset?: number): number; + writeInt32LE(value: number, offset?: number): number; + writeInt32BE(value: number, offset?: number): number; + writeFloatLE(value: number, offset?: number): number; + writeFloatBE(value: number, offset?: number): number; + writeDoubleLE(value: number, offset?: number): number; + writeDoubleBE(value: number, offset?: number): number; + + fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this; + + indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; + lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; + entries(): IterableIterator<[number, number]>; + includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean; + keys(): IterableIterator; + values(): IterableIterator; +} + +//#region borrowed +// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib +/** A controller object that allows you to abort one or more DOM requests as and when desired. */ +interface AbortController { + /** + * Returns the AbortSignal object associated with this object. + */ + readonly signal: AbortSignal; + /** + * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. + */ + abort(): void; +} + +/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ +interface AbortSignal { + /** + * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. + */ + readonly aborted: boolean; +} + +declare var AbortController: { + prototype: AbortController; + new(): AbortController; +}; + +declare var AbortSignal: { + prototype: AbortSignal; + new(): AbortSignal; +}; +//#endregion borrowed + +/*----------------------------------------------* +* * +* GLOBAL INTERFACES * +* * +*-----------------------------------------------*/ +declare namespace NodeJS { + interface InspectOptions { + /** + * If set to `true`, getters are going to be + * inspected as well. If set to `'get'` only getters without setter are going + * to be inspected. If set to `'set'` only getters having a corresponding + * setter are going to be inspected. This might cause side effects depending on + * the getter function. + * @default `false` + */ + getters?: 'get' | 'set' | boolean; + showHidden?: boolean; + /** + * @default 2 + */ + depth?: number | null; + colors?: boolean; + customInspect?: boolean; + showProxy?: boolean; + maxArrayLength?: number | null; + /** + * Specifies the maximum number of characters to + * include when formatting. Set to `null` or `Infinity` to show all elements. + * Set to `0` or negative to show no characters. + * @default 10000 + */ + maxStringLength?: number | null; + breakLength?: number; + /** + * Setting this to `false` causes each object key + * to be displayed on a new line. It will also add new lines to text that is + * longer than `breakLength`. If set to a number, the most `n` inner elements + * are united on a single line as long as all properties fit into + * `breakLength`. Short array elements are also grouped together. Note that no + * text will be reduced below 16 characters, no matter the `breakLength` size. + * For more information, see the example below. + * @default `true` + */ + compact?: boolean | number; + sorted?: boolean | ((a: string, b: string) => number); + } + + interface CallSite { + /** + * Value of "this" + */ + getThis(): any; + + /** + * Type of "this" as a string. + * This is the name of the function stored in the constructor field of + * "this", if available. Otherwise the object's [[Class]] internal + * property. + */ + getTypeName(): string | null; + + /** + * Current function + */ + getFunction(): Function | undefined; + + /** + * Name of the current function, typically its name property. + * If a name property is not available an attempt will be made to try + * to infer a name from the function's context. + */ + getFunctionName(): string | null; + + /** + * Name of the property [of "this" or one of its prototypes] that holds + * the current function + */ + getMethodName(): string | null; + + /** + * Name of the script [if this function was defined in a script] + */ + getFileName(): string | null; + + /** + * Current line number [if this function was defined in a script] + */ + getLineNumber(): number | null; + + /** + * Current column number [if this function was defined in a script] + */ + getColumnNumber(): number | null; + + /** + * A call site object representing the location where eval was called + * [if this function was created using a call to eval] + */ + getEvalOrigin(): string | undefined; + + /** + * Is this a toplevel invocation, that is, is "this" the global object? + */ + isToplevel(): boolean; + + /** + * Does this call take place in code defined by a call to eval? + */ + isEval(): boolean; + + /** + * Is this call in native V8 code? + */ + isNative(): boolean; + + /** + * Is this a constructor call? + */ + isConstructor(): boolean; + } + + interface ErrnoException extends Error { + errno?: number; + code?: string; + path?: string; + syscall?: string; + stack?: string; + } + + interface ReadableStream extends EventEmitter { + readable: boolean; + read(size?: number): string | Buffer; + setEncoding(encoding: BufferEncoding): this; + pause(): this; + resume(): this; + isPaused(): boolean; + pipe(destination: T, options?: { end?: boolean; }): T; + unpipe(destination?: WritableStream): this; + unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; + wrap(oldStream: ReadableStream): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + + interface WritableStream extends EventEmitter { + writable: boolean; + write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; + write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; + end(cb?: () => void): void; + end(data: string | Uint8Array, cb?: () => void): void; + end(str: string, encoding?: BufferEncoding, cb?: () => void): void; + } + + interface ReadWriteStream extends ReadableStream, WritableStream { } + + interface Global { + AbortController: typeof AbortController; + AbortSignal: typeof AbortSignal; + Array: typeof Array; + ArrayBuffer: typeof ArrayBuffer; + Boolean: typeof Boolean; + Buffer: typeof Buffer; + DataView: typeof DataView; + Date: typeof Date; + Error: typeof Error; + EvalError: typeof EvalError; + Float32Array: typeof Float32Array; + Float64Array: typeof Float64Array; + Function: typeof Function; + Infinity: typeof Infinity; + Int16Array: typeof Int16Array; + Int32Array: typeof Int32Array; + Int8Array: typeof Int8Array; + Intl: typeof Intl; + JSON: typeof JSON; + Map: MapConstructor; + Math: typeof Math; + NaN: typeof NaN; + Number: typeof Number; + Object: typeof Object; + Promise: typeof Promise; + RangeError: typeof RangeError; + ReferenceError: typeof ReferenceError; + RegExp: typeof RegExp; + Set: SetConstructor; + String: typeof String; + Symbol: Function; + SyntaxError: typeof SyntaxError; + TypeError: typeof TypeError; + URIError: typeof URIError; + Uint16Array: typeof Uint16Array; + Uint32Array: typeof Uint32Array; + Uint8Array: typeof Uint8Array; + Uint8ClampedArray: typeof Uint8ClampedArray; + WeakMap: WeakMapConstructor; + WeakSet: WeakSetConstructor; + clearImmediate: (immediateId: Immediate) => void; + clearInterval: (intervalId: Timeout) => void; + clearTimeout: (timeoutId: Timeout) => void; + decodeURI: typeof decodeURI; + decodeURIComponent: typeof decodeURIComponent; + encodeURI: typeof encodeURI; + encodeURIComponent: typeof encodeURIComponent; + escape: (str: string) => string; + eval: typeof eval; + global: Global; + isFinite: typeof isFinite; + isNaN: typeof isNaN; + parseFloat: typeof parseFloat; + parseInt: typeof parseInt; + setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => Immediate; + setInterval: (callback: (...args: any[]) => void, ms?: number, ...args: any[]) => Timeout; + setTimeout: (callback: (...args: any[]) => void, ms?: number, ...args: any[]) => Timeout; + queueMicrotask: typeof queueMicrotask; + undefined: typeof undefined; + unescape: (str: string) => string; + gc: () => void; + v8debug?: any; + } + + interface RefCounted { + ref(): this; + unref(): this; + } + + // compatibility with older typings + interface Timer extends RefCounted { + hasRef(): boolean; + refresh(): this; + [Symbol.toPrimitive](): number; + } + + interface Immediate extends RefCounted { + hasRef(): boolean; + _onImmediate: Function; // to distinguish it from the Timeout class + } + + interface Timeout extends Timer { + hasRef(): boolean; + refresh(): this; + [Symbol.toPrimitive](): number; + } + + type TypedArray = + | Uint8Array + | Uint8ClampedArray + | Uint16Array + | Uint32Array + | Int8Array + | Int16Array + | Int32Array + | BigUint64Array + | BigInt64Array + | Float32Array + | Float64Array; + type ArrayBufferView = TypedArray | DataView; + + interface Require { + (id: string): any; + resolve: RequireResolve; + cache: Dict; + /** + * @deprecated + */ + extensions: RequireExtensions; + main: Module | undefined; + } + + interface RequireResolve { + (id: string, options?: { paths?: string[]; }): string; + paths(request: string): string[] | null; + } + + interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { + '.js': (m: Module, filename: string) => any; + '.json': (m: Module, filename: string) => any; + '.node': (m: Module, filename: string) => any; + } + interface Module { + /** + * `true` if the module is running during the Node.js preload + */ + isPreloading: boolean; + exports: any; + require: Require; + id: string; + filename: string; + loaded: boolean; + /** @deprecated since 14.6.0 Please use `require.main` and `module.children` instead. */ + parent: Module | null | undefined; + children: Module[]; + /** + * @since 11.14.0 + * + * The directory name of the module. This is usually the same as the path.dirname() of the module.id. + */ + path: string; + paths: string[]; + } + + interface Dict { + [key: string]: T | undefined; + } + + interface ReadOnlyDict { + readonly [key: string]: T | undefined; + } +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/globals.global.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/globals.global.d.ts new file mode 100755 index 000000000..d66acba63 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/globals.global.d.ts @@ -0,0 +1 @@ +declare var global: NodeJS.Global & typeof globalThis; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/http.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/http.d.ts new file mode 100755 index 000000000..bc8cdd607 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/http.d.ts @@ -0,0 +1,426 @@ +declare module 'http' { + import * as stream from 'stream'; + import { URL } from 'url'; + import { Socket, Server as NetServer } from 'net'; + + // incoming headers will never contain number + interface IncomingHttpHeaders extends NodeJS.Dict { + 'accept'?: string; + 'accept-language'?: string; + 'accept-patch'?: string; + 'accept-ranges'?: string; + 'access-control-allow-credentials'?: string; + 'access-control-allow-headers'?: string; + 'access-control-allow-methods'?: string; + 'access-control-allow-origin'?: string; + 'access-control-expose-headers'?: string; + 'access-control-max-age'?: string; + 'access-control-request-headers'?: string; + 'access-control-request-method'?: string; + 'age'?: string; + 'allow'?: string; + 'alt-svc'?: string; + 'authorization'?: string; + 'cache-control'?: string; + 'connection'?: string; + 'content-disposition'?: string; + 'content-encoding'?: string; + 'content-language'?: string; + 'content-length'?: string; + 'content-location'?: string; + 'content-range'?: string; + 'content-type'?: string; + 'cookie'?: string; + 'date'?: string; + 'etag'?: string; + 'expect'?: string; + 'expires'?: string; + 'forwarded'?: string; + 'from'?: string; + 'host'?: string; + 'if-match'?: string; + 'if-modified-since'?: string; + 'if-none-match'?: string; + 'if-unmodified-since'?: string; + 'last-modified'?: string; + 'location'?: string; + 'origin'?: string; + 'pragma'?: string; + 'proxy-authenticate'?: string; + 'proxy-authorization'?: string; + 'public-key-pins'?: string; + 'range'?: string; + 'referer'?: string; + 'retry-after'?: string; + 'sec-websocket-accept'?: string; + 'sec-websocket-extensions'?: string; + 'sec-websocket-key'?: string; + 'sec-websocket-protocol'?: string; + 'sec-websocket-version'?: string; + 'set-cookie'?: string[]; + 'strict-transport-security'?: string; + 'tk'?: string; + 'trailer'?: string; + 'transfer-encoding'?: string; + 'upgrade'?: string; + 'user-agent'?: string; + 'vary'?: string; + 'via'?: string; + 'warning'?: string; + 'www-authenticate'?: string; + } + + // outgoing headers allows numbers (as they are converted internally to strings) + type OutgoingHttpHeader = number | string | string[]; + + interface OutgoingHttpHeaders extends NodeJS.Dict { + } + + interface ClientRequestArgs { + abort?: AbortSignal; + protocol?: string | null; + host?: string | null; + hostname?: string | null; + family?: number; + port?: number | string | null; + defaultPort?: number | string; + localAddress?: string; + socketPath?: string; + /** + * @default 8192 + */ + maxHeaderSize?: number; + method?: string; + path?: string | null; + headers?: OutgoingHttpHeaders; + auth?: string | null; + agent?: Agent | boolean; + _defaultAgent?: Agent; + timeout?: number; + setHost?: boolean; + // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278 + createConnection?: (options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket; + } + + interface ServerOptions { + IncomingMessage?: typeof IncomingMessage; + ServerResponse?: typeof ServerResponse; + /** + * Optionally overrides the value of + * [`--max-http-header-size`][] for requests received by this server, i.e. + * the maximum length of request headers in bytes. + * @default 8192 + */ + maxHeaderSize?: number; + /** + * Use an insecure HTTP parser that accepts invalid HTTP headers when true. + * Using the insecure parser should be avoided. + * See --insecure-http-parser for more information. + * @default false + */ + insecureHTTPParser?: boolean; + } + + type RequestListener = (req: IncomingMessage, res: ServerResponse) => void; + + interface HttpBase { + setTimeout(msecs?: number, callback?: () => void): this; + setTimeout(callback: () => void): this; + /** + * Limits maximum incoming headers count. If set to 0, no limit will be applied. + * @default 2000 + * {@link https://nodejs.org/api/http.html#http_server_maxheaderscount} + */ + maxHeadersCount: number | null; + timeout: number; + /** + * Limit the amount of time the parser will wait to receive the complete HTTP headers. + * @default 60000 + * {@link https://nodejs.org/api/http.html#http_server_headerstimeout} + */ + headersTimeout: number; + keepAliveTimeout: number; + /** + * Sets the timeout value in milliseconds for receiving the entire request from the client. + * @default 0 + * {@link https://nodejs.org/api/http.html#http_server_requesttimeout} + */ + requestTimeout: number; + } + + interface Server extends HttpBase {} + class Server extends NetServer { + constructor(requestListener?: RequestListener); + constructor(options: ServerOptions, requestListener?: RequestListener); + } + + // https://github.com/nodejs/node/blob/master/lib/_http_outgoing.js + class OutgoingMessage extends stream.Writable { + upgrading: boolean; + chunkedEncoding: boolean; + shouldKeepAlive: boolean; + useChunkedEncodingByDefault: boolean; + sendDate: boolean; + /** + * @deprecated Use `writableEnded` instead. + */ + finished: boolean; + headersSent: boolean; + /** + * @deprecated Use `socket` instead. + */ + connection: Socket | null; + socket: Socket | null; + + constructor(); + + setTimeout(msecs: number, callback?: () => void): this; + setHeader(name: string, value: number | string | ReadonlyArray): this; + getHeader(name: string): number | string | string[] | undefined; + getHeaders(): OutgoingHttpHeaders; + getHeaderNames(): string[]; + hasHeader(name: string): boolean; + removeHeader(name: string): void; + addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void; + flushHeaders(): void; + } + + // https://github.com/nodejs/node/blob/master/lib/_http_server.js#L108-L256 + class ServerResponse extends OutgoingMessage { + statusCode: number; + statusMessage: string; + + constructor(req: IncomingMessage); + + assignSocket(socket: Socket): void; + detachSocket(socket: Socket): void; + // https://github.com/nodejs/node/blob/master/test/parallel/test-http-write-callbacks.js#L53 + // no args in writeContinue callback + writeContinue(callback?: () => void): void; + writeHead(statusCode: number, reasonPhrase?: string, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this; + writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this; + writeProcessing(): void; + } + + interface InformationEvent { + statusCode: number; + statusMessage: string; + httpVersion: string; + httpVersionMajor: number; + httpVersionMinor: number; + headers: IncomingHttpHeaders; + rawHeaders: string[]; + } + + // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L77 + class ClientRequest extends OutgoingMessage { + aborted: boolean; + host: string; + protocol: string; + + constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void); + + method: string; + path: string; + /** @deprecated since v14.1.0 Use `request.destroy()` instead. */ + abort(): void; + onSocket(socket: Socket): void; + setTimeout(timeout: number, callback?: () => void): this; + setNoDelay(noDelay?: boolean): void; + setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; + + addListener(event: 'abort', listener: () => void): this; + addListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + addListener(event: 'continue', listener: () => void): this; + addListener(event: 'information', listener: (info: InformationEvent) => void): this; + addListener(event: 'response', listener: (response: IncomingMessage) => void): this; + addListener(event: 'socket', listener: (socket: Socket) => void): this; + addListener(event: 'timeout', listener: () => void): this; + addListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + on(event: 'abort', listener: () => void): this; + on(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + on(event: 'continue', listener: () => void): this; + on(event: 'information', listener: (info: InformationEvent) => void): this; + on(event: 'response', listener: (response: IncomingMessage) => void): this; + on(event: 'socket', listener: (socket: Socket) => void): this; + on(event: 'timeout', listener: () => void): this; + on(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'pipe', listener: (src: stream.Readable) => void): this; + on(event: 'unpipe', listener: (src: stream.Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: 'abort', listener: () => void): this; + once(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + once(event: 'continue', listener: () => void): this; + once(event: 'information', listener: (info: InformationEvent) => void): this; + once(event: 'response', listener: (response: IncomingMessage) => void): this; + once(event: 'socket', listener: (socket: Socket) => void): this; + once(event: 'timeout', listener: () => void): this; + once(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'pipe', listener: (src: stream.Readable) => void): this; + once(event: 'unpipe', listener: (src: stream.Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: 'abort', listener: () => void): this; + prependListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + prependListener(event: 'continue', listener: () => void): this; + prependListener(event: 'information', listener: (info: InformationEvent) => void): this; + prependListener(event: 'response', listener: (response: IncomingMessage) => void): this; + prependListener(event: 'socket', listener: (socket: Socket) => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: 'abort', listener: () => void): this; + prependOnceListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + prependOnceListener(event: 'continue', listener: () => void): this; + prependOnceListener(event: 'information', listener: (info: InformationEvent) => void): this; + prependOnceListener(event: 'response', listener: (response: IncomingMessage) => void): this; + prependOnceListener(event: 'socket', listener: (socket: Socket) => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + class IncomingMessage extends stream.Readable { + constructor(socket: Socket); + + aborted: boolean; + httpVersion: string; + httpVersionMajor: number; + httpVersionMinor: number; + complete: boolean; + /** + * @deprecated since v13.0.0 - Use `socket` instead. + */ + connection: Socket; + socket: Socket; + headers: IncomingHttpHeaders; + rawHeaders: string[]; + trailers: NodeJS.Dict; + rawTrailers: string[]; + setTimeout(msecs: number, callback?: () => void): this; + /** + * Only valid for request obtained from http.Server. + */ + method?: string; + /** + * Only valid for request obtained from http.Server. + */ + url?: string; + /** + * Only valid for response obtained from http.ClientRequest. + */ + statusCode?: number; + /** + * Only valid for response obtained from http.ClientRequest. + */ + statusMessage?: string; + destroy(error?: Error): void; + } + + interface AgentOptions { + /** + * Keep sockets around in a pool to be used by other requests in the future. Default = false + */ + keepAlive?: boolean; + /** + * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. + * Only relevant if keepAlive is set to true. + */ + keepAliveMsecs?: number; + /** + * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity + */ + maxSockets?: number; + /** + * Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity. + */ + maxTotalSockets?: number; + /** + * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. + */ + maxFreeSockets?: number; + /** + * Socket timeout in milliseconds. This will set the timeout after the socket is connected. + */ + timeout?: number; + /** + * Scheduling strategy to apply when picking the next free socket to use. + * @default `lifo` + */ + scheduling?: 'fifo' | 'lifo'; + } + + class Agent { + maxFreeSockets: number; + maxSockets: number; + maxTotalSockets: number; + readonly freeSockets: NodeJS.ReadOnlyDict; + readonly sockets: NodeJS.ReadOnlyDict; + readonly requests: NodeJS.ReadOnlyDict; + + constructor(opts?: AgentOptions); + + /** + * Destroy any sockets that are currently in use by the agent. + * It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled, + * then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise, + * sockets may hang open for quite a long time before the server terminates them. + */ + destroy(): void; + } + + const METHODS: string[]; + + const STATUS_CODES: { + [errorCode: number]: string | undefined; + [errorCode: string]: string | undefined; + }; + + function createServer(requestListener?: RequestListener): Server; + function createServer(options: ServerOptions, requestListener?: RequestListener): Server; + + // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly, + // create interface RequestOptions would make the naming more clear to developers + interface RequestOptions extends ClientRequestArgs { } + function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + function request(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; + function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; + let globalAgent: Agent; + + /** + * Read-only property specifying the maximum allowed size of HTTP headers in bytes. + * Defaults to 16KB. Configurable using the [`--max-http-header-size`][] CLI option. + */ + const maxHeaderSize: number; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/http2.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/http2.d.ts new file mode 100755 index 000000000..97bc32a38 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/http2.d.ts @@ -0,0 +1,969 @@ +declare module 'http2' { + import EventEmitter = require('events'); + import * as fs from 'fs'; + import * as net from 'net'; + import * as stream from 'stream'; + import * as tls from 'tls'; + import * as url from 'url'; + + import { + IncomingHttpHeaders as Http1IncomingHttpHeaders, + OutgoingHttpHeaders, + IncomingMessage, + ServerResponse, + } from 'http'; + export { OutgoingHttpHeaders } from 'http'; + + export interface IncomingHttpStatusHeader { + ":status"?: number; + } + + export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders { + ":path"?: string; + ":method"?: string; + ":authority"?: string; + ":scheme"?: string; + } + + // Http2Stream + + export interface StreamPriorityOptions { + exclusive?: boolean; + parent?: number; + weight?: number; + silent?: boolean; + } + + export interface StreamState { + localWindowSize?: number; + state?: number; + localClose?: number; + remoteClose?: number; + sumDependencyWeight?: number; + weight?: number; + } + + export interface ServerStreamResponseOptions { + endStream?: boolean; + waitForTrailers?: boolean; + } + + export interface StatOptions { + offset: number; + length: number; + } + + export interface ServerStreamFileResponseOptions { + statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean; + waitForTrailers?: boolean; + offset?: number; + length?: number; + } + + export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { + onError?(err: NodeJS.ErrnoException): void; + } + + export interface Http2Stream extends stream.Duplex { + readonly aborted: boolean; + readonly bufferSize: number; + readonly closed: boolean; + readonly destroyed: boolean; + /** + * Set the true if the END_STREAM flag was set in the request or response HEADERS frame received, + * indicating that no additional data should be received and the readable side of the Http2Stream will be closed. + */ + readonly endAfterHeaders: boolean; + readonly id?: number; + readonly pending: boolean; + readonly rstCode: number; + readonly sentHeaders: OutgoingHttpHeaders; + readonly sentInfoHeaders?: OutgoingHttpHeaders[]; + readonly sentTrailers?: OutgoingHttpHeaders; + readonly session: Http2Session; + readonly state: StreamState; + + close(code?: number, callback?: () => void): void; + priority(options: StreamPriorityOptions): void; + setTimeout(msecs: number, callback?: () => void): void; + sendTrailers(headers: OutgoingHttpHeaders): void; + + addListener(event: "aborted", listener: () => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "data", listener: (chunk: Buffer | string) => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "end", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "finish", listener: () => void): this; + addListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + addListener(event: "pipe", listener: (src: stream.Readable) => void): this; + addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + addListener(event: "streamClosed", listener: (code: number) => void): this; + addListener(event: "timeout", listener: () => void): this; + addListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: "wantTrailers", listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "aborted"): boolean; + emit(event: "close"): boolean; + emit(event: "data", chunk: Buffer | string): boolean; + emit(event: "drain"): boolean; + emit(event: "end"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "finish"): boolean; + emit(event: "frameError", frameType: number, errorCode: number): boolean; + emit(event: "pipe", src: stream.Readable): boolean; + emit(event: "unpipe", src: stream.Readable): boolean; + emit(event: "streamClosed", code: number): boolean; + emit(event: "timeout"): boolean; + emit(event: "trailers", trailers: IncomingHttpHeaders, flags: number): boolean; + emit(event: "wantTrailers"): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "aborted", listener: () => void): this; + on(event: "close", listener: () => void): this; + on(event: "data", listener: (chunk: Buffer | string) => void): this; + on(event: "drain", listener: () => void): this; + on(event: "end", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "finish", listener: () => void): this; + on(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + on(event: "pipe", listener: (src: stream.Readable) => void): this; + on(event: "unpipe", listener: (src: stream.Readable) => void): this; + on(event: "streamClosed", listener: (code: number) => void): this; + on(event: "timeout", listener: () => void): this; + on(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + on(event: "wantTrailers", listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "aborted", listener: () => void): this; + once(event: "close", listener: () => void): this; + once(event: "data", listener: (chunk: Buffer | string) => void): this; + once(event: "drain", listener: () => void): this; + once(event: "end", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "finish", listener: () => void): this; + once(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + once(event: "pipe", listener: (src: stream.Readable) => void): this; + once(event: "unpipe", listener: (src: stream.Readable) => void): this; + once(event: "streamClosed", listener: (code: number) => void): this; + once(event: "timeout", listener: () => void): this; + once(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + once(event: "wantTrailers", listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "aborted", listener: () => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "end", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "finish", listener: () => void): this; + prependListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; + prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + prependListener(event: "streamClosed", listener: (code: number) => void): this; + prependListener(event: "timeout", listener: () => void): this; + prependListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: "wantTrailers", listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "aborted", listener: () => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "end", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "finish", listener: () => void): this; + prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; + prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + prependOnceListener(event: "streamClosed", listener: (code: number) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + prependOnceListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: "wantTrailers", listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + export interface ClientHttp2Stream extends Http2Stream { + addListener(event: "continue", listener: () => {}): this; + addListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + addListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "continue"): boolean; + emit(event: "headers", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; + emit(event: "push", headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: "response", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "continue", listener: () => {}): this; + on(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + on(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "continue", listener: () => {}): this; + once(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + once(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "continue", listener: () => {}): this; + prependListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "continue", listener: () => {}): this; + prependOnceListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependOnceListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + export interface ServerHttp2Stream extends Http2Stream { + readonly headersSent: boolean; + readonly pushAllowed: boolean; + additionalHeaders(headers: OutgoingHttpHeaders): void; + pushStream(headers: OutgoingHttpHeaders, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; + pushStream(headers: OutgoingHttpHeaders, options?: StreamPriorityOptions, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; + respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void; + respondWithFD(fd: number | fs.promises.FileHandle, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void; + respondWithFile(path: string, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptionsWithError): void; + } + + // Http2Session + + export interface Settings { + headerTableSize?: number; + enablePush?: boolean; + initialWindowSize?: number; + maxFrameSize?: number; + maxConcurrentStreams?: number; + maxHeaderListSize?: number; + enableConnectProtocol?: boolean; + } + + export interface ClientSessionRequestOptions { + endStream?: boolean; + exclusive?: boolean; + parent?: number; + weight?: number; + waitForTrailers?: boolean; + } + + export interface SessionState { + effectiveLocalWindowSize?: number; + effectiveRecvDataLength?: number; + nextStreamID?: number; + localWindowSize?: number; + lastProcStreamID?: number; + remoteWindowSize?: number; + outboundQueueSize?: number; + deflateDynamicTableSize?: number; + inflateDynamicTableSize?: number; + } + + export interface Http2Session extends EventEmitter { + readonly alpnProtocol?: string; + readonly closed: boolean; + readonly connecting: boolean; + readonly destroyed: boolean; + readonly encrypted?: boolean; + readonly localSettings: Settings; + readonly originSet?: string[]; + readonly pendingSettingsAck: boolean; + readonly remoteSettings: Settings; + readonly socket: net.Socket | tls.TLSSocket; + readonly state: SessionState; + readonly type: number; + + close(callback?: () => void): void; + destroy(error?: Error, code?: number): void; + goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void; + ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; + ping(payload: NodeJS.ArrayBufferView, callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; + ref(): void; + setLocalWindowSize(windowSize: number): void; + setTimeout(msecs: number, callback?: () => void): void; + settings(settings: Settings): void; + unref(): void; + + addListener(event: "close", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + addListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + addListener(event: "localSettings", listener: (settings: Settings) => void): this; + addListener(event: "ping", listener: () => void): this; + addListener(event: "remoteSettings", listener: (settings: Settings) => void): this; + addListener(event: "timeout", listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "close"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "frameError", frameType: number, errorCode: number, streamID: number): boolean; + emit(event: "goaway", errorCode: number, lastStreamID: number, opaqueData: Buffer): boolean; + emit(event: "localSettings", settings: Settings): boolean; + emit(event: "ping"): boolean; + emit(event: "remoteSettings", settings: Settings): boolean; + emit(event: "timeout"): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "close", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + on(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + on(event: "localSettings", listener: (settings: Settings) => void): this; + on(event: "ping", listener: () => void): this; + on(event: "remoteSettings", listener: (settings: Settings) => void): this; + on(event: "timeout", listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "close", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + once(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + once(event: "localSettings", listener: (settings: Settings) => void): this; + once(event: "ping", listener: () => void): this; + once(event: "remoteSettings", listener: (settings: Settings) => void): this; + once(event: "timeout", listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "close", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + prependListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + prependListener(event: "localSettings", listener: (settings: Settings) => void): this; + prependListener(event: "ping", listener: () => void): this; + prependListener(event: "remoteSettings", listener: (settings: Settings) => void): this; + prependListener(event: "timeout", listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + prependOnceListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + prependOnceListener(event: "localSettings", listener: (settings: Settings) => void): this; + prependOnceListener(event: "ping", listener: () => void): this; + prependOnceListener(event: "remoteSettings", listener: (settings: Settings) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + export interface ClientHttp2Session extends Http2Session { + request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream; + + addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + addListener(event: "origin", listener: (origins: string[]) => void): this; + addListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + addListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "altsvc", alt: string, origin: string, stream: number): boolean; + emit(event: "origin", origins: ReadonlyArray): boolean; + emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; + emit(event: "stream", stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + on(event: "origin", listener: (origins: string[]) => void): this; + on(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + on(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + once(event: "origin", listener: (origins: string[]) => void): this; + once(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + once(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + prependListener(event: "origin", listener: (origins: string[]) => void): this; + prependListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + prependOnceListener(event: "origin", listener: (origins: string[]) => void): this; + prependOnceListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependOnceListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + export interface AlternativeServiceOptions { + origin: number | string | url.URL; + } + + export interface ServerHttp2Session extends Http2Session { + readonly server: Http2Server | Http2SecureServer; + + altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void; + origin(...args: Array): void; + + addListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "connect", session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; + emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + // Http2Server + + export interface SessionOptions { + maxDeflateDynamicTableSize?: number; + maxSessionMemory?: number; + maxHeaderListPairs?: number; + maxOutstandingPings?: number; + maxSendHeaderBlockLength?: number; + paddingStrategy?: number; + peerMaxConcurrentStreams?: number; + settings?: Settings; + + selectPadding?(frameLen: number, maxFrameLen: number): number; + createConnection?(authority: url.URL, option: SessionOptions): stream.Duplex; + } + + export interface ClientSessionOptions extends SessionOptions { + maxReservedRemoteStreams?: number; + createConnection?: (authority: url.URL, option: SessionOptions) => stream.Duplex; + protocol?: 'http:' | 'https:'; + } + + export interface ServerSessionOptions extends SessionOptions { + Http1IncomingMessage?: typeof IncomingMessage; + Http1ServerResponse?: typeof ServerResponse; + Http2ServerRequest?: typeof Http2ServerRequest; + Http2ServerResponse?: typeof Http2ServerResponse; + } + + export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions { } + export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions { } + + export interface ServerOptions extends ServerSessionOptions { } + + export interface SecureServerOptions extends SecureServerSessionOptions { + allowHTTP1?: boolean; + origins?: string[]; + } + + interface HTTP2ServerCommon { + setTimeout(msec?: number, callback?: () => void): this; + /** + * Throws ERR_HTTP2_INVALID_SETTING_VALUE for invalid settings values. + * Throws ERR_INVALID_ARG_TYPE for invalid settings argument. + */ + updateSettings(settings: Settings): void; + } + + export interface Http2Server extends net.Server, HTTP2ServerCommon { + addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: "session", listener: (session: ServerHttp2Session) => void): this; + addListener(event: "sessionError", listener: (err: Error) => void): this; + addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: "timeout", listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: "session", session: ServerHttp2Session): boolean; + emit(event: "sessionError", err: Error): boolean; + emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: "timeout"): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: "session", listener: (session: ServerHttp2Session) => void): this; + on(event: "sessionError", listener: (err: Error) => void): this; + on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: "timeout", listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: "session", listener: (session: ServerHttp2Session) => void): this; + once(event: "sessionError", listener: (err: Error) => void): this; + once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: "timeout", listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: "session", listener: (session: ServerHttp2Session) => void): this; + prependListener(event: "sessionError", listener: (err: Error) => void): this; + prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: "timeout", listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: "session", listener: (session: ServerHttp2Session) => void): this; + prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; + prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + export interface Http2SecureServer extends tls.Server, HTTP2ServerCommon { + addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: "session", listener: (session: ServerHttp2Session) => void): this; + addListener(event: "sessionError", listener: (err: Error) => void): this; + addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: "timeout", listener: () => void): this; + addListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: "session", session: ServerHttp2Session): boolean; + emit(event: "sessionError", err: Error): boolean; + emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: "timeout"): boolean; + emit(event: "unknownProtocol", socket: tls.TLSSocket): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: "session", listener: (session: ServerHttp2Session) => void): this; + on(event: "sessionError", listener: (err: Error) => void): this; + on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: "timeout", listener: () => void): this; + on(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: "session", listener: (session: ServerHttp2Session) => void): this; + once(event: "sessionError", listener: (err: Error) => void): this; + once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: "timeout", listener: () => void): this; + once(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: "session", listener: (session: ServerHttp2Session) => void): this; + prependListener(event: "sessionError", listener: (err: Error) => void): this; + prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: "timeout", listener: () => void): this; + prependListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: "session", listener: (session: ServerHttp2Session) => void): this; + prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; + prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + prependOnceListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + export class Http2ServerRequest extends stream.Readable { + constructor(stream: ServerHttp2Stream, headers: IncomingHttpHeaders, options: stream.ReadableOptions, rawHeaders: ReadonlyArray); + + readonly aborted: boolean; + readonly authority: string; + readonly connection: net.Socket | tls.TLSSocket; + readonly complete: boolean; + readonly headers: IncomingHttpHeaders; + readonly httpVersion: string; + readonly httpVersionMinor: number; + readonly httpVersionMajor: number; + readonly method: string; + readonly rawHeaders: string[]; + readonly rawTrailers: string[]; + readonly scheme: string; + readonly socket: net.Socket | tls.TLSSocket; + readonly stream: ServerHttp2Stream; + readonly trailers: IncomingHttpHeaders; + readonly url: string; + + setTimeout(msecs: number, callback?: () => void): void; + read(size?: number): Buffer | string | null; + + addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "data", listener: (chunk: Buffer | string) => void): this; + addListener(event: "end", listener: () => void): this; + addListener(event: "readable", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "aborted", hadError: boolean, code: number): boolean; + emit(event: "close"): boolean; + emit(event: "data", chunk: Buffer | string): boolean; + emit(event: "end"): boolean; + emit(event: "readable"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + on(event: "close", listener: () => void): this; + on(event: "data", listener: (chunk: Buffer | string) => void): this; + on(event: "end", listener: () => void): this; + on(event: "readable", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + once(event: "close", listener: () => void): this; + once(event: "data", listener: (chunk: Buffer | string) => void): this; + once(event: "end", listener: () => void): this; + once(event: "readable", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; + prependListener(event: "end", listener: () => void): this; + prependListener(event: "readable", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: "end", listener: () => void): this; + prependOnceListener(event: "readable", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + export class Http2ServerResponse extends stream.Writable { + constructor(stream: ServerHttp2Stream); + + readonly connection: net.Socket | tls.TLSSocket; + readonly finished: boolean; + readonly headersSent: boolean; + readonly socket: net.Socket | tls.TLSSocket; + readonly stream: ServerHttp2Stream; + sendDate: boolean; + statusCode: number; + statusMessage: ''; + addTrailers(trailers: OutgoingHttpHeaders): void; + end(callback?: () => void): void; + end(data: string | Uint8Array, callback?: () => void): void; + end(data: string | Uint8Array, encoding: BufferEncoding, callback?: () => void): void; + getHeader(name: string): string; + getHeaderNames(): string[]; + getHeaders(): OutgoingHttpHeaders; + hasHeader(name: string): boolean; + removeHeader(name: string): void; + setHeader(name: string, value: number | string | ReadonlyArray): void; + setTimeout(msecs: number, callback?: () => void): void; + write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean; + write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean; + writeContinue(): void; + writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this; + writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this; + createPushResponse(headers: OutgoingHttpHeaders, callback: (err: Error | null, res: Http2ServerResponse) => void): void; + + addListener(event: "close", listener: () => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "error", listener: (error: Error) => void): this; + addListener(event: "finish", listener: () => void): this; + addListener(event: "pipe", listener: (src: stream.Readable) => void): this; + addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "close"): boolean; + emit(event: "drain"): boolean; + emit(event: "error", error: Error): boolean; + emit(event: "finish"): boolean; + emit(event: "pipe", src: stream.Readable): boolean; + emit(event: "unpipe", src: stream.Readable): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "close", listener: () => void): this; + on(event: "drain", listener: () => void): this; + on(event: "error", listener: (error: Error) => void): this; + on(event: "finish", listener: () => void): this; + on(event: "pipe", listener: (src: stream.Readable) => void): this; + on(event: "unpipe", listener: (src: stream.Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "close", listener: () => void): this; + once(event: "drain", listener: () => void): this; + once(event: "error", listener: (error: Error) => void): this; + once(event: "finish", listener: () => void): this; + once(event: "pipe", listener: (src: stream.Readable) => void): this; + once(event: "unpipe", listener: (src: stream.Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "close", listener: () => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "error", listener: (error: Error) => void): this; + prependListener(event: "finish", listener: () => void): this; + prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; + prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "error", listener: (error: Error) => void): this; + prependOnceListener(event: "finish", listener: () => void): this; + prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; + prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + // Public API + + export namespace constants { + const NGHTTP2_SESSION_SERVER: number; + const NGHTTP2_SESSION_CLIENT: number; + const NGHTTP2_STREAM_STATE_IDLE: number; + const NGHTTP2_STREAM_STATE_OPEN: number; + const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number; + const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number; + const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number; + const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number; + const NGHTTP2_STREAM_STATE_CLOSED: number; + const NGHTTP2_NO_ERROR: number; + const NGHTTP2_PROTOCOL_ERROR: number; + const NGHTTP2_INTERNAL_ERROR: number; + const NGHTTP2_FLOW_CONTROL_ERROR: number; + const NGHTTP2_SETTINGS_TIMEOUT: number; + const NGHTTP2_STREAM_CLOSED: number; + const NGHTTP2_FRAME_SIZE_ERROR: number; + const NGHTTP2_REFUSED_STREAM: number; + const NGHTTP2_CANCEL: number; + const NGHTTP2_COMPRESSION_ERROR: number; + const NGHTTP2_CONNECT_ERROR: number; + const NGHTTP2_ENHANCE_YOUR_CALM: number; + const NGHTTP2_INADEQUATE_SECURITY: number; + const NGHTTP2_HTTP_1_1_REQUIRED: number; + const NGHTTP2_ERR_FRAME_SIZE_ERROR: number; + const NGHTTP2_FLAG_NONE: number; + const NGHTTP2_FLAG_END_STREAM: number; + const NGHTTP2_FLAG_END_HEADERS: number; + const NGHTTP2_FLAG_ACK: number; + const NGHTTP2_FLAG_PADDED: number; + const NGHTTP2_FLAG_PRIORITY: number; + const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number; + const DEFAULT_SETTINGS_ENABLE_PUSH: number; + const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number; + const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number; + const MAX_MAX_FRAME_SIZE: number; + const MIN_MAX_FRAME_SIZE: number; + const MAX_INITIAL_WINDOW_SIZE: number; + const NGHTTP2_DEFAULT_WEIGHT: number; + const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number; + const NGHTTP2_SETTINGS_ENABLE_PUSH: number; + const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number; + const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number; + const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number; + const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number; + const PADDING_STRATEGY_NONE: number; + const PADDING_STRATEGY_MAX: number; + const PADDING_STRATEGY_CALLBACK: number; + const HTTP2_HEADER_STATUS: string; + const HTTP2_HEADER_METHOD: string; + const HTTP2_HEADER_AUTHORITY: string; + const HTTP2_HEADER_SCHEME: string; + const HTTP2_HEADER_PATH: string; + const HTTP2_HEADER_ACCEPT_CHARSET: string; + const HTTP2_HEADER_ACCEPT_ENCODING: string; + const HTTP2_HEADER_ACCEPT_LANGUAGE: string; + const HTTP2_HEADER_ACCEPT_RANGES: string; + const HTTP2_HEADER_ACCEPT: string; + const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string; + const HTTP2_HEADER_AGE: string; + const HTTP2_HEADER_ALLOW: string; + const HTTP2_HEADER_AUTHORIZATION: string; + const HTTP2_HEADER_CACHE_CONTROL: string; + const HTTP2_HEADER_CONNECTION: string; + const HTTP2_HEADER_CONTENT_DISPOSITION: string; + const HTTP2_HEADER_CONTENT_ENCODING: string; + const HTTP2_HEADER_CONTENT_LANGUAGE: string; + const HTTP2_HEADER_CONTENT_LENGTH: string; + const HTTP2_HEADER_CONTENT_LOCATION: string; + const HTTP2_HEADER_CONTENT_MD5: string; + const HTTP2_HEADER_CONTENT_RANGE: string; + const HTTP2_HEADER_CONTENT_TYPE: string; + const HTTP2_HEADER_COOKIE: string; + const HTTP2_HEADER_DATE: string; + const HTTP2_HEADER_ETAG: string; + const HTTP2_HEADER_EXPECT: string; + const HTTP2_HEADER_EXPIRES: string; + const HTTP2_HEADER_FROM: string; + const HTTP2_HEADER_HOST: string; + const HTTP2_HEADER_IF_MATCH: string; + const HTTP2_HEADER_IF_MODIFIED_SINCE: string; + const HTTP2_HEADER_IF_NONE_MATCH: string; + const HTTP2_HEADER_IF_RANGE: string; + const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string; + const HTTP2_HEADER_LAST_MODIFIED: string; + const HTTP2_HEADER_LINK: string; + const HTTP2_HEADER_LOCATION: string; + const HTTP2_HEADER_MAX_FORWARDS: string; + const HTTP2_HEADER_PREFER: string; + const HTTP2_HEADER_PROXY_AUTHENTICATE: string; + const HTTP2_HEADER_PROXY_AUTHORIZATION: string; + const HTTP2_HEADER_RANGE: string; + const HTTP2_HEADER_REFERER: string; + const HTTP2_HEADER_REFRESH: string; + const HTTP2_HEADER_RETRY_AFTER: string; + const HTTP2_HEADER_SERVER: string; + const HTTP2_HEADER_SET_COOKIE: string; + const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string; + const HTTP2_HEADER_TRANSFER_ENCODING: string; + const HTTP2_HEADER_TE: string; + const HTTP2_HEADER_UPGRADE: string; + const HTTP2_HEADER_USER_AGENT: string; + const HTTP2_HEADER_VARY: string; + const HTTP2_HEADER_VIA: string; + const HTTP2_HEADER_WWW_AUTHENTICATE: string; + const HTTP2_HEADER_HTTP2_SETTINGS: string; + const HTTP2_HEADER_KEEP_ALIVE: string; + const HTTP2_HEADER_PROXY_CONNECTION: string; + const HTTP2_METHOD_ACL: string; + const HTTP2_METHOD_BASELINE_CONTROL: string; + const HTTP2_METHOD_BIND: string; + const HTTP2_METHOD_CHECKIN: string; + const HTTP2_METHOD_CHECKOUT: string; + const HTTP2_METHOD_CONNECT: string; + const HTTP2_METHOD_COPY: string; + const HTTP2_METHOD_DELETE: string; + const HTTP2_METHOD_GET: string; + const HTTP2_METHOD_HEAD: string; + const HTTP2_METHOD_LABEL: string; + const HTTP2_METHOD_LINK: string; + const HTTP2_METHOD_LOCK: string; + const HTTP2_METHOD_MERGE: string; + const HTTP2_METHOD_MKACTIVITY: string; + const HTTP2_METHOD_MKCALENDAR: string; + const HTTP2_METHOD_MKCOL: string; + const HTTP2_METHOD_MKREDIRECTREF: string; + const HTTP2_METHOD_MKWORKSPACE: string; + const HTTP2_METHOD_MOVE: string; + const HTTP2_METHOD_OPTIONS: string; + const HTTP2_METHOD_ORDERPATCH: string; + const HTTP2_METHOD_PATCH: string; + const HTTP2_METHOD_POST: string; + const HTTP2_METHOD_PRI: string; + const HTTP2_METHOD_PROPFIND: string; + const HTTP2_METHOD_PROPPATCH: string; + const HTTP2_METHOD_PUT: string; + const HTTP2_METHOD_REBIND: string; + const HTTP2_METHOD_REPORT: string; + const HTTP2_METHOD_SEARCH: string; + const HTTP2_METHOD_TRACE: string; + const HTTP2_METHOD_UNBIND: string; + const HTTP2_METHOD_UNCHECKOUT: string; + const HTTP2_METHOD_UNLINK: string; + const HTTP2_METHOD_UNLOCK: string; + const HTTP2_METHOD_UPDATE: string; + const HTTP2_METHOD_UPDATEREDIRECTREF: string; + const HTTP2_METHOD_VERSION_CONTROL: string; + const HTTP_STATUS_CONTINUE: number; + const HTTP_STATUS_SWITCHING_PROTOCOLS: number; + const HTTP_STATUS_PROCESSING: number; + const HTTP_STATUS_OK: number; + const HTTP_STATUS_CREATED: number; + const HTTP_STATUS_ACCEPTED: number; + const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number; + const HTTP_STATUS_NO_CONTENT: number; + const HTTP_STATUS_RESET_CONTENT: number; + const HTTP_STATUS_PARTIAL_CONTENT: number; + const HTTP_STATUS_MULTI_STATUS: number; + const HTTP_STATUS_ALREADY_REPORTED: number; + const HTTP_STATUS_IM_USED: number; + const HTTP_STATUS_MULTIPLE_CHOICES: number; + const HTTP_STATUS_MOVED_PERMANENTLY: number; + const HTTP_STATUS_FOUND: number; + const HTTP_STATUS_SEE_OTHER: number; + const HTTP_STATUS_NOT_MODIFIED: number; + const HTTP_STATUS_USE_PROXY: number; + const HTTP_STATUS_TEMPORARY_REDIRECT: number; + const HTTP_STATUS_PERMANENT_REDIRECT: number; + const HTTP_STATUS_BAD_REQUEST: number; + const HTTP_STATUS_UNAUTHORIZED: number; + const HTTP_STATUS_PAYMENT_REQUIRED: number; + const HTTP_STATUS_FORBIDDEN: number; + const HTTP_STATUS_NOT_FOUND: number; + const HTTP_STATUS_METHOD_NOT_ALLOWED: number; + const HTTP_STATUS_NOT_ACCEPTABLE: number; + const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number; + const HTTP_STATUS_REQUEST_TIMEOUT: number; + const HTTP_STATUS_CONFLICT: number; + const HTTP_STATUS_GONE: number; + const HTTP_STATUS_LENGTH_REQUIRED: number; + const HTTP_STATUS_PRECONDITION_FAILED: number; + const HTTP_STATUS_PAYLOAD_TOO_LARGE: number; + const HTTP_STATUS_URI_TOO_LONG: number; + const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number; + const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number; + const HTTP_STATUS_EXPECTATION_FAILED: number; + const HTTP_STATUS_TEAPOT: number; + const HTTP_STATUS_MISDIRECTED_REQUEST: number; + const HTTP_STATUS_UNPROCESSABLE_ENTITY: number; + const HTTP_STATUS_LOCKED: number; + const HTTP_STATUS_FAILED_DEPENDENCY: number; + const HTTP_STATUS_UNORDERED_COLLECTION: number; + const HTTP_STATUS_UPGRADE_REQUIRED: number; + const HTTP_STATUS_PRECONDITION_REQUIRED: number; + const HTTP_STATUS_TOO_MANY_REQUESTS: number; + const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number; + const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number; + const HTTP_STATUS_INTERNAL_SERVER_ERROR: number; + const HTTP_STATUS_NOT_IMPLEMENTED: number; + const HTTP_STATUS_BAD_GATEWAY: number; + const HTTP_STATUS_SERVICE_UNAVAILABLE: number; + const HTTP_STATUS_GATEWAY_TIMEOUT: number; + const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number; + const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number; + const HTTP_STATUS_INSUFFICIENT_STORAGE: number; + const HTTP_STATUS_LOOP_DETECTED: number; + const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number; + const HTTP_STATUS_NOT_EXTENDED: number; + const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number; + } + + /** + * This symbol can be set as a property on the HTTP/2 headers object with + * an array value in order to provide a list of headers considered sensitive. + */ + export const sensitiveHeaders: symbol; + + export function getDefaultSettings(): Settings; + export function getPackedSettings(settings: Settings): Buffer; + export function getUnpackedSettings(buf: Uint8Array): Settings; + + export function createServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; + export function createServer(options: ServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; + + export function createSecureServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; + export function createSecureServer(options: SecureServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; + + export function connect(authority: string | url.URL, listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session; + export function connect( + authority: string | url.URL, + options?: ClientSessionOptions | SecureClientSessionOptions, + listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void + ): ClientHttp2Session; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/https.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/https.d.ts new file mode 100755 index 000000000..23f956819 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/https.d.ts @@ -0,0 +1,36 @@ +declare module 'https' { + import * as tls from 'tls'; + import * as http from 'http'; + import { URL } from 'url'; + + type ServerOptions = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions; + + type RequestOptions = http.RequestOptions & tls.SecureContextOptions & { + rejectUnauthorized?: boolean; // Defaults to true + servername?: string; // SNI TLS Extension + }; + + interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions { + rejectUnauthorized?: boolean; + maxCachedSessions?: number; + } + + class Agent extends http.Agent { + constructor(options?: AgentOptions); + options: AgentOptions; + } + + interface Server extends http.HttpBase {} + class Server extends tls.Server { + constructor(requestListener?: http.RequestListener); + constructor(options: ServerOptions, requestListener?: http.RequestListener); + } + + function createServer(requestListener?: http.RequestListener): Server; + function createServer(options: ServerOptions, requestListener?: http.RequestListener): Server; + function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + function get(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + let globalAgent: Agent; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/index.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/index.d.ts new file mode 100755 index 000000000..673d81849 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/index.d.ts @@ -0,0 +1,58 @@ +// Type definitions for non-npm package Node.js 15.6 +// Project: http://nodejs.org/ +// Definitions by: Microsoft TypeScript +// DefinitelyTyped +// Alberto Schiabel +// Alvis HT Tang +// Andrew Makarov +// Benjamin Toueg +// Chigozirim C. +// David Junger +// Deividas Bakanas +// Eugene Y. Q. Shen +// Hannes Magnusson +// Hoàng Văn Khải +// Huw +// Kelvin Jin +// Klaus Meinhardt +// Lishude +// Mariusz Wiktorczyk +// Mohsen Azimi +// Nicolas Even +// Nikita Galkin +// Parambir Singh +// Sebastian Silbermann +// Simon Schick +// Thomas den Hollander +// Wilco Bakker +// wwwy3y3 +// Samuel Ainsworth +// Kyle Uehlein +// Thanik Bhongbhibhat +// Marcin Kopacz +// Trivikram Kamat +// Minh Son Nguyen +// Junxiao Shi +// Ilia Baryshnikov +// ExE Boss +// Surasak Chaisurin +// Piotr Błażejewicz +// Anna Henningsen +// Jason Kwok +// Victor Perin +// Yongsheng Zhang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// NOTE: These definitions support NodeJS and TypeScript 3.7. +// Typically type modifications should be made in base.d.ts instead of here + +/// + +// NOTE: TypeScript version-specific augmentations can be found in the following paths: +// - ~/base.d.ts - Shared definitions common to all TypeScript versions +// - ~/index.d.ts - Definitions specific to TypeScript 2.8 +// - ~/ts3.5/index.d.ts - Definitions specific to TypeScript 3.5 + +// NOTE: Augmentations for TypeScript 3.5 and later should use individual files for overrides +// within the respective ~/ts3.5 (or later) folder. However, this is disallowed for versions +// prior to TypeScript 3.5, so the older definitions will be found here. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/inspector.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/inspector.d.ts new file mode 100755 index 000000000..7403c5230 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/inspector.d.ts @@ -0,0 +1,3041 @@ +// tslint:disable-next-line:dt-header +// Type definitions for inspector + +// These definitions are auto-generated. +// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330 +// for more information. + +// tslint:disable:max-line-length + +/** + * The inspector module provides an API for interacting with the V8 inspector. + */ +declare module 'inspector' { + import EventEmitter = require('events'); + + interface InspectorNotification { + method: string; + params: T; + } + + namespace Schema { + /** + * Description of the protocol domain. + */ + interface Domain { + /** + * Domain name. + */ + name: string; + /** + * Domain version. + */ + version: string; + } + + interface GetDomainsReturnType { + /** + * List of supported domains. + */ + domains: Domain[]; + } + } + + namespace Runtime { + /** + * Unique script identifier. + */ + type ScriptId = string; + + /** + * Unique object identifier. + */ + type RemoteObjectId = string; + + /** + * Primitive value which cannot be JSON-stringified. + */ + type UnserializableValue = string; + + /** + * Mirror object referencing original JavaScript object. + */ + interface RemoteObject { + /** + * Object type. + */ + type: string; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string; + /** + * Object class (constructor) name. Specified for object type values only. + */ + className?: string; + /** + * Remote object value in case of primitive values or JSON values (if it was requested). + */ + value?: any; + /** + * Primitive value which can not be JSON-stringified does not have value, but gets this property. + */ + unserializableValue?: UnserializableValue; + /** + * String representation of the object. + */ + description?: string; + /** + * Unique object identifier (for non-primitive values). + */ + objectId?: RemoteObjectId; + /** + * Preview containing abbreviated property values. Specified for object type values only. + * @experimental + */ + preview?: ObjectPreview; + /** + * @experimental + */ + customPreview?: CustomPreview; + } + + /** + * @experimental + */ + interface CustomPreview { + header: string; + hasBody: boolean; + formatterObjectId: RemoteObjectId; + bindRemoteObjectFunctionId: RemoteObjectId; + configObjectId?: RemoteObjectId; + } + + /** + * Object containing abbreviated remote object value. + * @experimental + */ + interface ObjectPreview { + /** + * Object type. + */ + type: string; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string; + /** + * String representation of the object. + */ + description?: string; + /** + * True iff some of the properties or entries of the original object did not fit. + */ + overflow: boolean; + /** + * List of the properties. + */ + properties: PropertyPreview[]; + /** + * List of the entries. Specified for map and set subtype values only. + */ + entries?: EntryPreview[]; + } + + /** + * @experimental + */ + interface PropertyPreview { + /** + * Property name. + */ + name: string; + /** + * Object type. Accessor means that the property itself is an accessor property. + */ + type: string; + /** + * User-friendly property value string. + */ + value?: string; + /** + * Nested value preview. + */ + valuePreview?: ObjectPreview; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string; + } + + /** + * @experimental + */ + interface EntryPreview { + /** + * Preview of the key. Specified for map-like collection entries. + */ + key?: ObjectPreview; + /** + * Preview of the value. + */ + value: ObjectPreview; + } + + /** + * Object property descriptor. + */ + interface PropertyDescriptor { + /** + * Property name or symbol description. + */ + name: string; + /** + * The value associated with the property. + */ + value?: RemoteObject; + /** + * True if the value associated with the property may be changed (data descriptors only). + */ + writable?: boolean; + /** + * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). + */ + get?: RemoteObject; + /** + * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). + */ + set?: RemoteObject; + /** + * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. + */ + configurable: boolean; + /** + * True if this property shows up during enumeration of the properties on the corresponding object. + */ + enumerable: boolean; + /** + * True if the result was thrown during the evaluation. + */ + wasThrown?: boolean; + /** + * True if the property is owned for the object. + */ + isOwn?: boolean; + /** + * Property symbol object, if the property is of the symbol type. + */ + symbol?: RemoteObject; + } + + /** + * Object internal property descriptor. This property isn't normally visible in JavaScript code. + */ + interface InternalPropertyDescriptor { + /** + * Conventional property name. + */ + name: string; + /** + * The value associated with the property. + */ + value?: RemoteObject; + } + + /** + * Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified. + */ + interface CallArgument { + /** + * Primitive value or serializable javascript object. + */ + value?: any; + /** + * Primitive value which can not be JSON-stringified. + */ + unserializableValue?: UnserializableValue; + /** + * Remote object handle. + */ + objectId?: RemoteObjectId; + } + + /** + * Id of an execution context. + */ + type ExecutionContextId = number; + + /** + * Description of an isolated world. + */ + interface ExecutionContextDescription { + /** + * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. + */ + id: ExecutionContextId; + /** + * Execution context origin. + */ + origin: string; + /** + * Human readable name describing given context. + */ + name: string; + /** + * Embedder-specific auxiliary data. + */ + auxData?: {}; + } + + /** + * Detailed information about exception (or error) that was thrown during script compilation or execution. + */ + interface ExceptionDetails { + /** + * Exception id. + */ + exceptionId: number; + /** + * Exception text, which should be used together with exception object when available. + */ + text: string; + /** + * Line number of the exception location (0-based). + */ + lineNumber: number; + /** + * Column number of the exception location (0-based). + */ + columnNumber: number; + /** + * Script ID of the exception location. + */ + scriptId?: ScriptId; + /** + * URL of the exception location, to be used when the script was not reported. + */ + url?: string; + /** + * JavaScript stack trace if available. + */ + stackTrace?: StackTrace; + /** + * Exception object if available. + */ + exception?: RemoteObject; + /** + * Identifier of the context where exception happened. + */ + executionContextId?: ExecutionContextId; + } + + /** + * Number of milliseconds since epoch. + */ + type Timestamp = number; + + /** + * Stack entry for runtime errors and assertions. + */ + interface CallFrame { + /** + * JavaScript function name. + */ + functionName: string; + /** + * JavaScript script id. + */ + scriptId: ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * JavaScript script line number (0-based). + */ + lineNumber: number; + /** + * JavaScript script column number (0-based). + */ + columnNumber: number; + } + + /** + * Call frames for assertions or error messages. + */ + interface StackTrace { + /** + * String label of this stack trace. For async traces this may be a name of the function that initiated the async call. + */ + description?: string; + /** + * JavaScript function name. + */ + callFrames: CallFrame[]; + /** + * Asynchronous JavaScript stack trace that preceded this stack, if available. + */ + parent?: StackTrace; + /** + * Asynchronous JavaScript stack trace that preceded this stack, if available. + * @experimental + */ + parentId?: StackTraceId; + } + + /** + * Unique identifier of current debugger. + * @experimental + */ + type UniqueDebuggerId = string; + + /** + * If debuggerId is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See Runtime.StackTrace and Debugger.paused for usages. + * @experimental + */ + interface StackTraceId { + id: string; + debuggerId?: UniqueDebuggerId; + } + + interface EvaluateParameterType { + /** + * Expression to evaluate. + */ + expression: string; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string; + /** + * Determines whether Command Line API should be available during the evaluation. + */ + includeCommandLineAPI?: boolean; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean; + /** + * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + contextId?: ExecutionContextId; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean; + /** + * Whether execution should be treated as initiated by user in the UI. + */ + userGesture?: boolean; + /** + * Whether execution should await for resulting value and return once awaited promise is resolved. + */ + awaitPromise?: boolean; + } + + interface AwaitPromiseParameterType { + /** + * Identifier of the promise. + */ + promiseObjectId: RemoteObjectId; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + */ + generatePreview?: boolean; + } + + interface CallFunctionOnParameterType { + /** + * Declaration of the function to call. + */ + functionDeclaration: string; + /** + * Identifier of the object to call function on. Either objectId or executionContextId should be specified. + */ + objectId?: RemoteObjectId; + /** + * Call arguments. All call arguments must belong to the same JavaScript world as the target object. + */ + arguments?: CallArgument[]; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean; + /** + * Whether the result is expected to be a JSON object which should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean; + /** + * Whether execution should be treated as initiated by user in the UI. + */ + userGesture?: boolean; + /** + * Whether execution should await for resulting value and return once awaited promise is resolved. + */ + awaitPromise?: boolean; + /** + * Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. + */ + executionContextId?: ExecutionContextId; + /** + * Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. + */ + objectGroup?: string; + } + + interface GetPropertiesParameterType { + /** + * Identifier of the object to return properties for. + */ + objectId: RemoteObjectId; + /** + * If true, returns properties belonging only to the element itself, not to its prototype chain. + */ + ownProperties?: boolean; + /** + * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. + * @experimental + */ + accessorPropertiesOnly?: boolean; + /** + * Whether preview should be generated for the results. + * @experimental + */ + generatePreview?: boolean; + } + + interface ReleaseObjectParameterType { + /** + * Identifier of the object to release. + */ + objectId: RemoteObjectId; + } + + interface ReleaseObjectGroupParameterType { + /** + * Symbolic object group name. + */ + objectGroup: string; + } + + interface SetCustomObjectFormatterEnabledParameterType { + enabled: boolean; + } + + interface CompileScriptParameterType { + /** + * Expression to compile. + */ + expression: string; + /** + * Source url to be set for the script. + */ + sourceURL: string; + /** + * Specifies whether the compiled script should be persisted. + */ + persistScript: boolean; + /** + * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + executionContextId?: ExecutionContextId; + } + + interface RunScriptParameterType { + /** + * Id of the script to run. + */ + scriptId: ScriptId; + /** + * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + executionContextId?: ExecutionContextId; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean; + /** + * Determines whether Command Line API should be available during the evaluation. + */ + includeCommandLineAPI?: boolean; + /** + * Whether the result is expected to be a JSON object which should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + */ + generatePreview?: boolean; + /** + * Whether execution should await for resulting value and return once awaited promise is resolved. + */ + awaitPromise?: boolean; + } + + interface QueryObjectsParameterType { + /** + * Identifier of the prototype to return objects for. + */ + prototypeObjectId: RemoteObjectId; + } + + interface GlobalLexicalScopeNamesParameterType { + /** + * Specifies in which execution context to lookup global scope variables. + */ + executionContextId?: ExecutionContextId; + } + + interface EvaluateReturnType { + /** + * Evaluation result. + */ + result: RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails; + } + + interface AwaitPromiseReturnType { + /** + * Promise result. Will contain rejected value if promise was rejected. + */ + result: RemoteObject; + /** + * Exception details if stack strace is available. + */ + exceptionDetails?: ExceptionDetails; + } + + interface CallFunctionOnReturnType { + /** + * Call result. + */ + result: RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails; + } + + interface GetPropertiesReturnType { + /** + * Object properties. + */ + result: PropertyDescriptor[]; + /** + * Internal object properties (only of the element itself). + */ + internalProperties?: InternalPropertyDescriptor[]; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails; + } + + interface CompileScriptReturnType { + /** + * Id of the script. + */ + scriptId?: ScriptId; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails; + } + + interface RunScriptReturnType { + /** + * Run result. + */ + result: RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails; + } + + interface QueryObjectsReturnType { + /** + * Array with objects. + */ + objects: RemoteObject; + } + + interface GlobalLexicalScopeNamesReturnType { + names: string[]; + } + + interface ExecutionContextCreatedEventDataType { + /** + * A newly created execution context. + */ + context: ExecutionContextDescription; + } + + interface ExecutionContextDestroyedEventDataType { + /** + * Id of the destroyed context + */ + executionContextId: ExecutionContextId; + } + + interface ExceptionThrownEventDataType { + /** + * Timestamp of the exception. + */ + timestamp: Timestamp; + exceptionDetails: ExceptionDetails; + } + + interface ExceptionRevokedEventDataType { + /** + * Reason describing why exception was revoked. + */ + reason: string; + /** + * The id of revoked exception, as reported in exceptionThrown. + */ + exceptionId: number; + } + + interface ConsoleAPICalledEventDataType { + /** + * Type of the call. + */ + type: string; + /** + * Call arguments. + */ + args: RemoteObject[]; + /** + * Identifier of the context where the call was made. + */ + executionContextId: ExecutionContextId; + /** + * Call timestamp. + */ + timestamp: Timestamp; + /** + * Stack trace captured when the call was made. + */ + stackTrace?: StackTrace; + /** + * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. + * @experimental + */ + context?: string; + } + + interface InspectRequestedEventDataType { + object: RemoteObject; + hints: {}; + } + } + + namespace Debugger { + /** + * Breakpoint identifier. + */ + type BreakpointId = string; + + /** + * Call frame identifier. + */ + type CallFrameId = string; + + /** + * Location in the source code. + */ + interface Location { + /** + * Script identifier as reported in the Debugger.scriptParsed. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number; + } + + /** + * Location in the source code. + * @experimental + */ + interface ScriptPosition { + lineNumber: number; + columnNumber: number; + } + + /** + * JavaScript call frame. Array of call frames form the call stack. + */ + interface CallFrame { + /** + * Call frame identifier. This identifier is only valid while the virtual machine is paused. + */ + callFrameId: CallFrameId; + /** + * Name of the JavaScript function called on this call frame. + */ + functionName: string; + /** + * Location in the source code. + */ + functionLocation?: Location; + /** + * Location in the source code. + */ + location: Location; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Scope chain for this call frame. + */ + scopeChain: Scope[]; + /** + * this object for this call frame. + */ + this: Runtime.RemoteObject; + /** + * The value being returned, if the function is at return point. + */ + returnValue?: Runtime.RemoteObject; + } + + /** + * Scope description. + */ + interface Scope { + /** + * Scope type. + */ + type: string; + /** + * Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. + */ + object: Runtime.RemoteObject; + name?: string; + /** + * Location in the source code where scope starts + */ + startLocation?: Location; + /** + * Location in the source code where scope ends + */ + endLocation?: Location; + } + + /** + * Search match for resource. + */ + interface SearchMatch { + /** + * Line number in resource content. + */ + lineNumber: number; + /** + * Line with match content. + */ + lineContent: string; + } + + interface BreakLocation { + /** + * Script identifier as reported in the Debugger.scriptParsed. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number; + type?: string; + } + + interface SetBreakpointsActiveParameterType { + /** + * New value for breakpoints active state. + */ + active: boolean; + } + + interface SetSkipAllPausesParameterType { + /** + * New value for skip pauses state. + */ + skip: boolean; + } + + interface SetBreakpointByUrlParameterType { + /** + * Line number to set breakpoint at. + */ + lineNumber: number; + /** + * URL of the resources to set breakpoint on. + */ + url?: string; + /** + * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. + */ + urlRegex?: string; + /** + * Script hash of the resources to set breakpoint on. + */ + scriptHash?: string; + /** + * Offset in the line to set breakpoint at. + */ + columnNumber?: number; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. + */ + condition?: string; + } + + interface SetBreakpointParameterType { + /** + * Location to set breakpoint in. + */ + location: Location; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. + */ + condition?: string; + } + + interface RemoveBreakpointParameterType { + breakpointId: BreakpointId; + } + + interface GetPossibleBreakpointsParameterType { + /** + * Start of range to search possible breakpoint locations in. + */ + start: Location; + /** + * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. + */ + end?: Location; + /** + * Only consider locations which are in the same (non-nested) function as start. + */ + restrictToFunction?: boolean; + } + + interface ContinueToLocationParameterType { + /** + * Location to continue to. + */ + location: Location; + targetCallFrames?: string; + } + + interface PauseOnAsyncCallParameterType { + /** + * Debugger will pause when async call with given stack trace is started. + */ + parentStackTraceId: Runtime.StackTraceId; + } + + interface StepIntoParameterType { + /** + * Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause. + * @experimental + */ + breakOnAsyncCall?: boolean; + } + + interface GetStackTraceParameterType { + stackTraceId: Runtime.StackTraceId; + } + + interface SearchInContentParameterType { + /** + * Id of the script to search in. + */ + scriptId: Runtime.ScriptId; + /** + * String to search for. + */ + query: string; + /** + * If true, search is case sensitive. + */ + caseSensitive?: boolean; + /** + * If true, treats string parameter as regex. + */ + isRegex?: boolean; + } + + interface SetScriptSourceParameterType { + /** + * Id of the script to edit. + */ + scriptId: Runtime.ScriptId; + /** + * New content of the script. + */ + scriptSource: string; + /** + * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. + */ + dryRun?: boolean; + } + + interface RestartFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: CallFrameId; + } + + interface GetScriptSourceParameterType { + /** + * Id of the script to get source for. + */ + scriptId: Runtime.ScriptId; + } + + interface SetPauseOnExceptionsParameterType { + /** + * Pause on exceptions mode. + */ + state: string; + } + + interface EvaluateOnCallFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: CallFrameId; + /** + * Expression to evaluate. + */ + expression: string; + /** + * String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). + */ + objectGroup?: string; + /** + * Specifies whether command line API should be available to the evaluated expression, defaults to false. + */ + includeCommandLineAPI?: boolean; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean; + /** + * Whether to throw an exception if side effect cannot be ruled out during evaluation. + */ + throwOnSideEffect?: boolean; + } + + interface SetVariableValueParameterType { + /** + * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. + */ + scopeNumber: number; + /** + * Variable name. + */ + variableName: string; + /** + * New variable value. + */ + newValue: Runtime.CallArgument; + /** + * Id of callframe that holds variable. + */ + callFrameId: CallFrameId; + } + + interface SetReturnValueParameterType { + /** + * New return value. + */ + newValue: Runtime.CallArgument; + } + + interface SetAsyncCallStackDepthParameterType { + /** + * Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). + */ + maxDepth: number; + } + + interface SetBlackboxPatternsParameterType { + /** + * Array of regexps that will be used to check script url for blackbox state. + */ + patterns: string[]; + } + + interface SetBlackboxedRangesParameterType { + /** + * Id of the script. + */ + scriptId: Runtime.ScriptId; + positions: ScriptPosition[]; + } + + interface EnableReturnType { + /** + * Unique identifier of the debugger. + * @experimental + */ + debuggerId: Runtime.UniqueDebuggerId; + } + + interface SetBreakpointByUrlReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: BreakpointId; + /** + * List of the locations this breakpoint resolved into upon addition. + */ + locations: Location[]; + } + + interface SetBreakpointReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: BreakpointId; + /** + * Location this breakpoint resolved into. + */ + actualLocation: Location; + } + + interface GetPossibleBreakpointsReturnType { + /** + * List of the possible breakpoint locations. + */ + locations: BreakLocation[]; + } + + interface GetStackTraceReturnType { + stackTrace: Runtime.StackTrace; + } + + interface SearchInContentReturnType { + /** + * List of search matches. + */ + result: SearchMatch[]; + } + + interface SetScriptSourceReturnType { + /** + * New stack trace in case editing has happened while VM was stopped. + */ + callFrames?: CallFrame[]; + /** + * Whether current call stack was modified after applying the changes. + */ + stackChanged?: boolean; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId; + /** + * Exception details if any. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + interface RestartFrameReturnType { + /** + * New stack trace. + */ + callFrames: CallFrame[]; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId; + } + + interface GetScriptSourceReturnType { + /** + * Script source. + */ + scriptSource: string; + } + + interface EvaluateOnCallFrameReturnType { + /** + * Object wrapper for the evaluation result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + interface ScriptParsedEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {}; + /** + * True, if this script is generated as a result of the live edit operation. + * @experimental + */ + isLiveEdit?: boolean; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string; + /** + * True, if this script has sourceURL. + */ + hasSourceURL?: boolean; + /** + * True, if this script is ES6 module. + */ + isModule?: boolean; + /** + * This script length. + */ + length?: number; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace; + } + + interface ScriptFailedToParseEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {}; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string; + /** + * True, if this script has sourceURL. + */ + hasSourceURL?: boolean; + /** + * True, if this script is ES6 module. + */ + isModule?: boolean; + /** + * This script length. + */ + length?: number; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace; + } + + interface BreakpointResolvedEventDataType { + /** + * Breakpoint unique identifier. + */ + breakpointId: BreakpointId; + /** + * Actual breakpoint location. + */ + location: Location; + } + + interface PausedEventDataType { + /** + * Call stack the virtual machine stopped on. + */ + callFrames: CallFrame[]; + /** + * Pause reason. + */ + reason: string; + /** + * Object containing break-specific auxiliary properties. + */ + data?: {}; + /** + * Hit breakpoints IDs + */ + hitBreakpoints?: string[]; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId; + /** + * Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after Debugger.stepInto call with breakOnAsynCall flag. + * @experimental + */ + asyncCallStackTraceId?: Runtime.StackTraceId; + } + } + + namespace Console { + /** + * Console message. + */ + interface ConsoleMessage { + /** + * Message source. + */ + source: string; + /** + * Message severity. + */ + level: string; + /** + * Message text. + */ + text: string; + /** + * URL of the message origin. + */ + url?: string; + /** + * Line number in the resource that generated this message (1-based). + */ + line?: number; + /** + * Column number in the resource that generated this message (1-based). + */ + column?: number; + } + + interface MessageAddedEventDataType { + /** + * Console message that has been added. + */ + message: ConsoleMessage; + } + } + + namespace Profiler { + /** + * Profile node. Holds callsite information, execution statistics and child nodes. + */ + interface ProfileNode { + /** + * Unique id of the node. + */ + id: number; + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Number of samples where this node was on top of the call stack. + */ + hitCount?: number; + /** + * Child node ids. + */ + children?: number[]; + /** + * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. + */ + deoptReason?: string; + /** + * An array of source position ticks. + */ + positionTicks?: PositionTickInfo[]; + } + + /** + * Profile. + */ + interface Profile { + /** + * The list of profile nodes. First item is the root node. + */ + nodes: ProfileNode[]; + /** + * Profiling start timestamp in microseconds. + */ + startTime: number; + /** + * Profiling end timestamp in microseconds. + */ + endTime: number; + /** + * Ids of samples top nodes. + */ + samples?: number[]; + /** + * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. + */ + timeDeltas?: number[]; + } + + /** + * Specifies a number of samples attributed to a certain source position. + */ + interface PositionTickInfo { + /** + * Source line number (1-based). + */ + line: number; + /** + * Number of samples attributed to the source line. + */ + ticks: number; + } + + /** + * Coverage data for a source range. + */ + interface CoverageRange { + /** + * JavaScript script source offset for the range start. + */ + startOffset: number; + /** + * JavaScript script source offset for the range end. + */ + endOffset: number; + /** + * Collected execution count of the source range. + */ + count: number; + } + + /** + * Coverage data for a JavaScript function. + */ + interface FunctionCoverage { + /** + * JavaScript function name. + */ + functionName: string; + /** + * Source ranges inside the function with coverage data. + */ + ranges: CoverageRange[]; + /** + * Whether coverage data for this function has block granularity. + */ + isBlockCoverage: boolean; + } + + /** + * Coverage data for a JavaScript script. + */ + interface ScriptCoverage { + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Functions contained in the script that has coverage data. + */ + functions: FunctionCoverage[]; + } + + /** + * Describes a type collected during runtime. + * @experimental + */ + interface TypeObject { + /** + * Name of a type collected with type profiling. + */ + name: string; + } + + /** + * Source offset and types for a parameter or return value. + * @experimental + */ + interface TypeProfileEntry { + /** + * Source offset of the parameter or end of function for return values. + */ + offset: number; + /** + * The types for this parameter or return value. + */ + types: TypeObject[]; + } + + /** + * Type profile data collected during runtime for a JavaScript script. + * @experimental + */ + interface ScriptTypeProfile { + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Type profile entries for parameters and return values of the functions in the script. + */ + entries: TypeProfileEntry[]; + } + + interface SetSamplingIntervalParameterType { + /** + * New sampling interval in microseconds. + */ + interval: number; + } + + interface StartPreciseCoverageParameterType { + /** + * Collect accurate call counts beyond simple 'covered' or 'not covered'. + */ + callCount?: boolean; + /** + * Collect block-based coverage. + */ + detailed?: boolean; + } + + interface StopReturnType { + /** + * Recorded profile. + */ + profile: Profile; + } + + interface TakePreciseCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: ScriptCoverage[]; + } + + interface GetBestEffortCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: ScriptCoverage[]; + } + + interface TakeTypeProfileReturnType { + /** + * Type profile for all scripts since startTypeProfile() was turned on. + */ + result: ScriptTypeProfile[]; + } + + interface ConsoleProfileStartedEventDataType { + id: string; + /** + * Location of console.profile(). + */ + location: Debugger.Location; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string; + } + + interface ConsoleProfileFinishedEventDataType { + id: string; + /** + * Location of console.profileEnd(). + */ + location: Debugger.Location; + profile: Profile; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string; + } + } + + namespace HeapProfiler { + /** + * Heap snapshot object id. + */ + type HeapSnapshotObjectId = string; + + /** + * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. + */ + interface SamplingHeapProfileNode { + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Allocations size in bytes for the node excluding children. + */ + selfSize: number; + /** + * Child nodes. + */ + children: SamplingHeapProfileNode[]; + } + + /** + * Profile. + */ + interface SamplingHeapProfile { + head: SamplingHeapProfileNode; + } + + interface StartTrackingHeapObjectsParameterType { + trackAllocations?: boolean; + } + + interface StopTrackingHeapObjectsParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. + */ + reportProgress?: boolean; + } + + interface TakeHeapSnapshotParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. + */ + reportProgress?: boolean; + } + + interface GetObjectByHeapObjectIdParameterType { + objectId: HeapSnapshotObjectId; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string; + } + + interface AddInspectedHeapObjectParameterType { + /** + * Heap snapshot object id to be accessible by means of $x command line API. + */ + heapObjectId: HeapSnapshotObjectId; + } + + interface GetHeapObjectIdParameterType { + /** + * Identifier of the object to get heap object id for. + */ + objectId: Runtime.RemoteObjectId; + } + + interface StartSamplingParameterType { + /** + * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. + */ + samplingInterval?: number; + } + + interface GetObjectByHeapObjectIdReturnType { + /** + * Evaluation result. + */ + result: Runtime.RemoteObject; + } + + interface GetHeapObjectIdReturnType { + /** + * Id of the heap snapshot object corresponding to the passed remote object id. + */ + heapSnapshotObjectId: HeapSnapshotObjectId; + } + + interface StopSamplingReturnType { + /** + * Recorded sampling heap profile. + */ + profile: SamplingHeapProfile; + } + + interface GetSamplingProfileReturnType { + /** + * Return the sampling profile being collected. + */ + profile: SamplingHeapProfile; + } + + interface AddHeapSnapshotChunkEventDataType { + chunk: string; + } + + interface ReportHeapSnapshotProgressEventDataType { + done: number; + total: number; + finished?: boolean; + } + + interface LastSeenObjectIdEventDataType { + lastSeenObjectId: number; + timestamp: number; + } + + interface HeapStatsUpdateEventDataType { + /** + * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. + */ + statsUpdate: number[]; + } + } + + namespace NodeTracing { + interface TraceConfig { + /** + * Controls how the trace buffer stores data. + */ + recordMode?: string; + /** + * Included category filters. + */ + includedCategories: string[]; + } + + interface StartParameterType { + traceConfig: TraceConfig; + } + + interface GetCategoriesReturnType { + /** + * A list of supported tracing categories. + */ + categories: string[]; + } + + interface DataCollectedEventDataType { + value: Array<{}>; + } + } + + namespace NodeWorker { + type WorkerID = string; + + /** + * Unique identifier of attached debugging session. + */ + type SessionID = string; + + interface WorkerInfo { + workerId: WorkerID; + type: string; + title: string; + url: string; + } + + interface SendMessageToWorkerParameterType { + message: string; + /** + * Identifier of the session. + */ + sessionId: SessionID; + } + + interface EnableParameterType { + /** + * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger` + * message to run them. + */ + waitForDebuggerOnStart: boolean; + } + + interface DetachParameterType { + sessionId: SessionID; + } + + interface AttachedToWorkerEventDataType { + /** + * Identifier assigned to the session used to send/receive messages. + */ + sessionId: SessionID; + workerInfo: WorkerInfo; + waitingForDebugger: boolean; + } + + interface DetachedFromWorkerEventDataType { + /** + * Detached session identifier. + */ + sessionId: SessionID; + } + + interface ReceivedMessageFromWorkerEventDataType { + /** + * Identifier of a session which sends a message. + */ + sessionId: SessionID; + message: string; + } + } + + namespace NodeRuntime { + interface NotifyWhenWaitingForDisconnectParameterType { + enabled: boolean; + } + } + + /** + * The inspector.Session is used for dispatching messages to the V8 inspector back-end and receiving message responses and notifications. + */ + class Session extends EventEmitter { + /** + * Create a new instance of the inspector.Session class. + * The inspector session needs to be connected through session.connect() before the messages can be dispatched to the inspector backend. + */ + constructor(); + + /** + * Connects a session to the inspector back-end. + * An exception will be thrown if there is already a connected session established either + * through the API or by a front-end connected to the Inspector WebSocket port. + */ + connect(): void; + + /** + * Immediately close the session. All pending message callbacks will be called with an error. + * session.connect() will need to be called to be able to send messages again. + * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints. + */ + disconnect(): void; + + /** + * Posts a message to the inspector back-end. callback will be notified when a response is received. + * callback is a function that accepts two optional arguments - error and message-specific result. + */ + post(method: string, params?: {}, callback?: (err: Error | null, params?: {}) => void): void; + post(method: string, callback?: (err: Error | null, params?: {}) => void): void; + + /** + * Returns supported domains. + */ + post(method: "Schema.getDomains", callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; + + /** + * Evaluates expression on global object. + */ + post(method: "Runtime.evaluate", params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + post(method: "Runtime.evaluate", callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + + /** + * Add handler to promise with given promise object id. + */ + post(method: "Runtime.awaitPromise", params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; + post(method: "Runtime.awaitPromise", callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; + + /** + * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. + */ + post(method: "Runtime.callFunctionOn", params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; + post(method: "Runtime.callFunctionOn", callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; + + /** + * Returns properties of a given object. Object group of the result is inherited from the target object. + */ + post(method: "Runtime.getProperties", params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + post(method: "Runtime.getProperties", callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + + /** + * Releases remote object with given id. + */ + post(method: "Runtime.releaseObject", params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.releaseObject", callback?: (err: Error | null) => void): void; + + /** + * Releases all remote objects that belong to a given group. + */ + post(method: "Runtime.releaseObjectGroup", params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.releaseObjectGroup", callback?: (err: Error | null) => void): void; + + /** + * Tells inspected instance to run if it was waiting for debugger to attach. + */ + post(method: "Runtime.runIfWaitingForDebugger", callback?: (err: Error | null) => void): void; + + /** + * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. + */ + post(method: "Runtime.enable", callback?: (err: Error | null) => void): void; + + /** + * Disables reporting of execution contexts creation. + */ + post(method: "Runtime.disable", callback?: (err: Error | null) => void): void; + + /** + * Discards collected exceptions and console API calls. + */ + post(method: "Runtime.discardConsoleEntries", callback?: (err: Error | null) => void): void; + + /** + * @experimental + */ + post(method: "Runtime.setCustomObjectFormatterEnabled", params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.setCustomObjectFormatterEnabled", callback?: (err: Error | null) => void): void; + + /** + * Compiles expression. + */ + post(method: "Runtime.compileScript", params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + post(method: "Runtime.compileScript", callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + + /** + * Runs script with given id in a given context. + */ + post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + + post(method: "Runtime.queryObjects", params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + post(method: "Runtime.queryObjects", callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + + /** + * Returns all let, const and class variables from global scope. + */ + post( + method: "Runtime.globalLexicalScopeNames", + params?: Runtime.GlobalLexicalScopeNamesParameterType, + callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void + ): void; + post(method: "Runtime.globalLexicalScopeNames", callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; + + /** + * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. + */ + post(method: "Debugger.enable", callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; + + /** + * Disables debugger for given page. + */ + post(method: "Debugger.disable", callback?: (err: Error | null) => void): void; + + /** + * Activates / deactivates all breakpoints on the page. + */ + post(method: "Debugger.setBreakpointsActive", params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBreakpointsActive", callback?: (err: Error | null) => void): void; + + /** + * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). + */ + post(method: "Debugger.setSkipAllPauses", params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setSkipAllPauses", callback?: (err: Error | null) => void): void; + + /** + * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. + */ + post(method: "Debugger.setBreakpointByUrl", params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + post(method: "Debugger.setBreakpointByUrl", callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + + /** + * Sets JavaScript breakpoint at a given location. + */ + post(method: "Debugger.setBreakpoint", params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + post(method: "Debugger.setBreakpoint", callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + + /** + * Removes JavaScript breakpoint. + */ + post(method: "Debugger.removeBreakpoint", params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.removeBreakpoint", callback?: (err: Error | null) => void): void; + + /** + * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. + */ + post( + method: "Debugger.getPossibleBreakpoints", + params?: Debugger.GetPossibleBreakpointsParameterType, + callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void + ): void; + post(method: "Debugger.getPossibleBreakpoints", callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; + + /** + * Continues execution until specific location is reached. + */ + post(method: "Debugger.continueToLocation", params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.continueToLocation", callback?: (err: Error | null) => void): void; + + /** + * @experimental + */ + post(method: "Debugger.pauseOnAsyncCall", params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.pauseOnAsyncCall", callback?: (err: Error | null) => void): void; + + /** + * Steps over the statement. + */ + post(method: "Debugger.stepOver", callback?: (err: Error | null) => void): void; + + /** + * Steps into the function call. + */ + post(method: "Debugger.stepInto", params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.stepInto", callback?: (err: Error | null) => void): void; + + /** + * Steps out of the function call. + */ + post(method: "Debugger.stepOut", callback?: (err: Error | null) => void): void; + + /** + * Stops on the next JavaScript statement. + */ + post(method: "Debugger.pause", callback?: (err: Error | null) => void): void; + + /** + * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. + * @experimental + */ + post(method: "Debugger.scheduleStepIntoAsync", callback?: (err: Error | null) => void): void; + + /** + * Resumes JavaScript execution. + */ + post(method: "Debugger.resume", callback?: (err: Error | null) => void): void; + + /** + * Returns stack trace with given stackTraceId. + * @experimental + */ + post(method: "Debugger.getStackTrace", params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; + post(method: "Debugger.getStackTrace", callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; + + /** + * Searches for given string in script content. + */ + post(method: "Debugger.searchInContent", params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + post(method: "Debugger.searchInContent", callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + + /** + * Edits JavaScript source live. + */ + post(method: "Debugger.setScriptSource", params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + post(method: "Debugger.setScriptSource", callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + + /** + * Restarts particular call frame from the beginning. + */ + post(method: "Debugger.restartFrame", params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + post(method: "Debugger.restartFrame", callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + + /** + * Returns source for the script with given id. + */ + post(method: "Debugger.getScriptSource", params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + post(method: "Debugger.getScriptSource", callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + + /** + * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. + */ + post(method: "Debugger.setPauseOnExceptions", params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setPauseOnExceptions", callback?: (err: Error | null) => void): void; + + /** + * Evaluates expression on a given call frame. + */ + post(method: "Debugger.evaluateOnCallFrame", params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + post(method: "Debugger.evaluateOnCallFrame", callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + + /** + * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. + */ + post(method: "Debugger.setVariableValue", params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setVariableValue", callback?: (err: Error | null) => void): void; + + /** + * Changes return value in top frame. Available only at return break position. + * @experimental + */ + post(method: "Debugger.setReturnValue", params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setReturnValue", callback?: (err: Error | null) => void): void; + + /** + * Enables or disables async call stacks tracking. + */ + post(method: "Debugger.setAsyncCallStackDepth", params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setAsyncCallStackDepth", callback?: (err: Error | null) => void): void; + + /** + * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. + * @experimental + */ + post(method: "Debugger.setBlackboxPatterns", params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBlackboxPatterns", callback?: (err: Error | null) => void): void; + + /** + * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. + * @experimental + */ + post(method: "Debugger.setBlackboxedRanges", params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBlackboxedRanges", callback?: (err: Error | null) => void): void; + + /** + * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. + */ + post(method: "Console.enable", callback?: (err: Error | null) => void): void; + + /** + * Disables console domain, prevents further console messages from being reported to the client. + */ + post(method: "Console.disable", callback?: (err: Error | null) => void): void; + + /** + * Does nothing. + */ + post(method: "Console.clearMessages", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.enable", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.disable", callback?: (err: Error | null) => void): void; + + /** + * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. + */ + post(method: "Profiler.setSamplingInterval", params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; + post(method: "Profiler.setSamplingInterval", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.start", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.stop", callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; + + /** + * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. + */ + post(method: "Profiler.startPreciseCoverage", params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; + post(method: "Profiler.startPreciseCoverage", callback?: (err: Error | null) => void): void; + + /** + * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. + */ + post(method: "Profiler.stopPreciseCoverage", callback?: (err: Error | null) => void): void; + + /** + * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. + */ + post(method: "Profiler.takePreciseCoverage", callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; + + /** + * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. + */ + post(method: "Profiler.getBestEffortCoverage", callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; + + /** + * Enable type profile. + * @experimental + */ + post(method: "Profiler.startTypeProfile", callback?: (err: Error | null) => void): void; + + /** + * Disable type profile. Disabling releases type profile data collected so far. + * @experimental + */ + post(method: "Profiler.stopTypeProfile", callback?: (err: Error | null) => void): void; + + /** + * Collect type profile. + * @experimental + */ + post(method: "Profiler.takeTypeProfile", callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void; + + post(method: "HeapProfiler.enable", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.disable", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.startTrackingHeapObjects", params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.startTrackingHeapObjects", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.stopTrackingHeapObjects", params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.stopTrackingHeapObjects", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.takeHeapSnapshot", params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.takeHeapSnapshot", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.collectGarbage", callback?: (err: Error | null) => void): void; + + post( + method: "HeapProfiler.getObjectByHeapObjectId", + params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, + callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void + ): void; + post(method: "HeapProfiler.getObjectByHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; + + /** + * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). + */ + post(method: "HeapProfiler.addInspectedHeapObject", params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.addInspectedHeapObject", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.getHeapObjectId", params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + post(method: "HeapProfiler.getHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + + post(method: "HeapProfiler.startSampling", params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.startSampling", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.stopSampling", callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; + + post(method: "HeapProfiler.getSamplingProfile", callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void; + + /** + * Gets supported tracing categories. + */ + post(method: "NodeTracing.getCategories", callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void; + + /** + * Start trace events collection. + */ + post(method: "NodeTracing.start", params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void; + post(method: "NodeTracing.start", callback?: (err: Error | null) => void): void; + + /** + * Stop trace events collection. Remaining collected events will be sent as a sequence of + * dataCollected events followed by tracingComplete event. + */ + post(method: "NodeTracing.stop", callback?: (err: Error | null) => void): void; + + /** + * Sends protocol message over session with given id. + */ + post(method: "NodeWorker.sendMessageToWorker", params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void; + post(method: "NodeWorker.sendMessageToWorker", callback?: (err: Error | null) => void): void; + + /** + * Instructs the inspector to attach to running workers. Will also attach to new workers + * as they start + */ + post(method: "NodeWorker.enable", params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void; + post(method: "NodeWorker.enable", callback?: (err: Error | null) => void): void; + + /** + * Detaches from all running workers and disables attaching to new workers as they are started. + */ + post(method: "NodeWorker.disable", callback?: (err: Error | null) => void): void; + + /** + * Detached from the worker with given sessionId. + */ + post(method: "NodeWorker.detach", params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void; + post(method: "NodeWorker.detach", callback?: (err: Error | null) => void): void; + + /** + * Enable the `NodeRuntime.waitingForDisconnect`. + */ + post(method: "NodeRuntime.notifyWhenWaitingForDisconnect", params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void; + post(method: "NodeRuntime.notifyWhenWaitingForDisconnect", callback?: (err: Error | null) => void): void; + + // Events + + addListener(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + addListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new execution context is created. + */ + addListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + addListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + addListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + addListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + addListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + addListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + addListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + addListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + addListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + addListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + addListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + addListener(event: "Debugger.resumed", listener: () => void): this; + + /** + * Issued when new console message is added. + */ + addListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + addListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + addListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + addListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + addListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + addListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + addListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + addListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + /** + * Contains an bucket of collected trace events. + */ + addListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; + + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + addListener(event: "NodeTracing.tracingComplete", listener: () => void): this; + + /** + * Issued when attached to a worker. + */ + addListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when detached from the worker. + */ + addListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; + + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + addListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + addListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "inspectorNotification", message: InspectorNotification<{}>): boolean; + emit(event: "Runtime.executionContextCreated", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextDestroyed", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextsCleared"): boolean; + emit(event: "Runtime.exceptionThrown", message: InspectorNotification): boolean; + emit(event: "Runtime.exceptionRevoked", message: InspectorNotification): boolean; + emit(event: "Runtime.consoleAPICalled", message: InspectorNotification): boolean; + emit(event: "Runtime.inspectRequested", message: InspectorNotification): boolean; + emit(event: "Debugger.scriptParsed", message: InspectorNotification): boolean; + emit(event: "Debugger.scriptFailedToParse", message: InspectorNotification): boolean; + emit(event: "Debugger.breakpointResolved", message: InspectorNotification): boolean; + emit(event: "Debugger.paused", message: InspectorNotification): boolean; + emit(event: "Debugger.resumed"): boolean; + emit(event: "Console.messageAdded", message: InspectorNotification): boolean; + emit(event: "Profiler.consoleProfileStarted", message: InspectorNotification): boolean; + emit(event: "Profiler.consoleProfileFinished", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.addHeapSnapshotChunk", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.resetProfiles"): boolean; + emit(event: "HeapProfiler.reportHeapSnapshotProgress", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.lastSeenObjectId", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.heapStatsUpdate", message: InspectorNotification): boolean; + emit(event: "NodeTracing.dataCollected", message: InspectorNotification): boolean; + emit(event: "NodeTracing.tracingComplete"): boolean; + emit(event: "NodeWorker.attachedToWorker", message: InspectorNotification): boolean; + emit(event: "NodeWorker.detachedFromWorker", message: InspectorNotification): boolean; + emit(event: "NodeWorker.receivedMessageFromWorker", message: InspectorNotification): boolean; + emit(event: "NodeRuntime.waitingForDisconnect"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + on(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new execution context is created. + */ + on(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + on(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + on(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + on(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + on(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + on(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + on(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + on(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + on(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + on(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + on(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + on(event: "Debugger.resumed", listener: () => void): this; + + /** + * Issued when new console message is added. + */ + on(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + on(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + on(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + on(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + on(event: "HeapProfiler.resetProfiles", listener: () => void): this; + on(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + on(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + on(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + /** + * Contains an bucket of collected trace events. + */ + on(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; + + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + on(event: "NodeTracing.tracingComplete", listener: () => void): this; + + /** + * Issued when attached to a worker. + */ + on(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when detached from the worker. + */ + on(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; + + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + on(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + on(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + once(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new execution context is created. + */ + once(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + once(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + once(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + once(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + once(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + once(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + once(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + once(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + once(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + once(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + once(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + once(event: "Debugger.resumed", listener: () => void): this; + + /** + * Issued when new console message is added. + */ + once(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + once(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + once(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + once(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + once(event: "HeapProfiler.resetProfiles", listener: () => void): this; + once(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + once(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + once(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + /** + * Contains an bucket of collected trace events. + */ + once(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; + + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + once(event: "NodeTracing.tracingComplete", listener: () => void): this; + + /** + * Issued when attached to a worker. + */ + once(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when detached from the worker. + */ + once(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; + + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + once(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + once(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + prependListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new execution context is created. + */ + prependListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + prependListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + prependListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + prependListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + prependListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + prependListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + prependListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + prependListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + prependListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + prependListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + prependListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + prependListener(event: "Debugger.resumed", listener: () => void): this; + + /** + * Issued when new console message is added. + */ + prependListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + prependListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + prependListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + prependListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + prependListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + prependListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + /** + * Contains an bucket of collected trace events. + */ + prependListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; + + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + prependListener(event: "NodeTracing.tracingComplete", listener: () => void): this; + + /** + * Issued when attached to a worker. + */ + prependListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when detached from the worker. + */ + prependListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; + + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + prependListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + prependListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + prependOnceListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new execution context is created. + */ + prependOnceListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + prependOnceListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + prependOnceListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + prependOnceListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + prependOnceListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + prependOnceListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + prependOnceListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + prependOnceListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + prependOnceListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + prependOnceListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + prependOnceListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + prependOnceListener(event: "Debugger.resumed", listener: () => void): this; + + /** + * Issued when new console message is added. + */ + prependOnceListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + prependOnceListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + prependOnceListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + prependOnceListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependOnceListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependOnceListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + /** + * Contains an bucket of collected trace events. + */ + prependOnceListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; + + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + prependOnceListener(event: "NodeTracing.tracingComplete", listener: () => void): this; + + /** + * Issued when attached to a worker. + */ + prependOnceListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when detached from the worker. + */ + prependOnceListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; + + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + prependOnceListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + prependOnceListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; + } + + // Top Level API + + /** + * Activate inspector on host and port. Equivalent to node --inspect=[[host:]port], but can be done programatically after node has started. + * If wait is true, will block until a client has connected to the inspect port and flow control has been passed to the debugger client. + * @param port Port to listen on for inspector connections. Optional, defaults to what was specified on the CLI. + * @param host Host to listen on for inspector connections. Optional, defaults to what was specified on the CLI. + * @param wait Block until a client has connected. Optional, defaults to false. + */ + function open(port?: number, host?: string, wait?: boolean): void; + + /** + * Deactivate the inspector. Blocks until there are no active connections. + */ + function close(): void; + + /** + * Return the URL of the active inspector, or `undefined` if there is none. + */ + function url(): string | undefined; + + /** + * Blocks until a client (existing or connected later) has sent + * `Runtime.runIfWaitingForDebugger` command. + * An exception will be thrown if there is no active inspector. + */ + function waitForDebugger(): void; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/module.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/module.d.ts new file mode 100755 index 000000000..787955a56 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/module.d.ts @@ -0,0 +1,52 @@ +declare module 'module' { + import { URL } from 'url'; + namespace Module { + /** + * Updates all the live bindings for builtin ES Modules to match the properties of the CommonJS exports. + * It does not add or remove exported names from the ES Modules. + */ + function syncBuiltinESMExports(): void; + + function findSourceMap(path: string, error?: Error): SourceMap; + interface SourceMapPayload { + file: string; + version: number; + sources: string[]; + sourcesContent: string[]; + names: string[]; + mappings: string; + sourceRoot: string; + } + + interface SourceMapping { + generatedLine: number; + generatedColumn: number; + originalSource: string; + originalLine: number; + originalColumn: number; + } + + class SourceMap { + readonly payload: SourceMapPayload; + constructor(payload: SourceMapPayload); + findEntry(line: number, column: number): SourceMapping; + } + } + interface Module extends NodeModule {} + class Module { + static runMain(): void; + static wrap(code: string): string; + + /** + * @deprecated Deprecated since: v12.2.0. Please use createRequire() instead. + */ + static createRequireFromPath(path: string): NodeRequire; + static createRequire(path: string | URL): NodeRequire; + static builtinModules: string[]; + + static Module: typeof Module; + + constructor(id: string, parent?: Module); + } + export = Module; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/net.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/net.d.ts new file mode 100755 index 000000000..81be6bada --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/net.d.ts @@ -0,0 +1,326 @@ +declare module 'net' { + import * as stream from 'stream'; + import { Abortable, EventEmitter } from 'events'; + import * as dns from 'dns'; + + type LookupFunction = ( + hostname: string, + options: dns.LookupOneOptions, + callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void, + ) => void; + + interface AddressInfo { + address: string; + family: string; + port: number; + } + + interface SocketConstructorOpts { + fd?: number; + allowHalfOpen?: boolean; + readable?: boolean; + writable?: boolean; + } + + interface OnReadOpts { + buffer: Uint8Array | (() => Uint8Array); + /** + * This function is called for every chunk of incoming data. + * Two arguments are passed to it: the number of bytes written to buffer and a reference to buffer. + * Return false from this function to implicitly pause() the socket. + */ + callback(bytesWritten: number, buf: Uint8Array): boolean; + } + + interface ConnectOpts { + /** + * If specified, incoming data is stored in a single buffer and passed to the supplied callback when data arrives on the socket. + * Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will + * still be emitted as normal and methods like pause() and resume() will also behave as expected. + */ + onread?: OnReadOpts; + } + + interface TcpSocketConnectOpts extends ConnectOpts { + port: number; + host?: string; + localAddress?: string; + localPort?: number; + hints?: number; + family?: number; + lookup?: LookupFunction; + } + + interface IpcSocketConnectOpts extends ConnectOpts { + path: string; + } + + type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts; + + class Socket extends stream.Duplex { + constructor(options?: SocketConstructorOpts); + + // Extended base methods + write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean; + write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean; + + connect(options: SocketConnectOpts, connectionListener?: () => void): this; + connect(port: number, host: string, connectionListener?: () => void): this; + connect(port: number, connectionListener?: () => void): this; + connect(path: string, connectionListener?: () => void): this; + + setEncoding(encoding?: BufferEncoding): this; + pause(): this; + resume(): this; + setTimeout(timeout: number, callback?: () => void): this; + setNoDelay(noDelay?: boolean): this; + setKeepAlive(enable?: boolean, initialDelay?: number): this; + address(): AddressInfo | {}; + unref(): this; + ref(): this; + + /** @deprecated since v14.6.0 - Use `writableLength` instead. */ + readonly bufferSize: number; + readonly bytesRead: number; + readonly bytesWritten: number; + readonly connecting: boolean; + readonly destroyed: boolean; + readonly localAddress: string; + readonly localPort: number; + readonly remoteAddress?: string; + readonly remoteFamily?: string; + readonly remotePort?: number; + + // Extended base methods + end(cb?: () => void): void; + end(buffer: Uint8Array | string, cb?: () => void): void; + end(str: Uint8Array | string, encoding?: BufferEncoding, cb?: () => void): void; + + /** + * events.EventEmitter + * 1. close + * 2. connect + * 3. data + * 4. drain + * 5. end + * 6. error + * 7. lookup + * 8. timeout + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: (had_error: boolean) => void): this; + addListener(event: "connect", listener: () => void): this; + addListener(event: "data", listener: (data: Buffer) => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "end", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + addListener(event: "timeout", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close", had_error: boolean): boolean; + emit(event: "connect"): boolean; + emit(event: "data", data: Buffer): boolean; + emit(event: "drain"): boolean; + emit(event: "end"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean; + emit(event: "timeout"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: (had_error: boolean) => void): this; + on(event: "connect", listener: () => void): this; + on(event: "data", listener: (data: Buffer) => void): this; + on(event: "drain", listener: () => void): this; + on(event: "end", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + on(event: "timeout", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: (had_error: boolean) => void): this; + once(event: "connect", listener: () => void): this; + once(event: "data", listener: (data: Buffer) => void): this; + once(event: "drain", listener: () => void): this; + once(event: "end", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + once(event: "timeout", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: (had_error: boolean) => void): this; + prependListener(event: "connect", listener: () => void): this; + prependListener(event: "data", listener: (data: Buffer) => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "end", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + prependListener(event: "timeout", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: (had_error: boolean) => void): this; + prependOnceListener(event: "connect", listener: () => void): this; + prependOnceListener(event: "data", listener: (data: Buffer) => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "end", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + } + + interface ListenOptions extends Abortable { + port?: number; + host?: string; + backlog?: number; + path?: string; + exclusive?: boolean; + readableAll?: boolean; + writableAll?: boolean; + /** + * @default false + */ + ipv6Only?: boolean; + } + + interface ServerOpts { + /** + * Indicates whether half-opened TCP connections are allowed. + * @default false + */ + allowHalfOpen?: boolean; + + /** + * Indicates whether the socket should be paused on incoming connections. + * @default false + */ + pauseOnConnect?: boolean; + } + + // https://github.com/nodejs/node/blob/master/lib/net.js + class Server extends EventEmitter { + constructor(connectionListener?: (socket: Socket) => void); + constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void); + + listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this; + listen(port?: number, hostname?: string, listeningListener?: () => void): this; + listen(port?: number, backlog?: number, listeningListener?: () => void): this; + listen(port?: number, listeningListener?: () => void): this; + listen(path: string, backlog?: number, listeningListener?: () => void): this; + listen(path: string, listeningListener?: () => void): this; + listen(options: ListenOptions, listeningListener?: () => void): this; + listen(handle: any, backlog?: number, listeningListener?: () => void): this; + listen(handle: any, listeningListener?: () => void): this; + close(callback?: (err?: Error) => void): this; + address(): AddressInfo | string | null; + getConnections(cb: (error: Error | null, count: number) => void): void; + ref(): this; + unref(): this; + maxConnections: number; + connections: number; + listening: boolean; + + /** + * events.EventEmitter + * 1. close + * 2. connection + * 3. error + * 4. listening + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "connection", listener: (socket: Socket) => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "listening", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "connection", socket: Socket): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "listening"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "connection", listener: (socket: Socket) => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "listening", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "connection", listener: (socket: Socket) => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "listening", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "connection", listener: (socket: Socket) => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "listening", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "connection", listener: (socket: Socket) => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "listening", listener: () => void): this; + } + + type IPVersion = 'ipv4' | 'ipv6'; + + class BlockList { + /** + * Adds a rule to block the given IP address. + * + * @param address An IPv4 or IPv6 address. + * @param type Either 'ipv4' or 'ipv6'. Default: 'ipv4'. + */ + addAddress(address: string, type?: IPVersion): void; + + /** + * Adds a rule to block a range of IP addresses from start (inclusive) to end (inclusive). + * + * @param start The starting IPv4 or IPv6 address in the range. + * @param end The ending IPv4 or IPv6 address in the range. + * @param type Either 'ipv4' or 'ipv6'. Default: 'ipv4'. + */ + addRange(start: string, end: string, type?: IPVersion): void; + + /** + * Adds a rule to block a range of IP addresses specified as a subnet mask. + * + * @param net The network IPv4 or IPv6 address. + * @param prefix The number of CIDR prefix bits. + * For IPv4, this must be a value between 0 and 32. For IPv6, this must be between 0 and 128. + * @param type Either 'ipv4' or 'ipv6'. Default: 'ipv4'. + */ + addSubnet(net: string, prefix: number, type?: IPVersion): void; + + /** + * Returns `true` if the given IP address matches any of the rules added to the `BlockList`. + * + * @param address The IP address to check + * @param type Either 'ipv4' or 'ipv6'. Default: 'ipv4'. + */ + check(address: string, type?: IPVersion): boolean; + } + + interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { + timeout?: number; + } + + interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts { + timeout?: number; + } + + type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts; + + function createServer(connectionListener?: (socket: Socket) => void): Server; + function createServer(options?: ServerOpts, connectionListener?: (socket: Socket) => void): Server; + function connect(options: NetConnectOpts, connectionListener?: () => void): Socket; + function connect(port: number, host?: string, connectionListener?: () => void): Socket; + function connect(path: string, connectionListener?: () => void): Socket; + function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket; + function createConnection(port: number, host?: string, connectionListener?: () => void): Socket; + function createConnection(path: string, connectionListener?: () => void): Socket; + function isIP(input: string): number; + function isIPv4(input: string): boolean; + function isIPv6(input: string): boolean; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/os.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/os.d.ts new file mode 100755 index 000000000..6c92907b7 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/os.d.ts @@ -0,0 +1,239 @@ +declare module 'os' { + interface CpuInfo { + model: string; + speed: number; + times: { + user: number; + nice: number; + sys: number; + idle: number; + irq: number; + }; + } + + interface NetworkInterfaceBase { + address: string; + netmask: string; + mac: string; + internal: boolean; + cidr: string | null; + } + + interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { + family: "IPv4"; + } + + interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase { + family: "IPv6"; + scopeid: number; + } + + interface UserInfo { + username: T; + uid: number; + gid: number; + shell: T; + homedir: T; + } + + type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6; + + function hostname(): string; + function loadavg(): number[]; + function uptime(): number; + function freemem(): number; + function totalmem(): number; + function cpus(): CpuInfo[]; + function type(): string; + function release(): string; + function networkInterfaces(): NodeJS.Dict; + function homedir(): string; + function userInfo(options: { encoding: 'buffer' }): UserInfo; + function userInfo(options?: { encoding: BufferEncoding }): UserInfo; + + type SignalConstants = { + [key in NodeJS.Signals]: number; + }; + + namespace constants { + const UV_UDP_REUSEADDR: number; + namespace signals {} + const signals: SignalConstants; + namespace errno { + const E2BIG: number; + const EACCES: number; + const EADDRINUSE: number; + const EADDRNOTAVAIL: number; + const EAFNOSUPPORT: number; + const EAGAIN: number; + const EALREADY: number; + const EBADF: number; + const EBADMSG: number; + const EBUSY: number; + const ECANCELED: number; + const ECHILD: number; + const ECONNABORTED: number; + const ECONNREFUSED: number; + const ECONNRESET: number; + const EDEADLK: number; + const EDESTADDRREQ: number; + const EDOM: number; + const EDQUOT: number; + const EEXIST: number; + const EFAULT: number; + const EFBIG: number; + const EHOSTUNREACH: number; + const EIDRM: number; + const EILSEQ: number; + const EINPROGRESS: number; + const EINTR: number; + const EINVAL: number; + const EIO: number; + const EISCONN: number; + const EISDIR: number; + const ELOOP: number; + const EMFILE: number; + const EMLINK: number; + const EMSGSIZE: number; + const EMULTIHOP: number; + const ENAMETOOLONG: number; + const ENETDOWN: number; + const ENETRESET: number; + const ENETUNREACH: number; + const ENFILE: number; + const ENOBUFS: number; + const ENODATA: number; + const ENODEV: number; + const ENOENT: number; + const ENOEXEC: number; + const ENOLCK: number; + const ENOLINK: number; + const ENOMEM: number; + const ENOMSG: number; + const ENOPROTOOPT: number; + const ENOSPC: number; + const ENOSR: number; + const ENOSTR: number; + const ENOSYS: number; + const ENOTCONN: number; + const ENOTDIR: number; + const ENOTEMPTY: number; + const ENOTSOCK: number; + const ENOTSUP: number; + const ENOTTY: number; + const ENXIO: number; + const EOPNOTSUPP: number; + const EOVERFLOW: number; + const EPERM: number; + const EPIPE: number; + const EPROTO: number; + const EPROTONOSUPPORT: number; + const EPROTOTYPE: number; + const ERANGE: number; + const EROFS: number; + const ESPIPE: number; + const ESRCH: number; + const ESTALE: number; + const ETIME: number; + const ETIMEDOUT: number; + const ETXTBSY: number; + const EWOULDBLOCK: number; + const EXDEV: number; + const WSAEINTR: number; + const WSAEBADF: number; + const WSAEACCES: number; + const WSAEFAULT: number; + const WSAEINVAL: number; + const WSAEMFILE: number; + const WSAEWOULDBLOCK: number; + const WSAEINPROGRESS: number; + const WSAEALREADY: number; + const WSAENOTSOCK: number; + const WSAEDESTADDRREQ: number; + const WSAEMSGSIZE: number; + const WSAEPROTOTYPE: number; + const WSAENOPROTOOPT: number; + const WSAEPROTONOSUPPORT: number; + const WSAESOCKTNOSUPPORT: number; + const WSAEOPNOTSUPP: number; + const WSAEPFNOSUPPORT: number; + const WSAEAFNOSUPPORT: number; + const WSAEADDRINUSE: number; + const WSAEADDRNOTAVAIL: number; + const WSAENETDOWN: number; + const WSAENETUNREACH: number; + const WSAENETRESET: number; + const WSAECONNABORTED: number; + const WSAECONNRESET: number; + const WSAENOBUFS: number; + const WSAEISCONN: number; + const WSAENOTCONN: number; + const WSAESHUTDOWN: number; + const WSAETOOMANYREFS: number; + const WSAETIMEDOUT: number; + const WSAECONNREFUSED: number; + const WSAELOOP: number; + const WSAENAMETOOLONG: number; + const WSAEHOSTDOWN: number; + const WSAEHOSTUNREACH: number; + const WSAENOTEMPTY: number; + const WSAEPROCLIM: number; + const WSAEUSERS: number; + const WSAEDQUOT: number; + const WSAESTALE: number; + const WSAEREMOTE: number; + const WSASYSNOTREADY: number; + const WSAVERNOTSUPPORTED: number; + const WSANOTINITIALISED: number; + const WSAEDISCON: number; + const WSAENOMORE: number; + const WSAECANCELLED: number; + const WSAEINVALIDPROCTABLE: number; + const WSAEINVALIDPROVIDER: number; + const WSAEPROVIDERFAILEDINIT: number; + const WSASYSCALLFAILURE: number; + const WSASERVICE_NOT_FOUND: number; + const WSATYPE_NOT_FOUND: number; + const WSA_E_NO_MORE: number; + const WSA_E_CANCELLED: number; + const WSAEREFUSED: number; + } + namespace priority { + const PRIORITY_LOW: number; + const PRIORITY_BELOW_NORMAL: number; + const PRIORITY_NORMAL: number; + const PRIORITY_ABOVE_NORMAL: number; + const PRIORITY_HIGH: number; + const PRIORITY_HIGHEST: number; + } + } + + function arch(): string; + /** + * Returns a string identifying the kernel version. + * On POSIX systems, the operating system release is determined by calling + * [uname(3)][]. On Windows, `pRtlGetVersion` is used, and if it is not available, + * `GetVersionExW()` will be used. See + * https://en.wikipedia.org/wiki/Uname#Examples for more information. + */ + function version(): string; + function platform(): NodeJS.Platform; + function tmpdir(): string; + const EOL: string; + function endianness(): "BE" | "LE"; + /** + * Gets the priority of a process. + * Defaults to current process. + */ + function getPriority(pid?: number): number; + /** + * Sets the priority of the current process. + * @param priority Must be in range of -20 to 19 + */ + function setPriority(priority: number): void; + /** + * Sets the priority of the process specified process. + * @param priority Must be in range of -20 to 19 + */ + function setPriority(pid: number, priority: number): void; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/package.json new file mode 100755 index 000000000..2d9a89eaa --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/package.json @@ -0,0 +1,223 @@ +{ + "_args": [ + [ + "@types/node@15.6.1", + "/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning" + ] + ], + "_from": "@types/node@15.6.1", + "_id": "@types/node@15.6.1", + "_inBundle": false, + "_integrity": "sha512-7EIraBEyRHEe7CH+Fm1XvgqU6uwZN8Q7jppJGcqjROMT29qhAuuOxYB1uEY5UMYQKEmA5D+5tBnhdaPXSsLONA==", + "_location": "/@types/node", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@types/node@15.6.1", + "name": "@types/node", + "escapedName": "@types%2fnode", + "scope": "@types", + "rawSpec": "15.6.1", + "saveSpec": null, + "fetchSpec": "15.6.1" + }, + "_requiredBy": [ + "/@types/node-fetch" + ], + "_resolved": "https://registry.npmjs.org/@types/node/-/node-15.6.1.tgz", + "_spec": "15.6.1", + "_where": "/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning", + "bugs": { + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues" + }, + "contributors": [ + { + "name": "Microsoft TypeScript", + "url": "https://github.com/Microsoft" + }, + { + "name": "DefinitelyTyped", + "url": "https://github.com/DefinitelyTyped" + }, + { + "name": "Alberto Schiabel", + "url": "https://github.com/jkomyno" + }, + { + "name": "Alvis HT Tang", + "url": "https://github.com/alvis" + }, + { + "name": "Andrew Makarov", + "url": "https://github.com/r3nya" + }, + { + "name": "Benjamin Toueg", + "url": "https://github.com/btoueg" + }, + { + "name": "Chigozirim C.", + "url": "https://github.com/smac89" + }, + { + "name": "David Junger", + "url": "https://github.com/touffy" + }, + { + "name": "Deividas Bakanas", + "url": "https://github.com/DeividasBakanas" + }, + { + "name": "Eugene Y. Q. Shen", + "url": "https://github.com/eyqs" + }, + { + "name": "Hannes Magnusson", + "url": "https://github.com/Hannes-Magnusson-CK" + }, + { + "name": "Hoàng Văn Khải", + "url": "https://github.com/KSXGitHub" + }, + { + "name": "Huw", + "url": "https://github.com/hoo29" + }, + { + "name": "Kelvin Jin", + "url": "https://github.com/kjin" + }, + { + "name": "Klaus Meinhardt", + "url": "https://github.com/ajafff" + }, + { + "name": "Lishude", + "url": "https://github.com/islishude" + }, + { + "name": "Mariusz Wiktorczyk", + "url": "https://github.com/mwiktorczyk" + }, + { + "name": "Mohsen Azimi", + "url": "https://github.com/mohsen1" + }, + { + "name": "Nicolas Even", + "url": "https://github.com/n-e" + }, + { + "name": "Nikita Galkin", + "url": "https://github.com/galkin" + }, + { + "name": "Parambir Singh", + "url": "https://github.com/parambirs" + }, + { + "name": "Sebastian Silbermann", + "url": "https://github.com/eps1lon" + }, + { + "name": "Simon Schick", + "url": "https://github.com/SimonSchick" + }, + { + "name": "Thomas den Hollander", + "url": "https://github.com/ThomasdenH" + }, + { + "name": "Wilco Bakker", + "url": "https://github.com/WilcoBakker" + }, + { + "name": "wwwy3y3", + "url": "https://github.com/wwwy3y3" + }, + { + "name": "Samuel Ainsworth", + "url": "https://github.com/samuela" + }, + { + "name": "Kyle Uehlein", + "url": "https://github.com/kuehlein" + }, + { + "name": "Thanik Bhongbhibhat", + "url": "https://github.com/bhongy" + }, + { + "name": "Marcin Kopacz", + "url": "https://github.com/chyzwar" + }, + { + "name": "Trivikram Kamat", + "url": "https://github.com/trivikr" + }, + { + "name": "Minh Son Nguyen", + "url": "https://github.com/nguymin4" + }, + { + "name": "Junxiao Shi", + "url": "https://github.com/yoursunny" + }, + { + "name": "Ilia Baryshnikov", + "url": "https://github.com/qwelias" + }, + { + "name": "ExE Boss", + "url": "https://github.com/ExE-Boss" + }, + { + "name": "Surasak Chaisurin", + "url": "https://github.com/Ryan-Willpower" + }, + { + "name": "Piotr Błażejewicz", + "url": "https://github.com/peterblazejewicz" + }, + { + "name": "Anna Henningsen", + "url": "https://github.com/addaleax" + }, + { + "name": "Jason Kwok", + "url": "https://github.com/JasonHK" + }, + { + "name": "Victor Perin", + "url": "https://github.com/victorperin" + }, + { + "name": "Yongsheng Zhang", + "url": "https://github.com/ZYSzys" + } + ], + "dependencies": {}, + "description": "TypeScript definitions for Node.js", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme", + "license": "MIT", + "main": "", + "name": "@types/node", + "repository": { + "type": "git", + "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/node" + }, + "scripts": {}, + "typeScriptVersion": "3.5", + "types": "index.d.ts", + "typesPublisherContentHash": "f8f8a539a80cc272f918927a96e6cef5cc69df79ec257791f25651eb317ea354", + "typesVersions": { + "<=3.6": { + "*": [ + "ts3.6/*" + ] + } + }, + "version": "15.6.1" +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/path.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/path.d.ts new file mode 100755 index 000000000..4ca1c5094 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/path.d.ts @@ -0,0 +1,163 @@ +declare module 'path/posix' { + import path = require('path'); + export = path; +} + +declare module 'path/win32' { + import path = require('path'); + export = path; +} + +declare module 'path' { + namespace path { + /** + * A parsed path object generated by path.parse() or consumed by path.format(). + */ + interface ParsedPath { + /** + * The root of the path such as '/' or 'c:\' + */ + root: string; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir: string; + /** + * The file name including extension (if any) such as 'index.html' + */ + base: string; + /** + * The file extension (if any) such as '.html' + */ + ext: string; + /** + * The file name without extension (if any) such as 'index' + */ + name: string; + } + + interface FormatInputPathObject { + /** + * The root of the path such as '/' or 'c:\' + */ + root?: string; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir?: string; + /** + * The file name including extension (if any) such as 'index.html' + */ + base?: string; + /** + * The file extension (if any) such as '.html' + */ + ext?: string; + /** + * The file name without extension (if any) such as 'index' + */ + name?: string; + } + + interface PlatformPath { + /** + * Normalize a string path, reducing '..' and '.' parts. + * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. + * + * @param p string path to normalize. + */ + normalize(p: string): string; + /** + * Join all arguments together and normalize the resulting path. + * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown. + * + * @param paths paths to join. + */ + join(...paths: string[]): string; + /** + * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. + * + * Starting from leftmost {from} parameter, resolves {to} to an absolute path. + * + * If {to} isn't already absolute, {from} arguments are prepended in right to left order, + * until an absolute path is found. If after using all {from} paths still no absolute path is found, + * the current working directory is used as well. The resulting path is normalized, + * and trailing slashes are removed unless the path gets resolved to the root directory. + * + * @param pathSegments string paths to join. Non-string arguments are ignored. + */ + resolve(...pathSegments: string[]): string; + /** + * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. + * + * @param path path to test. + */ + isAbsolute(p: string): boolean; + /** + * Solve the relative path from {from} to {to}. + * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. + */ + relative(from: string, to: string): string; + /** + * Return the directory name of a path. Similar to the Unix dirname command. + * + * @param p the path to evaluate. + */ + dirname(p: string): string; + /** + * Return the last portion of a path. Similar to the Unix basename command. + * Often used to extract the file name from a fully qualified path. + * + * @param p the path to evaluate. + * @param ext optionally, an extension to remove from the result. + */ + basename(p: string, ext?: string): string; + /** + * Return the extension of the path, from the last '.' to end of string in the last portion of the path. + * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string + * + * @param p the path to evaluate. + */ + extname(p: string): string; + /** + * The platform-specific file separator. '\\' or '/'. + */ + readonly sep: string; + /** + * The platform-specific file delimiter. ';' or ':'. + */ + readonly delimiter: string; + /** + * Returns an object from a path string - the opposite of format(). + * + * @param pathString path to evaluate. + */ + parse(p: string): ParsedPath; + /** + * Returns a path string from an object - the opposite of parse(). + * + * @param pathString path to evaluate. + */ + format(pP: FormatInputPathObject): string; + /** + * On Windows systems only, returns an equivalent namespace-prefixed path for the given path. + * If path is not a string, path will be returned without modifications. + * This method is meaningful only on Windows system. + * On POSIX systems, the method is non-operational and always returns path without modifications. + */ + toNamespacedPath(path: string): string; + /** + * Posix specific pathing. + * Same as parent object on posix. + */ + readonly posix: PlatformPath; + /** + * Windows specific pathing. + * Same as parent object on windows + */ + readonly win32: PlatformPath; + } + } + const path: path.PlatformPath; + export = path; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/perf_hooks.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/perf_hooks.d.ts new file mode 100755 index 000000000..9eee61788 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/perf_hooks.d.ts @@ -0,0 +1,274 @@ +declare module 'perf_hooks' { + import { AsyncResource } from 'async_hooks'; + + type EntryType = 'node' | 'mark' | 'measure' | 'gc' | 'function' | 'http2' | 'http'; + + interface PerformanceEntry { + /** + * The total number of milliseconds elapsed for this entry. + * This value will not be meaningful for all Performance Entry types. + */ + readonly duration: number; + + /** + * The name of the performance entry. + */ + readonly name: string; + + /** + * The high resolution millisecond timestamp marking the starting time of the Performance Entry. + */ + readonly startTime: number; + + /** + * The type of the performance entry. + * Currently it may be one of: 'node', 'mark', 'measure', 'gc', or 'function'. + */ + readonly entryType: EntryType; + + /** + * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies + * the type of garbage collection operation that occurred. + * See perf_hooks.constants for valid values. + */ + readonly kind?: number; + + /** + * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags` + * property contains additional information about garbage collection operation. + * See perf_hooks.constants for valid values. + */ + readonly flags?: number; + } + + interface PerformanceNodeTiming extends PerformanceEntry { + /** + * The high resolution millisecond timestamp at which the Node.js process completed bootstrap. + */ + readonly bootstrapComplete: number; + + /** + * The high resolution millisecond timestamp at which the Node.js process completed bootstrapping. + * If bootstrapping has not yet finished, the property has the value of -1. + */ + readonly environment: number; + + /** + * The high resolution millisecond timestamp at which the Node.js environment was initialized. + */ + readonly idleTime: number; + + /** + * The high resolution millisecond timestamp of the amount of time the event loop has been idle + * within the event loop's event provider (e.g. `epoll_wait`). This does not take CPU usage + * into consideration. If the event loop has not yet started (e.g., in the first tick of the main script), + * the property has the value of 0. + */ + readonly loopExit: number; + + /** + * The high resolution millisecond timestamp at which the Node.js event loop started. + * If the event loop has not yet started (e.g., in the first tick of the main script), the property has the value of -1. + */ + readonly loopStart: number; + + /** + * The high resolution millisecond timestamp at which the V8 platform was initialized. + */ + readonly v8Start: number; + } + + interface EventLoopUtilization { + idle: number; + active: number; + utilization: number; + } + + /** + * @param util1 The result of a previous call to eventLoopUtilization() + * @param util2 The result of a previous call to eventLoopUtilization() prior to util1 + */ + type EventLoopUtilityFunction = (util1?: EventLoopUtilization, util2?: EventLoopUtilization) => EventLoopUtilization; + + interface Performance { + /** + * If name is not provided, removes all PerformanceMark objects from the Performance Timeline. + * If name is provided, removes only the named mark. + * @param name + */ + clearMarks(name?: string): void; + + /** + * Creates a new PerformanceMark entry in the Performance Timeline. + * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark', + * and whose performanceEntry.duration is always 0. + * Performance marks are used to mark specific significant moments in the Performance Timeline. + * @param name + */ + mark(name?: string): void; + + /** + * Creates a new PerformanceMeasure entry in the Performance Timeline. + * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure', + * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark. + * + * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify + * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist, + * then startMark is set to timeOrigin by default. + * + * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp + * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown. + * @param name + * @param startMark + * @param endMark + */ + measure(name: string, startMark: string, endMark: string): void; + + /** + * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones. + */ + readonly nodeTiming: PerformanceNodeTiming; + + /** + * @return the current high resolution millisecond timestamp + */ + now(): number; + + /** + * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured. + */ + readonly timeOrigin: number; + + /** + * Wraps a function within a new function that measures the running time of the wrapped function. + * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed. + * @param fn + */ + timerify any>(fn: T): T; + + /** + * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time. + * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). + * No other CPU idle time is taken into consideration. + */ + eventLoopUtilization: EventLoopUtilityFunction; + } + + interface PerformanceObserverEntryList { + /** + * @return a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime. + */ + getEntries(): PerformanceEntry[]; + + /** + * @return a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime + * whose performanceEntry.name is equal to name, and optionally, whose performanceEntry.entryType is equal to type. + */ + getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; + + /** + * @return Returns a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime + * whose performanceEntry.entryType is equal to type. + */ + getEntriesByType(type: EntryType): PerformanceEntry[]; + } + + type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; + + class PerformanceObserver extends AsyncResource { + constructor(callback: PerformanceObserverCallback); + + /** + * Disconnects the PerformanceObserver instance from all notifications. + */ + disconnect(): void; + + /** + * Subscribes the PerformanceObserver instance to notifications of new PerformanceEntry instances identified by options.entryTypes. + * When options.buffered is false, the callback will be invoked once for every PerformanceEntry instance. + * Property buffered defaults to false. + * @param options + */ + observe(options: { entryTypes: ReadonlyArray; buffered?: boolean }): void; + } + + namespace constants { + const NODE_PERFORMANCE_GC_MAJOR: number; + const NODE_PERFORMANCE_GC_MINOR: number; + const NODE_PERFORMANCE_GC_INCREMENTAL: number; + const NODE_PERFORMANCE_GC_WEAKCB: number; + + const NODE_PERFORMANCE_GC_FLAGS_NO: number; + const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number; + const NODE_PERFORMANCE_GC_FLAGS_FORCED: number; + const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number; + const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number; + const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number; + const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number; + } + + const performance: Performance; + + interface EventLoopMonitorOptions { + /** + * The sampling rate in milliseconds. + * Must be greater than zero. + * @default 10 + */ + resolution?: number; + } + + interface EventLoopDelayMonitor { + /** + * Enables the event loop delay sample timer. Returns `true` if the timer was started, `false` if it was already started. + */ + enable(): boolean; + /** + * Disables the event loop delay sample timer. Returns `true` if the timer was stopped, `false` if it was already stopped. + */ + disable(): boolean; + + /** + * Resets the collected histogram data. + */ + reset(): void; + + /** + * Returns the value at the given percentile. + * @param percentile A percentile value between 1 and 100. + */ + percentile(percentile: number): number; + + /** + * A `Map` object detailing the accumulated percentile distribution. + */ + readonly percentiles: Map; + + /** + * The number of times the event loop delay exceeded the maximum 1 hour eventloop delay threshold. + */ + readonly exceeds: number; + + /** + * The minimum recorded event loop delay. + */ + readonly min: number; + + /** + * The maximum recorded event loop delay. + */ + readonly max: number; + + /** + * The mean of the recorded event loop delays. + */ + readonly mean: number; + + /** + * The standard deviation of the recorded event loop delays. + */ + readonly stddev: number; + } + + function monitorEventLoopDelay(options?: EventLoopMonitorOptions): EventLoopDelayMonitor; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/process.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/process.d.ts new file mode 100755 index 000000000..20c1aba9f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/process.d.ts @@ -0,0 +1,461 @@ +declare module 'process' { + import * as tty from 'tty'; + + global { + var process: NodeJS.Process; + + namespace NodeJS { + // this namespace merge is here because these are specifically used + // as the type for process.stdin, process.stdout, and process.stderr. + // they can't live in tty.d.ts because we need to disambiguate the imported name. + interface ReadStream extends tty.ReadStream {} + interface WriteStream extends tty.WriteStream {} + + interface MemoryUsageFn { + /** + * The `process.memoryUsage()` method iterate over each page to gather informations about memory + * usage which can be slow depending on the program memory allocations. + */ + (): MemoryUsage; + /** + * method returns an integer representing the Resident Set Size (RSS) in bytes. + */ + rss(): number; + } + + interface MemoryUsage { + rss: number; + heapTotal: number; + heapUsed: number; + external: number; + arrayBuffers: number; + } + + interface CpuUsage { + user: number; + system: number; + } + + interface ProcessRelease { + name: string; + sourceUrl?: string; + headersUrl?: string; + libUrl?: string; + lts?: string; + } + + interface ProcessVersions extends Dict { + http_parser: string; + node: string; + v8: string; + ares: string; + uv: string; + zlib: string; + modules: string; + openssl: string; + } + + type Platform = 'aix' + | 'android' + | 'darwin' + | 'freebsd' + | 'linux' + | 'openbsd' + | 'sunos' + | 'win32' + | 'cygwin' + | 'netbsd'; + + type Signals = + "SIGABRT" | "SIGALRM" | "SIGBUS" | "SIGCHLD" | "SIGCONT" | "SIGFPE" | "SIGHUP" | "SIGILL" | "SIGINT" | "SIGIO" | + "SIGIOT" | "SIGKILL" | "SIGPIPE" | "SIGPOLL" | "SIGPROF" | "SIGPWR" | "SIGQUIT" | "SIGSEGV" | "SIGSTKFLT" | + "SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" | + "SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ" | "SIGBREAK" | "SIGLOST" | "SIGINFO"; + + type MultipleResolveType = 'resolve' | 'reject'; + + type BeforeExitListener = (code: number) => void; + type DisconnectListener = () => void; + type ExitListener = (code: number) => void; + type RejectionHandledListener = (promise: Promise) => void; + type UncaughtExceptionListener = (error: Error) => void; + type UnhandledRejectionListener = (reason: {} | null | undefined, promise: Promise) => void; + type WarningListener = (warning: Error) => void; + type MessageListener = (message: any, sendHandle: any) => void; + type SignalsListener = (signal: Signals) => void; + type NewListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void; + type RemoveListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void; + type MultipleResolveListener = (type: MultipleResolveType, promise: Promise, value: any) => void; + + interface Socket extends ReadWriteStream { + isTTY?: true; + } + + // Alias for compatibility + interface ProcessEnv extends Dict {} + + interface HRTime { + (time?: [number, number]): [number, number]; + bigint(): bigint; + } + + interface ProcessReport { + /** + * Directory where the report is written. + * working directory of the Node.js process. + * @default '' indicating that reports are written to the current + */ + directory: string; + + /** + * Filename where the report is written. + * The default value is the empty string. + * @default '' the output filename will be comprised of a timestamp, + * PID, and sequence number. + */ + filename: string; + + /** + * Returns a JSON-formatted diagnostic report for the running process. + * The report's JavaScript stack trace is taken from err, if present. + */ + getReport(err?: Error): string; + + /** + * If true, a diagnostic report is generated on fatal errors, + * such as out of memory errors or failed C++ assertions. + * @default false + */ + reportOnFatalError: boolean; + + /** + * If true, a diagnostic report is generated when the process + * receives the signal specified by process.report.signal. + * @defaul false + */ + reportOnSignal: boolean; + + /** + * If true, a diagnostic report is generated on uncaught exception. + * @default false + */ + reportOnUncaughtException: boolean; + + /** + * The signal used to trigger the creation of a diagnostic report. + * @default 'SIGUSR2' + */ + signal: Signals; + + /** + * Writes a diagnostic report to a file. If filename is not provided, the default filename + * includes the date, time, PID, and a sequence number. + * The report's JavaScript stack trace is taken from err, if present. + * + * @param fileName Name of the file where the report is written. + * This should be a relative path, that will be appended to the directory specified in + * `process.report.directory`, or the current working directory of the Node.js process, + * if unspecified. + * @param error A custom error used for reporting the JavaScript stack. + * @return Filename of the generated report. + */ + writeReport(fileName?: string): string; + writeReport(error?: Error): string; + writeReport(fileName?: string, err?: Error): string; + } + + interface ResourceUsage { + fsRead: number; + fsWrite: number; + involuntaryContextSwitches: number; + ipcReceived: number; + ipcSent: number; + majorPageFault: number; + maxRSS: number; + minorPageFault: number; + sharedMemorySize: number; + signalsCount: number; + swappedOut: number; + systemCPUTime: number; + unsharedDataSize: number; + unsharedStackSize: number; + userCPUTime: number; + voluntaryContextSwitches: number; + } + + interface EmitWarningOptions { + /** + * When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. + * + * @default 'Warning' + */ + type?: string; + + /** + * A unique identifier for the warning instance being emitted. + */ + code?: string; + + /** + * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. + * + * @default process.emitWarning + */ + ctor?: Function; + + /** + * Additional text to include with the error. + */ + detail?: string; + } + + interface Process extends EventEmitter { + /** + * Can also be a tty.WriteStream, not typed due to limitations. + */ + stdout: WriteStream & { + fd: 1; + }; + /** + * Can also be a tty.WriteStream, not typed due to limitations. + */ + stderr: WriteStream & { + fd: 2; + }; + stdin: ReadStream & { + fd: 0; + }; + openStdin(): Socket; + argv: string[]; + argv0: string; + execArgv: string[]; + execPath: string; + abort(): never; + chdir(directory: string): void; + cwd(): string; + debugPort: number; + + /** + * The `process.emitWarning()` method can be used to emit custom or application specific process warnings. + * + * These can be listened for by adding a handler to the `'warning'` event. + * + * @param warning The warning to emit. + * @param type When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. Default: `'Warning'`. + * @param code A unique identifier for the warning instance being emitted. + * @param ctor When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. Default: `process.emitWarning`. + */ + emitWarning(warning: string | Error, ctor?: Function): void; + emitWarning(warning: string | Error, type?: string, ctor?: Function): void; + emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void; + emitWarning(warning: string | Error, options?: EmitWarningOptions): void; + + env: ProcessEnv; + exit(code?: number): never; + exitCode?: number; + getgid(): number; + setgid(id: number | string): void; + getuid(): number; + setuid(id: number | string): void; + geteuid(): number; + seteuid(id: number | string): void; + getegid(): number; + setegid(id: number | string): void; + getgroups(): number[]; + setgroups(groups: ReadonlyArray): void; + setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void; + hasUncaughtExceptionCaptureCallback(): boolean; + version: string; + versions: ProcessVersions; + config: { + target_defaults: { + cflags: any[]; + default_configuration: string; + defines: string[]; + include_dirs: string[]; + libraries: string[]; + }; + variables: { + clang: number; + host_arch: string; + node_install_npm: boolean; + node_install_waf: boolean; + node_prefix: string; + node_shared_openssl: boolean; + node_shared_v8: boolean; + node_shared_zlib: boolean; + node_use_dtrace: boolean; + node_use_etw: boolean; + node_use_openssl: boolean; + target_arch: string; + v8_no_strict_aliasing: number; + v8_use_snapshot: boolean; + visibility: string; + }; + }; + kill(pid: number, signal?: string | number): true; + pid: number; + ppid: number; + title: string; + arch: string; + platform: Platform; + /** @deprecated since v14.0.0 - use `require.main` instead. */ + mainModule?: Module; + memoryUsage: MemoryUsageFn; + cpuUsage(previousValue?: CpuUsage): CpuUsage; + nextTick(callback: Function, ...args: any[]): void; + release: ProcessRelease; + features: { + inspector: boolean; + debug: boolean; + uv: boolean; + ipv6: boolean; + tls_alpn: boolean; + tls_sni: boolean; + tls_ocsp: boolean; + tls: boolean; + }; + /** + * @deprecated since v14.0.0 - Calling process.umask() with no argument causes + * the process-wide umask to be written twice. This introduces a race condition between threads, + * and is a potential security vulnerability. There is no safe, cross-platform alternative API. + */ + umask(): number; + /** + * Can only be set if not in worker thread. + */ + umask(mask: string | number): number; + uptime(): number; + hrtime: HRTime; + domain: Domain; + + // Worker + send?(message: any, sendHandle?: any, options?: { swallowErrors?: boolean}, callback?: (error: Error | null) => void): boolean; + disconnect(): void; + connected: boolean; + + /** + * The `process.allowedNodeEnvironmentFlags` property is a special, + * read-only `Set` of flags allowable within the [`NODE_OPTIONS`][] + * environment variable. + */ + allowedNodeEnvironmentFlags: ReadonlySet; + + /** + * Only available with `--experimental-report` + */ + report?: ProcessReport; + + resourceUsage(): ResourceUsage; + + traceDeprecation: boolean; + + /* EventEmitter */ + addListener(event: "beforeExit", listener: BeforeExitListener): this; + addListener(event: "disconnect", listener: DisconnectListener): this; + addListener(event: "exit", listener: ExitListener): this; + addListener(event: "rejectionHandled", listener: RejectionHandledListener): this; + addListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; + addListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; + addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + addListener(event: "warning", listener: WarningListener): this; + addListener(event: "message", listener: MessageListener): this; + addListener(event: Signals, listener: SignalsListener): this; + addListener(event: "newListener", listener: NewListenerListener): this; + addListener(event: "removeListener", listener: RemoveListenerListener): this; + addListener(event: "multipleResolves", listener: MultipleResolveListener): this; + + emit(event: "beforeExit", code: number): boolean; + emit(event: "disconnect"): boolean; + emit(event: "exit", code: number): boolean; + emit(event: "rejectionHandled", promise: Promise): boolean; + emit(event: "uncaughtException", error: Error): boolean; + emit(event: "uncaughtExceptionMonitor", error: Error): boolean; + emit(event: "unhandledRejection", reason: any, promise: Promise): boolean; + emit(event: "warning", warning: Error): boolean; + emit(event: "message", message: any, sendHandle: any): this; + emit(event: Signals, signal: Signals): boolean; + emit(event: "newListener", eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(event: "removeListener", eventName: string, listener: (...args: any[]) => void): this; + emit(event: "multipleResolves", listener: MultipleResolveListener): this; + + on(event: "beforeExit", listener: BeforeExitListener): this; + on(event: "disconnect", listener: DisconnectListener): this; + on(event: "exit", listener: ExitListener): this; + on(event: "rejectionHandled", listener: RejectionHandledListener): this; + on(event: "uncaughtException", listener: UncaughtExceptionListener): this; + on(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; + on(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + on(event: "warning", listener: WarningListener): this; + on(event: "message", listener: MessageListener): this; + on(event: Signals, listener: SignalsListener): this; + on(event: "newListener", listener: NewListenerListener): this; + on(event: "removeListener", listener: RemoveListenerListener): this; + on(event: "multipleResolves", listener: MultipleResolveListener): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "beforeExit", listener: BeforeExitListener): this; + once(event: "disconnect", listener: DisconnectListener): this; + once(event: "exit", listener: ExitListener): this; + once(event: "rejectionHandled", listener: RejectionHandledListener): this; + once(event: "uncaughtException", listener: UncaughtExceptionListener): this; + once(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; + once(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + once(event: "warning", listener: WarningListener): this; + once(event: "message", listener: MessageListener): this; + once(event: Signals, listener: SignalsListener): this; + once(event: "newListener", listener: NewListenerListener): this; + once(event: "removeListener", listener: RemoveListenerListener): this; + once(event: "multipleResolves", listener: MultipleResolveListener): this; + + prependListener(event: "beforeExit", listener: BeforeExitListener): this; + prependListener(event: "disconnect", listener: DisconnectListener): this; + prependListener(event: "exit", listener: ExitListener): this; + prependListener(event: "rejectionHandled", listener: RejectionHandledListener): this; + prependListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; + prependListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; + prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + prependListener(event: "warning", listener: WarningListener): this; + prependListener(event: "message", listener: MessageListener): this; + prependListener(event: Signals, listener: SignalsListener): this; + prependListener(event: "newListener", listener: NewListenerListener): this; + prependListener(event: "removeListener", listener: RemoveListenerListener): this; + prependListener(event: "multipleResolves", listener: MultipleResolveListener): this; + + prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this; + prependOnceListener(event: "disconnect", listener: DisconnectListener): this; + prependOnceListener(event: "exit", listener: ExitListener): this; + prependOnceListener(event: "rejectionHandled", listener: RejectionHandledListener): this; + prependOnceListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; + prependOnceListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; + prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + prependOnceListener(event: "warning", listener: WarningListener): this; + prependOnceListener(event: "message", listener: MessageListener): this; + prependOnceListener(event: Signals, listener: SignalsListener): this; + prependOnceListener(event: "newListener", listener: NewListenerListener): this; + prependOnceListener(event: "removeListener", listener: RemoveListenerListener): this; + prependOnceListener(event: "multipleResolves", listener: MultipleResolveListener): this; + + listeners(event: "beforeExit"): BeforeExitListener[]; + listeners(event: "disconnect"): DisconnectListener[]; + listeners(event: "exit"): ExitListener[]; + listeners(event: "rejectionHandled"): RejectionHandledListener[]; + listeners(event: "uncaughtException"): UncaughtExceptionListener[]; + listeners(event: "uncaughtExceptionMonitor"): UncaughtExceptionListener[]; + listeners(event: "unhandledRejection"): UnhandledRejectionListener[]; + listeners(event: "warning"): WarningListener[]; + listeners(event: "message"): MessageListener[]; + listeners(event: Signals): SignalsListener[]; + listeners(event: "newListener"): NewListenerListener[]; + listeners(event: "removeListener"): RemoveListenerListener[]; + listeners(event: "multipleResolves"): MultipleResolveListener[]; + } + + interface Global { + process: Process; + } + } + } + + export = process; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/punycode.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/punycode.d.ts new file mode 100755 index 000000000..b21ee8ec0 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/punycode.d.ts @@ -0,0 +1,75 @@ +/** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ +declare module 'punycode' { + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + function decode(string: string): string; + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + function encode(string: string): string; + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + function toUnicode(domain: string): string; + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + function toASCII(domain: string): string; + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + const ucs2: ucs2; + interface ucs2 { + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + decode(string: string): number[]; + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + encode(codePoints: ReadonlyArray): string; + } + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + const version: string; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/querystring.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/querystring.d.ts new file mode 100755 index 000000000..106511898 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/querystring.d.ts @@ -0,0 +1,28 @@ +declare module 'querystring' { + interface StringifyOptions { + encodeURIComponent?: (str: string) => string; + } + + interface ParseOptions { + maxKeys?: number; + decodeURIComponent?: (str: string) => string; + } + + interface ParsedUrlQuery extends NodeJS.Dict { } + + interface ParsedUrlQueryInput extends NodeJS.Dict | ReadonlyArray | ReadonlyArray | null> { + } + + function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string; + function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; + /** + * The querystring.encode() function is an alias for querystring.stringify(). + */ + const encode: typeof stringify; + /** + * The querystring.decode() function is an alias for querystring.parse(). + */ + const decode: typeof parse; + function escape(str: string): string; + function unescape(str: string): string; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/readline.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/readline.d.ts new file mode 100755 index 000000000..3969af542 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/readline.d.ts @@ -0,0 +1,171 @@ +declare module 'readline' { + import EventEmitter = require('events'); + + interface Key { + sequence?: string; + name?: string; + ctrl?: boolean; + meta?: boolean; + shift?: boolean; + } + + class Interface extends EventEmitter { + readonly terminal: boolean; + + // Need direct access to line/cursor data, for use in external processes + // see: https://github.com/nodejs/node/issues/30347 + /** The current input data */ + readonly line: string; + /** The current cursor position in the input line */ + readonly cursor: number; + + /** + * NOTE: According to the documentation: + * + * > Instances of the `readline.Interface` class are constructed using the + * > `readline.createInterface()` method. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface + */ + protected constructor(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean); + /** + * NOTE: According to the documentation: + * + * > Instances of the `readline.Interface` class are constructed using the + * > `readline.createInterface()` method. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface + */ + protected constructor(options: ReadLineOptions); + + getPrompt(): string; + setPrompt(prompt: string): void; + prompt(preserveCursor?: boolean): void; + question(query: string, callback: (answer: string) => void): void; + pause(): this; + resume(): this; + close(): void; + write(data: string | Buffer, key?: Key): void; + + /** + * Returns the real position of the cursor in relation to the input + * prompt + string. Long input (wrapping) strings, as well as multiple + * line prompts are included in the calculations. + */ + getCursorPos(): CursorPos; + + /** + * events.EventEmitter + * 1. close + * 2. line + * 3. pause + * 4. resume + * 5. SIGCONT + * 6. SIGINT + * 7. SIGTSTP + */ + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "line", listener: (input: string) => void): this; + addListener(event: "pause", listener: () => void): this; + addListener(event: "resume", listener: () => void): this; + addListener(event: "SIGCONT", listener: () => void): this; + addListener(event: "SIGINT", listener: () => void): this; + addListener(event: "SIGTSTP", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "line", input: string): boolean; + emit(event: "pause"): boolean; + emit(event: "resume"): boolean; + emit(event: "SIGCONT"): boolean; + emit(event: "SIGINT"): boolean; + emit(event: "SIGTSTP"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "line", listener: (input: string) => void): this; + on(event: "pause", listener: () => void): this; + on(event: "resume", listener: () => void): this; + on(event: "SIGCONT", listener: () => void): this; + on(event: "SIGINT", listener: () => void): this; + on(event: "SIGTSTP", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "line", listener: (input: string) => void): this; + once(event: "pause", listener: () => void): this; + once(event: "resume", listener: () => void): this; + once(event: "SIGCONT", listener: () => void): this; + once(event: "SIGINT", listener: () => void): this; + once(event: "SIGTSTP", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "line", listener: (input: string) => void): this; + prependListener(event: "pause", listener: () => void): this; + prependListener(event: "resume", listener: () => void): this; + prependListener(event: "SIGCONT", listener: () => void): this; + prependListener(event: "SIGINT", listener: () => void): this; + prependListener(event: "SIGTSTP", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "line", listener: (input: string) => void): this; + prependOnceListener(event: "pause", listener: () => void): this; + prependOnceListener(event: "resume", listener: () => void): this; + prependOnceListener(event: "SIGCONT", listener: () => void): this; + prependOnceListener(event: "SIGINT", listener: () => void): this; + prependOnceListener(event: "SIGTSTP", listener: () => void): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + + type ReadLine = Interface; // type forwarded for backwards compatibility + + type Completer = (line: string) => CompleterResult; + type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => any; + + type CompleterResult = [string[], string]; + + interface ReadLineOptions { + input: NodeJS.ReadableStream; + output?: NodeJS.WritableStream; + completer?: Completer | AsyncCompleter; + terminal?: boolean; + historySize?: number; + prompt?: string; + crlfDelay?: number; + removeHistoryDuplicates?: boolean; + escapeCodeTimeout?: number; + tabSize?: number; + } + + function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface; + function createInterface(options: ReadLineOptions): Interface; + function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void; + + type Direction = -1 | 0 | 1; + + interface CursorPos { + rows: number; + cols: number; + } + + /** + * Clears the current line of this WriteStream in a direction identified by `dir`. + */ + function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean; + /** + * Clears this `WriteStream` from the current cursor down. + */ + function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean; + /** + * Moves this WriteStream's cursor to the specified position. + */ + function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean; + /** + * Moves this WriteStream's cursor relative to its current position. + */ + function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/repl.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/repl.d.ts new file mode 100755 index 000000000..45901e979 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/repl.d.ts @@ -0,0 +1,395 @@ +declare module 'repl' { + import { Interface, Completer, AsyncCompleter } from 'readline'; + import { Context } from 'vm'; + import { InspectOptions } from 'util'; + + interface ReplOptions { + /** + * The input prompt to display. + * @default "> " + */ + prompt?: string; + /** + * The `Readable` stream from which REPL input will be read. + * @default process.stdin + */ + input?: NodeJS.ReadableStream; + /** + * The `Writable` stream to which REPL output will be written. + * @default process.stdout + */ + output?: NodeJS.WritableStream; + /** + * If `true`, specifies that the output should be treated as a TTY terminal, and have + * ANSI/VT100 escape codes written to it. + * Default: checking the value of the `isTTY` property on the output stream upon + * instantiation. + */ + terminal?: boolean; + /** + * The function to be used when evaluating each given line of input. + * Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can + * error with `repl.Recoverable` to indicate the input was incomplete and prompt for + * additional lines. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_default_evaluation + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_custom_evaluation_functions + */ + eval?: REPLEval; + /** + * Defines if the repl prints output previews or not. + * @default `true` Always `false` in case `terminal` is falsy. + */ + preview?: boolean; + /** + * If `true`, specifies that the default `writer` function should include ANSI color + * styling to REPL output. If a custom `writer` function is provided then this has no + * effect. + * Default: the REPL instance's `terminal` value. + */ + useColors?: boolean; + /** + * If `true`, specifies that the default evaluation function will use the JavaScript + * `global` as the context as opposed to creating a new separate context for the REPL + * instance. The node CLI REPL sets this value to `true`. + * Default: `false`. + */ + useGlobal?: boolean; + /** + * If `true`, specifies that the default writer will not output the return value of a + * command if it evaluates to `undefined`. + * Default: `false`. + */ + ignoreUndefined?: boolean; + /** + * The function to invoke to format the output of each command before writing to `output`. + * Default: a wrapper for `util.inspect`. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_customizing_repl_output + */ + writer?: REPLWriter; + /** + * An optional function used for custom Tab auto completion. + * + * @see https://nodejs.org/dist/latest-v11.x/docs/api/readline.html#readline_use_of_the_completer_function + */ + completer?: Completer | AsyncCompleter; + /** + * A flag that specifies whether the default evaluator executes all JavaScript commands in + * strict mode or default (sloppy) mode. + * Accepted values are: + * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. + * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to + * prefacing every repl statement with `'use strict'`. + */ + replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT; + /** + * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is + * pressed. This cannot be used together with a custom `eval` function. + * Default: `false`. + */ + breakEvalOnSigint?: boolean; + } + + type REPLEval = (this: REPLServer, evalCmd: string, context: Context, file: string, cb: (err: Error | null, result: any) => void) => void; + type REPLWriter = (this: REPLServer, obj: any) => string; + + /** + * This is the default "writer" value, if none is passed in the REPL options, + * and it can be overridden by custom print functions. + */ + const writer: REPLWriter & { options: InspectOptions }; + + type REPLCommandAction = (this: REPLServer, text: string) => void; + + interface REPLCommand { + /** + * Help text to be displayed when `.help` is entered. + */ + help?: string; + /** + * The function to execute, optionally accepting a single string argument. + */ + action: REPLCommandAction; + } + + /** + * Provides a customizable Read-Eval-Print-Loop (REPL). + * + * Instances of `repl.REPLServer` will accept individual lines of user input, evaluate those + * according to a user-defined evaluation function, then output the result. Input and output + * may be from `stdin` and `stdout`, respectively, or may be connected to any Node.js `stream`. + * + * Instances of `repl.REPLServer` support automatic completion of inputs, simplistic Emacs-style + * line editing, multi-line inputs, ANSI-styled output, saving and restoring current REPL session + * state, error recovery, and customizable evaluation functions. + * + * Instances of `repl.REPLServer` are created using the `repl.start()` method and _should not_ + * be created directly using the JavaScript `new` keyword. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_repl + */ + class REPLServer extends Interface { + /** + * The `vm.Context` provided to the `eval` function to be used for JavaScript + * evaluation. + */ + readonly context: Context; + /** + * @deprecated since v14.3.0 - Use `input` instead. + */ + readonly inputStream: NodeJS.ReadableStream; + /** + * @deprecated since v14.3.0 - Use `output` instead. + */ + readonly outputStream: NodeJS.WritableStream; + /** + * The `Readable` stream from which REPL input will be read. + */ + readonly input: NodeJS.ReadableStream; + /** + * The `Writable` stream to which REPL output will be written. + */ + readonly output: NodeJS.WritableStream; + /** + * The commands registered via `replServer.defineCommand()`. + */ + readonly commands: NodeJS.ReadOnlyDict; + /** + * A value indicating whether the REPL is currently in "editor mode". + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_commands_and_special_keys + */ + readonly editorMode: boolean; + /** + * A value indicating whether the `_` variable has been assigned. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly underscoreAssigned: boolean; + /** + * The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL). + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly last: any; + /** + * A value indicating whether the `_error` variable has been assigned. + * + * @since v9.8.0 + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly underscoreErrAssigned: boolean; + /** + * The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL). + * + * @since v9.8.0 + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly lastError: any; + /** + * Specified in the REPL options, this is the function to be used when evaluating each + * given line of input. If not specified in the REPL options, this is an async wrapper + * for the JavaScript `eval()` function. + */ + readonly eval: REPLEval; + /** + * Specified in the REPL options, this is a value indicating whether the default + * `writer` function should include ANSI color styling to REPL output. + */ + readonly useColors: boolean; + /** + * Specified in the REPL options, this is a value indicating whether the default `eval` + * function will use the JavaScript `global` as the context as opposed to creating a new + * separate context for the REPL instance. + */ + readonly useGlobal: boolean; + /** + * Specified in the REPL options, this is a value indicating whether the default `writer` + * function should output the result of a command if it evaluates to `undefined`. + */ + readonly ignoreUndefined: boolean; + /** + * Specified in the REPL options, this is the function to invoke to format the output of + * each command before writing to `outputStream`. If not specified in the REPL options, + * this will be a wrapper for `util.inspect`. + */ + readonly writer: REPLWriter; + /** + * Specified in the REPL options, this is the function to use for custom Tab auto-completion. + */ + readonly completer: Completer | AsyncCompleter; + /** + * Specified in the REPL options, this is a flag that specifies whether the default `eval` + * function should execute all JavaScript commands in strict mode or default (sloppy) mode. + * Possible values are: + * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. + * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to + * prefacing every repl statement with `'use strict'`. + */ + readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT; + + /** + * NOTE: According to the documentation: + * + * > Instances of `repl.REPLServer` are created using the `repl.start()` method and + * > _should not_ be created directly using the JavaScript `new` keyword. + * + * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_class_replserver + */ + private constructor(); + + /** + * Used to add new `.`-prefixed commands to the REPL instance. Such commands are invoked + * by typing a `.` followed by the `keyword`. + * + * @param keyword The command keyword (_without_ a leading `.` character). + * @param cmd The function to invoke when the command is processed. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_replserver_definecommand_keyword_cmd + */ + defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void; + /** + * Readies the REPL instance for input from the user, printing the configured `prompt` to a + * new line in the `output` and resuming the `input` to accept new input. + * + * When multi-line input is being entered, an ellipsis is printed rather than the 'prompt'. + * + * This method is primarily intended to be called from within the action function for + * commands registered using the `replServer.defineCommand()` method. + * + * @param preserveCursor When `true`, the cursor placement will not be reset to `0`. + */ + displayPrompt(preserveCursor?: boolean): void; + /** + * Clears any command that has been buffered but not yet executed. + * + * This method is primarily intended to be called from within the action function for + * commands registered using the `replServer.defineCommand()` method. + * + * @since v9.0.0 + */ + clearBufferedCommand(): void; + + /** + * Initializes a history log file for the REPL instance. When executing the + * Node.js binary and using the command line REPL, a history file is initialized + * by default. However, this is not the case when creating a REPL + * programmatically. Use this method to initialize a history log file when working + * with REPL instances programmatically. + * @param path The path to the history file + */ + setupHistory(path: string, cb: (err: Error | null, repl: this) => void): void; + + /** + * events.EventEmitter + * 1. close - inherited from `readline.Interface` + * 2. line - inherited from `readline.Interface` + * 3. pause - inherited from `readline.Interface` + * 4. resume - inherited from `readline.Interface` + * 5. SIGCONT - inherited from `readline.Interface` + * 6. SIGINT - inherited from `readline.Interface` + * 7. SIGTSTP - inherited from `readline.Interface` + * 8. exit + * 9. reset + */ + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "line", listener: (input: string) => void): this; + addListener(event: "pause", listener: () => void): this; + addListener(event: "resume", listener: () => void): this; + addListener(event: "SIGCONT", listener: () => void): this; + addListener(event: "SIGINT", listener: () => void): this; + addListener(event: "SIGTSTP", listener: () => void): this; + addListener(event: "exit", listener: () => void): this; + addListener(event: "reset", listener: (context: Context) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "line", input: string): boolean; + emit(event: "pause"): boolean; + emit(event: "resume"): boolean; + emit(event: "SIGCONT"): boolean; + emit(event: "SIGINT"): boolean; + emit(event: "SIGTSTP"): boolean; + emit(event: "exit"): boolean; + emit(event: "reset", context: Context): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "line", listener: (input: string) => void): this; + on(event: "pause", listener: () => void): this; + on(event: "resume", listener: () => void): this; + on(event: "SIGCONT", listener: () => void): this; + on(event: "SIGINT", listener: () => void): this; + on(event: "SIGTSTP", listener: () => void): this; + on(event: "exit", listener: () => void): this; + on(event: "reset", listener: (context: Context) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "line", listener: (input: string) => void): this; + once(event: "pause", listener: () => void): this; + once(event: "resume", listener: () => void): this; + once(event: "SIGCONT", listener: () => void): this; + once(event: "SIGINT", listener: () => void): this; + once(event: "SIGTSTP", listener: () => void): this; + once(event: "exit", listener: () => void): this; + once(event: "reset", listener: (context: Context) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "line", listener: (input: string) => void): this; + prependListener(event: "pause", listener: () => void): this; + prependListener(event: "resume", listener: () => void): this; + prependListener(event: "SIGCONT", listener: () => void): this; + prependListener(event: "SIGINT", listener: () => void): this; + prependListener(event: "SIGTSTP", listener: () => void): this; + prependListener(event: "exit", listener: () => void): this; + prependListener(event: "reset", listener: (context: Context) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "line", listener: (input: string) => void): this; + prependOnceListener(event: "pause", listener: () => void): this; + prependOnceListener(event: "resume", listener: () => void): this; + prependOnceListener(event: "SIGCONT", listener: () => void): this; + prependOnceListener(event: "SIGINT", listener: () => void): this; + prependOnceListener(event: "SIGTSTP", listener: () => void): this; + prependOnceListener(event: "exit", listener: () => void): this; + prependOnceListener(event: "reset", listener: (context: Context) => void): this; + } + + /** + * A flag passed in the REPL options. Evaluates expressions in sloppy mode. + */ + const REPL_MODE_SLOPPY: unique symbol; + + /** + * A flag passed in the REPL options. Evaluates expressions in strict mode. + * This is equivalent to prefacing every repl statement with `'use strict'`. + */ + const REPL_MODE_STRICT: unique symbol; + + /** + * Creates and starts a `repl.REPLServer` instance. + * + * @param options The options for the `REPLServer`. If `options` is a string, then it specifies + * the input prompt. + */ + function start(options?: string | ReplOptions): REPLServer; + + /** + * Indicates a recoverable error that a `REPLServer` can use to support multi-line input. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_recoverable_errors + */ + class Recoverable extends SyntaxError { + err: Error; + + constructor(err: Error); + } +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/stream.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/stream.d.ts new file mode 100755 index 000000000..8d24d2ae1 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/stream.d.ts @@ -0,0 +1,471 @@ +declare module 'stream' { + import { EventEmitter, Abortable } from 'events'; + import * as streamPromises from "stream/promises"; + + class internal extends EventEmitter { + pipe(destination: T, options?: { end?: boolean; }): T; + } + + namespace internal { + class Stream extends internal { + constructor(opts?: ReadableOptions); + } + + interface StreamOptions extends Abortable { + emitClose?: boolean; + highWaterMark?: number; + objectMode?: boolean; + construct?(this: T, callback: (error?: Error | null) => void): void; + destroy?(this: T, error: Error | null, callback: (error: Error | null) => void): void; + autoDestroy?: boolean; + } + + interface ReadableOptions extends StreamOptions { + encoding?: BufferEncoding; + read?(this: Readable, size: number): void; + } + + class Readable extends Stream implements NodeJS.ReadableStream { + /** + * A utility method for creating Readable Streams out of iterators. + */ + static from(iterable: Iterable | AsyncIterable, options?: ReadableOptions): Readable; + + readable: boolean; + readonly readableEncoding: BufferEncoding | null; + readonly readableEnded: boolean; + readonly readableFlowing: boolean | null; + readonly readableHighWaterMark: number; + readonly readableLength: number; + readonly readableObjectMode: boolean; + destroyed: boolean; + constructor(opts?: ReadableOptions); + _construct?(callback: (error?: Error | null) => void): void; + _read(size: number): void; + read(size?: number): any; + setEncoding(encoding: BufferEncoding): this; + pause(): this; + resume(): this; + isPaused(): boolean; + unpipe(destination?: NodeJS.WritableStream): this; + unshift(chunk: any, encoding?: BufferEncoding): void; + wrap(oldStream: NodeJS.ReadableStream): this; + push(chunk: any, encoding?: BufferEncoding): boolean; + _destroy(error: Error | null, callback: (error?: Error | null) => void): void; + destroy(error?: Error): void; + + /** + * Event emitter + * The defined events on documents including: + * 1. close + * 2. data + * 3. end + * 4. error + * 5. pause + * 6. readable + * 7. resume + */ + addListener(event: "close", listener: () => void): this; + addListener(event: "data", listener: (chunk: any) => void): this; + addListener(event: "end", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "pause", listener: () => void): this; + addListener(event: "readable", listener: () => void): this; + addListener(event: "resume", listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "close"): boolean; + emit(event: "data", chunk: any): boolean; + emit(event: "end"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "pause"): boolean; + emit(event: "readable"): boolean; + emit(event: "resume"): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "close", listener: () => void): this; + on(event: "data", listener: (chunk: any) => void): this; + on(event: "end", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "pause", listener: () => void): this; + on(event: "readable", listener: () => void): this; + on(event: "resume", listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "close", listener: () => void): this; + once(event: "data", listener: (chunk: any) => void): this; + once(event: "end", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "pause", listener: () => void): this; + once(event: "readable", listener: () => void): this; + once(event: "resume", listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "close", listener: () => void): this; + prependListener(event: "data", listener: (chunk: any) => void): this; + prependListener(event: "end", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "pause", listener: () => void): this; + prependListener(event: "readable", listener: () => void): this; + prependListener(event: "resume", listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "data", listener: (chunk: any) => void): this; + prependOnceListener(event: "end", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "pause", listener: () => void): this; + prependOnceListener(event: "readable", listener: () => void): this; + prependOnceListener(event: "resume", listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + + removeListener(event: "close", listener: () => void): this; + removeListener(event: "data", listener: (chunk: any) => void): this; + removeListener(event: "end", listener: () => void): this; + removeListener(event: "error", listener: (err: Error) => void): this; + removeListener(event: "pause", listener: () => void): this; + removeListener(event: "readable", listener: () => void): this; + removeListener(event: "resume", listener: () => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + + [Symbol.asyncIterator](): AsyncIterableIterator; + } + + interface WritableOptions extends StreamOptions { + decodeStrings?: boolean; + defaultEncoding?: BufferEncoding; + write?(this: Writable, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + writev?(this: Writable, chunks: Array<{ chunk: any, encoding: BufferEncoding }>, callback: (error?: Error | null) => void): void; + final?(this: Writable, callback: (error?: Error | null) => void): void; + } + + class Writable extends Stream implements NodeJS.WritableStream { + readonly writable: boolean; + readonly writableEnded: boolean; + readonly writableFinished: boolean; + readonly writableHighWaterMark: number; + readonly writableLength: number; + readonly writableObjectMode: boolean; + readonly writableCorked: number; + destroyed: boolean; + constructor(opts?: WritableOptions); + _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + _writev?(chunks: Array<{ chunk: any, encoding: BufferEncoding }>, callback: (error?: Error | null) => void): void; + _construct?(callback: (error?: Error | null) => void): void; + _destroy(error: Error | null, callback: (error?: Error | null) => void): void; + _final(callback: (error?: Error | null) => void): void; + write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; + write(chunk: any, encoding: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean; + setDefaultEncoding(encoding: BufferEncoding): this; + end(cb?: () => void): void; + end(chunk: any, cb?: () => void): void; + end(chunk: any, encoding: BufferEncoding, cb?: () => void): void; + cork(): void; + uncork(): void; + destroy(error?: Error): void; + + /** + * Event emitter + * The defined events on documents including: + * 1. close + * 2. drain + * 3. error + * 4. finish + * 5. pipe + * 6. unpipe + */ + addListener(event: "close", listener: () => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "finish", listener: () => void): this; + addListener(event: "pipe", listener: (src: Readable) => void): this; + addListener(event: "unpipe", listener: (src: Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "close"): boolean; + emit(event: "drain"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "finish"): boolean; + emit(event: "pipe", src: Readable): boolean; + emit(event: "unpipe", src: Readable): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "close", listener: () => void): this; + on(event: "drain", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "finish", listener: () => void): this; + on(event: "pipe", listener: (src: Readable) => void): this; + on(event: "unpipe", listener: (src: Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "close", listener: () => void): this; + once(event: "drain", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "finish", listener: () => void): this; + once(event: "pipe", listener: (src: Readable) => void): this; + once(event: "unpipe", listener: (src: Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "close", listener: () => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "finish", listener: () => void): this; + prependListener(event: "pipe", listener: (src: Readable) => void): this; + prependListener(event: "unpipe", listener: (src: Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "finish", listener: () => void): this; + prependOnceListener(event: "pipe", listener: (src: Readable) => void): this; + prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + + removeListener(event: "close", listener: () => void): this; + removeListener(event: "drain", listener: () => void): this; + removeListener(event: "error", listener: (err: Error) => void): this; + removeListener(event: "finish", listener: () => void): this; + removeListener(event: "pipe", listener: (src: Readable) => void): this; + removeListener(event: "unpipe", listener: (src: Readable) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + interface DuplexOptions extends ReadableOptions, WritableOptions { + allowHalfOpen?: boolean; + readableObjectMode?: boolean; + writableObjectMode?: boolean; + readableHighWaterMark?: number; + writableHighWaterMark?: number; + writableCorked?: number; + construct?(this: Duplex, callback: (error?: Error | null) => void): void; + read?(this: Duplex, size: number): void; + write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + writev?(this: Duplex, chunks: Array<{ chunk: any, encoding: BufferEncoding }>, callback: (error?: Error | null) => void): void; + final?(this: Duplex, callback: (error?: Error | null) => void): void; + destroy?(this: Duplex, error: Error | null, callback: (error: Error | null) => void): void; + } + + // Note: Duplex extends both Readable and Writable. + class Duplex extends Readable implements Writable { + readonly writable: boolean; + readonly writableEnded: boolean; + readonly writableFinished: boolean; + readonly writableHighWaterMark: number; + readonly writableLength: number; + readonly writableObjectMode: boolean; + readonly writableCorked: number; + constructor(opts?: DuplexOptions); + _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + _writev?(chunks: Array<{ chunk: any, encoding: BufferEncoding }>, callback: (error?: Error | null) => void): void; + _destroy(error: Error | null, callback: (error: Error | null) => void): void; + _final(callback: (error?: Error | null) => void): void; + write(chunk: any, encoding?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean; + write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; + setDefaultEncoding(encoding: BufferEncoding): this; + end(cb?: () => void): void; + end(chunk: any, cb?: () => void): void; + end(chunk: any, encoding?: BufferEncoding, cb?: () => void): void; + cork(): void; + uncork(): void; + } + + type TransformCallback = (error?: Error | null, data?: any) => void; + + interface TransformOptions extends DuplexOptions { + construct?(this: Transform, callback: (error?: Error | null) => void): void; + read?(this: Transform, size: number): void; + write?(this: Transform, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + writev?(this: Transform, chunks: Array<{ chunk: any, encoding: BufferEncoding }>, callback: (error?: Error | null) => void): void; + final?(this: Transform, callback: (error?: Error | null) => void): void; + destroy?(this: Transform, error: Error | null, callback: (error: Error | null) => void): void; + transform?(this: Transform, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; + flush?(this: Transform, callback: TransformCallback): void; + } + + class Transform extends Duplex { + constructor(opts?: TransformOptions); + _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; + _flush(callback: TransformCallback): void; + } + + class PassThrough extends Transform { } + + /** + * Attaches an AbortSignal to a readable or writeable stream. This lets code + * control stream destruction using an `AbortController`. + * + * Calling `abort` on the `AbortController` corresponding to the passed + * `AbortSignal` will behave the same way as calling `.destroy(new AbortError())` + * on the stream. + */ + function addAbortSignal(signal: AbortSignal, stream: T): T; + + interface FinishedOptions { + error?: boolean; + readable?: boolean; + writable?: boolean; + } + function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options: FinishedOptions, callback: (err?: NodeJS.ErrnoException | null) => void): () => void; + function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, callback: (err?: NodeJS.ErrnoException | null) => void): () => void; + namespace finished { + function __promisify__(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise; + } + + type PipelineSourceFunction = () => Iterable | AsyncIterable; + type PipelineSource = Iterable | AsyncIterable | NodeJS.ReadableStream | PipelineSourceFunction; + type PipelineTransform, U> = + NodeJS.ReadWriteStream | + ((source: S extends (...args: any[]) => Iterable | AsyncIterable ? + AsyncIterable : S) => AsyncIterable); + type PipelineTransformSource = PipelineSource | PipelineTransform; + + type PipelineDestinationIterableFunction = (source: AsyncIterable) => AsyncIterable; + type PipelineDestinationPromiseFunction = (source: AsyncIterable) => Promise

; + + type PipelineDestination, P> = + S extends PipelineTransformSource ? + (NodeJS.WritableStream | PipelineDestinationIterableFunction | PipelineDestinationPromiseFunction) : never; + type PipelineCallback> = + S extends PipelineDestinationPromiseFunction ? (err: NodeJS.ErrnoException | null, value: P) => void : + (err: NodeJS.ErrnoException | null) => void; + type PipelinePromise> = + S extends PipelineDestinationPromiseFunction ? Promise

: Promise; + interface PipelineOptions { + signal: AbortSignal; + } + + function pipeline, + B extends PipelineDestination>( + source: A, + destination: B, + callback?: PipelineCallback + ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline, + T1 extends PipelineTransform, + B extends PipelineDestination>( + source: A, + transform1: T1, + destination: B, + callback?: PipelineCallback + ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + B extends PipelineDestination>( + source: A, + transform1: T1, + transform2: T2, + destination: B, + callback?: PipelineCallback + ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + B extends PipelineDestination>( + source: A, + transform1: T1, + transform2: T2, + transform3: T3, + destination: B, + callback?: PipelineCallback + ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + T4 extends PipelineTransform, + B extends PipelineDestination>( + source: A, + transform1: T1, + transform2: T2, + transform3: T3, + transform4: T4, + destination: B, + callback?: PipelineCallback + ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline( + streams: ReadonlyArray, + callback?: (err: NodeJS.ErrnoException | null) => void, + ): NodeJS.WritableStream; + function pipeline( + stream1: NodeJS.ReadableStream, + stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, + ...streams: Array void)>, + ): NodeJS.WritableStream; + namespace pipeline { + function __promisify__, + B extends PipelineDestination>( + source: A, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function __promisify__, + T1 extends PipelineTransform, + B extends PipelineDestination>( + source: A, + transform1: T1, + destination: B, + options?: PipelineOptions, + ): PipelinePromise; + function __promisify__, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + B extends PipelineDestination>( + source: A, + transform1: T1, + transform2: T2, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function __promisify__, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + B extends PipelineDestination>( + source: A, + transform1: T1, + transform2: T2, + transform3: T3, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function __promisify__, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + T4 extends PipelineTransform, + B extends PipelineDestination>( + source: A, + transform1: T1, + transform2: T2, + transform3: T3, + transform4: T4, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + + function __promisify__( + streams: ReadonlyArray, + options?: PipelineOptions + ): Promise; + function __promisify__( + stream1: NodeJS.ReadableStream, + stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, + ...streams: Array, + ): Promise; + } + + interface Pipe { + close(): void; + hasRef(): boolean; + ref(): void; + unref(): void; + } + + const promises: typeof streamPromises; + } + + export = internal; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/stream/promises.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/stream/promises.d.ts new file mode 100755 index 000000000..7c704232f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/stream/promises.d.ts @@ -0,0 +1,67 @@ +declare module "stream/promises" { + import { FinishedOptions, PipelineSource, PipelineTransform, + PipelineDestination, PipelinePromise, PipelineOptions } from "stream"; + + function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise; + + function pipeline, + B extends PipelineDestination>( + source: A, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function pipeline, + T1 extends PipelineTransform, + B extends PipelineDestination>( + source: A, + transform1: T1, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function pipeline, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + B extends PipelineDestination>( + source: A, + transform1: T1, + transform2: T2, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function pipeline, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + B extends PipelineDestination>( + source: A, + transform1: T1, + transform2: T2, + transform3: T3, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function pipeline, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + T4 extends PipelineTransform, + B extends PipelineDestination>( + source: A, + transform1: T1, + transform2: T2, + transform3: T3, + transform4: T4, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + + function pipeline( + streams: ReadonlyArray, + options?: PipelineOptions + ): Promise; + function pipeline( + stream1: NodeJS.ReadableStream, + stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, + ...streams: Array, + ): Promise; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/string_decoder.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/string_decoder.d.ts new file mode 100755 index 000000000..c7ace1c12 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/string_decoder.d.ts @@ -0,0 +1,7 @@ +declare module 'string_decoder' { + class StringDecoder { + constructor(encoding?: BufferEncoding); + write(buffer: Buffer): string; + end(buffer?: Buffer): string; + } +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/timers.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/timers.d.ts new file mode 100755 index 000000000..6c1924043 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/timers.d.ts @@ -0,0 +1,30 @@ +declare module 'timers' { + interface TimerOptions { + /** + * Set to `false` to indicate that the scheduled `Timeout` + * should not require the Node.js event loop to remain active. + * @default true + */ + ref?: boolean; + + /** + * An optional `AbortSignal` that can be used to cancel the scheduled `Timeout`. + */ + signal?: AbortSignal; + } + + function setTimeout(callback: (...args: any[]) => void, ms?: number, ...args: any[]): NodeJS.Timeout; + namespace setTimeout { + function __promisify__(ms: number): Promise; + function __promisify__(ms: number, value: T, options?: TimerOptions): Promise; + } + function clearTimeout(timeoutId: NodeJS.Timeout): void; + function setInterval(callback: (...args: any[]) => void, ms?: number, ...args: any[]): NodeJS.Timeout; + function clearInterval(intervalId: NodeJS.Timeout): void; + function setImmediate(callback: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate; + namespace setImmediate { + function __promisify__(): Promise; + function __promisify__(value: T, options?: TimerOptions): Promise; + } + function clearImmediate(immediateId: NodeJS.Immediate): void; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/timers/promises.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/timers/promises.d.ts new file mode 100755 index 000000000..1c04f50a3 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/timers/promises.d.ts @@ -0,0 +1,13 @@ +declare module 'timers/promises' { + import { TimerOptions } from 'timers'; + + /** + * Returns a promise that resolves after the specified delay in milliseconds. + */ + function setTimeout(delay: number, value?: T, options?: TimerOptions): Promise; + + /** + * Returns a promise that resolves in the next tick. + */ + function setImmediate(value: T, options?: TimerOptions): Promise; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/tls.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/tls.d.ts new file mode 100755 index 000000000..b2f50a41d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/tls.d.ts @@ -0,0 +1,782 @@ +declare module 'tls' { + import * as net from 'net'; + + const CLIENT_RENEG_LIMIT: number; + const CLIENT_RENEG_WINDOW: number; + + interface Certificate { + /** + * Country code. + */ + C: string; + /** + * Street. + */ + ST: string; + /** + * Locality. + */ + L: string; + /** + * Organization. + */ + O: string; + /** + * Organizational unit. + */ + OU: string; + /** + * Common name. + */ + CN: string; + } + + interface PeerCertificate { + subject: Certificate; + issuer: Certificate; + subjectaltname: string; + infoAccess: NodeJS.Dict; + modulus: string; + exponent: string; + valid_from: string; + valid_to: string; + fingerprint: string; + fingerprint256: string; + ext_key_usage: string[]; + serialNumber: string; + raw: Buffer; + } + + interface DetailedPeerCertificate extends PeerCertificate { + issuerCertificate: DetailedPeerCertificate; + } + + interface CipherNameAndProtocol { + /** + * The cipher name. + */ + name: string; + /** + * SSL/TLS protocol version. + */ + version: string; + + /** + * IETF name for the cipher suite. + */ + standardName: string; + } + + interface EphemeralKeyInfo { + /** + * The supported types are 'DH' and 'ECDH'. + */ + type: string; + /** + * The name property is available only when type is 'ECDH'. + */ + name?: string; + /** + * The size of parameter of an ephemeral key exchange. + */ + size: number; + } + + interface KeyObject { + /** + * Private keys in PEM format. + */ + pem: string | Buffer; + /** + * Optional passphrase. + */ + passphrase?: string; + } + + interface PxfObject { + /** + * PFX or PKCS12 encoded private key and certificate chain. + */ + buf: string | Buffer; + /** + * Optional passphrase. + */ + passphrase?: string; + } + + interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions { + /** + * If true the TLS socket will be instantiated in server-mode. + * Defaults to false. + */ + isServer?: boolean; + /** + * An optional net.Server instance. + */ + server?: net.Server; + + /** + * An optional Buffer instance containing a TLS session. + */ + session?: Buffer; + /** + * If true, specifies that the OCSP status request extension will be + * added to the client hello and an 'OCSPResponse' event will be + * emitted on the socket before establishing a secure communication + */ + requestOCSP?: boolean; + } + + class TLSSocket extends net.Socket { + /** + * Construct a new tls.TLSSocket object from an existing TCP socket. + */ + constructor(socket: net.Socket, options?: TLSSocketOptions); + + /** + * A boolean that is true if the peer certificate was signed by one of the specified CAs, otherwise false. + */ + authorized: boolean; + /** + * The reason why the peer's certificate has not been verified. + * This property becomes available only when tlsSocket.authorized === false. + */ + authorizationError: Error; + /** + * Static boolean value, always true. + * May be used to distinguish TLS sockets from regular ones. + */ + encrypted: boolean; + + /** + * String containing the selected ALPN protocol. + * When ALPN has no selected protocol, tlsSocket.alpnProtocol equals false. + */ + alpnProtocol?: string; + + /** + * Returns an object representing the local certificate. The returned + * object has some properties corresponding to the fields of the + * certificate. + * + * See tls.TLSSocket.getPeerCertificate() for an example of the + * certificate structure. + * + * If there is no local certificate, an empty object will be returned. + * If the socket has been destroyed, null will be returned. + */ + getCertificate(): PeerCertificate | object | null; + /** + * Returns an object representing the cipher name and the SSL/TLS protocol version of the current connection. + * @returns Returns an object representing the cipher name + * and the SSL/TLS protocol version of the current connection. + */ + getCipher(): CipherNameAndProtocol; + /** + * Returns an object representing the type, name, and size of parameter + * of an ephemeral key exchange in Perfect Forward Secrecy on a client + * connection. It returns an empty object when the key exchange is not + * ephemeral. As this is only supported on a client socket; null is + * returned if called on a server socket. The supported types are 'DH' + * and 'ECDH'. The name property is available only when type is 'ECDH'. + * + * For example: { type: 'ECDH', name: 'prime256v1', size: 256 }. + */ + getEphemeralKeyInfo(): EphemeralKeyInfo | object | null; + /** + * Returns the latest Finished message that has + * been sent to the socket as part of a SSL/TLS handshake, or undefined + * if no Finished message has been sent yet. + * + * As the Finished messages are message digests of the complete + * handshake (with a total of 192 bits for TLS 1.0 and more for SSL + * 3.0), they can be used for external authentication procedures when + * the authentication provided by SSL/TLS is not desired or is not + * enough. + * + * Corresponds to the SSL_get_finished routine in OpenSSL and may be + * used to implement the tls-unique channel binding from RFC 5929. + */ + getFinished(): Buffer | undefined; + /** + * Returns an object representing the peer's certificate. + * The returned object has some properties corresponding to the field of the certificate. + * If detailed argument is true the full chain with issuer property will be returned, + * if false only the top certificate without issuer property. + * If the peer does not provide a certificate, it returns null or an empty object. + * @param detailed - If true; the full chain with issuer property will be returned. + * @returns An object representing the peer's certificate. + */ + getPeerCertificate(detailed: true): DetailedPeerCertificate; + getPeerCertificate(detailed?: false): PeerCertificate; + getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate; + /** + * Returns the latest Finished message that is expected or has actually + * been received from the socket as part of a SSL/TLS handshake, or + * undefined if there is no Finished message so far. + * + * As the Finished messages are message digests of the complete + * handshake (with a total of 192 bits for TLS 1.0 and more for SSL + * 3.0), they can be used for external authentication procedures when + * the authentication provided by SSL/TLS is not desired or is not + * enough. + * + * Corresponds to the SSL_get_peer_finished routine in OpenSSL and may + * be used to implement the tls-unique channel binding from RFC 5929. + */ + getPeerFinished(): Buffer | undefined; + /** + * Returns a string containing the negotiated SSL/TLS protocol version of the current connection. + * The value `'unknown'` will be returned for connected sockets that have not completed the handshaking process. + * The value `null` will be returned for server sockets or disconnected client sockets. + * See https://www.openssl.org/docs/man1.0.2/ssl/SSL_get_version.html for more information. + * @returns negotiated SSL/TLS protocol version of the current connection + */ + getProtocol(): string | null; + /** + * Could be used to speed up handshake establishment when reconnecting to the server. + * @returns ASN.1 encoded TLS session or undefined if none was negotiated. + */ + getSession(): Buffer | undefined; + /** + * Returns a list of signature algorithms shared between the server and + * the client in the order of decreasing preference. + */ + getSharedSigalgs(): string[]; + /** + * NOTE: Works only with client TLS sockets. + * Useful only for debugging, for session reuse provide session option to tls.connect(). + * @returns TLS session ticket or undefined if none was negotiated. + */ + getTLSTicket(): Buffer | undefined; + /** + * Returns true if the session was reused, false otherwise. + */ + isSessionReused(): boolean; + /** + * Initiate TLS renegotiation process. + * + * NOTE: Can be used to request peer's certificate after the secure connection has been established. + * ANOTHER NOTE: When running as the server, socket will be destroyed with an error after handshakeTimeout timeout. + * @param options - The options may contain the following fields: rejectUnauthorized, + * requestCert (See tls.createServer() for details). + * @param callback - callback(err) will be executed with null as err, once the renegotiation + * is successfully completed. + * @return `undefined` when socket is destroy, `false` if negotiaion can't be initiated. + */ + renegotiate(options: { rejectUnauthorized?: boolean, requestCert?: boolean }, callback: (err: Error | null) => void): undefined | boolean; + /** + * Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512). + * Smaller fragment size decreases buffering latency on the client: large fragments are buffered by + * the TLS layer until the entire fragment is received and its integrity is verified; + * large fragments can span multiple roundtrips, and their processing can be delayed due to packet + * loss or reordering. However, smaller fragments add extra TLS framing bytes and CPU overhead, + * which may decrease overall server throughput. + * @param size - TLS fragment size (default and maximum value is: 16384, minimum is: 512). + * @returns Returns true on success, false otherwise. + */ + setMaxSendFragment(size: number): boolean; + + /** + * Disables TLS renegotiation for this TLSSocket instance. Once called, + * attempts to renegotiate will trigger an 'error' event on the + * TLSSocket. + */ + disableRenegotiation(): void; + + /** + * When enabled, TLS packet trace information is written to `stderr`. This can be + * used to debug TLS connection problems. + * + * Note: The format of the output is identical to the output of `openssl s_client + * -trace` or `openssl s_server -trace`. While it is produced by OpenSSL's + * `SSL_trace()` function, the format is undocumented, can change without notice, + * and should not be relied on. + */ + enableTrace(): void; + + /** + * @param length number of bytes to retrieve from keying material + * @param label an application specific label, typically this will be a value from the + * [IANA Exporter Label Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels). + * @param context optionally provide a context. + */ + exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer; + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; + addListener(event: "secureConnect", listener: () => void): this; + addListener(event: "session", listener: (session: Buffer) => void): this; + addListener(event: "keylog", listener: (line: Buffer) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "OCSPResponse", response: Buffer): boolean; + emit(event: "secureConnect"): boolean; + emit(event: "session", session: Buffer): boolean; + emit(event: "keylog", line: Buffer): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "OCSPResponse", listener: (response: Buffer) => void): this; + on(event: "secureConnect", listener: () => void): this; + on(event: "session", listener: (session: Buffer) => void): this; + on(event: "keylog", listener: (line: Buffer) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "OCSPResponse", listener: (response: Buffer) => void): this; + once(event: "secureConnect", listener: () => void): this; + once(event: "session", listener: (session: Buffer) => void): this; + once(event: "keylog", listener: (line: Buffer) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; + prependListener(event: "secureConnect", listener: () => void): this; + prependListener(event: "session", listener: (session: Buffer) => void): this; + prependListener(event: "keylog", listener: (line: Buffer) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; + prependOnceListener(event: "secureConnect", listener: () => void): this; + prependOnceListener(event: "session", listener: (session: Buffer) => void): this; + prependOnceListener(event: "keylog", listener: (line: Buffer) => void): this; + } + + interface CommonConnectionOptions { + /** + * An optional TLS context object from tls.createSecureContext() + */ + secureContext?: SecureContext; + + /** + * When enabled, TLS packet trace information is written to `stderr`. This can be + * used to debug TLS connection problems. + * @default false + */ + enableTrace?: boolean; + /** + * If true the server will request a certificate from clients that + * connect and attempt to verify that certificate. Defaults to + * false. + */ + requestCert?: boolean; + /** + * An array of strings or a Buffer naming possible ALPN protocols. + * (Protocols should be ordered by their priority.) + */ + ALPNProtocols?: string[] | Uint8Array[] | Uint8Array; + /** + * SNICallback(servername, cb) A function that will be + * called if the client supports SNI TLS extension. Two arguments + * will be passed when called: servername and cb. SNICallback should + * invoke cb(null, ctx), where ctx is a SecureContext instance. + * (tls.createSecureContext(...) can be used to get a proper + * SecureContext.) If SNICallback wasn't provided the default callback + * with high-level API will be used (see below). + */ + SNICallback?: (servername: string, cb: (err: Error | null, ctx: SecureContext) => void) => void; + /** + * If true the server will reject any connection which is not + * authorized with the list of supplied CAs. This option only has an + * effect if requestCert is true. + * @default true + */ + rejectUnauthorized?: boolean; + } + + interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts { + /** + * Abort the connection if the SSL/TLS handshake does not finish in the + * specified number of milliseconds. A 'tlsClientError' is emitted on + * the tls.Server object whenever a handshake times out. Default: + * 120000 (120 seconds). + */ + handshakeTimeout?: number; + /** + * The number of seconds after which a TLS session created by the + * server will no longer be resumable. See Session Resumption for more + * information. Default: 300. + */ + sessionTimeout?: number; + /** + * 48-bytes of cryptographically strong pseudo-random data. + */ + ticketKeys?: Buffer; + + /** + * + * @param socket + * @param identity identity parameter sent from the client. + * @return pre-shared key that must either be + * a buffer or `null` to stop the negotiation process. Returned PSK must be + * compatible with the selected cipher's digest. + * + * When negotiating TLS-PSK (pre-shared keys), this function is called + * with the identity provided by the client. + * If the return value is `null` the negotiation process will stop and an + * "unknown_psk_identity" alert message will be sent to the other party. + * If the server wishes to hide the fact that the PSK identity was not known, + * the callback must provide some random data as `psk` to make the connection + * fail with "decrypt_error" before negotiation is finished. + * PSK ciphers are disabled by default, and using TLS-PSK thus + * requires explicitly specifying a cipher suite with the `ciphers` option. + * More information can be found in the RFC 4279. + */ + + pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null; + /** + * hint to send to a client to help + * with selecting the identity during TLS-PSK negotiation. Will be ignored + * in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be + * emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code. + */ + pskIdentityHint?: string; + } + + interface PSKCallbackNegotation { + psk: DataView | NodeJS.TypedArray; + identity: string; + } + + interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions { + host?: string; + port?: number; + path?: string; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored. + socket?: net.Socket; // Establish secure connection on a given socket rather than creating a new socket + checkServerIdentity?: typeof checkServerIdentity; + servername?: string; // SNI TLS Extension + session?: Buffer; + minDHSize?: number; + lookup?: net.LookupFunction; + timeout?: number; + /** + * When negotiating TLS-PSK (pre-shared keys), this function is called + * with optional identity `hint` provided by the server or `null` + * in case of TLS 1.3 where `hint` was removed. + * It will be necessary to provide a custom `tls.checkServerIdentity()` + * for the connection as the default one will try to check hostname/IP + * of the server against the certificate but that's not applicable for PSK + * because there won't be a certificate present. + * More information can be found in the RFC 4279. + * + * @param hint message sent from the server to help client + * decide which identity to use during negotiation. + * Always `null` if TLS 1.3 is used. + * @returns Return `null` to stop the negotiation process. `psk` must be + * compatible with the selected cipher's digest. + * `identity` must use UTF-8 encoding. + */ + pskCallback?(hint: string | null): PSKCallbackNegotation | null; + } + + class Server extends net.Server { + constructor(secureConnectionListener?: (socket: TLSSocket) => void); + constructor(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void); + + /** + * The server.addContext() method adds a secure context that will be + * used if the client request's SNI name matches the supplied hostname + * (or wildcard). + */ + addContext(hostName: string, credentials: SecureContextOptions): void; + /** + * Returns the session ticket keys. + */ + getTicketKeys(): Buffer; + /** + * + * The server.setSecureContext() method replaces the + * secure context of an existing server. Existing connections to the + * server are not interrupted. + */ + setSecureContext(details: SecureContextOptions): void; + /** + * The server.setSecureContext() method replaces the secure context of + * an existing server. Existing connections to the server are not + * interrupted. + */ + setTicketKeys(keys: Buffer): void; + + /** + * events.EventEmitter + * 1. tlsClientError + * 2. newSession + * 3. OCSPRequest + * 4. resumeSession + * 5. secureConnection + * 6. keylog + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + addListener(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; + addListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + addListener(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; + addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + addListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean; + emit(event: "newSession", sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void): boolean; + emit(event: "OCSPRequest", certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void): boolean; + emit(event: "resumeSession", sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean; + emit(event: "secureConnection", tlsSocket: TLSSocket): boolean; + emit(event: "keylog", line: Buffer, tlsSocket: TLSSocket): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + on(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; + on(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + on(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; + on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + on(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + once(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; + once(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + once(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; + once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + once(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + prependListener(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; + prependListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + prependListener(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; + prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + prependOnceListener(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; + prependOnceListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + prependOnceListener(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; + prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + } + + /** + * @deprecated since v0.11.3 Use `tls.TLSSocket` instead. + */ + interface SecurePair { + encrypted: TLSSocket; + cleartext: TLSSocket; + } + + type SecureVersion = 'TLSv1.3' | 'TLSv1.2' | 'TLSv1.1' | 'TLSv1'; + + interface SecureContextOptions { + /** + * Optionally override the trusted CA certificates. Default is to trust + * the well-known CAs curated by Mozilla. Mozilla's CAs are completely + * replaced when CAs are explicitly specified using this option. + */ + ca?: string | Buffer | Array; + /** + * Cert chains in PEM format. One cert chain should be provided per + * private key. Each cert chain should consist of the PEM formatted + * certificate for a provided private key, followed by the PEM + * formatted intermediate certificates (if any), in order, and not + * including the root CA (the root CA must be pre-known to the peer, + * see ca). When providing multiple cert chains, they do not have to + * be in the same order as their private keys in key. If the + * intermediate certificates are not provided, the peer will not be + * able to validate the certificate, and the handshake will fail. + */ + cert?: string | Buffer | Array; + /** + * Colon-separated list of supported signature algorithms. The list + * can contain digest algorithms (SHA256, MD5 etc.), public key + * algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g + * 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512). + */ + sigalgs?: string; + /** + * Cipher suite specification, replacing the default. For more + * information, see modifying the default cipher suite. Permitted + * ciphers can be obtained via tls.getCiphers(). Cipher names must be + * uppercased in order for OpenSSL to accept them. + */ + ciphers?: string; + /** + * Name of an OpenSSL engine which can provide the client certificate. + */ + clientCertEngine?: string; + /** + * PEM formatted CRLs (Certificate Revocation Lists). + */ + crl?: string | Buffer | Array; + /** + * Diffie Hellman parameters, required for Perfect Forward Secrecy. Use + * openssl dhparam to create the parameters. The key length must be + * greater than or equal to 1024 bits or else an error will be thrown. + * Although 1024 bits is permissible, use 2048 bits or larger for + * stronger security. If omitted or invalid, the parameters are + * silently discarded and DHE ciphers will not be available. + */ + dhparam?: string | Buffer; + /** + * A string describing a named curve or a colon separated list of curve + * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key + * agreement. Set to auto to select the curve automatically. Use + * crypto.getCurves() to obtain a list of available curve names. On + * recent releases, openssl ecparam -list_curves will also display the + * name and description of each available elliptic curve. Default: + * tls.DEFAULT_ECDH_CURVE. + */ + ecdhCurve?: string; + /** + * Attempt to use the server's cipher suite preferences instead of the + * client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be + * set in secureOptions + */ + honorCipherOrder?: boolean; + /** + * Private keys in PEM format. PEM allows the option of private keys + * being encrypted. Encrypted keys will be decrypted with + * options.passphrase. Multiple keys using different algorithms can be + * provided either as an array of unencrypted key strings or buffers, + * or an array of objects in the form {pem: [, + * passphrase: ]}. The object form can only occur in an array. + * object.passphrase is optional. Encrypted keys will be decrypted with + * object.passphrase if provided, or options.passphrase if it is not. + */ + key?: string | Buffer | Array; + /** + * Name of an OpenSSL engine to get private key from. Should be used + * together with privateKeyIdentifier. + */ + privateKeyEngine?: string; + /** + * Identifier of a private key managed by an OpenSSL engine. Should be + * used together with privateKeyEngine. Should not be set together with + * key, because both options define a private key in different ways. + */ + privateKeyIdentifier?: string; + /** + * Optionally set the maximum TLS version to allow. One + * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the + * `secureProtocol` option, use one or the other. + * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using + * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to + * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used. + */ + maxVersion?: SecureVersion; + /** + * Optionally set the minimum TLS version to allow. One + * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the + * `secureProtocol` option, use one or the other. It is not recommended to use + * less than TLSv1.2, but it may be required for interoperability. + * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using + * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to + * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to + * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used. + */ + minVersion?: SecureVersion; + /** + * Shared passphrase used for a single private key and/or a PFX. + */ + passphrase?: string; + /** + * PFX or PKCS12 encoded private key and certificate chain. pfx is an + * alternative to providing key and cert individually. PFX is usually + * encrypted, if it is, passphrase will be used to decrypt it. Multiple + * PFX can be provided either as an array of unencrypted PFX buffers, + * or an array of objects in the form {buf: [, + * passphrase: ]}. The object form can only occur in an array. + * object.passphrase is optional. Encrypted PFX will be decrypted with + * object.passphrase if provided, or options.passphrase if it is not. + */ + pfx?: string | Buffer | Array; + /** + * Optionally affect the OpenSSL protocol behavior, which is not + * usually necessary. This should be used carefully if at all! Value is + * a numeric bitmask of the SSL_OP_* options from OpenSSL Options + */ + secureOptions?: number; // Value is a numeric bitmask of the `SSL_OP_*` options + /** + * Legacy mechanism to select the TLS protocol version to use, it does + * not support independent control of the minimum and maximum version, + * and does not support limiting the protocol to TLSv1.3. Use + * minVersion and maxVersion instead. The possible values are listed as + * SSL_METHODS, use the function names as strings. For example, use + * 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow + * any TLS protocol version up to TLSv1.3. It is not recommended to use + * TLS versions less than 1.2, but it may be required for + * interoperability. Default: none, see minVersion. + */ + secureProtocol?: string; + /** + * Opaque identifier used by servers to ensure session state is not + * shared between applications. Unused by clients. + */ + sessionIdContext?: string; + /** + * 48-bytes of cryptographically strong pseudo-random data. + * See Session Resumption for more information. + */ + ticketKeys?: Buffer; + /** + * The number of seconds after which a TLS session created by the + * server will no longer be resumable. See Session Resumption for more + * information. Default: 300. + */ + sessionTimeout?: number; + } + + interface SecureContext { + context: any; + } + + /* + * Verifies the certificate `cert` is issued to host `host`. + * @host The hostname to verify the certificate against + * @cert PeerCertificate representing the peer's certificate + * + * Returns Error object, populating it with the reason, host and cert on failure. On success, returns undefined. + */ + function checkServerIdentity(host: string, cert: PeerCertificate): Error | undefined; + function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server; + function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; + function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + /** + * @deprecated since v0.11.3 Use `tls.TLSSocket` instead. + */ + function createSecurePair(credentials?: SecureContext, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; + function createSecureContext(options?: SecureContextOptions): SecureContext; + function getCiphers(): string[]; + + /** + * The default curve name to use for ECDH key agreement in a tls server. + * The default value is 'auto'. See tls.createSecureContext() for further + * information. + */ + let DEFAULT_ECDH_CURVE: string; + /** + * The default value of the maxVersion option of + * tls.createSecureContext(). It can be assigned any of the supported TLS + * protocol versions, 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: + * 'TLSv1.3', unless changed using CLI options. Using --tls-max-v1.2 sets + * the default to 'TLSv1.2'. Using --tls-max-v1.3 sets the default to + * 'TLSv1.3'. If multiple of the options are provided, the highest maximum + * is used. + */ + let DEFAULT_MAX_VERSION: SecureVersion; + /** + * The default value of the minVersion option of tls.createSecureContext(). + * It can be assigned any of the supported TLS protocol versions, + * 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: 'TLSv1.2', unless + * changed using CLI options. Using --tls-min-v1.0 sets the default to + * 'TLSv1'. Using --tls-min-v1.1 sets the default to 'TLSv1.1'. Using + * --tls-min-v1.3 sets the default to 'TLSv1.3'. If multiple of the options + * are provided, the lowest minimum is used. + */ + let DEFAULT_MIN_VERSION: SecureVersion; + + /** + * An immutable array of strings representing the root certificates (in PEM + * format) used for verifying peer certificates. This is the default value + * of the ca option to tls.createSecureContext(). + */ + const rootCertificates: ReadonlyArray; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/trace_events.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/trace_events.d.ts new file mode 100755 index 000000000..1bf653458 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/trace_events.d.ts @@ -0,0 +1,61 @@ +declare module 'trace_events' { + /** + * The `Tracing` object is used to enable or disable tracing for sets of + * categories. Instances are created using the + * `trace_events.createTracing()` method. + * + * When created, the `Tracing` object is disabled. Calling the + * `tracing.enable()` method adds the categories to the set of enabled trace + * event categories. Calling `tracing.disable()` will remove the categories + * from the set of enabled trace event categories. + */ + interface Tracing { + /** + * A comma-separated list of the trace event categories covered by this + * `Tracing` object. + */ + readonly categories: string; + + /** + * Disables this `Tracing` object. + * + * Only trace event categories _not_ covered by other enabled `Tracing` + * objects and _not_ specified by the `--trace-event-categories` flag + * will be disabled. + */ + disable(): void; + + /** + * Enables this `Tracing` object for the set of categories covered by + * the `Tracing` object. + */ + enable(): void; + + /** + * `true` only if the `Tracing` object has been enabled. + */ + readonly enabled: boolean; + } + + interface CreateTracingOptions { + /** + * An array of trace category names. Values included in the array are + * coerced to a string when possible. An error will be thrown if the + * value cannot be coerced. + */ + categories: string[]; + } + + /** + * Creates and returns a Tracing object for the given set of categories. + */ + function createTracing(options: CreateTracingOptions): Tracing; + + /** + * Returns a comma-separated list of all currently-enabled trace event + * categories. The current set of enabled trace event categories is + * determined by the union of all currently-enabled `Tracing` objects and + * any categories enabled using the `--trace-event-categories` flag. + */ + function getEnabledCategories(): string | undefined; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/ts3.6/assert.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/ts3.6/assert.d.ts new file mode 100755 index 000000000..37e24f5c1 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/ts3.6/assert.d.ts @@ -0,0 +1,98 @@ +declare module 'assert' { + /** An alias of `assert.ok()`. */ + function assert(value: any, message?: string | Error): void; + namespace assert { + class AssertionError extends Error { + actual: any; + expected: any; + operator: string; + generatedMessage: boolean; + code: 'ERR_ASSERTION'; + + constructor(options?: { + /** If provided, the error message is set to this value. */ + message?: string; + /** The `actual` property on the error instance. */ + actual?: any; + /** The `expected` property on the error instance. */ + expected?: any; + /** The `operator` property on the error instance. */ + operator?: string; + /** If provided, the generated stack trace omits frames before this function. */ + // tslint:disable-next-line:ban-types + stackStartFn?: Function; + }); + } + + class CallTracker { + calls(exact?: number): () => void; + calls any>(fn?: Func, exact?: number): Func; + report(): CallTrackerReportInformation[]; + verify(): void; + } + interface CallTrackerReportInformation { + message: string; + /** The actual number of times the function was called. */ + actual: number; + /** The number of times the function was expected to be called. */ + expected: number; + /** The name of the function that is wrapped. */ + operator: string; + /** A stack trace of the function. */ + stack: object; + } + + type AssertPredicate = RegExp | (new () => object) | ((thrown: any) => boolean) | object | Error; + + function fail(message?: string | Error): never; + /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */ + function fail( + actual: any, + expected: any, + message?: string | Error, + operator?: string, + // tslint:disable-next-line:ban-types + stackStartFn?: Function, + ): never; + function ok(value: any, message?: string | Error): void; + /** @deprecated since v9.9.0 - use strictEqual() instead. */ + function equal(actual: any, expected: any, message?: string | Error): void; + /** @deprecated since v9.9.0 - use notStrictEqual() instead. */ + function notEqual(actual: any, expected: any, message?: string | Error): void; + /** @deprecated since v9.9.0 - use deepStrictEqual() instead. */ + function deepEqual(actual: any, expected: any, message?: string | Error): void; + /** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */ + function notDeepEqual(actual: any, expected: any, message?: string | Error): void; + function strictEqual(actual: any, expected: any, message?: string | Error): void; + function notStrictEqual(actual: any, expected: any, message?: string | Error): void; + function deepStrictEqual(actual: any, expected: any, message?: string | Error): void; + function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void; + + function throws(block: () => any, message?: string | Error): void; + function throws(block: () => any, error: AssertPredicate, message?: string | Error): void; + function doesNotThrow(block: () => any, message?: string | Error): void; + function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void; + + function ifError(value: any): void; + + function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise; + function rejects( + block: (() => Promise) | Promise, + error: AssertPredicate, + message?: string | Error, + ): Promise; + function doesNotReject(block: (() => Promise) | Promise, message?: string | Error): Promise; + function doesNotReject( + block: (() => Promise) | Promise, + error: AssertPredicate, + message?: string | Error, + ): Promise; + + function match(value: string, regExp: RegExp, message?: string | Error): void; + function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void; + + const strict: typeof assert; + } + + export = assert; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/ts3.6/base.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/ts3.6/base.d.ts new file mode 100755 index 000000000..81ce877f8 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/ts3.6/base.d.ts @@ -0,0 +1,68 @@ +// NOTE: These definitions support NodeJS and TypeScript 3.6 and earlier. + +// NOTE: TypeScript version-specific augmentations can be found in the following paths: +// - ~/base.d.ts - Shared definitions common to all TypeScript versions +// - ~/index.d.ts - Definitions specific to TypeScript 3.7 and above +// - ~/ts3.5/base.d.ts - Definitions specific to TypeScript 3.6 and earlier +// - ~/ts3.5/index.d.ts - Definitions specific to TypeScript 3.6 and earlier with assert pulled in + +// Reference required types from the default lib: +/// +/// +/// +/// + +// Base definitions for all NodeJS modules that are not specific to any version of TypeScript: +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// + +// TypeScript 3.5-specific augmentations: +/// + +// TypeScript 3.5-specific augmentations: +/// diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/ts3.6/index.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/ts3.6/index.d.ts new file mode 100755 index 000000000..e34d7e5ed --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/ts3.6/index.d.ts @@ -0,0 +1,7 @@ +// NOTE: These definitions support NodeJS and TypeScript 3.5 - 3.6. +// This is required to enable typing assert in ts3.7 without causing errors +// Typically type modifications should be made in base.d.ts instead of here + +/// + +/// diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/tty.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/tty.d.ts new file mode 100755 index 000000000..093552413 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/tty.d.ts @@ -0,0 +1,66 @@ +declare module 'tty' { + import * as net from 'net'; + + function isatty(fd: number): boolean; + class ReadStream extends net.Socket { + constructor(fd: number, options?: net.SocketConstructorOpts); + isRaw: boolean; + setRawMode(mode: boolean): this; + isTTY: boolean; + } + /** + * -1 - to the left from cursor + * 0 - the entire line + * 1 - to the right from cursor + */ + type Direction = -1 | 0 | 1; + class WriteStream extends net.Socket { + constructor(fd: number); + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "resize", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "resize"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "resize", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "resize", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "resize", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "resize", listener: () => void): this; + + /** + * Clears the current line of this WriteStream in a direction identified by `dir`. + */ + clearLine(dir: Direction, callback?: () => void): boolean; + /** + * Clears this `WriteStream` from the current cursor down. + */ + clearScreenDown(callback?: () => void): boolean; + /** + * Moves this WriteStream's cursor to the specified position. + */ + cursorTo(x: number, y?: number, callback?: () => void): boolean; + cursorTo(x: number, callback: () => void): boolean; + /** + * Moves this WriteStream's cursor relative to its current position. + */ + moveCursor(dx: number, dy: number, callback?: () => void): boolean; + /** + * @default `process.env` + */ + getColorDepth(env?: {}): number; + hasColors(depth?: number): boolean; + hasColors(env?: {}): boolean; + hasColors(depth: number, env?: {}): boolean; + getWindowSize(): [number, number]; + columns: number; + rows: number; + isTTY: boolean; + } +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/url.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/url.d.ts new file mode 100755 index 000000000..f8da6e533 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/url.d.ts @@ -0,0 +1,116 @@ +declare module 'url' { + import { ParsedUrlQuery, ParsedUrlQueryInput } from 'querystring'; + + // Input to `url.format` + interface UrlObject { + auth?: string | null; + hash?: string | null; + host?: string | null; + hostname?: string | null; + href?: string | null; + pathname?: string | null; + protocol?: string | null; + search?: string | null; + slashes?: boolean | null; + port?: string | number | null; + query?: string | null | ParsedUrlQueryInput; + } + + // Output of `url.parse` + interface Url { + auth: string | null; + hash: string | null; + host: string | null; + hostname: string | null; + href: string; + path: string | null; + pathname: string | null; + protocol: string | null; + search: string | null; + slashes: boolean | null; + port: string | null; + query: string | null | ParsedUrlQuery; + } + + interface UrlWithParsedQuery extends Url { + query: ParsedUrlQuery; + } + + interface UrlWithStringQuery extends Url { + query: string | null; + } + + /** @deprecated since v11.0.0 - Use the WHATWG URL API. */ + function parse(urlStr: string): UrlWithStringQuery; + /** @deprecated since v11.0.0 - Use the WHATWG URL API. */ + function parse(urlStr: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery; + /** @deprecated since v11.0.0 - Use the WHATWG URL API. */ + function parse(urlStr: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery; + /** @deprecated since v11.0.0 - Use the WHATWG URL API. */ + function parse(urlStr: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url; + + function format(URL: URL, options?: URLFormatOptions): string; + /** @deprecated since v11.0.0 - Use the WHATWG URL API. */ + function format(urlObject: UrlObject | string): string; + /** @deprecated since v11.0.0 - Use the WHATWG URL API. */ + function resolve(from: string, to: string): string; + + function domainToASCII(domain: string): string; + function domainToUnicode(domain: string): string; + + /** + * This function ensures the correct decodings of percent-encoded characters as + * well as ensuring a cross-platform valid absolute path string. + * @param url The file URL string or URL object to convert to a path. + */ + function fileURLToPath(url: string | URL): string; + + /** + * This function ensures that path is resolved absolutely, and that the URL + * control characters are correctly encoded when converting into a File URL. + * @param url The path to convert to a File URL. + */ + function pathToFileURL(url: string): URL; + + interface URLFormatOptions { + auth?: boolean; + fragment?: boolean; + search?: boolean; + unicode?: boolean; + } + + class URL { + constructor(input: string, base?: string | URL); + hash: string; + host: string; + hostname: string; + href: string; + readonly origin: string; + password: string; + pathname: string; + port: string; + protocol: string; + search: string; + readonly searchParams: URLSearchParams; + username: string; + toString(): string; + toJSON(): string; + } + + class URLSearchParams implements Iterable<[string, string]> { + constructor(init?: URLSearchParams | string | NodeJS.Dict> | Iterable<[string, string]> | ReadonlyArray<[string, string]>); + append(name: string, value: string): void; + delete(name: string): void; + entries(): IterableIterator<[string, string]>; + forEach(callback: (value: string, name: string, searchParams: this) => void): void; + get(name: string): string | null; + getAll(name: string): string[]; + has(name: string): boolean; + keys(): IterableIterator; + set(name: string, value: string): void; + sort(): void; + toString(): string; + values(): IterableIterator; + [Symbol.iterator](): IterableIterator<[string, string]>; + } +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/util.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/util.d.ts new file mode 100755 index 000000000..f1c0794fc --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/util.d.ts @@ -0,0 +1,156 @@ +declare module 'util' { + import * as types from 'util/types'; + + export interface InspectOptions extends NodeJS.InspectOptions { } + export type Style = 'special' | 'number' | 'bigint' | 'boolean' | 'undefined' | 'null' | 'string' | 'symbol' | 'date' | 'regexp' | 'module'; + export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => string; + export interface InspectOptionsStylized extends InspectOptions { + stylize(text: string, styleType: Style): string; + } + export function format(format?: any, ...param: any[]): string; + export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string; + /** @deprecated since v0.11.3 - use a third party module instead. */ + export function log(string: string): void; + export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string; + export function inspect(object: any, options: InspectOptions): string; + export namespace inspect { + let colors: NodeJS.Dict<[number, number]>; + let styles: { + [K in Style]: string + }; + let defaultOptions: InspectOptions; + /** + * Allows changing inspect settings from the repl. + */ + let replDefaults: InspectOptions; + const custom: unique symbol; + } + /** @deprecated since v4.0.0 - use `Array.isArray()` instead. */ + export function isArray(object: any): object is any[]; + /** @deprecated since v4.0.0 - use `util.types.isRegExp()` instead. */ + export function isRegExp(object: any): object is RegExp; + /** @deprecated since v4.0.0 - use `util.types.isDate()` instead. */ + export function isDate(object: any): object is Date; + /** @deprecated since v4.0.0 - use `util.types.isNativeError()` instead. */ + export function isError(object: any): object is Error; + export function inherits(constructor: any, superConstructor: any): void; + export function debuglog(key: string): (msg: string, ...param: any[]) => void; + /** @deprecated since v4.0.0 - use `typeof value === 'boolean'` instead. */ + export function isBoolean(object: any): object is boolean; + /** @deprecated since v4.0.0 - use `Buffer.isBuffer()` instead. */ + export function isBuffer(object: any): object is Buffer; + /** @deprecated since v4.0.0 - use `typeof value === 'function'` instead. */ + export function isFunction(object: any): boolean; + /** @deprecated since v4.0.0 - use `value === null` instead. */ + export function isNull(object: any): object is null; + /** @deprecated since v4.0.0 - use `value === null || value === undefined` instead. */ + export function isNullOrUndefined(object: any): object is null | undefined; + /** @deprecated since v4.0.0 - use `typeof value === 'number'` instead. */ + export function isNumber(object: any): object is number; + /** @deprecated since v4.0.0 - use `value !== null && typeof value === 'object'` instead. */ + export function isObject(object: any): boolean; + /** @deprecated since v4.0.0 - use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead. */ + export function isPrimitive(object: any): boolean; + /** @deprecated since v4.0.0 - use `typeof value === 'string'` instead. */ + export function isString(object: any): object is string; + /** @deprecated since v4.0.0 - use `typeof value === 'symbol'` instead. */ + export function isSymbol(object: any): object is symbol; + /** @deprecated since v4.0.0 - use `value === undefined` instead. */ + export function isUndefined(object: any): object is undefined; + export function deprecate(fn: T, message: string, code?: string): T; + export function isDeepStrictEqual(val1: any, val2: any): boolean; + + export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1) => Promise): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1) => Promise): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2) => Promise): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2) => Promise): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3) => Promise): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise, + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise, + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; + + export interface CustomPromisifyLegacy extends Function { + __promisify__: TCustom; + } + + export interface CustomPromisifySymbol extends Function { + [promisify.custom]: TCustom; + } + + export type CustomPromisify = CustomPromisifySymbol | CustomPromisifyLegacy; + + export function promisify(fn: CustomPromisify): TCustom; + export function promisify(fn: (callback: (err: any, result: TResult) => void) => void): () => Promise; + export function promisify(fn: (callback: (err?: any) => void) => void): () => Promise; + export function promisify(fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void): (arg1: T1) => Promise; + export function promisify(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void): + (arg1: T1, arg2: T2, arg3: T3) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; + export function promisify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void, + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void): + (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; + export function promisify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void, + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; + export function promisify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void, + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; + export function promisify(fn: Function): Function; + export namespace promisify { + const custom: unique symbol; + } + export class TextDecoder { + readonly encoding: string; + readonly fatal: boolean; + readonly ignoreBOM: boolean; + constructor( + encoding?: string, + options?: { fatal?: boolean; ignoreBOM?: boolean } + ); + decode( + input?: NodeJS.ArrayBufferView | ArrayBuffer | null, + options?: { stream?: boolean } + ): string; + } + + export interface EncodeIntoResult { + /** + * The read Unicode code units of input. + */ + + read: number; + /** + * The written UTF-8 bytes of output. + */ + written: number; + } + + export { types }; + + export class TextEncoder { + readonly encoding: string; + encode(input?: string): Uint8Array; + encodeInto(input: string, output: Uint8Array): EncodeIntoResult; + } +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/util/types.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/util/types.d.ts new file mode 100755 index 000000000..ad4c0db44 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/util/types.d.ts @@ -0,0 +1,53 @@ +declare module 'util/types' { + function isAnyArrayBuffer(object: any): object is ArrayBufferLike; + function isArgumentsObject(object: any): object is IArguments; + function isArrayBuffer(object: any): object is ArrayBuffer; + function isArrayBufferView(object: any): object is NodeJS.ArrayBufferView; + function isAsyncFunction(object: any): boolean; + function isBigInt64Array(value: any): value is BigInt64Array; + function isBigUint64Array(value: any): value is BigUint64Array; + function isBooleanObject(object: any): object is Boolean; + function isBoxedPrimitive(object: any): object is String | Number | BigInt | Boolean | Symbol; + function isDataView(object: any): object is DataView; + function isDate(object: any): object is Date; + function isExternal(object: any): boolean; + function isFloat32Array(object: any): object is Float32Array; + function isFloat64Array(object: any): object is Float64Array; + function isGeneratorFunction(object: any): object is GeneratorFunction; + function isGeneratorObject(object: any): object is Generator; + function isInt8Array(object: any): object is Int8Array; + function isInt16Array(object: any): object is Int16Array; + function isInt32Array(object: any): object is Int32Array; + function isMap( + object: T | {}, + ): object is T extends ReadonlyMap + ? unknown extends T + ? never + : ReadonlyMap + : Map; + function isMapIterator(object: any): boolean; + function isModuleNamespaceObject(value: any): boolean; + function isNativeError(object: any): object is Error; + function isNumberObject(object: any): object is Number; + function isPromise(object: any): object is Promise; + function isProxy(object: any): boolean; + function isRegExp(object: any): object is RegExp; + function isSet( + object: T | {}, + ): object is T extends ReadonlySet + ? unknown extends T + ? never + : ReadonlySet + : Set; + function isSetIterator(object: any): boolean; + function isSharedArrayBuffer(object: any): object is SharedArrayBuffer; + function isStringObject(object: any): object is String; + function isSymbolObject(object: any): object is Symbol; + function isTypedArray(object: any): object is NodeJS.TypedArray; + function isUint8Array(object: any): object is Uint8Array; + function isUint8ClampedArray(object: any): object is Uint8ClampedArray; + function isUint16Array(object: any): object is Uint16Array; + function isUint32Array(object: any): object is Uint32Array; + function isWeakMap(object: any): object is WeakMap; + function isWeakSet(object: any): object is WeakSet; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/v8.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/v8.d.ts new file mode 100755 index 000000000..c0f286b7b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/v8.d.ts @@ -0,0 +1,198 @@ +declare module 'v8' { + import { Readable } from 'stream'; + + interface HeapSpaceInfo { + space_name: string; + space_size: number; + space_used_size: number; + space_available_size: number; + physical_space_size: number; + } + + // ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */ + type DoesZapCodeSpaceFlag = 0 | 1; + + interface HeapInfo { + total_heap_size: number; + total_heap_size_executable: number; + total_physical_size: number; + total_available_size: number; + used_heap_size: number; + heap_size_limit: number; + malloced_memory: number; + peak_malloced_memory: number; + does_zap_garbage: DoesZapCodeSpaceFlag; + number_of_native_contexts: number; + number_of_detached_contexts: number; + } + + interface HeapCodeStatistics { + code_and_metadata_size: number; + bytecode_and_metadata_size: number; + external_script_source_size: number; + } + + /** + * Returns an integer representing a "version tag" derived from the V8 version, command line flags and detected CPU features. + * This is useful for determining whether a vm.Script cachedData buffer is compatible with this instance of V8. + */ + function cachedDataVersionTag(): number; + + function getHeapStatistics(): HeapInfo; + function getHeapSpaceStatistics(): HeapSpaceInfo[]; + function setFlagsFromString(flags: string): void; + /** + * Generates a snapshot of the current V8 heap and returns a Readable + * Stream that may be used to read the JSON serialized representation. + * This conversation was marked as resolved by joyeecheung + * This JSON stream format is intended to be used with tools such as + * Chrome DevTools. The JSON schema is undocumented and specific to the + * V8 engine, and may change from one version of V8 to the next. + */ + function getHeapSnapshot(): Readable; + + /** + * + * @param fileName The file path where the V8 heap snapshot is to be + * saved. If not specified, a file name with the pattern + * `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be + * generated, where `{pid}` will be the PID of the Node.js process, + * `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from + * the main Node.js thread or the id of a worker thread. + */ + function writeHeapSnapshot(fileName?: string): string; + + function getHeapCodeStatistics(): HeapCodeStatistics; + + class Serializer { + /** + * Writes out a header, which includes the serialization format version. + */ + writeHeader(): void; + + /** + * Serializes a JavaScript value and adds the serialized representation to the internal buffer. + * This throws an error if value cannot be serialized. + */ + writeValue(val: any): boolean; + + /** + * Returns the stored internal buffer. + * This serializer should not be used once the buffer is released. + * Calling this method results in undefined behavior if a previous write has failed. + */ + releaseBuffer(): Buffer; + + /** + * Marks an ArrayBuffer as having its contents transferred out of band.\ + * Pass the corresponding ArrayBuffer in the deserializing context to deserializer.transferArrayBuffer(). + */ + transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; + + /** + * Write a raw 32-bit unsigned integer. + */ + writeUint32(value: number): void; + + /** + * Write a raw 64-bit unsigned integer, split into high and low 32-bit parts. + */ + writeUint64(hi: number, lo: number): void; + + /** + * Write a JS number value. + */ + writeDouble(value: number): void; + + /** + * Write raw bytes into the serializer’s internal buffer. + * The deserializer will require a way to compute the length of the buffer. + */ + writeRawBytes(buffer: NodeJS.TypedArray): void; + } + + /** + * A subclass of `Serializer` that serializes `TypedArray` (in particular `Buffer`) and `DataView` objects as host objects, + * and only stores the part of their underlying `ArrayBuffers` that they are referring to. + */ + class DefaultSerializer extends Serializer { + } + + class Deserializer { + constructor(data: NodeJS.TypedArray); + /** + * Reads and validates a header (including the format version). + * May, for example, reject an invalid or unsupported wire format. + * In that case, an Error is thrown. + */ + readHeader(): boolean; + + /** + * Deserializes a JavaScript value from the buffer and returns it. + */ + readValue(): any; + + /** + * Marks an ArrayBuffer as having its contents transferred out of band. + * Pass the corresponding `ArrayBuffer` in the serializing context to serializer.transferArrayBuffer() + * (or return the id from serializer._getSharedArrayBufferId() in the case of SharedArrayBuffers). + */ + transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; + + /** + * Reads the underlying wire format version. + * Likely mostly to be useful to legacy code reading old wire format versions. + * May not be called before .readHeader(). + */ + getWireFormatVersion(): number; + + /** + * Read a raw 32-bit unsigned integer and return it. + */ + readUint32(): number; + + /** + * Read a raw 64-bit unsigned integer and return it as an array [hi, lo] with two 32-bit unsigned integer entries. + */ + readUint64(): [number, number]; + + /** + * Read a JS number value. + */ + readDouble(): number; + + /** + * Read raw bytes from the deserializer’s internal buffer. + * The length parameter must correspond to the length of the buffer that was passed to serializer.writeRawBytes(). + */ + readRawBytes(length: number): Buffer; + } + + /** + * A subclass of `Serializer` that serializes `TypedArray` (in particular `Buffer`) and `DataView` objects as host objects, + * and only stores the part of their underlying `ArrayBuffers` that they are referring to. + */ + class DefaultDeserializer extends Deserializer { + } + + /** + * Uses a `DefaultSerializer` to serialize value into a buffer. + */ + function serialize(value: any): Buffer; + + /** + * Uses a `DefaultDeserializer` with default options to read a JS value from a buffer. + */ + function deserialize(data: NodeJS.TypedArray): any; + + /** + * Begins writing coverage report based on the `NODE_V8_COVERAGE` env var. + * Noop is the env var is not set. + */ + function takeCoverage(): void; + + /** + * Stops writing coverage report. + */ + function stopCoverage(): void; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/vm.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/vm.d.ts new file mode 100755 index 000000000..0d543232d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/vm.d.ts @@ -0,0 +1,152 @@ +declare module 'vm' { + interface Context extends NodeJS.Dict { } + interface BaseOptions { + /** + * Specifies the filename used in stack traces produced by this script. + * Default: `''`. + */ + filename?: string; + /** + * Specifies the line number offset that is displayed in stack traces produced by this script. + * Default: `0`. + */ + lineOffset?: number; + /** + * Specifies the column number offset that is displayed in stack traces produced by this script. + * @default 0 + */ + columnOffset?: number; + } + interface ScriptOptions extends BaseOptions { + displayErrors?: boolean; + timeout?: number; + cachedData?: Buffer; + /** @deprecated in favor of `script.createCachedData()` */ + produceCachedData?: boolean; + } + interface RunningScriptOptions extends BaseOptions { + /** + * When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace. + * Default: `true`. + */ + displayErrors?: boolean; + /** + * Specifies the number of milliseconds to execute code before terminating execution. + * If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer. + */ + timeout?: number; + /** + * If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. + * Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. + * If execution is terminated, an `Error` will be thrown. + * Default: `false`. + */ + breakOnSigint?: boolean; + /** + * If set to `afterEvaluate`, microtasks will be run immediately after the script has run. + */ + microtaskMode?: 'afterEvaluate'; + } + interface CompileFunctionOptions extends BaseOptions { + /** + * Provides an optional data with V8's code cache data for the supplied source. + */ + cachedData?: Buffer; + /** + * Specifies whether to produce new cache data. + * Default: `false`, + */ + produceCachedData?: boolean; + /** + * The sandbox/context in which the said function should be compiled in. + */ + parsingContext?: Context; + + /** + * An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling + */ + contextExtensions?: Object[]; + } + + interface CreateContextOptions { + /** + * Human-readable name of the newly created context. + * @default 'VM Context i' Where i is an ascending numerical index of the created context. + */ + name?: string; + /** + * Corresponds to the newly created context for display purposes. + * The origin should be formatted like a `URL`, but with only the scheme, host, and port (if necessary), + * like the value of the `url.origin` property of a URL object. + * Most notably, this string should omit the trailing slash, as that denotes a path. + * @default '' + */ + origin?: string; + codeGeneration?: { + /** + * If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc) + * will throw an EvalError. + * @default true + */ + strings?: boolean; + /** + * If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError. + * @default true + */ + wasm?: boolean; + }; + /** + * If set to `afterEvaluate`, microtasks will be run immediately after the script has run. + */ + microtaskMode?: 'afterEvaluate'; + } + + type MeasureMemoryMode = 'summary' | 'detailed'; + + interface MeasureMemoryOptions { + /** + * @default 'summary' + */ + mode?: MeasureMemoryMode; + context?: Context; + } + + interface MemoryMeasurement { + total: { + jsMemoryEstimate: number; + jsMemoryRange: [number, number]; + }; + } + + class Script { + constructor(code: string, options?: ScriptOptions); + runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any; + runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any; + runInThisContext(options?: RunningScriptOptions): any; + createCachedData(): Buffer; + cachedDataRejected?: boolean; + } + function createContext(sandbox?: Context, options?: CreateContextOptions): Context; + function isContext(sandbox: Context): boolean; + function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions | string): any; + function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions | string): any; + function runInThisContext(code: string, options?: RunningScriptOptions | string): any; + function compileFunction(code: string, params?: ReadonlyArray, options?: CompileFunctionOptions): Function; + + /** + * Measure the memory known to V8 and used by the current execution context or a specified context. + * + * The format of the object that the returned Promise may resolve with is + * specific to the V8 engine and may change from one version of V8 to the next. + * + * The returned result is different from the statistics returned by + * `v8.getHeapSpaceStatistics()` in that `vm.measureMemory()` measures + * the memory reachable by V8 from a specific context, while + * `v8.getHeapSpaceStatistics()` measures the memory used by an instance + * of V8 engine, which can switch among multiple contexts that reference + * objects in the heap of one engine. + * + * @experimental + */ + function measureMemory(options?: MeasureMemoryOptions): Promise; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/wasi.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/wasi.d.ts new file mode 100755 index 000000000..fe2b2aab8 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/wasi.d.ts @@ -0,0 +1,86 @@ +declare module 'wasi' { + interface WASIOptions { + /** + * An array of strings that the WebAssembly application will + * see as command line arguments. The first argument is the virtual path to the + * WASI command itself. + */ + args?: string[]; + + /** + * An object similar to `process.env` that the WebAssembly + * application will see as its environment. + */ + env?: object; + + /** + * This object represents the WebAssembly application's + * sandbox directory structure. The string keys of `preopens` are treated as + * directories within the sandbox. The corresponding values in `preopens` are + * the real paths to those directories on the host machine. + */ + preopens?: NodeJS.Dict; + + /** + * By default, WASI applications terminate the Node.js + * process via the `__wasi_proc_exit()` function. Setting this option to `true` + * causes `wasi.start()` to return the exit code rather than terminate the + * process. + * @default false + */ + returnOnExit?: boolean; + + /** + * The file descriptor used as standard input in the WebAssembly application. + * @default 0 + */ + stdin?: number; + + /** + * The file descriptor used as standard output in the WebAssembly application. + * @default 1 + */ + stdout?: number; + + /** + * The file descriptor used as standard error in the WebAssembly application. + * @default 2 + */ + stderr?: number; + } + + class WASI { + constructor(options?: WASIOptions); + /** + * + * Attempt to begin execution of `instance` by invoking its `_start()` export. + * If `instance` does not contain a `_start()` export, then `start()` attempts to + * invoke the `__wasi_unstable_reactor_start()` export. If neither of those exports + * is present on `instance`, then `start()` does nothing. + * + * `start()` requires that `instance` exports a [`WebAssembly.Memory`][] named + * `memory`. If `instance` does not have a `memory` export an exception is thrown. + * + * If `start()` is called more than once, an exception is thrown. + */ + start(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib. + + /** + * Attempt to initialize `instance` as a WASI reactor by invoking its `_initialize()` export, if it is present. + * If `instance` contains a `_start()` export, then an exception is thrown. + * + * `start()` requires that `instance` exports a [`WebAssembly.Memory`][] named + * `memory`. If `instance` does not have a `memory` export an exception is thrown. + * + * If `initialize()` is called more than once, an exception is thrown. + */ + initialize(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib. + + /** + * Is an object that implements the WASI system call API. This object + * should be passed as the `wasi_snapshot_preview1` import during the instantiation of a + * [`WebAssembly.Instance`][]. + */ + readonly wasiImport: NodeJS.Dict; // TODO: Narrow to DOM types + } +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/worker_threads.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/worker_threads.d.ts new file mode 100755 index 000000000..dbaed2af1 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/worker_threads.d.ts @@ -0,0 +1,264 @@ +declare module 'worker_threads' { + import { Context } from 'vm'; + import { EventEmitter } from 'events'; + import { EventLoopUtilityFunction } from 'perf_hooks'; + import { FileHandle } from 'fs/promises'; + import { Readable, Writable } from 'stream'; + import { URL } from 'url'; + import { X509Certificate } from 'crypto'; + + const isMainThread: boolean; + const parentPort: null | MessagePort; + const resourceLimits: ResourceLimits; + const SHARE_ENV: unique symbol; + const threadId: number; + const workerData: any; + + class MessageChannel { + readonly port1: MessagePort; + readonly port2: MessagePort; + } + + interface WorkerPerformance { + eventLoopUtilization: EventLoopUtilityFunction; + } + + type TransferListItem = ArrayBuffer | MessagePort | FileHandle | X509Certificate; + + class MessagePort extends EventEmitter { + close(): void; + postMessage(value: any, transferList?: ReadonlyArray): void; + ref(): void; + unref(): void; + start(): void; + + addListener(event: "close", listener: () => void): this; + addListener(event: "message", listener: (value: any) => void): this; + addListener(event: "messageerror", listener: (error: Error) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "close"): boolean; + emit(event: "message", value: any): boolean; + emit(event: "messageerror", error: Error): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "close", listener: () => void): this; + on(event: "message", listener: (value: any) => void): this; + on(event: "messageerror", listener: (error: Error) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "close", listener: () => void): this; + once(event: "message", listener: (value: any) => void): this; + once(event: "messageerror", listener: (error: Error) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "close", listener: () => void): this; + prependListener(event: "message", listener: (value: any) => void): this; + prependListener(event: "messageerror", listener: (error: Error) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "message", listener: (value: any) => void): this; + prependOnceListener(event: "messageerror", listener: (error: Error) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + + removeListener(event: "close", listener: () => void): this; + removeListener(event: "message", listener: (value: any) => void): this; + removeListener(event: "messageerror", listener: (error: Error) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + + off(event: "close", listener: () => void): this; + off(event: "message", listener: (value: any) => void): this; + off(event: "messageerror", listener: (error: Error) => void): this; + off(event: string | symbol, listener: (...args: any[]) => void): this; + } + + interface WorkerOptions { + /** + * List of arguments which would be stringified and appended to + * `process.argv` in the worker. This is mostly similar to the `workerData` + * but the values will be available on the global `process.argv` as if they + * were passed as CLI options to the script. + */ + argv?: any[]; + env?: NodeJS.Dict | typeof SHARE_ENV; + eval?: boolean; + workerData?: any; + stdin?: boolean; + stdout?: boolean; + stderr?: boolean; + execArgv?: string[]; + resourceLimits?: ResourceLimits; + /** + * Additional data to send in the first worker message. + */ + transferList?: TransferListItem[]; + /** + * @default true + */ + trackUnmanagedFds?: boolean; + } + + interface ResourceLimits { + /** + * The maximum size of a heap space for recently created objects. + */ + maxYoungGenerationSizeMb?: number; + /** + * The maximum size of the main heap in MB. + */ + maxOldGenerationSizeMb?: number; + /** + * The size of a pre-allocated memory range used for generated code. + */ + codeRangeSizeMb?: number; + /** + * The default maximum stack size for the thread. Small values may lead to unusable Worker instances. + * @default 4 + */ + stackSizeMb?: number; + } + + class Worker extends EventEmitter { + readonly stdin: Writable | null; + readonly stdout: Readable; + readonly stderr: Readable; + readonly threadId: number; + readonly resourceLimits?: ResourceLimits; + readonly performance: WorkerPerformance; + + /** + * @param filename The path to the Worker’s main script or module. + * Must be either an absolute path or a relative path (i.e. relative to the current working directory) starting with ./ or ../, + * or a WHATWG URL object using file: protocol. If options.eval is true, this is a string containing JavaScript code rather than a path. + */ + constructor(filename: string | URL, options?: WorkerOptions); + + postMessage(value: any, transferList?: ReadonlyArray): void; + ref(): void; + unref(): void; + /** + * Stop all JavaScript execution in the worker thread as soon as possible. + * Returns a Promise for the exit code that is fulfilled when the `exit` event is emitted. + */ + terminate(): Promise; + + /** + * Returns a readable stream for a V8 snapshot of the current state of the Worker. + * See [`v8.getHeapSnapshot()`][] for more details. + * + * If the Worker thread is no longer running, which may occur before the + * [`'exit'` event][] is emitted, the returned `Promise` will be rejected + * immediately with an [`ERR_WORKER_NOT_RUNNING`][] error + */ + getHeapSnapshot(): Promise; + + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "exit", listener: (exitCode: number) => void): this; + addListener(event: "message", listener: (value: any) => void): this; + addListener(event: "messageerror", listener: (error: Error) => void): this; + addListener(event: "online", listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "error", err: Error): boolean; + emit(event: "exit", exitCode: number): boolean; + emit(event: "message", value: any): boolean; + emit(event: "messageerror", error: Error): boolean; + emit(event: "online"): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "error", listener: (err: Error) => void): this; + on(event: "exit", listener: (exitCode: number) => void): this; + on(event: "message", listener: (value: any) => void): this; + on(event: "messageerror", listener: (error: Error) => void): this; + on(event: "online", listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "error", listener: (err: Error) => void): this; + once(event: "exit", listener: (exitCode: number) => void): this; + once(event: "message", listener: (value: any) => void): this; + once(event: "messageerror", listener: (error: Error) => void): this; + once(event: "online", listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "exit", listener: (exitCode: number) => void): this; + prependListener(event: "message", listener: (value: any) => void): this; + prependListener(event: "messageerror", listener: (error: Error) => void): this; + prependListener(event: "online", listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "exit", listener: (exitCode: number) => void): this; + prependOnceListener(event: "message", listener: (value: any) => void): this; + prependOnceListener(event: "messageerror", listener: (error: Error) => void): this; + prependOnceListener(event: "online", listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + + removeListener(event: "error", listener: (err: Error) => void): this; + removeListener(event: "exit", listener: (exitCode: number) => void): this; + removeListener(event: "message", listener: (value: any) => void): this; + removeListener(event: "messageerror", listener: (error: Error) => void): this; + removeListener(event: "online", listener: () => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + + off(event: "error", listener: (err: Error) => void): this; + off(event: "exit", listener: (exitCode: number) => void): this; + off(event: "message", listener: (value: any) => void): this; + off(event: "messageerror", listener: (error: Error) => void): this; + off(event: "online", listener: () => void): this; + off(event: string | symbol, listener: (...args: any[]) => void): this; + } + + interface BroadcastChannel extends NodeJS.RefCounted {} + + /** + * See https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel + */ + class BroadcastChannel { + readonly name: string; + onmessage: (message: unknown) => void; + onmessageerror: (message: unknown) => void; + + constructor(name: string); + + close(): void; + postMessage(message: unknown): void; + } + + /** + * Mark an object as not transferable. + * If `object` occurs in the transfer list of a `port.postMessage()` call, it will be ignored. + * + * In particular, this makes sense for objects that can be cloned, rather than transferred, + * and which are used by other objects on the sending side. For example, Node.js marks + * the `ArrayBuffer`s it uses for its Buffer pool with this. + * + * This operation cannot be undone. + */ + function markAsUntransferable(object: object): void; + + /** + * Transfer a `MessagePort` to a different `vm` Context. The original `port` + * object will be rendered unusable, and the returned `MessagePort` instance will + * take its place. + * + * The returned `MessagePort` will be an object in the target context, and will + * inherit from its global `Object` class. Objects passed to the + * `port.onmessage()` listener will also be created in the target context + * and inherit from its global `Object` class. + * + * However, the created `MessagePort` will no longer inherit from + * `EventEmitter`, and only `port.onmessage()` can be used to receive + * events using it. + */ + function moveMessagePortToContext(port: MessagePort, context: Context): MessagePort; + + /** + * Receive a single message from a given `MessagePort`. If no message is available, + * `undefined` is returned, otherwise an object with a single `message` property + * that contains the message payload, corresponding to the oldest message in the + * `MessagePort`’s queue. + */ + function receiveMessageOnPort(port: MessagePort): { message: any } | undefined; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/zlib.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/zlib.d.ts new file mode 100755 index 000000000..eafc91b8f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/node/zlib.d.ts @@ -0,0 +1,361 @@ +declare module 'zlib' { + import * as stream from 'stream'; + + interface ZlibOptions { + /** + * @default constants.Z_NO_FLUSH + */ + flush?: number; + /** + * @default constants.Z_FINISH + */ + finishFlush?: number; + /** + * @default 16*1024 + */ + chunkSize?: number; + windowBits?: number; + level?: number; // compression only + memLevel?: number; // compression only + strategy?: number; // compression only + dictionary?: NodeJS.ArrayBufferView | ArrayBuffer; // deflate/inflate only, empty dictionary by default + info?: boolean; + maxOutputLength?: number; + } + + interface BrotliOptions { + /** + * @default constants.BROTLI_OPERATION_PROCESS + */ + flush?: number; + /** + * @default constants.BROTLI_OPERATION_FINISH + */ + finishFlush?: number; + /** + * @default 16*1024 + */ + chunkSize?: number; + params?: { + /** + * Each key is a `constants.BROTLI_*` constant. + */ + [key: number]: boolean | number; + }; + maxOutputLength?: number; + } + + interface Zlib { + /** @deprecated Use bytesWritten instead. */ + readonly bytesRead: number; + readonly bytesWritten: number; + shell?: boolean | string; + close(callback?: () => void): void; + flush(kind?: number, callback?: () => void): void; + flush(callback?: () => void): void; + } + + interface ZlibParams { + params(level: number, strategy: number, callback: () => void): void; + } + + interface ZlibReset { + reset(): void; + } + + interface BrotliCompress extends stream.Transform, Zlib { } + interface BrotliDecompress extends stream.Transform, Zlib { } + interface Gzip extends stream.Transform, Zlib { } + interface Gunzip extends stream.Transform, Zlib { } + interface Deflate extends stream.Transform, Zlib, ZlibReset, ZlibParams { } + interface Inflate extends stream.Transform, Zlib, ZlibReset { } + interface DeflateRaw extends stream.Transform, Zlib, ZlibReset, ZlibParams { } + interface InflateRaw extends stream.Transform, Zlib, ZlibReset { } + interface Unzip extends stream.Transform, Zlib { } + + function createBrotliCompress(options?: BrotliOptions): BrotliCompress; + function createBrotliDecompress(options?: BrotliOptions): BrotliDecompress; + function createGzip(options?: ZlibOptions): Gzip; + function createGunzip(options?: ZlibOptions): Gunzip; + function createDeflate(options?: ZlibOptions): Deflate; + function createInflate(options?: ZlibOptions): Inflate; + function createDeflateRaw(options?: ZlibOptions): DeflateRaw; + function createInflateRaw(options?: ZlibOptions): InflateRaw; + function createUnzip(options?: ZlibOptions): Unzip; + + type InputType = string | ArrayBuffer | NodeJS.ArrayBufferView; + + type CompressCallback = (error: Error | null, result: Buffer) => void; + + function brotliCompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void; + function brotliCompress(buf: InputType, callback: CompressCallback): void; + namespace brotliCompress { + function __promisify__(buffer: InputType, options?: BrotliOptions): Promise; + } + + function brotliCompressSync(buf: InputType, options?: BrotliOptions): Buffer; + + function brotliDecompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void; + function brotliDecompress(buf: InputType, callback: CompressCallback): void; + namespace brotliDecompress { + function __promisify__(buffer: InputType, options?: BrotliOptions): Promise; + } + + function brotliDecompressSync(buf: InputType, options?: BrotliOptions): Buffer; + + function deflate(buf: InputType, callback: CompressCallback): void; + function deflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void; + namespace deflate { + function __promisify__(buffer: InputType, options?: ZlibOptions): Promise; + } + + function deflateSync(buf: InputType, options?: ZlibOptions): Buffer; + + function deflateRaw(buf: InputType, callback: CompressCallback): void; + function deflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void; + namespace deflateRaw { + function __promisify__(buffer: InputType, options?: ZlibOptions): Promise; + } + + function deflateRawSync(buf: InputType, options?: ZlibOptions): Buffer; + + function gzip(buf: InputType, callback: CompressCallback): void; + function gzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void; + namespace gzip { + function __promisify__(buffer: InputType, options?: ZlibOptions): Promise; + } + + function gzipSync(buf: InputType, options?: ZlibOptions): Buffer; + + function gunzip(buf: InputType, callback: CompressCallback): void; + function gunzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void; + namespace gunzip { + function __promisify__(buffer: InputType, options?: ZlibOptions): Promise; + } + + function gunzipSync(buf: InputType, options?: ZlibOptions): Buffer; + + function inflate(buf: InputType, callback: CompressCallback): void; + function inflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void; + namespace inflate { + function __promisify__(buffer: InputType, options?: ZlibOptions): Promise; + } + + function inflateSync(buf: InputType, options?: ZlibOptions): Buffer; + + function inflateRaw(buf: InputType, callback: CompressCallback): void; + function inflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void; + namespace inflateRaw { + function __promisify__(buffer: InputType, options?: ZlibOptions): Promise; + } + + function inflateRawSync(buf: InputType, options?: ZlibOptions): Buffer; + + function unzip(buf: InputType, callback: CompressCallback): void; + function unzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void; + namespace unzip { + function __promisify__(buffer: InputType, options?: ZlibOptions): Promise; + } + + function unzipSync(buf: InputType, options?: ZlibOptions): Buffer; + + namespace constants { + const BROTLI_DECODE: number; + const BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: number; + const BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: number; + const BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: number; + const BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: number; + const BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: number; + const BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: number; + const BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: number; + const BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: number; + const BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: number; + const BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: number; + const BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: number; + const BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: number; + const BROTLI_DECODER_ERROR_FORMAT_DISTANCE: number; + const BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: number; + const BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: number; + const BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: number; + const BROTLI_DECODER_ERROR_FORMAT_PADDING_1: number; + const BROTLI_DECODER_ERROR_FORMAT_PADDING_2: number; + const BROTLI_DECODER_ERROR_FORMAT_RESERVED: number; + const BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: number; + const BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: number; + const BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: number; + const BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: number; + const BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: number; + const BROTLI_DECODER_ERROR_UNREACHABLE: number; + const BROTLI_DECODER_NEEDS_MORE_INPUT: number; + const BROTLI_DECODER_NEEDS_MORE_OUTPUT: number; + const BROTLI_DECODER_NO_ERROR: number; + const BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: number; + const BROTLI_DECODER_PARAM_LARGE_WINDOW: number; + const BROTLI_DECODER_RESULT_ERROR: number; + const BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: number; + const BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: number; + const BROTLI_DECODER_RESULT_SUCCESS: number; + const BROTLI_DECODER_SUCCESS: number; + + const BROTLI_DEFAULT_MODE: number; + const BROTLI_DEFAULT_QUALITY: number; + const BROTLI_DEFAULT_WINDOW: number; + const BROTLI_ENCODE: number; + const BROTLI_LARGE_MAX_WINDOW_BITS: number; + const BROTLI_MAX_INPUT_BLOCK_BITS: number; + const BROTLI_MAX_QUALITY: number; + const BROTLI_MAX_WINDOW_BITS: number; + const BROTLI_MIN_INPUT_BLOCK_BITS: number; + const BROTLI_MIN_QUALITY: number; + const BROTLI_MIN_WINDOW_BITS: number; + + const BROTLI_MODE_FONT: number; + const BROTLI_MODE_GENERIC: number; + const BROTLI_MODE_TEXT: number; + + const BROTLI_OPERATION_EMIT_METADATA: number; + const BROTLI_OPERATION_FINISH: number; + const BROTLI_OPERATION_FLUSH: number; + const BROTLI_OPERATION_PROCESS: number; + + const BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: number; + const BROTLI_PARAM_LARGE_WINDOW: number; + const BROTLI_PARAM_LGBLOCK: number; + const BROTLI_PARAM_LGWIN: number; + const BROTLI_PARAM_MODE: number; + const BROTLI_PARAM_NDIRECT: number; + const BROTLI_PARAM_NPOSTFIX: number; + const BROTLI_PARAM_QUALITY: number; + const BROTLI_PARAM_SIZE_HINT: number; + + const DEFLATE: number; + const DEFLATERAW: number; + const GUNZIP: number; + const GZIP: number; + const INFLATE: number; + const INFLATERAW: number; + const UNZIP: number; + + // Allowed flush values. + const Z_NO_FLUSH: number; + const Z_PARTIAL_FLUSH: number; + const Z_SYNC_FLUSH: number; + const Z_FULL_FLUSH: number; + const Z_FINISH: number; + const Z_BLOCK: number; + const Z_TREES: number; + + // Return codes for the compression/decompression functions. + // Negative values are errors, positive values are used for special but normal events. + const Z_OK: number; + const Z_STREAM_END: number; + const Z_NEED_DICT: number; + const Z_ERRNO: number; + const Z_STREAM_ERROR: number; + const Z_DATA_ERROR: number; + const Z_MEM_ERROR: number; + const Z_BUF_ERROR: number; + const Z_VERSION_ERROR: number; + + // Compression levels. + const Z_NO_COMPRESSION: number; + const Z_BEST_SPEED: number; + const Z_BEST_COMPRESSION: number; + const Z_DEFAULT_COMPRESSION: number; + + // Compression strategy. + const Z_FILTERED: number; + const Z_HUFFMAN_ONLY: number; + const Z_RLE: number; + const Z_FIXED: number; + const Z_DEFAULT_STRATEGY: number; + + const Z_DEFAULT_WINDOWBITS: number; + const Z_MIN_WINDOWBITS: number; + const Z_MAX_WINDOWBITS: number; + + const Z_MIN_CHUNK: number; + const Z_MAX_CHUNK: number; + const Z_DEFAULT_CHUNK: number; + + const Z_MIN_MEMLEVEL: number; + const Z_MAX_MEMLEVEL: number; + const Z_DEFAULT_MEMLEVEL: number; + + const Z_MIN_LEVEL: number; + const Z_MAX_LEVEL: number; + const Z_DEFAULT_LEVEL: number; + + const ZLIB_VERNUM: number; + } + + // Allowed flush values. + /** @deprecated Use `constants.Z_NO_FLUSH` */ + const Z_NO_FLUSH: number; + /** @deprecated Use `constants.Z_PARTIAL_FLUSH` */ + const Z_PARTIAL_FLUSH: number; + /** @deprecated Use `constants.Z_SYNC_FLUSH` */ + const Z_SYNC_FLUSH: number; + /** @deprecated Use `constants.Z_FULL_FLUSH` */ + const Z_FULL_FLUSH: number; + /** @deprecated Use `constants.Z_FINISH` */ + const Z_FINISH: number; + /** @deprecated Use `constants.Z_BLOCK` */ + const Z_BLOCK: number; + /** @deprecated Use `constants.Z_TREES` */ + const Z_TREES: number; + + // Return codes for the compression/decompression functions. + // Negative values are errors, positive values are used for special but normal events. + /** @deprecated Use `constants.Z_OK` */ + const Z_OK: number; + /** @deprecated Use `constants.Z_STREAM_END` */ + const Z_STREAM_END: number; + /** @deprecated Use `constants.Z_NEED_DICT` */ + const Z_NEED_DICT: number; + /** @deprecated Use `constants.Z_ERRNO` */ + const Z_ERRNO: number; + /** @deprecated Use `constants.Z_STREAM_ERROR` */ + const Z_STREAM_ERROR: number; + /** @deprecated Use `constants.Z_DATA_ERROR` */ + const Z_DATA_ERROR: number; + /** @deprecated Use `constants.Z_MEM_ERROR` */ + const Z_MEM_ERROR: number; + /** @deprecated Use `constants.Z_BUF_ERROR` */ + const Z_BUF_ERROR: number; + /** @deprecated Use `constants.Z_VERSION_ERROR` */ + const Z_VERSION_ERROR: number; + + // Compression levels. + /** @deprecated Use `constants.Z_NO_COMPRESSION` */ + const Z_NO_COMPRESSION: number; + /** @deprecated Use `constants.Z_BEST_SPEED` */ + const Z_BEST_SPEED: number; + /** @deprecated Use `constants.Z_BEST_COMPRESSION` */ + const Z_BEST_COMPRESSION: number; + /** @deprecated Use `constants.Z_DEFAULT_COMPRESSION` */ + const Z_DEFAULT_COMPRESSION: number; + + // Compression strategy. + /** @deprecated Use `constants.Z_FILTERED` */ + const Z_FILTERED: number; + /** @deprecated Use `constants.Z_HUFFMAN_ONLY` */ + const Z_HUFFMAN_ONLY: number; + /** @deprecated Use `constants.Z_RLE` */ + const Z_RLE: number; + /** @deprecated Use `constants.Z_FIXED` */ + const Z_FIXED: number; + /** @deprecated Use `constants.Z_DEFAULT_STRATEGY` */ + const Z_DEFAULT_STRATEGY: number; + + /** @deprecated */ + const Z_BINARY: number; + /** @deprecated */ + const Z_TEXT: number; + /** @deprecated */ + const Z_ASCII: number; + /** @deprecated */ + const Z_UNKNOWN: number; + /** @deprecated */ + const Z_DEFLATED: number; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/offscreencanvas/LICENSE b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/offscreencanvas/LICENSE new file mode 100644 index 000000000..4b1ad51b2 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/offscreencanvas/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/offscreencanvas/README.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/offscreencanvas/README.md new file mode 100644 index 000000000..b32024b39 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/offscreencanvas/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/offscreencanvas` + +# Summary +This package contains type definitions for offscreencanvas-browser ( https://html.spec.whatwg.org/multipage/canvas.html#the-offscreencanvas-interface ). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/offscreencanvas + +Additional Details + * Last updated: Fri, 08 Mar 2019 23:23:08 GMT + * Dependencies: none + * Global values: OffscreenCanvas, OffscreenCanvasRenderingContext2D, createImageBitmap + +# Credits +These definitions were written by Klaus Reimer . diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/offscreencanvas/index.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/offscreencanvas/index.d.ts new file mode 100644 index 000000000..89e2b14df --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/offscreencanvas/index.d.ts @@ -0,0 +1,53 @@ +// Type definitions for non-npm package offscreencanvas-browser 2019.3 +// Project: https://html.spec.whatwg.org/multipage/canvas.html#the-offscreencanvas-interface +// Definitions by: Klaus Reimer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TypeScript Version: 3.1 + +// https://html.spec.whatwg.org/multipage/canvas.html#canvasdrawimage +interface CanvasDrawImage { + drawImage(image: CanvasImageSource | OffscreenCanvas, dx: number, dy: number): void; + drawImage(image: CanvasImageSource | OffscreenCanvas, dx: number, dy: number, dw: number, dh: number): void; + drawImage(image: CanvasImageSource | OffscreenCanvas, sx: number, sy: number, sw: number, sh: number, + dx: number, dy: number, dw: number, dh: number): void; +} + +// https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#dom-createimagebitmap +declare function createImageBitmap(image: ImageBitmapSource | OffscreenCanvas): Promise; +declare function createImageBitmap(image: ImageBitmapSource | OffscreenCanvas, sx: number, sy: number, + sw: number, sh: number): Promise; + +// https://html.spec.whatwg.org/multipage/canvas.html#dom-canvas-transfercontroltooffscreen +interface HTMLCanvasElement extends HTMLElement { + transferControlToOffscreen(): OffscreenCanvas; +} + +// https://html.spec.whatwg.org/multipage/canvas.html#offscreencanvasrenderingcontext2d +interface OffscreenCanvasRenderingContext2D extends CanvasState, CanvasTransform, CanvasCompositing, + CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, + CanvasDrawPath, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, + CanvasTextDrawingStyles, CanvasPath { + readonly canvas: OffscreenCanvas; +} +declare var OffscreenCanvasRenderingContext2D: { + prototype: OffscreenCanvasRenderingContext2D; + new (): OffscreenCanvasRenderingContext2D; +}; + +// https://html.spec.whatwg.org/multipage/canvas.html#the-offscreencanvas-interface +interface OffscreenCanvas extends EventTarget { + width: number; + height: number; + getContext(contextId: "2d", contextAttributes?: CanvasRenderingContext2DSettings): + OffscreenCanvasRenderingContext2D | null; + getContext(contextId: "webgl", contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null; + getContext(contextId: string, contextAttributes?: {}): OffscreenCanvasRenderingContext2D + | WebGLRenderingContext | null; + transferToImageBitmap(): ImageBitmap; + convertToBlob(options?: { type?: string, quality?: number }): Promise; +} +declare var OffscreenCanvas: { + prototype: OffscreenCanvas; + new (width: number, height: number): OffscreenCanvas; +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/offscreencanvas/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/offscreencanvas/package.json new file mode 100644 index 000000000..dc51c8256 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/offscreencanvas/package.json @@ -0,0 +1,28 @@ +{ + "name": "@types/offscreencanvas", + "version": "2019.3.0", + "description": "TypeScript definitions for offscreencanvas-browser", + "license": "MIT", + "contributors": [ + { + "name": "Klaus Reimer", + "url": "https://github.com/kayahr", + "githubUsername": "kayahr" + } + ], + "main": "", + "types": "index", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/offscreencanvas" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "056f77b7b89302825048174c0427ed47126998207221760a9f2c9b47e0bacead", + "typeScriptVersion": "2.0" + +,"_resolved": "https://registry.npmjs.org/@types/offscreencanvas/-/offscreencanvas-2019.3.0.tgz" +,"_integrity": "sha512-esIJx9bQg+QYF0ra8GnvfianIY8qWB0GBx54PK5Eps6m+xTj86KLavHv6qDhzKcu5UUOgNfJ2pWaIIV7TRUd9Q==" +,"_from": "@types/offscreencanvas@2019.3.0" +} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/seedrandom/README.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/seedrandom/README.md new file mode 100644 index 000000000..17037fcba --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/seedrandom/README.md @@ -0,0 +1,18 @@ +# Installation +> `npm install --save @types/seedrandom` + +# Summary +This package contains type definitions for seedrandom 2.4.2 (https://github.com/davidbau/seedrandom). + +# Details +Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/seedrandom + +Additional Details + * Last updated: Mon, 19 Sep 2016 17:28:59 GMT + * File structure: UMD + * Library Dependencies: none + * Module Dependencies: none + * Global values: seedrandom + +# Credits +These definitions were written by Kern Handa . diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/seedrandom/index.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/seedrandom/index.d.ts new file mode 100644 index 000000000..4db50058b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/seedrandom/index.d.ts @@ -0,0 +1,45 @@ +// Type definitions for seedrandom 2.4.2 +// Project: https://github.com/davidbau/seedrandom +// Definitions by: Kern Handa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace seedrandom { + + export type seedrandomStateType = boolean | (() => prng); + + interface prng { + new (seed?: string, options?: seedRandomOptions, callback?: any): prng; + (): number; + quick(): number; + int32(): number; + double(): number; + state(): () => prng; + } + + interface seedrandom_prng { + (seed?: string, options?: seedRandomOptions, callback?: any): prng; + alea: (seed?: string, options?: seedRandomOptions, callback?: seedrandomCallback) => prng; + xor128: (seed?: string, options?: seedRandomOptions, callback?: seedrandomCallback) => prng; + tychei: (seed?: string, options?: seedRandomOptions, callback?: seedrandomCallback) => prng; + xorwow: (seed?: string, options?: seedRandomOptions, callback?: seedrandomCallback) => prng; + xor4096: (seed?: string, options?: seedRandomOptions, callback?: seedrandomCallback) => prng; + xorshift7: (seed?: string, options?: seedRandomOptions, callback?: seedrandomCallback) => prng; + quick: (seed?: string, options?: seedRandomOptions, callback?: seedrandomCallback) => prng; + } + + interface seedrandomCallback { + (prng?: prng, shortseed?: string, global?: boolean, state?: seedrandomStateType): prng; + } + + interface seedRandomOptions { + entropy?: boolean; + 'global'?: boolean; + state?: seedrandomStateType; + pass?: seedrandomCallback; + } +} + +declare var seedrandom: seedrandom.seedrandom_prng; + +export = seedrandom; +export as namespace seedrandom; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/seedrandom/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/seedrandom/package.json new file mode 100644 index 000000000..7af99b7f0 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/seedrandom/package.json @@ -0,0 +1,20 @@ +{ + "name": "@types/seedrandom", + "version": "2.4.27", + "description": "TypeScript definitions for seedrandom 2.4.2", + "license": "MIT", + "author": "Kern Handa ", + "main": "", + "repository": { + "type": "git", + "url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git" + }, + "scripts": {}, + "dependencies": {}, + "typings": "index.d.ts", + "typesPublisherContentHash": "6ad69483683964e97254f65e374a17f845154a74df41e5bf3ea0d53ec1b70e19" + +,"_resolved": "https://registry.npmjs.org/@types/seedrandom/-/seedrandom-2.4.27.tgz" +,"_integrity": "sha1-nbVjk33YaRX2kJK8QyWdL0hXjkE=" +,"_from": "@types/seedrandom@2.4.27" +} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/seedrandom/types-metadata.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/seedrandom/types-metadata.json new file mode 100644 index 000000000..22b36208f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/seedrandom/types-metadata.json @@ -0,0 +1,23 @@ +{ + "authors": "Kern Handa ", + "definitionFilename": "index.d.ts", + "libraryDependencies": [], + "moduleDependencies": [], + "libraryMajorVersion": "2", + "libraryMinorVersion": "4", + "libraryName": "seedrandom 2.4.2", + "typingsPackageName": "seedrandom", + "projectName": "https://github.com/davidbau/seedrandom", + "sourceRepoURL": "https://www.github.com/DefinitelyTyped/DefinitelyTyped", + "sourceBranch": "types-2.0", + "kind": "UMD", + "globals": [ + "seedrandom" + ], + "declaredModules": [], + "files": [ + "index.d.ts" + ], + "hasPackageJson": false, + "contentHash": "6ad69483683964e97254f65e374a17f845154a74df41e5bf3ea0d53ec1b70e19" +} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl-ext/LICENSE b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl-ext/LICENSE new file mode 100644 index 000000000..4b1ad51b2 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl-ext/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl-ext/README.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl-ext/README.md new file mode 100644 index 000000000..5f8ad2684 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl-ext/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/webgl-ext` + +# Summary +This package contains type definitions for WebGL Extensions (http://webgl.org/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webgl-ext + +Additional Details + * Last updated: Tue, 23 Oct 2018 17:03:26 GMT + * Dependencies: none + * Global values: none + +# Credits +These definitions were written by Arthur Langereis . diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl-ext/index.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl-ext/index.d.ts new file mode 100644 index 000000000..e8e2e94e2 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl-ext/index.d.ts @@ -0,0 +1,82 @@ +// Type definitions for WebGL Extensions +// Project: http://webgl.org/ +// Definitions by: Arthur Langereis +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/webgl-ext +// TypeScript Version: 2.7 + +// render-gl1/declarations - WebGL 1 extension definitions (beyond TS lib) +// Extracted from Stardazed - https://github.com/stardazed/stardazed + +interface HTMLCanvasElement { + getContext(contextId: "webgl" | "experimental-webgl", contextAttributes?: WebGLContextAttributes): (WebGLRenderingContext & WebGL1Extensions) | null; +} + +interface WebGL1Extensions { + getExtension(name: "EXT_color_buffer_half_float"): EXT_color_buffer_half_float; + + getExtension(name: "WEBGL_compressed_texture_atc"): WEBGL_compressed_texture_atc; + getExtension(name: "WEBGL_compressed_texture_etc1"): WEBGL_compressed_texture_etc1; + getExtension(name: "WEBGL_compressed_texture_pvrtc"): WEBKIT_WEBGL_compressed_texture_pvrtc; + + // Prefixed versions appearing in the wild as per February 2018 + getExtension(name: "WEBKIT_EXT_texture_filter_anisotropic"): EXT_texture_filter_anisotropic; // Chrome + getExtension(name: "WEBKIT_WEBGL_compressed_texture_atc"): WEBGL_compressed_texture_atc; // Android + getExtension(name: "WEBKIT_WEBGL_compressed_texture_pvrtc"): WEBKIT_WEBGL_compressed_texture_pvrtc; // Safari iOS + getExtension(name: "WEBKIT_WEBGL_compressed_texture_s3tc"): WEBGL_compressed_texture_s3tc; // Chrome + getExtension(name: "WEBKIT_WEBGL_depth_texture"): WEBGL_depth_texture; // Chrome + getExtension(name: "WEBKIT_WEBGL_lose_context"): WEBGL_lose_context; // Chrome +} + + +// WebGL 1 Type Branding +interface WebGLObject { readonly __WebGLObject: void; } +interface WebGLBuffer { readonly __WebGLBuffer: void; } +interface WebGLFramebuffer { readonly __WebGLFramebuffer: void; } +interface WebGLProgram { readonly __WebGLProgram: void; } +interface WebGLRenderbuffer { readonly __WebGLRenderbuffer: void; } +interface WebGLShader { readonly __WebGLShader: void; } +interface WebGLTexture { readonly __WebGLTexture: void; } +interface WebGLUniformLocation { readonly __WebGLUniformLocation: void; } +interface WebGLVertexArrayObjectOES extends WebGLObject { readonly __WebGLVertexArrayObjectOES: void; } + +interface EXT_frag_depth { readonly __EXT_frag_depth: void; } +interface EXT_shader_texture_lod { readonly __EXT_shader_texture_lod: void; } + +interface OES_element_index_uint { readonly __OESElementIndexUint: void; } +interface OES_texture_float { readonly __OES_texture_float: void; } +interface OES_texture_float_linear { readonly __OES_texture_float_linear: void; } +interface OES_texture_half_float_linear { readonly __OES_texture_half_float_linear: void; } + + +// WebGL 1 Extensions +interface EXT_color_buffer_half_float { + readonly RGBA16F_EXT: number; + readonly RGB16F_EXT: number; + readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: number; + readonly UNSIGNED_NORMALIZED_EXT: number; +} + +interface OES_vertex_array_object { + // TS's lib.dom (as of v3.1.3) does not specify the nulls + createVertexArrayOES(): WebGLVertexArrayObjectOES | null; + deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): void; + isVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): boolean; + bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): void; +} + +interface WEBGL_compressed_texture_atc { + readonly COMPRESSED_RGB_ATC_WEBGL: number; + readonly COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL: number; + readonly COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL: number; +} + +interface WEBGL_compressed_texture_etc1 { + readonly COMPRESSED_RGB_ETC1_WEBGL: number; +} + +interface WEBKIT_WEBGL_compressed_texture_pvrtc { + readonly COMPRESSED_RGB_PVRTC_4BPPV1_IMG: number; + readonly COMPRESSED_RGB_PVRTC_2BPPV1_IMG: number; + readonly COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: number; + readonly COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: number; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl-ext/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl-ext/package.json new file mode 100644 index 000000000..1180b2981 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl-ext/package.json @@ -0,0 +1,27 @@ +{ + "name": "@types/webgl-ext", + "version": "0.0.30", + "description": "TypeScript definitions for WebGL Extensions", + "license": "MIT", + "contributors": [ + { + "name": "Arthur Langereis", + "url": "https://github.com/zenmumbler", + "githubUsername": "zenmumbler" + } + ], + "main": "", + "types": "", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "c4fbe5a8c8557daa65dacda7d74d61020264991e65ea85898689a7f2e6692e16", + "typeScriptVersion": "2.7" + +,"_resolved": "https://registry.npmjs.org/@types/webgl-ext/-/webgl-ext-0.0.30.tgz" +,"_integrity": "sha512-LKVgNmBxN0BbljJrVUwkxwRYqzsAEPcZOe6S2T6ZaBDIrFp0qu4FNlpc5sM1tGbXUYFgdVQIoeLk1Y1UoblyEg==" +,"_from": "@types/webgl-ext@0.0.30" +} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl2/LICENSE b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl2/LICENSE new file mode 100644 index 000000000..4b1ad51b2 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl2/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl2/README.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl2/README.md new file mode 100644 index 000000000..ebf670193 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl2/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/webgl2` + +# Summary +This package contains type definitions for WebGL 2, Editor's Draft Fri Feb 24 16:10:18 2017 -0800 (https://www.khronos.org/registry/webgl/specs/latest/2.0/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webgl2 + +Additional Details + * Last updated: Thu, 11 Jul 2019 21:17:01 GMT + * Dependencies: none + * Global values: WebGL2RenderingContext, WebGLQuery, WebGLSampler, WebGLSync, WebGLTransformFeedback, WebGLVertexArrayObject + +# Credits +These definitions were written by Nico Kemnitz , and Adrian Blumer . diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl2/index.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl2/index.d.ts new file mode 100644 index 000000000..8adf0da80 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl2/index.d.ts @@ -0,0 +1,1193 @@ +// Type definitions for WebGL 2, Editor's Draft Fri Feb 24 16:10:18 2017 -0800 +// Project: https://www.khronos.org/registry/webgl/specs/latest/2.0/ +// Definitions by: Nico Kemnitz +// Adrian Blumer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface HTMLCanvasElement extends HTMLElement { + getContext(contextId: "webgl2" | "experimental-webgl2", contextAttributes?: WebGLContextAttributes): WebGL2RenderingContext | null; +} + +interface ImageBitmap { + readonly width: number; + readonly height: number; + close(): void; +} + +interface WebGL2RenderingContext extends WebGLRenderingContext { + readonly READ_BUFFER: number; // 0x0C02 + readonly UNPACK_ROW_LENGTH: number; // 0x0CF2 + readonly UNPACK_SKIP_ROWS: number; // 0x0CF3 + readonly UNPACK_SKIP_PIXELS: number; // 0x0CF4 + readonly PACK_ROW_LENGTH: number; // 0x0D02 + readonly PACK_SKIP_ROWS: number; // 0x0D03 + readonly PACK_SKIP_PIXELS: number; // 0x0D04 + readonly COLOR: number; // 0x1800 + readonly DEPTH: number; // 0x1801 + readonly STENCIL: number; // 0x1802 + readonly RED: number; // 0x1903 + readonly RGB8: number; // 0x8051 + readonly RGBA8: number; // 0x8058 + readonly RGB10_A2: number; // 0x8059 + readonly TEXTURE_BINDING_3D: number; // 0x806A + readonly UNPACK_SKIP_IMAGES: number; // 0x806D + readonly UNPACK_IMAGE_HEIGHT: number; // 0x806E + readonly TEXTURE_3D: number; // 0x806F + readonly TEXTURE_WRAP_R: number; // 0x8072 + readonly MAX_3D_TEXTURE_SIZE: number; // 0x8073 + readonly UNSIGNED_INT_2_10_10_10_REV: number; // 0x8368 + readonly MAX_ELEMENTS_VERTICES: number; // 0x80E8 + readonly MAX_ELEMENTS_INDICES: number; // 0x80E9 + readonly TEXTURE_MIN_LOD: number; // 0x813A + readonly TEXTURE_MAX_LOD: number; // 0x813B + readonly TEXTURE_BASE_LEVEL: number; // 0x813C + readonly TEXTURE_MAX_LEVEL: number; // 0x813D + readonly MIN: number; // 0x8007 + readonly MAX: number; // 0x8008 + readonly DEPTH_COMPONENT24: number; // 0x81A6 + readonly MAX_TEXTURE_LOD_BIAS: number; // 0x84FD + readonly TEXTURE_COMPARE_MODE: number; // 0x884C + readonly TEXTURE_COMPARE_FUNC: number; // 0x884D + readonly CURRENT_QUERY: number; // 0x8865 + readonly QUERY_RESULT: number; // 0x8866 + readonly QUERY_RESULT_AVAILABLE: number; // 0x8867 + readonly STREAM_READ: number; // 0x88E1 + readonly STREAM_COPY: number; // 0x88E2 + readonly STATIC_READ: number; // 0x88E5 + readonly STATIC_COPY: number; // 0x88E6 + readonly DYNAMIC_READ: number; // 0x88E9 + readonly DYNAMIC_COPY: number; // 0x88EA + readonly MAX_DRAW_BUFFERS: number; // 0x8824 + readonly DRAW_BUFFER0: number; // 0x8825 + readonly DRAW_BUFFER1: number; // 0x8826 + readonly DRAW_BUFFER2: number; // 0x8827 + readonly DRAW_BUFFER3: number; // 0x8828 + readonly DRAW_BUFFER4: number; // 0x8829 + readonly DRAW_BUFFER5: number; // 0x882A + readonly DRAW_BUFFER6: number; // 0x882B + readonly DRAW_BUFFER7: number; // 0x882C + readonly DRAW_BUFFER8: number; // 0x882D + readonly DRAW_BUFFER9: number; // 0x882E + readonly DRAW_BUFFER10: number; // 0x882F + readonly DRAW_BUFFER11: number; // 0x8830 + readonly DRAW_BUFFER12: number; // 0x8831 + readonly DRAW_BUFFER13: number; // 0x8832 + readonly DRAW_BUFFER14: number; // 0x8833 + readonly DRAW_BUFFER15: number; // 0x8834 + readonly MAX_FRAGMENT_UNIFORM_COMPONENTS: number; // 0x8B49 + readonly MAX_VERTEX_UNIFORM_COMPONENTS: number; // 0x8B4A + readonly SAMPLER_3D: number; // 0x8B5F + readonly SAMPLER_2D_SHADOW: number; // 0x8B62 + readonly FRAGMENT_SHADER_DERIVATIVE_HINT: number; // 0x8B8B + readonly PIXEL_PACK_BUFFER: number; // 0x88EB + readonly PIXEL_UNPACK_BUFFER: number; // 0x88EC + readonly PIXEL_PACK_BUFFER_BINDING: number; // 0x88ED + readonly PIXEL_UNPACK_BUFFER_BINDING: number; // 0x88EF + readonly FLOAT_MAT2x3: number; // 0x8B65 + readonly FLOAT_MAT2x4: number; // 0x8B66 + readonly FLOAT_MAT3x2: number; // 0x8B67 + readonly FLOAT_MAT3x4: number; // 0x8B68 + readonly FLOAT_MAT4x2: number; // 0x8B69 + readonly FLOAT_MAT4x3: number; // 0x8B6A + readonly SRGB: number; // 0x8C40 + readonly SRGB8: number; // 0x8C41 + readonly SRGB8_ALPHA8: number; // 0x8C43 + readonly COMPARE_REF_TO_TEXTURE: number; // 0x884E + readonly RGBA32F: number; // 0x8814 + readonly RGB32F: number; // 0x8815 + readonly RGBA16F: number; // 0x881A + readonly RGB16F: number; // 0x881B + readonly VERTEX_ATTRIB_ARRAY_INTEGER: number; // 0x88FD + readonly MAX_ARRAY_TEXTURE_LAYERS: number; // 0x88FF + readonly MIN_PROGRAM_TEXEL_OFFSET: number; // 0x8904 + readonly MAX_PROGRAM_TEXEL_OFFSET: number; // 0x8905 + readonly MAX_VARYING_COMPONENTS: number; // 0x8B4B + readonly TEXTURE_2D_ARRAY: number; // 0x8C1A + readonly TEXTURE_BINDING_2D_ARRAY: number; // 0x8C1D + readonly R11F_G11F_B10F: number; // 0x8C3A + readonly UNSIGNED_INT_10F_11F_11F_REV: number; // 0x8C3B + readonly RGB9_E5: number; // 0x8C3D + readonly UNSIGNED_INT_5_9_9_9_REV: number; // 0x8C3E + readonly TRANSFORM_FEEDBACK_BUFFER_MODE: number; // 0x8C7F + readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: number; // 0x8C80 + readonly TRANSFORM_FEEDBACK_VARYINGS: number; // 0x8C83 + readonly TRANSFORM_FEEDBACK_BUFFER_START: number; // 0x8C84 + readonly TRANSFORM_FEEDBACK_BUFFER_SIZE: number; // 0x8C85 + readonly TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: number; // 0x8C88 + readonly RASTERIZER_DISCARD: number; // 0x8C89 + readonly MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: number; // 0x8C8A + readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: number; // 0x8C8B + readonly INTERLEAVED_ATTRIBS: number; // 0x8C8C + readonly SEPARATE_ATTRIBS: number; // 0x8C8D + readonly TRANSFORM_FEEDBACK_BUFFER: number; // 0x8C8E + readonly TRANSFORM_FEEDBACK_BUFFER_BINDING: number; // 0x8C8F + readonly RGBA32UI: number; // 0x8D70 + readonly RGB32UI: number; // 0x8D71 + readonly RGBA16UI: number; // 0x8D76 + readonly RGB16UI: number; // 0x8D77 + readonly RGBA8UI: number; // 0x8D7C + readonly RGB8UI: number; // 0x8D7D + readonly RGBA32I: number; // 0x8D82 + readonly RGB32I: number; // 0x8D83 + readonly RGBA16I: number; // 0x8D88 + readonly RGB16I: number; // 0x8D89 + readonly RGBA8I: number; // 0x8D8E + readonly RGB8I: number; // 0x8D8F + readonly RED_INTEGER: number; // 0x8D94 + readonly RGB_INTEGER: number; // 0x8D98 + readonly RGBA_INTEGER: number; // 0x8D99 + readonly SAMPLER_2D_ARRAY: number; // 0x8DC1 + readonly SAMPLER_2D_ARRAY_SHADOW: number; // 0x8DC4 + readonly SAMPLER_CUBE_SHADOW: number; // 0x8DC5 + readonly UNSIGNED_INT_VEC2: number; // 0x8DC6 + readonly UNSIGNED_INT_VEC3: number; // 0x8DC7 + readonly UNSIGNED_INT_VEC4: number; // 0x8DC8 + readonly INT_SAMPLER_2D: number; // 0x8DCA + readonly INT_SAMPLER_3D: number; // 0x8DCB + readonly INT_SAMPLER_CUBE: number; // 0x8DCC + readonly INT_SAMPLER_2D_ARRAY: number; // 0x8DCF + readonly UNSIGNED_INT_SAMPLER_2D: number; // 0x8DD2 + readonly UNSIGNED_INT_SAMPLER_3D: number; // 0x8DD3 + readonly UNSIGNED_INT_SAMPLER_CUBE: number; // 0x8DD4 + readonly UNSIGNED_INT_SAMPLER_2D_ARRAY: number; // 0x8DD7 + readonly DEPTH_COMPONENT32F: number; // 0x8CAC + readonly DEPTH32F_STENCIL8: number; // 0x8CAD + readonly FLOAT_32_UNSIGNED_INT_24_8_REV: number; // 0x8DAD + readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: number; // 0x8210 + readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: number; // 0x8211 + readonly FRAMEBUFFER_ATTACHMENT_RED_SIZE: number; // 0x8212 + readonly FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: number; // 0x8213 + readonly FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: number; // 0x8214 + readonly FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: number; // 0x8215 + readonly FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: number; // 0x8216 + readonly FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: number; // 0x8217 + readonly FRAMEBUFFER_DEFAULT: number; // 0x8218 + //readonly DEPTH_STENCIL_ATTACHMENT: number; // 0x821A /* Already defined in WebGL1 constants */ + //readonly DEPTH_STENCIL: number; // 0x84F9 /* Already defined in WebGL1 constants */ + readonly UNSIGNED_INT_24_8: number; // 0x84FA + readonly DEPTH24_STENCIL8: number; // 0x88F0 + readonly UNSIGNED_NORMALIZED: number; // 0x8C17 + readonly DRAW_FRAMEBUFFER_BINDING: number; // 0x8CA6 /* Same as FRAMEBUFFER_BINDING */ + readonly READ_FRAMEBUFFER: number; // 0x8CA8 + readonly DRAW_FRAMEBUFFER: number; // 0x8CA9 + readonly READ_FRAMEBUFFER_BINDING: number; // 0x8CAA + readonly RENDERBUFFER_SAMPLES: number; // 0x8CAB + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: number; // 0x8CD4 + readonly MAX_COLOR_ATTACHMENTS: number; // 0x8CDF + readonly COLOR_ATTACHMENT1: number; // 0x8CE1 + readonly COLOR_ATTACHMENT2: number; // 0x8CE2 + readonly COLOR_ATTACHMENT3: number; // 0x8CE3 + readonly COLOR_ATTACHMENT4: number; // 0x8CE4 + readonly COLOR_ATTACHMENT5: number; // 0x8CE5 + readonly COLOR_ATTACHMENT6: number; // 0x8CE6 + readonly COLOR_ATTACHMENT7: number; // 0x8CE7 + readonly COLOR_ATTACHMENT8: number; // 0x8CE8 + readonly COLOR_ATTACHMENT9: number; // 0x8CE9 + readonly COLOR_ATTACHMENT10: number; // 0x8CEA + readonly COLOR_ATTACHMENT11: number; // 0x8CEB + readonly COLOR_ATTACHMENT12: number; // 0x8CEC + readonly COLOR_ATTACHMENT13: number; // 0x8CED + readonly COLOR_ATTACHMENT14: number; // 0x8CEE + readonly COLOR_ATTACHMENT15: number; // 0x8CEF + readonly FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: number; // 0x8D56 + readonly MAX_SAMPLES: number; // 0x8D57 + readonly HALF_FLOAT: number; // 0x140B + readonly RG: number; // 0x8227 + readonly RG_INTEGER: number; // 0x8228 + readonly R8: number; // 0x8229 + readonly RG8: number; // 0x822B + readonly R16F: number; // 0x822D + readonly R32F: number; // 0x822E + readonly RG16F: number; // 0x822F + readonly RG32F: number; // 0x8230 + readonly R8I: number; // 0x8231 + readonly R8UI: number; // 0x8232 + readonly R16I: number; // 0x8233 + readonly R16UI: number; // 0x8234 + readonly R32I: number; // 0x8235 + readonly R32UI: number; // 0x8236 + readonly RG8I: number; // 0x8237 + readonly RG8UI: number; // 0x8238 + readonly RG16I: number; // 0x8239 + readonly RG16UI: number; // 0x823A + readonly RG32I: number; // 0x823B + readonly RG32UI: number; // 0x823C + readonly VERTEX_ARRAY_BINDING: number; // 0x85B5 + readonly R8_SNORM: number; // 0x8F94 + readonly RG8_SNORM: number; // 0x8F95 + readonly RGB8_SNORM: number; // 0x8F96 + readonly RGBA8_SNORM: number; // 0x8F97 + readonly SIGNED_NORMALIZED: number; // 0x8F9C + readonly COPY_READ_BUFFER: number; // 0x8F36 + readonly COPY_WRITE_BUFFER: number; // 0x8F37 + readonly COPY_READ_BUFFER_BINDING: number; // 0x8F36 /* Same as COPY_READ_BUFFER */ + readonly COPY_WRITE_BUFFER_BINDING: number; // 0x8F37 /* Same as COPY_WRITE_BUFFER */ + readonly UNIFORM_BUFFER: number; // 0x8A11 + readonly UNIFORM_BUFFER_BINDING: number; // 0x8A28 + readonly UNIFORM_BUFFER_START: number; // 0x8A29 + readonly UNIFORM_BUFFER_SIZE: number; // 0x8A2A + readonly MAX_VERTEX_UNIFORM_BLOCKS: number; // 0x8A2B + readonly MAX_FRAGMENT_UNIFORM_BLOCKS: number; // 0x8A2D + readonly MAX_COMBINED_UNIFORM_BLOCKS: number; // 0x8A2E + readonly MAX_UNIFORM_BUFFER_BINDINGS: number; // 0x8A2F + readonly MAX_UNIFORM_BLOCK_SIZE: number; // 0x8A30 + readonly MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: number; // 0x8A31 + readonly MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: number; // 0x8A33 + readonly UNIFORM_BUFFER_OFFSET_ALIGNMENT: number; // 0x8A34 + readonly ACTIVE_UNIFORM_BLOCKS: number; // 0x8A36 + readonly UNIFORM_TYPE: number; // 0x8A37 + readonly UNIFORM_SIZE: number; // 0x8A38 + readonly UNIFORM_BLOCK_INDEX: number; // 0x8A3A + readonly UNIFORM_OFFSET: number; // 0x8A3B + readonly UNIFORM_ARRAY_STRIDE: number; // 0x8A3C + readonly UNIFORM_MATRIX_STRIDE: number; // 0x8A3D + readonly UNIFORM_IS_ROW_MAJOR: number; // 0x8A3E + readonly UNIFORM_BLOCK_BINDING: number; // 0x8A3F + readonly UNIFORM_BLOCK_DATA_SIZE: number; // 0x8A40 + readonly UNIFORM_BLOCK_ACTIVE_UNIFORMS: number; // 0x8A42 + readonly UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: number; // 0x8A43 + readonly UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: number; // 0x8A44 + readonly UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: number; // 0x8A46 + readonly INVALID_INDEX: number; // 0xFFFFFFFF + readonly MAX_VERTEX_OUTPUT_COMPONENTS: number; // 0x9122 + readonly MAX_FRAGMENT_INPUT_COMPONENTS: number; // 0x9125 + readonly MAX_SERVER_WAIT_TIMEOUT: number; // 0x9111 + readonly OBJECT_TYPE: number; // 0x9112 + readonly SYNC_CONDITION: number; // 0x9113 + readonly SYNC_STATUS: number; // 0x9114 + readonly SYNC_FLAGS: number; // 0x9115 + readonly SYNC_FENCE: number; // 0x9116 + readonly SYNC_GPU_COMMANDS_COMPLETE: number; // 0x9117 + readonly UNSIGNALED: number; // 0x9118 + readonly SIGNALED: number; // 0x9119 + readonly ALREADY_SIGNALED: number; // 0x911A + readonly TIMEOUT_EXPIRED: number; // 0x911B + readonly CONDITION_SATISFIED: number; // 0x911C + readonly WAIT_FAILED: number; // 0x911D + readonly SYNC_FLUSH_COMMANDS_BIT: number; // 0x00000001 + readonly VERTEX_ATTRIB_ARRAY_DIVISOR: number; // 0x88FE + readonly ANY_SAMPLES_PASSED: number; // 0x8C2F + readonly ANY_SAMPLES_PASSED_CONSERVATIVE: number; // 0x8D6A + readonly SAMPLER_BINDING: number; // 0x8919 + readonly RGB10_A2UI: number; // 0x906F + readonly INT_2_10_10_10_REV: number; // 0x8D9F + readonly TRANSFORM_FEEDBACK: number; // 0x8E22 + readonly TRANSFORM_FEEDBACK_PAUSED: number; // 0x8E23 + readonly TRANSFORM_FEEDBACK_ACTIVE: number; // 0x8E24 + readonly TRANSFORM_FEEDBACK_BINDING: number; // 0x8E25 + readonly TEXTURE_IMMUTABLE_FORMAT: number; // 0x912F + readonly MAX_ELEMENT_INDEX: number; // 0x8D6B + readonly TEXTURE_IMMUTABLE_LEVELS: number; // 0x82DF + + readonly TIMEOUT_IGNORED: number; // -1 + + /* WebGL-specific enums */ + readonly MAX_CLIENT_WAIT_TIMEOUT_WEBGL: number; // 0x9247 + + + /* Buffer objects */ + // WebGL1: + bufferData(target: number, sizeOrData: number | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | + Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, usage: number): void; + bufferSubData(target: number, dstByteOffset: number, srcData: Int8Array | Int16Array | Int32Array | Uint8Array | + Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): void; + // For compatibility with WebGL 1 context in older Typescript versions. + bufferData(target: number, data: ArrayBufferView, usage: number): void; + bufferSubData(target: number, dstByteOffset: number, srcData: ArrayBufferView): void; + // WebGL2: + bufferData(target: number, srcData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | + Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, usage: number, srcOffset: number, length?: number): void; + bufferSubData(target: number, dstByteOffset: number, srcData: ArrayBufferView, + srcOffset: number, length?: number): void; + + copyBufferSubData(readTarget: number, writeTarget: number, readOffset: number, + writeOffset: number, size: number): void; + // MapBufferRange, in particular its read-only and write-only modes, + // can not be exposed safely to JavaScript. GetBufferSubData + // replaces it for the purpose of fetching data back from the GPU. + getBufferSubData(target: number, srcByteOffset: number, dstBuffer: ArrayBufferView, + dstOffset?: number, length?: number): void; + + /* Framebuffer objects */ + blitFramebuffer(srcX0: number, srcY0: number, srcX1: number, srcY1: number, dstX0: number, dstY0: number, + dstX1: number, dstY1: number, mask: number, filter: number): void; + framebufferTextureLayer(target: number, attachment: number, texture: WebGLTexture | null, level: number, + layer: number): void; + invalidateFramebuffer(target: number, attachments: number[]): void; + invalidateSubFramebuffer(target: number, attachments: number[], + x: number, y: number, width: number, height: number): void; + readBuffer(src: number): void; + + /* Renderbuffer objects */ + getInternalformatParameter(target: number, internalformat: number, pname: number): any; + renderbufferStorageMultisample(target: number, samples: number, internalformat: number, + width: number, height: number): void; + + /* Texture objects */ + texStorage2D(target: number, levels: number, internalformat: number, width: number, + height: number): void; + texStorage3D(target: number, levels: number, internalformat: number, width: number, + height: number, depth: number): void; + + // WebGL1 legacy entrypoints: + texImage2D(target: number, level: number, internalformat: number, + width: number, height: number, border: number, format: number, + type: number, pixels?: ArrayBufferView | null): void; + texImage2D(target: number, level: number, internalformat: number, + format: number, type: number, source: ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): void; // May throw DOMException + texImage2D(target: number, level: number, internalformat: number, + format: number, type: number, source: ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): void; // May throw DOMException + + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, + width: number, height: number, + format: number, type: number, pixels?: ArrayBufferView | null): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, + format: number, type: number, source: ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): void; // May throw DOMException + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, + format: number, type: number, source: ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): void; // May throw DOMException + + // WebGL2 entrypoints: + texImage2D(target: number, level: number, internalformat: number, width: number, height: number, + border: number, format: number, type: number, pboOffset: number): void; + texImage2D(target: number, level: number, internalformat: number, width: number, height: number, + border: number, format: number, type: number, + source: ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): void; // May throw DOMException + texImage2D(target: number, level: number, internalformat: number, width: number, height: number, + border: number, format: number, type: number, srcData: ArrayBufferView, + srcOffset: number): void; + + texImage3D(target: number, level: number, internalformat: number, width: number, height: number, + depth: number, border: number, format: number, type: number, pboOffset: number): void; + texImage3D(target: number, level: number, internalformat: number, width: number, height: number, + depth: number, border: number, format: number, type: number, + source: ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): void; // May throw DOMException + texImage3D(target: number, level: number, internalformat: number, width: number, height: number, + depth: number, border: number, format: number, type: number, srcData: ArrayBufferView | null): void; + texImage3D(target: number, level: number, internalformat: number, width: number, height: number, + depth: number, border: number, format: number, type: number, srcData: ArrayBufferView, + srcOffset: number): void; + + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, + height: number, format: number, type: number, pboOffset: number): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, + height: number, format: number, type: number, + source: ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): void; // May throw DOMException + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, + height: number, format: number, type: number, srcData: ArrayBufferView, + srcOffset: number): void; + + texSubImage3D(target: number, level: number, xoffset: number, yoffset: number, zoffset: number, + width: number, height: number, depth: number, format: number, type: number, + pboOffset: number): void; + texSubImage3D(target: number, level: number, xoffset: number, yoffset: number, zoffset: number, + width: number, height: number, depth: number, format: number, type: number, + source: ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): void; // May throw DOMException + texSubImage3D(target: number, level: number, xoffset: number, yoffset: number, zoffset: number, + width: number, height: number, depth: number, format: number, type: number, + srcData: ArrayBufferView | null, srcOffset?: number): void; + + copyTexSubImage3D(target: number, level: number, xoffset: number, yoffset: number, zoffset: number, + x: number, y: number, width: number, height: number): void; + + compressedTexImage2D(target: number, level: number, internalformat: number, width: number, + height: number, border: number, imageSize: number, offset: number): void; + compressedTexImage2D(target: number, level: number, internalformat: number, width: number, + height: number, border: number, srcData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | + Uint8ClampedArray | Float32Array | Float64Array | DataView | null, srcOffset?: number, srcLengthOverride?: number): void; + // For compatibility with WebGL 1 context in older Typescript versions. + compressedTexImage2D(target: number, level: number, internalformat: number, width: number, + height: number, border: number, srcData: ArrayBufferView, + srcOffset?: number, srcLengthOverride?: number): void; + + compressedTexImage3D(target: number, level: number, internalformat: number, width: number, + height: number, depth: number, border: number, imageSize: number, offset: number): void; + compressedTexImage3D(target: number, level: number, internalformat: number, width: number, + height: number, depth: number, border: number, srcData: ArrayBufferView, + srcOffset?: number, srcLengthOverride?: number): void; + + compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, + width: number, height: number, format: number, imageSize: number, offset: number): void; + compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, + width: number, height: number, format: number, + srcData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | + Uint8ClampedArray | Float32Array | Float64Array | DataView | null, srcOffset?: number, srcLengthOverride?: number): void; + // For compatibility with WebGL 1 context in older Typescript versions. + compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, + width: number, height: number, format: number, + srcData: ArrayBufferView | null, + srcOffset?: number, + srcLengthOverride?: number): void; + + compressedTexSubImage3D(target: number, level: number, xoffset: number, yoffset: number, + zoffset: number, width: number, height: number, depth: number, + format: number, imageSize: number, offset: number): void; + compressedTexSubImage3D(target: number, level: number, xoffset: number, yoffset: number, + zoffset: number, width: number, height: number, depth: number, + format: number, srcData: ArrayBufferView, + srcOffset?: number, + srcLengthOverride?: number): void; + + /* Programs and shaders */ + getFragDataLocation(program: WebGLProgram, name: string): number; + + /* Uniforms */ + uniform1ui(location: WebGLUniformLocation | null, v0: number): void; + uniform2ui(location: WebGLUniformLocation | null, v0: number, v1: number): void; + uniform3ui(location: WebGLUniformLocation | null, v0: number, v1: number, v2: number): void; + uniform4ui(location: WebGLUniformLocation | null, v0: number, v1: number, v2: number, v3: number): void; + + uniform1fv(location: WebGLUniformLocation | null, data: Float32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + uniform2fv(location: WebGLUniformLocation | null, data: Float32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + uniform3fv(location: WebGLUniformLocation | null, data: Float32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + uniform4fv(location: WebGLUniformLocation | null, data: Float32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + + uniform1iv(location: WebGLUniformLocation | null, data: Int32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + uniform2iv(location: WebGLUniformLocation | null, data: Int32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + uniform3iv(location: WebGLUniformLocation | null, data: Int32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + uniform4iv(location: WebGLUniformLocation | null, data: Int32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + + uniform1uiv(location: WebGLUniformLocation | null, data: Uint32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + uniform2uiv(location: WebGLUniformLocation | null, data: Uint32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + uniform3uiv(location: WebGLUniformLocation | null, data: Uint32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + uniform4uiv(location: WebGLUniformLocation | null, data: Uint32Array | ArrayLike, srcOffset?: number, + srcLength?: number): void; + + uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, + srcOffset?: number, srcLength?: number): void; + uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, + srcOffset?: number, srcLength?: number): void; + uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, + srcOffset?: number, srcLength?: number): void; + + uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, + srcOffset?: number, srcLength?: number): void; + uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, + srcOffset?: number, srcLength?: number): void; + uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, + srcOffset?: number, srcLength?: number): void; + + uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, + srcOffset?: number, srcLength?: number): void; + uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, + srcOffset?: number, srcLength?: number): void; + uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, + srcOffset?: number, srcLength?: number): void; + + /* Vertex attribs */ + vertexAttribI4i(index: number, x: number, y: number, z: number, w: number): void; + vertexAttribI4iv(index: number, values: Int32Array | ArrayLike): void; + vertexAttribI4ui(index: number, x: number, y: number, z: number, w: number): void; + vertexAttribI4uiv(index: number, values: Uint32Array | ArrayLike): void; + vertexAttribIPointer(index: number, size: number, type: number, stride: number, offset: number): void; + + /* Writing to the drawing buffer */ + vertexAttribDivisor(index: number, divisor: number): void; + drawArraysInstanced(mode: number, first: number, count: number, instanceCount: number): void; + drawElementsInstanced(mode: number, count: number, type: number, offset: number, instanceCount: number): void; + drawRangeElements(mode: number, start: number, end: number, count: number, type: number, offset: number): void; + + /* Reading back pixels */ + // WebGL1: + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, + dstData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | + Float32Array | Float64Array | DataView | null): void; + // For compatibility with WebGL 1 context in older Typescript versions. + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, + dstData: ArrayBufferView | null): void; + // WebGL2: + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, + offset: number): void; + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, + dstData: ArrayBufferView, dstOffset: number): void; + + /* Multiple Render Targets */ + drawBuffers(buffers: number[]): void; + + clearBufferfv(buffer: number, drawbuffer: number, values: Float32Array | ArrayLike, + srcOffset?: number): void; + clearBufferiv(buffer: number, drawbuffer: number, values: Int32Array | ArrayLike, + srcOffset?: number): void; + clearBufferuiv(buffer: number, drawbuffer: number, values: Uint32Array | ArrayLike, + srcOffset?: number): void; + + clearBufferfi(buffer: number, drawbuffer: number, depth: number, stencil: number): void; + + /* Query Objects */ + createQuery(): WebGLQuery | null; + deleteQuery(query: WebGLQuery | null): void; + isQuery(query: WebGLQuery | null): boolean; //[WebGLHandlesContextLoss] + beginQuery(target: number, query: WebGLQuery): void; + endQuery(target: number): void; + getQuery(target: number, pname: number): WebGLQuery | null; + getQueryParameter(query: WebGLQuery, pname: number): any; + + /* Sampler Objects */ + createSampler(): WebGLSampler | null; + deleteSampler(sampler: WebGLSampler | null): void; + isSampler(sampler: WebGLSampler | null): boolean; //[WebGLHandlesContextLoss] + bindSampler(unit: number, sampler: WebGLSampler | null): void; + samplerParameteri(sampler: WebGLSampler, pname: number, param: number): void; + samplerParameterf(sampler: WebGLSampler, pname: number, param: number): void; + getSamplerParameter(sampler: WebGLSampler, pname: number): any; + + /* Sync objects */ + fenceSync(condition: number, flags: number): WebGLSync | null; + isSync(sync: WebGLSync | null): boolean; //[WebGLHandlesContextLoss] + deleteSync(sync: WebGLSync | null): void; + clientWaitSync(sync: WebGLSync, flags: number, timeout: number): number; + waitSync(sync: WebGLSync, flags: number, timeout: number): void; + getSyncParameter(sync: WebGLSync, pname: number): any; + + /* Transform Feedback */ + createTransformFeedback(): WebGLTransformFeedback | null; + deleteTransformFeedback(tf: WebGLTransformFeedback | null): void; + isTransformFeedback(tf: WebGLTransformFeedback | null): boolean; //[WebGLHandlesContextLoss] + bindTransformFeedback(target: number, tf: WebGLTransformFeedback | null): void; + beginTransformFeedback(primitiveMode: number): void; + endTransformFeedback(): void; + transformFeedbackVaryings(program: WebGLProgram, varyings: string[], bufferMode: number): void; + getTransformFeedbackVarying(program: WebGLProgram, index: number): WebGLActiveInfo | null; + pauseTransformFeedback(): void; + resumeTransformFeedback(): void; + + /* Uniform Buffer Objects and Transform Feedback Buffers */ + bindBufferBase(target: number, index: number, buffer: WebGLBuffer | null): void; + bindBufferRange(target: number, index: number, buffer: WebGLBuffer | null, offset: number, size: number): void; + getIndexedParameter(target: number, index: number): any; + getUniformIndices(program: WebGLProgram, uniformNames: string[]): number[] | null; + getActiveUniforms(program: WebGLProgram, uniformIndices: number[], pname: number): any; + getUniformBlockIndex(program: WebGLProgram, uniformBlockName: string): number; + getActiveUniformBlockParameter(program: WebGLProgram, uniformBlockIndex: number, pname: number): any; + getActiveUniformBlockName(program: WebGLProgram, uniformBlockIndex: number): string | null; + uniformBlockBinding(program: WebGLProgram, uniformBlockIndex: number, uniformBlockBinding: number): void; + + /* Vertex Array Objects */ + createVertexArray(): WebGLVertexArrayObject | null; + deleteVertexArray(vertexArray: WebGLVertexArrayObject | null): void; + isVertexArray(vertexArray: WebGLVertexArrayObject | null): boolean; //[WebGLHandlesContextLoss] + bindVertexArray(array: WebGLVertexArrayObject | null): void; +} + +declare var WebGL2RenderingContext: { + prototype: WebGL2RenderingContext; + new (): WebGL2RenderingContext; + + /* WebGL1 constants */ + readonly ACTIVE_ATTRIBUTES: number; + readonly ACTIVE_TEXTURE: number; + readonly ACTIVE_UNIFORMS: number; + readonly ALIASED_LINE_WIDTH_RANGE: number; + readonly ALIASED_POINT_SIZE_RANGE: number; + readonly ALPHA: number; + readonly ALPHA_BITS: number; + readonly ALWAYS: number; + readonly ARRAY_BUFFER: number; + readonly ARRAY_BUFFER_BINDING: number; + readonly ATTACHED_SHADERS: number; + readonly BACK: number; + readonly BLEND: number; + readonly BLEND_COLOR: number; + readonly BLEND_DST_ALPHA: number; + readonly BLEND_DST_RGB: number; + readonly BLEND_EQUATION: number; + readonly BLEND_EQUATION_ALPHA: number; + readonly BLEND_EQUATION_RGB: number; + readonly BLEND_SRC_ALPHA: number; + readonly BLEND_SRC_RGB: number; + readonly BLUE_BITS: number; + readonly BOOL: number; + readonly BOOL_VEC2: number; + readonly BOOL_VEC3: number; + readonly BOOL_VEC4: number; + readonly BROWSER_DEFAULT_WEBGL: number; + readonly BUFFER_SIZE: number; + readonly BUFFER_USAGE: number; + readonly BYTE: number; + readonly CCW: number; + readonly CLAMP_TO_EDGE: number; + readonly COLOR_ATTACHMENT0: number; + readonly COLOR_BUFFER_BIT: number; + readonly COLOR_CLEAR_VALUE: number; + readonly COLOR_WRITEMASK: number; + readonly COMPILE_STATUS: number; + readonly COMPRESSED_TEXTURE_FORMATS: number; + readonly CONSTANT_ALPHA: number; + readonly CONSTANT_COLOR: number; + readonly CONTEXT_LOST_WEBGL: number; + readonly CULL_FACE: number; + readonly CULL_FACE_MODE: number; + readonly CURRENT_PROGRAM: number; + readonly CURRENT_VERTEX_ATTRIB: number; + readonly CW: number; + readonly DECR: number; + readonly DECR_WRAP: number; + readonly DELETE_STATUS: number; + readonly DEPTH_ATTACHMENT: number; + readonly DEPTH_BITS: number; + readonly DEPTH_BUFFER_BIT: number; + readonly DEPTH_CLEAR_VALUE: number; + readonly DEPTH_COMPONENT: number; + readonly DEPTH_COMPONENT16: number; + readonly DEPTH_FUNC: number; + readonly DEPTH_RANGE: number; + readonly DEPTH_STENCIL: number; + readonly DEPTH_STENCIL_ATTACHMENT: number; + readonly DEPTH_TEST: number; + readonly DEPTH_WRITEMASK: number; + readonly DITHER: number; + readonly DONT_CARE: number; + readonly DST_ALPHA: number; + readonly DST_COLOR: number; + readonly DYNAMIC_DRAW: number; + readonly ELEMENT_ARRAY_BUFFER: number; + readonly ELEMENT_ARRAY_BUFFER_BINDING: number; + readonly EQUAL: number; + readonly FASTEST: number; + readonly FLOAT: number; + readonly FLOAT_MAT2: number; + readonly FLOAT_MAT3: number; + readonly FLOAT_MAT4: number; + readonly FLOAT_VEC2: number; + readonly FLOAT_VEC3: number; + readonly FLOAT_VEC4: number; + readonly FRAGMENT_SHADER: number; + readonly FRAMEBUFFER: number; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + readonly FRAMEBUFFER_BINDING: number; + readonly FRAMEBUFFER_COMPLETE: number; + readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + readonly FRAMEBUFFER_UNSUPPORTED: number; + readonly FRONT: number; + readonly FRONT_AND_BACK: number; + readonly FRONT_FACE: number; + readonly FUNC_ADD: number; + readonly FUNC_REVERSE_SUBTRACT: number; + readonly FUNC_SUBTRACT: number; + readonly GENERATE_MIPMAP_HINT: number; + readonly GEQUAL: number; + readonly GREATER: number; + readonly GREEN_BITS: number; + readonly HIGH_FLOAT: number; + readonly HIGH_INT: number; + readonly IMPLEMENTATION_COLOR_READ_FORMAT: number; + readonly IMPLEMENTATION_COLOR_READ_TYPE: number; + readonly INCR: number; + readonly INCR_WRAP: number; + readonly INT: number; + readonly INT_VEC2: number; + readonly INT_VEC3: number; + readonly INT_VEC4: number; + readonly INVALID_ENUM: number; + readonly INVALID_FRAMEBUFFER_OPERATION: number; + readonly INVALID_OPERATION: number; + readonly INVALID_VALUE: number; + readonly INVERT: number; + readonly KEEP: number; + readonly LEQUAL: number; + readonly LESS: number; + readonly LINEAR: number; + readonly LINEAR_MIPMAP_LINEAR: number; + readonly LINEAR_MIPMAP_NEAREST: number; + readonly LINES: number; + readonly LINE_LOOP: number; + readonly LINE_STRIP: number; + readonly LINE_WIDTH: number; + readonly LINK_STATUS: number; + readonly LOW_FLOAT: number; + readonly LOW_INT: number; + readonly LUMINANCE: number; + readonly LUMINANCE_ALPHA: number; + readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + readonly MAX_CUBE_MAP_TEXTURE_SIZE: number; + readonly MAX_FRAGMENT_UNIFORM_VECTORS: number; + readonly MAX_RENDERBUFFER_SIZE: number; + readonly MAX_TEXTURE_IMAGE_UNITS: number; + readonly MAX_TEXTURE_SIZE: number; + readonly MAX_VARYING_VECTORS: number; + readonly MAX_VERTEX_ATTRIBS: number; + readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + readonly MAX_VERTEX_UNIFORM_VECTORS: number; + readonly MAX_VIEWPORT_DIMS: number; + readonly MEDIUM_FLOAT: number; + readonly MEDIUM_INT: number; + readonly MIRRORED_REPEAT: number; + readonly NEAREST: number; + readonly NEAREST_MIPMAP_LINEAR: number; + readonly NEAREST_MIPMAP_NEAREST: number; + readonly NEVER: number; + readonly NICEST: number; + readonly NONE: number; + readonly NOTEQUAL: number; + readonly NO_ERROR: number; + readonly ONE: number; + readonly ONE_MINUS_CONSTANT_ALPHA: number; + readonly ONE_MINUS_CONSTANT_COLOR: number; + readonly ONE_MINUS_DST_ALPHA: number; + readonly ONE_MINUS_DST_COLOR: number; + readonly ONE_MINUS_SRC_ALPHA: number; + readonly ONE_MINUS_SRC_COLOR: number; + readonly OUT_OF_MEMORY: number; + readonly PACK_ALIGNMENT: number; + readonly POINTS: number; + readonly POLYGON_OFFSET_FACTOR: number; + readonly POLYGON_OFFSET_FILL: number; + readonly POLYGON_OFFSET_UNITS: number; + readonly RED_BITS: number; + readonly RENDERBUFFER: number; + readonly RENDERBUFFER_ALPHA_SIZE: number; + readonly RENDERBUFFER_BINDING: number; + readonly RENDERBUFFER_BLUE_SIZE: number; + readonly RENDERBUFFER_DEPTH_SIZE: number; + readonly RENDERBUFFER_GREEN_SIZE: number; + readonly RENDERBUFFER_HEIGHT: number; + readonly RENDERBUFFER_INTERNAL_FORMAT: number; + readonly RENDERBUFFER_RED_SIZE: number; + readonly RENDERBUFFER_STENCIL_SIZE: number; + readonly RENDERBUFFER_WIDTH: number; + readonly RENDERER: number; + readonly REPEAT: number; + readonly REPLACE: number; + readonly RGB: number; + readonly RGB565: number; + readonly RGB5_A1: number; + readonly RGBA: number; + readonly RGBA4: number; + readonly SAMPLER_2D: number; + readonly SAMPLER_CUBE: number; + readonly SAMPLES: number; + readonly SAMPLE_ALPHA_TO_COVERAGE: number; + readonly SAMPLE_BUFFERS: number; + readonly SAMPLE_COVERAGE: number; + readonly SAMPLE_COVERAGE_INVERT: number; + readonly SAMPLE_COVERAGE_VALUE: number; + readonly SCISSOR_BOX: number; + readonly SCISSOR_TEST: number; + readonly SHADER_TYPE: number; + readonly SHADING_LANGUAGE_VERSION: number; + readonly SHORT: number; + readonly SRC_ALPHA: number; + readonly SRC_ALPHA_SATURATE: number; + readonly SRC_COLOR: number; + readonly STATIC_DRAW: number; + readonly STENCIL_ATTACHMENT: number; + readonly STENCIL_BACK_FAIL: number; + readonly STENCIL_BACK_FUNC: number; + readonly STENCIL_BACK_PASS_DEPTH_FAIL: number; + readonly STENCIL_BACK_PASS_DEPTH_PASS: number; + readonly STENCIL_BACK_REF: number; + readonly STENCIL_BACK_VALUE_MASK: number; + readonly STENCIL_BACK_WRITEMASK: number; + readonly STENCIL_BITS: number; + readonly STENCIL_BUFFER_BIT: number; + readonly STENCIL_CLEAR_VALUE: number; + readonly STENCIL_FAIL: number; + readonly STENCIL_FUNC: number; + readonly STENCIL_INDEX8: number; + readonly STENCIL_PASS_DEPTH_FAIL: number; + readonly STENCIL_PASS_DEPTH_PASS: number; + readonly STENCIL_REF: number; + readonly STENCIL_TEST: number; + readonly STENCIL_VALUE_MASK: number; + readonly STENCIL_WRITEMASK: number; + readonly STREAM_DRAW: number; + readonly SUBPIXEL_BITS: number; + readonly TEXTURE: number; + readonly TEXTURE0: number; + readonly TEXTURE1: number; + readonly TEXTURE10: number; + readonly TEXTURE11: number; + readonly TEXTURE12: number; + readonly TEXTURE13: number; + readonly TEXTURE14: number; + readonly TEXTURE15: number; + readonly TEXTURE16: number; + readonly TEXTURE17: number; + readonly TEXTURE18: number; + readonly TEXTURE19: number; + readonly TEXTURE2: number; + readonly TEXTURE20: number; + readonly TEXTURE21: number; + readonly TEXTURE22: number; + readonly TEXTURE23: number; + readonly TEXTURE24: number; + readonly TEXTURE25: number; + readonly TEXTURE26: number; + readonly TEXTURE27: number; + readonly TEXTURE28: number; + readonly TEXTURE29: number; + readonly TEXTURE3: number; + readonly TEXTURE30: number; + readonly TEXTURE31: number; + readonly TEXTURE4: number; + readonly TEXTURE5: number; + readonly TEXTURE6: number; + readonly TEXTURE7: number; + readonly TEXTURE8: number; + readonly TEXTURE9: number; + readonly TEXTURE_2D: number; + readonly TEXTURE_BINDING_2D: number; + readonly TEXTURE_BINDING_CUBE_MAP: number; + readonly TEXTURE_CUBE_MAP: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_X: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number; + readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number; + readonly TEXTURE_MAG_FILTER: number; + readonly TEXTURE_MIN_FILTER: number; + readonly TEXTURE_WRAP_S: number; + readonly TEXTURE_WRAP_T: number; + readonly TRIANGLES: number; + readonly TRIANGLE_FAN: number; + readonly TRIANGLE_STRIP: number; + readonly UNPACK_ALIGNMENT: number; + readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + readonly UNPACK_FLIP_Y_WEBGL: number; + readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + readonly UNSIGNED_BYTE: number; + readonly UNSIGNED_INT: number; + readonly UNSIGNED_SHORT: number; + readonly UNSIGNED_SHORT_4_4_4_4: number; + readonly UNSIGNED_SHORT_5_5_5_1: number; + readonly UNSIGNED_SHORT_5_6_5: number; + readonly VALIDATE_STATUS: number; + readonly VENDOR: number; + readonly VERSION: number; + readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + readonly VERTEX_ATTRIB_ARRAY_ENABLED: number; + readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + readonly VERTEX_ATTRIB_ARRAY_POINTER: number; + readonly VERTEX_ATTRIB_ARRAY_SIZE: number; + readonly VERTEX_ATTRIB_ARRAY_STRIDE: number; + readonly VERTEX_ATTRIB_ARRAY_TYPE: number; + readonly VERTEX_SHADER: number; + readonly VIEWPORT: number; + readonly ZERO: number; + + /* WebGL2 constants */ + readonly READ_BUFFER: number; // 0x0C02 + readonly UNPACK_ROW_LENGTH: number; // 0x0CF2 + readonly UNPACK_SKIP_ROWS: number; // 0x0CF3 + readonly UNPACK_SKIP_PIXELS: number; // 0x0CF4 + readonly PACK_ROW_LENGTH: number; // 0x0D02 + readonly PACK_SKIP_ROWS: number; // 0x0D03 + readonly PACK_SKIP_PIXELS: number; // 0x0D04 + readonly COLOR: number; // 0x1800 + readonly DEPTH: number; // 0x1801 + readonly STENCIL: number; // 0x1802 + readonly RED: number; // 0x1903 + readonly RGB8: number; // 0x8051 + readonly RGBA8: number; // 0x8058 + readonly RGB10_A2: number; // 0x8059 + readonly TEXTURE_BINDING_3D: number; // 0x806A + readonly UNPACK_SKIP_IMAGES: number; // 0x806D + readonly UNPACK_IMAGE_HEIGHT: number; // 0x806E + readonly TEXTURE_3D: number; // 0x806F + readonly TEXTURE_WRAP_R: number; // 0x8072 + readonly MAX_3D_TEXTURE_SIZE: number; // 0x8073 + readonly UNSIGNED_INT_2_10_10_10_REV: number; // 0x8368 + readonly MAX_ELEMENTS_VERTICES: number; // 0x80E8 + readonly MAX_ELEMENTS_INDICES: number; // 0x80E9 + readonly TEXTURE_MIN_LOD: number; // 0x813A + readonly TEXTURE_MAX_LOD: number; // 0x813B + readonly TEXTURE_BASE_LEVEL: number; // 0x813C + readonly TEXTURE_MAX_LEVEL: number; // 0x813D + readonly MIN: number; // 0x8007 + readonly MAX: number; // 0x8008 + readonly DEPTH_COMPONENT24: number; // 0x81A6 + readonly MAX_TEXTURE_LOD_BIAS: number; // 0x84FD + readonly TEXTURE_COMPARE_MODE: number; // 0x884C + readonly TEXTURE_COMPARE_FUNC: number; // 0x884D + readonly CURRENT_QUERY: number; // 0x8865 + readonly QUERY_RESULT: number; // 0x8866 + readonly QUERY_RESULT_AVAILABLE: number; // 0x8867 + readonly STREAM_READ: number; // 0x88E1 + readonly STREAM_COPY: number; // 0x88E2 + readonly STATIC_READ: number; // 0x88E5 + readonly STATIC_COPY: number; // 0x88E6 + readonly DYNAMIC_READ: number; // 0x88E9 + readonly DYNAMIC_COPY: number; // 0x88EA + readonly MAX_DRAW_BUFFERS: number; // 0x8824 + readonly DRAW_BUFFER0: number; // 0x8825 + readonly DRAW_BUFFER1: number; // 0x8826 + readonly DRAW_BUFFER2: number; // 0x8827 + readonly DRAW_BUFFER3: number; // 0x8828 + readonly DRAW_BUFFER4: number; // 0x8829 + readonly DRAW_BUFFER5: number; // 0x882A + readonly DRAW_BUFFER6: number; // 0x882B + readonly DRAW_BUFFER7: number; // 0x882C + readonly DRAW_BUFFER8: number; // 0x882D + readonly DRAW_BUFFER9: number; // 0x882E + readonly DRAW_BUFFER10: number; // 0x882F + readonly DRAW_BUFFER11: number; // 0x8830 + readonly DRAW_BUFFER12: number; // 0x8831 + readonly DRAW_BUFFER13: number; // 0x8832 + readonly DRAW_BUFFER14: number; // 0x8833 + readonly DRAW_BUFFER15: number; // 0x8834 + readonly MAX_FRAGMENT_UNIFORM_COMPONENTS: number; // 0x8B49 + readonly MAX_VERTEX_UNIFORM_COMPONENTS: number; // 0x8B4A + readonly SAMPLER_3D: number; // 0x8B5F + readonly SAMPLER_2D_SHADOW: number; // 0x8B62 + readonly FRAGMENT_SHADER_DERIVATIVE_HINT: number; // 0x8B8B + readonly PIXEL_PACK_BUFFER: number; // 0x88EB + readonly PIXEL_UNPACK_BUFFER: number; // 0x88EC + readonly PIXEL_PACK_BUFFER_BINDING: number; // 0x88ED + readonly PIXEL_UNPACK_BUFFER_BINDING: number; // 0x88EF + readonly FLOAT_MAT2x3: number; // 0x8B65 + readonly FLOAT_MAT2x4: number; // 0x8B66 + readonly FLOAT_MAT3x2: number; // 0x8B67 + readonly FLOAT_MAT3x4: number; // 0x8B68 + readonly FLOAT_MAT4x2: number; // 0x8B69 + readonly FLOAT_MAT4x3: number; // 0x8B6A + readonly SRGB: number; // 0x8C40 + readonly SRGB8: number; // 0x8C41 + readonly SRGB8_ALPHA8: number; // 0x8C43 + readonly COMPARE_REF_TO_TEXTURE: number; // 0x884E + readonly RGBA32F: number; // 0x8814 + readonly RGB32F: number; // 0x8815 + readonly RGBA16F: number; // 0x881A + readonly RGB16F: number; // 0x881B + readonly VERTEX_ATTRIB_ARRAY_INTEGER: number; // 0x88FD + readonly MAX_ARRAY_TEXTURE_LAYERS: number; // 0x88FF + readonly MIN_PROGRAM_TEXEL_OFFSET: number; // 0x8904 + readonly MAX_PROGRAM_TEXEL_OFFSET: number; // 0x8905 + readonly MAX_VARYING_COMPONENTS: number; // 0x8B4B + readonly TEXTURE_2D_ARRAY: number; // 0x8C1A + readonly TEXTURE_BINDING_2D_ARRAY: number; // 0x8C1D + readonly R11F_G11F_B10F: number; // 0x8C3A + readonly UNSIGNED_INT_10F_11F_11F_REV: number; // 0x8C3B + readonly RGB9_E5: number; // 0x8C3D + readonly UNSIGNED_INT_5_9_9_9_REV: number; // 0x8C3E + readonly TRANSFORM_FEEDBACK_BUFFER_MODE: number; // 0x8C7F + readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: number; // 0x8C80 + readonly TRANSFORM_FEEDBACK_VARYINGS: number; // 0x8C83 + readonly TRANSFORM_FEEDBACK_BUFFER_START: number; // 0x8C84 + readonly TRANSFORM_FEEDBACK_BUFFER_SIZE: number; // 0x8C85 + readonly TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: number; // 0x8C88 + readonly RASTERIZER_DISCARD: number; // 0x8C89 + readonly MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: number; // 0x8C8A + readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: number; // 0x8C8B + readonly INTERLEAVED_ATTRIBS: number; // 0x8C8C + readonly SEPARATE_ATTRIBS: number; // 0x8C8D + readonly TRANSFORM_FEEDBACK_BUFFER: number; // 0x8C8E + readonly TRANSFORM_FEEDBACK_BUFFER_BINDING: number; // 0x8C8F + readonly RGBA32UI: number; // 0x8D70 + readonly RGB32UI: number; // 0x8D71 + readonly RGBA16UI: number; // 0x8D76 + readonly RGB16UI: number; // 0x8D77 + readonly RGBA8UI: number; // 0x8D7C + readonly RGB8UI: number; // 0x8D7D + readonly RGBA32I: number; // 0x8D82 + readonly RGB32I: number; // 0x8D83 + readonly RGBA16I: number; // 0x8D88 + readonly RGB16I: number; // 0x8D89 + readonly RGBA8I: number; // 0x8D8E + readonly RGB8I: number; // 0x8D8F + readonly RED_INTEGER: number; // 0x8D94 + readonly RGB_INTEGER: number; // 0x8D98 + readonly RGBA_INTEGER: number; // 0x8D99 + readonly SAMPLER_2D_ARRAY: number; // 0x8DC1 + readonly SAMPLER_2D_ARRAY_SHADOW: number; // 0x8DC4 + readonly SAMPLER_CUBE_SHADOW: number; // 0x8DC5 + readonly UNSIGNED_INT_VEC2: number; // 0x8DC6 + readonly UNSIGNED_INT_VEC3: number; // 0x8DC7 + readonly UNSIGNED_INT_VEC4: number; // 0x8DC8 + readonly INT_SAMPLER_2D: number; // 0x8DCA + readonly INT_SAMPLER_3D: number; // 0x8DCB + readonly INT_SAMPLER_CUBE: number; // 0x8DCC + readonly INT_SAMPLER_2D_ARRAY: number; // 0x8DCF + readonly UNSIGNED_INT_SAMPLER_2D: number; // 0x8DD2 + readonly UNSIGNED_INT_SAMPLER_3D: number; // 0x8DD3 + readonly UNSIGNED_INT_SAMPLER_CUBE: number; // 0x8DD4 + readonly UNSIGNED_INT_SAMPLER_2D_ARRAY: number; // 0x8DD7 + readonly DEPTH_COMPONENT32F: number; // 0x8CAC + readonly DEPTH32F_STENCIL8: number; // 0x8CAD + readonly FLOAT_32_UNSIGNED_INT_24_8_REV: number; // 0x8DAD + readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: number; // 0x8210 + readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: number; // 0x8211 + readonly FRAMEBUFFER_ATTACHMENT_RED_SIZE: number; // 0x8212 + readonly FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: number; // 0x8213 + readonly FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: number; // 0x8214 + readonly FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: number; // 0x8215 + readonly FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: number; // 0x8216 + readonly FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: number; // 0x8217 + readonly FRAMEBUFFER_DEFAULT: number; // 0x8218 + //readonly DEPTH_STENCIL_ATTACHMENT: number; // 0x821A /* Already defined in WebGL1 constants */ + //readonly DEPTH_STENCIL: number; // 0x84F9 /* Already defined in WebGL1 constants */ + readonly UNSIGNED_INT_24_8: number; // 0x84FA + readonly DEPTH24_STENCIL8: number; // 0x88F0 + readonly UNSIGNED_NORMALIZED: number; // 0x8C17 + readonly DRAW_FRAMEBUFFER_BINDING: number; // 0x8CA6 /* Same as FRAMEBUFFER_BINDING */ + readonly READ_FRAMEBUFFER: number; // 0x8CA8 + readonly DRAW_FRAMEBUFFER: number; // 0x8CA9 + readonly READ_FRAMEBUFFER_BINDING: number; // 0x8CAA + readonly RENDERBUFFER_SAMPLES: number; // 0x8CAB + readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: number; // 0x8CD4 + readonly MAX_COLOR_ATTACHMENTS: number; // 0x8CDF + readonly COLOR_ATTACHMENT1: number; // 0x8CE1 + readonly COLOR_ATTACHMENT2: number; // 0x8CE2 + readonly COLOR_ATTACHMENT3: number; // 0x8CE3 + readonly COLOR_ATTACHMENT4: number; // 0x8CE4 + readonly COLOR_ATTACHMENT5: number; // 0x8CE5 + readonly COLOR_ATTACHMENT6: number; // 0x8CE6 + readonly COLOR_ATTACHMENT7: number; // 0x8CE7 + readonly COLOR_ATTACHMENT8: number; // 0x8CE8 + readonly COLOR_ATTACHMENT9: number; // 0x8CE9 + readonly COLOR_ATTACHMENT10: number; // 0x8CEA + readonly COLOR_ATTACHMENT11: number; // 0x8CEB + readonly COLOR_ATTACHMENT12: number; // 0x8CEC + readonly COLOR_ATTACHMENT13: number; // 0x8CED + readonly COLOR_ATTACHMENT14: number; // 0x8CEE + readonly COLOR_ATTACHMENT15: number; // 0x8CEF + readonly FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: number; // 0x8D56 + readonly MAX_SAMPLES: number; // 0x8D57 + readonly HALF_FLOAT: number; // 0x140B + readonly RG: number; // 0x8227 + readonly RG_INTEGER: number; // 0x8228 + readonly R8: number; // 0x8229 + readonly RG8: number; // 0x822B + readonly R16F: number; // 0x822D + readonly R32F: number; // 0x822E + readonly RG16F: number; // 0x822F + readonly RG32F: number; // 0x8230 + readonly R8I: number; // 0x8231 + readonly R8UI: number; // 0x8232 + readonly R16I: number; // 0x8233 + readonly R16UI: number; // 0x8234 + readonly R32I: number; // 0x8235 + readonly R32UI: number; // 0x8236 + readonly RG8I: number; // 0x8237 + readonly RG8UI: number; // 0x8238 + readonly RG16I: number; // 0x8239 + readonly RG16UI: number; // 0x823A + readonly RG32I: number; // 0x823B + readonly RG32UI: number; // 0x823C + readonly VERTEX_ARRAY_BINDING: number; // 0x85B5 + readonly R8_SNORM: number; // 0x8F94 + readonly RG8_SNORM: number; // 0x8F95 + readonly RGB8_SNORM: number; // 0x8F96 + readonly RGBA8_SNORM: number; // 0x8F97 + readonly SIGNED_NORMALIZED: number; // 0x8F9C + readonly COPY_READ_BUFFER: number; // 0x8F36 + readonly COPY_WRITE_BUFFER: number; // 0x8F37 + readonly COPY_READ_BUFFER_BINDING: number; // 0x8F36 /* Same as COPY_READ_BUFFER */ + readonly COPY_WRITE_BUFFER_BINDING: number; // 0x8F37 /* Same as COPY_WRITE_BUFFER */ + readonly UNIFORM_BUFFER: number; // 0x8A11 + readonly UNIFORM_BUFFER_BINDING: number; // 0x8A28 + readonly UNIFORM_BUFFER_START: number; // 0x8A29 + readonly UNIFORM_BUFFER_SIZE: number; // 0x8A2A + readonly MAX_VERTEX_UNIFORM_BLOCKS: number; // 0x8A2B + readonly MAX_FRAGMENT_UNIFORM_BLOCKS: number; // 0x8A2D + readonly MAX_COMBINED_UNIFORM_BLOCKS: number; // 0x8A2E + readonly MAX_UNIFORM_BUFFER_BINDINGS: number; // 0x8A2F + readonly MAX_UNIFORM_BLOCK_SIZE: number; // 0x8A30 + readonly MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: number; // 0x8A31 + readonly MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: number; // 0x8A33 + readonly UNIFORM_BUFFER_OFFSET_ALIGNMENT: number; // 0x8A34 + readonly ACTIVE_UNIFORM_BLOCKS: number; // 0x8A36 + readonly UNIFORM_TYPE: number; // 0x8A37 + readonly UNIFORM_SIZE: number; // 0x8A38 + readonly UNIFORM_BLOCK_INDEX: number; // 0x8A3A + readonly UNIFORM_OFFSET: number; // 0x8A3B + readonly UNIFORM_ARRAY_STRIDE: number; // 0x8A3C + readonly UNIFORM_MATRIX_STRIDE: number; // 0x8A3D + readonly UNIFORM_IS_ROW_MAJOR: number; // 0x8A3E + readonly UNIFORM_BLOCK_BINDING: number; // 0x8A3F + readonly UNIFORM_BLOCK_DATA_SIZE: number; // 0x8A40 + readonly UNIFORM_BLOCK_ACTIVE_UNIFORMS: number; // 0x8A42 + readonly UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: number; // 0x8A43 + readonly UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: number; // 0x8A44 + readonly UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: number; // 0x8A46 + readonly INVALID_INDEX: number; // 0xFFFFFFFF + readonly MAX_VERTEX_OUTPUT_COMPONENTS: number; // 0x9122 + readonly MAX_FRAGMENT_INPUT_COMPONENTS: number; // 0x9125 + readonly MAX_SERVER_WAIT_TIMEOUT: number; // 0x9111 + readonly OBJECT_TYPE: number; // 0x9112 + readonly SYNC_CONDITION: number; // 0x9113 + readonly SYNC_STATUS: number; // 0x9114 + readonly SYNC_FLAGS: number; // 0x9115 + readonly SYNC_FENCE: number; // 0x9116 + readonly SYNC_GPU_COMMANDS_COMPLETE: number; // 0x9117 + readonly UNSIGNALED: number; // 0x9118 + readonly SIGNALED: number; // 0x9119 + readonly ALREADY_SIGNALED: number; // 0x911A + readonly TIMEOUT_EXPIRED: number; // 0x911B + readonly CONDITION_SATISFIED: number; // 0x911C + readonly WAIT_FAILED: number; // 0x911D + readonly SYNC_FLUSH_COMMANDS_BIT: number; // 0x00000001 + readonly VERTEX_ATTRIB_ARRAY_DIVISOR: number; // 0x88FE + readonly ANY_SAMPLES_PASSED: number; // 0x8C2F + readonly ANY_SAMPLES_PASSED_CONSERVATIVE: number; // 0x8D6A + readonly SAMPLER_BINDING: number; // 0x8919 + readonly RGB10_A2UI: number; // 0x906F + readonly INT_2_10_10_10_REV: number; // 0x8D9F + readonly TRANSFORM_FEEDBACK: number; // 0x8E22 + readonly TRANSFORM_FEEDBACK_PAUSED: number; // 0x8E23 + readonly TRANSFORM_FEEDBACK_ACTIVE: number; // 0x8E24 + readonly TRANSFORM_FEEDBACK_BINDING: number; // 0x8E25 + readonly TEXTURE_IMMUTABLE_FORMAT: number; // 0x912F + readonly MAX_ELEMENT_INDEX: number; // 0x8D6B + readonly TEXTURE_IMMUTABLE_LEVELS: number; // 0x82DF + + readonly TIMEOUT_IGNORED: number; // -1 + + /* WebGL-specific enums */ + readonly MAX_CLIENT_WAIT_TIMEOUT_WEBGL: number; // 0x9247 +}; + +interface WebGLQuery extends WebGLObject { +} + +declare var WebGLQuery: { + prototype: WebGLQuery; + new (): WebGLQuery; +}; + +interface WebGLSampler extends WebGLObject { +} + +declare var WebGLSampler: { + prototype: WebGLSampler; + new (): WebGLSampler; +}; + +interface WebGLSync extends WebGLObject { +} + +declare var WebGLSync: { + prototype: WebGLSync; + new (): WebGLSync; +}; + +interface WebGLTransformFeedback extends WebGLObject { +} + +declare var WebGLTransformFeedback: { + prototype: WebGLTransformFeedback; + new (): WebGLTransformFeedback; +}; + +interface WebGLVertexArrayObject extends WebGLObject { +} + +declare var WebGLVertexArrayObject: { + prototype: WebGLVertexArrayObject; + new (): WebGLVertexArrayObject; +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl2/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl2/package.json new file mode 100644 index 000000000..e37999588 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@types/webgl2/package.json @@ -0,0 +1,33 @@ +{ + "name": "@types/webgl2", + "version": "0.0.5", + "description": "TypeScript definitions for WebGL 2, Editor's Draft Fri Feb 24 16:10:18 2017 -0800", + "license": "MIT", + "contributors": [ + { + "name": "Nico Kemnitz", + "url": "https://github.com/nkemnitz", + "githubUsername": "nkemnitz" + }, + { + "name": "Adrian Blumer", + "url": "https://github.com/karhu", + "githubUsername": "karhu" + } + ], + "main": "", + "types": "index", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/webgl2" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "c3c55fd3775154b231be91631dfd723072d24335bb4adbe05b3ee9ed727526bf", + "typeScriptVersion": "2.0" + +,"_resolved": "https://registry.npmjs.org/@types/webgl2/-/webgl2-0.0.5.tgz" +,"_integrity": "sha512-oGaKsBbxQOY5+aJFV3KECDhGaXt+yZJt2y/OZsnQGLRkH6Fvr7rv4pCt3SRH1somIHfej/c4u7NSpCyd9x+1Ow==" +,"_from": "@types/webgl2@0.0.5" +} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/abbrev/LICENSE b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/abbrev/LICENSE new file mode 100644 index 000000000..9bcfa9d7d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/abbrev/LICENSE @@ -0,0 +1,46 @@ +This software is dual-licensed under the ISC and MIT licenses. +You may use this software under EITHER of the following licenses. + +---------- + +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---------- + +Copyright Isaac Z. Schlueter and Contributors +All rights reserved. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/abbrev/README.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/abbrev/README.md new file mode 100644 index 000000000..99746fe67 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/abbrev/README.md @@ -0,0 +1,23 @@ +# abbrev-js + +Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev). + +Usage: + + var abbrev = require("abbrev"); + abbrev("foo", "fool", "folding", "flop"); + + // returns: + { fl: 'flop' + , flo: 'flop' + , flop: 'flop' + , fol: 'folding' + , fold: 'folding' + , foldi: 'folding' + , foldin: 'folding' + , folding: 'folding' + , foo: 'foo' + , fool: 'fool' + } + +This is handy for command-line scripts, or other cases where you want to be able to accept shorthands. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/abbrev/abbrev.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/abbrev/abbrev.js new file mode 100644 index 000000000..7b1dc5d67 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/abbrev/abbrev.js @@ -0,0 +1,61 @@ +module.exports = exports = abbrev.abbrev = abbrev + +abbrev.monkeyPatch = monkeyPatch + +function monkeyPatch () { + Object.defineProperty(Array.prototype, 'abbrev', { + value: function () { return abbrev(this) }, + enumerable: false, configurable: true, writable: true + }) + + Object.defineProperty(Object.prototype, 'abbrev', { + value: function () { return abbrev(Object.keys(this)) }, + enumerable: false, configurable: true, writable: true + }) +} + +function abbrev (list) { + if (arguments.length !== 1 || !Array.isArray(list)) { + list = Array.prototype.slice.call(arguments, 0) + } + for (var i = 0, l = list.length, args = [] ; i < l ; i ++) { + args[i] = typeof list[i] === "string" ? list[i] : String(list[i]) + } + + // sort them lexicographically, so that they're next to their nearest kin + args = args.sort(lexSort) + + // walk through each, seeing how much it has in common with the next and previous + var abbrevs = {} + , prev = "" + for (var i = 0, l = args.length ; i < l ; i ++) { + var current = args[i] + , next = args[i + 1] || "" + , nextMatches = true + , prevMatches = true + if (current === next) continue + for (var j = 0, cl = current.length ; j < cl ; j ++) { + var curChar = current.charAt(j) + nextMatches = nextMatches && curChar === next.charAt(j) + prevMatches = prevMatches && curChar === prev.charAt(j) + if (!nextMatches && !prevMatches) { + j ++ + break + } + } + prev = current + if (j === cl) { + abbrevs[current] = current + continue + } + for (var a = current.substr(0, j) ; j <= cl ; j ++) { + abbrevs[a] = current + a += current.charAt(j) + } + } + return abbrevs +} + +function lexSort (a, b) { + return a === b ? 0 : a > b ? 1 : -1 +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/abbrev/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/abbrev/package.json new file mode 100644 index 000000000..dace5cf45 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/abbrev/package.json @@ -0,0 +1,25 @@ +{ + "name": "abbrev", + "version": "1.1.1", + "description": "Like ruby's abbrev module, but in js", + "author": "Isaac Z. Schlueter ", + "main": "abbrev.js", + "scripts": { + "test": "tap test.js --100", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "repository": "http://github.com/isaacs/abbrev-js", + "license": "ISC", + "devDependencies": { + "tap": "^10.1" + }, + "files": [ + "abbrev.js" + ] + +,"_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz" +,"_integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" +,"_from": "abbrev@1.1.1" +} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/LICENSE b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/LICENSE new file mode 100644 index 000000000..ea38ade97 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) 2012 Another-D-Mention Software and other contributors, +http://www.another-d-mention.ro/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/README.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/README.md new file mode 100644 index 000000000..172b91119 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/README.md @@ -0,0 +1,65 @@ +# ADM-ZIP for NodeJS with added support for electron original-fs + +ADM-ZIP is a pure JavaScript implementation for zip data compression for [NodeJS](https://nodejs.org/). + +# Installation + +With [npm](https://www.npmjs.com/) do: + + $ npm install adm-zip + +## What is it good for? +The library allows you to: + +* decompress zip files directly to disk or in memory buffers +* compress files and store them to disk in .zip format or in compressed buffers +* update content of/add new/delete files from an existing .zip + +# Dependencies +There are no other nodeJS libraries that ADM-ZIP is dependent of + +# Examples + +## Basic usage +```javascript + + var AdmZip = require('adm-zip'); + + // reading archives + var zip = new AdmZip("./my_file.zip"); + var zipEntries = zip.getEntries(); // an array of ZipEntry records + + zipEntries.forEach(function(zipEntry) { + console.log(zipEntry.toString()); // outputs zip entries information + if (zipEntry.entryName == "my_file.txt") { + console.log(zipEntry.getData().toString('utf8')); + } + }); + // outputs the content of some_folder/my_file.txt + console.log(zip.readAsText("some_folder/my_file.txt")); + // extracts the specified file to the specified location + zip.extractEntryTo(/*entry name*/"some_folder/my_file.txt", /*target path*/"/home/me/tempfolder", /*maintainEntryPath*/false, /*overwrite*/true); + // extracts everything + zip.extractAllTo(/*target path*/"/home/me/zipcontent/", /*overwrite*/true); + + + // creating archives + var zip = new AdmZip(); + + // add file directly + var content = "inner content of the file"; + zip.addFile("test.txt", Buffer.alloc(content.length, content), "entry comment goes here"); + // add local file + zip.addLocalFile("/home/me/some_picture.png"); + // get everything as a buffer + var willSendthis = zip.toBuffer(); + // or write everything to disk + zip.writeZip(/*target file name*/"/home/me/files.zip"); + + + // ... more examples in the wiki +``` + +For more detailed information please check out the [wiki](https://github.com/cthackers/adm-zip/wiki). + +[![Build Status](https://travis-ci.org/cthackers/adm-zip.svg?branch=master)](https://travis-ci.org/cthackers/adm-zip) diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/adm-zip.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/adm-zip.js new file mode 100644 index 000000000..619544db0 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/adm-zip.js @@ -0,0 +1,639 @@ +var Utils = require("./util"); +var fs = Utils.FileSystem.require(), + pth = require("path"); + +fs.existsSync = fs.existsSync || pth.existsSync; + +var ZipEntry = require("./zipEntry"), + ZipFile = require("./zipFile"); + +var isWin = /^win/.test(process.platform); + + +module.exports = function (/**String*/input) { + var _zip = undefined, + _filename = ""; + + if (input && typeof input === "string") { // load zip file + if (fs.existsSync(input)) { + _filename = input; + _zip = new ZipFile(input, Utils.Constants.FILE); + } else { + throw new Error(Utils.Errors.INVALID_FILENAME); + } + } else if (input && Buffer.isBuffer(input)) { // load buffer + _zip = new ZipFile(input, Utils.Constants.BUFFER); + } else { // create new zip file + _zip = new ZipFile(null, Utils.Constants.NONE); + } + + function sanitize(prefix, name) { + prefix = pth.resolve(pth.normalize(prefix)); + var parts = name.split('/'); + for (var i = 0, l = parts.length; i < l; i++) { + var path = pth.normalize(pth.join(prefix, parts.slice(i, l).join(pth.sep))); + if (path.indexOf(prefix) === 0) { + return path; + } + } + return pth.normalize(pth.join(prefix, pth.basename(name))); + } + + function getEntry(/**Object*/entry) { + if (entry && _zip) { + var item; + // If entry was given as a file name + if (typeof entry === "string") + item = _zip.getEntry(entry); + // if entry was given as a ZipEntry object + if (typeof entry === "object" && typeof entry.entryName !== "undefined" && typeof entry.header !== "undefined") + item = _zip.getEntry(entry.entryName); + + if (item) { + return item; + } + } + return null; + } + + return { + /** + * Extracts the given entry from the archive and returns the content as a Buffer object + * @param entry ZipEntry object or String with the full path of the entry + * + * @return Buffer or Null in case of error + */ + readFile: function (/**Object*/entry) { + var item = getEntry(entry); + return item && item.getData() || null; + }, + + /** + * Asynchronous readFile + * @param entry ZipEntry object or String with the full path of the entry + * @param callback + * + * @return Buffer or Null in case of error + */ + readFileAsync: function (/**Object*/entry, /**Function*/callback) { + var item = getEntry(entry); + if (item) { + item.getDataAsync(callback); + } else { + callback(null, "getEntry failed for:" + entry) + } + }, + + /** + * Extracts the given entry from the archive and returns the content as plain text in the given encoding + * @param entry ZipEntry object or String with the full path of the entry + * @param encoding Optional. If no encoding is specified utf8 is used + * + * @return String + */ + readAsText: function (/**Object*/entry, /**String=*/encoding) { + var item = getEntry(entry); + if (item) { + var data = item.getData(); + if (data && data.length) { + return data.toString(encoding || "utf8"); + } + } + return ""; + }, + + /** + * Asynchronous readAsText + * @param entry ZipEntry object or String with the full path of the entry + * @param callback + * @param encoding Optional. If no encoding is specified utf8 is used + * + * @return String + */ + readAsTextAsync: function (/**Object*/entry, /**Function*/callback, /**String=*/encoding) { + var item = getEntry(entry); + if (item) { + item.getDataAsync(function (data, err) { + if (err) { + callback(data, err); + return; + } + + if (data && data.length) { + callback(data.toString(encoding || "utf8")); + } else { + callback(""); + } + }) + } else { + callback(""); + } + }, + + /** + * Remove the entry from the file or the entry and all it's nested directories and files if the given entry is a directory + * + * @param entry + */ + deleteFile: function (/**Object*/entry) { // @TODO: test deleteFile + var item = getEntry(entry); + if (item) { + _zip.deleteEntry(item.entryName); + } + }, + + /** + * Adds a comment to the zip. The zip must be rewritten after adding the comment. + * + * @param comment + */ + addZipComment: function (/**String*/comment) { // @TODO: test addZipComment + _zip.comment = comment; + }, + + /** + * Returns the zip comment + * + * @return String + */ + getZipComment: function () { + return _zip.comment || ''; + }, + + /** + * Adds a comment to a specified zipEntry. The zip must be rewritten after adding the comment + * The comment cannot exceed 65535 characters in length + * + * @param entry + * @param comment + */ + addZipEntryComment: function (/**Object*/entry, /**String*/comment) { + var item = getEntry(entry); + if (item) { + item.comment = comment; + } + }, + + /** + * Returns the comment of the specified entry + * + * @param entry + * @return String + */ + getZipEntryComment: function (/**Object*/entry) { + var item = getEntry(entry); + if (item) { + return item.comment || ''; + } + return '' + }, + + /** + * Updates the content of an existing entry inside the archive. The zip must be rewritten after updating the content + * + * @param entry + * @param content + */ + updateFile: function (/**Object*/entry, /**Buffer*/content) { + var item = getEntry(entry); + if (item) { + item.setData(content); + } + }, + + /** + * Adds a file from the disk to the archive + * + * @param localPath File to add to zip + * @param zipPath Optional path inside the zip + * @param zipName Optional name for the file + */ + addLocalFile: function (/**String*/localPath, /**String=*/zipPath, /**String=*/zipName) { + if (fs.existsSync(localPath)) { + if (zipPath) { + zipPath = zipPath.split("\\").join("/"); + if (zipPath.charAt(zipPath.length - 1) !== "/") { + zipPath += "/"; + } + } else { + zipPath = ""; + } + var p = localPath.split("\\").join("/").split("/").pop(); + + if (zipName) { + this.addFile(zipPath + zipName, fs.readFileSync(localPath), "", 0) + } else { + this.addFile(zipPath + p, fs.readFileSync(localPath), "", 0) + } + } else { + throw new Error(Utils.Errors.FILE_NOT_FOUND.replace("%s", localPath)); + } + }, + + /** + * Adds a local directory and all its nested files and directories to the archive + * + * @param localPath + * @param zipPath optional path inside zip + * @param filter optional RegExp or Function if files match will + * be included. + */ + addLocalFolder: function (/**String*/localPath, /**String=*/zipPath, /**=RegExp|Function*/filter) { + if (filter === undefined) { + filter = function () { + return true; + }; + } else if (filter instanceof RegExp) { + filter = function (filter) { + return function (filename) { + return filter.test(filename); + } + }(filter); + } + + if (zipPath) { + zipPath = zipPath.split("\\").join("/"); + if (zipPath.charAt(zipPath.length - 1) !== "/") { + zipPath += "/"; + } + } else { + zipPath = ""; + } + // normalize the path first + localPath = pth.normalize(localPath); + localPath = localPath.split("\\").join("/"); //windows fix + if (localPath.charAt(localPath.length - 1) !== "/") + localPath += "/"; + + if (fs.existsSync(localPath)) { + + var items = Utils.findFiles(localPath), + self = this; + + if (items.length) { + items.forEach(function (path) { + var p = path.split("\\").join("/").replace(new RegExp(localPath.replace(/(\(|\)|\$)/g, '\\$1'), 'i'), ""); //windows fix + if (filter(p)) { + if (p.charAt(p.length - 1) !== "/") { + self.addFile(zipPath + p, fs.readFileSync(path), "", 0) + } else { + self.addFile(zipPath + p, Buffer.alloc(0), "", 0) + } + } + }); + } + } else { + throw new Error(Utils.Errors.FILE_NOT_FOUND.replace("%s", localPath)); + } + }, + + /** + * Asynchronous addLocalFile + * @param localPath + * @param callback + * @param zipPath optional path inside zip + * @param filter optional RegExp or Function if files match will + * be included. + */ + addLocalFolderAsync: function (/*String*/localPath, /*Function*/callback, /*String*/zipPath, /*RegExp|Function*/filter) { + if (filter === undefined) { + filter = function () { + return true; + }; + } else if (filter instanceof RegExp) { + filter = function (filter) { + return function (filename) { + return filter.test(filename); + } + }(filter); + } + + if (zipPath) { + zipPath = zipPath.split("\\").join("/"); + if (zipPath.charAt(zipPath.length - 1) !== "/") { + zipPath += "/"; + } + } else { + zipPath = ""; + } + // normalize the path first + localPath = pth.normalize(localPath); + localPath = localPath.split("\\").join("/"); //windows fix + if (localPath.charAt(localPath.length - 1) !== "/") + localPath += "/"; + + var self = this; + fs.open(localPath, 'r', function (err, fd) { + if (err && err.code === 'ENOENT') { + callback(undefined, Utils.Errors.FILE_NOT_FOUND.replace("%s", localPath)); + } else if (err) { + callback(undefined, err); + } else { + var items = Utils.findFiles(localPath); + var i = -1; + + var next = function () { + i += 1; + if (i < items.length) { + var p = items[i].split("\\").join("/").replace(new RegExp(localPath.replace(/(\(|\))/g, '\\$1'), 'i'), ""); //windows fix + p = p.normalize('NFD').replace(/[\u0300-\u036f]/g, '').replace(/[^\x20-\x7E]/g, '') // accent fix + if (filter(p)) { + if (p.charAt(p.length - 1) !== "/") { + fs.readFile(items[i], function (err, data) { + if (err) { + callback(undefined, err); + } else { + self.addFile(zipPath + p, data, '', 0); + next(); + } + }) + } else { + self.addFile(zipPath + p, Buffer.alloc(0), "", 0); + next(); + } + } else { + next(); + } + + } else { + callback(true, undefined); + } + } + + next(); + } + }); + }, + + /** + * Allows you to create a entry (file or directory) in the zip file. + * If you want to create a directory the entryName must end in / and a null buffer should be provided. + * Comment and attributes are optional + * + * @param entryName + * @param content + * @param comment + * @param attr + */ + addFile: function (/**String*/entryName, /**Buffer*/content, /**String*/comment, /**Number*/attr) { + var entry = new ZipEntry(); + entry.entryName = entryName; + entry.comment = comment || ""; + + if (!attr) { + if (entry.isDirectory) { + attr = (0o40755 << 16) | 0x10; // (permissions drwxr-xr-x) + (MS-DOS directory flag) + } else { + attr = 0o644 << 16; // permissions -r-wr--r-- + } + } + + entry.attr = attr; + + entry.setData(content); + _zip.setEntry(entry); + }, + + /** + * Returns an array of ZipEntry objects representing the files and folders inside the archive + * + * @return Array + */ + getEntries: function () { + if (_zip) { + return _zip.entries; + } else { + return []; + } + }, + + /** + * Returns a ZipEntry object representing the file or folder specified by ``name``. + * + * @param name + * @return ZipEntry + */ + getEntry: function (/**String*/name) { + return getEntry(name); + }, + + getEntryCount: function() { + return _zip.getEntryCount(); + }, + + forEach: function(callback) { + return _zip.forEach(callback); + }, + + /** + * Extracts the given entry to the given targetPath + * If the entry is a directory inside the archive, the entire directory and it's subdirectories will be extracted + * + * @param entry ZipEntry object or String with the full path of the entry + * @param targetPath Target folder where to write the file + * @param maintainEntryPath If maintainEntryPath is true and the entry is inside a folder, the entry folder + * will be created in targetPath as well. Default is TRUE + * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true. + * Default is FALSE + * + * @return Boolean + */ + extractEntryTo: function (/**Object*/entry, /**String*/targetPath, /**Boolean*/maintainEntryPath, /**Boolean*/overwrite) { + overwrite = overwrite || false; + maintainEntryPath = typeof maintainEntryPath === "undefined" ? true : maintainEntryPath; + + var item = getEntry(entry); + if (!item) { + throw new Error(Utils.Errors.NO_ENTRY); + } + + var entryName = item.entryName; + + var target = sanitize(targetPath, maintainEntryPath ? entryName : pth.basename(entryName)); + + if (item.isDirectory) { + target = pth.resolve(target, ".."); + var children = _zip.getEntryChildren(item); + children.forEach(function (child) { + if (child.isDirectory) return; + var content = child.getData(); + if (!content) { + throw new Error(Utils.Errors.CANT_EXTRACT_FILE); + } + var childName = sanitize(targetPath, maintainEntryPath ? child.entryName : pth.basename(child.entryName)); + + Utils.writeFileTo(childName, content, overwrite); + }); + return true; + } + + var content = item.getData(); + if (!content) throw new Error(Utils.Errors.CANT_EXTRACT_FILE); + + if (fs.existsSync(target) && !overwrite) { + throw new Error(Utils.Errors.CANT_OVERRIDE); + } + Utils.writeFileTo(target, content, overwrite); + + return true; + }, + + /** + * Test the archive + * + */ + test: function () { + if (!_zip) { + return false; + } + + for (var entry in _zip.entries) { + try { + if (entry.isDirectory) { + continue; + } + var content = _zip.entries[entry].getData(); + if (!content) { + return false; + } + } catch (err) { + return false; + } + } + return true; + }, + + /** + * Extracts the entire archive to the given location + * + * @param targetPath Target location + * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true. + * Default is FALSE + */ + extractAllTo: function (/**String*/targetPath, /**Boolean*/overwrite) { + overwrite = overwrite || false; + if (!_zip) { + throw new Error(Utils.Errors.NO_ZIP); + } + _zip.entries.forEach(function (entry) { + var entryName = sanitize(targetPath, entry.entryName.toString()); + if (entry.isDirectory) { + Utils.makeDir(entryName); + return; + } + var content = entry.getData(); + if (!content) { + throw new Error(Utils.Errors.CANT_EXTRACT_FILE); + } + Utils.writeFileTo(entryName, content, overwrite); + try { + fs.utimesSync(entryName, entry.header.time, entry.header.time) + } catch (err) { + throw new Error(Utils.Errors.CANT_EXTRACT_FILE); + } + }) + }, + + /** + * Asynchronous extractAllTo + * + * @param targetPath Target location + * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true. + * Default is FALSE + * @param callback + */ + extractAllToAsync: function (/**String*/targetPath, /**Boolean*/overwrite, /**Function*/callback) { + if (!callback) { + callback = function() {} + } + overwrite = overwrite || false; + if (!_zip) { + callback(new Error(Utils.Errors.NO_ZIP)); + return; + } + + var entries = _zip.entries; + var i = entries.length; + entries.forEach(function (entry) { + if (i <= 0) return; // Had an error already + + var entryName = pth.normalize(entry.entryName.toString()); + + if (entry.isDirectory) { + Utils.makeDir(sanitize(targetPath, entryName)); + if (--i === 0) + callback(undefined); + return; + } + entry.getDataAsync(function (content, err) { + if (i <= 0) return; + if (err) { + callback(new Error(err)); + return; + } + if (!content) { + i = 0; + callback(new Error(Utils.Errors.CANT_EXTRACT_FILE)); + return; + } + + Utils.writeFileToAsync(sanitize(targetPath, entryName), content, overwrite, function (succ) { + try { + fs.utimesSync(pth.resolve(targetPath, entryName), entry.header.time, entry.header.time); + } catch (err) { + callback(new Error('Unable to set utimes')); + } + if (i <= 0) return; + if (!succ) { + i = 0; + callback(new Error('Unable to write')); + return; + } + if (--i === 0) + callback(undefined); + }); + }); + }) + }, + + /** + * Writes the newly created zip file to disk at the specified location or if a zip was opened and no ``targetFileName`` is provided, it will overwrite the opened zip + * + * @param targetFileName + * @param callback + */ + writeZip: function (/**String*/targetFileName, /**Function*/callback) { + if (arguments.length === 1) { + if (typeof targetFileName === "function") { + callback = targetFileName; + targetFileName = ""; + } + } + + if (!targetFileName && _filename) { + targetFileName = _filename; + } + if (!targetFileName) return; + + var zipData = _zip.compressToBuffer(); + if (zipData) { + var ok = Utils.writeFileTo(targetFileName, zipData, true); + if (typeof callback === 'function') callback(!ok ? new Error("failed") : null, ""); + } + }, + + /** + * Returns the content of the entire zip file as a Buffer object + * + * @return Buffer + */ + toBuffer: function (/**Function=*/onSuccess, /**Function=*/onFail, /**Function=*/onItemStart, /**Function=*/onItemEnd) { + this.valueOf = 2; + if (typeof onSuccess === "function") { + _zip.toAsyncBuffer(onSuccess, onFail, onItemStart, onItemEnd); + return null; + } + return _zip.compressToBuffer() + } + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/headers/entryHeader.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/headers/entryHeader.js new file mode 100644 index 000000000..29cfaf9b5 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/headers/entryHeader.js @@ -0,0 +1,261 @@ +var Utils = require("../util"), + Constants = Utils.Constants; + +/* The central directory file header */ +module.exports = function () { + var _verMade = 0x0A, + _version = 0x0A, + _flags = 0, + _method = 0, + _time = 0, + _crc = 0, + _compressedSize = 0, + _size = 0, + _fnameLen = 0, + _extraLen = 0, + + _comLen = 0, + _diskStart = 0, + _inattr = 0, + _attr = 0, + _offset = 0; + + var _dataHeader = {}; + + function setTime(val) { + val = new Date(val); + _time = (val.getFullYear() - 1980 & 0x7f) << 25 // b09-16 years from 1980 + | (val.getMonth() + 1) << 21 // b05-08 month + | val.getDate() << 16 // b00-04 hour + + // 2 bytes time + | val.getHours() << 11 // b11-15 hour + | val.getMinutes() << 5 // b05-10 minute + | val.getSeconds() >> 1; // b00-04 seconds divided by 2 + } + + setTime(+new Date()); + + return { + get made () { return _verMade; }, + set made (val) { _verMade = val; }, + + get version () { return _version; }, + set version (val) { _version = val }, + + get flags () { return _flags }, + set flags (val) { _flags = val; }, + + get method () { return _method; }, + set method (val) { _method = val; }, + + get time () { return new Date( + ((_time >> 25) & 0x7f) + 1980, + ((_time >> 21) & 0x0f) - 1, + (_time >> 16) & 0x1f, + (_time >> 11) & 0x1f, + (_time >> 5) & 0x3f, + (_time & 0x1f) << 1 + ); + }, + set time (val) { + setTime(val); + }, + + get crc () { return _crc; }, + set crc (val) { _crc = val; }, + + get compressedSize () { return _compressedSize; }, + set compressedSize (val) { _compressedSize = val; }, + + get size () { return _size; }, + set size (val) { _size = val; }, + + get fileNameLength () { return _fnameLen; }, + set fileNameLength (val) { _fnameLen = val; }, + + get extraLength () { return _extraLen }, + set extraLength (val) { _extraLen = val; }, + + get commentLength () { return _comLen }, + set commentLength (val) { _comLen = val }, + + get diskNumStart () { return _diskStart }, + set diskNumStart (val) { _diskStart = val }, + + get inAttr () { return _inattr }, + set inAttr (val) { _inattr = val }, + + get attr () { return _attr }, + set attr (val) { _attr = val }, + + get offset () { return _offset }, + set offset (val) { _offset = val }, + + get encripted () { return (_flags & 1) === 1 }, + + get entryHeaderSize () { + return Constants.CENHDR + _fnameLen + _extraLen + _comLen; + }, + + get realDataOffset () { + return _offset + Constants.LOCHDR + _dataHeader.fnameLen + _dataHeader.extraLen; + }, + + get dataHeader () { + return _dataHeader; + }, + + loadDataHeaderFromBinary : function(/*Buffer*/input) { + var data = input.slice(_offset, _offset + Constants.LOCHDR); + // 30 bytes and should start with "PK\003\004" + if (data.readUInt32LE(0) !== Constants.LOCSIG) { + throw new Error(Utils.Errors.INVALID_LOC); + } + _dataHeader = { + // version needed to extract + version : data.readUInt16LE(Constants.LOCVER), + // general purpose bit flag + flags : data.readUInt16LE(Constants.LOCFLG), + // compression method + method : data.readUInt16LE(Constants.LOCHOW), + // modification time (2 bytes time, 2 bytes date) + time : data.readUInt32LE(Constants.LOCTIM), + // uncompressed file crc-32 value + crc : data.readUInt32LE(Constants.LOCCRC), + // compressed size + compressedSize : data.readUInt32LE(Constants.LOCSIZ), + // uncompressed size + size : data.readUInt32LE(Constants.LOCLEN), + // filename length + fnameLen : data.readUInt16LE(Constants.LOCNAM), + // extra field length + extraLen : data.readUInt16LE(Constants.LOCEXT) + } + }, + + loadFromBinary : function(/*Buffer*/data) { + // data should be 46 bytes and start with "PK 01 02" + if (data.length !== Constants.CENHDR || data.readUInt32LE(0) !== Constants.CENSIG) { + throw new Error(Utils.Errors.INVALID_CEN); + } + // version made by + _verMade = data.readUInt16LE(Constants.CENVEM); + // version needed to extract + _version = data.readUInt16LE(Constants.CENVER); + // encrypt, decrypt flags + _flags = data.readUInt16LE(Constants.CENFLG); + // compression method + _method = data.readUInt16LE(Constants.CENHOW); + // modification time (2 bytes time, 2 bytes date) + _time = data.readUInt32LE(Constants.CENTIM); + // uncompressed file crc-32 value + _crc = data.readUInt32LE(Constants.CENCRC); + // compressed size + _compressedSize = data.readUInt32LE(Constants.CENSIZ); + // uncompressed size + _size = data.readUInt32LE(Constants.CENLEN); + // filename length + _fnameLen = data.readUInt16LE(Constants.CENNAM); + // extra field length + _extraLen = data.readUInt16LE(Constants.CENEXT); + // file comment length + _comLen = data.readUInt16LE(Constants.CENCOM); + // volume number start + _diskStart = data.readUInt16LE(Constants.CENDSK); + // internal file attributes + _inattr = data.readUInt16LE(Constants.CENATT); + // external file attributes + _attr = data.readUInt32LE(Constants.CENATX); + // LOC header offset + _offset = data.readUInt32LE(Constants.CENOFF); + }, + + dataHeaderToBinary : function() { + // LOC header size (30 bytes) + var data = Buffer.alloc(Constants.LOCHDR); + // "PK\003\004" + data.writeUInt32LE(Constants.LOCSIG, 0); + // version needed to extract + data.writeUInt16LE(_version, Constants.LOCVER); + // general purpose bit flag + data.writeUInt16LE(_flags, Constants.LOCFLG); + // compression method + data.writeUInt16LE(_method, Constants.LOCHOW); + // modification time (2 bytes time, 2 bytes date) + data.writeUInt32LE(_time, Constants.LOCTIM); + // uncompressed file crc-32 value + data.writeUInt32LE(_crc, Constants.LOCCRC); + // compressed size + data.writeUInt32LE(_compressedSize, Constants.LOCSIZ); + // uncompressed size + data.writeUInt32LE(_size, Constants.LOCLEN); + // filename length + data.writeUInt16LE(_fnameLen, Constants.LOCNAM); + // extra field length + data.writeUInt16LE(_extraLen, Constants.LOCEXT); + return data; + }, + + entryHeaderToBinary : function() { + // CEN header size (46 bytes) + var data = Buffer.alloc(Constants.CENHDR + _fnameLen + _extraLen + _comLen); + // "PK\001\002" + data.writeUInt32LE(Constants.CENSIG, 0); + // version made by + data.writeUInt16LE(_verMade, Constants.CENVEM); + // version needed to extract + data.writeUInt16LE(_version, Constants.CENVER); + // encrypt, decrypt flags + data.writeUInt16LE(_flags, Constants.CENFLG); + // compression method + data.writeUInt16LE(_method, Constants.CENHOW); + // modification time (2 bytes time, 2 bytes date) + data.writeUInt32LE(_time, Constants.CENTIM); + // uncompressed file crc-32 value + data.writeUInt32LE(_crc, Constants.CENCRC); + // compressed size + data.writeUInt32LE(_compressedSize, Constants.CENSIZ); + // uncompressed size + data.writeUInt32LE(_size, Constants.CENLEN); + // filename length + data.writeUInt16LE(_fnameLen, Constants.CENNAM); + // extra field length + data.writeUInt16LE(_extraLen, Constants.CENEXT); + // file comment length + data.writeUInt16LE(_comLen, Constants.CENCOM); + // volume number start + data.writeUInt16LE(_diskStart, Constants.CENDSK); + // internal file attributes + data.writeUInt16LE(_inattr, Constants.CENATT); + // external file attributes + data.writeUInt32LE(_attr, Constants.CENATX); + // LOC header offset + data.writeUInt32LE(_offset, Constants.CENOFF); + // fill all with + data.fill(0x00, Constants.CENHDR); + return data; + }, + + toString : function() { + return '{\n' + + '\t"made" : ' + _verMade + ",\n" + + '\t"version" : ' + _version + ",\n" + + '\t"flags" : ' + _flags + ",\n" + + '\t"method" : ' + Utils.methodToString(_method) + ",\n" + + '\t"time" : ' + this.time + ",\n" + + '\t"crc" : 0x' + _crc.toString(16).toUpperCase() + ",\n" + + '\t"compressedSize" : ' + _compressedSize + " bytes,\n" + + '\t"size" : ' + _size + " bytes,\n" + + '\t"fileNameLength" : ' + _fnameLen + ",\n" + + '\t"extraLength" : ' + _extraLen + " bytes,\n" + + '\t"commentLength" : ' + _comLen + " bytes,\n" + + '\t"diskNumStart" : ' + _diskStart + ",\n" + + '\t"inAttr" : ' + _inattr + ",\n" + + '\t"attr" : ' + _attr + ",\n" + + '\t"offset" : ' + _offset + ",\n" + + '\t"entryHeaderSize" : ' + (Constants.CENHDR + _fnameLen + _extraLen + _comLen) + " bytes\n" + + '}'; + } + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/headers/index.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/headers/index.js new file mode 100644 index 000000000..b8c67b96f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/headers/index.js @@ -0,0 +1,2 @@ +exports.EntryHeader = require("./entryHeader"); +exports.MainHeader = require("./mainHeader"); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/headers/mainHeader.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/headers/mainHeader.js new file mode 100644 index 000000000..195f597b3 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/headers/mainHeader.js @@ -0,0 +1,98 @@ +var Utils = require("../util"), + Constants = Utils.Constants; + +/* The entries in the end of central directory */ +module.exports = function () { + var _volumeEntries = 0, + _totalEntries = 0, + _size = 0, + _offset = 0, + _commentLength = 0; + + return { + get diskEntries () { return _volumeEntries }, + set diskEntries (/*Number*/val) { _volumeEntries = _totalEntries = val; }, + + get totalEntries () { return _totalEntries }, + set totalEntries (/*Number*/val) { _totalEntries = _volumeEntries = val; }, + + get size () { return _size }, + set size (/*Number*/val) { _size = val; }, + + get offset () { return _offset }, + set offset (/*Number*/val) { _offset = val; }, + + get commentLength () { return _commentLength }, + set commentLength (/*Number*/val) { _commentLength = val; }, + + get mainHeaderSize () { + return Constants.ENDHDR + _commentLength; + }, + + loadFromBinary : function(/*Buffer*/data) { + // data should be 22 bytes and start with "PK 05 06" + // or be 56+ bytes and start with "PK 06 06" for Zip64 + if ((data.length !== Constants.ENDHDR || data.readUInt32LE(0) !== Constants.ENDSIG) && + (data.length < Constants.ZIP64HDR || data.readUInt32LE(0) !== Constants.ZIP64SIG)) { + + throw new Error(Utils.Errors.INVALID_END); + } + + if (data.readUInt32LE(0) === Constants.ENDSIG) { + // number of entries on this volume + _volumeEntries = data.readUInt16LE(Constants.ENDSUB); + // total number of entries + _totalEntries = data.readUInt16LE(Constants.ENDTOT); + // central directory size in bytes + _size = data.readUInt32LE(Constants.ENDSIZ); + // offset of first CEN header + _offset = data.readUInt32LE(Constants.ENDOFF); + // zip file comment length + _commentLength = data.readUInt16LE(Constants.ENDCOM); + } else { + // number of entries on this volume + _volumeEntries = Utils.readBigUInt64LE(data, Constants.ZIP64SUB); + // total number of entries + _totalEntries = Utils.readBigUInt64LE(data, Constants.ZIP64TOT); + // central directory size in bytes + _size = Utils.readBigUInt64LE(data, Constants.ZIP64SIZ); + // offset of first CEN header + _offset = Utils.readBigUInt64LE(data, Constants.ZIP64OFF); + + _commentLength = 0; + } + + }, + + toBinary : function() { + var b = Buffer.alloc(Constants.ENDHDR + _commentLength); + // "PK 05 06" signature + b.writeUInt32LE(Constants.ENDSIG, 0); + b.writeUInt32LE(0, 4); + // number of entries on this volume + b.writeUInt16LE(_volumeEntries, Constants.ENDSUB); + // total number of entries + b.writeUInt16LE(_totalEntries, Constants.ENDTOT); + // central directory size in bytes + b.writeUInt32LE(_size, Constants.ENDSIZ); + // offset of first CEN header + b.writeUInt32LE(_offset, Constants.ENDOFF); + // zip file comment length + b.writeUInt16LE(_commentLength, Constants.ENDCOM); + // fill comment memory with spaces so no garbage is left there + b.fill(" ", Constants.ENDHDR); + + return b; + }, + + toString : function() { + return '{\n' + + '\t"diskEntries" : ' + _volumeEntries + ",\n" + + '\t"totalEntries" : ' + _totalEntries + ",\n" + + '\t"size" : ' + _size + " bytes,\n" + + '\t"offset" : 0x' + _offset.toString(16).toUpperCase() + ",\n" + + '\t"commentLength" : 0x' + _commentLength + "\n" + + '}'; + } + } +}; \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/methods/deflater.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/methods/deflater.js new file mode 100644 index 000000000..120863928 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/methods/deflater.js @@ -0,0 +1,31 @@ +module.exports = function (/*Buffer*/inbuf) { + + var zlib = require("zlib"); + + var opts = {chunkSize: (parseInt(inbuf.length / 1024) + 1) * 1024}; + + return { + deflate: function () { + return zlib.deflateRawSync(inbuf, opts); + }, + + deflateAsync: function (/*Function*/callback) { + var tmp = zlib.createDeflateRaw(opts), parts = [], total = 0; + tmp.on('data', function (data) { + parts.push(data); + total += data.length; + }); + tmp.on('end', function () { + var buf = Buffer.alloc(total), written = 0; + buf.fill(0); + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + part.copy(buf, written); + written += part.length; + } + callback && callback(buf); + }); + tmp.end(inbuf); + } + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/methods/index.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/methods/index.js new file mode 100644 index 000000000..ddcbba600 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/methods/index.js @@ -0,0 +1,2 @@ +exports.Deflater = require("./deflater"); +exports.Inflater = require("./inflater"); \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/methods/inflater.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/methods/inflater.js new file mode 100644 index 000000000..2978110f5 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/methods/inflater.js @@ -0,0 +1,29 @@ +module.exports = function (/*Buffer*/inbuf) { + + var zlib = require("zlib"); + + return { + inflate: function () { + return zlib.inflateRawSync(inbuf); + }, + + inflateAsync: function (/*Function*/callback) { + var tmp = zlib.createInflateRaw(), parts = [], total = 0; + tmp.on('data', function (data) { + parts.push(data); + total += data.length; + }); + tmp.on('end', function () { + var buf = Buffer.alloc(total), written = 0; + buf.fill(0); + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + part.copy(buf, written); + written += part.length; + } + callback && callback(buf); + }); + tmp.end(inbuf); + } + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/package.json new file mode 100644 index 000000000..0d1f223eb --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/package.json @@ -0,0 +1,47 @@ +{ + "name": "adm-zip", + "version": "0.4.16", + "description": "Javascript implementation of zip for nodejs with support for electron original-fs. Allows user to create or extract zip files both in memory or to/from disk", + "scripts": { + "test": "mocha test/mocha.js test/crc/index.js" + }, + "keywords": [ + "zip", + "methods", + "archive", + "unzip" + ], + "homepage": "https://github.com/cthackers/adm-zip", + "author": "Nasca Iacob (https://github.com/cthackers)", + "bugs": { + "email": "sy@another-d-mention.ro", + "url": "https://github.com/cthackers/adm-zip/issues" + }, + "license": "MIT", + "files": [ + "adm-zip.js", + "headers", + "methods", + "util", + "zipEntry.js", + "zipFile.js", + "MIT-LICENSE.txt" + ], + "main": "adm-zip.js", + "repository": { + "type": "git", + "url": "https://github.com/cthackers/adm-zip.git" + }, + "engines": { + "node": ">=0.3.0" + }, + "devDependencies": { + "chai": "^4.1.2", + "mocha": "^8.0.1", + "rimraf": "^2.6.2" + } + +,"_resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz" +,"_integrity": "sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg==" +,"_from": "adm-zip@0.4.16" +} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/util/constants.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/util/constants.js new file mode 100644 index 000000000..96a914d58 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/util/constants.js @@ -0,0 +1,135 @@ +module.exports = { + /* The local file header */ + LOCHDR : 30, // LOC header size + LOCSIG : 0x04034b50, // "PK\003\004" + LOCVER : 4, // version needed to extract + LOCFLG : 6, // general purpose bit flag + LOCHOW : 8, // compression method + LOCTIM : 10, // modification time (2 bytes time, 2 bytes date) + LOCCRC : 14, // uncompressed file crc-32 value + LOCSIZ : 18, // compressed size + LOCLEN : 22, // uncompressed size + LOCNAM : 26, // filename length + LOCEXT : 28, // extra field length + + /* The Data descriptor */ + EXTSIG : 0x08074b50, // "PK\007\008" + EXTHDR : 16, // EXT header size + EXTCRC : 4, // uncompressed file crc-32 value + EXTSIZ : 8, // compressed size + EXTLEN : 12, // uncompressed size + + /* The central directory file header */ + CENHDR : 46, // CEN header size + CENSIG : 0x02014b50, // "PK\001\002" + CENVEM : 4, // version made by + CENVER : 6, // version needed to extract + CENFLG : 8, // encrypt, decrypt flags + CENHOW : 10, // compression method + CENTIM : 12, // modification time (2 bytes time, 2 bytes date) + CENCRC : 16, // uncompressed file crc-32 value + CENSIZ : 20, // compressed size + CENLEN : 24, // uncompressed size + CENNAM : 28, // filename length + CENEXT : 30, // extra field length + CENCOM : 32, // file comment length + CENDSK : 34, // volume number start + CENATT : 36, // internal file attributes + CENATX : 38, // external file attributes (host system dependent) + CENOFF : 42, // LOC header offset + + /* The entries in the end of central directory */ + ENDHDR : 22, // END header size + ENDSIG : 0x06054b50, // "PK\005\006" + ENDSUB : 8, // number of entries on this disk + ENDTOT : 10, // total number of entries + ENDSIZ : 12, // central directory size in bytes + ENDOFF : 16, // offset of first CEN header + ENDCOM : 20, // zip file comment length + + END64HDR : 20, // zip64 END header size + END64SIG : 0x07064b50, // zip64 Locator signature, "PK\006\007" + END64START : 4, // number of the disk with the start of the zip64 + END64OFF : 8, // relative offset of the zip64 end of central directory + END64NUMDISKS : 16, // total number of disks + + ZIP64SIG : 0x06064b50, // zip64 signature, "PK\006\006" + ZIP64HDR : 56, // zip64 record minimum size + ZIP64LEAD : 12, // leading bytes at the start of the record, not counted by the value stored in ZIP64SIZE + ZIP64SIZE : 4, // zip64 size of the central directory record + ZIP64VEM : 12, // zip64 version made by + ZIP64VER : 14, // zip64 version needed to extract + ZIP64DSK : 16, // zip64 number of this disk + ZIP64DSKDIR : 20, // number of the disk with the start of the record directory + ZIP64SUB : 24, // number of entries on this disk + ZIP64TOT : 32, // total number of entries + ZIP64SIZB : 40, // zip64 central directory size in bytes + ZIP64OFF : 48, // offset of start of central directory with respect to the starting disk number + ZIP64EXTRA : 56, // extensible data sector + + /* Compression methods */ + STORED : 0, // no compression + SHRUNK : 1, // shrunk + REDUCED1 : 2, // reduced with compression factor 1 + REDUCED2 : 3, // reduced with compression factor 2 + REDUCED3 : 4, // reduced with compression factor 3 + REDUCED4 : 5, // reduced with compression factor 4 + IMPLODED : 6, // imploded + // 7 reserved + DEFLATED : 8, // deflated + ENHANCED_DEFLATED: 9, // enhanced deflated + PKWARE : 10,// PKWare DCL imploded + // 11 reserved + BZIP2 : 12, // compressed using BZIP2 + // 13 reserved + LZMA : 14, // LZMA + // 15-17 reserved + IBM_TERSE : 18, // compressed using IBM TERSE + IBM_LZ77 : 19, //IBM LZ77 z + + /* General purpose bit flag */ + FLG_ENC : 0, // encripted file + FLG_COMP1 : 1, // compression option + FLG_COMP2 : 2, // compression option + FLG_DESC : 4, // data descriptor + FLG_ENH : 8, // enhanced deflation + FLG_STR : 16, // strong encryption + FLG_LNG : 1024, // language encoding + FLG_MSK : 4096, // mask header values + + /* Load type */ + FILE : 0, + BUFFER : 1, + NONE : 2, + + /* 4.5 Extensible data fields */ + EF_ID : 0, + EF_SIZE : 2, + + /* Header IDs */ + ID_ZIP64 : 0x0001, + ID_AVINFO : 0x0007, + ID_PFS : 0x0008, + ID_OS2 : 0x0009, + ID_NTFS : 0x000a, + ID_OPENVMS : 0x000c, + ID_UNIX : 0x000d, + ID_FORK : 0x000e, + ID_PATCH : 0x000f, + ID_X509_PKCS7 : 0x0014, + ID_X509_CERTID_F : 0x0015, + ID_X509_CERTID_C : 0x0016, + ID_STRONGENC : 0x0017, + ID_RECORD_MGT : 0x0018, + ID_X509_PKCS7_RL : 0x0019, + ID_IBM1 : 0x0065, + ID_IBM2 : 0x0066, + ID_POSZIP : 0x4690, + + EF_ZIP64_OR_32 : 0xffffffff, + EF_ZIP64_OR_16 : 0xffff, + EF_ZIP64_SUNCOMP : 0, + EF_ZIP64_SCOMP : 8, + EF_ZIP64_RHO : 16, + EF_ZIP64_DSN : 24 +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/util/errors.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/util/errors.js new file mode 100644 index 000000000..db5d69e9a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/util/errors.js @@ -0,0 +1,35 @@ +module.exports = { + /* Header error messages */ + "INVALID_LOC" : "Invalid LOC header (bad signature)", + "INVALID_CEN" : "Invalid CEN header (bad signature)", + "INVALID_END" : "Invalid END header (bad signature)", + + /* ZipEntry error messages*/ + "NO_DATA" : "Nothing to decompress", + "BAD_CRC" : "CRC32 checksum failed", + "FILE_IN_THE_WAY" : "There is a file in the way: %s", + "UNKNOWN_METHOD" : "Invalid/unsupported compression method", + + /* Inflater error messages */ + "AVAIL_DATA" : "inflate::Available inflate data did not terminate", + "INVALID_DISTANCE" : "inflate::Invalid literal/length or distance code in fixed or dynamic block", + "TO_MANY_CODES" : "inflate::Dynamic block code description: too many length or distance codes", + "INVALID_REPEAT_LEN" : "inflate::Dynamic block code description: repeat more than specified lengths", + "INVALID_REPEAT_FIRST" : "inflate::Dynamic block code description: repeat lengths with no first length", + "INCOMPLETE_CODES" : "inflate::Dynamic block code description: code lengths codes incomplete", + "INVALID_DYN_DISTANCE": "inflate::Dynamic block code description: invalid distance code lengths", + "INVALID_CODES_LEN": "inflate::Dynamic block code description: invalid literal/length code lengths", + "INVALID_STORE_BLOCK" : "inflate::Stored block length did not match one's complement", + "INVALID_BLOCK_TYPE" : "inflate::Invalid block type (type == 3)", + + /* ADM-ZIP error messages */ + "CANT_EXTRACT_FILE" : "Could not extract the file", + "CANT_OVERRIDE" : "Target file already exists", + "NO_ZIP" : "No zip file was loaded", + "NO_ENTRY" : "Entry doesn't exist", + "DIRECTORY_CONTENT_ERROR" : "A directory cannot have content", + "FILE_NOT_FOUND" : "File not found: %s", + "NOT_IMPLEMENTED" : "Not implemented", + "INVALID_FILENAME" : "Invalid filename", + "INVALID_FORMAT" : "Invalid or unsupported zip format. No END header found" +}; \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/util/fattr.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/util/fattr.js new file mode 100644 index 000000000..b56fbd79a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/util/fattr.js @@ -0,0 +1,84 @@ +var fs = require("./fileSystem").require(), + pth = require("path"); + +fs.existsSync = fs.existsSync || pth.existsSync; + +module.exports = function(/*String*/path) { + + var _path = path || "", + _permissions = 0, + _obj = newAttr(), + _stat = null; + + function newAttr() { + return { + directory : false, + readonly : false, + hidden : false, + executable : false, + mtime : 0, + atime : 0 + } + } + + if (_path && fs.existsSync(_path)) { + _stat = fs.statSync(_path); + _obj.directory = _stat.isDirectory(); + _obj.mtime = _stat.mtime; + _obj.atime = _stat.atime; + _obj.executable = !!(1 & parseInt ((_stat.mode & parseInt ("777", 8)).toString (8)[0])); + _obj.readonly = !!(2 & parseInt ((_stat.mode & parseInt ("777", 8)).toString (8)[0])); + _obj.hidden = pth.basename(_path)[0] === "."; + } else { + console.warn("Invalid path: " + _path) + } + + return { + + get directory () { + return _obj.directory; + }, + + get readOnly () { + return _obj.readonly; + }, + + get hidden () { + return _obj.hidden; + }, + + get mtime () { + return _obj.mtime; + }, + + get atime () { + return _obj.atime; + }, + + + get executable () { + return _obj.executable; + }, + + decodeAttributes : function(val) { + + }, + + encodeAttributes : function (val) { + + }, + + toString : function() { + return '{\n' + + '\t"path" : "' + _path + ",\n" + + '\t"isDirectory" : ' + _obj.directory + ",\n" + + '\t"isReadOnly" : ' + _obj.readonly + ",\n" + + '\t"isHidden" : ' + _obj.hidden + ",\n" + + '\t"isExecutable" : ' + _obj.executable + ",\n" + + '\t"mTime" : ' + _obj.mtime + "\n" + + '\t"aTime" : ' + _obj.atime + "\n" + + '}'; + } + } + +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/util/fileSystem.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/util/fileSystem.js new file mode 100644 index 000000000..801ebffd0 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/util/fileSystem.js @@ -0,0 +1,12 @@ +exports.require = function() { + var fs = require("fs"); + if (process.versions['electron']) { + try { + originalFs = require("original-fs"); + if (Object.keys(originalFs).length > 0) { + fs = originalFs; + } + } catch (e) {} + } + return fs +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/util/index.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/util/index.js new file mode 100644 index 000000000..70528f62d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/util/index.js @@ -0,0 +1,5 @@ +module.exports = require("./utils"); +module.exports.FileSystem = require("./fileSystem"); +module.exports.Constants = require("./constants"); +module.exports.Errors = require("./errors"); +module.exports.FileAttr = require("./fattr"); \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/util/utils.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/util/utils.js new file mode 100644 index 000000000..a1c1b5c25 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/util/utils.js @@ -0,0 +1,218 @@ +var fs = require("./fileSystem").require(), + pth = require('path'); + +fs.existsSync = fs.existsSync || pth.existsSync; + +module.exports = (function() { + + var crcTable = [], + Constants = require('./constants'), + Errors = require('./errors'), + + PATH_SEPARATOR = pth.sep; + + + function mkdirSync(/*String*/path) { + var resolvedPath = path.split(PATH_SEPARATOR)[0]; + path.split(PATH_SEPARATOR).forEach(function(name) { + if (!name || name.substr(-1,1) === ":") return; + resolvedPath += PATH_SEPARATOR + name; + var stat; + try { + stat = fs.statSync(resolvedPath); + } catch (e) { + fs.mkdirSync(resolvedPath); + } + if (stat && stat.isFile()) + throw Errors.FILE_IN_THE_WAY.replace("%s", resolvedPath); + }); + } + + function findSync(/*String*/dir, /*RegExp*/pattern, /*Boolean*/recoursive) { + if (typeof pattern === 'boolean') { + recoursive = pattern; + pattern = undefined; + } + var files = []; + fs.readdirSync(dir).forEach(function(file) { + var path = pth.join(dir, file); + + if (fs.statSync(path).isDirectory() && recoursive) + files = files.concat(findSync(path, pattern, recoursive)); + + if (!pattern || pattern.test(path)) { + files.push(pth.normalize(path) + (fs.statSync(path).isDirectory() ? PATH_SEPARATOR : "")); + } + + }); + return files; + } + + function readBigUInt64LE(/*Buffer*/buffer, /*int*/index) { + var slice = Buffer.from(buffer.slice(index, index + 8)); + slice.swap64(); + + return parseInt(`0x${ slice.toString('hex') }`); + } + + return { + makeDir : function(/*String*/path) { + mkdirSync(path); + }, + + crc32 : function(buf) { + if (typeof buf === 'string') { + buf = Buffer.alloc(buf.length, buf); + } + var b = Buffer.alloc(4); + if (!crcTable.length) { + for (var n = 0; n < 256; n++) { + var c = n; + for (var k = 8; --k >= 0;) // + if ((c & 1) !== 0) { c = 0xedb88320 ^ (c >>> 1); } else { c = c >>> 1; } + if (c < 0) { + b.writeInt32LE(c, 0); + c = b.readUInt32LE(0); + } + crcTable[n] = c; + } + } + var crc = 0, off = 0, len = buf.length, c1 = ~crc; + while(--len >= 0) c1 = crcTable[(c1 ^ buf[off++]) & 0xff] ^ (c1 >>> 8); + crc = ~c1; + b.writeInt32LE(crc & 0xffffffff, 0); + return b.readUInt32LE(0); + }, + + methodToString : function(/*Number*/method) { + switch (method) { + case Constants.STORED: + return 'STORED (' + method + ')'; + case Constants.DEFLATED: + return 'DEFLATED (' + method + ')'; + default: + return 'UNSUPPORTED (' + method + ')'; + } + + }, + + writeFileTo : function(/*String*/path, /*Buffer*/content, /*Boolean*/overwrite, /*Number*/attr) { + if (fs.existsSync(path)) { + if (!overwrite) + return false; // cannot overwrite + + var stat = fs.statSync(path); + if (stat.isDirectory()) { + return false; + } + } + var folder = pth.dirname(path); + if (!fs.existsSync(folder)) { + mkdirSync(folder); + } + + var fd; + try { + fd = fs.openSync(path, 'w', 438); // 0666 + } catch(e) { + fs.chmodSync(path, 438); + fd = fs.openSync(path, 'w', 438); + } + if (fd) { + try { + fs.writeSync(fd, content, 0, content.length, 0); + } + catch (e){ + throw e; + } + finally { + fs.closeSync(fd); + } + } + fs.chmodSync(path, attr || 438); + return true; + }, + + writeFileToAsync : function(/*String*/path, /*Buffer*/content, /*Boolean*/overwrite, /*Number*/attr, /*Function*/callback) { + if(typeof attr === 'function') { + callback = attr; + attr = undefined; + } + + fs.exists(path, function(exists) { + if(exists && !overwrite) + return callback(false); + + fs.stat(path, function(err, stat) { + if(exists &&stat.isDirectory()) { + return callback(false); + } + + var folder = pth.dirname(path); + fs.exists(folder, function(exists) { + if(!exists) + mkdirSync(folder); + + fs.open(path, 'w', 438, function(err, fd) { + if(err) { + fs.chmod(path, 438, function() { + fs.open(path, 'w', 438, function(err, fd) { + fs.write(fd, content, 0, content.length, 0, function() { + fs.close(fd, function() { + fs.chmod(path, attr || 438, function() { + callback(true); + }) + }); + }); + }); + }) + } else { + if(fd) { + fs.write(fd, content, 0, content.length, 0, function() { + fs.close(fd, function() { + fs.chmod(path, attr || 438, function() { + callback(true); + }) + }); + }); + } else { + fs.chmod(path, attr || 438, function() { + callback(true); + }) + } + } + }); + }) + }) + }) + }, + + findFiles : function(/*String*/path) { + return findSync(path, true); + }, + + getAttributes : function(/*String*/path) { + + }, + + setAttributes : function(/*String*/path) { + + }, + + toBuffer : function(input) { + if (Buffer.isBuffer(input)) { + return input; + } else { + if (input.length === 0) { + return Buffer.alloc(0) + } + return Buffer.from(input, 'utf8'); + } + }, + + readBigUInt64LE, + + Constants : Constants, + Errors : Errors + } +})(); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/zipEntry.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/zipEntry.js new file mode 100644 index 000000000..979f12563 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/zipEntry.js @@ -0,0 +1,291 @@ +var Utils = require("./util"), + Headers = require("./headers"), + Constants = Utils.Constants, + Methods = require("./methods"); + +module.exports = function (/*Buffer*/input) { + + var _entryHeader = new Headers.EntryHeader(), + _entryName = Buffer.alloc(0), + _comment = Buffer.alloc(0), + _isDirectory = false, + uncompressedData = null, + _extra = Buffer.alloc(0); + + function getCompressedDataFromZip() { + if (!input || !Buffer.isBuffer(input)) { + return Buffer.alloc(0); + } + _entryHeader.loadDataHeaderFromBinary(input); + return input.slice(_entryHeader.realDataOffset, _entryHeader.realDataOffset + _entryHeader.compressedSize) + } + + function crc32OK(data) { + // if bit 3 (0x08) of the general-purpose flags field is set, then the CRC-32 and file sizes are not known when the header is written + if ((_entryHeader.flags & 0x8) !== 0x8) { + if (Utils.crc32(data) !== _entryHeader.dataHeader.crc) { + return false; + } + } else { + // @TODO: load and check data descriptor header + // The fields in the local header are filled with zero, and the CRC-32 and size are appended in a 12-byte structure + // (optionally preceded by a 4-byte signature) immediately after the compressed data: + } + return true; + } + + function decompress(/*Boolean*/async, /*Function*/callback, /*String*/pass) { + if(typeof callback === 'undefined' && typeof async === 'string') { + pass=async; + async=void 0; + } + if (_isDirectory) { + if (async && callback) { + callback(Buffer.alloc(0), Utils.Errors.DIRECTORY_CONTENT_ERROR); //si added error. + } + return Buffer.alloc(0); + } + + var compressedData = getCompressedDataFromZip(); + + if (compressedData.length === 0) { + // File is empty, nothing to decompress. + if (async && callback) callback(compressedData); + return compressedData; + } + + var data = Buffer.alloc(_entryHeader.size); + + switch (_entryHeader.method) { + case Utils.Constants.STORED: + compressedData.copy(data); + if (!crc32OK(data)) { + if (async && callback) callback(data, Utils.Errors.BAD_CRC);//si added error + throw new Error(Utils.Errors.BAD_CRC); + } else {//si added otherwise did not seem to return data. + if (async && callback) callback(data); + return data; + } + case Utils.Constants.DEFLATED: + var inflater = new Methods.Inflater(compressedData); + if (!async) { + var result = inflater.inflate(data); + result.copy(data, 0); + if (!crc32OK(data)) { + throw new Error(Utils.Errors.BAD_CRC + " " + _entryName.toString()); + } + return data; + } else { + inflater.inflateAsync(function(result) { + result.copy(data, 0); + if (!crc32OK(data)) { + if (callback) callback(data, Utils.Errors.BAD_CRC); //si added error + } else { //si added otherwise did not seem to return data. + if (callback) callback(data); + } + }) + } + break; + default: + if (async && callback) callback(Buffer.alloc(0), Utils.Errors.UNKNOWN_METHOD); + throw new Error(Utils.Errors.UNKNOWN_METHOD); + } + } + + function compress(/*Boolean*/async, /*Function*/callback) { + if ((!uncompressedData || !uncompressedData.length) && Buffer.isBuffer(input)) { + // no data set or the data wasn't changed to require recompression + if (async && callback) callback(getCompressedDataFromZip()); + return getCompressedDataFromZip(); + } + + if (uncompressedData.length && !_isDirectory) { + var compressedData; + // Local file header + switch (_entryHeader.method) { + case Utils.Constants.STORED: + _entryHeader.compressedSize = _entryHeader.size; + + compressedData = Buffer.alloc(uncompressedData.length); + uncompressedData.copy(compressedData); + + if (async && callback) callback(compressedData); + return compressedData; + default: + case Utils.Constants.DEFLATED: + + var deflater = new Methods.Deflater(uncompressedData); + if (!async) { + var deflated = deflater.deflate(); + _entryHeader.compressedSize = deflated.length; + return deflated; + } else { + deflater.deflateAsync(function(data) { + compressedData = Buffer.alloc(data.length); + _entryHeader.compressedSize = data.length; + data.copy(compressedData); + callback && callback(compressedData); + }) + } + deflater = null; + break; + } + } else { + if (async && callback) { + callback(Buffer.alloc(0)); + } else { + return Buffer.alloc(0); + } + } + } + + function readUInt64LE(buffer, offset) { + return (buffer.readUInt32LE(offset + 4) << 4) + buffer.readUInt32LE(offset); + } + + function parseExtra(data) { + var offset = 0; + var signature, size, part; + while(offset= Constants.EF_ZIP64_SCOMP) { + size = readUInt64LE(data, Constants.EF_ZIP64_SUNCOMP); + if(_entryHeader.size === Constants.EF_ZIP64_OR_32) { + _entryHeader.size = size; + } + } + if(data.length >= Constants.EF_ZIP64_RHO) { + compressedSize = readUInt64LE(data, Constants.EF_ZIP64_SCOMP); + if(_entryHeader.compressedSize === Constants.EF_ZIP64_OR_32) { + _entryHeader.compressedSize = compressedSize; + } + } + if(data.length >= Constants.EF_ZIP64_DSN) { + offset = readUInt64LE(data, Constants.EF_ZIP64_RHO); + if(_entryHeader.offset === Constants.EF_ZIP64_OR_32) { + _entryHeader.offset = offset; + } + } + if(data.length >= Constants.EF_ZIP64_DSN+4) { + diskNumStart = data.readUInt32LE(Constants.EF_ZIP64_DSN); + if(_entryHeader.diskNumStart === Constants.EF_ZIP64_OR_16) { + _entryHeader.diskNumStart = diskNumStart; + } + } + } + + + return { + get entryName () { return _entryName.toString(); }, + get rawEntryName() { return _entryName; }, + set entryName (val) { + _entryName = Utils.toBuffer(val); + var lastChar = _entryName[_entryName.length - 1]; + _isDirectory = (lastChar === 47) || (lastChar === 92); + _entryHeader.fileNameLength = _entryName.length; + }, + + get extra () { return _extra; }, + set extra (val) { + _extra = val; + _entryHeader.extraLength = val.length; + parseExtra(val); + }, + + get comment () { return _comment.toString(); }, + set comment (val) { + _comment = Utils.toBuffer(val); + _entryHeader.commentLength = _comment.length; + }, + + get name () { var n = _entryName.toString(); return _isDirectory ? n.substr(n.length - 1).split("/").pop() : n.split("/").pop(); }, + get isDirectory () { return _isDirectory }, + + getCompressedData : function() { + return compress(false, null) + }, + + getCompressedDataAsync : function(/*Function*/callback) { + compress(true, callback) + }, + + setData : function(value) { + uncompressedData = Utils.toBuffer(value); + if (!_isDirectory && uncompressedData.length) { + _entryHeader.size = uncompressedData.length; + _entryHeader.method = Utils.Constants.DEFLATED; + _entryHeader.crc = Utils.crc32(value); + _entryHeader.changed = true; + } else { // folders and blank files should be stored + _entryHeader.method = Utils.Constants.STORED; + } + }, + + getData : function(pass) { + if (_entryHeader.changed) { + return uncompressedData; + } else { + return decompress(false, null, pass); + } + }, + + getDataAsync : function(/*Function*/callback, pass) { + if (_entryHeader.changed) { + callback(uncompressedData) + } else { + decompress(true, callback, pass) + } + }, + + set attr(attr) { _entryHeader.attr = attr; }, + get attr() { return _entryHeader.attr; }, + + set header(/*Buffer*/data) { + _entryHeader.loadFromBinary(data); + }, + + get header() { + return _entryHeader; + }, + + packHeader : function() { + var header = _entryHeader.entryHeaderToBinary(); + // add + _entryName.copy(header, Utils.Constants.CENHDR); + if (_entryHeader.extraLength) { + _extra.copy(header, Utils.Constants.CENHDR + _entryName.length) + } + if (_entryHeader.commentLength) { + _comment.copy(header, Utils.Constants.CENHDR + _entryName.length + _entryHeader.extraLength, _comment.length); + } + return header; + }, + + toString : function() { + return '{\n' + + '\t"entryName" : "' + _entryName.toString() + "\",\n" + + '\t"name" : "' + (_isDirectory ? _entryName.toString().replace(/\/$/, '').split("/").pop() : _entryName.toString().split("/").pop()) + "\",\n" + + '\t"comment" : "' + _comment.toString() + "\",\n" + + '\t"isDirectory" : ' + _isDirectory + ",\n" + + '\t"header" : ' + _entryHeader.toString().replace(/\t/mg, "\t\t").replace(/}/mg, "\t}") + ",\n" + + '\t"compressedData" : <' + (input && input.length + " bytes buffer" || "null") + ">\n" + + '\t"data" : <' + (uncompressedData && uncompressedData.length + " bytes buffer" || "null") + ">\n" + + '}'; + } + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/zipFile.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/zipFile.js new file mode 100644 index 000000000..e4d1058b8 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/adm-zip/zipFile.js @@ -0,0 +1,408 @@ +var ZipEntry = require("./zipEntry"), + Headers = require("./headers"), + Utils = require("./util"); + +module.exports = function (/*String|Buffer*/input, /*Number*/inputType) { + var entryList = [], + entryTable = {}, + _comment = Buffer.alloc(0), + filename = "", + fs = Utils.FileSystem.require(), + inBuffer = null, + mainHeader = new Headers.MainHeader(), + loadedEntries = false; + + if (inputType === Utils.Constants.FILE) { + // is a filename + filename = input; + inBuffer = fs.readFileSync(filename); + readMainHeader(); + } else if (inputType === Utils.Constants.BUFFER) { + // is a memory buffer + inBuffer = input; + readMainHeader(); + } else { + // none. is a new file + loadedEntries = true; + } + + function iterateEntries(callback) { + const totalEntries = mainHeader.diskEntries; // total number of entries + let index = mainHeader.offset; // offset of first CEN header + + for (let i = 0; i < totalEntries; i++) { + let tmp = index; + const entry = new ZipEntry(inBuffer); + + entry.header = inBuffer.slice(tmp, tmp += Utils.Constants.CENHDR); + entry.entryName = inBuffer.slice(tmp, tmp += entry.header.fileNameLength); + + index += entry.header.entryHeaderSize; + + callback(entry); + } + } + + function readEntries() { + loadedEntries = true; + entryTable = {}; + entryList = new Array(mainHeader.diskEntries); // total number of entries + var index = mainHeader.offset; // offset of first CEN header + for (var i = 0; i < entryList.length; i++) { + + var tmp = index, + entry = new ZipEntry(inBuffer); + entry.header = inBuffer.slice(tmp, tmp += Utils.Constants.CENHDR); + + entry.entryName = inBuffer.slice(tmp, tmp += entry.header.fileNameLength); + + if (entry.header.extraLength) { + entry.extra = inBuffer.slice(tmp, tmp += entry.header.extraLength); + } + + if (entry.header.commentLength) + entry.comment = inBuffer.slice(tmp, tmp + entry.header.commentLength); + + index += entry.header.entryHeaderSize; + + entryList[i] = entry; + entryTable[entry.entryName] = entry; + } + } + + function readMainHeader() { + var i = inBuffer.length - Utils.Constants.ENDHDR, // END header size + max = Math.max(0, i - 0xFFFF), // 0xFFFF is the max zip file comment length + n = max, + endStart = inBuffer.length, + endOffset = -1, // Start offset of the END header + commentEnd = 0; + + for (i; i >= n; i--) { + if (inBuffer[i] !== 0x50) continue; // quick check that the byte is 'P' + if (inBuffer.readUInt32LE(i) === Utils.Constants.ENDSIG) { // "PK\005\006" + endOffset = i; + commentEnd = i; + endStart = i + Utils.Constants.ENDHDR; + // We already found a regular signature, let's look just a bit further to check if there's any zip64 signature + n = i - Utils.Constants.END64HDR; + continue; + } + + if (inBuffer.readUInt32LE(i) === Utils.Constants.END64SIG) { + // Found a zip64 signature, let's continue reading the whole zip64 record + n = max; + continue; + } + + if (inBuffer.readUInt32LE(i) == Utils.Constants.ZIP64SIG) { + // Found the zip64 record, let's determine it's size + endOffset = i; + endStart = i + Utils.readBigUInt64LE(inBuffer, i + Utils.Constants.ZIP64SIZE) + Utils.Constants.ZIP64LEAD; + break; + } + } + + if (!~endOffset) + throw new Error(Utils.Errors.INVALID_FORMAT); + + mainHeader.loadFromBinary(inBuffer.slice(endOffset, endStart)); + if (mainHeader.commentLength) { + _comment = inBuffer.slice(commentEnd + Utils.Constants.ENDHDR); + } + // readEntries(); + } + + return { + /** + * Returns an array of ZipEntry objects existent in the current opened archive + * @return Array + */ + get entries() { + if (!loadedEntries) { + readEntries(); + } + return entryList; + }, + + /** + * Archive comment + * @return {String} + */ + get comment() { + return _comment.toString(); + }, + set comment(val) { + mainHeader.commentLength = val.length; + _comment = val; + }, + + getEntryCount: function() { + if (!loadedEntries) { + return mainHeader.diskEntries; + } + + return entryList.length; + }, + + forEach: function(callback) { + if (!loadedEntries) { + iterateEntries(callback); + return; + } + + entryList.forEach(callback); + }, + + /** + * Returns a reference to the entry with the given name or null if entry is inexistent + * + * @param entryName + * @return ZipEntry + */ + getEntry: function (/*String*/entryName) { + if (!loadedEntries) { + readEntries(); + } + return entryTable[entryName] || null; + }, + + /** + * Adds the given entry to the entry list + * + * @param entry + */ + setEntry: function (/*ZipEntry*/entry) { + if (!loadedEntries) { + readEntries(); + } + entryList.push(entry); + entryTable[entry.entryName] = entry; + mainHeader.totalEntries = entryList.length; + }, + + /** + * Removes the entry with the given name from the entry list. + * + * If the entry is a directory, then all nested files and directories will be removed + * @param entryName + */ + deleteEntry: function (/*String*/entryName) { + if (!loadedEntries) { + readEntries(); + } + var entry = entryTable[entryName]; + if (entry && entry.isDirectory) { + var _self = this; + this.getEntryChildren(entry).forEach(function (child) { + if (child.entryName !== entryName) { + _self.deleteEntry(child.entryName) + } + }) + } + entryList.splice(entryList.indexOf(entry), 1); + delete(entryTable[entryName]); + mainHeader.totalEntries = entryList.length; + }, + + /** + * Iterates and returns all nested files and directories of the given entry + * + * @param entry + * @return Array + */ + getEntryChildren: function (/*ZipEntry*/entry) { + if (!loadedEntries) { + readEntries(); + } + if (entry.isDirectory) { + var list = [], + name = entry.entryName, + len = name.length; + + entryList.forEach(function (zipEntry) { + if (zipEntry.entryName.substr(0, len) === name) { + list.push(zipEntry); + } + }); + return list; + } + return [] + }, + + /** + * Returns the zip file + * + * @return Buffer + */ + compressToBuffer: function () { + if (!loadedEntries) { + readEntries(); + } + if (entryList.length > 1) { + entryList.sort(function (a, b) { + var nameA = a.entryName.toLowerCase(); + var nameB = b.entryName.toLowerCase(); + if (nameA < nameB) { + return -1 + } + if (nameA > nameB) { + return 1 + } + return 0; + }); + } + + var totalSize = 0, + dataBlock = [], + entryHeaders = [], + dindex = 0; + + mainHeader.size = 0; + mainHeader.offset = 0; + + entryList.forEach(function (entry) { + // compress data and set local and entry header accordingly. Reason why is called first + var compressedData = entry.getCompressedData(); + // data header + entry.header.offset = dindex; + var dataHeader = entry.header.dataHeaderToBinary(); + var entryNameLen = entry.rawEntryName.length; + var extra = entry.extra.toString(); + var postHeader = Buffer.alloc(entryNameLen + extra.length); + entry.rawEntryName.copy(postHeader, 0); + postHeader.fill(extra, entryNameLen); + + var dataLength = dataHeader.length + postHeader.length + compressedData.length; + + dindex += dataLength; + + dataBlock.push(dataHeader); + dataBlock.push(postHeader); + dataBlock.push(compressedData); + + var entryHeader = entry.packHeader(); + entryHeaders.push(entryHeader); + mainHeader.size += entryHeader.length; + totalSize += (dataLength + entryHeader.length); + }); + + totalSize += mainHeader.mainHeaderSize; // also includes zip file comment length + // point to end of data and beginning of central directory first record + mainHeader.offset = dindex; + + dindex = 0; + var outBuffer = Buffer.alloc(totalSize); + dataBlock.forEach(function (content) { + content.copy(outBuffer, dindex); // write data blocks + dindex += content.length; + }); + entryHeaders.forEach(function (content) { + content.copy(outBuffer, dindex); // write central directory entries + dindex += content.length; + }); + + var mh = mainHeader.toBinary(); + if (_comment) { + Buffer.from(_comment).copy(mh, Utils.Constants.ENDHDR); // add zip file comment + } + + mh.copy(outBuffer, dindex); // write main header + + return outBuffer + }, + + toAsyncBuffer: function (/*Function*/onSuccess, /*Function*/onFail, /*Function*/onItemStart, /*Function*/onItemEnd) { + if (!loadedEntries) { + readEntries(); + } + if (entryList.length > 1) { + entryList.sort(function (a, b) { + var nameA = a.entryName.toLowerCase(); + var nameB = b.entryName.toLowerCase(); + if (nameA > nameB) { + return -1 + } + if (nameA < nameB) { + return 1 + } + return 0; + }); + } + + var totalSize = 0, + dataBlock = [], + entryHeaders = [], + dindex = 0; + + mainHeader.size = 0; + mainHeader.offset = 0; + + var compress = function (entryList) { + var self = arguments.callee; + if (entryList.length) { + var entry = entryList.pop(); + var name = entry.entryName + entry.extra.toString(); + if (onItemStart) onItemStart(name); + entry.getCompressedDataAsync(function (compressedData) { + if (onItemEnd) onItemEnd(name); + + entry.header.offset = dindex; + // data header + var dataHeader = entry.header.dataHeaderToBinary(); + var postHeader; + try { + postHeader = Buffer.alloc(name.length, name); // using alloc will work on node 5.x+ + } catch(e){ + postHeader = new Buffer(name); // use deprecated method if alloc fails... + } + var dataLength = dataHeader.length + postHeader.length + compressedData.length; + + dindex += dataLength; + + dataBlock.push(dataHeader); + dataBlock.push(postHeader); + dataBlock.push(compressedData); + + var entryHeader = entry.packHeader(); + entryHeaders.push(entryHeader); + mainHeader.size += entryHeader.length; + totalSize += (dataLength + entryHeader.length); + + if (entryList.length) { + self(entryList); + } else { + + + totalSize += mainHeader.mainHeaderSize; // also includes zip file comment length + // point to end of data and beginning of central directory first record + mainHeader.offset = dindex; + + dindex = 0; + var outBuffer = Buffer.alloc(totalSize); + dataBlock.forEach(function (content) { + content.copy(outBuffer, dindex); // write data blocks + dindex += content.length; + }); + entryHeaders.forEach(function (content) { + content.copy(outBuffer, dindex); // write central directory entries + dindex += content.length; + }); + + var mh = mainHeader.toBinary(); + if (_comment) { + _comment.copy(mh, Utils.Constants.ENDHDR); // add zip file comment + } + + mh.copy(outBuffer, dindex); // write main header + + onSuccess(outBuffer); + } + }); + } + }; + + compress(entryList); + } + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/.travis.yml b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/.travis.yml new file mode 100644 index 000000000..76200951f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/.travis.yml @@ -0,0 +1,24 @@ +sudo: false + +language: node_js + +node_js: + - "4" + - "5" + - "6" + - "7" + - "8" + - "9" + - "10" + +install: + - PATH="`npm bin`:`npm bin -g`:$PATH" + # Install dependencies and build + - npm install + +script: + # Output useful info for debugging + - node --version + - npm --version + # Run tests + - npm test diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/History.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/History.md new file mode 100644 index 000000000..80c88dc40 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/History.md @@ -0,0 +1,113 @@ + +4.2.0 / 2018-01-15 +================== + + * Add support for returning an `http.Agent` instance + * Optimize promisifying logic + * Set `timeout` to null for proper cleanup + * Remove Node.js <= 0.11.3 special-casing from test case + +4.1.2 / 2017-11-20 +================== + + * test Node 9 on Travis + * ensure that `https.get()` uses the patched `https.request()` + +4.1.1 / 2017-07-20 +================== + + * Correct `https.request()` with a String (#9) + +4.1.0 / 2017-06-26 +================== + + * mix in Agent options into Request options + * throw when nothing is returned from agent-base callback + * do not modify the options object for https requests + +4.0.1 / 2017-06-13 +================== + + * add `this` context tests and fixes + +4.0.0 / 2017-06-06 +================== + + * drop support for Node.js < 4 + * drop old versions of Node.js from Travis-CI + * specify Node.js >= 4.0.0 in `engines.node` + * remove more old code + * remove "extend" dependency + * remove "semver" dependency + * make the Promise logic a bit cleaner + * add async function pseudo-example to README + * use direct return in README example + +3.0.0 / 2017-06-02 +================== + + * drop support for Node.js v0.8 and v0.10 + * add support for async, Promises, and direct return + * add a couple `options` test cases + * implement a `"timeout"` option + * rename main file to `index.js` + * test Node 8 on Travis + +2.1.1 / 2017-05-30 +================== + + * Revert [`fe2162e`](https://github.com/TooTallNate/node-agent-base/commit/fe2162e0ba18123f5b301cba4de1e9dd74e437cd) and [`270bdc9`](https://github.com/TooTallNate/node-agent-base/commit/270bdc92eb8e3bd0444d1e5266e8e9390aeb3095) (fixes #7) + +2.1.0 / 2017-05-26 +================== + + * unref is not supported for node < 0.9.1 (@pi0) + * add tests to dangling socket (@pi0) + * check unref() is supported (@pi0) + * fix dangling sockets problem (@pi0) + * add basic "ws" module tests + * make `Agent` be subclassable + * turn `addRequest()` into a named function + * test: Node.js v4 likes to call `cork` on the stream (#3, @tomhughes) + * travis: test node v4, v5, v6 and v7 + +2.0.1 / 2015-09-10 +================== + + * package: update "semver" to v5.0.1 for WebPack (#1, @vhpoet) + +2.0.0 / 2015-07-10 +================== + + * refactor to patch Node.js core for more consistent `opts` values + * ensure that HTTP(s) default port numbers are always given + * test: use ssl-cert-snakeoil SSL certs + * test: add tests for arbitrary options + * README: add API section + * README: make the Agent HTTP/HTTPS generic in the example + * README: use SVG for Travis-CI badge + +1.0.2 / 2015-06-27 +================== + + * agent: set `req._hadError` to true after emitting "error" + * package: update "mocha" to v2 + * test: add artificial HTTP GET request test + * test: add artificial data events test + * test: fix artifical GET response test on node > v0.11.3 + * test: use a real timeout for the async error test + +1.0.1 / 2013-09-09 +================== + + * Fix passing an "error" object to the callback function on the first tick + +1.0.0 / 2013-09-09 +================== + + * New API: now you pass a callback function directly + +0.0.1 / 2013-07-09 +================== + + * Initial release diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/README.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/README.md new file mode 100644 index 000000000..dbeceab8a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/README.md @@ -0,0 +1,145 @@ +agent-base +========== +### Turn a function into an [`http.Agent`][http.Agent] instance +[![Build Status](https://travis-ci.org/TooTallNate/node-agent-base.svg?branch=master)](https://travis-ci.org/TooTallNate/node-agent-base) + +This module provides an `http.Agent` generator. That is, you pass it an async +callback function, and it returns a new `http.Agent` instance that will invoke the +given callback function when sending outbound HTTP requests. + +#### Some subclasses: + +Here's some more interesting uses of `agent-base`. +Send a pull request to list yours! + + * [`http-proxy-agent`][http-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTP endpoints + * [`https-proxy-agent`][https-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTPS endpoints + * [`pac-proxy-agent`][pac-proxy-agent]: A PAC file proxy `http.Agent` implementation for HTTP and HTTPS + * [`socks-proxy-agent`][socks-proxy-agent]: A SOCKS (v4a) proxy `http.Agent` implementation for HTTP and HTTPS + + +Installation +------------ + +Install with `npm`: + +``` bash +$ npm install agent-base +``` + + +Example +------- + +Here's a minimal example that creates a new `net.Socket` connection to the server +for every HTTP request (i.e. the equivalent of `agent: false` option): + +```js +var net = require('net'); +var tls = require('tls'); +var url = require('url'); +var http = require('http'); +var agent = require('agent-base'); + +var endpoint = 'http://nodejs.org/api/'; +var parsed = url.parse(endpoint); + +// This is the important part! +parsed.agent = agent(function (req, opts) { + var socket; + // `secureEndpoint` is true when using the https module + if (opts.secureEndpoint) { + socket = tls.connect(opts); + } else { + socket = net.connect(opts); + } + return socket; +}); + +// Everything else works just like normal... +http.get(parsed, function (res) { + console.log('"response" event!', res.headers); + res.pipe(process.stdout); +}); +``` + +Returning a Promise or using an `async` function is also supported: + +```js +agent(async function (req, opts) { + await sleep(1000); + // etc… +}); +``` + +Return another `http.Agent` instance to "pass through" the responsibility +for that HTTP request to that agent: + +```js +agent(function (req, opts) { + return opts.secureEndpoint ? https.globalAgent : http.globalAgent; +}); +``` + + +API +--- + +## Agent(Function callback[, Object options]) → [http.Agent][] + +Creates a base `http.Agent` that will execute the callback function `callback` +for every HTTP request that it is used as the `agent` for. The callback function +is responsible for creating a `stream.Duplex` instance of some kind that will be +used as the underlying socket in the HTTP request. + +The `options` object accepts the following properties: + + * `timeout` - Number - Timeout for the `callback()` function in milliseconds. Defaults to Infinity (optional). + +The callback function should have the following signature: + +### callback(http.ClientRequest req, Object options, Function cb) → undefined + +The ClientRequest `req` can be accessed to read request headers and +and the path, etc. The `options` object contains the options passed +to the `http.request()`/`https.request()` function call, and is formatted +to be directly passed to `net.connect()`/`tls.connect()`, or however +else you want a Socket to be created. Pass the created socket to +the callback function `cb` once created, and the HTTP request will +continue to proceed. + +If the `https` module is used to invoke the HTTP request, then the +`secureEndpoint` property on `options` _will be set to `true`_. + + +License +------- + +(The MIT License) + +Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +[http-proxy-agent]: https://github.com/TooTallNate/node-http-proxy-agent +[https-proxy-agent]: https://github.com/TooTallNate/node-https-proxy-agent +[pac-proxy-agent]: https://github.com/TooTallNate/node-pac-proxy-agent +[socks-proxy-agent]: https://github.com/TooTallNate/node-socks-proxy-agent +[http.Agent]: https://nodejs.org/api/http.html#http_class_http_agent diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/index.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/index.d.ts new file mode 100644 index 000000000..ff6788bdc --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/index.d.ts @@ -0,0 +1,43 @@ +// Type definitions for agent-base 4.2.1 +// Project: https://github.com/TooTallNate/node-agent-base +// Definitions by: Christopher Quadflieg + +/// +import { EventEmitter } from 'events'; + +declare namespace Agent { + export type AgentCallback = ( + req?: any, + opts?: { + secureEndpoint: boolean; + } + ) => void; + + export interface AgentOptions { + timeout?: number; + host?: string; + port?: number; + [key: string]: any; + } + + export interface Agent extends EventEmitter { + _promisifiedCallback: boolean; + timeout: number | null; + options?: AgentOptions; + callback: AgentCallback; + addRequest: (req?: any, opts?: any) => void; + freeSocket: (socket: any, opts: any) => void; + } +} + +/** + * Base `http.Agent` implementation. + * No pooling/keep-alive is implemented by default. + */ +declare function Agent(opts?: Agent.AgentOptions): Agent.Agent; +declare function Agent( + callback: Agent.AgentCallback, + opts?: Agent.AgentOptions +): Agent.Agent; + +export = Agent; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/index.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/index.js new file mode 100644 index 000000000..0ee6b2969 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/index.js @@ -0,0 +1,170 @@ +'use strict'; +require('./patch-core'); +const inherits = require('util').inherits; +const promisify = require('es6-promisify'); +const EventEmitter = require('events').EventEmitter; + +module.exports = Agent; + +function isAgent(v) { + return v && typeof v.addRequest === 'function'; +} + +/** + * Base `http.Agent` implementation. + * No pooling/keep-alive is implemented by default. + * + * @param {Function} callback + * @api public + */ +function Agent(callback, _opts) { + if (!(this instanceof Agent)) { + return new Agent(callback, _opts); + } + + EventEmitter.call(this); + + // The callback gets promisified if it has 3 parameters + // (i.e. it has a callback function) lazily + this._promisifiedCallback = false; + + let opts = _opts; + if ('function' === typeof callback) { + this.callback = callback; + } else if (callback) { + opts = callback; + } + + // timeout for the socket to be returned from the callback + this.timeout = (opts && opts.timeout) || null; + + this.options = opts; +} +inherits(Agent, EventEmitter); + +/** + * Override this function in your subclass! + */ +Agent.prototype.callback = function callback(req, opts) { + throw new Error( + '"agent-base" has no default implementation, you must subclass and override `callback()`' + ); +}; + +/** + * Called by node-core's "_http_client.js" module when creating + * a new HTTP request with this Agent instance. + * + * @api public + */ +Agent.prototype.addRequest = function addRequest(req, _opts) { + const ownOpts = Object.assign({}, _opts); + + // Set default `host` for HTTP to localhost + if (null == ownOpts.host) { + ownOpts.host = 'localhost'; + } + + // Set default `port` for HTTP if none was explicitly specified + if (null == ownOpts.port) { + ownOpts.port = ownOpts.secureEndpoint ? 443 : 80; + } + + const opts = Object.assign({}, this.options, ownOpts); + + if (opts.host && opts.path) { + // If both a `host` and `path` are specified then it's most likely the + // result of a `url.parse()` call... we need to remove the `path` portion so + // that `net.connect()` doesn't attempt to open that as a unix socket file. + delete opts.path; + } + + delete opts.agent; + delete opts.hostname; + delete opts._defaultAgent; + delete opts.defaultPort; + delete opts.createConnection; + + // Hint to use "Connection: close" + // XXX: non-documented `http` module API :( + req._last = true; + req.shouldKeepAlive = false; + + // Create the `stream.Duplex` instance + let timeout; + let timedOut = false; + const timeoutMs = this.timeout; + const freeSocket = this.freeSocket; + + function onerror(err) { + if (req._hadError) return; + req.emit('error', err); + // For Safety. Some additional errors might fire later on + // and we need to make sure we don't double-fire the error event. + req._hadError = true; + } + + function ontimeout() { + timeout = null; + timedOut = true; + const err = new Error( + 'A "socket" was not created for HTTP request before ' + timeoutMs + 'ms' + ); + err.code = 'ETIMEOUT'; + onerror(err); + } + + function callbackError(err) { + if (timedOut) return; + if (timeout != null) { + clearTimeout(timeout); + timeout = null; + } + onerror(err); + } + + function onsocket(socket) { + if (timedOut) return; + if (timeout != null) { + clearTimeout(timeout); + timeout = null; + } + if (isAgent(socket)) { + // `socket` is actually an http.Agent instance, so relinquish + // responsibility for this `req` to the Agent from here on + socket.addRequest(req, opts); + } else if (socket) { + function onfree() { + freeSocket(socket, opts); + } + socket.on('free', onfree); + req.onSocket(socket); + } else { + const err = new Error( + 'no Duplex stream was returned to agent-base for `' + req.method + ' ' + req.path + '`' + ); + onerror(err); + } + } + + if (!this._promisifiedCallback && this.callback.length >= 3) { + // Legacy callback function - convert to a Promise + this.callback = promisify(this.callback, this); + this._promisifiedCallback = true; + } + + if (timeoutMs > 0) { + timeout = setTimeout(ontimeout, timeoutMs); + } + + try { + Promise.resolve(this.callback(req, opts)).then(onsocket, callbackError); + } catch (err) { + Promise.reject(err).catch(callbackError); + } +}; + +Agent.prototype.freeSocket = function freeSocket(socket, opts) { + // TODO reuse sockets + socket.destroy(); +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/package.json new file mode 100644 index 000000000..2edc1756f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/package.json @@ -0,0 +1,41 @@ +{ + "name": "agent-base", + "version": "4.3.0", + "description": "Turn a function into an `http.Agent` instance", + "main": "./index.js", + "scripts": { + "test": "mocha --reporter spec" + }, + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/node-agent-base.git" + }, + "keywords": [ + "http", + "agent", + "base", + "barebones", + "https" + ], + "author": "Nathan Rajlich (http://n8.io/)", + "license": "MIT", + "bugs": { + "url": "https://github.com/TooTallNate/node-agent-base/issues" + }, + "devDependencies": { + "@types/es6-promisify": "^5.0.0", + "@types/node": "^10.5.3", + "mocha": "^3.4.2", + "ws": "^3.0.0" + }, + "dependencies": { + "es6-promisify": "^5.0.0" + }, + "engines": { + "node": ">= 4.0.0" + } + +,"_resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz" +,"_integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==" +,"_from": "agent-base@4.3.0" +} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/patch-core.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/patch-core.js new file mode 100644 index 000000000..21cbbb675 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/patch-core.js @@ -0,0 +1,51 @@ +'use strict'; +const url = require('url'); +const https = require('https'); + +/** + * This currently needs to be applied to all Node.js versions + * in order to determine if the `req` is an HTTP or HTTPS request. + * + * There is currently no PR attempting to move this property upstream. + */ +const patchMarker = "__agent_base_https_request_patched__"; +if (!https.request[patchMarker]) { + https.request = (function(request) { + return function(_options, cb) { + let options; + if (typeof _options === 'string') { + options = url.parse(_options); + } else { + options = Object.assign({}, _options); + } + if (null == options.port) { + options.port = 443; + } + options.secureEndpoint = true; + return request.call(https, options, cb); + }; + })(https.request); + https.request[patchMarker] = true; +} + +/** + * This is needed for Node.js >= 9.0.0 to make sure `https.get()` uses the + * patched `https.request()`. + * + * Ref: https://github.com/nodejs/node/commit/5118f31 + */ +https.get = function (_url, _options, cb) { + let options; + if (typeof _url === 'string' && _options && typeof _options !== 'function') { + options = Object.assign({}, url.parse(_url), _options); + } else if (!_options && !cb) { + options = _url; + } else if (!cb) { + options = _url; + cb = _options; + } + + const req = https.request(options, cb); + req.end(); + return req; +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/test/ssl-cert-snakeoil.key b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/test/ssl-cert-snakeoil.key new file mode 100644 index 000000000..fd1250122 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/test/ssl-cert-snakeoil.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICWwIBAAKBgQCzURxIqzer0ACAbX/lHdsn4Gd9PLKrf7EeDYfIdV0HZKPD8WDr +bBx2/fBu0OW2sjnzv/SVZbJ0DAuPE/p0+eT0qb2qC10iz9iTD7ribd7gxhirVb8y +b3fBjXsxc8V8p4Ny1LcvNSqCjwUbJqdRogfoJeTiqPM58z5sNzuv5iq7iwIDAQAB +AoGAPMQy4olrP0UotlzlJ36bowLP70ffgHCwU+/f4NWs5fF78c3du0oSx1w820Dd +Z7E0JF8bgnlJJTxjumPZz0RUCugrEHBKJmzEz3cxF5E3+7NvteZcjKn9D67RrM5x +1/uSZ9cqKE9cYvY4fSuHx18diyZ4axR/wB1Pea2utjjDM+ECQQDb9ZbmmaWMiRpQ +5Up+loxP7BZNPsEVsm+DVJmEFbaFgGfncWBqSIqnPNjMwTwj0OigTwCAEGPkfRVW +T0pbYWCxAkEA0LK7SCTwzyDmhASUalk0x+3uCAA6ryFdwJf/wd8TRAvVOmkTEldX +uJ7ldLvfrONYO3v56uKTU/SoNdZYzKtO+wJAX2KM4ctXYy5BXztPpr2acz4qHa1N +Bh+vBAC34fOYhyQ76r3b1btHhWZ5jbFuZwm9F2erC94Ps5IaoqcX07DSwQJAPKGw +h2U0EPkd/3zVIZCJJQya+vgWFIs9EZcXVtvYXQyTBkVApTN66MhBIYjzkub5205J +bVQmOV37AKklY1DhwQJAA1wos0cYxro02edzatxd0DIR2r4qqOqLkw6BhYHhq6HJ +ZvIcQkHqdSXzdETFc01I1znDGGIrJHcnvKWgBPoEUg== +-----END RSA PRIVATE KEY----- diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/test/ssl-cert-snakeoil.pem b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/test/ssl-cert-snakeoil.pem new file mode 100644 index 000000000..b115a5e91 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/test/ssl-cert-snakeoil.pem @@ -0,0 +1,12 @@ +-----BEGIN CERTIFICATE----- +MIIB1TCCAT4CCQDV5mPlzm9+izANBgkqhkiG9w0BAQUFADAvMS0wKwYDVQQDEyQ3 +NTI3YmQ3Ny1hYjNlLTQ3NGItYWNlNy1lZWQ2MDUzOTMxZTcwHhcNMTUwNzA2MjI0 +NTA3WhcNMjUwNzAzMjI0NTA3WjAvMS0wKwYDVQQDEyQ3NTI3YmQ3Ny1hYjNlLTQ3 +NGItYWNlNy1lZWQ2MDUzOTMxZTcwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB +ALNRHEirN6vQAIBtf+Ud2yfgZ308sqt/sR4Nh8h1XQdko8PxYOtsHHb98G7Q5bay +OfO/9JVlsnQMC48T+nT55PSpvaoLXSLP2JMPuuJt3uDGGKtVvzJvd8GNezFzxXyn +g3LUty81KoKPBRsmp1GiB+gl5OKo8znzPmw3O6/mKruLAgMBAAEwDQYJKoZIhvcN +AQEFBQADgYEACzoHUF8UV2Z6541Q2wKEA0UFUzmUjf/E1XwBO+1P15ZZ64uw34B4 +1RwMPtAo9RY/PmICTWtNxWGxkzwb2JtDWtnxVER/lF8k2XcXPE76fxTHJF/BKk9J +QU8OTD1dd9gHCBviQB9TqntRZ5X7axjtuWjb2umY+owBYzAHZkp1HKI= +-----END CERTIFICATE----- diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/test/test.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/test/test.js new file mode 100644 index 000000000..0f372c076 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/agent-base/test/test.js @@ -0,0 +1,728 @@ +/** + * Module dependencies. + */ + +var fs = require('fs'); +var url = require('url'); +var net = require('net'); +var tls = require('tls'); +var http = require('http'); +var https = require('https'); +var WebSocket = require('ws'); +var assert = require('assert'); +var events = require('events'); +var inherits = require('util').inherits; +var Agent = require('../'); + +var PassthroughAgent = Agent(function(req, opts) { + return opts.secureEndpoint ? https.globalAgent : http.globalAgent; +}); + +describe('Agent', function() { + describe('subclass', function() { + it('should be subclassable', function(done) { + function MyAgent() { + Agent.call(this); + } + inherits(MyAgent, Agent); + + MyAgent.prototype.callback = function(req, opts, fn) { + assert.equal(req.path, '/foo'); + assert.equal(req.getHeader('host'), '127.0.0.1:1234'); + assert.equal(opts.secureEndpoint, true); + done(); + }; + + var info = url.parse('https://127.0.0.1:1234/foo'); + info.agent = new MyAgent(); + https.get(info); + }); + }); + describe('options', function() { + it('should support an options Object as first argument', function() { + var agent = new Agent({ timeout: 1000 }); + assert.equal(1000, agent.timeout); + }); + it('should support an options Object as second argument', function() { + var agent = new Agent(function() {}, { timeout: 1000 }); + assert.equal(1000, agent.timeout); + }); + it('should be mixed in with HTTP request options', function(done) { + var agent = new Agent({ + host: 'my-proxy.com', + port: 3128, + foo: 'bar' + }); + agent.callback = function(req, opts, fn) { + assert.equal('bar', opts.foo); + assert.equal('a', opts.b); + + // `host` and `port` are special-cases, and should always be + // overwritten in the request `opts` inside the agent-base callback + assert.equal('localhost', opts.host); + assert.equal(80, opts.port); + done(); + }; + var opts = { + b: 'a', + agent: agent + }; + http.get(opts); + }); + }); + describe('`this` context', function() { + it('should be the Agent instance', function(done) { + var called = false; + var agent = new Agent(); + agent.callback = function() { + called = true; + assert.equal(this, agent); + }; + var info = url.parse('http://127.0.0.1/foo'); + info.agent = agent; + var req = http.get(info); + req.on('error', function(err) { + assert(/no Duplex stream was returned/.test(err.message)); + done(); + }); + }); + it('should be the Agent instance with callback signature', function(done) { + var called = false; + var agent = new Agent(); + agent.callback = function(req, opts, fn) { + called = true; + assert.equal(this, agent); + fn(); + }; + var info = url.parse('http://127.0.0.1/foo'); + info.agent = agent; + var req = http.get(info); + req.on('error', function(err) { + assert(/no Duplex stream was returned/.test(err.message)); + done(); + }); + }); + }); + describe('"error" event', function() { + it('should be invoked on `http.ClientRequest` instance if `callback()` has not been defined', function( + done + ) { + var agent = new Agent(); + var info = url.parse('http://127.0.0.1/foo'); + info.agent = agent; + var req = http.get(info); + req.on('error', function(err) { + assert.equal( + '"agent-base" has no default implementation, you must subclass and override `callback()`', + err.message + ); + done(); + }); + }); + it('should be invoked on `http.ClientRequest` instance if Error passed to callback function on the first tick', function( + done + ) { + var agent = new Agent(function(req, opts, fn) { + fn(new Error('is this caught?')); + }); + var info = url.parse('http://127.0.0.1/foo'); + info.agent = agent; + var req = http.get(info); + req.on('error', function(err) { + assert.equal('is this caught?', err.message); + done(); + }); + }); + it('should be invoked on `http.ClientRequest` instance if Error passed to callback function after the first tick', function( + done + ) { + var agent = new Agent(function(req, opts, fn) { + setTimeout(function() { + fn(new Error('is this caught?')); + }, 10); + }); + var info = url.parse('http://127.0.0.1/foo'); + info.agent = agent; + var req = http.get(info); + req.on('error', function(err) { + assert.equal('is this caught?', err.message); + done(); + }); + }); + }); + describe('artificial "streams"', function() { + it('should send a GET request', function(done) { + var stream = new events.EventEmitter(); + + // needed for the `http` module to call .write() on the stream + stream.writable = true; + + stream.write = function(str) { + assert(0 == str.indexOf('GET / HTTP/1.1')); + done(); + }; + + // needed for `http` module in Node.js 4 + stream.cork = function() {}; + + var opts = { + method: 'GET', + host: '127.0.0.1', + path: '/', + port: 80, + agent: new Agent(function(req, opts, fn) { + fn(null, stream); + }) + }; + var req = http.request(opts); + req.end(); + }); + it('should receive a GET response', function(done) { + var stream = new events.EventEmitter(); + var opts = { + method: 'GET', + host: '127.0.0.1', + path: '/', + port: 80, + agent: new Agent(function(req, opts, fn) { + fn(null, stream); + }) + }; + var req = http.request(opts, function(res) { + assert.equal('1.0', res.httpVersion); + assert.equal(200, res.statusCode); + assert.equal('bar', res.headers.foo); + assert.deepEqual(['1', '2'], res.headers['set-cookie']); + done(); + }); + + // have to wait for the "socket" event since `http.ClientRequest` + // doesn't *actually* attach the listeners to the "stream" until + // this happens + req.once('socket', function() { + var buf = Buffer.from( + 'HTTP/1.0 200\r\n' + + 'Foo: bar\r\n' + + 'Set-Cookie: 1\r\n' + + 'Set-Cookie: 2\r\n\r\n' + ); + stream.emit('data', buf); + }); + + req.end(); + }); + }); +}); + +describe('"http" module', function() { + var server; + var port; + + // setup test HTTP server + before(function(done) { + server = http.createServer(); + server.listen(0, function() { + port = server.address().port; + done(); + }); + }); + + // shut down test HTTP server + after(function(done) { + server.once('close', function() { + done(); + }); + server.close(); + }); + + it('should work for basic HTTP requests', function(done) { + var called = false; + var agent = new Agent(function(req, opts, fn) { + called = true; + var socket = net.connect(opts); + fn(null, socket); + }); + + // add HTTP server "request" listener + var gotReq = false; + server.once('request', function(req, res) { + gotReq = true; + res.setHeader('X-Foo', 'bar'); + res.setHeader('X-Url', req.url); + res.end(); + }); + + var info = url.parse('http://127.0.0.1:' + port + '/foo'); + info.agent = agent; + http.get(info, function(res) { + assert.equal('bar', res.headers['x-foo']); + assert.equal('/foo', res.headers['x-url']); + assert(gotReq); + assert(called); + done(); + }); + }); + + it('should support direct return in `connect()`', function(done) { + var called = false; + var agent = new Agent(function(req, opts) { + called = true; + return net.connect(opts); + }); + + // add HTTP server "request" listener + var gotReq = false; + server.once('request', function(req, res) { + gotReq = true; + res.setHeader('X-Foo', 'bar'); + res.setHeader('X-Url', req.url); + res.end(); + }); + + var info = url.parse('http://127.0.0.1:' + port + '/foo'); + info.agent = agent; + http.get(info, function(res) { + assert.equal('bar', res.headers['x-foo']); + assert.equal('/foo', res.headers['x-url']); + assert(gotReq); + assert(called); + done(); + }); + }); + + it('should support returning a Promise in `connect()`', function(done) { + var called = false; + var agent = new Agent(function(req, opts) { + return new Promise(function(resolve, reject) { + called = true; + resolve(net.connect(opts)); + }); + }); + + // add HTTP server "request" listener + var gotReq = false; + server.once('request', function(req, res) { + gotReq = true; + res.setHeader('X-Foo', 'bar'); + res.setHeader('X-Url', req.url); + res.end(); + }); + + var info = url.parse('http://127.0.0.1:' + port + '/foo'); + info.agent = agent; + http.get(info, function(res) { + assert.equal('bar', res.headers['x-foo']); + assert.equal('/foo', res.headers['x-url']); + assert(gotReq); + assert(called); + done(); + }); + }); + + it('should set the `Connection: close` response header', function(done) { + var called = false; + var agent = new Agent(function(req, opts, fn) { + called = true; + var socket = net.connect(opts); + fn(null, socket); + }); + + // add HTTP server "request" listener + var gotReq = false; + server.once('request', function(req, res) { + gotReq = true; + res.setHeader('X-Url', req.url); + assert.equal('close', req.headers.connection); + res.end(); + }); + + var info = url.parse('http://127.0.0.1:' + port + '/bar'); + info.agent = agent; + http.get(info, function(res) { + assert.equal('/bar', res.headers['x-url']); + assert.equal('close', res.headers.connection); + assert(gotReq); + assert(called); + done(); + }); + }); + + it('should pass through options from `http.request()`', function(done) { + var agent = new Agent(function(req, opts, fn) { + assert.equal('google.com', opts.host); + assert.equal('bar', opts.foo); + done(); + }); + + http.get({ + host: 'google.com', + foo: 'bar', + agent: agent + }); + }); + + it('should default to port 80', function(done) { + var agent = new Agent(function(req, opts, fn) { + assert.equal(80, opts.port); + done(); + }); + + // (probably) not hitting a real HTTP server here, + // so no need to add a httpServer request listener + http.get({ + host: '127.0.0.1', + path: '/foo', + agent: agent + }); + }); + + it('should support the "timeout" option', function(done) { + // ensure we timeout after the "error" event had a chance to trigger + this.timeout(1000); + this.slow(800); + + var agent = new Agent( + function(req, opts, fn) { + // this function will time out + }, + { timeout: 100 } + ); + + var opts = url.parse('http://nodejs.org'); + opts.agent = agent; + + var req = http.get(opts); + req.once('error', function(err) { + assert.equal('ETIMEOUT', err.code); + req.abort(); + done(); + }); + }); + + it('should free sockets after use', function(done) { + var agent = new Agent(function(req, opts, fn) { + var socket = net.connect(opts); + fn(null, socket); + }); + + // add HTTP server "request" listener + var gotReq = false; + server.once('request', function(req, res) { + gotReq = true; + res.end(); + }); + + var info = url.parse('http://127.0.0.1:' + port + '/foo'); + info.agent = agent; + http.get(info, function(res) { + res.socket.emit('free'); + assert.equal(true, res.socket.destroyed); + assert(gotReq); + done(); + }); + }); + + + describe('PassthroughAgent', function() { + it('should pass through to `http.globalAgent`', function(done) { + // add HTTP server "request" listener + var gotReq = false; + server.once('request', function(req, res) { + gotReq = true; + res.setHeader('X-Foo', 'bar'); + res.setHeader('X-Url', req.url); + res.end(); + }); + + var info = url.parse('http://127.0.0.1:' + port + '/foo'); + info.agent = PassthroughAgent; + http.get(info, function(res) { + assert.equal('bar', res.headers['x-foo']); + assert.equal('/foo', res.headers['x-url']); + assert(gotReq); + done(); + }); + }); + }); +}); + +describe('"https" module', function() { + var server; + var port; + + // setup test HTTPS server + before(function(done) { + var options = { + key: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.key'), + cert: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.pem') + }; + server = https.createServer(options); + server.listen(0, function() { + port = server.address().port; + done(); + }); + }); + + // shut down test HTTP server + after(function(done) { + server.once('close', function() { + done(); + }); + server.close(); + }); + + it('should not modify the passed in Options object', function(done) { + var called = false; + var agent = new Agent(function(req, opts, fn) { + called = true; + assert.equal(true, opts.secureEndpoint); + assert.equal(443, opts.port); + assert.equal('localhost', opts.host); + }); + var opts = { agent: agent }; + var req = https.request(opts); + assert.equal(true, called); + assert.equal(false, 'secureEndpoint' in opts); + assert.equal(false, 'port' in opts); + done(); + }); + + it('should work with a String URL', function(done) { + var endpoint = 'https://127.0.0.1:' + port; + var req = https.get(endpoint); + + // it's gonna error out since `rejectUnauthorized` is not being passed in + req.on('error', function(err) { + assert.equal(err.code, 'DEPTH_ZERO_SELF_SIGNED_CERT'); + done(); + }); + }); + + it('should work for basic HTTPS requests', function(done) { + var called = false; + var agent = new Agent(function(req, opts, fn) { + called = true; + assert(opts.secureEndpoint); + var socket = tls.connect(opts); + fn(null, socket); + }); + + // add HTTPS server "request" listener + var gotReq = false; + server.once('request', function(req, res) { + gotReq = true; + res.setHeader('X-Foo', 'bar'); + res.setHeader('X-Url', req.url); + res.end(); + }); + + var info = url.parse('https://127.0.0.1:' + port + '/foo'); + info.agent = agent; + info.rejectUnauthorized = false; + https.get(info, function(res) { + assert.equal('bar', res.headers['x-foo']); + assert.equal('/foo', res.headers['x-url']); + assert(gotReq); + assert(called); + done(); + }); + }); + + it('should pass through options from `https.request()`', function(done) { + var agent = new Agent(function(req, opts, fn) { + assert.equal('google.com', opts.host); + assert.equal('bar', opts.foo); + done(); + }); + + https.get({ + host: 'google.com', + foo: 'bar', + agent: agent + }); + }); + + it('should support the 3-argument `https.get()`', function(done) { + var agent = new Agent(function(req, opts, fn) { + assert.equal('google.com', opts.host); + assert.equal('/q', opts.pathname || opts.path); + assert.equal('881', opts.port); + assert.equal('bar', opts.foo); + done(); + }); + + https.get( + 'https://google.com:881/q', + { + host: 'google.com', + foo: 'bar', + agent: agent + } + ); + }); + + it('should default to port 443', function(done) { + var agent = new Agent(function(req, opts, fn) { + assert.equal(true, opts.secureEndpoint); + assert.equal(false, opts.rejectUnauthorized); + assert.equal(443, opts.port); + done(); + }); + + // (probably) not hitting a real HTTPS server here, + // so no need to add a httpsServer request listener + https.get({ + host: '127.0.0.1', + path: '/foo', + agent: agent, + rejectUnauthorized: false + }); + }); + + it('should not re-patch https.request', () => { + var patchModulePath = "../patch-core"; + var patchedRequest = https.request; + + delete require.cache[require.resolve(patchModulePath)]; + require(patchModulePath); + + assert.equal(patchedRequest, https.request); + assert.equal(true, https.request.__agent_base_https_request_patched__); + }); + + describe('PassthroughAgent', function() { + it('should pass through to `https.globalAgent`', function(done) { + // add HTTP server "request" listener + var gotReq = false; + server.once('request', function(req, res) { + gotReq = true; + res.setHeader('X-Foo', 'bar'); + res.setHeader('X-Url', req.url); + res.end(); + }); + + var info = url.parse('https://127.0.0.1:' + port + '/foo'); + info.agent = PassthroughAgent; + info.rejectUnauthorized = false; + https.get(info, function(res) { + assert.equal('bar', res.headers['x-foo']); + assert.equal('/foo', res.headers['x-url']); + assert(gotReq); + done(); + }); + }); + }); +}); + +describe('"ws" server', function() { + var wss; + var server; + var port; + + // setup test HTTP server + before(function(done) { + server = http.createServer(); + wss = new WebSocket.Server({ server: server }); + server.listen(0, function() { + port = server.address().port; + done(); + }); + }); + + // shut down test HTTP server + after(function(done) { + server.once('close', function() { + done(); + }); + server.close(); + }); + + it('should work for basic WebSocket connections', function(done) { + function onconnection(ws) { + ws.on('message', function(data) { + assert.equal('ping', data); + ws.send('pong'); + }); + } + wss.on('connection', onconnection); + + var agent = new Agent(function(req, opts, fn) { + var socket = net.connect(opts); + fn(null, socket); + }); + + var client = new WebSocket('ws://127.0.0.1:' + port + '/', { + agent: agent + }); + + client.on('open', function() { + client.send('ping'); + }); + + client.on('message', function(data) { + assert.equal('pong', data); + client.close(); + wss.removeListener('connection', onconnection); + done(); + }); + }); +}); + +describe('"wss" server', function() { + var wss; + var server; + var port; + + // setup test HTTP server + before(function(done) { + var options = { + key: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.key'), + cert: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.pem') + }; + server = https.createServer(options); + wss = new WebSocket.Server({ server: server }); + server.listen(0, function() { + port = server.address().port; + done(); + }); + }); + + // shut down test HTTP server + after(function(done) { + server.once('close', function() { + done(); + }); + server.close(); + }); + + it('should work for secure WebSocket connections', function(done) { + function onconnection(ws) { + ws.on('message', function(data) { + assert.equal('ping', data); + ws.send('pong'); + }); + } + wss.on('connection', onconnection); + + var agent = new Agent(function(req, opts, fn) { + var socket = tls.connect(opts); + fn(null, socket); + }); + + var client = new WebSocket('wss://127.0.0.1:' + port + '/', { + agent: agent, + rejectUnauthorized: false + }); + + client.on('open', function() { + client.send('ping'); + }); + + client.on('message', function(data) { + assert.equal('pong', data); + client.close(); + wss.removeListener('connection', onconnection); + done(); + }); + }); +}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-regex/index.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-regex/index.d.ts new file mode 100644 index 000000000..2dbf6af2b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-regex/index.d.ts @@ -0,0 +1,37 @@ +declare namespace ansiRegex { + interface Options { + /** + Match only the first ANSI escape. + + @default false + */ + onlyFirst: boolean; + } +} + +/** +Regular expression for matching ANSI escape codes. + +@example +``` +import ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` +*/ +declare function ansiRegex(options?: ansiRegex.Options): RegExp; + +export = ansiRegex; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-regex/index.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-regex/index.js new file mode 100644 index 000000000..35054aa67 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-regex/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = ({onlyFirst = false} = {}) => { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, onlyFirst ? undefined : 'g'); +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-regex/license b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-regex/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-regex/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-regex/package.json new file mode 100644 index 000000000..555b26d73 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-regex/package.json @@ -0,0 +1,59 @@ +{ + "name": "ansi-regex", + "version": "5.0.0", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": "chalk/ansi-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "view-supported": "node fixtures/view-codes.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + } + +,"_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz" +,"_integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" +,"_from": "ansi-regex@5.0.0" +} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-regex/readme.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-regex/readme.md new file mode 100644 index 000000000..3c2b77c43 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-regex/readme.md @@ -0,0 +1,78 @@ +# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex) + +> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install ansi-regex +``` + + +## Usage + +```js +const ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` + + +## API + +### ansiRegex(options?) + +Returns a regex for matching ANSI escape codes. + +#### options + +Type: `object` + +##### onlyFirst + +Type: `boolean`
+Default: `false` *(Matches any ANSI escape codes in a string)* + +Match only the first ANSI escape. + + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +--- + +

+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-styles/index.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-styles/index.d.ts new file mode 100644 index 000000000..44a907e58 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-styles/index.d.ts @@ -0,0 +1,345 @@ +declare type CSSColor = + | 'aliceblue' + | 'antiquewhite' + | 'aqua' + | 'aquamarine' + | 'azure' + | 'beige' + | 'bisque' + | 'black' + | 'blanchedalmond' + | 'blue' + | 'blueviolet' + | 'brown' + | 'burlywood' + | 'cadetblue' + | 'chartreuse' + | 'chocolate' + | 'coral' + | 'cornflowerblue' + | 'cornsilk' + | 'crimson' + | 'cyan' + | 'darkblue' + | 'darkcyan' + | 'darkgoldenrod' + | 'darkgray' + | 'darkgreen' + | 'darkgrey' + | 'darkkhaki' + | 'darkmagenta' + | 'darkolivegreen' + | 'darkorange' + | 'darkorchid' + | 'darkred' + | 'darksalmon' + | 'darkseagreen' + | 'darkslateblue' + | 'darkslategray' + | 'darkslategrey' + | 'darkturquoise' + | 'darkviolet' + | 'deeppink' + | 'deepskyblue' + | 'dimgray' + | 'dimgrey' + | 'dodgerblue' + | 'firebrick' + | 'floralwhite' + | 'forestgreen' + | 'fuchsia' + | 'gainsboro' + | 'ghostwhite' + | 'gold' + | 'goldenrod' + | 'gray' + | 'green' + | 'greenyellow' + | 'grey' + | 'honeydew' + | 'hotpink' + | 'indianred' + | 'indigo' + | 'ivory' + | 'khaki' + | 'lavender' + | 'lavenderblush' + | 'lawngreen' + | 'lemonchiffon' + | 'lightblue' + | 'lightcoral' + | 'lightcyan' + | 'lightgoldenrodyellow' + | 'lightgray' + | 'lightgreen' + | 'lightgrey' + | 'lightpink' + | 'lightsalmon' + | 'lightseagreen' + | 'lightskyblue' + | 'lightslategray' + | 'lightslategrey' + | 'lightsteelblue' + | 'lightyellow' + | 'lime' + | 'limegreen' + | 'linen' + | 'magenta' + | 'maroon' + | 'mediumaquamarine' + | 'mediumblue' + | 'mediumorchid' + | 'mediumpurple' + | 'mediumseagreen' + | 'mediumslateblue' + | 'mediumspringgreen' + | 'mediumturquoise' + | 'mediumvioletred' + | 'midnightblue' + | 'mintcream' + | 'mistyrose' + | 'moccasin' + | 'navajowhite' + | 'navy' + | 'oldlace' + | 'olive' + | 'olivedrab' + | 'orange' + | 'orangered' + | 'orchid' + | 'palegoldenrod' + | 'palegreen' + | 'paleturquoise' + | 'palevioletred' + | 'papayawhip' + | 'peachpuff' + | 'peru' + | 'pink' + | 'plum' + | 'powderblue' + | 'purple' + | 'rebeccapurple' + | 'red' + | 'rosybrown' + | 'royalblue' + | 'saddlebrown' + | 'salmon' + | 'sandybrown' + | 'seagreen' + | 'seashell' + | 'sienna' + | 'silver' + | 'skyblue' + | 'slateblue' + | 'slategray' + | 'slategrey' + | 'snow' + | 'springgreen' + | 'steelblue' + | 'tan' + | 'teal' + | 'thistle' + | 'tomato' + | 'turquoise' + | 'violet' + | 'wheat' + | 'white' + | 'whitesmoke' + | 'yellow' + | 'yellowgreen'; + +declare namespace ansiStyles { + interface ColorConvert { + /** + The RGB color space. + + @param red - (`0`-`255`) + @param green - (`0`-`255`) + @param blue - (`0`-`255`) + */ + rgb(red: number, green: number, blue: number): string; + + /** + The RGB HEX color space. + + @param hex - A hexadecimal string containing RGB data. + */ + hex(hex: string): string; + + /** + @param keyword - A CSS color name. + */ + keyword(keyword: CSSColor): string; + + /** + The HSL color space. + + @param hue - (`0`-`360`) + @param saturation - (`0`-`100`) + @param lightness - (`0`-`100`) + */ + hsl(hue: number, saturation: number, lightness: number): string; + + /** + The HSV color space. + + @param hue - (`0`-`360`) + @param saturation - (`0`-`100`) + @param value - (`0`-`100`) + */ + hsv(hue: number, saturation: number, value: number): string; + + /** + The HSV color space. + + @param hue - (`0`-`360`) + @param whiteness - (`0`-`100`) + @param blackness - (`0`-`100`) + */ + hwb(hue: number, whiteness: number, blackness: number): string; + + /** + Use a [4-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4-bit) to set text color. + */ + ansi(ansi: number): string; + + /** + Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. + */ + ansi256(ansi: number): string; + } + + interface CSPair { + /** + The ANSI terminal control sequence for starting this style. + */ + readonly open: string; + + /** + The ANSI terminal control sequence for ending this style. + */ + readonly close: string; + } + + interface ColorBase { + readonly ansi: ColorConvert; + readonly ansi256: ColorConvert; + readonly ansi16m: ColorConvert; + + /** + The ANSI terminal control sequence for ending this color. + */ + readonly close: string; + } + + interface Modifier { + /** + Resets the current color chain. + */ + readonly reset: CSPair; + + /** + Make text bold. + */ + readonly bold: CSPair; + + /** + Emitting only a small amount of light. + */ + readonly dim: CSPair; + + /** + Make text italic. (Not widely supported) + */ + readonly italic: CSPair; + + /** + Make text underline. (Not widely supported) + */ + readonly underline: CSPair; + + /** + Inverse background and foreground colors. + */ + readonly inverse: CSPair; + + /** + Prints the text, but makes it invisible. + */ + readonly hidden: CSPair; + + /** + Puts a horizontal line through the center of the text. (Not widely supported) + */ + readonly strikethrough: CSPair; + } + + interface ForegroundColor { + readonly black: CSPair; + readonly red: CSPair; + readonly green: CSPair; + readonly yellow: CSPair; + readonly blue: CSPair; + readonly cyan: CSPair; + readonly magenta: CSPair; + readonly white: CSPair; + + /** + Alias for `blackBright`. + */ + readonly gray: CSPair; + + /** + Alias for `blackBright`. + */ + readonly grey: CSPair; + + readonly blackBright: CSPair; + readonly redBright: CSPair; + readonly greenBright: CSPair; + readonly yellowBright: CSPair; + readonly blueBright: CSPair; + readonly cyanBright: CSPair; + readonly magentaBright: CSPair; + readonly whiteBright: CSPair; + } + + interface BackgroundColor { + readonly bgBlack: CSPair; + readonly bgRed: CSPair; + readonly bgGreen: CSPair; + readonly bgYellow: CSPair; + readonly bgBlue: CSPair; + readonly bgCyan: CSPair; + readonly bgMagenta: CSPair; + readonly bgWhite: CSPair; + + /** + Alias for `bgBlackBright`. + */ + readonly bgGray: CSPair; + + /** + Alias for `bgBlackBright`. + */ + readonly bgGrey: CSPair; + + readonly bgBlackBright: CSPair; + readonly bgRedBright: CSPair; + readonly bgGreenBright: CSPair; + readonly bgYellowBright: CSPair; + readonly bgBlueBright: CSPair; + readonly bgCyanBright: CSPair; + readonly bgMagentaBright: CSPair; + readonly bgWhiteBright: CSPair; + } +} + +declare const ansiStyles: { + readonly modifier: ansiStyles.Modifier; + readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase; + readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase; + readonly codes: ReadonlyMap; +} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier; + +export = ansiStyles; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-styles/index.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-styles/index.js new file mode 100644 index 000000000..5d82581a1 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-styles/index.js @@ -0,0 +1,163 @@ +'use strict'; + +const wrapAnsi16 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${code + offset}m`; +}; + +const wrapAnsi256 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${38 + offset};5;${code}m`; +}; + +const wrapAnsi16m = (fn, offset) => (...args) => { + const rgb = fn(...args); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; + +const ansi2ansi = n => n; +const rgb2rgb = (r, g, b) => [r, g, b]; + +const setLazyProperty = (object, property, get) => { + Object.defineProperty(object, property, { + get: () => { + const value = get(); + + Object.defineProperty(object, property, { + value, + enumerable: true, + configurable: true + }); + + return value; + }, + enumerable: true, + configurable: true + }); +}; + +/** @type {typeof import('color-convert')} */ +let colorConvert; +const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { + if (colorConvert === undefined) { + colorConvert = require('color-convert'); + } + + const offset = isBackground ? 10 : 0; + const styles = {}; + + for (const [sourceSpace, suite] of Object.entries(colorConvert)) { + const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; + if (sourceSpace === targetSpace) { + styles[name] = wrap(identity, offset); + } else if (typeof suite === 'object') { + styles[name] = wrap(suite[targetSpace], offset); + } + } + + return styles; +}; + +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + + // Bright color + blackBright: [90, 39], + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + + // Alias bright black as gray (and grey) + styles.color.gray = styles.color.blackBright; + styles.bgColor.bgGray = styles.bgColor.bgBlackBright; + styles.color.grey = styles.color.blackBright; + styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; + + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; + + group[styleName] = styles[styleName]; + + codes.set(style[0], style[1]); + } + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + } + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); + setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); + + return styles; +} + +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-styles/license b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-styles/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-styles/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-styles/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-styles/package.json new file mode 100644 index 000000000..28f2a6dac --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-styles/package.json @@ -0,0 +1,60 @@ +{ + "name": "ansi-styles", + "version": "4.3.0", + "description": "ANSI escape codes for styling strings in the terminal", + "license": "MIT", + "repository": "chalk/ansi-styles", + "funding": "https://github.com/chalk/ansi-styles?sponsor=1", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "color-convert": "^2.0.1" + }, + "devDependencies": { + "@types/color-convert": "^1.9.0", + "ava": "^2.3.0", + "svg-term-cli": "^2.1.1", + "tsd": "^0.11.0", + "xo": "^0.25.3" + } + +,"_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" +,"_integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==" +,"_from": "ansi-styles@4.3.0" +} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-styles/readme.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-styles/readme.md new file mode 100644 index 000000000..24883de80 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/ansi-styles/readme.md @@ -0,0 +1,152 @@ +# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) + +> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal + +You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. + + + +## Install + +``` +$ npm install ansi-styles +``` + +## Usage + +```js +const style = require('ansi-styles'); + +console.log(`${style.green.open}Hello world!${style.green.close}`); + + +// Color conversion between 16/256/truecolor +// NOTE: If conversion goes to 16 colors or 256 colors, the original color +// may be degraded to fit that color palette. This means terminals +// that do not support 16 million colors will best-match the +// original color. +console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); +console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); +console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close); +``` + +## API + +Each style has an `open` and `close` property. + +## Styles + +### Modifiers + +- `reset` +- `bold` +- `dim` +- `italic` *(Not widely supported)* +- `underline` +- `inverse` +- `hidden` +- `strikethrough` *(Not widely supported)* + +### Colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` +- `magenta` +- `cyan` +- `white` +- `blackBright` (alias: `gray`, `grey`) +- `redBright` +- `greenBright` +- `yellowBright` +- `blueBright` +- `magentaBright` +- `cyanBright` +- `whiteBright` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` +- `bgBlackBright` (alias: `bgGray`, `bgGrey`) +- `bgRedBright` +- `bgGreenBright` +- `bgYellowBright` +- `bgBlueBright` +- `bgMagentaBright` +- `bgCyanBright` +- `bgWhiteBright` + +## Advanced usage + +By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. + +- `style.modifier` +- `style.color` +- `style.bgColor` + +###### Example + +```js +console.log(style.color.green.open); +``` + +Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. + +###### Example + +```js +console.log(style.codes.get(36)); +//=> 39 +``` + +## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) + +`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. + +The following color spaces from `color-convert` are supported: + +- `rgb` +- `hex` +- `keyword` +- `hsl` +- `hsv` +- `hwb` +- `ansi` +- `ansi256` + +To use these, call the associated conversion function with the intended output, for example: + +```js +style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code +style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code + +style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code +style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code + +style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code +style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code +``` + +## Related + +- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + +## For enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of `ansi-styles` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/aproba/LICENSE b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/aproba/LICENSE new file mode 100644 index 000000000..f4be44d88 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/aproba/LICENSE @@ -0,0 +1,14 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/aproba/README.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/aproba/README.md new file mode 100644 index 000000000..0bfc594c5 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/aproba/README.md @@ -0,0 +1,94 @@ +aproba +====== + +A ridiculously light-weight function argument validator + +``` +var validate = require("aproba") + +function myfunc(a, b, c) { + // `a` must be a string, `b` a number, `c` a function + validate('SNF', arguments) // [a,b,c] is also valid +} + +myfunc('test', 23, function () {}) // ok +myfunc(123, 23, function () {}) // type error +myfunc('test', 23) // missing arg error +myfunc('test', 23, function () {}, true) // too many args error + +``` + +Valid types are: + +| type | description +| :--: | :---------- +| * | matches any type +| A | `Array.isArray` OR an `arguments` object +| S | typeof == string +| N | typeof == number +| F | typeof == function +| O | typeof == object and not type A and not type E +| B | typeof == boolean +| E | `instanceof Error` OR `null` **(special: see below)** +| Z | == `null` + +Validation failures throw one of three exception types, distinguished by a +`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`. + +If you pass in an invalid type then it will throw with a code of +`EUNKNOWNTYPE`. + +If an **error** argument is found and is not null then the remaining +arguments are optional. That is, if you say `ESO` then that's like using a +non-magical `E` in: `E|ESO|ZSO`. + +### But I have optional arguments?! + +You can provide more than one signature by separating them with pipes `|`. +If any signature matches the arguments then they'll be considered valid. + +So for example, say you wanted to write a signature for +`fs.createWriteStream`. The docs for it describe it thusly: + +``` +fs.createWriteStream(path[, options]) +``` + +This would be a signature of `SO|S`. That is, a string and and object, or +just a string. + +Now, if you read the full `fs` docs, you'll see that actually path can ALSO +be a buffer. And options can be a string, that is: +``` +path | +options | +``` + +To reproduce this you have to fully enumerate all of the possible +combinations and that implies a signature of `SO|SS|OO|OS|S|O`. The +awkwardness is a feature: It reminds you of the complexity you're adding to +your API when you do this sort of thing. + + +### Browser support + +This has no dependencies and should work in browsers, though you'll have +noisier stack traces. + +### Why this exists + +I wanted a very simple argument validator. It needed to do two things: + +1. Be more concise and easier to use than assertions + +2. Not encourage an infinite bikeshed of DSLs + +This is why types are specified by a single character and there's no such +thing as an optional argument. + +This is not intended to validate user data. This is specifically about +asserting the interface of your functions. + +If you need greater validation, I encourage you to write them by hand or +look elsewhere. + diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/aproba/index.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/aproba/index.js new file mode 100644 index 000000000..6f3f797c0 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/aproba/index.js @@ -0,0 +1,105 @@ +'use strict' + +function isArguments (thingy) { + return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') +} + +var types = { + '*': {label: 'any', check: function () { return true }}, + A: {label: 'array', check: function (thingy) { return Array.isArray(thingy) || isArguments(thingy) }}, + S: {label: 'string', check: function (thingy) { return typeof thingy === 'string' }}, + N: {label: 'number', check: function (thingy) { return typeof thingy === 'number' }}, + F: {label: 'function', check: function (thingy) { return typeof thingy === 'function' }}, + O: {label: 'object', check: function (thingy) { return typeof thingy === 'object' && thingy != null && !types.A.check(thingy) && !types.E.check(thingy) }}, + B: {label: 'boolean', check: function (thingy) { return typeof thingy === 'boolean' }}, + E: {label: 'error', check: function (thingy) { return thingy instanceof Error }}, + Z: {label: 'null', check: function (thingy) { return thingy == null }} +} + +function addSchema (schema, arity) { + var group = arity[schema.length] = arity[schema.length] || [] + if (group.indexOf(schema) === -1) group.push(schema) +} + +var validate = module.exports = function (rawSchemas, args) { + if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) + if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') + if (!args) throw missingRequiredArg(1, 'args') + if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) + if (!types.A.check(args)) throw invalidType(1, ['array'], args) + var schemas = rawSchemas.split('|') + var arity = {} + + schemas.forEach(function (schema) { + for (var ii = 0; ii < schema.length; ++ii) { + var type = schema[ii] + if (!types[type]) throw unknownType(ii, type) + } + if (/E.*E/.test(schema)) throw moreThanOneError(schema) + addSchema(schema, arity) + if (/E/.test(schema)) { + addSchema(schema.replace(/E.*$/, 'E'), arity) + addSchema(schema.replace(/E/, 'Z'), arity) + if (schema.length === 1) addSchema('', arity) + } + }) + var matching = arity[args.length] + if (!matching) { + throw wrongNumberOfArgs(Object.keys(arity), args.length) + } + for (var ii = 0; ii < args.length; ++ii) { + var newMatching = matching.filter(function (schema) { + var type = schema[ii] + var typeCheck = types[type].check + return typeCheck(args[ii]) + }) + if (!newMatching.length) { + var labels = matching.map(function (schema) { + return types[schema[ii]].label + }).filter(function (schema) { return schema != null }) + throw invalidType(ii, labels, args[ii]) + } + matching = newMatching + } +} + +function missingRequiredArg (num) { + return newException('EMISSINGARG', 'Missing required argument #' + (num + 1)) +} + +function unknownType (num, type) { + return newException('EUNKNOWNTYPE', 'Unknown type ' + type + ' in argument #' + (num + 1)) +} + +function invalidType (num, expectedTypes, value) { + var valueType + Object.keys(types).forEach(function (typeCode) { + if (types[typeCode].check(value)) valueType = types[typeCode].label + }) + return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + + englishList(expectedTypes) + ' but got ' + valueType) +} + +function englishList (list) { + return list.join(', ').replace(/, ([^,]+)$/, ' or $1') +} + +function wrongNumberOfArgs (expected, got) { + var english = englishList(expected) + var args = expected.every(function (ex) { return ex.length === 1 }) + ? 'argument' + : 'arguments' + return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) +} + +function moreThanOneError (schema) { + return newException('ETOOMANYERRORTYPES', + 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') +} + +function newException (code, msg) { + var e = new Error(msg) + e.code = code + if (Error.captureStackTrace) Error.captureStackTrace(e, validate) + return e +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/aproba/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/aproba/package.json new file mode 100644 index 000000000..75cac37ce --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/aproba/package.json @@ -0,0 +1,38 @@ +{ + "name": "aproba", + "version": "1.2.0", + "description": "A ridiculously light-weight argument validator (now browser friendly)", + "main": "index.js", + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "standard": "^10.0.3", + "tap": "^10.0.2" + }, + "files": [ + "index.js" + ], + "scripts": { + "test": "standard && tap -j3 test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/iarna/aproba" + }, + "keywords": [ + "argument", + "validate" + ], + "author": "Rebecca Turner ", + "license": "ISC", + "bugs": { + "url": "https://github.com/iarna/aproba/issues" + }, + "homepage": "https://github.com/iarna/aproba" + +,"_resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz" +,"_integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" +,"_from": "aproba@1.2.0" +} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/CHANGES.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/CHANGES.md new file mode 100644 index 000000000..21f3b1c12 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/CHANGES.md @@ -0,0 +1,37 @@ +Hi, figured we could actually use a changelog now: + +## 1.1.5 2018-05-24 + +* [#92](https://github.com/iarna/are-we-there-yet/pull/92) Fix bug where + `finish` would throw errors when including `TrackerStream` objects in + `TrackerGroup` collections. (@brianloveswords) + +## 1.1.4 2017-04-21 + +* Fix typo in package.json + +## 1.1.3 2017-04-21 + +* Improve documentation and limit files included in the distribution. + +## 1.1.2 2016-03-15 + +* Add tracker group cycle detection and tests for it + +## 1.1.1 2016-01-29 + +* Fix a typo in stream completion tracker + +## 1.1.0 2016-01-29 + +* Rewrote completion percent computation to be low impact– no more walking a + tree of completion groups every time we need this info. Previously, with + medium sized tree of completion groups, even a relatively modest number of + calls to the top level `completed()` method would result in absurd numbers + of calls overall as it walked down the tree. We now, instead, keep track as + we bubble up changes, so the computation is limited to when data changes and + to the depth of that one branch, instead of _every_ node. (Plus, we were already + incurring _this_ cost, since we already bubbled out changes.) +* Moved different tracker types out to their own files. +* Made tests test for TOO MANY events too. +* Standarized the source code formatting diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/LICENSE b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/LICENSE new file mode 100644 index 000000000..af4588069 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/LICENSE @@ -0,0 +1,5 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/README.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/README.md new file mode 100644 index 000000000..7e2b42d86 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/README.md @@ -0,0 +1,195 @@ +are-we-there-yet +---------------- + +Track complex hiearchies of asynchronous task completion statuses. This is +intended to give you a way of recording and reporting the progress of the big +recursive fan-out and gather type workflows that are so common in async. + +What you do with this completion data is up to you, but the most common use case is to +feed it to one of the many progress bar modules. + +Most progress bar modules include a rudamentary version of this, but my +needs were more complex. + +Usage +===== + +```javascript +var TrackerGroup = require("are-we-there-yet").TrackerGroup + +var top = new TrackerGroup("program") + +var single = top.newItem("one thing", 100) +single.completeWork(20) + +console.log(top.completed()) // 0.2 + +fs.stat("file", function(er, stat) { + if (er) throw er + var stream = top.newStream("file", stat.size) + console.log(top.completed()) // now 0.1 as single is 50% of the job and is 20% complete + // and 50% * 20% == 10% + fs.createReadStream("file").pipe(stream).on("data", function (chunk) { + // do stuff with chunk + }) + top.on("change", function (name) { + // called each time a chunk is read from "file" + // top.completed() will start at 0.1 and fill up to 0.6 as the file is read + }) +}) +``` + +Shared Methods +============== + +* var completed = tracker.completed() + +Implemented in: `Tracker`, `TrackerGroup`, `TrackerStream` + +Returns the ratio of completed work to work to be done. Range of 0 to 1. + +* tracker.finish() + +Implemented in: `Tracker`, `TrackerGroup` + +Marks the tracker as completed. With a TrackerGroup this marks all of its +components as completed. + +Marks all of the components of this tracker as finished, which in turn means +that `tracker.completed()` for this will now be 1. + +This will result in one or more `change` events being emitted. + +Events +====== + +All tracker objects emit `change` events with the following arguments: + +``` +function (name, completed, tracker) +``` + +`name` is the name of the tracker that originally emitted the event, +or if it didn't have one, the first containing tracker group that had one. + +`completed` is the percent complete (as returned by `tracker.completed()` method). + +`tracker` is the tracker object that you are listening for events on. + +TrackerGroup +============ + +* var tracker = new TrackerGroup(**name**) + + * **name** *(optional)* - The name of this tracker group, used in change + notifications if the component updating didn't have a name. Defaults to undefined. + +Creates a new empty tracker aggregation group. These are trackers whose +completion status is determined by the completion status of other trackers. + +* tracker.addUnit(**otherTracker**, **weight**) + + * **otherTracker** - Any of the other are-we-there-yet tracker objects + * **weight** *(optional)* - The weight to give the tracker, defaults to 1. + +Adds the **otherTracker** to this aggregation group. The weight determines +how long you expect this tracker to take to complete in proportion to other +units. So for instance, if you add one tracker with a weight of 1 and +another with a weight of 2, you're saying the second will take twice as long +to complete as the first. As such, the first will account for 33% of the +completion of this tracker and the second will account for the other 67%. + +Returns **otherTracker**. + +* var subGroup = tracker.newGroup(**name**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subGroup = tracker.addUnit(new TrackerGroup(name), weight) +``` + +* var subItem = tracker.newItem(**name**, **todo**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subItem = tracker.addUnit(new Tracker(name, todo), weight) +``` + +* var subStream = tracker.newStream(**name**, **todo**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subStream = tracker.addUnit(new TrackerStream(name, todo), weight) +``` + +* console.log( tracker.debug() ) + +Returns a tree showing the completion of this tracker group and all of its +children, including recursively entering all of the children. + +Tracker +======= + +* var tracker = new Tracker(**name**, **todo**) + + * **name** *(optional)* The name of this counter to report in change + events. Defaults to undefined. + * **todo** *(optional)* The amount of work todo (a number). Defaults to 0. + +Ordinarily these are constructed as a part of a tracker group (via +`newItem`). + +* var completed = tracker.completed() + +Returns the ratio of completed work to work to be done. Range of 0 to 1. If +total work to be done is 0 then it will return 0. + +* tracker.addWork(**todo**) + + * **todo** A number to add to the amount of work to be done. + +Increases the amount of work to be done, thus decreasing the completion +percentage. Triggers a `change` event. + +* tracker.completeWork(**completed**) + + * **completed** A number to add to the work complete + +Increase the amount of work complete, thus increasing the completion percentage. +Will never increase the work completed past the amount of work todo. That is, +percentages > 100% are not allowed. Triggers a `change` event. + +* tracker.finish() + +Marks this tracker as finished, tracker.completed() will now be 1. Triggers +a `change` event. + +TrackerStream +============= + +* var tracker = new TrackerStream(**name**, **size**, **options**) + + * **name** *(optional)* The name of this counter to report in change + events. Defaults to undefined. + * **size** *(optional)* The number of bytes being sent through this stream. + * **options** *(optional)* A hash of stream options + +The tracker stream object is a pass through stream that updates an internal +tracker object each time a block passes through. It's intended to track +downloads, file extraction and other related activities. You use it by piping +your data source into it and then using it as your data source. + +If your data has a length attribute then that's used as the amount of work +completed when the chunk is passed through. If it does not (eg, object +streams) then each chunk counts as completing 1 unit of work, so your size +should be the total number of objects being streamed. + +* tracker.addWork(**todo**) + + * **todo** Increase the expected overall size by **todo** bytes. + +Increases the amount of work to be done, thus decreasing the completion +percentage. Triggers a `change` event. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/index.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/index.js new file mode 100644 index 000000000..57d8743fd --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/index.js @@ -0,0 +1,4 @@ +'use strict' +exports.TrackerGroup = require('./tracker-group.js') +exports.Tracker = require('./tracker.js') +exports.TrackerStream = require('./tracker-stream.js') diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/package.json new file mode 100644 index 000000000..0e3b64642 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/package.json @@ -0,0 +1,39 @@ +{ + "name": "are-we-there-yet", + "version": "1.1.5", + "description": "Keep track of the overall completion of many disparate processes", + "main": "index.js", + "scripts": { + "test": "standard && tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/iarna/are-we-there-yet.git" + }, + "author": "Rebecca Turner (http://re-becca.org)", + "license": "ISC", + "bugs": { + "url": "https://github.com/iarna/are-we-there-yet/issues" + }, + "homepage": "https://github.com/iarna/are-we-there-yet", + "devDependencies": { + "standard": "^11.0.1", + "tap": "^12.0.1" + }, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + }, + "files": [ + "index.js", + "tracker-base.js", + "tracker-group.js", + "tracker-stream.js", + "tracker.js", + "CHANGES.md" + ] + +,"_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz" +,"_integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==" +,"_from": "are-we-there-yet@1.1.5" +} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/tracker-base.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/tracker-base.js new file mode 100644 index 000000000..6f4368755 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/tracker-base.js @@ -0,0 +1,11 @@ +'use strict' +var EventEmitter = require('events').EventEmitter +var util = require('util') + +var trackerId = 0 +var TrackerBase = module.exports = function (name) { + EventEmitter.call(this) + this.id = ++trackerId + this.name = name +} +util.inherits(TrackerBase, EventEmitter) diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/tracker-group.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/tracker-group.js new file mode 100644 index 000000000..9759e1226 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/tracker-group.js @@ -0,0 +1,107 @@ +'use strict' +var util = require('util') +var TrackerBase = require('./tracker-base.js') +var Tracker = require('./tracker.js') +var TrackerStream = require('./tracker-stream.js') + +var TrackerGroup = module.exports = function (name) { + TrackerBase.call(this, name) + this.parentGroup = null + this.trackers = [] + this.completion = {} + this.weight = {} + this.totalWeight = 0 + this.finished = false + this.bubbleChange = bubbleChange(this) +} +util.inherits(TrackerGroup, TrackerBase) + +function bubbleChange (trackerGroup) { + return function (name, completed, tracker) { + trackerGroup.completion[tracker.id] = completed + if (trackerGroup.finished) return + trackerGroup.emit('change', name || trackerGroup.name, trackerGroup.completed(), trackerGroup) + } +} + +TrackerGroup.prototype.nameInTree = function () { + var names = [] + var from = this + while (from) { + names.unshift(from.name) + from = from.parentGroup + } + return names.join('/') +} + +TrackerGroup.prototype.addUnit = function (unit, weight) { + if (unit.addUnit) { + var toTest = this + while (toTest) { + if (unit === toTest) { + throw new Error( + 'Attempted to add tracker group ' + + unit.name + ' to tree that already includes it ' + + this.nameInTree(this)) + } + toTest = toTest.parentGroup + } + unit.parentGroup = this + } + this.weight[unit.id] = weight || 1 + this.totalWeight += this.weight[unit.id] + this.trackers.push(unit) + this.completion[unit.id] = unit.completed() + unit.on('change', this.bubbleChange) + if (!this.finished) this.emit('change', unit.name, this.completion[unit.id], unit) + return unit +} + +TrackerGroup.prototype.completed = function () { + if (this.trackers.length === 0) return 0 + var valPerWeight = 1 / this.totalWeight + var completed = 0 + for (var ii = 0; ii < this.trackers.length; ii++) { + var trackerId = this.trackers[ii].id + completed += valPerWeight * this.weight[trackerId] * this.completion[trackerId] + } + return completed +} + +TrackerGroup.prototype.newGroup = function (name, weight) { + return this.addUnit(new TrackerGroup(name), weight) +} + +TrackerGroup.prototype.newItem = function (name, todo, weight) { + return this.addUnit(new Tracker(name, todo), weight) +} + +TrackerGroup.prototype.newStream = function (name, todo, weight) { + return this.addUnit(new TrackerStream(name, todo), weight) +} + +TrackerGroup.prototype.finish = function () { + this.finished = true + if (!this.trackers.length) this.addUnit(new Tracker(), 1, true) + for (var ii = 0; ii < this.trackers.length; ii++) { + var tracker = this.trackers[ii] + tracker.finish() + tracker.removeListener('change', this.bubbleChange) + } + this.emit('change', this.name, 1, this) +} + +var buffer = ' ' +TrackerGroup.prototype.debug = function (depth) { + depth = depth || 0 + var indent = depth ? buffer.substr(0, depth) : '' + var output = indent + (this.name || 'top') + ': ' + this.completed() + '\n' + this.trackers.forEach(function (tracker) { + if (tracker instanceof TrackerGroup) { + output += tracker.debug(depth + 1) + } else { + output += indent + ' ' + tracker.name + ': ' + tracker.completed() + '\n' + } + }) + return output +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/tracker-stream.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/tracker-stream.js new file mode 100644 index 000000000..e1cf85055 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/tracker-stream.js @@ -0,0 +1,36 @@ +'use strict' +var util = require('util') +var stream = require('readable-stream') +var delegate = require('delegates') +var Tracker = require('./tracker.js') + +var TrackerStream = module.exports = function (name, size, options) { + stream.Transform.call(this, options) + this.tracker = new Tracker(name, size) + this.name = name + this.id = this.tracker.id + this.tracker.on('change', delegateChange(this)) +} +util.inherits(TrackerStream, stream.Transform) + +function delegateChange (trackerStream) { + return function (name, completion, tracker) { + trackerStream.emit('change', name, completion, trackerStream) + } +} + +TrackerStream.prototype._transform = function (data, encoding, cb) { + this.tracker.completeWork(data.length ? data.length : 1) + this.push(data) + cb() +} + +TrackerStream.prototype._flush = function (cb) { + this.tracker.finish() + cb() +} + +delegate(TrackerStream.prototype, 'tracker') + .method('completed') + .method('addWork') + .method('finish') diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/tracker.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/tracker.js new file mode 100644 index 000000000..68c2339b4 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/are-we-there-yet/tracker.js @@ -0,0 +1,30 @@ +'use strict' +var util = require('util') +var TrackerBase = require('./tracker-base.js') + +var Tracker = module.exports = function (name, todo) { + TrackerBase.call(this, name) + this.workDone = 0 + this.workTodo = todo || 0 +} +util.inherits(Tracker, TrackerBase) + +Tracker.prototype.completed = function () { + return this.workTodo === 0 ? 0 : this.workDone / this.workTodo +} + +Tracker.prototype.addWork = function (work) { + this.workTodo += work + this.emit('change', this.name, this.completed(), this) +} + +Tracker.prototype.completeWork = function (work) { + this.workDone += work + if (this.workDone > this.workTodo) this.workDone = this.workTodo + this.emit('change', this.name, this.completed(), this) +} + +Tracker.prototype.finish = function () { + this.workTodo = this.workDone = 1 + this.emit('change', this.name, 1, this) +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/CHANGELOG.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/CHANGELOG.md new file mode 100644 index 000000000..a43c628cc --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/CHANGELOG.md @@ -0,0 +1,185 @@ +1.0.10 / 2018-02-15 +------------------ + +- Use .concat instead of + for arrays, #122. + + +1.0.9 / 2016-09-29 +------------------ + +- Rerelease after 1.0.8 - deps cleanup. + + +1.0.8 / 2016-09-29 +------------------ + +- Maintenance (deps bump, fix node 6.5+ tests, coverage report). + + +1.0.7 / 2016-03-17 +------------------ + +- Teach `addArgument` to accept string arg names. #97, @tomxtobin. + + +1.0.6 / 2016-02-06 +------------------ + +- Maintenance: moved to eslint & updated CS. + + +1.0.5 / 2016-02-05 +------------------ + +- Removed lodash dependency to significantly reduce install size. + Thanks to @mourner. + + +1.0.4 / 2016-01-17 +------------------ + +- Maintenance: lodash update to 4.0.0. + + +1.0.3 / 2015-10-27 +------------------ + +- Fix parse `=` in args: `--examplepath="C:\myfolder\env=x64"`. #84, @CatWithApple. + + +1.0.2 / 2015-03-22 +------------------ + +- Relaxed lodash version dependency. + + +1.0.1 / 2015-02-20 +------------------ + +- Changed dependencies to be compatible with ancient nodejs. + + +1.0.0 / 2015-02-19 +------------------ + +- Maintenance release. +- Replaced `underscore` with `lodash`. +- Bumped version to 1.0.0 to better reflect semver meaning. +- HISTORY.md -> CHANGELOG.md + + +0.1.16 / 2013-12-01 +------------------- + +- Maintenance release. Updated dependencies and docs. + + +0.1.15 / 2013-05-13 +------------------- + +- Fixed #55, @trebor89 + + +0.1.14 / 2013-05-12 +------------------- + +- Fixed #62, @maxtaco + + +0.1.13 / 2013-04-08 +------------------- + +- Added `.npmignore` to reduce package size + + +0.1.12 / 2013-02-10 +------------------- + +- Fixed conflictHandler (#46), @hpaulj + + +0.1.11 / 2013-02-07 +------------------- + +- Multiple bugfixes, @hpaulj +- Added 70+ tests (ported from python), @hpaulj +- Added conflictHandler, @applepicke +- Added fromfilePrefixChar, @hpaulj + + +0.1.10 / 2012-12-30 +------------------- + +- Added [mutual exclusion](http://docs.python.org/dev/library/argparse.html#mutual-exclusion) + support, thanks to @hpaulj +- Fixed options check for `storeConst` & `appendConst` actions, thanks to @hpaulj + + +0.1.9 / 2012-12-27 +------------------ + +- Fixed option dest interferens with other options (issue #23), thanks to @hpaulj +- Fixed default value behavior with `*` positionals, thanks to @hpaulj +- Improve `getDefault()` behavior, thanks to @hpaulj +- Imrove negative argument parsing, thanks to @hpaulj + + +0.1.8 / 2012-12-01 +------------------ + +- Fixed parser parents (issue #19), thanks to @hpaulj +- Fixed negative argument parse (issue #20), thanks to @hpaulj + + +0.1.7 / 2012-10-14 +------------------ + +- Fixed 'choices' argument parse (issue #16) +- Fixed stderr output (issue #15) + + +0.1.6 / 2012-09-09 +------------------ + +- Fixed check for conflict of options (thanks to @tomxtobin) + + +0.1.5 / 2012-09-03 +------------------ + +- Fix parser #setDefaults method (thanks to @tomxtobin) + + +0.1.4 / 2012-07-30 +------------------ + +- Fixed pseudo-argument support (thanks to @CGamesPlay) +- Fixed addHelp default (should be true), if not set (thanks to @benblank) + + +0.1.3 / 2012-06-27 +------------------ + +- Fixed formatter api name: Formatter -> HelpFormatter + + +0.1.2 / 2012-05-29 +------------------ + +- Added basic tests +- Removed excess whitespace in help +- Fixed error reporting, when parcer with subcommands + called with empty arguments + + +0.1.1 / 2012-05-23 +------------------ + +- Fixed line wrapping in help formatter +- Added better error reporting on invalid arguments + + +0.1.0 / 2012-05-16 +------------------ + +- First release. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/LICENSE b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/LICENSE new file mode 100644 index 000000000..1afdae558 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/LICENSE @@ -0,0 +1,21 @@ +(The MIT License) + +Copyright (C) 2012 by Vitaly Puzrin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/README.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/README.md new file mode 100644 index 000000000..7fa6c4050 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/README.md @@ -0,0 +1,257 @@ +argparse +======== + +[![Build Status](https://secure.travis-ci.org/nodeca/argparse.svg?branch=master)](http://travis-ci.org/nodeca/argparse) +[![NPM version](https://img.shields.io/npm/v/argparse.svg)](https://www.npmjs.org/package/argparse) + +CLI arguments parser for node.js. Javascript port of python's +[argparse](http://docs.python.org/dev/library/argparse.html) module +(original version 3.2). That's a full port, except some very rare options, +recorded in issue tracker. + +**NB. Difference with original.** + +- Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/). +- Use `defaultValue` instead of `default`. +- Use `argparse.Const.REMAINDER` instead of `argparse.REMAINDER`, and + similarly for constant values `OPTIONAL`, `ZERO_OR_MORE`, and `ONE_OR_MORE` + (aliases for `nargs` values `'?'`, `'*'`, `'+'`, respectively), and + `SUPPRESS`. + + +Example +======= + +test.js file: + +```javascript +#!/usr/bin/env node +'use strict'; + +var ArgumentParser = require('../lib/argparse').ArgumentParser; +var parser = new ArgumentParser({ + version: '0.0.1', + addHelp:true, + description: 'Argparse example' +}); +parser.addArgument( + [ '-f', '--foo' ], + { + help: 'foo bar' + } +); +parser.addArgument( + [ '-b', '--bar' ], + { + help: 'bar foo' + } +); +parser.addArgument( + '--baz', + { + help: 'baz bar' + } +); +var args = parser.parseArgs(); +console.dir(args); +``` + +Display help: + +``` +$ ./test.js -h +usage: example.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ] + +Argparse example + +Optional arguments: + -h, --help Show this help message and exit. + -v, --version Show program's version number and exit. + -f FOO, --foo FOO foo bar + -b BAR, --bar BAR bar foo + --baz BAZ baz bar +``` + +Parse arguments: + +``` +$ ./test.js -f=3 --bar=4 --baz 5 +{ foo: '3', bar: '4', baz: '5' } +``` + +More [examples](https://github.com/nodeca/argparse/tree/master/examples). + + +ArgumentParser objects +====================== + +``` +new ArgumentParser({parameters hash}); +``` + +Creates a new ArgumentParser object. + +**Supported params:** + +- ```description``` - Text to display before the argument help. +- ```epilog``` - Text to display after the argument help. +- ```addHelp``` - Add a -h/–help option to the parser. (default: true) +- ```argumentDefault``` - Set the global default value for arguments. (default: null) +- ```parents``` - A list of ArgumentParser objects whose arguments should also be included. +- ```prefixChars``` - The set of characters that prefix optional arguments. (default: ‘-‘) +- ```formatterClass``` - A class for customizing the help output. +- ```prog``` - The name of the program (default: `path.basename(process.argv[1])`) +- ```usage``` - The string describing the program usage (default: generated) +- ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals. + +**Not supported yet** + +- ```fromfilePrefixChars``` - The set of characters that prefix files from which additional arguments should be read. + + +Details in [original ArgumentParser guide](http://docs.python.org/dev/library/argparse.html#argumentparser-objects) + + +addArgument() method +==================== + +``` +ArgumentParser.addArgument(name or flag or [name] or [flags...], {options}) +``` + +Defines how a single command-line argument should be parsed. + +- ```name or flag or [name] or [flags...]``` - Either a positional name + (e.g., `'foo'`), a single option (e.g., `'-f'` or `'--foo'`), an array + of a single positional name (e.g., `['foo']`), or an array of options + (e.g., `['-f', '--foo']`). + +Options: + +- ```action``` - The basic type of action to be taken when this argument is encountered at the command line. +- ```nargs```- The number of command-line arguments that should be consumed. +- ```constant``` - A constant value required by some action and nargs selections. +- ```defaultValue``` - The value produced if the argument is absent from the command line. +- ```type``` - The type to which the command-line argument should be converted. +- ```choices``` - A container of the allowable values for the argument. +- ```required``` - Whether or not the command-line option may be omitted (optionals only). +- ```help``` - A brief description of what the argument does. +- ```metavar``` - A name for the argument in usage messages. +- ```dest``` - The name of the attribute to be added to the object returned by parseArgs(). + +Details in [original add_argument guide](http://docs.python.org/dev/library/argparse.html#the-add-argument-method) + + +Action (some details) +================ + +ArgumentParser objects associate command-line arguments with actions. +These actions can do just about anything with the command-line arguments associated +with them, though most actions simply add an attribute to the object returned by +parseArgs(). The action keyword argument specifies how the command-line arguments +should be handled. The supported actions are: + +- ```store``` - Just stores the argument’s value. This is the default action. +- ```storeConst``` - Stores value, specified by the const keyword argument. + (Note that the const keyword argument defaults to the rather unhelpful None.) + The 'storeConst' action is most commonly used with optional arguments, that + specify some sort of flag. +- ```storeTrue``` and ```storeFalse``` - Stores values True and False + respectively. These are special cases of 'storeConst'. +- ```append``` - Stores a list, and appends each argument value to the list. + This is useful to allow an option to be specified multiple times. +- ```appendConst``` - Stores a list, and appends value, specified by the + const keyword argument to the list. (Note, that the const keyword argument defaults + is None.) The 'appendConst' action is typically used when multiple arguments need + to store constants to the same list. +- ```count``` - Counts the number of times a keyword argument occurs. For example, + used for increasing verbosity levels. +- ```help``` - Prints a complete help message for all the options in the current + parser and then exits. By default a help action is automatically added to the parser. + See ArgumentParser for details of how the output is created. +- ```version``` - Prints version information and exit. Expects a `version=` + keyword argument in the addArgument() call. + +Details in [original action guide](http://docs.python.org/dev/library/argparse.html#action) + + +Sub-commands +============ + +ArgumentParser.addSubparsers() + +Many programs split their functionality into a number of sub-commands, for +example, the svn program can invoke sub-commands like `svn checkout`, `svn update`, +and `svn commit`. Splitting up functionality this way can be a particularly good +idea when a program performs several different functions which require different +kinds of command-line arguments. `ArgumentParser` supports creation of such +sub-commands with `addSubparsers()` method. The `addSubparsers()` method is +normally called with no arguments and returns an special action object. +This object has a single method `addParser()`, which takes a command name and +any `ArgumentParser` constructor arguments, and returns an `ArgumentParser` object +that can be modified as usual. + +Example: + +sub_commands.js +```javascript +#!/usr/bin/env node +'use strict'; + +var ArgumentParser = require('../lib/argparse').ArgumentParser; +var parser = new ArgumentParser({ + version: '0.0.1', + addHelp:true, + description: 'Argparse examples: sub-commands', +}); + +var subparsers = parser.addSubparsers({ + title:'subcommands', + dest:"subcommand_name" +}); + +var bar = subparsers.addParser('c1', {addHelp:true}); +bar.addArgument( + [ '-f', '--foo' ], + { + action: 'store', + help: 'foo3 bar3' + } +); +var bar = subparsers.addParser( + 'c2', + {aliases:['co'], addHelp:true} +); +bar.addArgument( + [ '-b', '--bar' ], + { + action: 'store', + type: 'int', + help: 'foo3 bar3' + } +); + +var args = parser.parseArgs(); +console.dir(args); + +``` + +Details in [original sub-commands guide](http://docs.python.org/dev/library/argparse.html#sub-commands) + + +Contributors +============ + +- [Eugene Shkuropat](https://github.com/shkuropat) +- [Paul Jacobson](https://github.com/hpaulj) + +[others](https://github.com/nodeca/argparse/graphs/contributors) + +License +======= + +Copyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin). +Released under the MIT license. See +[LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details. + + diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/index.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/index.js new file mode 100644 index 000000000..3bbc14320 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./lib/argparse'); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action.js new file mode 100644 index 000000000..1483c79ff --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action.js @@ -0,0 +1,146 @@ +/** + * class Action + * + * Base class for all actions + * Do not call in your code, use this class only for inherits your own action + * + * Information about how to convert command line strings to Javascript objects. + * Action objects are used by an ArgumentParser to represent the information + * needed to parse a single argument from one or more strings from the command + * line. The keyword arguments to the Action constructor are also all attributes + * of Action instances. + * + * ##### Allowed keywords: + * + * - `store` + * - `storeConstant` + * - `storeTrue` + * - `storeFalse` + * - `append` + * - `appendConstant` + * - `count` + * - `help` + * - `version` + * + * Information about action options see [[Action.new]] + * + * See also [original guide](http://docs.python.org/dev/library/argparse.html#action) + * + **/ + +'use strict'; + + +// Constants +var c = require('./const'); + + +/** + * new Action(options) + * + * Base class for all actions. Used only for inherits + * + * + * ##### Options: + * + * - `optionStrings` A list of command-line option strings for the action. + * - `dest` Attribute to hold the created object(s) + * - `nargs` The number of command-line arguments that should be consumed. + * By default, one argument will be consumed and a single value will be + * produced. + * - `constant` Default value for an action with no value. + * - `defaultValue` The value to be produced if the option is not specified. + * - `type` Cast to 'string'|'int'|'float'|'complex'|function (string). If + * None, 'string'. + * - `choices` The choices available. + * - `required` True if the action must always be specified at the command + * line. + * - `help` The help describing the argument. + * - `metavar` The name to be used for the option's argument with the help + * string. If None, the 'dest' value will be used as the name. + * + * ##### nargs supported values: + * + * - `N` (an integer) consumes N arguments (and produces a list) + * - `?` consumes zero or one arguments + * - `*` consumes zero or more arguments (and produces a list) + * - `+` consumes one or more arguments (and produces a list) + * + * Note: that the difference between the default and nargs=1 is that with the + * default, a single value will be produced, while with nargs=1, a list + * containing a single value will be produced. + **/ +var Action = module.exports = function Action(options) { + options = options || {}; + this.optionStrings = options.optionStrings || []; + this.dest = options.dest; + this.nargs = typeof options.nargs !== 'undefined' ? options.nargs : null; + this.constant = typeof options.constant !== 'undefined' ? options.constant : null; + this.defaultValue = options.defaultValue; + this.type = typeof options.type !== 'undefined' ? options.type : null; + this.choices = typeof options.choices !== 'undefined' ? options.choices : null; + this.required = typeof options.required !== 'undefined' ? options.required : false; + this.help = typeof options.help !== 'undefined' ? options.help : null; + this.metavar = typeof options.metavar !== 'undefined' ? options.metavar : null; + + if (!(this.optionStrings instanceof Array)) { + throw new Error('optionStrings should be an array'); + } + if (typeof this.required !== 'undefined' && typeof this.required !== 'boolean') { + throw new Error('required should be a boolean'); + } +}; + +/** + * Action#getName -> String + * + * Tells action name + **/ +Action.prototype.getName = function () { + if (this.optionStrings.length > 0) { + return this.optionStrings.join('/'); + } else if (this.metavar !== null && this.metavar !== c.SUPPRESS) { + return this.metavar; + } else if (typeof this.dest !== 'undefined' && this.dest !== c.SUPPRESS) { + return this.dest; + } + return null; +}; + +/** + * Action#isOptional -> Boolean + * + * Return true if optional + **/ +Action.prototype.isOptional = function () { + return !this.isPositional(); +}; + +/** + * Action#isPositional -> Boolean + * + * Return true if positional + **/ +Action.prototype.isPositional = function () { + return (this.optionStrings.length === 0); +}; + +/** + * Action#call(parser, namespace, values, optionString) -> Void + * - parser (ArgumentParser): current parser + * - namespace (Namespace): namespace for output data + * - values (Array): parsed values + * - optionString (Array): input option string(not parsed) + * + * Call the action. Should be implemented in inherited classes + * + * ##### Example + * + * ActionCount.prototype.call = function (parser, namespace, values, optionString) { + * namespace.set(this.dest, (namespace[this.dest] || 0) + 1); + * }; + * + **/ +Action.prototype.call = function () { + throw new Error('.call() not defined');// Not Implemented error +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/append.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/append.js new file mode 100644 index 000000000..b5da0de23 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/append.js @@ -0,0 +1,53 @@ +/*:nodoc:* + * class ActionAppend + * + * This action stores a list, and appends each argument value to the list. + * This is useful to allow an option to be specified multiple times. + * This class inherided from [[Action]] + * + **/ + +'use strict'; + +var util = require('util'); + +var Action = require('../action'); + +// Constants +var c = require('../const'); + +/*:nodoc:* + * new ActionAppend(options) + * - options (object): options hash see [[Action.new]] + * + * Note: options.nargs should be optional for constants + * and more then zero for other + **/ +var ActionAppend = module.exports = function ActionAppend(options) { + options = options || {}; + if (this.nargs <= 0) { + throw new Error('nargs for append actions must be > 0; if arg ' + + 'strings are not supplying the value to append, ' + + 'the append const action may be more appropriate'); + } + if (!!this.constant && this.nargs !== c.OPTIONAL) { + throw new Error('nargs must be OPTIONAL to supply const'); + } + Action.call(this, options); +}; +util.inherits(ActionAppend, Action); + +/*:nodoc:* + * ActionAppend#call(parser, namespace, values, optionString) -> Void + * - parser (ArgumentParser): current parser + * - namespace (Namespace): namespace for output data + * - values (Array): parsed values + * - optionString (Array): input option string(not parsed) + * + * Call the action. Save result in namespace object + **/ +ActionAppend.prototype.call = function (parser, namespace, values) { + var items = (namespace[this.dest] || []).slice(); + items.push(values); + namespace.set(this.dest, items); +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/append/constant.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/append/constant.js new file mode 100644 index 000000000..313f5d2ef --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/append/constant.js @@ -0,0 +1,47 @@ +/*:nodoc:* + * class ActionAppendConstant + * + * This stores a list, and appends the value specified by + * the const keyword argument to the list. + * (Note that the const keyword argument defaults to null.) + * The 'appendConst' action is typically useful when multiple + * arguments need to store constants to the same list. + * + * This class inherited from [[Action]] + **/ + +'use strict'; + +var util = require('util'); + +var Action = require('../../action'); + +/*:nodoc:* + * new ActionAppendConstant(options) + * - options (object): options hash see [[Action.new]] + * + **/ +var ActionAppendConstant = module.exports = function ActionAppendConstant(options) { + options = options || {}; + options.nargs = 0; + if (typeof options.constant === 'undefined') { + throw new Error('constant option is required for appendAction'); + } + Action.call(this, options); +}; +util.inherits(ActionAppendConstant, Action); + +/*:nodoc:* + * ActionAppendConstant#call(parser, namespace, values, optionString) -> Void + * - parser (ArgumentParser): current parser + * - namespace (Namespace): namespace for output data + * - values (Array): parsed values + * - optionString (Array): input option string(not parsed) + * + * Call the action. Save result in namespace object + **/ +ActionAppendConstant.prototype.call = function (parser, namespace) { + var items = [].concat(namespace[this.dest] || []); + items.push(this.constant); + namespace.set(this.dest, items); +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/count.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/count.js new file mode 100644 index 000000000..d6a5899d0 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/count.js @@ -0,0 +1,40 @@ +/*:nodoc:* + * class ActionCount + * + * This counts the number of times a keyword argument occurs. + * For example, this is useful for increasing verbosity levels + * + * This class inherided from [[Action]] + * + **/ +'use strict'; + +var util = require('util'); + +var Action = require('../action'); + +/*:nodoc:* + * new ActionCount(options) + * - options (object): options hash see [[Action.new]] + * + **/ +var ActionCount = module.exports = function ActionCount(options) { + options = options || {}; + options.nargs = 0; + + Action.call(this, options); +}; +util.inherits(ActionCount, Action); + +/*:nodoc:* + * ActionCount#call(parser, namespace, values, optionString) -> Void + * - parser (ArgumentParser): current parser + * - namespace (Namespace): namespace for output data + * - values (Array): parsed values + * - optionString (Array): input option string(not parsed) + * + * Call the action. Save result in namespace object + **/ +ActionCount.prototype.call = function (parser, namespace) { + namespace.set(this.dest, (namespace[this.dest] || 0) + 1); +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/help.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/help.js new file mode 100644 index 000000000..b40e05a6f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/help.js @@ -0,0 +1,47 @@ +/*:nodoc:* + * class ActionHelp + * + * Support action for printing help + * This class inherided from [[Action]] + **/ +'use strict'; + +var util = require('util'); + +var Action = require('../action'); + +// Constants +var c = require('../const'); + +/*:nodoc:* + * new ActionHelp(options) + * - options (object): options hash see [[Action.new]] + * + **/ +var ActionHelp = module.exports = function ActionHelp(options) { + options = options || {}; + if (options.defaultValue !== null) { + options.defaultValue = options.defaultValue; + } else { + options.defaultValue = c.SUPPRESS; + } + options.dest = (options.dest !== null ? options.dest : c.SUPPRESS); + options.nargs = 0; + Action.call(this, options); + +}; +util.inherits(ActionHelp, Action); + +/*:nodoc:* + * ActionHelp#call(parser, namespace, values, optionString) + * - parser (ArgumentParser): current parser + * - namespace (Namespace): namespace for output data + * - values (Array): parsed values + * - optionString (Array): input option string(not parsed) + * + * Print help and exit + **/ +ActionHelp.prototype.call = function (parser) { + parser.printHelp(); + parser.exit(); +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/store.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/store.js new file mode 100644 index 000000000..283b86092 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/store.js @@ -0,0 +1,50 @@ +/*:nodoc:* + * class ActionStore + * + * This action just stores the argument’s value. This is the default action. + * + * This class inherited from [[Action]] + * + **/ +'use strict'; + +var util = require('util'); + +var Action = require('../action'); + +// Constants +var c = require('../const'); + + +/*:nodoc:* + * new ActionStore(options) + * - options (object): options hash see [[Action.new]] + * + **/ +var ActionStore = module.exports = function ActionStore(options) { + options = options || {}; + if (this.nargs <= 0) { + throw new Error('nargs for store actions must be > 0; if you ' + + 'have nothing to store, actions such as store ' + + 'true or store const may be more appropriate'); + + } + if (typeof this.constant !== 'undefined' && this.nargs !== c.OPTIONAL) { + throw new Error('nargs must be OPTIONAL to supply const'); + } + Action.call(this, options); +}; +util.inherits(ActionStore, Action); + +/*:nodoc:* + * ActionStore#call(parser, namespace, values, optionString) -> Void + * - parser (ArgumentParser): current parser + * - namespace (Namespace): namespace for output data + * - values (Array): parsed values + * - optionString (Array): input option string(not parsed) + * + * Call the action. Save result in namespace object + **/ +ActionStore.prototype.call = function (parser, namespace, values) { + namespace.set(this.dest, values); +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/store/constant.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/store/constant.js new file mode 100644 index 000000000..23caa897b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/store/constant.js @@ -0,0 +1,43 @@ +/*:nodoc:* + * class ActionStoreConstant + * + * This action stores the value specified by the const keyword argument. + * (Note that the const keyword argument defaults to the rather unhelpful null.) + * The 'store_const' action is most commonly used with optional + * arguments that specify some sort of flag. + * + * This class inherited from [[Action]] + **/ +'use strict'; + +var util = require('util'); + +var Action = require('../../action'); + +/*:nodoc:* + * new ActionStoreConstant(options) + * - options (object): options hash see [[Action.new]] + * + **/ +var ActionStoreConstant = module.exports = function ActionStoreConstant(options) { + options = options || {}; + options.nargs = 0; + if (typeof options.constant === 'undefined') { + throw new Error('constant option is required for storeAction'); + } + Action.call(this, options); +}; +util.inherits(ActionStoreConstant, Action); + +/*:nodoc:* + * ActionStoreConstant#call(parser, namespace, values, optionString) -> Void + * - parser (ArgumentParser): current parser + * - namespace (Namespace): namespace for output data + * - values (Array): parsed values + * - optionString (Array): input option string(not parsed) + * + * Call the action. Save result in namespace object + **/ +ActionStoreConstant.prototype.call = function (parser, namespace) { + namespace.set(this.dest, this.constant); +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/store/false.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/store/false.js new file mode 100644 index 000000000..9924f461d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/store/false.js @@ -0,0 +1,27 @@ +/*:nodoc:* + * class ActionStoreFalse + * + * This action store the values False respectively. + * This is special cases of 'storeConst' + * + * This class inherited from [[Action]] + **/ + +'use strict'; + +var util = require('util'); + +var ActionStoreConstant = require('./constant'); + +/*:nodoc:* + * new ActionStoreFalse(options) + * - options (object): hash of options see [[Action.new]] + * + **/ +var ActionStoreFalse = module.exports = function ActionStoreFalse(options) { + options = options || {}; + options.constant = false; + options.defaultValue = options.defaultValue !== null ? options.defaultValue : true; + ActionStoreConstant.call(this, options); +}; +util.inherits(ActionStoreFalse, ActionStoreConstant); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/store/true.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/store/true.js new file mode 100644 index 000000000..9e22f7d44 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/store/true.js @@ -0,0 +1,26 @@ +/*:nodoc:* + * class ActionStoreTrue + * + * This action store the values True respectively. + * This isspecial cases of 'storeConst' + * + * This class inherited from [[Action]] + **/ +'use strict'; + +var util = require('util'); + +var ActionStoreConstant = require('./constant'); + +/*:nodoc:* + * new ActionStoreTrue(options) + * - options (object): options hash see [[Action.new]] + * + **/ +var ActionStoreTrue = module.exports = function ActionStoreTrue(options) { + options = options || {}; + options.constant = true; + options.defaultValue = options.defaultValue !== null ? options.defaultValue : false; + ActionStoreConstant.call(this, options); +}; +util.inherits(ActionStoreTrue, ActionStoreConstant); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/subparsers.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/subparsers.js new file mode 100644 index 000000000..99dfedd0f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/subparsers.js @@ -0,0 +1,149 @@ +/** internal + * class ActionSubparsers + * + * Support the creation of such sub-commands with the addSubparsers() + * + * This class inherited from [[Action]] + **/ +'use strict'; + +var util = require('util'); +var format = require('util').format; + + +var Action = require('../action'); + +// Constants +var c = require('../const'); + +// Errors +var argumentErrorHelper = require('../argument/error'); + + +/*:nodoc:* + * new ChoicesPseudoAction(name, help) + * + * Create pseudo action for correct help text + * + **/ +function ChoicesPseudoAction(name, help) { + var options = { + optionStrings: [], + dest: name, + help: help + }; + + Action.call(this, options); +} + +util.inherits(ChoicesPseudoAction, Action); + +/** + * new ActionSubparsers(options) + * - options (object): options hash see [[Action.new]] + * + **/ +function ActionSubparsers(options) { + options = options || {}; + options.dest = options.dest || c.SUPPRESS; + options.nargs = c.PARSER; + + this.debug = (options.debug === true); + + this._progPrefix = options.prog; + this._parserClass = options.parserClass; + this._nameParserMap = {}; + this._choicesActions = []; + + options.choices = this._nameParserMap; + Action.call(this, options); +} + +util.inherits(ActionSubparsers, Action); + +/*:nodoc:* + * ActionSubparsers#addParser(name, options) -> ArgumentParser + * - name (string): sub-command name + * - options (object): see [[ArgumentParser.new]] + * + * Note: + * addParser supports an additional aliases option, + * which allows multiple strings to refer to the same subparser. + * This example, like svn, aliases co as a shorthand for checkout + * + **/ +ActionSubparsers.prototype.addParser = function (name, options) { + var parser; + + var self = this; + + options = options || {}; + + options.debug = (this.debug === true); + + // set program from the existing prefix + if (!options.prog) { + options.prog = this._progPrefix + ' ' + name; + } + + var aliases = options.aliases || []; + + // create a pseudo-action to hold the choice help + if (!!options.help || typeof options.help === 'string') { + var help = options.help; + delete options.help; + + var choiceAction = new ChoicesPseudoAction(name, help); + this._choicesActions.push(choiceAction); + } + + // create the parser and add it to the map + parser = new this._parserClass(options); + this._nameParserMap[name] = parser; + + // make parser available under aliases also + aliases.forEach(function (alias) { + self._nameParserMap[alias] = parser; + }); + + return parser; +}; + +ActionSubparsers.prototype._getSubactions = function () { + return this._choicesActions; +}; + +/*:nodoc:* + * ActionSubparsers#call(parser, namespace, values, optionString) -> Void + * - parser (ArgumentParser): current parser + * - namespace (Namespace): namespace for output data + * - values (Array): parsed values + * - optionString (Array): input option string(not parsed) + * + * Call the action. Parse input aguments + **/ +ActionSubparsers.prototype.call = function (parser, namespace, values) { + var parserName = values[0]; + var argStrings = values.slice(1); + + // set the parser name if requested + if (this.dest !== c.SUPPRESS) { + namespace[this.dest] = parserName; + } + + // select the parser + if (this._nameParserMap[parserName]) { + parser = this._nameParserMap[parserName]; + } else { + throw argumentErrorHelper(format( + 'Unknown parser "%s" (choices: [%s]).', + parserName, + Object.keys(this._nameParserMap).join(', ') + )); + } + + // parse all the remaining options into the namespace + parser.parseArgs(argStrings, namespace); +}; + +module.exports = ActionSubparsers; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/version.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/version.js new file mode 100644 index 000000000..8053328cd --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action/version.js @@ -0,0 +1,47 @@ +/*:nodoc:* + * class ActionVersion + * + * Support action for printing program version + * This class inherited from [[Action]] + **/ +'use strict'; + +var util = require('util'); + +var Action = require('../action'); + +// +// Constants +// +var c = require('../const'); + +/*:nodoc:* + * new ActionVersion(options) + * - options (object): options hash see [[Action.new]] + * + **/ +var ActionVersion = module.exports = function ActionVersion(options) { + options = options || {}; + options.defaultValue = (options.defaultValue ? options.defaultValue : c.SUPPRESS); + options.dest = (options.dest || c.SUPPRESS); + options.nargs = 0; + this.version = options.version; + Action.call(this, options); +}; +util.inherits(ActionVersion, Action); + +/*:nodoc:* + * ActionVersion#call(parser, namespace, values, optionString) -> Void + * - parser (ArgumentParser): current parser + * - namespace (Namespace): namespace for output data + * - values (Array): parsed values + * - optionString (Array): input option string(not parsed) + * + * Print version and exit + **/ +ActionVersion.prototype.call = function (parser) { + var version = this.version || parser.version; + var formatter = parser._getFormatter(); + formatter.addText(version); + parser.exit(0, formatter.formatHelp()); +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action_container.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action_container.js new file mode 100644 index 000000000..6f1237bea --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/action_container.js @@ -0,0 +1,482 @@ +/** internal + * class ActionContainer + * + * Action container. Parent for [[ArgumentParser]] and [[ArgumentGroup]] + **/ + +'use strict'; + +var format = require('util').format; + +// Constants +var c = require('./const'); + +var $$ = require('./utils'); + +//Actions +var ActionHelp = require('./action/help'); +var ActionAppend = require('./action/append'); +var ActionAppendConstant = require('./action/append/constant'); +var ActionCount = require('./action/count'); +var ActionStore = require('./action/store'); +var ActionStoreConstant = require('./action/store/constant'); +var ActionStoreTrue = require('./action/store/true'); +var ActionStoreFalse = require('./action/store/false'); +var ActionVersion = require('./action/version'); +var ActionSubparsers = require('./action/subparsers'); + +// Errors +var argumentErrorHelper = require('./argument/error'); + +/** + * new ActionContainer(options) + * + * Action container. Parent for [[ArgumentParser]] and [[ArgumentGroup]] + * + * ##### Options: + * + * - `description` -- A description of what the program does + * - `prefixChars` -- Characters that prefix optional arguments + * - `argumentDefault` -- The default value for all arguments + * - `conflictHandler` -- The conflict handler to use for duplicate arguments + **/ +var ActionContainer = module.exports = function ActionContainer(options) { + options = options || {}; + + this.description = options.description; + this.argumentDefault = options.argumentDefault; + this.prefixChars = options.prefixChars || ''; + this.conflictHandler = options.conflictHandler; + + // set up registries + this._registries = {}; + + // register actions + this.register('action', null, ActionStore); + this.register('action', 'store', ActionStore); + this.register('action', 'storeConst', ActionStoreConstant); + this.register('action', 'storeTrue', ActionStoreTrue); + this.register('action', 'storeFalse', ActionStoreFalse); + this.register('action', 'append', ActionAppend); + this.register('action', 'appendConst', ActionAppendConstant); + this.register('action', 'count', ActionCount); + this.register('action', 'help', ActionHelp); + this.register('action', 'version', ActionVersion); + this.register('action', 'parsers', ActionSubparsers); + + // raise an exception if the conflict handler is invalid + this._getHandler(); + + // action storage + this._actions = []; + this._optionStringActions = {}; + + // groups + this._actionGroups = []; + this._mutuallyExclusiveGroups = []; + + // defaults storage + this._defaults = {}; + + // determines whether an "option" looks like a negative number + // -1, -1.5 -5e+4 + this._regexpNegativeNumber = new RegExp('^[-]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?$'); + + // whether or not there are any optionals that look like negative + // numbers -- uses a list so it can be shared and edited + this._hasNegativeNumberOptionals = []; +}; + +// Groups must be required, then ActionContainer already defined +var ArgumentGroup = require('./argument/group'); +var MutuallyExclusiveGroup = require('./argument/exclusive'); + +// +// Registration methods +// + +/** + * ActionContainer#register(registryName, value, object) -> Void + * - registryName (String) : object type action|type + * - value (string) : keyword + * - object (Object|Function) : handler + * + * Register handlers + **/ +ActionContainer.prototype.register = function (registryName, value, object) { + this._registries[registryName] = this._registries[registryName] || {}; + this._registries[registryName][value] = object; +}; + +ActionContainer.prototype._registryGet = function (registryName, value, defaultValue) { + if (arguments.length < 3) { + defaultValue = null; + } + return this._registries[registryName][value] || defaultValue; +}; + +// +// Namespace default accessor methods +// + +/** + * ActionContainer#setDefaults(options) -> Void + * - options (object):hash of options see [[Action.new]] + * + * Set defaults + **/ +ActionContainer.prototype.setDefaults = function (options) { + options = options || {}; + for (var property in options) { + if ($$.has(options, property)) { + this._defaults[property] = options[property]; + } + } + + // if these defaults match any existing arguments, replace the previous + // default on the object with the new one + this._actions.forEach(function (action) { + if ($$.has(options, action.dest)) { + action.defaultValue = options[action.dest]; + } + }); +}; + +/** + * ActionContainer#getDefault(dest) -> Mixed + * - dest (string): action destination + * + * Return action default value + **/ +ActionContainer.prototype.getDefault = function (dest) { + var result = $$.has(this._defaults, dest) ? this._defaults[dest] : null; + + this._actions.forEach(function (action) { + if (action.dest === dest && $$.has(action, 'defaultValue')) { + result = action.defaultValue; + } + }); + + return result; +}; +// +// Adding argument actions +// + +/** + * ActionContainer#addArgument(args, options) -> Object + * - args (String|Array): argument key, or array of argument keys + * - options (Object): action objects see [[Action.new]] + * + * #### Examples + * - addArgument([ '-f', '--foo' ], { action: 'store', defaultValue: 1, ... }) + * - addArgument([ 'bar' ], { action: 'store', nargs: 1, ... }) + * - addArgument('--baz', { action: 'store', nargs: 1, ... }) + **/ +ActionContainer.prototype.addArgument = function (args, options) { + args = args; + options = options || {}; + + if (typeof args === 'string') { + args = [ args ]; + } + if (!Array.isArray(args)) { + throw new TypeError('addArgument first argument should be a string or an array'); + } + if (typeof options !== 'object' || Array.isArray(options)) { + throw new TypeError('addArgument second argument should be a hash'); + } + + // if no positional args are supplied or only one is supplied and + // it doesn't look like an option string, parse a positional argument + if (!args || args.length === 1 && this.prefixChars.indexOf(args[0][0]) < 0) { + if (args && !!options.dest) { + throw new Error('dest supplied twice for positional argument'); + } + options = this._getPositional(args, options); + + // otherwise, we're adding an optional argument + } else { + options = this._getOptional(args, options); + } + + // if no default was supplied, use the parser-level default + if (typeof options.defaultValue === 'undefined') { + var dest = options.dest; + if ($$.has(this._defaults, dest)) { + options.defaultValue = this._defaults[dest]; + } else if (typeof this.argumentDefault !== 'undefined') { + options.defaultValue = this.argumentDefault; + } + } + + // create the action object, and add it to the parser + var ActionClass = this._popActionClass(options); + if (typeof ActionClass !== 'function') { + throw new Error(format('Unknown action "%s".', ActionClass)); + } + var action = new ActionClass(options); + + // throw an error if the action type is not callable + var typeFunction = this._registryGet('type', action.type, action.type); + if (typeof typeFunction !== 'function') { + throw new Error(format('"%s" is not callable', typeFunction)); + } + + return this._addAction(action); +}; + +/** + * ActionContainer#addArgumentGroup(options) -> ArgumentGroup + * - options (Object): hash of options see [[ArgumentGroup.new]] + * + * Create new arguments groups + **/ +ActionContainer.prototype.addArgumentGroup = function (options) { + var group = new ArgumentGroup(this, options); + this._actionGroups.push(group); + return group; +}; + +/** + * ActionContainer#addMutuallyExclusiveGroup(options) -> ArgumentGroup + * - options (Object): {required: false} + * + * Create new mutual exclusive groups + **/ +ActionContainer.prototype.addMutuallyExclusiveGroup = function (options) { + var group = new MutuallyExclusiveGroup(this, options); + this._mutuallyExclusiveGroups.push(group); + return group; +}; + +ActionContainer.prototype._addAction = function (action) { + var self = this; + + // resolve any conflicts + this._checkConflict(action); + + // add to actions list + this._actions.push(action); + action.container = this; + + // index the action by any option strings it has + action.optionStrings.forEach(function (optionString) { + self._optionStringActions[optionString] = action; + }); + + // set the flag if any option strings look like negative numbers + action.optionStrings.forEach(function (optionString) { + if (optionString.match(self._regexpNegativeNumber)) { + if (!self._hasNegativeNumberOptionals.some(Boolean)) { + self._hasNegativeNumberOptionals.push(true); + } + } + }); + + // return the created action + return action; +}; + +ActionContainer.prototype._removeAction = function (action) { + var actionIndex = this._actions.indexOf(action); + if (actionIndex >= 0) { + this._actions.splice(actionIndex, 1); + } +}; + +ActionContainer.prototype._addContainerActions = function (container) { + // collect groups by titles + var titleGroupMap = {}; + this._actionGroups.forEach(function (group) { + if (titleGroupMap[group.title]) { + throw new Error(format('Cannot merge actions - two groups are named "%s".', group.title)); + } + titleGroupMap[group.title] = group; + }); + + // map each action to its group + var groupMap = {}; + function actionHash(action) { + // unique (hopefully?) string suitable as dictionary key + return action.getName(); + } + container._actionGroups.forEach(function (group) { + // if a group with the title exists, use that, otherwise + // create a new group matching the container's group + if (!titleGroupMap[group.title]) { + titleGroupMap[group.title] = this.addArgumentGroup({ + title: group.title, + description: group.description + }); + } + + // map the actions to their new group + group._groupActions.forEach(function (action) { + groupMap[actionHash(action)] = titleGroupMap[group.title]; + }); + }, this); + + // add container's mutually exclusive groups + // NOTE: if add_mutually_exclusive_group ever gains title= and + // description= then this code will need to be expanded as above + var mutexGroup; + container._mutuallyExclusiveGroups.forEach(function (group) { + mutexGroup = this.addMutuallyExclusiveGroup({ + required: group.required + }); + // map the actions to their new mutex group + group._groupActions.forEach(function (action) { + groupMap[actionHash(action)] = mutexGroup; + }); + }, this); // forEach takes a 'this' argument + + // add all actions to this container or their group + container._actions.forEach(function (action) { + var key = actionHash(action); + if (groupMap[key]) { + groupMap[key]._addAction(action); + } else { + this._addAction(action); + } + }); +}; + +ActionContainer.prototype._getPositional = function (dest, options) { + if (Array.isArray(dest)) { + dest = dest[0]; + } + // make sure required is not specified + if (options.required) { + throw new Error('"required" is an invalid argument for positionals.'); + } + + // mark positional arguments as required if at least one is + // always required + if (options.nargs !== c.OPTIONAL && options.nargs !== c.ZERO_OR_MORE) { + options.required = true; + } + if (options.nargs === c.ZERO_OR_MORE && typeof options.defaultValue === 'undefined') { + options.required = true; + } + + // return the keyword arguments with no option strings + options.dest = dest; + options.optionStrings = []; + return options; +}; + +ActionContainer.prototype._getOptional = function (args, options) { + var prefixChars = this.prefixChars; + var optionStrings = []; + var optionStringsLong = []; + + // determine short and long option strings + args.forEach(function (optionString) { + // error on strings that don't start with an appropriate prefix + if (prefixChars.indexOf(optionString[0]) < 0) { + throw new Error(format('Invalid option string "%s": must start with a "%s".', + optionString, + prefixChars + )); + } + + // strings starting with two prefix characters are long options + optionStrings.push(optionString); + if (optionString.length > 1 && prefixChars.indexOf(optionString[1]) >= 0) { + optionStringsLong.push(optionString); + } + }); + + // infer dest, '--foo-bar' -> 'foo_bar' and '-x' -> 'x' + var dest = options.dest || null; + delete options.dest; + + if (!dest) { + var optionStringDest = optionStringsLong.length ? optionStringsLong[0] : optionStrings[0]; + dest = $$.trimChars(optionStringDest, this.prefixChars); + + if (dest.length === 0) { + throw new Error( + format('dest= is required for options like "%s"', optionStrings.join(', ')) + ); + } + dest = dest.replace(/-/g, '_'); + } + + // return the updated keyword arguments + options.dest = dest; + options.optionStrings = optionStrings; + + return options; +}; + +ActionContainer.prototype._popActionClass = function (options, defaultValue) { + defaultValue = defaultValue || null; + + var action = (options.action || defaultValue); + delete options.action; + + var actionClass = this._registryGet('action', action, action); + return actionClass; +}; + +ActionContainer.prototype._getHandler = function () { + var handlerString = this.conflictHandler; + var handlerFuncName = '_handleConflict' + $$.capitalize(handlerString); + var func = this[handlerFuncName]; + if (typeof func === 'undefined') { + var msg = 'invalid conflict resolution value: ' + handlerString; + throw new Error(msg); + } else { + return func; + } +}; + +ActionContainer.prototype._checkConflict = function (action) { + var optionStringActions = this._optionStringActions; + var conflictOptionals = []; + + // find all options that conflict with this option + // collect pairs, the string, and an existing action that it conflicts with + action.optionStrings.forEach(function (optionString) { + var conflOptional = optionStringActions[optionString]; + if (typeof conflOptional !== 'undefined') { + conflictOptionals.push([ optionString, conflOptional ]); + } + }); + + if (conflictOptionals.length > 0) { + var conflictHandler = this._getHandler(); + conflictHandler.call(this, action, conflictOptionals); + } +}; + +ActionContainer.prototype._handleConflictError = function (action, conflOptionals) { + var conflicts = conflOptionals.map(function (pair) { return pair[0]; }); + conflicts = conflicts.join(', '); + throw argumentErrorHelper( + action, + format('Conflicting option string(s): %s', conflicts) + ); +}; + +ActionContainer.prototype._handleConflictResolve = function (action, conflOptionals) { + // remove all conflicting options + var self = this; + conflOptionals.forEach(function (pair) { + var optionString = pair[0]; + var conflictingAction = pair[1]; + // remove the conflicting option string + var i = conflictingAction.optionStrings.indexOf(optionString); + if (i >= 0) { + conflictingAction.optionStrings.splice(i, 1); + } + delete self._optionStringActions[optionString]; + // if the option now has no option string, remove it from the + // container holding it + if (conflictingAction.optionStrings.length === 0) { + conflictingAction.container._removeAction(conflictingAction); + } + }); +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/argparse.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/argparse.js new file mode 100644 index 000000000..f2a2c51d9 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/argparse.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports.ArgumentParser = require('./argument_parser.js'); +module.exports.Namespace = require('./namespace'); +module.exports.Action = require('./action'); +module.exports.HelpFormatter = require('./help/formatter.js'); +module.exports.Const = require('./const.js'); + +module.exports.ArgumentDefaultsHelpFormatter = + require('./help/added_formatters.js').ArgumentDefaultsHelpFormatter; +module.exports.RawDescriptionHelpFormatter = + require('./help/added_formatters.js').RawDescriptionHelpFormatter; +module.exports.RawTextHelpFormatter = + require('./help/added_formatters.js').RawTextHelpFormatter; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/argument/error.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/argument/error.js new file mode 100644 index 000000000..c8a02a08b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/argument/error.js @@ -0,0 +1,50 @@ +'use strict'; + + +var format = require('util').format; + + +var ERR_CODE = 'ARGError'; + +/*:nodoc:* + * argumentError(argument, message) -> TypeError + * - argument (Object): action with broken argument + * - message (String): error message + * + * Error format helper. An error from creating or using an argument + * (optional or positional). The string value of this exception + * is the message, augmented with information + * about the argument that caused it. + * + * #####Example + * + * var argumentErrorHelper = require('./argument/error'); + * if (conflictOptionals.length > 0) { + * throw argumentErrorHelper( + * action, + * format('Conflicting option string(s): %s', conflictOptionals.join(', ')) + * ); + * } + * + **/ +module.exports = function (argument, message) { + var argumentName = null; + var errMessage; + var err; + + if (argument.getName) { + argumentName = argument.getName(); + } else { + argumentName = '' + argument; + } + + if (!argumentName) { + errMessage = message; + } else { + errMessage = format('argument "%s": %s', argumentName, message); + } + + err = new TypeError(errMessage); + err.code = ERR_CODE; + return err; +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/argument/exclusive.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/argument/exclusive.js new file mode 100644 index 000000000..8287e00d0 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/argument/exclusive.js @@ -0,0 +1,54 @@ +/** internal + * class MutuallyExclusiveGroup + * + * Group arguments. + * By default, ArgumentParser groups command-line arguments + * into “positional arguments” and “optional arguments” + * when displaying help messages. When there is a better + * conceptual grouping of arguments than this default one, + * appropriate groups can be created using the addArgumentGroup() method + * + * This class inherited from [[ArgumentContainer]] + **/ +'use strict'; + +var util = require('util'); + +var ArgumentGroup = require('./group'); + +/** + * new MutuallyExclusiveGroup(container, options) + * - container (object): main container + * - options (object): options.required -> true/false + * + * `required` could be an argument itself, but making it a property of + * the options argument is more consistent with the JS adaptation of the Python) + **/ +var MutuallyExclusiveGroup = module.exports = function MutuallyExclusiveGroup(container, options) { + var required; + options = options || {}; + required = options.required || false; + ArgumentGroup.call(this, container); + this.required = required; + +}; +util.inherits(MutuallyExclusiveGroup, ArgumentGroup); + + +MutuallyExclusiveGroup.prototype._addAction = function (action) { + var msg; + if (action.required) { + msg = 'mutually exclusive arguments must be optional'; + throw new Error(msg); + } + action = this._container._addAction(action); + this._groupActions.push(action); + return action; +}; + + +MutuallyExclusiveGroup.prototype._removeAction = function (action) { + this._container._removeAction(action); + this._groupActions.remove(action); +}; + diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/argument/group.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/argument/group.js new file mode 100644 index 000000000..58b271f2f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/argument/group.js @@ -0,0 +1,75 @@ +/** internal + * class ArgumentGroup + * + * Group arguments. + * By default, ArgumentParser groups command-line arguments + * into “positional arguments” and “optional arguments” + * when displaying help messages. When there is a better + * conceptual grouping of arguments than this default one, + * appropriate groups can be created using the addArgumentGroup() method + * + * This class inherited from [[ArgumentContainer]] + **/ +'use strict'; + +var util = require('util'); + +var ActionContainer = require('../action_container'); + + +/** + * new ArgumentGroup(container, options) + * - container (object): main container + * - options (object): hash of group options + * + * #### options + * - **prefixChars** group name prefix + * - **argumentDefault** default argument value + * - **title** group title + * - **description** group description + * + **/ +var ArgumentGroup = module.exports = function ArgumentGroup(container, options) { + + options = options || {}; + + // add any missing keyword arguments by checking the container + options.conflictHandler = (options.conflictHandler || container.conflictHandler); + options.prefixChars = (options.prefixChars || container.prefixChars); + options.argumentDefault = (options.argumentDefault || container.argumentDefault); + + ActionContainer.call(this, options); + + // group attributes + this.title = options.title; + this._groupActions = []; + + // share most attributes with the container + this._container = container; + this._registries = container._registries; + this._actions = container._actions; + this._optionStringActions = container._optionStringActions; + this._defaults = container._defaults; + this._hasNegativeNumberOptionals = container._hasNegativeNumberOptionals; + this._mutuallyExclusiveGroups = container._mutuallyExclusiveGroups; +}; +util.inherits(ArgumentGroup, ActionContainer); + + +ArgumentGroup.prototype._addAction = function (action) { + // Parent add action + action = ActionContainer.prototype._addAction.call(this, action); + this._groupActions.push(action); + return action; +}; + + +ArgumentGroup.prototype._removeAction = function (action) { + // Parent remove action + ActionContainer.prototype._removeAction.call(this, action); + var actionIndex = this._groupActions.indexOf(action); + if (actionIndex >= 0) { + this._groupActions.splice(actionIndex, 1); + } +}; + diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/argument_parser.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/argument_parser.js new file mode 100644 index 000000000..bd9a59a45 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/argument_parser.js @@ -0,0 +1,1161 @@ +/** + * class ArgumentParser + * + * Object for parsing command line strings into js objects. + * + * Inherited from [[ActionContainer]] + **/ +'use strict'; + +var util = require('util'); +var format = require('util').format; +var Path = require('path'); +var sprintf = require('sprintf-js').sprintf; + +// Constants +var c = require('./const'); + +var $$ = require('./utils'); + +var ActionContainer = require('./action_container'); + +// Errors +var argumentErrorHelper = require('./argument/error'); + +var HelpFormatter = require('./help/formatter'); + +var Namespace = require('./namespace'); + + +/** + * new ArgumentParser(options) + * + * Create a new ArgumentParser object. + * + * ##### Options: + * - `prog` The name of the program (default: Path.basename(process.argv[1])) + * - `usage` A usage message (default: auto-generated from arguments) + * - `description` A description of what the program does + * - `epilog` Text following the argument descriptions + * - `parents` Parsers whose arguments should be copied into this one + * - `formatterClass` HelpFormatter class for printing help messages + * - `prefixChars` Characters that prefix optional arguments + * - `fromfilePrefixChars` Characters that prefix files containing additional arguments + * - `argumentDefault` The default value for all arguments + * - `addHelp` Add a -h/-help option + * - `conflictHandler` Specifies how to handle conflicting argument names + * - `debug` Enable debug mode. Argument errors throw exception in + * debug mode and process.exit in normal. Used for development and + * testing (default: false) + * + * See also [original guide][1] + * + * [1]:http://docs.python.org/dev/library/argparse.html#argumentparser-objects + **/ +function ArgumentParser(options) { + if (!(this instanceof ArgumentParser)) { + return new ArgumentParser(options); + } + var self = this; + options = options || {}; + + options.description = (options.description || null); + options.argumentDefault = (options.argumentDefault || null); + options.prefixChars = (options.prefixChars || '-'); + options.conflictHandler = (options.conflictHandler || 'error'); + ActionContainer.call(this, options); + + options.addHelp = typeof options.addHelp === 'undefined' || !!options.addHelp; + options.parents = options.parents || []; + // default program name + options.prog = (options.prog || Path.basename(process.argv[1])); + this.prog = options.prog; + this.usage = options.usage; + this.epilog = options.epilog; + this.version = options.version; + + this.debug = (options.debug === true); + + this.formatterClass = (options.formatterClass || HelpFormatter); + this.fromfilePrefixChars = options.fromfilePrefixChars || null; + this._positionals = this.addArgumentGroup({ title: 'Positional arguments' }); + this._optionals = this.addArgumentGroup({ title: 'Optional arguments' }); + this._subparsers = null; + + // register types + function FUNCTION_IDENTITY(o) { + return o; + } + this.register('type', 'auto', FUNCTION_IDENTITY); + this.register('type', null, FUNCTION_IDENTITY); + this.register('type', 'int', function (x) { + var result = parseInt(x, 10); + if (isNaN(result)) { + throw new Error(x + ' is not a valid integer.'); + } + return result; + }); + this.register('type', 'float', function (x) { + var result = parseFloat(x); + if (isNaN(result)) { + throw new Error(x + ' is not a valid float.'); + } + return result; + }); + this.register('type', 'string', function (x) { + return '' + x; + }); + + // add help and version arguments if necessary + var defaultPrefix = (this.prefixChars.indexOf('-') > -1) ? '-' : this.prefixChars[0]; + if (options.addHelp) { + this.addArgument( + [ defaultPrefix + 'h', defaultPrefix + defaultPrefix + 'help' ], + { + action: 'help', + defaultValue: c.SUPPRESS, + help: 'Show this help message and exit.' + } + ); + } + if (typeof this.version !== 'undefined') { + this.addArgument( + [ defaultPrefix + 'v', defaultPrefix + defaultPrefix + 'version' ], + { + action: 'version', + version: this.version, + defaultValue: c.SUPPRESS, + help: "Show program's version number and exit." + } + ); + } + + // add parent arguments and defaults + options.parents.forEach(function (parent) { + self._addContainerActions(parent); + if (typeof parent._defaults !== 'undefined') { + for (var defaultKey in parent._defaults) { + if (parent._defaults.hasOwnProperty(defaultKey)) { + self._defaults[defaultKey] = parent._defaults[defaultKey]; + } + } + } + }); +} + +util.inherits(ArgumentParser, ActionContainer); + +/** + * ArgumentParser#addSubparsers(options) -> [[ActionSubparsers]] + * - options (object): hash of options see [[ActionSubparsers.new]] + * + * See also [subcommands][1] + * + * [1]:http://docs.python.org/dev/library/argparse.html#sub-commands + **/ +ArgumentParser.prototype.addSubparsers = function (options) { + if (this._subparsers) { + this.error('Cannot have multiple subparser arguments.'); + } + + options = options || {}; + options.debug = (this.debug === true); + options.optionStrings = []; + options.parserClass = (options.parserClass || ArgumentParser); + + + if (!!options.title || !!options.description) { + + this._subparsers = this.addArgumentGroup({ + title: (options.title || 'subcommands'), + description: options.description + }); + delete options.title; + delete options.description; + + } else { + this._subparsers = this._positionals; + } + + // prog defaults to the usage message of this parser, skipping + // optional arguments and with no "usage:" prefix + if (!options.prog) { + var formatter = this._getFormatter(); + var positionals = this._getPositionalActions(); + var groups = this._mutuallyExclusiveGroups; + formatter.addUsage(this.usage, positionals, groups, ''); + options.prog = formatter.formatHelp().trim(); + } + + // create the parsers action and add it to the positionals list + var ParsersClass = this._popActionClass(options, 'parsers'); + var action = new ParsersClass(options); + this._subparsers._addAction(action); + + // return the created parsers action + return action; +}; + +ArgumentParser.prototype._addAction = function (action) { + if (action.isOptional()) { + this._optionals._addAction(action); + } else { + this._positionals._addAction(action); + } + return action; +}; + +ArgumentParser.prototype._getOptionalActions = function () { + return this._actions.filter(function (action) { + return action.isOptional(); + }); +}; + +ArgumentParser.prototype._getPositionalActions = function () { + return this._actions.filter(function (action) { + return action.isPositional(); + }); +}; + + +/** + * ArgumentParser#parseArgs(args, namespace) -> Namespace|Object + * - args (array): input elements + * - namespace (Namespace|Object): result object + * + * Parsed args and throws error if some arguments are not recognized + * + * See also [original guide][1] + * + * [1]:http://docs.python.org/dev/library/argparse.html#the-parse-args-method + **/ +ArgumentParser.prototype.parseArgs = function (args, namespace) { + var argv; + var result = this.parseKnownArgs(args, namespace); + + args = result[0]; + argv = result[1]; + if (argv && argv.length > 0) { + this.error( + format('Unrecognized arguments: %s.', argv.join(' ')) + ); + } + return args; +}; + +/** + * ArgumentParser#parseKnownArgs(args, namespace) -> array + * - args (array): input options + * - namespace (Namespace|Object): result object + * + * Parse known arguments and return tuple of result object + * and unknown args + * + * See also [original guide][1] + * + * [1]:http://docs.python.org/dev/library/argparse.html#partial-parsing + **/ +ArgumentParser.prototype.parseKnownArgs = function (args, namespace) { + var self = this; + + // args default to the system args + args = args || process.argv.slice(2); + + // default Namespace built from parser defaults + namespace = namespace || new Namespace(); + + self._actions.forEach(function (action) { + if (action.dest !== c.SUPPRESS) { + if (!$$.has(namespace, action.dest)) { + if (action.defaultValue !== c.SUPPRESS) { + var defaultValue = action.defaultValue; + if (typeof action.defaultValue === 'string') { + defaultValue = self._getValue(action, defaultValue); + } + namespace[action.dest] = defaultValue; + } + } + } + }); + + Object.keys(self._defaults).forEach(function (dest) { + namespace[dest] = self._defaults[dest]; + }); + + // parse the arguments and exit if there are any errors + try { + var res = this._parseKnownArgs(args, namespace); + + namespace = res[0]; + args = res[1]; + if ($$.has(namespace, c._UNRECOGNIZED_ARGS_ATTR)) { + args = $$.arrayUnion(args, namespace[c._UNRECOGNIZED_ARGS_ATTR]); + delete namespace[c._UNRECOGNIZED_ARGS_ATTR]; + } + return [ namespace, args ]; + } catch (e) { + this.error(e); + } +}; + +ArgumentParser.prototype._parseKnownArgs = function (argStrings, namespace) { + var self = this; + + var extras = []; + + // replace arg strings that are file references + if (this.fromfilePrefixChars !== null) { + argStrings = this._readArgsFromFiles(argStrings); + } + // map all mutually exclusive arguments to the other arguments + // they can't occur with + // Python has 'conflicts = action_conflicts.setdefault(mutex_action, [])' + // though I can't conceive of a way in which an action could be a member + // of two different mutually exclusive groups. + + function actionHash(action) { + // some sort of hashable key for this action + // action itself cannot be a key in actionConflicts + // I think getName() (join of optionStrings) is unique enough + return action.getName(); + } + + var conflicts, key; + var actionConflicts = {}; + + this._mutuallyExclusiveGroups.forEach(function (mutexGroup) { + mutexGroup._groupActions.forEach(function (mutexAction, i, groupActions) { + key = actionHash(mutexAction); + if (!$$.has(actionConflicts, key)) { + actionConflicts[key] = []; + } + conflicts = actionConflicts[key]; + conflicts.push.apply(conflicts, groupActions.slice(0, i)); + conflicts.push.apply(conflicts, groupActions.slice(i + 1)); + }); + }); + + // find all option indices, and determine the arg_string_pattern + // which has an 'O' if there is an option at an index, + // an 'A' if there is an argument, or a '-' if there is a '--' + var optionStringIndices = {}; + + var argStringPatternParts = []; + + argStrings.forEach(function (argString, argStringIndex) { + if (argString === '--') { + argStringPatternParts.push('-'); + while (argStringIndex < argStrings.length) { + argStringPatternParts.push('A'); + argStringIndex++; + } + } else { + // otherwise, add the arg to the arg strings + // and note the index if it was an option + var pattern; + var optionTuple = self._parseOptional(argString); + if (!optionTuple) { + pattern = 'A'; + } else { + optionStringIndices[argStringIndex] = optionTuple; + pattern = 'O'; + } + argStringPatternParts.push(pattern); + } + }); + var argStringsPattern = argStringPatternParts.join(''); + + var seenActions = []; + var seenNonDefaultActions = []; + + + function takeAction(action, argumentStrings, optionString) { + seenActions.push(action); + var argumentValues = self._getValues(action, argumentStrings); + + // error if this argument is not allowed with other previously + // seen arguments, assuming that actions that use the default + // value don't really count as "present" + if (argumentValues !== action.defaultValue) { + seenNonDefaultActions.push(action); + if (actionConflicts[actionHash(action)]) { + actionConflicts[actionHash(action)].forEach(function (actionConflict) { + if (seenNonDefaultActions.indexOf(actionConflict) >= 0) { + throw argumentErrorHelper( + action, + format('Not allowed with argument "%s".', actionConflict.getName()) + ); + } + }); + } + } + + if (argumentValues !== c.SUPPRESS) { + action.call(self, namespace, argumentValues, optionString); + } + } + + function consumeOptional(startIndex) { + // get the optional identified at this index + var optionTuple = optionStringIndices[startIndex]; + var action = optionTuple[0]; + var optionString = optionTuple[1]; + var explicitArg = optionTuple[2]; + + // identify additional optionals in the same arg string + // (e.g. -xyz is the same as -x -y -z if no args are required) + var actionTuples = []; + + var args, argCount, start, stop; + + for (;;) { + if (!action) { + extras.push(argStrings[startIndex]); + return startIndex + 1; + } + if (explicitArg) { + argCount = self._matchArgument(action, 'A'); + + // if the action is a single-dash option and takes no + // arguments, try to parse more single-dash options out + // of the tail of the option string + var chars = self.prefixChars; + if (argCount === 0 && chars.indexOf(optionString[1]) < 0) { + actionTuples.push([ action, [], optionString ]); + optionString = optionString[0] + explicitArg[0]; + var newExplicitArg = explicitArg.slice(1) || null; + var optionalsMap = self._optionStringActions; + + if (Object.keys(optionalsMap).indexOf(optionString) >= 0) { + action = optionalsMap[optionString]; + explicitArg = newExplicitArg; + } else { + throw argumentErrorHelper(action, sprintf('ignored explicit argument %r', explicitArg)); + } + } else if (argCount === 1) { + // if the action expect exactly one argument, we've + // successfully matched the option; exit the loop + stop = startIndex + 1; + args = [ explicitArg ]; + actionTuples.push([ action, args, optionString ]); + break; + } else { + // error if a double-dash option did not use the + // explicit argument + throw argumentErrorHelper(action, sprintf('ignored explicit argument %r', explicitArg)); + } + } else { + // if there is no explicit argument, try to match the + // optional's string arguments with the following strings + // if successful, exit the loop + + start = startIndex + 1; + var selectedPatterns = argStringsPattern.substr(start); + + argCount = self._matchArgument(action, selectedPatterns); + stop = start + argCount; + + + args = argStrings.slice(start, stop); + + actionTuples.push([ action, args, optionString ]); + break; + } + + } + + // add the Optional to the list and return the index at which + // the Optional's string args stopped + if (actionTuples.length < 1) { + throw new Error('length should be > 0'); + } + for (var i = 0; i < actionTuples.length; i++) { + takeAction.apply(self, actionTuples[i]); + } + return stop; + } + + // the list of Positionals left to be parsed; this is modified + // by consume_positionals() + var positionals = self._getPositionalActions(); + + function consumePositionals(startIndex) { + // match as many Positionals as possible + var selectedPattern = argStringsPattern.substr(startIndex); + var argCounts = self._matchArgumentsPartial(positionals, selectedPattern); + + // slice off the appropriate arg strings for each Positional + // and add the Positional and its args to the list + for (var i = 0; i < positionals.length; i++) { + var action = positionals[i]; + var argCount = argCounts[i]; + if (typeof argCount === 'undefined') { + continue; + } + var args = argStrings.slice(startIndex, startIndex + argCount); + + startIndex += argCount; + takeAction(action, args); + } + + // slice off the Positionals that we just parsed and return the + // index at which the Positionals' string args stopped + positionals = positionals.slice(argCounts.length); + return startIndex; + } + + // consume Positionals and Optionals alternately, until we have + // passed the last option string + var startIndex = 0; + var position; + + var maxOptionStringIndex = -1; + + Object.keys(optionStringIndices).forEach(function (position) { + maxOptionStringIndex = Math.max(maxOptionStringIndex, parseInt(position, 10)); + }); + + var positionalsEndIndex, nextOptionStringIndex; + + while (startIndex <= maxOptionStringIndex) { + // consume any Positionals preceding the next option + nextOptionStringIndex = null; + for (position in optionStringIndices) { + if (!optionStringIndices.hasOwnProperty(position)) { continue; } + + position = parseInt(position, 10); + if (position >= startIndex) { + if (nextOptionStringIndex !== null) { + nextOptionStringIndex = Math.min(nextOptionStringIndex, position); + } else { + nextOptionStringIndex = position; + } + } + } + + if (startIndex !== nextOptionStringIndex) { + positionalsEndIndex = consumePositionals(startIndex); + // only try to parse the next optional if we didn't consume + // the option string during the positionals parsing + if (positionalsEndIndex > startIndex) { + startIndex = positionalsEndIndex; + continue; + } else { + startIndex = positionalsEndIndex; + } + } + + // if we consumed all the positionals we could and we're not + // at the index of an option string, there were extra arguments + if (!optionStringIndices[startIndex]) { + var strings = argStrings.slice(startIndex, nextOptionStringIndex); + extras = extras.concat(strings); + startIndex = nextOptionStringIndex; + } + // consume the next optional and any arguments for it + startIndex = consumeOptional(startIndex); + } + + // consume any positionals following the last Optional + var stopIndex = consumePositionals(startIndex); + + // if we didn't consume all the argument strings, there were extras + extras = extras.concat(argStrings.slice(stopIndex)); + + // if we didn't use all the Positional objects, there were too few + // arg strings supplied. + if (positionals.length > 0) { + self.error('too few arguments'); + } + + // make sure all required actions were present + self._actions.forEach(function (action) { + if (action.required) { + if (seenActions.indexOf(action) < 0) { + self.error(format('Argument "%s" is required', action.getName())); + } + } + }); + + // make sure all required groups have one option present + var actionUsed = false; + self._mutuallyExclusiveGroups.forEach(function (group) { + if (group.required) { + actionUsed = group._groupActions.some(function (action) { + return seenNonDefaultActions.indexOf(action) !== -1; + }); + + // if no actions were used, report the error + if (!actionUsed) { + var names = []; + group._groupActions.forEach(function (action) { + if (action.help !== c.SUPPRESS) { + names.push(action.getName()); + } + }); + names = names.join(' '); + var msg = 'one of the arguments ' + names + ' is required'; + self.error(msg); + } + } + }); + + // return the updated namespace and the extra arguments + return [ namespace, extras ]; +}; + +ArgumentParser.prototype._readArgsFromFiles = function (argStrings) { + // expand arguments referencing files + var self = this; + var fs = require('fs'); + var newArgStrings = []; + argStrings.forEach(function (argString) { + if (self.fromfilePrefixChars.indexOf(argString[0]) < 0) { + // for regular arguments, just add them back into the list + newArgStrings.push(argString); + } else { + // replace arguments referencing files with the file content + try { + var argstrs = []; + var filename = argString.slice(1); + var content = fs.readFileSync(filename, 'utf8'); + content = content.trim().split('\n'); + content.forEach(function (argLine) { + self.convertArgLineToArgs(argLine).forEach(function (arg) { + argstrs.push(arg); + }); + argstrs = self._readArgsFromFiles(argstrs); + }); + newArgStrings.push.apply(newArgStrings, argstrs); + } catch (error) { + return self.error(error.message); + } + } + }); + return newArgStrings; +}; + +ArgumentParser.prototype.convertArgLineToArgs = function (argLine) { + return [ argLine ]; +}; + +ArgumentParser.prototype._matchArgument = function (action, regexpArgStrings) { + + // match the pattern for this action to the arg strings + var regexpNargs = new RegExp('^' + this._getNargsPattern(action)); + var matches = regexpArgStrings.match(regexpNargs); + var message; + + // throw an exception if we weren't able to find a match + if (!matches) { + switch (action.nargs) { + /*eslint-disable no-undefined*/ + case undefined: + case null: + message = 'Expected one argument.'; + break; + case c.OPTIONAL: + message = 'Expected at most one argument.'; + break; + case c.ONE_OR_MORE: + message = 'Expected at least one argument.'; + break; + default: + message = 'Expected %s argument(s)'; + } + + throw argumentErrorHelper( + action, + format(message, action.nargs) + ); + } + // return the number of arguments matched + return matches[1].length; +}; + +ArgumentParser.prototype._matchArgumentsPartial = function (actions, regexpArgStrings) { + // progressively shorten the actions list by slicing off the + // final actions until we find a match + var self = this; + var result = []; + var actionSlice, pattern, matches; + var i, j; + + function getLength(string) { + return string.length; + } + + for (i = actions.length; i > 0; i--) { + pattern = ''; + actionSlice = actions.slice(0, i); + for (j = 0; j < actionSlice.length; j++) { + pattern += self._getNargsPattern(actionSlice[j]); + } + + pattern = new RegExp('^' + pattern); + matches = regexpArgStrings.match(pattern); + + if (matches && matches.length > 0) { + // need only groups + matches = matches.splice(1); + result = result.concat(matches.map(getLength)); + break; + } + } + + // return the list of arg string counts + return result; +}; + +ArgumentParser.prototype._parseOptional = function (argString) { + var action, optionString, argExplicit, optionTuples; + + // if it's an empty string, it was meant to be a positional + if (!argString) { + return null; + } + + // if it doesn't start with a prefix, it was meant to be positional + if (this.prefixChars.indexOf(argString[0]) < 0) { + return null; + } + + // if the option string is present in the parser, return the action + if (this._optionStringActions[argString]) { + return [ this._optionStringActions[argString], argString, null ]; + } + + // if it's just a single character, it was meant to be positional + if (argString.length === 1) { + return null; + } + + // if the option string before the "=" is present, return the action + if (argString.indexOf('=') >= 0) { + optionString = argString.split('=', 1)[0]; + argExplicit = argString.slice(optionString.length + 1); + + if (this._optionStringActions[optionString]) { + action = this._optionStringActions[optionString]; + return [ action, optionString, argExplicit ]; + } + } + + // search through all possible prefixes of the option string + // and all actions in the parser for possible interpretations + optionTuples = this._getOptionTuples(argString); + + // if multiple actions match, the option string was ambiguous + if (optionTuples.length > 1) { + var optionStrings = optionTuples.map(function (optionTuple) { + return optionTuple[1]; + }); + this.error(format( + 'Ambiguous option: "%s" could match %s.', + argString, optionStrings.join(', ') + )); + // if exactly one action matched, this segmentation is good, + // so return the parsed action + } else if (optionTuples.length === 1) { + return optionTuples[0]; + } + + // if it was not found as an option, but it looks like a negative + // number, it was meant to be positional + // unless there are negative-number-like options + if (argString.match(this._regexpNegativeNumber)) { + if (!this._hasNegativeNumberOptionals.some(Boolean)) { + return null; + } + } + // if it contains a space, it was meant to be a positional + if (argString.search(' ') >= 0) { + return null; + } + + // it was meant to be an optional but there is no such option + // in this parser (though it might be a valid option in a subparser) + return [ null, argString, null ]; +}; + +ArgumentParser.prototype._getOptionTuples = function (optionString) { + var result = []; + var chars = this.prefixChars; + var optionPrefix; + var argExplicit; + var action; + var actionOptionString; + + // option strings starting with two prefix characters are only split at + // the '=' + if (chars.indexOf(optionString[0]) >= 0 && chars.indexOf(optionString[1]) >= 0) { + if (optionString.indexOf('=') >= 0) { + var optionStringSplit = optionString.split('=', 1); + + optionPrefix = optionStringSplit[0]; + argExplicit = optionStringSplit[1]; + } else { + optionPrefix = optionString; + argExplicit = null; + } + + for (actionOptionString in this._optionStringActions) { + if (actionOptionString.substr(0, optionPrefix.length) === optionPrefix) { + action = this._optionStringActions[actionOptionString]; + result.push([ action, actionOptionString, argExplicit ]); + } + } + + // single character options can be concatenated with their arguments + // but multiple character options always have to have their argument + // separate + } else if (chars.indexOf(optionString[0]) >= 0 && chars.indexOf(optionString[1]) < 0) { + optionPrefix = optionString; + argExplicit = null; + var optionPrefixShort = optionString.substr(0, 2); + var argExplicitShort = optionString.substr(2); + + for (actionOptionString in this._optionStringActions) { + if (!$$.has(this._optionStringActions, actionOptionString)) continue; + + action = this._optionStringActions[actionOptionString]; + if (actionOptionString === optionPrefixShort) { + result.push([ action, actionOptionString, argExplicitShort ]); + } else if (actionOptionString.substr(0, optionPrefix.length) === optionPrefix) { + result.push([ action, actionOptionString, argExplicit ]); + } + } + + // shouldn't ever get here + } else { + throw new Error(format('Unexpected option string: %s.', optionString)); + } + // return the collected option tuples + return result; +}; + +ArgumentParser.prototype._getNargsPattern = function (action) { + // in all examples below, we have to allow for '--' args + // which are represented as '-' in the pattern + var regexpNargs; + + switch (action.nargs) { + // the default (null) is assumed to be a single argument + case undefined: + case null: + regexpNargs = '(-*A-*)'; + break; + // allow zero or more arguments + case c.OPTIONAL: + regexpNargs = '(-*A?-*)'; + break; + // allow zero or more arguments + case c.ZERO_OR_MORE: + regexpNargs = '(-*[A-]*)'; + break; + // allow one or more arguments + case c.ONE_OR_MORE: + regexpNargs = '(-*A[A-]*)'; + break; + // allow any number of options or arguments + case c.REMAINDER: + regexpNargs = '([-AO]*)'; + break; + // allow one argument followed by any number of options or arguments + case c.PARSER: + regexpNargs = '(-*A[-AO]*)'; + break; + // all others should be integers + default: + regexpNargs = '(-*' + $$.repeat('-*A', action.nargs) + '-*)'; + } + + // if this is an optional action, -- is not allowed + if (action.isOptional()) { + regexpNargs = regexpNargs.replace(/-\*/g, ''); + regexpNargs = regexpNargs.replace(/-/g, ''); + } + + // return the pattern + return regexpNargs; +}; + +// +// Value conversion methods +// + +ArgumentParser.prototype._getValues = function (action, argStrings) { + var self = this; + + // for everything but PARSER args, strip out '--' + if (action.nargs !== c.PARSER && action.nargs !== c.REMAINDER) { + argStrings = argStrings.filter(function (arrayElement) { + return arrayElement !== '--'; + }); + } + + var value, argString; + + // optional argument produces a default when not present + if (argStrings.length === 0 && action.nargs === c.OPTIONAL) { + + value = (action.isOptional()) ? action.constant : action.defaultValue; + + if (typeof (value) === 'string') { + value = this._getValue(action, value); + this._checkValue(action, value); + } + + // when nargs='*' on a positional, if there were no command-line + // args, use the default if it is anything other than None + } else if (argStrings.length === 0 && action.nargs === c.ZERO_OR_MORE && + action.optionStrings.length === 0) { + + value = (action.defaultValue || argStrings); + this._checkValue(action, value); + + // single argument or optional argument produces a single value + } else if (argStrings.length === 1 && + (!action.nargs || action.nargs === c.OPTIONAL)) { + + argString = argStrings[0]; + value = this._getValue(action, argString); + this._checkValue(action, value); + + // REMAINDER arguments convert all values, checking none + } else if (action.nargs === c.REMAINDER) { + value = argStrings.map(function (v) { + return self._getValue(action, v); + }); + + // PARSER arguments convert all values, but check only the first + } else if (action.nargs === c.PARSER) { + value = argStrings.map(function (v) { + return self._getValue(action, v); + }); + this._checkValue(action, value[0]); + + // all other types of nargs produce a list + } else { + value = argStrings.map(function (v) { + return self._getValue(action, v); + }); + value.forEach(function (v) { + self._checkValue(action, v); + }); + } + + // return the converted value + return value; +}; + +ArgumentParser.prototype._getValue = function (action, argString) { + var result; + + var typeFunction = this._registryGet('type', action.type, action.type); + if (typeof typeFunction !== 'function') { + var message = format('%s is not callable', typeFunction); + throw argumentErrorHelper(action, message); + } + + // convert the value to the appropriate type + try { + result = typeFunction(argString); + + // ArgumentTypeErrors indicate errors + // If action.type is not a registered string, it is a function + // Try to deduce its name for inclusion in the error message + // Failing that, include the error message it raised. + } catch (e) { + var name = null; + if (typeof action.type === 'string') { + name = action.type; + } else { + name = action.type.name || action.type.displayName || ''; + } + var msg = format('Invalid %s value: %s', name, argString); + if (name === '') { msg += '\n' + e.message; } + throw argumentErrorHelper(action, msg); + } + // return the converted value + return result; +}; + +ArgumentParser.prototype._checkValue = function (action, value) { + // converted value must be one of the choices (if specified) + var choices = action.choices; + if (choices) { + // choise for argument can by array or string + if ((typeof choices === 'string' || Array.isArray(choices)) && + choices.indexOf(value) !== -1) { + return; + } + // choise for subparsers can by only hash + if (typeof choices === 'object' && !Array.isArray(choices) && choices[value]) { + return; + } + + if (typeof choices === 'string') { + choices = choices.split('').join(', '); + } else if (Array.isArray(choices)) { + choices = choices.join(', '); + } else { + choices = Object.keys(choices).join(', '); + } + var message = format('Invalid choice: %s (choose from [%s])', value, choices); + throw argumentErrorHelper(action, message); + } +}; + +// +// Help formatting methods +// + +/** + * ArgumentParser#formatUsage -> string + * + * Return usage string + * + * See also [original guide][1] + * + * [1]:http://docs.python.org/dev/library/argparse.html#printing-help + **/ +ArgumentParser.prototype.formatUsage = function () { + var formatter = this._getFormatter(); + formatter.addUsage(this.usage, this._actions, this._mutuallyExclusiveGroups); + return formatter.formatHelp(); +}; + +/** + * ArgumentParser#formatHelp -> string + * + * Return help + * + * See also [original guide][1] + * + * [1]:http://docs.python.org/dev/library/argparse.html#printing-help + **/ +ArgumentParser.prototype.formatHelp = function () { + var formatter = this._getFormatter(); + + // usage + formatter.addUsage(this.usage, this._actions, this._mutuallyExclusiveGroups); + + // description + formatter.addText(this.description); + + // positionals, optionals and user-defined groups + this._actionGroups.forEach(function (actionGroup) { + formatter.startSection(actionGroup.title); + formatter.addText(actionGroup.description); + formatter.addArguments(actionGroup._groupActions); + formatter.endSection(); + }); + + // epilog + formatter.addText(this.epilog); + + // determine help from format above + return formatter.formatHelp(); +}; + +ArgumentParser.prototype._getFormatter = function () { + var FormatterClass = this.formatterClass; + var formatter = new FormatterClass({ prog: this.prog }); + return formatter; +}; + +// +// Print functions +// + +/** + * ArgumentParser#printUsage() -> Void + * + * Print usage + * + * See also [original guide][1] + * + * [1]:http://docs.python.org/dev/library/argparse.html#printing-help + **/ +ArgumentParser.prototype.printUsage = function () { + this._printMessage(this.formatUsage()); +}; + +/** + * ArgumentParser#printHelp() -> Void + * + * Print help + * + * See also [original guide][1] + * + * [1]:http://docs.python.org/dev/library/argparse.html#printing-help + **/ +ArgumentParser.prototype.printHelp = function () { + this._printMessage(this.formatHelp()); +}; + +ArgumentParser.prototype._printMessage = function (message, stream) { + if (!stream) { + stream = process.stdout; + } + if (message) { + stream.write('' + message); + } +}; + +// +// Exit functions +// + +/** + * ArgumentParser#exit(status=0, message) -> Void + * - status (int): exit status + * - message (string): message + * + * Print message in stderr/stdout and exit program + **/ +ArgumentParser.prototype.exit = function (status, message) { + if (message) { + if (status === 0) { + this._printMessage(message); + } else { + this._printMessage(message, process.stderr); + } + } + + process.exit(status); +}; + +/** + * ArgumentParser#error(message) -> Void + * - err (Error|string): message + * + * Error method Prints a usage message incorporating the message to stderr and + * exits. If you override this in a subclass, + * it should not return -- it should + * either exit or throw an exception. + * + **/ +ArgumentParser.prototype.error = function (err) { + var message; + if (err instanceof Error) { + if (this.debug === true) { + throw err; + } + message = err.message; + } else { + message = err; + } + var msg = format('%s: error: %s', this.prog, message) + c.EOL; + + if (this.debug === true) { + throw new Error(msg); + } + + this.printUsage(process.stderr); + + return this.exit(2, msg); +}; + +module.exports = ArgumentParser; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/const.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/const.js new file mode 100644 index 000000000..b1fd4ced4 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/const.js @@ -0,0 +1,21 @@ +// +// Constants +// + +'use strict'; + +module.exports.EOL = '\n'; + +module.exports.SUPPRESS = '==SUPPRESS=='; + +module.exports.OPTIONAL = '?'; + +module.exports.ZERO_OR_MORE = '*'; + +module.exports.ONE_OR_MORE = '+'; + +module.exports.PARSER = 'A...'; + +module.exports.REMAINDER = '...'; + +module.exports._UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args'; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/help/added_formatters.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/help/added_formatters.js new file mode 100644 index 000000000..f8e42998e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/help/added_formatters.js @@ -0,0 +1,87 @@ +'use strict'; + +var util = require('util'); + +// Constants +var c = require('../const'); + +var $$ = require('../utils'); +var HelpFormatter = require('./formatter.js'); + +/** + * new RawDescriptionHelpFormatter(options) + * new ArgumentParser({formatterClass: argparse.RawDescriptionHelpFormatter, ...}) + * + * Help message formatter which adds default values to argument help. + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + **/ + +function ArgumentDefaultsHelpFormatter(options) { + HelpFormatter.call(this, options); +} + +util.inherits(ArgumentDefaultsHelpFormatter, HelpFormatter); + +ArgumentDefaultsHelpFormatter.prototype._getHelpString = function (action) { + var help = action.help; + if (action.help.indexOf('%(defaultValue)s') === -1) { + if (action.defaultValue !== c.SUPPRESS) { + var defaulting_nargs = [ c.OPTIONAL, c.ZERO_OR_MORE ]; + if (action.isOptional() || (defaulting_nargs.indexOf(action.nargs) >= 0)) { + help += ' (default: %(defaultValue)s)'; + } + } + } + return help; +}; + +module.exports.ArgumentDefaultsHelpFormatter = ArgumentDefaultsHelpFormatter; + +/** + * new RawDescriptionHelpFormatter(options) + * new ArgumentParser({formatterClass: argparse.RawDescriptionHelpFormatter, ...}) + * + * Help message formatter which retains any formatting in descriptions. + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + **/ + +function RawDescriptionHelpFormatter(options) { + HelpFormatter.call(this, options); +} + +util.inherits(RawDescriptionHelpFormatter, HelpFormatter); + +RawDescriptionHelpFormatter.prototype._fillText = function (text, width, indent) { + var lines = text.split('\n'); + lines = lines.map(function (line) { + return $$.trimEnd(indent + line); + }); + return lines.join('\n'); +}; +module.exports.RawDescriptionHelpFormatter = RawDescriptionHelpFormatter; + +/** + * new RawTextHelpFormatter(options) + * new ArgumentParser({formatterClass: argparse.RawTextHelpFormatter, ...}) + * + * Help message formatter which retains formatting of all help text. + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + **/ + +function RawTextHelpFormatter(options) { + RawDescriptionHelpFormatter.call(this, options); +} + +util.inherits(RawTextHelpFormatter, RawDescriptionHelpFormatter); + +RawTextHelpFormatter.prototype._splitLines = function (text) { + return text.split('\n'); +}; + +module.exports.RawTextHelpFormatter = RawTextHelpFormatter; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/help/formatter.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/help/formatter.js new file mode 100644 index 000000000..29036c14b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/help/formatter.js @@ -0,0 +1,795 @@ +/** + * class HelpFormatter + * + * Formatter for generating usage messages and argument help strings. Only the + * name of this class is considered a public API. All the methods provided by + * the class are considered an implementation detail. + * + * Do not call in your code, use this class only for inherits your own forvatter + * + * ToDo add [additonal formatters][1] + * + * [1]:http://docs.python.org/dev/library/argparse.html#formatter-class + **/ +'use strict'; + +var sprintf = require('sprintf-js').sprintf; + +// Constants +var c = require('../const'); + +var $$ = require('../utils'); + + +/*:nodoc:* internal + * new Support(parent, heding) + * - parent (object): parent section + * - heading (string): header string + * + **/ +function Section(parent, heading) { + this._parent = parent; + this._heading = heading; + this._items = []; +} + +/*:nodoc:* internal + * Section#addItem(callback) -> Void + * - callback (array): tuple with function and args + * + * Add function for single element + **/ +Section.prototype.addItem = function (callback) { + this._items.push(callback); +}; + +/*:nodoc:* internal + * Section#formatHelp(formatter) -> string + * - formatter (HelpFormatter): current formatter + * + * Form help section string + * + **/ +Section.prototype.formatHelp = function (formatter) { + var itemHelp, heading; + + // format the indented section + if (this._parent) { + formatter._indent(); + } + + itemHelp = this._items.map(function (item) { + var obj, func, args; + + obj = formatter; + func = item[0]; + args = item[1]; + return func.apply(obj, args); + }); + itemHelp = formatter._joinParts(itemHelp); + + if (this._parent) { + formatter._dedent(); + } + + // return nothing if the section was empty + if (!itemHelp) { + return ''; + } + + // add the heading if the section was non-empty + heading = ''; + if (this._heading && this._heading !== c.SUPPRESS) { + var currentIndent = formatter.currentIndent; + heading = $$.repeat(' ', currentIndent) + this._heading + ':' + c.EOL; + } + + // join the section-initialize newline, the heading and the help + return formatter._joinParts([ c.EOL, heading, itemHelp, c.EOL ]); +}; + +/** + * new HelpFormatter(options) + * + * #### Options: + * - `prog`: program name + * - `indentIncriment`: indent step, default value 2 + * - `maxHelpPosition`: max help position, default value = 24 + * - `width`: line width + * + **/ +var HelpFormatter = module.exports = function HelpFormatter(options) { + options = options || {}; + + this._prog = options.prog; + + this._maxHelpPosition = options.maxHelpPosition || 24; + this._width = (options.width || ((process.env.COLUMNS || 80) - 2)); + + this._currentIndent = 0; + this._indentIncriment = options.indentIncriment || 2; + this._level = 0; + this._actionMaxLength = 0; + + this._rootSection = new Section(null); + this._currentSection = this._rootSection; + + this._whitespaceMatcher = new RegExp('\\s+', 'g'); + this._longBreakMatcher = new RegExp(c.EOL + c.EOL + c.EOL + '+', 'g'); +}; + +HelpFormatter.prototype._indent = function () { + this._currentIndent += this._indentIncriment; + this._level += 1; +}; + +HelpFormatter.prototype._dedent = function () { + this._currentIndent -= this._indentIncriment; + this._level -= 1; + if (this._currentIndent < 0) { + throw new Error('Indent decreased below 0.'); + } +}; + +HelpFormatter.prototype._addItem = function (func, args) { + this._currentSection.addItem([ func, args ]); +}; + +// +// Message building methods +// + +/** + * HelpFormatter#startSection(heading) -> Void + * - heading (string): header string + * + * Start new help section + * + * See alse [code example][1] + * + * ##### Example + * + * formatter.startSection(actionGroup.title); + * formatter.addText(actionGroup.description); + * formatter.addArguments(actionGroup._groupActions); + * formatter.endSection(); + * + **/ +HelpFormatter.prototype.startSection = function (heading) { + this._indent(); + var section = new Section(this._currentSection, heading); + var func = section.formatHelp.bind(section); + this._addItem(func, [ this ]); + this._currentSection = section; +}; + +/** + * HelpFormatter#endSection -> Void + * + * End help section + * + * ##### Example + * + * formatter.startSection(actionGroup.title); + * formatter.addText(actionGroup.description); + * formatter.addArguments(actionGroup._groupActions); + * formatter.endSection(); + **/ +HelpFormatter.prototype.endSection = function () { + this._currentSection = this._currentSection._parent; + this._dedent(); +}; + +/** + * HelpFormatter#addText(text) -> Void + * - text (string): plain text + * + * Add plain text into current section + * + * ##### Example + * + * formatter.startSection(actionGroup.title); + * formatter.addText(actionGroup.description); + * formatter.addArguments(actionGroup._groupActions); + * formatter.endSection(); + * + **/ +HelpFormatter.prototype.addText = function (text) { + if (text && text !== c.SUPPRESS) { + this._addItem(this._formatText, [ text ]); + } +}; + +/** + * HelpFormatter#addUsage(usage, actions, groups, prefix) -> Void + * - usage (string): usage text + * - actions (array): actions list + * - groups (array): groups list + * - prefix (string): usage prefix + * + * Add usage data into current section + * + * ##### Example + * + * formatter.addUsage(this.usage, this._actions, []); + * return formatter.formatHelp(); + * + **/ +HelpFormatter.prototype.addUsage = function (usage, actions, groups, prefix) { + if (usage !== c.SUPPRESS) { + this._addItem(this._formatUsage, [ usage, actions, groups, prefix ]); + } +}; + +/** + * HelpFormatter#addArgument(action) -> Void + * - action (object): action + * + * Add argument into current section + * + * Single variant of [[HelpFormatter#addArguments]] + **/ +HelpFormatter.prototype.addArgument = function (action) { + if (action.help !== c.SUPPRESS) { + var self = this; + + // find all invocations + var invocations = [ this._formatActionInvocation(action) ]; + var invocationLength = invocations[0].length; + + var actionLength; + + if (action._getSubactions) { + this._indent(); + action._getSubactions().forEach(function (subaction) { + + var invocationNew = self._formatActionInvocation(subaction); + invocations.push(invocationNew); + invocationLength = Math.max(invocationLength, invocationNew.length); + + }); + this._dedent(); + } + + // update the maximum item length + actionLength = invocationLength + this._currentIndent; + this._actionMaxLength = Math.max(this._actionMaxLength, actionLength); + + // add the item to the list + this._addItem(this._formatAction, [ action ]); + } +}; + +/** + * HelpFormatter#addArguments(actions) -> Void + * - actions (array): actions list + * + * Mass add arguments into current section + * + * ##### Example + * + * formatter.startSection(actionGroup.title); + * formatter.addText(actionGroup.description); + * formatter.addArguments(actionGroup._groupActions); + * formatter.endSection(); + * + **/ +HelpFormatter.prototype.addArguments = function (actions) { + var self = this; + actions.forEach(function (action) { + self.addArgument(action); + }); +}; + +// +// Help-formatting methods +// + +/** + * HelpFormatter#formatHelp -> string + * + * Format help + * + * ##### Example + * + * formatter.addText(this.epilog); + * return formatter.formatHelp(); + * + **/ +HelpFormatter.prototype.formatHelp = function () { + var help = this._rootSection.formatHelp(this); + if (help) { + help = help.replace(this._longBreakMatcher, c.EOL + c.EOL); + help = $$.trimChars(help, c.EOL) + c.EOL; + } + return help; +}; + +HelpFormatter.prototype._joinParts = function (partStrings) { + return partStrings.filter(function (part) { + return (part && part !== c.SUPPRESS); + }).join(''); +}; + +HelpFormatter.prototype._formatUsage = function (usage, actions, groups, prefix) { + if (!prefix && typeof prefix !== 'string') { + prefix = 'usage: '; + } + + actions = actions || []; + groups = groups || []; + + + // if usage is specified, use that + if (usage) { + usage = sprintf(usage, { prog: this._prog }); + + // if no optionals or positionals are available, usage is just prog + } else if (!usage && actions.length === 0) { + usage = this._prog; + + // if optionals and positionals are available, calculate usage + } else if (!usage) { + var prog = this._prog; + var optionals = []; + var positionals = []; + var actionUsage; + var textWidth; + + // split optionals from positionals + actions.forEach(function (action) { + if (action.isOptional()) { + optionals.push(action); + } else { + positionals.push(action); + } + }); + + // build full usage string + actionUsage = this._formatActionsUsage([].concat(optionals, positionals), groups); + usage = [ prog, actionUsage ].join(' '); + + // wrap the usage parts if it's too long + textWidth = this._width - this._currentIndent; + if ((prefix.length + usage.length) > textWidth) { + + // break usage into wrappable parts + var regexpPart = new RegExp('\\(.*?\\)+|\\[.*?\\]+|\\S+', 'g'); + var optionalUsage = this._formatActionsUsage(optionals, groups); + var positionalUsage = this._formatActionsUsage(positionals, groups); + + + var optionalParts = optionalUsage.match(regexpPart); + var positionalParts = positionalUsage.match(regexpPart) || []; + + if (optionalParts.join(' ') !== optionalUsage) { + throw new Error('assert "optionalParts.join(\' \') === optionalUsage"'); + } + if (positionalParts.join(' ') !== positionalUsage) { + throw new Error('assert "positionalParts.join(\' \') === positionalUsage"'); + } + + // helper for wrapping lines + /*eslint-disable func-style*/ // node 0.10 compat + var _getLines = function (parts, indent, prefix) { + var lines = []; + var line = []; + + var lineLength = prefix ? prefix.length - 1 : indent.length - 1; + + parts.forEach(function (part) { + if (lineLength + 1 + part.length > textWidth) { + lines.push(indent + line.join(' ')); + line = []; + lineLength = indent.length - 1; + } + line.push(part); + lineLength += part.length + 1; + }); + + if (line) { + lines.push(indent + line.join(' ')); + } + if (prefix) { + lines[0] = lines[0].substr(indent.length); + } + return lines; + }; + + var lines, indent, parts; + // if prog is short, follow it with optionals or positionals + if (prefix.length + prog.length <= 0.75 * textWidth) { + indent = $$.repeat(' ', (prefix.length + prog.length + 1)); + if (optionalParts) { + lines = [].concat( + _getLines([ prog ].concat(optionalParts), indent, prefix), + _getLines(positionalParts, indent) + ); + } else if (positionalParts) { + lines = _getLines([ prog ].concat(positionalParts), indent, prefix); + } else { + lines = [ prog ]; + } + + // if prog is long, put it on its own line + } else { + indent = $$.repeat(' ', prefix.length); + parts = optionalParts.concat(positionalParts); + lines = _getLines(parts, indent); + if (lines.length > 1) { + lines = [].concat( + _getLines(optionalParts, indent), + _getLines(positionalParts, indent) + ); + } + lines = [ prog ].concat(lines); + } + // join lines into usage + usage = lines.join(c.EOL); + } + } + + // prefix with 'usage:' + return prefix + usage + c.EOL + c.EOL; +}; + +HelpFormatter.prototype._formatActionsUsage = function (actions, groups) { + // find group indices and identify actions in groups + var groupActions = []; + var inserts = []; + var self = this; + + groups.forEach(function (group) { + var end; + var i; + + var start = actions.indexOf(group._groupActions[0]); + if (start >= 0) { + end = start + group._groupActions.length; + + //if (actions.slice(start, end) === group._groupActions) { + if ($$.arrayEqual(actions.slice(start, end), group._groupActions)) { + group._groupActions.forEach(function (action) { + groupActions.push(action); + }); + + if (!group.required) { + if (inserts[start]) { + inserts[start] += ' ['; + } else { + inserts[start] = '['; + } + inserts[end] = ']'; + } else { + if (inserts[start]) { + inserts[start] += ' ('; + } else { + inserts[start] = '('; + } + inserts[end] = ')'; + } + for (i = start + 1; i < end; i += 1) { + inserts[i] = '|'; + } + } + } + }); + + // collect all actions format strings + var parts = []; + + actions.forEach(function (action, actionIndex) { + var part; + var optionString; + var argsDefault; + var argsString; + + // suppressed arguments are marked with None + // remove | separators for suppressed arguments + if (action.help === c.SUPPRESS) { + parts.push(null); + if (inserts[actionIndex] === '|') { + inserts.splice(actionIndex, actionIndex); + } else if (inserts[actionIndex + 1] === '|') { + inserts.splice(actionIndex + 1, actionIndex + 1); + } + + // produce all arg strings + } else if (!action.isOptional()) { + part = self._formatArgs(action, action.dest); + + // if it's in a group, strip the outer [] + if (groupActions.indexOf(action) >= 0) { + if (part[0] === '[' && part[part.length - 1] === ']') { + part = part.slice(1, -1); + } + } + // add the action string to the list + parts.push(part); + + // produce the first way to invoke the option in brackets + } else { + optionString = action.optionStrings[0]; + + // if the Optional doesn't take a value, format is: -s or --long + if (action.nargs === 0) { + part = '' + optionString; + + // if the Optional takes a value, format is: -s ARGS or --long ARGS + } else { + argsDefault = action.dest.toUpperCase(); + argsString = self._formatArgs(action, argsDefault); + part = optionString + ' ' + argsString; + } + // make it look optional if it's not required or in a group + if (!action.required && groupActions.indexOf(action) < 0) { + part = '[' + part + ']'; + } + // add the action string to the list + parts.push(part); + } + }); + + // insert things at the necessary indices + for (var i = inserts.length - 1; i >= 0; --i) { + if (inserts[i] !== null) { + parts.splice(i, 0, inserts[i]); + } + } + + // join all the action items with spaces + var text = parts.filter(function (part) { + return !!part; + }).join(' '); + + // clean up separators for mutually exclusive groups + text = text.replace(/([\[(]) /g, '$1'); // remove spaces + text = text.replace(/ ([\])])/g, '$1'); + text = text.replace(/\[ *\]/g, ''); // remove empty groups + text = text.replace(/\( *\)/g, ''); + text = text.replace(/\(([^|]*)\)/g, '$1'); // remove () from single action groups + + text = text.trim(); + + // return the text + return text; +}; + +HelpFormatter.prototype._formatText = function (text) { + text = sprintf(text, { prog: this._prog }); + var textWidth = this._width - this._currentIndent; + var indentIncriment = $$.repeat(' ', this._currentIndent); + return this._fillText(text, textWidth, indentIncriment) + c.EOL + c.EOL; +}; + +HelpFormatter.prototype._formatAction = function (action) { + var self = this; + + var helpText; + var helpLines; + var parts; + var indentFirst; + + // determine the required width and the entry label + var helpPosition = Math.min(this._actionMaxLength + 2, this._maxHelpPosition); + var helpWidth = this._width - helpPosition; + var actionWidth = helpPosition - this._currentIndent - 2; + var actionHeader = this._formatActionInvocation(action); + + // no help; start on same line and add a final newline + if (!action.help) { + actionHeader = $$.repeat(' ', this._currentIndent) + actionHeader + c.EOL; + + // short action name; start on the same line and pad two spaces + } else if (actionHeader.length <= actionWidth) { + actionHeader = $$.repeat(' ', this._currentIndent) + + actionHeader + + ' ' + + $$.repeat(' ', actionWidth - actionHeader.length); + indentFirst = 0; + + // long action name; start on the next line + } else { + actionHeader = $$.repeat(' ', this._currentIndent) + actionHeader + c.EOL; + indentFirst = helpPosition; + } + + // collect the pieces of the action help + parts = [ actionHeader ]; + + // if there was help for the action, add lines of help text + if (action.help) { + helpText = this._expandHelp(action); + helpLines = this._splitLines(helpText, helpWidth); + parts.push($$.repeat(' ', indentFirst) + helpLines[0] + c.EOL); + helpLines.slice(1).forEach(function (line) { + parts.push($$.repeat(' ', helpPosition) + line + c.EOL); + }); + + // or add a newline if the description doesn't end with one + } else if (actionHeader.charAt(actionHeader.length - 1) !== c.EOL) { + parts.push(c.EOL); + } + // if there are any sub-actions, add their help as well + if (action._getSubactions) { + this._indent(); + action._getSubactions().forEach(function (subaction) { + parts.push(self._formatAction(subaction)); + }); + this._dedent(); + } + // return a single string + return this._joinParts(parts); +}; + +HelpFormatter.prototype._formatActionInvocation = function (action) { + if (!action.isOptional()) { + var format_func = this._metavarFormatter(action, action.dest); + var metavars = format_func(1); + return metavars[0]; + } + + var parts = []; + var argsDefault; + var argsString; + + // if the Optional doesn't take a value, format is: -s, --long + if (action.nargs === 0) { + parts = parts.concat(action.optionStrings); + + // if the Optional takes a value, format is: -s ARGS, --long ARGS + } else { + argsDefault = action.dest.toUpperCase(); + argsString = this._formatArgs(action, argsDefault); + action.optionStrings.forEach(function (optionString) { + parts.push(optionString + ' ' + argsString); + }); + } + return parts.join(', '); +}; + +HelpFormatter.prototype._metavarFormatter = function (action, metavarDefault) { + var result; + + if (action.metavar || action.metavar === '') { + result = action.metavar; + } else if (action.choices) { + var choices = action.choices; + + if (typeof choices === 'string') { + choices = choices.split('').join(', '); + } else if (Array.isArray(choices)) { + choices = choices.join(','); + } else { + choices = Object.keys(choices).join(','); + } + result = '{' + choices + '}'; + } else { + result = metavarDefault; + } + + return function (size) { + if (Array.isArray(result)) { + return result; + } + + var metavars = []; + for (var i = 0; i < size; i += 1) { + metavars.push(result); + } + return metavars; + }; +}; + +HelpFormatter.prototype._formatArgs = function (action, metavarDefault) { + var result; + var metavars; + + var buildMetavar = this._metavarFormatter(action, metavarDefault); + + switch (action.nargs) { + /*eslint-disable no-undefined*/ + case undefined: + case null: + metavars = buildMetavar(1); + result = '' + metavars[0]; + break; + case c.OPTIONAL: + metavars = buildMetavar(1); + result = '[' + metavars[0] + ']'; + break; + case c.ZERO_OR_MORE: + metavars = buildMetavar(2); + result = '[' + metavars[0] + ' [' + metavars[1] + ' ...]]'; + break; + case c.ONE_OR_MORE: + metavars = buildMetavar(2); + result = '' + metavars[0] + ' [' + metavars[1] + ' ...]'; + break; + case c.REMAINDER: + result = '...'; + break; + case c.PARSER: + metavars = buildMetavar(1); + result = metavars[0] + ' ...'; + break; + default: + metavars = buildMetavar(action.nargs); + result = metavars.join(' '); + } + return result; +}; + +HelpFormatter.prototype._expandHelp = function (action) { + var params = { prog: this._prog }; + + Object.keys(action).forEach(function (actionProperty) { + var actionValue = action[actionProperty]; + + if (actionValue !== c.SUPPRESS) { + params[actionProperty] = actionValue; + } + }); + + if (params.choices) { + if (typeof params.choices === 'string') { + params.choices = params.choices.split('').join(', '); + } else if (Array.isArray(params.choices)) { + params.choices = params.choices.join(', '); + } else { + params.choices = Object.keys(params.choices).join(', '); + } + } + + return sprintf(this._getHelpString(action), params); +}; + +HelpFormatter.prototype._splitLines = function (text, width) { + var lines = []; + var delimiters = [ ' ', '.', ',', '!', '?' ]; + var re = new RegExp('[' + delimiters.join('') + '][^' + delimiters.join('') + ']*$'); + + text = text.replace(/[\n\|\t]/g, ' '); + + text = text.trim(); + text = text.replace(this._whitespaceMatcher, ' '); + + // Wraps the single paragraph in text (a string) so every line + // is at most width characters long. + text.split(c.EOL).forEach(function (line) { + if (width >= line.length) { + lines.push(line); + return; + } + + var wrapStart = 0; + var wrapEnd = width; + var delimiterIndex = 0; + while (wrapEnd <= line.length) { + if (wrapEnd !== line.length && delimiters.indexOf(line[wrapEnd] < -1)) { + delimiterIndex = (re.exec(line.substring(wrapStart, wrapEnd)) || {}).index; + wrapEnd = wrapStart + delimiterIndex + 1; + } + lines.push(line.substring(wrapStart, wrapEnd)); + wrapStart = wrapEnd; + wrapEnd += width; + } + if (wrapStart < line.length) { + lines.push(line.substring(wrapStart, wrapEnd)); + } + }); + + return lines; +}; + +HelpFormatter.prototype._fillText = function (text, width, indent) { + var lines = this._splitLines(text, width); + lines = lines.map(function (line) { + return indent + line; + }); + return lines.join(c.EOL); +}; + +HelpFormatter.prototype._getHelpString = function (action) { + return action.help; +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/namespace.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/namespace.js new file mode 100644 index 000000000..a860de9ec --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/namespace.js @@ -0,0 +1,76 @@ +/** + * class Namespace + * + * Simple object for storing attributes. Implements equality by attribute names + * and values, and provides a simple string representation. + * + * See also [original guide][1] + * + * [1]:http://docs.python.org/dev/library/argparse.html#the-namespace-object + **/ +'use strict'; + +var $$ = require('./utils'); + +/** + * new Namespace(options) + * - options(object): predefined propertis for result object + * + **/ +var Namespace = module.exports = function Namespace(options) { + $$.extend(this, options); +}; + +/** + * Namespace#isset(key) -> Boolean + * - key (string|number): property name + * + * Tells whenever `namespace` contains given `key` or not. + **/ +Namespace.prototype.isset = function (key) { + return $$.has(this, key); +}; + +/** + * Namespace#set(key, value) -> self + * -key (string|number|object): propery name + * -value (mixed): new property value + * + * Set the property named key with value. + * If key object then set all key properties to namespace object + **/ +Namespace.prototype.set = function (key, value) { + if (typeof (key) === 'object') { + $$.extend(this, key); + } else { + this[key] = value; + } + return this; +}; + +/** + * Namespace#get(key, defaultValue) -> mixed + * - key (string|number): property name + * - defaultValue (mixed): default value + * + * Return the property key or defaulValue if not set + **/ +Namespace.prototype.get = function (key, defaultValue) { + return !this[key] ? defaultValue : this[key]; +}; + +/** + * Namespace#unset(key, defaultValue) -> mixed + * - key (string|number): property name + * - defaultValue (mixed): default value + * + * Return data[key](and delete it) or defaultValue + **/ +Namespace.prototype.unset = function (key, defaultValue) { + var value = this[key]; + if (value !== null) { + delete this[key]; + return value; + } + return defaultValue; +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/utils.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/utils.js new file mode 100644 index 000000000..4a9cf3edb --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/lib/utils.js @@ -0,0 +1,57 @@ +'use strict'; + +exports.repeat = function (str, num) { + var result = ''; + for (var i = 0; i < num; i++) { result += str; } + return result; +}; + +exports.arrayEqual = function (a, b) { + if (a.length !== b.length) { return false; } + for (var i = 0; i < a.length; i++) { + if (a[i] !== b[i]) { return false; } + } + return true; +}; + +exports.trimChars = function (str, chars) { + var start = 0; + var end = str.length - 1; + while (chars.indexOf(str.charAt(start)) >= 0) { start++; } + while (chars.indexOf(str.charAt(end)) >= 0) { end--; } + return str.slice(start, end + 1); +}; + +exports.capitalize = function (str) { + return str.charAt(0).toUpperCase() + str.slice(1); +}; + +exports.arrayUnion = function () { + var result = []; + for (var i = 0, values = {}; i < arguments.length; i++) { + var arr = arguments[i]; + for (var j = 0; j < arr.length; j++) { + if (!values[arr[j]]) { + values[arr[j]] = true; + result.push(arr[j]); + } + } + } + return result; +}; + +function has(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} + +exports.has = has; + +exports.extend = function (dest, src) { + for (var i in src) { + if (has(src, i)) { dest[i] = src[i]; } + } +}; + +exports.trimEnd = function (str) { + return str.replace(/\s+$/g, ''); +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/package.json new file mode 100644 index 000000000..6bb96cb71 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/argparse/package.json @@ -0,0 +1,38 @@ +{ + "name": "argparse", + "description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library", + "version": "1.0.10", + "keywords": [ + "cli", + "parser", + "argparse", + "option", + "args" + ], + "contributors": [ + "Eugene Shkuropat", + "Paul Jacobson" + ], + "files": [ + "index.js", + "lib/" + ], + "license": "MIT", + "repository": "nodeca/argparse", + "scripts": { + "test": "make test" + }, + "dependencies": { + "sprintf-js": "~1.0.2" + }, + "devDependencies": { + "eslint": "^2.13.1", + "istanbul": "^0.4.5", + "mocha": "^3.1.0", + "ndoc": "^5.0.1" + } + +,"_resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz" +,"_integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==" +,"_from": "argparse@1.0.10" +} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/LICENSE b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/LICENSE new file mode 100644 index 000000000..c9eca5dd9 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Alex Indigo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/README.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/README.md new file mode 100644 index 000000000..ddcc7e6b9 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/README.md @@ -0,0 +1,233 @@ +# asynckit [![NPM Module](https://img.shields.io/npm/v/asynckit.svg?style=flat)](https://www.npmjs.com/package/asynckit) + +Minimal async jobs utility library, with streams support. + +[![PhantomJS Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=browser&style=flat)](https://travis-ci.org/alexindigo/asynckit) +[![Linux Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=linux:0.12-6.x&style=flat)](https://travis-ci.org/alexindigo/asynckit) +[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/asynckit/v0.4.0.svg?label=windows:0.12-6.x&style=flat)](https://ci.appveyor.com/project/alexindigo/asynckit) + +[![Coverage Status](https://img.shields.io/coveralls/alexindigo/asynckit/v0.4.0.svg?label=code+coverage&style=flat)](https://coveralls.io/github/alexindigo/asynckit?branch=master) +[![Dependency Status](https://img.shields.io/david/alexindigo/asynckit/v0.4.0.svg?style=flat)](https://david-dm.org/alexindigo/asynckit) +[![bitHound Overall Score](https://www.bithound.io/github/alexindigo/asynckit/badges/score.svg)](https://www.bithound.io/github/alexindigo/asynckit) + + + +AsyncKit provides harness for `parallel` and `serial` iterators over list of items represented by arrays or objects. +Optionally it accepts abort function (should be synchronously return by iterator for each item), and terminates left over jobs upon an error event. For specific iteration order built-in (`ascending` and `descending`) and custom sort helpers also supported, via `asynckit.serialOrdered` method. + +It ensures async operations to keep behavior more stable and prevent `Maximum call stack size exceeded` errors, from sync iterators. + +| compression | size | +| :----------------- | -------: | +| asynckit.js | 12.34 kB | +| asynckit.min.js | 4.11 kB | +| asynckit.min.js.gz | 1.47 kB | + + +## Install + +```sh +$ npm install --save asynckit +``` + +## Examples + +### Parallel Jobs + +Runs iterator over provided array in parallel. Stores output in the `result` array, +on the matching positions. In unlikely event of an error from one of the jobs, +will terminate rest of the active jobs (if abort function is provided) +and return error along with salvaged data to the main callback function. + +#### Input Array + +```javascript +var parallel = require('asynckit').parallel + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ] + , target = [] + ; + +parallel(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// async job accepts one element from the array +// and a callback function +function asyncJob(item, cb) +{ + // different delays (in ms) per item + var delay = item * 25; + + // pretend different jobs take different time to finish + // and not in consequential order + var timeoutId = setTimeout(function() { + target.push(item); + cb(null, item * 2); + }, delay); + + // allow to cancel "leftover" jobs upon error + // return function, invoking of which will abort this job + return clearTimeout.bind(null, timeoutId); +} +``` + +More examples could be found in [test/test-parallel-array.js](test/test-parallel-array.js). + +#### Input Object + +Also it supports named jobs, listed via object. + +```javascript +var parallel = require('asynckit/parallel') + , assert = require('assert') + ; + +var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 } + , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 } + , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ] + , expectedKeys = [ 'first', 'one', 'two', 'four', 'eight', 'sixteen', 'thirtyTwo', 'sixtyFour' ] + , target = [] + , keys = [] + ; + +parallel(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); + assert.deepEqual(keys, expectedKeys); +}); + +// supports full value, key, callback (shortcut) interface +function asyncJob(item, key, cb) +{ + // different delays (in ms) per item + var delay = item * 25; + + // pretend different jobs take different time to finish + // and not in consequential order + var timeoutId = setTimeout(function() { + keys.push(key); + target.push(item); + cb(null, item * 2); + }, delay); + + // allow to cancel "leftover" jobs upon error + // return function, invoking of which will abort this job + return clearTimeout.bind(null, timeoutId); +} +``` + +More examples could be found in [test/test-parallel-object.js](test/test-parallel-object.js). + +### Serial Jobs + +Runs iterator over provided array sequentially. Stores output in the `result` array, +on the matching positions. In unlikely event of an error from one of the jobs, +will not proceed to the rest of the items in the list +and return error along with salvaged data to the main callback function. + +#### Input Array + +```javascript +var serial = require('asynckit/serial') + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ] + , target = [] + ; + +serial(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// extended interface (item, key, callback) +// also supported for arrays +function asyncJob(item, key, cb) +{ + target.push(key); + + // it will be automatically made async + // even it iterator "returns" in the same event loop + cb(null, item * 2); +} +``` + +More examples could be found in [test/test-serial-array.js](test/test-serial-array.js). + +#### Input Object + +Also it supports named jobs, listed via object. + +```javascript +var serial = require('asynckit').serial + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ] + , target = [] + ; + +var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 } + , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 } + , expectedTarget = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , target = [] + ; + + +serial(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// shortcut interface (item, callback) +// works for object as well as for the arrays +function asyncJob(item, cb) +{ + target.push(item); + + // it will be automatically made async + // even it iterator "returns" in the same event loop + cb(null, item * 2); +} +``` + +More examples could be found in [test/test-serial-object.js](test/test-serial-object.js). + +_Note: Since _object_ is an _unordered_ collection of properties, +it may produce unexpected results with sequential iterations. +Whenever order of the jobs' execution is important please use `serialOrdered` method._ + +### Ordered Serial Iterations + +TBD + +For example [compare-property](compare-property) package. + +### Streaming interface + +TBD + +## Want to Know More? + +More examples can be found in [test folder](test/). + +Or open an [issue](https://github.com/alexindigo/asynckit/issues) with questions and/or suggestions. + +## License + +AsyncKit is licensed under the MIT license. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/bench.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/bench.js new file mode 100644 index 000000000..c612f1a55 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/bench.js @@ -0,0 +1,76 @@ +/* eslint no-console: "off" */ + +var asynckit = require('./') + , async = require('async') + , assert = require('assert') + , expected = 0 + ; + +var Benchmark = require('benchmark'); +var suite = new Benchmark.Suite; + +var source = []; +for (var z = 1; z < 100; z++) +{ + source.push(z); + expected += z; +} + +suite +// add tests + +.add('async.map', function(deferred) +{ + var total = 0; + + async.map(source, + function(i, cb) + { + setImmediate(function() + { + total += i; + cb(null, total); + }); + }, + function(err, result) + { + assert.ifError(err); + assert.equal(result[result.length - 1], expected); + deferred.resolve(); + }); +}, {'defer': true}) + + +.add('asynckit.parallel', function(deferred) +{ + var total = 0; + + asynckit.parallel(source, + function(i, cb) + { + setImmediate(function() + { + total += i; + cb(null, total); + }); + }, + function(err, result) + { + assert.ifError(err); + assert.equal(result[result.length - 1], expected); + deferred.resolve(); + }); +}, {'defer': true}) + + +// add listeners +.on('cycle', function(ev) +{ + console.log(String(ev.target)); +}) +.on('complete', function() +{ + console.log('Fastest is ' + this.filter('fastest').map('name')); +}) +// run async +.run({ 'async': true }); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/index.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/index.js new file mode 100644 index 000000000..455f9454e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/index.js @@ -0,0 +1,6 @@ +module.exports = +{ + parallel : require('./parallel.js'), + serial : require('./serial.js'), + serialOrdered : require('./serialOrdered.js') +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/abort.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/abort.js new file mode 100644 index 000000000..114367e5f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/abort.js @@ -0,0 +1,29 @@ +// API +module.exports = abort; + +/** + * Aborts leftover active jobs + * + * @param {object} state - current state object + */ +function abort(state) +{ + Object.keys(state.jobs).forEach(clean.bind(state)); + + // reset leftover jobs + state.jobs = {}; +} + +/** + * Cleans up leftover job by invoking abort function for the provided job id + * + * @this state + * @param {string|number} key - job id to abort + */ +function clean(key) +{ + if (typeof this.jobs[key] == 'function') + { + this.jobs[key](); + } +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/async.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/async.js new file mode 100644 index 000000000..7f1288a4c --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/async.js @@ -0,0 +1,34 @@ +var defer = require('./defer.js'); + +// API +module.exports = async; + +/** + * Runs provided callback asynchronously + * even if callback itself is not + * + * @param {function} callback - callback to invoke + * @returns {function} - augmented callback + */ +function async(callback) +{ + var isAsync = false; + + // check if async happened + defer(function() { isAsync = true; }); + + return function async_callback(err, result) + { + if (isAsync) + { + callback(err, result); + } + else + { + defer(function nextTick_callback() + { + callback(err, result); + }); + } + }; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/defer.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/defer.js new file mode 100644 index 000000000..b67110c7a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/defer.js @@ -0,0 +1,26 @@ +module.exports = defer; + +/** + * Runs provided function on next iteration of the event loop + * + * @param {function} fn - function to run + */ +function defer(fn) +{ + var nextTick = typeof setImmediate == 'function' + ? setImmediate + : ( + typeof process == 'object' && typeof process.nextTick == 'function' + ? process.nextTick + : null + ); + + if (nextTick) + { + nextTick(fn); + } + else + { + setTimeout(fn, 0); + } +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/iterate.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/iterate.js new file mode 100644 index 000000000..5d2839a59 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/iterate.js @@ -0,0 +1,75 @@ +var async = require('./async.js') + , abort = require('./abort.js') + ; + +// API +module.exports = iterate; + +/** + * Iterates over each job object + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {object} state - current job status + * @param {function} callback - invoked when all elements processed + */ +function iterate(list, iterator, state, callback) +{ + // store current index + var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; + + state.jobs[key] = runJob(iterator, key, list[key], function(error, output) + { + // don't repeat yourself + // skip secondary callbacks + if (!(key in state.jobs)) + { + return; + } + + // clean up jobs + delete state.jobs[key]; + + if (error) + { + // don't process rest of the results + // stop still active jobs + // and reset the list + abort(state); + } + else + { + state.results[key] = output; + } + + // return salvaged results + callback(error, state.results); + }); +} + +/** + * Runs iterator over provided job element + * + * @param {function} iterator - iterator to invoke + * @param {string|number} key - key/index of the element in the list of jobs + * @param {mixed} item - job description + * @param {function} callback - invoked after iterator is done with the job + * @returns {function|mixed} - job abort function or something else + */ +function runJob(iterator, key, item, callback) +{ + var aborter; + + // allow shortcut if iterator expects only two arguments + if (iterator.length == 2) + { + aborter = iterator(item, async(callback)); + } + // otherwise go with full three arguments + else + { + aborter = iterator(item, key, async(callback)); + } + + return aborter; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/readable_asynckit.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/readable_asynckit.js new file mode 100644 index 000000000..78ad240f0 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/readable_asynckit.js @@ -0,0 +1,91 @@ +var streamify = require('./streamify.js') + , defer = require('./defer.js') + ; + +// API +module.exports = ReadableAsyncKit; + +/** + * Base constructor for all streams + * used to hold properties/methods + */ +function ReadableAsyncKit() +{ + ReadableAsyncKit.super_.apply(this, arguments); + + // list of active jobs + this.jobs = {}; + + // add stream methods + this.destroy = destroy; + this._start = _start; + this._read = _read; +} + +/** + * Destroys readable stream, + * by aborting outstanding jobs + * + * @returns {void} + */ +function destroy() +{ + if (this.destroyed) + { + return; + } + + this.destroyed = true; + + if (typeof this.terminator == 'function') + { + this.terminator(); + } +} + +/** + * Starts provided jobs in async manner + * + * @private + */ +function _start() +{ + // first argument – runner function + var runner = arguments[0] + // take away first argument + , args = Array.prototype.slice.call(arguments, 1) + // second argument - input data + , input = args[0] + // last argument - result callback + , endCb = streamify.callback.call(this, args[args.length - 1]) + ; + + args[args.length - 1] = endCb; + // third argument - iterator + args[1] = streamify.iterator.call(this, args[1]); + + // allow time for proper setup + defer(function() + { + if (!this.destroyed) + { + this.terminator = runner.apply(null, args); + } + else + { + endCb(null, Array.isArray(input) ? [] : {}); + } + }.bind(this)); +} + + +/** + * Implement _read to comply with Readable streams + * Doesn't really make sense for flowing object mode + * + * @private + */ +function _read() +{ + +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/readable_parallel.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/readable_parallel.js new file mode 100644 index 000000000..5d2929f7a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/readable_parallel.js @@ -0,0 +1,25 @@ +var parallel = require('../parallel.js'); + +// API +module.exports = ReadableParallel; + +/** + * Streaming wrapper to `asynckit.parallel` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableParallel(list, iterator, callback) +{ + if (!(this instanceof ReadableParallel)) + { + return new ReadableParallel(list, iterator, callback); + } + + // turn on object mode + ReadableParallel.super_.call(this, {objectMode: true}); + + this._start(parallel, list, iterator, callback); +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/readable_serial.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/readable_serial.js new file mode 100644 index 000000000..782269820 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/readable_serial.js @@ -0,0 +1,25 @@ +var serial = require('../serial.js'); + +// API +module.exports = ReadableSerial; + +/** + * Streaming wrapper to `asynckit.serial` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableSerial(list, iterator, callback) +{ + if (!(this instanceof ReadableSerial)) + { + return new ReadableSerial(list, iterator, callback); + } + + // turn on object mode + ReadableSerial.super_.call(this, {objectMode: true}); + + this._start(serial, list, iterator, callback); +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/readable_serial_ordered.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/readable_serial_ordered.js new file mode 100644 index 000000000..3de89c472 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/readable_serial_ordered.js @@ -0,0 +1,29 @@ +var serialOrdered = require('../serialOrdered.js'); + +// API +module.exports = ReadableSerialOrdered; +// expose sort helpers +module.exports.ascending = serialOrdered.ascending; +module.exports.descending = serialOrdered.descending; + +/** + * Streaming wrapper to `asynckit.serialOrdered` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableSerialOrdered(list, iterator, sortMethod, callback) +{ + if (!(this instanceof ReadableSerialOrdered)) + { + return new ReadableSerialOrdered(list, iterator, sortMethod, callback); + } + + // turn on object mode + ReadableSerialOrdered.super_.call(this, {objectMode: true}); + + this._start(serialOrdered, list, iterator, sortMethod, callback); +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/state.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/state.js new file mode 100644 index 000000000..cbea7ad8f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/state.js @@ -0,0 +1,37 @@ +// API +module.exports = state; + +/** + * Creates initial state object + * for iteration over list + * + * @param {array|object} list - list to iterate over + * @param {function|null} sortMethod - function to use for keys sort, + * or `null` to keep them as is + * @returns {object} - initial state object + */ +function state(list, sortMethod) +{ + var isNamedList = !Array.isArray(list) + , initState = + { + index : 0, + keyedList: isNamedList || sortMethod ? Object.keys(list) : null, + jobs : {}, + results : isNamedList ? {} : [], + size : isNamedList ? Object.keys(list).length : list.length + } + ; + + if (sortMethod) + { + // sort array keys based on it's values + // sort object's keys just on own merit + initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) + { + return sortMethod(list[a], list[b]); + }); + } + + return initState; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/streamify.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/streamify.js new file mode 100644 index 000000000..f56a1c92b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/streamify.js @@ -0,0 +1,141 @@ +var async = require('./async.js'); + +// API +module.exports = { + iterator: wrapIterator, + callback: wrapCallback +}; + +/** + * Wraps iterators with long signature + * + * @this ReadableAsyncKit# + * @param {function} iterator - function to wrap + * @returns {function} - wrapped function + */ +function wrapIterator(iterator) +{ + var stream = this; + + return function(item, key, cb) + { + var aborter + , wrappedCb = async(wrapIteratorCallback.call(stream, cb, key)) + ; + + stream.jobs[key] = wrappedCb; + + // it's either shortcut (item, cb) + if (iterator.length == 2) + { + aborter = iterator(item, wrappedCb); + } + // or long format (item, key, cb) + else + { + aborter = iterator(item, key, wrappedCb); + } + + return aborter; + }; +} + +/** + * Wraps provided callback function + * allowing to execute snitch function before + * real callback + * + * @this ReadableAsyncKit# + * @param {function} callback - function to wrap + * @returns {function} - wrapped function + */ +function wrapCallback(callback) +{ + var stream = this; + + var wrapped = function(error, result) + { + return finisher.call(stream, error, result, callback); + }; + + return wrapped; +} + +/** + * Wraps provided iterator callback function + * makes sure snitch only called once, + * but passes secondary calls to the original callback + * + * @this ReadableAsyncKit# + * @param {function} callback - callback to wrap + * @param {number|string} key - iteration key + * @returns {function} wrapped callback + */ +function wrapIteratorCallback(callback, key) +{ + var stream = this; + + return function(error, output) + { + // don't repeat yourself + if (!(key in stream.jobs)) + { + callback(error, output); + return; + } + + // clean up jobs + delete stream.jobs[key]; + + return streamer.call(stream, error, {key: key, value: output}, callback); + }; +} + +/** + * Stream wrapper for iterator callback + * + * @this ReadableAsyncKit# + * @param {mixed} error - error response + * @param {mixed} output - iterator output + * @param {function} callback - callback that expects iterator results + */ +function streamer(error, output, callback) +{ + if (error && !this.error) + { + this.error = error; + this.pause(); + this.emit('error', error); + // send back value only, as expected + callback(error, output && output.value); + return; + } + + // stream stuff + this.push(output); + + // back to original track + // send back value only, as expected + callback(error, output && output.value); +} + +/** + * Stream wrapper for finishing callback + * + * @this ReadableAsyncKit# + * @param {mixed} error - error response + * @param {mixed} output - iterator output + * @param {function} callback - callback that expects final results + */ +function finisher(error, output, callback) +{ + // signal end of the stream + // only for successfully finished streams + if (!error) + { + this.push(null); + } + + // back to original track + callback(error, output); +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/terminator.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/terminator.js new file mode 100644 index 000000000..d6eb99219 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/lib/terminator.js @@ -0,0 +1,29 @@ +var abort = require('./abort.js') + , async = require('./async.js') + ; + +// API +module.exports = terminator; + +/** + * Terminates jobs in the attached state context + * + * @this AsyncKitState# + * @param {function} callback - final callback to invoke after termination + */ +function terminator(callback) +{ + if (!Object.keys(this.jobs).length) + { + return; + } + + // fast forward iteration index + this.index = this.size; + + // abort jobs + abort(this); + + // send back results we have so far + async(callback)(null, this.results); +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/package.json new file mode 100644 index 000000000..b0adbbd48 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/package.json @@ -0,0 +1,67 @@ +{ + "name": "asynckit", + "version": "0.4.0", + "description": "Minimal async jobs utility library, with streams support", + "main": "index.js", + "scripts": { + "clean": "rimraf coverage", + "lint": "eslint *.js lib/*.js test/*.js", + "test": "istanbul cover --reporter=json tape -- 'test/test-*.js' | tap-spec", + "win-test": "tape test/test-*.js", + "browser": "browserify -t browserify-istanbul test/lib/browserify_adjustment.js test/test-*.js | obake --coverage | tap-spec", + "report": "istanbul report", + "size": "browserify index.js | size-table asynckit", + "debug": "tape test/test-*.js" + }, + "pre-commit": [ + "clean", + "lint", + "test", + "browser", + "report", + "size" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/alexindigo/asynckit.git" + }, + "keywords": [ + "async", + "jobs", + "parallel", + "serial", + "iterator", + "array", + "object", + "stream", + "destroy", + "terminate", + "abort" + ], + "author": "Alex Indigo ", + "license": "MIT", + "bugs": { + "url": "https://github.com/alexindigo/asynckit/issues" + }, + "homepage": "https://github.com/alexindigo/asynckit#readme", + "devDependencies": { + "browserify": "^13.0.0", + "browserify-istanbul": "^2.0.0", + "coveralls": "^2.11.9", + "eslint": "^2.9.0", + "istanbul": "^0.4.3", + "obake": "^0.1.2", + "phantomjs-prebuilt": "^2.1.7", + "pre-commit": "^1.1.3", + "reamde": "^1.1.0", + "rimraf": "^2.5.2", + "size-table": "^0.2.0", + "tap-spec": "^4.1.1", + "tape": "^4.5.1" + }, + "dependencies": {} + +,"_resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" +,"_integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" +,"_from": "asynckit@0.4.0" +} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/parallel.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/parallel.js new file mode 100644 index 000000000..3c50344d8 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/parallel.js @@ -0,0 +1,43 @@ +var iterate = require('./lib/iterate.js') + , initState = require('./lib/state.js') + , terminator = require('./lib/terminator.js') + ; + +// Public API +module.exports = parallel; + +/** + * Runs iterator over provided array elements in parallel + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function parallel(list, iterator, callback) +{ + var state = initState(list); + + while (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, function(error, result) + { + if (error) + { + callback(error, result); + return; + } + + // looks like it's the last one + if (Object.keys(state.jobs).length === 0) + { + callback(null, state.results); + return; + } + }); + + state.index++; + } + + return terminator.bind(state, callback); +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/serial.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/serial.js new file mode 100644 index 000000000..6cd949a67 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/serial.js @@ -0,0 +1,17 @@ +var serialOrdered = require('./serialOrdered.js'); + +// Public API +module.exports = serial; + +/** + * Runs iterator over provided array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serial(list, iterator, callback) +{ + return serialOrdered(list, iterator, null, callback); +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/serialOrdered.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/serialOrdered.js new file mode 100644 index 000000000..607eafea5 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/serialOrdered.js @@ -0,0 +1,75 @@ +var iterate = require('./lib/iterate.js') + , initState = require('./lib/state.js') + , terminator = require('./lib/terminator.js') + ; + +// Public API +module.exports = serialOrdered; +// sorting helpers +module.exports.ascending = ascending; +module.exports.descending = descending; + +/** + * Runs iterator over provided sorted array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serialOrdered(list, iterator, sortMethod, callback) +{ + var state = initState(list, sortMethod); + + iterate(list, iterator, state, function iteratorHandler(error, result) + { + if (error) + { + callback(error, result); + return; + } + + state.index++; + + // are we there yet? + if (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, iteratorHandler); + return; + } + + // done here + callback(null, state.results); + }); + + return terminator.bind(state, callback); +} + +/* + * -- Sort methods + */ + +/** + * sort helper to sort array elements in ascending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function ascending(a, b) +{ + return a < b ? -1 : a > b ? 1 : 0; +} + +/** + * sort helper to sort array elements in descending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function descending(a, b) +{ + return -1 * ascending(a, b); +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/stream.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/stream.js new file mode 100644 index 000000000..d43465f90 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/asynckit/stream.js @@ -0,0 +1,21 @@ +var inherits = require('util').inherits + , Readable = require('stream').Readable + , ReadableAsyncKit = require('./lib/readable_asynckit.js') + , ReadableParallel = require('./lib/readable_parallel.js') + , ReadableSerial = require('./lib/readable_serial.js') + , ReadableSerialOrdered = require('./lib/readable_serial_ordered.js') + ; + +// API +module.exports = +{ + parallel : ReadableParallel, + serial : ReadableSerial, + serialOrdered : ReadableSerialOrdered, +}; + +inherits(ReadableAsyncKit, Readable); + +inherits(ReadableParallel, ReadableAsyncKit); +inherits(ReadableSerial, ReadableAsyncKit); +inherits(ReadableSerialOrdered, ReadableAsyncKit); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/balanced-match/.github/FUNDING.yml b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/balanced-match/.github/FUNDING.yml new file mode 100644 index 000000000..cea8b16e9 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/balanced-match/.github/FUNDING.yml @@ -0,0 +1,2 @@ +tidelift: "npm/balanced-match" +patreon: juliangruber diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/balanced-match/LICENSE.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/balanced-match/LICENSE.md new file mode 100644 index 000000000..2cdc8e414 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/balanced-match/LICENSE.md @@ -0,0 +1,21 @@ +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/balanced-match/README.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/balanced-match/README.md new file mode 100644 index 000000000..d2a48b6b4 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/balanced-match/README.md @@ -0,0 +1,97 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! + +[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) +[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) + +[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) + +## Example + +Get the first matching pair of braces: + +```js +var balanced = require('balanced-match'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); +console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } +``` + +## API + +### var m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +* **start** the index of the first match of `a` +* **end** the index of the matching `b` +* **pre** the preamble, `a` and `b` not included +* **body** the match, `a` and `b` not included +* **post** the postscript, `a` and `b` not included + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. + +### var r = balanced.range(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +array with indexes: `[ , ]`. + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install balanced-match +``` + +## Security contact information + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/balanced-match/index.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/balanced-match/index.js new file mode 100644 index 000000000..c67a64608 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/balanced-match/index.js @@ -0,0 +1,62 @@ +'use strict'; +module.exports = balanced; +function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); + + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} + +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + if(a===b) { + return [ai, bi]; + } + begs = []; + left = str.length; + + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; + } + + if (begs.length) { + result = [ left, right ]; + } + } + + return result; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/balanced-match/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/balanced-match/package.json new file mode 100644 index 000000000..1281bacf3 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/balanced-match/package.json @@ -0,0 +1,76 @@ +{ + "_from": "balanced-match@^1.0.0", + "_id": "balanced-match@1.0.2", + "_inBundle": false, + "_integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "_location": "/balanced-match", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "balanced-match@^1.0.0", + "name": "balanced-match", + "escapedName": "balanced-match", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/brace-expansion" + ], + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "_shasum": "e83e3a7e3f300b34cb9d87f615fa0cbf357690ee", + "_spec": "balanced-match@^1.0.0", + "_where": "/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/brace-expansion", + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/balanced-match/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "devDependencies": { + "matcha": "^0.7.0", + "tape": "^4.6.0" + }, + "homepage": "https://github.com/juliangruber/balanced-match", + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "license": "MIT", + "main": "index.js", + "name": "balanced-match", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "scripts": { + "bench": "matcha test/bench.js", + "test": "tape test/test.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "1.0.2" +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/brace-expansion/LICENSE b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/brace-expansion/LICENSE new file mode 100644 index 000000000..de3226673 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/brace-expansion/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013 Julian Gruber + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/brace-expansion/README.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/brace-expansion/README.md new file mode 100644 index 000000000..6b4e0e164 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/brace-expansion/README.md @@ -0,0 +1,129 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) +[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) + +[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) + +## Example + +```js +var expand = require('brace-expansion'); + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +var expand = require('brace-expansion'); +``` + +### var expanded = expand(str) + +Return an array of all possible and valid expansions of `str`. If none are +found, `[str]` is returned. + +Valid expansions are: + +```js +/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install brace-expansion +``` + +## Contributors + +- [Julian Gruber](https://github.com/juliangruber) +- [Isaac Z. Schlueter](https://github.com/isaacs) + +## Sponsors + +This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! + +Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/brace-expansion/index.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/brace-expansion/index.js new file mode 100644 index 000000000..0478be81e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/brace-expansion/index.js @@ -0,0 +1,201 @@ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} + diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/brace-expansion/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/brace-expansion/package.json new file mode 100644 index 000000000..99f83cd7d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/brace-expansion/package.json @@ -0,0 +1,51 @@ +{ + "name": "brace-expansion", + "description": "Brace expansion as known from sh/bash", + "version": "1.1.11", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "homepage": "https://github.com/juliangruber/brace-expansion", + "main": "index.js", + "scripts": { + "test": "tape test/*.js", + "gentest": "bash test/generate.sh", + "bench": "matcha test/perf/bench.js" + }, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + }, + "devDependencies": { + "matcha": "^0.7.0", + "tape": "^4.6.0" + }, + "keywords": [], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + } + +,"_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" +,"_integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==" +,"_from": "brace-expansion@1.1.11" +} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/chalk/index.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/chalk/index.d.ts new file mode 100644 index 000000000..9cd88f38b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/chalk/index.d.ts @@ -0,0 +1,415 @@ +/** +Basic foreground colors. + +[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) +*/ +declare type ForegroundColor = + | 'black' + | 'red' + | 'green' + | 'yellow' + | 'blue' + | 'magenta' + | 'cyan' + | 'white' + | 'gray' + | 'grey' + | 'blackBright' + | 'redBright' + | 'greenBright' + | 'yellowBright' + | 'blueBright' + | 'magentaBright' + | 'cyanBright' + | 'whiteBright'; + +/** +Basic background colors. + +[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) +*/ +declare type BackgroundColor = + | 'bgBlack' + | 'bgRed' + | 'bgGreen' + | 'bgYellow' + | 'bgBlue' + | 'bgMagenta' + | 'bgCyan' + | 'bgWhite' + | 'bgGray' + | 'bgGrey' + | 'bgBlackBright' + | 'bgRedBright' + | 'bgGreenBright' + | 'bgYellowBright' + | 'bgBlueBright' + | 'bgMagentaBright' + | 'bgCyanBright' + | 'bgWhiteBright'; + +/** +Basic colors. + +[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) +*/ +declare type Color = ForegroundColor | BackgroundColor; + +declare type Modifiers = + | 'reset' + | 'bold' + | 'dim' + | 'italic' + | 'underline' + | 'inverse' + | 'hidden' + | 'strikethrough' + | 'visible'; + +declare namespace chalk { + /** + Levels: + - `0` - All colors disabled. + - `1` - Basic 16 colors support. + - `2` - ANSI 256 colors support. + - `3` - Truecolor 16 million colors support. + */ + type Level = 0 | 1 | 2 | 3; + + interface Options { + /** + Specify the color support for Chalk. + + By default, color support is automatically detected based on the environment. + + Levels: + - `0` - All colors disabled. + - `1` - Basic 16 colors support. + - `2` - ANSI 256 colors support. + - `3` - Truecolor 16 million colors support. + */ + level?: Level; + } + + /** + Return a new Chalk instance. + */ + type Instance = new (options?: Options) => Chalk; + + /** + Detect whether the terminal supports color. + */ + interface ColorSupport { + /** + The color level used by Chalk. + */ + level: Level; + + /** + Return whether Chalk supports basic 16 colors. + */ + hasBasic: boolean; + + /** + Return whether Chalk supports ANSI 256 colors. + */ + has256: boolean; + + /** + Return whether Chalk supports Truecolor 16 million colors. + */ + has16m: boolean; + } + + interface ChalkFunction { + /** + Use a template string. + + @remarks Template literals are unsupported for nested calls (see [issue #341](https://github.com/chalk/chalk/issues/341)) + + @example + ``` + import chalk = require('chalk'); + + log(chalk` + CPU: {red ${cpu.totalPercent}%} + RAM: {green ${ram.used / ram.total * 100}%} + DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} + `); + ``` + + @example + ``` + import chalk = require('chalk'); + + log(chalk.red.bgBlack`2 + 3 = {bold ${2 + 3}}`) + ``` + */ + (text: TemplateStringsArray, ...placeholders: unknown[]): string; + + (...text: unknown[]): string; + } + + interface Chalk extends ChalkFunction { + /** + Return a new Chalk instance. + */ + Instance: Instance; + + /** + The color support for Chalk. + + By default, color support is automatically detected based on the environment. + + Levels: + - `0` - All colors disabled. + - `1` - Basic 16 colors support. + - `2` - ANSI 256 colors support. + - `3` - Truecolor 16 million colors support. + */ + level: Level; + + /** + Use HEX value to set text color. + + @param color - Hexadecimal value representing the desired color. + + @example + ``` + import chalk = require('chalk'); + + chalk.hex('#DEADED'); + ``` + */ + hex(color: string): Chalk; + + /** + Use keyword color value to set text color. + + @param color - Keyword value representing the desired color. + + @example + ``` + import chalk = require('chalk'); + + chalk.keyword('orange'); + ``` + */ + keyword(color: string): Chalk; + + /** + Use RGB values to set text color. + */ + rgb(red: number, green: number, blue: number): Chalk; + + /** + Use HSL values to set text color. + */ + hsl(hue: number, saturation: number, lightness: number): Chalk; + + /** + Use HSV values to set text color. + */ + hsv(hue: number, saturation: number, value: number): Chalk; + + /** + Use HWB values to set text color. + */ + hwb(hue: number, whiteness: number, blackness: number): Chalk; + + /** + Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set text color. + + 30 <= code && code < 38 || 90 <= code && code < 98 + For example, 31 for red, 91 for redBright. + */ + ansi(code: number): Chalk; + + /** + Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. + */ + ansi256(index: number): Chalk; + + /** + Use HEX value to set background color. + + @param color - Hexadecimal value representing the desired color. + + @example + ``` + import chalk = require('chalk'); + + chalk.bgHex('#DEADED'); + ``` + */ + bgHex(color: string): Chalk; + + /** + Use keyword color value to set background color. + + @param color - Keyword value representing the desired color. + + @example + ``` + import chalk = require('chalk'); + + chalk.bgKeyword('orange'); + ``` + */ + bgKeyword(color: string): Chalk; + + /** + Use RGB values to set background color. + */ + bgRgb(red: number, green: number, blue: number): Chalk; + + /** + Use HSL values to set background color. + */ + bgHsl(hue: number, saturation: number, lightness: number): Chalk; + + /** + Use HSV values to set background color. + */ + bgHsv(hue: number, saturation: number, value: number): Chalk; + + /** + Use HWB values to set background color. + */ + bgHwb(hue: number, whiteness: number, blackness: number): Chalk; + + /** + Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set background color. + + 30 <= code && code < 38 || 90 <= code && code < 98 + For example, 31 for red, 91 for redBright. + Use the foreground code, not the background code (for example, not 41, nor 101). + */ + bgAnsi(code: number): Chalk; + + /** + Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color. + */ + bgAnsi256(index: number): Chalk; + + /** + Modifier: Resets the current color chain. + */ + readonly reset: Chalk; + + /** + Modifier: Make text bold. + */ + readonly bold: Chalk; + + /** + Modifier: Emitting only a small amount of light. + */ + readonly dim: Chalk; + + /** + Modifier: Make text italic. (Not widely supported) + */ + readonly italic: Chalk; + + /** + Modifier: Make text underline. (Not widely supported) + */ + readonly underline: Chalk; + + /** + Modifier: Inverse background and foreground colors. + */ + readonly inverse: Chalk; + + /** + Modifier: Prints the text, but makes it invisible. + */ + readonly hidden: Chalk; + + /** + Modifier: Puts a horizontal line through the center of the text. (Not widely supported) + */ + readonly strikethrough: Chalk; + + /** + Modifier: Prints the text only when Chalk has a color support level > 0. + Can be useful for things that are purely cosmetic. + */ + readonly visible: Chalk; + + readonly black: Chalk; + readonly red: Chalk; + readonly green: Chalk; + readonly yellow: Chalk; + readonly blue: Chalk; + readonly magenta: Chalk; + readonly cyan: Chalk; + readonly white: Chalk; + + /* + Alias for `blackBright`. + */ + readonly gray: Chalk; + + /* + Alias for `blackBright`. + */ + readonly grey: Chalk; + + readonly blackBright: Chalk; + readonly redBright: Chalk; + readonly greenBright: Chalk; + readonly yellowBright: Chalk; + readonly blueBright: Chalk; + readonly magentaBright: Chalk; + readonly cyanBright: Chalk; + readonly whiteBright: Chalk; + + readonly bgBlack: Chalk; + readonly bgRed: Chalk; + readonly bgGreen: Chalk; + readonly bgYellow: Chalk; + readonly bgBlue: Chalk; + readonly bgMagenta: Chalk; + readonly bgCyan: Chalk; + readonly bgWhite: Chalk; + + /* + Alias for `bgBlackBright`. + */ + readonly bgGray: Chalk; + + /* + Alias for `bgBlackBright`. + */ + readonly bgGrey: Chalk; + + readonly bgBlackBright: Chalk; + readonly bgRedBright: Chalk; + readonly bgGreenBright: Chalk; + readonly bgYellowBright: Chalk; + readonly bgBlueBright: Chalk; + readonly bgMagentaBright: Chalk; + readonly bgCyanBright: Chalk; + readonly bgWhiteBright: Chalk; + } +} + +/** +Main Chalk object that allows to chain styles together. +Call the last one as a method with a string argument. +Order doesn't matter, and later styles take precedent in case of a conflict. +This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`. +*/ +declare const chalk: chalk.Chalk & chalk.ChalkFunction & { + supportsColor: chalk.ColorSupport | false; + Level: chalk.Level; + Color: Color; + ForegroundColor: ForegroundColor; + BackgroundColor: BackgroundColor; + Modifiers: Modifiers; + stderr: chalk.Chalk & {supportsColor: chalk.ColorSupport | false}; +}; + +export = chalk; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/chalk/license b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/chalk/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/chalk/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/chalk/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/chalk/package.json new file mode 100644 index 000000000..639fda1cd --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/chalk/package.json @@ -0,0 +1,103 @@ +{ + "_args": [ + [ + "chalk@4.1.1", + "/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning" + ] + ], + "_from": "chalk@4.1.1", + "_id": "chalk@4.1.1", + "_inBundle": false, + "_integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "_location": "/chalk", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "chalk@4.1.1", + "name": "chalk", + "escapedName": "chalk", + "rawSpec": "4.1.1", + "saveSpec": null, + "fetchSpec": "4.1.1" + }, + "_requiredBy": [ + "/@tensorflow/tfjs" + ], + "_resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", + "_spec": "4.1.1", + "_where": "/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning", + "bugs": { + "url": "https://github.com/chalk/chalk/issues" + }, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "description": "Terminal string styling done right", + "devDependencies": { + "ava": "^2.4.0", + "coveralls": "^3.0.7", + "execa": "^4.0.0", + "import-fresh": "^3.1.0", + "matcha": "^0.7.0", + "nyc": "^15.0.0", + "resolve-from": "^5.0.0", + "tsd": "^0.7.4", + "xo": "^0.28.2" + }, + "engines": { + "node": ">=10" + }, + "files": [ + "source", + "index.d.ts" + ], + "funding": "https://github.com/chalk/chalk?sponsor=1", + "homepage": "https://github.com/chalk/chalk#readme", + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "str", + "ansi", + "style", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "main": "source", + "name": "chalk", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/chalk.git" + }, + "scripts": { + "bench": "matcha benchmark.js", + "test": "xo && nyc ava && tsd" + }, + "version": "4.1.1", + "xo": { + "rules": { + "unicorn/prefer-string-slice": "off", + "unicorn/prefer-includes": "off", + "@typescript-eslint/member-ordering": "off", + "no-redeclare": "off", + "unicorn/string-content": "off", + "unicorn/better-regex": "off" + } + } +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/chalk/readme.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/chalk/readme.md new file mode 100644 index 000000000..851259216 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/chalk/readme.md @@ -0,0 +1,335 @@ +

+
+
+ Chalk +
+
+
+

+ +> Terminal string styling done right + +[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![npm dependents](https://badgen.net/npm/dependents/chalk)](https://www.npmjs.com/package/chalk?activeTab=dependents) [![Downloads](https://badgen.net/npm/dt/chalk)](https://www.npmjs.com/package/chalk) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) ![TypeScript-ready](https://img.shields.io/npm/types/chalk.svg) [![run on repl.it](https://repl.it/badge/github/chalk/chalk)](https://repl.it/github/chalk/chalk) + + + +
+ +--- + +
+ +--- + +
+ +## Highlights + +- Expressive API +- Highly performant +- Ability to nest styles +- [256/Truecolor color support](#256-and-truecolor-color-support) +- Auto-detects color support +- Doesn't extend `String.prototype` +- Clean and focused +- Actively maintained +- [Used by ~50,000 packages](https://www.npmjs.com/browse/depended/chalk) as of January 1, 2020 + +## Install + +```console +$ npm install chalk +``` + +## Usage + +```js +const chalk = require('chalk'); + +console.log(chalk.blue('Hello world!')); +``` + +Chalk comes with an easy to use composable API where you just chain and nest the styles you want. + +```js +const chalk = require('chalk'); +const log = console.log; + +// Combine styled and normal strings +log(chalk.blue('Hello') + ' World' + chalk.red('!')); + +// Compose multiple styles using the chainable API +log(chalk.blue.bgRed.bold('Hello world!')); + +// Pass in multiple arguments +log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz')); + +// Nest styles +log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!')); + +// Nest styles of the same type even (color, underline, background) +log(chalk.green( + 'I am a green line ' + + chalk.blue.underline.bold('with a blue substring') + + ' that becomes green again!' +)); + +// ES2015 template literal +log(` +CPU: ${chalk.red('90%')} +RAM: ${chalk.green('40%')} +DISK: ${chalk.yellow('70%')} +`); + +// ES2015 tagged template literal +log(chalk` +CPU: {red ${cpu.totalPercent}%} +RAM: {green ${ram.used / ram.total * 100}%} +DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} +`); + +// Use RGB colors in terminal emulators that support it. +log(chalk.keyword('orange')('Yay for orange colored text!')); +log(chalk.rgb(123, 45, 67).underline('Underlined reddish color')); +log(chalk.hex('#DEADED').bold('Bold gray!')); +``` + +Easily define your own themes: + +```js +const chalk = require('chalk'); + +const error = chalk.bold.red; +const warning = chalk.keyword('orange'); + +console.log(error('Error!')); +console.log(warning('Warning!')); +``` + +Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args): + +```js +const name = 'Sindre'; +console.log(chalk.green('Hello %s'), name); +//=> 'Hello Sindre' +``` + +## API + +### chalk.`