Returns the modifiers tree of the given class, method, or variable declaration.
180936
@Nullable
  public static ModifiersTree getModifiers(Tree tree) {
    if (tree instanceof ClassTree) {
      return ((ClassTree) tree).getModifiers();
    } else if (tree instanceof MethodTree) {
      return ((MethodTree) tree).getModifiers();
    } else if (tree instanceof VariableTree) {
      return ((VariableTree) tree).getModifiers();
    } else {
      return null;
    }
  }
174925
public String getModifiersStr() {
        final StringBuilder buf = new StringBuilder();
        modifiersToString(modifiers, buf);
        return buf.toString();
    }
850225
def get_class_methods(cls):
    
    return [
        node
        for node in cls.body
        if isinstance(node, ast.FunctionDef)
    ]
224777
private static boolean checkModifiers(Class<? extends AbstractPlugin> pluginClass) {
        int modifiers = pluginClass.getModifiers();
        return !Modifier.isAbstract(modifiers) &&
                !Modifier.isInterface(modifiers) &&
                !Modifier.isPrivate(modifiers);
    }
195344
def get_mod_func(class_string):
    
    try:
        dot = class_string.rindex('.')
    except ValueError:
        return class_string, ''
    return class_string[:dot], class_string[dot + 1:]
1201442
public String modifiers() {
        int modifiers = getModifiers();
        if (isAnnotationTypeElement() ||
                (isMethod() && containingClass().isInterface())) {
            // Remove the implicit abstract modifier.
            return Modifier.toString(modifiers & ~Modifier.ABSTRACT);
        } else {
            return Modifier.toString(modifiers);
        }
    }
1003133
@Nullable
  public static Symbol getDeclaredSymbol(Tree tree) {
    if (tree instanceof AnnotationTree) {
      return getSymbol(((AnnotationTree) tree).getAnnotationType());
    }
    if (tree instanceof PackageTree) {
      return getSymbol((PackageTree) tree);
    }
    if (tree instanceof TypeParameterTree) {
      Type type = ((JCTypeParameter) tree).type;
      return type == null ? null : type.tsym;
    }
    if (tree instanceof ClassTree) {
      return getSymbol((ClassTree) tree);
    }
    if (tree instanceof MethodTree) {
      return getSymbol((MethodTree) tree);
    }
    if (tree instanceof VariableTree) {
      return getSymbol((VariableTree) tree);
    }
    return null;
  }
789413
public static int jlClassGetModifiers(Class<?> clazz) {
		//		ReloadableType rtype = getReloadableTypeIfHasBeenReloaded(clazz);
		ReloadableType rtype = getRType(clazz);
		if (rtype == null) {
			return clazz.getModifiers();
		}
		else {
			//Note: the "super bit" may be set in class modifiers but we should block it out, it
			//shouldn't be shown to users of the reflection API.
			return rtype.getLatestTypeDescriptor().getModifiers() & ~Opcodes.ACC_SUPER;
		}
	}
905135
protected String modifierString(MemberDoc member) {
        int ms = member.modifierSpecifier();
        int no = Modifier.NATIVE | Modifier.SYNCHRONIZED;
    return Modifier.toString(ms & ~no);
    }
163633
public static List<MethodTree> getConstructors(ClassTree classTree) {
    List<MethodTree> constructors = new ArrayList<>();
    for (Tree member : classTree.getMembers()) {
      if (member instanceof MethodTree) {
        MethodTree methodTree = (MethodTree) member;
        if (getSymbol(methodTree).isConstructor()) {
          constructors.add(methodTree);
        }
      }
    }
    return constructors;
  }
74129
public static Optional<SuggestedFix> removeModifiers(
      Tree tree, VisitorState state, Modifier... modifiers) {
    Set<Modifier> toRemove = ImmutableSet.copyOf(modifiers);
    ModifiersTree originalModifiers = getModifiers(tree);
    if (originalModifiers == null) {
      return Optional.empty();
    }
    return removeModifiers(originalModifiers, state, toRemove);
  }
848436
public static List<? extends ExecutableElement> getEffectiveMethods(TypeElement cls)
    {
        List<ExecutableElement> list = new ArrayList<>();
        while (cls != null)
        {
            for (ExecutableElement method : ElementFilter.methodsIn(cls.getEnclosedElements()))
            {
                if (!overrides(list, method))
                {
                    list.add(method);
                }
            }
            cls = (TypeElement) Typ.asElement(cls.getSuperclass());
        }
        return list;
    }
831950
public List<FunctionWrapper> compileFunctions(
      ImportStack importStack, Context context, Object object
  ) {
    Class<?> functionClass = object.getClass();
    Method[] methods = functionClass.getDeclaredMethods();
    List<FunctionDeclaration> declarations = new LinkedList<>();

    for (Method method : methods) {
      int modifiers = method.getModifiers();

      if (!Modifier.isPublic(modifiers)) {
        continue;
      }

      FunctionDeclaration declaration = createDeclaration(importStack, context, object, method);
      declarations.add(declaration);
    }

    return declarations.stream().map(FunctionWrapper::new).collect(Collectors.toList());
  }
1128616
def _get_dim_modifier(self, modifiers, dimstring=None):
        
        if dimstring is None:
            suffix = modifiers.split("dimension")[1]
            start = modifiers.index("dimension") + len("dimension")
        else:
            suffix = dimstring
            start = 0
        
        #We use a stack to monitor how many parenthesis we have traversed in the string.
        #Once we reach the closing parenthesis, we know that we have the dimension info.
        stack = []
        args = []
        for i in range(len(suffix)):
            if suffix[i] == '(':
                stack.append(i + start)
            elif suffix[i] == ')':
                args.append((stack.pop(), i + start))
                if len(stack) == 0:
                    #The last entry in args should be the indices of the entire
                    #dimension expression once the very first '(' has its twin found.
                    return args[-1]
426955
public static Element getDeclaredElement(TreeNode node) {
    if (node instanceof AbstractTypeDeclaration) {
      return ((AbstractTypeDeclaration) node).getTypeElement();
    } else if (node instanceof MethodDeclaration) {
      return ((MethodDeclaration) node).getExecutableElement();
    } else if (node instanceof VariableDeclaration) {
      return ((VariableDeclaration) node).getVariableElement();
    }
    return null;
  }
246131
function jsonModifiers(modifiers) {
  return modifiers.map(function(modifier, id) {
    return {
      id: id + 1,
      name: modifier.name(),
      description: modifier.description(),
      className: modifier.className(),
      markup: modifier.markup() ? modifier.markup().toString() : null
    };
  });
}
1093092
public static Optional<SuggestedFix> addModifiers(
      Tree tree, VisitorState state, Modifier... modifiers) {
    ModifiersTree originalModifiers = getModifiers(tree);
    if (originalModifiers == null) {
      return Optional.empty();
    }
    return addModifiers(tree, originalModifiers, state, new TreeSet<>(Arrays.asList(modifiers)));
  }