non-private only for test case
170018
static int countLineBreaks(String s) {
    int pos = -1;
    int count = 0;
    while (true) {
      int nextPos = s.indexOf('\n', pos + 1);
      if (nextPos == -1) {
        break;
      }
      pos = nextPos;
      count++;
    }
    return count;
  }
385380
function protectStaticMethod(name, meta, constructor) {
        constructor[cacheKeyword].methods[name] = meta.implementation;

        if (meta.isPrivate) {
            Object.defineProperty(constructor, name, {
                get: function get() {
                    var method = constructor[cacheKeyword].methods[name],
                        currCaller;

                    currCaller = process._dejavu.caller;

                    if (currCaller && (currCaller.method[$name] || currCaller.method[$anonymous]) && meta.allowed === currCaller.constructorId) {
                        return method;
                    }

                    throw new Error('Cannot access private static method "' + name + '" of class "' + constructor.prototype.$name + '".');
                },
                set: function set(newVal) {
                    if (!constructor[$class].locked || constructor[$class].forceUnlocked) {
                        constructor[cacheKeyword].methods[name] = newVal;
                    } else {
                        throw new Error('Cannot set private static method "' + name + '" of class "' + constructor.prototype.$name + '".');
                    }
                },
                configurable: false,
                enumerable: true
            });
        } else if (meta.isProtected) {
            Object.defineProperty(constructor, name, {
                get: function get() {
                    var method = constructor[cacheKeyword].methods[name],
                        currCaller;

                    currCaller = process._dejavu.caller;

                    if (currCaller && (currCaller.method[$name] || currCaller.method[$anonymous]) && (contains(meta.allowed, currCaller.constructorId) || constructor.prototype instanceof currCaller.constructor)) {
                        return method;
                    }

                    throw new Error('Cannot access protected static method "' + name + '" of class "' + constructor.prototype.$name + '".');
                },
                set: function set(newVal) {
                    if (!constructor[$class].locked || constructor[$class].forceUnlocked) {
                        constructor[cacheKeyword].methods[name] = newVal;
                    } else {
                        throw new Error('Cannot set protected static method "' + name + '" of class "' + constructor.prototype.$name + '".');
                    }
                },
                configurable: false,
                enumerable: true
            });
        } else {
            Object.defineProperty(constructor, name, {
                get: function get() {
                    return constructor[cacheKeyword].methods[name];
                },
                set: function set(newVal) {
                    if (!constructor[$class].locked || constructor[$class].forceUnlocked) {
                        constructor[cacheKeyword].methods[name] = newVal;
                    } else {
                        throw new Error('Cannot set public static method "' + name + '" of class "' + constructor.prototype.$name + '".');
                    }
                },
                configurable: false,
                enumerable: true
            });
        }
    }
660352
private boolean handleCaseSensitivityCheck(String path, boolean checkWEBINF) throws IOException {
        if (System.getSecurityManager() != null) {
            final String tmpPath = path;
            final boolean tmpCheckWEBINF = checkWEBINF; //PK81387
            try {
                return ((Boolean) AccessController.doPrivileged(new PrivilegedExceptionAction() {
                    public Object run() throws IOException {
                        return _handleCaseSensitivityCheck(tmpPath, tmpCheckWEBINF); //PK81387 added tmpCheckWEBINF param
                    }
                })).booleanValue();
            } catch (PrivilegedActionException pae) {
                throw (IOException) pae.getException();
            }
        } else {
            return (_handleCaseSensitivityCheck(path, checkWEBINF)).booleanValue(); //PK81387 added checkWEBINF param
        }
    }
550758
public static Matcher isPrivate() {
    return new Matcher() {
      @Override public boolean matches(Node node, NodeMetadata metadata) {
        JSDocInfo jsDoc = NodeUtil.getBestJSDocInfo(node);
        if (jsDoc != null) {
          return jsDoc.getVisibility() == Visibility.PRIVATE;
        }
        return false;
      }
    };
  }
1038485
@SuppressWarnings("all")
    public static synchronized <T> IExpectationSetters<T> expectPrivate(Object instance, String methodName,
                                                                        Class<?>[] parameterTypes, Object... arguments) throws Exception {

        if (arguments == null) {
            arguments = new Object[0];
        }

        if (instance == null) {
            throw new IllegalArgumentException("instance cannot be null.");
        } else if (arguments.length != parameterTypes.length) {
            throw new IllegalArgumentException(
                    "The length of the arguments must be equal to the number of parameter types.");
        }

        Method foundMethod = Whitebox.getMethod(instance.getClass(), methodName, parameterTypes);

        WhiteboxImpl.throwExceptionIfMethodWasNotFound(instance.getClass(), methodName, foundMethod, parameterTypes);

        return doExpectPrivate(instance, foundMethod, arguments);
    }
778855
function(mocha, test) {
        test.parent._onlyTests = test.parent._onlyTests.concat(test);
        mocha.options.hasOnly = true;
        return test;
      }
964176
public void used( final TestCaseDef testCase)
    {
    // Note: must accumulate tuples into a separate list to avoid ConcurrentModificationException when updating used/unused membership.
    List<Tuple> usedTuples =
      IteratorUtils.toList(
        IteratorUtils.filteredIterator(
          IteratorUtils.chainedIterator(
            unused_.iterator(),
            used_.iterator()),
          tuple -> testCase.usesTuple( tuple)));

    for( Tuple tuple : usedTuples)
      {
      used( tuple);
      }
    }
