Ensure custom observable object extensions follow strict naming style
    conventions.
6744
def custom_object_extension_prefix_strict(instance):
    
    for key, obj in instance['objects'].items():
        if not ('extensions' in obj and 'type' in obj and
                obj['type'] in enums.OBSERVABLE_EXTENSIONS):
            continue
        for ext_key in obj['extensions']:
            if (ext_key not in enums.OBSERVABLE_EXTENSIONS[obj['type']] and
                    not CUSTOM_TYPE_PREFIX_RE.match(ext_key)):
                yield JSONError("Custom Cyber Observable Object extension type"
                                " '%s' should start with 'x-' followed by a source "
                                "unique identifier (like a domain name with dots "
                                "replaced by hyphens), a hyphen and then the name."
                                % ext_key, instance['id'],
                                'custom-prefix')
645371
function build_ext_define_patterns(namespaces) {
  var mappedNamespaced = _.map(namespaces, function(ns) {
    [ns + ".define", ns + ".ClassManager.create"]
  });
  return _.flatten(mappedNamespaced);
}
1052348
def fully_qualified_name(obj, sep='.'):
    """"""
    if inspect.isclass(obj):
        return obj.__module__ + sep + obj.__name__
    else:
        return obj.__module__ + sep + obj.__class__.__name__
746068
public void overwriteDeclaredType(StaticScope scope, String name, JSType type) {
    checkState(isDeclaredForScope(scope, name), "missing name %s", name);
    reregister(scope, type, name);
  }
1340305
function ensureParamName(param, expectedParamName, preventDestructuring) {
      if (param) {
        if (param.type === 'ObjectPattern' && preventDestructuring) {
          context.report(
            param,
            `Unexpected destructuring, use name "${expectedParamName}"`
          );
        } else if (
          param.type === 'Identifier' &&
          param.name !== expectedParamName
        ) {
          context.report(
            param,
            `Invalid parameter name, use "${expectedParamName}" instead`
          );
        }
      }
    }
1137220
def window_specialization(typename):
    """"""
    return Extension(
        'zipline.lib._{name}window'.format(name=typename),
        ['zipline/lib/_{name}window.pyx'.format(name=typename)],
        depends=['zipline/lib/_windowtemplate.pxi'],
    )
1193849
function nameClause(previousExpr, detection ) {
     
      var name = detection[NAME_INDEX],
            
          matchesName = ( !name || name == '*' ) 
                           ?  always
                           :  function(ascent){return headKey(ascent) == name};
     

      return lazyIntersection(matchesName, previousExpr);
   }
851831
function typeCreateHandler(docObject, newScope) {
		
		docObject && addDocObjectToDocMap(docObject, docMap, filename, comment && comment.line);
		if (newScope) {
			scope = newScope;
		}
	}
876561
def strict(*types):
    """"""

    def decorate(func):
        @wraps(func)
        def wrapper(self, p):
            func(self, p)
            if not isinstance(p[0], types):
                raise YAMLStrictTypeError(p[0], types, func)

        wrapper.co_firstlineno = func.__code__.co_firstlineno
        return wrapper

    return decorate
7710
function cleanFunctionName(name) {
  for (const reg of [
    objectProperty,
    arrayProperty,
    functionProperty,
    annonymousProperty
  ]) {
    const match = reg.exec(name);
    if (match) {
      return match[1];
    }
  }

  return name;
}
1061364
private void ensureLegacyParsed() {
        if ((legacyChanged == false) || (legacyStrings == null)) {
            return;
        }
        serviceSet = null;
        if (legacyMap == null) {
            legacyMap = new LinkedHashMap<ServiceKey,Service>();
        } else {
            legacyMap.clear();
        }
        for (Map.Entry<String,String> entry : legacyStrings.entrySet()) {
            parseLegacyPut(entry.getKey(), entry.getValue());
        }
        removeInvalidServices(legacyMap);
        legacyChanged = false;
    }
1066056
public void customizeVueObserverPrototype(VueObserver vueObserver) {
    vueObserveArrayFunction = vueObserver.getObserveArray();
    vueWalkFunction = vueObserver.getWalk();

    vueObserver.setWalk(toObserve -> {
      if (observeJavaObject(toObserve)) {
        return;
      }

      vueWalkFunction.call(this, toObserve);
    });
  }
