index
int64
0
50.7k
project_path
stringclasses
279 values
completion_path
stringlengths
57
199
signature_postion
stringlengths
3
11
class_position
stringlengths
3
11
function_name
stringlengths
1
62
class_name
stringlengths
0
55
body_position
stringlengths
3
11
body_position_with_comments
stringlengths
3
11
masked_class
stringlengths
14
8.32k
masked_class_with_comment
stringlengths
14
8.32k
func_body
stringlengths
9
6.72k
func_body_with_comment
stringlengths
9
6.72k
len_func_body
int64
1
643
len_input
int64
10
2.02k
len_output
int64
4
1.9k
total
int64
20
2.05k
file_code
stringlengths
14
442k
file_code_with_comment
stringlengths
14
442k
49,488
/home/hieuvd/dung_repo/raw/stars_03/probtorch_probtorch/probtorch
/home/hieuvd/dung_repo/raw/stars_03/probtorch_probtorch/probtorch/probtorch/util.py
65,66
1,139
expanded_size
67,76
66,76
"Helper functions that don't have a better place yet" import torch from numbers import Number import math from functools import wraps __all__ = ['broadcast_size', 'expanded_size', 'batch_sum', 'partial_sum', 'log_sum_exp', 'log_mean_exp'] def expand_inputs(f): ...
"Helper functions that don't have a better place yet" import torch from numbers import Number import math from functools import wraps __all__ = ['broadcast_size', 'expanded_size', 'batch_sum', 'partial_sum', 'log_sum_exp', 'log_mean_exp'] def expand_inputs(f): ...
# strip leading 1s from original size if not expand_size: return orig_size if orig_size == (1,): return expand_size else: return expand_size + orig_size
"""Returns the expanded size given two sizes""" # strip leading 1s from original size if not expand_size: return orig_size if orig_size == (1,): return expand_size else: return expand_size + orig_size
23
1,414
67
1,481
"Helper functions that don't have a better place yet" import torch from numbers import Number import math from functools import wraps __all__ = ['broadcast_size', 'expanded_size', 'batch_sum', 'partial_sum', 'log_sum_exp', 'log_mean_exp'] def expand_inputs(f): ...
"Helper functions that don't have a better place yet" import torch from numbers import Number import math from functools import wraps __all__ = ['broadcast_size', 'expanded_size', 'batch_sum', 'partial_sum', 'log_sum_exp', 'log_mean_exp'] def expand_inputs(f): ...
49,489
/home/hieuvd/dung_repo/raw/stars_03/probtorch_probtorch/probtorch
/home/hieuvd/dung_repo/raw/stars_03/probtorch_probtorch/probtorch/setup.py
9,10
1,118
get_version
10,21
10,21
import io import os import sys from shutil import rmtree from setuptools import find_packages, setup, Command import setuptools.command.build_py def get_version(): FILL_FUNC_BODYNAME = 'probtorch' DESCRIPTION = 'Probabilistic Torch is library for deep generative models that extends PyTorch' URL = 'https://github.com/...
import io import os import sys from shutil import rmtree from setuptools import find_packages, setup, Command import setuptools.command.build_py def get_version(): FILL_FUNC_BODYNAME = 'probtorch' DESCRIPTION = 'Probabilistic Torch is library for deep generative models that extends PyTorch' URL = 'https://github.com/...
try: import subprocess CWD = os.path.dirname(os.path.abspath(__file__)) rev = subprocess.check_output("git rev-parse --short HEAD".split(), cwd=CWD) version = "0.0+" + str(rev.strip().decode('utf-8')) return version except Exception: return "0.0" # Package meta-...
try: import subprocess CWD = os.path.dirname(os.path.abspath(__file__)) rev = subprocess.check_output("git rev-parse --short HEAD".split(), cwd=CWD) version = "0.0+" + str(rev.strip().decode('utf-8')) return version except Exception: return "0.0" # Package meta-...
27
976
120
1,096
import io import os import sys from shutil import rmtree from setuptools import find_packages, setup, Command import setuptools.command.build_py def get_version(): FILL_FUNC_BODYNAME = 'probtorch' DESCRIPTION = 'Probabilistic Torch is library for deep generative models that extends PyTorch' URL = 'https://github.com/...
import io import os import sys from shutil import rmtree from setuptools import find_packages, setup, Command import setuptools.command.build_py def get_version(): FILL_FUNC_BODYNAME = 'probtorch' DESCRIPTION = 'Probabilistic Torch is library for deep generative models that extends PyTorch' URL = 'https://github.com/...
49,490
/home/hieuvd/dung_repo/raw/stars_03/probtorch_probtorch/probtorch
/home/hieuvd/dung_repo/raw/stars_03/probtorch_probtorch/probtorch/setup.py
73,74
56,89
run
UploadCommand
74,89
74,89
class UploadCommand(Command): """Support setup.py upload.""" description = 'Build and publish the package.' user_options = [] @staticmethod def status(s): """Prints things in bold.""" print('\033[1m{0}\033[0m'.format(s)) def initialize_options(self): pass def fina...
class UploadCommand(Command): """Support setup.py upload.""" description = 'Build and publish the package.' user_options = [] @staticmethod def status(s): """Prints things in bold.""" print('\033[1m{0}\033[0m'.format(s)) def initialize_options(self): pass def fina...
try: self.status('Removing previous builds...') rmtree(os.path.join(here, 'dist')) except OSError: pass self.status('Building Source and Wheel (universal) distribution...') os.system('{0} setup.py sdist bdist_wheel --universal'.format(sys.executable))...
try: self.status('Removing previous builds...') rmtree(os.path.join(here, 'dist')) except OSError: pass self.status('Building Source and Wheel (universal) distribution...') os.system('{0} setup.py sdist bdist_wheel --universal'.format(sys.executable))...
31
128
146
274
import io import os import sys from shutil import rmtree from setuptools import find_packages, setup, Command import setuptools.command.build_py def get_version(): try: import subprocess CWD = os.path.dirname(os.path.abspath(__file__)) rev = subprocess.check_output("git rev-parse --short H...
import io import os import sys from shutil import rmtree from setuptools import find_packages, setup, Command import setuptools.command.build_py def get_version(): try: import subprocess CWD = os.path.dirname(os.path.abspath(__file__)) rev = subprocess.check_output("git rev-parse --short H...
49,491
/home/hieuvd/dung_repo/raw/stars_03/probtorch_probtorch/probtorch
/home/hieuvd/dung_repo/raw/stars_03/probtorch_probtorch/probtorch/setup.py
48,50
42,56
create_version_file
build_py
50,56
50,56
class build_py(setuptools.command.build_py.build_py): def run(self): self.create_version_file() setuptools.command.build_py.build_py.run(self) @staticmethod def create_version_file(): FILL_FUNC_BODY
class build_py(setuptools.command.build_py.build_py): def run(self): self.create_version_file() setuptools.command.build_py.build_py.run(self) @staticmethod def create_version_file(): FILL_FUNC_BODY
print('-- Building version ' + VERSION) version_path = os.path.join(here, 'probtorch', 'version.py') with open(version_path, 'w') as f: f.write("__version__ = '{}'\n".format(VERSION))
print('-- Building version ' + VERSION) version_path = os.path.join(here, 'probtorch', 'version.py') with open(version_path, 'w') as f: f.write("__version__ = '{}'\n".format(VERSION))
19
81
80
161
import io import os import sys from shutil import rmtree from setuptools import find_packages, setup, Command import setuptools.command.build_py def get_version(): try: import subprocess CWD = os.path.dirname(os.path.abspath(__file__)) rev = subprocess.check_output("git rev-parse --short H...
import io import os import sys from shutil import rmtree from setuptools import find_packages, setup, Command import setuptools.command.build_py def get_version(): try: import subprocess CWD = os.path.dirname(os.path.abspath(__file__)) rev = subprocess.check_output("git rev-parse --short H...
49,494
/home/hieuvd/dung_repo/raw/stars_03/proplot-dev_proplot/proplot
/home/hieuvd/dung_repo/raw/stars_03/proplot-dev_proplot/proplot/proplot/internals/docstring.py
62,63
1,139
_concatenate_inherited
67,110
63,110
#!/usr/bin/env python3 """ Utilities for modifying proplot docstrings. """ # WARNING: To check every docstring in the package for # unfilled snippets simply use the following code: # >>> import proplot as pplt # ... seen = set() # ... def _iter_doc(objs): # ... if objs in seen: # ... return # ... seen.a...
#!/usr/bin/env python3 """ Utilities for modifying proplot docstrings. """ # WARNING: To check every docstring in the package for # unfilled snippets simply use the following code: # >>> import proplot as pplt # ... seen = set() # ... def _iter_doc(objs): # ... if objs in seen: # ... return # ... seen.a...
# Get matplotlib axes func # NOTE: Do not bother inheriting from cartopy GeoAxes. Cartopy completely # truncates the matplotlib docstrings (which is kind of not great). qual = func.__qualname__ if 'Axes' in qual: cls = maxes.Axes elif 'Figure' in qual: cls = mfigure.Figure el...
""" Concatenate docstrings from a matplotlib axes method with a proplot axes method and obfuscate the call signature. """ # Get matplotlib axes func # NOTE: Do not bother inheriting from cartopy GeoAxes. Cartopy completely # truncates the matplotlib docstrings (which is kind of not great). ...
156
925
447
1,372
#!/usr/bin/env python3 """ Utilities for modifying proplot docstrings. """ # WARNING: To check every docstring in the package for # unfilled snippets simply use the following code: # >>> import proplot as pplt # ... seen = set() # ... def _iter_doc(objs): # ... if objs in seen: # ... return # ... seen.a...
#!/usr/bin/env python3 """ Utilities for modifying proplot docstrings. """ # WARNING: To check every docstring in the package for # unfilled snippets simply use the following code: # >>> import proplot as pplt # ... seen = set() # ... def _iter_doc(objs): # ... if objs in seen: # ... return # ... seen.a...
49,495
/home/hieuvd/dung_repo/raw/stars_03/proplot-dev_proplot/proplot
/home/hieuvd/dung_repo/raw/stars_03/proplot-dev_proplot/proplot/proplot/internals/guides.py
76,77
1,158
_update_kw
80,92
77,92
#!/usr/bin/env python3 """ Utilties related to legends and colorbars. """ import matplotlib.artist as martist import matplotlib.colorbar as mcolorbar import matplotlib.legend as mlegend # noqa: F401 import matplotlib.ticker as mticker import numpy as np from . import ic # noqa: F401 from . import warnings # Global ...
#!/usr/bin/env python3 """ Utilties related to legends and colorbars. """ import matplotlib.artist as martist import matplotlib.colorbar as mcolorbar import matplotlib.legend as mlegend # noqa: F401 import matplotlib.ticker as mticker import numpy as np from . import ic # noqa: F401 from . import warnings # Global ...
for key, value in opts.items(): if value is None: continue keys = tuple(k for opts in GUIDE_ALIASES for k in opts if key in opts) keys = keys or (key,) # e.g. 'extend' or something keys_found = tuple(key for key in keys if kwargs.get(key) is not None) if not keys...
""" Add the keyword arguments to the dictionary if not already present. """ for key, value in opts.items(): if value is None: continue keys = tuple(k for opts in GUIDE_ALIASES for k in opts if key in opts) keys = keys or (key,) # e.g. 'extend' or something ke...
62
1,590
152
1,742
#!/usr/bin/env python3 """ Utilties related to legends and colorbars. """ import matplotlib.artist as martist import matplotlib.colorbar as mcolorbar import matplotlib.legend as mlegend # noqa: F401 import matplotlib.ticker as mticker import numpy as np from . import ic # noqa: F401 from . import warnings # Global ...
#!/usr/bin/env python3 """ Utilties related to legends and colorbars. """ import matplotlib.artist as martist import matplotlib.colorbar as mcolorbar import matplotlib.legend as mlegend # noqa: F401 import matplotlib.ticker as mticker import numpy as np from . import ic # noqa: F401 from . import warnings # Global ...
49,496
/home/hieuvd/dung_repo/raw/stars_03/proplot-dev_proplot/proplot
/home/hieuvd/dung_repo/raw/stars_03/proplot-dev_proplot/proplot/proplot/internals/labels.py
25,26
1,83
_update_label
30,83
26,83
#!/usr/bin/env python3 """ Utilities related to matplotlib text labels. """ import matplotlib.patheffects as mpatheffects import matplotlib.text as mtext from . import ic # noqa: F401 def _transfer_label(src, dest): """ Transfer the input text object properties and content to the destination text object...
#!/usr/bin/env python3 """ Utilities related to matplotlib text labels. """ import matplotlib.patheffects as mpatheffects import matplotlib.text as mtext from . import ic # noqa: F401 def _transfer_label(src, dest): """ Transfer the input text object properties and content to the destination text object...
props = props or {} props = props.copy() # shallow copy props.update(kwargs) # Update border border = props.pop('border', None) bordercolor = props.pop('bordercolor', 'w') borderinvert = props.pop('borderinvert', False) borderwidth = props.pop('borderwidth', 2) borderstyle = props....
""" Add a monkey patch for ``Text.update`` with pseudo "border" and "bbox" properties without wrapping the entire class. This facillitates inset titles. """ props = props or {} props = props.copy() # shallow copy props.update(kwargs) # Update border border = props.pop('border', Non...
201
289
650
939
#!/usr/bin/env python3 """ Utilities related to matplotlib text labels. """ import matplotlib.patheffects as mpatheffects import matplotlib.text as mtext from . import ic # noqa: F401 def _transfer_label(src, dest): """ Transfer the input text object properties and content to the destination text object...
#!/usr/bin/env python3 """ Utilities related to matplotlib text labels. """ import matplotlib.patheffects as mpatheffects import matplotlib.text as mtext from . import ic # noqa: F401 def _transfer_label(src, dest): """ Transfer the input text object properties and content to the destination text object...
49,497
/home/hieuvd/dung_repo/raw/stars_03/proplot-dev_proplot/proplot
/home/hieuvd/dung_repo/raw/stars_03/proplot-dev_proplot/proplot/proplot/internals/warnings.py
53,54
1,113
_rename_objs
59,87
54,87
#!/usr/bin/env python3 """ Utilities for internal warnings and deprecations. """ import functools import re import sys import warnings from . import ic # noqa: F401 # Internal modules omitted from warning message REGEX_INTERNAL = re.compile(r'\A(matplotlib|mpl_toolkits|proplot)\.') # Trivial warning class meant onl...
#!/usr/bin/env python3 """ Utilities for internal warnings and deprecations. """ import functools import re import sys import warnings from . import ic # noqa: F401 # Internal modules omitted from warning message REGEX_INTERNAL = re.compile(r'\A(matplotlib|mpl_toolkits|proplot)\.') # Trivial warning class meant onl...
objs = [] for old_name, new_obj in kwargs.items(): new_name = new_obj.__name__ message = ( f'{old_name!r} was deprecated in version {version} and may be ' f'removed in {_next_release()}. Please use {new_name!r} instead.' ) if isinstance(new_obj, type): ...
""" Emit a basic deprecation warning after renaming function(s), method(s), or class(es). Each key should be an old name, and each argument should be the new object to point to. Do not document the deprecated object(s) to discourage use. """ objs = [] for old_name, new_obj in kwargs.items():...
81
838
355
1,193
#!/usr/bin/env python3 """ Utilities for internal warnings and deprecations. """ import functools import re import sys import warnings from . import ic # noqa: F401 # Internal modules omitted from warning message REGEX_INTERNAL = re.compile(r'\A(matplotlib|mpl_toolkits|proplot)\.') # Trivial warning class meant onl...
#!/usr/bin/env python3 """ Utilities for internal warnings and deprecations. """ import functools import re import sys import warnings from . import ic # noqa: F401 # Internal modules omitted from warning message REGEX_INTERNAL = re.compile(r'\A(matplotlib|mpl_toolkits|proplot)\.') # Trivial warning class meant onl...
49,499
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/docs/source/conf.py
75,76
1,92
setup
76,81
76,81
# -*- coding: utf-8 -*- DESCRIPTION = ( 'A wrapper library that provides one API to read, manipulate and write ' + 'data in different excel formats' + '' ) # Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the...
# -*- coding: utf-8 -*- DESCRIPTION = ( 'A wrapper library that provides one API to read, manipulate and write ' + 'data in different excel formats' + '' ) # Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the...
app.add_stylesheet('theme_overrides.css') # TODO: DESCRIPTION not configurable upstream
app.add_stylesheet('theme_overrides.css') # TODO: DESCRIPTION not configurable upstream
7
911
37
948
# -*- coding: utf-8 -*- DESCRIPTION = ( 'A wrapper library that provides one API to read, manipulate and write ' + 'data in different excel formats' + '' ) # Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the...
# -*- coding: utf-8 -*- DESCRIPTION = ( 'A wrapper library that provides one API to read, manipulate and write ' + 'data in different excel formats' + '' ) # Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the...
49,500
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/examples/basics/convert_xls_to_xlsx.py
34,35
1,43
main
35,41
35,41
""" convert_xls_to_xlsx.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows how to use **save_book_as** to convert xls file to xlsx file. What this example implies is that you can do the conversion in between these formats: ==== === === === === ==== ==...
""" convert_xls_to_xlsx.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows how to use **save_book_as** to convert xls file to xlsx file. What this example implies is that you can do the conversion in between these formats: ==== === === === === ==== ==...
pe.save_book_as( file_name=os.path.join(base_dir, "multiple-sheets.xls"), dest_file_name=os.path.join(base_dir, "multiple-sheets.xlsx") )
pe.save_book_as( file_name=os.path.join(base_dir, "multiple-sheets.xls"), dest_file_name=os.path.join(base_dir, "multiple-sheets.xlsx") )
6
338
76
414
""" convert_xls_to_xlsx.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows how to use **save_book_as** to convert xls file to xlsx file. What this example implies is that you can do the conversion in between these formats: ==== === === === === ==== ==...
""" convert_xls_to_xlsx.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows how to use **save_book_as** to convert xls file to xlsx file. What this example implies is that you can do the conversion in between these formats: ==== === === === === ==== ==...
49,501
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/examples/basics/read_cell_by_cell.py
25,26
1,44
main
26,42
26,42
""" read_cell_by_cell.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows how to use get_sheet() to go through a single page spreadsheet, The output is:: 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 """ import os import pye...
""" read_cell_by_cell.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows how to use get_sheet() to go through a single page spreadsheet, The output is:: 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 """ import os import pye...
# Simple give the file name to **Reader** # "example.xls","example.xlsx","example.ods", "example.xlsm" spreadsheet = pe.get_sheet(file_name=os.path.join(base_dir, "example.csv")) # row_range() gives [0 .. number of rows] for r in spreadsheet.row_range(): # column_range() gives [0 .. number ...
# Simple give the file name to **Reader** # "example.xls","example.xlsx","example.ods", "example.xlsm" spreadsheet = pe.get_sheet(file_name=os.path.join(base_dir, "example.csv")) # row_range() gives [0 .. number of rows] for r in spreadsheet.row_range(): # column_range() gives [0 .. number ...
65
178
207
385
""" read_cell_by_cell.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows how to use get_sheet() to go through a single page spreadsheet, The output is:: 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 """ import os import pye...
""" read_cell_by_cell.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows how to use get_sheet() to go through a single page spreadsheet, The output is:: 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 """ import os import pye...
49,502
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/examples/basics/read_column_by_column.py
19,20
1,32
main
20,30
20,30
""" read_column_by_column.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows a pythonic way to use get_sheet to go through a single page spreadsheet column by column. The output is:: [1.0, 4.0, 7.0] [2.0, 5.0, 8.0] [3.0, 6.0, 9.0] """ imp...
""" read_column_by_column.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows a pythonic way to use get_sheet to go through a single page spreadsheet column by column. The output is:: [1.0, 4.0, 7.0] [2.0, 5.0, 8.0] [3.0, 6.0, 9.0] """ imp...
# "example.csv","example.ods","example.xls", "example.xlsm" spreadsheet = pe.get_sheet(file_name=os.path.join(base_dir, "example.xlsx")) # columns() returns column based iterator, meaning it can be iterated # column by column for value in spread...
# "example.csv","example.ods","example.xls", "example.xlsm" spreadsheet = pe.get_sheet(file_name=os.path.join(base_dir, "example.xlsx")) # columns() returns column based iterator, meaning it can be iterated # column by column for value in spread...
27
189
112
301
""" read_column_by_column.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows a pythonic way to use get_sheet to go through a single page spreadsheet column by column. The output is:: [1.0, 4.0, 7.0] [2.0, 5.0, 8.0] [3.0, 6.0, 9.0] """ imp...
""" read_column_by_column.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows a pythonic way to use get_sheet to go through a single page spreadsheet column by column. The output is:: [1.0, 4.0, 7.0] [2.0, 5.0, 8.0] [3.0, 6.0, 9.0] """ imp...
49,503
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/examples/basics/read_excel_book.py
16,17
1,47
main
17,32
17,32
""" read_excel_book.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows how to use get_book to go through a multiple sheet spreadsheet. Please install pyexcel-ods3 """ import os import pyexcel as pe def main(base_dir): FILL_FUNC_BODYif __name__ == '...
""" read_excel_book.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows how to use get_book to go through a multiple sheet spreadsheet. Please install pyexcel-ods3 """ import os import pyexcel as pe def main(base_dir): FILL_FUNC_BODYif __name__ == '...
# Simply give a name to the Book class book = pe.get_book(file_name=os.path.join(base_dir, "multiple-sheets-example.xls")) # the default iterator for a **Book* instance is a SheetIterator for sheet in book: # Each sheet has name print("sheet...
# Simply give a name to the Book class book = pe.get_book(file_name=os.path.join(base_dir, "multiple-sheets-example.xls")) # the default iterator for a **Book* instance is a SheetIterator for sheet in book: # Each sheet has name print("sheet...
70
316
164
480
""" read_excel_book.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows how to use get_book to go through a multiple sheet spreadsheet. Please install pyexcel-ods3 """ import os import pyexcel as pe def main(base_dir): FILL_FUNC_BODYif __name__ == '...
""" read_excel_book.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows how to use get_book to go through a multiple sheet spreadsheet. Please install pyexcel-ods3 """ import os import pyexcel as pe def main(base_dir): FILL_FUNC_BODYif __name__ == '...
49,504
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/examples/basics/read_row_by_row.py
21,22
1,38
main
22,36
22,36
""" read_row_by_row.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows a pythonic way to use **Reader** class to go through a single page spreadsheet row by row. The output is:: [1.0, 2.0, 3.0] [4.0, 5.0, 6.0] [7.0, 8.0, 9.0] Please insta...
""" read_row_by_row.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows a pythonic way to use **Reader** class to go through a single page spreadsheet row by row. The output is:: [1.0, 2.0, 3.0] [4.0, 5.0, 6.0] [7.0, 8.0, 9.0] Please insta...
# "example.csv","example.xlsx","example.ods", "example.xlsm" spreadsheet = pyexcel.get_sheet(file_name=os.path.join(base_dir, "example.xls")) # rows() returns row based iterator, meaning it can be iterated row by row for row in spreadsheet.rows...
# "example.csv","example.xlsx","example.ods", "example.xlsm" spreadsheet = pyexcel.get_sheet(file_name=os.path.join(base_dir, "example.xls")) # rows() returns row based iterator, meaning it can be iterated row by row for row in spreadsheet.rows...
50
198
159
357
""" read_row_by_row.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows a pythonic way to use **Reader** class to go through a single page spreadsheet row by row. The output is:: [1.0, 2.0, 3.0] [4.0, 5.0, 6.0] [7.0, 8.0, 9.0] Please insta...
""" read_row_by_row.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows a pythonic way to use **Reader** class to go through a single page spreadsheet row by row. The output is:: [1.0, 2.0, 3.0] [4.0, 5.0, 6.0] [7.0, 8.0, 9.0] Please insta...
49,505
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/examples/basics/series.py
18,19
1,89
main
19,87
19,87
""" series.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows how to use `name_columns_by_row` to get the data in various ways. you will need to do `pip install pyexcel-xls` """ # please install pyexcel-ods import os import json import pyexcel as p...
""" series.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows how to use `name_columns_by_row` to get the data in various ways. you will need to do `pip install pyexcel-xls` """ # please install pyexcel-ods import os import json import pyexcel as p...
# print all in json # # Column 1 Column 2 Column 3 # 1 4 7 # 2 5 8 # 3 6 9 sheet = pe.get_sheet(file_name=os.path.join(base_dir, "example_series.xls"), name_columns_by_row=0) ...
# print all in json # # Column 1 Column 2 Column 3 # 1 4 7 # 2 5 8 # 3 6 9 sheet = pe.get_sheet(file_name=os.path.join(base_dir, "example_series.xls"), name_columns_by_row=0) ...
265
155
920
1,075
""" series.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows how to use `name_columns_by_row` to get the data in various ways. you will need to do `pip install pyexcel-xls` """ # please install pyexcel-ods import os import json import pyexcel as p...
""" series.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows how to use `name_columns_by_row` to get the data in various ways. you will need to do `pip install pyexcel-xls` """ # please install pyexcel-ods import os import json import pyexcel as p...
49,506
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/examples/basics/write_excel_book.py
17,18
1,37
main
18,35
18,35
""" write_excel_book.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows how to use save_book_as to write a dictionary to sheet spreadsheet. Please install pyexcel-xls. """ import os import pyexcel as pe def main(base_dir): FILL_FUNC_BODYif __name_...
""" write_excel_book.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows how to use save_book_as to write a dictionary to sheet spreadsheet. Please install pyexcel-xls. """ import os import pyexcel as pe def main(base_dir): FILL_FUNC_BODYif __name_...
# the dictionary should look like the following: # * key: a string typed key # * value: a two dimensional array or a list of lists data = { "Sheet 1": [[1, 2, 3], [4, 5, 6], [7, 8, 9]], "Sheet 2": [['X', 'Y', 'Z'], [1, 2, 3], [4, 5, 6]], "Sheet 3": [['O', 'P', 'Q'], [3, 2, 1], ...
# the dictionary should look like the following: # * key: a string typed key # * value: a two dimensional array or a list of lists data = { "Sheet 1": [[1, 2, 3], [4, 5, 6], [7, 8, 9]], "Sheet 2": [['X', 'Y', 'Z'], [1, 2, 3], [4, 5, 6]], "Sheet 3": [['O', 'P', 'Q'], [3, 2, 1], ...
108
139
270
409
""" write_excel_book.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows how to use save_book_as to write a dictionary to sheet spreadsheet. Please install pyexcel-xls. """ import os import pyexcel as pe def main(base_dir): FILL_FUNC_BODYif __name_...
""" write_excel_book.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This shows how to use save_book_as to write a dictionary to sheet spreadsheet. Please install pyexcel-xls. """ import os import pyexcel as pe def main(base_dir): FILL_FUNC_BODYif __name_...
49,507
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/examples/cookbook/merge_sheets.py
17,18
1,27
main
18,25
18,25
""" merge_sheets.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This code snippet shows you how to merge files that are scattered in a directory into one excel book Please install pyexcel-xls """ import os import glob import pyexcel as pe def main(base_di...
""" merge_sheets.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This code snippet shows you how to merge files that are scattered in a directory into one excel book Please install pyexcel-xls """ import os import glob import pyexcel as pe def main(base_di...
merged = pe.Book() files = glob.glob(os.path.join(base_dir, "scattered-csv-files", "*.csv")) for csv_file in files: merged += pe.load(csv_file) merged.save_as("merged.xls")
merged = pe.Book() files = glob.glob(os.path.join(base_dir, "scattered-csv-files", "*.csv")) for csv_file in files: merged += pe.load(csv_file) merged.save_as("merged.xls")
16
140
83
223
""" merge_sheets.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This code snippet shows you how to merge files that are scattered in a directory into one excel book Please install pyexcel-xls """ import os import glob import pyexcel as pe def main(base_di...
""" merge_sheets.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This code snippet shows you how to merge files that are scattered in a directory into one excel book Please install pyexcel-xls """ import os import glob import pyexcel as pe def main(base_di...
49,508
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/examples/formatting/formatter01.py
13,14
1,28
main
14,26
14,26
""" formater01.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This file shows you how to use column format function """ import os import pyexcel as pe def main(base_dir): FILL_FUNC_BODYif __name__ == '__main__': main(os.getcwd())
""" formater01.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This file shows you how to use column format function """ import os import pyexcel as pe def main(base_dir): FILL_FUNC_BODYif __name__ == '__main__': main(os.getcwd())
sheet = pe.get_sheet(file_name=os.path.join(base_dir, "tutorial_datatype_01.xls"), name_columns_by_row=0) print(sheet.to_dict()) # {u'userid': [10120.0, 10121.0, 10122.0], # u'name': [u'Adam', u'Bella', u'Cedar']} sheet.column...
sheet = pe.get_sheet(file_name=os.path.join(base_dir, "tutorial_datatype_01.xls"), name_columns_by_row=0) print(sheet.to_dict()) # {u'userid': [10120.0, 10121.0, 10122.0], # u'name': [u'Adam', u'Bella', u'Cedar']} sheet.column...
29
115
223
338
""" formater01.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This file shows you how to use column format function """ import os import pyexcel as pe def main(base_dir): FILL_FUNC_BODYif __name__ == '__main__': main(os.getcwd())
""" formater01.py :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details This file shows you how to use column format function """ import os import pyexcel as pe def main(base_dir): FILL_FUNC_BODYif __name__ == '__main__': main(os.getcwd())
49,509
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/book.py
218,219
1,234
to_book
220,229
219,229
""" pyexcel.book ~~~~~~~~~~~~~~~~~~~ Excel book :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ from pyexcel import _compact as compact from pyexcel.sheet import Sheet from pyexcel.internal.meta import BookMeta from pyexcel.internal.commo...
""" pyexcel.book ~~~~~~~~~~~~~~~~~~~ Excel book :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ from pyexcel import _compact as compact from pyexcel.sheet import Sheet from pyexcel.internal.meta import BookMeta from pyexcel.internal.commo...
if isinstance(bookstream, Book): return bookstream return Book( bookstream.to_dict(), filename=bookstream.filename, path=bookstream.path, )
"""Convert a bookstream to Book""" if isinstance(bookstream, Book): return bookstream return Book( bookstream.to_dict(), filename=bookstream.filename, path=bookstream.path, )
11
1,850
62
1,912
""" pyexcel.book ~~~~~~~~~~~~~~~~~~~ Excel book :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ from pyexcel import _compact as compact from pyexcel.sheet import Sheet from pyexcel.internal.meta import BookMeta from pyexcel.internal.commo...
""" pyexcel.book ~~~~~~~~~~~~~~~~~~~ Excel book :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ from pyexcel import _compact as compact from pyexcel.sheet import Sheet from pyexcel.internal.meta import BookMeta from pyexcel.internal.commo...
49,510
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/book.py
48,49
18,218
load_from_sheets
Book
55,72
49,72
class Book(BookMeta): """ Read an excel book that has one or more sheets For csv file, there will be just one sheet """ def __init__(self, sheets=None, filename="memory", path=None): """ Book constructor Selecting a specific book according to filename extension :p...
class Book(BookMeta): """ Read an excel book that has one or more sheets For csv file, there will be just one sheet """ def __init__(self, sheets=None, filename="memory", path=None): """ Book constructor Selecting a specific book according to filename extension :p...
if sheets is None: return keys = sheets.keys() for name in keys: value = sheets[name] if isinstance(value, Sheet): sheet = value sheet.name = name else: # array sheet = Sheet(value, na...
""" Load content from existing sheets :param dict sheets: a dictionary of sheets. Each sheet is a list of lists """ if sheets is None: return keys = sheets.keys() for name in keys: value = sheets[name] ...
56
1,529
158
1,687
""" pyexcel.book ~~~~~~~~~~~~~~~~~~~ Excel book :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ from pyexcel import _compact as compact from pyexcel.sheet import Sheet from pyexcel.internal.meta import BookMeta from pyexcel.internal.commo...
""" pyexcel.book ~~~~~~~~~~~~~~~~~~~ Excel book :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ from pyexcel import _compact as compact from pyexcel.sheet import Sheet from pyexcel.internal.meta import BookMeta from pyexcel.internal.commo...
49,511
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/cookbook.py
22,23
1,182
update_columns
34,47
23,47
""" pyexcel.cookbook ~~~~~~~~~~~~~~~~~~~ Cookbook for pyexcel :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ import os from pyexcel.book import Book from pyexcel.core import save_as, get_book, get_sheet from pyexcel._compact import Orde...
""" pyexcel.cookbook ~~~~~~~~~~~~~~~~~~~ Cookbook for pyexcel :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ import os from pyexcel.book import Book from pyexcel.core import save_as, get_book, get_sheet from pyexcel._compact import Orde...
default_out_file = OUT_FILE_FORMATTER % infilename if outfilename: default_out_file = outfilename if os.path.exists(default_out_file): raise NotImplementedError(MESSAGE_WARNING) sheet = get_sheet(file_name=infilename, name_columns_by_row=0) series = sheet.colnames for k in column...
"""Update one or more columns of a data file with series The data structure of column_dicts should be: key should be first row of the column the rest of the value should an array :param str infilename: an accessible file name :param dict column_dicts: dictionaries of columns :param str outf...
31
1,632
169
1,801
""" pyexcel.cookbook ~~~~~~~~~~~~~~~~~~~ Cookbook for pyexcel :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ import os from pyexcel.book import Book from pyexcel.core import save_as, get_book, get_sheet from pyexcel._compact import Orde...
""" pyexcel.cookbook ~~~~~~~~~~~~~~~~~~~ Cookbook for pyexcel :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ import os from pyexcel.book import Book from pyexcel.core import save_as, get_book, get_sheet from pyexcel._compact import Orde...
49,513
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/deprecated.py
192,197
1,199
BookReader
198,199
197,199
""" pyexcel.deprecated ~~~~~~~~~~~~~~~~~~~ List of apis that become deprecated but was kept for backward compatibility :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from functools import partial from pyexcel.core import get_book, get_sheet from pyexcel._compact imp...
""" pyexcel.deprecated ~~~~~~~~~~~~~~~~~~~ List of apis that become deprecated but was kept for backward compatibility :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from functools import partial from pyexcel.core import get_book, get_sheet from pyexcel._compact imp...
return load_book(file_name, **keywords)
"""For backward compatibility""" return load_book(file_name, **keywords)
3
1,796
16
1,812
""" pyexcel.deprecated ~~~~~~~~~~~~~~~~~~~ List of apis that become deprecated but was kept for backward compatibility :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from functools import partial from pyexcel.core import get_book, get_sheet from pyexcel._compact imp...
""" pyexcel.deprecated ~~~~~~~~~~~~~~~~~~~ List of apis that become deprecated but was kept for backward compatibility :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from functools import partial from pyexcel.core import get_book, get_sheet from pyexcel._compact imp...
49,514
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/internal/attributes.py
38,39
1,61
register_an_attribute
40,61
39,61
""" pyexcel.internal.attributes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Book and sheet attributes :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel import constants ATTRIBUTE_REGISTRY = { constants.SHEET: { constants.READ_ACTION: set(), ...
""" pyexcel.internal.attributes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Book and sheet attributes :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel import constants ATTRIBUTE_REGISTRY = { constants.SHEET: { constants.READ_ACTION: set(), ...
if attr in ATTRIBUTE_REGISTRY[target][constants.RW_ACTION]: # No registration required return ATTRIBUTE_REGISTRY[target][action].add(attr) if action == constants.READ_ACTION: meta_cls.register_input(attr) else: meta_cls.register_presentation(attr) intersection = (...
"""Register a file type as an attribute""" if attr in ATTRIBUTE_REGISTRY[target][constants.RW_ACTION]: # No registration required return ATTRIBUTE_REGISTRY[target][action].add(attr) if action == constants.READ_ACTION: meta_cls.register_input(attr) else: meta_cls.re...
34
304
276
580
""" pyexcel.internal.attributes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Book and sheet attributes :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel import constants ATTRIBUTE_REGISTRY = { constants.SHEET: { constants.READ_ACTION: set(), ...
""" pyexcel.internal.attributes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Book and sheet attributes :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel import constants ATTRIBUTE_REGISTRY = { constants.SHEET: { constants.READ_ACTION: set(), ...
49,515
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/internal/common.py
36,37
1,59
get_sheet_headers
37,48
37,48
""" pyexcel.internal.common ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Defintion for the shared objects :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ NO_COLUMN_NAMES = "Only sheet with column names is accepted" class SheetIterator(): """ Sheet Iterator """ def...
""" pyexcel.internal.common ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Defintion for the shared objects :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ NO_COLUMN_NAMES = "Only sheet with column names is accepted" class SheetIterator(): """ Sheet Iterator """ def...
from pyexcel.internal.generators import SheetStream if isinstance(sheet, SheetStream): headers = next(sheet.payload) else: headers = sheet.colnames if len(headers) == 0: raise Exception(NO_COLUMN_NAMES) return headers
from pyexcel.internal.generators import SheetStream if isinstance(sheet, SheetStream): headers = next(sheet.payload) else: headers = sheet.colnames if len(headers) == 0: raise Exception(NO_COLUMN_NAMES) return headers
22
376
92
468
""" pyexcel.internal.common ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Defintion for the shared objects :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ NO_COLUMN_NAMES = "Only sheet with column names is accepted" class SheetIterator(): """ Sheet Iterator """ def...
""" pyexcel.internal.common ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Defintion for the shared objects :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ NO_COLUMN_NAMES = "Only sheet with column names is accepted" class SheetIterator(): """ Sheet Iterator """ def...
49,516
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/internal/common.py
28,29
13,36
next
SheetIterator
30,36
29,36
class SheetIterator(): """ Sheet Iterator """ def __init__(self, bookreader): self.book_reader_ref = bookreader self.current = 0 def __iter__(self): return self def __next__(self): return self.next() def next(self): FILL_FUNC_BODY
class SheetIterator(): """ Sheet Iterator """ def __init__(self, bookreader): self.book_reader_ref = bookreader self.current = 0 def __iter__(self): return self def __next__(self): return self.next() def next(self): """get next sheet""" FILL_FUNC_B...
if self.current < self.book_reader_ref.number_of_sheets(): self.current += 1 return self.book_reader_ref[self.current - 1] raise StopIteration
"""get next sheet""" if self.current < self.book_reader_ref.number_of_sheets(): self.current += 1 return self.book_reader_ref[self.current - 1] raise StopIteration
13
103
61
164
""" pyexcel.internal.common ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Defintion for the shared objects :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ NO_COLUMN_NAMES = "Only sheet with column names is accepted" class SheetIterator(): """ Sheet Iterator """ def...
""" pyexcel.internal.common ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Defintion for the shared objects :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ NO_COLUMN_NAMES = "Only sheet with column names is accepted" class SheetIterator(): """ Sheet Iterator """ def...
49,517
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/internal/core.py
15,16
1,79
get_sheet_stream
19,28
16,28
""" pyexcel.internal.core ~~~~~~~~~~~~~~~~~~~~~~ elementary functions to read and write generic excel content :copyright: (c) 2015-2021 by Onni Software Ltd. :license: New BSD License """ from pyexcel.internal import SOURCE from pyexcel.constants import DEFAULT_NO_DATA from pyexcel.internal.genera...
""" pyexcel.internal.core ~~~~~~~~~~~~~~~~~~~~~~ elementary functions to read and write generic excel content :copyright: (c) 2015-2021 by Onni Software Ltd. :license: New BSD License """ from pyexcel.internal import SOURCE from pyexcel.constants import DEFAULT_NO_DATA from pyexcel.internal.genera...
a_source = SOURCE.get_source(**keywords) filename, path = a_source.get_source_info() sheets = a_source.get_data() if sheets: sheet_name, data = _one_sheet_tuple(sheets.items()) return SheetStream(sheet_name, data) return SheetStream(DEFAULT_NO_DATA, [[]])
""" Get an instance of SheetStream from an excel source """ a_source = SOURCE.get_source(**keywords) filename, path = a_source.get_source_info() sheets = a_source.get_data() if sheets: sheet_name, data = _one_sheet_tuple(sheets.items()) return SheetStream(sheet_name, data) ...
22
554
112
666
""" pyexcel.internal.core ~~~~~~~~~~~~~~~~~~~~~~ elementary functions to read and write generic excel content :copyright: (c) 2015-2021 by Onni Software Ltd. :license: New BSD License """ from pyexcel.internal import SOURCE from pyexcel.constants import DEFAULT_NO_DATA from pyexcel.internal.genera...
""" pyexcel.internal.core ~~~~~~~~~~~~~~~~~~~~~~ elementary functions to read and write generic excel content :copyright: (c) 2015-2021 by Onni Software Ltd. :license: New BSD License """ from pyexcel.internal import SOURCE from pyexcel.constants import DEFAULT_NO_DATA from pyexcel.internal.genera...
49,518
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/internal/garbagecollector.py
24,26
1,41
free_resources
29,35
26,35
""" pyexcel.internal.garbagecollector ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Simple garbage collector :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel import docstrings as docs from pyexcel._compact import append_doc GARBAGE = [] def append(item): ...
""" pyexcel.internal.garbagecollector ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Simple garbage collector :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel import docstrings as docs from pyexcel._compact import append_doc GARBAGE = [] def append(item): ...
for item in GARBAGE: item.close() item = None reset()
""" Close file handles opened by signature functions that starts with 'i' """ for item in GARBAGE: item.close() item = None reset()
9
230
33
263
""" pyexcel.internal.garbagecollector ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Simple garbage collector :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel import docstrings as docs from pyexcel._compact import append_doc GARBAGE = [] def append(item): ...
""" pyexcel.internal.garbagecollector ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Simple garbage collector :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel import docstrings as docs from pyexcel._compact import append_doc GARBAGE = [] def append(item): ...
49,519
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/internal/generators.py
77,78
50,126
load_from_sheets
BookStream
83,99
78,99
class BookStream(): """ Memory efficient book representation Comparing with :class:`pyexcel.Book`, the instace of this class uses :class:`pyexcel.generators.SheetStream` as its internal repesentation of sheet objects. Because `SheetStream` does not read data into memory, it is memory efficient....
class BookStream(): """ Memory efficient book representation Comparing with :class:`pyexcel.Book`, the instace of this class uses :class:`pyexcel.generators.SheetStream` as its internal repesentation of sheet objects. Because `SheetStream` does not read data into memory, it is memory efficient....
if sheets is None: return self.sheets = OrderedDict() keys = sheets.keys() if not isinstance(sheets, OrderedDict): # if the end user does not care about the order # we put alphatical order keys = sorted(keys) for name in keys: ...
"""Load content from existing sheets :param dict sheets: a dictionary of sheets. Each sheet is a list of lists """ if sheets is None: return self.sheets = OrderedDict() keys = sheets.keys() if not isinstance(sheets, OrderedDict): #...
65
515
174
689
""" pyexcel.internal.generators ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Defintion for the sheet and book generators. :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel._compact import OrderedDict from pyexcel.internal.common import SheetIterator class SheetStream():...
""" pyexcel.internal.generators ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Defintion for the sheet and book generators. :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel._compact import OrderedDict from pyexcel.internal.common import SheetIterator class SheetStream():...
49,520
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/internal/generators.py
46,47
14,50
get_internal_array
SheetStream
47,50
47,50
class SheetStream(): """ Memory efficient sheet representation This class wraps around the data read from pyexcel-io. Comparing with :class:`pyexcel.Sheet`, the instance of this class does not load all data into memory. Hence it performs better when dealing with big data. If you would like...
class SheetStream(): """ Memory efficient sheet representation This class wraps around the data read from pyexcel-io. Comparing with :class:`pyexcel.Sheet`, the instance of this class does not load all data into memory. Hence it performs better when dealing with big data. If you would like...
return self.payload
return self.payload
2
251
12
263
""" pyexcel.internal.generators ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Defintion for the sheet and book generators. :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel._compact import OrderedDict from pyexcel.internal.common import SheetIterator class SheetStream():...
""" pyexcel.internal.generators ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Defintion for the sheet and book generators. :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel._compact import OrderedDict from pyexcel.internal.common import SheetIterator class SheetStream():...
49,521
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/internal/plugins.py
19,20
13,34
get_a_plugin
IOPluginManager
21,28
20,28
class IOPluginManager(PluginManager): """Generic plugin manager for renderer and parser""" def __init__(self, name): PluginManager.__init__(self, name) def get_a_plugin(self, key, library=None): FILL_FUNC_BODY def get_all_file_types(self): """get all supported file types""" file...
class IOPluginManager(PluginManager): """Generic plugin manager for renderer and parser""" def __init__(self, name): PluginManager.__init__(self, name) def get_a_plugin(self, key, library=None): """get a plugin to handle the file type""" FILL_FUNC_BODY def get_all_file_types(self): ...
__file_type = None if key: __file_type = key.lower() plugin_cls = self.load_me_now(__file_type, library=library) return plugin_cls(__file_type)
"""get a plugin to handle the file type""" __file_type = None if key: __file_type = key.lower() plugin_cls = self.load_me_now(__file_type, library=library) return plugin_cls(__file_type)
14
129
66
195
""" pyexcel.internal.plugins ~~~~~~~~~~~~~~~~~~~~~~~~~~ Renderer and parser plugin manager :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from lml.plugin import PluginManager class IOPluginManager(PluginManager): """Generic plugin manager for renderer and parse...
""" pyexcel.internal.plugins ~~~~~~~~~~~~~~~~~~~~~~~~~~ Renderer and parser plugin manager :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from lml.plugin import PluginManager class IOPluginManager(PluginManager): """Generic plugin manager for renderer and parse...
49,522
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/internal/sheets/_shared.py
50,51
1,122
analyse_slice
52,75
51,75
""" pyexcel.internal.sheets._shared ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Locally shared utility functions :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ import re import types from typing import Tuple from functools import partial from pyexcel._compact import P...
""" pyexcel.internal.sheets._shared ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Locally shared utility functions :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ import re import types from typing import Tuple from functools import partial from pyexcel._compact import P...
if aslice.start is None: start = 0 else: start = max(aslice.start, 0) if aslice.stop is None: stop = upper_bound else: stop = min(aslice.stop, upper_bound) if start > stop: raise ValueError if start < stop: if aslice.step: my_range = ra...
"""An internal function to analyze a given slice""" if aslice.start is None: start = 0 else: start = max(aslice.start, 0) if aslice.stop is None: stop = upper_bound else: stop = min(aslice.stop, upper_bound) if start > stop: raise ValueError if start <...
66
778
213
991
""" pyexcel.internal.sheets._shared ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Locally shared utility functions :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ import re import types from typing import Tuple from functools import partial from pyexcel._compact import P...
""" pyexcel.internal.sheets._shared ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Locally shared utility functions :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ import re import types from typing import Tuple from functools import partial from pyexcel._compact import P...
49,523
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/internal/sheets/_shared.py
39,41
20,50
get_converter
CommonPropertyAmongRowNColumn
42,50
41,50
class CommonPropertyAmongRowNColumn(): """ Group reusable functions from row and column """ def __init__(self, matrix): self._ref = matrix def __iadd__(self, other): raise NotImplementedError("Not implemented") def __add__(self, other): """Overload + sign :ret...
class CommonPropertyAmongRowNColumn(): """ Group reusable functions from row and column """ def __init__(self, matrix): self._ref = matrix def __iadd__(self, other): raise NotImplementedError("Not implemented") def __add__(self, other): """Overload + sign :ret...
converter = None if isinstance(theformatter, types.FunctionType): converter = theformatter else: converter = partial(to_format, theformatter) return converter
"""return the actual converter or a built-in converter""" converter = None if isinstance(theformatter, types.FunctionType): converter = theformatter else: converter = partial(to_format, theformatter) return converter
16
153
59
212
""" pyexcel.internal.sheets._shared ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Locally shared utility functions :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ import re import types from typing import Tuple from functools import partial from pyexcel._compact import P...
""" pyexcel.internal.sheets._shared ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Locally shared utility functions :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ import re import types from typing import Tuple from functools import partial from pyexcel._compact import P...
49,525
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/internal/sheets/extended_list.py
8,9
4,15
value_counts
PyexcelList
9,15
9,15
class PyexcelList(list): def __init__(self, *args): list.__init__(self, *args) def value_counts(self): FILL_FUNC_BODY
class PyexcelList(list): def __init__(self, *args): list.__init__(self, *args) def value_counts(self): FILL_FUNC_BODY
from pyexcel import get_sheet c = Counter(self) sheet = get_sheet(adict=c) sheet.rownames = ["names", "counts"] return sheet
from pyexcel import get_sheet c = Counter(self) sheet = get_sheet(adict=c) sheet.rownames = ["names", "counts"] return sheet
16
52
57
109
from collections import Counter class PyexcelList(list): def __init__(self, *args): list.__init__(self, *args) def value_counts(self): FILL_FUNC_BODY
from collections import Counter class PyexcelList(list): def __init__(self, *args): list.__init__(self, *args) def value_counts(self): FILL_FUNC_BODY
49,529
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/internal/source_plugin.py
151,152
1,157
_get_me_pypi_package_name
152,156
152,156
""" pyexcel.internal.source_plugin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Second level abstraction :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from lml.plugin import PluginManager from pyexcel_io import constants as io_constants from pyexcel import constants from pyexcel...
""" pyexcel.internal.source_plugin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Second level abstraction :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from lml.plugin import PluginManager from pyexcel_io import constants as io_constants from pyexcel import constants from pyexcel...
root_module_name = module_name.split(".")[0] return root_module_name.replace("_", "-")
root_module_name = module_name.split(".")[0] return root_module_name.replace("_", "-")
6
1,479
39
1,518
""" pyexcel.internal.source_plugin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Second level abstraction :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from lml.plugin import PluginManager from pyexcel_io import constants as io_constants from pyexcel import constants from pyexcel...
""" pyexcel.internal.source_plugin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Second level abstraction :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from lml.plugin import PluginManager from pyexcel_io import constants as io_constants from pyexcel import constants from pyexcel...
49,530
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/internal/source_plugin.py
59,62
26,133
get_a_plugin
SourcePluginManager
63,76
62,76
class SourcePluginManager(PluginManager): """Data source plugin loader""" def __init__(self): PluginManager.__init__(self, "source") self.keywords = {} def load_me_later(self, plugin_info): PluginManager.load_me_later(self, plugin_info) self._register_a_plugin_info(plugin_i...
class SourcePluginManager(PluginManager): """Data source plugin loader""" def __init__(self): PluginManager.__init__(self, "source") self.keywords = {} def load_me_later(self, plugin_info): PluginManager.load_me_later(self, plugin_info) self._register_a_plugin_info(plugin_i...
key = REGISTRY_KEY_FORMAT % (target, action) io_library = None # backward support pyexcel-io library parameter if "library" in keywords: io_library = keywords.pop("library") source_cls = self.load_me_now( key, action=action, library=source_library, **keywo...
"""obtain a source plugin for signature functions""" key = REGISTRY_KEY_FORMAT % (target, action) io_library = None # backward support pyexcel-io library parameter if "library" in keywords: io_library = keywords.pop("library") source_cls = self.load_me_now( ...
43
960
147
1,107
""" pyexcel.internal.source_plugin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Second level abstraction :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from lml.plugin import PluginManager from pyexcel_io import constants as io_constants from pyexcel import constants from pyexcel...
""" pyexcel.internal.source_plugin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Second level abstraction :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from lml.plugin import PluginManager from pyexcel_io import constants as io_constants from pyexcel import constants from pyexcel...
49,531
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/internal/utils.py
1,2
1,57
default_getter
7,16
2,16
def default_getter(attribute=None): FILL_FUNC_BODYdef default_setter(attribute=None): """a default method for missing parser method for example, the support to read data in a specific file type is missing but the support to write data exists """ def none_importer(_x, _y, **_z): """docstrin...
def default_getter(attribute=None): """a default method for missing renderer method for example, the support to write data in a specific file type is missing but the support to read data exists """ FILL_FUNC_BODYdef default_setter(attribute=None): """a default method for missing parser method ...
def none_presenter(_, **__): """docstring is assigned a few lines down the line""" raise NotImplementedError("%s getter is not defined." % attribute) none_presenter.__doc__ = "%s getter is not defined." % attribute return none_presenter
"""a default method for missing renderer method for example, the support to write data in a specific file type is missing but the support to read data exists """ def none_presenter(_, **__): """docstring is assigned a few lines down the line""" raise NotImplementedError("%s getter ...
31
422
85
507
def default_getter(attribute=None): FILL_FUNC_BODYdef default_setter(attribute=None): """a default method for missing parser method for example, the support to read data in a specific file type is missing but the support to write data exists """ def none_importer(_x, _y, **_z): """docstrin...
def default_getter(attribute=None): """a default method for missing renderer method for example, the support to write data in a specific file type is missing but the support to read data exists """ FILL_FUNC_BODYdef default_setter(attribute=None): """a default method for missing parser method ...
49,532
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/parser.py
21,22
13,43
parse_file
AbstractParser
25,27
22,27
class AbstractParser(): """ Parsing data from tabular data such as excel file """ def __init__(self, file_type): self._file_type = file_type def parse_file(self, file_name, **keywords): FILL_FUNC_BODY def parse_file_stream(self, file_stream, **keywords): """ Parse data f...
class AbstractParser(): """ Parsing data from tabular data such as excel file """ def __init__(self, file_type): self._file_type = file_type def parse_file(self, file_name, **keywords): """ Parse data from a physical file """ FILL_FUNC_BODY def parse_file_stream(...
raise NotImplementedError("parse_file is not implemented")
""" Parse data from a physical file """ raise NotImplementedError("parse_file is not implemented")
5
226
19
245
""" pyexcel.parser ~~~~~~~~~~~~~~~~~~~ Extract tabular data from external file, stream or content :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.internal import garbagecollector as gc class AbstractParser(): """ Parsing data from tabular data s...
""" pyexcel.parser ~~~~~~~~~~~~~~~~~~~ Extract tabular data from external file, stream or content :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.internal import garbagecollector as gc class AbstractParser(): """ Parsing data from tabular data s...
49,533
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/parser.py
54,55
43,62
parse_file_content
DbParser
55,57
55,57
class DbParser(AbstractParser): """ Change interface for db parser """ def parse_file(self, file_name, **keywords): raise Exception("parse_file is not supported") def parse_file_stream(self, file_stream, **keywords): return self.parse_db(file_stream, **keywords) def parse_file...
class DbParser(AbstractParser): """ Change interface for db parser """ def parse_file(self, file_name, **keywords): raise Exception("parse_file is not supported") def parse_file_stream(self, file_stream, **keywords): return self.parse_db(file_stream, **keywords) def parse_file...
raise Exception("parse_file_content is not supported")
raise Exception("parse_file_content is not supported")
5
163
17
180
""" pyexcel.parser ~~~~~~~~~~~~~~~~~~~ Extract tabular data from external file, stream or content :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.internal import garbagecollector as gc class AbstractParser(): """ Parsing data from tabular data s...
""" pyexcel.parser ~~~~~~~~~~~~~~~~~~~ Extract tabular data from external file, stream or content :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.internal import garbagecollector as gc class AbstractParser(): """ Parsing data from tabular data s...
49,534
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/parsers/django.py
18,21
15,35
parse_db
DjangoExporter
21,35
21,35
class DjangoExporter(DbParser): """Export data from django model""" def parse_db( self, argument, export_columns_list=None, on_demand=True, **keywords ): FILL_FUNC_BODY
class DjangoExporter(DbParser): """Export data from django model""" def parse_db( self, argument, export_columns_list=None, on_demand=True, **keywords ): FILL_FUNC_BODY
models = argument exporter = django.DjangoModelExporter() if export_columns_list is None: export_columns_list = [None] * len(models) for model, export_columns in zip(models, export_columns_list): adapter = django.DjangoModelExportAdapter(model, export_columns) ...
models = argument exporter = django.DjangoModelExporter() if export_columns_list is None: export_columns_list = [None] * len(models) for model, export_columns in zip(models, export_columns_list): adapter = django.DjangoModelExportAdapter(model, export_columns) ...
44
66
181
247
""" pyexcel.plugin.parsers.django ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Export data into database datables :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io import get_data, iget_data from pyexcel_io.database import common as django from pyexcel.parser i...
""" pyexcel.plugin.parsers.django ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Export data into database datables :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io import get_data, iget_data from pyexcel_io.database import common as django from pyexcel.parser i...
49,535
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/parsers/excel.py
29,32
13,40
_parse_any
ExcelParser
32,40
32,40
class ExcelParser(AbstractParser): """get data from excel files""" def parse_file(self, file_name, **keywords): return self._parse_any(file_name, **keywords) def parse_file_stream(self, file_stream, **keywords): return self._parse_any( file_stream, file_type=self._file_type, **...
class ExcelParser(AbstractParser): """get data from excel files""" def parse_file(self, file_name, **keywords): return self._parse_any(file_name, **keywords) def parse_file_stream(self, file_stream, **keywords): return self._parse_any( file_stream, file_type=self._file_type, **...
if on_demand: sheets, reader = iget_data( anything, file_type=file_type, **keywords ) self._free_me_up_later(reader) else: sheets = get_data(anything, file_type=file_type, **keywords) return sheets
if on_demand: sheets, reader = iget_data( anything, file_type=file_type, **keywords ) self._free_me_up_later(reader) else: sheets = get_data(anything, file_type=file_type, **keywords) return sheets
19
199
89
288
""" pyexcel.plugins.parsers.excel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Parsing excel sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io import get_data, iget_data from pyexcel.parser import AbstractParser class ExcelParser(AbstractParser): ...
""" pyexcel.plugins.parsers.excel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Parsing excel sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io import get_data, iget_data from pyexcel.parser import AbstractParser class ExcelParser(AbstractParser): ...
49,536
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/parsers/sqlalchemy.py
17,20
14,34
parse_db
SQLAlchemyExporter
20,34
20,34
class SQLAlchemyExporter(DbParser): """export data via sqlalchemy""" def parse_db( self, argument, export_columns_list=None, on_demand=False, **keywords ): FILL_FUNC_BODY
class SQLAlchemyExporter(DbParser): """export data via sqlalchemy""" def parse_db( self, argument, export_columns_list=None, on_demand=False, **keywords ): FILL_FUNC_BODY
session, tables = argument exporter = sql.SQLTableExporter(session) if export_columns_list is None: export_columns_list = [None] * len(tables) for table, export_columns in zip(tables, export_columns_list): adapter = sql.SQLTableExportAdapter(table, export_columns)...
session, tables = argument exporter = sql.SQLTableExporter(session) if export_columns_list is None: export_columns_list = [None] * len(tables) for table, export_columns in zip(tables, export_columns_list): adapter = sql.SQLTableExportAdapter(table, export_columns)...
45
69
181
250
""" pyexcel.plugin.parsers.sqlalchemy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Export data into database datables :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io import get_data, iget_data from pyexcel_io.database import common as sql from pyexcel.parser ...
""" pyexcel.plugin.parsers.sqlalchemy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Export data into database datables :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io import get_data, iget_data from pyexcel_io.database import common as sql from pyexcel.parser ...
49,537
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/renderers/_texttable.py
27,28
1,57
render_text_table
29,51
28,51
""" pyexcel.plugin.renderers._texttable ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Export data into texttable format. It also serves the default presentation of pyexcel sheet and book. :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from types import GeneratorType fro...
""" pyexcel.plugin.renderers._texttable ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Export data into texttable format. It also serves the default presentation of pyexcel sheet and book. :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from types import GeneratorType fro...
content = "" if write_title: content += "%s:\n" % sheet.name table = Texttable(max_width=0) data = sheet.to_array() if isinstance(data, GeneratorType): data = list(data) if len(data) == 0: return content table.set_cols_dtype(["t"] * len(data[0])) if len(sheet.coln...
"""return data in text table presentation""" content = "" if write_title: content += "%s:\n" % sheet.name table = Texttable(max_width=0) data = sheet.to_array() if isinstance(data, GeneratorType): data = list(data) if len(data) == 0: return content table.set_cols_...
55
285
265
550
""" pyexcel.plugin.renderers._texttable ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Export data into texttable format. It also serves the default presentation of pyexcel sheet and book. :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from types import GeneratorType fro...
""" pyexcel.plugin.renderers._texttable ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Export data into texttable format. It also serves the default presentation of pyexcel sheet and book. :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from types import GeneratorType fro...
49,538
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/renderers/_texttable.py
22,23
19,27
render_sheet
TextTableRenderer
23,27
23,27
class TextTableRenderer(Renderer): """Default texttable presetation""" def render_sheet(self, sheet): FILL_FUNC_BODY
class TextTableRenderer(Renderer): """Default texttable presetation""" def render_sheet(self, sheet): FILL_FUNC_BODY
content = render_text_table(sheet, self._write_title) self._stream.write(content)
content = render_text_table(sheet, self._write_title) self._stream.write(content)
5
40
34
74
""" pyexcel.plugin.renderers._texttable ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Export data into texttable format. It also serves the default presentation of pyexcel sheet and book. :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from types import GeneratorType fro...
""" pyexcel.plugin.renderers._texttable ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Export data into texttable format. It also serves the default presentation of pyexcel sheet and book. :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from types import GeneratorType fro...
49,539
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/renderers/django.py
40,49
20,77
render_book_to_stream
DjangoRenderer
49,77
49,77
class DjangoRenderer(DbRenderer): """Import data into database""" def render_sheet_to_stream( self, model, sheet, init=None, mapdict=None, **keywords ): headers = common.get_sheet_headers(sheet) importer = django.DjangoModelImporter() adapter = django.DjangoModelImportAdapte...
class DjangoRenderer(DbRenderer): """Import data into database""" def render_sheet_to_stream( self, model, sheet, init=None, mapdict=None, **keywords ): headers = common.get_sheet_headers(sheet) importer = django.DjangoModelImporter() adapter = django.DjangoModelImportAdapte...
colnames_array = common.get_book_headers_in_array(book) new_models = [model for model in models if model is not None] initializers = inits if initializers is None: initializers = [None] * len(new_models) if mapdicts is None: mapdicts = [None] * len(new_mod...
colnames_array = common.get_book_headers_in_array(book) new_models = [model for model in models if model is not None] initializers = inits if initializers is None: initializers = [None] * len(new_models) if mapdicts is None: mapdicts = [None] * len(new_mod...
90
255
352
607
""" pyexcel.plugin.renderers.django ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Export data into django models :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io import save_data from pyexcel_io.database import common as django from pyexcel._compact import Ord...
""" pyexcel.plugin.renderers.django ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Export data into django models :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io import save_data from pyexcel_io.database import common as django from pyexcel._compact import Ord...
49,540
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/renderers/excel.py
36,37
15,40
render_book_to_stream
ExcelRenderer
37,40
37,40
class ExcelRenderer(AbstractRenderer): """Output data into excel format""" def get_io(self): return manager.get_io(self._file_type) def render_sheet_to_file(self, file_name, sheet, **keywords): sheet_name = DEFAULT_SHEET_NAME if sheet.name: sheet_name = sheet.name ...
class ExcelRenderer(AbstractRenderer): """Output data into excel format""" def get_io(self): return manager.get_io(self._file_type) def render_sheet_to_file(self, file_name, sheet, **keywords): sheet_name = DEFAULT_SHEET_NAME if sheet.name: sheet_name = sheet.name ...
self.render_book_to_file( file_stream, book, file_type=self._file_type, **keywords )
self.render_book_to_file( file_stream, book, file_type=self._file_type, **keywords )
6
265
39
304
""" pyexcel.plugin.renderers.excel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Export data into excel files :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io import manager from pyexcel_io import save_data from pyexcel.renderer import AbstractRenderer from pye...
""" pyexcel.plugin.renderers.excel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Export data into excel files :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io import manager from pyexcel_io import save_data from pyexcel.renderer import AbstractRenderer from pye...
49,541
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/renderers/sqlalchemy.py
36,39
16,62
render_book_to_stream
SQLAlchemyRenderer
39,62
39,62
class SQLAlchemyRenderer(DbRenderer): """Import data into database""" def render_sheet_to_stream( self, file_stream, sheet, init=None, mapdict=None, **keywords ): headers = common.get_sheet_headers(sheet) importer = sql.SQLTableImporter(file_stream[0]) adapter = sql.SQLTable...
class SQLAlchemyRenderer(DbRenderer): """Import data into database""" def render_sheet_to_stream( self, file_stream, sheet, init=None, mapdict=None, **keywords ): headers = common.get_sheet_headers(sheet) importer = sql.SQLTableImporter(file_stream[0]) adapter = sql.SQLTable...
session, tables = file_stream thebook = book initializers = inits colnames_array = common.get_book_headers_in_array(book) if initializers is None: initializers = [None] * len(tables) if mapdicts is None: mapdicts = [None] * len(tables) scat...
session, tables = file_stream thebook = book initializers = inits colnames_array = common.get_book_headers_in_array(book) if initializers is None: initializers = [None] * len(tables) if mapdicts is None: mapdicts = [None] * len(tables) scat...
82
249
317
566
""" pyexcel.plugin.renderers.sqlalchemy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Export data into database datables :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io import save_data from pyexcel_io.database import common as sql from pyexcel._compact import...
""" pyexcel.plugin.renderers.sqlalchemy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Export data into database datables :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io import save_data from pyexcel_io.database import common as sql from pyexcel._compact import...
49,542
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/django.py
47,48
38,49
get_params
BookDjangoSource
48,49
48,49
class BookDjangoSource(BookDbSource): """ multiple Django table as data source """ def __init__(self, models, **keywords): self.__models = models BookDbSource.__init__(self, DB_DJANGO, **keywords) def get_params(self): FILL_FUNC_BODY
class BookDjangoSource(BookDbSource): """ multiple Django table as data source """ def __init__(self, models, **keywords): self.__models = models BookDbSource.__init__(self, DB_DJANGO, **keywords) def get_params(self): FILL_FUNC_BODY
return self.__models
return self.__models
2
89
7
96
""" pyexcel.plugins.sources.django ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of django sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io.constants import DB_DJANGO from .db_sources import BookDbSource, SheetDbSource class SheetDjangoSour...
""" pyexcel.plugins.sources.django ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of django sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io.constants import DB_DJANGO from .db_sources import BookDbSource, SheetDbSource class SheetDjangoSour...
49,543
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/django.py
34,35
14,38
get_import_params
SheetDjangoSource
35,38
35,38
class SheetDjangoSource(SheetDbSource): """ Django model as data source """ def __init__( self, model=None, export_columns=None, sheet_name=None, **keywords ): self.__model = model SheetDbSource.__init__( self, DB_DJANGO, export_columns=ex...
class SheetDjangoSource(SheetDbSource): """ Django model as data source """ def __init__( self, model=None, export_columns=None, sheet_name=None, **keywords ): self.__model = model SheetDbSource.__init__( self, DB_DJANGO, export_columns=ex...
return self.__model
return self.__model
2
160
11
171
""" pyexcel.plugins.sources.django ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of django sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io.constants import DB_DJANGO from .db_sources import BookDbSource, SheetDbSource class SheetDjangoSour...
""" pyexcel.plugins.sources.django ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of django sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io.constants import DB_DJANGO from .db_sources import BookDbSource, SheetDbSource class SheetDjangoSour...
49,544
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/file_input.py
34,35
17,40
get_data
ReadExcelFromFile
38,40
35,40
class ReadExcelFromFile(AbstractSource): """Pick up 'file_name' field and do single sheet based read and write""" def __init__(self, file_name=None, parser_library=None, **keywords): self.__file_name = file_name if "force_file_type" in keywords: file_type = keywords.get("force_file...
class ReadExcelFromFile(AbstractSource): """Pick up 'file_name' field and do single sheet based read and write""" def __init__(self, file_name=None, parser_library=None, **keywords): self.__file_name = file_name if "force_file_type" in keywords: file_type = keywords.get("force_file...
sheets = self.__parser.parse_file(self.__file_name, **self._keywords) return sheets
""" Return a dictionary with only one key and one value """ sheets = self.__parser.parse_file(self.__file_name, **self._keywords) return sheets
6
234
30
264
""" pyexcel.plugins.sources.file_input ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of input file sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ import os from pyexcel.source import AbstractSource from pyexcel.internal import PARSER # pylint: disable...
""" pyexcel.plugins.sources.file_input ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of input file sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ import os from pyexcel.source import AbstractSource from pyexcel.internal import PARSER # pylint: disable...
49,545
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/file_output.py
40,41
37,44
write_data
WriteBookToFile
41,44
41,44
class WriteBookToFile(WriteSheetToFile): """Pick up 'file_name' field and do multiple sheet based read and write""" def write_data(self, book): FILL_FUNC_BODY
class WriteBookToFile(WriteSheetToFile): """Pick up 'file_name' field and do multiple sheet based read and write""" def write_data(self, book): FILL_FUNC_BODY
self._renderer.render_book_to_file( self._file_name, book, **self._keywords )
self._renderer.render_book_to_file( self._file_name, book, **self._keywords )
5
56
36
92
""" pyexcel.plugins.sources.file_output ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of output file sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource from pyexcel.plugins import find_file_type_from_file_name from py...
""" pyexcel.plugins.sources.file_output ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of output file sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource from pyexcel.plugins import find_file_type_from_file_name from py...
49,546
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/file_output.py
30,31
16,37
write_data
WriteSheetToFile
31,37
31,37
class WriteSheetToFile(AbstractSource): """Pick up 'file_name' field and do single sheet based read and write""" def __init__(self, file_name=None, renderer_library=None, **keywords): AbstractSource.__init__(self, **keywords) self._file_name = file_name if "force_file_type" in keywords...
class WriteSheetToFile(AbstractSource): """Pick up 'file_name' field and do single sheet based read and write""" def __init__(self, file_name=None, renderer_library=None, **keywords): AbstractSource.__init__(self, **keywords) self._file_name = file_name if "force_file_type" in keywords...
self._renderer.render_sheet_to_file( self._file_name, sheet, **self._keywords ) # pylint: disable=W0223
self._renderer.render_sheet_to_file( self._file_name, sheet, **self._keywords ) # pylint: disable=W0223
8
191
54
245
""" pyexcel.plugins.sources.file_output ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of output file sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource from pyexcel.plugins import find_file_type_from_file_name from py...
""" pyexcel.plugins.sources.file_output ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of output file sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource from pyexcel.plugins import find_file_type_from_file_name from py...
49,547
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/http.py
66,67
1,69
_get_file_type_from_url
67,69
67,69
""" pyexcel.plugins.sources.http ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of http sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel import constants from pyexcel.source import AbstractSource from pyexcel._compact import PY2, request from pyexce...
""" pyexcel.plugins.sources.http ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of http sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel import constants from pyexcel.source import AbstractSource from pyexcel._compact import PY2, request from pyexce...
extension = url.split(".") return extension[-1]
extension = url.split(".") return extension[-1]
5
641
18
659
""" pyexcel.plugins.sources.http ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of http sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel import constants from pyexcel.source import AbstractSource from pyexcel._compact import PY2, request from pyexce...
""" pyexcel.plugins.sources.http ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of http sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel import constants from pyexcel.source import AbstractSource from pyexcel._compact import PY2, request from pyexce...
49,548
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/http.py
46,47
31,66
get_data
HttpSource
47,62
47,62
class HttpSource(AbstractSource): """ Multiple sheet data source via http protocol """ fields = [params.URL] targets = (constants.SHEET, constants.BOOK) actions = (constants.READ_ACTION,) attributes = [params.URL] key = params.URL def __init__(self, url=None, **keywords): s...
class HttpSource(AbstractSource): """ Multiple sheet data source via http protocol """ fields = [params.URL] targets = (constants.SHEET, constants.BOOK) actions = (constants.READ_ACTION,) attributes = [params.URL] key = params.URL def __init__(self, url=None, **keywords): s...
connection = request.urlopen(self.__url) info = connection.info() if PY2: mime_type = info.type else: mime_type = info.get_content_type() file_type = FILE_TYPE_MIME_TABLE.get(mime_type, None) if file_type is None: file_type = _get_file_...
connection = request.urlopen(self.__url) info = connection.info() if PY2: mime_type = info.type else: mime_type = info.get_content_type() file_type = FILE_TYPE_MIME_TABLE.get(mime_type, None) if file_type is None: file_type = _get_file_...
43
158
201
359
""" pyexcel.plugins.sources.http ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of http sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel import constants from pyexcel.source import AbstractSource from pyexcel._compact import PY2, request from pyexce...
""" pyexcel.plugins.sources.http ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of http sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel import constants from pyexcel.source import AbstractSource from pyexcel._compact import PY2, request from pyexce...
49,549
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/memory_input.py
34,35
17,47
get_data
ReadExcelFileMemory
35,45
35,45
class ReadExcelFileMemory(AbstractSource): """Pick up 'file_type' and read a sheet from memory""" def __init__( self, file_content=None, file_type=None, file_stream=None, parser_library=None, **keywords ): self.__file_type = file_type self.__f...
class ReadExcelFileMemory(AbstractSource): """Pick up 'file_type' and read a sheet from memory""" def __init__( self, file_content=None, file_type=None, file_stream=None, parser_library=None, **keywords ): self.__file_type = file_type self.__f...
if self.__file_stream is not None: sheets = self.__parser.parse_file_stream( self.__file_stream, **self._keywords ) else: sheets = self.__parser.parse_file_content( self.__file_content, **self._keywords ) return shee...
if self.__file_stream is not None: sheets = self.__parser.parse_file_stream( self.__file_stream, **self._keywords ) else: sheets = self.__parser.parse_file_content( self.__file_content, **self._keywords ) return shee...
20
190
91
281
""" pyexcel.plugins.sources.memory_input ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of input file sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource from pyexcel.internal import PARSER from . import params # ...
""" pyexcel.plugins.sources.memory_input ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of input file sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource from pyexcel.internal import PARSER from . import params # ...
49,550
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/output_to_memory.py
48,49
43,52
write_data
WriteBookToMemory
49,52
49,52
class WriteBookToMemory(WriteSheetToMemory): """ Multiple sheet data source for writing back to memory """ def write_data(self, book): FILL_FUNC_BODY
class WriteBookToMemory(WriteSheetToMemory): """ Multiple sheet data source for writing back to memory """ def write_data(self, book): FILL_FUNC_BODY
self._renderer.render_book_to_stream( self._content, book, **self._keywords )
self._renderer.render_book_to_stream( self._content, book, **self._keywords )
5
53
34
87
""" pyexcel.plugins.sources.output_to_memory ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of output file sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource, MemorySourceMixin from pyexcel.internal import RENDE...
""" pyexcel.plugins.sources.output_to_memory ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of output file sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource, MemorySourceMixin from pyexcel.internal import RENDE...
49,551
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/output_to_memory.py
36,37
15,43
write_data
WriteSheetToMemory
37,43
37,43
class WriteSheetToMemory(AbstractSource, MemorySourceMixin): """ Single sheet to memory """ def __init__( self, file_type=None, file_stream=None, renderer_library=None, **keywords ): AbstractSource.__init__(self, **keywords) self._renderer = ...
class WriteSheetToMemory(AbstractSource, MemorySourceMixin): """ Single sheet to memory """ def __init__( self, file_type=None, file_stream=None, renderer_library=None, **keywords ): AbstractSource.__init__(self, **keywords) self._renderer = ...
self._renderer.render_sheet_to_stream( self._content, sheet, **self._keywords ) # pylint: disable=W0223
self._renderer.render_sheet_to_stream( self._content, sheet, **self._keywords ) # pylint: disable=W0223
8
190
52
242
""" pyexcel.plugins.sources.output_to_memory ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of output file sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource, MemorySourceMixin from pyexcel.internal import RENDE...
""" pyexcel.plugins.sources.output_to_memory ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of output file sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource, MemorySourceMixin from pyexcel.internal import RENDE...
49,552
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/pydata/arraysource.py
32,33
17,37
get_source_info
ArraySource
33,35
33,35
class ArraySource(AbstractSource, MemorySourceMixin): """ A two dimensional array as sheet source """ def __init__(self, array, sheet_name=DEFAULT_SHEET_NAME, **keywords): self.__array = array self._content = _FakeIO() self.__sheet_name = sheet_name AbstractSource.__init...
class ArraySource(AbstractSource, MemorySourceMixin): """ A two dimensional array as sheet source """ def __init__(self, array, sheet_name=DEFAULT_SHEET_NAME, **keywords): self.__array = array self._content = _FakeIO() self.__sheet_name = sheet_name AbstractSource.__init...
return params.ARRAY, None
return params.ARRAY, None
3
193
12
205
""" pyexcel.plugins.sources.pydata.arraysource ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of array source :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource, MemorySourceMixin from pyexcel.constants import DEFAU...
""" pyexcel.plugins.sources.pydata.arraysource ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of array source :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource, MemorySourceMixin from pyexcel.constants import DEFAU...
49,553
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/pydata/bookdict.py
40,41
1,49
_convert_dict_to_ordered_dict
41,49
41,49
""" pyexcel.plugins.sources.pydata.bookdictsource ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of book dict source :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource, MemorySourceMixin from pyexcel._compact impor...
""" pyexcel.plugins.sources.pydata.bookdictsource ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of book dict source :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource, MemorySourceMixin from pyexcel._compact impor...
keys = the_dict.keys() if not PY2: keys = list(keys) keys = sorted(keys) ret = OrderedDict() for key in keys: ret[key] = the_dict[key] return ret
keys = the_dict.keys() if not PY2: keys = list(keys) keys = sorted(keys) ret = OrderedDict() for key in keys: ret[key] = the_dict[key] return ret
24
355
75
430
""" pyexcel.plugins.sources.pydata.bookdictsource ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of book dict source :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource, MemorySourceMixin from pyexcel._compact impor...
""" pyexcel.plugins.sources.pydata.bookdictsource ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of book dict source :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource, MemorySourceMixin from pyexcel._compact impor...
49,554
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/pydata/bookdict.py
27,28
17,40
get_data
BookDictSource
28,33
28,33
class BookDictSource(AbstractSource, MemorySourceMixin): """ Multiple sheet data source via a dictionary of two dimensional arrays """ def __init__(self, bookdict, **keywords): self.__bookdict = bookdict self._content = _FakeIO() AbstractSource.__init__(self, **keywords) de...
class BookDictSource(AbstractSource, MemorySourceMixin): """ Multiple sheet data source via a dictionary of two dimensional arrays """ def __init__(self, bookdict, **keywords): self.__bookdict = bookdict self._content = _FakeIO() AbstractSource.__init__(self, **keywords) de...
the_dict = self.__bookdict if not isinstance(self.__bookdict, OrderedDict): the_dict = _convert_dict_to_ordered_dict(self.__bookdict) return the_dict
the_dict = self.__bookdict if not isinstance(self.__bookdict, OrderedDict): the_dict = _convert_dict_to_ordered_dict(self.__bookdict) return the_dict
12
155
61
216
""" pyexcel.plugins.sources.pydata.bookdictsource ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of book dict source :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource, MemorySourceMixin from pyexcel._compact impor...
""" pyexcel.plugins.sources.pydata.bookdictsource ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of book dict source :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource, MemorySourceMixin from pyexcel._compact impor...
49,555
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/pydata/common.py
36,37
33,46
row_iterator
ArrayReader
37,40
37,40
class ArrayReader(SheetReader): """read data from an array via pyexcel-io interface""" def row_iterator(self): FILL_FUNC_BODY def column_iterator(self, row): for cell in row: yield cell # pylint: disable=W0223
class ArrayReader(SheetReader): """read data from an array via pyexcel-io interface""" def row_iterator(self): FILL_FUNC_BODY def column_iterator(self, row): for cell in row: yield cell # pylint: disable=W0223
for row in self._native_sheet: yield row
for row in self._native_sheet: yield row
6
82
19
101
""" pyexcel.plugins.sources.pydata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of array, dict, records and book dict sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io.sheet import SheetReader from pyexcel import constants from pyexcel._compact...
""" pyexcel.plugins.sources.pydata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of array, dict, records and book dict sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io.sheet import SheetReader from pyexcel import constants from pyexcel._compact...
49,556
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/pydata/common.py
83,84
80,101
row_iterator
DictReader
84,101
84,101
class DictReader(ArrayReader): """read data from a dictionary via pyexcel-io interface""" def row_iterator(self): FILL_FUNC_BODY
class DictReader(ArrayReader): """read data from a dictionary via pyexcel-io interface""" def row_iterator(self): FILL_FUNC_BODY
keys = self._native_sheet.keys() if not PY2: keys = list(keys) if not isinstance(self._native_sheet, OrderedDict): keys = sorted(keys) if self._keywords.get("with_keys", True): yield keys if isinstance(self._native_sheet[keys[0]], list): ...
keys = self._native_sheet.keys() if not PY2: keys = list(keys) if not isinstance(self._native_sheet, OrderedDict): keys = sorted(keys) if self._keywords.get("with_keys", True): yield keys if isinstance(self._native_sheet[keys[0]], list): ...
50
45
192
237
""" pyexcel.plugins.sources.pydata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of array, dict, records and book dict sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io.sheet import SheetReader from pyexcel import constants from pyexcel._compact...
""" pyexcel.plugins.sources.pydata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of array, dict, records and book dict sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io.sheet import SheetReader from pyexcel import constants from pyexcel._compact...
49,557
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/pydata/common.py
62,63
46,80
row_iterator
RecordsReader
63,80
63,80
class RecordsReader(ArrayReader): """read data from a records via pyexcel-io interface By default, all records are assumed to have the keys and the keys of the first dictionary of the records will be taken as a reference. When the keys of the first dictionary is the full list, The records read...
class RecordsReader(ArrayReader): """read data from a records via pyexcel-io interface By default, all records are assumed to have the keys and the keys of the first dictionary of the records will be taken as a reference. When the keys of the first dictionary is the full list, The records read...
headers = self._keywords.get("custom_headers") for index, row in enumerate(self._native_sheet): if index == 0: if headers is None: if isinstance(row, OrderedDict): headers = list(row.keys()) else: ...
headers = self._keywords.get("custom_headers") for index, row in enumerate(self._native_sheet): if index == 0: if headers is None: if isinstance(row, OrderedDict): headers = list(row.keys()) else: ...
42
149
153
302
""" pyexcel.plugins.sources.pydata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of array, dict, records and book dict sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io.sheet import SheetReader from pyexcel import constants from pyexcel._compact...
""" pyexcel.plugins.sources.pydata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of array, dict, records and book dict sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io.sheet import SheetReader from pyexcel import constants from pyexcel._compact...
49,558
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/pydata/common.py
23,24
17,33
setvalue
_FakeIO
25,27
24,27
class _FakeIO(): """emulates a stream object""" def __init__(self): self.__value = None def setvalue(self, value): FILL_FUNC_BODY def getvalue(self): """duck method getvalue""" return self.__value # pylint: disable=W0223
class _FakeIO(): """emulates a stream object""" def __init__(self): self.__value = None def setvalue(self, value): """duck method setvalue""" FILL_FUNC_BODY def getvalue(self): """duck method getvalue""" return self.__value # pylint: disable=W0223
self.__value = value
"""duck method setvalue""" self.__value = value
3
100
10
110
""" pyexcel.plugins.sources.pydata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of array, dict, records and book dict sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io.sheet import SheetReader from pyexcel import constants from pyexcel._compact...
""" pyexcel.plugins.sources.pydata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of array, dict, records and book dict sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io.sheet import SheetReader from pyexcel import constants from pyexcel._compact...
49,559
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/pydata/dictsource.py
31,32
17,42
get_data
DictSource
32,37
32,37
class DictSource(AbstractSource, MemorySourceMixin): """ A dictionary of one dimensional array as sheet source """ def __init__( self, adict, with_keys=True, sheet_name=DEFAULT_SHEET_NAME, **keywords ): self.__adict = adict self.__with_keys = with_keys self._content ...
class DictSource(AbstractSource, MemorySourceMixin): """ A dictionary of one dimensional array as sheet source """ def __init__( self, adict, with_keys=True, sheet_name=DEFAULT_SHEET_NAME, **keywords ): self.__adict = adict self.__with_keys = with_keys self._content ...
dict_reader = DictReader( self.__adict, with_keys=self.__with_keys, **self._keywords ) return {self.__sheet_name: dict_reader.to_array()}
dict_reader = DictReader( self.__adict, with_keys=self.__with_keys, **self._keywords ) return {self.__sheet_name: dict_reader.to_array()}
10
193
60
253
""" pyexcel.plugins.sources.pydata.dictsource ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of dict sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource, MemorySourceMixin from pyexcel.constants import DEFAULT_...
""" pyexcel.plugins.sources.pydata.dictsource ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of dict sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource, MemorySourceMixin from pyexcel.constants import DEFAULT_...
49,560
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/pydata/records.py
40,41
17,42
get_content
RecordsSource
41,42
41,42
class RecordsSource(AbstractSource, MemorySourceMixin): """ A list of dictionaries as data source The dictionaries should have identical fields. """ def __init__(self, records, sheet_name=DEFAULT_SHEET_NAME, **keywords): self.__records = records self._content = _FakeIO() se...
class RecordsSource(AbstractSource, MemorySourceMixin): """ A list of dictionaries as data source The dictionaries should have identical fields. """ def __init__(self, records, sheet_name=DEFAULT_SHEET_NAME, **keywords): self.__records = records self._content = _FakeIO() se...
return self._content
return self._content
2
230
7
237
""" pyexcel.plugins.sources.pydata.recordssource ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of records source :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource, MemorySourceMixin from pyexcel.constants import ...
""" pyexcel.plugins.sources.pydata.recordssource ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of records source :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource, MemorySourceMixin from pyexcel.constants import ...
49,561
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/querysets.py
63,64
19,79
get_data
SheetQuerySetSource
64,79
64,79
class SheetQuerySetSource(AbstractSource): """ Database query set as data source SQLAlchemy and Django query sets are supported """ fields = [params.COLUMN_NAMES, params.QUERY_SETS] targets = (constants.SHEET,) actions = (constants.READ_ACTION,) attributes = [] def __init__( ...
class SheetQuerySetSource(AbstractSource): """ Database query set as data source SQLAlchemy and Django query sets are supported """ fields = [params.COLUMN_NAMES, params.QUERY_SETS] targets = (constants.SHEET,) actions = (constants.READ_ACTION,) attributes = [] def __init__( ...
local_params = dict( row_renderer=self.__row_renderer, start_row=self.__start_row, row_limit=self.__row_limit, ) if self.__skip_row_func is not None: local_params["skip_row_func"] = self.__skip_row_func data = get_data( self.__...
local_params = dict( row_renderer=self.__row_renderer, start_row=self.__start_row, row_limit=self.__row_limit, ) if self.__skip_row_func is not None: local_params["skip_row_func"] = self.__skip_row_func data = get_data( self.__...
25
400
152
552
""" pyexcel.plugins.sources.querysets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of querysets :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io import get_data from pyexcel_io.constants import DB_QUERYSET from pyexcel import constants from pyexcel...
""" pyexcel.plugins.sources.querysets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of querysets :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io import get_data from pyexcel_io.constants import DB_QUERYSET from pyexcel import constants from pyexcel...
49,562
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/sheet_stream_source.py
26,27
14,28
get_source_info
SheetStreamSource
27,28
27,28
class SheetStreamSource(AbstractSource, MemorySourceMixin): """ Internal Sheet Stream as data source """ def __init__(self, sheet_stream, **keywords): self.__sheet_stream = sheet_stream AbstractSource.__init__(self, **keywords) def get_data(self): return {self.__sheet_strea...
class SheetStreamSource(AbstractSource, MemorySourceMixin): """ Internal Sheet Stream as data source """ def __init__(self, sheet_stream, **keywords): self.__sheet_stream = sheet_stream AbstractSource.__init__(self, **keywords) def get_data(self): return {self.__sheet_strea...
return params.SHEET_STREAM, None
return params.SHEET_STREAM, None
3
124
15
139
""" pyexcel.plugins.sources.sheet_stream_source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of array source :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource, MemorySourceMixin from pyexcel.plugins.sources impor...
""" pyexcel.plugins.sources.sheet_stream_source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of array source :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel.source import AbstractSource, MemorySourceMixin from pyexcel.plugins.sources impor...
49,563
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/sqlalchemy.py
49,50
39,51
get_params
BookSQLSource
50,51
50,51
class BookSQLSource(BookDbSource): """ SQLAlchemy bridged multiple table data source """ def __init__(self, session, tables, **keywords): self.__session = session self.__tables = tables BookDbSource.__init__(self, DB_SQL, **keywords) def get_params(self): FILL_FUNC_BODY
class BookSQLSource(BookDbSource): """ SQLAlchemy bridged multiple table data source """ def __init__(self, session, tables, **keywords): self.__session = session self.__tables = tables BookDbSource.__init__(self, DB_SQL, **keywords) def get_params(self): FILL_FUNC_BODY
return (self.__session, self.__tables)
return (self.__session, self.__tables)
3
97
13
110
""" pyexcel.plugins.sources.sqlalchemy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of sqlalchemy sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io.constants import DB_SQL from .db_sources import BookDbSource, SheetDbSource class SheetSQLA...
""" pyexcel.plugins.sources.sqlalchemy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of sqlalchemy sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io.constants import DB_SQL from .db_sources import BookDbSource, SheetDbSource class SheetSQLA...
49,564
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/plugins/sources/sqlalchemy.py
32,33
14,39
get_export_params
SheetSQLAlchemySource
33,35
33,35
class SheetSQLAlchemySource(SheetDbSource): """ SQLAlchemy channeled sql database as data source """ def __init__( self, session, table, export_columns=None, sheet_name=None, **keywords ): self.__session = session self.__table = table SheetDbSource.__init__( ...
class SheetSQLAlchemySource(SheetDbSource): """ SQLAlchemy channeled sql database as data source """ def __init__( self, session, table, export_columns=None, sheet_name=None, **keywords ): self.__session = session self.__table = table SheetDbSource.__init__( ...
return (self.__session, [self.__table])
return (self.__session, [self.__table])
3
176
16
192
""" pyexcel.plugins.sources.sqlalchemy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of sqlalchemy sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io.constants import DB_SQL from .db_sources import BookDbSource, SheetDbSource class SheetSQLA...
""" pyexcel.plugins.sources.sqlalchemy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Representation of sqlalchemy sources :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel_io.constants import DB_SQL from .db_sources import BookDbSource, SheetDbSource class SheetSQLA...
49,565
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/source.py
69,70
1,71
_has_field
70,71
70,71
""" pyexcel.source ~~~~~~~~~~~~~~~~~~~~~~~~ Generic data source definition :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel import constants class AbstractSource(): """ Define a data source for use with the signature functions This can be us...
""" pyexcel.source ~~~~~~~~~~~~~~~~~~~~~~~~ Generic data source definition :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel import constants class AbstractSource(): """ Define a data source for use with the signature functions This can be us...
return field in keywords and keywords[field] is not None
return field in keywords and keywords[field] is not None
9
487
15
502
""" pyexcel.source ~~~~~~~~~~~~~~~~~~~~~~~~ Generic data source definition :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel import constants class AbstractSource(): """ Define a data source for use with the signature functions This can be us...
""" pyexcel.source ~~~~~~~~~~~~~~~~~~~~~~~~ Generic data source definition :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel import constants class AbstractSource(): """ Define a data source for use with the signature functions This can be us...
49,566
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/source.py
37,39
13,55
is_my_business
AbstractSource
42,46
39,46
class AbstractSource(): """ Define a data source for use with the signature functions This can be used to extend the function parameters once the custom class inherit this and register it with corresponding source registry """ fields = [constants.SOURCE] attributes = [] targets = [] ...
class AbstractSource(): """ Define a data source for use with the signature functions This can be used to extend the function parameters once the custom class inherit this and register it with corresponding source registry """ fields = [constants.SOURCE] attributes = [] targets = [] ...
statuses = [_has_field(field, keywords) for field in cls.fields] results = [status for status in statuses if status is False] return len(results) == 0
""" If all required keys are present, this source is activated """ statuses = [_has_field(field, keywords) for field in cls.fields] results = [status for status in statuses if status is False] return len(results) == 0
23
279
52
331
""" pyexcel.source ~~~~~~~~~~~~~~~~~~~~~~~~ Generic data source definition :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel import constants class AbstractSource(): """ Define a data source for use with the signature functions This can be us...
""" pyexcel.source ~~~~~~~~~~~~~~~~~~~~~~~~ Generic data source definition :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel import constants class AbstractSource(): """ Define a data source for use with the signature functions This can be us...
49,567
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/pyexcel/source.py
61,62
55,69
get_content
MemorySourceMixin
66,69
62,69
class MemorySourceMixin(): """A memory source should an internal memory stream And it is desirable to get its internal stream """ def get_content(self): FILL_FUNC_BODY
class MemorySourceMixin(): """A memory source should an internal memory stream And it is desirable to get its internal stream """ def get_content(self): """Get memory representation of the formatted data e.g. StringIO instance which contains the csv formatted data """ FILL_FUN...
return self._content
"""Get memory representation of the formatted data e.g. StringIO instance which contains the csv formatted data """ return self._content
2
83
11
94
""" pyexcel.source ~~~~~~~~~~~~~~~~~~~~~~~~ Generic data source definition :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel import constants class AbstractSource(): """ Define a data source for use with the signature functions This can be us...
""" pyexcel.source ~~~~~~~~~~~~~~~~~~~~~~~~ Generic data source definition :copyright: (c) 2015-2022 by Onni Software Ltd. :license: New BSD License """ from pyexcel import constants class AbstractSource(): """ Define a data source for use with the signature functions This can be us...
49,568
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/setup.py
141,142
1,196
read
143,151
142,151
#!/usr/bin/env python3 """ Template by pypi-mobans """ import os import sys from shutil import rmtree from setuptools import Command, setup, find_packages NAME = "pyexcel" AUTHOR = "C.W." VERSION = "0.7.0" EMAIL = "info@pyexcel.org" LICENSE = "New BSD" DESCRIPTION = ( "A wrapper library that provides one API to...
#!/usr/bin/env python3 """ Template by pypi-mobans """ import os import sys from shutil import rmtree from setuptools import Command, setup, find_packages NAME = "pyexcel" AUTHOR = "C.W." VERSION = "0.7.0" EMAIL = "info@pyexcel.org" LICENSE = "New BSD" DESCRIPTION = ( "A wrapper library that provides one API to...
filename_absolute = os.path.join(HERE, filename) with open(filename_absolute, encoding='utf-8') as opened_file: content = filter_out_test_code(opened_file) content = "".join(list(content)) return content
"""Read a file into setup""" filename_absolute = os.path.join(HERE, filename) with open(filename_absolute, encoding='utf-8') as opened_file: content = filter_out_test_code(opened_file) content = "".join(list(content)) return content
17
1,608
83
1,691
#!/usr/bin/env python3 """ Template by pypi-mobans """ import os import sys from shutil import rmtree from setuptools import Command, setup, find_packages NAME = "pyexcel" AUTHOR = "C.W." VERSION = "0.7.0" EMAIL = "info@pyexcel.org" LICENSE = "New BSD" DESCRIPTION = ( "A wrapper library that provides one API to...
#!/usr/bin/env python3 """ Template by pypi-mobans """ import os import sys from shutil import rmtree from setuptools import Command, setup, find_packages NAME = "pyexcel" AUTHOR = "C.W." VERSION = "0.7.0" EMAIL = "info@pyexcel.org" LICENSE = "New BSD" DESCRIPTION = ( "A wrapper library that provides one API to...
49,569
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel
/home/hieuvd/dung_repo/raw/stars_03/pyexcel_pyexcel/pyexcel/setup.py
97,98
80,119
run
PublishCommand
98,119
98,119
class PublishCommand(Command): """Support setup.py upload.""" description = "Build and publish the package on github and pypi" user_options = [] @staticmethod def status(s): """Prints things in bold.""" print("\033[1m{0}\033[0m".format(s)) def initialize_options(self): ...
class PublishCommand(Command): """Support setup.py upload.""" description = "Build and publish the package on github and pypi" user_options = [] @staticmethod def status(s): """Prints things in bold.""" print("\033[1m{0}\033[0m".format(s)) def initialize_options(self): ...
try: self.status("Removing previous builds...") rmtree(os.path.join(HERE, "dist")) rmtree(os.path.join(HERE, "build")) rmtree(os.path.join(HERE, "pyexcel.egg-info")) except OSError: pass self.status("Building Source and Wheel (universa...
try: self.status("Removing previous builds...") rmtree(os.path.join(HERE, "dist")) rmtree(os.path.join(HERE, "build")) rmtree(os.path.join(HERE, "pyexcel.egg-info")) except OSError: pass self.status("Building Source and Wheel (universa...
39
134
224
358
#!/usr/bin/env python3 """ Template by pypi-mobans """ import os import sys from shutil import rmtree from setuptools import Command, setup, find_packages NAME = "pyexcel" AUTHOR = "C.W." VERSION = "0.7.0" EMAIL = "info@pyexcel.org" LICENSE = "New BSD" DESCRIPTION = ( "A wrapper library that provides one API to...
#!/usr/bin/env python3 """ Template by pypi-mobans """ import os import sys from shutil import rmtree from setuptools import Command, setup, find_packages NAME = "pyexcel" AUTHOR = "C.W." VERSION = "0.7.0" EMAIL = "info@pyexcel.org" LICENSE = "New BSD" DESCRIPTION = ( "A wrapper library that provides one API to...
49,570
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt/examples/xlwt_easyxf_simple_demo.py
10,11
1,47
write_xls
11,25
11,25
# Write an XLS file with a single worksheet, containing # a heading row and some rows of data. import datetime import xlwt ezxf = xlwt.easyxf def write_xls(file_name, sheet_name, headings, data, heading_xf, data_xfs): FILL_FUNC_BODYif __name__ == '__main__': mkd = datetime.date hdngs = ['Date', 'Stock Code'...
# Write an XLS file with a single worksheet, containing # a heading row and some rows of data. import datetime import xlwt ezxf = xlwt.easyxf def write_xls(file_name, sheet_name, headings, data, heading_xf, data_xfs): FILL_FUNC_BODYif __name__ == '__main__': mkd = datetime.date hdngs = ['Date', 'Stock Code'...
book = xlwt.Workbook() sheet = book.add_sheet(sheet_name) rowx = 0 for colx, value in enumerate(headings): sheet.write(rowx, colx, value, heading_xf) sheet.set_panes_frozen(True) # frozen headings instead of split panes sheet.set_horz_split_pos(rowx+1) # in general, freeze after last hea...
book = xlwt.Workbook() sheet = book.add_sheet(sheet_name) rowx = 0 for colx, value in enumerate(headings): sheet.write(rowx, colx, value, heading_xf) sheet.set_panes_frozen(True) # frozen headings instead of split panes sheet.set_horz_split_pos(rowx+1) # in general, freeze after last hea...
63
553
215
768
# Write an XLS file with a single worksheet, containing # a heading row and some rows of data. import datetime import xlwt ezxf = xlwt.easyxf def write_xls(file_name, sheet_name, headings, data, heading_xf, data_xfs): FILL_FUNC_BODYif __name__ == '__main__': mkd = datetime.date hdngs = ['Date', 'Stock Code'...
# Write an XLS file with a single worksheet, containing # a heading row and some rows of data. import datetime import xlwt ezxf = xlwt.easyxf def write_xls(file_name, sheet_name, headings, data, heading_xf, data_xfs): FILL_FUNC_BODYif __name__ == '__main__': mkd = datetime.date hdngs = ['Date', 'Stock Code'...
49,572
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt/xlwt/Bitmap.py
259,260
246,266
_write_imdata
ImRawDataBmpRecord
260,266
260,266
class ImRawDataBmpRecord(BiffRecord): _REC_ID = 0x007F def __init__(self, data): """Insert a 24bit bitmap image in a worksheet. The main record required is IMDATA but it must be proceeded by a OBJ record to define its position. """ BiffRecord.__init__(self) self.width,...
class ImRawDataBmpRecord(BiffRecord): _REC_ID = 0x007F def __init__(self, data): """Insert a 24bit bitmap image in a worksheet. The main record required is IMDATA but it must be proceeded by a OBJ record to define its position. """ BiffRecord.__init__(self) self.width,...
# Write the IMDATA record to store the bitmap data cf = 0x09 env = 0x01 lcb = self.size self._rec_data = pack("<HHL", cf, env, lcb) + data
# Write the IMDATA record to store the bitmap data cf = 0x09 env = 0x01 lcb = self.size self._rec_data = pack("<HHL", cf, env, lcb) + data
27
157
69
226
# -*- coding: utf-8 -*- # Portions are Copyright (C) 2005 Roman V. Kiseliov # Portions are Copyright (c) 2004 Evgeny Filatov <fufff@users.sourceforge.net> # Portions are Copyright (c) 2002-2004 John McNamara (Perl Spreadsheet::WriteExcel) from struct import pack, unpack from .BIFFRecords import BiffRecord def _...
# -*- coding: utf-8 -*- # Portions are Copyright (C) 2005 Roman V. Kiseliov # Portions are Copyright (c) 2004 Evgeny Filatov <fufff@users.sourceforge.net> # Portions are Copyright (c) 2002-2004 John McNamara (Perl Spreadsheet::WriteExcel) from struct import pack, unpack from .BIFFRecords import BiffRecord def _...
49,574
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt/xlwt/Cell.py
29,30
21,33
get_biff_data
BlankCell
30,33
30,33
class BlankCell(object): __slots__ = ["rowx", "colx", "xf_idx"] def __init__(self, rowx, colx, xf_idx): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx def get_biff_data(self): FILL_FUNC_BODY
class BlankCell(object): __slots__ = ["rowx", "colx", "xf_idx"] def __init__(self, rowx, colx, xf_idx): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx def get_biff_data(self): FILL_FUNC_BODY
# return BIFFRecords.BlankRecord(self.rowx, self.colx, self.xf_idx).get() return pack('<5H', 0x0201, 6, self.rowx, self.colx, self.xf_idx)
# return BIFFRecords.BlankRecord(self.rowx, self.colx, self.xf_idx).get() return pack('<5H', 0x0201, 6, self.rowx, self.colx, self.xf_idx)
12
101
72
173
# -*- coding: utf-8 -*- from struct import pack, unpack from . import BIFFRecords class StrCell(object): __slots__ = ["rowx", "colx", "xf_idx", "sst_idx"] def __init__(self, rowx, colx, xf_idx, sst_idx): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.sst_idx = s...
# -*- coding: utf-8 -*- from struct import pack, unpack from . import BIFFRecords class StrCell(object): __slots__ = ["rowx", "colx", "xf_idx", "sst_idx"] def __init__(self, rowx, colx, xf_idx, sst_idx): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.sst_idx = s...
49,575
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt/xlwt/Cell.py
120,121
111,124
get_biff_data
BooleanCell
121,124
121,124
class BooleanCell(object): __slots__ = ["rowx", "colx", "xf_idx", "number"] def __init__(self, rowx, colx, xf_idx, number): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.number = number def get_biff_data(self): FILL_FUNC_BODY
class BooleanCell(object): __slots__ = ["rowx", "colx", "xf_idx", "number"] def __init__(self, rowx, colx, xf_idx, number): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.number = number def get_biff_data(self): FILL_FUNC_BODY
return BIFFRecords.BoolErrRecord(self.rowx, self.colx, self.xf_idx, self.number, 0).get()
return BIFFRecords.BoolErrRecord(self.rowx, self.colx, self.xf_idx, self.number, 0).get()
6
112
44
156
# -*- coding: utf-8 -*- from struct import pack, unpack from . import BIFFRecords class StrCell(object): __slots__ = ["rowx", "colx", "xf_idx", "sst_idx"] def __init__(self, rowx, colx, xf_idx, sst_idx): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.sst_idx = s...
# -*- coding: utf-8 -*- from struct import pack, unpack from . import BIFFRecords class StrCell(object): __slots__ = ["rowx", "colx", "xf_idx", "sst_idx"] def __init__(self, rowx, colx, xf_idx, sst_idx): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.sst_idx = s...
49,576
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt/xlwt/Cell.py
153,154
141,157
get_biff_data
ErrorCell
154,157
154,157
class ErrorCell(object): __slots__ = ["rowx", "colx", "xf_idx", "number"] def __init__(self, rowx, colx, xf_idx, error_string_or_code): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx try: self.number = error_code_map[error_string_or_code] except KeyEr...
class ErrorCell(object): __slots__ = ["rowx", "colx", "xf_idx", "number"] def __init__(self, rowx, colx, xf_idx, error_string_or_code): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx try: self.number = error_code_map[error_string_or_code] except KeyEr...
return BIFFRecords.BoolErrRecord(self.rowx, self.colx, self.xf_idx, self.number, 1).get()
return BIFFRecords.BoolErrRecord(self.rowx, self.colx, self.xf_idx, self.number, 1).get()
6
163
44
207
# -*- coding: utf-8 -*- from struct import pack, unpack from . import BIFFRecords class StrCell(object): __slots__ = ["rowx", "colx", "xf_idx", "sst_idx"] def __init__(self, rowx, colx, xf_idx, sst_idx): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.sst_idx = s...
# -*- coding: utf-8 -*- from struct import pack, unpack from . import BIFFRecords class StrCell(object): __slots__ = ["rowx", "colx", "xf_idx", "sst_idx"] def __init__(self, rowx, colx, xf_idx, sst_idx): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.sst_idx = s...
49,577
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt/xlwt/Cell.py
167,168
157,173
get_biff_data
FormulaCell
168,173
168,173
class FormulaCell(object): __slots__ = ["rowx", "colx", "xf_idx", "frmla", "calc_flags"] def __init__(self, rowx, colx, xf_idx, frmla, calc_flags=0): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.frmla = frmla self.calc_flags = calc_flags def get_biff_...
class FormulaCell(object): __slots__ = ["rowx", "colx", "xf_idx", "frmla", "calc_flags"] def __init__(self, rowx, colx, xf_idx, frmla, calc_flags=0): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.frmla = frmla self.calc_flags = calc_flags def get_biff_...
return BIFFRecords.FormulaRecord(self.rowx, self.colx, self.xf_idx, self.frmla.rpn(), self.calc_flags).get() # module-level function for *internal* use by the Row module
return BIFFRecords.FormulaRecord(self.rowx, self.colx, self.xf_idx, self.frmla.rpn(), self.calc_flags).get() # module-level function for *internal* use by the Row module
16
145
71
216
# -*- coding: utf-8 -*- from struct import pack, unpack from . import BIFFRecords class StrCell(object): __slots__ = ["rowx", "colx", "xf_idx", "sst_idx"] def __init__(self, rowx, colx, xf_idx, sst_idx): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.sst_idx = s...
# -*- coding: utf-8 -*- from struct import pack, unpack from . import BIFFRecords class StrCell(object): __slots__ = ["rowx", "colx", "xf_idx", "sst_idx"] def __init__(self, rowx, colx, xf_idx, sst_idx): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.sst_idx = s...
49,578
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt/xlwt/Cell.py
42,43
33,46
get_biff_data
MulBlankCell
43,46
43,46
class MulBlankCell(object): __slots__ = ["rowx", "colx1", "colx2", "xf_idx"] def __init__(self, rowx, colx1, colx2, xf_idx): self.rowx = rowx self.colx1 = colx1 self.colx2 = colx2 self.xf_idx = xf_idx def get_biff_data(self): FILL_FUNC_BODY
class MulBlankCell(object): __slots__ = ["rowx", "colx1", "colx2", "xf_idx"] def __init__(self, rowx, colx1, colx2, xf_idx): self.rowx = rowx self.colx1 = colx1 self.colx2 = colx2 self.xf_idx = xf_idx def get_biff_data(self): FILL_FUNC_BODY
return BIFFRecords.MulBlankRecord(self.rowx, self.colx1, self.colx2, self.xf_idx).get()
return BIFFRecords.MulBlankRecord(self.rowx, self.colx1, self.colx2, self.xf_idx).get()
5
127
46
173
# -*- coding: utf-8 -*- from struct import pack, unpack from . import BIFFRecords class StrCell(object): __slots__ = ["rowx", "colx", "xf_idx", "sst_idx"] def __init__(self, rowx, colx, xf_idx, sst_idx): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.sst_idx = s...
# -*- coding: utf-8 -*- from struct import pack, unpack from . import BIFFRecords class StrCell(object): __slots__ = ["rowx", "colx", "xf_idx", "sst_idx"] def __init__(self, rowx, colx, xf_idx, sst_idx): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.sst_idx = s...
49,579
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt/xlwt/Cell.py
55,56
46,111
get_encoded_data
NumberCell
56,105
56,105
class NumberCell(object): __slots__ = ["rowx", "colx", "xf_idx", "number"] def __init__(self, rowx, colx, xf_idx, number): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.number = float(number) def get_encoded_data(self): FILL_FUNC_BODY def get_biff_data(self...
class NumberCell(object): __slots__ = ["rowx", "colx", "xf_idx", "number"] def __init__(self, rowx, colx, xf_idx, number): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.number = float(number) def get_encoded_data(self): FILL_FUNC_BODY def get_biff_data(self...
rk_encoded = 0 num = self.number # The four possible kinds of RK encoding are *not* mutually exclusive. # The 30-bit integer variety picks up the most. # In the code below, the four varieties are checked in descending order # of bangs per buck, or not at all. # S...
rk_encoded = 0 num = self.number # The four possible kinds of RK encoding are *not* mutually exclusive. # The 30-bit integer variety picks up the most. # In the code below, the four varieties are checked in descending order # of bangs per buck, or not at all. # S...
257
201
721
922
# -*- coding: utf-8 -*- from struct import pack, unpack from . import BIFFRecords class StrCell(object): __slots__ = ["rowx", "colx", "xf_idx", "sst_idx"] def __init__(self, rowx, colx, xf_idx, sst_idx): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.sst_idx = s...
# -*- coding: utf-8 -*- from struct import pack, unpack from . import BIFFRecords class StrCell(object): __slots__ = ["rowx", "colx", "xf_idx", "sst_idx"] def __init__(self, rowx, colx, xf_idx, sst_idx): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.sst_idx = s...
49,580
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt/xlwt/Cell.py
17,18
8,21
get_biff_data
StrCell
18,21
18,21
class StrCell(object): __slots__ = ["rowx", "colx", "xf_idx", "sst_idx"] def __init__(self, rowx, colx, xf_idx, sst_idx): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.sst_idx = sst_idx def get_biff_data(self): FILL_FUNC_BODY
class StrCell(object): __slots__ = ["rowx", "colx", "xf_idx", "sst_idx"] def __init__(self, rowx, colx, xf_idx, sst_idx): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.sst_idx = sst_idx def get_biff_data(self): FILL_FUNC_BODY
# return BIFFRecords.LabelSSTRecord(self.rowx, self.colx, self.xf_idx, self.sst_idx).get() return pack('<5HL', 0x00FD, 10, self.rowx, self.colx, self.xf_idx, self.sst_idx)
# return BIFFRecords.LabelSSTRecord(self.rowx, self.colx, self.xf_idx, self.sst_idx).get() return pack('<5HL', 0x00FD, 10, self.rowx, self.colx, self.xf_idx, self.sst_idx)
14
124
87
211
# -*- coding: utf-8 -*- from struct import pack, unpack from . import BIFFRecords class StrCell(object): __slots__ = ["rowx", "colx", "xf_idx", "sst_idx"] def __init__(self, rowx, colx, xf_idx, sst_idx): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.sst_idx = s...
# -*- coding: utf-8 -*- from struct import pack, unpack from . import BIFFRecords class StrCell(object): __slots__ = ["rowx", "colx", "xf_idx", "sst_idx"] def __init__(self, rowx, colx, xf_idx, sst_idx): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.sst_idx = s...
49,581
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt/xlwt/Column.py
40,41
6,48
get_biff_record
Column
41,48
41,48
class Column(object): def __init__(self, colx, parent_sheet): if not(isinstance(colx, int) and 0 <= colx <= 255): raise ValueError("column index (%r) not an int in range(256)" % colx) self._index = colx self._parent = parent_sheet self._parent_wb = parent_sheet.get_parent...
class Column(object): def __init__(self, colx, parent_sheet): if not(isinstance(colx, int) and 0 <= colx <= 255): raise ValueError("column index (%r) not an int in range(256)" % colx) self._index = colx self._parent = parent_sheet self._parent_wb = parent_sheet.get_parent...
options = (self.hidden & 0x01) << 0 options |= (self.user_set & 0x01) << 1 options |= (self.best_fit & 0x01) << 2 options |= (self.level & 0x07) << 8 options |= (self.collapse & 0x01) << 12 return ColInfoRecord(self._index, self._index, self.width, self._xf_index, optio...
options = (self.hidden & 0x01) << 0 options |= (self.user_set & 0x01) << 1 options |= (self.best_fit & 0x01) << 2 options |= (self.level & 0x07) << 8 options |= (self.collapse & 0x01) << 12 return ColInfoRecord(self._index, self._index, self.width, self._xf_index, optio...
42
385
132
517
# -*- coding: utf-8 -*- from .BIFFRecords import ColInfoRecord class Column(object): def __init__(self, colx, parent_sheet): if not(isinstance(colx, int) and 0 <= colx <= 255): raise ValueError("column index (%r) not an int in range(256)" % colx) self._index = colx self._paren...
# -*- coding: utf-8 -*- from .BIFFRecords import ColInfoRecord class Column(object): def __init__(self, colx, parent_sheet): if not(isinstance(colx, int) and 0 <= colx <= 255): raise ValueError("column index (%r) not an int in range(256)" % colx) self._index = colx self._paren...
49,582
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt/xlwt/ExcelFormula.py
35,36
9,44
rpn
Formula
43,44
36,44
class Formula(object): __slots__ = ["__s", "__parser", "__sheet_refs", "__xcall_refs"] def __init__(self, s): try: self.__s = s lexer = ExcelFormulaLexer.Lexer(s) self.__parser = ExcelFormulaParser.Parser(lexer) self.__parser.formula() self._...
class Formula(object): __slots__ = ["__s", "__parser", "__sheet_refs", "__xcall_refs"] def __init__(self, s): try: self.__s = s lexer = ExcelFormulaLexer.Lexer(s) self.__parser = ExcelFormulaParser.Parser(lexer) self.__parser.formula() self._...
return struct.pack("<H", len(self.__parser.rpn)) + self.__parser.rpn
''' Offset Size Contents 0 2 Size of the following formula data (sz) 2 sz Formula data (RPN token array) [2+sz] var. (optional) Additional data for specific tokens ''' return struct.pack("<H", len(self.__parser.rpn)) + self....
5
369
27
396
# -*- coding: utf-8 -*- import struct from . import ExcelFormulaLexer, ExcelFormulaParser from .antlr import ANTLRException class Formula(object): __slots__ = ["__s", "__parser", "__sheet_refs", "__xcall_refs"] def __init__(self, s): try: self.__s = s lexer = ExcelFormulaLe...
# -*- coding: utf-8 -*- import struct from . import ExcelFormulaLexer, ExcelFormulaParser from .antlr import ANTLRException class Formula(object): __slots__ = ["__s", "__parser", "__sheet_refs", "__xcall_refs"] def __init__(self, s): try: self.__s = s lexer = ExcelFormulaLe...
49,583
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt/xlwt/ExcelFormulaLexer.py
102,103
77,122
nextToken
Lexer
103,122
103,122
class Lexer(TokenStream): def __init__(self, text): self._text = text[:] self._pos = 0 self._line = 0 def isEOF(self): return len(self._text) <= self._pos def curr_ch(self): return self._text[self._pos] def next_ch(self, n = 1): self._pos += n def ...
class Lexer(TokenStream): def __init__(self, text): self._text = text[:] self._pos = 0 self._line = 0 def isEOF(self): return len(self._text) <= self._pos def curr_ch(self): return self._text[self._pos] def next_ch(self, n = 1): self._pos += n def ...
# skip whitespace while not self.isEOF() and self.is_whitespace(): self.next_ch() if self.isEOF(): return Tok(type = EOF) # first, try to match token with 2 or more chars t = self.match_pattern() if t: return t # second, we want...
# skip whitespace while not self.isEOF() and self.is_whitespace(): self.next_ch() if self.isEOF(): return Tok(type = EOF) # first, try to match token with 2 or more chars t = self.match_pattern() if t: return t # second, we want...
64
245
215
460
# -*- coding: utf-8 -*- from __future__ import print_function from re import IGNORECASE, VERBOSE, compile as recompile from . import ExcelFormulaParser from .antlr import EOF, CommonToken as Tok, TokenStream, TokenStreamException int_const_pattern = r"\d+\b" flt_const_pattern = r""" (?: (?: \d* \. \d+ ) ...
# -*- coding: utf-8 -*- from __future__ import print_function from re import IGNORECASE, VERBOSE, compile as recompile from . import ExcelFormulaParser from .antlr import EOF, CommonToken as Tok, TokenStream, TokenStreamException int_const_pattern = r"\d+\b" flt_const_pattern = r""" (?: (?: \d* \. \d+ ) ...
49,586
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt/xlwt/Formatting.py
188,189
143,194
_search_key
Alignment
189,194
189,194
class Alignment(object): HORZ_GENERAL = 0x00 HORZ_LEFT = 0x01 HORZ_CENTER = 0x02 HORZ_RIGHT = 0x03 HORZ_FILLED = 0x04 HORZ_JUSTIFIED = 0x05 # BIFF4-BIFF8X HORZ_CENTER_ACROSS_SEL = 0x06 # Centr...
class Alignment(object): HORZ_GENERAL = 0x00 HORZ_LEFT = 0x01 HORZ_CENTER = 0x02 HORZ_RIGHT = 0x03 HORZ_FILLED = 0x04 HORZ_JUSTIFIED = 0x05 # BIFF4-BIFF8X HORZ_CENTER_ACROSS_SEL = 0x06 # Centr...
return ( self.horz, self.vert, self.dire, self.orie, self.rota, self.wrap, self.shri, self.inde, self.merg, )
return ( self.horz, self.vert, self.dire, self.orie, self.rota, self.wrap, self.shri, self.inde, self.merg, )
12
641
60
701
''' Formatting ========== The XF record is able to store explicit cell formatting attributes or the attributes of a cell style. Explicit formatting includes the reference to a cell style XF record. This allows to extend a defined cell style with some explicit attributes. The formatting attributes are di...
''' Formatting ========== The XF record is able to store explicit cell formatting attributes or the attributes of a cell style. Explicit formatting includes the reference to a cell style XF record. This allows to extend a defined cell style with some explicit attributes. The formatting attributes are di...
49,587
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt/xlwt/Formatting.py
232,233
194,240
_search_key
Borders
233,240
233,240
class Borders(object): NO_LINE = 0x00 THIN = 0x01 MEDIUM = 0x02 DASHED = 0x03 DOTTED = 0x04 THICK = 0x05 DOUBLE = 0x06 HAIR = 0x07 #The following for BIFF8 MEDIUM_DASHED = 0x08 THIN_DASH_DOTTED = 0x09 MEDIUM_DASH_DOTTED = 0x0A...
class Borders(object): NO_LINE = 0x00 THIN = 0x01 MEDIUM = 0x02 DASHED = 0x03 DOTTED = 0x04 THICK = 0x05 DOUBLE = 0x06 HAIR = 0x07 #The following for BIFF8 MEDIUM_DASHED = 0x08 THIN_DASH_DOTTED = 0x09 MEDIUM_DASH_DOTTED = 0x0A...
return ( self.left, self.right, self.top, self.bottom, self.diag, self.left_colour, self.right_colour, self.top_colour, self.bottom_colour, self.diag_colour, self.need_diag1, self.need_diag2, )
return ( self.left, self.right, self.top, self.bottom, self.diag, self.left_colour, self.right_colour, self.top_colour, self.bottom_colour, self.diag_colour, self.need_diag1, self.need_diag2, )
15
479
96
575
''' Formatting ========== The XF record is able to store explicit cell formatting attributes or the attributes of a cell style. Explicit formatting includes the reference to a cell style XF record. This allows to extend a defined cell style with some explicit attributes. The formatting attributes are di...
''' Formatting ========== The XF record is able to store explicit cell formatting attributes or the attributes of a cell style. Explicit formatting includes the reference to a cell style XF record. This allows to extend a defined cell style with some explicit attributes. The formatting attributes are di...
49,588
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt/xlwt/Formatting.py
96,97
38,143
get_biff_record
Font
97,126
97,126
class Font(object): ESCAPEMENT_NONE = 0x00 ESCAPEMENT_SUPERSCRIPT = 0x01 ESCAPEMENT_SUBSCRIPT = 0x02 UNDERLINE_NONE = 0x00 UNDERLINE_SINGLE = 0x01 UNDERLINE_SINGLE_ACC = 0x21 UNDERLINE_DOUBLE = 0x02 UNDERLINE_DOUBLE_ACC = 0x22 FAMILY_NONE ...
class Font(object): ESCAPEMENT_NONE = 0x00 ESCAPEMENT_SUPERSCRIPT = 0x01 ESCAPEMENT_SUBSCRIPT = 0x02 UNDERLINE_NONE = 0x00 UNDERLINE_SINGLE = 0x01 UNDERLINE_SINGLE_ACC = 0x21 UNDERLINE_DOUBLE = 0x02 UNDERLINE_DOUBLE_ACC = 0x22 FAMILY_NONE ...
height = self.height options = 0x00 if self.bold: options |= 0x01 self._weight = 0x02BC if self.italic: options |= 0x02 if self.underline != self.UNDERLINE_NONE: options |= 0x04 if self.struck_out: options |= 0x...
height = self.height options = 0x00 if self.bold: options |= 0x01 self._weight = 0x02BC if self.italic: options |= 0x02 if self.underline != self.UNDERLINE_NONE: options |= 0x04 if self.struck_out: options |= 0x...
72
947
271
1,218
''' Formatting ========== The XF record is able to store explicit cell formatting attributes or the attributes of a cell style. Explicit formatting includes the reference to a cell style XF record. This allows to extend a defined cell style with some explicit attributes. The formatting attributes are di...
''' Formatting ========== The XF record is able to store explicit cell formatting attributes or the attributes of a cell style. Explicit formatting includes the reference to a cell style XF record. This allows to extend a defined cell style with some explicit attributes. The formatting attributes are di...
49,589
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt/xlwt/Formatting.py
250,251
240,257
_search_key
Pattern
251,257
251,257
class Pattern(object): # patterns 0x00 - 0x12 NO_PATTERN = 0x00 SOLID_PATTERN = 0x01 def __init__(self): self.pattern = self.NO_PATTERN self.pattern_fore_colour = 0x40 self.pattern_back_colour = 0x41 def _search_key(self): FILL_FUNC_BODY
class Pattern(object): # patterns 0x00 - 0x12 NO_PATTERN = 0x00 SOLID_PATTERN = 0x01 def __init__(self): self.pattern = self.NO_PATTERN self.pattern_fore_colour = 0x40 self.pattern_back_colour = 0x41 def _search_key(self): FILL_FUNC_BODY
return ( self.pattern, self.pattern_fore_colour, self.pattern_back_colour, )
return ( self.pattern, self.pattern_fore_colour, self.pattern_back_colour, )
6
123
42
165
''' Formatting ========== The XF record is able to store explicit cell formatting attributes or the attributes of a cell style. Explicit formatting includes the reference to a cell style XF record. This allows to extend a defined cell style with some explicit attributes. The formatting attributes are di...
''' Formatting ========== The XF record is able to store explicit cell formatting attributes or the attributes of a cell style. Explicit formatting includes the reference to a cell style XF record. This allows to extend a defined cell style with some explicit attributes. The formatting attributes are di...
49,590
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt/xlwt/Formatting.py
262,263
257,267
_search_key
Protection
263,267
263,267
class Protection(object): def __init__(self): self.cell_locked = 1 self.formula_hidden = 0 def _search_key(self): FILL_FUNC_BODY
class Protection(object): def __init__(self): self.cell_locked = 1 self.formula_hidden = 0 def _search_key(self): FILL_FUNC_BODY
return ( self.cell_locked, self.formula_hidden, )
return ( self.cell_locked, self.formula_hidden, )
5
55
29
84
''' Formatting ========== The XF record is able to store explicit cell formatting attributes or the attributes of a cell style. Explicit formatting includes the reference to a cell style XF record. This allows to extend a defined cell style with some explicit attributes. The formatting attributes are di...
''' Formatting ========== The XF record is able to store explicit cell formatting attributes or the attributes of a cell style. Explicit formatting includes the reference to a cell style XF record. This allows to extend a defined cell style with some explicit attributes. The formatting attributes are di...
49,594
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt/xlwt/UnicodeUtils.py
77,78
1,127
upack2rt
78,109
78,109
# -*- coding: utf-8 -*- ''' From BIFF8 on, strings are always stored using UTF-16LE text encoding. The character array is a sequence of 16-bit values4. Additionally it is possible to use a compressed format, which omits the high bytes of all characters, if they are all zero. The following tables describ...
# -*- coding: utf-8 -*- ''' From BIFF8 on, strings are always stored using UTF-16LE text encoding. The character array is a sequence of 16-bit values4. Additionally it is possible to use a compressed format, which omits the high bytes of all characters, if they are all zero. The following tables describ...
us = '' fr = b'' offset = 0 # convert rt strings to unicode if not already unicode # also generate the formatting run for the styles added for s, fontx in rt: if not isinstance(s, six.text_type): s = s.decode(encoding) us += s if fontx is not None: ...
us = '' fr = b'' offset = 0 # convert rt strings to unicode if not already unicode # also generate the formatting run for the styles added for s, fontx in rt: if not isinstance(s, six.text_type): s = s.decode(encoding) us += s if fontx is not None: ...
177
1,165
410
1,575
# -*- coding: utf-8 -*- ''' From BIFF8 on, strings are always stored using UTF-16LE text encoding. The character array is a sequence of 16-bit values4. Additionally it is possible to use a compressed format, which omits the high bytes of all characters, if they are all zero. The following tables describ...
# -*- coding: utf-8 -*- ''' From BIFF8 on, strings are always stored using UTF-16LE text encoding. The character array is a sequence of 16-bit values4. Additionally it is possible to use a compressed format, which omits the high bytes of all characters, if they are all zero. The following tables describ...
49,595
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt
/home/hieuvd/dung_repo/raw/stars_03/python-excel_xlwt/xlwt/xlwt/Utils.py
164,165
1,169
quote_sheet_name
165,169
165,169
# see the xlwt.license module for details of licensing. # Utilities for work with reference to cells and with sheetnames from __future__ import unicode_literals import re from .ExcelMagic import MAX_COL, MAX_ROW _re_cell_ex = re.compile(r"(\$?)([A-I]?[A-Z])(\$?)(\d+)", re.IGNORECASE) _re_row_range = re.compile(r"\$...
# see the xlwt.license module for details of licensing. # Utilities for work with reference to cells and with sheetnames from __future__ import unicode_literals import re from .ExcelMagic import MAX_COL, MAX_ROW _re_cell_ex = re.compile(r"(\$?)([A-I]?[A-Z])(\$?)(\d+)", re.IGNORECASE) _re_row_range = re.compile(r"\$...
if not valid_sheet_name(unquoted_sheet_name): raise Exception( 'attempt to quote an invalid worksheet name %r' % unquoted_sheet_name) return "'" + unquoted_sheet_name.replace("'", "''") + "'"
if not valid_sheet_name(unquoted_sheet_name): raise Exception( 'attempt to quote an invalid worksheet name %r' % unquoted_sheet_name) return "'" + unquoted_sheet_name.replace("'", "''") + "'"
22
1,924
75
1,999
# see the xlwt.license module for details of licensing. # Utilities for work with reference to cells and with sheetnames from __future__ import unicode_literals import re from .ExcelMagic import MAX_COL, MAX_ROW _re_cell_ex = re.compile(r"(\$?)([A-I]?[A-Z])(\$?)(\d+)", re.IGNORECASE) _re_row_range = re.compile(r"\$...
# see the xlwt.license module for details of licensing. # Utilities for work with reference to cells and with sheetnames from __future__ import unicode_literals import re from .ExcelMagic import MAX_COL, MAX_ROW _re_cell_ex = re.compile(r"(\$?)([A-I]?[A-Z])(\$?)(\d+)", re.IGNORECASE) _re_row_range = re.compile(r"\$...
49,648
/home/hieuvd/dung_repo/raw/stars_03/qinxuye_cola/cola
/home/hieuvd/dung_repo/raw/stars_03/qinxuye_cola/cola/app/weibo/bundle.py
41,42
27,50
urls
WeiboUserBundle
42,50
42,50
class WeiboUserBundle(Bundle): def __init__(self, uid): super(WeiboUserBundle, self).__init__(uid) self.uid = uid self.exists = True self.last_error_page = None self.last_error_page_times = 0 self.weibo_user = None self.last_update = None ...
class WeiboUserBundle(Bundle): def __init__(self, uid): super(WeiboUserBundle, self).__init__(uid) self.uid = uid self.exists = True self.last_error_page = None self.last_error_page_times = 0 self.weibo_user = None self.last_update = None ...
start = int(time.time() * (10**6)) return [ 'http://weibo.com/%s/follow' % self.uid, 'http://weibo.com/aj/mblog/mbloglist?uid=%s&_k=%s' % (self.uid, start), 'http://weibo.com/%s/info' % self.uid, # remove because some user's link has been http://weibo.com/...
start = int(time.time() * (10**6)) return [ 'http://weibo.com/%s/follow' % self.uid, 'http://weibo.com/aj/mblog/mbloglist?uid=%s&_k=%s' % (self.uid, start), 'http://weibo.com/%s/info' % self.uid, # remove because some user's link has been http://weibo.com/...
31
142
163
305
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (c) 2013 Qin Xuye <qin@qinxuye.me> 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (c) 2013 Qin Xuye <qin@qinxuye.me> 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...
49,649
/home/hieuvd/dung_repo/raw/stars_03/qinxuye_cola/cola
/home/hieuvd/dung_repo/raw/stars_03/qinxuye_cola/cola/app/weibo/utils.py
123,124
1,135
get_avatar_size_url
124,132
124,132
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (c) 2013 Qin Xuye <qin@qinxuye.me> 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (c) 2013 Qin Xuye <qin@qinxuye.me> 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...
assert size == 50 or size == 180 splits = img_url.split('/') current_size = int(splits[-3]) if current_size == size: return img_url splits[-3] = str(size) return '/'.join(splits)
assert size == 50 or size == 180 splits = img_url.split('/') current_size = int(splits[-3]) if current_size == size: return img_url splits[-3] = str(size) return '/'.join(splits)
25
1,491
85
1,576
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (c) 2013 Qin Xuye <qin@qinxuye.me> 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (c) 2013 Qin Xuye <qin@qinxuye.me> 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...
49,650
/home/hieuvd/dung_repo/raw/stars_03/qinxuye_cola/cola
/home/hieuvd/dung_repo/raw/stars_03/qinxuye_cola/cola/cola/cluster/tracker.py
71,72
53,83
has_worker
JobTracker
72,76
72,76
class JobTracker(object): def __init__(self): self.running_jobs = {} def register_job(self, job_name, job_master): self.running_jobs[job_name] = job_master def get_job_master(self, job_name): return self.running_jobs[job_name] def remove_worker(self, jo...
class JobTracker(object): def __init__(self): self.running_jobs = {} def register_job(self, job_name, job_master): self.running_jobs[job_name] = job_master def get_job_master(self, job_name): return self.running_jobs[job_name] def remove_worker(self, jo...
if job_name in self.running_jobs: self.running_jobs[job_name].has_worker(worker) return False
if job_name in self.running_jobs: self.running_jobs[job_name].has_worker(worker) return False
7
292
43
335
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (c) 2013 Qin Xuye <qin@qinxuye.me> 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (c) 2013 Qin Xuye <qin@qinxuye.me> 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...
49,651
/home/hieuvd/dung_repo/raw/stars_03/qinxuye_cola/cola
/home/hieuvd/dung_repo/raw/stars_03/qinxuye_cola/cola/cola/cluster/tracker.py
34,35
27,38
update
WorkerInfo
35,38
35,38
class WorkerInfo(object): def __init__(self, worker): self.worker = worker self.continous_register = 1 self.last_update = int(time.time()) self.status = RUNNING def update(self): FILL_FUNC_BODY
class WorkerInfo(object): def __init__(self, worker): self.worker = worker self.continous_register = 1 self.last_update = int(time.time()) self.status = RUNNING def update(self): FILL_FUNC_BODY
self.continous_register += 1 self.last_update = int(time.time())
self.continous_register += 1 self.last_update = int(time.time())
6
79
29
108
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (c) 2013 Qin Xuye <qin@qinxuye.me> 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (c) 2013 Qin Xuye <qin@qinxuye.me> 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...
49,652
/home/hieuvd/dung_repo/raw/stars_03/qinxuye_cola/cola
/home/hieuvd/dung_repo/raw/stars_03/qinxuye_cola/cola/cola/cluster/tracker.py
45,46
38,53
register_worker
WorkerTracker
46,53
46,53
class WorkerTracker(object): def __init__(self): self.workers = {} self.black_list = [] self.stopped = threading.Event() def register_worker(self, worker): FILL_FUNC_BODY
class WorkerTracker(object): def __init__(self): self.workers = {} self.black_list = [] self.stopped = threading.Event() def register_worker(self, worker): FILL_FUNC_BODY
if worker not in self.workers: prev_workers = self.workers.keys() self.workers[worker] = WorkerInfo(worker) return prev_workers else: self.workers[worker].update()
if worker not in self.workers: prev_workers = self.workers.keys() self.workers[worker] = WorkerInfo(worker) return prev_workers else: self.workers[worker].update()
15
71
71
142
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (c) 2013 Qin Xuye <qin@qinxuye.me> 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (c) 2013 Qin Xuye <qin@qinxuye.me> 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...
49,653
/home/hieuvd/dung_repo/raw/stars_03/qinxuye_cola/cola
/home/hieuvd/dung_repo/raw/stars_03/qinxuye_cola/cola/cola/commands/master.py
46,47
28,63
run
MasterCommand
47,63
47,63
class MasterCommand(Command): def __init__(self): self.logger = get_logger('cola_master_command') def add_arguments(self, parser): ip = get_ip() self.master_parser = parser.add_parser('master', help='master commands') self.master_parser.add_argument('-w', '--working', m...
class MasterCommand(Command): def __init__(self): self.logger = get_logger('cola_master_command') def add_arguments(self, parser): ip = get_ip() self.master_parser = parser.add_parser('master', help='master commands') self.master_parser.add_argument('-w', '--working', m...
if args.start is not None: ctx = Context(is_master=True, master_addr=args.start, working_dir=args.working) ctx.start_master() self.logger.info('start master at: %s' % ctx.master_addr) elif args.kill is not None: ctx = Context(is_c...
if args.start is not None: ctx = Context(is_master=True, master_addr=args.start, working_dir=args.working) ctx.start_master() self.logger.info('start master at: %s' % ctx.master_addr) elif args.kill is not None: ctx = Context(is_c...
66
337
254
591
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (c) 2013 Qin Xuye <qin@qinxuye.me> 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (c) 2013 Qin Xuye <qin@qinxuye.me> 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...
49,654
/home/hieuvd/dung_repo/raw/stars_03/qinxuye_cola/cola
/home/hieuvd/dung_repo/raw/stars_03/qinxuye_cola/cola/cola/commands/startproject.py
44,45
29,66
run
StartProjectCommand
45,66
45,66
class StartProjectCommand(Command): def __init__(self): self.logger = get_logger('cola_startproject_command') def add_arguments(self, parser): self.start_project_parser = parser.add_parser('startproject', help='startproject command') self.start_project_parser.add_argument('project', met...
class StartProjectCommand(Command): def __init__(self): self.logger = get_logger('cola_startproject_command') def add_arguments(self, parser): self.start_project_parser = parser.add_parser('startproject', help='startproject command') self.start_project_parser.add_argument('project', met...
ctx = Context(is_client=True, local_mode=True) project_name = args.project[0] if ' ' in project_name: self.logger.error('project name cannot contain whitespace') current_dir = os.getcwd() project_dir = os.path.join(current_dir, project_name) ...
ctx = Context(is_client=True, local_mode=True) project_name = args.project[0] if ' ' in project_name: self.logger.error('project name cannot contain whitespace') current_dir = os.getcwd() project_dir = os.path.join(current_dir, project_name) ...
65
205
322
527
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (c) 2013 Qin Xuye <qin@qinxuye.me> 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (c) 2013 Qin Xuye <qin@qinxuye.me> 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...