anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: jina-ai/jina
Issue: the argument order and the arguments mismatch in search_lines

**Describe the bug**
the argument order in `input_lines` is

```python
def input_lines(lines: Iterator[str] = None, filepath: str = None, size: int = None, sampling_rate: float = None,
                read_mode='r'):
```
while the usage in the `search_lines` function is as following,

```python
self._get_client(**kwargs).search(input_lines(filepath, lines, size, sampling_rate, read_mode), output_fn)
```



**Describe how you solve it**
reorder the arguments

---

<!-- Optional, but really help us locate the problem faster -->

**Environment**
<!-- Run `jina --version-full` and copy paste the output here -->

**Screenshots**
<!-- If applicable, add screenshots to help explain your problem. -->

Changed files:
jina/flow/__init__.py

diff --git a/jina/flow/__init__.py b/jina/flow/__init__.py
index 7933957b6ab..424564c366f 100644
--- a/jina/flow/__init__.py
+++ b/jina/flow/__init__.py
@@ -668,7 +668,7 @@ class Flow:
         :param kwargs: accepts all keyword arguments of `jina client` CLI
         """
         from ..clients.python.io import input_lines
-        self._get_client(**kwargs).search(input_lines(filepath, lines, size, sampling_rate, read_mode), output_fn)
+        self._get_client(**kwargs).search(input_lines(lines, filepath, size, sampling_rate, read_mode), output_fn)
 
     @deprecated_alias(buffer='input_fn', callback='output_fn')
     def index(self, input_fn: Union[Iterator['jina_pb2.Document'], Iterator[bytes], Callable] = None,
Repository: jina-ai/jina
Issue: The docs in Sentencizer is not self-explained.\\

**Describe the bug**
https://github.com/jina-ai/jina/issues/395#issuecomment-625773716

**Describe how you solve it**
make the statement clearer.

---

<!-- Optional, but really help us locate the problem faster -->

**Environment**
<!-- Run `jina --version-full` and copy paste the output here -->

**Screenshots**
<!-- If applicable, add screenshots to help explain your problem. -->

Changed files:
jina/executors/crafters/nlp/split.py

diff --git a/jina/executors/crafters/nlp/split.py b/jina/executors/crafters/nlp/split.py
index f3c4ce0a81b..f4387bf172b 100644
--- a/jina/executors/crafters/nlp/split.py
+++ b/jina/executors/crafters/nlp/split.py
@@ -10,26 +10,31 @@ from .. import BaseSegmenter
 class Sentencizer(BaseSegmenter):
     """
     :class:`Sentencizer` split the text on the doc-level into sentences on the chunk-level with a rule-base strategy.
+        The text are splitted on the the punctuation characters that are listed in ``punct_chars``. The sentences that
+        are shorter than the ``min_sent_len`` or longer than the ``max_sent_len`` after stripping will be discarded.
     """
 
     def __init__(self,
                  min_sent_len: int = 1,
-                 max_sent_len: int = -1,
+                 max_sent_len: int = 1e5,
                  punct_chars: str = None,
                  *args, **kwargs):
         """
 
