Check whether global variable is locked

        :param str gv_name: Name of global variable to be checked
        :param str intro_message: Message which is used form a useful logger error message if needed
        :return:
765887
def global_variable_is_editable(self, gv_name, intro_message='edit'):
        
        if self.model.global_variable_manager.is_locked(gv_name):
            logger.error("{1} of global variable '{0}' is not possible, as it is locked".format(gv_name, intro_message))
            return False
        return True
645108
def check_errors(self, is_global=False):
    
    errors = self.global_errors if is_global else self.errors
    if errors:
      print('dfTimewolf encountered one or more errors:')
      for error, critical in errors:
        print('{0:s}  {1:s}'.format('CRITICAL: ' if critical else '', error))
        if critical:
          print('Critical error found. Aborting.')
          sys.exit(-1)
386121
@Override
	public Value check(ILexNameToken name)
	{
		Value v = get(name);

		if (v != null)
		{
			return v;
		}

		if (freeVariables != null)
		{
			v = freeVariables.get(name);

			if (v != null)
			{
				return v;
			}
		}

		// A RootContext stops the name search from continuing down the
		// context chain. It first checks any state context, then goes
		// down to the global level.

		if (v == null)
		{
			if (stateCtxt != null)
			{
				v = stateCtxt.check(name);

				if (v != null)
				{
					return v;
				}
			}

			Context g = getGlobal();

			if (g != this)
			{
				return g.check(name);
			}
		}

		return v;
	}
508688
private void checkNameVisibility(Scope scope, Node name) {
    if (!name.isName()) {
      return;
    }

    Var var = scope.getVar(name.getString());
    if (var == null) {
      return;
    }

    Visibility v = checkPrivateNameConvention(
        AccessControlUtils.getEffectiveNameVisibility(
            name, var, defaultVisibilityForFiles), name);

    switch (v) {
      case PACKAGE:
        if (!isPackageAccessAllowed(var, name)) {
          compiler.report(
              JSError.make(
                  name,
                  BAD_PACKAGE_PROPERTY_ACCESS,
                  name.getString(),
                  var.getSourceFile().getName()));
        }
        break;
      case PRIVATE:
        if (!isPrivateAccessAllowed(var, name)) {
          compiler.report(
              JSError.make(
                  name,
                  BAD_PRIVATE_GLOBAL_ACCESS,
                  name.getString(),
                  var.getSourceFile().getName()));
        }
        break;
      default:
        // Nothing to do for PUBLIC and PROTECTED
        // (which is irrelevant for names).
        break;
    }
  }
1129645
def getVariable(self, name):
        
        return lock_and_call(
            lambda: Variable(self._impl.getVariable(name)),
            self._lock
        )
1217665
def check_lazy_load_gewest(f):
    '''
    
    '''
    def wrapper(self):
        gewest = self
        attribute = 'namen' if f.__name__ == 'naam' else f.__name__
        if (getattr(gewest, '_%s' % attribute, None) is None):
            log.debug('Lazy loading Gewest %d', gewest.id)
            gewest.check_gateway()
            g = gewest.gateway.get_gewest_by_id(gewest.id)
            gewest._namen = g._namen
            gewest._centroid = g._centroid
            gewest._bounding_box = g._bounding_box
        return f(self)
    return wrapper
272582
def get_global_step_var():
    
    scope = tfv1.VariableScope(reuse=False, name='')  # the root vs
    with tfv1.variable_scope(scope):
        var = tfv1.train.get_or_create_global_step()
    return var
591250
def ensure_callback_server_started(gw):
    

    # getattr will fallback to JVM, so we cannot test by hasattr()
    if "_callback_server" not in gw.__dict__ or gw._callback_server is None:
        gw.callback_server_parameters.eager_load = True
        gw.callback_server_parameters.daemonize = True
        gw.callback_server_parameters.daemonize_connections = True
        gw.callback_server_parameters.port = 0
        gw.start_callback_server(gw.callback_server_parameters)
        cbport = gw._callback_server.server_socket.getsockname()[1]
        gw._callback_server.port = cbport
        # gateway with real port
        gw._python_proxy_port = gw._callback_server.port
        # get the GatewayServer object in JVM by ID
        jgws = JavaObject("GATEWAY_SERVER", gw._gateway_client)
        # update the port of CallbackClient with real port
        jgws.resetCallbackClient(jgws.getCallbackClient().getAddress(), gw._python_proxy_port)
735195
private synchronized boolean msgCanBeSent( long stamp, boolean nackMsg )
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(this, tc, "msgCanBeSent", new Object[] { Long.valueOf(stamp),
          Boolean.valueOf(nackMsg),
          Long.valueOf(firstMsgOutsideWindow),
          Boolean.valueOf(containsGuesses)});

    boolean sendMessage = true;
    
    // Check whether we can send the message
    // Don't send any messages once there is a guess in the stream (unless a NACK)
    if ((stamp >= firstMsgOutsideWindow) || (containsGuesses && !nackMsg))
    {
      sendMessage = false;
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
      {
        SibTr.debug(tc, "firstMsgOutsideWindow is: " + firstMsgOutsideWindow
        + " sendWindow is " +  sendWindow + " containsGuesses is " + containsGuesses);
      }
    }
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "msgCanBeSent", Boolean.valueOf(sendMessage));

    return sendMessage;
  }
