code
stringlengths
114
1.05M
path
stringlengths
3
312
quality_prob
float64
0.5
0.99
learning_prob
float64
0.2
1
filename
stringlengths
3
168
kind
stringclasses
1 value
import re from typing import List, Set, FrozenSet, Callable # noqa: ignore=F401 from typing import Iterable, Tuple, Dict # noqa: ignore=F401 from libscanbuild import shell_split, run_command __all__ = ['get_version', 'get_arguments', 'get_checkers'] # regex for activated checker ACTIVE_CHECKER_PATTERN =...
/scan-build-2.0.20.tar.gz/scan-build-2.0.20/libscanbuild/clang.py
0.786213
0.276211
clang.py
pypi
""" This module is a collection of methods commonly used in this project. """ import collections import functools import json import logging import os import os.path import re import shlex import subprocess import sys import pprint from typing import List, Any, Dict, Callable # noqa: ignore=F401 ENVIRONMENT_KEY = 'I...
/scan-build-2.0.20.tar.gz/scan-build-2.0.20/libscanbuild/__init__.py
0.567937
0.195978
__init__.py
pypi
import requests from datetime import datetime, timedelta, timezone from pycountry import countries from pathlib import Path import json def parse_tz(tzstr): sign = -1 + (tzstr[0] == "+") * 2 # 1 if timezone is positive, -1 if timezone is negative tzstr = tzstr[1:] hour, minute = tzstr.split(":") hour...
/scan_for_webcams-1.4.3-py3-none-any.whl/scanforwebcams/geoip.py
0.415847
0.164752
geoip.py
pypi
Scan Image Slicer --- Scan image slicer is a tool for detecting and separating images from a scanned image (or any image). The designed use case is for digitizing old photos, paper clippings and the like. ### Workflow - create an empty input folder for the scanned images - (optional) create a folder structure inside t...
/scan-image-slicer-1.3.0.tar.gz/scan-image-slicer-1.3.0/README.md
0.651022
0.930458
README.md
pypi
from typing import Dict, List, TypedDict, Union APPEND_CREDIT_CARD_DEFAULT = False """Default value of the field path 'Arguments append_credit_card'""" ASSISTED_SPLIT_DEFAULT = False """Default value of the field path 'Arguments assisted_split'""" AUTO_BASH_DEFAULT = False """Default value of the field path 'Mode ...
/scan_to_paperless-1.25.0-py3-none-any.whl/scan_to_paperless/config.py
0.930734
0.675079
config.py
pypi
from typing import Dict, List, TypedDict, Union APPEND_CREDIT_CARD_DEFAULT = False """Default value of the field path 'Arguments append_credit_card'""" ASSISTED_SPLIT_DEFAULT = False """Default value of the field path 'Arguments assisted_split'""" AUTO_LEVEL_DEFAULT = False """Default value of the field path 'Argu...
/scan_to_paperless-1.25.0-py3-none-any.whl/scan_to_paperless/process_schema.py
0.927079
0.680641
process_schema.py
pypi
import argparse import glob import json import logging import math import os import re import shutil import subprocess # nosec import sys import tempfile import time import traceback from typing import IO, TYPE_CHECKING, Any, Dict, List, Optional, Protocol, Tuple, TypedDict, Union, cast # read, write, rotate, crop, s...
/scan_to_paperless-1.25.0-py3-none-any.whl/scan_to_paperless/process.py
0.659844
0.23053
process.py
pypi
import attr from collections import Counter from licensedcode.tokenize import query_tokenizer # All values of match_coverage less than this value are taken as # `near-perfect-match-coverage` cases NEAR_PERFECT_MATCH_COVERAGE_THR = 100 # Values of match_coverage less than this are taken as `imperfect-match-coverage`...
/scancode-analyzer-21.4.7.tar.gz/scancode-analyzer-21.4.7/src/scancode_analyzer/license_analyzer.py
0.784154
0.361559
license_analyzer.py
pypi
import pandas as pd from licensedcode import models # Threshold of Words which is used in `Rule.compute_relevance` in `scancode.licensedcode.models.py` THRESHOLD_COMPUTE_RELEVANCE = 18.0 # Different Rule Attribute Groups boolean_rule_attributes = [ "is_license_reference", "is_license_text", "is_license_notice",...
/scancode-analyzer-21.4.7.tar.gz/scancode-analyzer-21.4.7/src/scancode_analyzer/load_data.py
0.678647
0.271741
load_data.py
pypi
from collections import Counter import attr """ Data Format and example output of analyzer summary, having unique license detection issues and statistics. codebase_level: - license_detection_issues_summary: SummaryLicenseIssues - unique_license_detection_issues: list of UniqueIssue - issue_...
/scancode-analyzer-21.4.7.tar.gz/scancode-analyzer-21.4.7/src/scancode_analyzer/summary.py
0.810966
0.254743
summary.py
pypi
Selecting Incorrect Scan Cases ============================== The steps of analysing license matches in a file and flagging potential license detection issues are: 1. Dividing Matches in file-regions - :ref:`location_regions_division` 2. Detecting License Detection Issues in file-regions - :ref:`analysis` 3. Grouping...
/scancode-analyzer-21.4.7.tar.gz/scancode-analyzer-21.4.7/docs/source/how-analysis-is-performed/selecting-incorrect-unique.rst
0.909505
0.790571
selecting-incorrect-unique.rst
pypi
.. _lic_detection_issue_types: License Detection Issue Types ============================= There are 4 types of license information as segregated by scancode-toolkit, based on rule types. - text - notices - tags - references. Note that this is the order of precedence, as in in a file-region if there's one type high...
/scancode-analyzer-21.4.7.tar.gz/scancode-analyzer-21.4.7/docs/source/how-analysis-is-performed/cases-incorrect-scans.rst
0.911239
0.672905
cases-incorrect-scans.rst
pypi
import numpy as np import pandas as pd from results_analyze.rules_analyze import LicenseRulesInfo class ResultsDataFrameFile: def __init__(self): self.lic_rule_info = LicenseRulesInfo(has_loaded=False) # Which columns to drop from a File Level Dataframe. self.drop_columns_list_file_lev...
/scancode-analyzer-21.4.7.tar.gz/scancode-analyzer-21.4.7/etc/load_scan_into_dataframe/load_results_file.py
0.833765
0.420064
load_results_file.py
pypi
import os import gzip import json import pandas as pd import numpy as np from results_analyze.postgres import PostgresFetch from results_analyze.load_results_file import ResultsDataFrameFile from results_analyze.df_file_io import DataFrameFileIO # How many rows of Database to Fetch at once # ToDo: Calculation Funct...
/scancode-analyzer-21.4.7.tar.gz/scancode-analyzer-21.4.7/etc/load_scan_into_dataframe/load_results_package.py
0.73173
0.470007
load_results_package.py
pypi
""" Monkeypatch Pool iterators so that Ctrl-C interrupts everything properly derived from https://gist.github.com/aljungberg/626518 Copyright (c) Alexander Ljungberg. All rights reserved. Modifications Copyright (c) nexB Inc. and others. All rights reserved. Permission is hereby granted, free of charge, to any perso...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/scancode/pool.py
0.710829
0.206854
pool.py
pypi
from itertools import islice from os.path import getsize import logging import os import sys from commoncode.filetype import get_last_modified_date from commoncode.hash import multi_checksums from scancode import ScancodeError from typecode.contenttype import get_type TRACE = os.environ.get('SCANCODE_DEBUG_API', Fal...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/scancode/api.py
0.54698
0.198258
api.py
pypi
# FIXME: the glob story is very weird!!! examples_text = ''' Scancode command lines examples: (Note for Windows: use '\\' back slash instead of '/' forward slash for paths.) Scan a single file for copyrights. Print scan results to stdout as pretty JSON: scancode --copyright samples/zlib/zlib.h --json-pp - Scan...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/scancode/help.py
0.430866
0.350866
help.py
pypi
import string import re import ipaddress import urlpy from commoncode.text import toascii from cluecode import finder_data from textcode import analysis # Tracing flags TRACE = False TRACE_URL = False TRACE_EMAIL = False def logger_debug(*args): pass if TRACE or TRACE_URL or TRACE_EMAIL: import loggin...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/cluecode/finder.py
0.543106
0.197735
finder.py
pypi
The purpose of `packagedcode` is to: - detect a package, - determine its dependencies, - collect its declared licensing (at the metadata/manifest level) vs. its actual license (as scanned and normalized). 1. **detect the presence of a package** in a codebase based on its manifest, its file or archive type. Typi...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/packagedcode/README.rst
0.895731
0.754418
README.rst
pypi
import ast from pathlib import Path """ Parse setup.py files. """ # https://setuptools.readthedocs.io/en/latest/setuptools.html#metadata FIELDS = { 'author_email', 'author', 'classifiers', 'dependency_links', 'description', 'download_url', 'extras_require', 'install_requires', 'k...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/packagedcode/pypi_setup_py.py
0.793826
0.294653
pypi_setup_py.py
pypi
from packagedcode import models """ Various package data file formats to implment. """ # Package types # NOTE: this is somewhat redundant with extractcode archive handlers # yet the purpose and semantics are rather different here # TODO: parse me!!! # TODO: add missing URLs and descriptions class JavaJarHandler(m...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/packagedcode/misc.py
0.428951
0.199191
misc.py
pypi
import io import re import attr from packageurl import PackageURL @attr.s() class GoModule(object): namespace = attr.ib(default=None) name = attr.ib(default=None) version = attr.ib(default=None) module = attr.ib(default=None) require = attr.ib(default=None) exclude = attr.ib(default=None) ...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/packagedcode/go_mod.py
0.532911
0.210259
go_mod.py
pypi
from commoncode import fileutils from packagedcode import models """ Handle README.*-style semi-structured package metadata. These are seen in Android, Chromium and a few more places. """ # Common README field name mapped to known PackageData field name PACKAGE_FIELD_BY_README_FIELD = { 'name': 'name', 'pro...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/packagedcode/readme.py
0.638835
0.247692
readme.py
pypi
import io import json from functools import partial from packagedcode import models """ Parse PHP composer package manifests, see https://getcomposer.org/ and https://packagist.org/ TODO: add support for composer.lock and packagist formats: both are fairly similar. """ class BasePhpComposerHandler(models.Datafile...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/packagedcode/phpcomposer.py
0.430028
0.158207
phpcomposer.py
pypi
import io import json from packageurl import PackageURL from packagedcode import models """ Handle haxelib Haxe packages See - https://lib.haxe.org/all/ this lists all the packages. - https://lib.haxe.org/documentation/creating-a-haxelib-package/ - https://github.com/HaxeFoundation/haxelib - https://github.com/gog...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/packagedcode/haxe.py
0.477067
0.245854
haxe.py
pypi
from contextlib import closing import pefile from ftfy import fix_text from commoncode import text from packagedcode import models from packagedcode.models import Party from packagedcode.models import party_org from typecode import contenttype TRACE = False def logger_debug(*args): pass if TRACE: impor...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/packagedcode/win_pe.py
0.564339
0.180504
win_pe.py
pypi
try: from license_expression import Licensing from license_expression import combine_expressions as le_combine_expressions except: Licensing = None le_combine_expressions = None PLAIN_URLS = ( 'https://', 'http://', ) VCS_URLS = ( 'git://', 'git+git://', 'git+https://', 'git+h...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/packagedcode/utils.py
0.509276
0.394551
utils.py
pypi
import io import json from commoncode import datautils from packagedcode import models import attr from packageurl import PackageURL """ Handle Godeps-like Go package dependency data. Note: there are other dependency tools for Go beside Godeps, yet several use the same format. Godeps (and glide, etc.) is mostly le...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/packagedcode/godeps.py
0.538741
0.242441
godeps.py
pypi
import warnings import saneyaml from packageurl import PackageURL from packagedcode import models """ Collect data from Dart pub packages. See https://dart.dev/tools/pub/pubspec API has theses URLs: is limited and only returns all versions of a package - feeds https://pub.dev/feed.atom - all packages, paginated: h...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/packagedcode/pubspec.py
0.525612
0.209834
pubspec.py
pypi
import re from collections import defaultdict from binascii import crc32 from itertools import islice from licensedcode.stopwords import STOPWORDS from textcode.analysis import numbered_text_lines """ Utilities to break texts in lines and tokens (aka. words) with specialized version for queries and rules texts. """ ...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/licensedcode/tokenize.py
0.533884
0.333856
tokenize.py
pypi
ScanCode license detection overview and key design elements =========================================================== License detection is about finding common texts between the text of a query file being scanned and the texts of the indexed license texts and rule texts. The process strives to be correct first and f...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/licensedcode/README.rst
0.932699
0.982288
README.rst
pypi
from collections.abc import Set from itertools import count from itertools import groupby from intbitset import intbitset """ Ranges and intervals of integers using bitmaps. Used as a compact and faster data structure for token and position sets. """ class Span(Set): """ Represent ranges of integers (such ...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/licensedcode/spans.py
0.91611
0.491334
spans.py
pypi
import os import json import pathlib from datetime import datetime from os.path import dirname from os.path import join from distutils.dir_util import copy_tree import click import saneyaml from commoncode.cliutils import MISC_GROUP from commoncode.cliutils import PluggableCommandLineOption from jinja2 import Enviro...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/licensedcode/license_db.py
0.499756
0.176175
license_db.py
pypi
from collections import namedtuple import sys import time """ Computes the difference between two texts. Originally based on Diff Match and Patch Copyright 2018 The diff-match-patch Authors. original author fraser@google.com (Neil Fraser) https://github.com/google/diff-match-patch Licensed under the Apache License...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/licensedcode/dmp.py
0.721056
0.490724
dmp.py
pypi
from time import time import sys from licensedcode.match import LicenseMatch from licensedcode.spans import Span TRACE = False TRACE2 = False TRACE3 = False def logger_debug(*args): pass if TRACE or TRACE2 or TRACE3: use_print = True if use_print: prn = print else: import logging ...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/licensedcode/match_seq.py
0.510008
0.242878
match_seq.py
pypi
from __future__ import absolute_import, division, print_function from ._compat import PY2 from ._make import NOTHING, Factory, pipe if not PY2: import inspect import typing __all__ = [ "default_if_none", "optional", "pipe", "to_bool", ] def optional(converter): """ A converter tha...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/licensedcode/_vendor/attr/converters.py
0.850142
0.249207
converters.py
pypi
from __future__ import absolute_import, division, print_function import operator import re from contextlib import contextmanager from ._config import get_run_validators, set_run_validators from ._make import _AndValidator, and_, attrib, attrs from .exceptions import NotCallableError try: Pattern = re.Pattern e...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/licensedcode/_vendor/attr/validators.py
0.844569
0.261016
validators.py
pypi
from __future__ import absolute_import, division, print_function from functools import total_ordering from ._funcs import astuple from ._make import attrib, attrs @total_ordering @attrs(eq=False, order=False, slots=True, frozen=True) class VersionInfo(object): """ A version object that can be compared to t...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/licensedcode/_vendor/attr/_version_info.py
0.805517
0.209389
_version_info.py
pypi
from __future__ import absolute_import, division, print_function import copy from ._compat import iteritems from ._make import NOTHING, _obj_setattr, fields from .exceptions import AttrsAttributeNotFoundError def asdict( inst, recurse=True, filter=None, dict_factory=dict, retain_collection_type...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/licensedcode/_vendor/attr/_funcs.py
0.874158
0.177668
_funcs.py
pypi
from __future__ import absolute_import, division, print_function import functools from ._compat import new_class from ._make import _make_ne _operation_names = {"eq": "==", "lt": "<", "le": "<=", "gt": ">", "ge": ">="} def cmp_using( eq=None, lt=None, le=None, gt=None, ge=None, require_sa...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/licensedcode/_vendor/attr/_cmp.py
0.847021
0.336876
_cmp.py
pypi
def get_relative_path(root_path, path): """ Return a path relativefrom the posix 'path' relative to a base path of `len_base_path` length where the base is a directory if `base_is_dir` True or a file otherwise. """ return path[len(root_path):].lstrip('/') LEGAL_STARTS_ENDS = ( 'copying',...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/summarycode/classify.py
0.479016
0.190611
classify.py
pypi
from collections import defaultdict import attr import click from commoncode.fileset import get_matches as get_fileset_matches from plugincode.pre_scan import PreScanPlugin from plugincode.pre_scan import pre_scan_impl from commoncode.cliutils import PluggableCommandLineOption from commoncode.cliutils import PRE_SCA...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/summarycode/facet.py
0.681833
0.260848
facet.py
pypi
def get_resource_summary(resource, key, as_attribute=False): """ Return the "summary" value as mapping for the `key` summary attribute of a resource. This is collected either from a direct Resource.summary attribute if `as_attribute` is True or as a Resource.extra_data summary item otherwise. ...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/summarycode/utils.py
0.874319
0.429609
utils.py
pypi
from collections import defaultdict import re import attr import fingerprints from text_unidecode import unidecode from cluecode.copyrights import CopyrightDetector from commoncode.text import toascii from summarycode.utils import sorted_counter from summarycode.utils import get_resource_tallies from summarycode.uti...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/summarycode/copyright_tallies.py
0.444806
0.157363
copyright_tallies.py
pypi
from collections import Counter import attr from commoncode.cliutils import POST_SCAN_GROUP, PluggableCommandLineOption from plugincode.post_scan import PostScanPlugin, post_scan_impl from summarycode.utils import (get_resource_tallies, set_resource_tallies, sorted_counter) # Tracing ...
/scancode_toolkit_mini-32.0.6-cp311-none-any.whl/summarycode/tallies.py
0.550366
0.161982
tallies.py
pypi
""" Monkeypatch Pool iterators so that Ctrl-C interrupts everything properly derived from https://gist.github.com/aljungberg/626518 Copyright (c) Alexander Ljungberg. All rights reserved. Modifications Copyright (c) nexB Inc. and others. All rights reserved. Permission is hereby granted, free of charge, to any perso...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/scancode/pool.py
0.710829
0.206854
pool.py
pypi
from itertools import islice from os.path import getsize import logging import os import sys from commoncode.filetype import get_last_modified_date from commoncode.hash import multi_checksums from scancode import ScancodeError from typecode.contenttype import get_type TRACE = os.environ.get('SCANCODE_DEBUG_API', Fal...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/scancode/api.py
0.54698
0.198258
api.py
pypi
# FIXME: the glob story is very weird!!! examples_text = ''' Scancode command lines examples: (Note for Windows: use '\\' back slash instead of '/' forward slash for paths.) Scan a single file for copyrights. Print scan results to stdout as pretty JSON: scancode --copyright samples/zlib/zlib.h --json-pp - Scan...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/scancode/help.py
0.430866
0.350866
help.py
pypi
import string import re import ipaddress import urlpy from commoncode.text import toascii from cluecode import finder_data from textcode import analysis # Tracing flags TRACE = False TRACE_URL = False TRACE_EMAIL = False def logger_debug(*args): pass if TRACE or TRACE_URL or TRACE_EMAIL: import loggin...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/cluecode/finder.py
0.543106
0.197735
finder.py
pypi
The purpose of `packagedcode` is to: - detect a package, - determine its dependencies, - collect its declared licensing (at the metadata/manifest level) vs. its actual license (as scanned and normalized). 1. **detect the presence of a package** in a codebase based on its manifest, its file or archive type. Typi...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/packagedcode/README.rst
0.895731
0.754418
README.rst
pypi
import ast from pathlib import Path """ Parse setup.py files. """ # https://setuptools.readthedocs.io/en/latest/setuptools.html#metadata FIELDS = { 'author_email', 'author', 'classifiers', 'dependency_links', 'description', 'download_url', 'extras_require', 'install_requires', 'k...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/packagedcode/pypi_setup_py.py
0.793826
0.294653
pypi_setup_py.py
pypi
from packagedcode import models """ Various package data file formats to implment. """ # Package types # NOTE: this is somewhat redundant with extractcode archive handlers # yet the purpose and semantics are rather different here # TODO: parse me!!! # TODO: add missing URLs and descriptions class JavaJarHandler(m...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/packagedcode/misc.py
0.428951
0.199191
misc.py
pypi
import io import re import attr from packageurl import PackageURL @attr.s() class GoModule(object): namespace = attr.ib(default=None) name = attr.ib(default=None) version = attr.ib(default=None) module = attr.ib(default=None) require = attr.ib(default=None) exclude = attr.ib(default=None) ...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/packagedcode/go_mod.py
0.532911
0.210259
go_mod.py
pypi
from commoncode import fileutils from packagedcode import models """ Handle README.*-style semi-structured package metadata. These are seen in Android, Chromium and a few more places. """ # Common README field name mapped to known PackageData field name PACKAGE_FIELD_BY_README_FIELD = { 'name': 'name', 'pro...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/packagedcode/readme.py
0.638835
0.247692
readme.py
pypi
import io import json from functools import partial from packagedcode import models """ Parse PHP composer package manifests, see https://getcomposer.org/ and https://packagist.org/ TODO: add support for composer.lock and packagist formats: both are fairly similar. """ class BasePhpComposerHandler(models.Datafile...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/packagedcode/phpcomposer.py
0.430028
0.158207
phpcomposer.py
pypi
import io import json from packageurl import PackageURL from packagedcode import models """ Handle haxelib Haxe packages See - https://lib.haxe.org/all/ this lists all the packages. - https://lib.haxe.org/documentation/creating-a-haxelib-package/ - https://github.com/HaxeFoundation/haxelib - https://github.com/gog...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/packagedcode/haxe.py
0.477067
0.245854
haxe.py
pypi
from contextlib import closing import pefile from ftfy import fix_text from commoncode import text from packagedcode import models from packagedcode.models import Party from packagedcode.models import party_org from typecode import contenttype TRACE = False def logger_debug(*args): pass if TRACE: impor...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/packagedcode/win_pe.py
0.564339
0.180504
win_pe.py
pypi
try: from license_expression import Licensing from license_expression import combine_expressions as le_combine_expressions except: Licensing = None le_combine_expressions = None PLAIN_URLS = ( 'https://', 'http://', ) VCS_URLS = ( 'git://', 'git+git://', 'git+https://', 'git+h...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/packagedcode/utils.py
0.509276
0.394551
utils.py
pypi
import io import json from commoncode import datautils from packagedcode import models import attr from packageurl import PackageURL """ Handle Godeps-like Go package dependency data. Note: there are other dependency tools for Go beside Godeps, yet several use the same format. Godeps (and glide, etc.) is mostly le...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/packagedcode/godeps.py
0.538741
0.242441
godeps.py
pypi
import warnings import saneyaml from packageurl import PackageURL from packagedcode import models """ Collect data from Dart pub packages. See https://dart.dev/tools/pub/pubspec API has theses URLs: is limited and only returns all versions of a package - feeds https://pub.dev/feed.atom - all packages, paginated: h...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/packagedcode/pubspec.py
0.525612
0.209834
pubspec.py
pypi
import re from collections import defaultdict from binascii import crc32 from itertools import islice from licensedcode.stopwords import STOPWORDS from textcode.analysis import numbered_text_lines """ Utilities to break texts in lines and tokens (aka. words) with specialized version for queries and rules texts. """ ...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/licensedcode/tokenize.py
0.533884
0.333856
tokenize.py
pypi
ScanCode license detection overview and key design elements =========================================================== License detection is about finding common texts between the text of a query file being scanned and the texts of the indexed license texts and rule texts. The process strives to be correct first and f...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/licensedcode/README.rst
0.932699
0.982288
README.rst
pypi
from collections.abc import Set from itertools import count from itertools import groupby from intbitset import intbitset """ Ranges and intervals of integers using bitmaps. Used as a compact and faster data structure for token and position sets. """ class Span(Set): """ Represent ranges of integers (such ...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/licensedcode/spans.py
0.91611
0.491334
spans.py
pypi
import os import json import pathlib from datetime import datetime from os.path import dirname from os.path import join from distutils.dir_util import copy_tree import click import saneyaml from commoncode.cliutils import MISC_GROUP from commoncode.cliutils import PluggableCommandLineOption from jinja2 import Enviro...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/licensedcode/license_db.py
0.499756
0.176175
license_db.py
pypi
from collections import namedtuple import sys import time """ Computes the difference between two texts. Originally based on Diff Match and Patch Copyright 2018 The diff-match-patch Authors. original author fraser@google.com (Neil Fraser) https://github.com/google/diff-match-patch Licensed under the Apache License...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/licensedcode/dmp.py
0.721056
0.490724
dmp.py
pypi
from time import time import sys from licensedcode.match import LicenseMatch from licensedcode.spans import Span TRACE = False TRACE2 = False TRACE3 = False def logger_debug(*args): pass if TRACE or TRACE2 or TRACE3: use_print = True if use_print: prn = print else: import logging ...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/licensedcode/match_seq.py
0.510008
0.242878
match_seq.py
pypi
from __future__ import absolute_import, division, print_function from ._compat import PY2 from ._make import NOTHING, Factory, pipe if not PY2: import inspect import typing __all__ = [ "default_if_none", "optional", "pipe", "to_bool", ] def optional(converter): """ A converter tha...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/licensedcode/_vendor/attr/converters.py
0.850142
0.249207
converters.py
pypi
from __future__ import absolute_import, division, print_function import operator import re from contextlib import contextmanager from ._config import get_run_validators, set_run_validators from ._make import _AndValidator, and_, attrib, attrs from .exceptions import NotCallableError try: Pattern = re.Pattern e...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/licensedcode/_vendor/attr/validators.py
0.844569
0.261016
validators.py
pypi
from __future__ import absolute_import, division, print_function from functools import total_ordering from ._funcs import astuple from ._make import attrib, attrs @total_ordering @attrs(eq=False, order=False, slots=True, frozen=True) class VersionInfo(object): """ A version object that can be compared to t...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/licensedcode/_vendor/attr/_version_info.py
0.805517
0.209389
_version_info.py
pypi
from __future__ import absolute_import, division, print_function import copy from ._compat import iteritems from ._make import NOTHING, _obj_setattr, fields from .exceptions import AttrsAttributeNotFoundError def asdict( inst, recurse=True, filter=None, dict_factory=dict, retain_collection_type...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/licensedcode/_vendor/attr/_funcs.py
0.874158
0.177668
_funcs.py
pypi
from __future__ import absolute_import, division, print_function import functools from ._compat import new_class from ._make import _make_ne _operation_names = {"eq": "==", "lt": "<", "le": "<=", "gt": ">", "ge": ">="} def cmp_using( eq=None, lt=None, le=None, gt=None, ge=None, require_sa...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/licensedcode/_vendor/attr/_cmp.py
0.847021
0.336876
_cmp.py
pypi
def get_relative_path(root_path, path): """ Return a path relativefrom the posix 'path' relative to a base path of `len_base_path` length where the base is a directory if `base_is_dir` True or a file otherwise. """ return path[len(root_path):].lstrip('/') LEGAL_STARTS_ENDS = ( 'copying',...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/summarycode/classify.py
0.479016
0.190611
classify.py
pypi
from collections import defaultdict import attr import click from commoncode.fileset import get_matches as get_fileset_matches from plugincode.pre_scan import PreScanPlugin from plugincode.pre_scan import pre_scan_impl from commoncode.cliutils import PluggableCommandLineOption from commoncode.cliutils import PRE_SCA...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/summarycode/facet.py
0.681833
0.260848
facet.py
pypi
def get_resource_summary(resource, key, as_attribute=False): """ Return the "summary" value as mapping for the `key` summary attribute of a resource. This is collected either from a direct Resource.summary attribute if `as_attribute` is True or as a Resource.extra_data summary item otherwise. ...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/summarycode/utils.py
0.874319
0.429609
utils.py
pypi
from collections import defaultdict import re import attr import fingerprints from text_unidecode import unidecode from cluecode.copyrights import CopyrightDetector from commoncode.text import toascii from summarycode.utils import sorted_counter from summarycode.utils import get_resource_tallies from summarycode.uti...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/summarycode/copyright_tallies.py
0.444806
0.157363
copyright_tallies.py
pypi
from collections import Counter import attr from commoncode.cliutils import POST_SCAN_GROUP, PluggableCommandLineOption from plugincode.post_scan import PostScanPlugin, post_scan_impl from summarycode.utils import (get_resource_tallies, set_resource_tallies, sorted_counter) # Tracing ...
/scancode-toolkit-32.0.6.tar.gz/scancode-toolkit-32.0.6/src/summarycode/tallies.py
0.550366
0.161982
tallies.py
pypi
from django import forms from django.apps import apps from django.core.exceptions import ValidationError from taggit.forms import TagField from taggit.forms import TagWidget from scanpipe.models import Project from scanpipe.pipes.fetch import fetch_urls scanpipe_app = apps.get_app_config("scanpipe") class Multipl...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/forms.py
0.695235
0.178884
forms.py
pypi
from django.db import migrations, models import django.db.models.deletion import scanpipe.models class Migration(migrations.Migration): dependencies = [ ("scanpipe", "0021_codebaseresource_package_data"), ] operations = [ migrations.RenameField( model_name='discoveredpackage...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/migrations/0022_create_discovereddependencies_model.py
0.58059
0.200245
0022_create_discovereddependencies_model.py
pypi
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("scanpipe", "0024_remove_discoveredpackage_dependencies_data"), ] operations = [ migrations.RemoveField( model_name="discoveredpackage", name="last_modified_date", ...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/migrations/0025_remove_discoveredpackage_last_modified_date_and_more.py
0.639398
0.201499
0025_remove_discoveredpackage_last_modified_date_and_more.py
pypi
from django.db import migrations, models import django.db.models.deletion import scanpipe.models import uuid class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='CodebaseResource', fields=[ ...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/migrations/0001_initial.py
0.585338
0.232071
0001_initial.py
pypi
from django.db import migrations from django.db.models import Q from django.conf import settings def compute_package_declared_license_expression_spdx(apps, schema_editor): """ Compute DiscoveredPackage `declared_license_expression_spdx`, when missing, from `declared_license_expression`, when available. ...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/migrations/0031_scancode_toolkit_v32_data_updates.py
0.739046
0.228156
0031_scancode_toolkit_v32_data_updates.py
pypi
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("scanpipe", "0029_codebaseresource_scanpipe_co_type_ea1dd7_idx_and_more"), ] operations = [ migrations.RemoveIndex( model_name="discoveredpackage", name="scanpipe_di_...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/migrations/0030_scancode_toolkit_v32_model_updates.py
0.717309
0.215289
0030_scancode_toolkit_v32_model_updates.py
pypi
from django.apps import apps from rest_framework import serializers from taggit.serializers import TaggitSerializer from taggit.serializers import TagListSerializerField from scanpipe.api import ExcludeFromListViewMixin from scanpipe.models import CodebaseRelation from scanpipe.models import CodebaseResource from sc...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/api/serializers.py
0.848251
0.196152
serializers.py
pypi
import json import re from contextlib import suppress from dataclasses import dataclass from dataclasses import field from datetime import datetime from pathlib import Path from typing import List # Python 3.8 compatibility SPDX_SPEC_VERSION = "2.3" SPDX_LICENSE_LIST_VERSION = "3.20" SPDX_SCHEMA_NAME = "spdx-schema-...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/pipes/spdx.py
0.770206
0.225193
spdx.py
pypi
import re from pathlib import Path java_package_re = re.compile(r"^\s*package\s+([\w\.]+)\s*;") def get_java_package(location, java_extensions=(".java",), **kwargs): """ Return a Java package as a mapping with a single "java_package" key, or ``None`` from the .java source code file at ``location``. ...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/pipes/jvm.py
0.82734
0.235911
jvm.py
pypi
from commoncode.resource import VirtualCodebase from scanpipe.models import Project def sort_by_lower_name(resource): return resource["name"].lower() def get_resource_fields(resource, fields): """Return a mapping of fields from `fields` and values from `resource`""" return {field: getattr(resource, fi...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/pipes/codebase.py
0.874426
0.354489
codebase.py
pypi
import concurrent.futures import json import logging import multiprocessing import os import shlex from collections import defaultdict from functools import partial from pathlib import Path from django.apps import apps from django.conf import settings from django.db.models import ObjectDoesNotExist from commoncode i...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/pipes/scancode.py
0.697918
0.156749
scancode.py
pypi
from typing import NamedTuple import ahocorasick """ Path matching using Aho-Corasick automatons. The approach is to create a trie of all reversed path suffixes aka. subpath each mapped to a tuple of: (subpath length, [list of path ids]). And then search this index using Aho-Corasick search. For instance with...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/pipes/pathmap.py
0.901086
0.569553
pathmap.py
pypi
import logging import posixpath from collections import namedtuple from pathlib import Path from container_inspector.image import Image from container_inspector.utils import extract_tar from scanpipe import pipes from scanpipe.pipes import flag from scanpipe.pipes import rootfs logger = logging.getLogger(__name__) ...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/pipes/docker.py
0.778102
0.319679
docker.py
pypi
import hashlib import json from contextlib import suppress from pathlib import Path from django.core.exceptions import MultipleObjectsReturned from django.core.exceptions import ObjectDoesNotExist from scanpipe import pipes from scanpipe.models import CodebaseResource from scanpipe.pipes import flag from scanpipe.pi...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/pipes/js.py
0.761272
0.31237
js.py
pypi
import shutil from pathlib import Path from django.core.exceptions import FieldDoesNotExist from django.core.validators import EMPTY_VALUES from django.db import models import openpyxl from scanpipe import pipes from scanpipe.models import CodebaseRelation from scanpipe.models import CodebaseResource from scanpipe....
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/pipes/input.py
0.754192
0.215041
input.py
pypi
import fnmatch import logging import os from django.core.exceptions import ObjectDoesNotExist from django.db.models import Q import attr from commoncode.ignore import default_ignores from container_inspector.distro import Distro from packagedcode import plugin_package from scanpipe import pipes from scanpipe.pipes ...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/pipes/rootfs.py
0.730001
0.173498
rootfs.py
pypi
import json import sys from pathlib import Path from django.core.validators import EMPTY_VALUES from attributecode.model import About from packagedcode import APPLICATION_PACKAGE_DATAFILE_HANDLERS from packagedcode.licensing import get_license_detections_and_expression from packageurl import PackageURL from python_i...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/pipes/resolve.py
0.619817
0.194024
resolve.py
pypi
from scanpipe.pipelines import Pipeline from scanpipe.pipes import d2d from scanpipe.pipes import flag from scanpipe.pipes import matchcode from scanpipe.pipes import purldb from scanpipe.pipes import scancode class DeployToDevelop(Pipeline): """ Relate deploy and develop code trees. This pipeline is ex...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/pipelines/deploy_to_develop.py
0.830663
0.236406
deploy_to_develop.py
pypi
from scanpipe.pipelines import Pipeline from scanpipe.pipes import flag from scanpipe.pipes import rootfs from scanpipe.pipes import scancode class RootFS(Pipeline): """Analyze a Linux root filesystem, aka rootfs.""" @classmethod def steps(cls): return ( cls.extract_input_files_to_co...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/pipelines/root_filesystems.py
0.714329
0.216529
root_filesystems.py
pypi
import json from django.core.serializers.json import DjangoJSONEncoder from commoncode.hash import multi_checksums from scanpipe.pipelines import Pipeline from scanpipe.pipes import input from scanpipe.pipes import scancode from scanpipe.pipes.scancode import extract_archive class ScanPackage(Pipeline): """ ...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/pipelines/scan_package.py
0.653901
0.213603
scan_package.py
pypi
from scanpipe.pipelines.root_filesystems import RootFS from scanpipe.pipes import docker from scanpipe.pipes import rootfs class Docker(RootFS): """Analyze Docker images.""" @classmethod def steps(cls): return ( cls.extract_images, cls.extract_layers, cls.find...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/pipelines/docker.py
0.805403
0.27661
docker.py
pypi
import inspect import logging import traceback import warnings from contextlib import contextmanager from functools import wraps from pydoc import getdoc from pydoc import splitdoc from timeit import default_timer as timer from django.utils import timezone from pyinstrument import Profiler from scanpipe import huma...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/pipelines/__init__.py
0.814791
0.240418
__init__.py
pypi
from scanpipe import pipes from scanpipe.pipelines import Pipeline from scanpipe.pipes import scancode from scanpipe.pipes.input import copy_inputs class ScanCodebase(Pipeline): """ Scan a codebase with ScanCode-toolkit. If the codebase consists of several packages and dependencies, it will try to r...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/pipelines/scan_codebase.py
0.739046
0.228081
scan_codebase.py
pypi
from scanpipe.pipelines import Pipeline from scanpipe.pipes import resolve from scanpipe.pipes import update_or_create_package class InspectManifest(Pipeline): """ Inspect one or more manifest files and resolve its packages. Supports: - BOM: SPDX document, CycloneDX BOM, AboutCode ABOUT file - P...
/scancodeio-32.6.0.tar.gz/scancodeio-32.6.0/scanpipe/pipelines/inspect_manifest.py
0.827584
0.151341
inspect_manifest.py
pypi