200035
def public(self, boolean):
        """"""
        if(boolean):
            r = self.flag({
                "flag": "make_public"
            })
        else:
            r = self.flag({
                "flag": "make_private"
            })

        return r
593645
function isolate(fn, val) {
    var value, lastPromise;

    // Reset lastPromise for nested helpers
    Test.lastPromise = null;

    value = fn(val);

    lastPromise = Test.lastPromise;
    Test.lastPromise = null;

    // If the method returned a promise
    // return that promise. If not,
    // return the last async helper's promise
    if (value && value instanceof Test.Promise || !lastPromise) {
      return value;
    } else {
      return run(function () {
        return Test.resolve(lastPromise).then(function () {
          return value;
        });
      });
    }
  }
1129927
function internalStart(test) {

  	// If semaphore is non-numeric, throw error
  	if (isNaN(test.semaphore)) {
  		test.semaphore = 0;

  		pushFailure("Invalid value on test.semaphore", sourceFromStacktrace(2));
  		return;
  	}

  	// Don't start until equal number of stop-calls
  	if (test.semaphore > 0) {
  		return;
  	}

  	// Throw an Error if start is called more often than stop
  	if (test.semaphore < 0) {
  		test.semaphore = 0;

  		pushFailure("Tried to restart test while already started (test's semaphore was 0 already)", sourceFromStacktrace(2));
  		return;
  	}

  	// Add a slight delay to allow more assertions etc.
  	if (defined.setTimeout) {
  		if (config.timeout) {
  			clearTimeout(config.timeout);
  		}
  		config.timeout = setTimeout(function () {
  			if (test.semaphore > 0) {
  				return;
  			}

  			if (config.timeout) {
  				clearTimeout(config.timeout);
  			}

  			begin();
  		}, 13);
  	} else {
  		begin();
  	}
  }
286678
private static PrivacyItem parseItem(XmlPullParser parser) throws XmlPullParserException, IOException {
    // CHECKSTYLE:ON
        // Retrieves the required attributes
        String actionValue = parser.getAttributeValue("", "action");
        // Set the order number, this attribute is required
        long order = ParserUtils.getLongAttribute(parser, "order");

        // If type is not set, then it's the fall-through case
        String type = parser.getAttributeValue("", "type");

        /*
         * According the action value it sets the allow status. The fall-through action is assumed
         * to be "allow"
         */
        boolean allow;
        switch (actionValue) {
        case "allow":
            allow = true;
            break;
        case "deny":
            allow = false;
            break;
        default:
            // TODO: Should be SmackParsingException.
            throw new IOException("Unknown action value '" + actionValue + "'");
        }

        PrivacyItem item;
        if (type != null) {
            // If the type is not null, then we are dealing with a standard privacy item
            String value = parser.getAttributeValue("", "value");
            item = new PrivacyItem(PrivacyItem.Type.valueOf(type), value, allow, order);
        }
        else {
            // If the type is null, then we are dealing with the fall-through privacy item.
            item = new PrivacyItem(allow, order);
        }
        parseItemChildElements(parser, item);
        return item;
    // CHECKSTYLE:OFF
    }
942618
def validate_data_privacy(request, data, wrapper_kw=None):
    
    from nefertari import wrappers
    if wrapper_kw is None:
        wrapper_kw = {}

    wrapper = wrappers.apply_privacy(request)
    allowed_fields = wrapper(result=data, **wrapper_kw).keys()
    data = data.copy()
    data.pop('_type', None)
    not_allowed_fields = set(data.keys()) - set(allowed_fields)

    if not_allowed_fields:
        raise wrappers.ValidationError(', '.join(not_allowed_fields))
756538
def save(self, *args, **kwargs):
        '''  '''
        if not self.status:
            self.status == Event.RegStatus.hidden
        super(PrivateLessonEvent,self).save(*args,**kwargs)
491538
function(privateKey, cb = null){
        if(isFunction(cb)){
            try {
                return cb(null, ethUtils.privateToPublic(privateKey))
            }
            catch(err){
                return cb(err)
            }
        } else {
            try {
                return ethUtils.privateToPublic(privateKey)
            }
            catch(err){
                return err
            }
        }
    }
93478
private Visibility checkPrivateNameConvention(Visibility v, Node name) {
    if (isPrivateByConvention(name.getString())) {
      if (v != Visibility.PRIVATE && v != Visibility.INHERITED) {
        compiler.report(JSError.make(name, CONVENTION_MISMATCH));
      }
      return Visibility.PRIVATE;
    }
    return v;
  }
583786
public static synchronized <T> IExpectationSetters<T> expectPrivate(Object instance, String methodName,
                                                                        Class<?> where, Class<?>[] parameterTypes, Object... arguments) throws Exception {
        if (instance == null) {
            throw new IllegalArgumentException("Instance or class to expect cannot be null.");
        }
        Method[] methods = null;
        if (methodName != null) {
            if (parameterTypes == null) {
                methods = Whitebox.getMethods(where, methodName);
            } else {
                methods = new Method[]{Whitebox.getMethod(where, methodName, parameterTypes)};
            }
        }
        Method methodToExpect;
        if (methods != null && methods.length == 1) {
            methodToExpect = methods[0];
        } else {
            methodToExpect = WhiteboxImpl.findMethodOrThrowException(instance, null, methodName, arguments);
        }

        return doExpectPrivate(instance, methodToExpect, arguments);
    }
144768
function _defPrivateProperty(name, value) {
        if (instanceOf(value, Function)) value = value.bind(model)
        _privateProperties[name] = value
        $util.def(model, name, {
            enumerable: false,
            value: value
        })
    }