Return all <ArloVideo> objects from camera given days range

        :param days: number of days to retrieve
541027
def videos(self, days=None):
        
        if days is None:
            days = self._min_days_vdo_cache
        library = ArloMediaLibrary(self._session, preload=False)
        try:
            return library.load(only_cameras=[self], days=days)
        except (AttributeError, IndexError):
            # make sure we are returning an empty list istead of None
            # returning an empty list, cache will be forced only when calling
            # the update method. Changing this can impact badly
            # in the Home Assistant performance
            return []
1262333
public static CalendarDays of(long days) {

        return ((days == 0) ? CalendarDays.ZERO : ((days == 1) ? CalendarDays.ONE : new CalendarDays(days)));

    }
218748
def main(args):
    

    v = VerbosityMixin()

    if args:

        if 'clip' in args:
            bounds = convert_to_float_list(args.clip)
        else:
            bounds = None

        if args.subs == 'process':
            verbose = True if args.verbose else False
            force_unzip = True if args.force_unzip else False
            stored = process_image(args.path, args.bands, verbose, args.pansharpen, args.ndvi, force_unzip,
                                   args.ndvigrey, bounds)

            if args.upload:
                u = Uploader(args.key, args.secret, args.region)
                u.run(args.bucket, get_file(stored), stored)

            return ["The output is stored at %s" % stored]

        elif args.subs == 'search':

            try:
                if args.start:
                    args.start = reformat_date(parse(args.start))
                if args.end:
                    args.end = reformat_date(parse(args.end))
                if args.latest > 0:
                    args.limit = 25
                    end = datetime.now()
                    start = end - relativedelta(days=+365)
                    args.end = end.strftime("%Y-%m-%d")
                    args.start = start.strftime("%Y-%m-%d")
            except (TypeError, ValueError):
                return ["Your date format is incorrect. Please try again!", 1]

            s = Search()

            try:
                if args.lat is not None:
                    lat = float(args.lat)
                else:
                    lat = None

                if args.lon is not None:
                    lon = float(args.lon)
                else:
                    lon = None
            except ValueError:
                return ["The latitude and longitude values must be valid numbers", 1]

            address = args.address
            if address and (lat and lon):
                return ["Cannot specify both address and latitude-longitude"]

            result = s.search(paths_rows=args.pathrow,
                              lat=lat,
                              lon=lon,
                              address=address,
                              limit=args.limit,
                              start_date=args.start,
                              end_date=args.end,
                              cloud_max=args.cloud,
                              geojson=args.geojson)

            if 'status' in result:

                if result['status'] == 'SUCCESS':
                    if args.json:
                        return json.dumps(result)

                    if args.latest > 0:
                        datelist = []
                        for i in range(0, result['total_returned']):
                            datelist.append((result['results'][i]['date'], result['results'][i]))

                        datelist.sort(key=lambda tup: tup[0], reverse=True)
                        datelist = datelist[:args.latest]

                        result['results'] = []
                        for i in range(0, len(datelist)):
                            result['results'].append(datelist[i][1])
                            result['total_returned'] = len(datelist)

                    else:
                        v.output('%s items were found' % result['total'], normal=True, arrow=True)

                    if result['total'] > 100:
                        return ['Over 100 results. Please narrow your search', 1]
                    else:
                        v.output(json.dumps(result, sort_keys=True, indent=4), normal=True, color='green')
                    return ['Search completed!']

                elif result['status'] == 'error':
                    return [result['message'], 1]

            if args.geojson:
                return json.dumps(result)

        elif args.subs == 'download':
            d = Downloader(download_dir=args.dest, usgs_user=args.username, usgs_pass=args.password)
            try:
                bands = convert_to_integer_list(args.bands)

                if args.process:
                    if args.pansharpen:
                        bands.append(8)

                    if args.ndvi or args.ndvigrey:
                        bands = [4, 5]

                    if not args.bands:
                        bands = [4, 3, 2]

                files = d.download(args.scenes, bands)

                if args.process:
                    if not args.bands:
                        args.bands = '432'
                    force_unzip = True if args.force_unzip else False
                    for f in files:
                        stored = process_image(f, args.bands, False, args.pansharpen, args.ndvi, force_unzip,
                                               args.ndvigrey, bounds=bounds)

                        if args.upload:
                            try:
                                u = Uploader(args.key, args.secret, args.region)
                            except NoAuthHandlerFound:
                                return ["Could not authenticate with AWS", 1]
                            except URLError:
                                return ["Connection timeout. Probably the region parameter is incorrect", 1]
                            u.run(args.bucket, get_file(stored), stored)

                    return ['The output is stored at %s' % stored, 0]
                else:
                    return ['Download Completed', 0]
            except IncorrectSceneId:
                return ['The SceneID provided was incorrect', 1]
            except (RemoteFileDoesntExist, USGSInventoryAccessMissing) as e:
                return [e.message, 1]
426911
private void getDailyDates(Calendar calendar, int frequency, List<Date> dates)
   {
      while (moreDates(calendar, dates))
      {
         dates.add(calendar.getTime());
         calendar.add(Calendar.DAY_OF_YEAR, frequency);
      }
   }
