Ensure the given argument is a valid Wavefront source name

 @param source [String] the source name to validate
 @return True if the source name is valid
 @raise Wavefront::Exception::InvalidSourceId if the source name
   is not valid
431090
def wf_source_id?(source)
      if source.is_a?(String) && source.match(/^[\w\.\-]+$/) &&
         source.size < 1024
        return true
      end

      raise Wavefront::Exception::InvalidSourceId
    end
46472
def source_partial_exists?
      if @site.respond_to?(:in_source_dir)
        File.exists? @site.in_source_dir("_app.yaml")
      else
        File.exists? Jekyll.sanitized_path(@site.source, "_app.yaml")
      end
    end
1282161
private static boolean isValidHeaderMagic(OrcDataSource source)
            throws IOException
    {
        byte[] headerMagic = new byte[MAGIC.length()];
        source.readFully(0, headerMagic);

        return MAGIC.equals(Slices.wrappedBuffer(headerMagic));
    }
1115595
def wf_derivedmetric_id?(id)
      id = id.to_s if id.is_a?(Numeric)
      return true if id.is_a?(String) && id =~ /^\d{13}$/

      raise Wavefront::Exception::InvalidDerivedMetricId
    end
267824
public boolean sourceExists(String name) {

        if (name != null && name.equals(getTemplateName())) {
            return true;
        }

        // Look for a .tea file
        return super.sourceExists(name);
    }
590943
def wf_version?(version)
      version = version.to_i if version.is_a?(String) && version =~ /^\d+$/
      return true if version.is_a?(Integer) && version.positive?
      raise Wavefront::Exception::InvalidVersion
    end
854568
def wf_metric_name?(metric)
      if metric.is_a?(String) && metric.size < 1024 &&
         (metric.match(/^#{DELTA}?[\w\-\.]+$/) ||
          metric.match(%r{^\"#{DELTA}?[\w\-\.\/,]+\"$}))
        return true
      end

      raise Wavefront::Exception::InvalidMetricName
    end
343294
def is_valid?
      result = false == is_blank?(@volume_id) &&
               false == is_blank?(@device_name) &&
               false == is_blank?(@volume_status) &&
               false == is_blank?(@mount_points) &&
               nil == @mount_points.find { |mount_point| is_blank?(mount_point) }
      return result
    end
435522
def valid?
      return false if @id.nil?
      return false if @name.nil?
      authenticator_validator = EnumAttributeValidator.new('String', ["local", "ldap"])
      return false unless authenticator_validator.valid?(@authenticator)
      return true
    end
999285
def hash_to_wf(point)
      format('%s %s %s source=%s %s %s',
             *point_array(point)).squeeze(' ').strip
    rescue StandardError
      raise Wavefront::Exception::InvalidPoint
    end
429361
def valid?
      begin
        self.each do |threshold|
          if threshold.respond_to?(:valid?)
            return false unless threshold.valid?
          else
            raise InvalidThresholdsObject, "Container object has unknown objects"
          end
        end
        return true
      rescue InvalidThresholdsObject
        return false
      end
    end
844902
def source
      @source ||= Dassets.config.sources.select do |source|
        @file_path =~ /^#{slash_path(source.path)}/
      end.last
    end
891526
public static boolean validateResource(URI uri) {
        return uri != null && uri.getPort() != -1 && uri.getHost() != null;
    }
5427
def valid?
      return false if @id.nil?
      return false if @created_at.nil?
      return false if @updated_at.nil?
      creation_source_validator = EnumAttributeValidator.new('String', ["OTHER", "APPOINTMENTS", "COUPON", "DELETION_RECOVERY", "DIRECTORY", "EGIFTING", "EMAIL_COLLECTION", "FEEDBACK", "IMPORT", "INVOICES", "LOYALTY", "MARKETING", "MERGE", "ONLINE_STORE", "INSTANT_PROFILE", "TERMINAL", "THIRD_PARTY", "THIRD_PARTY_IMPORT", "UNMERGE_RECOVERY"])
      return false unless creation_source_validator.valid?(@creation_source)
      return true
    end
247132
def _id_for_source(self, name):
        
        if not name in self.source2id_lut:
            self.c.execute("INSERT INTO sources (name) VALUES ( ? )", (name,))
            self.source2id_lut[name] = self.c.lastrowid
            self.id2source_lut[self.c.lastrowid] = name
        return self.source2id_lut[name]
466687
function(ledName) {
      var result = this.isValidLEDName(ledName) ? tessel.port[this.validLEDNames.indexOf(ledName)] : null;

      return result;
    }
1319629
def wf_link_id?(id)
      return true if id.is_a?(String) && id =~ /^\w{16}$/
      raise Wavefront::Exception::InvalidExternalLinkId
    end