:param eopatch: Input EOPatch.
        :type eopatch: EOPatch
        :return: Transformed eo patch
        :rtype: EOPatch
11440
def execute(self, eopatch):
        
        feature_type, feature_name = next(self.feature(eopatch))

        good_idxs = self._get_filtered_indices(eopatch[feature_type][feature_name] if feature_name is not ... else
                                               eopatch[feature_type])

        for feature_type, feature_name in self.filter_features(eopatch):
            if feature_type.is_time_dependent():
                if feature_type.has_dict():
                    if feature_type.contains_ndarrays():
                        eopatch[feature_type][feature_name] = np.asarray([eopatch[feature_type][feature_name][idx] for
                                                                          idx in good_idxs])
                    # else:
                    #     NotImplemented
                else:
                    eopatch[feature_type] = [eopatch[feature_type][idx] for idx in good_idxs]

        self._update_other_data(eopatch)

        return eopatch
671623
def _process_transform(self, data, transform, step_size):
    '''
    
    '''
    if isinstance(transform, (list,tuple,set)):
      return { t : self._transform(data,t,step_size) for t in transform }
    elif isinstance(transform, dict):
      return { tn : self._transform(data,tf,step_size) for tn,tf in transform.items() }
    return self._transform(data,transform,step_size)
1347643
def patched_function(self, *args, **kwargs):
        
        result = self.function(*args, **kwargs)
        self.validate(result)
        return result
1154088
def execute(self, eopatch):
        
        # pylint: disable=too-many-locals
        feature_type, feature_name, new_feature_name = next(self.feature(eopatch))

        # Make a copy not to change original numpy array
        feature_data = eopatch[feature_type][feature_name].copy()
        time_num, height, width, band_num = feature_data.shape
        if time_num <= 1:
            raise ValueError('Feature {} has time dimension of size {}, required at least size '
                             '2'.format((feature_type, feature_name), time_num))

        # Apply a mask on data
        if self.mask_feature is not None:
            for mask_type, mask_name in self.mask_feature(eopatch):
                negated_mask = ~eopatch[mask_type][mask_name].astype(np.bool)
                feature_data = self._mask_feature_data(feature_data, negated_mask, mask_type)

        # Flatten array
        feature_data = np.reshape(feature_data, (time_num, height * width * band_num))

        # If resampling create new EOPatch
        new_eopatch = EOPatch() if self.resample_range else eopatch

        # Resample times
        times = eopatch.time_series(scale_time=self.scale_time)
        new_eopatch.timestamp = self.get_resampled_timestamp(eopatch.timestamp)
        total_diff = int((new_eopatch.timestamp[0].date() - eopatch.timestamp[0].date()).total_seconds())
        resampled_times = new_eopatch.time_series(scale_time=self.scale_time) + total_diff // self.scale_time

        # Add BBox to eopatch if it was created anew
        if new_eopatch.bbox is None:
            new_eopatch.bbox = eopatch.bbox

        # Replace duplicate acquisitions which have same values on the chosen time scale with their average
        feature_data, times = self._get_unique_times(feature_data, times)

        # Interpolate
        feature_data = self.interpolate_data(feature_data, times, resampled_times)

        # Normalize
        if self.result_interval:
            min_val, max_val = self.result_interval
            valid_mask = ~np.isnan(feature_data)
            feature_data[valid_mask] = np.maximum(np.minimum(feature_data[valid_mask], max_val), min_val)

        # Replace unknown value
        if not np.isnan(self.unknown_value):
            feature_data[np.isnan(feature_data)] = self.unknown_value

        # Reshape back
        new_eopatch[feature_type][new_feature_name] = np.reshape(feature_data,
                                                                 (feature_data.shape[0], height, width, band_num))

        # append features from old patch
        new_eopatch = self._copy_old_features(new_eopatch, eopatch, self.copy_features)

        return new_eopatch
1272168
def getTransform(self):
        
        if "transform" in self.info.keys():
            T = self.info["transform"]
            return T
        else:
            T = self.GetMatrix()
            tr = vtk.vtkTransform()
            tr.SetMatrix(T)
            return tr
173778
def execute(self, eopatch):
        
        feature_type, feature_name, new_feature_name = next(self.feature(eopatch))
        mask_feature_type, mask_feature_name = next(self.mask_feature(eopatch))

        data = np.copy(eopatch[feature_type][feature_name])
        mask = eopatch[mask_feature_type][mask_feature_name]

        if not isinstance(self.mask_values, list):
            raise ValueError('Incorrect format or values of argument `mask_values`')

        for value in self.mask_values:
            data[mask.squeeze() == value] = self.no_data_value

        eopatch.add_feature(feature_type, new_feature_name, data)

        return eopatch
