sentence1 stringlengths 52 3.87M | sentence2 stringlengths 1 47.2k | label stringclasses 1
value |
|---|---|---|
def _validate_rfilter(self, rfilter, letter="d"):
"""Validate that all columns in filter are in header."""
if letter == "d":
pexdoc.exh.addai(
"dfilter",
(
(not self._has_header)
and any([not isinstance(item, int) for it... | Validate that all columns in filter are in header. | entailment |
def data(self, filtered=False, no_empty=False):
r"""
Return (filtered) file data.
The returned object is a list, each item is a sub-list corresponding
to a row of data; each item in the sub-lists contains data
corresponding to a particular column
:param filtered: Fi... | r"""
Return (filtered) file data.
The returned object is a list, each item is a sub-list corresponding
to a row of data; each item in the sub-lists contains data
corresponding to a particular column
:param filtered: Filtering type
:type filtered: :ref:`CsvFiltered`... | entailment |
def dsort(self, order):
r"""
Sort rows.
:param order: Sort order
:type order: :ref:`CsvColFilter`
.. [[[cog cog.out(exobj.get_sphinx_autodoc()) ]]]
.. Auto-generated exceptions documentation for
.. pcsv.csv_file.CsvFile.dsort
:raises:
* Runtim... | r"""
Sort rows.
:param order: Sort order
:type order: :ref:`CsvColFilter`
.. [[[cog cog.out(exobj.get_sphinx_autodoc()) ]]]
.. Auto-generated exceptions documentation for
.. pcsv.csv_file.CsvFile.dsort
:raises:
* RuntimeError (Argument \`order\` is no... | entailment |
def header(self, filtered=False):
r"""
Return data header.
When the raw (input) data is used the data header is a list of the
comma-separated values file header if the file is loaded with header
(each list item is a column header) or a list of column numbers if the
file ... | r"""
Return data header.
When the raw (input) data is used the data header is a list of the
comma-separated values file header if the file is loaded with header
(each list item is a column header) or a list of column numbers if the
file is loaded without header (column zero is t... | entailment |
def replace(self, rdata, filtered=False):
r"""
Replace data.
:param rdata: Replacement data
:type rdata: list of lists
:param filtered: Filtering type
:type filtered: :ref:`CsvFiltered`
.. [[[cog cog.out(exobj.get_sphinx_autodoc(width=63)) ]]]
.. Auto... | r"""
Replace data.
:param rdata: Replacement data
:type rdata: list of lists
:param filtered: Filtering type
:type filtered: :ref:`CsvFiltered`
.. [[[cog cog.out(exobj.get_sphinx_autodoc(width=63)) ]]]
.. Auto-generated exceptions documentation for
..... | entailment |
def write(self, fname=None, filtered=False, header=True, append=False):
r"""
Write (processed) data to a specified comma-separated values (CSV) file.
:param fname: Name of the comma-separated values file to be
written. If None the file from which the data originated
... | r"""
Write (processed) data to a specified comma-separated values (CSV) file.
:param fname: Name of the comma-separated values file to be
written. If None the file from which the data originated
is overwritten
:type fname: FileName_
:param f... | entailment |
def model_creation(dicCnfg, varRat=None, strPathHrf=None):
"""
Create or load pRF model time courses.
Parameters
----------
dicCnfg : dict
Dictionary containing config parameters.
varRat : float, default None
Ratio of size suppressive surround to size of center pRF
strPathHr... | Create or load pRF model time courses.
Parameters
----------
dicCnfg : dict
Dictionary containing config parameters.
varRat : float, default None
Ratio of size suppressive surround to size of center pRF
strPathHrf : str or None:
Path to npy file with custom hrf parameters. I... | entailment |
def registIssue(self, CorpNum, cashbill, Memo, UserID=None):
""" νκΈμμμ¦ μ¦μλ°ν
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
cashbill : λ±λ‘ν νκΈμμμ¦ object. made with Cashbill(...)
UserID : νλΉνμ μμ΄λ
return
μ²λ¦¬κ²°κ³Ό. consist of code and message
... | νκΈμμμ¦ μ¦μλ°ν
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
cashbill : λ±λ‘ν νκΈμμμ¦ object. made with Cashbill(...)
UserID : νλΉνμ μμ΄λ
return
μ²λ¦¬κ²°κ³Ό. consist of code and message
raise
PopbillException | entailment |
def register(self, CorpNum, cashbill, UserID=None):
""" νκΈμμμ¦ λ±λ‘
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
cashbill : λ±λ‘ν νκΈμμμ¦ object. made with Cashbill(...)
UserID : νλΉνμ μμ΄λ
return
μ²λ¦¬κ²°κ³Ό. consist of code and message
r... | νκΈμμμ¦ λ±λ‘
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
cashbill : λ±λ‘ν νκΈμμμ¦ object. made with Cashbill(...)
UserID : νλΉνμ μμ΄λ
return
μ²λ¦¬κ²°κ³Ό. consist of code and message
raise
PopbillException | entailment |
def revokeRegistIssue(self, CorpNum, mgtKey, orgConfirmNum, orgTradeDate, smssendYN=False, memo=None, UserID=None,
isPartCancel=False, cancelType=None, supplyCost=None, tax=None, serviceFee=None,
totalAmount=None):
""" μ·¨μνκΈμμμ¦ μ¦μλ°ν
args
... | μ·¨μνκΈμμμ¦ μ¦μλ°ν
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
mgtKey : νκΈμμμ¦ λ¬Έμκ΄λ¦¬λ²νΈ
orgConfirmNum : μλ³ΈνκΈμμμ¦ μΉμΈλ²νΈ
orgTradeDate : μλ³ΈνκΈμμμ¦ κ±°λμΌμ
smssendYN : λ°νμλ΄λ¬Έμ μ μ‘μ¬λΆ
memo : λ©λͺ¨
UserID : νλΉνμ μμ΄λ
i... | entailment |
def update(self, CorpNum, MgtKey, cashbill, UserID=None):
""" μμ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
MgtKey : μλ³Έ νκΈμμμ¦ λ¬Έμκ΄λ¦¬λ²νΈ
cashbill : μμ ν νκΈμμμ¦ object. made with Cashbill(...)
UserID : νλΉνμ μμ΄λ
return
μ²λ¦¬κ²°κ³Ό. ... | μμ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
MgtKey : μλ³Έ νκΈμμμ¦ λ¬Έμκ΄λ¦¬λ²νΈ
cashbill : μμ ν νκΈμμμ¦ object. made with Cashbill(...)
UserID : νλΉνμ μμ΄λ
return
μ²λ¦¬κ²°κ³Ό. consist of code and message
raise
Popbill... | entailment |
def issue(self, CorpNum, MgtKey, Memo=None, UserID=None):
""" λ°ν
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
MgtKey : μλ³Έ νκΈμμμ¦ λ¬Έμκ΄λ¦¬λ²νΈ
Memo : λ°ν λ©λͺ¨
UserID : νλΉνμ μμ΄λ
return
μ²λ¦¬κ²°κ³Ό. consist of code and message
... | λ°ν
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
MgtKey : μλ³Έ νκΈμμμ¦ λ¬Έμκ΄λ¦¬λ²νΈ
Memo : λ°ν λ©λͺ¨
UserID : νλΉνμ μμ΄λ
return
μ²λ¦¬κ²°κ³Ό. consist of code and message
raise
PopbillException | entailment |
def delete(self, CorpNum, MgtKey, UserID=None):
""" μμ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
MgtKey : μλ³Έ νκΈμμμ¦ λ¬Έμκ΄λ¦¬λ²νΈ
UserID : νλΉνμ μμ΄λ
return
μ²λ¦¬κ²°κ³Ό. consist of code and message
raise
PopbillException... | μμ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
MgtKey : μλ³Έ νκΈμμμ¦ λ¬Έμκ΄λ¦¬λ²νΈ
UserID : νλΉνμ μμ΄λ
return
μ²λ¦¬κ²°κ³Ό. consist of code and message
raise
PopbillException | entailment |
def search(self, CorpNum, DType, SDate, EDate, State, TradeType, TradeUsage, TaxationType, Page, PerPage, Order,
UserID=None, QString=None, TradeOpt=None):
""" λͺ©λ‘ μ‘°ν
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
DType : μΌμμ ν, R-λ±λ‘μΌμ, T-κ±°λμΌμ, I-λ°νμΌμ μ€ ν 1
... | λͺ©λ‘ μ‘°ν
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
DType : μΌμμ ν, R-λ±λ‘μΌμ, T-κ±°λμΌμ, I-λ°νμΌμ μ€ ν 1
SDate : μμμΌμ, νμνμ(yyyyMMdd)
EDate : μ’
λ£μΌμ, νμνμ(yyyyMMdd)
State : μνμ½λ λ°°μ΄, 2,3λ²μ§Έ μ리μ μμΌλμΉ΄λ(*) μ¬μ©κ°λ₯
TradeType : λ¬Έμνν λ°°μ΄, N-μΌλ°νκΈμμμ¦,... | entailment |
def getInfo(self, CorpNum, MgtKey):
""" μν/μμ½ μ 보 μ‘°ν
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
MgtKey : λ¬Έμκ΄λ¦¬λ²νΈ
return
λ¬Έμ μν/μμ½ μ 보 object
raise
PopbillException
"""
if MgtKey == None or MgtKey == "":
... | μν/μμ½ μ 보 μ‘°ν
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
MgtKey : λ¬Έμκ΄λ¦¬λ²νΈ
return
λ¬Έμ μν/μμ½ μ 보 object
raise
PopbillException | entailment |
def getInfos(self, CorpNum, MgtKeyList):
""" μνμ 보 λ€λ νμΈ, μ΅λ 1000건
args
CorpNum : νμ μ¬μ
μ λ²νΈ
MgtKeyList : λ¬Έμκ΄λ¦¬λ²νΈ λͺ©λ‘
return
μνμ 보 λͺ©λ‘ as List
raise
PopbillException
"""
if MgtKeyList == None ... | μνμ 보 λ€λ νμΈ, μ΅λ 1000건
args
CorpNum : νμ μ¬μ
μ λ²νΈ
MgtKeyList : λ¬Έμκ΄λ¦¬λ²νΈ λͺ©λ‘
return
μνμ 보 λͺ©λ‘ as List
raise
PopbillException | entailment |
def getDetailInfo(self, CorpNum, MgtKey):
""" μμΈμ 보 μ‘°ν
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
MgtKey : λ¬Έμκ΄λ¦¬λ²νΈ
return
λ¬Έμ μμΈμ 보 object
raise
PopbillException
"""
if MgtKey == None or MgtKey == "":
... | μμΈμ 보 μ‘°ν
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
MgtKey : λ¬Έμκ΄λ¦¬λ²νΈ
return
λ¬Έμ μμΈμ 보 object
raise
PopbillException | entailment |
def sendEmail(self, CorpNum, MgtKey, ReceiverEmail, UserID=None):
""" μλ¦Όλ©μΌ μ¬μ μ‘
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
MgtKey : λ¬Έμκ΄λ¦¬λ²νΈ
ReceiverEmail : μμ μ μ΄λ©μΌ μ£Όμ
UserID : νλΉνμ μμ΄λ
return
μ²λ¦¬κ²°κ³Ό. consist of code and m... | μλ¦Όλ©μΌ μ¬μ μ‘
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
MgtKey : λ¬Έμκ΄λ¦¬λ²νΈ
ReceiverEmail : μμ μ μ΄λ©μΌ μ£Όμ
UserID : νλΉνμ μμ΄λ
return
μ²λ¦¬κ²°κ³Ό. consist of code and message
raise
PopbillException | entailment |
def getLogs(self, CorpNum, MgtKey):
""" λ¬Έμμ΄λ ₯ μ‘°ν
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
MgtKey : λ¬Έμκ΄λ¦¬λ²νΈ
return
λ¬Έμ μ΄λ ₯ λͺ©λ‘ as List
raise
PopbillException
"""
if MgtKey == None or MgtKey == "":
... | λ¬Έμμ΄λ ₯ μ‘°ν
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
MgtKey : λ¬Έμκ΄λ¦¬λ²νΈ
return
λ¬Έμ μ΄λ ₯ λͺ©λ‘ as List
raise
PopbillException | entailment |
def getEPrintURL(self, CorpNum, MgtKey, UserID=None):
""" 곡κΈλ°λμμ© μΈμ URL νμΈ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
MgtKey : λ¬Έμκ΄λ¦¬λ²νΈ
UserID : νλΉνμ μμ΄λ
return
νλΉ URL as str
raise
PopbillException
... | 곡κΈλ°λμμ© μΈμ URL νμΈ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
MgtKey : λ¬Έμκ΄λ¦¬λ²νΈ
UserID : νλΉνμ μμ΄λ
return
νλΉ URL as str
raise
PopbillException | entailment |
def updateEmailConfig(self, Corpnum, EmailType, SendYN, UserID=None):
""" μλ¦Όλ©μΌ μ μ‘μ€μ μμ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
EmailType: λ©μΌμ μ‘μ ν
SendYN: μ μ‘μ¬λΆ (True-μ μ‘, False-λ―Έμ μ‘)
UserID : νλΉνμ μμ΄λ
return
μ²λ¦¬κ²°κ³Ό. consi... | μλ¦Όλ©μΌ μ μ‘μ€μ μμ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
EmailType: λ©μΌμ μ‘μ ν
SendYN: μ μ‘μ¬λΆ (True-μ μ‘, False-λ―Έμ μ‘)
UserID : νλΉνμ μμ΄λ
return
μ²λ¦¬κ²°κ³Ό. consist of code and message
raise
PopbillException | entailment |
def list(self, request):
"""
Returns the list of documents found on the collection
"""
pipeline = [{'$match': request.args.pop('match', {})}]
sort = request.args.pop('sort', {})
if sort:
pipeline.append({'$sort': sort})
project = request.args.pop('pr... | Returns the list of documents found on the collection | entailment |
def create(self, request):
"""
Creates a new document based on the given data
"""
document = self.collection(request.json)
document.created_at = datetime.utcnow()
document.updated_at = document.created_at
created = document.insert()
return Response(
... | Creates a new document based on the given data | entailment |
def retrieve(self, request, _id):
"""
Returns the document containing the given _id or 404
"""
_id = deserialize(_id)
retrieved = self.collection.find_one({'_id': _id})
if retrieved:
return Response(serialize(retrieved))
else:
return Respo... | Returns the document containing the given _id or 404 | entailment |
def update(self, request, _id):
"""
Updates the document with the given _id using the given data
"""
_id = deserialize(_id)
to_update = self.collection.find_one({'_id': _id})
if to_update:
document = self.collection(dict(to_update, **request.json))
... | Updates the document with the given _id using the given data | entailment |
def delete(self, request, _id):
"""
Deletes the document with the given _id if it exists
"""
_id = deserialize(_id)
to_delete = self.collection.get({'_id': _id})
if to_delete:
deleted = to_delete.delete()
return Response(
response... | Deletes the document with the given _id if it exists | entailment |
def with_reactor(*dec_args, **dec_kwargs):
"""
Decorator for test functions that require a running reactor.
Can be used like this::
@with_reactor
def test_connect_to_server(self):
...
Or like this::
@with_reactor(timeout=10)
def test_connec... | Decorator for test functions that require a running reactor.
Can be used like this::
@with_reactor
def test_connect_to_server(self):
...
Or like this::
@with_reactor(timeout=10)
def test_connect_to_server(self):
...
If the ... | entailment |
def _ensure_reactor_running():
"""
Starts the twisted reactor if it is not running already.
The reactor is started in a new daemon-thread.
Has to perform dirty hacks so that twisted can register
signals even if it is not running in the main-thread.
"""
if not reactor.running:
... | Starts the twisted reactor if it is not running already.
The reactor is started in a new daemon-thread.
Has to perform dirty hacks so that twisted can register
signals even if it is not running in the main-thread. | entailment |
def _timeoutDeferred(deferred, timeout):
"""
Cancels the given deferred after the given time, if it has not yet callbacked/errbacked it.
"""
delayedCall = reactor.callLater(timeout, deferred.cancel)
def gotResult(result):
if delayedCall.active():
delayedCall.cancel()
retu... | Cancels the given deferred after the given time, if it has not yet callbacked/errbacked it. | entailment |
def find_prf_cpu(idxPrc, aryFuncChnk, aryPrfTc, aryMdlParams, strVersion,
lgcXval, varNumXval, queOut, lgcRstr=None, lgcPrint=True):
"""
Find best fitting pRF model for voxel time course, using the CPU.
Parameters
----------
idxPrc : int
Process ID of the process calling th... | Find best fitting pRF model for voxel time course, using the CPU.
Parameters
----------
idxPrc : int
Process ID of the process calling this function (for CPU
multi-threading). In GPU version, this parameter is 0 (just one thread
on CPU).
aryFunc : np.array
2D array with ... | entailment |
def check(schema, rev_id, page_id=None, radius=defaults.RADIUS,
before=None, window=None):
"""
Checks the revert status of a revision. With this method, you can
determine whether an edit is a 'reverting' edit, was 'reverted' by another
edit and/or was 'reverted_to' by another edit.
:Para... | Checks the revert status of a revision. With this method, you can
determine whether an edit is a 'reverting' edit, was 'reverted' by another
edit and/or was 'reverted_to' by another edit.
:Parameters:
session : :class:`mwapi.Session`
An API session to make use of
rev_id : int
... | entailment |
def check_archive(schema, rev_id, namespace=None, title=None, timestamp=None,
radius=defaults.RADIUS,
before=None, window=None):
"""
Checks the revert status of an archived revision (from a deleted page).
With this method, you can determine whether an edit is a 'reverting... | Checks the revert status of an archived revision (from a deleted page).
With this method, you can determine whether an edit is a 'reverting'
edit, was 'reverted' by another edit and/or was 'reverted_to' by
another edit.
:Parameters:
session : :class:`mwapi.Session`
An API session to... | entailment |
def _get_json(value):
"""Convert the given value to a JSON object."""
if hasattr(value, 'replace'):
value = value.replace('\n', ' ')
try:
return json.loads(value)
except json.JSONDecodeError:
# Escape double quotes.
if hasattr(value, 'replace'):
value = value.... | Convert the given value to a JSON object. | entailment |
def save_list(key, *values):
"""Convert the given list of parameters to a JSON object.
JSON object is of the form:
{ key: [values[0], values[1], ... ] },
where values represent the given list of parameters.
"""
return json.dumps({key: [_get_json(value) for value in values]}) | Convert the given list of parameters to a JSON object.
JSON object is of the form:
{ key: [values[0], values[1], ... ] },
where values represent the given list of parameters. | entailment |
def save_file(key, file_path, *refs):
"""Convert the given parameters to a special JSON object.
JSON object is of the form:
{ key: {"file": file_path}}, or
{ key: {"file": file_path, "refs": [refs[0], refs[1], ... ]}}
"""
if not os.path.isfile(file_path):
return error("Output '{}' set ... | Convert the given parameters to a special JSON object.
JSON object is of the form:
{ key: {"file": file_path}}, or
{ key: {"file": file_path, "refs": [refs[0], refs[1], ... ]}} | entailment |
def save_file_list(key, *files_refs):
"""Convert the given parameters to a special JSON object.
Each parameter is a file-refs specification of the form:
<file-path>:<reference1>,<reference2>, ...,
where the colon ':' and the list of references are optional.
JSON object is of the form:
{ key: {... | Convert the given parameters to a special JSON object.
Each parameter is a file-refs specification of the form:
<file-path>:<reference1>,<reference2>, ...,
where the colon ':' and the list of references are optional.
JSON object is of the form:
{ key: {"file": file_path}}, or
{ key: {"file": f... | entailment |
def save_dir(key, dir_path, *refs):
"""Convert the given parameters to a special JSON object.
JSON object is of the form:
{ key: {"dir": dir_path}}, or
{ key: {"dir": dir_path, "refs": [refs[0], refs[1], ... ]}}
"""
if not os.path.isdir(dir_path):
return error(
"Output '{}'... | Convert the given parameters to a special JSON object.
JSON object is of the form:
{ key: {"dir": dir_path}}, or
{ key: {"dir": dir_path, "refs": [refs[0], refs[1], ... ]}} | entailment |
def save_dir_list(key, *dirs_refs):
"""Convert the given parameters to a special JSON object.
Each parameter is a dir-refs specification of the form:
<dir-path>:<reference1>,<reference2>, ...,
where the colon ':' and the list of references are optional.
JSON object is of the form:
{ key: {"dir... | Convert the given parameters to a special JSON object.
Each parameter is a dir-refs specification of the form:
<dir-path>:<reference1>,<reference2>, ...,
where the colon ':' and the list of references are optional.
JSON object is of the form:
{ key: {"dir": dir_path}}, or
{ key: {"dir": dir_pa... | entailment |
def progress(progress):
"""Convert given progress to a JSON object.
Check that progress can be represented as float between 0 and 1 and
return it in JSON of the form:
{"proc.progress": progress}
"""
if isinstance(progress, int) or isinstance(progress, float):
progress = float(prog... | Convert given progress to a JSON object.
Check that progress can be represented as float between 0 and 1 and
return it in JSON of the form:
{"proc.progress": progress} | entailment |
def checkrc(rc, *args):
"""Check if ``rc`` (return code) meets requirements.
Check if ``rc`` is 0 or is in ``args`` list that contains
acceptable return codes.
Last argument of ``args`` can optionally be error message that
is printed if ``rc`` doesn't meet requirements.
Output is JSON of the f... | Check if ``rc`` (return code) meets requirements.
Check if ``rc`` is 0 or is in ``args`` list that contains
acceptable return codes.
Last argument of ``args`` can optionally be error message that
is printed if ``rc`` doesn't meet requirements.
Output is JSON of the form:
{"proc.rc": <rc>,... | entailment |
def export_file(file_path):
"""Prepend the given parameter with ``export``"""
if not os.path.isfile(file_path):
return error("Referenced file does not exist: '{}'.".format(file_path))
return "export {}".format(file_path) | Prepend the given parameter with ``export`` | entailment |
def import_file(
src,
file_name,
imported_format=ImportedFormat.BOTH,
progress_from=0.0,
progress_to=None,
):
"""Import file to working directory.
:param src: Source file path or URL
:param file_name: Source file name
:param imported_format: Import file format (extracted, compressed... | Import file to working directory.
:param src: Source file path or URL
:param file_name: Source file name
:param imported_format: Import file format (extracted, compressed or both)
:param progress_from: Initial progress value
:param progress_to: Final progress value
:return: Destination file pat... | entailment |
def loadNiiData(lstNiiFls,
strPathNiiMask=None,
strPathNiiFunc=None):
"""load nii data.
Parameters
----------
lstNiiFls : list, list of str with nii file names
strPathNiiMask : str, path to nii file with mask (optional)
strPathNiiFunc : str, p... | load nii data.
Parameters
----------
lstNiiFls : list, list of str with nii file names
strPathNiiMask : str, path to nii file with mask (optional)
strPathNiiFunc : str, parent path to nii files (optional)
Returns
-------
aryFunc : np.array
Nii... | entailment |
def calcR2(predTst, yTest, axis=0):
"""calculate coefficient of determination. Assumes that axis=0 is time
Parameters
----------
predTst : np.array, predicted reponse for yTest
yTest : np.array, acxtually observed response for yTest
Returns
-------
aryFunc : ... | calculate coefficient of determination. Assumes that axis=0 is time
Parameters
----------
predTst : np.array, predicted reponse for yTest
yTest : np.array, acxtually observed response for yTest
Returns
-------
aryFunc : np.array
R2 | entailment |
def calcFstats(predTst, yTest, p, axis=0):
"""calculate coefficient of determination. Assumes that axis=0 is time
Parameters
----------
predTst : np.array, predicted reponse for yTest
yTest : np.array, acxtually observed response for yTest
p: float, number of predictors
... | calculate coefficient of determination. Assumes that axis=0 is time
Parameters
----------
predTst : np.array, predicted reponse for yTest
yTest : np.array, acxtually observed response for yTest
p: float, number of predictors
Returns
-------
aryFunc : np.a... | entailment |
def calcMse(predTst, yTest, axis=0):
"""calculate mean squared error. Assumes that axis=0 is time
Parameters
----------
predTst : np.array, predicted reponse for yTest
yTest : np.array, acxtually observed response for yTest
Returns
-------
aryFunc : np.array
... | calculate mean squared error. Assumes that axis=0 is time
Parameters
----------
predTst : np.array, predicted reponse for yTest
yTest : np.array, acxtually observed response for yTest
Returns
-------
aryFunc : np.array
MSE | entailment |
def n_day(date_string):
"""
date_string string in format "(number|a) day(s) ago"
"""
today = datetime.date.today()
match = re.match(r'(\d{1,3}|a) days? ago', date_string)
groups = match.groups()
if groups:
decrement = groups[0]
if decrement... | date_string string in format "(number|a) day(s) ago" | entailment |
def detect(checksum_revisions, radius=defaults.RADIUS):
"""
Detects reverts that occur in a sequence of revisions. Note that,
`revision` data meta will simply be returned in the case of a revert.
This function serves as a convenience wrapper around calls to
:class:`mwreverts.Detector`'s :func:`~mw... | Detects reverts that occur in a sequence of revisions. Note that,
`revision` data meta will simply be returned in the case of a revert.
This function serves as a convenience wrapper around calls to
:class:`mwreverts.Detector`'s :func:`~mwreverts.Detector.process`
method.
:Parameters:
chec... | entailment |
def getChargeInfo(self, CorpNum, ItemCode, UserID=None):
""" κ³ΌκΈμ 보 νμΈ
args
CorpNum : νμ μ¬μ
μλ²νΈ
ItemCode : μ μλͺ
μΈμ μ’
λ₯μ½λ
UserID : νλΉ νμμμ΄λ
return
κ³ΌκΈμ 보 κ°μ²΄
raise
PopbillException
"""
... | κ³ΌκΈμ 보 νμΈ
args
CorpNum : νμ μ¬μ
μλ²νΈ
ItemCode : μ μλͺ
μΈμ μ’
λ₯μ½λ
UserID : νλΉ νμμμ΄λ
return
κ³ΌκΈμ 보 κ°μ²΄
raise
PopbillException | entailment |
def getUnitCost(self, CorpNum, ItemCode):
""" μ μλͺ
μΈμ λ°νλ¨κ° νμΈ.
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
return
... | μ μλͺ
μΈμ λ°νλ¨κ° νμΈ.
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
return
λ°νλ¨κ° by float
raise
Pop... | entailment |
def FAXSend(self, CorpNum, statement, SendNum, ReceiveNum, UserID=None):
""" μ ν©μ€ μ μ‘
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
statement : μ μλͺ
μΈμ κ°μ²΄
SendNum : ν©μ€ λ°μ λ²νΈ
ReceiveNum : ν©μ€ μμ λ²νΈ
UserID : νλΉνμ μμ΄λ
return
... | μ ν©μ€ μ μ‘
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
statement : μ μλͺ
μΈμ κ°μ²΄
SendNum : ν©μ€ λ°μ λ²νΈ
ReceiveNum : ν©μ€ μμ λ²νΈ
UserID : νλΉνμ μμ΄λ
return
ν©μ€μ μ‘ μ μλ²νΈ(receiptNum)
raise
PopbillException | entailment |
def registIssue(self, CorpNum, statement, Memo=None, UserID=None):
""" μ¦μλ°ν
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
statement : λ±λ‘ν μ μλͺ
μΈμ object. made with Statement(...)
Memo : μ¦μλ°νλ©λͺ¨
UserID : νλΉνμ μμ΄λ
return
μ²λ¦¬... | μ¦μλ°ν
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
statement : λ±λ‘ν μ μλͺ
μΈμ object. made with Statement(...)
Memo : μ¦μλ°νλ©λͺ¨
UserID : νλΉνμ μμ΄λ
return
μ²λ¦¬κ²°κ³Ό. consist of code and message
raise
PopbillExcep... | entailment |
def register(self, CorpNum, statement, UserID=None):
""" μμμ μ₯
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
statement : λ±λ‘ν μ μλͺ
μΈμ object. made with Statement(...)
UserID : νλΉνμ μμ΄λ
return
μ²λ¦¬κ²°κ³Ό. consist of code and message
ra... | μμμ μ₯
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
statement : λ±λ‘ν μ μλͺ
μΈμ object. made with Statement(...)
UserID : νλΉνμ μμ΄λ
return
μ²λ¦¬κ²°κ³Ό. consist of code and message
raise
PopbillException | entailment |
def update(self, CorpNum, ItemCode, MgtKey, Statement, UserID=None):
""" μμμ μ₯
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
M... | μμμ μ₯
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
MgtKey : ννΈλ λ¬Έμκ΄λ¦¬λ²νΈ
Statement : λ±λ‘ν μ μλͺ
μΈμ object. made with Statem... | entailment |
def issue(self, CorpNum, ItemCode, MgtKey, Memo=None, EmailSubject=None, UserID=None):
""" λ°ν
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
... | λ°ν
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
MgtKey : ννΈλ λ¬Έμκ΄λ¦¬λ²νΈ
Memo : μ²λ¦¬λ©λͺ¨
EmailSubject : λ°νλ©μΌ... | entailment |
def cancel(self, CorpNum, ItemCode, MgtKey, Memo=None, UserID=None):
""" λ°νμ·¨μ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
M... | λ°νμ·¨μ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
MgtKey : ννΈλ λ¬Έμκ΄λ¦¬λ²νΈ
Memo : μ²λ¦¬λ©λͺ¨
UserID : νλΉνμ μμ΄λ... | entailment |
def delete(self, CorpNum, ItemCode, MgtKey, UserID=None):
""" μμ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
MgtKey : ννΈλ λ¬Έ... | μμ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
MgtKey : ννΈλ λ¬Έμκ΄λ¦¬λ²νΈ
UserID : νλΉνμ μμ΄λ
return
... | entailment |
def search(self, CorpNum, DType, SDate, EDate, State, ItemCode, Page, PerPage, Order, UserID=None, QString=None):
""" λͺ©λ‘ μ‘°ν
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
DType : μΌμμ ν, R-λ±λ‘μΌμ, W-μμ±μΌμ, I-λ°νμΌμ μ€ ν 1
SDate : μμμΌμ, νμνμ(yyyyMMdd)
EDate : ... | λͺ©λ‘ μ‘°ν
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
DType : μΌμμ ν, R-λ±λ‘μΌμ, W-μμ±μΌμ, I-λ°νμΌμ μ€ ν 1
SDate : μμμΌμ, νμνμ(yyyyMMdd)
EDate : μ’
λ£μΌμ, νμνμ(yyyyMMdd)
State : μνμ½λ, 2,3λ²μ§Έ μ리μ μμΌλμΉ΄λ(*) μ¬μ©κ°λ₯
ItemCode : λͺ
μΈμ μ’
λ₯μ½λ λ°°μ΄, 121-λͺ
μΈμ, 1... | entailment |
def getInfo(self, CorpNum, ItemCode, MgtKey):
""" μν/μμ½ μ 보 νμΈ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
MgtKey : ννΈλ λ¬Έμκ΄λ¦¬... | μν/μμ½ μ 보 νμΈ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
MgtKey : ννΈλ λ¬Έμκ΄λ¦¬λ²νΈ
return
λ¬Έμ μν/μμ½μ 보 object
... | entailment |
def getDetailInfo(self, CorpNum, ItemCode, MgtKey):
""" μ μλͺ
μΈμ μμΈμ 보 νμΈ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
MgtKey : ... | μ μλͺ
μΈμ μμΈμ 보 νμΈ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
MgtKey : ννΈλ λ¬Έμκ΄λ¦¬λ²νΈ
return
λ¬Έμ μμΈμ 보 object
... | entailment |
def sendSMS(self, CorpNum, ItemCode, MgtKey, Sender, Receiver, Contents, UserID=None):
""" μλ¦Όλ¬Έμ μ μ‘
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμ... | μλ¦Όλ¬Έμ μ μ‘
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
MgtKey : ννΈλ λ¬Έμκ΄λ¦¬λ²νΈ
Sender : λ°μ λ²νΈ
Receiver : μ... | entailment |
def getLogs(self, CorpNum, ItemCode, MgtKey):
""" μ μλͺ
μΈμ λ¬Έμμ΄λ ₯ λͺ©λ‘ νμΈ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
MgtKey : ννΈλ... | μ μλͺ
μΈμ λ¬Έμμ΄λ ₯ λͺ©λ‘ νμΈ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
MgtKey : ννΈλ λ¬Έμκ΄λ¦¬λ²νΈ
return
λ¬Έμμ΄λ ₯ μ 보 λͺ©λ‘ as ... | entailment |
def attachFile(self, CorpNum, ItemCode, MgtKey, FilePath, UserID=None):
""" νμΌ μ²¨λΆ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
... | νμΌ μ²¨λΆ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
MgtKey : ννΈλ λ¬Έμκ΄λ¦¬λ²νΈ
FilePath : 첨λΆνμΌμ κ²½λ‘
UserID :... | entailment |
def getFiles(self, CorpNum, ItemCode, MgtKey):
""" 첨λΆνμΌ λͺ©λ‘ νμΈ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
MgtKey : ννΈλ λ¬Έμκ΄λ¦¬... | 첨λΆνμΌ λͺ©λ‘ νμΈ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
MgtKey : ννΈλ λ¬Έμκ΄λ¦¬λ²νΈ
return
첨λΆνμΌ λͺ©λ‘ as List
... | entailment |
def deleteFile(self, CorpNum, ItemCode, MgtKey, FileID, UserID=None):
""" 첨λΆνμΌ μμ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
... | 첨λΆνμΌ μμ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
MgtKey : ννΈλ λ¬Έμκ΄λ¦¬λ²νΈ
FileID : νμΌμμ΄λ, 첨λΆνμΌ λͺ©λ‘νμΈ(getFiles) API μλ΅μ ... | entailment |
def getMassPrintURL(self, CorpNum, ItemCode, MgtKeyList, UserID=None):
""" λ€λ μΈμ URL νμΈ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
... | λ€λ μΈμ URL νμΈ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : λͺ
μΈμ μ’
λ₯ μ½λ
[121 - κ±°λλͺ
μΈμ], [122 - μ²κ΅¬μ], [123 - 견μ μ],
[124 - λ°μ£Όμ], [125 - μ
κΈν], [126 - μμμ¦]
MgtKeyList : ννΈλ λ¬Έμκ΄λ¦¬λ²νΈ λͺ©λ‘
UserID : νλΉνμ μμ΄λ
... | entailment |
def attachStatement(self, CorpNum, ItemCode, MgtKey, SubItemCode, SubMgtKey, UserID=None):
""" λ€λ₯Έ μ μλͺ
μΈμ 첨λΆ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : μ μλͺ
μΈμ μ’
λ₯μ½λ, 121-λͺ
μΈμ, 122-μ²κ΅¬μ, 123-견μ μ, 124-λ°μ£Όμ 125-μ
κΈν, 126-μμμ¦
MgtKey : μ μλͺ
μΈμ λ¬Έμκ΄λ¦¬λ²νΈ
... | λ€λ₯Έ μ μλͺ
μΈμ 첨λΆ
args
CorpNum : νλΉνμ μ¬μ
μλ²νΈ
ItemCode : μ μλͺ
μΈμ μ’
λ₯μ½λ, 121-λͺ
μΈμ, 122-μ²κ΅¬μ, 123-견μ μ, 124-λ°μ£Όμ 125-μ
κΈν, 126-μμμ¦
MgtKey : μ μλͺ
μΈμ λ¬Έμκ΄λ¦¬λ²νΈ
SubItemCode : 첨λΆν λͺ
μΈμ μ’
λ₯μ½λ, 121-λͺ
μΈμ, 122-μ²κ΅¬μ, 123-견μ μ, 124-λ°μ£Όμ 125-μ
κΈν, 126-μμμ¦
SubMgtK... | entailment |
def process(self, article):
"""
Ingests an article and processes it for metadata and elements to provide
proper references in the EPUB spine.
This method may only be called once unless the Package was instantiated
in collection mode using ``Package(collection=True)``. It places ... | Ingests an article and processes it for metadata and elements to provide
proper references in the EPUB spine.
This method may only be called once unless the Package was instantiated
in collection mode using ``Package(collection=True)``. It places entries
in an internal spine list for th... | entailment |
def acquire_metadata(self):
"""
Handles the acquisition of metadata for both collection mode and single
mode, uses the metadata methods belonging to the article's publisher
attribute.
"""
#For space economy
publisher = self.article.publisher
if self.colle... | Handles the acquisition of metadata for both collection mode and single
mode, uses the metadata methods belonging to the article's publisher
attribute. | entailment |
def file_manifest(self, location):
"""
An iterator through the files in a location which yields item elements
suitable for insertion into the package manifest.
"""
#Maps file extensions to mimetypes
mimetypes = {'.jpg': 'image/jpeg',
'.jpeg': 'image/j... | An iterator through the files in a location which yields item elements
suitable for insertion into the package manifest. | entailment |
def get_contrib_names(self, contrib):
"""
Returns an appropriate Name and File-As-Name for a contrib element.
This code was refactored out of nav_contributors and
package_contributors to provide a single definition point for a common
job. This is a useful utility that may be wel... | Returns an appropriate Name and File-As-Name for a contrib element.
This code was refactored out of nav_contributors and
package_contributors to provide a single definition point for a common
job. This is a useful utility that may be well-employed for other
publishers as well. | entailment |
def package_description(self):
"""
Given an Article class instance, this is responsible for returning an
article description. For this method I have taken the approach of
serializing the article's first abstract, if it has one. This results
in 0 or 1 descriptions per article.
... | Given an Article class instance, this is responsible for returning an
article description. For this method I have taken the approach of
serializing the article's first abstract, if it has one. This results
in 0 or 1 descriptions per article. | entailment |
def heading_title(self):
"""
Makes the Article Title for the Heading.
Metadata element, content derived from FrontMatter
"""
art_title = self.article.root.xpath('./front/article-meta/title-group/article-title')[0]
article_title = deepcopy(art_title)
article_title... | Makes the Article Title for the Heading.
Metadata element, content derived from FrontMatter | entailment |
def make_heading_authors(self, authors):
"""
Constructs the Authors content for the Heading. This should display
directly after the Article Title.
Metadata element, content derived from FrontMatter
"""
author_element = etree.Element('h3', {'class': 'authors'})
#C... | Constructs the Authors content for the Heading. This should display
directly after the Article Title.
Metadata element, content derived from FrontMatter | entailment |
def make_heading_affiliations(self, heading_div):
"""
Makes the content for the Author Affiliations, displays after the
Authors segment in the Heading.
Metadata element, content derived from FrontMatter
"""
#Get all of the aff element tuples from the metadata
aff... | Makes the content for the Author Affiliations, displays after the
Authors segment in the Heading.
Metadata element, content derived from FrontMatter | entailment |
def make_heading_abstracts(self, heading_div):
"""
An article may contain data for various kinds of abstracts. This method
works on those that are included in the Heading. This is displayed
after the Authors and Affiliations.
Metadata element, content derived from FrontMatter
... | An article may contain data for various kinds of abstracts. This method
works on those that are included in the Heading. This is displayed
after the Authors and Affiliations.
Metadata element, content derived from FrontMatter | entailment |
def make_article_info(self):
"""
The Article Info contains the (self) Citation, Editors, Dates,
Copyright, Funding Statement, Competing Interests Statement,
Correspondence, and Footnotes. Maybe more...
This content follows the Heading and precedes the Main segment in the
... | The Article Info contains the (self) Citation, Editors, Dates,
Copyright, Funding Statement, Competing Interests Statement,
Correspondence, and Footnotes. Maybe more...
This content follows the Heading and precedes the Main segment in the
output.
This function accepts the recei... | entailment |
def make_article_info_citation(self):
"""
Creates a self citation node for the ArticleInfo of the article.
This method uses code from this page as a reference implementation:
https://github.com/PLOS/ambra/blob/master/base/src/main/resources/articleTransform-v3.xsl
"""
ci... | Creates a self citation node for the ArticleInfo of the article.
This method uses code from this page as a reference implementation:
https://github.com/PLOS/ambra/blob/master/base/src/main/resources/articleTransform-v3.xsl | entailment |
def make_article_info_dates(self):
"""
Makes the section containing important dates for the article: typically
Received, Accepted, and Published.
"""
dates_div = etree.Element('div', {'id': 'article-dates'})
d = './front/article-meta/history/date'
received = self... | Makes the section containing important dates for the article: typically
Received, Accepted, and Published. | entailment |
def make_article_info_copyright(self, article_info_div):
"""
Makes the copyright section for the ArticleInfo. For PLoS, this means
handling the information contained in the metadata <permissions>
element.
"""
perm = self.article.root.xpath('./front/article-meta/permission... | Makes the copyright section for the ArticleInfo. For PLoS, this means
handling the information contained in the metadata <permissions>
element. | entailment |
def make_article_info_funding(self, article_info_div):
"""
Creates the element for declaring Funding in the article info.
"""
funding_group = self.article.root.xpath('./front/article-meta/funding-group')
if funding_group:
funding_div = etree.SubElement(article_info_di... | Creates the element for declaring Funding in the article info. | entailment |
def make_article_info_competing_interests(self, article_info_div):
"""
Creates the element for declaring competing interests in the article
info.
"""
#Check for author-notes
con_expr = "./front/article-meta/author-notes/fn[@fn-type='conflict']"
conflict = self.art... | Creates the element for declaring competing interests in the article
info. | entailment |
def make_article_info_correspondences(self, article_info_div):
"""
Articles generally provide a first contact, typically an email address
for one of the authors. This will supply that content.
"""
corresps = self.article.root.xpath('./front/article-meta/author-notes/corresp')
... | Articles generally provide a first contact, typically an email address
for one of the authors. This will supply that content. | entailment |
def make_article_info_footnotes_other(self, article_info_div):
"""
This will catch all of the footnotes of type 'other' in the <fn-group>
of the <back> element.
"""
other_fn_expr = "./back/fn-group/fn[@fn-type='other']"
other_fns = self.article.root.xpath(other_fn_expr)
... | This will catch all of the footnotes of type 'other' in the <fn-group>
of the <back> element. | entailment |
def make_back_matter(self):
"""
The <back> element may have 0 or 1 <label> elements and 0 or 1 <title>
elements. Then it may have any combination of the following: <ack>,
<app-group>, <bio>, <fn-group>, <glossary>, <ref-list>, <notes>, and
<sec>. <sec> is employed here as a catch... | The <back> element may have 0 or 1 <label> elements and 0 or 1 <title>
elements. Then it may have any combination of the following: <ack>,
<app-group>, <bio>, <fn-group>, <glossary>, <ref-list>, <notes>, and
<sec>. <sec> is employed here as a catch-all for material that does not
fall und... | entailment |
def move_back_boxed_texts(self):
"""
The only intended use for this function is to patch a problem seen in
at least one PLoS article (journal.pgen.0020002). This will move any
<boxed-text> elements over to the receiving element, which is probably
the main body.
"""
... | The only intended use for this function is to patch a problem seen in
at least one PLoS article (journal.pgen.0020002). This will move any
<boxed-text> elements over to the receiving element, which is probably
the main body. | entailment |
def make_back_acknowledgments(self):
"""
The <ack> is an important piece of back matter information, and will be
including immediately after the main text.
This element should only occur once, optionally, for PLoS, if a need
becomes known, then multiple instances may be supporte... | The <ack> is an important piece of back matter information, and will be
including immediately after the main text.
This element should only occur once, optionally, for PLoS, if a need
becomes known, then multiple instances may be supported. | entailment |
def make_back_author_contributions(self, body):
"""
Though this goes in the back of the document with the rest of the back
matter, it is not an element found under <back>.
I don't expect to see more than one of these. Compare this method to
make_article_info_competing_interests(... | Though this goes in the back of the document with the rest of the back
matter, it is not an element found under <back>.
I don't expect to see more than one of these. Compare this method to
make_article_info_competing_interests() | entailment |
def make_back_glossary(self, body):
"""
Glossaries are a fairly common item in papers for PLoS, but it also
seems that they are rarely incorporated into the PLoS web-site or PDF
formats. They are included in the ePub output however because they are
helpful and because we can.
... | Glossaries are a fairly common item in papers for PLoS, but it also
seems that they are rarely incorporated into the PLoS web-site or PDF
formats. They are included in the ePub output however because they are
helpful and because we can. | entailment |
def make_back_notes(self, body):
"""
The notes element in PLoS articles can be employed for posting notices
of corrections or adjustments in proof. The <notes> element has a very
diverse content model, but PLoS practice appears to be fairly
consistent: a single <sec> containing a... | The notes element in PLoS articles can be employed for posting notices
of corrections or adjustments in proof. The <notes> element has a very
diverse content model, but PLoS practice appears to be fairly
consistent: a single <sec> containing a <title> and a <p> | entailment |
def convert_disp_formula_elements(self):
"""
<disp-formula> elements must be converted to conforming elements
"""
for disp in self.main.getroot().findall('.//disp-formula'):
#find label element
label_el = disp.find('label')
graphic_el = disp.find('grap... | <disp-formula> elements must be converted to conforming elements | entailment |
def convert_inline_formula_elements(self):
"""
<inline-formula> elements must be converted to be conforming
These elements may contain <inline-graphic> elements, textual content,
or both.
"""
for inline in self.main.getroot().findall('.//inline-formula'):
#in... | <inline-formula> elements must be converted to be conforming
These elements may contain <inline-graphic> elements, textual content,
or both. | entailment |
def convert_disp_quote_elements(self):
"""
Extract or extended quoted passage from another work, usually made
typographically distinct from surrounding text
<disp-quote> elements have a relatively complex content model, but PLoS
appears to employ either <p>s or <list>s.
... | Extract or extended quoted passage from another work, usually made
typographically distinct from surrounding text
<disp-quote> elements have a relatively complex content model, but PLoS
appears to employ either <p>s or <list>s. | entailment |
def convert_boxed_text_elements(self):
"""
Textual material that is part of the body of text but outside the
flow of the narrative text, for example, a sidebar, marginalia, text
insert (whether enclosed in a box or not), caution, tip, note box, etc.
<boxed-text> elements for PLo... | Textual material that is part of the body of text but outside the
flow of the narrative text, for example, a sidebar, marginalia, text
insert (whether enclosed in a box or not), caution, tip, note box, etc.
<boxed-text> elements for PLoS appear to all contain a single <sec>
element whic... | entailment |
def convert_supplementary_material_elements(self):
"""
Supplementary material are not, nor are they generally expected to be,
packaged into the epub file. Though this is a technical possibility,
and certain epub reading systems (such as those run on a PC) might be
reasonably capa... | Supplementary material are not, nor are they generally expected to be,
packaged into the epub file. Though this is a technical possibility,
and certain epub reading systems (such as those run on a PC) might be
reasonably capable of the external handling of diverse file formats
I presume ... | entailment |
def fetch_single_representation(self, item_xlink_href):
"""
This function will render a formatted URL for accessing the PLoS' server
SingleRepresentation of an object.
"""
#A dict of URLs for PLoS subjournals
journal_urls = {'pgen': 'http://www.plosgenetics.org/article/{0... | This function will render a formatted URL for accessing the PLoS' server
SingleRepresentation of an object. | entailment |
def convert_fig_elements(self):
"""
Responsible for the correct conversion of JPTS 3.0 <fig> elements to
EPUB xhtml. Aside from translating <fig> to <img>, the content model
must be edited.
"""
for fig in self.main.getroot().findall('.//fig'):
if fig.getparent... | Responsible for the correct conversion of JPTS 3.0 <fig> elements to
EPUB xhtml. Aside from translating <fig> to <img>, the content model
must be edited. | entailment |
def convert_verse_group_elements(self):
"""
A song, poem, or verse
Implementorβs Note: No attempt has been made to retain the look or
visual form of the original poetry.
This unusual element, <verse-group> is used to convey poetry and is
recursive in nature (it may cont... | A song, poem, or verse
Implementorβs Note: No attempt has been made to retain the look or
visual form of the original poetry.
This unusual element, <verse-group> is used to convey poetry and is
recursive in nature (it may contain further <verse-group> elements).
Examples of the... | entailment |
def convert_fn_elements(self):
"""
<fn> elements may be used in the main text body outside of tables and
figures for purposes such as erratum notes. It appears that PLoS
practice is to not show erratum notes in the web or pdf formats after
the appropriate corrections have been ma... | <fn> elements may be used in the main text body outside of tables and
figures for purposes such as erratum notes. It appears that PLoS
practice is to not show erratum notes in the web or pdf formats after
the appropriate corrections have been made to the text. The erratum
notes are thus ... | entailment |
def convert_list_elements(self):
"""
A sequence of two or more items, which may or may not be ordered.
The <list> element has an optional <label> element and optional <title>
element, followed by one or more <list-item> elements. This is element
is recursive as the <list-item> e... | A sequence of two or more items, which may or may not be ordered.
The <list> element has an optional <label> element and optional <title>
element, followed by one or more <list-item> elements. This is element
is recursive as the <list-item> elements may contain further <list> or
<def-li... | entailment |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.