internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: cowrie/cowrie

Issue:
$UID not spitting out UID
**Describe the bug**
A hacker found a way to get inside the cowrie box and executed "echo $UID". The reply that came back was empty, and the hacker disconnected. My normal box returned the UID.

**To Reproduce**
Steps to reproduce the behavior:
1. Connect to linux machine
2. Type in "Echo $UID" (response should be something like 1001 or 0)
3. Connect to cowrie
4. Type in "echo $UID"
5. See nothing replied on screen.

**Expected behavior**
When someone uses the variable $UID, get the variable from the honeyfs/etc/passwd file or return 0.

**Server (please complete the following information):**
 - OS: Linux nanopineo2 5.8.6-sunxi64 #20.08.2 SMP Fri Sep 4 08:52:31 CEST 2020 aarch64 GNU/Linux
 - Python: Python 3.7.3

**Additional context**
My hackers seem to get smarter each day...



Discussion:

Resolving patch:
diff --git a/src/cowrie/shell/session.py b/src/cowrie/shell/session.py
--- a/src/cowrie/shell/session.py
+++ b/src/cowrie/shell/session.py
@@ -36,7 +36,7 @@ def __init__(self, avatar, reactor=None):
             'USER': self.username,
             'HOME': self.avatar.home,
             'TMOUT': '1800',
-            'UID': self.uid}
+            'UID': str(self.uid)}
         if self.uid == 0:
             self.environ['PATH'] = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
         else:


Test patch:
Repository: cowrie/cowrie

Issue:
Command output logged before command in ttylog
**Describe the bug**
When using ssh in 'execcmd' mode, the command output is logged before the command itself.

Here a snippet from `src/cowrie/insults/insults.py` with my comments:
```
if self.type == 'e':
            cmd = self.terminalProtocol.execcmd.encode('utf8') <-- during this call, the output is logged
            if self.ttylogEnabled:
                ttylog.ttylog_write(self.ttylogFile, len(cmd), ttylog.TYPE_INTERACT, time.time(), cmd) <-- here the command is logged
```

**To Reproduce**
Steps to reproduce the behavior:
1. Connect using ssh client and execute a command:
```
$ ssh root@cowrie "cat /proc/cpuinfo | grep name | wc -l"
root@cowrie's password:
2
```
2. A snippet from the cowrie log
```
executing command "b'cat /proc/cpuinfo | grep name | wc -l'"
CMD: cat /proc/cpuinfo | grep name | wc -l
Command found: wc -l
Command found: grep name
Command found: cat /proc/cpuinfo
exitCode: 0
sending request b'exit-status'
sending close 0
remote close
Closing TTY Log: var/lib/cowrie/tty/3f1f9a5db692d999bb3d576b5e9956a242136e961ff3f52ba6202b1254ccdb99 after 0 seconds
```
3. Run playlog on the new ttylog:
```
$ bin/playlog -b var/lib/cowrie/tty/3f1f9a5db692d999bb3d576b5e9956a242136e961ff3f52ba6202b1254ccdb99
2
cat /proc/cpuinfo | grep name | wc -l
```
**Expected behavior**
The command should be logged first and the output should be logged at the time when it is available.




Discussion:

Resolving patch:
diff --git a/src/cowrie/insults/insults.py b/src/cowrie/insults/insults.py
--- a/src/cowrie/insults/insults.py
+++ b/src/cowrie/insults/insults.py
@@ -59,15 +59,17 @@ def connectionMade(self):
 
         if self.type == 'e':
             self.stdinlogOpen = True
+            # log the command into ttylog
+            if self.ttylogEnabled:
+                (sess, cmd) = self.protocolArgs
+                ttylog.ttylog_write(self.ttylogFile, len(cmd), ttylog.TYPE_INTERACT, time.time(), cmd)
         else:
             self.stdinlogOpen = False
 
         insults.ServerProtocol.connectionMade(self)
 
         if self.type == 'e':
-            cmd = self.terminalProtocol.execcmd.encode('utf8')
-            if self.ttylogEnabled:
-                ttylog.ttylog_write(self.ttylogFile, len(cmd), ttylog.TYPE_INTERACT, time.time(), cmd)
+            self.terminalProtocol.execcmd.encode('utf8')
 
     def write(self, data):
         if self.ttylogEnabled and self.ttylogOpen:


Test patch:
Repository: cowrie/cowrie

