optimize imports

pull/1/head
Bobloy 7 years ago
parent 1cde856661
commit a7bc72493e

@ -1,5 +1,4 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import sys
""" """

@ -25,7 +25,6 @@ class Statement(StatementMixin):
""" """
def __init__(self, text, **kwargs): def __init__(self, text, **kwargs):
import sys
# Try not to allow non-string types to be passed to statements # Try not to allow non-string types to be passed to statements
try: try:

@ -1,11 +1,12 @@
from chatter.chatterbot.constants import TAG_NAME_MAX_LENGTH, STATEMENT_TEXT_MAX_LENGTH
from chatter.chatterbot.conversation import StatementMixin
from chatter.chatterbot.ext.sqlalchemy_app.types import UnicodeString
from sqlalchemy import Table, Column, Integer, DateTime, ForeignKey, PickleType from sqlalchemy import Table, Column, Integer, DateTime, ForeignKey, PickleType
from sqlalchemy.ext.declarative import declared_attr, declarative_base from sqlalchemy.ext.declarative import declared_attr, declarative_base
from sqlalchemy.orm import relationship from sqlalchemy.orm import relationship
from sqlalchemy.sql import func from sqlalchemy.sql import func
from chatter.chatterbot.constants import TAG_NAME_MAX_LENGTH, STATEMENT_TEXT_MAX_LENGTH
from chatter.chatterbot.conversation import StatementMixin
from chatter.chatterbot.ext.sqlalchemy_app.types import UnicodeString
class ModelBase(object): class ModelBase(object):
""" """

@ -12,8 +12,6 @@ class VariableInputTypeAdapter(InputAdapter):
VALID_FORMATS = (JSON, TEXT, OBJECT, ) VALID_FORMATS = (JSON, TEXT, OBJECT, )
def detect_type(self, statement): def detect_type(self, statement):
import sys
string_types = str string_types = str

@ -1,7 +1,6 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from chatter.chatterbot.conversation import Statement from chatter.chatterbot.conversation import Statement
from .best_match import BestMatch from .best_match import BestMatch

@ -3,7 +3,6 @@ from __future__ import unicode_literals
from collections import Counter from collections import Counter
from chatter.chatterbot import utils from chatter.chatterbot import utils
from .logic_adapter import LogicAdapter from .logic_adapter import LogicAdapter

@ -27,7 +27,6 @@ def unescape_html(chatbot, statement):
Convert escaped html characters into unescaped html characters. Convert escaped html characters into unescaped html characters.
For example: "&lt;b&gt;" becomes "<b>". For example: "&lt;b&gt;" becomes "<b>".
""" """
import sys
# Replace HTML escape characters # Replace HTML escape characters
import html import html
@ -43,8 +42,6 @@ def convert_to_ascii(chatbot, statement):
For example: "på fédéral" becomes "pa federal". For example: "på fédéral" becomes "pa federal".
""" """
import unicodedata import unicodedata
import sys
text = unicodedata.normalize('NFKD', statement.text) text = unicodedata.normalize('NFKD', statement.text)
text = text.encode('ascii', 'ignore').decode('utf-8') text = text.encode('ascii', 'ignore').decode('utf-8')

@ -75,8 +75,6 @@ def input_function():
Normalizes reading input between python 2 and 3. Normalizes reading input between python 2 and 3.
The function 'raw_input' becomes 'input' in Python 3. The function 'raw_input' becomes 'input' in Python 3.
""" """
import sys
user_input = input() # NOQA user_input = input() # NOQA

Loading…
Cancel
Save