Sole porcupine endpoint
544602
def check_sentence():
    """"""
    text = ''
    if request.method == 'POST':
        text = request.form['text']
        if not text:
            error = 'No input'
            flash_message = error
        else:
            fb = check(request.form['text'])
            correct = False
            if request.form.get('is_correct') and not fb.primary_error:
                correct = True
            elif not request.form.get('is_correct') and fb.primary_error:
                correct = True
            sub = Submission(text=text, correct=correct, primary_error=fb.primary_error,
                    specific_error=fb.specific_error)
            session.add(sub)
            session.commit()
            # TODO: remove the hack below
            if not fb.primary_error:
                fb.human_readable = "No errors were found."
            flash_message = fb.human_readable

        flash(flash_message)
    return render_template('check_sentence.html', text=text)
390164
def stub!
      CiscoMSE::Endpoints::Location.any_instance.stub(:clients).and_return( Stub::Data::Location::CLIENTS )
    end
951461
def default_endpoint(ctx, param, value):
    """"""
    if ctx.resilient_parsing:
        return

    config = ctx.obj['config']
    endpoint = default_endpoint_from_config(config, option=value)

    if endpoint is None:
        raise click.UsageError('No default endpoint found.')

    return endpoint
748012
def owns_endpoint(self, endpoint):
        

        if self.blueprint:
            if endpoint.startswith(self.blueprint.name):
                endpoint = endpoint.split(self.blueprint.name + '.', 1)[-1]
            else:
                return False
        return endpoint in self.endpoints
206386
def dev(endpoint, **kwargs):
    
    kwargs['endpoint'] = endpoint
    os.environ['OPEN311_CITY_INFO'] = dumps(kwargs)
    return Three(**kwargs)
784099
def endpoint(self):
        
        if self._endpoint:
            return self._endpoint
        elif self._controller_cls:
            endpoint = f'{snake_case(self._controller_cls.__name__)}.{self.method_name}'
            return endpoint if not self.bp_name else f'{self.bp_name}.{endpoint}'
        elif self.bp_name:
            return f'{self.bp_name}.{self.method_name}'
        return f'{self.view_func.__module__}.{self.method_name}'
1230595
def get_endpoint(self, endpoint=None):
        """"""
        base_url = self.api_config.api_url
        if not endpoint:
            if 'localhost' in base_url:
                endpoint = ''
            else:
                endpoint = ENDPOINTS[self.endpoint_type]

        endpoint = '/'.join([p.strip('/') for p in (base_url, endpoint)]).strip('/')
        self.logger.info("Using Endpoint: %s", endpoint)
        return endpoint
829804
function EndPoint (local) {
  this.listeners = 0;
  this.dgram = dgram.createSocket('udp4');
  this.dgram.on('message', EndPoint.prototype.receive.bind(this));
  this.dgram.bind(local.port, local.address);
  this.local = this.dgram.address();
  this.packet = new Buffer(2048);
  this.sockets = {};
}
356019
def parse_endpoint(inputendpoint_xml)
      hash = Hash.new
      %w{LoadBalancedEndpointSetName LocalPort Name Port Protocol EnableDirectServerReturn LoadBalancerName IdleTimeoutInMinutes}.each do |key|
        hash[key] = xml_content(inputendpoint_xml, key, nil)
      end
      # Protocol could be in there twice... If we have two, pick the second one as the first is for the probe.
      if inputendpoint_xml.css("Protocol").count > 1
        hash["Protocol"] = inputendpoint_xml.css("Protocol")[1].content
      end
      probe = inputendpoint_xml.css("LoadBalancerProbe")
      if probe
        hash["LoadBalancerProbe"] = Hash.new
        %w{Path Port Protocol IntervalInSeconds TimeoutInSeconds}.each do |key|
          hash["LoadBalancerProbe"][key] = xml_content(probe, key, nil)
        end
      end
      hash
    end
