tangledgroup/tangled-llama-p-128k-base-v0.1
Text Generation
•
Updated
•
40
•
2
type
stringclasses 7
values | content
stringlengths 4
9.55k
| repo
stringlengths 7
96
| path
stringlengths 4
178
| language
stringclasses 1
value |
---|---|---|---|---|
ClassDeclaration |
export declare class DxoTextsComponent extends NestedOption {
fix: string;
leftPosition: string;
rightPosition: string;
unfix: string;
addRow: string;
cancelAllChanges: string;
cancelRowChanges: string;
confirmDeleteMessage: string;
confirmDeleteTitle: string;
deleteRow: string;
editRow: string;
saveAllChanges: string;
saveRowChanges: string;
undeleteRow: string;
validationCancelChanges: string;
exportAll: string;
exportSelectedRows: string;
exportTo: string;
clearFilter: string;
createFilter: string;
filterEnabledHint: string;
groupByThisColumn: string;
groupContinuedMessage: string;
groupContinuesMessage: string;
ungroup: string;
ungroupAll: string;
cancel: string;
emptyValue: string;
ok: string;
avg: string;
avgOtherColumn: string;
count: string;
max: string;
maxOtherColumn: string;
min: string;
minOtherColumn: string;
sum: string;
sumOtherColumn: string;
allFields: string;
columnFields: string;
dataFields: string;
filterFields: string;
rowFields: string;
columnFieldArea: string;
dataFieldArea: string;
filterFieldArea: string;
rowFieldArea: string;
collapseAll: string;
dataNotAvailable: string;
expandAll: string;
exportToExcel: string;
grandTotal: string;
noData: string;
removeAllSorting: string;
showFieldChooser: string;
sortColumnBySummary: string;
sortRowBySummary: string;
total: string;
addRowToNode: string;
protected readonly _optionPath: string;
constructor(parentOptionHost: NestedOptionHost, optionHost: NestedOptionHost);
} | IgorMinar/devextreme-angular-build | ui/nested/texts.d.ts | TypeScript |
ClassDeclaration |
export declare class DxoTextsModule {
} | IgorMinar/devextreme-angular-build | ui/nested/texts.d.ts | TypeScript |
ArrowFunction |
() => {
this.updateErrorText();
} | aalexeev239/taiga-ui | projects/kit/components/field-error/field-error.component.ts | TypeScript |
ArrowFunction |
errorId => !!this.controlErrors[errorId] | aalexeev239/taiga-ui | projects/kit/components/field-error/field-error.component.ts | TypeScript |
ClassDeclaration | // TODO: Refactor
// @dynamic
@Component({
selector: 'tui-field-error',
// @bad TODO: find a way to get 'touched' state change
// https://github.com/angular/angular/issues/10887
// changeDetection: ChangeDetectionStrategy.OnPush,
templateUrl: './field-error.template.html',
styleUrls: ['./field-error.style.less'],
animations: [tuiHeightCollapse, tuiFadeIn],
})
export class TuiFieldErrorComponent implements OnInit, OnDestroy {
@Input()
@tuiRequiredSetter()
set order(value: readonly string[]) {
this.errorsOrder = value;
this.updateErrorText();
}
private firstError: TuiValidationError | null = null;
private errorsOrder: readonly string[] = [];
private destroy$ = new Subject<void>();
constructor(
@Optional()
@Self()
@Inject(NgControl)
private ngControl: NgControl | null,
@Optional()
@Self()
@Inject(FormArrayName)
private formArrayName: FormArrayName | null,
@Optional()
@Self()
@Inject(FormGroupName)
private formGroupName: FormGroupName | null,
@Optional()
@Self()
@Inject(FormGroupDirective)
private formGroup: FormGroupDirective | null,
@Inject(ChangeDetectorRef) private changeDetectorRef: ChangeDetectorRef,
@Inject(TUI_VALIDATION_ERRORS)
private readonly validationErrors: Record<string, PolymorpheusContent>,
) {
tuiAssert.assert(
!!this.ngControl,
`NgControl not injected in ${this.constructor.name}!` +
' Use [(ngModel)] or [formControl] or formControlName for correct work.',
);
if (this.ngControl) {
this.ngControl.valueAccessor = this;
}
}
ngOnInit() {
const control = this.control;
if (!control) {
return;
}
// Temporary workaround until issue with async validators will be resolved.
// https://github.com/angular/angular/issues/13200
if (control.asyncValidator) {
control.updateValueAndValidity();
}
this.updateErrorText();
control.statusChanges.pipe(takeUntil(this.destroy$)).subscribe(() => {
this.updateErrorText();
});
}
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
get computedError(): TuiValidationError | null {
return this.invalid && this.touched && this.firstError ? this.firstError : null;
}
get invalid(): boolean {
const control = this.control;
return control && control.invalid !== null ? control.invalid : false;
}
get touched(): boolean {
const control = this.control;
return control && control.touched !== null ? control.touched : false;
}
get control(): AbstractControl | null {
if (this.ngControl) {
return this.ngControl.control;
}
if (this.formArrayName) {
return this.formArrayName.control;
}
if (this.formGroupName) {
return this.formGroupName.control;
}
if (this.formGroup) {
return this.formGroup.control;
}
return null;
}
registerOnChange() {
this.markForCheck();
}
registerOnTouched() {
this.markForCheck();
}
setDisabledState() {
this.markForCheck();
}
writeValue() {
this.markForCheck();
}
private get firstErrorIdByOrder(): string | null {
const firstErrorId =
this.errorsOrder &&
this.errorsOrder.find(errorId => !!this.controlErrors[errorId]);
return firstErrorId || null;
}
private get firstErrorId(): string | null {
const errorIds = Object.keys(this.controlErrors);
return errorIds[0];
}
private get controlErrors(): {[key: string]: any} {
const control = this.control;
return (control && control.errors) || {};
}
private updateErrorText() {
this.firstError = this.getErrorText();
}
private getErrorText(): TuiValidationError | null {
const firstErrorId = this.firstErrorIdByOrder || this.firstErrorId;
const firstError = firstErrorId && this.controlErrors[firstErrorId];
// @bad TODO: Remove firstError.message check after everybody migrates to TuiValidationError
if (
firstError &&
(firstError instanceof TuiValidationError ||
typeof firstError.message === 'string')
) {
return firstError;
}
return firstErrorId
? new TuiValidationError(this.validationErrors[firstErrorId], firstError)
: null;
}
private markForCheck() {
this.changeDetectorRef.markForCheck();
}
} | aalexeev239/taiga-ui | projects/kit/components/field-error/field-error.component.ts | TypeScript |
MethodDeclaration |
ngOnInit() {
const control = this.control;
if (!control) {
return;
}
// Temporary workaround until issue with async validators will be resolved.
// https://github.com/angular/angular/issues/13200
if (control.asyncValidator) {
control.updateValueAndValidity();
}
this.updateErrorText();
control.statusChanges.pipe(takeUntil(this.destroy$)).subscribe(() => {
this.updateErrorText();
});
} | aalexeev239/taiga-ui | projects/kit/components/field-error/field-error.component.ts | TypeScript |
MethodDeclaration |
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
} | aalexeev239/taiga-ui | projects/kit/components/field-error/field-error.component.ts | TypeScript |
MethodDeclaration |
registerOnChange() {
this.markForCheck();
} | aalexeev239/taiga-ui | projects/kit/components/field-error/field-error.component.ts | TypeScript |
MethodDeclaration |
registerOnTouched() {
this.markForCheck();
} | aalexeev239/taiga-ui | projects/kit/components/field-error/field-error.component.ts | TypeScript |
MethodDeclaration |
setDisabledState() {
this.markForCheck();
} | aalexeev239/taiga-ui | projects/kit/components/field-error/field-error.component.ts | TypeScript |
MethodDeclaration |
writeValue() {
this.markForCheck();
} | aalexeev239/taiga-ui | projects/kit/components/field-error/field-error.component.ts | TypeScript |
MethodDeclaration |
private updateErrorText() {
this.firstError = this.getErrorText();
} | aalexeev239/taiga-ui | projects/kit/components/field-error/field-error.component.ts | TypeScript |
MethodDeclaration |
private getErrorText(): TuiValidationError | null {
const firstErrorId = this.firstErrorIdByOrder || this.firstErrorId;
const firstError = firstErrorId && this.controlErrors[firstErrorId];
// @bad TODO: Remove firstError.message check after everybody migrates to TuiValidationError
if (
firstError &&
(firstError instanceof TuiValidationError ||
typeof firstError.message === 'string')
) {
return firstError;
}
return firstErrorId
? new TuiValidationError(this.validationErrors[firstErrorId], firstError)
: null;
} | aalexeev239/taiga-ui | projects/kit/components/field-error/field-error.component.ts | TypeScript |
MethodDeclaration |
private markForCheck() {
this.changeDetectorRef.markForCheck();
} | aalexeev239/taiga-ui | projects/kit/components/field-error/field-error.component.ts | TypeScript |
ArrowFunction |
response => {
this.returnData = `<i class="material-icons green">done</i>${response}`;
} | CESNET/perun-web-apps | apps/admin-gui/src/app/shared/pipes/application-state.pipe.ts | TypeScript |
ArrowFunction |
response => {
this.returnData = `<i class="material-icons red">clear</i>${response}`;
} | CESNET/perun-web-apps | apps/admin-gui/src/app/shared/pipes/application-state.pipe.ts | TypeScript |
ArrowFunction |
response => {
this.returnData = `<i class="material-icons orange">contact_mail</i> ${response}`;
} | CESNET/perun-web-apps | apps/admin-gui/src/app/shared/pipes/application-state.pipe.ts | TypeScript |
ArrowFunction |
response => {
this.returnData = `<i class="material-icons blue">gavel</i>${response}`;
} | CESNET/perun-web-apps | apps/admin-gui/src/app/shared/pipes/application-state.pipe.ts | TypeScript |
ClassDeclaration |
@Pipe({
name: 'applicationState',
pure: false
})
export class ApplicationStatePipe implements PipeTransform {
private returnData = '';
constructor(
private translate: TranslateService
) { }
transform(value: any): any {
switch (value) {
case 'APPROVED': {
this.translate.get('VO_DETAIL.APPLICATION.STATE.APPROVED').subscribe(response => {
this.returnData = `<i class="material-icons green">done</i>${response}`;
});
break;
}
case 'REJECTED': {
this.translate.get('VO_DETAIL.APPLICATION.STATE.REJECTED').subscribe(response => {
this.returnData = `<i class="material-icons red">clear</i>${response}`;
});
break;
}
case 'NEW': {
this.translate.get('VO_DETAIL.APPLICATION.STATE.NEW').subscribe(response => {
this.returnData = `<i class="material-icons orange">contact_mail</i> ${response}`;
});
break;
}
case 'VERIFIED': {
this.translate.get('VO_DETAIL.APPLICATION.STATE.VERIFIED').subscribe(response => {
this.returnData = `<i class="material-icons blue">gavel</i>${response}`;
});
break;
}
default: {
this.returnData = value;
break;
}
}
return this.returnData;
}
} | CESNET/perun-web-apps | apps/admin-gui/src/app/shared/pipes/application-state.pipe.ts | TypeScript |
MethodDeclaration |
transform(value: any): any {
switch (value) {
case 'APPROVED': {
this.translate.get('VO_DETAIL.APPLICATION.STATE.APPROVED').subscribe(response => {
this.returnData = `<i class="material-icons green">done</i>${response}`;
});
break;
}
case 'REJECTED': {
this.translate.get('VO_DETAIL.APPLICATION.STATE.REJECTED').subscribe(response => {
this.returnData = `<i class="material-icons red">clear</i>${response}`;
});
break;
}
case 'NEW': {
this.translate.get('VO_DETAIL.APPLICATION.STATE.NEW').subscribe(response => {
this.returnData = `<i class="material-icons orange">contact_mail</i> ${response}`;
});
break;
}
case 'VERIFIED': {
this.translate.get('VO_DETAIL.APPLICATION.STATE.VERIFIED').subscribe(response => {
this.returnData = `<i class="material-icons blue">gavel</i>${response}`;
});
break;
}
default: {
this.returnData = value;
break;
}
}
return this.returnData;
} | CESNET/perun-web-apps | apps/admin-gui/src/app/shared/pipes/application-state.pipe.ts | TypeScript |
FunctionDeclaration |
export function isRelativePath(p: string): boolean {
return p.startsWith('.')
} | wendellhu95/squirrel | src/utils/path.ts | TypeScript |
FunctionDeclaration |
async function readAndDecodeFromDisk(path, _encoding) {
return new Promise<string>((resolve, reject) => {
fs.readFile(path, (err, data) => {
if (err) {
reject(err);
} else {
resolve(encoding.decode(data, _encoding));
}
});
});
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
FunctionDeclaration |
async function readAllAsString(stream: NodeJS.ReadableStream) {
return new Promise<string>((resolve, reject) => {
let all = '';
stream.on('data', chunk => {
all += chunk;
assert.equal(typeof chunk, 'string');
});
stream.on('end', () => {
resolve(all);
});
stream.on('error', reject);
});
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
ArrowFunction |
() => {
const file = require.toUrl('./fixtures/some_utf8.css');
return encoding.detectEncodingByBOM(file).then((encoding: string) => {
assert.equal(encoding, 'utf8');
});
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
ArrowFunction |
(encoding: string) => {
assert.equal(encoding, 'utf8');
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
ArrowFunction |
() => {
const file = require.toUrl('./fixtures/some_utf16le.css');
return encoding.detectEncodingByBOM(file).then((encoding: string) => {
assert.equal(encoding, 'utf16le');
});
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
ArrowFunction |
(encoding: string) => {
assert.equal(encoding, 'utf16le');
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
ArrowFunction |
() => {
const file = require.toUrl('./fixtures/some_utf16be.css');
return encoding.detectEncodingByBOM(file).then((encoding: string) => {
assert.equal(encoding, 'utf16be');
});
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
ArrowFunction |
(encoding: string) => {
assert.equal(encoding, 'utf16be');
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
ArrowFunction |
(encoding: string) => {
assert.equal(encoding, null);
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
ArrowFunction |
enc => {
assert.ok(encoding.encodingExists(enc));
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
ArrowFunction |
enc => {
assert.ok(encoding.encodingExists(enc));
assert.equal(enc, 'utf16le');
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
ArrowFunction |
buffer => {
const mimes = encoding.detectEncodingFromBuffer(buffer);
assert.equal(mimes.seemsBinary, false);
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
ArrowFunction |
buffer => {
const mimes = encoding.detectEncodingFromBuffer(buffer);
assert.equal(mimes.seemsBinary, true);
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
ArrowFunction |
buffer => {
const mimes = encoding.detectEncodingFromBuffer(buffer);
assert.equal(mimes.encoding, encoding.UTF16le);
assert.equal(mimes.seemsBinary, false);
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
ArrowFunction |
buffer => {
const mimes = encoding.detectEncodingFromBuffer(buffer);
assert.equal(mimes.encoding, encoding.UTF16be);
assert.equal(mimes.seemsBinary, false);
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
ArrowFunction |
buffer => {
return encoding.detectEncodingFromBuffer(buffer, true).then(mimes => {
assert.equal(mimes.encoding, 'shiftjis');
});
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
ArrowFunction |
mimes => {
assert.equal(mimes.encoding, 'shiftjis');
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
ArrowFunction |
buffer => {
return encoding.detectEncodingFromBuffer(buffer, true).then(mimes => {
assert.equal(mimes.encoding, 'windows1252');
});
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
ArrowFunction |
mimes => {
assert.equal(mimes.encoding, 'windows1252');
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
fs.readFile(path, (err, data) => {
if (err) {
reject(err);
} else {
resolve(encoding.decode(data, _encoding));
}
});
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
ArrowFunction |
(err, data) => {
if (err) {
reject(err);
} else {
resolve(encoding.decode(data, _encoding));
}
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
let all = '';
stream.on('data', chunk => {
all += chunk;
assert.equal(typeof chunk, 'string');
});
stream.on('end', () => {
resolve(all);
});
stream.on('error', reject);
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
ArrowFunction |
chunk => {
all += chunk;
assert.equal(typeof chunk, 'string');
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
ArrowFunction |
() => {
resolve(all);
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
MethodDeclaration |
read(size) {
this.push(Buffer.from([65, 66, 67]));
this.push(Buffer.from([65, 66, 67]));
this.push(Buffer.from([65, 66, 67]));
this.push(null);
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
MethodDeclaration |
read(size) {
this.push(null); // empty
} | MarcelRaschke/azuredatastudio | src/vs/base/test/node/encoding/encoding.test.ts | TypeScript |
FunctionDeclaration |
export function NodeTypes(): NodeTypesClass {
if (nodeTypesInstance === undefined) {
nodeTypesInstance = new NodeTypesClass();
nodeTypesInstance.init({});
}
return nodeTypesInstance;
} | BeeMyDesk/n8n | packages/core/test/Helpers.ts | TypeScript |
FunctionDeclaration |
export function WorkflowExecuteAdditionalData(waitPromise: IDeferredPromise<IRun>, nodeExecutionOrder: string[]): IWorkflowExecuteAdditionalData {
const hookFunctions = {
nodeExecuteAfter: [
async (nodeName: string, data: ITaskData): Promise<void> => {
nodeExecutionOrder.push(nodeName);
},
],
workflowExecuteAfter: [
async (fullRunData: IRun): Promise<void> => {
waitPromise.resolve(fullRunData);
},
],
};
const workflowData: IWorkflowBase = {
name: '',
createdAt: new Date(),
updatedAt: new Date(),
active: true,
nodes: [],
connections: {},
};
return {
credentials: {},
credentialsHelper: new CredentialsHelper({}, ''),
hooks: new WorkflowHooks(hookFunctions, 'trigger', '1', workflowData),
executeWorkflow: async (workflowInfo: IExecuteWorkflowInfo): Promise<any> => {}, // tslint:disable-line:no-any
restApiUrl: '',
encryptionKey: 'test',
timezone: 'America/New_York',
webhookBaseUrl: 'webhook',
webhookTestBaseUrl: 'webhook-test',
};
} | BeeMyDesk/n8n | packages/core/test/Helpers.ts | TypeScript |
ArrowFunction |
(setItem) => {
set(newItem.json, setItem.name as string, setItem.value);
} | BeeMyDesk/n8n | packages/core/test/Helpers.ts | TypeScript |
ArrowFunction |
(data) => data.type | BeeMyDesk/n8n | packages/core/test/Helpers.ts | TypeScript |
ArrowFunction |
async (nodeName: string, data: ITaskData): Promise<void> => {
nodeExecutionOrder.push(nodeName);
} | BeeMyDesk/n8n | packages/core/test/Helpers.ts | TypeScript |
ArrowFunction |
async (fullRunData: IRun): Promise<void> => {
waitPromise.resolve(fullRunData);
} | BeeMyDesk/n8n | packages/core/test/Helpers.ts | TypeScript |
ArrowFunction |
async (workflowInfo: IExecuteWorkflowInfo): Promise<any> => {} | BeeMyDesk/n8n | packages/core/test/Helpers.ts | TypeScript |
ClassDeclaration |
export class CredentialsHelper extends ICredentialsHelper {
getDecrypted(name: string, type: string): ICredentialDataDecryptedObject {
return {};
}
getCredentials(name: string, type: string): Credentials {
return new Credentials('', '', [], '');
}
async updateCredentials(name: string, type: string, data: ICredentialDataDecryptedObject): Promise<void> {}
} | BeeMyDesk/n8n | packages/core/test/Helpers.ts | TypeScript |
ClassDeclaration |
class NodeTypesClass implements INodeTypes {
nodeTypes: INodeTypeData = {
'n8n-nodes-base.merge': {
sourcePath: '',
type: {
description: {
displayName: 'Merge',
name: 'merge',
icon: 'fa:clone',
group: ['transform'],
version: 1,
description: 'Merges data of multiple streams once data of both is available',
defaults: {
name: 'Merge',
color: '#00cc22',
},
inputs: ['main', 'main'],
outputs: ['main'],
properties: [
{
displayName: 'Mode',
name: 'mode',
type: 'options',
options: [
{
name: 'Append',
value: 'append',
description: 'Combines data of both inputs. The output will contain items of input 1 and input 2.',
},
{
name: 'Pass-through',
value: 'passThrough',
description: 'Passes through data of one input. The output will conain only items of the defined input.',
},
{
name: 'Wait',
value: 'wait',
description: 'Waits till data of both inputs is available and will then output a single empty item.',
},
],
default: 'append',
description: 'How data should be merged. If it should simply<br />be appended or merged depending on a property.',
},
{
displayName: 'Output Data',
name: 'output',
type: 'options',
displayOptions: {
show: {
mode: [
'passThrough'
],
},
},
options: [
{
name: 'Input 1',
value: 'input1',
},
{
name: 'Input 2',
value: 'input2',
},
],
default: 'input1',
description: 'Defines of which input the data should be used as output of node.',
},
]
},
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
// const itemsInput2 = this.getInputData(1);
const returnData: INodeExecutionData[] = [];
const mode = this.getNodeParameter('mode', 0) as string;
if (mode === 'append') {
// Simply appends the data
for (let i = 0; i < 2; i++) {
returnData.push.apply(returnData, this.getInputData(i));
}
} else if (mode === 'passThrough') {
const output = this.getNodeParameter('output', 0) as string;
if (output === 'input1') {
returnData.push.apply(returnData, this.getInputData(0));
} else {
returnData.push.apply(returnData, this.getInputData(1));
}
} else if (mode === 'wait') {
returnData.push({ json: {} });
}
return [returnData];
}
},
},
'n8n-nodes-base.set': {
sourcePath: '',
type: {
description: {
displayName: 'Set',
name: 'set',
group: ['input'],
version: 1,
description: 'Sets a value',
defaults: {
name: 'Set',
color: '#0000FF',
},
inputs: ['main'],
outputs: ['main'],
properties: [
{
displayName: 'Keep Only Set',
name: 'keepOnlySet',
type: 'boolean',
default: false,
description: 'If only the values set on this node should be<br />kept and all others removed.',
},
{
displayName: 'Values to Set',
name: 'values',
placeholder: 'Add Value',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
description: 'The value to set.',
default: {},
options: [
{
name: 'number',
displayName: 'Number',
values: [
{
displayName: 'Name',
name: 'name',
type: 'string',
default: 'propertyName',
description: 'Name of the property to write data to.<br />Supports dot-notation.<br />Example: "data.person[0].name"',
},
{
displayName: 'Value',
name: 'value',
type: 'number',
default: 0,
description: 'The number value to write in the property.',
},
]
},
],
},
]
},
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
const returnData: INodeExecutionData[] = [];
let item: INodeExecutionData;
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
item = items[itemIndex];
const newItem: INodeExecutionData = {
json: JSON.parse(JSON.stringify(item.json)),
};
// Add number values
(this.getNodeParameter('values.number', itemIndex, []) as INodeParameters[]).forEach((setItem) => {
set(newItem.json, setItem.name as string, setItem.value);
});
returnData.push(newItem);
}
return this.prepareOutputData(returnData);
}
},
},
'n8n-nodes-base.start': {
sourcePath: '',
type: {
description: {
displayName: 'Start',
name: 'start',
group: ['input'],
version: 1,
description: 'Starts the workflow execution from this node',
defaults: {
name: 'Start',
color: '#553399',
},
inputs: [],
outputs: ['main'],
properties: []
},
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
return this.prepareOutputData(items);
},
},
},
};
async init(nodeTypes: INodeTypeData): Promise<void> { }
getAll(): INodeType[] {
return Object.values(this.nodeTypes).map((data) => data.type);
}
getByName(nodeType: string): INodeType {
return this.nodeTypes[nodeType].type;
}
} | BeeMyDesk/n8n | packages/core/test/Helpers.ts | TypeScript |
MethodDeclaration |
getDecrypted(name: string, type: string): ICredentialDataDecryptedObject {
return {};
} | BeeMyDesk/n8n | packages/core/test/Helpers.ts | TypeScript |
MethodDeclaration |
getCredentials(name: string, type: string): Credentials {
return new Credentials('', '', [], '');
} | BeeMyDesk/n8n | packages/core/test/Helpers.ts | TypeScript |
MethodDeclaration |
async updateCredentials(name: string, type: string, data: ICredentialDataDecryptedObject): Promise<void> {} | BeeMyDesk/n8n | packages/core/test/Helpers.ts | TypeScript |
MethodDeclaration |
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
// const itemsInput2 = this.getInputData(1);
const returnData: INodeExecutionData[] = [];
const mode = this.getNodeParameter('mode', 0) as string;
if (mode === 'append') {
// Simply appends the data
for (let i = 0; i < 2; i++) {
returnData.push.apply(returnData, this.getInputData(i));
}
} else if (mode === 'passThrough') {
const output = this.getNodeParameter('output', 0) as string;
if (output === 'input1') {
returnData.push.apply(returnData, this.getInputData(0));
} else {
returnData.push.apply(returnData, this.getInputData(1));
}
} else if (mode === 'wait') {
returnData.push({ json: {} });
}
return [returnData];
} | BeeMyDesk/n8n | packages/core/test/Helpers.ts | TypeScript |
MethodDeclaration |
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
const returnData: INodeExecutionData[] = [];
let item: INodeExecutionData;
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
item = items[itemIndex];
const newItem: INodeExecutionData = {
json: JSON.parse(JSON.stringify(item.json)),
};
// Add number values
(this.getNodeParameter('values.number', itemIndex, []) as INodeParameters[]).forEach((setItem) => {
set(newItem.json, setItem.name as string, setItem.value);
});
returnData.push(newItem);
}
return this.prepareOutputData(returnData);
} | BeeMyDesk/n8n | packages/core/test/Helpers.ts | TypeScript |
MethodDeclaration |
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
return this.prepareOutputData(items);
} | BeeMyDesk/n8n | packages/core/test/Helpers.ts | TypeScript |
MethodDeclaration |
async init(nodeTypes: INodeTypeData): Promise<void> { } | BeeMyDesk/n8n | packages/core/test/Helpers.ts | TypeScript |
MethodDeclaration |
getAll(): INodeType[] {
return Object.values(this.nodeTypes).map((data) => data.type);
} | BeeMyDesk/n8n | packages/core/test/Helpers.ts | TypeScript |
MethodDeclaration |
getByName(nodeType: string): INodeType {
return this.nodeTypes[nodeType].type;
} | BeeMyDesk/n8n | packages/core/test/Helpers.ts | TypeScript |
ArrowFunction |
data =>{
console.log("se guardo");
} | crissl/GestonPagosArriendo_Front | .history/src/app/pages/docentes/planificacion-acompanamiento/planificacion-acompanamiento.component_20200404142353.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-planificacion-acompanamiento',
templateUrl: './planificacion-acompanamiento.component.html',
styleUrls: ['./planificacion-acompanamiento.component.scss']
})
export class PlanificacionAcompanamientoComponent implements OnInit {
titleDocente= TutoriaConstants.DATOSDOCENTE;
titleTutoria= TutoriaConstants.DATOSTUTORIA;
titleRegistro= TutoriaConstants.DATOSREGISTRO;
aula: boolean = true
constructor(private service: PersonalDataService, private restService: RestService, public toast: ToastrService) { }
datosGuardar : any;
ncr:any;
datos: boolean;
codigos: Campus;
cedula="1725412306";
ngOnInit() {
this.codigos = new Campus();
this.listarCamp();
}
id:any
procesaPropagar(data){
this.id=data[0].pidm
//console.log(data[0].pidm)
}
tema:any={
tema:""
}
codigo: any;
campus: any;
guardarC(codigo: number, campus) {
this.codigo = codigo;
this.campus = campus;
}
public observaciones: any = {
observacion:"",
fecha: Date.now(),
}
guardar(){
this.datosGuardar = {
codigoFormularios : "5",
interacion: "0",
fechaFormulario: formattedDate,
tipoPersona: "ESTUDIANTE",
tipoTutoria: "PLANIFICACION ACOMPANAMIENTO",
spridenPidm: this.id ,
tema:this.tema.tema,
observacion: this.observaciones.observacion,
estado:"A"
}
this.guardarTutorias();
}
guardarTutorias(){
this.restService.addData(this.datosGuardar,"segu").subscribe(
data =>{
console.log("se guardo");
}
)
}
// listarCamp(){
// this.restService.findDataById("campus").subscribe(
// data => {
// this.codigos = data
// console.log("se listo");
// }
// )
// }
// listarCamp(){
// // this.showAlerts();
// this.restService.get('/campus').subscribe(
// data => {
// this.codigos = data;
// console.log("se listo " + this.codigos);
// console.log("se listoid " + this.codigos.campus);
// console.log("se listoid " + this.codigos.codigo);
// });
// }
expressType: string;
typeExpress: string[] = [ 'AULA', 'LUGAR'];
radioOptions: FormGroup;
} | crissl/GestonPagosArriendo_Front | .history/src/app/pages/docentes/planificacion-acompanamiento/planificacion-acompanamiento.component_20200404142353.ts | TypeScript |
MethodDeclaration |
ngOnInit() {
this.codigos = new Campus();
this.listarCamp();
} | crissl/GestonPagosArriendo_Front | .history/src/app/pages/docentes/planificacion-acompanamiento/planificacion-acompanamiento.component_20200404142353.ts | TypeScript |
MethodDeclaration |
procesaPropagar(data){
this.id=data[0].pidm
//console.log(data[0].pidm)
} | crissl/GestonPagosArriendo_Front | .history/src/app/pages/docentes/planificacion-acompanamiento/planificacion-acompanamiento.component_20200404142353.ts | TypeScript |
MethodDeclaration |
guardarC(codigo: number, campus) {
this.codigo = codigo;
this.campus = campus;
} | crissl/GestonPagosArriendo_Front | .history/src/app/pages/docentes/planificacion-acompanamiento/planificacion-acompanamiento.component_20200404142353.ts | TypeScript |
MethodDeclaration |
guardar(){
this.datosGuardar = {
codigoFormularios : "5",
interacion: "0",
fechaFormulario: formattedDate,
tipoPersona: "ESTUDIANTE",
tipoTutoria: "PLANIFICACION ACOMPANAMIENTO",
spridenPidm: this.id ,
tema:this.tema.tema,
observacion: this.observaciones.observacion,
estado:"A"
}
this.guardarTutorias();
} | crissl/GestonPagosArriendo_Front | .history/src/app/pages/docentes/planificacion-acompanamiento/planificacion-acompanamiento.component_20200404142353.ts | TypeScript |
MethodDeclaration |
guardarTutorias(){
this.restService.addData(this.datosGuardar,"segu").subscribe(
data =>{
console.log("se guardo");
}
)
} | crissl/GestonPagosArriendo_Front | .history/src/app/pages/docentes/planificacion-acompanamiento/planificacion-acompanamiento.component_20200404142353.ts | TypeScript |
ArrowFunction |
() => {
return (
<>
<h1>Sign Up Complete</h1>
<p>Thanks for signing up. Your details have successfully been recorded.</p>
</> | AdamSlack/NextJSPlayground | app/pages/user/signUpCompleted.tsx | TypeScript |
FunctionDeclaration |
function checkSelection({
store,
getCheckboxPropsByItem,
getRecordKey,
data,
type,
byDefaultChecked,
}) {
return byDefaultChecked
? data[type]((item, i) => getCheckboxPropsByItem(item, i).defaultChecked)
: data[type]((item, i) => store.getState().selectedRowKeys.indexOf(getRecordKey(item, i)) >= 0);
} | w2ichan/ant-design-vue | components/table/SelectionCheckboxAll.tsx | TypeScript |
FunctionDeclaration |
function getIndeterminateState(props) {
const { store, data } = props;
if (!data.length) {
return false;
}
const someCheckedNotByDefaultChecked =
checkSelection({
...props,
data,
type: 'some',
byDefaultChecked: false,
}) &&
!checkSelection({
...props,
data,
type: 'every',
byDefaultChecked: false,
});
const someCheckedByDefaultChecked =
checkSelection({
...props,
data,
type: 'some',
byDefaultChecked: true,
}) &&
!checkSelection({
...props,
data,
type: 'every',
byDefaultChecked: true,
});
if (store.getState().selectionDirty) {
return someCheckedNotByDefaultChecked;
}
return someCheckedNotByDefaultChecked || someCheckedByDefaultChecked;
} | w2ichan/ant-design-vue | components/table/SelectionCheckboxAll.tsx | TypeScript |
FunctionDeclaration |
function getCheckState(props) {
const { store, data } = props;
if (!data.length) {
return false;
}
if (store.getState().selectionDirty) {
return checkSelection({
...props,
data,
type: 'every',
byDefaultChecked: false,
});
}
return (
checkSelection({
...props,
data,
type: 'every',
byDefaultChecked: false,
}) ||
checkSelection({
...props,
data,
type: 'every',
byDefaultChecked: true,
})
);
} | w2ichan/ant-design-vue | components/table/SelectionCheckboxAll.tsx | TypeScript |
ArrowFunction |
(item, i) => getCheckboxPropsByItem(item, i).defaultChecked | w2ichan/ant-design-vue | components/table/SelectionCheckboxAll.tsx | TypeScript |
ArrowFunction |
(item, i) => store.getState().selectedRowKeys.indexOf(getRecordKey(item, i)) >= 0 | w2ichan/ant-design-vue | components/table/SelectionCheckboxAll.tsx | TypeScript |
ArrowFunction |
prevState => {
const newState: any = {};
if (indeterminate !== prevState.indeterminate) {
newState.indeterminate = indeterminate;
}
if (checked !== prevState.checked) {
newState.checked = checked;
}
return newState;
} | w2ichan/ant-design-vue | components/table/SelectionCheckboxAll.tsx | TypeScript |
ArrowFunction |
() => {
this.setCheckState(this.$props);
} | w2ichan/ant-design-vue | components/table/SelectionCheckboxAll.tsx | TypeScript |
ArrowFunction |
(selection, index) => {
return (
<Menu.Item key={selection.key || index}>
<div
onClick={() => {
this.$emit('select', selection.key, index, selection.onSelect);
}}
>
{selection.text}
</div>
</Menu.Item> | w2ichan/ant-design-vue | components/table/SelectionCheckboxAll.tsx | TypeScript |
ArrowFunction |
() => {
this.$emit('select', selection.key, index, selection.onSelect);
} | w2ichan/ant-design-vue | components/table/SelectionCheckboxAll.tsx | TypeScript |
MethodDeclaration |
data() {
const { $props: props } = this;
return {
checked: getCheckState(props),
indeterminate: getIndeterminateState(props),
};
} | w2ichan/ant-design-vue | components/table/SelectionCheckboxAll.tsx | TypeScript |
MethodDeclaration |
setup() {
return {
defaultSelections: [],
unsubscribe: null,
};
} | w2ichan/ant-design-vue | components/table/SelectionCheckboxAll.tsx | TypeScript |
MethodDeclaration |
created() {
const { $props: props } = this;
this.defaultSelections = props.hideDefaultSelections
? []
: [
{
key: 'all',
text: props.locale.selectAll,
},
{
key: 'invert',
text: props.locale.selectInvert,
},
];
} | w2ichan/ant-design-vue | components/table/SelectionCheckboxAll.tsx | TypeScript |
MethodDeclaration |
handler() {
this.setCheckState(this.$props);
} | w2ichan/ant-design-vue | components/table/SelectionCheckboxAll.tsx | TypeScript |
MethodDeclaration |
mounted() {
this.subscribe();
} | w2ichan/ant-design-vue | components/table/SelectionCheckboxAll.tsx | TypeScript |
MethodDeclaration |
beforeUnmount() {
if (this.unsubscribe) {
this.unsubscribe();
}
} | w2ichan/ant-design-vue | components/table/SelectionCheckboxAll.tsx | TypeScript |
MethodDeclaration |
checkSelection(props, data, type, byDefaultChecked) {
const { store, getCheckboxPropsByItem, getRecordKey } = props || this.$props;
// type should be 'every' | 'some'
if (type === 'every' || type === 'some') {
return byDefaultChecked
? data[type]((item, i) => getCheckboxPropsByItem(item, i).defaultChecked)
: data[type](
(item, i) => store.getState().selectedRowKeys.indexOf(getRecordKey(item, i)) >= 0,
);
}
return false;
} | w2ichan/ant-design-vue | components/table/SelectionCheckboxAll.tsx | TypeScript |
MethodDeclaration |
setCheckState(props) {
const checked = getCheckState(props);
const indeterminate = getIndeterminateState(props);
this.setState(prevState => {
const newState: any = {};
if (indeterminate !== prevState.indeterminate) {
newState.indeterminate = indeterminate;
}
if (checked !== prevState.checked) {
newState.checked = checked;
}
return newState;
});
} | w2ichan/ant-design-vue | components/table/SelectionCheckboxAll.tsx | TypeScript |
MethodDeclaration |
handleSelectAllChange(e) {
const { checked } = e.target;
this.$emit('select', checked ? 'all' : 'removeAll', 0, null);
} | w2ichan/ant-design-vue | components/table/SelectionCheckboxAll.tsx | TypeScript |
MethodDeclaration |
subscribe() {
const { store } = this;
this.unsubscribe = store.subscribe(() => {
this.setCheckState(this.$props);
});
} | w2ichan/ant-design-vue | components/table/SelectionCheckboxAll.tsx | TypeScript |
MethodDeclaration |
renderMenus(selections) {
return selections.map((selection, index) => {
return (
<Menu.Item key={selection.key || index}>
<div
onClick={() => {
this.$emit('select', selection.key, index, selection.onSelect);
}}
>
{selection.text}
</div>
</Menu.Item>
);
} | w2ichan/ant-design-vue | components/table/SelectionCheckboxAll.tsx | TypeScript |
ArrowFunction |
(toolbox: GluegunToolbox) => {
toolbox.foo = () => {
toolbox.print.info('called foo extension')
}
// enable this if you want to read configuration in from
// the current folder's package.json (in a "carlotz-dev-cli" property),
// carlotz-dev-cli.config.json, etc.
// toolbox.config = {
// ...toolbox.config,
// ...toolbox.config.loadConfig("carlotz-dev-cli", process.cwd())
// }
} | Coffeegerm/carlotz-dev-cli | src/extensions/cli-extension.ts | TypeScript |
ArrowFunction |
() => {
toolbox.print.info('called foo extension')
} | Coffeegerm/carlotz-dev-cli | src/extensions/cli-extension.ts | TypeScript |
FunctionDeclaration |
function dismissDialog() {
setModalOpen(false);
} | 14squared/BotFramework-Composer | Composer/packages/client/src/components/TestController/TestController.tsx | TypeScript |
FunctionDeclaration |
function openDialog() {
setModalOpen(true);
} | 14squared/BotFramework-Composer | Composer/packages/client/src/components/TestController/TestController.tsx | TypeScript |
FunctionDeclaration |
function dismissCallout() {
if (calloutVisible) setCalloutVisible(false);
} | 14squared/BotFramework-Composer | Composer/packages/client/src/components/TestController/TestController.tsx | TypeScript |
FunctionDeclaration |
function openCallout() {
setCalloutVisible(true);
} | 14squared/BotFramework-Composer | Composer/packages/client/src/components/TestController/TestController.tsx | TypeScript |
FunctionDeclaration |
function startPollingRuntime() {
if (!botStatusInterval) {
const cancelInterval = setInterval(() => {
// get publish status
getPublishStatus(projectId, defaultPublishConfig);
}, POLLING_INTERVAL);
botStatusInterval = cancelInterval;
}
} | 14squared/BotFramework-Composer | Composer/packages/client/src/components/TestController/TestController.tsx | TypeScript |
A dataset of TypeScript snippets, processed from the typescript subset of the-stack-smol.
FunctionDeclaration ---- 8205
ArrowFunction --------- 33890
ClassDeclaration ------- 5325
InterfaceDeclaration -- 12884
EnumDeclaration --------- 518
TypeAliasDeclaration --- 3580
MethodDeclaration ----- 24713
content
gpt-3.5-turbo
(in progress)from datasets import load_dataset
load_dataset("bleugreen/typescript-chunks")
DatasetDict({
train: Dataset({
features: ['type', 'content', 'repo', 'path', 'language'],
num_rows: 89115
})
})