Issue:
Add mkdir as command
**Is your feature request related to a problem? Please describe.**
I see a lot of bots trying to build the .ssh directory or a tmp directory using mkdir. However, when the command is executed they get an error back that the command does not exist.

**Describe the solution you'd like**
Either have it create a virtual location (that only the attacker can see), or have it reply with a txtcommand with the following text:
```
mkdir: missing operand
Try 'mkdir --help' for more information.
```

**Describe alternatives you've considered**
Adding the command to txtcommands, but that does not seem to work properly (missing something?).

**Additional context**
Add any other context or screenshots about the feature request here.



Discussion:

Resolving patch:
diff --git a/src/cowrie/commands/fs.py b/src/cowrie/commands/fs.py
--- a/src/cowrie/commands/fs.py
+++ b/src/cowrie/commands/fs.py
@@ -517,6 +517,7 @@ def call(self):
 
 
 commands['/bin/mkdir'] = command_mkdir
+commands['mkdir'] = command_mkdir
 
 
 class command_rmdir(HoneyPotCommand):


Test patch:
Repository: cowrie/cowrie

Issue:
CEF spaces between each character
I followed the 7 steps https://cowrie.readthedocs.io/en/latest/INSTALL.html#step-1-install-dependencies

I set up cef in the config file 
`
[output_localsyslog]
enabled = true
facility = USER
format = cef`

But the output I'm getting has a bunch of spaces it seems to have a space between each character below 

`
Nov 26 04:42:45 cowrie cowrie: [cowrie] C E F : 0 | C o w r i e | C o w r i e | 1 . 0 | c o w r i e . s e s s i o n . c o n n e c t | c o w r i e . s e s s i o n . c o n n e c t | 5 | a p p = S S H v 2   d e s t i n a t i o n S e r v i c e n a m e = s s h d   d e v i c e E x t e r n a l I d = c o w r i e   m s g = N e w   c o n n e c t i o n :   1 9 2 . 1 6 8 . 2 . 5 7 : 3 3 6 2 6   ( 1 9 2 . 1 6 8 . 2 . 6 4 : 2 2 2 2 )   [ s e s s i o n :   8 a 9 0 7 9 8 c 8 9 f d ]   s r c = 1 9 2 . 1 6 8 . 2 . 5 7   p r o t o = t c p   s p t = 3 3 6 2 6   d p t = 2 2 2 2   d s t = 1 9 2 . 1 6 8 . 2 . 6 4

Nov 26 04:42:46 cowrie cowrie: [cowrie] C E F : 0 | C o w r i e | C o w r i e | 1 . 0 | c o w r i e . c l i e n t . v e r s i o n | c o w r i e . c l i e n t . v e r s i o n | 5 | a p p = S S H v 2   d e s t i n a t i o n S e r v i c e n a m e = s s h d   d e v i c e E x t e r n a l I d = c o w r i e   m s g = R e m o t e   S S H   v e r s i o n :   b ' S S H - 2 . 0 - O p e n S S H _ 8 . 2 p 1   U b u n t u - 4 u b u n t u 0 . 1 '   s r c = 1 9 2 . 1 6 8 . 2 . 5 7   p r o t o = t c p

Nov 26 04:42:46 cowrie cowrie: [cowrie] C E F : 0 | C o w r i e | C o w r i e | 1 . 0 | c o w r i e . c l i e n t . k e x | c o w r i e . c l i e n t . k e x | 5 | a p p = S S H v 2   d e s t i n a t i o n S e r v i c e n a m e = s s h d   d e v i c e E x t e r n a l I d = c o w r i e   m s g = S S H   c l i e n t   h a s s h   f i n g e r p r i n t :   a e 8 b d 7 d d 0 9 9 7 0 5 5 5 a a 4 c 6 e d 2 2 a d b b f 5 6   s r c = 1 9 2 . 1 6 8 . 2 . 5 7   p r o t o = t c p
`


Discussion:

Resolving patch:
diff --git a/src/cowrie/output/localsyslog.py b/src/cowrie/output/localsyslog.py
--- a/src/cowrie/output/localsyslog.py
+++ b/src/cowrie/output/localsyslog.py
@@ -45,6 +45,7 @@ class Output(cowrie.core.output.Output):
     def start(self):
         self.format = CowrieConfig().get('output_localsyslog', 'format')
         facilityString = CowrieConfig().get('output_localsyslog', 'facility')