14228
def get_endpoint(name, tags=None, region=None, key=None, keyid=None,
                 profile=None):
    '''
    

    '''
    endpoint = False
    res = __salt__['boto_rds.exists'](name, tags, region, key, keyid,
                                      profile)
    if res.get('exists'):
        try:
            conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
            if conn:
                rds = conn.describe_db_instances(DBInstanceIdentifier=name)

                if rds and 'Endpoint' in rds['DBInstances'][0]:
                    endpoint = rds['DBInstances'][0]['Endpoint']['Address']
                    return endpoint

        except ClientError as e:
            return {'error': __utils__['boto3.get_error'](e)}

    return endpoint
122830
private static EndPointInfo defineEndPoint(EndPointMgr epm, String name, String[] config) {
        String host = null;
        String port = null;
        for (int i = 0; i < config.length; i++) {
            String key = ChannelUtils.extractKey(config[i]);
            if ("host".equalsIgnoreCase(key)) {
                host = ChannelUtils.extractValue(config[i]);
            } else if ("port".equalsIgnoreCase(key)) {
                port = ChannelUtils.extractValue(config[i]);
            }
        }
        return epm.defineEndPoint(name, host, Integer.parseInt(port));
    }
1044007
def bind(self, address):
        """"""
        if self.uses_nanoconfig:
            raise ValueError("Nanoconfig address must be sole endpoint")
        endpoint_id = _nn_check_positive_rtn(
            wrapper.nn_bind(self._fd, address)
        )
        ep = Socket.BindEndpoint(self, endpoint_id, address)
        self._endpoints.append(ep)
        return ep
421830
def lookup_endpoint(cli):
    """"""
    url = '/applications/{0}/environment'.format(APPNAME)
    environ = cli.user.get(url).item
    port = environ['DOTCLOUD_SATELLITE_ZMQ_PORT']
    host = socket.gethostbyname(environ['DOTCLOUD_SATELLITE_ZMQ_HOST'])
    return "tcp://{0}:{1}".format(host, port)
65812
private function computeEndpoint(): UrlInterface
    {
        if (!$this->transactions->isOpened()) {
            return Url::fromString('/db/data/transaction/commit');
        }

        return $this->transactions->current()->endpoint();
    }
693967
def locate_endpoint_function(self, name=None):
        ''
        if name is not None:
            ep = "%s_%s" %(self._base_pathname,
                           name)
        else:
            ep = self._base_pathname
        return self._notflask.endpoints[ep]['view_func']
420354
def server_show(endpoint_id, server_id):
    
    client = get_client()

    server_doc = client.get_endpoint_server(endpoint_id, server_id)
    if not server_doc["uri"]:  # GCP endpoint server
        fields = (("ID", "id"),)
        text_epilog = dedent(
            """
            This server is for a Globus Connect Personal installation.

            For its connection status, try:
            globus endpoint show {}
        """.format(
                endpoint_id
            )
        )
    else:

        def advertised_port_summary(server):
            def get_range_summary(start, end):
                return (
                    "unspecified"
                    if not start and not end
                    else "unrestricted"
                    if start == 1024 and end == 65535
                    else "{}-{}".format(start, end)
                )

            return "incoming {}, outgoing {}".format(
                get_range_summary(
                    server["incoming_data_port_start"], server["incoming_data_port_end"]
                ),
                get_range_summary(
                    server["outgoing_data_port_start"], server["outgoing_data_port_end"]
                ),
            )

        fields = (
            ("ID", "id"),
            ("URI", "uri"),
            ("Subject", "subject"),
            ("Data Ports", advertised_port_summary),
        )
        text_epilog = None

    formatted_print(
        server_doc,
        text_format=FORMAT_TEXT_RECORD,
        fields=fields,
        text_epilog=text_epilog,
    )
136190
def connect(self, address):
        """"""
        if self.uses_nanoconfig:
            raise ValueError("Nanoconfig address must be sole endpoint")
        endpoint_id = _nn_check_positive_rtn(
            wrapper.nn_connect(self.fd, address)
        )
        ep = Socket.ConnectEndpoint(self, endpoint_id, address)
        self._endpoints.append(ep)
        return ep