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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/test_environ.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:24.049340 | # -*- coding: utf-8 -*-
''' Tests for the BaseRequest and BaseResponse objects and their subclasses. '''
import unittest
import sys
import itertools
import bottle
from bottle import request, tob, touni, json_dumps, HTTPError, parse_date, CookieError
from . import tools
import wsgiref.util
import base64
from bottle ... |
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/test_auth.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:24.062316 | # -*- coding: utf-8 -*-
import bottle
from .tools import ServerTestBase
class TestBasicAuth(ServerTestBase):
def test__header(self):
@bottle.route('/')
@bottle.auth_basic(lambda x, y: False)
def test(): return {}
self.assertStatus(401)
self.assertHeader('Www-Authenticate', ... |
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/test_app.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:24.066509 | # -*- coding: utf-8 -*-
""" Tests for the functionality of the application object.
TODO: Move other tests here.
"""
import unittest
from bottle import Bottle
class TestApplicationObject(unittest.TestCase):
def test_setattr(self):
""" Attributed can be assigned, but only once. """
app = ... |
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/test_config.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:24.077646 | import os
import tempfile
import unittest
from bottle import ConfigDict
class TestConfDict(unittest.TestCase):
def test_isadict(self):
""" ConfigDict should behaves like a normal dict. """
# It is a dict-subclass, so this kind of pointless, but it doen't hurt.
d, m = dict(), ConfigDict()
... |
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/test_importhook.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:24.615439 | # -*- coding: utf-8 -*-
import unittest
import sys, os
import bottle
class TestImportHooks(unittest.TestCase):
def make_module(self, name, **args):
mod = sys.modules.setdefault(name, bottle.new_module(name))
mod.__file__ = '<virtual %s>' % name
mod.__dict__.update(**args)
return mo... |
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/test_formsdict.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:24.616762 | # -*- coding: utf-8 -*-
# '瓶' means "Bottle"
import unittest
from bottle import FormsDict, touni, tob
class TestFormsDict(unittest.TestCase):
def test_attr_access(self):
""" FomsDict.attribute returs string values as unicode. """
d = FormsDict(py3='瓶')
self.assertEqual('瓶', d.py3)
... |
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/test_html_helper.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:24.623621 | import unittest
from bottle import _parse_http_header
class TestHttpUtils(unittest.TestCase):
# TODO: Move more of the low level http stuff here.
def test_accept_header(self):
self.assertEqual(_parse_http_header(
'text/xml, text/whitespace ,'
'application/params;para... |
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/test_jinja2.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:24.660738 | # -*- coding: utf-8 -*-
import unittest
from bottle import Jinja2Template, jinja2_template, jinja2_view, touni
from .tools import warn, chdir
class TestJinja2Template(unittest.TestCase):
def test_string(self):
""" Templates: Jinja2 string"""
t = Jinja2Template('start {{var}} end').render(var='va... |
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/test_mdict.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:24.662367 | import unittest
from bottle import MultiDict, HeaderDict
class TestMultiDict(unittest.TestCase):
def test_isadict(self):
""" MultiDict should behaves like a normal dict """
d, m = dict(a=5), MultiDict(a=5)
d['key'], m['key'] = 'value', 'value'
d['k2'], m['k2'] = 'v1', 'v1'
d... |
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/test_outputfilter.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:24.691405 | # -*- coding: utf-8 -*-
'''Everything returned by Bottle()._cast() MUST be WSGI compatiple.'''
import unittest
import bottle
from bottle import tob, touni
from .tools import ServerTestBase, tobs, warn
USING_UJSON = True
try:
import ujson
except ImportError:
USING_UJSON = False
class TestOutputFilter(ServerT... |
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/test_mount.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:24.693182 | # -*- coding: utf-8 -*-
import bottle
from .tools import ServerTestBase, api
from bottle import response
class TestAppMounting(ServerTestBase):
def setUp(self):
ServerTestBase.setUp(self)
self.subapp = bottle.Bottle()
@self.subapp.route('/')
@self.subapp.route('/test/<test>')
... |
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/test_oorouting.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:24.704876 | """
Tests & demonstrates various OO approaches to routes
"""
import unittest
import sys
if sys.version_info >= (3, 0, 0):
from io import BytesIO
else:
from StringIO import StringIO as BytesIO
__author__ = 'atc'
from bottle import Bottle, request, tob, BaseRequest
class TestRouter(object):
"""
A tes... |
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/test_mako.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:24.706163 | from __future__ import with_statement
import unittest
from .tools import warn, chdir
from bottle import MakoTemplate, mako_template, mako_view, touni
class TestMakoTemplate(unittest.TestCase):
def test_string(self):
""" Templates: Mako string"""
t = MakoTemplate('start ${var} end').render(var='var'... |
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/test_multipart.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:24.707266 | # -*- coding: utf-8 -*-
import unittest
import base64
import sys, os.path, tempfile
from io import BytesIO
import bottle
class BaseMultipartTest(unittest.TestCase):
def setUp(self):
self.reset()
def reset(self):
self.data = BytesIO()
self.parts = None
def write(self, *lines):
... |
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/test_stpl.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:25.496237 | # -*- coding: utf-8 -*-
from __future__ import with_statement
import unittest
from bottle import SimpleTemplate, TemplateError, view, template, touni, tob, html_quote
import re, os
import traceback
from .tools import chdir
class TestSimpleTemplate(unittest.TestCase):
def assertRenders(self, tpl, to, *args, **vars... |
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/test_route.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:25.497257 | import functools
import unittest
import bottle
from .tools import api
from bottle import _re_flatten
class TestReFlatten(unittest.TestCase):
def test_re_flatten(self):
self.assertEqual(_re_flatten(r"(?:aaa)(_bbb)"), '(?:aaa)(?:_bbb)')
self.assertEqual(_re_flatten(r"(aaa)(_bbb)"), '(?:aaa)(?:_bbb)... |
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/test_sendfile.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:25.500768 | import sys
import unittest
from bottle import static_file, request, response, parse_date, parse_range_header, Bottle, tob
import bottle
import wsgiref.util
import os
import tempfile
import time
basename = os.path.basename(__file__)
root = os.path.dirname(__file__)
basename2 = os.path.basename(bottle.__file__)
root2 =... |
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/tools.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:25.501412 | # -*- coding: utf-8 -*-
from __future__ import with_statement
import os
import bottle
import sys
import unittest
import wsgiref
import wsgiref.util
import wsgiref.validate
import warnings
import mimetypes
import uuid
from bottle import tob, BytesIO
def warn(msg):
sys.stderr.write('WARNING: %s\n' % msg.strip())... |
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/test_plugins.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:25.502208 | # -*- coding: utf-8 -*-
import unittest
from . import tools
from bottle import HTTPResponse, HTTPError, json_dumps
class MyPlugin(object):
def __init__(self):
self.app = None
self.add_args = {}
self.add_content = ''
def setup(self, app):
self.app = app
def apply(self, fu... |
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/test_wsgi.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:25.510945 | # -*- coding: utf-8 -*-
from __future__ import with_statement
import bottle
from .tools import ServerTestBase, chdir
from bottle import tob, touni, HTTPResponse
class TestWsgi(ServerTestBase):
''' Tests for WSGI functionality, routing and output casting (decorators) '''
def test_get(self):
""" WSGI: G... |
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/test_securecookies.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:25.545439 | #coding: utf-8
import unittest
import bottle
from bottle import tob, touni
from .tools import api
class TestSignedCookies(unittest.TestCase):
def setUp(self):
self.data = touni('υηι¢σ∂є')
self.secret = tob('secret')
bottle.app.push()
bottle.response.bind()
def tear_down(self)... |
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/test_router.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:25.574484 | # -*- coding: utf-8 -*-
import unittest
import bottle
import warnings
class TestRouter(unittest.TestCase):
CGI = False
def setUp(self):
self.r = bottle.Router()
def add(self, path, target, method='GET', **ka):
with warnings.catch_warnings() as r:
warnings.simplefilte... |
bottlepy/bottle | https://github.com/bottlepy/bottle | null | null | null | null | 8,759 | null | null | mit | null | null | null | null | null | null | null | test/test_resources.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:25.686316 | import os.path
import sys
import unittest
from bottle import ResourceManager
if sys.platform == 'win32':
TEST_PATHS = ('C:\\foo\\bar\\', 'C:\\foo\\bar\\baz', 'C:\\foo\\baz\\..\\bar\\blub')
EXPECTED = ['C:\\foo\\bar\\']
else:
TEST_PATHS = ('/foo/bar/', '/foo/bar/baz', '/foo/baz/../bar/blub')
EXPECTED = ... |
Jeffallan/claude-skills | https://github.com/Jeffallan/claude-skills | null | null | null | null | 8,751 | null | null | mit | null | null | null | null | null | null | null | scripts/update-docs.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:28.193153 | #!/usr/bin/env python3
"""
Update documentation files with version and counts from version.json.
This script:
1. Reads the version from version.json
2. Computes counts (skills, references, workflows) from filesystem
3. Updates version.json with computed counts
4. Updates all documentation files with version and counts... |
Jeffallan/claude-skills | https://github.com/Jeffallan/claude-skills | null | null | null | null | 8,751 | null | null | mit | null | null | null | null | null | null | null | scripts/validate-skills.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:28.225459 | #!/usr/bin/env python3
"""
Skill Validation Script for Claude Skills Repository
Validates skill structure, YAML frontmatter, and count consistency.
Run before releases to prevent broken skills from being published.
Usage:
python scripts/validate-skills.py # Run all checks
python scripts/validate-... |
Jeffallan/claude-skills | https://github.com/Jeffallan/claude-skills | null | null | null | null | 8,751 | null | null | mit | null | null | null | null | null | null | null | scripts/validate-markdown.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:28.243393 | #!/usr/bin/env python3
"""
Validate markdown files for common parsing errors.
Checks for:
- HTML comments breaking tables
- Unclosed code blocks
- Missing table separator rows
- Inconsistent column counts in tables
Usage:
python scripts/validate-markdown.py [--check] [--path PATH]
"""
import argparse
from datacl... |
Jeffallan/claude-skills | https://github.com/Jeffallan/claude-skills | null | null | null | null | 8,751 | null | null | mit | null | null | null | null | null | null | null | scripts/migrate-frontmatter.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:28.273312 | #!/usr/bin/env python3
"""
Migrate skill SKILL.md frontmatter to Agent Skills spec-compliant structure.
Moves triggers, role, scope, output-format under metadata key.
Adds license, metadata.author, metadata.version, metadata.domain.
Usage:
python scripts/migrate-frontmatter.py # Migrate all skills
... |
hunshcn/gh-proxy | https://github.com/hunshcn/gh-proxy | null | null | null | null | 8,722 | null | null | mit | null | null | null | null | null | null | null | app/main.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:30.814869 | # -*- coding: utf-8 -*-
import re
import requests
from flask import Flask, Response, redirect, request
from requests.exceptions import (
ChunkedEncodingError,
ContentDecodingError, ConnectionError, StreamConsumedError)
from requests.utils import (
stream_decode_response_unicode, iter_slices, CaseInsensitiv... |
hardikvasa/google-images-download | https://github.com/hardikvasa/google-images-download | null | null | null | null | 8,674 | null | null | mit | null | null | null | null | null | null | null | docs/conf.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:33.143232 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or module... |
hardikvasa/google-images-download | https://github.com/hardikvasa/google-images-download | null | null | null | null | 8,674 | null | null | mit | null | null | null | null | null | null | null | google_images_download/__main__.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:33.149275 | #!/usr/bin/env python
from __future__ import absolute_import
from .__init__ import main
if __name__ == '__main__':
main()
|
hardikvasa/google-images-download | https://github.com/hardikvasa/google-images-download | null | null | null | null | 8,674 | null | null | mit | null | null | null | null | null | null | null | tests/test_google_images_download.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:33.162765 | from google_images_download import google_images_download
import os, errno
import time
def silent_remove_of_file(file):
try:
os.remove(file)
except OSError as e:
if e.errno != errno.ENOENT:
raise e
return False
return True
def test_download_images_to_default_location(... |
hardikvasa/google-images-download | https://github.com/hardikvasa/google-images-download | null | null | null | null | 8,674 | null | null | mit | null | null | null | null | null | null | null | tests/test_sample.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:33.169781 | # Sample Test passing with nose and pytest
def test_pass():
assert True, "dummy sample test"
|
hardikvasa/google-images-download | https://github.com/hardikvasa/google-images-download | null | null | null | null | 8,674 | null | null | mit | null | null | null | null | null | null | null | google_images_download/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:33.170286 | #!/usr/bin/env python
from __future__ import absolute_import
def main():
import google_images_download.google_images_download
if __name__ == '__main__':
main()
|
hardikvasa/google-images-download | https://github.com/hardikvasa/google-images-download | null | null | null | null | 8,674 | null | null | mit | null | null | null | null | null | null | null | google_images_download/google_images_download.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:33.177229 | #!/usr/bin/env python
# In[ ]:
# coding: utf-8
###### Searching and Downloading Google Images to the local disk ######
# Import Libraries
import sys
version = (3, 0)
cur_version = sys.version_info
if cur_version >= version: # If the Current Version of Python is 3.0 or above
import urllib.request
from urllib... |
hardikvasa/google-images-download | https://github.com/hardikvasa/google-images-download | null | null | null | null | 8,674 | null | null | mit | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:33.196557 | from setuptools import setup, find_packages
from codecs import open
from os import path
__version__ = '2.8.0'
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open('README.rst', encoding='utf-8') as f:
long_description = f.read()
# get the dependencies and install... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | hallo/datasets/talk_video.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:37.205909 | # pylint: disable=R0801
"""
talking_video_dataset.py
This module defines the TalkingVideoDataset class, a custom PyTorch dataset
for handling talking video data. The dataset uses video files, masks, and
embeddings to prepare data for tasks such as video generation and
speech-driven video animation.
Classes:
Ta... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | hallo/datasets/audio_processor.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:37.208900 | # pylint: disable=C0301
'''
This module contains the AudioProcessor class and related functions for processing audio data.
It utilizes various libraries and models to perform tasks such as preprocessing, feature extraction,
and audio separation. The class is initialized with configuration parameters and can process
aud... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | hallo/animate/face_animate_static.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:37.209983 | # pylint: disable=R0801
"""
This module is responsible for handling the animation of faces using a combination of deep learning models and image processing techniques.
It provides a pipeline to generate realistic face animations by incorporating user-provided conditions such as facial expressions and environments.
Th... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | hallo/datasets/mask_image.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:37.210821 | # pylint: disable=R0801
"""
This module contains the code for a dataset class called FaceMaskDataset, which is used to process and
load image data related to face masks. The dataset class inherits from the PyTorch Dataset class and
provides methods for data augmentation, getting items from the dataset, and determining ... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | hallo/animate/face_animate.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:37.211754 | # pylint: disable=R0801
"""
This module is responsible for animating faces in videos using a combination of deep learning techniques.
It provides a pipeline for generating face animations by processing video frames and extracting face features.
The module utilizes various schedulers and utilities for efficient face an... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | hallo/datasets/image_processor.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:37.213096 | # pylint: disable=W0718
"""
This module is responsible for processing images, particularly for face-related tasks.
It uses various libraries such as OpenCV, NumPy, and InsightFace to perform tasks like
face detection, augmentation, and mask rendering. The ImageProcessor class encapsulates
the functionality for these op... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | hallo/models/face_locator.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:38.450783 | """
This module implements the FaceLocator class, which is a neural network model designed to
locate and extract facial features from input images or tensors. It uses a series of
convolutional layers to progressively downsample and refine the facial feature map.
The FaceLocator class is part of a larger system that ma... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | hallo/models/image_proj.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:38.452344 | """
image_proj_model.py
This module defines the ImageProjModel class, which is responsible for
projecting image embeddings into a different dimensional space. The model
leverages a linear transformation followed by a layer normalization to
reshape and normalize the input image embeddings for further processing in
c... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | hallo/models/transformer_2d.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:38.454083 | # pylint: disable=E1101
# src/models/transformer_2d.py
"""
This module defines the Transformer2DModel, a PyTorch model that extends ModelMixin and ConfigMixin. It includes
methods for gradient checkpointing, forward propagation, and various utility functions. The model is designed for
2D image-related tasks and uses L... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | hallo/models/motion_module.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:38.467553 | # pylint: disable=R0801
# pylint: disable=W0613
# pylint: disable=W0221
"""
temporal_transformers.py
This module provides classes and functions for implementing Temporal Transformers
in PyTorch, designed for handling video data and temporal sequences within transformer-based models.
Functions:
zero_module(module... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | hallo/models/audio_proj.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:38.489779 | """
This module provides the implementation of an Audio Projection Model, which is designed for
audio processing tasks. The model takes audio embeddings as input and outputs context tokens
that can be used for various downstream applications, such as audio analysis or synthesis.
The AudioProjModel class is based on th... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | hallo/models/mutual_self_attention.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:38.519104 | # pylint: disable=E1120
"""
This module contains the implementation of mutual self-attention,
which is a type of attention mechanism used in deep learning models.
The module includes several classes and functions related to attention mechanisms,
such as BasicTransformerBlock and TemporalBasicTransformerBlock.
The m... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | hallo/models/wav2vec.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:39.041856 | # pylint: disable=R0901
# src/models/wav2vec.py
"""
This module defines the Wav2Vec model, which is a pre-trained model for speech recognition and understanding.
It inherits from the Wav2Vec2Model class in the transformers library and provides additional functionalities
such as feature extraction and encoding.
Classe... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | hallo/models/resnet.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:39.043064 | # pylint: disable=E1120
# pylint: disable=E1102
# pylint: disable=W0237
# src/models/resnet.py
"""
This module defines various components used in the ResNet model, such as InflatedConv3D, InflatedGroupNorm,
Upsample3D, Downsample3D, ResnetBlock3D, and Mish activation function. These components are used to construct
a... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | hallo/models/unet_3d_blocks.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:39.127741 | # pylint: disable=R0801
# src/models/unet_3d_blocks.py
"""
This module defines various 3D UNet blocks used in the video model.
The blocks include:
- UNetMidBlock3DCrossAttn: The middle block of the UNet with cross attention.
- CrossAttnDownBlock3D: The downsampling block with cross attention.
- DownBlock3D: The stand... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | hallo/utils/config.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:39.139266 | """
This module provides utility functions for configuration manipulation.
"""
from typing import Dict
def filter_non_none(dict_obj: Dict):
"""
Filters out key-value pairs from the given dictionary where the value is None.
Args:
dict_obj (Dict): The dictionary to be filtered.
Returns:
... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | hallo/models/unet_3d.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:39.151115 | # pylint: disable=R0801
# pylint: disable=E1101
# pylint: disable=R0402
# pylint: disable=W1203
"""
This is the main file for the UNet3DConditionModel, which defines the UNet3D model architecture.
The UNet3D model is a 3D convolutional neural network designed for image segmentation and
other computer vision tasks. It... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | hallo/models/unet_2d_condition.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:39.171488 | # pylint: disable=R0801
# pylint: disable=E1101
# pylint: disable=W1203
"""
This module implements the `UNet2DConditionModel`,
a variant of the 2D U-Net architecture designed for conditional image generation tasks.
The model is capable of taking a noisy input sample and conditioning it based on additional information ... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | hallo/models/attention.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:39.558033 | # pylint: disable=R0801
# pylint: disable=C0303
"""
This module contains various transformer blocks for different applications, such as BasicTransformerBlock,
TemporalBasicTransformerBlock, and AudioTemporalBasicTransformerBlock. These blocks are used in various models,
such as GLIGEN, UNet, and others. The transforme... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | hallo/utils/util.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:39.641924 | # pylint: disable=C0116
# pylint: disable=W0718
# pylint: disable=R1732
# pylint: disable=R0801
"""
utils.py
This module provides utility functions for various tasks such as setting random seeds,
importing modules from files, managing checkpoint files, and saving video files from
sequences of PIL images.
Functions:
... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | scripts/extract_meta_info_stage1.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:39.696106 | # pylint: disable=R0801
"""
This module is used to extract meta information from video directories.
It takes in two command-line arguments: `root_path` and `dataset_name`. The `root_path`
specifies the path to the video directory, while the `dataset_name` specifies the name
of the dataset. The module then collects all... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | scripts/data_preprocess.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:39.700166 | # pylint: disable=W1203,W0718
"""
This module is used to process videos to prepare data for training. It utilizes various libraries and models
to perform tasks such as video frame extraction, audio extraction, face mask generation, and face embedding extraction.
The script takes in command-line arguments to specify the... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | scripts/app.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:39.700753 | """
This script is a gradio web ui.
The script takes an image and an audio clip, and lets you configure all the
variables such as cfg_scale, pose_weight, face_weight, lip_weight, etc.
Usage:
This script can be run from the command line with the following command:
python scripts/app.py
"""
import argparse
import gra... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | scripts/inference.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:39.730310 | # pylint: disable=E1101
# scripts/inference.py
"""
This script contains the main inference pipeline for processing audio and image inputs to generate a video output.
The script imports necessary packages and classes, defines a neural network model,
and contains functions for processing audio embeddings and performin... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | scripts/extract_meta_info_stage2.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:39.754463 | # pylint: disable=R0801
"""
This module is used to extract meta information from video files and store them in a JSON file.
The script takes in command line arguments to specify the root path of the video files,
the dataset name, and the name of the meta information file. It then generates a list of
dictionaries conta... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | scripts/train_stage1.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:39.807663 | # pylint: disable=E1101,C0415,W0718,R0801
# scripts/train_stage1.py
"""
This is the main training script for stage 1 of the project.
It imports necessary packages, defines necessary classes and functions, and trains the model using the provided configuration.
The script includes the following classes and functions:
... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | scripts/train_stage2.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:40.171405 | # pylint: disable=E1101,C0415,W0718,R0801
# scripts/train_stage2.py
"""
This is the main training script for stage 2 of the project.
It imports necessary packages, defines necessary classes and functions, and trains the model using the provided configuration.
The script includes the following classes and functions:
... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:40.287169 | """
setup.py
----
This is the main setup file for the hallo face animation project. It defines the package
metadata, required dependencies, and provides the entry point for installing the package.
"""
# -*- coding: utf-8 -*-
from setuptools import setup
packages = \
['hallo', 'hallo.datasets', 'hallo.models', 'h... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | hallo/models/transformer_3d.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:43.250472 | # pylint: disable=R0801
"""
This module implements the Transformer3DModel, a PyTorch model designed for processing
3D data such as videos. It extends ModelMixin and ConfigMixin to provide a transformer
model with support for gradient checkpointing and various types of attention mechanisms.
The model can be configured w... |
fudan-generative-vision/hallo | https://github.com/fudan-generative-vision/hallo | null | null | null | null | 8,648 | null | null | mit | null | null | null | null | null | null | null | hallo/models/unet_2d_blocks.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:43.399770 | # pylint: disable=R0801
# pylint: disable=W1203
"""
This file defines the 2D blocks for the UNet model in a PyTorch implementation.
The UNet model is a popular architecture for image segmentation tasks,
which consists of an encoder, a decoder, and a skip connection mechanism.
The 2D blocks in this file include vari... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | bayes_opt/bayesian_optimization.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:45.696770 | """Main module.
Holds the `BayesianOptimization` class, which handles the maximization of a
function over a specific target space.
"""
from __future__ import annotations
import json
from collections import deque
from collections.abc import Iterable
from os import PathLike
from pathlib import Path
from typing import ... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | bayes_opt/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:45.698618 | """Pure Python implementation of bayesian global optimization with gaussian processes."""
from __future__ import annotations
import importlib.metadata
from bayes_opt import acquisition
from bayes_opt.bayesian_optimization import BayesianOptimization
from bayes_opt.constraint import ConstraintModel
from bayes_opt.dom... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | bayes_opt/target_space.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:45.699819 | """Manages the optimization domain and holds points."""
from __future__ import annotations
from copy import deepcopy
from typing import TYPE_CHECKING, Any
from warnings import warn
import numpy as np
from colorama import Fore
from bayes_opt.constraint import ConstraintModel
from bayes_opt.exception import NotUnique... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | bayes_opt/exception.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:45.704962 | """This module contains custom exceptions for Bayesian Optimization."""
from __future__ import annotations
__all__ = [
"BayesianOptimizationError",
"ConstraintNotSupportedError",
"NoValidPointRegisteredError",
"NotUniqueError",
"TargetSpaceEmptyError",
]
class BayesianOptimizationError(Exception... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | bayes_opt/constraint.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:45.708023 | """Constraint handling."""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
import numpy as np
from scipy.stats import norm
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels import Matern
from bayes_opt.parameter import wrap_kernel
if TYPE_C... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | bayes_opt/domain_reduction.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:45.709732 | """Implement domain transformation.
In particular, this provides a base transformer class and a sequential domain
reduction transformer as based on Stander and Craig's "On the robustness of a
simple domain reduction scheme for simulation-based optimization"
"""
from __future__ import annotations
from abc import ABC,... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | bayes_opt/parameter.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:45.711221 | """Parameter classes for Bayesian optimization."""
from __future__ import annotations
import abc
from collections.abc import Sequence
from inspect import signature
from numbers import Number
from typing import TYPE_CHECKING, Any, Callable, Union
import numpy as np
from sklearn.gaussian_process import kernels
from b... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | bayes_opt/util.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:45.716246 | """Contains utility functions."""
from __future__ import annotations
import numpy as np
def ensure_rng(random_state: int | np.random.RandomState | None = None) -> np.random.RandomState:
"""Create a random number generator based on an optional seed.
Parameters
----------
random_state : np.random.Ran... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | bayes_opt/acquisition.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:45.718533 | """Acquisition functions for Bayesian Optimization.
The acquisition functions in this module can be grouped the following way:
- One of the base acquisition functions
(:py:class:`UpperConfidenceBound<bayes_opt.acquisition.UpperConfidenceBound>`,
:py:class:`ProbabilityOfImprovement<bayes_opt.acquisition.Probabilit... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | bayes_opt/logger.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:45.735198 | """Contains classes and functions for logging."""
from __future__ import annotations
from collections.abc import Mapping
from typing import TYPE_CHECKING, Any
from colorama import Fore, just_fix_windows_console
if TYPE_CHECKING:
from bayes_opt.parameter import ParamsType
just_fix_windows_console()
class Scre... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | examples/async_optimization.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:46.266690 | import time
import random
from bayes_opt import BayesianOptimization
from bayes_opt.util import UtilityFunction
import asyncio
import threading
from colorama import Fore
try:
import json
import tornado.ioloop
import tornado.httpserver
from tornado.web import RequestHandler
import requests
except ... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | examples/sklearn_example.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:46.313482 | from sklearn.datasets import make_classification
from sklearn.model_selection import cross_val_score
from sklearn.ensemble import RandomForestClassifier as RFC
from sklearn.svm import SVC
from bayes_opt import BayesianOptimization
from colorama import Fore
def get_data():
"""Synthetic binary classification datase... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | examples/duplicate_point.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:46.335379 | import numpy as np
from bayes_opt import BayesianOptimization
from bayes_opt import acquisition
def f(x):
return np.exp(-(x - 2) ** 2) + np.exp(-(x - 6) ** 2 / 10) + 1/ (x ** 2 + 1)
if __name__ == '__main__':
acq = acquisition.UpperConfidenceBound(kappa=5) # kappa determines explore/Exploitation ratio
... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | tests/test_bayesian_optimization.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:46.342192 | from __future__ import annotations
import pickle
import warnings
from pathlib import Path
import numpy as np
import pytest
from scipy.optimize import NonlinearConstraint
from bayes_opt import BayesianOptimization, acquisition
from bayes_opt.acquisition import AcquisitionFunction
from bayes_opt.domain_reduction impor... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | docsrc/conf.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:46.346833 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | examples/async_optimization_dummies.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:46.352176 | """Originally by @rhizhiy
https://github.com/bayesian-optimization/BayesianOptimization/issues/347#issuecomment-1273465096
"""
import time
from typing import Callable
import matplotlib.pyplot as plt
import numpy as np
from bayes_opt import BayesianOptimization
from bayes_opt import acquisition
from scipy.optimize impo... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | examples/typed_hyperparameter_tuning.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:46.354394 | import numpy as np
from bayes_opt import BayesianOptimization, acquisition
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.datasets import load_digits
from sklearn.model_selection import KFold
from sklearn.metrics import log_loss
import matplotlib.pyplot as plt
N_FOLDS = 10
N_START = 2
N_ITER = 25... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | tests/test_constraint.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:46.358586 | from __future__ import annotations
import numpy as np
import pytest
from scipy.optimize import NonlinearConstraint
from bayes_opt import BayesianOptimization, ConstraintModel
@pytest.fixture
def target_function():
return lambda x, y: np.cos(2 * x) * np.cos(y) + np.sin(x)
@pytest.fixture
def constraint_functio... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | tests/test_logger.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:46.377470 | from __future__ import annotations
import io
from unittest.mock import patch
from colorama import Fore
from bayes_opt import BayesianOptimization
from bayes_opt.logger import ScreenLogger
def target_func(**kwargs):
"""Simple target function for testing."""
return sum(kwargs.values())
PBOUNDS = {"p1": (0,... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | tests/test_acquisition.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:46.395188 | from __future__ import annotations
import sys
import numpy as np
import pytest
from scipy.optimize import NonlinearConstraint
from scipy.spatial.distance import pdist
from sklearn.gaussian_process import GaussianProcessRegressor
from bayes_opt import BayesianOptimization, acquisition, exception
from bayes_opt.acquis... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | tests/test_notebooks_run.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:47.557556 | """
collect all notebooks in examples, and check that they run without error
"""
from __future__ import annotations
from pathlib import Path
import nbformat
import pytest
from nbclient.exceptions import CellExecutionError
from nbconvert.preprocessors import ExecutePreprocessor
this_file_loc = Path(__file__).parent
... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | tests/test_util.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:48.153173 | from __future__ import annotations
import numpy as np
from bayes_opt.util import ensure_rng
def test_ensure_rng():
"""Test that ensure_rng properly handles different inputs."""
# Test with None (should return a new RandomState)
rng1 = ensure_rng(None)
assert isinstance(rng1, np.random.RandomState)
... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | tests/test_seq_domain_red.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:48.183198 | from __future__ import annotations
import numpy as np
import pytest
from bayes_opt import BayesianOptimization, SequentialDomainReductionTransformer
from bayes_opt.target_space import TargetSpace
def black_box_function(x, y):
"""Function with unknown internals we wish to maximize.
This is just serving as a... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | tests/test_parameter.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:48.183715 | from __future__ import annotations
import numpy as np
import pytest
from scipy.optimize import NonlinearConstraint
from sklearn.gaussian_process import GaussianProcessRegressor, kernels
from bayes_opt import BayesianOptimization
from bayes_opt.parameter import CategoricalParameter, FloatParameter, IntParameter, wrap_... |
bayesian-optimization/BayesianOptimization | https://github.com/bayesian-optimization/BayesianOptimization | null | null | null | null | 8,619 | null | null | mit | null | null | null | null | null | null | null | tests/test_target_space.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:48.357334 | from __future__ import annotations
import numpy as np
import pytest
from scipy.optimize import NonlinearConstraint
from bayes_opt.exception import NotUniqueError
from bayes_opt.target_space import TargetSpace
def target_func(**kwargs):
# arbitrary target func
return sum(kwargs.values())
PBOUNDS = {"p1": (... |
X-PLUG/MobileAgent | https://github.com/X-PLUG/MobileAgent | null | null | null | null | 8,611 | null | null | mit | null | null | null | null | null | null | null | GUI-Critic-R1/test.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:51.919906 | import requests
import os
from tqdm import tqdm
from PIL import Image, ImageDraw
import numpy as np
from time import sleep
import dashscope
from transformers import Qwen2VLForConditionalGeneration, AutoTokenizer, AutoProcessor
from transformers import Qwen2_5_VLForConditionalGeneration
from qwen_vl_utils import process... |
X-PLUG/MobileAgent | https://github.com/X-PLUG/MobileAgent | null | null | null | null | 8,611 | null | null | mit | null | null | null | null | null | null | null | Mobile-Agent-E/MobileAgentE/api.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:51.924304 | import base64
import requests
from time import sleep
import json
def encode_image(image_path):
with open(image_path, "rb") as image_file:
return base64.b64encode(image_file.read()).decode('utf-8')
def track_usage(res_json, api_key):
"""
{'id': 'chatcmpl-AbJIS3o0HMEW9CWtRjU43bu2Ccrdu', 'object': '... |
X-PLUG/MobileAgent | https://github.com/X-PLUG/MobileAgent | null | null | null | null | 8,611 | null | null | mit | null | null | null | null | null | null | null | Mobile-Agent-E/MobileAgentE/crop.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:51.939435 | import math
import cv2
import numpy as np
from PIL import Image, ImageDraw
# import clip
# import torch
def crop_image(img, position):
def distance(x1,y1,x2,y2):
return math.sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2))
position = position.tolist()
for i in range(4):
for j in range(i+1, 4):
... |
X-PLUG/MobileAgent | https://github.com/X-PLUG/MobileAgent | null | null | null | null | 8,611 | null | null | mit | null | null | null | null | null | null | null | GUI-Critic-R1/statistic.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:51.940734 | from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score, confusion_matrix
from tqdm import tqdm
from dashscope import Generation
from time import sleep
from concurrent.futures import ThreadPoolExecutor
API = 'sk-04507fb92f4249c480095126bc662828'
USER_PROMPT = '''The following two sentences... |
X-PLUG/MobileAgent | https://github.com/X-PLUG/MobileAgent | null | null | null | null | 8,611 | null | null | mit | null | null | null | null | null | null | null | Mobile-Agent-E/MobileAgentE/icon_localization.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:51.947428 | from MobileAgentE.crop import calculate_size, calculate_iou
from PIL import Image
import torch
def remove_boxes(boxes_filt, size, iou_threshold=0.5):
boxes_to_remove = set()
for i in range(len(boxes_filt)):
if calculate_size(boxes_filt[i]) > 0.05*size[0]*size[1]:
boxes_to_remove.add(i)
... |
X-PLUG/MobileAgent | https://github.com/X-PLUG/MobileAgent | null | null | null | null | 8,611 | null | null | mit | null | null | null | null | null | null | null | Mobile-Agent-E/MobileAgentE/text_localization.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:51.949541 | import cv2
import numpy as np
from MobileAgentE.crop import crop_image
def order_point(coor):
arr = np.array(coor).reshape([4, 2])
sum_ = np.sum(arr, 0)
centroid = sum_ / arr.shape[0]
theta = np.arctan2(arr[:, 1] - centroid[1], arr[:, 0] - centroid[0])
sort_points = arr[np.argsort(theta)]
sort... |
X-PLUG/MobileAgent | https://github.com/X-PLUG/MobileAgent | null | null | null | null | 8,611 | null | null | mit | null | null | null | null | null | null | null | Mobile-Agent-E/inference_agent_E.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:51.958097 | import os
import time
import copy
import torch
import shutil
from PIL import Image, ImageDraw
from time import sleep
from MobileAgentE.api import inference_chat
from MobileAgentE.text_localization import ocr
from MobileAgentE.icon_localization import det
from MobileAgentE.controller import get_screenshot, start_record... |
X-PLUG/MobileAgent | https://github.com/X-PLUG/MobileAgent | null | null | null | null | 8,611 | null | null | mit | null | null | null | null | null | null | null | Mobile-Agent-E/MobileAgentE/chat.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:51.966287 | import copy
from MobileAgentE.api import encode_image
def init_action_chat():
operation_history = []
sysetm_prompt = "You are a helpful AI mobile phone operating assistant. You need to help me operate the phone to complete the user\'s instruction."
operation_history.append(["system", [{"type": "text", "te... |
X-PLUG/MobileAgent | https://github.com/X-PLUG/MobileAgent | null | null | null | null | 8,611 | null | null | mit | null | null | null | null | null | null | null | Mobile-Agent-E/MobileAgentE/agents.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:51.967491 | from dataclasses import dataclass, field
from abc import ABC, abstractmethod
from dataclasses import dataclass, field
from MobileAgentE.api import encode_image
from MobileAgentE.controller import tap, swipe, type, back, home, switch_app, enter, save_screenshot_to_file
from MobileAgentE.text_localization import ocr
imp... |
X-PLUG/MobileAgent | https://github.com/X-PLUG/MobileAgent | null | null | null | null | 8,611 | null | null | mit | null | null | null | null | null | null | null | Mobile-Agent-E/MobileAgentE/controller.py | null | null | null | null | null | null | Python | 2026-05-04T02:08:51.991376 | import os
import time
import subprocess
from PIL import Image
from time import sleep
def get_screenshot(adb_path):
command = adb_path + " shell rm /sdcard/screenshot.png"
subprocess.run(command, capture_output=True, text=True, shell=True)
time.sleep(0.5)
command = adb_path + " shell screencap -p /sdcar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.