zip stringlengths 19 109 | filename stringlengths 4 185 | contents stringlengths 0 30.1M | type_annotations listlengths 0 1.97k | type_annotation_starts listlengths 0 1.97k | type_annotation_ends listlengths 0 1.97k |
|---|---|---|---|---|---|
archives/0mars_monoskel.zip | packages/injector_provider/tests/test_injector_provider.py | from unittest.mock import patch
from injector import Injector, Module
from injector_provider.providers import InjectorProvider
class TestObjectGraphBuilder:
def test_can_build_without_any_configurations(self):
provider = InjectorProvider()
assert isinstance(provider.get_injector(), Injector)
... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/setup.py | from glob import glob
from os.path import abspath, dirname, join as pjoin
import pkg_resources
from setuptools import setup, find_packages
root = dirname(abspath(__file__))
def execfile(fname, globs, locs=None):
locs = locs or globs
exec(compile(open(fname).read(), fname, "exec"), globs, locs)
source_path... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/__init__.py | # project/__init__.py
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/_version.py | version_info = [0, 0, 1]
__version__ = "0.0.1"
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/configurations/__init__.py | [] | [] | [] | |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/configurations/app/__init__.py | [] | [] | [] | |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/configurations/app/main.py | import falcon
from meerkat.configurations.app import settings
from falcon_marshmallow import JSONEnforcer, EmptyRequestDropper
from meerkat.configurations.app.middlewares import RequestLoader
from injector_provider import InjectorProvider
from registry.services import Container, Registry
app = falcon.API(middleware=[... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/configurations/app/middlewares.py | import logging
import falcon
from falcon import HTTPUnprocessableEntity, HTTPBadRequest
from falcon_marshmallow import Marshmallow
from falcon_marshmallow.middleware import get_stashed_content
from marshmallow import ValidationError, Schema
log = logging.getLogger(__name__)
class HTTPValidationError(falcon.HTTPErro... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/configurations/app/settings.py | from meerkat.configurations.infrastructure.db import DataBaseService
from meerkat.configurations.infrastructure.di.service import DiService
from meerkat.configurations.infrastructure.environment import EnvironmentService
from meerkat.configurations.infrastructure.logging import LoggingService
from meerkat.configuration... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/configurations/infrastructure/db/__init__.py | from registry.services import BootableService, Container
from mongoengine import connect
class DataBaseService(BootableService):
def boot(self, container: Container):
from meerkat.configurations.app.settings import Props
host = container.get(Props.MONGO_HOST)
port = int(container.get(Pro... | [
"Container"
] | [
162
] | [
171
] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/configurations/infrastructure/di/__init__.py | [] | [] | [] | |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/configurations/infrastructure/di/domain.py | from buslane.events import EventBus
from injector import singleton, provider, Module
from meerkat.data_providers.database.mongo import PostMongoRepository
from meerkat.domain.post.use_cases import AddNewPostUseCase, PublishPostUseCase
class UseCasesConfigurator(Module):
@singleton
@provider
def add_new(s... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/configurations/infrastructure/di/service.py | from meerkat.configurations.app import settings
from meerkat.configurations.infrastructure.di.domain import UseCasesConfigurator
from registry.services import BootableService, Container
class DiService(BootableService):
def boot(self, container: Container):
provider = container.get(settings.Props.DI_PROVI... | [
"Container"
] | [
252
] | [
261
] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/configurations/infrastructure/environment/__init__.py | import os
from registry.services import BootableService, Container
class EnvironmentService(BootableService):
def boot(self, container: Container):
from meerkat.configurations.app.settings import Props
container.set(Props.APP_URL, os.environ.get(Props.APP_URL.value))
container.set(Prop... | [
"Container"
] | [
144
] | [
153
] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/configurations/infrastructure/logging/__init__.py | import logging as registry_logging
import sys
import registry.services
class LoggingService(registry.services.BootableService):
def boot(self, app: registry.services.Container):
registry_logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
le... | [
"registry.services.Container"
] | [
155
] | [
182
] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/configurations/infrastructure/rest/__init__.py | [] | [] | [] | |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/configurations/infrastructure/rest/health/__init__.py | import falcon
import json
from marshmallow import Schema, fields
# schema
class HealthSchema(Schema):
status: fields.Str = fields.Str(required=True)
message: fields.Str = fields.Str(required=True)
class HealthCheck:
# Handles GET requests
def on_get(self, req, resp):
"""Get app health
... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/configurations/infrastructure/rest/health/definitions.py | from injector import Module, singleton, provider
from meerkat.configurations.infrastructure.rest.health import HealthCheck
class HealthConfigurator(Module):
@singleton
@provider
def provide_health_check_resource(self) -> HealthCheck:
return HealthCheck()
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/configurations/infrastructure/rest/health/registry.py | from meerkat.configurations.app import settings
from meerkat.configurations.infrastructure.rest.health import HealthCheck
from meerkat.configurations.infrastructure.rest.health.definitions import HealthConfigurator
from registry.services import BootableService, Container
class HealthService(BootableService):
def ... | [
"Container"
] | [
342
] | [
351
] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/configurations/infrastructure/rest/swagger/__init__.py | import json
import falcon
from apispec import APISpec
from apispec.ext.marshmallow import MarshmallowPlugin
from falcon import Request
from falcon.response import Response
from falcon_apispec import FalconPlugin
from meerkat.configurations.infrastructure.rest.health import HealthSchema, HealthCheck
from meerkat.entry... | [
"Request",
"Response"
] | [
1451,
1466
] | [
1458,
1474
] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/configurations/infrastructure/rest/swagger/registry.py | from registry.services import BootableService, Container
from falcon_swagger_ui import register_swaggerui_app
class SwaggerService(BootableService):
def post_boot(self, container):
from meerkat.configurations.app import settings
from meerkat.configurations.infrastructure.rest.swagger import Swagge... | [
"Container"
] | [
1014
] | [
1023
] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/data_providers/__init__.py | [] | [] | [] | |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/data_providers/database/__init__.py | [] | [] | [] | |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/data_providers/database/mongo/__init__.py | # public interfaces
from .repositories import PostMongoRepository
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/data_providers/database/mongo/documents.py | from mongoengine import Document
from mongoengine.fields import StringField, UUIDField, BooleanField
class PostDocument(Document):
id = UUIDField(binary=False, primary_key=True)
title = StringField(max_length=512, required=True)
body = StringField(max_length=1024, required=True)
published = BooleanFie... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/data_providers/database/mongo/repositories.py | from injector import inject
from meerkat.domain.post.data_providers import PostDataProvider
from meerkat.domain.post.entities import Post
from meerkat.domain.post.value_objects import Id
from meerkat.domain.post.data_providers.exceptions import EntityNotFoundException
from meerkat.data_providers.database.mongo.transfo... | [
"PostDocumentTransformer",
"Post",
"Id"
] | [
525,
616,
744
] | [
548,
620,
746
] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/data_providers/database/mongo/transformers.py | from meerkat.data_providers.database.mongo.documents import PostDocument
from meerkat.domain.post.entities import Post
from meerkat.domain.post.value_objects import Id, Title, Body
class PostDocumentTransformer:
def transform_to_document(self, post: Post) -> PostDocument:
return PostDocument(id=post.id.va... | [
"Post",
"PostDocument"
] | [
256,
487
] | [
260,
499
] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/domain/__init__.py | [] | [] | [] | |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/domain/exceptions.py | class DomainException(Exception):
pass
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/domain/post/__init__.py | [] | [] | [] | |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/domain/post/data_providers/__init__.py | import abc
from meerkat.domain.post.entities.post import Post
from meerkat.domain.post.value_objects import Id
class PostDataProvider(metaclass=abc.ABCMeta):
@abc.abstractmethod
def save(self, post: Post):
""" Saves the post to the data-store
Args:
post (Post): The post en... | [
"Post",
"Id"
] | [
210,
440
] | [
214,
442
] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/domain/post/data_providers/exceptions.py | class EntityNotFoundException(Exception):
pass
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/domain/post/entities/__init__.py | from .post import Post
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/domain/post/entities/exceptions/__init__.py | from meerkat.domain.exceptions import DomainException
class PublishingFailedException(DomainException):
pass
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/domain/post/entities/post.py | from meerkat.domain.post.entities.exceptions import PublishingFailedException
from meerkat.domain.post.value_objects import Title, Body, Id
class Post:
id: Id
title: Title
body: Body
published: bool = False
@staticmethod
def create(id: Id, title: Title, body: Body):
instance = Post()
... | [
"Id",
"Title",
"Body"
] | [
263,
274,
287
] | [
265,
279,
291
] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/domain/post/events/__init__.py | from .post_created import PostCreated
from .post_published import PostPublished
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/domain/post/events/post_created.py | from dataclasses import dataclass
from buslane.events import Event
from meerkat.domain.post.entities.post import Post
@dataclass(frozen=True)
class PostCreated(Event):
post: Post
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/domain/post/events/post_published.py | from dataclasses import dataclass
from buslane.events import Event
from meerkat.domain.post.entities.post import Post
@dataclass(frozen=True)
class PostPublished(Event):
post: Post
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/domain/post/use_cases/__init__.py | from .add_new_post import AddNewPostUseCase
from .publish_post import PublishPostUseCase
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/domain/post/use_cases/add_new_post.py | import uuid
from buslane.events import EventBus
from dataclasses import dataclass
from meerkat.domain.post.data_providers import PostDataProvider
from meerkat.domain.post.entities import Post
from meerkat.domain.post.events import PostCreated
from meerkat.domain.post.value_objects import Title, Body, Id
@dataclass(f... | [
"PostDataProvider",
"EventBus",
"AddNewPostCommand"
] | [
451,
480,
598
] | [
467,
488,
615
] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/domain/post/use_cases/publish_post.py | from buslane.events import EventBus
from dataclasses import dataclass
from meerkat.domain.post.data_providers import PostDataProvider
from meerkat.domain.post.events import PostPublished
from meerkat.domain.post.value_objects import Id
@dataclass(frozen=True)
class PublishPostCommand:
id: Id
class PublishPostU... | [
"PostDataProvider",
"EventBus",
"PublishPostCommand"
] | [
366,
395,
513
] | [
382,
403,
531
] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/domain/post/value_objects/__init__.py | from .title import Title
from .body import Body
from .id import Id
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/domain/post/value_objects/body.py | from dataclasses import dataclass
@dataclass(frozen=True)
class Body:
value: str
def is_valid(self):
return len(self.value) > 0
def __str__(self):
return self.value
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/domain/post/value_objects/id.py | from uuid import UUID
class Id:
value: UUID
def __init__(self, value: UUID):
self.value = value
def is_valid(self):
return len(str(self)) > 0
def __str__(self):
return str(self.value)
| [
"UUID"
] | [
81
] | [
85
] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/domain/post/value_objects/title.py | class Title:
value: str
def __init__(self, value):
self.value = value
def is_valid(self):
return len(self.value) > 0
def __str__(self):
return self.value
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/entrypoints/rest/__init__.py | [] | [] | [] | |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/entrypoints/rest/core/errors.py | # -*- coding: utf-8 -*-
import json
import falcon
try:
from collections import OrderedDict
except ImportError:
OrderedDict = dict
OK = {"status": falcon.HTTP_200, "code": 200}
ERR_UNKNOWN = {"status": falcon.HTTP_500, "code": 500, "title": "Unknown Error"}
ERR_AUTH_REQUIRED = {
"status": falcon.HTTP_4... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/entrypoints/rest/post/__init__.py | [] | [] | [] | |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/entrypoints/rest/post/definitions.py | from injector import singleton, provider, Module
from meerkat.domain.post.use_cases import AddNewPostUseCase, PublishPostUseCase
from meerkat.entrypoints.rest.post.resources import PostCollection, Post
class PostConfigurator(Module):
@singleton
@provider
def post_collection(self) -> PostCollection:
... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/entrypoints/rest/post/registry.py | from meerkat.configurations.app import settings
from meerkat.entrypoints.rest.post.definitions import PostConfigurator
from meerkat.entrypoints.rest.post.resources import PostCollection, Post
from registry.services import BootableService, Container
class PostService(BootableService):
def boot(self, container: Con... | [
"Container"
] | [
317
] | [
326
] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/entrypoints/rest/post/resources.py | import json
import logging
import uuid
import falcon
from meerkat.configurations.app.middlewares import HTTPValidationError
from meerkat.domain.post.use_cases import AddNewPostUseCase, PublishPostUseCase
from meerkat.domain.post.use_cases.add_new_post import AddNewPostCommand
from meerkat.domain.post.use_cases.publis... | [
"AddNewPostUseCase",
"PublishPostUseCase",
"falcon.Request",
"falcon.Response",
"str"
] | [
606,
1905,
2002,
2024,
2045
] | [
623,
1923,
2016,
2039,
2048
] |
archives/0mars_monoskel.zip | packages/meerkat/src/meerkat/entrypoints/rest/post/schemas.py | from marshmallow import fields, Schema
from meerkat.domain.post.entities import Post
class PostSchema(Schema):
class Meta:
ordered = True
id: fields.Str = fields.Str()
title: fields.Str = fields.Str(required=True)
body: fields.Str = fields.Str(required=True)
@classmethod
def from_do... | [
"Post"
] | [
343
] | [
347
] |
archives/0mars_monoskel.zip | packages/meerkat/tests/__init__.py | import sys
import os
sys.path.append(os.path.realpath(os.path.dirname(__file__) + "/../src/"))
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/tests/meerkat/__init__.py | [] | [] | [] | |
archives/0mars_monoskel.zip | packages/meerkat/tests/meerkat/domain/__init__.py | [] | [] | [] | |
archives/0mars_monoskel.zip | packages/meerkat/tests/meerkat/domain/post/__init__.py | [] | [] | [] | |
archives/0mars_monoskel.zip | packages/meerkat/tests/meerkat/domain/post/use_cases/__init__.py | [] | [] | [] | |
archives/0mars_monoskel.zip | packages/meerkat/tests/meerkat/domain/post/use_cases/test_add_new_post.py | import uuid
from unittest import mock
from meerkat.domain.post.events import PostCreated
from meerkat.domain.post.use_cases.add_new_post import AddNewPostUseCase, AddNewPostCommand
class TestCreatePost:
@mock.patch('meerkat.domain.post.use_cases.add_new_post.uuid.uuid4')
def test_can_add_new_post(self, uuid... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/meerkat/tests/meerkat/domain/post/use_cases/test_publish_post.py | import uuid
from unittest import mock
from meerkat.domain.post.entities import Post
from meerkat.domain.post.events import PostPublished
from meerkat.domain.post.use_cases import PublishPostUseCase
from meerkat.domain.post.use_cases.publish_post import PublishPostCommand
from meerkat.domain.post.value_objects import T... | [
"Id"
] | [
682
] | [
684
] |
archives/0mars_monoskel.zip | packages/monomanage/setup.py | from glob import glob
from os.path import abspath, dirname, join as pjoin
from setuptools import setup, find_packages
root = dirname(abspath(__file__))
def execfile(fname, globs, locs=None):
locs = locs or globs
exec(compile(open(fname).read(), fname, "exec"), globs, locs)
source_path = 'src'
packages = fi... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/__init__.py | [] | [] | [] | |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/_install_requires.py | install_requires = [
"networkx",
"semver",
"stdlib_list"
]
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/_version.py | version_info = [0, 10, 0, 'dev0']
__version__ = "0.10.0dev0"
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/app/__init__.py | from .api import package_wheels
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/app/api.py | # Copyright (C) 2019 Simon Biggs
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/app/wheels.py | # Copyright (C) 2019 Simon Biggs
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/clean/__init__.py | [] | [] | [] | |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/clean/core.py | import shutil
try:
shutil.rmtree('dist')
except FileNotFoundError:
pass
try:
shutil.rmtree('build')
except FileNotFoundError:
pass
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/docs/__init__.py | from .api import pre_docs_build
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/docs/api.py | # Copyright (C) 2019 Simon Biggs
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/docs/graphs.py | # Copyright (C) 2019 Simon Biggs
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/draw/__init__.py | from .api import draw_all
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/draw/api.py | # Copyright (C) 2019 Simon Biggs
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/draw/directories.py | # Copyright (C) 2019 Simon Biggs
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/draw/files.py | # Copyright (C) 2019 Simon Biggs
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/draw/packages.py | # Copyright (C) 2019 Simon Biggs
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/draw/utilities.py | # Copyright (C) 2019 Simon Biggs
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/parse/__init__.py | [] | [] | [] | |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/parse/imports.py | # Copyright (C) 2019 Simon Biggs
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/propagate/__init__.py | [] | [] | [] | |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/propagate/dependencies.py | # Copyright (C) 2019 Simon Biggs
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/propagate/versions.py | # Copyright (C) 2019 Simon Biggs
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/tree/__init__.py | from .build import build_tree, test_tree, PackageTree
from .check import is_imports_json_up_to_date, update_imports_json
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/tree/build.py | # Copyright (C) 2019 Simon Biggs
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/monomanage/src/monomanage/tree/check.py | # Copyright (C) 2019 Simon Biggs
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/registry/setup.py | from os.path import abspath, dirname, join as pjoin
from setuptools import setup, find_packages
root = dirname(abspath(__file__))
def execfile(fname, globs, locs=None):
locs = locs or globs
exec(compile(open(fname).read(), fname, "exec"), globs, locs)
source_path = 'src'
packages = find_packages(source_pat... | [] | [] | [] |
archives/0mars_monoskel.zip | packages/registry/src/registry/__init__.py | from . import services
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/registry/src/registry/_version.py | version_info = [0, 1, 0]
__version__ = "0.1.0"
| [] | [] | [] |
archives/0mars_monoskel.zip | packages/registry/src/registry/services.py | from abc import ABC, abstractmethod
from enum import Enum
class Props(Enum):
pass
class Container(object):
def __init__(self):
self.vars = {}
def set(self, prop: Props, value):
self.vars[prop] = value
def get(self, key: Props):
return self.vars[key]
class BootableService... | [
"Props",
"Props",
"Container",
"BootableService",
"Container"
] | [
188,
259,
378,
698,
785
] | [
193,
264,
387,
713,
794
] |
archives/1098994933_python.zip | arithmetic_analysis/bisection.py | import math
def bisection(function, a, b): # finds where the function becomes 0 in [a,b] using bolzano
start = a
end = b
if function(a) == 0: # one of the a or b is a root for the function
return a
elif function(b) == 0:
return b
elif function(a) * function(b) > 0: # if none of... | [] | [] | [] |
archives/1098994933_python.zip | arithmetic_analysis/in_static_equilibrium.py | """
Checks if a system of forces is in static equilibrium.
python/black : true
flake8 : passed
mypy : passed
"""
from numpy import array, cos, sin, radians, cross # type: ignore
from typing import List
def polar_force(
magnitude: float, angle: float, radian_mode: bool = False
) -> List[float]:
... | [
"float",
"float",
"array",
"array"
] | [
252,
266,
808,
825
] | [
257,
271,
813,
830
] |
archives/1098994933_python.zip | arithmetic_analysis/intersection.py | import math
def intersection(function,x0,x1): #function is the f we want to find its root and x0 and x1 are two random starting points
x_n = x0
x_n1 = x1
while True:
x_n2 = x_n1-(function(x_n1)/((function(x_n1)-function(x_n))/(x_n1-x_n)))
if abs(x_n2 - x_n1) < 10**-5:
return x_n... | [] | [] | [] |
archives/1098994933_python.zip | arithmetic_analysis/lu_decomposition.py | """Lower-Upper (LU) Decomposition."""
# lower–upper (LU) decomposition - https://en.wikipedia.org/wiki/LU_decomposition
import numpy
def LUDecompose(table):
# Table that contains our data
# Table has to be a square array so we need to check first
rows, columns = numpy.shape(table)
L = numpy.zeros((ro... | [] | [] | [] |
archives/1098994933_python.zip | arithmetic_analysis/newton_method.py | """Newton's Method."""
# Newton's Method - https://en.wikipedia.org/wiki/Newton%27s_method
# function is the f(x) and function1 is the f'(x)
def newton(function, function1, startingInt):
x_n = startingInt
while True:
x_n1 = x_n - function(x_n) / function1(x_n)
if abs(x_n - x_n1) < 10**-5:
... | [] | [] | [] |
archives/1098994933_python.zip | arithmetic_analysis/newton_raphson_method.py | # Implementing Newton Raphson method in Python
# Author: Syed Haseeb Shah (github.com/QuantumNovice)
from sympy import diff
from decimal import Decimal
def NewtonRaphson(func, a):
''' Finds root from the point 'a' onwards by Newton-Raphson method '''
while True:
c = Decimal(a) - ( Decimal(eval(func)) ... | [] | [] | [] |
archives/1098994933_python.zip | backtracking/all_combinations.py | # -*- coding: utf-8 -*-
"""
In this problem, we want to determine all possible combinations of k
numbers out of 1 ... n. We use backtracking to solve this problem.
Time complexity: O(C(n,k)) which is O(n choose k) = O((n!/(k! * (n - k)!)))
"""
def generate_all_combinations(n: int, k: int) -> [[int]]:
"""
... | [
"int",
"int"
] | [
283,
291
] | [
286,
294
] |
archives/1098994933_python.zip | backtracking/all_permutations.py | '''
In this problem, we want to determine all possible permutations
of the given sequence. We use backtracking to solve this problem.
Time complexity: O(n! * n),
where n denotes the length of the given sequence.
'''
def generate_all_permutations(sequence):
create_state_space_tree(sequence, [], 0, [0 for i in ra... | [] | [] | [] |
archives/1098994933_python.zip | backtracking/all_subsequences.py | '''
In this problem, we want to determine all possible subsequences
of the given sequence. We use backtracking to solve this problem.
Time complexity: O(2^n),
where n denotes the length of the given sequence.
'''
def generate_all_subsequences(sequence):
create_state_space_tree(sequence, [], 0)
def create_stat... | [] | [] | [] |
archives/1098994933_python.zip | backtracking/minimax.py | import math
''' Minimax helps to achieve maximum score in a game by checking all possible moves
depth is current depth in game tree.
nodeIndex is index of current node in scores[].
if move is of maximizer return true else false
leaves of game tree is stored in scores[]
height is maximum height ... | [] | [] | [] |
archives/1098994933_python.zip | backtracking/n_queens.py | '''
The nqueens problem is of placing N queens on a N * N
chess board such that no queen can attack any other queens placed
on that chess board.
This means that one queen cannot have any other queen on its horizontal, vertical and
diagonal lines.
'''
solution = []
def isSafe(board, row, column):
'''
T... | [] | [] | [] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.