repo_full_name stringlengths 6 93 | repo_url stringlengths 25 112 | repo_api_url stringclasses 28
values | owner stringclasses 28
values | repo_name stringclasses 28
values | description stringclasses 28
values | stars int64 617 98.8k | forks int64 31 355 ⌀ | watchers int64 990 999 ⌀ | license stringclasses 2
values | default_branch stringclasses 2
values | repo_created_at timestamp[s]date 2012-07-24 23:12:50 2025-06-16 08:07:28 ⌀ | repo_updated_at timestamp[s]date 2026-02-23 15:23:15 2026-05-03 18:52:12 ⌀ | repo_topics listlengths 0 13 ⌀ | repo_languages unknown | is_fork bool 1
class | open_issues int64 3 104 ⌀ | file_path stringlengths 3 208 | file_name stringclasses 509
values | file_extension stringclasses 1
value | file_size_bytes int64 101 84k ⌀ | file_url stringclasses 627
values | file_raw_url stringclasses 627
values | file_sha stringclasses 624
values | language stringclasses 8
values | parsed_at stringdate 2026-05-04 01:12:36 2026-05-04 19:41:55 | text stringlengths 100 102k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | helium/_impl/match_type.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:13.139479 | from helium._impl.util.xpath import lower, replace_nbsp
class MatchType:
def xpath(self, value, text):
raise NotImplementedError()
def text(self, value, text):
raise NotImplementedError()
class PREFIX_IGNORE_CASE(MatchType):
def xpath(self, value, text):
if not text:
return ''
# Asterisks '*' are someti... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | helium/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:13.163226 | """
Helium's API is contained in module ``helium``. It is a simple Python API that
makes specifying web automation cases as simple as describing them to someone
looking over their shoulder at a screen.
The public functions and classes of Helium are listed below. If you wish to use
Helium functions in your Python scrip... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | helium/_impl/util/dictionary.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:13.173853 | def inverse(dictionary):
"""
{a: {b}} -> {b: {a}}
"""
result = {}
for key, values in dictionary.items():
for value in values:
if value not in result:
result[value] = set()
result[value].add(key)
return result |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | helium/_impl/util/html.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:13.194614 | from html.parser import HTMLParser
import re
def strip_tags(html):
s = TagStripper()
s.feed(html)
return s.get_data()
class TagStripper(HTMLParser):
def __init__(self):
HTMLParser.__init__(self)
self.reset()
self.fed = []
def handle_data(self, d):
self.fed.append(d)
def get_data(self):
return ''.join(... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | helium/_impl/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:13.196071 | from copy import copy
from helium._impl.match_type import PREFIX_IGNORE_CASE
from helium._impl.selenium_wrappers import WebElementWrapper, \
WebDriverWrapper, FrameIterator, FramesChangedWhileIterating
from helium._impl.util.dictionary import inverse
from helium._impl.util.system import is_windows, get_canonical_os_na... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | docs/conf.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:13.201644 | import os
import sys
from datetime import date
sys.path.insert(0, os.path.abspath('..'))
# -- Project information -----------------------------------------------------
project = 'helium'
copyright = '%s, Michael Herrmann' % date.today().year
author = 'Michael Herrmann'
# Also update ../setup.py when you change thi... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | helium/_impl/selenium_wrappers.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:13.213872 | from helium._impl.util.geom import Rectangle
from selenium.common.exceptions import StaleElementReferenceException, \
NoSuchFrameException, WebDriverException, NoSuchElementException
from selenium.webdriver.common.action_chains import ActionChains
from urllib.error import URLError
import sys
class Wrapper:
def __ini... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | helium/_impl/util/inspect_.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:13.220145 | from helium._impl.util.lang import isbound
import inspect
def repr_args(f, args=None, kwargs=None, repr_fn=repr):
if args is None:
args = []
if kwargs is None:
kwargs = {}
arg_names, _, _, defaults = inspect.getfullargspec(f)[:4]
if isbound(f):
# Skip 'self' parameter:
arg_names = arg_names[1:]
num_defaul... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | helium/_impl/util/geom.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:13.267827 | from collections import namedtuple
from math import sqrt
class Rectangle:
def __init__(self, left=0, top=0, width=0, height=0):
self.left = left
self.top = top
self.right = left + width
self.bottom = top + height
@classmethod
def from_w_h(cls, width, height):
return cls(0, 0, width, height)
@classmethod
... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:14.501742 | from helium import start_chrome, start_firefox, go_to, set_driver, \
kill_browser
from selenium.webdriver import ChromeOptions
from selenium.webdriver.common.by import By
from tests.api.util import get_data_file_url
from time import time, sleep
from unittest import TestCase
import os
def test_browser_name():
try:
... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | helium/_impl/util/system.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:14.502510 | """
Gives information about the current operating system.
"""
import sys
def is_windows():
return sys.platform in ('win32', 'cygwin')
def is_mac():
return sys.platform == 'darwin'
def is_linux():
return sys.platform.startswith('linux')
def get_canonical_os_name():
if is_windows():
return 'windows'
elif is_ma... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | helium/_impl/util/lang.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:14.504501 | class TemporaryAttrValue:
def __init__(self, obj, attr, value):
self.obj = obj
self.attr = attr
self.value = value
self.value_before = None
def __enter__(self):
self.value_before = getattr(self.obj, self.attr)
setattr(self.obj, self.attr, self.value)
def __exit__(self, *_):
setattr(self.obj, self.attr,... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | helium/_impl/util/xpath.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:14.505540 | # -*- coding: utf-8 -*-
def lower(text):
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝ'
return "translate(%s, '%s', '%s')" % (text, alphabet, alphabet.lower())
def replace_nbsp(text, by=' '):
return "translate(%s, '\u00a0', %r)" % (text, by)
def predicate(condition):
return '[%s]' % conditi... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | helium/_impl/util/path.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:15.266121 | from errno import EEXIST
from os.path import split, isdir
from os import makedirs
def get_components(path):
folders = []
while True:
path, folder = split(path)
if folder != "":
folders.append(folder)
else:
if path != "":
folders.append(path)
break
return list(reversed(folders))
def ensure_exists... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:16.147191 | from setuptools import setup, find_packages
setup(
name = 'helium',
# Also update docs/conf.py when you change this:
version = '7.0.0',
author = 'Michael Herrmann',
author_email = 'michael+removethisifyouarehuman@herrmann.io',
description = 'Lighter browser automation based on Selenium.',
keywords = 'helium sel... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_alert.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:16.324140 | from helium import click, Alert, press, ENTER, write, TextField, Config, \
wait_until
from helium._impl.util.lang import TemporaryAttrValue
from helium._impl.util.system import is_mac
from tests.api import BrowserAT, test_browser_name
from selenium.common.exceptions import UnexpectedAlertPresentException
from time imp... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_chrome_options.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:16.391306 | from helium import start_chrome, kill_browser
from os.path import join
from tests.api import test_browser_name
from unittest import TestCase, skipIf
from selenium.webdriver.chrome.options import Options as ChromeOptions
from contextlib import contextmanager
import json
@skipIf(test_browser_name() != 'chrome', 'Only r... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_drag.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:16.852491 | from helium import *
from selenium.webdriver.common.by import By
from tests.api import BrowserAT
class DragTest(BrowserAT):
def setUp(self):
super().setUp()
self.drag_target = self.driver.find_element(By.ID, 'target')
def get_page(self):
return 'test_drag/default.html'
def test_drag(self):
drag("Drag me.", ... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_doubleclick.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:16.853100 | from helium import doubleclick
from tests.api import BrowserAT
class DoubleclickTest(BrowserAT):
def get_page(self):
return 'test_doubleclick.html'
def test_double_click(self):
doubleclick('Doubleclick here.')
self.assertEqual('Success!', self.read_result_from_browser()) |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_find_all.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:16.854951 | from selenium.common.exceptions import StaleElementReferenceException
from helium import find_all, Button, TextField, write
from tests.api import BrowserAT
class FindAllTest(BrowserAT):
def get_page(self):
return 'test_gui_elements.html'
def test_find_all_duplicate_button(self):
self.assertEqual(4, len(find_all(... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_click.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:16.920477 | from helium import click, Config
from helium._impl.util.lang import TemporaryAttrValue
from tests.api import BrowserAT
class ClickTest(BrowserAT):
def get_page(self):
return 'test_click.html'
def test_click(self):
click("Click me!")
self.assertEqual('Success!', self.read_result_from_browser())
def test_click_... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_gui_elements.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:16.921902 | # -*- coding: utf-8 -*-
from helium import Button, TextField, ComboBox, CheckBox, click, \
RadioButton, write, Text, find_all, Link, ListItem, Image, select, Config
from tests.api import BrowserAT
class GUIElementsTest(BrowserAT):
def get_page(self):
return 'test_gui_elements.html'
@classmethod
def setUpClass(cl... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_highlight.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:17.200900 | from helium import highlight, Button, Text, Config
from helium._impl.util.lang import TemporaryAttrValue
from tests.api import BrowserAT
class HighlightTest(BrowserAT):
def get_page(self):
return 'test_gui_elements.html'
def test_highlight(self):
button = Button("Input Button")
highlight(button)
self._check_... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_kill_service_at_exit_chrome.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:17.450379 | from helium import start_chrome
from helium._impl.util.system import is_windows
from tests.api import test_browser_name
from tests.api.test_kill_service_at_exit import KillServiceAtExitAT
from tests.api.util import InSubProcess
from unittest import TestCase, skipIf
@skipIf(test_browser_name() != 'chrome', 'Only run th... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_implicit_wait.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:17.456223 | from helium import click, Config
from helium._impl.util.lang import TemporaryAttrValue
from tests.api import BrowserAT
from time import time
class ImplicitWaitTest(BrowserAT):
def get_page(self):
return 'test_implicit_wait.html'
def test_click_text_implicit_wait(self):
click("Click me!")
start_time = time()
... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_kill_service_at_exit.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:17.525784 | from psutil import NoSuchProcess
import psutil
class KillServiceAtExitAT:
def test_kill_service_at_exit(self):
self.start_browser_in_sub_process()
self.assertEqual([], self.get_new_running_services())
def start_browser_in_sub_process(self):
raise NotImplementedError()
def get_new_running_services(self):
re... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_no_driver.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:17.558984 | from helium import *
from helium._impl import APIImpl
from unittest import TestCase
class NoDriverTest(TestCase):
def test_go_to_requires_driver(self):
self._check_requires_driver(lambda: go_to('google.com'))
def test_write_requires_driver(self):
self._check_requires_driver(lambda: write('foo'))
def test_press_... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_leaked_password.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:17.567976 | from helium import write, click, Text, wait_until
from tests.api import BrowserAT
class LeakedPasswordTest(BrowserAT):
def get_page(self):
return 'test_leaked_password.html'
def test_submit_leaked_password(self):
# Chrome 140.0.7339.185 or earlier introduced password leak detection.
# Writing leaked credential... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_point.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:17.818035 | from helium import click, Point, Button, hover, rightclick, doubleclick, drag
from tests.api import BrowserAT, test_browser_name
from re import search
class PointTest(BrowserAT):
"""
Tests helium.Point.
The tests allow for a coordinate difference between browsers of up to +/- 1
pixel. For instance: In Firefox, Bu... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_press.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:18.030253 | from helium import press, TextField, SHIFT
from tests.api import BrowserAT
class PressTest(BrowserAT):
def get_page(self):
return 'test_write.html'
def test_press_single_character(self):
press('a')
self.assertEqual('a', TextField('Autofocus text field').value)
def test_press_upper_case_character(self):
pres... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_aria.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:18.080365 | from helium import Button, TextField
from tests.api import BrowserAT
class AriaTest(BrowserAT):
def get_page(self):
return 'test_aria.html'
def test_aria_label_button_exists(self):
self.assertTrue(Button("Close").exists())
def test_aria_label_button_is_enabled(self):
self.assertTrue(Button("Close").is_enabled... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_rightclick.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:18.095228 | from helium import click, rightclick
from tests.api import BrowserAT
class RightclickTest(BrowserAT):
def get_page(self):
return 'test_rightclick.html'
def test_simple_rightclick(self):
rightclick("Perform a normal rightclick here.")
self.assertEqual(
"Normal rightclick performed.", self.read_result_from_br... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_repr.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:18.131821 | from helium import *
from helium import HTMLElement
from tests.api import BrowserAT
import re
class UnboundReprTest(BrowserAT):
def get_page(self):
return 'test_gui_elements.html'
def test_unbound_s_repr(self):
self.assertEqual(
"S('.cssClass')", repr(S('.cssClass'))
)
def test_unbound_s_repr_below(self):... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_file_upload.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:18.142853 | from helium import attach_file, drag_file, TextField, Text
from tests.api import BrowserAT
from tests.api.util import get_data_file
class FileUploadTest(BrowserAT):
def get_page(self):
return 'test_file_upload/test_file_upload.html'
def setUp(self):
super().setUp()
self.file_to_upload = get_data_file(
'test... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_s.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:18.160333 | from helium import S
from tests.api import BrowserAT
class STest(BrowserAT):
def get_page(self):
return 'test_gui_elements.html'
def test_find_by_id(self):
self.assertFindsEltWithId(S("#checkBoxId"), 'checkBoxId')
def test_find_by_name(self):
self.assertFindsEltWithId(S("@checkBoxName"), 'checkBoxId')
def te... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_scroll.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:18.192456 | from helium import scroll_down, scroll_left, scroll_right, scroll_up
from tests.api import BrowserAT
class ScrollTest(BrowserAT):
def get_page(self):
return 'test_scroll.html'
def test_scroll_up_when_at_top_of_page(self):
scroll_up()
self.assert_scroll_position_equals(0, 0)
def test_scroll_down(self):
scrol... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_start_go_to.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:18.418307 | from helium import go_to
from tests.api import start_browser
from tests.api.util import get_data_file_url
from os import path
from unittest import TestCase
class StartGoToTest(TestCase):
def setUp(self):
self.url = get_data_file_url('test_start_go_to.html')
self.driver = None
def test_go_to(self):
self.driver ... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_tables.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:18.615014 | from helium import *
from tests.api import BrowserAT
class TablesTest(BrowserAT):
def get_page(self):
return 'test_tables.html'
def test_s_below_above(self):
second_table_cells = find_all(
S("table > tbody > tr > td",
below=Text("Table no. 2"),
above=Text("Table no. 3")
)
)
self.assertEqual(len... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_wait_until.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:18.726431 | from helium import click, wait_until, Text
from tests.api import BrowserAT
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
from selenium.webdriver.support.expected_conditions import \
presence_of_element_located
from time import time
class WaitUntilTest(BrowserAT):
... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_window_handling.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:18.729321 | from helium import write, click, switch_to, TextField, Text, get_driver, \
Link, wait_until
from selenium.webdriver.common.by import By
from tests.api import BrowserAT, test_browser_name
from unittest import skipIf
class WindowHandlingTest(BrowserAT):
def get_page(self):
return 'test_window_handling/main.html'
de... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_write.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:18.765381 | from helium import write, TextField
from tests.api import BrowserAT
class WriteTest(BrowserAT):
def get_page(self):
return 'test_write.html'
def test_write(self):
write('Hello World!')
self.assertEqual(
'Hello World!', TextField('Autofocus text field').value
)
def test_write_into(self):
value = 'Hi the... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/util.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:18.798649 | from os.path import dirname, join
from pathlib import Path
from subprocess import Popen, PIPE, STDOUT
import os
import sys
def get_data_file(*rel_path):
return join(dirname(__file__), 'data', *rel_path)
def get_data_file_url(data_file):
return Path(get_data_file(data_file)).as_uri()
class InSubProcess:
"""
Impo... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_text_impl.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:18.813492 | from helium._impl import TextImpl
from helium._impl.selenium_wrappers import WebDriverWrapper
from selenium.webdriver.common.by import By
from tests.api import BrowserAT
class TextImplTest(BrowserAT):
def get_page(self):
return 'test_text_impl.html'
def test_empty_search_text_xpath(self):
xpath = TextImpl(WebDri... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_window.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:18.814205 | from helium import Window, click, go_to, get_driver, wait_until
from tests.api.util import get_data_file_url
from tests.api import BrowserAT
class WindowTest(BrowserAT):
def get_page(self):
return 'test_window/test_window.html'
def test_window_exists(self):
self.assertTrue(Window('test_window').exists())
def te... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_hover.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:21.877117 | from helium import hover, Config
from helium._impl.util.lang import TemporaryAttrValue
from helium._impl.util.system import is_windows
from tests.api import BrowserAT
class HoverTest(BrowserAT):
def get_page(self):
return 'test_hover.html'
def setUp(self):
# This test fails if the mouse cursor happens to be over... |
mherrmann/helium | https://github.com/mherrmann/helium | null | null | null | null | 8,275 | null | null | mit | null | null | null | null | null | null | null | tests/api/test_iframe.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:22.029910 | from helium import Text, get_driver, find_all
from tests.api import BrowserAT
class IframeTest(BrowserAT):
def get_page(self):
return "test_iframe/main.html"
def test_test_text_in_iframe_exists(self):
self.assertTrue(Text("This text is inside an iframe.").exists())
def test_text_in_nested_iframe_exists(self):
... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | compat/droidrun/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:24.516789 | """Compatibility shim: droidrun -> mobilerun.
Uses a PEP 451 meta-path finder (find_spec) to lazily alias droidrun.*
imports to mobilerun.* on demand. Compatible with Python 3.11-3.13+.
"""
import importlib
import importlib.abc
import importlib.machinery
import importlib.util
import os
import sys
import warnings
war... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | compat/droidrun/macro/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:24.521670 | """Forward droidrun.macro to mobilerun.macro.
NOT empty — must re-export the real module's API so `from droidrun.macro
import MacroPlayer` works. The lazy importer in __init__.py won't handle
this because this file takes precedence as a physical package.
"""
import sys
import mobilerun.macro as _real
# Re-export eve... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/__main__.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:24.522263 | """
Mobilerun main entry point
"""
from mobilerun.cli.main import cli
if __name__ == "__main__":
cli()
|
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | compat/droidrun/cli_shim.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:24.525793 | import sys
def main():
# Use stderr print instead of DeprecationWarning — Python hides
# DeprecationWarning by default, so most users would never see it.
print(
"\033[33m\u26a0 The 'droidrun' CLI has been renamed to 'mobilerun'. "
"Please update your scripts.\033[0m",
file=sys.stde... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/action_context.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:24.527403 | """ActionContext — composed bag of dependencies for action functions.
Replaces the ``tools=tools_instance`` parameter that action functions
previously received.
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Optional
if TYPE_CHECKING:
from mobilerun.agent.droid.state import MobileAgent... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | compat/droidrun/__main__.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:24.528335 | """Preserve 'python -m droidrun' entrypoint."""
import warnings
warnings.warn(
"Use 'python -m mobilerun' instead of 'python -m droidrun'.",
DeprecationWarning,
stacklevel=2,
)
from mobilerun.cli.main import cli
cli()
|
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:24.529672 | """
Mobilerun - A framework for controlling Android devices through LLM agents.
"""
import logging
from importlib.metadata import version
__version__ = version("mobilerun")
# Attach a default CLILogHandler so that every consumer (CLI, TUI, SDK,
# tools-only) gets visible output without explicit setup. CLI and TUI
#... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | compat/droidrun/macro/__main__.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:24.542603 | """Preserve 'python -m droidrun.macro' entrypoint."""
import warnings
warnings.warn(
"Use 'python -m mobilerun.macro' instead.",
DeprecationWarning,
stacklevel=2,
)
from mobilerun.macro.cli import macro_cli
macro_cli()
|
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/action_result.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:24.543243 | """ActionResult — structured return type from action functions."""
from __future__ import annotations
from dataclasses import dataclass
@dataclass
class ActionResult:
"""What the agent sees after an action runs."""
success: bool
summary: str
def __str__(self) -> str:
return self.summary
|
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/common/events.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:25.170411 | from typing import Any, Dict
from llama_index.core.workflow import Event
class ScreenshotEvent(Event):
screenshot: bytes
class RecordUIStateEvent(Event):
ui_state: list[Dict[str, Any]]
class ToolExecutionEvent(Event):
"""Emitted after every tool call dispatched through ToolRegistry."""
tool_name... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/droid/events.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:25.171515 | """
MobileAgent coordination events.
These events route between MobileAgent and child agents.
For internal agent events, see each agent's events.py file.
"""
from typing import Dict, List, Optional
from llama_index.core.workflow import Event, StopEvent
from pydantic import BaseModel
class FastAgentExecuteEvent(Eve... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/droid/state.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:25.172821 | from __future__ import annotations
from typing import Dict, List, Optional
from uuid import uuid4
from llama_index.core.base.llms.types import ChatMessage
from pydantic import BaseModel, ConfigDict, Field
from mobilerun.telemetry import PackageVisitEvent, capture
class QueuedUserMessage(BaseModel):
id: str = F... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/executor/events.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:25.187237 | """
Events for the ExecutorAgent workflow.
Internal events for streaming to frontend/logging.
For MobileAgent coordination events, see droid/events.py
"""
from typing import Dict, Optional
from llama_index.core.workflow import Event
from mobilerun.agent.usage import UsageResult
class ExecutorContextEvent(Event):
... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/droid/droid_agent.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:25.188805 | """
MobileAgent - A wrapper class that coordinates the planning and execution of tasks
to achieve a user's goal on a mobile device.
Architecture:
- When reasoning=False: Uses FastAgent directly
- When reasoning=True: Uses Manager (planning) + Executor (action) workflows
"""
import logging
import os
import traceback
f... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/executor/executor_agent.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:25.190319 | """
ExecutorAgent - Action execution workflow.
This agent is responsible for:
- Taking a specific subgoal from the Manager
- Analyzing the current UI state
- Selecting and executing appropriate actions
"""
from __future__ import annotations
import asyncio
import json
import logging
from typing import TYPE_CHECKING, ... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/executor/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:25.208750 | """
Executor Agent - Action execution workflow.
"""
from mobilerun.agent.droid.events import ExecutorInputEvent, ExecutorResultEvent
from mobilerun.agent.executor.events import (
ExecutorActionEvent,
ExecutorContextEvent,
ExecutorResponseEvent,
ExecutorActionResultEvent,
)
from mobilerun.agent.executor... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/droid/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:25.238349 | """
Mobilerun Agent Module.
This module provides a ReAct agent for automating Android devices using reasoning and acting.
"""
from mobilerun.agent.droid.droid_agent import MobileAgent
from mobilerun.agent.droid.state import MobileAgentState
# Legacy aliases for backward compatibility
_LEGACY_ALIASES = {
"DroidAg... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/fast_agent/events.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:26.694936 | """
Events for the FastAgent workflow.
Internal events for streaming to frontend/logging.
"""
from typing import Optional
from llama_index.core.workflow import Event
from mobilerun.agent.usage import UsageResult
class FastAgentInputEvent(Event):
"""Input ready for LLM."""
pass
class FastAgentResponseEv... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/executor/prompts.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:26.698075 | """
Prompts for the ExecutorAgent.
"""
def parse_executor_response(response: str) -> dict:
"""
Parse the Executor LLM response.
Extracts:
- thought: Content between "### Thought" and "### Action"
- action: Content between "### Action" and "### Description"
- description: Content after "### De... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/fast_agent/xml_parser.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:26.699352 | """XML tool-call parsing and result formatting.
Parses LLM responses containing <function_calls> blocks into structured
ToolCall objects, and formats tool results as <function_results> XML
for injection back into the conversation.
"""
import json
import logging
import re
import xml.etree.ElementTree as ET
from datacl... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/external/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:26.700392 | """External agent loader — dynamic imports.
External agents are self-contained modules that receive raw ADB access
via ``async_adbutils.AdbDevice``. They bring their own LLM client, prompts,
parsing, and action loop — zero imports from ``mobilerun``.
An external agent can be either:
- A single file: ``mobilerun/agent... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/fast_agent/fast_agent.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:26.701687 | """FastAgent — XML tool-calling agent for device interaction.
Uses a structured XML tool-calling protocol. The LLM emits <function_calls>
blocks, the agent parses them, executes the tools via ToolRegistry, and feeds
<function_results> back as user messages.
"""
import asyncio
import copy
import logging
import os
from... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/manager/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:27.068628 | """
Manager Agent - Planning and reasoning workflow.
Two variants available:
- ManagerAgent: Stateful, maintains chat history
- StatelessManagerAgent: Stateless, rebuilds context each turn
"""
from mobilerun.agent.droid.events import ManagerInputEvent, ManagerPlanEvent
from mobilerun.agent.manager.events import (
... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/manager/prompts.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:27.069884 | """
Prompts for the ManagerAgent.
"""
import re
def parse_manager_response(response: str) -> dict:
"""
Parse manager LLM response into structured dict.
Extracts XML-style tags from the response:
- <thought>...</thought>
- <add_memory>...</add_memory>
- <plan>...</plan>
- <request_accompl... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/manager/events.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:27.165648 | """
Events for the ManagerAgent workflow.
Internal events for streaming to frontend/logging.
For MobileAgent coordination events, see droid/events.py
"""
from typing import Optional
from llama_index.core.workflow import Event
from mobilerun.agent.usage import UsageResult
class ManagerContextEvent(Event):
"""C... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/providers/registry.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:27.293355 | from __future__ import annotations
from mobilerun.agent.providers.types import (
ProviderFamilySpec,
ProviderVariantSpec,
)
from mobilerun.config_manager.credential_paths import (
ANTHROPIC_OAUTH_CREDENTIAL_PATH,
GEMINI_OAUTH_CREDENTIAL_PATH,
OPENAI_OAUTH_CREDENTIAL_PATH,
)
# Canonical mapping fr... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/manager/manager_agent.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:27.294295 | """
ManagerAgent - Planning and reasoning workflow.
This agent is responsible for:
- Analyzing the current state
- Creating plans and subgoals
- Tracking progress
- Deciding when tasks are complete
"""
from __future__ import annotations
import copy
import json
import logging
import os
from typing import TYPE_CHECKIN... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/oneflows/app_starter_workflow.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:27.319335 | """
Simple workflow to open an app based on a description.
"""
import json
import logging
from workflows import Context, Workflow, step
from workflows.events import StartEvent, StopEvent
from mobilerun.agent.utils.inference import acomplete_with_retries
logger = logging.getLogger("mobilerun")
class AppStarter(Wor... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/manager/stateless_manager_agent.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:27.335798 | """
StatelessManagerAgent - Stateless planning agent that rebuilds context each turn.
"""
from __future__ import annotations
import logging
from typing import TYPE_CHECKING, Optional, Type
from llama_index.core.llms.llm import LLM
from llama_index.core.workflow import Context, StartEvent, StopEvent, Workflow, step
f... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/oneflows/structured_output_agent.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:27.340472 | """
StructuredOutputAgent - Extract structured data from final answers.
Takes a raw text answer and a Pydantic model, uses structured_predict()
to extract structured data from the text.
"""
import logging
from typing import Type
from llama_index.core.llms.llm import LLM
from llama_index.core.prompts import PromptTem... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/providers/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:27.342404 | from mobilerun.agent.providers.registry import (
VARIANT_ENV_KEY_SLOT,
get_provider_family,
list_auth_modes,
list_models_for_variant,
list_provider_families,
resolve_provider_variant,
)
from mobilerun.agent.providers.types import (
ProviderFamilySpec,
ProviderVariantSpec,
)
__all__ = [
... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/providers/setup_service.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:27.674238 | from __future__ import annotations
from dataclasses import dataclass
from typing import Iterable
import httpx
from mobilerun.agent.providers import (
VARIANT_ENV_KEY_SLOT,
ProviderFamilySpec,
ProviderVariantSpec,
list_provider_families,
resolve_provider_variant,
)
from mobilerun.config_manager.co... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/providers/types.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:27.720108 | from __future__ import annotations
from dataclasses import dataclass, field
@dataclass(frozen=True)
class ProviderVariantSpec:
"""Internal provider runtime variant for a user-facing provider family."""
id: str
runtime_provider_name: str
auth_mode: str
default_model: str | None
models: tuple[... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/tool_registry.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:27.767328 | """ToolRegistry — single source of truth for available tools.
Central registry for agent-callable tools.
"""
from __future__ import annotations
import inspect
import json
import logging
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Callable, Dict, Optional, Set
from mobilerun.agent.action... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/trajectory/writer.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:27.924960 | import asyncio
import json
import logging
import time
from abc import ABC, abstractmethod
from dataclasses import dataclass
from pathlib import Path
from typing import List, Optional
import aiofiles
from PIL import Image
from aiofiles import ospath
logger = logging.getLogger("mobilerun")
def make_serializable(obj)... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/usage.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:27.935857 | import contextlib
import logging
from typing import Any, Dict, List, Optional
from uuid import uuid4
from llama_index.core.callbacks.base_handler import BaseCallbackHandler
from llama_index.core.callbacks.schema import CBEventType, EventPayload
from llama_index.core.llms import LLM, ChatResponse
from pydantic import B... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/trajectory/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:27.936418 | from mobilerun.agent.trajectory.writer import TrajectoryWriter, make_serializable
__all__ = ["TrajectoryWriter", "make_serializable"]
|
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/utils/chat_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:27.965413 | import logging
from io import BytesIO
from pathlib import Path
from typing import Union
from llama_index.core.base.llms.types import ChatMessage, ImageBlock, TextBlock
from PIL import Image
logger = logging.getLogger("mobilerun")
# ============================================================================
# CONVE... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/utils/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:27.966073 | """
Utility modules for Mobilerun agents.
"""
from .chat_utils import (
to_chat_messages,
has_content,
filter_empty_messages,
limit_history,
)
from .prompt_resolver import PromptResolver
from .signatures import build_tool_registry
from .trajectory import Trajectory
__all__ = [
# Chat utilities
... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/utils/inference.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:27.986383 | import asyncio
import logging
from typing import Optional, Type, TypeVar
from llama_index.core.base.llms.types import (
ChatMessage,
ChatResponse,
CompletionResponse,
)
from llama_index.core.prompts import PromptTemplate
from pydantic import BaseModel
logger = logging.getLogger("mobilerun")
T = TypeVar("... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/utils/actions.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:28.015803 | """Action functions for device interaction.
Each function receives ``ctx: ActionContext`` as a keyword argument and
interacts with the device via ``ctx.driver``, resolves UI elements via
``ctx.ui``, and accesses shared state via ``ctx.shared_state``.
"""
import asyncio
import logging
from typing import TYPE_CHECKING,... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/utils/llm_loader.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:28.244140 | """
LLM Loader - Centralized logic for loading agent-specific LLMs based on configuration.
This module determines which LLMs are needed based on the agent mode (reasoning vs direct execution)
and loads them from config profiles.
"""
import logging
from typing import Any, List, Type
from llama_index.core.llms.llm imp... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/utils/llm_picker.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:28.319172 | import logging
from typing import TYPE_CHECKING, Any
from llama_index.core.llms.llm import LLM
from mobilerun.agent.usage import track_usage
if TYPE_CHECKING:
from mobilerun.config_manager.config_manager import LLMProfile
# Configure logging
logger = logging.getLogger("mobilerun")
SUPPORTED_PROVIDERS = [
... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/utils/oauth/anthropic_oauth_llm.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:28.351430 | import base64
import hashlib
import json
import os
import secrets
import sys
import threading
import time
import webbrowser
from http.server import BaseHTTPRequestHandler, HTTPServer
from pathlib import Path
from typing import Any, Dict, Literal, Optional, Sequence
from urllib.parse import parse_qs, urlencode, urlparse... |
droidrun/mobilerun | https://github.com/droidrun/mobilerun | null | null | null | null | 8,262 | null | null | mit | null | null | null | null | null | null | null | mobilerun/agent/utils/oauth/gemini_oauth_code_assist_llm.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:28.581523 | import base64
import hashlib
import json
import os
import secrets
import sys
import threading
import time
import webbrowser
from http.server import BaseHTTPRequestHandler, HTTPServer
from pathlib import Path
from typing import Any, Dict, Optional, Sequence, ClassVar
from urllib.parse import parse_qs, urlencode, urlpars... |
graphql-python/graphene | https://github.com/graphql-python/graphene | null | null | null | null | 8,241 | null | null | mit | null | null | null | null | null | null | null | examples/context_example.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:31.073808 | import graphene
class User(graphene.ObjectType):
id = graphene.ID()
name = graphene.String()
class Query(graphene.ObjectType):
me = graphene.Field(User)
def resolve_me(root, info):
return info.context["user"]
schema = graphene.Schema(query=Query)
query = """
query something{
me ... |
graphql-python/graphene | https://github.com/graphql-python/graphene | null | null | null | null | 8,241 | null | null | mit | null | null | null | null | null | null | null | examples/complex_example.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:31.078944 | import graphene
class GeoInput(graphene.InputObjectType):
lat = graphene.Float(required=True)
lng = graphene.Float(required=True)
@property
def latlng(self):
return f"({self.lat},{self.lng})"
class Address(graphene.ObjectType):
latlng = graphene.String()
class Query(graphene.ObjectTyp... |
graphql-python/graphene | https://github.com/graphql-python/graphene | null | null | null | null | 8,241 | null | null | mit | null | null | null | null | null | null | null | examples/starwars/data.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:31.080786 | human_data = {}
droid_data = {}
def setup():
from .schema import Human, Droid
global human_data, droid_data
luke = Human(
id="1000",
name="Luke Skywalker",
friends=["1002", "1003", "2000", "2001"],
appears_in=[4, 5, 6],
home_planet="Tatooine",
)
vader = Hu... |
graphql-python/graphene | https://github.com/graphql-python/graphene | null | null | null | null | 8,241 | null | null | mit | null | null | null | null | null | null | null | examples/starwars/schema.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:31.081761 | import graphene
from .data import get_character, get_droid, get_hero, get_human
class Episode(graphene.Enum):
NEWHOPE = 4
EMPIRE = 5
JEDI = 6
class Character(graphene.Interface):
id = graphene.ID()
name = graphene.String()
friends = graphene.List(lambda: Character)
appears_in = graphene... |
graphql-python/graphene | https://github.com/graphql-python/graphene | null | null | null | null | 8,241 | null | null | mit | null | null | null | null | null | null | null | examples/starwars/tests/test_query.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:31.090066 | from graphene.test import Client
from ..data import setup
from ..schema import schema
setup()
client = Client(schema)
def test_hero_name_query():
result = client.execute("""
query HeroNameQuery {
hero {
name
}
}
""")
assert result == {"data": {"hero": {"n... |
graphql-python/graphene | https://github.com/graphql-python/graphene | null | null | null | null | 8,241 | null | null | mit | null | null | null | null | null | null | null | examples/simple_example.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:31.091349 | import graphene
class Patron(graphene.ObjectType):
id = graphene.ID()
name = graphene.String()
age = graphene.Int()
class Query(graphene.ObjectType):
patron = graphene.Field(Patron)
def resolve_patron(root, info):
return Patron(id=1, name="Syrus", age=27)
schema = graphene.Schema(quer... |
graphql-python/graphene | https://github.com/graphql-python/graphene | null | null | null | null | 8,241 | null | null | mit | null | null | null | null | null | null | null | examples/starwars_relay/tests/test_connections.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:31.796843 | from graphene.test import Client
from ..data import setup
from ..schema import schema
setup()
client = Client(schema)
def test_correct_fetch_first_ship_rebels():
result = client.execute("""
query RebelsShipsQuery {
rebels {
name,
ships(first: 1) {
pageInf... |
graphql-python/graphene | https://github.com/graphql-python/graphene | null | null | null | null | 8,241 | null | null | mit | null | null | null | null | null | null | null | examples/starwars_relay/tests/test_objectidentification.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:31.798846 | import textwrap
from graphene.test import Client
from ..data import setup
from ..schema import schema
setup()
client = Client(schema)
def test_str_schema():
assert str(schema).strip() == textwrap.dedent(
'''\
type Query {
rebels: Faction
empire: Faction
node(
... |
graphql-python/graphene | https://github.com/graphql-python/graphene | null | null | null | null | 8,241 | null | null | mit | null | null | null | null | null | null | null | examples/starwars_relay/data.py | null | null | null | null | null | null | Python | 2026-05-04T02:12:31.800836 | data = {}
def setup():
global data
from .schema import Ship, Faction
xwing = Ship(id="1", name="X-Wing")
ywing = Ship(id="2", name="Y-Wing")
awing = Ship(id="3", name="A-Wing")
# Yeah, technically it's Corellian. But it flew in the service of the rebels,
# so for the purposes of this ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.