1047505
function getDays(start, end = moment().startOf('day')) {
  let cursor = moment(start);
  let days = [];
  while (cursor.isBefore(end)) {
    days.push(cursor.format('YYYY-MM-DD'));
    cursor = cursor.add(1, 'd');
  }
  return days;
}
144561
def get(
            self,
            days):
        
        self.log.info('starting the ``get`` method')

        self._remove_processed_data()

        archivePath = self.settings["atlas archive path"]
        self._update_day_tracker_table()
        mjds = self._determine_mjds_to_download(days=days)

        if len(mjds) == 0:
            return

        dbConn = self.atlasMoversDBConn

        # DOWNLOAD THE DATA IN PARALLEL
        results = fmultiprocess(log=self.log, function=_download_one_night_of_atlas_data, timeout=3600,
                                inputArray=mjds, archivePath=archivePath)

        global dbSettings

        dbSettings = self.settings["database settings"]["atlasMovers"]

        for d in results:
            if d and len(d[0]):
                insert_list_of_dictionaries_into_database_tables(
                    dbConn=dbConn,
                    log=self.log,
                    dictList=d[0],
                    dbTableName="atlas_exposures",
                    dateModified=True,
                    batchSize=10000,
                    replace=True,
                    dbSettings=dbSettings
                )

        # UPDATE BOOKKEEPING
        mjds = []
        mjds[:] = [r[1] for r in results if (r and r[1] is not None)]
        mjds = (',').join(mjds)

        if len(mjds):
            sqlQuery = """update atlas_exposures set local_data = 1 where floor(mjd) in (%(mjds)s);
        update day_tracker set processed = 1 where mjd in (%(mjds)s);""" % locals(
            )
            writequery(
                log=self.log,
                sqlQuery=sqlQuery,
                dbConn=self.atlasMoversDBConn,
            )

        bk = bookkeeper(
            log=self.log,
            settings=self.settings,
            fullUpdate=False
        )
        bk.clean_all()

        self.log.info('completed the ``get`` method')
        return None
1167872
def iso_day_to_weekday(d):
    
    if int(d) == utils.get_now().isoweekday():
        return _("today")
    for w in WEEKDAYS:
        if w[0] == int(d):
            return w[1]
1052076
def _GetDateValuesWithEpoch(self, number_of_days, date_time_epoch):
    
    return self._GetDateValues(
        number_of_days, date_time_epoch.year, date_time_epoch.month,
        date_time_epoch.day_of_month)
458053
def _days(cls, start, end):
        
        days = []
        # datetime
        start_day, end_day = dt.strptime(start, cls.DATE_FORMAT), dt.strptime(end, cls.DATE_FORMAT)
        delta = end_day - start_day

        for day in range(delta.days+1):
            days.append(start_day + timedelta(days=day))
        return days
944342
function getDaysNames () {
            var daysNameList = [];
            for (var i = 0; i < 7 ; i++) {
                daysNameList.push(moment().weekday(i).format('ddd'));
            }
            return daysNameList;
        }
364506
def days(self):
        """"""
        monday = self.day(0)
        return [monday + timedelta(days=i) for i in range(7)]
218837
def cameraUrls(self, camera=None, home=None, cid=None):
        
        local_url = None
        vpn_url = None
        if cid:
            camera_data=self.cameraById(cid)
        else:
            camera_data=self.cameraByName(camera=camera, home=home)
        if camera_data:
            vpn_url = camera_data['vpn_url']
            resp = postRequest(vpn_url + '/command/ping')
            temp_local_url=resp['local_url']
            try:
                resp = postRequest(temp_local_url + '/command/ping',timeout=1)
                if resp and temp_local_url == resp['local_url']:
                    local_url = temp_local_url
            except:  # On this particular request, vithout errors from previous requests, error is timeout
                local_url = None
        return vpn_url, local_url
1073948
def SD(self, days=45):
    
    if len(self.raw_data) >= days:
      data = self.raw_data[-days:]
      data_avg = float(sum(data) / days)
      data2 = []
      for x in data:
        data2.append((x - data_avg ) ** 2)

      return math.sqrt(sum(data2) / len(data2))
    else:
      return 0
860371
def daterange(start_date, end_date):
    
    for n in range(int((end_date - start_date).days)):
        yield start_date + timedelta(n)
737650
function getEra(date, daily) {
  date = this.toDate(date);
  return date ? getEraFn(date, daily) : null;
}
1095117
def byweekday(self):
        
        retval = []
        if self.rule._byweekday:
            retval += [Weekday(day) for day in self.rule._byweekday]
        if self.rule._bynweekday:
            retval += [Weekday(day, n) for day, n in self.rule._bynweekday]
        return retval
731125
def select_day(self, day):
        

        def _select_day(day):
            return self.data.loc[day, slice(None)]

        try:
            return self.new(_select_day(day), self.type, self.if_fq)
        except:
            raise ValueError('QA CANNOT GET THIS Day {} '.format(day))