from pathlib import Path

from configparser import ConfigParser

import pyshark


fp_config_path = Path.cwd() / 'config.ini'  # get config from the current directory
pyshark_config_path = Path(pyshark.__file__).parent / 'config.ini'


def get_config():
    if Path.exists(fp_config_path):
        config_path = fp_config_path
    elif Path.exists(pyshark_config_path):
        config_path = pyshark_config_path
    else:
        return None
        
    config = ConfigParser()
    config.read(config_path)
    return config

from pathlib import Path

from configparser import ConfigParser

import pyshark


fp_config_path = Path.cwd() / 'config.ini'  # get config from the current directory
pyshark_config_path = Path(pyshark.__file__).parent / 'config.ini'


def get_config():
    if fp_config_path.exists():
        config_path = fp_config_path
    elif pyshark_config_path.exists():
        config_path = pyshark_config_path
    else:
        return None
        
    config = ConfigParser()
    config.read(config_path)
    return config

Use `x_path.exists()` instead of `Path.exists(x)`.
Use `x_path.exists()` instead of `Path.exists(x)`.
  from pathlib import Path
  
  from configparser import ConfigParser
  
  import pyshark
  
  
  fp_config_path = Path.cwd() / 'config.ini'  # get config from the current directory
  pyshark_config_path = Path(pyshark.__file__).parent / 'config.ini'
  
  
  def get_config():
-     if Path.exists(fp_config_path):
+     if fp_config_path.exists():
          config_path = fp_config_path
-     elif Path.exists(pyshark_config_path):
+     elif pyshark_config_path.exists():
          config_path = pyshark_config_path
      else:
          return None
          
      config = ConfigParser()
      config.read(config_path)
      return config
  
Use `x_path.exists()` instead of `Path.exists(x)`.
## Code Before:
from pathlib import Path

from configparser import ConfigParser

import pyshark


fp_config_path = Path.cwd() / 'config.ini'  # get config from the current directory
pyshark_config_path = Path(pyshark.__file__).parent / 'config.ini'


def get_config():
    if Path.exists(fp_config_path):
        config_path = fp_config_path
    elif Path.exists(pyshark_config_path):
        config_path = pyshark_config_path
    else:
        return None
        
    config = ConfigParser()
    config.read(config_path)
    return config

## Instruction:
Use `x_path.exists()` instead of `Path.exists(x)`.
## Code After:
from pathlib import Path

from configparser import ConfigParser

import pyshark


fp_config_path = Path.cwd() / 'config.ini'  # get config from the current directory
pyshark_config_path = Path(pyshark.__file__).parent / 'config.ini'


def get_config():
    if fp_config_path.exists():
        config_path = fp_config_path
    elif pyshark_config_path.exists():
        config_path = pyshark_config_path
    else:
        return None
        
    config = ConfigParser()
    config.read(config_path)
    return config
