How do we do profiling in odoo16 - odoo-16

As I know, we can use from odoo.tools.misc import profile or from odoo.tools.profiler import profile in odoo14 for profiling. They, however, are all deprecated in odoo16.
If I want to log my python method in odoo16, what tool should I use?

Related

How to import numkt (kotlin's numpy wrapper) into jupyter notebook to be used with kotlin kernel

I installed the kotlin kernel into my jupyter notebook environment using Anaconda. There are several libraries available by default like I can %use lets-plot
I'd really like to use the numpy wrapper which is sometimes called knumpy, kotlin-numpy or numkt
Import statements I see for the package include:
import org.jetbrains.numkt.*
import org.jetbrains.numkt.core.*
import org.jetbrains.numkt.math.*
from places like here
I can currently use the statement: %use numpy
and I get the error: Unresolved reference: numkt
I'd really like to get this functionality into my environment so I can actually do things.
How would I install/import this functionality into/from my anaconda environment.
Thnx
Remove all those imports and replace them with:
%use numpy
Here you can find knumpy very basic example.

Migrating existing Karate project from Version 0.8.0 to 0.9.5

I'm trying to migrate existing Karate project from 0.8.0 to 0.9.5
but facing some issues like below
1)None of the below imports are working, Need to figure it out equalling ones from 0.9.5
Looking for help from other, who has already tried this
import com.intuit.karate.cucumber.CucumberUtils;
import com.intuit.karate.cucumber.FeatureWrapper;
import com.intuit.karate.cucumber.KarateFeature;
import com.intuit.karate.cucumber.KarateJunitAndJsonReporter;
import com.intuit.karate.cucumber.KarateJunitFormatter;
import com.intuit.karate.cucumber.KarateReporter;
import com.intuit.karate.cucumber.KarateRuntime;
import com.intuit.karate.cucumber.KarateRuntimeOptions;
import com.intuit.karate.cucumber.KarateStats;
import com.intuit.karate.filter;
2)import com.intuit.karate.cucumber.CucumberRunner;- stating as Deprecated already, need to know replacement of this, my baseClass extends CucumberRunner.
3)also need to know replacement for below also
import com.intuit.karate.cucumber.FeatureFilePath;
import com.intuit.karate.cucumber.FeatureWrapper;
import com.intuit.karate.ScriptContext;
above imports are using in parsing Feature file
public static FeatureFilePath parseFeaturePath(File file) {
Please suggest tips to get this migration done successfully.
Thank you,
Jay
Sorry, only KarateStats was designed as a public API which is replaced by com.intuit.karate.Results. And CucumberRunner is replaced by com.intuit.karate.Runner. These are clearly mentioned in the release notes for 0.9.0.
The core of Karate was completely written and things like the KarateFeature and FeatureWrapper don't even exist anymore. I would say whoever decided to use or extend these classes made a very bad decision, and we never documented or encouraged any such approach. All the best !

django.core.management.sql.sql_delete removed on django 1.11

I'm upgrading django from 1.8 to 1.11 and this imports are failing
from django.core.management.sql import sql_delete
*** ImportError: cannot import name sql_delete
from django.core.management.sql import sql_all
*** ImportError: cannot import name sql_all
I was looking for the remove mention in the releases notes but I couldn't find anything.
Does anyone know when were removed and any alternative to replace it?
In Django 1.7+, the recommended approach would be to use migrate and sqlmigrate instead of syncdb and sqlall.
I don't think that the sql_all and sql_delete functions were ever a public API, therefore their removal didn't have to be mentioned in the release notes. They were removed in this commit, which was included in Django 1.9.

What does the warning «Use properties from the build variant packages» mean?

What does this warning mean?
It is appeared in version 1.0.0-beta-3595 for all usages of kotlin android extensions in my code.
I think they did this to support multiple build variants. For example when you have a flavour proversion and you want to use a layout from that flavour you have to use
import kotlinx.android.synthetic.proversion.activity_main.*
For the main build variant you have to use
import kotlinx.android.synthetic.main.activity_main.*
Not strictly the answer to the question 'why did they do that', but that's how to eliminate warning.
Change
import kotlinx.android.synthetic.activity_main.*
to
import kotlinx.android.synthetic.main.activity_main.*
implying that you already bumped version in build.gradle and updated IDEA (or AS) kotlin plugins.

import a yii package to the project

I tried to work with CPasswordHelper and everytime I got an exception when trying to run one of its methods. I think the reason is that I didn't import the package(system.utils) that CPasswordHelper is belong to. My question is how do I do that?
If it matter I'm working with netBeans.
CPasswordHelper is a core class defined in YiiBase, you don't need import it before using.
It is added since 1.1.14, may be you should check your yii version.