text stringlengths 24 1.04M | metadata stringlengths 233 497 |
|---|---|
### File: proto2ros_tests/test/generated/RemoteExecutionResultError.msg
# Remote execution error.
int32 code
# May contain backslashes ().
string reason
string[] traceback
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "omnetpp-msg", "repo_name": "minhanghuang/proto2ros", "path": "proto2ros_tests/test/generated/RemoteExecutionResultError.msg", "license": "mit", "size": 101} |
### File: proto2ros_tests/test/generated/Value.msg
# Heterogeneous value.
proto2ros_tests/ValueOneOfData data
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "omnetpp-msg", "repo_name": "minhanghuang/proto2ros", "path": "proto2ros_tests/test/generated/Value.msg", "license": "mit", "size": 60} |
### File: proto2ros_tests/test/generated/ValueOneOfData.msg
int8 DATA_NOT_SET=0
int8 DATA_NUMBER_SET=1
int8 DATA_TEXT_SET=2
int8 DATA_PAIR_SET=3
int8 DATA_LIST_SET=4
int8 DATA_DICT_SET=5
# Numeric value.
float32 number
# Text value.
string text
# Pair value.
proto2ros_tests/Pair pair
# List value.
proto2ros_tests/Lis... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "omnetpp-msg", "repo_name": "minhanghuang/proto2ros", "path": "proto2ros_tests/test/generated/ValueOneOfData.msg", "license": "mit", "size": 349} |
### File: proto2ros_tests/test/test_proto2ros.cpp
// Copyright (c) 2024 Boston Dynamics AI Institute LLC. All rights reserved.
// NOLINTBEGIN(readability-magic-numbers,readability-function-cognitive-complexity,cppcoreguidelines-pro-type-reinterpret-cast)
#include <bosdyn/api/geometry.pb.h>
#include <gtest/gtest.h>
#inc... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/proto2ros", "path": "proto2ros_tests/test/test_proto2ros.cpp", "license": "mit", "size": 24143} |
### File: Makefile
all: format tests
format:
isort src/pydocstyle
black src/pydocstyle
tests:
tox -e py,install,docs
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Makefile", "repo_name": "minhanghuang/pydocstyle", "path": "Makefile", "license": "mit", "size": 103} |
### File: docs/Makefile
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Makefile", "repo_name": "minhanghuang/pydocstyle", "path": "docs/Makefile", "license": "mit", "size": 6762} |
### File: docs/make.bat
@ECHO OFF
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set BUILDDIR=_build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
set I18NSPHINXOPTS=%SPHINXOPTS% .
if NOT "%PAPER%" == "" (
set ALLSPHINXOPTS=-D latex_paper_siz... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Batchfile", "repo_name": "minhanghuang/pydocstyle", "path": "docs/make.bat", "license": "mit", "size": 6701} |
### File: setup.py
from setuptools import setup
# Do not update the version manually - it is managed by `bumpversion`.
version = '6.1.2rc'
requirements = [
'snowballstemmer',
]
extra_requirements = {
'toml': ['toml'],
}
setup(
name='pydocstyle',
version=version,
description="Python docstring st... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pydocstyle", "path": "setup.py", "license": "mit", "size": 1599} |
### File: src/pydocstyle/__init__.py
# Temporary hotfix for flake8-docstrings
from .checker import ConventionChecker, check
from .parser import AllError
from .utils import __version__
from .violations import Error, conventions
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pydocstyle", "path": "src/pydocstyle/__init__.py", "license": "mit", "size": 190} |
### File: src/pydocstyle/__main__.py
#! /usr/bin/env python
"""Static analysis tool for checking docstring conventions and style.
The repository is located at:
http://github.com/PyCQA/pydocstyle
"""
__all__ = ()
def main() -> None:
from pydocstyle import cli
cli.main()
if __name__ == '__main__':
ma... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pydocstyle", "path": "src/pydocstyle/__main__.py", "license": "mit", "size": 288} |
### File: src/pydocstyle/checker.py
"""Parsed source code checkers for docstring violations."""
import ast
import string
import tokenize as tk
from collections import namedtuple
from itertools import chain, takewhile
from re import compile as re
from textwrap import dedent
from . import violations
from .config import... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pydocstyle", "path": "src/pydocstyle/checker.py", "license": "mit", "size": 44047} |
### File: src/pydocstyle/cli.py
"""Command line interface for pydocstyle."""
import logging
import sys
from .checker import check
from .config import ConfigurationParser, IllegalConfiguration
from .utils import log
from .violations import Error
__all__ = ('main',)
class ReturnCode:
no_violations_found = 0
v... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pydocstyle", "path": "src/pydocstyle/cli.py", "license": "mit", "size": 2893} |
### File: src/pydocstyle/config.py
"""Configuration file parsing and utilities."""
import copy
import itertools
import operator
import os
from collections import namedtuple
from collections.abc import Set
from configparser import NoOptionError, NoSectionError, RawConfigParser
from functools import reduce
from re impor... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pydocstyle", "path": "src/pydocstyle/config.py", "license": "mit", "size": 32749} |
### File: src/pydocstyle/parser.py
"""Python code parser."""
import sys
import textwrap
import tokenize as tk
from io import StringIO
from itertools import chain, dropwhile
from pathlib import Path
from re import compile as re
from typing import Tuple
from .utils import log
__all__ = (
'Parser',
'Definition'... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pydocstyle", "path": "src/pydocstyle/parser.py", "license": "mit", "size": 27641} |
### File: src/pydocstyle/utils.py
"""General shared utilities."""
import ast
import logging
import re
from itertools import tee, zip_longest
from typing import Any, Iterable, Tuple
# Do not update the version manually - it is managed by `bumpversion`.
__version__ = '6.1.2rc'
log = logging.getLogger(__name__)
#: Regul... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pydocstyle", "path": "src/pydocstyle/utils.py", "license": "mit", "size": 1326} |
### File: src/pydocstyle/violations.py
"""Docstring violation definition."""
from collections import namedtuple
from functools import partial
from itertools import dropwhile
from typing import Any, Callable, Iterable, List, Optional
from .parser import Definition
from .utils import is_blank
__all__ = ('Error', 'Erro... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pydocstyle", "path": "src/pydocstyle/violations.py", "license": "mit", "size": 12411} |
### File: src/pydocstyle/wordlists.py
"""Wordlists loaded from package data.
We can treat them as part of the code for the imperative mood check, and
therefore we load them at import time, rather than on-demand.
"""
import pkgutil
import re
from typing import Dict, Iterator, Set
import snowballstemmer
#: Regular ex... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pydocstyle", "path": "src/pydocstyle/wordlists.py", "license": "mit", "size": 1548} |
### File: src/tests/error_tests.py
"""Tests for the violations.Error class."""
import pytest
import collections
import textwrap
from pydocstyle.violations import Error
MockDefinition = collections.namedtuple('MockDefinition', ['source', 'start'])
def test_message_without_context():
"""Test a simple error messa... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pydocstyle", "path": "src/tests/error_tests.py", "license": "mit", "size": 1536} |
### File: src/tests/parser_test.py
"""Parser tests."""
import io
import sys
import pytest
import textwrap
from pathlib import Path
from pydocstyle.parser import Parser, ParseError
class CodeSnippet(io.StringIO):
"""A code snippet.
Automatically wraps snippet as a file-like object and handles line wraps.
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pydocstyle", "path": "src/tests/parser_test.py", "license": "mit", "size": 28193} |
### File: Dockerfile
FROM python:3
WORKDIR /usr/src/app
COPY requirements ./requirements
RUN pip install -r requirements/requirements.txt
RUN pip install -r requirements/requirements-tests.txt
COPY . .
RUN pip install .[tests]
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Dockerfile", "repo_name": "minhanghuang/pylama", "path": "Dockerfile", "license": "mit", "size": 209} |
### File: Makefile
MODULE=pylama
SPHINXBUILD=sphinx-build
ALLSPHINXOPTS= -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
BUILDDIR=_build
VIRTUAL_ENV ?= env
LIBSDIR=$(CURDIR)/libs
.PHONY: help
# target: help - Display callable targets
help:
@egrep "^# target:" [Mm]akefile
$(VIRTUAL_ENV): setup.cfg requ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Makefile", "repo_name": "minhanghuang/pylama", "path": "Makefile", "license": "mit", "size": 1798} |
### File: docs/conf.py
# -*- coding: utf-8 -*-
"""Setup pylama configuration."""
import os
import sys
import pkg_resources
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named '... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "docs/conf.py", "license": "mit", "size": 2178} |
### File: dummy.py
#!/usr/bin/env python
# coding: utf-8
# (c) 2005 Divmod, Inc. See LICENSE file for details
# commented code
#import os
# from foo import junk
# a = 3
a = 4
#foo(1, 2, 3)
class Message(object):
message = ''
message_args = ()
def __init__(self, filename, loc, use_column=True):
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "dummy.py", "license": "mit", "size": 3840} |
### File: pylama/__init__.py
"""Code audit tool for python.
:copyright: 2013 by Kirill Klenov.
"""
import logging
__version__ = "8.4.1"
LOGGER = logging.getLogger("pylama")
# pylama:ignore=D
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/__init__.py", "license": "mit", "size": 168} |
### File: pylama/__main__.py
"""Support the module execution."""
from pylama.main import shell
if __name__ == "__main__":
shell()
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/__main__.py", "license": "mit", "size": 107} |
### File: pylama/check_async.py
"""Support for checking code asynchronously."""
import logging
from concurrent.futures import ProcessPoolExecutor
from pathlib import Path
from typing import List
from pylama.config import Namespace
from pylama.errors import Error
try:
import multiprocessing
CPU_COUNT = multi... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/check_async.py", "license": "mit", "size": 1034} |
### File: pylama/config.py
"""Parse arguments from command line and configuration files."""
import fnmatch
import logging
import os
import re
import sys
from argparse import ArgumentParser, Namespace
from pathlib import Path
from typing import Any, Collection, Dict, List, Optional, Set, Union
from pylama import LOGGER... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/config.py", "license": "mit", "size": 9091} |
### File: pylama/config_toml.py
"""Pylama TOML configuration."""
import toml
from pylama.libs.inirama import Namespace as _Namespace
class Namespace(_Namespace):
"""Inirama-style wrapper for TOML config."""
def parse(self, source: str, update: bool = True, **params):
"""Parse TOML source as string.... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/config_toml.py", "license": "mit", "size": 950} |
### File: pylama/context.py
"""Manage resources."""
import ast
import os.path as op
import re
from argparse import Namespace
from copy import copy
from functools import lru_cache
from pathlib import Path
from tempfile import NamedTemporaryFile, mkdtemp
from typing import Dict, List, Set
from pylama.errors import Erro... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/context.py", "license": "mit", "size": 5984} |
### File: pylama/core.py
"""Pylama's core functionality.
Prepare params, check a modeline and run the checkers.
"""
import os.path as op
from pathlib import Path
from typing import List
from pylama.config import CURDIR, LOGGER, Namespace
from pylama.context import RunContext
from pylama.errors import Error, default_s... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/core.py", "license": "mit", "size": 1700} |
### File: pylama/errors.py
""" Don't duplicate same errors from different linters. """
from __future__ import annotations
import re
from collections import defaultdict
from typing import Any, DefaultDict, Dict, Generator, List, Set, Tuple
PATTERN_NUMBER = re.compile(r"^\s*([A-Z]\d+)\s*", re.I)
DUPLICATES: Dict[Tuple... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/errors.py", "license": "mit", "size": 3958} |
### File: pylama/hook.py
"""SCM hooks. Integration with git and mercurial."""
from __future__ import absolute_import
import sys
from configparser import ConfigParser # noqa
from os import chmod, getcwd
from os import path as op
from subprocess import PIPE, Popen
from typing import List, Tuple
from pylama.config imp... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/hook.py", "license": "mit", "size": 3415} |
### File: pylama/libs/__init__.py
""" Support libs. """
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/libs/__init__.py", "license": "mit", "size": 22} |
### File: pylama/libs/inirama.py
"""
Inirama is a python module that parses INI files.
.. _badges:
.. include:: ../README.rst
:start-after: .. _badges:
:end-before: .. _contents:
.. _description:
.. include:: ../README.rst
:start-after: .. _description:
:end-before:... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/libs/inirama.py", "license": "mit", "size": 9229} |
### File: pylama/lint/__init__.py
"""Custom module loader."""
from __future__ import annotations
from argparse import ArgumentParser
from importlib import import_module
from pathlib import Path
from pkgutil import walk_packages
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Type
from pkg_resources impor... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/lint/__init__.py", "license": "mit", "size": 1651} |
### File: pylama/lint/pylama_eradicate.py
"""Commented-out code checking."""
from eradicate import Eradicator
from pylama.context import RunContext
from pylama.lint import LinterV2 as Abstract
class Linter(Abstract):
"""Run commented-out code checking."""
name = "eradicate"
def run_check(self, ctx: Ru... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/lint/pylama_eradicate.py", "license": "mit", "size": 737} |
### File: pylama/lint/pylama_fake.py
"""A fake linter which one never be loaded."""
from typing import Any, Dict, List
import unknown_module # noqa
from pylama.lint import Linter as Abstract
class Linter(Abstract):
"""Just a fake."""
name = "fake"
def run(self, _path: str, **_) -> List[Dict[str, Any... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/lint/pylama_fake.py", "license": "mit", "size": 366} |
### File: pylama/lint/pylama_mccabe.py
"""Code complexity checking."""
from argparse import ArgumentError
from mccabe import McCabeChecker
from pylama.context import RunContext
from pylama.lint import ArgumentParser
from pylama.lint import LinterV2 as Abstract
class Linter(Abstract):
"""Run complexity checking.... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/lint/pylama_mccabe.py", "license": "mit", "size": 1355} |
### File: pylama/lint/pylama_mypy.py
"""MyPy support.
TODO: Error codes
"""
from __future__ import annotations
from mypy import api
from pylama.context import RunContext
from pylama.lint import LinterV2 as Abstract
class Linter(Abstract):
"""MyPy runner."""
name = "mypy"
def run_check(self, ctx: RunC... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/lint/pylama_mypy.py", "license": "mit", "size": 1606} |
### File: pylama/lint/pylama_pycodestyle.py
"""pycodestyle support."""
from pycodestyle import BaseReport, Checker, StyleGuide, get_parser
from pylama.context import RunContext
from pylama.lint import LinterV2 as Abstract
class Linter(Abstract):
"""pycodestyle runner."""
name = "pycodestyle"
def run_ch... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/lint/pylama_pycodestyle.py", "license": "mit", "size": 1494} |
### File: pylama/lint/pylama_pydocstyle.py
"""pydocstyle support."""
from argparse import ArgumentParser
from pydocstyle import ConventionChecker as PyDocChecker
from pydocstyle.violations import conventions
from pylama.context import RunContext
from pylama.lint import LinterV2 as Abstract
class Linter(Abstract):
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/lint/pylama_pydocstyle.py", "license": "mit", "size": 1542} |
### File: pylama/lint/pylama_pyflakes.py
"""Pyflakes support."""
from pyflakes import checker
from pylama.context import RunContext
from pylama.lint import LinterV2 as Abstract
m = checker.messages
CODES = {
m.UnusedImport.message: "W0611",
m.RedefinedWhileUnused.message: "W0404",
m.ImportShadowedByLoopV... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/lint/pylama_pyflakes.py", "license": "mit", "size": 1804} |
### File: pylama/lint/pylama_pylint.py
"""Pylint integration to Pylama."""
import logging
from argparse import ArgumentParser
from os import environ
from pathlib import Path
from typing import Dict
from pylint.interfaces import CONFIDENCE_LEVELS
from pylint.lint import Run
from pylint.reporters import BaseReporter
fr... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/lint/pylama_pylint.py", "license": "mit", "size": 3206} |
### File: pylama/lint/pylama_radon.py
"""Support Radon.
Supports stdin.
"""
from argparse import ArgumentError, ArgumentParser
from radon.complexity import add_inner_blocks
from radon.visitors import ComplexityVisitor
from pylama.context import RunContext
from pylama.lint import LinterV2 as Abstract
class Linter(... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/lint/pylama_radon.py", "license": "mit", "size": 2192} |
### File: pylama/lint/pylama_vulture.py
"""Support Vulture."""
from argparse import ArgumentParser
from vulture.core import ERROR_CODES, Vulture, make_config
from pylama.context import RunContext
from pylama.lint import LinterV2 as BaseLinter
class Linter(BaseLinter):
"""vulture runner."""
name = "vulture"... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/lint/pylama_vulture.py", "license": "mit", "size": 2240} |
### File: pylama/main.py
"""Pylama's shell support."""
import sys
import warnings
from json import dumps
from os import path as op
from os import walk
from pathlib import Path
from typing import List, Optional
from pylama.check_async import check_async
from pylama.config import CURDIR, Namespace, parse_options, setup... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/main.py", "license": "mit", "size": 3753} |
### File: pylama/pytest.py
""" py.test plugin for checking files with pylama. """
from __future__ import absolute_import
import pathlib
from os import path as op
import pytest
from pylama.config import CURDIR
from pylama.main import DEFAULT_FORMAT, check_paths, parse_options
HISTKEY = "pylama/mtimes"
def pytest_l... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/pytest.py", "license": "mit", "size": 2922} |
### File: pylama/utils.py
"""Pylama utils."""
from io import StringIO
from sys import stdin
from typing import List
def get_lines(value: str) -> List[str]:
"""Return lines from the given string."""
return StringIO(value).readlines()
def read(filename: str) -> str:
"""Read the given filename."""
wit... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "pylama/utils.py", "license": "mit", "size": 489} |
### File: setup.py
#!/usr/bin/env python
"""Setup pylama installation."""
import pathlib
import pkg_resources
from setuptools import setup
def parse_requirements(path: str) -> "list[str]":
with pathlib.Path(path).open(encoding='utf-8') as requirements:
return [str(req) for req in pkg_resources.parse_re... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "setup.py", "license": "mit", "size": 702} |
### File: tests/conftest.py
from pathlib import Path
from typing import Dict
import pytest
@pytest.fixture(scope="session")
def parse_options():
from pylama.config import parse_options as parse_options_
return parse_options_
@pytest.fixture(scope="session")
def parse_args(parse_options):
def parse_arg... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pylama", "path": "tests/conftest.py", "license": "mit", "size": 1090} |
### File: pyflakes/__init__.py
__version__ = '2.5.0'
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pyflakes", "path": "pyflakes/__init__.py", "license": "mit", "size": 22} |
### File: pyflakes/__main__.py
from pyflakes.api import main
# python -m pyflakes
if __name__ == '__main__':
main(prog='pyflakes')
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pyflakes", "path": "pyflakes/__main__.py", "license": "mit", "size": 105} |
### File: pyflakes/api.py
"""
API for the command-line I{pyflakes} tool.
"""
import ast
import os
import platform
import re
import sys
from pyflakes import checker, __version__
from pyflakes import reporter as modReporter
__all__ = ['check', 'checkPath', 'checkRecursive', 'iterSourceCode', 'main']
PYTHON_SHEBANG_REG... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pyflakes", "path": "pyflakes/api.py", "license": "mit", "size": 5625} |
### File: pyflakes/checker.py
"""
Main module.
Implement the central Checker class.
Also, it models the Bindings and Scopes.
"""
import __future__
import builtins
import ast
import bisect
import collections
import contextlib
import doctest
import functools
import os
import re
import string
import sys
import tokenize
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pyflakes", "path": "pyflakes/checker.py", "license": "mit", "size": 79606} |
### File: pyflakes/messages.py
"""
Provide the class Message and its subclasses.
"""
class Message:
message = ''
message_args = ()
def __init__(self, filename, loc):
self.filename = filename
self.lineno = loc.lineno
self.col = loc.col_offset
def __str__(self):
return ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pyflakes", "path": "pyflakes/messages.py", "license": "mit", "size": 10328} |
### File: pyflakes/reporter.py
"""
Provide the Reporter class.
"""
import re
import sys
class Reporter:
"""
Formats the results of pyflakes checks to users.
"""
def __init__(self, warningStream, errorStream):
"""
Construct a L{Reporter}.
@param warningStream: A file-like obj... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pyflakes", "path": "pyflakes/reporter.py", "license": "mit", "size": 3053} |
### File: pyflakes/scripts/pyflakes.py
"""
Implementation of the command-line I{pyflakes} tool.
"""
# For backward compatibility
__all__ = ['check', 'checkPath', 'checkRecursive', 'iterSourceCode', 'main']
from pyflakes.api import check, checkPath, checkRecursive, iterSourceCode, main
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pyflakes", "path": "pyflakes/scripts/pyflakes.py", "license": "mit", "size": 248} |
### File: pyflakes/test/harness.py
import ast
import textwrap
import unittest
from pyflakes import checker
__all__ = ['TestCase', 'skip', 'skipIf']
skip = unittest.skip
skipIf = unittest.skipIf
class TestCase(unittest.TestCase):
withDoctest = False
def flakes(self, input, *expectedOutputs, **kw):
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pyflakes", "path": "pyflakes/test/harness.py", "license": "mit", "size": 1004} |
### File: setup.py
#!/usr/bin/env python
# Copyright 2005-2011 Divmod, Inc.
# Copyright 2013 Florent Xicluna. See LICENSE file for details
import os.path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
extra = {'scripts': ["bin/pyflakes"]}
else:
extra = {
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pyflakes", "path": "setup.py", "license": "mit", "size": 2024} |
### File: CMakeLists.txt
cmake_minimum_required(VERSION 3.5)
project(python_cmake_module NONE)
find_package(ament_cmake REQUIRED)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()
ament_package(
CONFIG_EXTRAS "python_cmake_module-extras.cmake"
)
install... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/python_cmake_module", "path": "CMakeLists.txt", "license": "apache-2.0", "size": 349} |
### File: cmake/Modules/FindPythonExtra.cmake
# Copyright 2016 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LIC... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/python_cmake_module", "path": "cmake/Modules/FindPythonExtra.cmake", "license": "apache-2.0", "size": 3763} |
### File: python_cmake_module-extras.cmake
# Copyright 2016 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/python_cmake_module", "path": "python_cmake_module-extras.cmake", "license": "apache-2.0", "size": 740} |
### File: main.py
'''Train CIFAR10 with PyTorch.'''
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import torchvision
import torchvision.transforms as transforms
import os
import argparse
from models import *
from utils import progr... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pytorch-cifar", "path": "main.py", "license": "mit", "size": 4636} |
### File: models/__init__.py
from .vgg import *
from .dpn import *
from .lenet import *
from .senet import *
from .pnasnet import *
from .densenet import *
from .googlenet import *
from .shufflenet import *
from .shufflenetv2 import *
from .resnet import *
from .resnext import *
from .preact_resnet import *
from .mobil... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pytorch-cifar", "path": "models/__init__.py", "license": "mit", "size": 427} |
### File: models/densenet.py
'''DenseNet in PyTorch.'''
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class Bottleneck(nn.Module):
def __init__(self, in_planes, growth_rate):
super(Bottleneck, self).__init__()
self.bn1 = nn.BatchNorm2d(in_planes)
self.conv... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pytorch-cifar", "path": "models/densenet.py", "license": "mit", "size": 3542} |
### File: models/dla.py
'''DLA in PyTorch.
Reference:
Deep Layer Aggregation. https://arxiv.org/abs/1707.06484
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
class BasicBlock(nn.Module):
expansion = 1
def __init__(self, in_planes, planes, stride=1):
super(BasicBlock, self... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pytorch-cifar", "path": "models/dla.py", "license": "mit", "size": 4425} |
### File: models/dla_simple.py
'''Simplified version of DLA in PyTorch.
Note this implementation is not identical to the original paper version.
But it seems works fine.
See dla.py for the original paper version.
Reference:
Deep Layer Aggregation. https://arxiv.org/abs/1707.06484
'''
import torch
import torch.nn... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pytorch-cifar", "path": "models/dla_simple.py", "license": "mit", "size": 4084} |
### File: models/dpn.py
'''Dual Path Networks in PyTorch.'''
import torch
import torch.nn as nn
import torch.nn.functional as F
class Bottleneck(nn.Module):
def __init__(self, last_planes, in_planes, out_planes, dense_depth, stride, first_layer):
super(Bottleneck, self).__init__()
self.out_planes ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pytorch-cifar", "path": "models/dpn.py", "license": "mit", "size": 3562} |
### File: models/efficientnet.py
'''EfficientNet in PyTorch.
Paper: "EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks".
Reference: https://github.com/keras-team/keras-applications/blob/master/keras_applications/efficientnet.py
'''
import torch
import torch.nn as nn
import torch.nn.functional a... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pytorch-cifar", "path": "models/efficientnet.py", "license": "mit", "size": 5719} |
### File: models/googlenet.py
'''GoogLeNet with PyTorch.'''
import torch
import torch.nn as nn
import torch.nn.functional as F
class Inception(nn.Module):
def __init__(self, in_planes, n1x1, n3x3red, n3x3, n5x5red, n5x5, pool_planes):
super(Inception, self).__init__()
# 1x1 conv branch
sel... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pytorch-cifar", "path": "models/googlenet.py", "license": "mit", "size": 3221} |
### File: models/lenet.py
'''LeNet in PyTorch.'''
import torch.nn as nn
import torch.nn.functional as F
class LeNet(nn.Module):
def __init__(self):
super(LeNet, self).__init__()
self.conv1 = nn.Conv2d(3, 6, 5)
self.conv2 = nn.Conv2d(6, 16, 5)
self.fc1 = nn.Linear(16*5*5, 120)
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pytorch-cifar", "path": "models/lenet.py", "license": "mit", "size": 699} |
### File: models/mobilenet.py
'''MobileNet in PyTorch.
See the paper "MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications"
for more details.
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
class Block(nn.Module):
'''Depthwise conv + Pointwise conv'''
def ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pytorch-cifar", "path": "models/mobilenet.py", "license": "mit", "size": 2025} |
### File: models/mobilenetv2.py
'''MobileNetV2 in PyTorch.
See the paper "Inverted Residuals and Linear Bottlenecks:
Mobile Networks for Classification, Detection and Segmentation" for more details.
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
class Block(nn.Module):
'''expand + depthwi... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pytorch-cifar", "path": "models/mobilenetv2.py", "license": "mit", "size": 3092} |
### File: models/pnasnet.py
'''PNASNet in PyTorch.
Paper: Progressive Neural Architecture Search
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
class SepConv(nn.Module):
'''Separable Convolution.'''
def __init__(self, in_planes, out_planes, kernel_size, stride):
super(SepConv,... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pytorch-cifar", "path": "models/pnasnet.py", "license": "mit", "size": 4258} |
### File: models/preact_resnet.py
'''Pre-activation ResNet in PyTorch.
Reference:
[1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun
Identity Mappings in Deep Residual Networks. arXiv:1603.05027
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
class PreActBlock(nn.Module):
'''Pre-act... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pytorch-cifar", "path": "models/preact_resnet.py", "license": "mit", "size": 4078} |
### File: models/regnet.py
'''RegNet in PyTorch.
Paper: "Designing Network Design Spaces".
Reference: https://github.com/keras-team/keras-applications/blob/master/keras_applications/efficientnet.py
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
class SE(nn.Module):
'''Squeeze-and-Excitat... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pytorch-cifar", "path": "models/regnet.py", "license": "mit", "size": 4548} |
### File: models/resnet.py
'''ResNet in PyTorch.
For Pre-activation ResNet, see 'preact_resnet.py'.
Reference:
[1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun
Deep Residual Learning for Image Recognition. arXiv:1512.03385
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
class BasicBl... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pytorch-cifar", "path": "models/resnet.py", "license": "mit", "size": 4218} |
### File: models/resnext.py
'''ResNeXt in PyTorch.
See the paper "Aggregated Residual Transformations for Deep Neural Networks" for more details.
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
class Block(nn.Module):
'''Grouped convolution block.'''
expansion = 2
def __init__(sel... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pytorch-cifar", "path": "models/resnext.py", "license": "mit", "size": 3478} |
### File: models/senet.py
'''SENet in PyTorch.
SENet is the winner of ImageNet-2017. The paper is not released yet.
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
class BasicBlock(nn.Module):
def __init__(self, in_planes, planes, stride=1):
super(BasicBlock, self).__init__()
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pytorch-cifar", "path": "models/senet.py", "license": "mit", "size": 4027} |
### File: models/shufflenet.py
'''ShuffleNet in PyTorch.
See the paper "ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices" for more details.
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
class ShuffleBlock(nn.Module):
def __init__(self, groups):
s... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pytorch-cifar", "path": "models/shufflenet.py", "license": "mit", "size": 3542} |
### File: models/shufflenetv2.py
'''ShuffleNetV2 in PyTorch.
See the paper "ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design" for more details.
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
class ShuffleBlock(nn.Module):
def __init__(self, groups=2):
supe... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pytorch-cifar", "path": "models/shufflenetv2.py", "license": "mit", "size": 5530} |
### File: models/vgg.py
'''VGG11/13/16/19 in Pytorch.'''
import torch
import torch.nn as nn
cfg = {
'VGG11': [64, 'M', 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M'],
'VGG13': [64, 64, 'M', 128, 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M'],
'VGG16': [64, 64, 'M', 128, 128, 'M', 256, 256,... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pytorch-cifar", "path": "models/vgg.py", "license": "mit", "size": 1442} |
### File: utils.py
'''Some helper functions for PyTorch, including:
- get_mean_and_std: calculate the mean and std value of dataset.
- msr_init: net parameter initialization.
- progress_bar: progress bar mimic xlua.progress.
'''
import os
import sys
import time
import math
import torch.nn as nn
import torc... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/pytorch-cifar", "path": "utils.py", "license": "mit", "size": 3446} |
### File: CMakeLists.txt
cmake_minimum_required(VERSION 3.5)
project(python_qt_binding)
find_package(ament_cmake REQUIRED)
find_package(ament_cmake_python REQUIRED)
ament_python_install_package(${PROJECT_NAME}
PACKAGE_DIR src/${PROJECT_NAME})
install(FILES
cmake/shiboken_helper.cmake
cmake/sip_configure.py
c... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/python_qt_binding", "path": "CMakeLists.txt", "license": "bsd", "size": 804} |
### File: Makefile
.PHONY: all setup clean_dist distro clean install upload push
NAME=python_qt_binding
VERSION=`./setup.py --version`
all:
echo "noop for debbuild"
setup:
echo "building version ${VERSION}"
clean_dist:
-rm -f MANIFEST
-rm -rf dist
distro: setup clean_dist
python setup.py sdist
push: distro
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Makefile", "repo_name": "minhanghuang/python_qt_binding", "path": "Makefile", "license": "bsd", "size": 622} |
### File: cmake/shiboken_helper.cmake
# By default, without the settings below, find_package(Python3) will attempt
# to find the newest python version it can, and additionally will find the
# most specific version. For instance, on a system that has
# /usr/bin/python3.10, /usr/bin/python3.11, and /usr/bin/python3, it ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/python_qt_binding", "path": "cmake/shiboken_helper.cmake", "license": "bsd", "size": 6356} |
### File: cmake/sip_configure.py
import copy
import os
import re
import shutil
import subprocess
import sys
import tempfile
import PyQt5
from PyQt5 import QtCore
import sipconfig
libqt5_rename = False
class Configuration(sipconfig.Configuration):
def __init__(self):
env = copy.copy(os.environ)
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/python_qt_binding", "path": "cmake/sip_configure.py", "license": "bsd", "size": 7988} |
### File: cmake/sip_helper.cmake
if(__PYTHON_QT_BINDING_SIP_HELPER_INCLUDED)
return()
endif()
set(__PYTHON_QT_BINDING_SIP_HELPER_INCLUDED TRUE)
set(__PYTHON_QT_BINDING_SIP_HELPER_DIR ${CMAKE_CURRENT_LIST_DIR})
# By default, without the settings below, find_package(Python3) will attempt
# to find the newest python v... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/python_qt_binding", "path": "cmake/sip_helper.cmake", "license": "bsd", "size": 5205} |
### File: setup.py
#!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
try:
from catkin_pkg.python_setup import generate_distutils_setup
d = generate_distutils_setup()
except ImportError:
# extract information from package.xml manually when ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/python_qt_binding", "path": "setup.py", "license": "bsd", "size": 1693} |
### File: src/python_qt_binding/__init__.py
#!/usr/bin/env python
# Copyright (c) 2011, Dirk Thomas, Dorian Scholz, TU Darmstadt
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistri... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/python_qt_binding", "path": "src/python_qt_binding/__init__.py", "license": "bsd", "size": 2958} |
### File: src/python_qt_binding/binding_helper.py
#!/usr/bin/env python
# Copyright (c) 2011, Dirk Thomas, Dorian Scholz, TU Darmstadt
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Re... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/python_qt_binding", "path": "src/python_qt_binding/binding_helper.py", "license": "bsd", "size": 9980} |
### File: CMakeLists.txt
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(pytorch-cpp VERSION 1.0.0 LANGUAGES CXX)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
option(DOWNLOAD_DATASETS "Automatically download required datasets at build-time." ON)
option(CREATE_SCRIPTMODULES "Automatical... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/pytorch-cpp", "path": "CMakeLists.txt", "license": "mit", "size": 4567} |
### File: Dockerfile
# Based on and inspired by Dockerfiles and resources at:
# https://github.com/pytorch/pytorch/blob/master/Dockerfile
# https://github.com/anibali/docker-pytorch
# https://jtreminio.com/blog/running-docker-containers-as-current-host-user/
ARG BASE_IMAGE=ubuntu:18.04
ARG PYTHON_VERSION=3.8
FR... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Dockerfile", "repo_name": "minhanghuang/pytorch-cpp", "path": "Dockerfile", "license": "mit", "size": 2000} |
### File: cmake/check_files.cmake
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
function(check_files BASE_DIR FILES_TO_CHECK FILE_MD5S MISSING_FILES)
foreach(FILE_TO_CHECK ${${FILES_TO_CHECK}})
if(EXISTS "${BASE_DIR}/${FILE_TO_CHECK}")
list(FIND ${FILES_TO_CHECK} ${FILE_TO_CHECK} MD5_IDX)
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/pytorch-cpp", "path": "cmake/check_files.cmake", "license": "mit", "size": 763} |
### File: cmake/copy_torch_dlls.cmake
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
function(copy_torch_dlls TARGET_NAME)
# According to https://github.com/pytorch/pytorch/issues/25457
# the torch DLLs need to be copied to avoid memory errors.
# (see also: https://pytorch.org/cppdocs/installing.html )
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/pytorch-cpp", "path": "cmake/copy_torch_dlls.cmake", "license": "mit", "size": 799} |
### File: cmake/cpplint.cmake
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
find_program(CPPLINT cpplint)
if(CPPLINT)
set(CPPLINT_COMMAND ${CPPLINT})
else()
get_filename_component(CPPLINT_PY_FILE "cpplint.py" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_LIST_DIR}/../tools/")
if(NOT EXISTS ${CPPLINT_PY_FILE}... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/pytorch-cpp", "path": "cmake/cpplint.cmake", "license": "mit", "size": 1126} |
### File: cmake/create_torch_dll_hardlinks.cmake
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
file(GLOB TORCH_DLLS "${TORCH_INSTALL_PREFIX}/lib/*.dll")
foreach(TORCH_DLL_FILE ${TORCH_DLLS})
get_filename_component(TORCH_DLL_NAME ${TORCH_DLL_FILE} NAME)
# Create hardlink to the DLL fi... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/pytorch-cpp", "path": "cmake/create_torch_dll_hardlinks.cmake", "license": "mit", "size": 423} |
### File: cmake/fetch_cifar10.cmake
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
function(fetch_cifar10 DATA_DIR)
set(CIFAR_DIR "${DATA_DIR}/cifar10")
set(CIFAR_URL "https://www.cs.toronto.edu/~kriz/cifar-10-binary.tar.gz")
set(CIFAR_EXTRACTED_FILES
"data_batch_1.bin" "data_batch_2.bin" "data_b... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/pytorch-cpp", "path": "cmake/fetch_cifar10.cmake", "license": "mit", "size": 1637} |
### File: cmake/fetch_datasets.cmake
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
include(${CMAKE_CURRENT_LIST_DIR}/fetch_mnist.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/fetch_cifar10.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/fetch_penntreebank.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/fetch_neural_style_transfer_ima... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/pytorch-cpp", "path": "cmake/fetch_datasets.cmake", "license": "mit", "size": 350} |
### File: cmake/fetch_flickr8k.cmake
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
function(fetch_flickr8k DATA_DIR)
set(FLICKR8K_DIR "${DATA_DIR}/flickr_8k")
set(FLICKR8K_DOWNLOAD_DIR "${FLICKR8K_DIR}/download")
set(FLICKR8K_DATA_URL
"https://github.com/jbrownlee/Datasets/releases/download/Fli... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/pytorch-cpp", "path": "cmake/fetch_flickr8k.cmake", "license": "mit", "size": 1834} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.