<commit_before>import React from 'react';
import PropTypes from 'prop-types';

import * as events from '../util/events';
import { getProp, isControlledProp } from '../util/props';
import { withParentContext } from '../Context';
import withYMaps from '../withYMaps';
import applyRef from '../util/ref';

export class ObjectManager extends React.Component {
  constructor() {
    super();
    this.state = { instance: null };
  }

  componentDidMount() {
    const instance = ObjectManager.mountObject(
      this.props.ymaps.ObjectManager,
      this.props
    );

    this.setState({ instance });
  }

  componentDidUpdate(prevProps) {
    if (this.state.instance !== null) {
      ObjectManager.updateObject(this.state.instance, prevProps, this.props);
    }
  }

  componentWillUnmount() {
    ObjectManager.unmountObject(this.state.instance, this.props);
  }

  render() {
    return null;
  }

  static mountObject(ObjectManager, props) {
    const { instanceRef, parent, _events } = events.separateEvents(props);

    const options = getProp(props, 'options');
    const features = getProp(props, 'features');
    const filter = getProp(props, 'filter');
    const objects = getProp(props, 'objects');
    const clusters = getProp(props, 'clusters');

    const instance = new ObjectManager(options);

    instance.add(features || []);
<commit_msg>added default values for props<commit_after>import React from 'react';
import PropTypes from 'prop-types';

import * as events from '../util/events';
import { getProp, isControlledProp } from '../util/props';
import { withParentContext } from '../Context';
import withYMaps from '../withYMaps';
import applyRef from '../util/ref';

export class ObjectManager extends React.Component {
  constructor() {
    super();
    this.state = { instance: null };
  }

  componentDidMount() {
    const instance = ObjectManager.mountObject(
      this.props.ymaps.ObjectManager,
      this.props
    );

    this.setState({ instance });
  }

  componentDidUpdate(prevProps) {
    if (this.state.instance !== null) {
      ObjectManager.updateObject(this.state.instance, prevProps, this.props);
    }
  }

  componentWillUnmount() {
    ObjectManager.unmountObject(this.state.instance, this.props);
  }

  render() {
    return null;
  }

  static mountObject(ObjectManager, props) {
    const { instanceRef, parent, _events } = events.separateEvents(props);

    const options = getProp(props, 'options', {});
    const features = getProp(props, 'features', {});
    const filter = getProp(props, 'filter', null);
    const objects = getProp(props, 'objects', {});
    const clusters = getProp(props, 'clusters', {});

    const instance = new ObjectManager(options);

    instance.add(features || []);

{'fraction_non_alphanumeric': 0.13806921675774134, 'fraction_numerical': 0.0, 'mean_word_length': 3.6700680272108843, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1768322', 'n_tokens_mistral': 799, 'n_tokens_neox': 780, 'n_words': 193}