repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/picture/migrations/__init__.py
fluent_contents/plugins/picture/migrations/__init__.py
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/oembeditem/appsettings.py
fluent_contents/plugins/oembeditem/appsettings.py
from django.conf import settings # Define the source for the OEmbed provider list. # By default, use a fixed set of providers, to avoid random other HTML content in the web site. FLUENT_OEMBED_SOURCE = getattr( settings, "FLUENT_OEMBED_SOURCE", "basic" ) # basic, embedly, noembed, list # Allow to extend any sour...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/oembeditem/models.py
fluent_contents/plugins/oembeditem/models.py
from django.core.exceptions import ValidationError from django.db import models from django.utils.translation import gettext_lazy as _ from micawber import ProviderException from fluent_contents.models import ContentItemManager from fluent_contents.models.db import ContentItem from fluent_contents.plugins.oembeditem i...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/oembeditem/fields.py
fluent_contents/plugins/oembeditem/fields.py
from django.core.exceptions import ValidationError from django.db.models import URLField from django.utils.translation import gettext_lazy as _ from fluent_contents.plugins.oembeditem import backend class OEmbedUrlField(URLField): """ URL Field which validates whether the URL is supported by the OEmbed provi...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/oembeditem/__init__.py
fluent_contents/plugins/oembeditem/__init__.py
VERSION = (0, 1, 0) # Do some version checking try: import micawber except ImportError: raise ImportError("The 'micawber' package is required to use the 'oembeditem' plugin.")
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/oembeditem/content_plugins.py
fluent_contents/plugins/oembeditem/content_plugins.py
""" Definition of the plugin. """ import re from fluent_contents.extensions import ContentPlugin, plugin_pool from fluent_contents.plugins.oembeditem.models import OEmbedItem re_safe = re.compile(r"[^\w_-]") @plugin_pool.register class OEmbedPlugin(ContentPlugin): model = OEmbedItem category = ContentPlugin...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/oembeditem/backend.py
fluent_contents/plugins/oembeditem/backend.py
""" Backend for fetching OEmbed data. This module can also be used by other external apps. """ import threading from django.core.exceptions import ImproperlyConfigured from micawber import Provider, ProviderRegistry, bootstrap_basic, bootstrap_embedly from micawber.providers import bootstrap_noembed # Export was mis...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/oembeditem/management/__init__.py
fluent_contents/plugins/oembeditem/management/__init__.py
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/oembeditem/management/commands/debug_oembed.py
fluent_contents/plugins/oembeditem/management/commands/debug_oembed.py
from pprint import pformat from django.core.management.base import BaseCommand, CommandError from micawber.exceptions import ProviderException, ProviderNotFoundException from fluent_contents.plugins.oembeditem.backend import get_oembed_data class Command(BaseCommand): args = "<url>" help = "Display the OEmb...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/oembeditem/management/commands/__init__.py
fluent_contents/plugins/oembeditem/management/commands/__init__.py
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/oembeditem/migrations/0001_initial.py
fluent_contents/plugins/oembeditem/migrations/0001_initial.py
from django.db import migrations, models import fluent_contents.plugins.oembeditem.fields class Migration(migrations.Migration): dependencies = [("fluent_contents", "0001_initial")] operations = [ migrations.CreateModel( name="OEmbedItem", fields=[ ( ...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/oembeditem/migrations/__init__.py
fluent_contents/plugins/oembeditem/migrations/__init__.py
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/markup/appsettings.py
fluent_contents/plugins/markup/appsettings.py
""" Settings for the markup item. """ from django.conf import settings from django.core.exceptions import ImproperlyConfigured _SUPPORTED_LANGUAGES = ("restructuredtext", "markdown", "textile") FLUENT_MARKUP_LANGUAGES = getattr( settings, "FLUENT_MARKUP_LANGUAGES", ["restructuredtext", "markdown", "textile"] ) FL...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/markup/models.py
fluent_contents/plugins/markup/models.py
from django.core.exceptions import ValidationError from django.db import models from django.utils.text import Truncator from django.utils.translation import gettext_lazy as _ from fluent_contents.forms import ContentItemForm from fluent_contents.models import ContentItem, ContentItemManager from fluent_contents.plugin...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/markup/__init__.py
fluent_contents/plugins/markup/__init__.py
VERSION = (0, 1, 0)
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/markup/content_plugins.py
fluent_contents/plugins/markup/content_plugins.py
""" Markup plugin, rendering human readable formatted text to HTML. This plugin supports several markup languages: reStructuredText: Used for Python documentation. Markdown: Used for GitHub and Stackoverflow comments (both have a dialect/extended version) Textile: A extensive markup format, also used in Redmine...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/markup/tests.py
fluent_contents/plugins/markup/tests.py
from django.test import TestCase from django.utils.encoding import force_str from fluent_contents.plugins.markup.models import LANGUAGE_MODEL_CLASSES from fluent_contents.tests.factories import create_content_item from fluent_contents.tests.utils import render_content_items class MarkupPluginTests(TestCase): """...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/markup/backend.py
fluent_contents/plugins/markup/backend.py
""" The rendering support of the markup plugin. This uses the backends from the actual text processing libraries. """ from django.core.exceptions import ImproperlyConfigured from django.utils.safestring import mark_safe from fluent_contents.plugins.markup import appsettings def render_restructuredtext(text): f...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/markup/migrations/0001_initial.py
fluent_contents/plugins/markup/migrations/0001_initial.py
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("fluent_contents", "0001_initial")] operations = [ migrations.CreateModel( name="MarkupItem", fields=[ ( "contentitem_ptr", ...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/markup/migrations/0002_fix_polymorphic_ctype.py
fluent_contents/plugins/markup/migrations/0002_fix_polymorphic_ctype.py
import sys from django.db import migrations, models def _forwards(apps, schema_editor): """ Make sure that the MarkupItem model actually points to the correct proxy model, that implements the given language. """ # Need to work on the actual models here. from django.contrib.contenttypes.models...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/plugins/markup/migrations/__init__.py
fluent_contents/plugins/markup/migrations/__init__.py
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/migrations/0001_initial.py
fluent_contents/migrations/0001_initial.py
import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("contenttypes", "0001_initial")] operations = [ migrations.CreateModel( name="ContentItem", fields=[ ( "id", ...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/migrations/__init__.py
fluent_contents/migrations/__init__.py
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/conf/plugin_template/models.py
fluent_contents/conf/plugin_template/models.py
from django.db import models from django.utils.translation import gettext_lazy as _ from fluent_contents.models import ContentItem class {{ model }}(ContentItem): """ CMS plugin data model to ... """ title = models.CharField(_("Title"), max_length=200) class Meta: verbose_name = _("{{ mo...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/conf/plugin_template/__init__.py
fluent_contents/conf/plugin_template/__init__.py
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/conf/plugin_template/content_plugins.py
fluent_contents/conf/plugin_template/content_plugins.py
from fluent_contents.extensions import ContentPlugin, plugin_pool from .models import {{ model }} @plugin_pool.register class {{ plugin }}(ContentPlugin): """ CMS plugin for ... """ model = {{ model }} #category = ContentPlugin.ADVANCED render_template = "includes/fluentcms_plugins/{{ app_nam...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/conf/plugin_template/tests.py
fluent_contents/conf/plugin_template/tests.py
from django.test import TestCase from fluent_contents.tests.factories import create_content_item from fluent_contents.tests.utils import render_content_items from .models import {{ model }} class Test{{ plugin }}(TestCase): """ Testing the CMS plugin. """ def test_rendering(self): """ ...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/fluent_contents/conf/plugin_template/migrations/__init__.py
fluent_contents/conf/plugin_template/migrations/__init__.py
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/conf.py
docs/conf.py
# # django-fluent-contents documentation build configuration file, created by # sphinx-quickstart on Wed Dec 21 15:06:42 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configur...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/_ext/djangodummy/settings.py
docs/_ext/djangodummy/settings.py
# Settings file to allow parsing API documentation of Django modules, # and provide defaults to use in the documentation. # # This file is placed in a subdirectory, # so the docs root won't be detected by find_packages() import os # Display sane URLs in the docs: STATIC_URL = "/static/" # Required by Django SECRET_KE...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/docs/_ext/djangodummy/__init__.py
docs/_ext/djangodummy/__init__.py
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/example/manage.py
example/manage.py
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/example/settings.py
example/settings.py
# Add parent path, # Allow starting the app without installing the module. import sys from os.path import dirname, join, realpath import django sys.path.insert(0, dirname(dirname(realpath(__file__)))) DEBUG = True ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { "def...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/example/__init__.py
example/__init__.py
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/example/urls.py
example/urls.py
from django.contrib import admin from django.urls import include, path admin.autodiscover() urlpatterns = [ path("admin/doc/", include("django.contrib.admindocs.urls")), path("admin/apps/tinymce/", include("tinymce.urls")), path("admin/", admin.site.urls), # url(r'^forms/', include('form_designer.urls...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/example/article/views.py
example/article/views.py
from article.models import Article from django.views.generic.detail import DetailView class ArticleDetailView(DetailView): model = Article template_name = "article/details.html"
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/example/article/admin.py
example/article/admin.py
from article.models import Article, ArticleTextItem from django.contrib import admin from fluent_contents.admin import PlaceholderFieldAdmin @admin.register(Article) class ArticleAdmin(PlaceholderFieldAdmin): prepopulated_fields = {"slug": ("title",)} fieldsets = ( (None, {"fields": ("title", "slug"...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/example/article/models.py
example/article/models.py
from django.db import models from django.urls import reverse from fluent_contents.models import ContentItem, ContentItemManager from fluent_contents.models.fields import ( ContentItemRelation, PlaceholderField, PlaceholderRelation, ) class Article(models.Model): title = models.CharField("Title", max_...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/example/article/__init__.py
example/article/__init__.py
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/example/article/content_plugins.py
example/article/content_plugins.py
from article.models import ArticleTextItem from fluent_contents.extensions import ContentPlugin, plugin_pool class ArticleTextPlugin(ContentPlugin): name = "Text item" category = "Content plugins" model = ArticleTextItem render_template = "article/plugins/text.html" plugin_pool.register(ArticleText...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/example/article/urls.py
example/article/urls.py
from article.views import ArticleDetailView from django.urls import path urlpatterns = [ path("<str:slug>/", ArticleDetailView.as_view(), name="article-details"), ]
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/example/article/migrations/0001_initial.py
example/article/migrations/0001_initial.py
# Generated by Django 1.9 on 2015-12-29 18:13 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [("fluent_contents", "0001_initial")] operations = [ migrations.CreateModel( name="Article", ...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/example/article/migrations/__init__.py
example/article/migrations/__init__.py
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/example/theme1/__init__.py
example/theme1/__init__.py
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/example/simplecms/views.py
example/simplecms/views.py
from django.http import Http404 from django.shortcuts import render from django.template.context import RequestContext from simplecms.models import Page def page_detail(request, path): stripped = path.strip("/") if path else "" stripped = stripped and "/%s/" % stripped or "/" try: page = Page.obj...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/example/simplecms/admin.py
example/simplecms/admin.py
import json from django.contrib import admin from django.http import HttpResponse from django.template.loader import get_template from django.urls import path from django.utils.safestring import mark_safe from mptt.admin import MPTTModelAdmin from simplecms import appconfig from simplecms.models import Page from flue...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/example/simplecms/models.py
example/simplecms/models.py
from django.db import models, transaction from django.urls import reverse from mptt.models import MPTTModel from simplecms import appconfig from fluent_contents.models import ContentItemRelation, PlaceholderRelation class Page(MPTTModel): title = models.CharField("Title", max_length=200) # The basic fields ...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/example/simplecms/appconfig.py
example/simplecms/appconfig.py
from django.conf import settings from django.core.exceptions import ImproperlyConfigured SIMPLECMS_TEMPLATE_CHOICES = getattr(settings, "SIMPLECMS_TEMPLATE_CHOICES", ()) SIMPLECMS_DEFAULT_TEMPLATE = getattr( settings, "SIMPLECMS_DEFAULT_TEMPLATE", SIMPLECMS_TEMPLATE_CHOICES[0][0] if SIMPLECMS_TEMPLATE_CHOI...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/example/simplecms/__init__.py
example/simplecms/__init__.py
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/example/simplecms/urls.py
example/simplecms/urls.py
from django.conf.urls import * from . import views urlpatterns = [url(r"^$|^(?P<path>.*/)$", views.page_detail, name="simplecms-page")]
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/example/simplecms/test/__init__.py
example/simplecms/test/__init__.py
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/example/simplecms/migrations/0001_initial.py
example/simplecms/migrations/0001_initial.py
# Generated by Django 1.9 on 2015-12-29 18:13 import django.db.models.deletion import django.db.models.manager from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name="Page", ...
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
django-fluent/django-fluent-contents
https://github.com/django-fluent/django-fluent-contents/blob/7ff95b879b2662a52f456eaabff7d5ed623b1741/example/simplecms/migrations/__init__.py
example/simplecms/migrations/__init__.py
python
Apache-2.0
7ff95b879b2662a52f456eaabff7d5ed623b1741
2026-01-05T07:09:32.719958Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/migration/keeper/migrate_from_json.py
migration/keeper/migrate_from_json.py
#!/usr/bin/env python3 """ Keeper→1Password migration helper Given a Keeper-style JSON export (with top-level keys like `shared_folders` and `records`), create 1Password vaults and items using the 1Password CLI (`op`). What it does ------------ 1. Creates a vault for each **shared_folder** and grants users/groups ...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/item-management/bulk-update-url-field-by-vault.py
1password/item-management/bulk-update-url-field-by-vault.py
import subprocess import json import csv import threading import concurrent.futures import sys import itertools import time from datetime import datetime import os from typing import List, Dict, Optional import queue from tqdm import tqdm # Script to update website fields for all items in a 1Password vault. # Allows s...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/item-management/bulk-update-by-csv/csv_update.py
1password/item-management/bulk-update-by-csv/csv_update.py
#!/usr/bin/env python3 import csv import json import subprocess import sys import os def run_op_command(command_args): """ Runs an 'op' command and returns its stdout. Raises subprocess.CalledProcessError on failure. """ try: # Ensure OP_CONNECT_HOST and OP_CONNECT_TOKEN are not set if us...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/reporting/user-access-list.py
1password/reporting/user-access-list.py
import os import subprocess import csv import json scriptPath = os.path.dirname(__file__) outputPath = scriptPath class User: def __init__( self, name, email, uuid, state, type, createdAt, updatedAt, lastAuthAt, groups, vaults ): self.name = name self.email = email self.uuid =...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/reporting/vault-user-group-access-report.py
1password/reporting/vault-user-group-access-report.py
# A script that provides a list of users who have access to each vault in # a 1Password account, and whether that assignment is a direct assignment or # granted by group membership, and their vault permissions # # This script must be run by a member of the Owners group of a 1Password Business account import os import s...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/reporting/vault-user-access-report.py
1password/reporting/vault-user-access-report.py
# A script that provides a list of users and their permissions for each vault import os import subprocess import csv import json import argparse import sys parser = argparse.ArgumentParser( "User and Permissions Report Generator", "Generates a csv-like report of each user and their permissions for each vault p...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/reporting/user-and-item-list.py
1password/reporting/user-and-item-list.py
# A script that provides a list of users and the names of every item contained in a list of vaultUUIDs import os import sys import subprocess import csv import json import argparse parser = argparse.ArgumentParser( "User and Items Report Generator", "Generates a csv-like report listing all item names and UUIDs...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/account-management/remove-permissions-groups-and-vault.py
1password/account-management/remove-permissions-groups-and-vault.py
import subprocess import csv import threading import sys import os import queue import time import json from datetime import datetime from typing import List, Tuple, Dict from tqdm import tqdm # Colors for console output CYAN = "\033[96m" YELLOW = "\033[93m" RED = "\033[91m" GREEN = "\033[92m" RESET = "\033[0m" # Val...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/account-management/create_vaults_from_input.py
1password/account-management/create_vaults_from_input.py
#!/usr/bin/python3 import argparse import csv import json import subprocess import sys import time parser = argparse.ArgumentParser( "Create a 1Password vault for each name in a list of vault names provided as a plaintext file using the --file flag.", "By default, you will have full permissions on each vault c...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/user-management/identify-absentees.py
1password/user-management/identify-absentees.py
import subprocess import json import csv import re import os from datetime import datetime from typing import List, Dict, Optional, Any from concurrent.futures import ThreadPoolExecutor # Try to import tqdm for a nice progress bar, but it’s optional try: import tqdm TQDM_AVAILABLE = True except ImportError: ...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/migration/cleanup-scripts/vault_dedupe_helper.py
1password/migration/cleanup-scripts/vault_dedupe_helper.py
### # A script that will produce a csv-like report to assist with de-duplication. # Outputs vaultName, vaultUUID, itemCount, vault creation date, vault updated, number of users ### import os import subprocess import csv import json from datetime import datetime import sys scriptPath = os.path.dirname(__file__) outputP...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/migration/cleanup-scripts/add_vault_prefix.py
1password/migration/cleanup-scripts/add_vault_prefix.py
import subprocess import argparse import json import sys parser = argparse.ArgumentParser("Vault Prefixer", "Provide a path to a list of vault UUIDs.", "Prefixes all vaults passed to the script from the specified file with '!'.") parser.add_argument("--file", action="store", dest="filepath", help="Required. Specify th...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/migration/cleanup-scripts/remove_imported_prefix.py
1password/migration/cleanup-scripts/remove_imported_prefix.py
import subprocess import json import sys # Check CLI version def checkCLIVersion(): r = subprocess.run(["op", "--version", "--format=json"], capture_output=True) major, minor = r.stdout.decode("utf-8").rstrip().split(".", 2)[:2] if not major == 2 and not int(minor) >= 25: sys.exit( "❌ ...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/migration/cleanup-scripts/move_items_to_tracked_vault.py
1password/migration/cleanup-scripts/move_items_to_tracked_vault.py
#!/usr/bin/python3 import json import os import subprocess import sys scriptPath = os.path.dirname(__file__) outputPath = scriptPath # Optionally choose an alternative output path here. class Vault: def __init__(self, name, uuid, itemCount, created, updated): self.name = name self.uuid = uuid ...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/migration/cleanup-scripts/recreate_metadata_entry.py
1password/migration/cleanup-scripts/recreate_metadata_entry.py
#!/usr/bin/python3 import os import subprocess import csv import json from collections import defaultdict from datetime import datetime scriptPath = os.path.dirname(__file__) outputPath = scriptPath # Optionally choose an alternative output path here. class Vault: def __init__(self, csvRow): self.name =...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/migration/lastpass/template_generator.py
1password/migration/lastpass/template_generator.py
import logging import subprocess import json from dataclasses import dataclass import utils @dataclass class LPassData: url: str username: str password: str otp_secret: str notes: str title: str vault: str class TemplateGenerator: __AVAILABLE_TEMPLATE_TYPES = ["Login", "Secure Note"...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/migration/lastpass/folder_migrate.py
1password/migration/lastpass/folder_migrate.py
#!/usr/bin/env python3 # This script will create 1Password vaults from each unique value # in the `grouping` column of a LastPass export generated through their # web-based exported or the lpass CLI (this has not # been tested on exports from their browser extension or other methods). # Shared/Nested folders in 1Passw...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/migration/lastpass/vault_item_import.py
1password/migration/lastpass/vault_item_import.py
#!/usr/bin/env python3 # This script will create vaults and login items from a LastPass export # generated through their web-based exported or the lpass CLI (this has not # been tested on exports from their browser extension or other methods). # Shared/Nested folders in 1Password will have separate, non-nested # vault...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/migration/lastpass/lpass.py
1password/migration/lastpass/lpass.py
#!/usr/bin/env python3 import subprocess import sys def get_lp_data(): # Sign user into LastPass lp_username = input("You may be prompted once for your LastPass username and twice for your Master Password.\nThe first prompt signs you into the LastPass CLI, the second prompt approves the export.\nWe don't stor...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/migration/lastpass/main.py
1password/migration/lastpass/main.py
#!/usr/bin/env python3 import getopt import sys import io import lpass from folder_migrate import migrate_folders from vault_item_import import migrate_items def main(argv): options = { 'ignore-shared': False, 'dry-run': False, } csvfile = None is_migrating_folders = False is_migra...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/migration/lastpass/utils.py
1password/migration/lastpass/utils.py
import re import calendar def normalize_vault_name(vault_name: str) -> str: return re.sub(r'[^a-zA-Z0-9\s-]', "_", vault_name) def lpass_date_to_1password_format(lpass_date: str) -> str: if not lpass_date: return "" [month, year] = lpass_date.split(",") monthNumber = list(calendar.month_abbr...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/migration/lastpass/template_generator_test.py
1password/migration/lastpass/template_generator_test.py
from template_generator import LPassData, TemplateGenerator def test_template_generator_credit_card(): lpass_data = LPassData( url="http://sn", username="", password="", otp_secret="", notes="NoteType:Credit Card\nLanguage:en-GB\nName on Card:Test User\nType:card type\nNumb...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/migration/lastpass/utils_test.py
1password/migration/lastpass/utils_test.py
# A debug script people simply migrating from LastPass to 1Password # can disregard as it is not used in the process migrating. import utils def test_normalize_vault_name(): assert utils.normalize_vault_name("dev\sub_dev\\nested folder") == "dev_sub_dev_nested folder" assert utils.normalize_vault_name("dev/s...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/onepassword_sdks/demo-reverse-sharing/app.py
1password/onepassword_sdks/demo-reverse-sharing/app.py
import os import asyncio from flask import Flask, request, render_template, flash, redirect, url_for, session from dotenv import load_dotenv # Import 1Password SDK components from onepassword import * from dotenv import load_dotenv load_dotenv(".env") app = Flask(__name__) # --- Configuration from Environment Vari...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/onepassword_sdks/demo-share-okta-user-script/create-okta-user.py
1password/onepassword_sdks/demo-share-okta-user-script/create-okta-user.py
import os from okta.client import Client as OktaClient from okta.models import User, UserProfile, UserCredentials import asyncio from onepassword import * import pyperclip from dotenv import load_dotenv load_dotenv() def validate_email(email): """ Simple email validation """ import re email_rege...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/onepassword_sdks/demo-share-script/sdk_share_script.py
1password/onepassword_sdks/demo-share-script/sdk_share_script.py
#!/usr/bin/env python3 """ This script: 1. Reads a README.md file from a specified folder 2. Creates a note in 1Password with the README content 3. Adds a specified file from the same folder as an attachment 4. Creates a share link for the note Uses the official 1Password Python SDK (onepassword). """ import asyncio ...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/scripted-provisioning/provisioning.py
1password/scripted-provisioning/provisioning.py
import subprocess import csv import re import os import sys import threading import time from datetime import datetime from queue import Queue from typing import List, Dict, Optional, Any, Tuple # ANSI color codes for colorful terminal output CYAN: str = "\033[96m" YELLOW: str = "\033[93m" RED: str = "\033[91m" GREEN:...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
true
1Password/solutions
https://github.com/1Password/solutions/blob/e1e9e4a57961ce939fa7aa34f522728fa35e377e/1password/connect/reverse-sharing/app.py
1password/connect/reverse-sharing/app.py
import os import requests from flask import Flask, request, render_template, flash, session, redirect, url_for app = Flask(__name__) # --- Configuration from Environment Variables --- # REQUIRED: Secret key for session management. app.config["SECRET_KEY"] = os.environ.get( "FLASK_SECRET_KEY", "dev-secret-key-repl...
python
MIT
e1e9e4a57961ce939fa7aa34f522728fa35e377e
2026-01-05T07:09:31.784390Z
false
salesforce/cos-e
https://github.com/salesforce/cos-e/blob/e4bf8b6724dd8c6cbb13585383373e9734b1866f/code/parse-commonsenseQA.py
code/parse-commonsenseQA.py
import jsonlines import sys import csv expl = {} with open(sys.argv[2], 'rb') as f: for item in jsonlines.Reader(f): expl[item['id']] = item['explanation']['open-ended'] with open(sys.argv[1], 'rb') as f: with open(sys.argv[3],'w') as wf: wfw = csv.writer(wf,delimiter=',',quotechar='"') ...
python
BSD-3-Clause
e4bf8b6724dd8c6cbb13585383373e9734b1866f
2026-01-05T07:09:35.803459Z
false
salesforce/cos-e
https://github.com/salesforce/cos-e/blob/e4bf8b6724dd8c6cbb13585383373e9734b1866f/code/classification/run_commonsenseQA_expl_v1.1.py
code/classification/run_commonsenseQA_expl_v1.1.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
python
BSD-3-Clause
e4bf8b6724dd8c6cbb13585383373e9734b1866f
2026-01-05T07:09:35.803459Z
false
salesforce/cos-e
https://github.com/salesforce/cos-e/blob/e4bf8b6724dd8c6cbb13585383373e9734b1866f/code/classification/run_commonsenseQA_expl_v1.0.py
code/classification/run_commonsenseQA_expl_v1.0.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy...
python
BSD-3-Clause
e4bf8b6724dd8c6cbb13585383373e9734b1866f
2026-01-05T07:09:35.803459Z
false
salesforce/cos-e
https://github.com/salesforce/cos-e/blob/e4bf8b6724dd8c6cbb13585383373e9734b1866f/code/generation/train_commonsenseqa_v1.1.py
code/generation/train_commonsenseqa_v1.1.py
#!/usr/bin/env python3 import math import os from sacrebleu import corpus_bleu import csv import argparse import logging from tqdm import trange, tqdm import json import torch import torch.nn.functional as F import numpy as np from torch.utils.data import (DataLoader, RandomSampler, SequentialSampler, ...
python
BSD-3-Clause
e4bf8b6724dd8c6cbb13585383373e9734b1866f
2026-01-05T07:09:35.803459Z
false
salesforce/cos-e
https://github.com/salesforce/cos-e/blob/e4bf8b6724dd8c6cbb13585383373e9734b1866f/code/generation/train_commonsenseqa_v1.0.py
code/generation/train_commonsenseqa_v1.0.py
#!/usr/bin/env python3 import math import os from sacrebleu import corpus_bleu import csv import argparse import logging from tqdm import trange, tqdm import json import torch import torch.nn.functional as F import numpy as np from torch.utils.data import (DataLoader, RandomSampler, SequentialSampler, ...
python
BSD-3-Clause
e4bf8b6724dd8c6cbb13585383373e9734b1866f
2026-01-05T07:09:35.803459Z
false
networkop/docker-topo
https://github.com/networkop/docker-topo/blob/ac69c69b983eb1a9d785a393ce57098d2e304b6a/setup.py
setup.py
from setuptools import setup import os import sys EXTRA_FILES = "topo-extra-files" def collect_files(): return [ (d, [os.path.join(d, f) for f in files]) for d, folders, files in os.walk(EXTRA_FILES) ] setup( name="docker-topo", version="2.0.3", scripts=["bin/docker-topo"], ...
python
BSD-3-Clause
ac69c69b983eb1a9d785a393ce57098d2e304b6a
2026-01-05T07:09:37.064134Z
false
bcwaldon/warlock
https://github.com/bcwaldon/warlock/blob/058925a819c34769669c6b174a3d752111d9f1c2/tests/test_core.py
tests/test_core.py
# Copyright 2012 Brian Waldon # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
python
Apache-2.0
058925a819c34769669c6b174a3d752111d9f1c2
2026-01-05T07:09:39.132789Z
false
bcwaldon/warlock
https://github.com/bcwaldon/warlock/blob/058925a819c34769669c6b174a3d752111d9f1c2/tests/__init__.py
tests/__init__.py
python
Apache-2.0
058925a819c34769669c6b174a3d752111d9f1c2
2026-01-05T07:09:39.132789Z
false
bcwaldon/warlock
https://github.com/bcwaldon/warlock/blob/058925a819c34769669c6b174a3d752111d9f1c2/warlock/model.py
warlock/model.py
# Copyright 2012 Brian Waldon # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
python
Apache-2.0
058925a819c34769669c6b174a3d752111d9f1c2
2026-01-05T07:09:39.132789Z
false
bcwaldon/warlock
https://github.com/bcwaldon/warlock/blob/058925a819c34769669c6b174a3d752111d9f1c2/warlock/exceptions.py
warlock/exceptions.py
# Copyright 2012 Brian Waldon # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
python
Apache-2.0
058925a819c34769669c6b174a3d752111d9f1c2
2026-01-05T07:09:39.132789Z
false
bcwaldon/warlock
https://github.com/bcwaldon/warlock/blob/058925a819c34769669c6b174a3d752111d9f1c2/warlock/core.py
warlock/core.py
# Copyright 2012 Brian Waldon # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
python
Apache-2.0
058925a819c34769669c6b174a3d752111d9f1c2
2026-01-05T07:09:39.132789Z
false
bcwaldon/warlock
https://github.com/bcwaldon/warlock/blob/058925a819c34769669c6b174a3d752111d9f1c2/warlock/__init__.py
warlock/__init__.py
# Copyright 2012 Brian Waldon # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
python
Apache-2.0
058925a819c34769669c6b174a3d752111d9f1c2
2026-01-05T07:09:39.132789Z
false
maxhumber/hickory
https://github.com/maxhumber/hickory/blob/637ff813685e74f89afa11c5b3b17453f464c0c3/setup.py
setup.py
from setuptools import find_packages, setup with open("README.md", "r", encoding="utf-8") as f: long_description = f.read() setup( name="hickory", version="1.0.0", description="The command line tool for scheduling Python scripts", long_description=long_description, long_description_content_typ...
python
MIT
637ff813685e74f89afa11c5b3b17453f464c0c3
2026-01-05T07:09:39.614467Z
false
maxhumber/hickory
https://github.com/maxhumber/hickory/blob/637ff813685e74f89afa11c5b3b17453f464c0c3/tests/generic/test_utils.py
tests/generic/test_utils.py
import pytest from hickory.utils import * def test_run(): assert run("echo hi") == "hi" def test_strip_number(): strings = ["1", "1l", "l"] assert [strip_number(s) for s in strings] == [1, 1, None] def test_contains_number(): strings = ["1", "1l", "l"] assert [contains_number(s) for s in stri...
python
MIT
637ff813685e74f89afa11c5b3b17453f464c0c3
2026-01-05T07:09:39.614467Z
false
maxhumber/hickory
https://github.com/maxhumber/hickory/blob/637ff813685e74f89afa11c5b3b17453f464c0c3/tests/generic/test_colors.py
tests/generic/test_colors.py
import pytest from hickory.colors import * def test_color_str(): assert str(Color(93)) == '\033[93m' assert str(Color(93, 94)) == '\033[93;94m' def test_color_format(): assert f'{Color(93)}' == '\033[93m' assert f'{Color(93)}bb' == '\033[93mbb' def test_color_matmul(): assert Color(93) @ 'all...
python
MIT
637ff813685e74f89afa11c5b3b17453f464c0c3
2026-01-05T07:09:39.614467Z
false
maxhumber/hickory
https://github.com/maxhumber/hickory/blob/637ff813685e74f89afa11c5b3b17453f464c0c3/tests/generic/test_format_status.py
tests/generic/test_format_status.py
import pytest from hickory.format_status import format_status def test_format_status(): info_dicts = [ { "id": "0f98e6", "file": "foo.py", "runs": "396", "state": "waiting", "interval": 5, } ] string = "ID FILE STATE R...
python
MIT
637ff813685e74f89afa11c5b3b17453f464c0c3
2026-01-05T07:09:39.614467Z
false
maxhumber/hickory
https://github.com/maxhumber/hickory/blob/637ff813685e74f89afa11c5b3b17453f464c0c3/tests/macOS/test_launchd.py
tests/macOS/test_launchd.py
import sys from pathlib import Path from hickory.launchd import _build_dict def test__build_dict(): script = "foo.py" label = f"hickory.000000.{script}" working_directory = str(Path.cwd()) which_python = sys.executable interval = "@10:00pm" ldd = _build_dict(label, working_directory, which_py...
python
MIT
637ff813685e74f89afa11c5b3b17453f464c0c3
2026-01-05T07:09:39.614467Z
false
maxhumber/hickory
https://github.com/maxhumber/hickory/blob/637ff813685e74f89afa11c5b3b17453f464c0c3/tests/macOS/test_cli.py
tests/macOS/test_cli.py
import os import subprocess import sys import time from pathlib import Path import pytest os.chdir("tests") def setup(): foo = """import datetime import time stamp = datetime.datetime.now().strftime("%H:%M:%S") time.sleep(5) print(f"Foo - {stamp} + 5 seconds")""" with open("foo.py", "w") as f: f.w...
python
MIT
637ff813685e74f89afa11c5b3b17453f464c0c3
2026-01-05T07:09:39.614467Z
false
maxhumber/hickory
https://github.com/maxhumber/hickory/blob/637ff813685e74f89afa11c5b3b17453f464c0c3/tests/macOS/test_every_launchd.py
tests/macOS/test_every_launchd.py
import pytest from hickory.every_launchd import * def test_seconds_interval_to_seconds(): intervals = ["10", "10s", "10sec", "10secs", "10seconds"] seconds = [interval_to_seconds(i) for i in intervals] assert all([s == 10 for s in seconds]) def test_minutes_interval_to_seconds(): intervals = ["30m"...
python
MIT
637ff813685e74f89afa11c5b3b17453f464c0c3
2026-01-05T07:09:39.614467Z
false