Provides Zenpy's default HTTPAdapter args for those users providing their own adapter.
12945
def http_adapter_kwargs():
        

        return dict(
            # Transparently retry requests that are safe to retry, with the exception of 429. This is handled
            # in the Api._call_api() method.
            max_retries=Retry(
                total=3,
                status_forcelist=[r for r in Retry.RETRY_AFTER_STATUS_CODES if r != 429],
                respect_retry_after_header=False
            )
        )
1206474
def get_connection(self, *args, **kwargs):
        
        conn = super(SSLHTTPAdapter, self).get_connection(*args, **kwargs)
        if conn.assert_hostname != self.assert_hostname:
            conn.assert_hostname = self.assert_hostname
        return conn
1354772
public void setAdapter(PagerAdapter adapter) {
    if (mAdapter != null) {
      mAdapter.unregisterDataSetObserver(mObserver);
      mAdapter.startUpdate(this);
      mAdapter.destroyItem(this, mCurrentPosition, mCurrentFragment);
      mAdapter.finishUpdate(this);
      mCurrentPosition = 0;
    }

    mAdapter = adapter;
    mExpectedAdapterCount = 0;

    if (mAdapter != null) {
      if (mObserver == null) {
        mObserver = new PagerObserver();
      }
      mAdapter.registerDataSetObserver(mObserver);
      mPopulatePending = false;
      final boolean wasFirstLayout = mFirstLayout;
      mFirstLayout = true;
      mExpectedAdapterCount = mAdapter.getCount();
      if (mRestoredCurItem >= 0) {
        mAdapter.restoreState(mRestoredAdapterState, mRestoredClassLoader);
        setCurrentItemInternal(mRestoredCurItem, true);
        mRestoredCurItem = -1;
        mRestoredAdapterState = null;
        mRestoredClassLoader = null;
      } else if (!wasFirstLayout) {
        populate();
      } else {
        requestLayout();
      }
    }
  }
553734
function createAdapter(type) {
    var adapterConfig = adaptersConfig[type];
    if (!adapterConfig) {
        throw new Error('Adapter type ' + type + ' has not been registered.');
    }
    return new DebugAdapter(adaptersConfig[type], adaptersCwd[type]);
}
204246
def etcd(url=DEFAULT_URL, mock=False, **kwargs):
    """"""
    if mock:
        from etc.adapters.mock import MockAdapter
        adapter_class = MockAdapter
    else:
        from etc.adapters.etcd import EtcdAdapter
        adapter_class = EtcdAdapter
    return Client(adapter_class(url, **kwargs))
1169607
public void setAdapter(final BaseCircularViewAdapter adapter) {
        mAdapter = adapter;
        if (mAdapter != null) {
            mAdapter.registerDataSetObserver(mAdapterDataSetObserver);
        }
        postInvalidate();
    }
296011
private static Adapter unwrapAdapter(Adapter adapter) {
        return adapter instanceof WrapperListAdapter
                ? unwrapAdapter(((WrapperListAdapter) adapter).getWrappedAdapter())
                : adapter;
    }
716299
def _make_target_adaptor(base_class, target_type):
  """"""
  if not target_type.supports_default_sources() or target_type.default_sources_globs is None:
    return base_class

  globs = _tuplify(target_type.default_sources_globs)
  excludes = _tuplify(target_type.default_sources_exclude_globs)

  class GlobsHandlingTargetAdaptor(base_class):
    @property
    def default_sources_globs(self):
      if globs is None:
        return super(GlobsHandlingTargetAdaptor, self).default_sources_globs
      else:
        return globs

    @property
    def default_sources_exclude_globs(self):
      if excludes is None:
        return super(GlobsHandlingTargetAdaptor, self).default_sources_exclude_globs
      else:
        return excludes

  return GlobsHandlingTargetAdaptor
460333
function(httpAdapter, options) {
  if (!this.constructor.name) {
    throw new Error('The Constructor must be named');
  }

  this.name = formatGeocoderName(this.constructor.name);

  if (!httpAdapter || httpAdapter == 'undefined') {
    throw new Error(this.constructor.name + ' need an httpAdapter');
  }
  this.httpAdapter = httpAdapter;

  if (!options || options == 'undefined') {
    options = {};
  }

  if (this.options) {
    this.options.forEach(function(option) {
      if (!options[option] || options[option] == 'undefined') {
        options[option] = null;
      }
    });
  }

  this.options = options;
}
1100760
function findAdapter(adapters, mediaType, method) {
  for (let i = 0; i < adapters.length; i += 1) {
    if (adapters[i].mediaTypes.indexOf(mediaType) !== -1 && adapters[i][method]) {
      return adapters[i];
    }
  }

  return null;
}
333833
protected void setUpAdapter() {
        if (mAdapter == null) {
            mAdapter = new SimpleMonthAdapter(getContext(), mController);
        } else {
            mAdapter.setSelectedDay(mSelectedDay);
            mAdapter.notifyDataSetChanged();
        }
        // refresh the view with the new parameters
        mAdapter.notifyDataSetChanged();
    }
25811
def get_http_method_arg_name(self):
        
        if self.method == 'get':
            arg_name = 'params'
        else:
            arg_name = 'data'
        return getattr(requests, self.method), arg_name
1122461
def add_argument(*args, **kwargs):
    

    def decorator(func):
        func = ScriptAdaptor._wrap(func)
        func._add_argument(args, kwargs)
        return func
    return decorator
12423
def get_adapted_session(adapter):
        
        session = requests.Session()
        session.mount("http://", adapter)
        session.mount("https://", adapter)
        return session
1205456
def add_adapter(self, adapter):
        """"""

        if self._started:
            raise InternalError("New adapters cannot be added after start() is called")

        if isinstance(adapter, DeviceAdapter):
            self._logger.warning("Wrapping legacy device adapter %s in async wrapper", adapter)
            adapter = AsynchronousModernWrapper(adapter, loop=self._loop)

        self.adapters.append(adapter)

        adapter_callback = functools.partial(self.handle_adapter_event,
                                             len(self.adapters) - 1)
        events = ['device_seen', 'broadcast', 'report', 'connection',
                  'disconnection', 'trace', 'progress']

        adapter.register_monitor([None], events, adapter_callback)
109202
async def make_default_options_response(self) -> Response:
        """"""
        methods = _request_ctx_stack.top.url_adapter.allowed_methods()
        return self.response_class('', headers={'Allow': ', '.join(methods)})
1146936
private InvocationHandlerAdapter getInvocationHandlerAdapter(Object instance) {
        if (instance == null) {
            return null;
        }

        return mocks.get(instance);
    }