Imports what we {Have}

 @param [Have] What we {Have}
486113
def import(have)
      begin
        data = File.read(have.file)
      rescue
        @report << "Failure while reading #{have.file}"
        raise AbortJob
      end

      begin
        if [:detect, :charlock_holmes].include?(have.encoding) && defined?(CharlockHolmes)
          detection = CharlockHolmes::EncodingDetector.detect(data)
          @report << "Assuming #{detection[:encoding]} for #{have.file} (detected by charlock_holmes with #{detection[:confidence]}% confidence)"
          data.force_encoding(detection[:encoding])
        elsif [:detect, :rchardet19].include?(have.encoding) && defined?(CharDet)
          detection = CharDet.detect(data)
          @report << "Assuming #{detection.encoding} for #{have.file} (detected by rchardet19 with #{(detection.confidence * 100).to_i}% confidence)"
          data.force_encoding(detection.encoding)
        else
          @report << "Assuming #{have.encoding} for #{have.file} (user-supplied)"
          data.force_encoding(have.encoding)
        end
      rescue
        @report << "Failure while setting encoding for #{have.file}"
        raise AbortJob
      end

      begin
        data.encode!('UTF-8')
      rescue
        @report << "Failure while transcoding #{have.file} from #{data.encoding} to intermediate UTF-8 encoding"
        raise AbortJob
      end

      begin
        have.subtitles =
          case File.extname(have.file)
          when '.ass'
            ASS.import(data)
          when '.ssa'
            SSA.import(data)
          when '.srt'
            SRT.import(data)
          when '.yt'
            YT.import(data)
          else
            fail 'Not supported'
          end
      rescue
        @report << "Failure while importing #{File.extname(have.file)[1..3].upcase} from #{have.file}"
        raise AbortJob
      end
    end
726222
def merge!(other)
      other.each_pair do |key, value|
        if value.is_a?(Hash) && self[key.to_s].is_a?(Hash)
          value = self[key.to_s].merge(value) do |_key, old_val, new_val|
            if in?(_key)
              new_val & old_val
            elsif nin?(_key)
              (old_val + new_val).uniq
            else
              new_val
            end
          end
        end
        if multi_selection?(key)
          value = (self[key.to_s] || []).concat(value)
        end
        store(key, value)
      end
    end
404826
def include_all?(*items)
      items = items.first if items.length == 1 && items.first.kind_of?(Array)
      (items - self).empty?
    end
956486
function addAvailableComponents(req, res, next) {
  res.locals.components = files.getComponents();
  next();
}
766234
function having() {
    var havings = this.grouped.having;
    if (!havings) {
      return '';
    }
    var sql = ['having'];
    for (var i = 0, l = havings.length; i < l; i++) {
      var str = '',
          s = havings[i];
      if (i !== 0) {
        str = s.bool + ' ';
      }
      if (s.type === 'havingBasic') {
        sql.push(str + this.formatter.columnize(s.column) + ' ' + this.formatter.operator(s.operator) + ' ' + this.formatter.parameter(s.value));
      } else {
        if (s.type === 'whereWrapped') {
          var val = this.whereWrapped(s);
          if (val) {
            sql.push(val);
          }
        } else {
          sql.push(str + this.formatter.unwrapRaw(s.value));
        }
      }
    }
    return sql.length > 1 ? sql.join(' ') : '';
  }
514277
def _have(self, name=None):
        
        if name is None:
            return (
                (k, v) for k, v  in self.env.items()
                if k.startswith('HAVE_')
            )
        return self.env.get('HAVE_' + self.env_key(name)) == True
1275484
function (path, callback) {
            var that = this;
            this.queue.push(path);

            //
            // Import a file asynchronously
            //
            less.Parser.importer(path, this.paths, function (e, root) {
                that.queue.splice(that.queue.indexOf(path), 1); // Remove the path from the queue

                var imported = path in that.files;

                that.files[path] = root;                        // Store the root

                if (e && !that.error) { that.error = e }

                callback(e, root, imported);

                if (that.queue.length === 0) { finish(e) }       // Call `finish` if we're done importing
            }, env);
        }
482769
function HasOne(model, related, foreignKey, localKey) {
        var _this = _super.call(this, model) /* istanbul ignore next */ || this;
        _this.related = _this.model.relation(related);
        _this.foreignKey = foreignKey;
        _this.localKey = localKey;
        return _this;
    }
989425
def append_if_local_or_in_imports(self, definition):
        
        if isinstance(definition, LocalModuleDefinition):
            self.definitions.append(definition)
        elif self.import_names == ["*"]:
            self.definitions.append(definition)
        elif self.import_names and definition.name in self.import_names:
            self.definitions.append(definition)
        elif (self.import_alias_mapping and definition.name in
              self.import_alias_mapping.values()):
            self.definitions.append(definition)

        if definition.parent_module_name:
            self.definitions.append(definition)

        if definition.node not in project_definitions:
            project_definitions[definition.node] = definition
487089
def module_include(base, mod)
      old_methods = {}

      mod.instance_methods.each do |sym|
        old_methods[sym] = base.instance_method(sym) if base.method_defined?(sym)
      end

      mod.instance_methods.each do |sym|
        method = mod.instance_method(sym)
        base.send(:define_method, sym, method)
      end

      yield
    ensure
      mod.instance_methods.each do |sym|
        base.send(:undef_method, sym) if base.method_defined?(sym)
      end
      old_methods.each do |sym, method|
        base.send(:define_method, sym, method)
      end
    end
609510
protected void parseImports() {
    List<Element> imports = rootElement.elements("import");
    for (Element theImport : imports) {
      String importType = theImport.attribute("importType");
      XMLImporter importer = this.getImporter(importType, theImport);
      if (importer == null) {
        addError("Could not import item of type " + importType, theImport);
      } else {
        importer.importFrom(theImport, this);
      }
    }
  }
1001020
function hasIn(obj, keys) {
  var k = keys[0],
      ks = keys.slice(1);
  if (ks.length) return !(k in obj) ? false : hasIn(obj[k], ks);
  return (k in obj);
}
936783
function configureExternals(config) {
  if (!externals)
    return
  config.externals = {}
  for (let {globalIdentifier, importIdentifier} of externals)
    config.externals[importIdentifier] = globalIdentifier
}
946608
def do_import(self, line):
        ""
        table, line = self.get_table_params(line)
        if line[0] == '[':
            list = self.get_list(line)
        else:
            with open(line) as f:
                list = self.get_list(f.read())

        items = 0
        consumed = 0

        for item in list:
            table.put_item(item)
            #consumed += item.consumed_units
            items += 1
            print item['id']

        print "imported %s items, consumed units:%s" % (items, consumed)
514290
def include(*what):
    
    cls, attrs = _split_what(what)

    def include_(attribute, value):
        return value.__class__ in cls or attribute in attrs

    return include_
1223715
def does_tree_import(package, name, node):
    
    binding = find_binding(name, find_root(node), package)
    return bool(binding)
543696
function importNonExisting(from, to) {
	if (from) {
		for (var prop in from) {
			if (!(prop in to)) {
				to[prop] = from[prop];
			}
		}
	}
}