query stringlengths 9 14.6k | document stringlengths 8 5.39M | metadata dict | negatives listlengths 0 30 | negative_scores listlengths 0 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Examine a symbol which should be of a class, and return metadata about its members. | getMembersOfSymbol(symbol) {
const members = [];
// The decorators map contains all the properties that are decorated
const { memberDecorators } = this.acquireDecoratorInfo(symbol);
// Make a copy of the decorators as successfully reflected members delete themselves from the
// m... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"reflectMembers(symbol, decorators, isStatic) {\n if (symbol.flags & ts.SymbolFlags.Accessor) {\n const members = [];\n const setter = symbol.declarations && symbol.declarations.find(ts.isSetAccessor);\n const getter = symbol.declarations && symbol.declarations.find(ts.isGetA... | [
"0.62493396",
"0.613744",
"0.5964649",
"0.58746517",
"0.58359355",
"0.54977167",
"0.54424715",
"0.5419152",
"0.52868015",
"0.523012",
"0.52052546",
"0.519491",
"0.51597625",
"0.5146191",
"0.51381147",
"0.51038355",
"0.5101066",
"0.5089235",
"0.5086796",
"0.5080139",
"0.506404... | 0.71463716 | 0 |
Check the given statement to see if it is a call to any of the specified helper functions or null if not found. Matching statements will look like: `tslib_1.__decorate(...);`. | getHelperCall(statement, helperNames) {
if ((ts.isExpressionStatement(statement) || ts.isReturnStatement(statement)) &&
statement.expression) {
let expression = statement.expression;
while (isAssignment(expression)) {
expression = expression.right;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isHelper(node) {\n\t if (t.isMemberExpression(node)) {\n\t return isHelper(node.object) || isHelper(node.property);\n\t } else if (t.isIdentifier(node)) {\n\t return node.name === \"require\" || node.name[0] === \"_\";\n\t } else if (t.isCallExpression(node)) {\n\t return isHelper(node.callee)... | [
"0.5161843",
"0.5161843",
"0.5161843",
"0.5161843",
"0.5114379",
"0.50943327",
"0.4824513",
"0.47533813",
"0.47232136",
"0.46679255",
"0.46450347",
"0.46362802",
"0.4616565",
"0.4598985",
"0.4592513",
"0.45889077",
"0.45311746",
"0.4476658",
"0.4476658",
"0.44759285",
"0.4468... | 0.59273905 | 0 |
Reflect over a symbol and extract the member information, combining it with the provided decorator information, and whether it is a static member. A single symbol may represent multiple class members in the case of accessors; an equally named getter/setter accessor pair is combined into a single symbol. When the symbol... | reflectMembers(symbol, decorators, isStatic) {
if (symbol.flags & ts.SymbolFlags.Accessor) {
const members = [];
const setter = symbol.declarations && symbol.declarations.find(ts.isSetAccessor);
const getter = symbol.declarations && symbol.declarations.find(ts.isGetAccessor);... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getMembersOfSymbol(symbol) {\n const members = [];\n // The decorators map contains all the properties that are decorated\n const { memberDecorators } = this.acquireDecoratorInfo(symbol);\n // Make a copy of the decorators as successfully reflected members delete themselves from the\n ... | [
"0.70819026",
"0.6573095",
"0.65717745",
"0.6371851",
"0.5472887",
"0.53679425",
"0.52445537",
"0.51767296",
"0.50916475",
"0.50325346",
"0.4972492",
"0.49637046",
"0.49543604",
"0.49474522",
"0.4754406",
"0.46893734",
"0.4671235",
"0.46423814",
"0.4615484",
"0.45630938",
"0.... | 0.7692743 | 0 |
Find the declarations of the constructor parameters of a class identified by its symbol. | getConstructorParameterDeclarations(classSymbol) {
const members = classSymbol.implementation.members;
if (members && members.has(CONSTRUCTOR)) {
const constructorSymbol = members.get(CONSTRUCTOR);
// For some reason the constructor does not have a `valueDeclaration` ?!?
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getConstructorParamInfo(classSymbol, parameterNodes) {\n const { constructorParamInfo } = this.acquireDecoratorInfo(classSymbol);\n return parameterNodes.map((node, index) => {\n const { decorators, typeExpression } = constructorParamInfo[index] ?\n constructorParamInfo[inde... | [
"0.7379882",
"0.65882176",
"0.6366721",
"0.62201387",
"0.6093704",
"0.60610604",
"0.55392766",
"0.5279921",
"0.5271014",
"0.5232033",
"0.51794183",
"0.5161068",
"0.512789",
"0.5106828",
"0.5068835",
"0.5000633",
"0.49427438",
"0.4872133",
"0.48714867",
"0.4771448",
"0.4761797... | 0.79217714 | 0 |
Get the parameter decorators of a class constructor. | getConstructorParamInfo(classSymbol, parameterNodes) {
const { constructorParamInfo } = this.acquireDecoratorInfo(classSymbol);
return parameterNodes.map((node, index) => {
const { decorators, typeExpression } = constructorParamInfo[index] ?
constructorParamInfo[index] :
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getConstructorParameterDeclarations(classSymbol) {\n const members = classSymbol.implementation.members;\n if (members && members.has(CONSTRUCTOR)) {\n const constructorSymbol = members.get(CONSTRUCTOR);\n // For some reason the constructor does not have a `valueDeclaration` ?!?... | [
"0.64685744",
"0.613741",
"0.61184597",
"0.5686397",
"0.55735797",
"0.53564334",
"0.53063196",
"0.5306089",
"0.5282357",
"0.5279513",
"0.52498376",
"0.5190451",
"0.51876366",
"0.5168506",
"0.51672405",
"0.51018476",
"0.50719184",
"0.50655705",
"0.5046758",
"0.5044073",
"0.503... | 0.7093461 | 0 |
Compute the `TypeValueReference` for the given `typeExpression`. Although `typeExpression` is a valid `ts.Expression` that could be emitted directly into the generated code, ngcc still needs to resolve the declaration and create an `IMPORTED` type value reference as the compiler has specialized handling for some symbol... | typeToValue(typeExpression) {
if (typeExpression === null) {
return {
kind: 2 /* UNAVAILABLE */,
reason: { kind: 0 /* MISSING_TYPE */ },
};
}
const imp = this.getImportOfExpression(typeExpression);
const decl = this.getDeclarationOf... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTypeReference(typeInfo, type) {\n return {\n kind: 'Type',\n schema: typeInfo.schema,\n type: type || typeInfo.type\n };\n}",
"function parseJSDocTypeExpression() {\n var result = createNode(257 /* JSDocTypeExpression */, scanner.getTokenPos());\n parseExpecte... | [
"0.580241",
"0.5137582",
"0.49331325",
"0.49056157",
"0.45995814",
"0.45770168",
"0.45451453",
"0.44543248",
"0.4448528",
"0.4448528",
"0.44362003",
"0.44360644",
"0.44159302",
"0.44141856",
"0.4383037",
"0.4383037",
"0.4383037",
"0.4383037",
"0.4383037",
"0.4383037",
"0.4383... | 0.6583733 | 0 |
Determines where the `expression` is imported from. | getImportOfExpression(expression) {
if (ts.isIdentifier(expression)) {
return this.getImportOfIdentifier(expression);
}
else if (ts.isPropertyAccessExpression(expression) && ts.isIdentifier(expression.name)) {
return this.getImportOfIdentifier(expression.name);
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_resolveImport(specifier, containingFilePath) {\n if (specifier.charAt(0) === '.') {\n const resolvedPath = this._resolveFileSpecifier(specifier, containingFilePath);\n if (resolvedPath === null) {\n this._trackUnresolvedFileImport(specifier, containingFilePath);\n ... | [
"0.5976261",
"0.58723193",
"0.55816084",
"0.5555437",
"0.5512403",
"0.5479653",
"0.54534495",
"0.53685945",
"0.51808614",
"0.5082038",
"0.50094694",
"0.49976042",
"0.49969774",
"0.4989917",
"0.49537355",
"0.49437317",
"0.49394262",
"0.4935794",
"0.49048623",
"0.48269868",
"0.... | 0.696695 | 0 |
Search statements related to the given class for calls to the specified helper. | getHelperCallsForClass(classSymbol, helperNames) {
return this.getStatementsForClass(classSymbol)
.map(statement => this.getHelperCall(statement, helperNames))
.filter(isDefined);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function define_helpers_registrator(Klass) {\n Klass.registerHelper = function (name, helper, options) {\n // Scenario: registerHelper('foo', foo_helper[, foo_opts]);\n if (_.isString(name)) {\n Klass.prototype[name] = helper;\n Klass.prototype.__helpers__[name] = {\n helper: ... | [
"0.46022868",
"0.45965898",
"0.459571",
"0.45681214",
"0.4567649",
"0.45646304",
"0.45646304",
"0.45518357",
"0.44774607",
"0.4434975",
"0.44307545",
"0.44133377",
"0.44133377",
"0.44133377",
"0.44133377",
"0.44133377",
"0.44133377",
"0.438591",
"0.4354315",
"0.43316716",
"0.... | 0.6281387 | 0 |
Find statements related to the given class that may contain calls to a helper. In ESM2015 code the helper calls are in the top level module, so we have to consider all the statements in the module. | getStatementsForClass(classSymbol) {
const classNode = classSymbol.implementation.valueDeclaration;
if (isTopLevel(classNode)) {
return this.getModuleStatements(classNode.getSourceFile());
}
const statement = getContainingStatement(classNode);
if (ts.isBlock(statement... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getHelperCallsForClass(classSymbol, helperNames) {\n return this.getStatementsForClass(classSymbol)\n .map(statement => this.getHelperCall(statement, helperNames))\n .filter(isDefined);\n }",
"function traceClass(targetClass)\n{\n\tvar hook = Java.use(targetClass);\n\tvar methods ... | [
"0.63783264",
"0.5022613",
"0.4947726",
"0.48804748",
"0.48748615",
"0.4842928",
"0.4793643",
"0.47681198",
"0.4713233",
"0.46929514",
"0.46794885",
"0.46769553",
"0.46500283",
"0.464832",
"0.46325782",
"0.4607503",
"0.45773646",
"0.45723787",
"0.45637354",
"0.45374396",
"0.4... | 0.5555715 | 1 |
Create a mapping between the public exports in a src program and the public exports of a dts program. | computePublicDtsDeclarationMap(src, dts) {
const declarationMap = new Map();
const dtsDeclarationMap = new Map();
const rootDts = getRootFileOrFail(dts);
this.collectDtsExportedDeclarations(dtsDeclarationMap, rootDts, dts.program.getTypeChecker());
const rootSrc = getRootFileOrFa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function saveNameToExportMap(index,def,exportsMap){if(exportsMap){if(def.exportAs)exportsMap[def.exportAs]=index;if(def.template)exportsMap['']=index;}}",
"function saveNameToExportMap(index, def, exportsMap) {\n if (exportsMap) {\n if (def.exportAs)\n exportsMap[def.exportAs] = index;\n ... | [
"0.6453806",
"0.60027874",
"0.60027874",
"0.60027874",
"0.5946425",
"0.59243846",
"0.5911351",
"0.5810774",
"0.5747218",
"0.5747218",
"0.5747218",
"0.5747218",
"0.5747218",
"0.5747218",
"0.57037467",
"0.5435842",
"0.53040266",
"0.52692133",
"0.5238328",
"0.52319777",
"0.52197... | 0.64393175 | 1 |
Create a mapping between the "private" exports in a src program and the "private" exports of a dts program. These exports may be exported from individual files in the src or dts programs, but not exported from the root file (i.e publicly from the entrypoint). This mapping is a "best guess" since we cannot guarantee tha... | computePrivateDtsDeclarationMap(src, dts) {
const declarationMap = new Map();
const dtsDeclarationMap = new Map();
const typeChecker = dts.program.getTypeChecker();
const dtsFiles = getNonRootPackageFiles(dts);
for (const dtsFile of dtsFiles) {
this.collectDtsExported... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"computePublicDtsDeclarationMap(src, dts) {\n const declarationMap = new Map();\n const dtsDeclarationMap = new Map();\n const rootDts = getRootFileOrFail(dts);\n this.collectDtsExportedDeclarations(dtsDeclarationMap, rootDts, dts.program.getTypeChecker());\n const rootSrc = getRo... | [
"0.64863193",
"0.6486257",
"0.5939152",
"0.5874563",
"0.5806893",
"0.5806893",
"0.5806893",
"0.5806893",
"0.5806893",
"0.5806893",
"0.57222426",
"0.56512254",
"0.5584789",
"0.5521209",
"0.536072",
"0.536072",
"0.536072",
"0.53060204",
"0.5305256",
"0.5291864",
"0.5231133",
... | 0.6858086 | 0 |
Collect mappings between names of exported declarations in a file and its actual declaration. Any new mappings are added to the `dtsDeclarationMap`. | collectDtsExportedDeclarations(dtsDeclarationMap, srcFile, checker) {
const srcModule = srcFile && checker.getSymbolAtLocation(srcFile);
const moduleExports = srcModule && checker.getExportsOfModule(srcModule);
if (moduleExports) {
moduleExports.forEach(exportedSymbol => {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"computePrivateDtsDeclarationMap(src, dts) {\n const declarationMap = new Map();\n const dtsDeclarationMap = new Map();\n const typeChecker = dts.program.getTypeChecker();\n const dtsFiles = getNonRootPackageFiles(dts);\n for (const dtsFile of dtsFiles) {\n this.collect... | [
"0.70967287",
"0.7037963",
"0.5888442",
"0.5766831",
"0.56008434",
"0.5585399",
"0.55216986",
"0.55104494",
"0.5480872",
"0.5480872",
"0.5480872",
"0.5480872",
"0.5480872",
"0.5480872",
"0.54380023",
"0.53543365",
"0.5340679",
"0.50620466",
"0.49901634",
"0.49898845",
"0.4912... | 0.8158543 | 0 |
Checks if the specified declaration resolves to the known JavaScript global `Object`. | isJavaScriptObjectDeclaration(decl) {
const node = decl.node;
// The default TypeScript library types the global `Object` variable through
// a variable declaration with a type reference resolving to `ObjectConstructor`.
if (!ts.isVariableDeclaration(node) || !ts.isIdentifier(node.name) ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"detectKnownDeclaration(decl) {\n if (decl.known === null && this.isJavaScriptObjectDeclaration(decl)) {\n // If the identifier resolves to the global JavaScript `Object`, update the declaration to\n // denote it as the known `JsGlobalObject` declaration.\n decl.known = Known... | [
"0.7089518",
"0.67383516",
"0.66838866",
"0.66838866",
"0.66838866",
"0.66838866",
"0.66838866",
"0.66838866",
"0.6661495",
"0.6661495",
"0.645572",
"0.6416757",
"0.6270266",
"0.61783874",
"0.61483586",
"0.61147743",
"0.61045474",
"0.6066151",
"0.6059187",
"0.60518056",
"0.60... | 0.7438834 | 0 |
Attempts to extract a single `EnumMember` from a statement in the following syntax: Enum["MemberA"] = "a"; or, for enum member with numeric values: Enum[Enum["MemberA"] = 0] = "MemberA"; | reflectEnumMember(enumName, statement) {
if (!ts.isExpressionStatement(statement))
return null;
const expression = statement.expression;
// Check for the `Enum[X] = Y;` case.
if (!isEnumAssignment(enumName, expression)) {
return null;
}
const assig... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseEnumMember() {\n var node = createNode(255 /* EnumMember */, scanner.getStartPos());\n node.name = parsePropertyName();\n node.initializer = allowInAnd(parseNonParameterInitializer);\n return finishNode(node);\n }",
"function reflectEnumAssignment(... | [
"0.7492474",
"0.64754045",
"0.5921861",
"0.58231664",
"0.5735814",
"0.5717971",
"0.566666",
"0.56319743",
"0.55816996",
"0.54996336",
"0.5415048",
"0.53224146",
"0.5258993",
"0.52503496",
"0.52298915",
"0.51394457",
"0.51239955",
"0.5081355",
"0.5081355",
"0.5081355",
"0.5081... | 0.74358666 | 1 |
Checks whether the expression looks like an enum member assignment targeting `Enum`: Enum[X] = Y; Here, X and Y can be any expression. | function isEnumAssignment(enumName, expression) {
if (!ts.isBinaryExpression(expression) ||
expression.operatorToken.kind !== ts.SyntaxKind.EqualsToken ||
!ts.isElementAccessExpression(expression.left)) {
return false;
}
// Verify that the outer assignment corresponds with the enum d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function reflectEnumAssignment(expression) {\n const memberName = expression.left.argumentExpression;\n if (!ts.isPropertyName(memberName))\n return null;\n return { name: memberName, initializer: expression.right };\n}",
"reflectEnumMember(enumName, statement) {\n if (!ts.isExpressionStat... | [
"0.70496255",
"0.6636869",
"0.6438885",
"0.63500845",
"0.63233995",
"0.6095857",
"0.60935354",
"0.60690457",
"0.5959869",
"0.58376104",
"0.57970405",
"0.5720624",
"0.57116586",
"0.57110506",
"0.5682543",
"0.5682543",
"0.5624251",
"0.5603715",
"0.54603976",
"0.5444759",
"0.542... | 0.764976 | 0 |
Attempts to create an `EnumMember` from an expression that is believed to represent an enum assignment. | function reflectEnumAssignment(expression) {
const memberName = expression.left.argumentExpression;
if (!ts.isPropertyName(memberName))
return null;
return { name: memberName, initializer: expression.right };
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseEnumMember() {\n var node = createNode(255 /* EnumMember */, scanner.getStartPos());\n node.name = parsePropertyName();\n node.initializer = allowInAnd(parseNonParameterInitializer);\n return finishNode(node);\n }",
"reflectEnumMember(enumName, sta... | [
"0.68882585",
"0.6329197",
"0.61846244",
"0.58651066",
"0.5784439",
"0.5604375",
"0.55680054",
"0.5492142",
"0.5492142",
"0.5492142",
"0.5492142",
"0.5492142",
"0.5492142",
"0.53870803",
"0.5343577",
"0.5330082",
"0.53245753",
"0.53245753",
"0.53245753",
"0.53245753",
"0.5324... | 0.77867675 | 0 |
Tests whether the expression appears to have been synthesized by TypeScript, i.e. whether it is of the following form: ``` super(...arguments); ``` | function isSynthesizedSuperCall(expression) {
if (!ts.isCallExpression(expression))
return false;
if (expression.expression.kind !== ts.SyntaxKind.SuperKeyword)
return false;
if (expression.arguments.length !== 1)
return false;
const argument = expression.arguments[0];
return... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isSuperExpression(node, typescript) {\n return node.kind === typescript.SyntaxKind.SuperKeyword;\n}",
"function isSynthesizedConstructor(constructor) {\n if (!constructor.body)\n return false;\n const firstStatement = constructor.body.statements[0];\n if (!firstStatement || !ts.isExpr... | [
"0.65285534",
"0.5996565",
"0.5848515",
"0.58414227",
"0.58363396",
"0.580542",
"0.5797772",
"0.5738287",
"0.5738287",
"0.5728865",
"0.5720244",
"0.5720244",
"0.5700199",
"0.5700199",
"0.5700199",
"0.5538339",
"0.546952",
"0.5278594",
"0.52613443",
"0.525324",
"0.52525526",
... | 0.7043676 | 0 |
exercise 4 Given an array of integers. Write a function which will get that array and create new array, with size equal to first positive element of given array (If no positive element return []) and content of returned array will be next elements of given array (repeated, if needed) | function func(array) {
let length = array.length;
let counter = 0;
let repeatedArray = [], result = [];
for (let i = 0; i < length; i++) {
if (array[i] > 0) {
repeatedArray = array.slice(i+1);
counter = array[i];
break;
}
}
if (counter === 0) {... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function first(arrIn) {\n let arnold =[]\n for (let i = 1; i <= arrIn; i++){\n arnold.push(i);\n }\n return arnold;\n}",
"function first(n){\n let arry = [];\n for(let i = 0; i < n; i++){\n arry[i] = i + 1;\n }\n return arry;\n}",
"function first(arr,number = 1){\n if (arr){\n if ... | [
"0.7297178",
"0.6994876",
"0.6804028",
"0.67832047",
"0.6756885",
"0.66939247",
"0.6659462",
"0.6609246",
"0.65927964",
"0.6570189",
"0.65631145",
"0.6555823",
"0.648345",
"0.64712626",
"0.6469182",
"0.64566845",
"0.6426559",
"0.63866377",
"0.63810086",
"0.6366907",
"0.635264... | 0.726833 | 1 |
exercise 5 Given an array of integers. Write a function which will get that array and return an object with 2 properties even6 and odd7. Values of that properties will be even6> array of all positive numbers that are divisible by 6 odd7> array of all positive odd numbers that are divisible by 7 | function getObjectFromArray(array) {
return array.reduce((obj, current) => {
if (current%6 === 0) {
obj.even6.push(current)
} else if (current%7 === 0 && current%2) {
obj.odd7.push(current)
}
return obj;
}, {even6: [], odd7: []});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function modifiedObject(arr) {\n let obj = {\n even6: [],\n odd7: []\n };\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] > 0) {\n if (arr[i] % 6 === 0) {\n obj.even6.push(arr[i]);\n } else if (arr[i] % 2 != 0 && arr[i] % 7 === 0) {\n obj.odd7.push(arr[i]);\n }\n }... | [
"0.72891307",
"0.69540846",
"0.69073564",
"0.68481123",
"0.6844651",
"0.68075657",
"0.67953193",
"0.6787495",
"0.6733238",
"0.6720162",
"0.6716264",
"0.67079663",
"0.6706492",
"0.66892123",
"0.6680669",
"0.66777956",
"0.6641419",
"0.6619868",
"0.65995973",
"0.65967935",
"0.65... | 0.7456593 | 0 |
Write wrapper function dbGetEmployeeWrapper which will call dbGetEmployee and return a promise. Rewrite function printHeadOfHead to be promise based. Rewrite function printHeadOfHead to be async/await based. | function dbGetEmployeeWrapper(id) {
return new Promise(function(resolve, reject) {
setTimeout(_ => {
console.log(`Getting ${id}`);
const employees = [
{id: 1, name: 'John', headId: 3},
{id: 2, name: 'Ann', headId: 3},
{id: 3, name: '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dbGetEmployeeWrapper(id) {\n dbGetEmployee(id)\n .then(res => {\n resolve(res);\n })\n .catch(err => {\n reject(err);\n });\n}",
"printEmployee() {\n // get employee information\n dbFunctions.employeeInfo()\n // show results in console\n .then((... | [
"0.6706466",
"0.64557743",
"0.6354984",
"0.62891597",
"0.62389785",
"0.62369776",
"0.6216776",
"0.6130999",
"0.6114306",
"0.6101639",
"0.6079463",
"0.6070466",
"0.60605645",
"0.6048747",
"0.6019932",
"0.59935266",
"0.59816974",
"0.5959442",
"0.59545684",
"0.59534967",
"0.5950... | 0.70047325 | 0 |
Representa um objeto Tag. | function Tag(id) {
this.id = id;
this.name = _t('label.upper.tag');
this.dateCreated = '00/00/0000';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Tag(label,id,created) {\n this.label = label;\n this.id = id;\n this.created = created;\n}",
"function Tag() {\n this.id;\n this.name;\n\n this.createdDate;\n this.modifiedDate;\n this.deletedDate;\n}",
"get tag() {}",
"get tag() {}",
"get tag() {}",
"get tag() {}",
"getTag(t... | [
"0.7276361",
"0.7181449",
"0.6730452",
"0.6730452",
"0.6730452",
"0.6730452",
"0.6661055",
"0.6582735",
"0.6582735",
"0.6582735",
"0.6582735",
"0.6573987",
"0.632186",
"0.6231252",
"0.61505806",
"0.61116827",
"0.599098",
"0.59888136",
"0.59669274",
"0.59614414",
"0.5935835",
... | 0.7277963 | 0 |
addBy function that takes firstNumber as argument | function addBy(firstNumber) {
return function (secondNumber) {
return firstNumber + secondNumber;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function additionByOne(num){\n return num+1;\n}",
"function add() {\n const first = arguments[0];\n const rest = Array.from(arguments).slice(1);\n return rest.reduce((sum, next) => sum + next, first);\n}",
"function addg(first) {\n function more(next) {\n if (next === undefined) {\n return... | [
"0.6304855",
"0.6281286",
"0.6280091",
"0.6222542",
"0.6195665",
"0.61621255",
"0.6149411",
"0.6140329",
"0.613541",
"0.610245",
"0.596825",
"0.59520787",
"0.5925123",
"0.58841515",
"0.58248293",
"0.5818921",
"0.5817994",
"0.57985836",
"0.5777757",
"0.57716817",
"0.57708144",... | 0.7576262 | 0 |
counts number of unchecked tasks | countUnchecked() {
return Tasks.find({ checked: {$ne: true} }).count();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getRemainingTasks() {\n var remaining = 0\n\n data.forEach((task) => {\n if (!task.isChecked) {\n remaining += 1;\n }\n })\n return remaining;\n}",
"incompleteCount() {\n return Tasks.find({checked: {$ne: true} }).count();\n }",
"getCompletedCount() {\n var count = 0;\n for (l... | [
"0.76308",
"0.7207167",
"0.713103",
"0.7100273",
"0.6936903",
"0.68531996",
"0.6840346",
"0.68202853",
"0.66696066",
"0.66330457",
"0.6618245",
"0.6569538",
"0.6498801",
"0.64972574",
"0.6477502",
"0.6473653",
"0.63448703",
"0.6328046",
"0.63151735",
"0.631409",
"0.62782454",... | 0.77250975 | 0 |
Executes visitor on the object and its children (recursively). | function traverse(object, visitor) {
var key, child;
if (visitor.call(null, object) === false) {
return;
}
for (key in object) {
if (object.hasOwnProperty(key)) {
child = object[key];
if (typeof child === 'object' && child !== null) {
traverse(chi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function traverseBroad(object, visitor) {\n var child;\n\n if (!object) {\n return;\n }\n\n if (visitor.call(null, object) === false) {\n return false;\n }\n for (var i = 0, keys = Object.keys(object); i < keys.length; i++) {\n child = obje... | [
"0.6831234",
"0.6737173",
"0.6631679",
"0.6603919",
"0.6597046",
"0.6327477",
"0.6326548",
"0.63106924",
"0.6283541",
"0.6283541",
"0.6283541",
"0.628348",
"0.62702715",
"0.62497216",
"0.62314236",
"0.6160083",
"0.6153698",
"0.61036766",
"0.6062171",
"0.60327005",
"0.6006829"... | 0.70505863 | 0 |
Updates active state here and in GalleryComponent when a tab is clicked | changeTab(newActiveTab) {
if (this.state.activeTab !== newActiveTab) {
this.setState({activeTab: newActiveTab});
this.props.getActiveTab(newActiveTab); // Calls a function in Gallery
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateTab(tab) {\r\n this.setState({ buttonActive: tab });\r\n }",
"function updateActiveTab() {\n\t\tvar tabs = document.querySelectorAll(\n\t\t\ttoClassSelector(Class.Tabs.Item) + '[' + HashAttribute + ']'\n\t\t);\n\t\tvar regex = new RegExp('(\\\\s|^)' + Class.Tabs.ItemActive + '(\\\\s|$)');\n\t\tArray.pr... | [
"0.71229625",
"0.69243884",
"0.6868725",
"0.682091",
"0.67334867",
"0.6712387",
"0.66910684",
"0.66417825",
"0.6581865",
"0.65617824",
"0.6550072",
"0.6540805",
"0.641839",
"0.64023566",
"0.6371314",
"0.6361832",
"0.6360837",
"0.6338408",
"0.63269687",
"0.6324766",
"0.6276433... | 0.7471569 | 0 |
ReactToastr: Alert form form validation errors.. | showFormErrorToastr() {
this.refs.container.error(
// 1. Message:
'Please review the fields in red.',
// 2. Title:
'The form is missing one or more required fields.',
// 3. Options:
{
timeOut: 30000000,
extendedTimeOut: 10000000,
// closeButton: true,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"showInvalidFormValidation() {\n this.showErrorToast({\n msg: \"The given data was invalid. Please check your form again!\",\n dt: 3800\n });\n }",
"function error(msg) {\n inputEl.classList.add('invalid');\n M.toast({\n html: msg,\n displ... | [
"0.74319535",
"0.66242987",
"0.6417351",
"0.6382764",
"0.6379546",
"0.63596916",
"0.6356821",
"0.6329302",
"0.63146317",
"0.62709004",
"0.6241092",
"0.6240177",
"0.62063414",
"0.6195214",
"0.61859643",
"0.6176522",
"0.6168152",
"0.616542",
"0.6143273",
"0.61382926",
"0.612024... | 0.7827307 | 0 |
Validate the length is greater than 15 | function validateLength(text){
return text.length <= 15;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validator(v){\n\treturn v.length > 5;\n}",
"verifyLength(value, len) {\n if (value.length >= len) {\n\n return true;\n }\n return false;\n }",
"function lengthValidate(num){\n return num.toString().length === 11\n}",
"verifyLength(value, length) {\n if (value.le... | [
"0.7712606",
"0.7690791",
"0.76855975",
"0.7666396",
"0.7666396",
"0.7666396",
"0.7666396",
"0.7666396",
"0.7666396",
"0.7666396",
"0.7666396",
"0.7615376",
"0.73698956",
"0.7350286",
"0.7257795",
"0.72309434",
"0.72172004",
"0.71917844",
"0.71493",
"0.7144262",
"0.7141518",
... | 0.8487972 | 0 |
This check the public and private path list to see if it is already classified | function checkClassifiedPath(url){
var deferred = Q.defer();
client.sismember(["public-path", url], function(err, reply){
if (!err){
if (reply === 1)
deferred.resolve("public");
else
client.sismember(["private-path", url], function(err, reply){... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isAdded(path) {\n if (this.requirements.some(req => req.path === path)) {\n return true;\n }\n\n if (path.parentPath) {\n return this.isAdded(path.parentPath);\n }\n\n return false;\n }",
"function mayProxy(pathname) {\n const maybePublicPath = path.resolve(appPublicFolder, pathname.... | [
"0.57246226",
"0.563733",
"0.55920035",
"0.543641",
"0.5423731",
"0.5333765",
"0.5236067",
"0.52187854",
"0.5189381",
"0.51836854",
"0.51619244",
"0.5024838",
"0.49307045",
"0.49181804",
"0.49122617",
"0.49082655",
"0.49070957",
"0.49051046",
"0.49051046",
"0.49051046",
"0.49... | 0.674614 | 0 |
Accessing Multidimensional arrays with nested loops create a function that multiplies | function multiplyAll(arr){
var product = 1;
for(var i = 0; i < arr.length; i++){
for(var j = 0; i < arr[i].length; j++){
product *=arr[i][j];
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function multiplyAll(arr){\n var product = 1;\n for (var i=0; i < arr.length; i++){\n for (var j=0; j < arr[i].length; j++){\n product *= arr[i][j];\n }\n }\n return product;\n}",
"function multiplyAll(arr) {\n var product = 1;\n for (var i = 0; i < arr.length; i++) {\n ... | [
"0.7274046",
"0.7216407",
"0.71942043",
"0.7118614",
"0.71056485",
"0.7104881",
"0.7045112",
"0.70429194",
"0.6986645",
"0.6977343",
"0.695034",
"0.68389374",
"0.6770592",
"0.67007095",
"0.6696899",
"0.6692387",
"0.66552967",
"0.66398126",
"0.66075945",
"0.6603276",
"0.656810... | 0.7322342 | 0 |
function to check the winning condition | function checkWinningCondition() {
if (matchedCards.length === 16) {
stopTimer();
overlay();
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function check_winner(){ //NOT FUNCTIONING YET //see if there's a winner\n\tconsole.log(\"check winner run\"); \n\tconsole.log('value of i is _'+ i);\n\tfor(var i = 0; i < win_options.length; i++){\n\t\tfor(var j=0; j <win_options[i].length; j++){\n\t\n\t\t\tif(player_clicks[win_options[i][0]]==player_clicks[win... | [
"0.76413405",
"0.76184887",
"0.7616633",
"0.760656",
"0.7596802",
"0.75693935",
"0.75164396",
"0.7513826",
"0.74362314",
"0.74327374",
"0.7428812",
"0.7428183",
"0.74261206",
"0.7421521",
"0.74077094",
"0.7404831",
"0.73908794",
"0.73878044",
"0.7386076",
"0.73747444",
"0.737... | 0.7911138 | 0 |
function to add cards that match from openCards to matchedCards array | function addCardsToMatchedCardsList() {
for (const q of openCards) {
matchedCards.push(q);
//empty the openCards List
openCards = [];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addMatched(card) {\n matchedCards.push(card);\n }",
"function matched(openCards) {\n // Loop through each card and add new class to indicate match\n openCards.forEach(function(openCard) {\n openCard.parentElement.classList.add('match', 'animated', 'tada');\n });\n openCards.splice... | [
"0.8029191",
"0.79793024",
"0.79004735",
"0.75783396",
"0.742062",
"0.7376155",
"0.7370277",
"0.73505574",
"0.733974",
"0.7254134",
"0.72462666",
"0.72267205",
"0.7207035",
"0.7202715",
"0.7198351",
"0.7163247",
"0.71479905",
"0.714702",
"0.7144664",
"0.71402866",
"0.70695937... | 0.8591411 | 0 |
function to check if the two cards are a match in openCards List | function checkIfMatched() {
if ((openCards[0].innerHTML) === (openCards[1].innerHTML)) {
return true;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkIf2CardsInOpenCardsList() {\n\tif (openCards.length === 2) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}",
"function isCardsShownMatch(openCardPair) {\n if (openCardPair.length == 2){\n // get first card symbol\n let c1 = cardSymbol(openCardPair[0]);\n // get second card symb... | [
"0.8023649",
"0.8021068",
"0.7702935",
"0.76571643",
"0.759112",
"0.7568469",
"0.7523376",
"0.75177985",
"0.7517724",
"0.75151974",
"0.7510719",
"0.7501662",
"0.7468287",
"0.74678427",
"0.7450725",
"0.7441077",
"0.74398357",
"0.74360245",
"0.74305284",
"0.74245507",
"0.736718... | 0.80608654 | 0 |
functions to update the display of the card open and show | function updateDisplayOpen() {
for (const o of openCards) {
o.classList.add('show', 'open');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayCard(card) {\n\treturn $(card).toggleClass('open show animated');\n}",
"function displayCard(card) {\n card.setAttribute('class', 'card show open');\n openCards.push(card);\n}",
"function showCard(card)\n\t{\n\t\tcard.addClass('show open');\n\t\taddOpened(card);\n\t}",
"function display... | [
"0.74046004",
"0.725845",
"0.7239593",
"0.72255015",
"0.7179865",
"0.7157794",
"0.71051157",
"0.70724285",
"0.7039121",
"0.7028762",
"0.6930229",
"0.69255275",
"0.6915711",
"0.68958265",
"0.6892181",
"0.6874916",
"0.68369883",
"0.68115824",
"0.67689234",
"0.6763885",
"0.67531... | 0.7750585 | 0 |
function to add clicked card to clicked cards list | function addClickedCardToOpenCardsList() {
openCards.push(currentcard);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addCardsToClickedCards(event) {\n clickedCards.push(event.target);\n}",
"function addClickedCards(clickCard){\n clickedCards.push(clickCard);\n \n}",
"function addOpenedcards(cardClick){\n openList.push(cardClick);\n}",
"function addCardToList(card) {\n openCardsList.push(card);\n}",
"f... | [
"0.84073204",
"0.8275494",
"0.7898426",
"0.7847148",
"0.78248876",
"0.7819599",
"0.77133393",
"0.7681912",
"0.7673341",
"0.76699644",
"0.7624687",
"0.7616307",
"0.76140964",
"0.7607805",
"0.7603797",
"0.75692123",
"0.7533851",
"0.7522203",
"0.7455631",
"0.7435593",
"0.7435593... | 0.84598756 | 0 |
function to check if there are two cards in the openCards List | function checkIf2CardsInOpenCardsList() {
if (openCards.length === 2) {
return true;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cardCheck (clickedCard) {\n return (openedCards.length < 2 && document.querySelector('.open') !== clickedCard && clickedCard.getAttribute('class') !== 'match' && clickedCard.getAttribute('class') === 'card')\n}",
"function openedCard() {\n\tvar len = openedCards.length;\n\tif (len == 2) {\n\t\tunmatche... | [
"0.786648",
"0.7830144",
"0.7773362",
"0.77139026",
"0.7622617",
"0.7508125",
"0.7435498",
"0.7421022",
"0.7411155",
"0.73964214",
"0.7364326",
"0.7362231",
"0.7335503",
"0.73017824",
"0.7301164",
"0.72621894",
"0.72569925",
"0.72238106",
"0.72067344",
"0.7198806",
"0.7190072... | 0.9038928 | 0 |
create a function to update the star counter | function updateStarCounter() {
// when moves counter reaches 20, one star is removed
if (Number(movesMade.innerText) === 20) {
let star = document.querySelector('#star-one').classList.add('none');
}
// when moves counter reaches 29, two stars are removed
if (Number(movesMade.innerText) === 29) {
let star = doc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateStars() {\n\t{\n\t\t$(\".fa-star\").last().attr(\"class\", \"fa fa-star-o\");\n\t\tif (numStars > 0)\n\t\t{\n\t\t\tnumStars--;\n\t\t}\n\t\t$(\".numStars\").text(numStars);\n\t}\n}",
"function updateStar() {\n\tlet starCount = 0;\n\tfor(star of allStars) {\n\t\tif(star.hidden === false) {\n\t\t\tst... | [
"0.7330666",
"0.7320217",
"0.73125774",
"0.7242443",
"0.71489835",
"0.71222687",
"0.7092469",
"0.70550424",
"0.70375717",
"0.70235765",
"0.6923127",
"0.6904367",
"0.68921816",
"0.68502194",
"0.68164307",
"0.68113714",
"0.67924607",
"0.6791532",
"0.67803264",
"0.67732656",
"0.... | 0.7463382 | 0 |
create function to check if the card clicked on is a valid one | function checkIfCardClickedOnIsValid() {
if (currentcard.classList.contains("open")) {
//do not allow click, invalid move
return false;
} else if (currentcard.classList.contains("show")) {
return false;
} else if (currentcard.classList.contains("match")) {
return false;
} else if (currentcard.classList.cont... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isClickvalid(cardClick) {\n return (\n cardClick.classList.contains('card') && \n !cardClick.classList.contains('match') && \n openList.length < 2 && \n !openList.includes(cardClick)\n );\n}",
"function checkClickedCard(clickedCard) {\n if ($(clickedCard).hasClass('cli... | [
"0.7789578",
"0.76773375",
"0.74628216",
"0.7370799",
"0.7270108",
"0.7210839",
"0.72052693",
"0.69809246",
"0.6919428",
"0.6830479",
"0.68244636",
"0.6821736",
"0.6777508",
"0.67689735",
"0.6767344",
"0.6764765",
"0.6750715",
"0.6736764",
"0.6727545",
"0.6694491",
"0.6691602... | 0.7814213 | 0 |
GENERATES THE CITIES ON THE DROPDOWN | function generateCities(){
var queryURL = "https://developers.teleport.org/assets/urban_areas.json"
var cityArray = Object.keys(cities);
console.log(cityArray);
cityArray.sort(function(a,b){
if (a < b )return -1
else if (a === b)return 0
else return 1
})
for (var i = 0; i < city... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function populateCities(data) {\n var selector = document.getElementById('selector-city');\n\n data.forEach(function (item) {\n var option = document.createElement('option');\n option.text = item;\n option.value = item;\n selector.appendChild(option);\n });\n}",
"function createCountiesDistrictOpt... | [
"0.69719404",
"0.67206985",
"0.6715126",
"0.6641887",
"0.652335",
"0.6513365",
"0.6508849",
"0.6476505",
"0.64391327",
"0.6432026",
"0.63633984",
"0.6324038",
"0.6308918",
"0.62948895",
"0.62943286",
"0.62835956",
"0.62785536",
"0.6270685",
"0.62447953",
"0.62437266",
"0.6238... | 0.73890907 | 0 |
PULLS THE URBAN AREAS API URL FOR SPECIFIED CITY | function urbanSlug() {
$.ajax({
url: querySecondURL,
method: "GET",
}).done(function (response) {
console.log(response);
console.log(response._links["city:urban_area"].href);
//COUNTRY CODE GRABBED BY ADZUNA API
var countryURL = response._links["city:country"].href;
co... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function callAPI(city) {\n var weatherURL = \"https://api.weatherbit.io/v2.0/forecast/daily?key=125e5091a0b746d9a25859114793888d&days=6&city=\" + city\n return $.ajax({\n url: weatherURL,\n method: \"GET\",\n success: function (data) {\n }\n })\n ... | [
"0.6824484",
"0.6682816",
"0.6185189",
"0.615426",
"0.6140819",
"0.60942924",
"0.6055985",
"0.60306233",
"0.59976524",
"0.5970024",
"0.5964057",
"0.5948275",
"0.5947834",
"0.593991",
"0.5929034",
"0.5921982",
"0.59172136",
"0.58993924",
"0.58975744",
"0.5893175",
"0.5879973",... | 0.6833735 | 0 |
this code is strict mode | function bar() {
// this code is also strict mode.
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function strictMode() {\n 'use strict';\n\n //..\n //..\n }",
"transient private protected internal function m182() {}",
"function nonStrictMode() {\n let x = 34;\n\n //..\n 'use strict';\n //..\n }",
"private internal function m248() {}",
"transient final private protected internal function... | [
"0.700863",
"0.65669847",
"0.6437033",
"0.6406819",
"0.6319276",
"0.62874204",
"0.6270003",
"0.6243575",
"0.623028",
"0.62220687",
"0.61885697",
"0.61846226",
"0.61478347",
"0.6141579",
"0.61104053",
"0.6078688",
"0.60658807",
"0.59791523",
"0.596724",
"0.5948656",
"0.5945315... | 0.66404295 | 1 |
constructor of PopupWithImage class. | constructor(popupSelector) {
super(popupSelector);
this._image = this._popup.querySelector(".popup__image");
this._description = this._popup.querySelector(".popup__description");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function preparePopupObject() {\n var height = $( window ).height() * 9 / 10; //90% with limit on 700px\n if (height > 700) {\n height = 700;\n }\n return {\n file : IMAGES_URL,\n title : \"Insert image\",\n width : $( window ).width() * 9 / 1... | [
"0.67220545",
"0.659725",
"0.6502694",
"0.6451205",
"0.63570464",
"0.6142633",
"0.6141414",
"0.6120667",
"0.5912787",
"0.5912787",
"0.59123474",
"0.59032977",
"0.59023464",
"0.58810294",
"0.5838571",
"0.57979757",
"0.5781581",
"0.577313",
"0.5754978",
"0.5752571",
"0.5714085"... | 0.6701324 | 1 |
Take a string containing the translated code for a Ceylon module, extracts the meta data and parses it to get at the dependencies and then preloads those dependencies using rewritten paths that RequireJS will understand. It will then evaluate the actual sources and finally execute the "func()" that was passed. Quite a ... | function loadModuleAsString(src, func, err) {
delete window.ex$;
delete window._CTM$;
delete window.$CCMM$;
var lines = src.split("\n");
var metadata = lines[1];
try {
globalEval(metadata);
} catch (ex) {
if (err) {
err("parsing", ex);
}
}
if (wind... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_parseFile(requireName, filepath, cache, ifStoreSrc, fakeCode, coreModules) {\n let code, e;\n if (filepath in cache) { return cache[filepath]; }\n const isCore = (coreModules && (Array.from(coreModules).includes(requireName))) || !/[\\\\\\/]/.test(filepath);\n const isBinary = /\\.node... | [
"0.5958456",
"0.56065565",
"0.55832493",
"0.54869604",
"0.54367787",
"0.54123664",
"0.5392285",
"0.5364396",
"0.53576356",
"0.535006",
"0.53013456",
"0.53008664",
"0.52969986",
"0.52701974",
"0.5219044",
"0.521651",
"0.521328",
"0.52041525",
"0.51707214",
"0.5132758",
"0.5118... | 0.7286514 | 0 |
The function returns an array of hashtagsections in blocks. These will be areas in block which have hashtags applicable to them. | function getHashtagRanges(blockText, hashtagConfig) {
var sections = [];
if (hashtagConfig) {
var counter = 0;
var startIndex = 0;
var text = blockText;
var trigger = hashtagConfig.trigger || '#';
var separator = hashtagConfig.separator || ' ';
for (; text.length > 0 && startIndex >= 0;) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSections(block, hashtagConfig) {\n var sections = [];\n var lastOffset = 0;\n var sectionRanges = block.entityRanges.map(function (range) {\n var offset = range.offset,\n length = range.length,\n key = range.key;\n\n return {\n offset: offset,\n length: length,\n k... | [
"0.73171216",
"0.62822634",
"0.5737905",
"0.5494678",
"0.54688334",
"0.5445135",
"0.5444306",
"0.53879803",
"0.534561",
"0.5254781",
"0.5248393",
"0.5210212",
"0.5197703",
"0.5184604",
"0.5168408",
"0.51587737",
"0.51571226",
"0.51526755",
"0.51318896",
"0.50628376",
"0.50541... | 0.81304055 | 0 |
The function returns an array of entitysections in blocks. These will be areas in block which have same entity or no entity applicable to them. | function getSections(block, hashtagConfig) {
var sections = [];
var lastOffset = 0;
var sectionRanges = block.entityRanges.map(function (range) {
var offset = range.offset,
length = range.length,
key = range.key;
return {
offset: offset,
length: length,
key: key,
t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getEntities(contentState, selection) {\n var blockMap = null; // Overriden if a selection is specified\n\n var filter = () => true;\n\n if (!selection) {\n blockMap = contentState.getBlockMap();\n } else {\n var blocks = _getBlocksForSelection(contentState, selection);\n\n blockMap = draftJs.... | [
"0.6030502",
"0.5942927",
"0.56609595",
"0.56449294",
"0.5635224",
"0.5628802",
"0.56274027",
"0.5623499",
"0.56053406",
"0.5601239",
"0.5599575",
"0.5599575",
"0.5599575",
"0.5599575",
"0.5599575",
"0.5599575",
"0.5599575",
"0.5572627",
"0.5561526",
"0.55493194",
"0.54647636... | 0.6959568 | 0 |
Function to check if the block is an atomic entity block. | function isAtomicEntityBlock(block) {
if (block.entityRanges.length > 0 && (isEmptyString(block.text) || block.type === 'atomic')) {
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isBlock() {\n const parentNode = this.parentNode\n return (parentNode && parentNode.isContainer())\n }",
"function isBlock() {\n return !rElem && rBlock;\n}",
"function verifyBlock(block,cb)\n{\n\tlet transactions=JSON.stringify(block.transacitons)\n\tif(crypto.createHash(\"sha256\").update(block.bN+... | [
"0.5990764",
"0.59859765",
"0.59152305",
"0.5855972",
"0.58498037",
"0.5833948",
"0.5833948",
"0.57973516",
"0.57973516",
"0.57973516",
"0.57246846",
"0.5680836",
"0.5680836",
"0.56021285",
"0.5598912",
"0.5587647",
"0.5527286",
"0.54810697",
"0.53647894",
"0.53307736",
"0.53... | 0.84344953 | 0 |
The function will return array of inline styles applicable to the block. | function getStyleArrayForBlock(block) {
var text = block.text,
inlineStyleRanges = block.inlineStyleRanges;
var inlineStyles = {
BOLD: new Array(text.length),
ITALIC: new Array(text.length),
UNDERLINE: new Array(text.length),
STRIKETHROUGH: new Array(text.length),
CODE: new Array(text.len... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static get styles() { return []; }",
"getStyle() {\n const style = {};\n if (this.blockDef.bold) {\n style.fontWeight = \"bold\";\n }\n if (this.blockDef.italic) {\n style.fontStyle = \"italic\";\n }\n if (this.blockDef.underline) {\n sty... | [
"0.7091037",
"0.69307494",
"0.67397606",
"0.64518076",
"0.63817436",
"0.6375413",
"0.63573915",
"0.6334739",
"0.62920266",
"0.62920266",
"0.62920266",
"0.62920266",
"0.62920266",
"0.62920266",
"0.62920266",
"0.62920266",
"0.62920266",
"0.62689424",
"0.62689424",
"0.6259966",
... | 0.79373664 | 0 |
The function will return inline style applicable at some offset within a block. | function getStylesAtOffset(inlineStyles, offset) {
var styles = {};
if (inlineStyles.COLOR[offset]) {
styles.COLOR = inlineStyles.COLOR[offset];
}
if (inlineStyles.BGCOLOR[offset]) {
styles.BGCOLOR = inlineStyles.BGCOLOR[offset];
}
if (inlineStyles.FONTSIZE[offset]) {
styles.FONTSIZE = inlineSty... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function citestyle(inlineContext) /* (inlineContext : inlineContext) -> common/citestyle */ {\n return inlineContext.citestyle;\n}",
"function getStyleArrayForBlock(block) {\n var text = block.text,\n inlineStyleRanges = block.inlineStyleRanges;\n\n var inlineStyles = {\n BOLD: new Array(text.length... | [
"0.61688024",
"0.6168793",
"0.6024345",
"0.5909336",
"0.5838118",
"0.57038766",
"0.56045574",
"0.5551781",
"0.55247945",
"0.55095875",
"0.55056804",
"0.5497657",
"0.5451416",
"0.54232675",
"0.5412247",
"0.537885",
"0.537885",
"0.537885",
"0.5365915",
"0.534681",
"0.53105533",... | 0.6384266 | 0 |
Function returns true for a set of styles if the value of these styles at an offset are same as that on the previous offset. | function sameStyleAsPrevious(inlineStyles, styles, index) {
var sameStyled = true;
if (index > 0 && index < inlineStyles.length) {
styles.forEach(function (style) {
sameStyled = sameStyled && inlineStyles[style][index] === inlineStyles[style][index - 1];
});
} else {
sameStyled = false;
}
re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isStylingMatch(tStylingKeyCursor, tStylingKey) {\n ngDevMode &&\n assertNotEqual(Array.isArray(tStylingKey), true, 'Expected that \\'tStylingKey\\' has been unwrapped');\n if (tStylingKeyCursor === null || // If the cursor is `null` it means that we have map at that\n // location so we... | [
"0.6071127",
"0.6071127",
"0.6071127",
"0.6071127",
"0.6071127",
"0.6071127",
"0.60620606",
"0.6014069",
"0.5913279",
"0.58651775",
"0.5842107",
"0.5842107",
"0.57791996",
"0.5680556",
"0.5662435",
"0.56021935",
"0.5570979",
"0.54870856",
"0.54676914",
"0.5442457",
"0.5431348... | 0.66965985 | 0 |
Function returns html for text depending on inline style tags applicable to it. | function addInlineStyleMarkup(style, content) {
if (style === 'BOLD') {
return '<strong>' + content + '</strong>';
} else if (style === 'ITALIC') {
return '<em>' + content + '</em>';
} else if (style === 'UNDERLINE') {
return '<ins>' + content + '</ins>';
} else if (style === 'STRIKETHROUGH') {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderedTextHTML(rcReport) {\n\n //generate the list of charStyles\n\tvar text = rcReport.rawText;\n\n\tvar charStyles = new Array(text.length).fill(null) //TODO make this an array of the same length as the text string, populated by empty lists to start\n\tObject.keys(rcReport.highlights).forEach(functio... | [
"0.6296654",
"0.60650635",
"0.5838463",
"0.58191633",
"0.58073074",
"0.5801947",
"0.5763141",
"0.5722304",
"0.5722304",
"0.5674378",
"0.5602594",
"0.5600388",
"0.5562338",
"0.5553164",
"0.55337197",
"0.55287987",
"0.5524206",
"0.55203193",
"0.5474567",
"0.5464444",
"0.5440089... | 0.65014595 | 0 |
The function returns text for given section of block after doing required character replacements. | function getSectionText(text) {
if (text && text.length > 0) {
var chars = text.map(function (ch) {
switch (ch) {
case '\n':
return '<br>';
case '&':
return '&';
case '<':
return '<';
case '>':
return '>';
default:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getInstHTML(inText, inBlock)\n\t\t{\n\t\t\tvar retText = inText.replace(/blockNum/g, inBlock);\n\t\t\tretText = retText.replace(/nBlocks/g, piCurrent.nBlocks);\n\t\t\tretText = retText.replace(/keyTopLeft/g, piCurrent.keyTopLeft.toUpperCase());\n\t\t\tretText = retText.replace(/keyTopRight/g, piCurrent.ke... | [
"0.63859963",
"0.6053171",
"0.5678697",
"0.5615781",
"0.55340606",
"0.54705346",
"0.54316765",
"0.5423118",
"0.5415969",
"0.53674877",
"0.53156257",
"0.52867794",
"0.52686334",
"0.5264231",
"0.5227907",
"0.5226342",
"0.5223512",
"0.5204035",
"0.5184723",
"0.51828307",
"0.5170... | 0.6258256 | 1 |
Function will return markup for Entity. | function getEntityMarkup(entityMap, entityKey, text, customEntityTransform) {
var entity = entityMap[entityKey];
if (typeof customEntityTransform === 'function') {
var html = customEntityTransform(entity, text);
if (html) {
return html;
}
}
if (entity.type === 'MENTION') {
return '<a href=... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function entityRenderer() {\n\treturn function(value) {\n\t\tif (value) {\n\t\t\tvar url = \"\";\n\t\t\tvar entityId = \"\";\n\t\t\tvar entityType = \"\";\n\t\t\tvar label = \"\";\n\t\t\tvar icon = \"\";\n\t\t\tvar s = value.split(\"\\n\");\n\t\t\tif (s.length == 3) {\n\t\t\t\tentityId = s[1];\n\t\t\t\tentityType ... | [
"0.72735983",
"0.65700215",
"0.64682436",
"0.6340784",
"0.59462774",
"0.58665097",
"0.5742056",
"0.57417053",
"0.57302177",
"0.57067025",
"0.5695746",
"0.56869453",
"0.56522334",
"0.5636272",
"0.5635484",
"0.56239355",
"0.5623771",
"0.56192213",
"0.55933553",
"0.5539835",
"0.... | 0.7098501 | 1 |
For a given section in a block the function will return a further list of sections, with similar inline styles applicable to them. | function getInlineStyleSections(block, styles, start, end) {
var styleSections = [];
var text = block.text;
if (text.length > 0) {
var inlineStyles = getStyleArrayForBlock(block);
var section = void 0;
for (var i = start; i < end; i += 1) {
if (i !== start && sameStyleAsPrevious(inlineStyles, s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSections(block, hashtagConfig) {\n var sections = [];\n var lastOffset = 0;\n var sectionRanges = block.entityRanges.map(function (range) {\n var offset = range.offset,\n length = range.length,\n key = range.key;\n\n return {\n offset: offset,\n length: length,\n k... | [
"0.64678544",
"0.63157",
"0.62506187",
"0.6075956",
"0.6049362",
"0.6047739",
"0.6029342",
"0.60094273",
"0.5997654",
"0.5874504",
"0.5843741",
"0.582069",
"0.5811782",
"0.58037",
"0.5787037",
"0.5761392",
"0.57449985",
"0.5710475",
"0.567036",
"0.5655392",
"0.56024724",
"0... | 0.68242747 | 0 |
The method returns markup for section to which inline styles like BOLD, ITALIC, UNDERLINE, STRIKETHROUGH, CODE, SUPERSCRIPT, SUBSCRIPT are applicable. | function getStyleTagSectionMarkup(styleSection) {
var styles = styleSection.styles,
text = styleSection.text;
var content = getSectionText(text);
forEach(styles, function (style, value) {
content = addInlineStyleMarkup(style, content, value);
});
return content;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getInlineStyleSectionMarkup(block, styleSection) {\n var styleTagSections = getInlineStyleSections(block, ['BOLD', 'ITALIC', 'UNDERLINE', 'STRIKETHROUGH', 'CODE', 'SUPERSCRIPT', 'SUBSCRIPT'], styleSection.start, styleSection.end);\n var styleSectionText = '';\n styleTagSections.forEach(function (styleP... | [
"0.73043823",
"0.635364",
"0.57079893",
"0.56092894",
"0.5547252",
"0.5512077",
"0.5491791",
"0.5374459",
"0.5225946",
"0.52157456",
"0.51922107",
"0.5156656",
"0.51279163",
"0.5121436",
"0.5116676",
"0.51025563",
"0.50675386",
"0.50594974",
"0.5054202",
"0.503921",
"0.503237... | 0.65415186 | 1 |
The method returns markup for section to which inline styles like color, backgroundcolor, fontsize are applicable. | function getInlineStyleSectionMarkup(block, styleSection) {
var styleTagSections = getInlineStyleSections(block, ['BOLD', 'ITALIC', 'UNDERLINE', 'STRIKETHROUGH', 'CODE', 'SUPERSCRIPT', 'SUBSCRIPT'], styleSection.start, styleSection.end);
var styleSectionText = '';
styleTagSections.forEach(function (stylePropertyS... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getStyleTagSectionMarkup(styleSection) {\n var styles = styleSection.styles,\n text = styleSection.text;\n\n var content = getSectionText(text);\n forEach(styles, function (style, value) {\n content = addInlineStyleMarkup(style, content, value);\n });\n return content;\n}",
"get AddHtmlCont... | [
"0.64027846",
"0.60118693",
"0.5862752",
"0.58136195",
"0.57920235",
"0.57508725",
"0.5718685",
"0.56758016",
"0.561558",
"0.5519896",
"0.5515256",
"0.549805",
"0.5375702",
"0.52954537",
"0.52787817",
"0.5251474",
"0.5222066",
"0.52182084",
"0.52173436",
"0.5209086",
"0.52033... | 0.66030866 | 0 |
The method returns markup for an entity section. An entity section is a continuous section in a block to which same entity or no entity is applicable. | function getSectionMarkup(block, entityMap, section, customEntityTransform) {
var entityInlineMarkup = [];
var inlineStyleSections = getInlineStyleSections(block, ['COLOR', 'BGCOLOR', 'FONTSIZE', 'FONTFAMILY'], section.start, section.end);
inlineStyleSections.forEach(function (styleSection) {
entityInlineMark... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"enterEntitySection(ctx) {\n\t}",
"function getEntityContent(entity) {\n\tif (document.getElementById) {\n\t\treturn entity.innerHTML;\n\t} else if (document.all) {\n\t\treturn entity.innerHTML;\n\t} else if (document.layers) {\n\t\treturn entity.document.read();\n\t}\n}",
"async renderEntity() {\n const { e... | [
"0.6111341",
"0.5939312",
"0.57039696",
"0.5675929",
"0.5424555",
"0.54218614",
"0.5354189",
"0.5278487",
"0.5250988",
"0.5156359",
"0.5134191",
"0.5102403",
"0.5074581",
"0.5055963",
"0.50297564",
"0.50005245",
"0.49964753",
"0.494645",
"0.49444097",
"0.49057013",
"0.4903303... | 0.70526654 | 0 |
Function to check if a block is of type list. | function isList(blockType) {
return blockType === 'unordered-list-item' || blockType === 'ordered-list-item';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isList($this){\n return $this.is('ul, ol');\n }",
"function isList($this){\n return $this.is('ul, ol');\n }",
"function isList(opts, node) {\n return opts.types.includes(node.type);\n}",
"function isListElement(parent, node) {\n switch (parent.kind) {\n cas... | [
"0.7330686",
"0.7330686",
"0.7222876",
"0.71287733",
"0.70762855",
"0.6600573",
"0.64673704",
"0.63931197",
"0.6278775",
"0.6258105",
"0.62391365",
"0.6170418",
"0.6099209",
"0.6063947",
"0.6036796",
"0.5970813",
"0.594764",
"0.591822",
"0.591822",
"0.591822",
"0.591822",
"... | 0.84380776 | 0 |
Function will return html markup for a list block. | function getListMarkup(listBlocks, entityMap, hashtagConfig, directional, customEntityTransform) {
var listHtml = [];
var nestedListBlock = [];
var previousBlock = void 0;
listBlocks.forEach(function (block) {
var nestedBlock = false;
if (!previousBlock) {
listHtml.push('<' + getBlockTag(block.typ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_generateListPreviewMarkup(data) {\n return `<div class=\"list-element\" data-listID=\"${data.id}\">\n <div class=\"colour-line\" ></div>\n <h2>${data.listTitle} </h2>\n </div>`;\n }",
"function generateHtml(list){\n\tlet html = \n `<li class=\"student-item cf\">\n\t <div class=\"stude... | [
"0.6692132",
"0.6601856",
"0.65285623",
"0.6503104",
"0.64196247",
"0.63944197",
"0.6307249",
"0.6294694",
"0.6292366",
"0.6246134",
"0.61446446",
"0.6128217",
"0.6100655",
"0.60989267",
"0.60966784",
"0.60966784",
"0.60966784",
"0.6025417",
"0.60048157",
"0.59830266",
"0.598... | 0.69246614 | 0 |
The function will generate html markup for given draftjs editorContent. | function draftToHtml(editorContent, hashtagConfig, directional, customEntityTransform) {
var html = [];
if (editorContent) {
var blocks = editorContent.blocks,
entityMap = editorContent.entityMap;
if (blocks && blocks.length > 0) {
var listBlocks = [];
blocks.forEach(function (block) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function processCode(content) { \n var slide = '\\n' \n slide += '\\t<textarea class=\"textareaCode\" onfocus=\"selectEdit(this.id)\" onBlur=\"deselectEdit(this.id)\">'\n for(var line of content)\n slide += line.replace('<', '<').replace('>', '>') +'\\n'\n ... | [
"0.64645976",
"0.62773734",
"0.62350976",
"0.6193859",
"0.61000437",
"0.60957634",
"0.6093508",
"0.60811454",
"0.6072058",
"0.6070669",
"0.5997872",
"0.59962374",
"0.59956175",
"0.59728223",
"0.59718895",
"0.59619516",
"0.5939797",
"0.5873417",
"0.58541024",
"0.5850862",
"0.5... | 0.6576202 | 0 |
==================================== === OTHER SIDEWORKING FUNCTIONS === ==================================== & === webp support check === & ! === if browser supports webp, it will be added === ! ! === else > just .jpeg/.png === ! | async function supportsWebp() {
if (!self.createImageBitmap) return false;
const webpData = "data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=";
const blob = await fetch(webpData).then(r => r.blob());
return createImageBitmap(blob).then(() => true, () => false);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isWebpSupported(callback) {\n let img = new Image();\n img.onload = () => callback(img.width > 0 && img.height > 0);\n img.onerror = () => callback(false);\n img.src =\n 'data:image/webp;base64,' +\n 'UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==';\n}",
"function checkWebp(cb) {\n var im... | [
"0.7324403",
"0.7092712",
"0.6793175",
"0.67805934",
"0.66271037",
"0.6553124",
"0.6483135",
"0.6431187",
"0.5847469",
"0.58156794",
"0.5782857",
"0.575301",
"0.5735826",
"0.5682923",
"0.56601447",
"0.5647954",
"0.55925477",
"0.5567386",
"0.5530926",
"0.5495489",
"0.5448901",... | 0.7277791 | 1 |
Array with enemy================================= function Enemy(img, x, y, speedX, speedY, width, height) ///////////////////////////////////////////////////////////////////////// Adding enemy========================================== | function addEnemy(x, y ){
let enemy = new Enemy(enemyShipImg, x, y, randomNum(-1, 1), randomNum(1, 2), 20, 30, 'ship', rockrtEnemyLife)
enemyArr.push(enemy);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Enemy(img, x, y, speedX, speedY, width, height, name, life){\n\tthis.img = img;\n\tthis.x = x;\n\tthis.y = y;\n\n\tthis.width = width;\n\tthis.height = height;\n\n\tthis.speedX = speedX;\n\tthis.speedY = speedY;\n\n\tthis.N_x = 0;\n\tthis.N_y = 0;\n\n\tthis.life = life;\n\tthis.name = name;\n\tthis.fire =... | [
"0.76147705",
"0.73525983",
"0.7339395",
"0.7333894",
"0.7262806",
"0.72168314",
"0.7111502",
"0.70984435",
"0.70367664",
"0.7027346",
"0.70020455",
"0.6982995",
"0.6974419",
"0.69690686",
"0.69667405",
"0.6960846",
"0.6936102",
"0.6924908",
"0.6914047",
"0.6889181",
"0.68841... | 0.7627179 | 0 |
Draw enemy biShips ==================================================== | function drawEnemyBigShips(){
for(let i=0;i<enemyArr.length; i++){
if(enemyArr[i].name === 'redCarier'){
if(enemyArr[i].topFrame === true && enemyArr[i].y <= 0){
enemyArr[i].speedY *= -1;
}
if(enemyArr[i].y >= enemyArr[i].yPos ){
enemyArr[i].speedY *= -1;
if(enemyArr[i].topFra... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawEnemy(){\n\tfor(let i=0;i<enemyArr.length; i++){\n\n\t\tif(enemyArr[i].name === 'redFregat'){\n\t\t\tif(enemyArr[i].y >= enemyArr[i].yPos){\n\t\t\t\tenemyArr[i].speedY = 0;\n\t\t\t\tif(enemyArr[i].speedX === 0){\n\t\t\t\t\tenemyArr[i].speedX = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tenemyArr[i].x += ... | [
"0.73781407",
"0.7328486",
"0.7117259",
"0.7039511",
"0.70148027",
"0.6895497",
"0.6851246",
"0.67704487",
"0.67293954",
"0.6728128",
"0.66992027",
"0.66238993",
"0.66184103",
"0.6611224",
"0.65992224",
"0.65740716",
"0.6564773",
"0.6564702",
"0.6560467",
"0.6559332",
"0.6543... | 0.7615727 | 0 |
=///////////////////////////////////////////////////////////////////////////////////////////// CTX draw enemyis | function drawEnemy(){
for(let i=0;i<enemyArr.length; i++){
if(enemyArr[i].name === 'redFregat'){
if(enemyArr[i].y >= enemyArr[i].yPos){
enemyArr[i].speedY = 0;
if(enemyArr[i].speedX === 0){
enemyArr[i].speedX = 1;
}
}
}
enemyArr[i].x += enemyArr[i].speedX;
enemyArr[i].y += enemyArr[i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"drawExistingEnemies() {\n const enemies = this.enemiesManager.entitiesDisplayed;\n for (let index = 0; index < enemies.length; index++) {\n enemies[index].draw(this.ctx);\n }\n }",
"function draw(){\r\n ctx.globalAlpha = 1;\r\n ctx.clearRect(0,0,_WIDTH,_HEIGHT);\r\n //DRAW BG\r\n ctx.drawImage... | [
"0.7740134",
"0.73719126",
"0.7252885",
"0.7244749",
"0.724149",
"0.7136419",
"0.7085716",
"0.69331473",
"0.6914002",
"0.6892854",
"0.68678665",
"0.6799916",
"0.6744714",
"0.67443466",
"0.67297286",
"0.67176676",
"0.6677211",
"0.6613995",
"0.65606457",
"0.65285075",
"0.652146... | 0.75784844 | 1 |
appendId is the element Id you want to append this fragment to | static appendFragment(HTMLtoAppend, parentId) {
var fragment = document.createDocumentFragment();
var newDiv = document.createElement('div');
newDiv.innerHTML = HTMLtoAppend;
newDiv.setAttribute("id", parentId + '_child');
fragment.appendChild(newDiv);
document.getElementById(pare... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"appendTo(id) {\n document.getElementById(id).appendChild(this.element)\n }",
"static appendFragmentMulti(HTMLtoAppend, parentId, fragmentId) {\n\n var fragment = document.createDocumentFragment();\n var newDiv = document.createElement('div');\n newDiv.innerHTML = HTMLtoAppend;\n newDiv.se... | [
"0.6824157",
"0.6513469",
"0.6286812",
"0.62612486",
"0.61304665",
"0.6047222",
"0.59814066",
"0.5977007",
"0.5954599",
"0.59437907",
"0.5893249",
"0.58899474",
"0.58281034",
"0.58281034",
"0.5754803",
"0.57529384",
"0.57382584",
"0.5725537",
"0.56697094",
"0.5666568",
"0.564... | 0.70105016 | 0 |
delete selected fragment. Will delete the most recent fragment if Ids are shared. | static deleteFragment(parentId,fragmentId) {
var this_fragment = document.getElementById(fragmentId);
document.getElementById(parentId).removeChild(this_fragment);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"deleteFragment(editor) {\n editor.deleteFragment();\n }",
"deleteFragment(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var {\n direction = 'forward'\n } = options;\n editor.deleteFragment(direction);\n }",
"delVertex(){\n if(th... | [
"0.71308994",
"0.6696022",
"0.63349855",
"0.58437544",
"0.57525337",
"0.56544876",
"0.5600891",
"0.5597677",
"0.5510269",
"0.5498364",
"0.5482806",
"0.5464929",
"0.5428921",
"0.54172826",
"0.53989094",
"0.5392858",
"0.5385223",
"0.5361266",
"0.53608745",
"0.5322448",
"0.53121... | 0.70220864 | 1 |
Separates the appendId from the fragmentId so you can make multiple child threads with different Ids | static appendFragmentMulti(HTMLtoAppend, parentId, fragmentId) {
var fragment = document.createDocumentFragment();
var newDiv = document.createElement('div');
newDiv.innerHTML = HTMLtoAppend;
newDiv.setAttribute("id", parentId + '_child');
fragment.appendChild(newDiv);
document.ge... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static appendFragment(HTMLtoAppend, parentId) {\n\n var fragment = document.createDocumentFragment();\n var newDiv = document.createElement('div');\n newDiv.innerHTML = HTMLtoAppend;\n newDiv.setAttribute(\"id\", parentId + '_child');\n\n fragment.appendChild(newDiv);\n\n document.get... | [
"0.6389273",
"0.55652595",
"0.55069226",
"0.5404096",
"0.52957726",
"0.5201288",
"0.51413554",
"0.51354694",
"0.51277",
"0.5084503",
"0.50172627",
"0.49981374",
"0.49650282",
"0.4946107",
"0.49227476",
"0.491483",
"0.49142262",
"0.4909166",
"0.48992255",
"0.48974743",
"0.4881... | 0.6815563 | 0 |
Make a move. Sentinel value of null goes forward or backwards in history, depending on 'reverse' | doMove(move, reverse) {
var moves = this.state.moves;
var futureMoves = this.state.futureMoves;
if (move !== null) {
moves.push(move);
futureMoves = [];
} else {
if (reverse) {
move = moves.pop();
futureMoves.push(move);... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function MakeNullMove ()\n{\n\tGameBoard.history[GameBoard.hisPly].posKey = GameBoard.posKey;\n\t\n\t//If there was an en passant square, we need to reset it (hash it out), because this\n\t//square is reset every turn\n\tif (GameBoard.enPas != SQUARES.NO_SQ)\n\t{\n\t\tHASH_EP();\n\t}\n\t\n\t//Updating the history ... | [
"0.6461058",
"0.63412493",
"0.62441826",
"0.62325585",
"0.6230449",
"0.6164313",
"0.6145626",
"0.61295253",
"0.6122893",
"0.59409106",
"0.5934355",
"0.59246993",
"0.5905209",
"0.5862732",
"0.5851216",
"0.5846079",
"0.58442456",
"0.5796339",
"0.5777409",
"0.57653",
"0.5743066"... | 0.6402829 | 1 |
Write a function to count the number of div elements on the web page | function countDivs() {
return document.getElementsByTagName('div');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function countDiv() {\n\n var array = document.getElementsByTagName('div'), // This will return an array\n length = array.length;\n \n return length;\n}",
"function div(document)\n{\n return document.querySelectorAll(\"div\").length;\n}",
"function countDivs(html){\n var count=0;\n ... | [
"0.8416736",
"0.8238836",
"0.8203422",
"0.70944595",
"0.7041079",
"0.6976016",
"0.6752995",
"0.67294276",
"0.6668284",
"0.65692407",
"0.65619737",
"0.6557921",
"0.65095735",
"0.64806277",
"0.6471776",
"0.6444005",
"0.64394265",
"0.6437881",
"0.6383485",
"0.63770485",
"0.63435... | 0.8488324 | 0 |
Check if there are peer connections | function thereAreConnections() {
if (Object.keys(connections).length === 0) return false;
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"has_connections() {\n\t\t\treturn this.connected.length > 0\n\t\t}",
"arePeersReady() {\n return this._readyState === true && this._remoteIsReady === true;\n }",
"function checkConnection(){\n viewModel.notOnline(!navigator.onLine);\n // requests next check in 500 ms\n setTimeout(checkConnection, ... | [
"0.76527715",
"0.7038825",
"0.65918654",
"0.65582395",
"0.6516918",
"0.65003264",
"0.64872104",
"0.6449203",
"0.62509865",
"0.62476504",
"0.6233165",
"0.6221224",
"0.62115216",
"0.6206495",
"0.61992747",
"0.61324966",
"0.61291975",
"0.610066",
"0.6098667",
"0.5966943",
"0.592... | 0.7874017 | 0 |
on video double click go on full screen | function fullScreenVideo() {
if (videoPlayer.controls) return;
if (!isVideoOnFullScreen) {
if (videoPlayer.requestFullscreen) videoPlayer.requestFullscreen();
else if (videoPlayer.webkitRequestFullscreen) videoPlayer.webkitRequestFullscreen();
else if (videoPlayer.msRequestFullscreen) videoP... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fullScreenVideoPlayer(videoId) {\n\n let videoPlayer = getId(videoId);\n\n videoPlayer.addEventListener(\"fullscreenchange\", (e) => {\n if (videoPlayer.controls) return; // if controls enabled do nothing\n let fullscreenElement = document.fullscreenElement;\n if (!fullscreenElement) {\n v... | [
"0.7292037",
"0.71438617",
"0.71094686",
"0.71020025",
"0.70424217",
"0.70263124",
"0.69628906",
"0.69291115",
"0.6903852",
"0.6903852",
"0.6903852",
"0.6890008",
"0.6868802",
"0.68506163",
"0.6815466",
"0.68139744",
"0.6806096",
"0.6792138",
"0.6753475",
"0.66764915",
"0.664... | 0.71634424 | 1 |
AttachMediaStream stream to element | function attachMediaStream(element, stream) {
console.log("Success, media stream attached");
element.srcObject = stream;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onRemoteStreamAdded(event) {\n\tattachMediaStream(remoteVideo.get(0), event.stream);\n}",
"function handleAddStream(data) {\n console.log(\"got stream from peer\");\n console.log(\"peer stream\", data.stream)\n console.log(\"my stream\", myStream)\n const peerStream = document.getElementById... | [
"0.6791371",
"0.6741637",
"0.66819483",
"0.6585714",
"0.6519109",
"0.6476554",
"0.64535326",
"0.6400826",
"0.639309",
"0.6372642",
"0.63197184",
"0.63192105",
"0.62887526",
"0.62394094",
"0.6192113",
"0.61652595",
"0.6143227",
"0.6139367",
"0.6139367",
"0.6118062",
"0.6103833... | 0.8960846 | 0 |
copy room url to clipboard | function copyRoomURL() {
let roomURL = window.location.href;
let tmpInput = document.createElement("input");
document.body.appendChild(tmpInput);
tmpInput.value = roomURL;
tmpInput.select();
document.execCommand("copy");
document.body.removeChild(tmpInput);
notify("Meeting link copied");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function copy() {\n\tvar copyText = document.querySelector(\"#url\");\n\tcopyText.select();\n\tdocument.execCommand(\"copy\");\n}",
"function copyUrl() {\n var text = $('.sambr-editbox-textarea');\n\t\ttext.select(); // 選擇物件\n\t\tdocument.execCommand(\"Copy\"); // 執行瀏覽器複製命令\n\t\talert(\"文字己拷貝\");\n }",
"... | [
"0.8058978",
"0.79021466",
"0.7775577",
"0.75611687",
"0.75550497",
"0.7479777",
"0.74760896",
"0.744475",
"0.74309486",
"0.7330011",
"0.7321445",
"0.7255549",
"0.7187552",
"0.716532",
"0.7160483",
"0.71271193",
"0.7124879",
"0.707853",
"0.7071872",
"0.7052289",
"0.7049089",
... | 0.800257 | 1 |
set video to on / off | function setVideo(e, value) {
myMediaStream.getVideoTracks()[0].enabled = !myMediaStream.getVideoTracks()[0].enabled;
myVideoStatus = myMediaStream.getVideoTracks()[0].enabled;
e.target.className = "fas fa-video" + (myVideoStatus ? "" : "-slash");
if (value) {
videoBtn.className = "fas fa-video" + (myVideoS... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toggleVideo(b) {\n if (b == \"true\") {\n localStream.getVideoTracks()[0].enabled = true\n } else {\n localStream.getVideoTracks()[0].enabled = false\n }\n}",
"function setMyVideoOff(config) {\n let peer_name = config.peer_name;\n if (myVideoStatus === false) return;\n myMediaS... | [
"0.7671713",
"0.7600128",
"0.7595152",
"0.7581918",
"0.7570464",
"0.745307",
"0.72604334",
"0.7253136",
"0.7226749",
"0.72004384",
"0.71230245",
"0.7039199",
"0.70361376",
"0.69781816",
"0.6931589",
"0.69074994",
"0.68971837",
"0.6840059",
"0.6838662",
"0.6832078",
"0.6821355... | 0.7711548 | 0 |
Stop Local Video Track | function stopMyVideoTrack() { myMediaStream.getVideoTracks()[0].stop(); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stopVideo () {\n let tracks = videoStream.getTracks()\n tracks.forEach(function (track) {\n track.stop()\n })\n video.srcObject = null\n}",
"stop() {\n if(this._currentStream){\n this._currentStream.getVideoTracks()[0].stop();\n this._currentStream = null;\n }\... | [
"0.809135",
"0.7937502",
"0.7915205",
"0.7797258",
"0.7774347",
"0.77519894",
"0.77519894",
"0.7747636",
"0.7719725",
"0.7564518",
"0.75631505",
"0.74228144",
"0.73791003",
"0.7268435",
"0.72521365",
"0.7236302",
"0.72201777",
"0.7209929",
"0.7192762",
"0.7181215",
"0.7158032... | 0.84464633 | 0 |
Enable / disable screen sharing | function toggleScreenSharing() {
const constraints = { video: true, };
let screenMediaPromise;
if (!isScreenStreaming) {
// on screen sharing start
if (navigator.getDisplayMedia) screenMediaPromise = navigator.getDisplayMedia(constraints);
else if (navigator.mediaDevices.getDisplayMedia) screenMedia... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isScreenSharing() {}",
"function shareScreenChanged(ifToShare, ifToLocalShare) {\n isScreenSharing = ifToShare;\n isLocalScreenSharing = ifToLocalShare;\n $('#screen-btn').removeClass('disabled selected');\n if (ifToShare) {\n if (ifToLocalShare) {\n $('#screen-btn').addClass('selected disabled');\n ... | [
"0.7545101",
"0.72133654",
"0.7162467",
"0.7080302",
"0.6947595",
"0.6942109",
"0.6757365",
"0.6675122",
"0.66625893",
"0.6511963",
"0.6506673",
"0.6454837",
"0.6453065",
"0.64191365",
"0.64168566",
"0.63343817",
"0.63343203",
"0.6279669",
"0.6278324",
"0.6257221",
"0.6213228... | 0.7830377 | 0 |
Set Screen Sharing Status | function setScreenSharingStatus(status) {
screenShareBtn.className = status ? "fas fa-stop-circle" : "fas fa-desktop";
tippy(screenShareBtn, { content: status ? "stop screen sharing" : "start screen sharing", placement: "right-start", });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function listenToScreenShareStatus(screenSharingStatus) {\n if (screenSharingStatus) {\n if (screenSharingStatus !== UserScreenSharingStateEnum.NONE.enum) {\n scope.d.screenShareStatus = screenSharingStatus;\n ... | [
"0.7255748",
"0.7208644",
"0.7054991",
"0.69394827",
"0.6450669",
"0.6420688",
"0.6413295",
"0.62273234",
"0.6107544",
"0.61062723",
"0.60600805",
"0.60467017",
"0.604505",
"0.6003297",
"0.59760803",
"0.59153014",
"0.5912228",
"0.5911226",
"0.58986056",
"0.5887056",
"0.587011... | 0.74977237 | 0 |
Create Chat Room Data Channel | function createChatChannel(peer_id) { chatChannels[peer_id] = connections[peer_id].createDataChannel( "chat_channel" ); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createDataChannel(connection, channelOptions){\n\t\tvar clientChannel = connection.createDataChannel(\"chat\", channelOptions);\n\n\t\tconnection.dataChannel = clientChannel;\n\t\tconsole.log(\"Datachannel Created\");\n\n\t\tclientChannel.onopen = function () {\n\n\t\t\tif(isInitializing){\n\t\t\t\tchatBo... | [
"0.71355623",
"0.6967934",
"0.6967226",
"0.6927709",
"0.69202036",
"0.68713254",
"0.6798817",
"0.66499615",
"0.66191256",
"0.6559237",
"0.65572566",
"0.655358",
"0.6472866",
"0.6447111",
"0.64178646",
"0.6408164",
"0.64028466",
"0.6399248",
"0.63572526",
"0.63517255",
"0.6343... | 0.7556537 | 0 |
Check if url is an image | function isImageURL(url) { return url.match(/\.(jpeg|jpg|gif|png|tiff|bmp)$/) != null; } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isImage(url) {\n return url.match(/\\.(jpeg|gif|jpg|png)$/) != null;\n}",
"function isImage(url) {\n return (url && url.match(/\\.(jpeg|jpg|gif|png)$/) !== null);\n}",
"function is_image(url)\n {\n return url.startsWith(\"data:\") ||\n /\\.(bmp|gif|jpg|jpeg|png|svg)$/.tes... | [
"0.87207144",
"0.85644364",
"0.84918225",
"0.83522326",
"0.8222923",
"0.81511337",
"0.78845865",
"0.7841916",
"0.7832635",
"0.75970036",
"0.75970036",
"0.75970036",
"0.75970036",
"0.75927407",
"0.7570273",
"0.74224484",
"0.7119926",
"0.7026018",
"0.7004404",
"0.699439",
"0.69... | 0.86373115 | 1 |
Set my Hand Status and Icon | function setMyHandStatus() {
if (myHandStatus) {
// Raise hand
myHandStatus = false;
tippy(myHandBtn, { content: "Raise your hand", placement: "right-start", });
}
else {
// Lower hand
myHandStatus = true;
tippy(myHandBtn, { content: "Lower your hand", placement: "right-start", });
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setIcon() {\n if (dark) {\n nightSwitch.innerHTML = sun;\n } else {\n nightSwitch.innerHTML = moon;\n }\n}",
"setActionIconsDefault() {\n this.talkIcon.setFrame(4)\n this.swordIcon.setFrame(2)\n this.bowIcon.setFrame(0)\n }",
"function setIcon () {\n if ( oauth.hasToken() ) {\n ... | [
"0.6337768",
"0.6283486",
"0.6267474",
"0.6160071",
"0.59827703",
"0.59156036",
"0.5880457",
"0.58092874",
"0.5728408",
"0.5706025",
"0.5697108",
"0.56827354",
"0.5677698",
"0.5649126",
"0.56205827",
"0.5611263",
"0.5564636",
"0.5541761",
"0.55297154",
"0.5522379",
"0.5521045... | 0.7857217 | 0 |
Set My Audio Status Icon and Title | function setMyAudioStatus(status) {
myAudioStatusIcon.className = "fas fa-microphone" + (status ? "" : "-slash");
// send my audio status to all peers in the room
sendStatus("audio", status);
tippy(myAudioStatusIcon, { content: status ? "My audio is On" : "My audio is Off", });
tippy(audioBtn, { content: stat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stAudio(){\n adTitle.innerHTML = bandInfo.playList[titleFlag];\n if (flag===0)\n {\n conAudio.play();\n \n playAudio.style.background = \"url(../images/musicicon.svg)\";\n\t\n\tflag=1;\n\t\n\t}else{\n\t\t\n\t\tconAudio.pause();\n\t\tplayAudio.innerHTML = \"Play\";\n\t\tflag=0;\n\t\t}\n\n\t}",
"s... | [
"0.64925796",
"0.63952774",
"0.6348531",
"0.63140875",
"0.6167556",
"0.61474943",
"0.60971266",
"0.604048",
"0.60101146",
"0.59958124",
"0.5976904",
"0.591624",
"0.58935535",
"0.5871369",
"0.58258396",
"0.5820468",
"0.5819923",
"0.5806851",
"0.5804912",
"0.58009595",
"0.57895... | 0.74242043 | 0 |
Set My Video Status Icon and Title | function setMyVideoStatus(status) {
myVideoImg.style.display = status ? "none" : "block";
myVideoStatusIcon.className = "fas fa-video" + (status ? "" : "-slash");
// send my video status to all peers in the room
sendStatus("video", status);
tippy(myVideoStatusIcon, { content: status ? "My video is On" : "My ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateIcons() {\n // Check if video is paused or playing \n if (video.paused) {\n // if video is paused, show the play button \n play.innerHTML = '<i class=\"fa fa-play fa-2x\">'\n } else {\n // if video is playing, show the pause button\n play.innerHTML = '<i class=\"... | [
"0.6560887",
"0.6460511",
"0.6375954",
"0.6287081",
"0.6198431",
"0.6108692",
"0.60388315",
"0.60388315",
"0.5951975",
"0.59508425",
"0.5882556",
"0.58773154",
"0.5860464",
"0.5835514",
"0.5813915",
"0.5790218",
"0.5777885",
"0.57662",
"0.5762982",
"0.5754218",
"0.5737604",
... | 0.75900906 | 0 |
Set Participant Audio Status Icon and Title | function setPeerAudioStatus(peer_id, status) {
let peerAudioStatus = getId(peer_id + "_audioStatus");
peerAudioStatus.className = "fas fa-microphone" + (status ? "" : "-slash");
tippy(peerAudioStatus, { content: status ? "Participant audio is On" : "Participant audio is Off", });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setMyAudioStatus(status) {\n myAudioStatusIcon.className = \"fas fa-microphone\" + (status ? \"\" : \"-slash\");\n // send my audio status to all peers in the room\n sendStatus(\"audio\", status);\n tippy(myAudioStatusIcon, { content: status ? \"My audio is On\" : \"My audio is Off\", });\n tippy(aud... | [
"0.7380918",
"0.63118744",
"0.60802567",
"0.60668033",
"0.60213774",
"0.59592205",
"0.58787924",
"0.586316",
"0.5827232",
"0.5723521",
"0.57175094",
"0.566509",
"0.565926",
"0.5636529",
"0.5626429",
"0.56104773",
"0.55892086",
"0.5587871",
"0.5565938",
"0.5531104",
"0.5508469... | 0.7018474 | 1 |
Set Participant Video Status Icon and Title | function setPeerVideoStatus(peer_id, status) {
let peerVideoImg = getId(peer_id + "_image");
let peerVideoStatus = getId(peer_id + "_videoStatus");
peerVideoStatus.className = "fas fa-video" + (status ? "" : "-slash");
peerVideoImg.style.display = status ? "none" : "block";
tippy(peerVideoStatus, { content: s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setMyVideoStatus(status) {\n\n myVideoImg.style.display = status ? \"none\" : \"block\";\n myVideoStatusIcon.className = \"fas fa-video\" + (status ? \"\" : \"-slash\");\n // send my video status to all peers in the room\n sendStatus(\"video\", status);\n tippy(myVideoStatusIcon, { content: status ? ... | [
"0.7596296",
"0.6257277",
"0.621572",
"0.60582256",
"0.5994631",
"0.5981778",
"0.5889506",
"0.5854155",
"0.5801434",
"0.5746945",
"0.57037836",
"0.56314397",
"0.562871",
"0.562871",
"0.56238323",
"0.56080335",
"0.56071115",
"0.56008524",
"0.5548263",
"0.55193925",
"0.5497867"... | 0.74317956 | 1 |
Create File Sharing Data Channel | function createFileChannel(peer_id) {
fileChannels[peer_id] = connections[peer_id].createDataChannel( "file_channel" );
fileChannels[peer_id].binaryType = "arraybuffer";
fileChannels[peer_id].addEventListener( "open", fileShareChannelStateChange );
fileChannels[peer_id].addEventListener( "close", fileShareChann... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createFile() {\n var message = 'create file randomly',\n params = {\n message: message,\n committer: {\n name: 'yukihirai0505',\n email: 'hogehoge@gmail.com'\n },\n content: Utilities.base64Encode(message)\n },\n data = fetchJson(FILE_URL.replace(FILE_PATH_PLACE... | [
"0.590655",
"0.5753978",
"0.566559",
"0.56622833",
"0.5637896",
"0.5627598",
"0.5529678",
"0.5523338",
"0.5522652",
"0.55035543",
"0.5498002",
"0.5459306",
"0.5437679",
"0.54049474",
"0.5403848",
"0.54034877",
"0.53768516",
"0.5355554",
"0.5353251",
"0.53422725",
"0.5305198",... | 0.7127962 | 0 |
File Sharing data channel state | function fileShareChannelStateChange(event) {
console.log("fileScreenChannelStateChange", event.type);
if (event.type === "close") {
if (sendInProgress) {
alert("error: File Sharing channel closed");
sendInProgress = false;
}
isFileChannelOpen = false;
return;
}
isFileChannelOpen = t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createFileChannel(peer_id) {\n fileChannels[peer_id] = connections[peer_id].createDataChannel( \"file_channel\" );\n fileChannels[peer_id].binaryType = \"arraybuffer\";\n fileChannels[peer_id].addEventListener( \"open\", fileShareChannelStateChange );\n fileChannels[peer_id].addEventListener( \"close\... | [
"0.58479786",
"0.5539274",
"0.54602146",
"0.5417424",
"0.53401804",
"0.5293054",
"0.5151914",
"0.5150359",
"0.5073321",
"0.5071535",
"0.5070109",
"0.5059441",
"0.50355244",
"0.50123984",
"0.50093204",
"0.49973035",
"0.49938756",
"0.4950029",
"0.49447846",
"0.49447846",
"0.493... | 0.6572967 | 0 |
File sharing data channel error | function fileShareError(event) {
// cleanup
receiveBuffer = [];
incomingFileData = [];
receivedSize = 0;
// error
if (sendInProgress) {
console.error("fileShareError", event);
alert("error: File Sharing " + event.error);
sendInProgress = false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createFileChannel(peer_id) {\n fileChannels[peer_id] = connections[peer_id].createDataChannel( \"file_channel\" );\n fileChannels[peer_id].binaryType = \"arraybuffer\";\n fileChannels[peer_id].addEventListener( \"open\", fileShareChannelStateChange );\n fileChannels[peer_id].addEventListener( \"close\... | [
"0.60882324",
"0.60607773",
"0.55934334",
"0.5509301",
"0.549509",
"0.5436016",
"0.5428176",
"0.5283089",
"0.5270075",
"0.5249675",
"0.52258265",
"0.52244973",
"0.51974463",
"0.51666975",
"0.51591086",
"0.5132381",
"0.5069936",
"0.5069936",
"0.50649345",
"0.5063522",
"0.50345... | 0.64380854 | 0 |
Send File Data trought datachannel | function sendFileData() {
sendInProgress = true;
fileReader = new FileReader();
let offset = 0;
fileReader.addEventListener("error", (err) => console.error("fileReader error", err) );
fileReader.addEventListener("abort", (e) => console.log("fileReader aborted", e) );
fileReader.addEventListener("load", (e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendFile(id, option) {\n let fileReader = new FileReader();\n let files = document.getElementById(\"sendFile\").files; // Gets an array of our selected files\n for (let i in files) {\n if (files[i].name == option) { // Find the requested file\n\n fileReader.readAsArrayBuffer(files[i]); // Get t... | [
"0.72271913",
"0.6957713",
"0.6832655",
"0.6826819",
"0.64791924",
"0.6463318",
"0.6323603",
"0.6269772",
"0.6240194",
"0.62179327",
"0.6186656",
"0.614722",
"0.6134179",
"0.6125165",
"0.60932624",
"0.6089312",
"0.6078825",
"0.60667694",
"0.60331637",
"0.5990324",
"0.59823513... | 0.7574835 | 0 |
Select the File to Share | function selectFileToShare() {
Swal.fire({ allowOutsideClick: false, background: background, position: "top", title: "Share the file",
input: "file", inputAttributes: { accept: fileInput, "aria-label": "Select the file", },
showDenyButton: true, confirmButtonText: `Send`, confirmButtonColor: 'black', deny... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"selectFile(callback) {\n\t\tconst input = document.createElement('input');\n\t\tinput.type = 'file';\n\t\tinput.multiple = false;\n\t\tinput.onchange = (ev) => {\n\t\t\tconst { files } = ev.target;\n\t\t\tcallback.call(UploadFS, files[0]);\n\t\t};\n\t\t// Fix for iOS/Safari\n\t\tconst div = document.createElement(... | [
"0.67293227",
"0.66049904",
"0.6524067",
"0.6521835",
"0.6481818",
"0.6456668",
"0.63923955",
"0.6332239",
"0.6263838",
"0.6234001",
"0.6226263",
"0.6213425",
"0.61890656",
"0.6174788",
"0.61511654",
"0.6111731",
"0.61032766",
"0.6088193",
"0.6026656",
"0.6016481",
"0.6007892... | 0.6945732 | 0 |
set peer kick out button | function setPeerKickOutBtn(peer_id) {
let peerKickOutBtn = getId(peer_id + "_kickOut");
peerKickOutBtn.addEventListener("click", (e) => { kickOut(peer_id, peerKickOutBtn); });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hangupAction() {\n localPeerConnection.close();\n localPeerConnection = null;\n hangupButton.disabled = true;\n console.log('Ending call.');\n}",
"function kickedOut(config) {\n let peer_name = config.peer_name;\n let timerInterval;\n Swal.fire({ allowOutsideClick: false, background: background, ... | [
"0.7056952",
"0.6494199",
"0.60471976",
"0.604269",
"0.59446406",
"0.5938087",
"0.58623475",
"0.58341664",
"0.5811286",
"0.5790223",
"0.5786993",
"0.5709712",
"0.5699579",
"0.5673349",
"0.5671038",
"0.56339306",
"0.5621703",
"0.5611344",
"0.5608192",
"0.5586694",
"0.5582586",... | 0.77777433 | 0 |
TASK: SERVE Start serving /dist via browserSync, then watch for andy file changes | function serve() {
browserSync.init({
server: 'dist/'
});
watch(srcPaths.html, { interval: 1000 }, html);
watch(srcPaths.scripts, { interval: 1000 }, scripts);
watch(srcPaths.styles, { interval: 1000 }, styles);
watch(srcPaths.images, { interval: 1000 }, images)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function watchAndServe() {\n browserSync.init({\n server: 'dist',\n });\n\n watch('src/styles/**/*.scss', styles);\n watch('src/pug/pages/*.pug', pugHtml);\n // watch('src/**/*.html', html);\n watch('src/assets/**/*', assets);\n watch('src/js/**/*.js', scripts);\n watch('dist/*.html').on('change', brows... | [
"0.8024507",
"0.7730186",
"0.7653299",
"0.7572846",
"0.7557701",
"0.75416607",
"0.7489777",
"0.7460623",
"0.74378955",
"0.7412561",
"0.72858256",
"0.72843206",
"0.7260716",
"0.72276896",
"0.7218689",
"0.7210307",
"0.7190986",
"0.7165807",
"0.715574",
"0.7145539",
"0.7144029",... | 0.7786632 | 1 |
View for creating a new Composite property and performing augmentation. Delegates to other views for the various steps in the augmentation process. | function CompositePropertyView(options) {
this.initialize.apply(this, [options]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"newBasicProp(...args){\n let newProp = new BasicProperty(...args);\n this.addProperty(newProp);\n }",
"function create(composite, parameters) {\n var createOptions = _.extend({}, composite.options, options);\n this[composite.property] = new composite.model(parameters,\n ... | [
"0.5803324",
"0.5607766",
"0.5294246",
"0.5251177",
"0.52320874",
"0.51856744",
"0.5167465",
"0.5167377",
"0.51285034",
"0.5125338",
"0.5125338",
"0.5125338",
"0.5117835",
"0.5108266",
"0.5102271",
"0.51010823",
"0.5062422",
"0.5062422",
"0.5028613",
"0.49843687",
"0.49802008... | 0.7437399 | 0 |
Recursively find files which passes the regex test | function collectFilesWithPattern(cwd, regex) {
var results = [];
fs.readdirSync(cwd)
.forEach(function (name) {
var pathname = path.join(cwd, name);
if (name[0] !== '.' && fs.statSync(pathname).isDirectory()) {
results = results.concat(collectFilesWithPattern(pathname, regex));
} else ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function list(path, regex=undefined, files=[]) {\n const fs = require('fs');\n let localFiles = fs.readdirSync(path);\n\n for(let dir of localFiles) {\n let fileData = fs.lstatSync(`${path}/${dir}`);\n\n if(fileData.isDirectory()) {\n list(`${path}/${dir}`, regex, files);\n ... | [
"0.63981605",
"0.6039763",
"0.6020938",
"0.60152936",
"0.5985151",
"0.588764",
"0.57899714",
"0.57837856",
"0.5758704",
"0.5748393",
"0.5713926",
"0.5632528",
"0.5615848",
"0.55954707",
"0.5565417",
"0.5555523",
"0.55542797",
"0.55534303",
"0.55496466",
"0.5532709",
"0.552871... | 0.71684474 | 0 |
Returns true if there is an animation | isAnimating() {
return this.animations.length &&
this.animations.some((anim) => anim.blocksGameLoop());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isAnimating() {\n return animationFrame > 1;\n }",
"hasAnimations() {\n\n return !!Object.keys(this.__animations).length;\n\n }",
"function checkAnimationComplete(){\t\n\tvar targetName = '';\n\tfor(n=0;n<animation_arr.length;n++){\n\t\tif($.pukiAnimation[animation_arr[n].name].visible){\n\t\t\tt... | [
"0.81552696",
"0.7992421",
"0.795986",
"0.79468083",
"0.774582",
"0.7435596",
"0.73904705",
"0.7337069",
"0.73356074",
"0.73299944",
"0.7317912",
"0.7197388",
"0.7126413",
"0.7071825",
"0.7005474",
"0.7005474",
"0.6994255",
"0.6990351",
"0.6961235",
"0.6951738",
"0.6948485",
... | 0.80202436 | 1 |
Ends all the Animations | endAll() {
this.animations.forEach((anim) => anim.onEnd());
this.animations = [];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function finishAllAnimations() {\n runningAnimations.forEach(function (animation) {\n animation.finishNow();\n });\n clearTimeout(fadeInTimer);\n clearTimeout(animateHeightTimer);\n clearTimeout(animationsCompleteTimer);\n runningAnimations.length = 0;\n }",
"function finishAnimations() {... | [
"0.77940047",
"0.73777306",
"0.7249109",
"0.7238775",
"0.7164866",
"0.7149945",
"0.70995176",
"0.7090881",
"0.7066589",
"0.6970161",
"0.6958191",
"0.6958191",
"0.6958191",
"0.69271284",
"0.69126403",
"0.6826393",
"0.6823897",
"0.67834336",
"0.677647",
"0.67764664",
"0.6764166... | 0.8338266 | 0 |
Creates the Paused Animation | paused() {
this.add(new PausedAnimation(this.canvas));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"animation() {}",
"function PowerupSpawnAnimation(pos, size, color) {\n this.alpha = 0;\n this.color = color;\n this.pos = pos;\n this.size = size;\n this.is_done = false;\n}",
"draw() {\n var particle = $(\n `<img src='http://pngimg.com/uploads/fish/fish_PNG25137.png' class='${\n this.parti... | [
"0.59631985",
"0.5721123",
"0.5698979",
"0.56874204",
"0.5644828",
"0.5608912",
"0.55751705",
"0.55490965",
"0.554868",
"0.55331504",
"0.5505373",
"0.54961455",
"0.5476232",
"0.5474234",
"0.5466223",
"0.546324",
"0.54612315",
"0.54582316",
"0.54563385",
"0.5416313",
"0.540941... | 0.6978407 | 0 |
this is for all standard get and post requests to /cowSayWhat | function cowsay (request, response) {
if (request.method === 'POST') {
bodyParser(request, function(err, data) {
if (err) return error(response, err);
if (data.text) return responseWriter(response, 200, cowSayWhat(data.text));
error(response, 'Bad POST request.\n try this JSON: {"text": "howdy"}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"GET() {\n }",
"function handleGetRequest(request, response){ \n var dataAfterIndex = request.url.indexOf(\"?\");\n var cutDownUrl = request.url; \n var getObject = null;\n\n // Get the data send with the url\n if(dataAfterIndex != -1) {\n var getObject = queryParser.parse(cutDownUrl.subs... | [
"0.617832",
"0.58528",
"0.56983536",
"0.56225896",
"0.5614119",
"0.55875254",
"0.55364156",
"0.5509574",
"0.54957926",
"0.54928166",
"0.54810256",
"0.54278535",
"0.5407234",
"0.5393842",
"0.5355945",
"0.5347823",
"0.5342108",
"0.5334655",
"0.5327828",
"0.53043413",
"0.5286259... | 0.68485934 | 0 |
compiles a json for all of the incidents | function compileIncidentJSON() {
const getIncidents = GetIncidentSection("GetIncidentDetails");
//Witnesses section
const getWitnesses = GetIncidentSection("GetICDCMWitness");
//limitations section
const getLimitations = GetIncidentSection("GetICDCMLimitation");
//corrective actions section
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function compileJson(data) {\n var code = '#imports\\nfrom time import sleep\\nimport sys\\n\\n#variable inits\\nprevVal=\"\"\\n'\n data.vars.forEach(v => {\n code += '___'+v+'=\"\"\\n'\n })\n code += compileCodelist(data.code)\n return code\n}",
"function createContinentsJSON() {\n // let continents = ... | [
"0.601381",
"0.5615752",
"0.53082734",
"0.5264404",
"0.52551377",
"0.51049477",
"0.5077091",
"0.5029915",
"0.49807572",
"0.4958347",
"0.49515635",
"0.4884851",
"0.48843387",
"0.4832095",
"0.482306",
"0.48067847",
"0.47914252",
"0.47842315",
"0.47267124",
"0.47065586",
"0.4666... | 0.75658786 | 0 |
loads the incident details section | function loadIncidents(compiledIncidentSection) {
//first time loading claim
compiledIncidentSection.incidents.forEach((incident, incidentID) => {
PopulateGenericList("WorkIssues", "populateWorkIssues", "ListText", "ListValue")
$("#IncidentDetailsWrapper").append(incidentTemplate(incident, incid... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadDetails() {\n ctrl.testCasesReguest =\n $http.get(ctrl.requestUrl).success(function (data) {\n ctrl.data = data;\n }).catch(function (error) {\n ctrl.data = null;\n ctrl.error = error.statusText;\n ... | [
"0.6376912",
"0.6248804",
"0.6171344",
"0.6155188",
"0.5868961",
"0.5680009",
"0.5635127",
"0.55922735",
"0.55801547",
"0.55432093",
"0.54737484",
"0.5453072",
"0.5449403",
"0.5440203",
"0.53926057",
"0.53900284",
"0.5366212",
"0.53632224",
"0.5329279",
"0.5320102",
"0.531895... | 0.64479226 | 0 |
takes a select inputs data atribute of datasectionname and toggles the class 'hidden'. | function showHideBasedOnSelect(dropdownElement) {
//shows the section by removing the class hidden on the selected element
$("[data-id='" + $(dropdownElement.find("option:selected")[0]).attr("data-sectionname") + "']").removeClass("hidden");
//loops through all the options not selected and hides their corr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hideStuff() {\n let value = $(this).val();\n\n if (value !== 'default') {\n $('section').hide();\n $(`section[data-keyword=${value}]`).show();\n } else {\n $('section').show();\n }\n }",
"function selectOptionOut(group){\r\n var rename = document.getElementById(group+\... | [
"0.6442067",
"0.6314488",
"0.6309778",
"0.61952955",
"0.6184286",
"0.61376077",
"0.60754204",
"0.6072932",
"0.6060082",
"0.60539013",
"0.59841275",
"0.5974589",
"0.5956801",
"0.5944682",
"0.59407836",
"0.5897699",
"0.58688045",
"0.58487403",
"0.5843706",
"0.58372545",
"0.5831... | 0.67703336 | 0 |
loads ICDCMCategories for specific incident | function loadICDCMCategoriesControls(incident, incidentID) {
//creates a table for all the icdcmCategorys in the current incident
$(`#primaryIncident_${incidentID}`).find("[id*='ICDCMCategoryTabPane']").each(function () {
const DiagnosisID = $(this).attr("data-icdcmCategoryID");
const categoryDa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadIncidents(compiledIncidentSection) {\n //first time loading claim\n compiledIncidentSection.incidents.forEach((incident, incidentID) => {\n PopulateGenericList(\"WorkIssues\", \"populateWorkIssues\", \"ListText\", \"ListValue\")\n $(\"#IncidentDetailsWrapper\").append(incidentTempl... | [
"0.6479412",
"0.5881433",
"0.5855179",
"0.58372927",
"0.5746095",
"0.5679779",
"0.5589027",
"0.55447435",
"0.544635",
"0.54039377",
"0.5365502",
"0.52894145",
"0.526799",
"0.52675414",
"0.5228779",
"0.5174609",
"0.5174288",
"0.51596206",
"0.5130677",
"0.5111282",
"0.51110953"... | 0.74886745 | 0 |
clears form values that are children of a specific ID. | function clearForms(formId) {
$("[data-id='" + formId + "']").find(":input").not(':button, :submit, :reset, :hidden, :checkbox, :radio').val('');
//$('#' + formId + ' :input').not(':button, :submit, :reset, :hidden, :checkbox, :radio').val('');
$("[data-id='" + formId + "']").find(":checkbox, :radio").prop(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function delValue(id) {\n\n\t//該当値行を削除する\n\t$(id).parent().parent().remove();\n}",
"function resetForm() {\n\t// enable the ID-field if it was disabled before\n\t$(this).children('#id').prop('disabled', false);\n\t\n\t// clear all forms\n\t$('#storyblock-form').children('#id').val('');\n\t$('#storyblock-form').c... | [
"0.64336467",
"0.6365686",
"0.62037766",
"0.6202224",
"0.6160387",
"0.6150017",
"0.61426306",
"0.6101936",
"0.6085152",
"0.6081472",
"0.60723394",
"0.6052808",
"0.60435665",
"0.6035883",
"0.60295236",
"0.60114807",
"0.59945244",
"0.5962344",
"0.5945553",
"0.59305227",
"0.5921... | 0.65554065 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.