<commit_before># Copyright 2016 <NAME> <<EMAIL>>
#
# 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.
"""
Contains functions and classes for remote visualization.
"""
import logging
import urlparse
from requests import Session, ConnectionError, HTTPError, Timeout

import virtualizer4 as Virtualizer
from escape import CONFIG, __version__
from escape.adapt import LAYER_NAME as ADAPT
from escape.orchest import LAYER_NAME as ORCHEST
from escape.service import LAYER_NAME as SERVICE
from escape.util.conversion import NFFGConverter
from escape.util.misc import Singleton
from escape.util.nffg import NFFG
from pox.core import core


class RemoteVisualizer(Session):
  """
  Main object for remote Visualization.
  """
  # Singleton
  __metaclass__ = Singleton
  # name form POXCore
  _core_name = "visualizer"

  # Bindings of Layer IDs
  ID_MAPPER = {
    SERVICE: "ESCAPE-SERVICE",
    ORCHEST: "ESCAPE-ORCHESTRATION",
    ADAPT: "ESCAPE-ADAPTATION"
  }

  # Basic HTTP headers
  basic_headers = {
    'User-Agent': "ESCAPE/" + __version__,
    'Content-Type': "application/xml"}

  # Default timeout value in sec
  DEFAULT_TIMEOUT = 3

  def __init__ (self, url=None, rpc=None, timeout=DEFAULT_TIMEOUT,
                instance_id=None):<commit_msg>Change visualization timeout to 1 s<commit_after># Copyright 2016 <NAME> <<EMAIL>>
#
# 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.
"""
Contains functions and classes for remote visualization.
"""
import logging
import urlparse
from requests import Session, ConnectionError, HTTPError, Timeout

import virtualizer4 as Virtualizer
from escape import CONFIG, __version__
from escape.adapt import LAYER_NAME as ADAPT
from escape.orchest import LAYER_NAME as ORCHEST
from escape.service import LAYER_NAME as SERVICE
from escape.util.conversion import NFFGConverter
from escape.util.misc import Singleton
from escape.util.nffg import NFFG
from pox.core import core


class RemoteVisualizer(Session):
  """
  Main object for remote Visualization.
  """
  # Singleton
  __metaclass__ = Singleton
  # name form POXCore
  _core_name = "visualizer"

  # Bindings of Layer IDs
  ID_MAPPER = {
    SERVICE: "ESCAPE-SERVICE",
    ORCHEST: "ESCAPE-ORCHESTRATION",
    ADAPT: "ESCAPE-ADAPTATION"
  }

  # Basic HTTP headers
  basic_headers = {
    'User-Agent': "ESCAPE/" + __version__,
    'Content-Type': "application/xml"}

  # Default timeout value in sec
  DEFAULT_TIMEOUT = 1

  def __init__ (self, url=None, rpc=None, timeout=DEFAULT_TIMEOUT,
                instance_id=None):
{'fraction_non_alphanumeric': 0.07705479452054795, 'fraction_numerical': 0.0059931506849315065, 'mean_word_length': 4.326747720364741, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '2120965', 'n_tokens_mistral': 1052, 'n_tokens_neox': 1015, 'n_words': 390}