Fully check membership: hierarchy, protection, and hiding.
Does not exclude methods not inherited due to overriding.
177190
public boolean isMemberOf(TypeSymbol clazz, Types types) {
        return
            owner == clazz ||
            clazz.isSubClass(owner, types) &&
            isInheritedIn(clazz, types) &&
            !hiddenIn((ClassSymbol)clazz, types);
    }
41280
function isMemberAccess (node, retType, accessor, accessorType, memberName) {
  return nodeType(node, exactMatch(nodeTypes.MEMBERACCESS)) &&
        expressionType(node, retType) &&
        name(node, memberName) &&
        nrOfChildren(node, 1) &&
        name(node.children[0], accessor) &&
        expressionType(node.children[0], accessorType)
}
1039779
private boolean isSameMemberWhenErased(Type type,
                                               MethodSymbol method,
                                               Type erasure) {
            return types.isSameType(erasure(types.memberType(type, method)),
                                    erasure);
        }
609771
private boolean checkChildren( boolean exclusive,
                                   int depth ) {
        if (children == null) {
            // a file

            return owner == null || !(this.exclusive || exclusive);
        }
        // a folder

        if (owner == null) {
            // no owner, checking children

            if (depth != 0) {
                boolean canLock = true;
                int limit = children.length;
                for (int i = 0; i < limit; i++) {
                    if (!children[i].checkChildren(exclusive, depth - 1)) {
                        canLock = false;
                    }
                }
                return canLock;
            }
            // depth == 0 -> we don't care for children
            return true;
        }
        // there already is a owner
        return !(this.exclusive || exclusive);

    }
1042712
def _exclude(self, member):
        '''
        
        '''
        if isinstance(member, string_types):
            return None

        for item in self.opts['spm_build_exclude']:
            if member.name.startswith('{0}/{1}'.format(self.formula_conf['name'], item)):
                return None
            elif member.name.startswith('{0}/{1}'.format(self.abspath, item)):
                return None
        return member
1160900
private boolean consideringHierarchy(Publish p) {
		boolean sent = false;
		for (Entry<Class<?>, List<SubscriberParent>> e : p.mapping.entrySet()) {
			if (e.getKey().isAssignableFrom(p.message.getClass())) {
				for (SubscriberParent parent : e.getValue()) {
					if (!predicateApplies(parent.getSubscriber(), p.message)) {
						continue;
					}
					parent.getSubscriber().receiveO(p.message);
					sent = true;
				}
			}
		}
		return sent;
	}
255596
private boolean checkSupertypes(Class<?> cls) {
    for(Class<?> c : knownParameterizables) {
      if(c.isAssignableFrom(cls)) {
        return true;
      }
    }
    return false;
  }
483338
private boolean checkChildren(boolean exclusive, int depth) {
        if (_children == null) {
            // a file

            return _owner == null || !(_exclusive || exclusive);
        } else {
            // a folder

            if (_owner == null) {
                // no owner, checking children

                if (depth != 0) {
                    boolean canLock = true;
                    int limit = _children.length;
                    for (int i = 0; i < limit; i++) {
                        if (!_children[i].checkChildren(exclusive, depth - 1)) {
                            canLock = false;
                        }
                    }
                    return canLock;
                } else {
                    // depth == 0 -> we don't care for children
                    return true;
                }
            } else {
                // there already is a owner
                return !(_exclusive || exclusive);
            }
        }

    }
62973
def conceal_member(self, login):
        
        url = self._build_url('public_members', login, base_url=self._api)
        return self._boolean(self._delete(url), 204, 404)
563544
function (name, value) {
            var overriddenMember = this._extend.prototype[name];
            if (undefined !== overriddenMember) {
                this._checkOverridenMember(value, overriddenMember);
            }
        }
739608
private List<Element> getInheritedPackagePrivateMethods() {
        List<Element> results = new ArrayList<>();
        for (TypeElement currentClass : visibleClasses) {
            if (currentClass != typeElement &&
                utils.isPackagePrivate(currentClass) &&
                !utils.isLinkable(currentClass)) {
                // Document these members in the child class because
                // the parent is inaccessible.
                results.addAll(classMap.get(currentClass).members);
            }
        }
        return results;
    }
