original_string: public static function fromObjects($array, $key) {
          $elements = array();
          foreach ($array as $element) {
              $result = call_user_func(array($element, $key));
              $elements = array_merge($elements, is_array($result) ? $result : array($result));
          }
          return new self($elements);
      }
code: public static function fromObjects($array, $key) {
          $elements = array();
          foreach ($array as $element) {
              $result = call_user_func(array($element, $key));
              $elements = array_merge($elements, is_array($result) ? $result : array($result));
          }
          return new self($elements);
      }
code_tokens: public static function fromObjects ( $ array , $ key ) { $ elements = array ( ) ; foreach ( $ array as $ element ) { $ result = call_user_func ( array ( $ element , $ key ) ) ; $ elements = array_merge ( $ elements , is_array ( $ result ) ? $ result : array ( $ result ) ) ; } return new self ( $ elements ) ; }
docstring: Creates a partition from a set of objects.
  @param array $array
  @param callable $key
  @return Partition
docstring_tokens: Creates a partition from a set of objects .