Get the unboxed variants dominated by a case of this variant
183506
public JSVariant[] getDominatedVariants(int i) {
    if (dominated == null)
      dominated = new JSVariant[cases.length][];
    if (dominated[i] == null) {
      JSType acase = cases[i];
      if (acase instanceof JSVariant)
        dominated[i] = new JSVariant[] {(JSVariant)acase };
      else if (acase instanceof JSTuple)
        dominated[i] = ((JSTuple)acase).getDominatedVariants();
      else
        // Other cases don't dominate any unboxed variants (JSRepeated always boxes any
        // variants under it)
        dominated[i] = new JSVariant[0];
    }
    return dominated[i];
  }
1166990
def getVariantSetByName(self, name):
        
        if name not in self._variantSetNameMap:
            raise exceptions.VariantSetNameNotFoundException(name)
        return self._variantSetNameMap[name]
578648
def get_variant(self, index=None):
        
        for variant in self.iter_variants():
            if variant.index == index:
                return variant
1290110
def case(self, case_id=None):
        
        cases = self.cases()
        if case_id:
            for case in cases:
                if case.case_id == case_id:
                    return case
        else:
            if cases:
                return cases[0]

        return None
538806
def case(self, case_id):
        """"""
        case_obj = self.query(Case).filter_by(case_id=case_id).first()
        return case_obj
551170
def select_highest_versioned_permutation(permutations, user_deps)
      sorted = sort_permutations(permutations, user_deps)
      sorted.empty? ? [] : sorted.last
    end
632659
function uniq(t) {
        var seen = {};
        return t.filter(function(item) {
            return seen.hasOwnProperty(item) ? false : (seen[item] = true);
        })
    }
464159
private List<TestCaseDef> getBaseFailureCases( FunctionInputDef inputDef, VarTupleSet validTuples, VarTupleSet failureTuples, List<TestCaseDef> baseCases)
    {
    logger_.debug( "{}: Extending base failure test cases", inputDef);

    Iterator<TestCaseDef> failureBaseCases =
      IteratorUtils.filteredIterator(
        baseCases.iterator(),
        testCase -> testCase.getInvalidVar() != null);

    List<TestCaseDef> testCases = extendBaseCases( inputDef, validTuples, failureBaseCases);

    // Consume all failure values used.
    for( TestCaseDef testCase : testCases)
      {
      VarDef failureVar = testCase.getInvalidVar();
      failureTuples.used( new Tuple( new VarBindingDef( failureVar, testCase.getValue( failureVar))));
      }

    logger_.info( "{}: Extended {} base failure test cases", inputDef, testCases.size());
    return testCases;
   }
743549
def result
      case @type
      when :anime
        iter { |i| Jikan::AnimeResult.new(i) }
      when :manga
        iter { |i| Jikan::MangaResult.new(i) }
      when :character
        iter { |i| Jikan::CharacterResult.new(i) }
      when :person
        iter { |i| Jikan::PersonResult.new(i) }
      end
    end
1160905
def update_case(case_obj, existing_case):
    
    variant_nrs = ['nr_variants', 'nr_sv_variants']
    individuals = [('individuals','_inds'), ('sv_individuals','_sv_inds')]
    
    updated_case = deepcopy(existing_case)
    
    for i,file_name in enumerate(['vcf_path','vcf_sv_path']):
        variant_type = 'snv'
        if file_name == 'vcf_sv_path':
            variant_type = 'sv'
        if case_obj.get(file_name):
            if updated_case.get(file_name):
                LOG.warning("VCF of type %s already exists in case", variant_type)
                raise CaseError("Can not replace VCF in existing case")
            else:
                updated_case[file_name] = case_obj[file_name]
                updated_case[variant_nrs[i]] = case_obj[variant_nrs[i]]
                updated_case[individuals[i][0]] = case_obj[individuals[i][0]]
                updated_case[individuals[i][1]] = case_obj[individuals[i][1]]

    return updated_case
1057612
protected Type[] getUppermostTypeVariableBounds(TypeVariable<?> bound) {
        if (bound.getBounds()[0] instanceof TypeVariable<?>) {
            return getUppermostTypeVariableBounds((TypeVariable<?>) bound.getBounds()[0]);
        }
        return bound.getBounds();
    }
591272
@Override
	public String getAvailableVariant(String variant, VariantSet variantSet) {
		String availableVariant = null;
		if (variantSet.contains(variant)) {
			availableVariant = variant;
		} else {
			String subVar = variant;
			while (subVar.indexOf('_') != -1) {
				subVar = subVar.substring(0, subVar.lastIndexOf('_'));
				if (variantSet.contains(subVar)) {
					availableVariant = subVar;
				}
			}
		}
		if (availableVariant == null) {
			availableVariant = variantSet.getDefaultVariant();
		}

		return availableVariant;
	}
889184
function getCaseRanking(testString) {
  const containsUpperCase = testString.toLowerCase() !== testString
  const containsDash = testString.indexOf('-') >= 0
  const containsUnderscore = testString.indexOf('_') >= 0

  if (!containsUpperCase && !containsUnderscore && containsDash) {
    return caseRankings.KEBAB
  }

  if (!containsUpperCase && containsUnderscore && !containsDash) {
    return caseRankings.SNAKE
  }

  if (containsUpperCase && !containsDash && !containsUnderscore) {
    const startsWithUpperCase = testString[0].toUpperCase() === testString[0]
    if (startsWithUpperCase) {
      return caseRankings.PASCAL
    }

    return caseRankings.CAMEL
  }

  return caseRankings.NO_CASE
}
1177031
private int getCase(int varIndex) {

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) JmfTr.entry(this, tc, "getCase", new Object[]{Integer.valueOf(varIndex)});
    int result;

    synchronized (getMessageLockArtefact()) {
      if (map != null) {
        result = map.choiceCodes[varIndex];
      }
      else if (choiceCache == null) {
        result = -1;
      }
      else {
        result = choiceCache[varIndex];
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) JmfTr.exit(this, tc, "getCase", Integer.valueOf(result));
    return result;
  }
1167004
def underscored2camel_case(v):
    """"""
    vlist = v.split('_')
    c = []
    for n, el in enumerate(vlist):
        if el:
            if n == 0:
                c.append(el)
            else:
                c.extend([el[0].upper(), el[1:]])
    return ''.join(c)
524206
def cases(ctx, case_id, to_json):
    """"""

    adapter = ctx.obj['adapter']
    cases = []

    if case_id:
        case_obj = adapter.case({'case_id':case_id})
        if not case_obj:
            LOG.info("Case {0} does not exist in database".format(case_id))
            return
        case_obj['_id'] = str(case_obj['_id'])
        cases.append(case_obj)
    else:
        cases = adapter.cases()
        if cases.count() == 0:
            LOG.info("No cases found in database")
            ctx.abort()

    if to_json:
        click.echo(json.dumps(cases))
        return

    click.echo("#case_id\tvcf_path")

    for case_obj in cases:
        click.echo("{0}\t{1}".format(case_obj.get('case_id'), case_obj.get('vcf_path')))
1290821
function parseCaseStatements (spec) {
  return _(spec)
    .remove(statement => !_.isUndefined(statement.case))
    .map(parseCaseStatement)
    .value()
}