1255487
function configureWrapper(name){
                        var _ = nvd3Utils.deepExtend(defaultWrapper(name), scope.options[name] || {});

                        if (scope._config.extended) scope.options[name] = _;

                        var wrapElement = angular.element('<div></div>').html(_['html'] || '')
                            .addClass(name).addClass(_.className)
                            .removeAttr('style')
                            .css(_.css);

                        if (!_['html']) wrapElement.text(_.text);

                        if (_.enable) {
                            if (name === 'title') element.prepend(wrapElement);
                            else if (name === 'subtitle') angular.element(element[0].querySelector('.title')).after(wrapElement);
                            else if (name === 'caption') element.append(wrapElement);
                        }
                    }
1263525
def allowPatternsForNameChecking(self, patternsFunc, patternsClass):
        
        cfgParser = self.linter.cfgfile_parser
        nameChecker = self.getCheckerByName(NameChecker)
        if not nameChecker:
            return
        if patternsFunc:
            regexFuncAdd = "|((%s).+)$" % "|".join(patternsFunc)
        else:
            regexFuncAdd = ""
        if patternsClass:
            regexClassAdd = "|((%s).+)$" % "|".join(patternsClass)
        else:
            regexClassAdd = ""
        # Modify regex for function, method and class name.
        regexMethod = cfgParser.get("BASIC", "method-rgx") + regexFuncAdd
        regexFunction = cfgParser.get("BASIC", "function-rgx") + regexFuncAdd
        regexClass = cfgParser.get("BASIC", "class-rgx") + regexClassAdd
        # Save to config parser.
        cfgParser.set("BASIC", "method-rgx", regexMethod)
        cfgParser.set("BASIC", "function-rgx", regexFunction)
        cfgParser.set("BASIC", "class-rgx", regexClass)
        # Save to name checker.
        nameChecker.config.method_rgx = re.compile(regexMethod)
        nameChecker.config.function_rgx = re.compile(regexFunction)
        nameChecker.config.class_rgx = re.compile(regexClass)
1126561
function XElement(name) {
        _super.call(this);
        this._elements = new observable_array_1.ObservableArray();
        if (!(name instanceof XName)) {
            name = new XName(name);
        }
        this._name = name;
    }
435862
def strict_defaults(fn):
    '''  '''
    @wraps(fn)
    def wrapper(*args, **kwargs):
        defaults = _get_default_args(fn)
        # dictionary that holds each default type
        needed_types={
            key:type(defaults[key]) for key in defaults
        }
        # ordered tuple of the function's argument names
        arg_names=_get_arg_names(fn)
        assert not len(arg_names) - len(fn.__defaults__), '{} needs default variables on all arguments'.format(fn.__name__)
        # merge args to kwargs for easy parsing
        for i in range(len(args)):
            if args[i] not in kwargs.keys():
                kwargs[arg_names[i]]=args[i]
        # assert that theyre all the correct type
        for name in needed_types:
            # do them all seperately so you can show what went wrong
            assert  isinstance(kwargs[name],needed_types[name]), 'got {} and expected a {}'.format(kwargs[name],needed_types[name])
        # return the refined results
        return fn(**kwargs)
    return wrapper
205003
function objectExtendDeep(extended) {
  var currentObject;
  var currentType;
  var extendedType;
  var currentItem;
  var currentTypeInner;

  for (var i = 1, c = arguments.length; i < c; i++) {
    currentObject = arguments[i];
    if (!currentObject)
      continue;
    currentType = type(currentObject);
    extendedType = type(extended);
    // type mismatch
    if (currentType !== extendedType) {
      if (currentType === 'array') {
        extended = [];
      } else if (currentType === 'object' && extendedType !== 'function') {
        extended = {};
      }
      // else copy, primitive, date, regexp, function ...
    }
    // extend arrays
    if (currentType === 'array') {
      extended = extended.concat(currentObject);
    } else {
      // or objects ;)
      for (var key in currentObject) {
        if (ownProperty.call(currentObject, key)) {
          currentTypeInner = type(currentObject[key]);
          currentItem = currentObject[key];
          if (/^(object|array)$/.test(currentTypeInner)) {
            extended[key] = objectExtendDeep(extended[key], currentItem);
          } else if (currentTypeInner === 'date') {
            extended[key] = new Date(currentItem.getTime());
          } else if (currentTypeInner === 'regexp') {
            extended[key] = cloneRegExp(currentItem);
          } else {
            extended[key] = currentItem;
          }
        }
      }
    }
  }
  return extended;
}