Find the first TextView that contains value or by index.
 @param value [String, Integer] the value to find.
 If int then the TextView at that index is returned.
 @return [TextView]
421123
def text(value)
      return ele_index TEXT_VIEW, value if value.is_a? Numeric

      complex_find_contains TEXT_VIEW, value
    end
935283
def button(value)
      # Don't use ele_index because that only works on one element type.
      # Android needs to combine button and image button to match iOS.
      if value.is_a? Numeric
        index = value
        raise "#{index} is not a valid index. Must be >= 1" if index <= 0

        # 1 indexed
        return find_element :uiautomator, _button_visible_selectors(index: index)
      end

      find_element :uiautomator, _button_contains_string(value)
    end
169835
@SuppressWarnings("unchecked") // we know that return value type is a child of view, and V is bound to a child of view.
    public static <V extends View> V findViewById(Activity activity, int id) {
        return (V) activity.findViewById(id);
    }
1061906
def index(self, value):
        

        for i, x in enumerate(self):
            if x == value:
                return i

        raise ValueError("{} is not in list".format(value))
1223263
def findViewWithAttributeOrRaise(self, attr, val, root="ROOT"):
        '''
        
        '''

        view = self.findViewWithAttribute(attr, val, root)
        if view:
            return view
        else:
            raise ViewNotFoundException(attr, val, root)
381940
def _find(string, sub_string, start_index):
    
    result = string.find(sub_string, start_index)
    if result == -1:
        raise TokenError("expected '{0}'".format(sub_string))
    return result
1201053
def textfield(value)
      if value.is_a? Numeric
        index = value
        raise "#{index} is not a valid index. Must be >= 1" if index <= 0

        index -= 1 # eles_by_json and _textfields_with_predicate is 0 indexed.
        result = eles_by_json(_textfield_visible)[index]
        raise _no_such_element if result.nil?

        return result
      end

      ele_by_json _textfield_contains_string value
    end
1296749
public CmsElementViewInfo getView(String value) {

        for (CmsElementViewInfo info : m_data.getElementViews()) {
            if (info.getElementViewId().toString().equals(value)) {
                return info;
            }
        }
        return null;
    }
924195
function(value, text) {
      text = (typeof text == 'string')
        ? text.toLowerCase()
        : text
      ;
      value = (typeof value == 'string')
        ? value.toLowerCase()
        : value
      ;
      return (value == text);
    }
885847
public static boolean isValueReference(String value)
    {
        if (value == null)
        {
            throw new NullPointerException("value");
        }

        int start = value.indexOf("#{");
        if (start < 0)
        {
            return false;
        }

        int end = value.lastIndexOf('}');
        return (end >= 0 && start < end);
    }
1370768
def index(value, array):
    
    i = array.searchsorted(value)
    if i == len(array): return -1
    else:               return i
315539
def atom=(value)
      value.is_a?(Atom) ? super(value) : super(Atom.find(value.to_s))
    end
207209
public static PriceTypeEnumeration findByValue(final String value) {
        if (value.equalsIgnoreCase("negotiable")) {
            return PriceTypeEnumeration.NEGOTIABLE;
        } else {
            return PriceTypeEnumeration.STARTING;
        }
    }
22402
public static <T> boolean contains(T[] array, T value) {
		return indexOf(array, value) > INDEX_NOT_FOUND;
	}
1081170
function text (el, value) {
  if (arguments.length === 1) {
    if ('textContent' in el) {
      return el.textContent
    } else {
      return el.innerText
    }
  } else {
    if ('textContent' in el) {
      el.textContent = value
    } else {
      el.innerText = value
    }
  }
}
1104513
def parse_value(cls, value: int, default: T = None) -> T:
        """"""
        return next((item for item in cls if value == item.value), default)
1291032
@SuppressWarnings("unchecked") // we know that return value type is a child of view, and V is bound to a child of view.
    public static <V extends View> V findViewById(View view, int id) {
        return (V) view.findViewById(id);
    }