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 |
|---|---|---|---|---|---|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class WantAction(BaseModel):
"""The act of expressing a desire about the object. An agent wants an object.
References:
https://schema.org/WantAction
Note:
Model Depth... | /schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/WantAction.py | 0.934178 | 0.411702 | WantAction.py | pypi |
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class MoneyTransfer(BaseModel):
"""The act of transferring money from one place to another place. This may occur electronically or physically.
References:
https://schema.org/Mone... | /schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/MoneyTransfer.py | 0.909546 | 0.379263 | MoneyTransfer.py | pypi |
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class RestockingFees(BaseModel):
"""Specifies that the customer must pay a restocking fee when returning a product.
References:
https://schema.org/RestockingFees
Note:
... | /schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/RestockingFees.py | 0.948597 | 0.333368 | RestockingFees.py | pypi |
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class VenueMap(BaseModel):
"""A venue map (e.g. for malls, auditoriums, museums, etc.).
References:
https://schema.org/VenueMap
Note:
Model Depth 5
Attributes:
... | /schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/VenueMap.py | 0.932376 | 0.316448 | VenueMap.py | pypi |
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class BeautySalon(BaseModel):
"""Beauty salon.
References:
https://schema.org/BeautySalon
Note:
Model Depth 5
Attributes:
potentialAction: (Optional[Union... | /schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/BeautySalon.py | 0.865579 | 0.367582 | BeautySalon.py | pypi |
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class Grant(BaseModel):
"""A grant, typically financial or otherwise quantifiable, of resources. Typically a [[funder]] sponsors some [[MonetaryAmount]] to an [[Organization]] or [[Person]], ... | /schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/Grant.py | 0.936278 | 0.373704 | Grant.py | pypi |
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class EUEnergyEfficiencyCategoryA3Plus(BaseModel):
"""Represents EU Energy Efficiency Class A+++ as defined in EU energy labeling regulations.
References:
https://schema.org/EUEn... | /schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/EUEnergyEfficiencyCategoryA3Plus.py | 0.943835 | 0.321247 | EUEnergyEfficiencyCategoryA3Plus.py | pypi |
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class VideoGameClip(BaseModel):
"""A short segment/part of a video game.
References:
https://schema.org/VideoGameClip
Note:
Model Depth 4
Attributes:
pote... | /schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/VideoGameClip.py | 0.925592 | 0.343232 | VideoGameClip.py | pypi |
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class EUEnergyEfficiencyCategoryE(BaseModel):
"""Represents EU Energy Efficiency Class E as defined in EU energy labeling regulations.
References:
https://schema.org/EUEnergyEffi... | /schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/EUEnergyEfficiencyCategoryE.py | 0.943458 | 0.313236 | EUEnergyEfficiencyCategoryE.py | pypi |
import os
import logging
import re
from lxml.etree import ElementTree as XMLElementTree, Element as XMLElement, SubElement as XMLSubelement, Comment as XMLComment, QName, indent
import json
from schemata.structures import *
logger = logging.getLogger("schemata.exporters")
class JSONSchemasExporter(object):
... | /schematacode-1.0.1.tar.gz/schematacode-1.0.1/schemata/exporters.py | 0.720565 | 0.332256 | exporters.py | pypi |
import logging
logger = logging.getLogger("schemata.structures")
"""
This module contains the core classes for Schemata.
There are, broadly, three categories of class here.
The first is the Schema class, which simply represents the entire schema. It contains all of the structures.
The second is structure classes.... | /schematacode-1.0.1.tar.gz/schematacode-1.0.1/schemata/structures.py | 0.909902 | 0.677607 | structures.py | pypi |
import os
import logging
import re
from lxml.etree import ElementTree as XMLElementTree, Element as XMLElement, SubElement as XMLSubelement, Comment as XMLComment, QName, indent
import json
from schemata.structures import *
logger = logging.getLogger("schemata.parser")
"""
This module contains the Schemata parse... | /schematacode-1.0.1.tar.gz/schematacode-1.0.1/schemata/parser.py | 0.567577 | 0.254868 | parser.py | pypi |
import argparse
import datetime
import re
import sys
from typing import Generator, List, Optional
PYPROJECT_PATH = "pyproject.toml"
CHANGELOG_PATH = "docs/changelog.rst"
COMPARE_URL_PREFIX = "https://github.com/schemathesis/schemathesis/compare/"
def _read_changelog() -> List[str]:
with open(CHANGELOG_PATH) as f... | /schemathesis-3.19.2.tar.gz/schemathesis-3.19.2/changelog.py | 0.599954 | 0.165425 | changelog.py | pypi |
<p align="center">
<em>Discover API-breaking payloads, keep API documentation up-to-date, and increase confidence in your API</em>
</p>
<p align="center">
<a href="https://github.com/schemathesis/schemathesis/actions" target="_blank">
<img src="https://github.com/schemathesis/schemathesis/actions/workf... | /schemathesis-3.19.2.tar.gz/schemathesis-3.19.2/README.md | 0.60871 | 0.938688 | README.md | pypi |
Authentication
==============
In this section, we'll cover how to use Schemathesis to test APIs that require authentication.
We'll start with the basics of setting authentication credentials manually using headers, cookies, and query strings.
Then, we'll move on to more advanced topics, including HTTP Basic, Digest Au... | /schemathesis-3.19.2.tar.gz/schemathesis-3.19.2/docs/auth.rst | 0.90851 | 0.69766 | auth.rst | pypi |
Data generation
===============
This section describes how Schemathesis generates test examples and their serialization process.
Schemathesis converts Open API schemas to compatible JSON Schemas and passes them to ``hypothesis-jsonschema``, which generates data for those schemas.
.. important::
If the API schem... | /schemathesis-3.19.2.tar.gz/schemathesis-3.19.2/docs/how.rst | 0.90341 | 0.753399 | how.rst | pypi |
from typing import Any
from tenacity import retry, stop_after_attempt, wait_fixed, retry_if_exception_type
import synapseclient # type: ignore
import pandas # type: ignore
class SynapseTableNameError(Exception):
"""SynapseTableNameError"""
def __init__(self, message: str, table_name: str) -> None:
... | /schematic_db-0.0.31-py3-none-any.whl/schematic_db/synapse/synapse.py | 0.878686 | 0.188137 | synapse.py | pypi |
from enum import Enum
from typing import Any, Optional, TypeVar
from pydantic.dataclasses import dataclass
from pydantic import validator
class ColumnDatatype(Enum):
"""A generic datatype that should be supported by all database types."""
TEXT = "text"
DATE = "date"
INT = "int"
FLOAT = "float"
... | /schematic_db-0.0.31-py3-none-any.whl/schematic_db/db_schema/db_schema.py | 0.958158 | 0.371279 | db_schema.py | pypi |
# pylint: disable=duplicate-code
from typing import Any
from os import getenv
from datetime import datetime
import pytz
import requests
import pandas
from schematic_db.manifest_store.manifest_metadata_list import ManifestMetadataList
class SchematicAPIError(Exception):
"""When schematic API response status code ... | /schematic_db-0.0.31-py3-none-any.whl/schematic_db/api_utils/api_utils.py | 0.850407 | 0.195959 | api_utils.py | pypi |
import pandas as pd
from schematic_db.rdb.rdb import RelationalDatabase
from schematic_db.query_store.synapse_query_store import QueryStore
class DuplicateColumnError(Exception):
"""Occurs when a query results in a table with duplicate columns"""
def __init__(self, table_name: str) -> None:
"""
... | /schematic_db-0.0.31-py3-none-any.whl/schematic_db/rdb_queryer/rdb_queryer.py | 0.860823 | 0.255564 | rdb_queryer.py | pypi |
from typing import Any
import numpy
import pandas
import sqlalchemy
import sqlalchemy.dialects.postgresql
from sqlalchemy.inspection import inspect
from sqlalchemy import exc
from schematic_db.db_schema.db_schema import ColumnDatatype
from .sql_alchemy_database import SQLAlchemyDatabase, SQLConfig
from .rdb import Upse... | /schematic_db-0.0.31-py3-none-any.whl/schematic_db/rdb/postgres.py | 0.79546 | 0.227995 | postgres.py | pypi |
from abc import ABC, abstractmethod
import pandas as pd
from schematic_db.db_schema.db_schema import TableSchema
class UpsertDatabaseError(Exception):
"""Raised when a database class catches an error doing an upsert"""
def __init__(self, table_name: str) -> None:
"""
Args:
table_n... | /schematic_db-0.0.31-py3-none-any.whl/schematic_db/rdb/rdb.py | 0.857872 | 0.349699 | rdb.py | pypi |
from typing import Any
import pandas
import numpy
import sqlalchemy
import sqlalchemy.dialects.mysql
from sqlalchemy import exc
from schematic_db.db_schema.db_schema import (
ColumnDatatype,
ColumnSchema,
)
from .sql_alchemy_database import SQLAlchemyDatabase, SQLConfig
from .rdb import UpsertDatabaseError
cl... | /schematic_db-0.0.31-py3-none-any.whl/schematic_db/rdb/mysql.py | 0.825132 | 0.271916 | mysql.py | pypi |
# pylint: disable=duplicate-code
from typing import Any
import json
import re
from pydantic.dataclasses import dataclass
from pydantic import validator
@dataclass()
class ManifestMetadata:
"""Metadata for a manifest in Synapse."""
dataset_id: str
dataset_name: str
manifest_id: str
manifest_name: ... | /schematic_db-0.0.31-py3-none-any.whl/schematic_db/manifest_store/manifest_metadata_list.py | 0.897762 | 0.3214 | manifest_metadata_list.py | pypi |
from typing import Optional
import pandas
from deprecation import deprecated
from schematic_db.schema_graph.schema_graph import SchemaGraph
from schematic_db.api_utils.api_utils import ManifestMetadataList
from schematic_db.synapse.synapse import Synapse
from .manifest_store import ManifestStore, ManifestStoreConfig
... | /schematic_db-0.0.31-py3-none-any.whl/schematic_db/manifest_store/synapse_manifest_store.py | 0.906457 | 0.156846 | synapse_manifest_store.py | pypi |
# pylint: disable=duplicate-code
from typing import Optional
import pandas
from schematic_db.api_utils.api_utils import (
get_project_manifests,
download_manifest,
ManifestMetadataList,
)
from schematic_db.schema_graph.schema_graph import SchemaGraph
from .manifest_store import ManifestStore, ManifestStore... | /schematic_db-0.0.31-py3-none-any.whl/schematic_db/manifest_store/api_manifest_store.py | 0.891457 | 0.154663 | api_manifest_store.py | pypi |
from abc import ABC, abstractmethod
import re
import pandas
from pydantic.dataclasses import dataclass
from pydantic import validator
import validators
from schematic_db.api_utils.api_utils import ManifestMetadataList
@dataclass()
class ManifestStoreConfig:
"""
A config for a ManifestStore.
Properties:
... | /schematic_db-0.0.31-py3-none-any.whl/schematic_db/manifest_store/manifest_store.py | 0.852997 | 0.23105 | manifest_store.py | pypi |
from typing import Optional, Any
from deprecation import deprecated
from schematic_db.db_schema.db_schema import (
ForeignKeySchema,
ColumnSchema,
ColumnDatatype,
)
DATATYPES = {
"str": ColumnDatatype.TEXT,
"float": ColumnDatatype.FLOAT,
"int": ColumnDatatype.INT,
"date": ColumnDatatype.DA... | /schematic_db-0.0.31-py3-none-any.whl/schematic_db/schema/database_config.py | 0.906129 | 0.255016 | database_config.py | pypi |
# pylint: disable=duplicate-code
from typing import Optional
import warnings
from pydantic.dataclasses import dataclass
from pydantic import validator
import validators
from schematic_db.db_schema.db_schema import (
DatabaseSchema,
TableSchema,
ForeignKeySchema,
ColumnSchema,
ColumnDatatype,
)
from... | /schematic_db-0.0.31-py3-none-any.whl/schematic_db/schema/schema.py | 0.90839 | 0.252511 | schema.py | pypi |
# Schematic
[](https://actions-badge.atrox.dev/Sage-Bionetworks/schematic/goto?ref=develop) [
class InvalidResourceError(Exception):
"""
... | /schematicpy-23.8.1.tar.gz/schematicpy-23.8.1/schematic/loader.py | 0.864182 | 0.186873 | loader.py | pypi |
# pylint: disable=line-too-long
#!/usr/bin/env python3
# `schematic manifest` related sub-commands description
manifest_commands = {
"manifest": {
"config": (
"Specify the path to the `config.yml` using this option. This is a required argument."
),
"get": {
"short_he... | /schematicpy-23.8.1.tar.gz/schematicpy-23.8.1/schematic/help.py | 0.74055 | 0.42483 | help.py | pypi |
from typing import Optional, Any, Sequence
class MissingConfigValueError(Exception):
"""Exception raised when configuration value not provided in config file.
Args:
config_keys: tuple of keys as present in config file.
message: custom/pre-defined error message to be returned.
Returns:
... | /schematicpy-23.8.1.tar.gz/schematicpy-23.8.1/schematic/exceptions.py | 0.94152 | 0.162879 | exceptions.py | pypi |
__author__ = "Jaakko Salonen"
__copyright__ = "Copyright 2011-2012, Jaakko Salonen"
__version__ = "0.5.0"
__license__ = "MIT"
__status__ = "Prototype"
from urllib.parse import unquote
from copy import copy
from rdflib import BNode, URIRef
import sys
if sys.version_info.major == 3:
unicode = str
try:
from r... | /schematicpy-23.8.1.tar.gz/schematicpy-23.8.1/schematic/schemas/curie.py | 0.478285 | 0.160562 | curie.py | pypi |
import os
from jsonschema import validate
from schematic.utils.io_utils import load_schemaorg, load_json, load_default
from schematic.utils.general import str2list, dict2list, find_duplicates
from schematic.utils.curie_utils import (
expand_curies_in_schema,
extract_name_from_uri_or_curie,
)
from schematic.uti... | /schematicpy-23.8.1.tar.gz/schematicpy-23.8.1/schematic/schemas/validator.py | 0.449634 | 0.323848 | validator.py | pypi |
import inspect
import logging
from typing import Any, Mapping, Sequence, Union, List
from functools import reduce
import re
logger = logging.getLogger(__name__)
# We are using fstrings in logger methods
# pylint: disable=logging-fstring-interpolation
def query_dict(dictionary: Mapping[Any, Any], keys: Sequence[An... | /schematicpy-23.8.1.tar.gz/schematicpy-23.8.1/schematic/utils/cli_utils.py | 0.928676 | 0.346099 | cli_utils.py | pypi |
from io import StringIO
import json
import logging
import networkx as nx
import numpy as np
import os
from os import path
import pandas as pd
# allows specifying explicit variable types
from typing import Any, Dict, Optional, Text, List
from schematic.utils.viz_utils import visualize
from schematic.visualization.attr... | /schematicpy-23.8.1.tar.gz/schematicpy-23.8.1/schematic/visualization/tangled_tree.py | 0.76895 | 0.264103 | tangled_tree.py | pypi |
import gc
import json
import logging
import numpy as np
import os
import pandas as pd
from typing import Any, Dict, Optional, Text, List
from schematic.schemas import SchemaGenerator
from schematic.utils.io_utils import load_json
logger = logging.getLogger(__name__)
class AttributesExplorer():
def __init__(self,... | /schematicpy-23.8.1.tar.gz/schematicpy-23.8.1/schematic/visualization/attributes_explorer.py | 0.735167 | 0.214568 | attributes_explorer.py | pypi |
import re
from dataclasses import field
from pydantic.dataclasses import dataclass
from pydantic import validator, ConfigDict, Extra
# This turns on validation for value assignments after creation
pydantic_config = ConfigDict(validate_assignment=True, extra=Extra.forbid)
@dataclass(config=pydantic_config)
class Syn... | /schematicpy-23.8.1.tar.gz/schematicpy-23.8.1/schematic/configuration/dataclasses.py | 0.85738 | 0.400017 | dataclasses.py | pypi |
from typing import Optional, Any
import os
import yaml
from schematic.utils.general import normalize_path
from .dataclasses import (
SynapseConfig,
ManifestConfig,
ModelConfig,
GoogleSheetsConfig,
)
class ConfigNonAllowedFieldError(Exception):
"""Raised when a user submitted config file contains ... | /schematicpy-23.8.1.tar.gz/schematicpy-23.8.1/schematic/configuration/configuration.py | 0.909914 | 0.174199 | configuration.py | pypi |
2.1.0 / Unreleased
==================
**[BREAKING CHANGE]**
- Drop Python 2.6 support
`#517 <https://github.com/schematics/schematics/pull/517>`__
(`rooterkyberian <https://github.com/rooterkyberian>`__)
Other changes:
- Add TimedeltaType
`#540 <https://github.com/schematics/schematics/pull/540>`__
(`gabisur... | /schematics-fork-2.1.1.tar.gz/schematics-fork-2.1.1/HISTORY.rst | 0.816626 | 0.734429 | HISTORY.rst | pypi |
from __future__ import absolute_import
import functools
import operator
import sys
__all__ = ['PY2', 'PY3', 'string_type', 'iteritems', 'metaclass', 'py_native_string', 'reraise', 'str_compat']
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
if PY2:
__all__ += ['bytes', 'str', 'map', 'zip', 'r... | /schematics-fork-2.1.1.tar.gz/schematics-fork-2.1.1/schematics/compat.py | 0.561816 | 0.163813 | compat.py | pypi |
from __future__ import unicode_literals, absolute_import
import inspect
import functools
from .common import *
from .datastructures import Context
from .exceptions import FieldError, DataError
from .transforms import import_loop, validation_converter
from .undefined import Undefined
from .iteration import atoms
__a... | /schematics-fork-2.1.1.tar.gz/schematics-fork-2.1.1/schematics/validate.py | 0.841598 | 0.490175 | validate.py | pypi |
from __future__ import unicode_literals, absolute_import
from collections import namedtuple
from .compat import iteritems
from .undefined import Undefined
try:
# optional type checking
import typing
if typing.TYPE_CHECKING:
from typing import Mapping, Tuple, Callable, Optional, Any, Iterable
... | /schematics-fork-2.1.1.tar.gz/schematics-fork-2.1.1/schematics/iteration.py | 0.899635 | 0.335514 | iteration.py | pypi |
from .compat import str_compat, repr_compat
try:
from collections.abc import Set # PY3
except ImportError:
from collections import Set # PY2
@repr_compat
@str_compat
class Role(Set):
"""
A ``Role`` object can be used to filter specific fields against a sequence.
The ``Role`` contains two thin... | /schematics-fork-2.1.1.tar.gz/schematics-fork-2.1.1/schematics/role.py | 0.857872 | 0.576482 | role.py | pypi |
from __future__ import unicode_literals, absolute_import
from .compat import *
try:
from collections.abc import Mapping, Sequence # PY3
except ImportError:
from collections import Mapping, Sequence # PY2
__all__ = []
class DataObject(object):
"""
An object for holding data as attributes.
`... | /schematics-fork-2.1.1.tar.gz/schematics-fork-2.1.1/schematics/datastructures.py | 0.85166 | 0.312632 | datastructures.py | pypi |
from __future__ import unicode_literals, absolute_import
import json
from .common import *
from .compat import string_type, str_compat
from .datastructures import FrozenDict, FrozenList
from .translator import LazyText
try:
from collections.abc import Mapping, Sequence # PY3
except ImportError:
from collec... | /schematics-fork-2.1.1.tar.gz/schematics-fork-2.1.1/schematics/exceptions.py | 0.834036 | 0.178633 | exceptions.py | pypi |
import functools
from ..transforms import convert, to_primitive
from ..validate import validate
def _callback_wrap(data, schema, transform, *args, **kwargs):
return transform(schema, data, *args, **kwargs)
class Machine(object):
""" A poor man's state machine. """
states = ('raw', 'converted', 'valida... | /schematics-fork-2.1.1.tar.gz/schematics-fork-2.1.1/schematics/contrib/machine.py | 0.615666 | 0.265556 | machine.py | pypi |
from __future__ import unicode_literals, absolute_import
try:
from enum import Enum
except ImportError:
pass
from ..exceptions import ConversionError
from ..translator import _
from ..types import BaseType
from ..compat import string_type
class EnumType(BaseType):
"""A field type allowing to use native ... | /schematics-fork-2.1.1.tar.gz/schematics-fork-2.1.1/schematics/contrib/enum_type.py | 0.798933 | 0.265065 | enum_type.py | pypi |
from __future__ import unicode_literals, absolute_import
import copy
import datetime
import decimal
import itertools
import numbers
import random
import re
import string
import uuid
from collections import OrderedDict
from ..common import *
from ..exceptions import *
from ..translator import _
from ..undefined impo... | /schematics-fork-2.1.1.tar.gz/schematics-fork-2.1.1/schematics/types/base.py | 0.789761 | 0.175644 | base.py | pypi |
from typing import Type
from schematics.common import NOT_NONE
from schematics.exceptions import ConversionError
from schematics.types import BaseType
from schematics.undefined import Undefined
from schematics_proto3.enum import ProtobufEnum
from schematics_proto3.types.base import ProtobufTypeMixin
from schematics_p... | /schematics_proto3-0.1.3-py3-none-any.whl/schematics_proto3/types/enum.py | 0.692538 | 0.225918 | enum.py | pypi |
from schematics.common import NOT_NONE
from schematics.exceptions import ValidationError, DataError, CompoundError, StopValidationError
from schematics.types import CompoundType, BaseType
from schematics.undefined import Undefined
from schematics_proto3.oneof import OneOfVariant
from schematics_proto3.types.base impor... | /schematics_proto3-0.1.3-py3-none-any.whl/schematics_proto3/types/oneof.py | 0.602062 | 0.244036 | oneof.py | pypi |
this change log is not maintained in this fork
2.1.0 / Unreleased
==================
**[BREAKING CHANGE]**
- Drop Python 2.6 support
`#517 <https://github.com/schematics/schematics/pull/517>`__
(`rooterkyberian <https://github.com/rooterkyberian>`__)
Other changes:
- Add TimedeltaType
`#540 <https://github.co... | /schematics-py310-plus-0.0.4.tar.gz/schematics-py310-plus-0.0.4/HISTORY.rst | 0.72331 | 0.706444 | HISTORY.rst | pypi |
.. _types:
=====
Types
=====
Types are the smallest definition of structure in Schematics. They represent
structure by offering functions to inspect or mutate the data in some way.
According to Schematics, a type is an instance of a way to do three things:
1. Coerce the data type into an appropriate representation... | /schematics-py310-plus-0.0.4.tar.gz/schematics-py310-plus-0.0.4/docs/usage/types.rst | 0.947817 | 0.699889 | types.rst | pypi |
.. _exporting:
=========
Exporting
=========
To export data is to go from the Schematics representation of data to some
other form. It's also possible you want to adjust some things along the way,
such as skipping over some fields or providing empty values for missing fields.
The general mechanism for data export i... | /schematics-py310-plus-0.0.4.tar.gz/schematics-py310-plus-0.0.4/docs/usage/exporting.rst | 0.86511 | 0.748582 | exporting.rst | pypi |
import functools
import inspect
from typing import List
from .datastructures import Context
from .exceptions import DataError, FieldError
from .iteration import atoms
from .transforms import import_loop, validation_converter
from .undefined import Undefined
__all__: List[str] = []
def schema_from(obj):
try:
... | /schematics-py310-plus-0.0.4.tar.gz/schematics-py310-plus-0.0.4/schematics/validate.py | 0.862685 | 0.534795 | validate.py | pypi |
from typing import (
TYPE_CHECKING,
Any,
Callable,
Iterable,
Mapping,
NamedTuple,
Optional,
Tuple,
)
from .undefined import Undefined
if TYPE_CHECKING:
from schematics.schema import Schema
class Atom(NamedTuple):
name: Optional[str] = None
field: Optional[str] = None
... | /schematics-py310-plus-0.0.4.tar.gz/schematics-py310-plus-0.0.4/schematics/iteration.py | 0.905873 | 0.423995 | iteration.py | pypi |
from collections.abc import Set
class Role(Set):
"""
A ``Role`` object can be used to filter specific fields against a sequence.
The ``Role`` contains two things: a set of names and a function.
The function describes how to filter, taking a field name as input and then
returning ``True`` or ``Fa... | /schematics-py310-plus-0.0.4.tar.gz/schematics-py310-plus-0.0.4/schematics/role.py | 0.929696 | 0.73456 | role.py | pypi |
from collections.abc import Mapping, Sequence
from typing import List
__all__: List[str] = []
class DataObject:
"""
An object for holding data as attributes.
``DataObject`` can be instantiated like ``dict``::
>>> d = DataObject({'one': 1, 'two': 2}, three=3)
>>> d.__dict__
{'on... | /schematics-py310-plus-0.0.4.tar.gz/schematics-py310-plus-0.0.4/schematics/datastructures.py | 0.909872 | 0.480662 | datastructures.py | pypi |
import inspect
from collections import ChainMap, OrderedDict
from copy import deepcopy
from types import FunctionType, MappingProxyType
from typing import List
from . import schema
from .datastructures import Context
from .exceptions import (
DataError,
MockCreationError,
UndefinedValueError,
UnknownF... | /schematics-py310-plus-0.0.4.tar.gz/schematics-py310-plus-0.0.4/schematics/models.py | 0.861553 | 0.200773 | models.py | pypi |
import json
from collections.abc import Mapping, Sequence
from typing import Optional, Type
from .datastructures import FrozenDict, FrozenList
from .translator import LazyText
__all__ = [
"BaseError",
"ErrorMessage",
"FieldError",
"ConversionError",
"ValidationError",
"StopValidationError",
... | /schematics-py310-plus-0.0.4.tar.gz/schematics-py310-plus-0.0.4/schematics/exceptions.py | 0.873997 | 0.215268 | exceptions.py | pypi |
import functools
from ..transforms import convert, to_primitive
from ..validate import validate
def _callback_wrap(data, schema, transform, *args, **kwargs):
return transform(schema, data, *args, **kwargs)
class Machine:
"""A poor man's state machine."""
states = ("raw", "converted", "validated", "ser... | /schematics-py310-plus-0.0.4.tar.gz/schematics-py310-plus-0.0.4/schematics/contrib/machine.py | 0.68437 | 0.328987 | machine.py | pypi |
from enum import Enum
from ..exceptions import ConversionError
from ..translator import _
from ..types import BaseType
class EnumType(BaseType):
"""A field type allowing to use native enums as values.
Restricts values to enum members and (optionally) enum values.
`use_values` - if set to True allows do a... | /schematics-py310-plus-0.0.4.tar.gz/schematics-py310-plus-0.0.4/schematics/contrib/enum_type.py | 0.838845 | 0.330201 | enum_type.py | pypi |
import itertools
from collections.abc import Iterable, Mapping, Sequence
from typing import Type, TypeVar
from ..common import DROP, NONEMPTY, NOT_NONE
from ..exceptions import BaseError, CompoundError, ConversionError, ValidationError
from ..transforms import (
convert,
export_loop,
get_export_context,
... | /schematics-py310-plus-0.0.4.tar.gz/schematics-py310-plus-0.0.4/schematics/types/compound.py | 0.820326 | 0.17075 | compound.py | pypi |
import copy
import datetime
import decimal
import itertools
import numbers
import random
import re
import string
import uuid
from collections import OrderedDict
from collections.abc import Iterable
from typing import Any, Optional, Type
from ..common import DEFAULT, NATIVE, NONEMPTY, PRIMITIVE
from ..exceptions import... | /schematics-py310-plus-0.0.4.tar.gz/schematics-py310-plus-0.0.4/schematics/types/base.py | 0.771715 | 0.195479 | base.py | pypi |
import inspect
from collections import namedtuple
from schematics import models
from schematics import types
name = 'schematics_to_swagger'
DEFAULT_SWAGGER_VERSION = 2
SwaggerProp = namedtuple('SwaggerProp', ['name', 'func'], defaults=(None, lambda x: x))
_KNOWN_PROPS = {
'max_length': SwaggerProp('maxLength')... | /schematics_to_swagger-1.4.7-py3-none-any.whl/schematics_to_swagger/__init__.py | 0.530236 | 0.332608 | __init__.py | pypi |
import collections
import numbers
import lxml.builder
import lxml.etree
from schematics import Model
from schematics.types import BaseType, ModelType, CompoundType, ListType, DictType
from schematics.types.base import MultilingualStringType
from schematics.types.compound import PolyModelType
from xmltodict import pars... | /schematics-xml-0.2.1.tar.gz/schematics-xml-0.2.1/schematics_xml/models.py | 0.727685 | 0.298798 | models.py | pypi |
2.1.1 / 2021-08-17
==================
- Update error message for incorrect choices field
`#572 <https://github.com/schematics/schematics/pull/572>`__
(`begor <https://github.com/begor>`__)
- Avoid some deprecation warnings when using Python 3
`#576 <https://github.com/schematics/schematics/pull/576>`__
(`jesusl... | /schematics-2.1.1.tar.gz/schematics-2.1.1/HISTORY.rst | 0.787278 | 0.657799 | HISTORY.rst | pypi |
Digital Logic
=============
.. jupyter-execute::
:hide-code:
%config InlineBackend.figure_format = 'svg'
import schemdraw
from schemdraw import logic
Logic gates can be drawn by importing the :py:mod:`schemdraw.logic.logic` module:
.. code-block:: python
from schemdraw import logic
Logic gat... | /schemdraw-0.17.tar.gz/schemdraw-0.17/docs/elements/logic.rst | 0.887296 | 0.711681 | logic.rst | pypi |
Flowcharts and Diagrams
=======================
.. jupyter-execute::
:hide-code:
%config InlineBackend.figure_format = 'svg'
import schemdraw
from schemdraw import flow
Schemdraw provides basic symbols for flowcharting and state diagrams.
The :py:mod:`schemdraw.flow.flow` module contains a set of f... | /schemdraw-0.17.tar.gz/schemdraw-0.17/docs/elements/flow.rst | 0.886482 | 0.667792 | flow.rst | pypi |
Digital Logic
=============
.. jupyter-execute::
:hide-code:
%config InlineBackend.figure_format = 'svg'
import schemdraw
from schemdraw import logic
Logic gates can be drawn by importing the :py:mod:`schemdraw.logic.logic` module:
.. code-block:: python
from schemdraw import logic
Logic gat... | /schemdraw-0.17.tar.gz/schemdraw-0.17/docs/elements/.ipynb_checkpoints/logic-checkpoint.rst | 0.887296 | 0.711681 | logic-checkpoint.rst | pypi |
Flowcharts and Diagrams
=======================
.. jupyter-execute::
:hide-code:
%config InlineBackend.figure_format = 'svg'
import schemdraw
from schemdraw import flow
Schemdraw provides basic symbols for flowcharting and state diagrams.
The :py:mod:`schemdraw.flow.flow` module contains a set of f... | /schemdraw-0.17.tar.gz/schemdraw-0.17/docs/elements/.ipynb_checkpoints/flow-checkpoint.rst | 0.886482 | 0.667792 | flow-checkpoint.rst | pypi |
Customizing Elements
====================
.. jupyter-execute::
:hide-code:
%config InlineBackend.figure_format = 'svg'
import schemdraw
from schemdraw import elements as elm
from schemdraw import logic
from schemdraw.segments import *
Grouping Elements
-----------------
If a set of circuit ... | /schemdraw-0.17.tar.gz/schemdraw-0.17/docs/usage/customizing.rst | 0.897803 | 0.693447 | customizing.rst | pypi |
.. jupyter-execute::
:hide-code:
%config InlineBackend.figure_format = 'svg'
import schemdraw
from schemdraw import elements as elm
.. _placement:
Placing Elements
================
Elements are added to a Drawing using the `add` method or `+=` shortcut.
The Drawing maintains a current position ... | /schemdraw-0.17.tar.gz/schemdraw-0.17/docs/usage/placement.rst | 0.887552 | 0.699857 | placement.rst | pypi |
Getting Started
===============
Installation
------------
schemdraw can be installed from pip using
.. code-block:: bash
pip install schemdraw
or to include optional ``matplotlib`` backend dependencies:
.. code-block:: bash
pip install schemdraw[matplotlib]
To allow the SVG drawing :ref:`backends` to re... | /schemdraw-0.17.tar.gz/schemdraw-0.17/docs/usage/start.rst | 0.953221 | 0.68635 | start.rst | pypi |
.. jupyter-execute::
:hide-code:
%config InlineBackend.figure_format = 'svg'
import schemdraw
from schemdraw import elements as elm
.. _placement:
Placing Elements
================
Elements are added to a Drawing using the `add` method or `+=` shortcut.
The Drawing maintains a current position ... | /schemdraw-0.17.tar.gz/schemdraw-0.17/docs/usage/.ipynb_checkpoints/placement-checkpoint.rst | 0.887552 | 0.699857 | placement-checkpoint.rst | pypi |
Customizing Elements
====================
.. jupyter-execute::
:hide-code:
%config InlineBackend.figure_format = 'svg'
import schemdraw
from schemdraw import elements as elm
from schemdraw import logic
from schemdraw.segments import *
Grouping Elements
-----------------
If a set of circuit ... | /schemdraw-0.17.tar.gz/schemdraw-0.17/docs/usage/.ipynb_checkpoints/customizing-checkpoint.rst | 0.897803 | 0.693447 | customizing-checkpoint.rst | pypi |
Getting Started
===============
Installation
------------
schemdraw can be installed from pip using
.. code-block:: bash
pip install schemdraw
or to include optional ``matplotlib`` backend dependencies:
.. code-block:: bash
pip install schemdraw[matplotlib]
To allow the SVG drawing :ref:`backends` to re... | /schemdraw-0.17.tar.gz/schemdraw-0.17/docs/usage/.ipynb_checkpoints/start-checkpoint.rst | 0.953221 | 0.68635 | start-checkpoint.rst | pypi |
# Installation #
In your terminal (vagrant), do:
```bash
cd [repo]/protected/config
cp db.json.sample db.json
cd [repo]/protected/schema
virtualenv env
. env/bin/activate
pip install -r requirements.txt
```
Next time, when you want to run schemup:
```bash
. env/bin/activate
python update.py commit
```
# General #
... | /schemup-1.0.1.zip/schemup-1.0.1/README.md | 0.675978 | 0.727806 | README.md | pypi |
2.1.1 / 2021-08-17
==================
- Update error message for incorrect choices field
`#572 <https://github.com/schematics/schematics/pull/572>`__
(`begor <https://github.com/begor>`__)
- Avoid some deprecation warnings when using Python 3
`#576 <https://github.com/schematics/schematics/pull/576>`__
(`jesusl... | /schemv-2.1.1.1.tar.gz/schemv-2.1.1.1/HISTORY.rst | 0.787278 | 0.657799 | HISTORY.rst | pypi |
:github_url:
.. _about:
.. index::
single: synopsis
single: motivation
single: implementation
single: use cases
About ``scherbelberg``
======================
.. _synopsis:
Synopsis
--------
*scherbelberg* provides both a :ref:`command line interface (CLI) <cli>` and a :ref:`Python application prog... | /scherbelberg-0.0.6.tar.gz/scherbelberg-0.0.6/docs/source/about.rst | 0.939803 | 0.671928 | about.rst | pypi |
import json
from datetime import datetime
from pydantic import BaseModel
from scherkhan.models.enums import WebsocketMessageType
class BaseMessage(BaseModel):
"""Base message model."""
type: WebsocketMessageType
car_id: int
data: dict
class CmdMessageData(BaseModel):
"""Cmd message data model... | /scherkhan_auto-0.1.0.tar.gz/scherkhan_auto-0.1.0/src/scherkhan/models/websocket.py | 0.667473 | 0.29116 | websocket.py | pypi |
import time
import numpy as np
from schicluster import *
from sklearn.cluster import KMeans, SpectralClustering
from sklearn.metrics.cluster import adjusted_rand_score as ARI
mm9dim = [197195432, 181748087, 159599783, 155630120, 152537259, 149517037, 152524553, 131738871, 124076172, 129993255,
121843856, 121... | /schicluster-1.3.2.tar.gz/schicluster-1.3.2/example/example.py | 0.466846 | 0.317334 | example.py | pypi |
# SchNetPack - Deep Neural Networks for Atomistic Systems
[](https://travis-ci.com/atomistic-machine-learning/schnetpack)
[](https://github.com/py... | /schnetpack-2.0.3.tar.gz/schnetpack-2.0.3/README.md | 0.78695 | 0.990848 | README.md | pypi |
from selenium import webdriver
from selenium.webdriver.common.by import By
import time
from . import helpers
def get_publication_data(author_id: str, author_name: str = '', preferred_browser: str = "safari") -> list[dict[str, str]]:
"""Retrieves data from Google Scholar.
This function is the primary web-uti... | /scholar-network-0.2.6.tar.gz/scholar-network-0.2.6/src/scholar_network/scraping.py | 0.519034 | 0.215361 | scraping.py | pypi |
from collections import defaultdict
from dataclasses import InitVar, dataclass, field
from typing import Union
@dataclass
class CustomCounter:
"""Custom counter class built to emulate Counter from std lib.
This class utilizes a specific use case for this program, and
uses 'reflexive tuple matching' to g... | /scholar-network-0.2.6.tar.gz/scholar-network-0.2.6/src/scholar_network/models.py | 0.917912 | 0.557905 | models.py | pypi |
# Scholar Scraper
This is a simple script to scrape the Google Scholar page of given authors and extract all the information about them (
publications, cites per year, etc.).
The script is written in Python 3 and uses the [`scholarly`](https://github.com/scholarly-python-package/scholarly)
library.
<br/>
## Install... | /scholar-scraper-1.0.11.tar.gz/scholar-scraper-1.0.11/README.md | 0.660939 | 0.930962 | README.md | pypi |
import json
from concurrent.futures import ThreadPoolExecutor
from typing import List
from scholarly import scholarly, ProxyGenerator
from .CustomScholarlyTypes import SimplifiedAuthor
from .utilities import JSONEncoder
MAX_RETRIES = 10
def set_new_proxy():
"""
Set a new proxy for the scholarly library.
... | /scholar-scraper-1.0.11.tar.gz/scholar-scraper-1.0.11/scholar_scraper/ScholarScraper.py | 0.793786 | 0.373533 | ScholarScraper.py | pypi |
[](https://github.com/scholarly-python-package/scholarly/actions?query=branch%3Amain)
[:
"""Walk a tree, applying an action to every object.
Returns a modified tree.
"""
if isinstance(x, list):
array = []
for item in x:
if isinstance(item, dict) and 't' in item:
res = action(item['t'], it... | /scholdocfilters-0.1.1.tar.gz/scholdocfilters-0.1.1/scholdocfilters.py | 0.526099 | 0.431045 | scholdocfilters.py | pypi |
from math import pi as _pi
from ._if_not_valid_raise import (_if_not_int_or_float_raise,
_if_not_positive_raise)
def circle_area(r):
"""Calculates the area of a trapezium using the formula:
area = \u03C0(radius squared)
Parameters
----------
r: int or float
... | /school_algorithms-1.14.0.tar.gz/school_algorithms-1.14.0/src/school_algorithms/circle.py | 0.950881 | 0.549338 | circle.py | pypi |
from ._if_not_valid_raise import _if_not_int_or_float_raise
def power_calc(E, t):
"""Calculates power from energy and time using the formula:
power = energy / time
Parameters
----------
E : int or float
The energy value in the equation.
t : int or float
The time value of t... | /school_algorithms-1.14.0.tar.gz/school_algorithms-1.14.0/src/school_algorithms/physics.py | 0.960352 | 0.774711 | physics.py | pypi |
__author__ = "Marc-Olivier Derouin"
__email__ = "marcolivier.derouin@poulet-frit.com"
import re
from typing import List, Tuple
import unittest
from abc import ABC, abstractmethod
class Equality(ABC):
"""Abstract base class for equality definitions"""
def __init__(self, expected: str):
"""Initialize ... | /school_grader-4.0.9.tar.gz/school_grader-4.0.9/src/school_grader/equality.py | 0.927429 | 0.779867 | equality.py | pypi |
class APIError(Exception):
"""Обработка всех типов ошибок"""
NAME = "APIError"
def __init__(self, url: str, status_code: int, description: str | None = None) -> None:
error_text = f"API-Error | {status_code}:{self.NAME}:\nURL: {url}"
if description:
error_text += f"\n{d... | /school_mosreg_api-0.9.4.tar.gz/school_mosreg_api-0.9.4/school_mosreg_api/exceptions.py | 0.471467 | 0.173533 | exceptions.py | pypi |
from datetime import date, datetime
from typing import Any, Optional
from .base import BaseAPI
from .. import types
class SchoolMosregRUAPI(BaseAPI):
"""Основной sync класс почти со всеми функциями API.\n~~~"""
def check_person(self, value):
if value == "me":
return (self.get_user()).perso... | /school_mosreg_api-0.9.4.tar.gz/school_mosreg_api-0.9.4/school_mosreg_api/api/methods.py | 0.700792 | 0.255471 | methods.py | pypi |
from .model import Type
from datetime import datetime
from .Works import Work
class ImportantWork(Type):
work: Work
subjectName: str
workTypeName: str
class Mark_(Type):
id: int
id_str: str
type: str
value: str
textValue: str | None = None
person: int
person_str: str | None ... | /school_mosreg_api-0.9.4.tar.gz/school_mosreg_api-0.9.4/school_mosreg_api/types/UserFeeds.py | 0.524882 | 0.267001 | UserFeeds.py | pypi |
from .model import Type
class HobbyGroup(Type):
schoolId: int
schoolId_str: str
hobbyGroupName: str
hobbyGroupDescription: str
hobbyGroupSchedule: str
hobbyGroupPayment: str | None | None = None
hobbyGroupEnrollment: str
class LearningResult(Type):
schoolId: int
schoolId_str: str
... | /school_mosreg_api-0.9.4.tar.gz/school_mosreg_api-0.9.4/school_mosreg_api/types/SchoolsParameters.py | 0.64512 | 0.346293 | SchoolsParameters.py | pypi |
import asyncio
from datetime import date, datetime
from typing import Any
from .base import AsyncBaseAPI
from .. import types
class AsyncSchoolMosregRUAPI(AsyncBaseAPI):
"""Основной Async класс почти со всеми функциями API.\n~~~"""
async def check_person(self, value):
if value == "me":
... | /school_mosreg_api-0.9.4.tar.gz/school_mosreg_api-0.9.4/school_mosreg_api/asyncapi/methods.py | 0.554229 | 0.250987 | methods.py | pypi |
# cjcx/cjcx_cxDgXscj.html?doType=query&gnmkdm=N305005&su=2018133209
from school_sdk.client.api import BaseCrawler
class Score(BaseCrawler):
year = None
term = None
def __init__(self, user_client) -> None:
super().__init__(user_client)
self.endpoints: dict = self.school.config['url_endpoin... | /school-sdk-1.5.0.tar.gz/school-sdk-1.5.0/school_sdk/client/api/score.py | 0.469277 | 0.192501 | score.py | pypi |
import requests
from majormode.perseus.constant.place import AddressComponentType
from majormode.perseus.model.geolocation import GeoPoint
from majormode.perseus.model.place import Place
GOOGLE_GEOCODING_API_URL = 'https://maps.googleapis.com/maps/api/geocode/json?address={}&key={}'
GOOGLE_PERSEUS_ADDRESS_COMPONEN... | /school_transport_application_form_tool-1.2.15-py3-none-any.whl/intek/application/geocoding.py | 0.538012 | 0.331864 | geocoding.py | pypi |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.