Commande | Nom JetBrain |
---|---|
Dupliquer une ligne | Duplicate line |
Déplacer une ligne | Move line down/up |
Déplacer un bloc de code automatiquement sélectionné | Move statement down/up |
Ouvrir un fichier | File... |
Rechercher dans un fichier / le projet | Find in path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const sinon = require('sinon'); | |
const chai = require('chai'); | |
const sinonChai = require('sinon-chai'); | |
const expect = chai.expect; | |
chai.use(sinonChai); | |
const utils = require('../../../server/mixins/utils'); | |
describe('mixins utils', () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = { | |
addUserInfoToOptions: function(context, unused, next) { | |
if (!context.req.currentUser || !context.req.currentUser.id) { | |
const noCurrentUserError = new Error( | |
'The request does not contain currentUser information' | |
); | |
noCurrentUserError.status = 401; | |
throw noCurrentUserError; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const utils = require('./utils'); | |
module.exports = function(Model, bootOptions) { | |
const options = Object.assign( | |
{ | |
creatorId: 'creatorId', | |
required: true, | |
}, | |
bootOptions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
from unittest.mock import sentinel | |
import requests | |
if __name__ == '__main__': | |
alphabet = ['BD', 'GT', 'IDEAL', 'IDEALWINE', '18', '2018', 'BETTANE', 'DESSAUVE', 'GRAND', 'TASTING', 'ID'] | |
product_len = 1 | |
iterator = itertools.product(*(product_len * [alphabet])) | |
code = ''.join(next(iterator)) |
Pweave is a dynamic report generation tool for Python. Its lets write texts (Markdown, reST, Latex...) and code in the same file with the code being evaluated and highlighted on purpose.
Key features:
- Execute python code in the chunks and capture input and output to a report.
- Rich output and support for IPython magics
- Use hidden code chunks, i.e. code is executed, but not printed in the output file.
Jupyter notebook has been heavily reported as the perfect prototyping tool for data scientist. Its main features are:
- inline code execution
- easy idea structuring
- nice displays of pictures and dataframe
This overall flexibility has made it a preferred tool compared to the more rustic iPython command line. However it should not be forgotten that this is no more than an REPL where you can navigate efficiently throughout the history.
and why Jupyter Notebook is not a good tool to do it.
At Sicara, we build machine learning based products for our customers:
- we build products: we need to develop in a production-ready mindset. Algorithms are served in the cloud, served and updated with APIs, etc.
- machine learning products: the customer comes with a business need and we have to deliver a satisfying solution as fast as possible.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@tf.function(input_signature=(tf.TensorSpec(shape=[None, None, 3], dtype=tf.uint8),)) | |
def preprocessing(input_tensor): | |
output_tensor = tf.cast(input_tensor, dtype=tf.float32) | |
output_tensor = tf.image.resize_with_pad(output_tensor, target_height=224, target_width=224) | |
output_tensor = keras_applications.mobilenet.preprocess_input(output_tensor, data_format="channels_last") | |
return output_tensor |
OlderNewer