Searches the corresponding code
        :param search: The code part to be searched
433636
def search_db(self, search):
        

        def search_callback(_, address, balance):
            """

            :param _:
            :param address: The address of the contract with the code in search
            :param balance: The balance of the corresponding contract
            """
            print("Address: " + address + ", balance: " + str(balance))

        try:
            self.leveldb.search(search, search_callback)

        except SyntaxError:
            raise CriticalError("Syntax error in search expression.")
1312650
async def search(self, regex):
        
        coro = self._loop.run_in_executor(None, self._search, regex)
        match = await coro

        return match
127776
def generate_search_space(code_dir):
    
    search_space = {}
    
    if code_dir.endswith(slash):
        code_dir = code_dir[:-1]

    for subdir, _, files in os.walk(code_dir):
        # generate module name from path
        if subdir == code_dir:
            package = ''
        else:
            assert subdir.startswith(code_dir + slash), subdir
            prefix_len = len(code_dir) + 1
            package = subdir[prefix_len:].replace(slash, '.') + '.'

        for file_name in files:
            if file_name.endswith('.py'):
                path = os.path.join(subdir, file_name)
                module = package + file_name[:-3]
                search_space.update(_generate_file_search_space(path, module))

    return search_space
290761
def _do_search(self):
        
        if self._results_cache is None:
            response = self.raw()
            results = self.to_python(response.get('hits', {}).get('hits', []))
            self._results_cache = DictSearchResults(
                self.type, response, results, None)
        return self._results_cache
829315
def filter(self, search):
        
        if not self._filters:
            return search

        post_filter = MatchAll()
        for f in itervalues(self._filters):
            post_filter &= f
        return search.post_filter(post_filter)
461775
def datascan(self, search: str):
        
        url_path = "/api/datascan/{search}".format(search=search)
        return self._request(path=url_path)
1315190
def binary_search(data, target, lo=0, hi=None):
    
    hi = hi if hi is not None else len(data)
    mid = (lo + hi) // 2
    if hi < 2 or hi > len(data) or target > data[-1] or target < data[0]:
        return -1
    if data[mid] > target:
        return binary_search(data, target, lo=lo, hi=mid)
    elif data[mid] < target:
        return binary_search(data, target, lo=(mid + 1), hi=hi)
    elif data[mid] == target:
        return mid
942755
def search_string(self):
        "
        self.__normalize()

        # Get the template
        tmpl_source = unicode(open(self.tmpl_file).read())

        # Process template
        compiler = Compiler()
        template = compiler.compile(tmpl_source)
        out = template(self)
        if not out:
            return False
        out = ''.join(out)

        #
        # Cleanup output and remove all extra space
        #

        # remove extra spaces
        out = re.sub('\n', '', out)
        out = re.sub('\s{3,}', ' ', out)

        # Remove hanging commas i.e: [1, 2,]
        out = re.sub(',\s*([}\\]])', '\\1', out)

        # Space between brackets i.e: ],  [
        out = re.sub('([{\\[}\\]])(,?)\s*([{\\[}\\]])', '\\1\\2\\3', out)

        # Cleanup spaces around [, {, }, ], : and , characters
        out = re.sub('\s*([{\\[\\]}:,])\s*', '\\1', out)

        return out
192439
def search(query, files, mode='sentence', regex=False):
    ''''''
    out = []
    sentences = convert_timestamps(files)

    if mode == 'fragment':
        out = fragment_search(query, sentences, regex)
    elif mode == 'word':
        out = word_search(query, sentences, regex)
    elif mode == 'franken':
        out = franken_sentence(query, files)
    else:
        out = sentence_search(query, sentences, regex)


    return out
1090989
def search(self, regex, flags=0):
        
        return self._generate_test(
            lambda value: re.search(regex, value, flags),
            ('search', self._path, regex)
        )
1266790
def search(self, keyword, source_in=None, **kwargs):
        
        for provider in self._providers:
            if source_in is not None:
                if provider.identifier not in source_in:
                    continue

            try:
                result = provider.search(keyword=keyword)
            except Exception as e:
                logger.exception(str(e))
                logger.error('Search %s in %s failed.' % (keyword, provider))
            else:
                yield result
420512
def search(self, q):
        
        results = self._api.search(q=q)

        return results
646138
def search_by_code(pattern)
      self.class.new(
        select do |emoji|
          pattern === emoji.code || emoji.aliases.any? do |alias_code|
            pattern === alias_code
          end
        end
      )
    end
942497
def search(self, keyword, children=None, arg=None):
        
        if children is None:
            children = self.substmts
        return [ ch for ch in children
                 if (ch.keyword == keyword and
                     (arg is None or ch.arg == arg))]
111810
def compile_search(pattern, flags=0, **kwargs):
    """"""

    return _regex.compile(_apply_search_backrefs(pattern, flags), flags, **kwargs)
943126
def sort(self, search):
        
        if self._sort:
            search = search.sort(*self._sort)
        return search
645891
def filter_search(self, search):
        
        builder = QueryBuilder(
            self.filtering_fields,
            self.filtering_map,
            self
        )
        search, unmatched = builder.build(search, self.get_query_params())

        # Ensure that no unsupported arguments were used.
        for argument in self.get_always_allowed_arguments():
            unmatched.pop(argument, None)

        if unmatched:
            msg = 'Unsupported parameter(s): {}. Please use a combination of: {}.'.format(
                ', '.join(unmatched),
                ', '.join(self.filtering_fields),
            )
            raise ParseError(msg)

        return search