Send a query to the SSOS web service, looking for available observations using the given track.

        :param target_name: name of target to query against SSOIS db
        :param lunation_count: ignored
        :rtype: SSOSData
496671
def query_ssos(self, target_name, lunation_count=None):
        

        # we observe ~ a week either side of new moon
        # but we don't know when in the dark run the discovery happened
        # so be generous with the search boundaries, add extra 2 weeks
        # current date just has to be the night of the triplet,
        from mp_ephem import horizons
        search_start_date = Time('1999-01-01', scale='utc')
        search_end_date = Time(datetime.datetime.now().strftime('%Y-%m-%d'), scale='utc')
        logger.info("Sending query to SSOS start_date: {} end_data: {}\n".format(search_start_date, search_end_date))
        query = Query(target_name,
                      search_start_date=search_start_date,
                      search_end_date=search_end_date)

        logger.debug("Parsing query results...")
        tracks_data = self.ssos_parser.parse(query.get())

        tracks_data.mpc_observations = {}

        start_time = Time(search_start_date)
        stop_time = Time(search_end_date)
        step_size = 5 * units.hour
        self.orbit = horizons.Body(target_name, start_time, stop_time, step_size)

        ref_sky_coord = None

        for source in tracks_data.get_sources():
            astrom_observations = tracks_data.observations
            source_readings = source.get_readings()
            for idx in range(len(source_readings)):
                source_reading = source_readings[idx]
                assert isinstance(source_reading, SourceReading)
                if ref_sky_coord is None or source_reading.sky_coord.separation(ref_sky_coord) > 40 * units.arcsec:
                    ref_sky_coord = source_reading.sky_coord
                source_reading.reference_sky_coord = ref_sky_coord
                astrom_observation = astrom_observations[idx]
                self.orbit.predict(Time(astrom_observation.mjd, format='mjd', scale='utc'))
                source_reading.pa = self.orbit.pa
                # why are these being recorded just in pixels?  Because the error ellipse is drawn in pixels.
                # TODO: Modify error ellipse drawing routine to use WCS but be sure
                # that this does not cause trouble with the use of dra/ddec for cutout computer
                source_reading.dx = self.orbit.dra
                source_reading.dy = self.orbit.ddec
        logger.debug("Sending back set of observations that might contain the target: {}".format(tracks_data))
        return tracks_data
264025
def set_scan_target_progress(
            self, scan_id, target, host, progress):
        
        self.scan_collection.set_target_progress(
            scan_id, target, host, progress)
696807
public static long count(nitro_service service, String name) throws Exception{
		netbridge_nsip6_binding obj = new netbridge_nsip6_binding();
		obj.set_name(name);
		options option = new options();
		option.set_count(true);
		netbridge_nsip6_binding response[] = (netbridge_nsip6_binding[]) obj.get_resources(service,option);
		if (response != null) {
			return response[0].__count;
		}
		return 0;
	}
155216
def _set_affected_target_count_in_runtracker(self):
    """"""
    target_count = len(self.build_graph)
    self.run_tracker.pantsd_stats.set_affected_targets_size(target_count)
    return target_count
310131
public function counting($name, $hit, $total = null)
    {
        if (! \is_string($name) || empty($name)) {
            return;
        }

        $cid = Coroutine::tid();
        if (! isset($this->countings[$cid][$name])) {
            $this->countings[$cid][$name] = ['hit' => 0, 'total' => 0];
        }
        $this->countings[$cid][$name]['hit'] += (int)$hit;
        if ($total !== null) {
            $this->countings[$cid][$name]['total'] += (int)$total;
        }
    }
1159574
def add_observers(self, count, date_observed):
        
        if not self.can_update():
            self._tcex.handle_error(910, [self.type])

        data = {
            'count': count,
            'dataObserved': self._utils.format_datetime(
                date_observed, date_format='%Y-%m-%dT%H:%M:%SZ'
            ),
        }

        return self.tc_requests.add_observations(
            self.api_type, self.api_sub_type, self.unique_id, data, owner=self.owner
        )
767733
private void reportCounter(final String name, final Counter counter) {
		send(name, String.valueOf(counter.getCount()));
	}
1166342
public static long count(nitro_service service, String vservername) throws Exception{
		sslvserver_sslciphersuite_binding obj = new sslvserver_sslciphersuite_binding();
		obj.set_vservername(vservername);
		options option = new options();
		option.set_count(true);
		sslvserver_sslciphersuite_binding response[] = (sslvserver_sslciphersuite_binding[]) obj.get_resources(service,option);
		if (response != null) {
			return response[0].__count;
		}
		return 0;
	}