+        levelString = CowrieConfig().get('output_localsyslog', 'level')
         self.facility = vars(syslog)['LOG_' + facilityString]
         self.syslog = twisted.python.syslog.SyslogObserver(prefix='cowrie', facility=self.facility)
 
@@ -57,7 +58,7 @@ def write(self, logentry):
 
         if self.format == 'cef':
             self.syslog.emit({
-                'message': cowrie.core.cef.formatCef(logentry),
+                'message': [cowrie.core.cef.formatCef(logentry)],
                 'isError': False,
                 'system': 'cowrie'
             })


Test patch:
Repository: cowrie/cowrie

Issue:
9may



Discussion:

Resolving patch:
diff --git a/src/cowrie/output/mysql.py b/src/cowrie/output/mysql.py
--- a/src/cowrie/output/mysql.py
+++ b/src/cowrie/output/mysql.py
@@ -95,14 +95,14 @@ def simpleQuery(self, sql, args):
     def write(self, entry):
         if entry["eventid"] == "cowrie.session.connect":
             r = yield self.db.runQuery(
-                f"SELECT `id`\" \"FROM `sensors`\" \"WHERE `ip` = {self.sensor}"
+                "SELECT `id`" "FROM `sensors`" f"WHERE `ip` = {self.sensor}"
             )
 
             if r:
                 sensorid = r[0][0]
             else:
                 yield self.db.runQuery(
-                    f"INSERT INTO `sensors` (`ip`) \" \"VALUES ({self.sensor})"
+                    "INSERT INTO `sensors` (`ip`) " f"VALUES ({self.sensor})"
                 )
 
                 r = yield self.db.runQuery("SELECT LAST_INSERT_ID()")


Test patch:
Repository: e2nIEE/pandapower

Issue:
3W transformer equivalent can have zero impedance
For three-winding transformers with specific parameters it is possible to get equivalent transformers with zero impedance. While this is probably due to bad data, currently pandapower does not check this and the powerflow does not convergence with the warning 

RuntimeWarning: divide by zero encountered in true_divide
  Ysf = stat / (branch[:, BR_R] + 1j * branch[:, BR_X])  ## series admittance

While this is a clear hint at the problem, finding the faulty element is not very straightforward.

I suggest at least a check in `_trafo_df_from_trafo3w()` like the following:

```
if any(trafo_df.vsc_percent==0):
    raise UserWarning("Equivalent Trafo with zero impedance!")
```

One could also add a small Impedance to let the powerflow continue...


Discussion:
The transformer in my case has the following parameters:
```
std_type                                  None
hv_bus                                      24
mv_bus                                      25
lv_bus                                      23
sn_hv_kva                               140000
sn_mv_kva                                70000
sn_lv_kva                                70000
vn_hv_kv                                   150
vn_mv_kv                                    22
vn_lv_kv                                    22
vsc_hv_percent                              12
vsc_mv_percent                              24
vsc_lv_percent                              12
vscr_hv_percent                              0
vscr_mv_percent                              0
vscr_lv_percent                              0
pfe_kw                                       0
i0_percent                                   0
in_service                                True
```

Resolving patch:
diff --git a/pandapower/build_branch.py b/pandapower/build_branch.py
--- a/pandapower/build_branch.py
+++ b/pandapower/build_branch.py
@@ -497,6 +497,8 @@ def _trafo_df_from_trafo3w(net):
         i += 1
 
     trafo_df = pd.DataFrame.from_dict(trafos2w, orient="index")
+    if any(trafo_df.vsc_percent==0):
+        raise UserWarning("Equivalent transformer with zero impedance!")
     return trafo_df
 
 


Test patch:
Repository: e2nIEE/pandapower

Issue:
pp.runpp fails with "Generators with different voltage setpoints connected to the same bus", BUT all setpoints are equal in grid model.
Hi,

in build_gen.py (Line 463) an equality check is made. But due to some conversions made before, this check fails:
``` python 
values = [1.00999999 1.00999999 1.00999999 1.00999999 1.         1.01 1.        ]
values_equal = [1.00999999 1.00999999 1.00999999 1.00999999 1.         1.00999999 1.        ]
```

Attached is the problematic grid in pickle, using pandapower 1.6.0 develop commit b7136d72ca66a1fcfdcf2460d40c35dac38f02a0 and python 3.7