-        :param min_sent_len: the minimal length of the sentence.
-        :param max_sent_len: the maximal length of the sentence.
+        :param min_sent_len: the minimal number of characters (including white spaces) of the sentence, by default 1.
+        :param max_sent_len: the maximal number of characters (including white spaces) of the sentence, by default 1e5.
         :param punct_chars: the punctuation characters to split on.
         """
         super().__init__(*args, **kwargs)
         self.min_sent_len = min_sent_len
-        self.max_sent_len = max_sent_len if max_sent_len > 0 else 1e5
+        self.max_sent_len = max_sent_len
         self.punct_chars = punct_chars
         if not punct_chars:
             self.punct_chars = ['!', '.', '?', '։', '؟', '۔', '܀', '܁', '܂', '‼', '‽', '⁇', '⁈', '⁉', '⸮', '﹖', '﹗',
                                 '！', '．', '？', '｡', '。']
+        if self.min_sent_len < self.max_sent_len:
+            self.logger.warning('the min_sent_len (={}) should be smaller or equal to the max_sent_len (={})'.format(
+                self.min_sent_len, self.max_sent_len))
         self._slit_pat = re.compile('([{0}])+([^{0}])'.format(''.join(self.punct_chars)))
 
     def craft(self, raw_bytes: bytes, doc_id: int, *args, **kwargs) -> List[Dict]:
Repository: jina-ai/jina
Issue: passing port_grpc in search function leads to a TypeError  

**Describe the bug**
check the bug at [issue-34](https://github.com/jina-ai/examples/issues/34)

**Describe how you solve it**
avoid passing `port_grpc` as a keyword argument because the `**kwargs` has already included it.

---

<!-- Optional, but really help us locate the problem faster -->

**Environment**
<!-- Run `jina --version-full` and copy paste the output here -->

**Screenshots**
<!-- If applicable, add screenshots to help explain your problem. -->

Changed files:
jina/flow/__init__.py, jina/executors/__init__.py

diff --git a/jina/executors/__init__.py b/jina/executors/__init__.py
index 5bbe321eda0..a862009ee4c 100644
--- a/jina/executors/__init__.py
+++ b/jina/executors/__init__.py
@@ -21,6 +21,9 @@ from ..helper import yaml, PathImporter, expand_dict, expand_env_var, valid_yaml
 from ..logging.base import get_logger
 from ..logging.profile import TimeContext
 
+if False:
+    from ..drivers import BaseDriver
+
 __all__ = ['BaseExecutor', 'AnyExecutor', 'ExecutorType']
 
 AnyExecutor = TypeVar('AnyExecutor', bound='BaseExecutor')
diff --git a/jina/flow/__init__.py b/jina/flow/__init__.py
index 327a6b62e1d..7ef43c4b90b 100644
--- a/jina/flow/__init__.py
+++ b/jina/flow/__init__.py
@@ -519,7 +519,11 @@ class Flow:
     def _get_client(self, **kwargs):
         kwargs.update(self._common_kwargs)
         from ..clients import py_client
-        return py_client(port_grpc=self.port_grpc, host=self.host, **kwargs)
+        if 'port_grpc' not in kwargs:
+            kwargs['port_grpc'] = self.port_grpc
+        if 'host' not in kwargs:
+            kwargs['host'] = self.host
+        return py_client(**kwargs)
 
     @deprecated_alias(raw_bytes='input_fn', callback='output_fn')
     def train(self, input_fn: Union[Iterator['jina_pb2.Document'], Iterator[bytes], Callable] = None,
Repository: jina-ai/jina
Issue: NGTIndexer should be inherited from BaseNumpyIndexer

**Describe the bug**
In the [PR-599](https://github.com/jina-ai/jina/pull/599), we've refactored `NumpyIndexer` so that the user can switch between different Indexers during query. `NGTIndexer` needs to be adapted accordingly.

**Describe how you solve it**

```
class NGTIndexer(BaseNumpyIndexer):
```

---

<!-- Optional, but really help us locate the problem faster -->

**Environment**
<!-- Run `jina --version-full` and copy paste the output here -->

**Screenshots**
<!-- If applicable, add screenshots to help explain your problem. -->

Changed files:
jina/executors/indexers/vector/ngt.py

diff --git a/jina/executors/indexers/vector/ngt.py b/jina/executors/indexers/vector/ngt.py
index ea4e1f1e7c7..d3347d7a251 100644
--- a/jina/executors/indexers/vector/ngt.py
+++ b/jina/executors/indexers/vector/ngt.py
@@ -4,10 +4,10 @@ __license__ = "Apache-2.0"
 from typing import Tuple
 
 import numpy as np
-from .numpy import NumpyIndexer
+from .numpy import BaseNumpyIndexer
 
 
-class NGTIndexer(NumpyIndexer):
+class NGTIndexer(BaseNumpyIndexer):
     """NGT powered vector indexer
 
     For more information about the NGT supported parameters and installation problems, please consult:
@@ -34,11 +34,8 @@ class NGTIndexer(NumpyIndexer):
         self.num_threads = num_threads
         self.epsilon = epsilon
 
-    def get_query_handler(self):
-        """Index all vectors , if already indexed return NGT Index handle """
-
+    def build_advanced_index(self, vecs: 'np.ndarray'):
         import ngtpy
-        vecs = super().get_query_handler()
         if vecs is not None:
             ngtpy.create(path=self.index_path, dimension=self.num_dim, distance_type=self.metric)
             _index = ngtpy.Index(self.index_path)
@@ -62,4 +59,4 @@ class NGTIndexer(NumpyIndexer):
             idx.append(index_k)
             dist.append(distance_k)
 
-        return self.int2ext_key[np.array(idx)], np.array(dist)
\\ No newline at end of file
+        return self.int2ext_key[np.array(idx)], np.array(dist)
Repository: jina-ai/jina
Issue: transformers is broken due to pr-406

**Describe the bug**
Not every model with `cls_token` has the `extra_output` in the outputs.

**Describe how you solve it**
add a checkpoint to check if a valid `extra_output` is returned.

---

<!-- Optional, but really help us locate the problem faster -->

**Environment**
<!-- Run `jina --version-full` and copy paste the output here -->

**Screenshots**
<!-- If applicable, add screenshots to help explain your problem. -->

Changed files:
jina/executors/encoders/nlp/transformer.py

diff --git a/jina/executors/encoders/nlp/transformer.py b/jina/executors/encoders/nlp/transformer.py
index 0305a74c397..33367f0162b 100644
--- a/jina/executors/encoders/nlp/transformer.py
+++ b/jina/executors/encoders/nlp/transformer.py
@@ -65,7 +65,7 @@ class BaseTransformerEncoder(BaseEncoder):
             _mask_ids_batch = self.tensor2array(mask_ids_batch)
             _seq_output = self.tensor2array(seq_output)
             if self.pooling_strategy == 'cls':
-                if hasattr(self._tokenizer, 'cls_token'):
+                if hasattr(self._tokenizer, 'cls_token') and len(extra_output) > 0:
                     output = self.tensor2array(extra_output[0])
                 else:
                     output = reduce_cls(_seq_output, _mask_ids_batch, self.cls_pos)