<commit_before><?php
namespace Rxnet\RabbitMq;

use Bunny\Channel;
use Bunny\Message;
use Rx\Observable;
use Rxnet\Serializer\Serializer;
use Underscore\Types\Arrays;

class RabbitMessage
{
    protected $channel;
    protected $serializer;
    protected $message;
    protected $trait;

    protected $routingKey;
    protected $data;
    protected $labels = [];

    /**
     * RabbitMessage constructor.
     * @param Channel $channel
     * @param Message $message
     * @param Serializer $serializer
     */
    public function __construct(Channel $channel, Message $message, Serializer $serializer)
    {
        $this->channel = $channel;
        $this->message = $message;
        $this->serializer = $serializer;

        $this->data = $serializer->unserialize($message->content);
        $this->routingKey = $message->routingKey;
        $this->labels = $message->headers;
        $this->labels['retried'] = $message->deliveryTag;
        $this->labels['exchange'] = $message->exchange;

    }

    /**
     * @return string
     */
    public function getRoutingKey()
    {
        return $this->routingKey;
    }

    /**
     * @return mixed
     */
    public function getData()
    {
        return $this->data;
    }

    /**
     * @return array
     */
    public function getLabels()
    {
        return $this->labels;
    }

    /**
     * @return Observable
     */
    public function ack()
    {<commit_msg>add getLabel method for rabbitMessage<commit_after><?php
namespace Rxnet\RabbitMq;

use Bunny\Channel;
use Bunny\Message;
use Rx\Observable;
use Rxnet\Serializer\Serializer;
use Underscore\Types\Arrays;

class RabbitMessage
{
    protected $channel;
    protected $serializer;
    protected $message;
    protected $trait;

    protected $routingKey;
    protected $data;
    protected $labels = [];

    /**
     * RabbitMessage constructor.
     * @param Channel $channel
     * @param Message $message
     * @param Serializer $serializer
     */
    public function __construct(Channel $channel, Message $message, Serializer $serializer)
    {
        $this->channel = $channel;
        $this->message = $message;
        $this->serializer = $serializer;

        $this->data = $serializer->unserialize($message->content);
        $this->routingKey = $message->routingKey;
        $this->labels = $message->headers;
        $this->labels['retried'] = $message->deliveryTag;
        $this->labels['exchange'] = $message->exchange;

    }

    /**
     * @return string
     */
    public function getRoutingKey()
    {
        return $this->routingKey;
    }

    /**
     * @return mixed
     */
    public function getData()
    {
        return $this->data;
    }

    /**
     * @return array
     */
    public function getLabels()
    {
        return $this->labels;
    }

    /**
     * @param $label
     * @param null $default
     * @return mixed
     */
    public function getLabel($label, $default = null)
    {
        return Arrays::get($this->labels, $label, $default);
    }

    /**
     * @return Observable
     */
    public function ack()
    {
{'fraction_non_alphanumeric': 0.13185041908446163, 'fraction_numerical': 0.0, 'mean_word_length': 2.311632870864461, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 38, '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': '4135468', 'n_tokens_mistral': 926, 'n_tokens_neox': 907, 'n_words': 200}