Whether we should ignore this location.

@param pProvider
the provider that provided the location
@param pTime
the time of the location
@return true if we should ignore this location, false if not
768846
public boolean shouldIgnore(final String pProvider, final long pTime) {

		if (LocationManager.GPS_PROVIDER.equals(pProvider)) {
			mLastGps = pTime;
		} else {
			if (pTime < mLastGps + Configuration.getInstance().getGpsWaitTime()) {
				return true;
			}
		}

		return false;
	}
12892
static boolean isStale(OmemoDevice userDevice, OmemoDevice subject, Date lastReceipt, int maxAgeHours) {
        if (userDevice.equals(subject)) {
            return false;
        }

        if (lastReceipt == null) {
            return false;
        }

        long maxAgeMillis = MILLIS_PER_HOUR * maxAgeHours;
        Date now = new Date();

        return now.getTime() - lastReceipt.getTime() > maxAgeMillis;
    }
216437
public <T> boolean register(final T pProvider, final Class<? super T> pCategory) {
        return registerImpl(pProvider, pCategory);
    }
1179788
def _occursOn(self, myDate):
        
        # TODO analyse which is faster (rrule or db) and test that first
        if myDate not in self.repeat:
            return False
        if CancellationPage.events.child_of(self)                            \
                           .filter(except_date=myDate).exists():
            return False
        return True
530274
public boolean hasNamedPolicy(String ptype, List<String> params) {
        return model.hasPolicy("p", ptype, params);
    }
1189825
@Override
  public final synchronized void changeBalanceStorePeriod(
    final Map<String, Object> pAddParam,
      final EPeriod pPeriod) throws Exception {
    if (pPeriod == null) {
      throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
        "null_not_accepted");
    }
    if (!lazyGetBalanceAtAllDirtyCheck(pAddParam).getBalanceStorePeriod()
      .equals(pPeriod)) {
      getLogger().info(null, SrvBalanceStd.class,
        "changing period from " + this.balanceAtAllDirtyCheck
          .getBalanceStorePeriod() + " to " + pPeriod);
      this.balanceAtAllDirtyCheck.setBalanceStorePeriod(pPeriod);
      if (!getSrvAccSettings().lazyGetAccSettings(pAddParam)
        .getBalanceStorePeriod().equals(pPeriod)) {
        getSrvAccSettings().lazyGetAccSettings(pAddParam)
          .setBalanceStorePeriod(pPeriod);
        getSrvAccSettings().saveAccSettings(pAddParam, getSrvAccSettings()
          .lazyGetAccSettings(pAddParam));
      }
      this.balanceAtAllDirtyCheck
        .setCurrentBalanceDate(initDate);
      this.balanceAtAllDirtyCheck.setIsPeriodChanged(true);
      getSrvOrm()
        .updateEntity(pAddParam, this.balanceAtAllDirtyCheck);
    }
  }
492134
public final synchronized Date evalDateNextPeriodStart(
    final Map<String, Object> pAddParam,
      final Date pDateFor) throws Exception {
    EPeriod period = evalBalanceStorePeriod(pAddParam);
    if (!(period.equals(EPeriod.MONTHLY)
      || period.equals(EPeriod.WEEKLY)
        || period.equals(EPeriod.DAILY))) {
      throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
        "stored_balance_period_must_be_dwm");
    }
    Calendar cal = Calendar.getInstance(new Locale("en", "US"));
    cal.setTime(pDateFor);
    cal.set(Calendar.HOUR_OF_DAY, 0);
    cal.set(Calendar.MINUTE, 0);
    cal.set(Calendar.SECOND, 0);
    cal.set(Calendar.MILLISECOND, 0);
    if (period.equals(EPeriod.DAILY)) {
      cal.add(Calendar.DATE, 1);
    } else if (period.equals(EPeriod.MONTHLY)) {
      cal.add(Calendar.MONTH, 1);
      cal.set(Calendar.DAY_OF_MONTH, 1);
    } else if (period.equals(EPeriod.WEEKLY)) {
      cal.add(Calendar.DAY_OF_YEAR, 7);
      cal.set(Calendar.DAY_OF_WEEK, 1);
    }
    return cal.getTime();
  }
643159
def check_exclude_rec(self):
        # pylint: disable=access-member-before-definition
        
        if self.rec_tag:
            msg = "[timeentry::%s] is in a loop in exclude parameter" % (self.get_name())
            self.add_error(msg)
            return False
        self.rec_tag = True
        for timeperiod in self.exclude:
            timeperiod.check_exclude_rec()
        return True
325482
@TargetApi(Build.VERSION_CODES.FROYO)
    public static boolean hasLocationFeature(PackageManager manager) {
        return manager.hasSystemFeature(PackageManager.FEATURE_LOCATION);
    }
132044
@SuppressWarnings("unlikely-arg-type")
    public boolean unsubscribe(IProvider provider) {
        if (providers.remove(provider)) {
            fireProviderConnectionEvent(provider, PipeConnectionEvent.EventType.PROVIDER_DISCONNECT, null);
            listeners.remove(provider);
            return true;
        }
        return false;
    }
907160
@Override
  public boolean isTimeIncluded (final long timeStamp)
  {
    if (m_aExcludeAll == true)
    {
      return false;
    }

    // Test the base calendar first. Only if the base calendar not already
    // excludes the time/date, continue evaluating this calendar instance.
    if (super.isTimeIncluded (timeStamp) == false)
    {
      return false;
    }

    final Calendar cl = createJavaCalendar (timeStamp);
    final int day = cl.get (Calendar.DAY_OF_MONTH);

    return !(isDayExcluded (day));
  }
