Return a copy of the AuthContext object with the given key and
        value added.
971278
def with_value(self, key, val):
        ''' 
        '''
        new_dict = dict(self._dict)
        new_dict[key] = val
        return AuthContext(new_dict)
195429
async def create(cls, key: str):
        
        return cls._object(await cls._handler.create(key=key))
1069045
def create_and_add(self, key, value=None, cas=0, **options):
        
        itm = Item(key, value)
        itm.cas = cas
        return self.add(itm, **options)
480095
def _get(self, key, identity='image'):
        
        value = self._get_raw(add_prefix(key, identity))

        if not value:
            return None

        if identity == 'image':
            return deserialize_image_file(value)

        return deserialize(value)
1042804
def _get_context_from_gdoc(self, key):
        
        try:
            content = self.export_xlsx(key)
            data = process_xlsx(content)
            if 'values' in data:
                data = copy_global_values(data)
            return data
        except BadStatusLine:
            # Stale connection, reset API and data
            puts("Connection reset, reloading drive API")
            self.client = get_drive_api()
            return self._get_context_from_gdoc(key)
433080
def copy(self, key):
        
        copy = List(key, self.db)
        copy.clear()
        copy.extend(self)
        return copy
1133611
def add_exp_key(self, key, value, ex):
        ""
        return self.c.set(key, value, ex)
979568
def get(self, key=None, view=None):
        """"""
        self.set_header("Access-Control-Allow-Origin", "*")
        self.set_header("Content-Type", "application/json")
        if key is not None:
            value = {}
            value.update(self.database[key])
            if view is not None:
                # generate a context with the relevant variables
                context = {}
                context["value"] = value
                context["ctx"] = self.ctx
                result = json.dumps(getattr(views, view)(context))
            else:
                result = json.dumps(value)
        else:
            result = json.dumps(self.database.values())

        self.write(result)
606788
static public Object get(String key) {
        if (setContext()) {
            return m_context.get(key);
        } else {
            return m_defaultContext.get(key);
        }
    }
1001568
def create_authentication_from_json(values):
        """"""
        key_id = values.get('publicKey')
        authentication_type = values.get('type')
        if not key_id:
            raise ValueError(
                f'Invalid authentication definition, "publicKey" is missing: {values}')

        authentication = {'type': authentication_type, 'publicKey': key_id}

        return authentication
915742
public Object put(CacheKey key, Object value)
   {
      return put(key, value, false);
   }
873746
public final Object put(Object key, Object value) {
        return internalData.put(key, value);
    }
1310249
def then_the_return_value_for_is(context, key, value):
    
    assert key in context.apiRequest.data
    assert str(context.apiRequest.data[key]) == str(value)
1016026
@SuppressWarnings("unchecked")
    public final static <T extends Object> T getContext(String key) {
        Map<String, Object> ctx = CTX_HOLDER.get();
        if (ctx == null) {
            return null;
        }
        return (T) ctx.get(key);
    }
815808
public Object put(Object key, Object value) {
        mCacheMap.put(key, value);
        return mBackingMap.put(key, value);
    }
1193424
@SuppressWarnings("unchecked")
	public <T> T defineContextualValue(String key, Object value) {
		return (T) this.values.put(key,  value);
	}
1046983
def copy(self):
        """"""
        return self._fromset(set(self._set), key=self._key)