```
Traceback (most recent call last):
  File "C:\Anaconda3\envs\py37\lib\site-packages\pandapower\run.py", line 294, in runpp
    _powerflow(net, **kwargs)
  File "C:\Anaconda3\envs\py37\lib\site-packages\pandapower\powerflow.py", line 66, in _powerflow
    ppc, ppci = _pd2ppc(net)
  File "C:\Anaconda3\envs\py37\lib\site-packages\pandapower\pd2ppc.py", line 114, in _pd2ppc
    _check_voltage_setpoints_at_same_bus(ppc)
  File "C:\Anaconda3\envs\py37\lib\site-packages\pandapower\build_gen.py", line 437, in _check_voltage_setpoints_at_same_bus
    raise UserWarning("Generators with different voltage setpoints connected to the same bus")
UserWarning: Generators with different voltage setpoints connected to the same bus
```

BR V3
pp.runpp fails with "Generators with different voltage setpoints connected to the same bus", BUT all setpoints are equal in grid model.
Hi,

in build_gen.py (Line 463) an equality check is made. But due to some conversions made before, this check fails:
``` python 
values = [1.00999999 1.00999999 1.00999999 1.00999999 1.         1.01 1.        ]
values_equal = [1.00999999 1.00999999 1.00999999 1.00999999 1.         1.00999999 1.        ]
```

Attached is the problematic grid in pickle, using pandapower 1.6.0 develop commit b7136d72ca66a1fcfdcf2460d40c35dac38f02a0 and python 3.7

```
Traceback (most recent call last):
  File "C:\Anaconda3\envs\py37\lib\site-packages\pandapower\run.py", line 294, in runpp
    _powerflow(net, **kwargs)
  File "C:\Anaconda3\envs\py37\lib\site-packages\pandapower\powerflow.py", line 66, in _powerflow
    ppc, ppci = _pd2ppc(net)
  File "C:\Anaconda3\envs\py37\lib\site-packages\pandapower\pd2ppc.py", line 114, in _pd2ppc
    _check_voltage_setpoints_at_same_bus(ppc)
  File "C:\Anaconda3\envs\py37\lib\site-packages\pandapower\build_gen.py", line 437, in _check_voltage_setpoints_at_same_bus
    raise UserWarning("Generators with different voltage setpoints connected to the same bus")
UserWarning: Generators with different voltage setpoints connected to the same bus
```

BR V3


Discussion:

Resolving patch:
diff --git a/pandapower/build_gen.py b/pandapower/build_gen.py
--- a/pandapower/build_gen.py
+++ b/pandapower/build_gen.py
@@ -460,4 +460,4 @@ def _different_values_at_one_bus(buses, values):
     # have the voltage of the first generator at that bus
     values_equal = first_values[buses]
 
-    return not np.array_equal(values, values_equal)
+    return not np.allclose(values, values_equal)


Test patch:
Repository: e2nIEE/pandapower

Issue:
Deprecation warning for asmatrix
The usage of numpy asmatrix raises Deprecation Warnings in numpy 1.15.4:
PendingDeprecationWarning: the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.
There are 5 occurences in pandapower/pf/dSbus_dV_pypower.py.


Discussion:

Resolving patch:
diff --git a/pandapower/pf/dSbus_dV_pypower.py b/pandapower/pf/dSbus_dV_pypower.py
--- a/pandapower/pf/dSbus_dV_pypower.py
+++ b/pandapower/pf/dSbus_dV_pypower.py
@@ -12,7 +12,7 @@
 """Computes partial derivatives of power injection w.r.t. voltage.
 """
 
-from numpy import conj, diag, asmatrix, asarray, zeros
+from numpy import conj, diag, asarray
 from scipy.sparse import issparse, csr_matrix as sparse
 
 
@@ -39,11 +39,11 @@ def dSbus_dV_sparse(Ybus, V):
 
 def dSbus_dV_dense(Ybus, V):
     # standard code from Pypower (slower than above)
-    Ibus = Ybus * asmatrix(V).T
+    Ibus = Ybus * asarray(V).T
 
-    diagV = asmatrix(diag(V))
-    diagIbus = asmatrix(diag(asarray(Ibus).flatten()))
-    diagVnorm = asmatrix(diag(V / abs(V)))
+    diagV = asarray(diag(V))
+    diagIbus = asarray(diag(asarray(Ibus).flatten()))
+    diagVnorm = asarray(diag(V / abs(V)))
 
     dS_dVm = diagV * conj(Ybus * diagVnorm) + conj(diagIbus) * diagVnorm
     dS_dVa = 1j * diagV * conj(diagIbus - Ybus * diagV)