641791
def with_eos(self) -> 'TranslatorInput':
        
        return TranslatorInput(sentence_id=self.sentence_id,
                               tokens=self.tokens + [C.EOS_SYMBOL],
                               factors=[factor + [C.EOS_SYMBOL] for factor in
                                        self.factors] if self.factors is not None else None,
                               restrict_lexicon=self.restrict_lexicon,
                               constraints=self.constraints,
                               avoid_list=self.avoid_list,
                               pass_through_dict=self.pass_through_dict)
1346131
def p_union_patch(self, p):
        """"""
        p[0] = AstUnionPatch(
            path=self.path,
            lineno=p[2][1],
            lexpos=p[2][2],
            name=p[3],
            fields=p[6],
            examples=p[7],
            closed=p[2][0] == 'union_closed')
625403
function transform(el, context) {
    ebayUIAttributeTransformer(el, context);

    const builder = context.builder;
    const iconAttribute = el.getAttribute('icon');
    const iconName = iconAttribute && iconAttribute.value.value;
    if (iconName) {
        const iconTag = context.createNodeForEl('ebay-icon', [
            {
                name: 'name',
                value: builder.literal(iconName)
            },
            {
                name: 'type',
                value: builder.literal('inline')
            }
        ]);
        const menuIconTag = context.createNodeForEl('ebay-infotip:icon');
        menuIconTag.appendChild(iconTag);
        el.prependChild(menuIconTag);
    }
}
543557
def csvpatch_cmd(input_csv, input=None, output=None, strict=True):
    
    patch_stream = (sys.stdin
                    if input is None
                    else open(input))
    tocsv_stream = (sys.stdout
                    if output is None
                    else open(output, 'w'))
    fromcsv_stream = open(input_csv)

    try:
        patch_file(patch_stream, fromcsv_stream, tocsv_stream, strict=strict)

    except patch.InvalidPatchError as e:
        error.abort('reading patch, {0}'.format(e.args[0]))

    finally:
        patch_stream.close()
        fromcsv_stream.close()
        tocsv_stream.close()
64357
def transformMesh(self, transformation):
        
        if isinstance(transformation, vtk.vtkMatrix4x4):
            tr = vtk.vtkTransform()
            tr.SetMatrix(transformation)
            transformation = tr

        tf = vtk.vtkTransformPolyDataFilter()

        tf.SetTransform(transformation)
        tf.SetInputData(self.polydata())
        tf.Update()
        self.PokeMatrix(vtk.vtkMatrix4x4())  # identity
        return self.updateMesh(tf.GetOutput())
582623
def _execute_handling(self, *eopatches, **kwargs):
        
        self.private_task_config.start_time = datetime.datetime.now()

        caught_exception = None
        try:
            return_value = self.execute(*eopatches, **kwargs)
        except BaseException as exception:
            caught_exception = exception, sys.exc_info()[2]

        if caught_exception is not None:  # Exception is not raised in except statement to prevent duplicated traceback
            exception, traceback = caught_exception
            raise type(exception)('During execution of task {}: {}'.format(self.__class__.__name__,
                                                                           exception)).with_traceback(traceback)

        self.private_task_config.end_time = datetime.datetime.now()
        return return_value