583128
@Override
	public Value check(ILexNameToken name)
	{
		// A RootContext stops the name search from continuing down the
		// context chain. It first checks any local context, then it
		// checks the "class" context, then it goes down to the global level.

		Value v = get(name); // Local variables

		if (v != null)
		{
			return v;
		}

		if (freeVariables != null)
		{
			v = freeVariables.get(name);

			if (v != null)
			{
				return v;
			}
		}

		v = assistantFactory.createSClassDefinitionAssistant().getStatic(classdef, name);

		if (v != null)
		{
			return v;
		}

		Context g = getGlobal();

		if (g != this)
		{
			return g.check(name);
		}

		return v;
	}
937368
def thread_global(name, default_value = nil)
      is_a?(Module) or raise TypeError, "receiver has to be a Module"

      name = name.to_s
      var_name = "@__#{name}_#{__id__.abs}__"

      lock = Mutex.new
      modul = self

      define_method(name) do
        lock.synchronize { modul.instance_variable_get var_name }
      end

      define_method(name + "=") do |value|
        lock.synchronize { modul.instance_variable_set var_name, value }
      end

      modul.instance_variable_set var_name, default_value if default_value
      self
    end
228226
def main(*argv):
    
    try:
        url = str(argv[0])

        arcgisSH = ArcGISTokenSecurityHandler()
        if arcgisSH.valid == False:
            arcpy.AddError(arcgisSH.message)
            return
        fl = FeatureLayer(
            url=url,
            securityHandler=arcgisSH,
            initialize=True)

        res = fl.query(where="1=1",out_fields='*',returnGeometry=False)
        arcpy.AddMessage(res)
        arcpy.SetParameterAsText(1, str(res))
    except arcpy.ExecuteError:
        line, filename, synerror = trace()
        arcpy.AddError("error on line: %s" % line)
        arcpy.AddError("error in file name: %s" % filename)
        arcpy.AddError("with error message: %s" % synerror)
        arcpy.AddError("ArcPy Error Message: %s" % arcpy.GetMessages(2))
    except FunctionError, f_e:
        messages = f_e.args[0]
        arcpy.AddError("error in function: %s" % messages["function"])
        arcpy.AddError("error on line: %s" % messages["line"])
        arcpy.AddError("error in file name: %s" % messages["filename"])
        arcpy.AddError("with error message: %s" % messages["synerror"])
        arcpy.AddError("ArcPy Error Message: %s" % messages["arc"])
    except:
        line, filename, synerror = trace()
        arcpy.AddError("error on line: %s" % line)
        arcpy.AddError("error in file name: %s" % filename)
        arcpy.AddError("with error message: %s" % synerror)
914928
def _onGlobal(self, name, line, pos, absPosition, level):
        """"""
        # level is ignored
        for item in self.globals:
            if item.name == name:
                return
        self.globals.append(Global(name, line, pos, absPosition))
1045116
def log_gc_stats_on_request_begin
      return do_nothing_on_null(:log_gc_stats_on_request_begin) if null?

      # See the docs for MUTEX on why we synchronize this.
      GC_MUTEX.synchronize do
        if OBJECT_SPACE_SUPPORTS_LIVE_OBJECTS
          @transaction.message('Initial objects on heap: ' \
            "#{ObjectSpace.live_objects}")
        end
        if OBJECT_SPACE_SUPPORTS_ALLOCATED_OBJECTS
          @transaction.message('Initial objects allocated so far: ' \
            "#{ObjectSpace.allocated_objects}")
        elsif OBJECT_SPACE_SUPPORTS_COUNT_OBJECTS
          count = ObjectSpace.count_objects
          @transaction.message('Initial objects allocated so far: ' \
            "#{count[:TOTAL] - count[:FREE]}")
        end
        if GC_SUPPORTS_TIME
          @transaction.message("Initial GC time: #{GC.time}")
        end
      end
    end
84422
def _ensure_global(self, values=None):
        
        if self._gpayload is None:
            self._gpayload = values or {}
        self.enable()
212794
def debug(self, message, domain=None):
        
        if domain is None:
            domain = self.extension_name
        debug(message, domain)
1158515
def primaryName(self, value: Optional[str]) -> None:
        
        if value is not None:
            self.warned_no_primary = False
        self.primaryNames[self.viewNo] = value
        self.compact_primary_names()
        if value != self._primaryName:
            self._primaryName = value
            self.logger.info("{} setting primaryName for view no {} to: {}".
                             format(self, self.viewNo, value))
            if value is None:
                # Since the GC needs to happen after a primary has been
                # decided.
                return
            self._gc_before_new_view()
            if self.__should_reset_watermarks_before_new_view():
                self._reset_watermarks_before_new_view()