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 time | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
from selenium.common.exceptions import TimeoutException, NoSuchElementException | |
# Initialize the WebDriver | |
driver = webdriver.Firefox() |
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
# Get the file path from the user | |
file_path = input("Enter the path to the file: ") | |
# Read the file and store the lines in a list | |
with open(file_path, 'r') as file: | |
lines = file.readlines() | |
# Initialize a dictionary to store libraries under each heading | |
libs_by_heading = {} | |
current_heading = None |
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
def remove_duplicates(): | |
file_paths = input("Enter file paths separated by spaces: ").split() | |
for file_path in file_paths: | |
try: | |
with open(file_path, 'r') as file: | |
lines = file.readlines() | |
except FileNotFoundError: | |
print(f"File {file_path} not found. Skipping...") | |
continue |
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 math | |
def calculate_backlight_ratio(max_backlight, nits_with_hbm, nits_without_hbm): | |
ratio = (max_backlight * nits_with_hbm) / nits_without_hbm | |
return ratio | |
# Get user input for backlight parameters | |
lut_type = input("Do you want LUT for FrameworkDimming or KernelDimming FD/KD?: ").strip().upper() | |
if lut_type not in ['FD', 'KD']: |
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 re | |
def convert_to_xml(input_string): | |
match = re.match(r'^(.+)@(.+)::(.+?)(?:/([^@]+))?$', input_string) | |
if match: | |
package, version, interface, instance = match.groups() | |
xml_string = f''' | |
<hal format="hidl"> | |
<name>{package}</name> | |
<version>{version}</version> |
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
#!/usr/bin/env python3 | |
import bisect | |
import subprocess | |
import sys | |
import time | |
from threading import Thread | |
def run_shell_cmd(*args): |