239374
private PatchingResult applyPatch(final String patchId, final Patch patch, final IdentityPatchContext context) throws PatchingException, IOException, XMLStreamException {

        final Identity identity = patch.getIdentity();
        final Patch.PatchType patchType = identity.getPatchType();
        final InstallationManager.InstallationModification modification = context.getModification();
        if (patchType == Patch.PatchType.CUMULATIVE) {
            // Invalidate all installed patches (one-off, cumulative) - we never need to invalidate the release base
            final List<String> invalidation = new ArrayList<String>(modification.getPatchIDs());
            if (!invalidation.isEmpty()) {
                try {
                    // Before rolling back the one-off patches, validate that the state until that point is consistent
                    validateRollbackState(invalidation.get(invalidation.size() - 1),
                            modification.getUnmodifiedInstallationState());
                } catch (PatchingException e) {
                    throw e;
                } catch (Exception e) {
                    throw new PatchingException(e);
                }
                // Invalidate the installed patches first
                for (final String rollback : invalidation) {
                    rollback(rollback, context);
                }
            }
        }

        // Add to installed patches list
        modification.addInstalledPatch(patchId);

        // Then apply the current patch
        for (final PatchElement element : patch.getElements()) {
            // Apply the content modifications
            final IdentityPatchContext.PatchEntry target = context.resolveForElement(element);
            final PatchElementProvider provider = element.getProvider();
            final Patch.PatchType elementPatchType = provider.getPatchType();
            final String elementPatchId = element.getId();
            // See if we can skip this element
            if (target.isApplied(elementPatchId)) {
                // TODO if it is already applied, we can just skip the entry (maybe based ont the type of the patch)
                // This needs some further testing, maybe we need to compare our history with the patch if they are consistent
                throw PatchLogger.ROOT_LOGGER.alreadyApplied(elementPatchId);
            }
            // Check upgrade conditions
            checkUpgradeConditions(provider, target);
            apply(elementPatchId, element.getModifications(), target);
            target.apply(elementPatchId, elementPatchType);
        }
        // Apply the patch to the identity
        final IdentityPatchContext.PatchEntry identityEntry = context.getIdentityEntry();
        apply(patchId, patch.getModifications(), identityEntry);
        identityEntry.apply(patchId, patchType);

        // Port forward missing module changes
        if (patchType == Patch.PatchType.CUMULATIVE) {
            portForward(patch, context);
        }

        // We need the resulting version for rollback
        if (patchType == Patch.PatchType.CUMULATIVE) {
            final Identity.IdentityUpgrade upgrade = identity.forType(Patch.PatchType.CUMULATIVE, Identity.IdentityUpgrade.class);
            identityEntry.setResultingVersion(upgrade.getResultingVersion());
        }

        // Execute the tasks
        final IdentityApplyCallback callback = new IdentityApplyCallback(patch, identityEntry.getDirectoryStructure());
        try {
            return executeTasks(context, callback);
        } catch (Exception e) {
            context.cancel(callback);
            throw rethrowException(e);
        }
    }
386553
def copy_patches(ptches0):
        
        if not isinstance(ptches0, list):
            ptches0 = list(ptches0)
        copyed_ptches = []
        for pt in ptches0:
            pth = pt.get_path().deepcopy()
            ptch = patches.PathPatch(pth,
                                     lw=pt.get_lw(),
                                     fc=pt.get_fc(),
                                     ec=pt.get_ec(),
                                     alpha=pt.get_alpha())
            copyed_ptches.append(ptch)
        return copyed_ptches
1006828
def monkeypatch():
    
    np.array = array
    np.arange = arange
    np.linspace = linspace
    np.logspace = logspace
    np.geomspace = geomspace
    np.full = full
    np.full_like = full_like
    np.zeros = zeros
    np.zeros_like = zeros_like
    np.ones = ones
    np.ones_like = ones_like
    np.eye = eye
1221520
def _get_features(self, eopatch=None):
        
        for feature_type, feature_dict in self.feature_collection.items():
            if feature_type is None and self.default_feature_type is not None:
                feature_type = self.default_feature_type

            if feature_type is None:
                for feature_name, new_feature_name in feature_dict.items():
                    if eopatch is None:
                        yield self._return_feature(..., feature_name, new_feature_name)
                    else:
                        found_feature_type = self._find_feature_type(feature_name, eopatch)
                        if found_feature_type:
                            yield self._return_feature(found_feature_type, feature_name, new_feature_name)
                        else:
                            raise ValueError("Feature with name '{}' does not exist among features of allowed feature"
                                             " types in given EOPatch. Allowed feature types are "
                                             "{}".format(feature_name, self.allowed_feature_types))
            elif feature_dict is ...:
                if not feature_type.has_dict() or eopatch is None:
                    yield self._return_feature(feature_type, ...)
                else:
                    for feature_name in eopatch[feature_type]:
                        yield self._return_feature(feature_type, feature_name)
            else:
                for feature_name, new_feature_name in feature_dict.items():
                    if eopatch is not None and feature_name not in eopatch[feature_type]:
                        raise ValueError('Feature {} of type {} was not found in EOPatch'.format(feature_name,
                                                                                                 feature_type))
                    yield self._return_feature(feature_type, feature_name, new_feature_name)
640563
function monkeyPatch() {
	var script = function() {
		window.__karma__ = true;
		(function patch() {
			if (typeof window.__bs === 'undefined') {
				window.setTimeout(patch, 500);
			} else {
				var oldCanSync = window.__bs.prototype.canSync;
				window.__bs.prototype.canSync = function(data, optPath) {
					data.url = window.location.pathname.substr(0, window.location.pathname.indexOf('/www')) + data.url.substr(data.url.indexOf('/www'))
					return oldCanSync.apply(this, [data, optPath]);
				};
			}
		}());
	};
	return '<script>(' + script.toString() + '());</script>';
}