Checks a list of allowable regions against a click location. Returns true if the click should be allowed. Splices out the allowable region from the list after it has been used.
321306
function checkAllowableRegions(touchCoordinates, x, y) {
    for (var i = 0; i < touchCoordinates.length; i += 2) {
      if (hit(touchCoordinates[i], touchCoordinates[i+1], x, y)) {
        touchCoordinates.splice(i, i + 2);
        return true; // allowable region
      }
    }
    return false; // No allowable region; bust it.
  }
1174252
def check_all_local(self):
        """"""
        all_local_chk = self.event['global']['all_local'].isChecked()
        for buttons in self.event['local'].values():
            buttons[0].setChecked(all_local_chk)
            buttons[1].setEnabled(buttons[0].isChecked())
107403
def db_aws_list_regions(self):
        '''  '''
        regions = self.db_services.list_regions()
        if regions != []:
            print "Avaliable AWS regions:"
        for reg in regions:
            print '\t' + reg,
            if reg == self.db_services.get_region():
                print "(currently selected)"
            else:
                print ''
1258720
private void filter(Element list)
    {
        // Iterate all the child nodes of the given list to see who's allowed and who's not allowed inside it.
        Node child = list.getFirstChild();
        Node previousListItem = null;
        while (child != null) {
            Node nextSibling = child.getNextSibling();
            if (isAllowedInsideList(child)) {
                // Save a reference to the previous list item. Note that the previous list item is not necessarily the
                // previous sibling.
                if (child.getNodeName().equalsIgnoreCase(TAG_LI)) {
                    previousListItem = child;
                }
            } else {
                if (previousListItem == null) {
                    // Create a new list item to be able to move the invalid child.
                    previousListItem = list.getOwnerDocument().createElement(TAG_LI);
                    list.insertBefore(previousListItem, child);
                    // Hide the marker of the list item to make the list look the same after it is cleaned.
                    ((Element) previousListItem).setAttribute(ATTRIBUTE_STYLE, "list-style-type: none");
                }
                // Move the child node at the end of the previous list item because it is not allowed where it is now.
                previousListItem.appendChild(child);
            }
            child = nextSibling;
        }
    }
1179639
function isRangeInTable(opts: Options, node: Node, range: Range): boolean {
    const { startKey, endKey } = range;
    const startPosition = TablePosition.create(opts, node, startKey);
    const endPosition = TablePosition.create(opts, node, endKey);

    // Only handle events in tables
    if (!startPosition.isInTable() || !endPosition.isInTable()) {
        return false;
    }

    // Inside the same table
    return startPosition.table === endPosition.table;
}
969604
public boolean regionMatches(char []cb, int offset, int length)
  {
    int pos = getIndex();

    char ch = current();
    for (int i = 0; i < length; i++) {
      if (cb[i + offset] != ch) {
        setIndex(pos);
        return false;
      }
      ch = next();
    }

    return true;
  }
1084137
def _validate_allowed(self, allowed_values, field, value):
        
        if isinstance(value, Iterable) and not isinstance(value, _str_type):
            unallowed = set(value) - set(allowed_values)
            if unallowed:
                self._error(field, errors.UNALLOWED_VALUES, list(unallowed))
        else:
            if value not in allowed_values:
                self._error(field, errors.UNALLOWED_VALUE, value)
1114661
boolean hasClickedOnce(int click)
    {
        if (click < clicks.length && clicks[click] && !clicked[click])
        {
            clicked[click] = true;
            return true;
        }
        return false;
    }
871168
@Override
    public boolean accept(File file) {
        //All directories are added in the least that can be read by the Application
        if (file.isDirectory()&&file.canRead())
        {   return true;
        }
        else if(properties.selection_type==DialogConfigs.DIR_SELECT)
        {   /*  True for files, If the selection type is Directory type, ie.
             *  Only directory has to be selected from the list, then all files are
             *  ignored.
             */
            return false;
        }
        else
        {   /*  Check whether name of the file ends with the extension. Added if it
             *  does.
             */
            String name = file.getName().toLowerCase(Locale.getDefault());
            for (String ext : validExtensions) {
                if (name.endsWith(ext)) {
                    return true;
                }
            }
        }
        return false;
    }
100889
def check_selection(self):
        
        if self.current_prompt_pos is None:
            self.set_cursor_position('eof')
        else:
            self.truncate_selection(self.current_prompt_pos)
230882
def is_url_allowed(url):
    
    blacklist = [
        r'\.ttf', r'\.woff', r'fonts\.googleapis\.com', r'\.png', r'\.jpe?g', r'\.gif',
        r'\.svg'
    ]

    for ft in blacklist:
        if re.search(ft, url):
            return False

    return True
493409
function canFocus(elm) {
        if (isTextInputElement(elm) && !elm.hidden) {
          return true;
        }

        if (hasTabstopData(elm)) {
          return true;
        }

        if (/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(getRole(elm))) {
          return true;
        }

        return false;
      }
367658
def allowed_methods(self, path_info=None):
        
        try:
            self.match(path_info, method="--")
        except MethodNotAllowed as e:
            return e.valid_methods
        except HTTPException:
            pass
        return []
9167
public boolean hasRegion(String region) {
        return regions.containsKey(region) || matchesRegionRegex(region) || hasServiceEndpoint
                (region);
    }
174139
private static boolean canBeNewCurrInterval(Bound<?> lastBound, Bound<?> currentBound) {
        int vCompare = BoundValueComparator.compareValueDispatchingToInf(lastBound, currentBound);
        if (vCompare != 0) {
            return true;
        } else {
            if (lastBound.isLowerBound() && currentBound.isUpperBound()) {
                return true;
            } else if (lastBound.isUpperBound() && lastBound.getBoundaryType() == RangeBoundary.OPEN 
                && currentBound.isLowerBound() && currentBound.getBoundaryType() == RangeBoundary.OPEN) {
                return true; // the case x) (x
            } else {
                return false;
            }
        }
    }
1229814
def allowed_values(self):
        
        data = clips.data.DataObject(self._env)

        lib.EnvSlotAllowedValues(
            self._env, self._cls, self._name, data.byref)

        return tuple(data.value) if isinstance(data.value, list) else ()
1254680
def is_eligible(self, segment):
        
        if not segment or not segment.sampled:
            return False

        return segment.get_total_subsegments_size() > self.streaming_threshold