Return this Async's Context Id if it exists.
968122
def context_id(self):
        """"""
        if not self._context_id:
            self._context_id = self._get_context_id()
            self.update_options(context_id=self._context_id)

        return self._context_id
851243
function getContext(seneca) {
  var transactionId = seneca.fixedargs.tx$;
  var context = seneca.fixedargs.context$;

  if (typeof context === 'undefined') {
    try {
      context = seneca.fixedargs.context$ = JSON.parse(URLSafeBase64.decode(transactionId).toString('utf8'));
      debug('context loaded from tx$ and cached in context$', transactionId, context);
    } catch (error) {
      context = null;
      debug('context cannot be loaded from tx$', transactionId, error);
    }
  } else {
    debug('context loaded from context$', transactionId, context);
  }

  return context;
}
935564
def get_context(namespace, context_id):
    """"""
    context_obj = get_state(context_id, namespace=namespace)
    if not context_obj:
        raise ContextError("Context '{}' not found in namespace '{}'".format(
            context_id, namespace))
    return context_obj
1098062
def with_debug_id(debug_id):
        """"""
        ctx = SpanContext(
            trace_id=None, span_id=None, parent_id=None, flags=None
        )
        ctx._debug_id = debug_id
        return ctx
840956
@SuppressLint("HardwareIds")
  public static String getDeviceId(Context context) {
    String androidId = getString(context.getContentResolver(), ANDROID_ID);
    if (!isNullOrEmpty(androidId)
        && !"9774d56d682e549c".equals(androidId)
        && !"unknown".equals(androidId)
        && !"000000000000000".equals(androidId)) {
      return androidId;
    }

    // Serial number, guaranteed to be on all non phones in 2.3+.
    if (!isNullOrEmpty(Build.SERIAL)) {
      return Build.SERIAL;
    }

    // Telephony ID, guaranteed to be on all phones, requires READ_PHONE_STATE permission
    if (hasPermission(context, READ_PHONE_STATE) && hasFeature(context, FEATURE_TELEPHONY)) {
      TelephonyManager telephonyManager = getSystemService(context, TELEPHONY_SERVICE);
      @SuppressLint("MissingPermission")
      String telephonyId = telephonyManager.getDeviceId();
      if (!isNullOrEmpty(telephonyId)) {
        return telephonyId;
      }
    }

    // If this still fails, generate random identifier that does not persist across installations
    return UUID.randomUUID().toString();
  }
1223826
protected String getId(FaceletContext ctx)
    {
        if (this._id != null)
        {
            return this._id.getValue(ctx);
        }
        return ctx.generateUniqueId(_delegate.getTagId());
    }
314695
function getContext() {
	const ctx = java.lang.Class.forName("android.app.AppGlobals").getMethod("getInitialApplication", null).invoke(null, null);
	if (ctx) { return ctx; }

	return java.lang.Class.forName("android.app.ActivityThread").getMethod("currentApplication", null).invoke(null, null);
}
737294
def getContext(self, context_name = 'default'):
		
		if context_name == 'default' and 'default' not in self.contexts:
			self('default')

		return self.contexts[context_name]
591524
public static ControlContainerContext getContext() 
    {
        Stack<ControlContainerContext> contextStack = _threadContexts.get();
        if (contextStack == null || contextStack.size() == 0)
            return null;

        return contextStack.peek();
    }
208536
function getContext(i) {
  if (context) {
    return context
  } else {
    const path = getCallsite(i || 2).getFileName()
    const file = files[path]
    if (file) return file.group
    throw Error(`Test module was not loaded properly: "${path}"`)
  }
}
600738
def get_task_id(self):
        """"""
        task_id = self.json_response.get("task_id", None)
        self.logger.info("%s\t%s" % (self.request_method, self.request_url))
        return task_id
804361
private static String getRegistrationId(Context context) {
        final SharedPreferences prefs = getGcmPreferences(context);
        String registrationId = prefs.getString(PROPERTY_REG_ID, "");
        if (registrationId.isEmpty()) {
            return "";
        }
        // Check if app was updated; if so, it must clear the registration ID
        // since the existing regID is not guaranteed to work with the new
        // app version.
        int registeredVersion = prefs.getInt(PROPERTY_APP_VERSION, Integer.MIN_VALUE);
        int currentVersion = getAppVersion(context);
        if (registeredVersion != currentVersion) {
            return "";
        }

        if (OrtcClient.getOnRegistrationId() != null){
            OrtcClient.getOnRegistrationId().run(registrationId);
        }

        return registrationId;
    }
497809
def get_current_context():
    
    local_context = _local.get_local_context()

    if local_context.registry:
        return local_context.registry[-1]

    raise errors.NotInContextError('Not in a Context.')
590596
def get_next_invoke_id(self, addr):
        """"""
        if _debug: StateMachineAccessPoint._debug("get_next_invoke_id")

        initialID = self.nextInvokeID
        while 1:
            invokeID = self.nextInvokeID
            self.nextInvokeID = (self.nextInvokeID + 1) % 256

            # see if we've checked for them all
            if initialID == self.nextInvokeID:
                raise RuntimeError("no available invoke ID")

            for tr in self.clientTransactions:
                if (invokeID == tr.invokeID) and (addr == tr.pdu_address):
                    break
            else:
                break

        return invokeID
499364
def context_exists(self, name):
        """"""
        contexts = self.data['contexts']
        for context in contexts:
            if context['name'] == name:
                return True
        return False
1013181
public static String getCurrentId()
  {
    SystemManager system = getCurrent();

    if (system == null) {
      ClassLoader loader = Thread.currentThread().getContextClassLoader();

      throw new IllegalStateException(L.l("{0} is not available in this context.\n  {1}",
                                          SystemManager.class.getSimpleName(),
                                          loader));
    }

    return system.getId();
  }
306768
def exists(name):
    '''
    
    '''
    contextkey = 'nspawn.exists.{0}'.format(name)
    if contextkey in __context__:
        return __context__[contextkey]
    __context__[contextkey] = name in list_all()
    return __context__[contextkey]