<commit_before>docker-py
=========

An API client for docker written in Python

API
===

`client.Client(base_url='http://localhost:4243')`
Client class. `base_url` refers to the protocol+hostname+port where the docker server is hosted.

* `c.build(dockerfile)`
Identical to the `docker build` command. `dockerfile` is a file-like object or a bytes collection.

* `c.commit(container, repository=None, tag=None, message=None, author=None, conf=None)`
Identical to the `docker commit` command.

* `c.containers(quiet=False, all=False, trunc=True, latest=False, since=None, before=None, limit=-1)`
Identical to the `docker ps` command.

* `c.create_container(image, command, hostname=None, user=None, detach=False, stdin_open=False, tty=False, mem_limit=0, ports=None, environment=None, dns=None, volumes=None, volumes_from=None)`
Creates a container that can then be `start`ed. Parameters are similar to those for the `docker run` command
except it doesn't support the attach options (`-a`)

* `c.diff(container)`
Identical to the `docker diff` command.

* `c.export(container)`
Identical to the `docker export` command.

* `c.history(image)`
Identical to the `docker history` command.

* `c.images(name=None, quiet=False, all=False, viz=False)`
Identical to the `docker images` command.

* `c.import_image(src, repository=None, tag=None)`
Identical to the `docker import` command. If `src` is a string or unicode string, it will be treated as a URL
to fetch the image from. To import an image from the local machine, `src` needs to be a file-like object or
bytes collection.

* `c.info()`
Identical to the `docker info` command.

* `c.insert(url, path)`
Identical to the `docker insert` command.

* `c.inspect_container(container_id)`
Identical to the `docker inspect` command, but can only be used with a container ID.

* `c.inspect_image(container_id)`
Identical to the `docker inspect` command, but can only be used with an image ID.

* `c.kill(containers...)`
Identical to the `docker kill` command.

* `c.login(username, password=<PASSWORD>, email=None)`
Identical to the `docker login` command (but non-interactive, obviously).

* `c.logs(container)`
Identical to the `docker logs` command.

* `c.port(container, private_port)`
Identical to the `docker port` command.

* `c.pull(repository, tag=None, registry=None)`
Identical to the `docker pull` command.

* `c.push(repository, registry=None)`
Identical to the `docker push` command.

* `c.remove_container(containers..., v=False)`
Identical to the `docker rm` command.

* `c.remove_image(images...)`
Identical to the `docker rmi` command.

* `c.restart(containers..., t=10)`
Identical to the `docker restart` command.

* `c.search(term)`
Identical to the `docker search` command.

* `c.start(container)`
Identical to the `docker start` command, but doesn't support attach options. Use `docker logs` to
recover `stdout`/`stderr`

* `c.start(container, binds={'/host': '/mnt'})`
Allows to bind a directory in the host to the container.
Similar to the `docker run` command with the `-b="/host:/mnt"`.
Requires the container to be created with the volumes argument:
`c.create_container(..., volumes={'/mnt': {}})`

* `c.stop(containers..., t=10)`
Identical to the `docker stop` command.

* `c.tag(image, repository, tag=None, force=False)`
Identical to the `docker tag` command.

* `c.version()`
Identical to the `docker version` command.

* `c.wait(containers...)`
Identical to the `docker wait` command.


Testing
=======

* [Install](http://www.docker.io/gettingstarted/) docker.
* Create a virtualenv
* Install dependencies:

```sh
make setup
```

* Run tests:

```sh
make test
```<commit_msg>Fixed whitespaces on readme and removed makefile references.<commit_after>docker-py
=========

An API client for docker written in Python

API
===

`client.Client(base_url='http://localhost:4243')`  
Client class. `base_url` refers to the protocol+hostname+port where the docker server is hosted.

* `c.build(dockerfile)`  
Identical to the `docker build` command. `dockerfile` is a file-like object or a bytes collection.

* `c.commit(container, repository=None, tag=None, message=None, author=None, conf=None)`  
Identical to the `docker commit` command.

* `c.containers(quiet=False, all=False, trunc=True, latest=False, since=None, before=None, limit=-1)`  
Identical to the `docker ps` command.

* `c.create_container(image, command, hostname=None, user=None, detach=False, stdin_open=False, tty=False, mem_limit=0, ports=None, environment=None, dns=None, volumes=None, volumes_from=None)`  
Creates a container that can then be `start`ed. Parameters are similar to those for the `docker run` command
except it doesn't support the attach options (`-a`)

* `c.diff(container)`  
Identical to the `docker diff` command.

* `c.export(container)`  
Identical to the `docker export` command.

* `c.history(image)`  
Identical to the `docker history` command.

* `c.images(name=None, quiet=False, all=False, viz=False)`  
Identical to the `docker images` command.

* `c.import_image(src, repository=None, tag=None)`  
Identical to the `docker import` command. If `src` is a string or unicode string, it will be treated as a URL
to fetch the image from. To import an image from the local machine, `src` needs to be a file-like object or 
bytes collection.

* `c.info()`  
Identical to the `docker info` command.

* `c.insert(url, path)`  
Identical to the `docker insert` command.

* `c.inspect_container(container_id)`  
Identical to the `docker inspect` command, but can only be used with a container ID.

* `c.inspect_image(container_id)`  
Identical to the `docker inspect` command, but can only be used with an image ID.

* `c.kill(containers...)`  
Identical to the `docker kill` command.

* `c.login(username, password=<PASSWORD>, email=None)`  
Identical to the `docker login` command (but non-interactive, obviously).

* `c.logs(container)`  
Identical to the `docker logs` command.

* `c.port(container, private_port)`  
Identical to the `docker port` command.

* `c.pull(repository, tag=None, registry=None)`  
Identical to the `docker pull` command.

* `c.push(repository, registry=None)`  
Identical to the `docker push` command.

* `c.remove_container(containers..., v=False)`  
Identical to the `docker rm` command.

* `c.remove_image(images...)`  
Identical to the `docker rmi` command.

* `c.restart(containers..., t=10)`  
Identical to the `docker restart` command.

* `c.search(term)`  
Identical to the `docker search` command.

* `c.start(container)`  
Identical to the `docker start` command, but doesn't support attach options. Use `docker logs` to 
recover `stdout`/`stderr`

* `c.start(container, binds={'/host': '/mnt'})`  
Allows to bind a directory in the host to the container.
Similar to the `docker run` command with the `-b="/host:/mnt"`.
Requires the container to be created with the volumes argument:
`c.create_container(..., volumes={'/mnt': {}})`  

* `c.stop(containers..., t=10)`
Identical to the `docker stop` command.

* `c.tag(image, repository, tag=None, force=False)`  
Identical to the `docker tag` command.

* `c.version()`  
Identical to the `docker version` command.

* `c.wait(containers...)`  
Identical to the `docker wait` command.

{'fraction_non_alphanumeric': 0.1357853982300885, 'fraction_numerical': 0.0027654867256637168, 'mean_word_length': 4.890065146579804, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2511710', 'n_tokens_mistral': 2443, 'n_tokens_neox': 2330, 'n_words': 813}