196045
function is_followed_by_name( $target_name, $source_name = NULL )
	{
		$params = array();
		$params['target_screen_name'] = $target_name;

		if ( $source_name != NULL ) {
			$params['source_screen_name'] = $source_name;
		}

		return $this->oauth->get( 'friendships/show', $params );
	}
1229115
def get_detectors(self, name=None, tags=None, batch_size=100, **kwargs):
        
        detectors = []
        offset = 0
        while True:
            resp = self._get(
                self._u(self._DETECTOR_ENDPOINT_SUFFIX),
                params={
                    'offset': offset,
                    'limit': batch_size,
                    'name': name,
                    'tags': tags or [],
                },
                **kwargs)
            resp.raise_for_status()
            data = resp.json()
            detectors += data['results']
            if len(detectors) == data['count']:
                break
            offset = len(detectors)
        return detectors
1023037
def _get_hit_count(self, database, enquire):
        
        return self._get_enquire_mset(
            database, enquire, 0, database.get_doccount()
        ).size()
858588
private WebTarget withAuthToken(final WebTarget target) {
    if (_sessionOptions.getAuthToken() != null) {
      return target.queryParam(AUTH_TOKEN_PARAM_NAME, _sessionOptions.getAuthToken());
    } else {
      return target;
    }
  }
918701
def count(self, source, target):
        
        try:
            source_value = self._response_holder[source]
        except KeyError:
            # Source value hasn't been determined yet, we need
            # to generate the source value first
            raw = self.fake_response[source]
            source_value = self._parse_syntax(raw)
        if isinstance(source_value, str):
            source_value = int(source_value)
        target = self.fake_response[target]
        values = []
        for _ in range(source_value):
            self._is_empty = False  # Remote state for re.sub to switch in case it hits a None value
            mock_value = self._parse_syntax(target)
            mock_value = str(mock_value)  # Treat the value as a string regardless of its actual data type
            _target = mock_value[1:-1]  # Remove extra quotation
            _target = _target.replace("'", '"')

            try:
                mock_value = json.loads(_target)
            except:
                mock_value = _target

            # If uniqueness is specified and this mock value isn't
            # in the store yet, then we can append it to the results
            if not self._is_empty:
                values.append(mock_value)
        return values
1354243
def trigger(self, target: str, trigger: str, parameters: Dict[str, Any]={}):
		
		pass
818145
def target_show(self, id, **kwargs):
        ""
        api_path = "/api/v2/targets/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
1301627
@SuppressWarnings("unchecked")
    public void updateTarget(final Target updatedTarget) {
        if (updatedTarget != null) {
            final Item item = getItem(updatedTarget.getId());
            // TO DO update SPUILabelDefinitions.ASSIGNED_DISTRIBUTION_NAME_VER
            // &
            // SPUILabelDefinitions.ASSIGNED_DISTRIBUTION_NAME_VER

            /*
             * Update the status which will trigger the value change lister
             * registered for the target update status. That listener will
             * update the new status icon showing for this target in the table.
             */
            item.getItemProperty(SPUILabelDefinitions.VAR_TARGET_STATUS).setValue(updatedTarget.getUpdateStatus());
            /*
             * Update the last query which will trigger the value change lister
             * registered for the target last query column. That listener will
             * update the latest query date for this target in the tooltip.
             */
            item.getItemProperty(SPUILabelDefinitions.LAST_QUERY_DATE).setValue(updatedTarget.getLastTargetQuery());

            item.getItemProperty(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY)
                    .setValue(UserDetailsFormatter.loadAndFormatLastModifiedBy(updatedTarget));
            item.getItemProperty(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE)
                    .setValue(SPDateTimeUtil.getFormattedDate(updatedTarget.getLastModifiedAt()));
            item.getItemProperty(SPUILabelDefinitions.VAR_DESC).setValue(updatedTarget.getDescription());

            /* Update the new Name, Description and poll date */
            item.getItemProperty(SPUILabelDefinitions.VAR_NAME).setValue(updatedTarget.getName());
        }
    }
313011
def get_target_error(self,i):
    
    x = self._target_hpas[i]
    h = x['hpa']
    pos = x['pos']
    prob = 0
    be = BaseError('target')
    be.set_observable(h.get_target(),h.get_query())
    if i != 0 and pos == 0: # check for a total deletion before
      prev = x['prev-hpa']
      if len(prev.get_target()) == 0: # total insertion
        ilen = len(prev.get_query())
        be.set_unobserved_before(0,len(prev.get_query()),prev.get_query()[0],0.5)
    if i != len(self._target_hpas)-1 and pos == len(h.get_target())-1: # check for a total deletion before
      if x['next-hpa']:
        foll = x['next-hpa']
        if len(foll.get_target()) == 0: # total insertion
          be.set_unobserved_after(0,len(foll.get_query()),foll.get_query()[0],0.5)
    return be