from tensorflow.core.example import example_pb2 - tensorflow

I am trying to understand the tensorflow source. I find the line
from tensorflow.core.example import example_pb2
in several examples. Yet if I go to that directory in tensorflow/tensorflow/core/ i cannot comprehend where example_pb2 is supposed to be defined. Would be thankful for any hints.

Related

Why does this import statement syntax work for me when the syntax in the Open Zeppelin documentation does not?

import "#openzeppelin/contracts/access/Ownable.sol"; DOES NOT WORK (but is what the documentation shows and the course I'm taking shows)
import "OpenZeppelin/openzeppelin-contracts#3.4.0/contracts/access/Ownable.sol"; WORKS (I found from another SO post)
I'm a little confused why the former does not work when it's what the documentation tells me to use. When I run brownie compile I get the following error:
contracts/Lottery.sol:4:1: ParserError: Source "#openzeppelin/contracts/access/Ownable.sol" not found: File outside of allowed directories. import "#openzeppelin/contracts/access/Ownable.sol";
Update:
I was missing the remapping in my config file. Adding the below fixed it.
remappings:
- "#chainlink=smartcontractkit/chainlink-brownie-contracts#1.1.1"
- "#openzeppelin=OpenZeppelin/openzeppelin-contracts#3.4.0"

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 !

Pyinstaller returns fatal error when clicking on the built exe

I've built a digital LogBook for the laboratory that I work in as a PhD in Physics, so it's tailored to our needs. The code runs fine using tkinter for GUI , pandas and openpyxl so that the inserted data can be stored to an excel file. The problem is that I need to turn it into an exe (and specifically an exe for 32-bit from a 64-bit machine). I've used for other apps I've built, the pyinstaller and they work great, but for this one nothing seems to work. I've been searching a week now for a possible solution but I cannot seem to find a way out. Not to mention that many of what I'm reading as answers to similar question is like Greek to me, since I'm a newbie in Python. So, if there is anyone that can give me a clean-cut answer so that I can understand what I'm doing in the process, I would be grateful.
I'm working with Python 2.7.15 and Windows 10
Here are my imports:
from openpyxl import load_workbook
from openpyxl import Workbook
import pandas as pd
from openpyxl.utils.dataframe import dataframe_to_rows
from datetime import *
from tkinter import messagebox
import os
import tkinter.ttk

IntelliJ: cannot resolve smybol in "org.apache.commons.lang3.tuple.ImmutablePair"

I am working on a web visualisation for a given project (db with genes, proteins, task is to do some nice visualisation with springboot and thymeleaf). The project was provided with all files, yet I am missing some libraries (also leading to some errors in the code ofc).
When trying to import:
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
lang3 gives me a "cannot resolve symbol" error and automatically searching jars on web results in "no jars found".I found the lang3-jar manually and successfully added it to the project library. When importing:
import org.apache.commons.lang3.*;
All errors for tuple.Pair-usage are gone. Yet, usage of ImmutablePair still results in a "cannot resolve symbol" error.
Firstly, I am confused and now unsure, if my knowledge of imports is correct. I learned, if for example you import something.anything.x and something.anything.y, you could also just import something.anything.*; and x and y would be covered.
Secondly, if needed, where do I find the jars I need (I could not find them yet).
Thanks :)
So, I do not know, where this error results in, yet I do know a solution. When adding the library, select "From Maven" and search for Apache lang3 and add it. Resolves the problems.

How do I call ipython modules in a short-hand way?

I'm learning python, and using notebooks;
My tutorial is telling my to use
randn(5)
but this only works for me when I use the fully qualified method; ie:
np.random.randn(5)
I imported numpy as np. Is there something else I need to do to make this work? I also wanted shorthand notation when calling plot() as well.
The tutorial likely assume that %pylab was called, or IPython was started with --pylab. The pylab magic does:
from pylab import *
which includes
from numpy import *
and other things, hiding where functions come from. The tutorial should probably not assume that you have done this, but if it does, it should be very clear about that fact, and mention what has happened and where these functions are coming from.
These days, it is typically considered prudent in teaching materials to make imports like this explicit, e.g.
import numpy as np
np.random.randn(x)
or
from numpy.random import randn
randn(x)
especially in a notebook, where saving a few characters of typing is much less precious than in a terminal.
When I use %pylab inline it works! Thanks