returns true if the value was something that could be imported
500709
protected function compileImport($rawPath, $out) {
        if ($rawPath[0] == "string") {
            $path = $this->compileStringContent($rawPath);
            if ($path = $this->findImport($path)) {
                $this->importFile($path, $out);
                return true;
            }
            return false;
        } if ($rawPath[0] == "list") {
            // handle a list of strings
            if (count($rawPath[2]) == 0) return false;
            foreach ($rawPath[2] as $path) {
                if ($path[0] != "string") return false;
            }

            foreach ($rawPath[2] as $path) {
                $this->compileImport($path, $out);
            }

            return true;
        }

        return false;
    }
1133986
def get_imports(self, option):
        
        if option:
            if len(option) == 1 and option[0].isupper() and len(option[0]) > 3:
                return getattr(settings, option[0])
            else:
                codes = [e for e in option if e.isupper() and len(e) == 3]
                if len(codes) != len(option):
                    raise ImproperlyConfigured("Invalid currency codes found: %s" % codes)
                return codes
        for attr in ('CURRENCIES', 'SHOP_CURRENCIES'):
            try:
                return getattr(settings, attr)
            except AttributeError:
                continue
        return option
1362844
private boolean addNodeIfNotAlreadyIncluded(T thisImport,
      LinkedList<T> imports, Set<T> alreadyIncludedImports) {
    if (alreadyIncludedImports.contains(thisImport)) {
      return false;
    }
    imports.add(thisImport);
    alreadyIncludedImports.add(thisImport);
    return true;
  }
478764
def is_visit_primitive(obj):
    ''''''
    from .base import visit
    if (isinstance(obj, tuple(PRIMITIVE_TYPES)) and not isinstance(obj, STR)
        and not isinstance(obj, bytes)):
        return True
    if (isinstance(obj, CONTAINERS) and not isinstance(obj, STR) and not
        isinstance(obj, bytes)):
        return False
    if isinstance(obj, STR) or isinstance(obj, bytes):
        if len(obj) == 1:
            return True
        return False
    return list(visit(obj, max_enum=2)) == [obj]
1060329
public static boolean hasValue(InputComponent<?, ?> input)
   {
      boolean ret;
      Object value = InputComponents.getValueFor(input);
      if (value == null)
      {
         ret = false;
      }
      else if (value instanceof String && value.toString().isEmpty())
      {
         ret = false;
      }
      else if (!input.getValueType().isInstance(value) && value instanceof Iterable
               && !((Iterable) value).iterator().hasNext())
      {
         ret = false;
      }
      else
      {
         ret = true;
      }
      return ret;
   }
988364
protected boolean checkImmutable(String translatedName, List<String> immutableResources) {

        boolean resourceNotImmutable = true;
        if (immutableResources.contains(translatedName)) {
            if (LOG.isDebugEnabled()) {
                LOG.debug(
                    Messages.get().getBundle().key(Messages.LOG_IMPORTEXPORT_RESOURCENAME_IMMUTABLE_1, translatedName));
            }
            // this resource must not be modified by an import if it already exists
            String storedSiteRoot = m_cms.getRequestContext().getSiteRoot();
            try {
                m_cms.getRequestContext().setSiteRoot("/");
                m_cms.readResource(translatedName);
                resourceNotImmutable = false;
                if (LOG.isDebugEnabled()) {
                    LOG.debug(
                        Messages.get().getBundle().key(Messages.LOG_IMPORTEXPORT_IMMUTABLE_FLAG_SET_1, translatedName));
                }
            } catch (CmsException e) {
                // resourceNotImmutable will be true
                if (LOG.isDebugEnabled()) {
                    LOG.debug(
                        Messages.get().getBundle().key(
                            Messages.LOG_IMPORTEXPORT_ERROR_ON_TEST_IMMUTABLE_1,
                            translatedName),
                        e);
                }
            } finally {
                m_cms.getRequestContext().setSiteRoot(storedSiteRoot);
            }
        }
        return resourceNotImmutable;
    }
543696
function importNonExisting(from, to) {
	if (from) {
		for (var prop in from) {
			if (!(prop in to)) {
				to[prop] = from[prop];
			}
		}
	}
}
12122
def imported_from_bootstrap(self, module):
    

    # A vendored module.
    path = getattr(module, '__file__', None)
    if path and os.path.realpath(path).startswith(self._realpath):
      return True

    # A vendored package.
    path = getattr(module, '__path__', None)
    if path and any(os.path.realpath(path_item).startswith(self._realpath)
                    for path_item in path):
      return True

    return False
706213
function(properties, raw_properties) {

		if (Lava.schema.data.VALIDATE_IMPORT_DATA && !this.isValidValue(raw_properties[this._name]))
			Lava.t('Invalid value in import data (' + this._name + '): ' + raw_properties[this._name]);

		return raw_properties[this._name];

	}
1123306
def has_module (name, without_error=True):
    
    try:
        importlib.import_module(name)
        return True
    except ImportError:
        return False
    except Exception:
        # some modules raise errors when intitializing
        return not without_error
407677
def load_obj_or_import_string(self, value):
        
        imp = self.app.config.get(value)
        if isinstance(imp, six.string_types):
            return import_string(imp)
        elif imp:
            return imp
172311
def available(self):
        

        for module_name in self.packages:
            if importlib.util.find_spec(module_name):
                return True
        return False
320003
def obj_or_import_string(value, default=None):
    
    if isinstance(value, six.string_types):
        return import_string(value)
    elif value:
        return value
    return default
252027
def isPeBounded(self):
        
        boundImportsDir = self.ntHeaders.optionalHeader.dataDirectory[consts.BOUND_IMPORT_DIRECTORY]
        if boundImportsDir.rva.value and boundImportsDir.size.value:
            return True
        return False
797668
def is_key(cls, result):
        """"""
        from boto.gs.key import Key

        return isinstance(result, Key)
205714
def _parse_from_import_source(self):
        
        assert self.current.value == 'from', self.current.value
        self.stream.move()
        is_future_import = self.current.value == '__future__'
        self.stream.move()
        while (self.current is not None and
               self.current.kind in (tk.DOT, tk.NAME, tk.OP) and
               self.current.value != 'import'):
            self.stream.move()
        if self.current is None or self.current.value != 'import':
            return False
        self.check_current(value='import')
        assert self.current.value == 'import', self.current.value
        self.stream.move()
        return is_future_import
12039
private static ImmutableList<ImportTree> getWildcardImports(List<? extends ImportTree> imports) {
    ImmutableList.Builder<ImportTree> result = ImmutableList.builder();
    for (ImportTree tree : imports) {
      // javac represents on-demand imports as a member select where the selected name is '*'.
      Tree ident = tree.getQualifiedIdentifier();
      if (!(ident instanceof MemberSelectTree)) {
        continue;
      }
      MemberSelectTree select = (MemberSelectTree) ident;
      if (select.getIdentifier().contentEquals("*")) {
        result.add(tree);
      }
    }
    return result.build();
  }