type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
MethodDeclaration |
openDialog(photo: PhotoData) {
const dialogConfig = new MatDialogConfig();
dialogConfig.autoFocus = true;
dialogConfig.data = {
id: photo.photoId,
url: photo.url
};
this.dialog.open(ImageDialogComponent, dialogConfig);
} | sublimeOne/projects | src/app/photos/photos.component.ts | TypeScript |
FunctionDeclaration |
export function fixtureFactory<T>(defaults: T): (params?: Partial<T>) => T {
return (params = {}) => merge({}, defaults, params)
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
it('should throw error on not JSON ABI', () => {
const inputJson = `abc`
expect(() => extractAbi(inputJson)).toThrow(MalformedAbiError, 'Not a json')
})
it('should throw error on malformed ABI', () => {
const inputJson = `{ "someProps": "abc" }`
expect(() => extractAbi(inputJson)).toThro... | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
const inputJson = `abc`
expect(() => extractAbi(inputJson)).toThrow(MalformedAbiError, 'Not a json')
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => extractAbi(inputJson) | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
const inputJson = `{ "someProps": "abc" }`
expect(() => extractAbi(inputJson)).toThrow(MalformedAbiError, 'Not a valid ABI')
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
const inputJson = `[
{
"name": "piece",
"constant": false,
"payable": false,
"inputs": [],
"outputs": [],
"type": "function"
}
]
`
expect(extractAbi(inputJson)).toEqual([
{
name: 'piece',
constant: false,
... | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
const inputJson = `{ "abi": [
{
"name": "piece",
"constant": false,
"payable": false,
"inputs": [],
"outputs": [],
"type": "function"
}
]
}`
expect(extractAbi(inputJson)).toEqual([
{
name: 'piece',
constant: fals... | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
const inputJson = `{ "compilerOutput": { "abi": [
{
"name": "piece",
"constant": false,
"payable": false,
"inputs": [],
"outputs": [],
"type": "function"
}
]
} }`
expect(extractAbi(inputJson)).toEqual([
{
name: 'piece',
... | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
const sampleBytecode = '1234abcd'
const resultBytecode = { bytecode: ensure0xPrefix(sampleBytecode) }
it('should return bytecode for bare bytecode string', () => {
expect(extractBytecode(sampleBytecode)).toEqual(resultBytecode)
})
it('should return bytecode for bare bytecode with 0x prefix', ()... | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
expect(extractBytecode(sampleBytecode)).toEqual(resultBytecode)
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
expect(extractBytecode(resultBytecode.bytecode)).toEqual(resultBytecode)
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
expect(extractBytecode('surely-not-bytecode')).toEqual(undefined)
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
expect(extractBytecode(`[{ "name": "piece" }]`)).toEqual(undefined)
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
expect(extractBytecode(`{ "abi": [{ "name": "piece" }] }`)).toEqual(undefined)
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
expect(extractBytecode(`{ "bytecode": "${sampleBytecode}" }`)).toEqual(resultBytecode)
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
const inputJson = `{ "evm": { "bytecode": { "object": "${sampleBytecode}" }}}`
expect(extractBytecode(inputJson)).toEqual(resultBytecode)
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
expect(
extractBytecode(`{ "compilerOutput": { "evm": { "bytecode": { "object": "${sampleBytecode}" } } } }`),
).toEqual(resultBytecode)
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
expect(extractBytecode(`{ "bytecode": "surely-not-bytecode" }`)).toEqual(undefined)
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
const devUserDoc = `{
"devdoc": {
"author" : "Larry A. Gardner",
"details" : "All function calls are currently implemented without side effects",
"methods" :
{
"age(uint256)" :
{
"author" : "Mary A. Botanist",
"details" : "The Alexandr N. Tetear... | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
const doc = extractDocumentation(devUserDoc)
expect(doc).toEqual({
author: 'Larry A. Gardner',
details: 'All function calls are currently implemented without side effects',
methods: {
'age(uint256)': {
author: 'Mary A. Botanist',
details: 'The Alexandr N. ... | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
const doc = extractDocumentation(userDoc)
expect(doc).toEqual({
methods: { 'age(uint256)': { notice: 'Calculate tree age in years, rounded up, for live trees' } },
notice: 'You can use this contract for only the most basic simulation',
})
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
const linkRef1: BytecodeLinkReference = { reference: '__./ContractWithLibrary.sol:TestLibrar__' }
const bytecodeStr1 = `565b005b60005481565b73${linkRef1.reference}63b7203ec673${linkRef1.reference}63b7203ec6846040518263ffffffff167c010000`
const linkRef2: BytecodeLinkReference = { reference: '__TestLibrary... | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
expect(extractBytecode(bytecodeStr1)).toEqual({
bytecode: `0x${bytecodeStr1}`,
linkReferences: [linkRef1],
})
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
expect(extractBytecode(JSON.stringify(bytecodeObj2))).toEqual({
bytecode: bytecodeObj2.bytecode,
linkReferences: [linkRef2],
})
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
expect(extractBytecode(JSON.stringify(bytecodeObj3))).toEqual({
bytecode: bytecodeObj3.evm.bytecode.object,
linkReferences: [linkRef3],
})
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
expect(extractBytecode(JSON.stringify(bytecodeObj4))).toEqual({
bytecode: bytecodeObj4.evm.bytecode.object,
linkReferences: [linkRef4],
})
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
expect(extractBytecode(JSON.stringify(bytecodeObj5))).toEqual({
bytecode: bytecodeObj5.compilerOutput.evm.bytecode.object,
linkReferences: [linkRef4],
})
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
const bytecodeObj4a = {
...bytecodeObj4,
bytecode: bytecodeObj4.evm.bytecode.object,
}
expect(extractBytecode(JSON.stringify(bytecodeObj4a))).toEqual({
bytecode: bytecodeObj4.evm.bytecode.object,
linkReferences: [linkRef4],
})
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
expect(extractBytecode(JSON.stringify(bytecodeObj6))).toEqual({
bytecode: bytecodeObj4.evm.bytecode.object,
linkReferences: [linkRef4],
})
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
it("should prepend 0x when it's missing", () => {
expect(ensure0xPrefix('1234')).toEqual('0x1234')
})
it('should return string unchanged when it has 0x prefix', () => {
expect(ensure0xPrefix('0x1234')).toEqual('0x1234')
})
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
expect(ensure0xPrefix('1234')).toEqual('0x1234')
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
expect(ensure0xPrefix('0x1234')).toEqual('0x1234')
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
it('works', () => {
const expectedEvent: RawEventAbiDefinition = {
anonymous: false,
inputs: [
{ indexed: true, name: '_from', type: 'address' },
{ indexed: false, name: '_value', type: 'uint256' },
],
name: 'Deposit',
type: 'event',
}
const parsedEve... | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
const expectedEvent: RawEventAbiDefinition = {
anonymous: false,
inputs: [
{ indexed: true, name: '_from', type: 'address' },
{ indexed: false, name: '_value', type: 'uint256' },
],
name: 'Deposit',
type: 'event',
}
const parsedEvent = parseEvent(expect... | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
describe('functions', () => {
const abiPiece = {
constant: false,
inputs: [
{
name: 'foo',
type: 'uint256',
},
{
name: 'bar',
type: 'bytes32',
},
],
name: 'doFooBar',
outputs: [],
payable: false,
... | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
const abiPiece = {
constant: false,
inputs: [
{
name: 'foo',
type: 'uint256',
},
{
name: 'bar',
type: 'bytes32',
},
],
name: 'doFooBar',
outputs: [],
payable: false,
type: 'function',
}
... | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
const res = parse([abiPiece], 'ACoolContract', documentation)
expect(res.functions.doFooBar[0].documentation).toEqual(documentation.methods['doFooBar(uint256,bytes32)'])
expect(res.documentation!.details).toEqual(documentation.details)
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
it('should work on output-less fallback functions', () => {
const fallbackAbiFunc: RawAbiDefinition = {
payable: true,
stateMutability: 'payable',
type: 'fallback',
} as any
expect(() => parse([fallbackAbiFunc], 'fallback')).not.toThrow()
})
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
const fallbackAbiFunc: RawAbiDefinition = {
payable: true,
stateMutability: 'payable',
type: 'fallback',
} as any
expect(() => parse([fallbackAbiFunc], 'fallback')).not.toThrow()
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => parse([fallbackAbiFunc], 'fallback') | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
it('should work on output-less fallback functions', () => {
const event: RawAbiDefinition = {
anonymous: false,
inputs: [
{
indexed: false,
internalType: 'bytes32',
name: '',
type: 'bytes32',
},
],
nam... | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
const event: RawAbiDefinition = {
anonymous: false,
inputs: [
{
indexed: false,
internalType: 'bytes32',
name: '',
type: 'bytes32',
},
],
name: 'log_bytes32',
type: 'event',
} as any
e... | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
(params = {}) => merge({}, defaults, params) | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
const fnFactory = fixtureFactory<FunctionDeclaration>({
name: 'constant',
inputs: [],
outputs: [{ type: { type: 'string', originalType: 'string' }, name: 'output' }],
stateMutability: 'view',
})
const viewFn = fnFactory()
const pureFn = fnFactory({ stateMutability: 'pure' })
const pa... | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
it('works', () => {
expect(isConstant(viewFn)).toEqual(true)
expect(isConstant(pureFn)).toEqual(true)
expect(isConstant(payableFn)).toEqual(false)
expect(isConstant(nonPayableFn)).toEqual(false)
expect(isConstant(viewWithInputs)).toEqual(false)
})
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
expect(isConstant(viewFn)).toEqual(true)
expect(isConstant(pureFn)).toEqual(true)
expect(isConstant(payableFn)).toEqual(false)
expect(isConstant(nonPayableFn)).toEqual(false)
expect(isConstant(viewWithInputs)).toEqual(false)
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
it('works', () => {
expect(isConstantFn(viewFn)).toEqual(false)
expect(isConstantFn(pureFn)).toEqual(false)
expect(isConstantFn(payableFn)).toEqual(false)
expect(isConstantFn(nonPayableFn)).toEqual(false)
expect(isConstantFn(viewWithInputs)).toEqual(true)
})
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
expect(isConstantFn(viewFn)).toEqual(false)
expect(isConstantFn(pureFn)).toEqual(false)
expect(isConstantFn(payableFn)).toEqual(false)
expect(isConstantFn(nonPayableFn)).toEqual(false)
expect(isConstantFn(viewWithInputs)).toEqual(true)
} | ItsNickBarry/TypeChain | packages/typechain/test/parser/abiParser.test.ts | TypeScript |
ArrowFunction |
() => {
it('create an instance', () => {
const pipe = new MinmaxPipe();
expect(pipe).toBeTruthy();
});
} | taylordeckard/trading-sim | src/app/charts/minmax.pipe.spec.ts | TypeScript |
ArrowFunction |
() => {
const pipe = new MinmaxPipe();
expect(pipe).toBeTruthy();
} | taylordeckard/trading-sim | src/app/charts/minmax.pipe.spec.ts | TypeScript |
ArrowFunction |
() => this.server.register({
plugin: {
name: options.path,
register: async (server, registerOpts) => {
server.route({
method: 'GET',
path: options.path,
handler: async (request, h) => {
let result;
for (co... | charlex/cloud-trace-nodejs | test/web-frameworks/hapi17.ts | TypeScript |
ArrowFunction |
async (server, registerOpts) => {
server.route({
method: 'GET',
path: options.path,
handler: async (request, h) => {
let result;
for (const handler of this.routes.get(options.path)!) {
result = await handler(request... | charlex/cloud-trace-nodejs | test/web-frameworks/hapi17.ts | TypeScript |
ArrowFunction |
async (request, h) => {
let result;
for (const handler of this.routes.get(options.path)!) {
result = await handler(request.raw.req.headers);
if (result) {
return result;
}
}
return ... | charlex/cloud-trace-nodejs | test/web-frameworks/hapi17.ts | TypeScript |
ClassDeclaration |
export class Hapi17 implements WebFramework {
static commonName = `hapi@17`;
static expectedTopStackFrame = '_executeWrap';
static versionRange = '>=7.5';
private server: hapi_17.Server;
// We can't add two routes on the same path.
// So instead of registering a new Hapi plugin per path,
// register onl... | charlex/cloud-trace-nodejs | test/web-frameworks/hapi17.ts | TypeScript |
MethodDeclaration |
addHandler(options: WebFrameworkAddHandlerOptions): void {
let shouldRegister = false;
if (!this.routes.has(options.path)) {
this.routes.set(options.path, [options.fn]);
shouldRegister = true;
} else {
this.routes.get(options.path)!.push(options.fn);
}
// Only register a new plug... | charlex/cloud-trace-nodejs | test/web-frameworks/hapi17.ts | TypeScript |
MethodDeclaration |
async listen(port: number): Promise<number> {
await this.registering;
this.server.settings.port = port;
await this.server.start();
return Number(this.server.info!.port);
} | charlex/cloud-trace-nodejs | test/web-frameworks/hapi17.ts | TypeScript |
MethodDeclaration |
shutdown(): void {
this.server.stop();
} | charlex/cloud-trace-nodejs | test/web-frameworks/hapi17.ts | TypeScript |
ArrowFunction |
e => undefined | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
() => this.onSettingsChanged() | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
e => {
if (e.affectsConfiguration('python.dataScience', undefined)) {
// When config changes happen, recreate our commands.
this.dispose();
}
} | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
() => this.isCommandSupported(NotebookCommand, cancelToken) | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
() => this.getUsableJupyterPythonImpl(cancelToken) | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async (cancelToken?: CancellationToken): Promise<boolean> => {
// See if we can find the command nbconvert
return Cancellation.race(() => this.isCommandSupported(ConvertCommand), cancelToken);
} | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
() => this.isCommandSupported(ConvertCommand) | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async (cancelToken?: CancellationToken): Promise<boolean> => {
// See if we can find the command ipykernel
return Cancellation.race(() => this.isCommandSupported(KernelCreateCommand), cancelToken);
} | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
() => this.isCommandSupported(KernelCreateCommand) | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async (cancelToken?: CancellationToken): Promise<boolean> => {
// See if we can find the command kernelspec
return Cancellation.race(() => this.isCommandSupported(KernelSpecCommand), cancelToken);
} | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
() => this.isCommandSupported(KernelSpecCommand) | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async () => {
let connection: IConnection;
let kernelSpec: IJupyterKernelSpec | undefined;
// If our uri is undefined or if it's set to local launch we need to launch a server locally
if (!uri) {
const launchResults = await this.startNotebookServer... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async (file: string): Promise<void> => {
// First we find a way to start a notebook server
const notebookCommand = await this.findBestCommand('notebook');
if (!notebookCommand) {
throw new Error(localize.DataScience.jupyterNotSupported());
}
const args: strin... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async (file: string, template: string): Promise<string> => {
// First we find a way to start a nbconvert
const convert = await this.findBestCommand(ConvertCommand);
if (!convert) {
throw new Error(localize.DataScience.jupyterNbConvertNotSupported());
}
// Wai... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
() => this.sessionManager.getActiveKernelSpecs(connection) | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
() => this.enumerateSpecs(cancelToken) | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
(uri: string): IConnection => {
let url: URL;
try {
url = new URL(uri);
} catch (err) {
// This should already have been parsed when set, so just throw if it's not right here
throw err;
}
return {
baseUrl: `${url.protoco... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
() => {
launchResult.dispose();
} | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async (cancelToken?: CancellationToken): Promise<PythonInterpreter | undefined> => {
// This should be the best interpreter for notebooks
const found = await this.findBestCommand(NotebookCommand, cancelToken);
if (found) {
return found.interpreter();
}
return... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async (cancelToken?: CancellationToken): Promise<JupyterServerInfo[] | undefined> => {
// We have a small python file here that we will execute to get the server info from all running Jupyter instances
const bestInterpreter = await this.getUsableJupyterPython(cancelToken);
if (bestInterprete... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async () => {
if (!diskPath) {
return;
}
try {
await fs.remove(path.dirname(diskPath));
} catch {
noop();
}... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async (specName: string, cancelToken?: CancellationToken): Promise<string | undefined> => {
// Enumerate all specs and get path for the match
const specs = await this.enumerateSpecs(cancelToken);
const match = specs.find(s => {
const js = s as JupyterKernelSpec;
ret... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
s => {
const js = s as JupyterKernelSpec;
return js && js.name === specName;
} | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async () => {
// Try ten times. Process may still be up and running.
// We don't want to do async as async dispose means it may never finish and then we don't
// delete
let count = 0;
while (count < 10) {
try {
... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async (command: string, cancelToken?: CancellationToken): Promise<boolean> => {
// See if we can find the command
try {
const result = await this.findBestCommand(command, cancelToken);
return result !== undefined;
} catch (err) {
this.logger.logWarning(... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async (inputEnv: NodeJS.ProcessEnv, interpreter: PythonInterpreter): Promise<any> => {
if (!inputEnv) {
inputEnv = process.env;
}
if (interpreter && interpreter.type === InterpreterType.Conda) {
return this.condaService.getActivatedCondaEnvironment(interpreter, inpu... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async (info: PythonInterpreter | undefined, cancelToken?: CancellationToken): Promise<boolean> => {
if (info) {
// Enumerate our specs
const specs = await this.enumerateSpecs(cancelToken);
// See if any of their paths match
return specs.findIndex(s => {
... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
s => {
if (info && s && s.path) {
return this.fileSystem.arePathsSame(s.path, info.path);
}
return false;
} | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async (enumerator: () => Promise<(IJupyterKernelSpec | undefined)[]>): Promise<IJupyterKernelSpec | undefined> => {
// Extract our current python information that the user has picked.
// We'll match against this.
const info = await this.interpreterService.getActiveInterpreter();
let... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async s => {
if (s && s.path && s.path.length > 0 && await fs.pathExists(s.path)) {
return this.interpreterService.getInterpreterDetails(s.path);
}
} | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async (cancelToken?: CancellationToken): Promise<(IJupyterKernelSpec | undefined)[]> => {
if (await this.isKernelSpecSupported()) {
const kernelSpecCommand = await this.findBestCommand(KernelSpecCommand);
if (kernelSpecCommand) {
try {
// Ask f... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
l => this.readSpec(l) | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
s => s | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async (command: string, interpreter: PythonInterpreter, cancelToken?: CancellationToken): Promise<JupyterCommand | undefined> => {
// If the module is found on this interpreter, then we found it.
if (interpreter && await this.doesModuleExist(command, interpreter, cancelToken) && !Cancellation.isCance... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async (pathToCheck: string): Promise<string[]> => {
try {
const files = await this.fileSystem.getFiles(pathToCheck);
return files ? files.filter(s => CheckJupyterRegEx.test(path.basename(s))) : [];
} catch (err) {
this.logger.logWarning('Python Extension (fileSy... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
s => CheckJupyterRegEx.test(path.basename(s)) | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async (): Promise<string | undefined> => {
if (!this.jupyterPath) {
const paths = this.knownSearchPaths.getSearchPaths();
for (let i = 0; i < paths.length && !this.jupyterPath; i += 1) {
const found = await this.lookForJupyterInDirectory(paths[i]);
i... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async (command: string, cancelToken?: CancellationToken): Promise<JupyterCommand | undefined> => {
if (await this.doesJupyterCommandExist(command, cancelToken) && !Cancellation.isCanceled(cancelToken)) {
// Search the known paths for jupyter
const jupyterPath = await this.searchPaths... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
async (command: string, cancelToken?: CancellationToken): Promise<JupyterCommand | undefined> => {
// See if we already have this command in list
if (!this.commands.hasOwnProperty(command)) {
// Not found, try to find it.
// First we look in the current interpreter
... | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
i => i !== current | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
i => this.findInterpreterCommand(command, i, cancelToken) | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
ArrowFunction |
f => f !== undefined | Flamefire/vscode-python | src/client/datascience/jupyter/jupyterExecution.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.