Checks the given title against the given API specifications to ensure it's short enough
199530
def _check_title_length(title, api):
    '''  '''
    if len(title) > api.MAX_SUBTASK_TITLE_LENGTH:
        raise ValueError("Title cannot be longer than {} characters".format(api.MAX_SUBTASK_TITLE_LENGTH))
415441
private String ensureQualified(String name) {
        String qualifier = String.format("%s.", this.modelInfo.getName());
        if (!name.startsWith(qualifier)) {
            return String.format("%s%s", qualifier, name);
        }

        return name;
    }
204877
def title(self):
        """"""
        if self.event:
            if self.release['name']:
                return u'{0}: {1}'.format(
                    self.repository['full_name'], self.release['name']
                )
        return u'{0} {1}'.format(self.repo_model.name, self.model.tag)
362663
protected function validateMetaTitle()
    {
        $field = 'meta_title';
        $value = $this->getSubmitted($field);

        if (!isset($value)) {
            $this->unsetSubmitted($field);
            return true;
        }

        if (mb_strlen($value) > 60) {
            $this->setErrorLengthRange($field, $this->translation->text('Meta title'), 0, 60);
            return false;
        }

        return true;
    }
1372475
function determineWMSTitle(json, version) {
	var ret = '';

	if (version == '1.3.0') {
		if (json.WMS_Capabilities.Service) {
			if (json.WMS_Capabilities.Service[0]) {
				if (json.WMS_Capabilities.Service[0].Title) {
					if (json.WMS_Capabilities.Service[0].Title[0]) {
						ret = json.WMS_Capabilities.Service[0].Title[0];
					}
				}
			}
		}
	} else {
		if (version == '1.1.1' || version == '1.1.0' || version == '1.0.0') {
			if (json.WMT_MS_Capabilities.Service) {
				if (json.WMT_MS_Capabilities.Service[0]) {
					if (json.WMT_MS_Capabilities.Service[0].Title) {
						if (json.WMT_MS_Capabilities.Service[0].Title[0]) {
							ret = json.WMT_MS_Capabilities.Service[0].Title[0];
						}
					}
				}
			}
		}
	}

	return ret;
}
1225375
function spec(req, res) {
    if (req.uri.pathname !== specification) return;

    res.statusCode = 200;
    res.setHeader('Content-Type', 'application/json');
    res.end(JSON.stringify(primus.spec));

    return true;
  }
375694
private static boolean compareTitles(String primaryTitle, String firstCompareTitle, String secondCompareTitle, int maxDistance) {
        // Compare with the first title
        if (compareDistance(primaryTitle, firstCompareTitle, maxDistance)) {
            return true;
        }

        // Compare with the other title
        return compareDistance(primaryTitle, secondCompareTitle, maxDistance);
    }
1329549
function verifyListSpacing(properties) {
            const length = properties.length;

            for (let i = 0; i < length; i++) {
                verifySpacing(properties[i], singleLineOptions);
            }
        }
798525
function _makeNodeTitleMatcher(s) {
		s = s.toLowerCase();
		return function(node) {
			return node.title.toLowerCase().indexOf(s) >= 0;
		};
	}
862940
def get_title():
    ''' 
    '''
    MAX_LEN = 256
    buffer_ = create_unicode_buffer(MAX_LEN)
    kernel32.GetConsoleTitleW(buffer_, MAX_LEN)
    log.debug('%s', buffer_.value)
    return buffer_.value
581201
def title(cls):
        """"""
        if cls.__title_length__ is None:
            column_type = UnicodeText()
        else:
            column_type = Unicode(cls.__title_length__)
        return Column(column_type, nullable=False)
1358530
def check_requirements(dist, attr, value):
    """"""
    try:
        list(pkg_resources.parse_requirements(value))
    except (TypeError,ValueError):
        raise DistutilsSetupError(
            "%r must be a string or list of strings "
            "containing valid project/version requirement specifiers" % (attr,)
        )
243018
def valid_api_key(ctx, param, value):
    
    if value is not None and len(value) != 32:
        raise click.BadParameter(
            "API Key must be 32 characters long, not {}".format(str(len(value)))
        )
    else:
        return value
1176542
function validateSpec (api) {
  if (api.openapi) {
    // We don't (yet) support validating against the OpenAPI spec
    return;
  }

  var paths = Object.keys(api.paths || {});
  var operationIds = [];
  paths.forEach(function (pathName) {
    var path = api.paths[pathName];
    var pathId = "/paths" + pathName;

    if (path && pathName.indexOf("/") === 0) {
      validatePath(api, path, pathId, operationIds);
    }
  });
  var definitions = Object.keys(api.definitions || {});
  definitions.forEach(function (definitionName) {
    var definition = api.definitions[definitionName];
    var definitionId = "/definitions/" + definitionName;
    validateRequiredPropertiesExist(definition, definitionId);
  });
}
63916
def validate_appname_or_none(option, value):
    """"""
    if value is None:
        return value
    validate_string(option, value)
    # We need length in bytes, so encode utf8 first.
    if len(value.encode('utf-8')) > 128:
        raise ValueError("%s must be <= 128 bytes" % (option,))
    return value
1233015
def check_api_version(resource_root, min_version):
  
  if resource_root.version < min_version:
    raise Exception("API version %s is required but %s is in use."
        % (min_version, resource_root.version))
1360892
private String determineDefinitionTitle(Parameters params) {
       if (params.model.getTitle() != null) {
            return params.model.getTitle();
        } else {
            return params.definitionName;
        }
    }