Test patch:
Repository: e2nIEE/pandapower

Issue:
wrong documentation of estimation.remove_bad_data
There is an invalid keyword parameter 'chi2_prob_false' for the function 'estimation.remove_bad_data' described in the documentation. On the other hand the parameter 'ref_power' which is a valid parameter for this function is not described in the documentation.


Discussion:
'ref_power' is also not described in 'estimation.estimate' and 'estimation.chi2_analysis'
Thanks for the info, i will take a look and correct these mistakes.

Resolving patch:
diff --git a/pandapower/estimation/state_estimation.py b/pandapower/estimation/state_estimation.py
--- a/pandapower/estimation/state_estimation.py
+++ b/pandapower/estimation/state_estimation.py
@@ -24,8 +24,10 @@
     import logging
 std_logger = logging.getLogger(__name__)
 
-ESTIMATOR_MAPPING = {'wls': WLSEstimator,
-                     'wls_with_zero_constraint': WLSEstimatorZeroInjectionConstraints}
+ESTIMATOR_MAPPING = {
+    'wls': WLSEstimator,
+    'wls_with_zero_constraint': WLSEstimatorZeroInjectionConstraints
+}
 
 
 def estimate(net, algorithm='wls', init='flat', tolerance=1e-6, maximum_iterations=10,
@@ -119,9 +121,6 @@ def remove_bad_data(net, init='flat', tolerance=1e-6, maximum_iterations=10,
         if the largest normalized residual reflects a bad measurement
         (default value of 3.0)
 
-        **chi2_prob_false** (float) - probability of error / false alarms
-        (default value: 0.05)
-
     OUTPUT:
         **successful** (boolean) - Was the state estimation successful?
     """
@@ -458,9 +457,6 @@ def perform_rn_max_test(self, v_in_out=None, delta_in_out=None,
             if the largest normalized residual reflects a bad measurement
             (standard value of 3.0)
 
-            **chi2_prob_false** (float) - probability of error / false alarms
-            (standard value: 0.05)
-
         OUTPUT:
             **successful** (boolean) - True if all bad data could be removed
 


Test patch:
Repository: e2nIEE/pandapower

Issue:
Cryptic error if plotly is not installed 
A call to `simple_plotly` (as in e.g. the tutorial notebook `plotly_built-in`) fails with 

``` python
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
 in 
----> 1 simple_plotly(net)

~\Documents\Python\pandapower\pandapower\plotting\plotly\simple_plotly.py in simple_plotly(net, respect_switches, use_line_geodata, on_map, projection, map_style, figsize, aspectratio, line_width, bus_size, ext_grid_size, bus_color, line_color, trafo_color, ext_grid_color)
    117         **ext_grid_color** (String, 'yellow') - External Grid Color. Init is yellow
    118     """
--> 119     version_check()
    120     # create geocoord if none are available
    121     if 'line_geodata' not in net:

~\Documents\Python\pandapower\pandapower\plotting\plotly\traces.py in version_check()
     34 
     35 def version_check():
---> 36     if version.parse(plotly_version) < version.parse("3.1.1"):
     37         raise UserWarning("Your plotly version {} is no longer supported.\r\n"
     38                           "Please upgrade your python-plotly installation, "

NameError: name 'plotly_version' is not defined
```

if plotly is not installed. Apparently `traces.py` logs that plotly could not be imported, but this information is not displayed to the user.

There should probably be a more descriptive error if `simple_plotly` is called without an installation of plotly.


Discussion:

Resolving patch:
diff --git a/pandapower/plotting/plotly/traces.py b/pandapower/plotting/plotly/traces.py
--- a/pandapower/plotting/plotly/traces.py
+++ b/pandapower/plotting/plotly/traces.py
@@ -33,6 +33,10 @@
 
 
 def version_check():
+    if "plotly_version" not in locals() and "plotly_version" not in globals():
+        raise UserWarning("You are trying to use plotly, which is not installed.\r\n"
+                          "Please upgrade your python-plotly installation, "
+                          "e.g., via pip install --upgrade plotly")
     if version.parse(plotly_version) < version.parse("3.1.1"):
         raise UserWarning("Your plotly version {} is no longer supported.\r\n"
                           "Please upgrade your python-plotly installation, "


Test patch:
Repository: e2nIEE/pandapower

Issue:
from_mpc failed to load the case generated by to_mpc
After checking the source code, I found the to_mpc function saves the fields in a loose format. According to the from_mpc function, all the fields should be under a variable called "mpc" (default), however the to_mpc function does not follow this, which leads to a situation that the from_mpc function cannot load the case generated by the to_mpc function.


Discussion:

Resolving patch:
diff --git a/pandapower/converter/matpower/to_mpc.py b/pandapower/converter/matpower/to_mpc.py
--- a/pandapower/converter/matpower/to_mpc.py
+++ b/pandapower/converter/matpower/to_mpc.py
@@ -42,7 +42,8 @@ def to_mpc(net, filename=None, **kwargs):
     """
     ppc = to_ppc(net, **kwargs)
 
-    mpc = _ppc2mpc(ppc)
+    mpc = dict()
+    mpc["mpc"] = _ppc2mpc(ppc)
     if filename is not None:
         # savemat
         savemat(filename, mpc)


Test patch:
Repository: e2nIEE/pandapower

Issue:
Fail to load .mat file
Generate the .m file using PowerWorld and then load the .m file in Matlab to save the workspace as .mat file. (Also rename the workspace to mpc before saving) Then the .mat file still cannot be loaded by pandapower because in the .mat file ncost = 4 instead of 2 or 3. A dirty fix if you only need to run PF is to change the condition ncost == 3 to ncost in [3, 4].


Discussion:
That is to say, you need to modify the pypower script in the converter folder to support the case where ncost = 4.

Resolving patch:
diff --git a/pandapower/converter/pypower/from_ppc.py b/pandapower/converter/pypower/from_ppc.py
--- a/pandapower/converter/pypower/from_ppc.py
+++ b/pandapower/converter/pypower/from_ppc.py
@@ -40,7 +40,11 @@ def _create_costs(net, ppc, gen_lookup, type, idx):
                            ppc['gencost'][idx, 4:], type)
     elif ppc['gencost'][idx, 0] == 2:
         ncost = ppc['gencost'][idx, NCOST]
-        if ncost == 2:
+        if ncost == 1:
+            cp2 = 0
+            cp1 = 0
+            cp0 = ppc['gencost'][idx, COST]
+        elif ncost == 2:
             cp2 = 0
             cp1 = ppc['gencost'][idx, COST]
             cp0 = ppc['gencost'][idx, COST + 1]
@@ -48,6 +52,14 @@ def _create_costs(net, ppc, gen_lookup, type, idx):
             cp2 = ppc['gencost'][idx, COST]
             cp1 = ppc['gencost'][idx, COST + 1]
             cp0 = ppc['gencost'][idx, COST + 2]
+        elif ncost > 3:
+            logger.warning("The pandapower poly_cost table only supports up to 2nd order " +
+                           "polynomials. The ppc higher order polynomials cannot be converted.")
+            cp2 = ppc['gencost'][idx, COST + ncost - 3]
+            cp1 = ppc['gencost'][idx, COST + ncost - 2]
+            cp0 = ppc['gencost'][idx, COST + ncost - 1]
+        else:
+            raise ValueError("'ncost' must be an positve integer but is " + str(ncost))
         pp.create_poly_cost(net, gen_lookup.element.at[idx], gen_lookup.element_type.at[idx],
                                   cp1_eur_per_mw=cp1, cp2_eur_per_mw2=cp2, cp0_eur=cp0)
     else:


Test patch:
diff --git a/pandapower/test/converter/test_from_ppc.py b/pandapower/test/converter/test_from_ppc.py
--- a/pandapower/test/converter/test_from_ppc.py
+++ b/pandapower/test/converter/test_from_ppc.py
@@ -64,7 +64,8 @@ def test_validate_from_ppc():
 
 def test_ppc_testgrids():
     # check ppc_testgrids
-    name = ['case2_1', 'case2_2', 'case2_3', 'case2_4', 'case3_1', 'case3_2', 'case6', 'case14', 'case57']
+    name = ['case2_1', 'case2_2', 'case2_3', 'case2_4', 'case3_1', 'case3_2', 'case6', 'case14',
+            'case57']
     for i in name:
         ppc = get_testgrids(i, 'ppc_testgrids.p')
         net = from_ppc(ppc, f_hz=60)