<commit_before># Copyright (c) 2016 Dataman Cloud
# 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.

from omegaclient.client import HTTPClient
from omegaclient.project import ProjectMixin
from omegaclient.app import AppMixin
from omegaclient.cluster import ClusterMixin
from omegaclient.logs import LogMixin


class OmegaClient(ProjectMixin, AppMixin, ClusterMixin, LogMixin):
    """
    Client for user to use Dataman Cloud.
    """

    def __init__(self, server_url, email, password):

        self.http = HTTPClient(server_url, email, password)

        super(OmegaClient, self).__init__()

    @staticmethod
    def process_data(resp):
        """Processing data response from Omega API."""

        data = resp.json()

        if 'data' in data:
            return data['data']

        return data<commit_msg>feature: added alert and metric api refrences<commit_after># Copyright (c) 2016 Dataman Cloud
# 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.

from omegaclient.client import HTTPClient
from omegaclient.project import ProjectMixin
from omegaclient.app import AppMixin
from omegaclient.cluster import ClusterMixin
from omegaclient.logs import LogMixin
from omegaclient.alert import AlertMixin
from omegaclient.metrics import MetricsMixin


class OmegaClient(ProjectMixin, AppMixin, ClusterMixin, LogMixin, AlertMixin,
                  MetricsMixin):
    """
    Client for user to use Dataman Cloud.
    """

    def __init__(self, server_url, email, password):

        self.http = HTTPClient(server_url, email, password)

        super(OmegaClient, self).__init__()

    @staticmethod
    def process_data(resp):
        """Processing data response from Omega API."""

        data = resp.json()

        if 'data' in data:
            return data['data']

        return data
{'fraction_non_alphanumeric': 0.07231833910034602, 'fraction_numerical': 0.005536332179930796, 'mean_word_length': 3.3473684210526318, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '401627', 'n_tokens_mistral': 801, 'n_tokens_neox': 767, 'n_words': 313}