Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(22)  |  Call(15)  |  Derive(0)  |  Import(7)

src/s/c/scikit-learn-0.14.1/sklearn/datasets/svmlight_format.py   scikit-learn(Download)
from ..externals import six
from ..utils import atleast2d_or_csr
from ..externals.six import u, b
    if comment:
        f.write(b("# Generated by dump_svmlight_file from scikit-learn %s\n"
                % __version__))
        f.write(b("# Column indices are %s-based\n"
                  % ["zero", "one"][one_based]))
        f.writelines(b("# %s\n" % line) for line in comment.splitlines())

src/m/n/mne-python-HEAD/mne/label.py   mne-python(Download)
from .parallel import parallel_func, check_n_jobs
from .stats.cluster_level import _find_clusters
from .externals.six import b, string_types
from .externals.six.moves import zip, xrange
        data[:, 1:4] = 1e3 * label.pos
        data[:, 4] = label.values
        fid.write(b("#%s\n" % label.comment))
        fid.write(b("%d\n" % n_vertices))
        for d in data:
            fid.write(b("%d %f %f %f %f\n" % tuple(d)))

src/m/n/mne-python-HEAD/mne/io/kit/coreg.py   mne-python(Download)
from ... import __version__
from .constants import KIT
from ...externals.six import b
        version = __version__
        now = datetime.now().strftime("%I:%M%p on %B %d, %Y")
        fid.write(b("% Ascii 3D points file created by mne-python version "
                    "{version} at {now}\n".format(version=version, now=now)))
        fid.write(b("% {N} 3D points, x y z per line\n".format(N=len(pts))))

src/m/n/mne-python-HEAD/mne/io/bti/read.py   mne-python(Download)
import struct
import numpy as np
from ...externals.six import b
    data = list(struct.unpack(format, fid.read(struct.calcsize(format))))
    bytestr = b('').join(data[0:data.index(b('\x00')) if b('\x00') in data else

src/m/n/mne-python-HEAD/mne/io/write.py   mne-python(Download)
# License: BSD (3-clause)
from ..externals.six import string_types, b
import time
import numpy as np
        The machine identifier used in MNE.
    mac = b('%012x' %uuid.getnode()) # byte conversion for Py3
    mac = re.findall(b'..', mac) # split string
    mac += [b'00', b'00']  # add two more fields
    fid.write(np.array(ch_name, dtype='>c').tostring())
    if len(ch_name) < 16:
        fid.write(b('\0') * (16 - len(ch_name)))

src/s/c/scikit-learn-0.14.1/sklearn/datasets/lfw.py   scikit-learn(Download)
from ..externals.joblib import Memory
from ..externals.six import b, u
logger = logging.getLogger(__name__)
    # the right amount of memory before starting to decode the jpeg files
    with open(index_file_path, 'rb') as index_file:
        split_lines = [ln.strip().split(b('\t')) for ln in index_file]
    pair_specs = [sl for sl in split_lines if len(sl) > 2]
    n_pairs = len(pair_specs)

src/m/n/mne-python-HEAD/mne/io/tag.py   mne-python(Download)
import numpy as np
from scipy import linalg
from ..externals.six import b, text_type
from ..externals.jdcal import jd2jcal