===== athlete endpoint ===== ===== helpers =====
347598
function(listType,args,done) {

    var endpoint = 'athlete/'
        , qs = util.getQS(_qsAllowedProps,args);

    endpoint += listType + '?' + qs;
    util.getEndpoint(endpoint,args,done);
}
60559
protected final void addEndpoint(Endpoint e) {
        final List<Endpoint> newEndpoints;
        endpointsLock.lock();
        try {
            List<Endpoint> newEndpointsUnsorted = Lists.newArrayList(endpoints);
            newEndpointsUnsorted.add(e);
            endpoints = newEndpoints = ImmutableList.sortedCopyOf(newEndpointsUnsorted);
        } finally {
            endpointsLock.unlock();
        }

        notifyListeners(newEndpoints);
        completeInitialEndpointsFuture(newEndpoints);
    }
601733
private static List<String> loadEndPoints(Map<String, String[]> endpoints) {
        final boolean bTrace = TraceComponent.isAnyTracingEnabled();
        final EndPointMgr epm = EndPointMgrImpl.getRef();
        List<String> createdEndpoints = new ArrayList<String>(endpoints.size());

        for (Entry<String, String[]> entry : endpoints.entrySet()) {
            try {
                EndPointInfo ep = defineEndPoint(epm, entry.getKey(), entry.getValue());
                createdEndpoints.add(ep.getName());
            } catch (IllegalArgumentException e) {
                FFDCFilter.processException(e, "ChannelUtils.loadEndPoints",
                                            "create", new Object[] { epm, entry });
                if (bTrace && tc.isEventEnabled()) {
                    Tr.event(tc, "Unable to load endpoint: " + e);
                }
            }
        }

        return createdEndpoints;
    }
837856
@Around("execution(* *(..)) && @annotation(TimerJ)")
    public Object around(ProceedingJoinPoint point) throws Throwable {
        String methodName = MethodSignature.class.cast(point.getSignature()).getMethod().getName();
        String methodArgs = point.getArgs().toString();
        MetricRegistry metricRegistry = Metrics.getRegistry();
        Timer timer;

        String metricName = "Starting method "+methodName + "at "+System.nanoTime();
        synchronized (this) {
            if(metricRegistry.getTimers().containsKey(methodName)){
                timer = metricRegistry.getTimers().get(metricName);
            }
            else{
                timer = metricRegistry.register(metricName, new Timer());
            }
        }
        Timer.Context before = timer.time();
        Object result = point.proceed();
        long timeAfter = before.stop();

        logger.debug("Method " + methodName + " with args " + methodArgs + " executed in " + timeAfter + " ns");

        return result;
    }
1251172
@SuppressWarnings("unchecked")
	@Override
	public T getEndpoint(String nodeID) {
		Endpoint[] array;
		if (nodeID == null && preferLocal) {
			array = getEndpointsByNodeID(this.nodeID);
			if (array.length == 0) {
				array = endpoints;
			}
		} else {
			array = getEndpointsByNodeID(nodeID);
		}
		if (array.length == 0) {
			return null;
		}
		if (array.length == 1) {
			return (T) array[0];
		}
		return (T) next(array);
	}
1341339
@SuppressWarnings("unchecked")
	@Override
	public List<T> getAllEndpoints() {
		ArrayList<T> list = new ArrayList<>(endpoints.length);
		for (int i = 0; i < endpoints.length; i++) {
			list.add((T) endpoints[i]);
		}
		return list;
	}
1185720
function(startPoint, endPoint) {
                startPoint = vector.create(startPoint).to3D();
                endPoint = vector.create(endPoint).to3D();
                if (startPoint === null || endPoint === null) { return null; }
                this.line = line.create(startPoint, endPoint.subtract(startPoint));
                this.start = startPoint;
                this.end = endPoint;
                return this;
              }