347315
def check_member(m)
      potential_members = self.class::MEMBER_CLASS.map_all_ids_to(:name, api: @api)
      if m.to_s =~ /^\d+$/
        return { id: m.to_i, name: potential_members[m] } if potential_members.key?(m.to_i)
      else
        return { name: m, id: potential_members.invert[m] } if potential_members.value?(m)
      end
      raise JSS::NoSuchItemError, "No #{self.class::MEMBER_CLASS::RSRC_OBJECT_KEY} matching '#{m}' in the JSS."
    end
552589
function checker (uid, ownerId, userRoles, requiredRoleList) {
  if (requiredRoleList.length === 0) {
    return false
  }

  if (requiredRoleList.includes(builtinRoles.Everyone)) {
    return true
  }

  if (uid && requiredRoleList.includes(builtinRoles.Authenticated)) {
    return true
  }

  for (const role of userRoles) {
    if (requiredRoleList.includes(role)) return true
  }

  // TODO: roles.Owner is actually a finer-grained restriction over usual roles. Not this.
  return requiredRoleList.includes(builtinRoles.Owner) &&
    uid &&
    (ownerId === uid)
}
465830
def override(cls):
    

    def check_override(method):
        if method.__name__ not in dir(cls):
            raise NameError("{} does not override any method of {}".format(
                method, cls))
        return method

    return check_override
763490
private void validateClassLevelJsDoc(Node n, JSDocInfo info) {
    if (info != null && n.isMemberFunctionDef()
        && hasClassLevelJsDoc(info)) {
      report(n, DISALLOWED_MEMBER_JSDOC);
    }
  }
92138
def _is_excluded(self, prop, info_dict):
        
        if prop.key in BLACKLISTED_KEYS:
            return True

        if info_dict.get('exclude', False):
            return True

        if prop.key in self.excludes:
            return True

        if self.includes and prop.key not in self.includes:
            return True

        return False
233327
public static List<MethodNode> filterMethodsByVisibility(List<MethodNode> methodNodeList, ClassNode enclosingClassNode) {
        if (!asBoolean(methodNodeList)) {
            return StaticTypeCheckingVisitor.EMPTY_METHODNODE_LIST;
        }

        List<MethodNode> result = new LinkedList<>();

        boolean isEnclosingInnerClass = enclosingClassNode instanceof InnerClassNode;
        List<ClassNode> outerClasses = enclosingClassNode.getOuterClasses();

        outer:
        for (MethodNode methodNode : methodNodeList) {
            if (methodNode instanceof ExtensionMethodNode) {
                result.add(methodNode);
                continue;
            }

            ClassNode declaringClass = methodNode.getDeclaringClass();

            if (isEnclosingInnerClass) {
                for (ClassNode outerClass : outerClasses) {
                    if (outerClass.isDerivedFrom(declaringClass)) {
                        if (outerClass.equals(declaringClass)) {
                            result.add(methodNode);
                            continue outer;
                        } else {
                            if (methodNode.isPublic() || methodNode.isProtected()) {
                                result.add(methodNode);
                                continue outer;
                            }
                        }
                    }
                }
            }

            if (declaringClass instanceof InnerClassNode) {
                if (declaringClass.getOuterClasses().contains(enclosingClassNode)) {
                    result.add(methodNode);
                    continue;
                }
            }

            if (methodNode.isPrivate() && !enclosingClassNode.equals(declaringClass)) {
                continue;
            }
            if (methodNode.isProtected()
                    && !enclosingClassNode.isDerivedFrom(declaringClass)
                    && !samePackageName(enclosingClassNode, declaringClass)) {
                continue;
            }
            if (methodNode.isPackageScope() && !samePackageName(enclosingClassNode, declaringClass)) {
                continue;
            }

            result.add(methodNode);
        }

        return result;
    }