507616
@Override
  public boolean isTimeIncluded (final long timeStamp)
  {
    if (super.isTimeIncluded (timeStamp) == false)
    {
      return false;
    }

    final Date lookFor = getStartOfDayJavaCalendar (timeStamp).getTime ();

    return !(m_aDates.contains (lookFor));
  }
123181
public static <T> Predicate<T> ignore(BooleanSupplier proposition, Class<T> ignored) {
        dbc.precondition(proposition != null, "cannot ignore parameter of a null proposition");
        return t -> proposition.getAsBoolean();
    }
343410
public static void printTimeAverage(final Collection pTimeDifferences, final PrintStream pPrintStream) {

    if (pPrintStream == null) {
      System.err.println(PRINTSTREAM_IS_NULL_ERROR_MESSAGE);
      return;
    }
    if (pTimeDifferences == null) {
      pPrintStream.println(TIMEDIFFERENCES_IS_NULL_ERROR_MESSAGE);
      return;
    }
    Object         o;
    TimeDifference timeDifference;
    Calendar       startCalendar      = null;
    Calendar       endCalendar        = null;
    Calendar       totalStartCalendar = null;
    Calendar       totalEndCalendar   = null;
    long           startCalendarMilliSeconds, endCalendarMilliSeconds;
    List           timeDifferenceList = new Vector();
    Iterator       i                  = pTimeDifferences.iterator();

    if (i.hasNext()) {
      o = i.next();
      if (!(o instanceof TimeDifference)) {
        pPrintStream.println(TIMEDIFFERENCES_WRONG_DATATYPE_ERROR_MESSAGE);
        return;
      }
      timeDifference            = (TimeDifference) o;
      startCalendar             = timeDifference.getStartCalendar();
      totalStartCalendar        = startCalendar;
      endCalendar               = timeDifference.getEndCalendar();
      startCalendarMilliSeconds = startCalendar.getTime().getTime();
      endCalendarMilliSeconds   = endCalendar.getTime().getTime();
      timeDifferenceList.add(new Long(endCalendarMilliSeconds - startCalendarMilliSeconds));
    }
    while (i.hasNext()) {
      o = i.next();
      if (!(o instanceof TimeDifference)) {
        pPrintStream.println(TIMEDIFFERENCES_WRONG_DATATYPE_ERROR_MESSAGE);
        return;
      }
      timeDifference            = (TimeDifference) o;
      startCalendar             = timeDifference.getStartCalendar();
      endCalendar               = timeDifference.getEndCalendar();
      startCalendarMilliSeconds = startCalendar.getTime().getTime();
      endCalendarMilliSeconds   = endCalendar.getTime().getTime();
      timeDifferenceList.add(new Long(endCalendarMilliSeconds - startCalendarMilliSeconds));
    }
    totalEndCalendar = endCalendar;
    int  numberOfElements = timeDifferenceList.size();
    long timeDifferenceElement;
    long timeDifferenceSum = 0;

    for (Iterator i2 = timeDifferenceList.iterator(); i2.hasNext(); ) {
      timeDifferenceElement = ((Long) i2.next()).longValue();
      timeDifferenceSum     += timeDifferenceElement;
    }

    // Total elapsed time
    String totalElapsedTime = buildTimeDifference(totalStartCalendar, totalEndCalendar);

    // Time average presentation format
    pPrintStream.println("Average time difference: " + timeDifferenceSum / numberOfElements + "ms (" + numberOfElements
                         + " elements, total elapsed time: " + totalElapsedTime + ")");
  }
998032
public boolean leavePlace ()
    {
        if (_pendingPlaceId != -1) {
            return false;
        }

        _lservice.leavePlace();
        didLeavePlace();

        // let our observers know that we're no longer in a location
        _observers.apply(_didChangeOp);

        return true;
    }
632657
@Override
    public LogRepositoryBrowser find(RepositoryPointerImpl location, boolean ignoreTimestamp) {
        String[] instanceIds = location.getInstanceIds();
        if (instanceIds.length == 0) {
            logger.logp(Level.SEVERE, className, "find", "HPEL_NotRepositoryLocation");
            return null;
        }

        String locProcId = ignoreTimestamp ? parsePIDandLabel(instanceIds[0]) : instanceIds[0];
        LogRepositoryBrowser result = null;
        File[] files = listFiles(instanceFilter);
        if (files == null) {
            return null;
        }
        for (File file : files) {
            String curProcId = ignoreTimestamp ? parsePIDandLabel(file.getName()) : file.getName();
            if (locProcId.equalsIgnoreCase(curProcId)) {
                result = new LogRepositoryBrowserImpl(file, new String[] { file.getName() });
                for (int i = 1; i < instanceIds.length && result != null; i++) {
                    Map<String, LogRepositoryBrowser> map = result.getSubProcesses();
                    result = map.get(instanceIds[i]);
                }
            }
        }

        return result;
    }
132113
public boolean rejectPresenter(MvpPresenter<?> presenter, String delegateTag) {
		Set<MvpPresenter> presenters = mTags.get(delegateTag);
		if (presenters != null) {
			presenters.remove(presenter);
		}
		if (presenters == null || presenters.isEmpty()) {
			mTags.remove(delegateTag);
		}

		Set<String> delegateTags = mConnections.get(presenter);
		if (delegateTags == null) {
			mConnections.remove(presenter);
			return true;
		}

		Iterator<String> tagsIterator = delegateTags.iterator();
		while (tagsIterator.hasNext()) {
			String tag = tagsIterator.next();

			if (tag.startsWith(delegateTag)) {
				tagsIterator.remove();
			}
		}

		boolean noTags = delegateTags.isEmpty();

		if (noTags) {
			mConnections.remove(presenter);
		}

		return noTags;
	}