1046572
function subEndpoints(prefix, suffixes) {
  return function () {
    Array.prototype.forEach.call(suffixes, function (suffix) {
      var path = prefix + suffix;
      createEndpointFromPath(path);
      console.log('  registered path %s', path);
    });
  }
}
1122708
public function createWorkout(Workout $workout)
    {
        $response = $this->request(self::CREATE_WORKOUT_ENDPOINT, [
            'workoutId' => '-' . $this->bigRandomNumber(16),
            'duration' => $workout->getDuration(),
            'sport' => $workout->getTypeId(),
            'extendedResponse' => 'true',
            'gzip' => 'true',
        ], $workout->getPointsAsString());

        if (!isset($response['workout.id'])) {
            throw new EndomondoApiOldException('Workout create failed.');
        }

        $workout->setId($response['workout.id']);

        return $this->updateWorkout($workout);
    }
613098
function createEndpointFromObject(path, query, body) {
  // OPTIONS gives server permission to use CORS
  server.createRoute({
    request: {
        url: path,
        query: query || {},
        method: 'options',
    },
    response: {
        code: 200,
        delay: config.latency,
        body: {},
        headers: {
          'Access-Control-Allow-Origin': config.allowOrigin,
          // allow several methods since some endpoints are writable
          'Access-Control-Allow-Methods': 'GET, PUT, POST',
          'Access-Control-Allow-Credentials': 'true'
        }
    }
  });
  return server.get(path)
               .query(query)
               .responseHeaders({
                 'Access-Control-Allow-Origin': config.allowOrigin,
                 'Access-Control-Allow-Methods': 'GET, PUT, POST',
                 'Access-Control-Allow-Credentials': 'true'
               })
               .body(body)
               .delay(config.latency);
}
415284
function(request, data){
  request.source_endpoint = data[1];
  request.type = data[2];
  parseType(request, data);
}
668568
public void setEndpoint(String endpoint) {
        this.endpoint = endpoint;

        if (bugsnag != null) {
            bugsnag.setEndpoints(endpoint, null);
        }
    }
185421
public void initMultiCountMetrics(PhysicalPlanHelper helper) {
    // For bolt, we would consider both input stream and output stream
    List<TopologyAPI.InputStream> inputs = helper.getMyBolt().getInputsList();
    for (TopologyAPI.InputStream inputStream : inputs) {
      String streamId = inputStream.getStream().getId();
      String globalStreamId =
          new StringBuilder(inputStream.getStream().getComponentName()).
              append("/").append(streamId).toString();

      ackCount.scope(streamId);
      failCount.scope(streamId);
      executeCount.scope(streamId);
      executeTimeNs.scope(streamId);

      ackCount.scope(globalStreamId);
      failCount.scope(globalStreamId);
      executeCount.scope(globalStreamId);
      executeTimeNs.scope(globalStreamId);
    }
    List<TopologyAPI.OutputStream> outputs = helper.getMyBolt().getOutputsList();
    for (TopologyAPI.OutputStream outputStream : outputs) {
      String streamId = outputStream.getStream().getId();
      emitCount.scope(streamId);
    }
  }
1277731
def _attach_endpoints(self):
        """"""
        for name, endpoint in inspect.getmembers(self):
            if inspect.isclass(endpoint) and issubclass(endpoint, self._Endpoint) and (endpoint is not self._Endpoint):
                endpoint_instance = endpoint(self.base_requester)
                setattr(self, endpoint_instance.endpoint, endpoint_instance)
459110
function parsePoint(result) {
  if (result.geometry) {
    if (result.geometry.location) {
      const {lng, lat} = result.geometry.location
      return helpers.point([lng, lat])
    }
  }
}
69958
void setEndPoints() {
		float angleNum = 360f / (rayNum - 1);
		for (int i = 0; i < rayNum; i++) {
			final float angle = angleNum * i;
			sin[i] = MathUtils.sinDeg(angle);
			cos[i] = MathUtils.cosDeg(angle);
			endX[i] = distance * cos[i];
			endY[i] = distance * sin[i];
		}
	}
1133497
def method_missing(m, *array)
      endpoint = Scale.descendants(Scale::Endpoints::Endpoint).find { |e| e.match? m }
      return endpoint.new(self, *array).process if endpoint
      super
    end