repo_name stringlengths 7 65 | path stringlengths 5 185 | copies stringlengths 1 4 | size stringlengths 4 6 | content stringlengths 977 990k | license stringclasses 14
values | hash stringlengths 32 32 | line_mean float64 7.18 99.4 | line_max int64 31 999 | alpha_frac float64 0.25 0.95 | ratio float64 1.5 7.84 | autogenerated bool 1
class | config_or_test bool 2
classes | has_no_keywords bool 2
classes | has_few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
colour-science/colour | colour/appearance/rlab.py | 1 | 9285 | """
RLAB Colour Appearance Model
============================
Defines the *RLAB* colour appearance model objects:
- :attr:`colour.VIEWING_CONDITIONS_RLAB`
- :attr:`colour.D_FACTOR_RLAB`
- :class:`colour.CAM_Specification_RLAB`
- :func:`colour.XYZ_to_RLAB`
References
----------
- :cite:`Fairchild1996a` : Fa... | bsd-3-clause | 7a34fab1f0d39dd15d39fadb466b79a0 | 29.048544 | 79 | 0.584599 | 3.10639 | false | false | false | false |
colour-science/colour | colour/constants/common.py | 1 | 1823 | """
Common Constants
================
Defines the common constants objects that don't belong to any specific
category.
"""
from __future__ import annotations
import os
import numpy as np
from colour.utilities.documentation import (
DocstringFloat,
is_documentation_building,
)
from colour.hints import DTypeF... | bsd-3-clause | d3c914f9ac84757cd1b5af936933f8a9 | 25.808824 | 78 | 0.687329 | 3.401119 | false | false | false | false |
colour-science/colour | colour/models/rgb/datasets/sharp.py | 1 | 3347 | """
Sharp RGB Colourspace
=====================
Defines the *Sharp RGB* colourspace:
- :attr:`colour.models.RGB_COLOURSPACE_SHARP_RGB`
References
----------
- :cite:`Susstrunk2000` : Susstrunk, S. E., Holm, J. M., & Finlayson, G. D.
(2000). Chromatic adaptation performance of different RGB sensors. In R.
... | bsd-3-clause | a6d7bc7ddfd0d00142f748b3b0780607 | 28.104348 | 78 | 0.657604 | 2.734477 | false | false | true | false |
colour-science/colour | colour/recovery/datasets/smits1999.py | 1 | 3892 | """
Smits (1999) - Reflectance Recovery Dataset
===========================================
Defines the datasets for reflectance recovery using *Smits (1999)* method.
References
----------
- :cite:`Smits1999a` : Smits, B. (1999). An RGB-to-Spectrum Conversion for
Reflectances. Journal of Graphics Tools, 4(4), 1... | bsd-3-clause | 4afbb44a7527a85b35ab732a2a5fc327 | 25.657534 | 78 | 0.554985 | 2.915356 | false | false | false | false |
colour-science/colour | colour/colorimetry/generation.py | 1 | 23391 | """
Spectral Generation
===================
Defines various objects performing spectral generation:
- :func:`colour.sd_constant`
- :func:`colour.sd_zeros`
- :func:`colour.sd_ones`
- :func:`colour.msds_constant`
- :func:`colour.msds_zeros`
- :func:`colour.msds_ones`
- :func:`colour.colorimetry.sd_gaussia... | bsd-3-clause | 63e67f959c144f57de6b5fb1699281ed | 26.167247 | 79 | 0.624599 | 3.770917 | false | false | false | false |
colour-science/colour | colour/adaptation/zhai2018.py | 1 | 6121 | """
Zhai and Luo (2018) Chromatic Adaptation Model
==============================================
Defines the *Zhai and Luo (2018)* chromatic adaptation model object:
- :func:`colour.adaptation.chromatic_adaptation_Zhai2018`
References
----------
- :cite:`Zhai2018` : Zhai, Q., & Luo, M. R. (2018). Study of chrom... | bsd-3-clause | 1e2aed13f55ba2e7dbfcfea127e8e493 | 33.977143 | 79 | 0.540925 | 3.208071 | false | false | false | false |
colour-science/colour | colour/models/din99.py | 1 | 14075 | """
DIN99 Colourspace and DIN99b, DIN99c, DIN99d Refined Formulas
=============================================================
Defines the *DIN99* colourspace and *DIN99b*, *DIN99c*, *DIN99d* refined
formulas transformations:
- :func:`colour.Lab_to_DIN99`
- :func:`colour.DIN99_to_Lab`
- :func:`colour.XYZ_to_DI... | bsd-3-clause | 9e571942794d3857c2d94009435e42ea | 33.329268 | 79 | 0.43254 | 3.177918 | false | false | false | false |
colour-science/colour | colour/difference/cam16_ucs.py | 1 | 2100 | """
:math:`\\Delta E'` - Delta E Colour Difference - Li et al. (2017)
=================================================================
Defines the :math:`\\Delta E'` colour difference computation objects based on
*Li, Li, Wang, Zu, Luo, Cui, Melgosa, Brill and Pointer (2017)* *CAM16-LCD*,
*CAM16-SCD*, and *CAM16-UCS*... | bsd-3-clause | 246d0e644e109197d5452dd1533c1592 | 31.8125 | 78 | 0.66381 | 2.668361 | false | false | true | false |
colour-science/colour | colour/recovery/jiang2013.py | 1 | 15577 | """
Jiang et al. (2013) - Camera RGB Sensitivities Recovery
=======================================================
Defines the objects for camera *RGB* sensitivities recovery using
*Jiang, Liu, Gu and Süsstrunk (2013)* method:
- :func:`colour.recovery.PCA_Jiang2013`
- :func:`colour.recovery.RGB_to_sd_camera_sen... | bsd-3-clause | 61360077ce5453a393bef0486c1fde32 | 36.805825 | 78 | 0.562211 | 3.026229 | false | false | false | false |
colour-science/colour | colour/colorimetry/illuminants.py | 1 | 14081 | """
Illuminants
===========
Defines the *CIE* illuminants computation related objects:
- :func:`colour.sd_CIE_standard_illuminant_A`
- :func:`colour.sd_CIE_illuminant_D_series`
- :func:`colour.daylight_locus_function`
References
----------
- :cite:`CIETC1-482004` : CIE TC 1-48. (2004). EXPLANATORY COMMENTS -... | bsd-3-clause | 7a7918b3ccf0b28009518de388bf9db4 | 38.997159 | 79 | 0.381277 | 3.528571 | false | false | false | false |
colour-science/colour | colour/models/rgb/datasets/__init__.py | 1 | 6661 | from __future__ import annotations
from colour.utilities import LazyCanonicalMapping, usage_warning
from .aces import (
RGB_COLOURSPACE_ACES2065_1,
RGB_COLOURSPACE_ACESCC,
RGB_COLOURSPACE_ACESCCT,
RGB_COLOURSPACE_ACESCG,
RGB_COLOURSPACE_ACESPROXY,
)
from .adobe_rgb_1998 import RGB_COLOURSPACE_ADOBE... | bsd-3-clause | 0c0e94f4c8a4859b6962d89adcc5132c | 33.692708 | 79 | 0.702447 | 2.444404 | false | false | false | false |
colour-science/colour | colour/examples/plotting/examples_section_plots.py | 1 | 3061 | """Showcases gamut section plotting examples."""
import numpy as np
from matplotlib.lines import Line2D
import colour.plotting
from colour.plotting import (
colour_style,
plot_visible_spectrum_section,
plot_RGB_colourspace_section,
)
from colour.utilities import message_box
message_box("Gamut Section Plo... | bsd-3-clause | faf6c143436f68491bdb821ba87e00b3 | 21.181159 | 78 | 0.664815 | 2.99218 | false | false | false | false |
colour-science/colour | colour/io/uprtek_sekonic.py | 1 | 26020 | """
UPRTek and Sekonic Spectral Data
================================
Defines the input and output objects for *UPRTek* and *Sekonic*
*Pseudo-XLS*/*CSV* spectral data files.
- :class:`colour.SpectralDistribution_UPRTek`
- :class:`colour.SpectralDistribution_Sekonic`
"""
from __future__ import annotations
import... | bsd-3-clause | cdba5eed2cd3e9b062ccd7fd3c573fae | 34.353261 | 78 | 0.530323 | 2.945772 | false | false | false | false |
colour-science/colour | colour/geometry/vertices.py | 1 | 19545 | """
Geometry Primitive Vertices
===========================
Defines various geometry primitive vertices generation methods:
- :func:`colour.geometry.primitive_vertices_quad_mpl`
- :func:`colour.geometry.primitive_vertices_grid_mpl`
- :func:`colour.geometry.primitive_vertices_cube_mpl`
- :func:`colour.geometry... | bsd-3-clause | b31f1ea38201106ea5380e352a1f1294 | 29.828076 | 79 | 0.499207 | 3.316647 | false | false | false | false |
colour-science/colour | colour/utilities/common.py | 1 | 33599 | """
Common Utilities
================
Defines the common utilities objects that don't fall in any specific category.
References
----------
- :cite:`DjangoSoftwareFoundation2022` : Django Software Foundation. (2022).
slugify. Retrieved June 1, 2022, from https://github.com/django/django/\
blob/0dd29209091280ccf3... | bsd-3-clause | 898de766929338d70ac8c94a7db402b6 | 22.644616 | 81 | 0.563886 | 4.21886 | false | false | false | false |
colour-science/colour | colour/io/tests/test_tabular.py | 1 | 6599 | # !/usr/bin/env python
"""Define the unit tests for the :mod:`colour.io.tabular` module."""
from __future__ import annotations
import os
import shutil
import unittest
import tempfile
from colour.colorimetry import SpectralDistribution, SpectralShape
from colour.hints import Dict
from colour.io import (
read_spec... | bsd-3-clause | 2752f54c3eeb234a133c720c70de158b | 26.045082 | 79 | 0.57342 | 2.735904 | false | true | false | false |
colour-science/colour | colour/characterisation/datasets/filters/sds.py | 1 | 2345 | """
Spectral Distributions of Filters
=================================
Defines the spectral distributions of filters.
Each filter data is in the form of :class:`dict` class instance of
:class:`colour.SpectralDistribution` classes as follows::
{'name': SpectralDistribution, ..., 'name': SpectralDistribution}
Th... | bsd-3-clause | ceb5a28a8815ff9bbabc84c8f0184be0 | 23.427083 | 79 | 0.632836 | 3.398551 | false | false | false | false |
colour-science/colour | colour/examples/colorimetry/examples_whiteness.py | 1 | 2319 | """Showcases *whiteness* computations."""
import numpy as np
import colour
from colour.utilities import message_box
message_box('"Whiteness" Computations')
XYZ = np.array([95.00000000, 100.00000000, 105.00000000])
XYZ_0 = np.array([94.80966767, 100.00000000, 107.30513595])
message_box(
f'Computing "whiteness" u... | bsd-3-clause | d42687e230da3e7f91d3a0aeb8c9aa99 | 28.730769 | 79 | 0.68909 | 2.605618 | false | false | false | false |
theislab/anndata | anndata/_core/anndata.py | 1 | 75719 | """\
Main class and helper functions.
"""
import warnings
import collections.abc as cabc
from collections import OrderedDict
from copy import copy, deepcopy
from enum import Enum
from functools import partial, singledispatch
from pathlib import Path
from os import PathLike
from textwrap import dedent
from typing import... | bsd-3-clause | fcb74c020d36c84b8ab06403ffe77658 | 35.135148 | 116 | 0.534526 | 3.902775 | false | false | false | false |
theislab/anndata | anndata/tests/test_concatenate.py | 1 | 37125 | from collections.abc import Hashable
from copy import deepcopy
from itertools import chain, product
from functools import partial, singledispatch
import warnings
import numpy as np
from numpy import ma
import pandas as pd
from pandas.api.types import is_categorical_dtype
import pytest
from scipy import sparse
from bol... | bsd-3-clause | ba88033de0fb17c5f55b2973b6872a06 | 30.435224 | 107 | 0.523448 | 3.011682 | false | true | false | false |
theislab/anndata | anndata/utils.py | 1 | 7776 | import warnings
from functools import wraps, singledispatch
from typing import Mapping, Any, Sequence, Union, Callable
import h5py
import pandas as pd
import numpy as np
from scipy import sparse
from .logging import get_logger
from ._core.sparse_dataset import SparseDataset
logger = get_logger(__name__)
@singledis... | bsd-3-clause | 5eb66b7979fd2d1ab95fbaad3ff39456 | 29.332031 | 89 | 0.615712 | 3.844059 | false | false | false | false |
sarumont/py-trello | trello/organization.py | 1 | 3166 | # -*- coding: utf-8 -*-
from __future__ import with_statement, print_function, absolute_import
from trello import TrelloBase
from trello.compat import force_str
from trello.member import Member
class Organization(TrelloBase):
TIMEZONE = 'UTC'
"""
Class representing an organization
"""
def __ini... | bsd-3-clause | e56679b93968a81a9f7abe9fd969c5ef | 33.413043 | 94 | 0.584649 | 3.860976 | false | false | false | false |
theislab/anndata | anndata/_core/index.py | 1 | 6684 | import collections.abc as cabc
from functools import singledispatch
from itertools import repeat
from typing import Union, Sequence, Optional, Tuple
import h5py
import numpy as np
import pandas as pd
from scipy.sparse import spmatrix, issparse
Index1D = Union[slice, int, str, np.int64, np.ndarray]
Index = Union[Inde... | bsd-3-clause | 2f1157a42d311ea1b89ba3665b74af21 | 34.157895 | 85 | 0.609581 | 3.678414 | false | false | false | false |
samuel/kokki | kokki/cookbooks/librato/recipes/default.py | 1 | 1031 |
from kokki import Execute, File, Fail
apt_list_path = '/etc/apt/sources.list.d/librato.list'
apt = None
if env.system.platform == "ubuntu":
ver = env.system.lsb['release']
if ver == "10.04":
apt = "deb http://apt.librato.com/ubuntu/ lucid non-free"
elif ver in ("10.10", "11.04", "11.10"):
... | bsd-3-clause | 3bc8d3fc3d66d62b2e343db2faccb056 | 31.21875 | 79 | 0.623666 | 2.928977 | false | false | false | false |
hydroshare/hydroshare | hs_tools_resource/migrations/0020_auto_20180604_1845.py | 1 | 1716 | # -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('hs_tools_resource', '0019_auto_20180531_2304'),
]
operations = [
migrations.CreateModel(
nam... | bsd-3-clause | 3b297c5a04f35561c8db63dc87fc7c83 | 40.853659 | 177 | 0.596737 | 4.457143 | false | false | false | false |
hydroshare/hydroshare | hs_collection_resource/tests/test_collection.py | 1 | 53799 | import json
from dateutil import parser
from django.contrib.auth.models import Group
from django.test import TransactionTestCase, Client
from hs_access_control.models import PrivilegeCodes
from hs_collection_resource.models import CollectionResource, CollectionDeletedResource
from hs_collection_resource.utils import ... | bsd-3-clause | b69eea679cc17d45bcf511ae81ff8834 | 52.108588 | 118 | 0.622335 | 4.14157 | false | false | false | false |
hydroshare/hydroshare | hs_access_control/migrations/0030_groupcommunityinvite_groupcommunityrequest.py | 1 | 2842 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-06-06 15:28
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('auth', '0008_alter_user_u... | bsd-3-clause | 203224194e0d8ee0ddae2b0ffb672ba0 | 62.155556 | 193 | 0.645672 | 3.958217 | false | false | false | false |
hydroshare/hydroshare | hs_tracking/signals.py | 1 | 3703 | from django.contrib.auth.signals import user_logged_in, user_logged_out
from django.dispatch import receiver
from hs_core.signals import pre_download_file, pre_delete_resource, post_create_resource
from .models import Session
from .models import Variable
from .utils import get_std_log_fields
@receiver(user_logged_i... | bsd-3-clause | 60138c9e62f1c1058912ab5f9166ec12 | 31.2 | 88 | 0.678639 | 3.960428 | false | false | false | false |
pysal/spaghetti | spaghetti/_version.py | 1 | 22388 | # This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains th... | bsd-3-clause | 6dd9c28dacd2d629c4e725a5df2af6ae | 33.076104 | 88 | 0.573477 | 3.949894 | false | false | false | false |
hydroshare/hydroshare | hs_tracking/views.py | 1 | 4286 | import csv
import urllib.parse
from io import StringIO
from django.contrib.auth.decorators import user_passes_test
from django.http import HttpResponse, HttpResponseForbidden, HttpResponseRedirect
from django.utils.decorators import method_decorator
from django.views.generic import TemplateView
from . import models a... | bsd-3-clause | 760fa71c1e7a9e372c53f10113495f27 | 35.948276 | 94 | 0.632058 | 4.066414 | false | false | false | false |
hydroshare/hydroshare | hs_file_types/nc_functions/nc_meta.py | 1 | 17504 | """
Module extracts metadata from NetCDF file to complete the required HydroShare NetCDF
Science Metadata
References
reprojection
http://gis.stackexchange.com/questions/78838/how-to-convert-projected-coordinates-to-
lat-lon-using-python
datatype
http://docs.scipy.org/doc/numpy/reference/arrays.dtypes.html
... | bsd-3-clause | 42d0b0c4d0921d81052e466ad004057c | 32.340952 | 99 | 0.589751 | 3.641356 | false | false | false | false |
mitodl/micromasters | profiles/migrations/0011_add_employment_history_table.py | 1 | 1118 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('profiles', '0010_profile_agreed_to_terms_of_service'),
]
operations = [
migrations.CreateModel(
name='Em... | bsd-3-clause | 1dbc1424bce8bc2cc60ea0038b202ee9 | 38.928571 | 144 | 0.575134 | 4.401575 | false | false | false | false |
pywinauto/pywinauto | pywinauto/taskbar.py | 1 | 5221 | # GUI Application automation and testing library
# Copyright (C) 2006-2018 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or with... | bsd-3-clause | 92a8689283c42fd6d697ee89d11113df | 43.798246 | 107 | 0.748516 | 3.750718 | false | false | false | false |
pywinauto/pywinauto | pywinauto/linux/atspi_element_info.py | 1 | 10561 | # -*- coding: utf-8 -*-
# GUI Application automation and testing library
# Copyright (C) 2006-2019 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary f... | bsd-3-clause | cef5d3af945027b74b98c22cf7e05a19 | 37.97048 | 108 | 0.636493 | 4.104547 | false | false | false | false |
pywinauto/pywinauto | pywinauto/linux/atspi_objects.py | 1 | 44571 | # -*- coding: utf-8 -*-
# GUI Application automation and testing library
# Copyright (C) 2006-2019 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary f... | bsd-3-clause | 9f1773c3cf0550e3f044f17dd0ee0b04 | 35.38449 | 115 | 0.658276 | 3.318023 | false | false | false | false |
pywinauto/pywinauto | pywinauto/controls/win_base_wrapper.py | 1 | 16489 | # GUI Application automation and testing library
# Copyright (C) 2006-2019 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# ... | bsd-3-clause | a323019d55dd3cecd7305b603b5fabbc | 36.732265 | 119 | 0.570016 | 4.449271 | false | false | false | false |
mozilla/addons-server | tests/performance/helpers.py | 4 | 4292 | import logging
import random
import collections
import os
import string
import re
import tempfile
import uuid
from contextlib import contextmanager
from shutil import make_archive, rmtree
from zipfile import ZipFile
import lxml
from fxa.constants import ENVIRONMENT_URLS
from fxa.core import Client
from fxa.tests.util... | bsd-3-clause | 276dfedf3bf4cfbf96469b421d11e66c | 28.39726 | 80 | 0.672181 | 3.47812 | false | false | false | false |
mozilla/addons-server | src/olympia/constants/promoted.py | 5 | 3550 | from collections import namedtuple
from django.utils.translation import gettext_lazy as _
from olympia.constants import applications
_PromotedSuperClass = namedtuple(
'_PromotedSuperClass',
[
# Be careful when adding to this list to adjust defaults too.
'id',
'name',
'api_nam... | bsd-3-clause | 1da5a41b8f74dfe9e8ba3382655d03a3 | 23.14966 | 79 | 0.625352 | 3.352219 | false | false | false | false |
mozilla/addons-server | src/olympia/accounts/views.py | 3 | 30704 | import base64
import binascii
import functools
import os
import time
from urllib.parse import quote_plus
from django.conf import settings
from django.contrib.auth import login, logout
from django.db.models import Q
from django.http import Http404, HttpResponseRedirect
from django.urls import reverse
from django.utils... | bsd-3-clause | df2bd3048d5ff492739af911489cd986 | 35.948255 | 88 | 0.606468 | 4.139679 | false | false | false | false |
mozilla/addons-server | src/olympia/addons/migrations/0033_auto_20210511_1256.py | 5 | 1102 | # Generated by Django 2.2.21 on 2021-05-11 12:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('addons', '0032_addonreviewerflags_auto_approval_disabled_unlisted'),
]
operations = [
migrations.AlterField(
model_name='addonr... | bsd-3-clause | 4f3bb983e504dd35b4a5d0894db8ce35 | 32.393939 | 78 | 0.621597 | 4.355731 | false | false | false | false |
mozilla/addons-server | src/olympia/scanners/migrations/0021_auto_20200122_1347.py | 6 | 1152 | # Generated by Django 2.2.9 on 2020-01-22 13:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('scanners', '0020_auto_20200116_1250'),
]
operations = [
migrations.AlterField(
model_name='scannerqueryresult',
name... | bsd-3-clause | 01b0c5d21f338aa9a0c7830d34066370 | 33.909091 | 117 | 0.549479 | 3.865772 | false | false | false | false |
mozilla/addons-server | src/olympia/api/tests/__init__.py | 4 | 1337 | from datetime import datetime, timedelta
from django.conf import settings
import jwt
from olympia.api.models import SYMMETRIC_JWT_TYPE, APIKey
class JWTAuthKeyTester:
def create_api_key(
self,
user,
key='some-user-key',
is_active=True,
secret='some-shared-secret',
... | bsd-3-clause | e1f328e7edb98dd794f386992c5f592b | 28.065217 | 79 | 0.585639 | 3.663014 | false | false | false | false |
mozilla/addons-server | src/olympia/core/sentry.py | 3 | 4205 | import json
import os
import re
import urllib.parse
# List of fields to scrub in our custom sentry_before_send() callback.
# /!\ Each value needs to be in lowercase !
SENTRY_SENSITIVE_FIELDS = (
'email',
'ip_address',
'remote_addr',
'remoteaddresschain',
'x-forwarded-for',
)
def get_sentry_releas... | bsd-3-clause | 82c64880d579eb6d12a4a78bf3c8fd8f | 34.635593 | 83 | 0.582878 | 3.997148 | false | false | false | false |
mozilla/addons-server | src/olympia/versions/tests/test_tasks.py | 3 | 20079 | import os
from base64 import b64encode
from django.conf import settings
from django.utils.encoding import force_str
from unittest import mock
import pytest
from olympia import amo
from olympia.amo.tests import addon_factory, root_storage, version_factory
from olympia.versions.models import Version, VersionPreview
fr... | bsd-3-clause | 448796e816c3efeda8b259d16c2b0084 | 31.755302 | 88 | 0.595099 | 3.388861 | false | false | false | false |
mozilla/addons-server | src/olympia/urls.py | 3 | 4040 | from django.conf import settings
from django.urls import include, re_path
from django.contrib import admin
from django.shortcuts import redirect
from django.urls import reverse
from django.views.static import serve as serve_static
from olympia.amo.utils import urlparams
from olympia.amo.views import frontend_view
from... | bsd-3-clause | b9485724573bcd61f9823e2e70fc52ed | 32.94958 | 83 | 0.62599 | 3.57206 | false | false | false | false |
mozilla/addons-server | src/olympia/constants/base.py | 2 | 13564 | import re
from collections import namedtuple
from django.utils.translation import gettext_lazy as _
# Add-on and File statuses.
STATUS_NULL = 0 # No review type chosen yet, add-on is incomplete.
STATUS_AWAITING_REVIEW = 1 # File waiting for review.
_STATUS_PENDING = 2 # Deprecated. Was Personas waiting for review... | bsd-3-clause | 408786e09ae416b6a8f6b74516bb9d2a | 28.810989 | 85 | 0.653421 | 3.123187 | false | false | false | false |
mozilla/addons-server | src/olympia/landfill/management/commands/generate_default_addons_for_frontend.py | 4 | 2774 | from django.core.management.base import BaseCommand
from django.utils import translation
from django.test.utils import override_settings
from django.db.models.signals import post_save
from olympia.landfill.serializers import GenerateAddonsSerializer
from olympia.addons.models import Addon, update_search_index
# Fea... | bsd-3-clause | 078f7ed59718737396acc71ec24e1627 | 29.822222 | 87 | 0.672314 | 3.890603 | false | false | false | false |
mozilla/addons-server | src/olympia/scanners/admin.py | 2 | 36060 | from django.conf import settings
from django.contrib import admin, messages
from django.contrib.admin import SimpleListFilter
from django.contrib.admin.views.main import ChangeList, ERROR_FLAG, PAGE_VAR
from django.db.models import Count, Prefetch
from django.http import Http404
from django.http.request import QueryDic... | bsd-3-clause | a02c9feba651c32d1d31913fe2ad43f4 | 33.115421 | 88 | 0.554825 | 4.209175 | false | false | false | false |
mozilla/addons-server | src/olympia/users/models.py | 3 | 38810 | import binascii
import os
import random
import re
import time
import ipaddress
from urllib.parse import urljoin
from datetime import datetime
from extended_choices import Choices
from fnmatch import fnmatchcase
import requests
from django import forms
from django.conf import settings
from django.contrib.auth.models i... | bsd-3-clause | 3dbafb73e2a190ca372c2750fc363f80 | 33.559216 | 88 | 0.614816 | 4.143269 | false | false | false | false |
mozilla/addons-server | src/olympia/api/fields.py | 3 | 23928 | import re
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.core.validators import RegexValidator
from django.utils.encoding import smart_str
from django.utils.translation import get_language, gettext, gettext_lazy as _, override
from rest_framework import exceptions, ... | bsd-3-clause | 7608ea8c19153280bfd6fa3fc3258f8f | 35.925926 | 88 | 0.621782 | 4.418837 | false | false | false | false |
mozilla/addons-server | src/olympia/amo/management/commands/compress_assets.py | 3 | 6878 | import hashlib
import os
import subprocess
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.contrib.staticfiles.finders import find as find_static_path
from olympia.lib.jingo_minify_helpers import ensure_path_exists
def run_command(command):
"""Run a... | bsd-3-clause | d7ee665b43ea2745ef77d874b7c7dbb9 | 35.780749 | 88 | 0.525007 | 4.366984 | false | false | false | false |
mozilla/addons-server | src/olympia/shelves/forms.py | 4 | 4699 | import requests
from urllib import parse
from rest_framework.settings import api_settings
from django import forms
from django.conf import settings
from django.urls import NoReverseMatch, reverse
import olympia.core.logger
from olympia import amo
from olympia.shelves.models import Shelf
from olympia.tags.models impo... | bsd-3-clause | a37255a8de7801716717795989fac403 | 34.870229 | 88 | 0.485848 | 4.666336 | false | false | false | false |
mozilla/addons-server | src/olympia/scanners/migrations/0045_auto_20210604_1340.py | 5 | 1654 | # Generated by Django 2.2.23 on 2021-06-04 13:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('scanners', '0044_auto_20210511_1256'),
]
operations = [
migrations.AlterField(
model_name='scannerqueryrule',
name=... | bsd-3-clause | b26c9d5dbc1e97bfb32d42729cfa83af | 32.755102 | 100 | 0.456469 | 5.318328 | false | false | false | false |
mozilla/addons-server | src/olympia/landfill/collection.py | 5 | 1117 | import random
from datetime import datetime
from olympia.amo.utils import slugify
from olympia.bandwagon.models import Collection, CollectionAddon
from .translations import generate_translations
def create_collection(application, **kwargs):
"""Create a Collection for the given `application`."""
data = {
... | bsd-3-clause | adc719d765c6f148c27a32e521eae0b1 | 26.925 | 66 | 0.660698 | 3.865052 | false | false | false | false |
mozilla/addons-server | src/olympia/addons/migrations/0015_auto_20200710_0859.py | 6 | 1116 | # Generated by Django 2.2.14 on 2020-07-10 08:59
from django.conf import settings
from django.db import migrations, models
import django.db.models.manager
import olympia.amo.models
class Migration(migrations.Migration):
dependencies = [
('addons', '0014_remove_addon_view_source'),
]
operations ... | bsd-3-clause | 37f142ae425cb7b3912a72c9ebe14b8a | 30 | 143 | 0.58871 | 4.243346 | false | false | false | false |
mozilla/addons-server | src/olympia/activity/management/commands/repudiate_token.py | 4 | 1503 | from django.core.management.base import BaseCommand, CommandError
import olympia.core.logger
from olympia.activity.models import ActivityLogToken
log = olympia.core.logger.getLogger('z.amo.activity')
class Command(BaseCommand):
help = 'Force expire a list of Activity Email tokens.'
def add_arguments(self... | bsd-3-clause | 1bd1594fa509e9a3cc57063aad784ad9 | 32.4 | 87 | 0.565536 | 4.245763 | false | false | false | false |
mozilla/addons-server | src/olympia/bandwagon/views.py | 2 | 8858 | from django.conf import settings
from django.views.decorators.cache import patch_cache_control
from rest_framework import serializers
from rest_framework.viewsets import ModelViewSet
from olympia import amo
from olympia.accounts.views import AccountViewSet
from olympia.addons.models import Addon, attach_tags
from oly... | bsd-3-clause | d2dff556de7846f25dba5413058a421c | 37.34632 | 87 | 0.631407 | 4.406965 | false | false | false | false |
mozilla/addons-server | src/olympia/translations/widgets.py | 4 | 6572 | from django import forms
from django.utils import translation
from django.utils.encoding import force_str
from django.utils.translation.trans_real import to_language
from django.utils.safestring import mark_safe
from .models import Translation
def get_string(x):
locale = translation.get_language()
try:
... | bsd-3-clause | 82be140f7693d536e3397c4efce2fe64 | 34.333333 | 88 | 0.601795 | 4.256477 | false | false | false | false |
mozilla/addons-server | src/olympia/hero/models.py | 3 | 10214 | import os
from urllib.parse import urlparse
from django.conf import settings
from django.core.exceptions import ValidationError
from django.core.files.storage import default_storage as storage
from django.db import models
from django.db.models.fields import BLANK_CHOICE_DASH
from django.forms.widgets import RadioSelec... | bsd-3-clause | 2c5d54b89efb86ea66c6a2ba8b9901d8 | 32.162338 | 83 | 0.604562 | 3.934515 | false | false | false | false |
mozilla/addons-server | src/olympia/blocklist/tests/test_models.py | 3 | 7493 | from django.core.exceptions import ValidationError
from django.test.utils import override_settings
from olympia.amo.tests import addon_factory, TestCase, user_factory
from ..models import Block, BlocklistSubmission
class TestBlock(TestCase):
def test_is_version_blocked(self):
block = Block.objects.creat... | bsd-3-clause | 88d9140e471bb1f17070cd3c9b92c7d1 | 39.945355 | 86 | 0.644468 | 3.856408 | false | true | false | false |
mozilla/addons-server | src/olympia/blocklist/migrations/0004_multiblocksubmit.py | 3 | 1731 | # Generated by Django 2.2.6 on 2019-11-20 10:01
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import olympia.amo.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settin... | bsd-3-clause | 36425d6cc655f6575c92ef81c901bc7a | 43.384615 | 142 | 0.595609 | 4.121429 | false | false | false | false |
mozilla/addons-server | src/olympia/lib/jingo_minify_helpers.py | 4 | 2606 | import errno
import os
import subprocess
from django.conf import settings
from django.contrib.staticfiles.finders import find as find_static_path
from django.templatetags.static import static
import markupsafe
def _build_html(items, wrapping):
"""
Wrap `items` in wrapping.
"""
return markupsafe.Mark... | bsd-3-clause | 220e9d46aea4a5056e88bbcafed54103 | 26.431579 | 79 | 0.615886 | 3.872214 | false | false | false | false |
mozilla/addons-server | src/olympia/files/fields.py | 3 | 1695 | import os
import os.path
# FieldFile is the underyling File proxy, FileField is the database field.
from django.db.models.fields.files import FieldFile, FileField
class _FileNameFieldFile(FieldFile):
"""Custom django FieldFile to go with LegacyFilenameFileField. When
instantiated with a pre-migration `name` ... | bsd-3-clause | e55723b4b140f7743111eebb019a140e | 40.341463 | 78 | 0.694395 | 4.484127 | false | false | false | false |
mozilla/addons-server | src/olympia/amo/context_processors.py | 3 | 3241 | from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.urls import reverse
from django.utils.translation import get_language, get_language_bidi, gettext
from olympia import amo
from olympia.access import acl
from urllib.parse import quote
def i18n(request):
lang = get_... | bsd-3-clause | ff961d868eece8a7cba84f55c761c8c2 | 29.009259 | 84 | 0.5307 | 4.25887 | false | false | false | false |
mozilla/addons-server | src/olympia/amo/sitemap.py | 2 | 16452 | import datetime
import math
import os
from collections import namedtuple
from dataclasses import dataclass
from urllib.parse import urlparse
from django.conf import settings
from django.contrib.sitemaps import Sitemap as DjangoSitemap
from django.core.paginator import PageNotAnInteger
from django.db.models import Coun... | bsd-3-clause | 5e2ae26a47df4c37482e1f8e10eabb49 | 32.169355 | 92 | 0.573851 | 3.86651 | false | false | false | false |
mozilla/addons-server | src/olympia/api/tests/test_fields.py | 3 | 33432 | from collections import OrderedDict
from django.conf import settings
from django.test.utils import override_settings
import pytest
from unittest.mock import Mock
from rest_framework import exceptions, serializers
from rest_framework.request import Request
from rest_framework.test import APIRequestFactory
from olympi... | bsd-3-clause | be5d3ebaa09f02b600da23e07a802d0f | 37.009101 | 88 | 0.616342 | 4.027728 | false | true | false | false |
mozilla/addons-server | src/olympia/versions/migrations/0001_initial.py | 3 | 7759 | # Generated by Django 2.2.5 on 2019-09-12 14:36
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.manager
import django.utils.timezone
import django_extensions.db.fields.json
import olympia.amo.fields
import olympia.amo.models
import olympia.translations.fields
import ol... | bsd-3-clause | 0fb4f2c5681ba536757cc56e66af5ecd | 56.051471 | 316 | 0.606908 | 4.196322 | false | false | false | false |
mozilla/addons-server | src/olympia/users/management/commands/clear_old_user_data.py | 5 | 2252 | from datetime import datetime, timedelta
from django.core.management.base import BaseCommand
from django.db.models import Q
from django.db.transaction import atomic
import olympia.core.logger
from olympia import amo
from olympia.activity.models import IPLog
from olympia.addons.models import Addon, AddonUser
from olym... | bsd-3-clause | de3a5ea94602388196a1e333883c455f | 35.918033 | 88 | 0.638988 | 3.716172 | false | false | false | false |
mozilla/addons-server | src/olympia/amo/urlresolvers.py | 3 | 6651 | import hashlib
import hmac
import re
from urllib.parse import quote
from django.conf import settings
from django.utils.encoding import force_bytes
from django.utils.http import _urlparse as django_urlparse
from django.utils.translation.trans_real import parse_accept_lang_header
import bleach
import markupsafe
from ... | bsd-3-clause | 2d3d0d8cb9f00f4801ca57b68c75970f | 32.590909 | 85 | 0.617351 | 4.043161 | false | false | false | false |
mozilla/addons-server | src/olympia/amo/fields.py | 3 | 5251 | import re
import ipaddress
from django.conf import settings
from django.core import exceptions
from django.core.validators import RegexValidator, URLValidator
from django.db import models
from django.forms import fields
from django.utils.translation import gettext_lazy as _
from captcha.fields import ReCaptchaField a... | bsd-3-clause | 47661ab3f690f4b412c6a35a37bf626a | 33.097403 | 88 | 0.633213 | 4.005339 | false | false | false | false |
mozilla/addons-server | src/olympia/users/migrations/0001_initial.py | 3 | 10188 | # Generated by Django 2.2.5 on 2019-09-12 13:51
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import olympia.amo.fields
import olympia.amo.models
import olympia.amo.validators
import olympia.users.mo... | bsd-3-clause | a8dee4c82a64259adbdaf71f85c2add5 | 56.235955 | 333 | 0.60002 | 4.309645 | false | false | false | false |
mozilla/addons-server | src/olympia/files/migrations/0001_initial.py | 3 | 7800 | # Generated by Django 2.2.5 on 2019-09-12 13:36
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import django_extensions.db.fields.json
import olympia.amo.fields
import olympia.amo.models
import uuid
class Migration(migrations.Mi... | bsd-3-clause | 654d30bd5018512b81c7b58a819a9bec | 52.061224 | 189 | 0.582051 | 4.362416 | false | false | false | false |
mozilla/addons-server | src/olympia/files/tests/test_admin.py | 3 | 2903 | from django.urls import reverse
from django.utils.encoding import force_str
from olympia.amo.tests import TestCase, addon_factory, user_factory
class TestFileAdmin(TestCase):
def setUp(self):
self.list_url = reverse('admin:files_file_changelist')
def test_can_list_files_with_admin_advanced_permissio... | bsd-3-clause | 10d5ae0f9c4adcc24fda4633f6ffcf34 | 39.887324 | 73 | 0.640372 | 3.819737 | false | true | false | false |
waveform80/picamera | docs/examples/mmal_clock_splitter.py | 2 | 6683 | import io
import datetime as dt
from threading import Thread, Lock
from collections import namedtuple
from math import sin, cos, pi
from time import sleep
from picamera import mmal, mmalobj as mo, PiCameraPortDisabled
from PIL import Image, ImageDraw
class Coord(namedtuple('Coord', ('x', 'y'))):
@classmethod
... | bsd-3-clause | b608280d8503a9601987e4c393e83d3a | 35.519126 | 90 | 0.5918 | 3.758718 | false | false | false | false |
waveform80/picamera | docs/examples/yuv_capture2.py | 2 | 1789 | from __future__ import division
import time
import picamera
import numpy as np
width = 100
height = 100
stream = open('image.data', 'w+b')
# Capture the image in YUV format
with picamera.PiCamera() as camera:
camera.resolution = (width, height)
camera.start_preview()
time.sleep(2)
camera.capture(strea... | bsd-3-clause | 6f2ea37afe0e6a0895e25a8051fbfb7d | 39.659091 | 73 | 0.63611 | 3.011785 | false | false | false | false |
waveform80/picamera | picamera/camera.py | 1 | 186867 | # vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# Python camera library for the Rasperry-Pi camera module
# Copyright (c) 2013-2017 Dave Jones <dave@waveform.org.uk>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# ... | bsd-3-clause | bbd77c23c32565c1cf524d8160ce5617 | 43.864826 | 146 | 0.590361 | 4.304584 | false | false | false | false |
intake/filesystem_spec | fsspec/implementations/arrow.py | 1 | 6762 | import errno
import io
import os
import secrets
import shutil
from contextlib import suppress
from functools import wraps
from fsspec.spec import AbstractFileSystem
from fsspec.utils import infer_storage_options, mirror_from, stringify_path
def wrap_exceptions(func):
@wraps(func)
def wrapper(*args, **kwargs)... | bsd-3-clause | 9d852e6a5cdb5591e6fba5451fb44893 | 27.058091 | 88 | 0.556492 | 4.005924 | false | false | false | false |
intake/filesystem_spec | fsspec/implementations/hdfs.py | 1 | 7072 | import secrets
import shutil
import weakref
from contextlib import suppress
from pyarrow.hdfs import HadoopFileSystem
from fsspec.implementations.arrow import wrap_exceptions
from fsspec.spec import AbstractFileSystem
from fsspec.utils import infer_storage_options, mirror_from
@mirror_from(
"client",
[
... | bsd-3-clause | 24346125ff72b7954ffdd8c473f2cdef | 25.486891 | 88 | 0.533937 | 4.140515 | false | false | false | false |
intake/filesystem_spec | fsspec/archive.py | 1 | 2150 | from fsspec import AbstractFileSystem
from fsspec.utils import tokenize
class AbstractArchiveFileSystem(AbstractFileSystem):
"""
A generic superclass for implementing Archive-based filesystems.
Currently, it is shared amongst `ZipFileSystem`, `LibArchiveFileSystem` and
`TarFileSystem`.
"""
d... | bsd-3-clause | 61d7acb58bfcef009929fe09663f1471 | 30.617647 | 93 | 0.508372 | 4.118774 | false | false | false | false |
intake/filesystem_spec | fsspec/implementations/memory.py | 1 | 8606 | from __future__ import absolute_import, division, print_function
import logging
from datetime import datetime
from errno import ENOTEMPTY
from io import BytesIO
from fsspec import AbstractFileSystem
logger = logging.Logger("fsspec.memoryfs")
class MemoryFileSystem(AbstractFileSystem):
"""A filesystem based on ... | bsd-3-clause | 813fd4a3e5386af5a5859ace13590f31 | 32.356589 | 86 | 0.49082 | 4.411071 | false | false | false | false |
intake/filesystem_spec | fsspec/implementations/jupyter.py | 2 | 3816 | import base64
import io
import re
import requests
import fsspec
class JupyterFileSystem(fsspec.AbstractFileSystem):
"""View of the files as seen by a Jupyter server (notebook or lab)"""
protocol = ("jupyter", "jlab")
def __init__(self, url, tok=None, **kwargs):
"""
Parameters
... | bsd-3-clause | 0427e7ab03bbb5cfa101162f4792a5a0 | 29.774194 | 79 | 0.507862 | 3.90184 | false | false | false | false |
intake/filesystem_spec | fsspec/dircache.py | 1 | 2675 | import time
from collections.abc import MutableMapping
from functools import lru_cache
class DirCache(MutableMapping):
"""
Caching of directory listings, in a structure like::
{"path0": [
{"name": "path0/file0",
"size": 123,
"type": "file",
...
... | bsd-3-clause | 015dd0f0c0dbae77b4a1a140f2307b89 | 26.864583 | 86 | 0.52785 | 4.096478 | false | false | false | false |
google/deepvariant | deepvariant/vcf_stats_vis.py | 1 | 16942 | # Copyright 2019 Google LLC.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
#... | bsd-3-clause | d8521b2cbd5cafd02e6f5018617d40b4 | 35.591793 | 85 | 0.645142 | 3.29675 | false | false | false | false |
google/deepvariant | third_party/nucleus/io/genomics_reader.py | 1 | 8951 | # Copyright 2018 Google LLC.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
#... | bsd-3-clause | f78df5dd789422861c35b073b6a2b264 | 34.379447 | 79 | 0.713105 | 4.083485 | false | false | false | false |
google/deepvariant | third_party/nucleus/io/gfile.py | 1 | 2728 | # Copyright 2018 Google LLC.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
#... | bsd-3-clause | c8bd082ae2182f2f6b4938eebafcabdc | 30.356322 | 78 | 0.724707 | 4.249221 | false | false | false | false |
nipy/nireg | nireg/externals/transforms3d/utils.py | 5 | 2816 | ''' Utilities for transforms3d '''
from __future__ import absolute_import
import math
from itertools import permutations
import numpy as np
def normalized_vector(vec):
''' Return vector divided by Euclidean (L2) norm
See :term:`unit vector` and :term:`Euclidean norm`
Parameters
----------
vec ... | bsd-3-clause | 4161f4284361d212ad26024fc796e519 | 20.333333 | 100 | 0.520952 | 3.459459 | false | false | false | false |
python-mechanize/mechanize | mechanize/_clientcookie.py | 1 | 9611 | from __future__ import absolute_import
import re
import time
from .polyglot import (
Cookie as _Cookie, CookieJar as CJ, MozillaCookieJar as MCJ, request_host
as request_host_lc, DEFAULT_HTTP_PORT, CookiePolicy, DefaultCookiePolicy,
FileCookieJar, LoadError, LWPCookieJar, _debug, domain_match,
eff_requ... | bsd-3-clause | b0d1d29f11a38da55f20c4abc4b733eb | 35.823755 | 79 | 0.515659 | 4.574488 | false | false | false | false |
python-mechanize/mechanize | test/test_form.py | 1 | 125798 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2002-2005 John J. Lee <jjl@pobox.com>
# Copyright 2005 Gary Poster
# Copyright 2005 Zope Corporation
# Copyright 1998-2000 Gisle Aas.
import os
import unittest
import warnings
import io
from functools import partial
import mechanize
import mechanize._form as ... | bsd-3-clause | 53a985ff7ff5fd7bc8faf6b9eff8b34f | 34.921188 | 95 | 0.557712 | 3.658669 | false | false | false | false |
python-mechanize/mechanize | mechanize/_mechanize.py | 1 | 31661 | """Stateful programmatic WWW navigation, after Perl's WWW::Mechanize.
Copyright 2003-2006 John J. Lee <jjl@pobox.com>
Copyright 2003 Andy Lester (original Perl code)
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD or ZPL 2.1 licenses (see the file LICENSE
included with ... | bsd-3-clause | 907e1053401bb3d76b579a8f900bc86d | 36.117233 | 79 | 0.586526 | 4.507546 | false | false | false | false |
python-mechanize/mechanize | test/test_html.py | 1 | 4397 | #!/usr/bin/env python
from unittest import TestCase
import mechanize
import mechanize._form
from mechanize._response import test_html_response
from mechanize._html import content_parser, get_title, Factory
class RegressionTests(TestCase):
def test_close_base_tag(self):
# any document containing a </bas... | bsd-3-clause | c402c74d9787709fad27a7381f1f47cd | 30.862319 | 119 | 0.579259 | 3.726271 | false | true | false | false |
sdss/marvin | python/marvin/api/rss.py | 1 | 7790 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: Brian Cherinka, José Sánchez-Gallego, and Brett Andrews
# @Date: 2016-04-11
# @Filename: rss.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
#
# @Last modified by: José Sánchez-Gallego (gallegoj@uw.edu)
# @Last modified time: 2018-... | bsd-3-clause | 78242b2a0930efc7ffb2b42837c314d2 | 31.714286 | 114 | 0.545338 | 3.920443 | false | true | false | false |
sdss/marvin | python/marvin/tools/maps.py | 1 | 32466 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: Brian Cherinka, José Sánchez-Gallego, and Brett Andrews
# @Date: 2017-11-08
# @Filename: maps.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
#
# @Last modified by: José Sánchez-Gallego (gallegoj@uw.edu)
# @Last modified time: 2018... | bsd-3-clause | 83269ad37038b0a87bd0d676c4520b1f | 38.587805 | 125 | 0.560871 | 4.052178 | false | false | false | false |
sdss/marvin | python/marvin/utils/datamodel/dap/MPL10.py | 1 | 4949 | # !/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Filename: MPL10.py
# Project: dap
# Author: Brian Cherinka
# Created: Monday, 13th July 2020 2:49:16 pm
# License: BSD 3-clause "New" or "Revised" License
# Copyright (c) 2020 Brian Cherinka
# Last Modified: Monday, 13th July 2020 2:49:16 pm
# Modified By: Brian Cherin... | bsd-3-clause | 18fc213c4adfa030690a033febae1871 | 48.989899 | 112 | 0.583754 | 4.124167 | false | false | false | false |
sdss/marvin | python/marvin/utils/datamodel/query/forms.py | 1 | 18474 | #!/usr/bin/env python
# encoding: utf-8
'''
Licensed under a 3-clause BSD license.
Revision History:
Initial Version: 2016-02-23 14:13:28 by Brian Cherinka
2016-02-23 - made some test sample forms with wtforms+sqlalchemy - B. Cherinka
2016-03-02 - generalized the form to build all forms - B. Cherinka
'''
... | bsd-3-clause | b0d02c495af86945e9b94d695fab5fdb | 35.948 | 126 | 0.608098 | 4.065581 | false | false | false | false |
mozilla/inventory | vendor-local/src/django-extensions/django_extensions/management/commands/runscript.py | 39 | 6135 | from django.core.management.base import BaseCommand
from django.core.management.color import no_style
from optparse import make_option
import sys
import os
import imp
try:
set
except NameError:
from sets import Set as set # Python 2.3 fallback
def vararg_callback(option, opt_str, opt_value, parser):
pa... | bsd-3-clause | 11d5feb9ef1b48f6a69f765e15a42a37 | 35.736527 | 96 | 0.518174 | 4.436009 | false | false | false | false |
mozilla/inventory | core/search/compiler/invparsley.py | 2 | 2166 | grammar = """
# http://people.mozilla.com/~juber/public/docs/_build/html/flows.html
# DSL for Inventory
# Grammar base classes should implement the following functions:
# - directive
# - regexpr
# - text
# - AND_op
# - OR_op
# - NOT_op
# - compile
space = ' '
ws = space*
wss = space+
not_ws = :c ?(c not... | bsd-3-clause | e923c7588f63da86deb6cf230f428928 | 24.186047 | 79 | 0.550785 | 2.597122 | false | false | false | false |
mozilla/inventory | vendor-local/src/django-extensions/build/lib/django_extensions/management/commands/print_user_for_session.py | 46 | 1664 | from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from django.contrib.sessions.models import Session
import re
SESSION_RE = re.compile("^[0-9a-f]{20,40}$")
class Command(BaseCommand):
help = ("print the user information for the provided session key. "
... | bsd-3-clause | 40acd6652bd3845b32886366fddc4cf5 | 34.404255 | 76 | 0.602764 | 4.255754 | false | false | false | false |
mozilla/inventory | vendor-local/src/django-extensions/build/lib/django_extensions/management/commands/print_settings.py | 16 | 1994 | """
print_settings
==============
Django command similar to 'diffsettings' but shows all active Django settings.
"""
from django.core.management.base import NoArgsCommand
from django.conf import settings
from optparse import make_option
class Command(NoArgsCommand):
"""print_settings command"""
help = "Pri... | bsd-3-clause | 8da2d8bc4919b10b3c2f2f22809860d0 | 26.315068 | 78 | 0.568205 | 4.411504 | false | false | false | false |
mozilla/inventory | scripts/owner_unmanaged_system_report.py | 3 | 1861 | #!/usr/bin/python
try:
import json
except:
from django.utils import simplejson as json
import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)))
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)))
os.environ['DJANGO_SET... | bsd-3-clause | cef641ca4b53ddefe559c09b4600a56f | 37.770833 | 144 | 0.610962 | 3.606589 | false | false | false | false |
mozilla/inventory | core/range/views.py | 2 | 9556 | from django.core.exceptions import ValidationError
from django.shortcuts import get_object_or_404
from django.shortcuts import render
from django.http import HttpResponse
from core.utils import int_to_ip, resolve_ip_type
from core.range.forms import RangeForm
from core.range.utils import range_usage
from core.range.ip... | bsd-3-clause | 09a1d08d8d1ad13c18801c17a9668d6e | 30.853333 | 79 | 0.587798 | 3.853226 | false | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.