Checks that the specified name is available for use by the specified
 network.

 @param name [String] the name to check for
 @param network [Network] the network to ignore
 @raise [CommandError] if the name is already taken
8455
def check_name_available_except!(name, network)
      return if name.nil? || network.name_eql?(name) || !find_network(name)

      raise CommandError, "a network with the name #{name.inspect} " \
                          'already exists'
    end
593164
def get_network_by_name_version(self, name: str, version: str) -> Optional[Network]:
        """"""
        name_version_filter = and_(Network.name == name, Network.version == version)
        network = self.session.query(Network).filter(name_version_filter).one_or_none()
        return network
243975
def get_available_name(self, name):
        
        local_available_name = self.local.get_available_name(name)
        remote_available_name = self.remote.get_available_name(name)

        if remote_available_name > local_available_name:
            return remote_available_name
        return local_available_name
754632
def deregister(cls, name: str) -> None:
        
        if name not in cls.available:
            raise ConnectionPluginNotRegistered(
                f"Connection {name!r} is not registered"
            )
        cls.available.pop(name)
342258
def _list_vlans_by_name(self, name):
        
        results = self.list_vlans(name=name, mask='id')
        return [result['id'] for result in results]
693732
def validate_name(name)
      raise InvalidIntrospectionData if name.bytesize > 255
      raise InvalidIntrospectionData if name =~ /^\./ || name =~ /\.$/
      raise InvalidIntrospectionData if name =~ /\.\./
      raise InvalidIntrospectionData if name !~ /\./
      name.split(".").each do |element|
        raise InvalidIntrospectionData if element !~ INTERFACE_ELEMENT_RE
      end
    end
787968
def name=(name)
      if name.nil?
        fail ArgumentError, "name cannot be nil"
      end

      if name !~ Regexp.new(/^(?!(.*[\\\"\\*\\\\\\>\\<\\?\/\\:\\|]+.*)|(.*[\\.]?.*[\\.]+$)|(.*[ ]+$))/)
        fail ArgumentError, "invalid value for 'name', must conform to the pattern /^(?!(.*[\\\"\\*\\\\\\>\\<\\?\/\\:\\|]+.*)|(.*[\\.]?.*[\\.]+$)|(.*[ ]+$))/."
      end

      @name = name
    end
229913
def is_valid_name_error(name: str, node: Node = None) -> Optional[GraphQLError]:
    """"""
    if not isinstance(name, str):
        raise TypeError("Expected string")
    if name.startswith("__"):
        return GraphQLError(
            f"Name {name!r} must not begin with '__',"
            " which is reserved by GraphQL introspection.",
            node,
        )
    if not re_name.match(name):
        return GraphQLError(
            f"Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but {name!r} does not.", node
        )
    return None
1091119
def delete_network_subname(self, sub_name):
        
        try:
            body = {}
            net_list = self.neutronclient.list_networks(body=body)
            for net in net_list:
                if net.get('name').find(sub_name) != -1:
                    self.delete_network_all_subnets(net.get('net_id'))
        except Exception as exc:
            LOG.error("Failed to get network by subname %(name)s, "
                      "Exc %(exc)s",
                      {'name': sub_name, 'exc': str(exc)})
117240
def has_name?( other, ns=nil )
      if ns
        return (namespace() == ns and name() == other)
      elsif other.include? ":"
        return fully_expanded_name == other
      else
        return name == other
      end
    end
221581
public void reserve(String name) {
    checkName(name);
    // if this is new
    if (reserved.add(name)) {
      // add it to names, so that generateName will still work for reserved names (they will just
      // get suffixes).
      if (!names.add(name)) {
        names.remove(name);
        throw new IllegalArgumentException("newly reserved name: " + name + " was already used!");
      }
    }
  }
509641
def override(name = nil, &block)
      if override = self.class.overrides(name)
        instance_eval(&override)
      else
        raise ArgumentError.new("no override by the name of #{name} has been configured")
      end
      self
    end
1004973
def is_name_registered( self, name ):
        
        name_rec = self.get_name( name )    # won't return the name if expired
        if name_rec is None:
            return False 

        if name_rec['revoked']:
            return False

        return True
52870
def check(name, **kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('app:check', **{
        'node': ctx.repo.create_secure_service('node'),
        'name': name,
    })
959410
def _name_exists(self, name):
        
        for i in range(self.count()):
            if self.tabText(i) == name:
                return True
        return False
136985
def resource_exists(self, name):
        """"""
        if name not in self.available:
            try:
                get_zoneinfo().getinfo('zoneinfo/' + name)
                self.available[name] = True
            except KeyError:
                self.available[name] = False

        return self.available[name]
50885
def available(name):
    '''
    
    '''
    cmd = '{0} get {1}'.format(_cmd(), name)
    if __salt__['cmd.retcode'](cmd) == 2:
        return False
    return True