Get proxified element.

    :param proxy: proxy element from where get proxified element.
    :return: proxified element. None if proxy is not proxified.
431362
def proxified_elt(proxy):
    

    if ismethod(proxy):
        proxy = get_method_function(proxy)
    result = getattr(proxy, __PROXIFIED__, None)

    return result
155504
public void getProxyInfos(Collection<ProxyInfo> result) {
        for (Map.Entry<String, DistributedObjectFuture> entry : proxies.entrySet()) {
            DistributedObjectFuture future = entry.getValue();
            if (future.isSetAndInitialized()) {
                String proxyName = entry.getKey();
                result.add(new ProxyInfo(serviceName, proxyName));
            }
        }
    }
847985
public Proxy asSeleniumProxy() {
        Proxy seleniumProxyConfig = new Proxy();

        seleniumProxyConfig.setProxyType(Proxy.ProxyType.MANUAL);
        seleniumProxyConfig.setHttpProxy(asHostAndPort());

        return seleniumProxyConfig;
    }
1359755
def get_proxy_parts(proxy):
    
    proxy_parts = {'schema': None,
                   'user': None,
                   'password': None,
                   'host': None,
                   'port': None,
                   }
    # Find parts
    results = re.match(proxy_parts_pattern, proxy)
    if results:
        matched = results.groupdict()
        for key in proxy_parts:
            proxy_parts[key] = matched.get(key)

    else:
        logger.error("Invalid proxy format `{proxy}`".format(proxy=proxy))

    if proxy_parts['port'] is None:
        proxy_parts['port'] = '80'

    return proxy_parts
865484
private ProxyLogicHandler getProxyHandler(final IoSession session) {
        ProxyLogicHandler handler = ((ProxyIoSession) session
                .getAttribute(ProxyIoSession.PROXY_SESSION)).getHandler();

        if (handler == null) {
            throw new IllegalStateException();
        }

        // Sanity check
        if (handler.getProxyIoSession().getProxyFilter() != this) {
            throw new IllegalArgumentException("Not managed by this filter.");
        }

        return handler;
    }
1039479
def extract_value(proxy):
    
    value = proxy.namespace.get(proxy.config_key, proxy.default)
    if value is UndefToken:
        raise errors.ConfigurationError("%s is missing value for: %s" %
            (proxy.namespace, proxy.config_key))

    try:
        return proxy.validator(value)
    except errors.ValidationError as e:
        raise errors.ConfigurationError("%s failed to validate %s: %s" %
            (proxy.namespace, proxy.config_key, e))
495929
public function updateProxy(ProxyGenerator &$proxy)
    {
        $proxy = $proxy->addMethod('manipulate', function ($args, $next) {
            $manipulation = $args[0];
            SearchUpdater::handle_manipulation($manipulation);
            return $next(...$args);
        });
    }
28817
@SuppressWarnings("deprecation")
	public Proxy getProxy(Proxy p) {
		if (p != null) {
			doInit(p);
		}
		mode = COMMAND_MODE;
		pack();
		show();
		return proxy;
	}
926262
def get_entity(self):
        
        if self._accessor is None:
            if self.__converted_entity is None:
                self.__converted_entity = self._convert_to_entity()
        else:
            # If we have an accessor, we can get the proxied entity by ID.
            # FIXME: This is a hack that is only used for REMOVE operations
            #        with data elements.
            self.__converted_entity = \
                self.get_matching(self.get_id()).get_entity()
        return self.__converted_entity
578255
def proxy_for(widget):
    
    proxy_type = widget_proxies.get(widget.__class__)
    if proxy_type is None:
        raise KeyError('There is no proxy type registered for %r' % widget)
    return proxy_type(widget)
801755
def get_proxies(self, proxy_url=None):
        
        query_parameters = {}
        if proxy_url is not None:
            query_parameters['proxyUrl'] = self._serialize.query('proxy_url', proxy_url, 'str')
        response = self._send(http_method='GET',
                              location_id='ec1f4311-f2b4-4c15-b2b8-8990b80d2908',
                              version='5.0-preview.2',
                              query_parameters=query_parameters)
        return self._deserialize('[Proxy]', self._unwrap_collection(response))
771356
def get_proxy():
    """"""
    proxies = _config['proxies']

    return proxies[
        random.randint(0, len(proxies) - 1)
    ] if len(proxies) > 0 else None
715204
public void setProxy(Proxy proxy)
    {
        if(proxy != null)
        {
            java.net.Proxy p = new java.net.Proxy(java.net.Proxy.Type.HTTP,
                    new InetSocketAddress(proxy.getHost(), proxy.getPort()));
            client.setProxy(p);
        }
        else
            client.setProxy(java.net.Proxy.NO_PROXY);
    }
384573
def _get_element(name, element_type, server=None, with_properties=True):
    '''
    
    '''
    element = {}
    name = quote(name, safe='')
    data = _api_get('{0}/{1}'.format(element_type, name), server)

    # Format data, get properties if asked, and return the whole thing
    if any(data['extraProperties']['entity']):
        for key, value in data['extraProperties']['entity'].items():
            element[key] = value
        if with_properties:
            element['properties'] = _get_element_properties(name, element_type)
        return element
    return None
224545
def get_element(parent_to_parse, element_path=None):
    

    if parent_to_parse is None:
        return None

    elif isinstance(parent_to_parse, ElementTree):
        parent_to_parse = parent_to_parse.getroot()

    elif hasattr(parent_to_parse, 'read'):
        parent_to_parse = string_to_element(parent_to_parse.read())

    elif isinstance(parent_to_parse, STRING_TYPES):
        parent_to_parse = string_to_element(parent_to_parse)

    elif isinstance(parent_to_parse, dict):
        parent_to_parse = dict_to_element(parent_to_parse)

    if parent_to_parse is None:
        return None
    elif not isinstance(parent_to_parse, ElementType):
        element_type = type(parent_to_parse).__name__
        raise TypeError('Invalid element type: {0}'.format(element_type))

    return parent_to_parse.find(element_path) if element_path else parent_to_parse
153171
def set_proxy (self, proxy):
        
        self.proxy = proxy
        self.proxytype = "http"
        self.proxyauth = None
        if not self.proxy:
            return
        proxyurl = urlparse.urlparse(self.proxy)
        self.proxytype = proxyurl.scheme
        if self.proxytype not in ('http', 'https'):
            # Note that invalid proxies might raise TypeError in urllib2,
            # so make sure to stop checking at this point, not later.
            msg = _("Proxy value `%(proxy)s' must start with 'http:' or 'https:'.") \
                 % dict(proxy=proxy)
            raise LinkCheckerError(msg)
        if self.ignore_proxy_host():
            # log proxy without auth info
            log.debug(LOG_CHECK, "ignoring proxy %r", self.proxy)
            self.add_info(_("Ignoring proxy setting `%(proxy)s'.") %
                dict(proxy=proxy))
            self.proxy = None
            return
        log.debug(LOG_CHECK, "using proxy %r", self.proxy)
        self.add_info(_("Using proxy `%(proxy)s'.") % dict(proxy=self.proxy))
        self.proxyhost = proxyurl.hostname
        self.proxyport = proxyurl.port
        if proxyurl.username is not None:
            username = proxyurl.username
            password = proxyurl.password if proxy.password is not None else ""
            auth = "%s:%s" % (username, password)
            self.proxyauth = "Basic "+httputil.encode_base64(auth)
636294
public InvocationHandler getInvocationHandler(Object proxy) {
        Field field = getInvocationHandlerField();
        try {
            return (InvocationHandler) field.get(proxy);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException("Object is not a proxy of correct type", e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }