semvec/pypi-packages huggingface dataset:
baka-tenshi 1.0.3.dev11
Baka: Skeleton framework built top of pyramid, baka_tenshi for sqlalchemy
License: MIT
Keywords: model,sqlalchemy,framework

Baka model add-ons
==================

`Baka_tenshi <https://github.com/suryakencana/Baka_tenshi>`_ is add-ons baka framework built top of pyramid that provides an SQLAlchemy declarative ``Base`` alias model.Model and a add method on ``request.db``.


Usage
=====

You can use these as base classes for declarative model definitions, e.g.

.. code:: python

   from base_model.model import Model

   class MyModel(Model):
       """Example model class."""

       __tablename__ = 'base.mymodel'

       @classmethod
       def do_first(cls, session):
       instance = session.query(cls).first()


Register Model
==============

using Baka_tenshi, you can apply dependency injection method for model that has been created.

.. code:: python

   def includeme(config):
       config.register_model('base.MyModel')


   # in view handler request
   @route('/my.model', renderer='json')
   def view_mymodel(request):
       MyModel = request.find_model('base.mymodel')
       mymodel = MyModel()
       mymodel.name = 'user model'
       mymodel.address = 'user address'
       mymodel.phone = '0089800-998'
       request.db.add(mymodel)

       return {'success': True}


Install
=======

Install with ``.ini`` file

.. code:: bash

   pyramid.includes =
      Baka_tenshi
      pyramid_debugtoolbar
      pyramid_mailer


Install with code

.. code:: python

   def includeme(config):
       config.include('Baka_tenshi')
uqid 0.3.0
Unique id from random chars and optional date-time.
License: MIT

uqid::

    pip install uqid
    from uqid import uqid, digits

    print(uqid()) # e7ljCIs4grYZ9tOv6bpX3TQIA7FyA23umzGjDcIjHff2XwF2ziAw56B7S3EdOuCA
    print(uqid(4, digits)) # 4982

* Returns unique id from random chars.
* Default is 64 chars 0-9a-zA-Z aka base62.

dtid::

    pip install uqid
    from uqid import dtid
    print(dtid())

    YYYYMMDDhhmmssmicrosrnd4
    20161231235959123456uN1q

* 24 bytes by default - as str(ObjectId()).
* But human-friendly - unlike ObjectId.
* Microsecond-precise UTC timestamp - unlike second-precise ObjectId().
* May extract datetime_from_dtid().
* May be used as a log timestamp as is.
* Alphabetically ordered.
* Safe chars 0-9a-zA-Z - unlike binary ObjectId() leading to "ValueError: Invalid UTF-8 sequence length" if added to JSON without str().
* base62^4 is over 14M uniques per microsecond.
* dtid(24) is 2x faster than uqid(24) but slower than str(ObjectId())

tests::

    python2 uqid.py
    python3 uqid.py

    SAMPLES:
    str(uuid4()): 3bb25137-2422-4d06-bd12-5a9de2ea2bf6
    len(^): 36
    len(v): 24
    str(ObjectId()): 5acdcd1f9c591516ae800615
    uqid(24): UFRFQVCtYu6rtQq8LD33XjI3
    dtid(24): 20180411085351268116tHse
    Iterations: 1000000

    python2 SECONDS:
    str(uuid4()) seconds: 11.825964
    str(ObjectId()) seconds: 2.424702
    uqid(24) seconds: 9.701306
    dtid(24) seconds: 5.357983

    python3 SECONDS:
    str(uuid4()) seconds: 5.826098
    str(ObjectId()) seconds: 3.192565
    uqid(24) seconds: 17.769653
    dtid(24) seconds: 9.588677

    DUPLICATES:
    str(uuid4()) duplicates: 0
    str(ObjectId()) duplicates: 0
    uqid(24) duplicates: 0
    dtid(24) duplicates: 0
flatlands 0.1.8
Flatlands simple on-track driving simulator with physics
License: MIT
Requires Python: >=3
Keywords: driving simulation gym

# Flatlands Driving Simulator for OpenAI Gym

## Ascent Robotics

Flatlands is a simple gym compatible simulator for a car driving around a track. It is tested with Python3, and Windows/ Ubuntu.

- To use it, clone this repo to your computer with:
```shell-script
git clone git@github.com:ascentai/flatlands-gym.git && cd flatlands-gym
```

- Then install the dependencies with:
```shell-script
pip install -e .
```
> Flatlands uses `pygame` for visualization, so if this doesn't work, you may need to install the SDL library on your system as well.

- To create a gym environment you need to import `gym` and then import `flatlands` inside python
```python
import gym
import flatlands

env = gym.make("Flatlands-v0")
```

For a more in depth example, see [demo_flatlands.py](demo_flatlands.py) which drives that car based on the steering angle compared to upcoming points.