sentence1
stringlengths
52
3.87M
sentence2
stringlengths
1
47.2k
label
stringclasses
1 value
def convert_def_list_elements(self): """ A list in which each item consists of two parts: a word, phrase, term, graphic, chemical structure, or equation paired with one of more descriptions, discussions, explanations, or definitions of it. <def-list> elements are lists of <def-i...
A list in which each item consists of two parts: a word, phrase, term, graphic, chemical structure, or equation paired with one of more descriptions, discussions, explanations, or definitions of it. <def-list> elements are lists of <def-item> elements which are in turn composed of a pai...
entailment
def convert_ref_list_elements(self): """ List of references (citations) for an article, which is often called “References”, “Bibliography”, or “Additional Reading”. No distinction is made between lists of cited references and lists of suggested references. This method s...
List of references (citations) for an article, which is often called “References”, “Bibliography”, or “Additional Reading”. No distinction is made between lists of cited references and lists of suggested references. This method should not be confused with the method(s) employed for the...
entailment
def convert_table_wrap_elements(self): """ Responsible for the correct conversion of JPTS 3.0 <table-wrap> elements to EPUB content. The 'id' attribute is treated as mandatory by this method. """ for table_wrap in self.main.getroot().findall('.//table-wrap'): ...
Responsible for the correct conversion of JPTS 3.0 <table-wrap> elements to EPUB content. The 'id' attribute is treated as mandatory by this method.
entailment
def convert_graphic_elements(self): """ This is a method for the odd special cases where <graphic> elements are standalone, or rather, not a part of a standard graphical element such as a figure or a table. This method should always be employed after the standard cases have alrea...
This is a method for the odd special cases where <graphic> elements are standalone, or rather, not a part of a standard graphical element such as a figure or a table. This method should always be employed after the standard cases have already been handled.
entailment
def getChargeInfo(self, CorpNum, MsgType, UserID=None): """ 과금정보 확인 args CorpNum : 회원 사업자번호 MsgType : 문자전송 유형 UserID : 팝빌 회원아이디 return 과금정보 객체 raise PopbillException """ ...
과금정보 확인 args CorpNum : 회원 사업자번호 MsgType : 문자전송 유형 UserID : 팝빌 회원아이디 return 과금정보 객체 raise PopbillException
entailment
def sendSMS_multi(self, CorpNum, Sender, Contents, Messages, reserveDT, adsYN=False, UserID=None, RequestNum=None): """ 단문 문자메시지 다량전송 args CorpNum : 팝빌회원 사업자번호 Sender : 발신자번호 (동보전송용) Contents : 문자 내용 (동보전송용) Messages : 개별전송정보 배열 ...
단문 문자메시지 다량전송 args CorpNum : 팝빌회원 사업자번호 Sender : 발신자번호 (동보전송용) Contents : 문자 내용 (동보전송용) Messages : 개별전송정보 배열 reserveDT : 예약전송시간 (형식. yyyyMMddHHmmss) UserID : 팝빌회원 아이디 RequestNum : 전송요청번호 ...
entailment
def sendLMS(self, CorpNum, Sender, Receiver, ReceiverName, Subject, Contents, reserveDT, adsYN=False, UserID=None, SenderName=None, RequestNum=None): """ 장문 문자메시지 단건 전송 args CorpNum : 팝빌회원 사업자번호 Sender : 발신번호 Receiver : 수신번호 ...
장문 문자메시지 단건 전송 args CorpNum : 팝빌회원 사업자번호 Sender : 발신번호 Receiver : 수신번호 ReceiverName : 수신자명 Subject : 메시지 제목 Contents : 메시지 내용(2000Byte 초과시 길이가 조정되어 전송됨) reserveDT : 예약전송시간 (형식. yyyyMMddHHm...
entailment
def sendLMS_multi(self, CorpNum, Sender, Subject, Contents, Messages, reserveDT, adsYN=False, UserID=None, RequestNum=None): """ 장문 문자메시지 다량전송 args CorpNum : 팝빌회원 사업자번호 Sender : 발신자번호 (동보전송용) Subject : 장문 메시지 제목 (동보전송용) ...
장문 문자메시지 다량전송 args CorpNum : 팝빌회원 사업자번호 Sender : 발신자번호 (동보전송용) Subject : 장문 메시지 제목 (동보전송용) Contents : 장문 문자 내용 (동보전송용) Messages : 개별전송정보 배열 reserveDT : 예약시간 (형식. yyyyMMddHHmmss) UserID : 팝...
entailment
def sendMMS_Multi(self, CorpNum, Sender, Subject, Contents, Messages, FilePath, reserveDT, adsYN=False, UserID=None, RequestNum=None): """ 멀티 문자메시지 다량 전송 args CorpNum : 팝빌회원 사업자번호 Sender : 발신자번호 (동보전송용) Subject : 장문 메시지 제목 (...
멀티 문자메시지 다량 전송 args CorpNum : 팝빌회원 사업자번호 Sender : 발신자번호 (동보전송용) Subject : 장문 메시지 제목 (동보전송용) Contents : 장문 문자 내용 (동보전송용) Messages : 개별전송정보 배열 FilePath : 전송하고자 하는 파일 경로 reserveDT : 예약전송시간 (형...
entailment
def sendMessage(self, MsgType, CorpNum, Sender, SenderName, Subject, Contents, Messages, reserveDT, adsYN=False, UserID=None, RequestNum=None): """ 문자 메시지 전송 args MsgType : 문자 전송 유형(단문:SMS, 장문:LMS, 단/장문:XMS) CorpNum : 팝빌회원 사업자번호 ...
문자 메시지 전송 args MsgType : 문자 전송 유형(단문:SMS, 장문:LMS, 단/장문:XMS) CorpNum : 팝빌회원 사업자번호 Sender : 발신자번호 (동보전송용) Subject : 장문 메시지 제목 (동보전송용) Contents : 장문 문자 내용 (동보전송용) Messages : 개별전송정보 배열 reserve...
entailment
def getMessages(self, CorpNum, ReceiptNum, UserID=None): """ 문자 전송결과 조회 args CorpNum : 팝빌회원 사업자번호 ReceiptNum : 전송요청시 발급받은 접수번호 UserID : 팝빌회원 아이디 return 전송정보 as list raise PopbillException...
문자 전송결과 조회 args CorpNum : 팝빌회원 사업자번호 ReceiptNum : 전송요청시 발급받은 접수번호 UserID : 팝빌회원 아이디 return 전송정보 as list raise PopbillException
entailment
def getMessagesRN(self, CorpNum, RequestNum, UserID=None): """ 문자 전송결과 조회 args CorpNum : 팝빌회원 사업자번호 RequestNum : 전송요청시 할당한 전송요청번호 UserID : 팝빌회원 아이디 return 전송정보 as list raise PopbillExcept...
문자 전송결과 조회 args CorpNum : 팝빌회원 사업자번호 RequestNum : 전송요청시 할당한 전송요청번호 UserID : 팝빌회원 아이디 return 전송정보 as list raise PopbillException
entailment
def cancelReserveRN(self, CorpNum, RequestNum, UserID=None): """ 문자 예약전송 취소 args CorpNum : 팝빌회원 사업자번호 RequestNum : 전송요청시 할당한 전송요청번호 UserID : 팝빌회원 아이디 return 처리결과. consist of code and message raise ...
문자 예약전송 취소 args CorpNum : 팝빌회원 사업자번호 RequestNum : 전송요청시 할당한 전송요청번호 UserID : 팝빌회원 아이디 return 처리결과. consist of code and message raise PopbillException
entailment
def getURL(self, CorpNum, UserID, ToGo): """ 문자 관련 팝빌 URL args CorpNum : 팝빌회원 사업자번호 UserID : 팝빌회원 아이디 TOGO : BOX (전송내역조회 팝업) return 팝빌 URL raise PopbillException """ if ...
문자 관련 팝빌 URL args CorpNum : 팝빌회원 사업자번호 UserID : 팝빌회원 아이디 TOGO : BOX (전송내역조회 팝업) return 팝빌 URL raise PopbillException
entailment
def getStates(self, Corpnum, reciptNumList, UserID=None): """ 전송내역 요약정보 확인 args CorpNum : 팝빌회원 사업자번호 reciptNumList : 문자전송 접수번호 배열 UserID : 팝빌회원 아이디 return 전송정보 as list raise PopbillExcept...
전송내역 요약정보 확인 args CorpNum : 팝빌회원 사업자번호 reciptNumList : 문자전송 접수번호 배열 UserID : 팝빌회원 아이디 return 전송정보 as list raise PopbillException
entailment
def funcGauss1D(x, mu, sig): """ Create 1D Gaussian. Source: http://mathworld.wolfram.com/GaussianFunction.html """ arrOut = np.exp(-np.power((x - mu)/sig, 2.)/2) # normalize arrOut = arrOut/(np.sqrt(2.*np.pi)*sig) return arrOut
Create 1D Gaussian. Source: http://mathworld.wolfram.com/GaussianFunction.html
entailment
def absolute_path(user_path): """ Some paths must be made absolute, this will attempt to convert them. """ if os.path.abspath(user_path): return unix_path_coercion(user_path) else: try: openaccess_epub.utils.evaluate_relative_path(relative=user_path) except: ...
Some paths must be made absolute, this will attempt to convert them.
entailment
def configure(default=None, dev=None): """ The inner control loops for user interaction during quickstart configuration. """ cache_loc = openaccess_epub.utils.cache_location() config_loc = openaccess_epub.utils.config_location() #Make the cache directory openaccess_epub.utils.mkdir_p(ca...
The inner control loops for user interaction during quickstart configuration.
entailment
def getCertificateExpireDate(self, CorpNum): """ 공인인증서 만료일 확인, 등록여부 확인용도로 활용가능 args CorpNum : 확인할 회원 사업자번호 return 등록시 만료일자, 미등록시 해당 PopbillException raise. raise PopbillException """ result = self._httpget('/Taxi...
공인인증서 만료일 확인, 등록여부 확인용도로 활용가능 args CorpNum : 확인할 회원 사업자번호 return 등록시 만료일자, 미등록시 해당 PopbillException raise. raise PopbillException
entailment
def checkMgtKeyInUse(self, CorpNum, MgtKeyType, MgtKey): """ 파트너 관리번호 사용중 여부 확인. args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 return 사용중 여부 by True/False raise ...
파트너 관리번호 사용중 여부 확인. args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 return 사용중 여부 by True/False raise PopbillException
entailment
def register(self, CorpNum, taxinvoice, writeSpecification=False, UserID=None): """ 임시저장 args CorpNum : 회원 사업자 번호 taxinvoice : 등록할 세금계산서 object. Made with Taxinvoice(...) writeSpecification : 등록시 거래명세서 동시 작성 여부 UserID : 팝빌 회원아이디 ...
임시저장 args CorpNum : 회원 사업자 번호 taxinvoice : 등록할 세금계산서 object. Made with Taxinvoice(...) writeSpecification : 등록시 거래명세서 동시 작성 여부 UserID : 팝빌 회원아이디 return 처리결과. consist of code and message raise ...
entailment
def registIssue(self, CorpNum, taxinvoice, writeSpecification=False, forceIssue=False, dealInvoiceMgtKey=None, memo=None, emailSubject=None, UserID=None): """ 즉시 발행 args CorpNum : 팝빌회원 사업자번호 taxinvoice : 세금계산서 객체 writeSpecification ...
즉시 발행 args CorpNum : 팝빌회원 사업자번호 taxinvoice : 세금계산서 객체 writeSpecification : 거래명세서 동시작성 여부 forceIssue : 지연발행 강제여부 dealInvoiceMgtKey : 거래명세서 문서관리번호 memo : 메모 emailSubject : 메일제목, 미기재시 기본제목으로 전송 ...
entailment
def update(self, CorpNum, MgtKeyType, MgtKey, taxinvoice, writeSpecification=False, UserID=None): """ 수정 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 taxinvoice : 수정할 세금계산서 object. Made...
수정 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 taxinvoice : 수정할 세금계산서 object. Made with Taxinvoice(...) writeSpecification : 등록시 거래명세서 동시 작성 여부 UserID : 팝빌 회원아이...
entailment
def getInfo(self, CorpNum, MgtKeyType, MgtKey): """ 상태정보 확인 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 return 처리결과. consist of code and message raise ...
상태정보 확인 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 return 처리결과. consist of code and message raise PopbillException
entailment
def getDetailInfo(self, CorpNum, MgtKeyType, MgtKey): """ 상세정보 확인 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 return 처리결과. consist of code and message raise ...
상세정보 확인 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 return 처리결과. consist of code and message raise PopbillException
entailment
def delete(self, CorpNum, MgtKeyType, MgtKey, UserID=None): """ 삭제 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 UserID : 팝빌 회원아이디 return 처리결과. consist of cod...
삭제 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 UserID : 팝빌 회원아이디 return 처리결과. consist of code and message raise PopbillException
entailment
def send(self, CorpNum, MgtKeyType, MgtKey, Memo=None, EmailSubject=None, UserID=None): """ 승인요청 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 Memo : 처리 메모 UserID : 팝빌 회원...
승인요청 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 Memo : 처리 메모 UserID : 팝빌 회원아이디 return 처리결과. consist of code and message raise ...
entailment
def cancelSend(self, CorpNum, MgtKeyType, MgtKey, Memo=None, UserID=None): """ 승인요청 취소 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 Memo : 처리 메모 UserID : 팝빌 회원아이디 ...
승인요청 취소 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 Memo : 처리 메모 UserID : 팝빌 회원아이디 return 처리결과. consist of code and message raise ...
entailment
def issue(self, CorpNum, MgtKeyType, MgtKey, Memo=None, EmailSubject=None, ForceIssue=False, UserID=None): """ 발행 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 Memo : 처리 메모 ...
발행 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 Memo : 처리 메모 EmailSubject : 발행메일 이메일 제목 ForceIssue : 지연발행 세금계산서 강제발행 여부. UserID : 팝빌 회원아이디 ...
entailment
def registRequest(self, CorpNum, taxinvoice, memo=None, UserID=None): """ 즉시 요청 args CorpNum : 팝빌회원 사업자번호 taxinvoice : 세금계산서 객체 memo : 메모 UsreID : 팝빌회원 아이디 return 검색결과 정보 raise Pop...
즉시 요청 args CorpNum : 팝빌회원 사업자번호 taxinvoice : 세금계산서 객체 memo : 메모 UsreID : 팝빌회원 아이디 return 검색결과 정보 raise PopbillException
entailment
def sendToNTS(self, CorpNum, MgtKeyType, MgtKey, UserID=None): """ 국세청 즉시전송 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 UserID : 팝빌 회원아이디 return 처리결과. consi...
국세청 즉시전송 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 UserID : 팝빌 회원아이디 return 처리결과. consist of code and message raise PopbillException
entailment
def getLogs(self, CorpNum, MgtKeyType, MgtKey): """ 세금계산서 문서이력 목록 확인 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 return 문서이력 정보 목록 as List raise ...
세금계산서 문서이력 목록 확인 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 return 문서이력 정보 목록 as List raise PopbillException
entailment
def getFiles(self, CorpNum, MgtKeyType, MgtKey): """ 첨부파일 목록 확인 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 return 첩부파일 정보 목록 as List raise Popb...
첨부파일 목록 확인 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 return 첩부파일 정보 목록 as List raise PopbillException
entailment
def deleteFile(self, CorpNum, MgtKeyType, MgtKey, FileID, UserID=None): """ 첨부파일 삭제 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 UserID : 팝빌 회원아이디 return 처리결...
첨부파일 삭제 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKey : 파트너 관리번호 UserID : 팝빌 회원아이디 return 처리결과. consist of code and message raise PopbillException
entailment
def getMassPrintURL(self, CorpNum, MgtKeyType, MgtKeyList, UserID=None): """ 다량 인쇄 URL 확인 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKeyList : 파트너 관리번호 목록 UserID : 팝빌 회원아이디 return ...
다량 인쇄 URL 확인 args CorpNum : 회원 사업자 번호 MgtKeyType : 관리번호 유형 one of ['SELL','BUY','TRUSTEE'] MgtKeyList : 파트너 관리번호 목록 UserID : 팝빌 회원아이디 return 팝빌 URL as str raise PopbillException
entailment
def search(self, CorpNum, MgtKeyType, DType, SDate, EDate, State, Type, TaxType, LateOnly, TaxRegIDYN, TaxRegIDType, TaxRegID, Page, PerPage, Order, UserID=None, QString=None, InterOPYN=None, IssueType=None): """ 목록 조회 args CorpNum : 팝빌회원 사업자번호 MgtKeyTy...
목록 조회 args CorpNum : 팝빌회원 사업자번호 MgtKeyType : 세금계산서유형, SELL-매출, BUY-매입, TRUSTEE-위수탁 DType : 일자유형, R-등록일시, W-작성일자, I-발행일시 중 택 1 SDate : 시작일자, 표시형식(yyyyMMdd) EDate : 종료일자, 표시형식(yyyyMMdd) State : 상태코드, 2,3번째 자리에 와일드카...
entailment
def attachStatement(self, CorpNum, MgtKeyType, MgtKey, ItemCode, StmtMgtKey, UserID=None): """ 전자명세서 첨부 args CorpNum : 팝빌회원 사업자번호 MgtKeyType : 세금계산서 유형, SELL-매출, BUY-매입, TRUSTEE-위수탁 MgtKey : 세금계산서 문서관리번호 StmtCode : 명세서 종류코드, 121-명세서, 12...
전자명세서 첨부 args CorpNum : 팝빌회원 사업자번호 MgtKeyType : 세금계산서 유형, SELL-매출, BUY-매입, TRUSTEE-위수탁 MgtKey : 세금계산서 문서관리번호 StmtCode : 명세서 종류코드, 121-명세서, 122-청구서, 123-견적서, 124-발주서 125-입금표, 126-영수증 StmtMgtKey : 전자명세서 문서관리번호 User...
entailment
def assignMgtKey(self, CorpNum, MgtKeyType, ItemKey, MgtKey, UserID=None): """ 관리번호할당 args CorpNum : 팝빌회원 사업자번호 MgtKeyType : 세금계산서 유형, SELL-매출, BUY-매입, TRUSTEE-위수탁 ItemKey : 아이템키 (Search API로 조회 가능) MgtKey : 세금계산서에 할당할 파트너 관리 번호 ...
관리번호할당 args CorpNum : 팝빌회원 사업자번호 MgtKeyType : 세금계산서 유형, SELL-매출, BUY-매입, TRUSTEE-위수탁 ItemKey : 아이템키 (Search API로 조회 가능) MgtKey : 세금계산서에 할당할 파트너 관리 번호 UserID : 팝빌회원 아이디 return 처리결과. consist of code and...
entailment
def getSealURL(self, CorpNum, UserID): """ 팝빌 인감 및 첨부문서 등록 URL args CorpNum : 회원 사업자번호 UserID : 회원 팝빌아이디 return 30초 보안 토큰을 포함한 url raise PopbillException """ result = self._httpget('/?TG=SEAL', C...
팝빌 인감 및 첨부문서 등록 URL args CorpNum : 회원 사업자번호 UserID : 회원 팝빌아이디 return 30초 보안 토큰을 포함한 url raise PopbillException
entailment
def getTaxCertURL(self, CorpNum, UserID): """ 공인인증서 등록 URL args CorpNum : 회원 사업자번호 UserID : 회원 팝빌아이디 return 30초 보안 토큰을 포함한 url raise PopbillException """ result = self._httpget('/?TG=CERT', CorpN...
공인인증서 등록 URL args CorpNum : 회원 사업자번호 UserID : 회원 팝빌아이디 return 30초 보안 토큰을 포함한 url raise PopbillException
entailment
def encloses(self, location: FileLocation ) -> Optional[FunctionDesc]: """ Returns the function, if any, that encloses a given location. """ for func in self.in_file(location.filename): if location in func.location: return fun...
Returns the function, if any, that encloses a given location.
entailment
def in_file(self, filename: str) -> Iterator[FunctionDesc]: """ Returns an iterator over all of the functions definitions that are contained within a given file. """ yield from self.__filename_to_functions.get(filename, [])
Returns an iterator over all of the functions definitions that are contained within a given file.
entailment
def model_creation_opt(dicCnfg, aryMdlParams, strPathHrf=None, varRat=None, lgcPrint=True): """ Create or load pRF model time courses. Parameters ---------- dicCnfg : dict Dictionary containing config parameters. aryMdlParams : numpy arrays x, y and sigma ...
Create or load pRF model time courses. Parameters ---------- dicCnfg : dict Dictionary containing config parameters. aryMdlParams : numpy arrays x, y and sigma parameters. strPathHrf : str or None: Path to npy file with custom hrf parameters. If None, default paramet...
entailment
def parse_config(args): """ Try to load config, to load other journal locations Otherwise, return default location Returns journal location """ # Try user config or return default location early config_path = path.expanduser(args.config_file) if not path.exists(config_path): # C...
Try to load config, to load other journal locations Otherwise, return default location Returns journal location
entailment
def record_entries(journal_location, entries): """ args entry - list of entries to record """ check_journal_dest(journal_location) current_date = datetime.datetime.today() date_header = current_date.strftime("%a %H:%M:%S %Y-%m-%d") + "\n" with open(build_journal_path(journal_location, cu...
args entry - list of entries to record
entailment
def get_entry(journal_location, date): """ args date - date object returns entry text or None if entry doesn't exist """ if not isinstance(date, datetime.date): return None try: with open(build_journal_path(journal_location, date), "r") as entry_file: return entry...
args date - date object returns entry text or None if entry doesn't exist
entailment
def replace( fname1, fname2, dfilter1, dfilter2, has_header1=True, has_header2=True, frow1=0, frow2=0, ofname=None, ocols=None, ): r""" Replace data in one file with data from another file. :param fname1: Name of the input comma-separated values file, the file ...
r""" Replace data in one file with data from another file. :param fname1: Name of the input comma-separated values file, the file that contains the columns to be replaced :type fname1: FileNameExists_ :param fname2: Name of the replacement comma-separated values file, the ...
entailment
def spmt(t, peak_delay=6, under_delay=16, peak_disp=1, under_disp=1, p_u_ratio=6): """Normalized SPM HRF function from sum of two gamma PDFs Parameters ---------- t : array-like vector of times at which to sample HRF Returns ------- hrf : array vector length ``len(...
Normalized SPM HRF function from sum of two gamma PDFs Parameters ---------- t : array-like vector of times at which to sample HRF Returns ------- hrf : array vector length ``len(t)`` of samples from HRF at times `t` Notes ----- [1] This is the canonical HRF functi...
entailment
def dspmt(t, peak_delay=6, under_delay=16, peak_disp=1, under_disp=1, p_u_ratio=6): """ SPM canonical HRF derivative, HRF derivative values for time values `t` Parameters ---------- t : array-like vector of times at which to sample HRF Returns ------- hrf : array ...
SPM canonical HRF derivative, HRF derivative values for time values `t` Parameters ---------- t : array-like vector of times at which to sample HRF Returns ------- hrf : array vector length ``len(t)`` of samples from HRF at times `t` Notes ----- [1] This is the can...
entailment
def ddspmt(t, peak_delay=6, under_delay=16, peak_disp=1, under_disp=1, p_u_ratio=6): """ SPM canonical HRF dispersion derivative, values for time values `t` Parameters ---------- t : array-like vector of times at which to sample HRF Returns ------- hrf : array ve...
SPM canonical HRF dispersion derivative, values for time values `t` Parameters ---------- t : array-like vector of times at which to sample HRF Returns ------- hrf : array vector length ``len(t)`` of samples from HRF at times `t` Notes ----- [1] This is the canonic...
entailment
def create_boxcar(aryCnd, aryOns, aryDrt, varTr, varNumVol, aryExclCnd=None, varTmpOvsmpl=1000.): """ Creation of condition time courses in temporally upsampled space. Parameters ---------- aryCnd : np.array 1D array with condition identifiers (every condition has its own...
Creation of condition time courses in temporally upsampled space. Parameters ---------- aryCnd : np.array 1D array with condition identifiers (every condition has its own int) aryOns : np.array, same len as aryCnd 1D array with condition onset times in seconds. aryDrt : np.array, s...
entailment
def cnvl_tc(idxPrc, aryPrfTcChunk, lstHrf, varTr, varNumVol, varTmpOvsmpl, queOut, varHrfLen=32., dctPrm=None): """Convolution of time courses with HRF model. Parameters ---------- idxPrc : int, positive Process ID of the process calling this function (for CPU multi-threadin...
Convolution of time courses with HRF model. Parameters ---------- idxPrc : int, positive Process ID of the process calling this function (for CPU multi-threading). In GPU version, this parameter is 0 (just one thread on CPU). aryPrfTcChunk : np.array 2D array with model ...
entailment
def create_inputs_to_reference(job_data, input_files, input_directories): """ Creates a dictionary with the summarized information in job_data, input_files and input_directories :param job_data: The job data specifying input parameters other than files and directories. :param input_files: A dictionary ...
Creates a dictionary with the summarized information in job_data, input_files and input_directories :param job_data: The job data specifying input parameters other than files and directories. :param input_files: A dictionary describing the input files. :param input_directories: A dictionary describing the ...
entailment
def _partition_all_internal(s, sep): """ Uses str.partition() to split every occurrence of sep in s. The returned list does not contain empty strings. :param s: The string to split. :param sep: A separator string. :return: A list of parts split by sep """ parts = list(s.partition(sep)) ...
Uses str.partition() to split every occurrence of sep in s. The returned list does not contain empty strings. :param s: The string to split. :param sep: A separator string. :return: A list of parts split by sep
entailment
def partition_all(s, sep): """ Uses str.partition() to split every occurrence of sep in s. The returned list does not contain empty strings. If sep is a list, all separators are evaluated. :param s: The string to split. :param sep: A separator string or a list of separator strings. :return: A l...
Uses str.partition() to split every occurrence of sep in s. The returned list does not contain empty strings. If sep is a list, all separators are evaluated. :param s: The string to split. :param sep: A separator string or a list of separator strings. :return: A list of parts split by sep
entailment
def split_input_references(to_split): """ Returns the given string in normal strings and unresolved input references. An input reference is identified as something of the following form $(...). Example: split_input_reference("a$(b)cde()$(fg)") == ["a", "$(b)", "cde()", "$(fg)"] :param to_split...
Returns the given string in normal strings and unresolved input references. An input reference is identified as something of the following form $(...). Example: split_input_reference("a$(b)cde()$(fg)") == ["a", "$(b)", "cde()", "$(fg)"] :param to_split: The string to split :raise InvalidInputRefer...
entailment
def split_all(reference, sep): """ Splits a given string at a given separator or list of separators. :param reference: The reference to split. :param sep: Separator string or list of separator strings. :return: A list of split strings """ parts = partition_all(reference, sep) return [p ...
Splits a given string at a given separator or list of separators. :param reference: The reference to split. :param sep: Separator string or list of separator strings. :return: A list of split strings
entailment
def _resolve_file(attributes, input_file, input_identifier, input_reference): """ Returns the attributes in demand of the input file. :param attributes: A list of attributes to get from the input_file. :param input_file: The file from which to get the attributes. :param input_identifier: The input ...
Returns the attributes in demand of the input file. :param attributes: A list of attributes to get from the input_file. :param input_file: The file from which to get the attributes. :param input_identifier: The input identifier of the given file. :param input_reference: The reference string :return...
entailment
def _resolve_directory(attributes, input_directory, input_identifier, input_reference): """ Returns the attributes in demand of the input directory. :param attributes: A list of attributes to get from the input directory. :param input_directory: The directory from which to get the attributes. :para...
Returns the attributes in demand of the input directory. :param attributes: A list of attributes to get from the input directory. :param input_directory: The directory from which to get the attributes. :param input_identifier: The input identifier of the given directory. :param input_reference: The ref...
entailment
def resolve_input_reference(reference, inputs_to_reference): """ Replaces a given input_reference by a string extracted from inputs_to_reference. :param reference: The input reference to resolve. :param inputs_to_reference: A dictionary containing information about the given inputs. :raise Invalid...
Replaces a given input_reference by a string extracted from inputs_to_reference. :param reference: The input reference to resolve. :param inputs_to_reference: A dictionary containing information about the given inputs. :raise InvalidInputReference: If the given input reference could not be resolved. ...
entailment
def resolve_input_references(to_resolve, inputs_to_reference): """ Resolves input references given in the string to_resolve by using the inputs_to_reference. See http://www.commonwl.org/user_guide/06-params/index.html for more information. Example: "$(inputs.my_file.nameroot).md" -> "filename.md" ...
Resolves input references given in the string to_resolve by using the inputs_to_reference. See http://www.commonwl.org/user_guide/06-params/index.html for more information. Example: "$(inputs.my_file.nameroot).md" -> "filename.md" :param to_resolve: The path to match :param inputs_to_reference: I...
entailment
def data(self): """ Returns a dictionnary containing all the passed data and an item ``error_list`` which holds the result of :attr:`error_list`. """ res = {'error_list': self.error_list} res.update(super(ValidationErrors, self).data) return res
Returns a dictionnary containing all the passed data and an item ``error_list`` which holds the result of :attr:`error_list`.
entailment
def circDiff(length, ary1, ary2): """calculate the circular difference between two paired arrays. This function will return the difference between pairs of numbers; however the difference that is output will be minimal in the sense that if we assume an array with length = 4: [0, 1, 2, 3], the difference...
calculate the circular difference between two paired arrays. This function will return the difference between pairs of numbers; however the difference that is output will be minimal in the sense that if we assume an array with length = 4: [0, 1, 2, 3], the difference between 0 and 3 will not be 3, but 1...
entailment
def getPartnerURL(self, CorpNum, TOGO): """ 팝빌 회원 잔여포인트 확인 args CorpNum : 팝빌회원 사업자번호 TOGO : "CHRG" return URL raise PopbillException """ try: return linkhub.getPartnerURL(self._getToke...
팝빌 회원 잔여포인트 확인 args CorpNum : 팝빌회원 사업자번호 TOGO : "CHRG" return URL raise PopbillException
entailment
def getBalance(self, CorpNum): """ 팝빌 회원 잔여포인트 확인 args CorpNum : 확인하고자 하는 회원 사업자번호 return 잔여포인트 by float raise PopbillException """ try: return linkhub.getBalance(self._getToken(CorpNum)) exce...
팝빌 회원 잔여포인트 확인 args CorpNum : 확인하고자 하는 회원 사업자번호 return 잔여포인트 by float raise PopbillException
entailment
def getAccessURL(self, CorpNum, UserID): """ 팝빌 로그인 URL args CorpNum : 회원 사업자번호 UserID : 회원 팝빌아이디 return 30초 보안 토큰을 포함한 url raise PopbillException """ result = self._httpget('/?TG=LOGIN', CorpNum...
팝빌 로그인 URL args CorpNum : 회원 사업자번호 UserID : 회원 팝빌아이디 return 30초 보안 토큰을 포함한 url raise PopbillException
entailment
def getChargeURL(self, CorpNum, UserID): """ 팝빌 연동회원 포인트 충전 URL args CorpNum : 회원 사업자번호 UserID : 회원 팝빌아이디 return 30초 보안 토큰을 포함한 url raise PopbillException """ result = self._httpget('/?TG=CHRG', ...
팝빌 연동회원 포인트 충전 URL args CorpNum : 회원 사업자번호 UserID : 회원 팝빌아이디 return 30초 보안 토큰을 포함한 url raise PopbillException
entailment
def checkIsMember(self, CorpNum): """ 회원가입여부 확인 args CorpNum : 회원 사업자번호 return 회원가입여부 True/False raise PopbillException """ if CorpNum == None or CorpNum == '': raise PopbillException(-99999999, "사업자번...
회원가입여부 확인 args CorpNum : 회원 사업자번호 return 회원가입여부 True/False raise PopbillException
entailment
def joinMember(self, JoinInfo): """ 팝빌 회원가입 args JoinInfo : 회원가입정보. Reference JoinForm class return 처리결과. consist of code and message raise PopbillException """ JoinInfo.LinkID = self.__linkID postData = ...
팝빌 회원가입 args JoinInfo : 회원가입정보. Reference JoinForm class return 처리결과. consist of code and message raise PopbillException
entailment
def updateContact(self, CorpNum, ContactInfo, UserID=None): """ 담당자 정보 수정 args CorpNum : 회원 사업자번호 ContactInfo : 담당자 정보, Reference ContactInfo class UserID : 회원 아이디 return 처리결과. consist of code and message raise ...
담당자 정보 수정 args CorpNum : 회원 사업자번호 ContactInfo : 담당자 정보, Reference ContactInfo class UserID : 회원 아이디 return 처리결과. consist of code and message raise PopbillException
entailment
def updateCorpInfo(self, CorpNum, CorpInfo, UserID=None): """ 담당자 정보 수정 args CorpNum : 회원 사업자번호 CorpInfo : 회사 정보, Reference CorpInfo class UserID : 회원 아이디 return 처리결과. consist of code and message raise ...
담당자 정보 수정 args CorpNum : 회원 사업자번호 CorpInfo : 회사 정보, Reference CorpInfo class UserID : 회원 아이디 return 처리결과. consist of code and message raise PopbillException
entailment
def registContact(self, CorpNum, ContactInfo, UserID=None): """ 담당자 추가 args CorpNum : 회원 사업자번호 ContactInfo : 담당자 정보, Reference ContactInfo class UserID : 회원 아이디 return 처리결과. consist of code and message raise ...
담당자 추가 args CorpNum : 회원 사업자번호 ContactInfo : 담당자 정보, Reference ContactInfo class UserID : 회원 아이디 return 처리결과. consist of code and message raise PopbillException
entailment
def TemplateValidator(value): """Try to compile a string into a Django template""" try: Template(value) except Exception as e: raise ValidationError( _("Cannot compile template (%(exception)s)"), params={"exception": e} )
Try to compile a string into a Django template
entailment
def merge( fname1, fname2, dfilter1=None, dfilter2=None, has_header1=True, has_header2=True, frow1=0, frow2=0, ofname=None, ocols=None, ): r""" Merge two comma-separated values files. Data columns from the second file are appended after data columns from the firs...
r""" Merge two comma-separated values files. Data columns from the second file are appended after data columns from the first file. Empty values in columns are used if the files have different number of rows :param fname1: Name of the first comma-separated values file, the file ...
entailment
def pyprf_opt_brute(strCsvCnfg, objNspc, lgcTest=False, strPathHrf=None, varRat=None): """ Function for optimizing given pRF paramaters using brute-force grid search. Parameters ---------- strCsvCnfg : str Absolute file path of config file. objNspc : object N...
Function for optimizing given pRF paramaters using brute-force grid search. Parameters ---------- strCsvCnfg : str Absolute file path of config file. objNspc : object Name space from command line arguments. lgcTest : Boolean Whether this is a test (pytest). If yes, absolute ...
entailment
def get_lbry_api_function_docs(url=LBRY_API_RAW_JSON_URL): """ Scrapes the given URL to a page in JSON format to obtain the documentation for the LBRY API :param str url: URL to the documentation we need to obtain, pybry.constants.LBRY_API_RAW_JSON_URL by default :return: List of functions retrieved f...
Scrapes the given URL to a page in JSON format to obtain the documentation for the LBRY API :param str url: URL to the documentation we need to obtain, pybry.constants.LBRY_API_RAW_JSON_URL by default :return: List of functions retrieved from the `url` given :rtype: list
entailment
def generate_method_definition(func): """ Generates the body for the given function :param dict func: dict of a JSON-Formatted function as defined by the API docs :return: A String containing the definition for the function as it should be written in code :rtype: str """ indent = 4 # initi...
Generates the body for the given function :param dict func: dict of a JSON-Formatted function as defined by the API docs :return: A String containing the definition for the function as it should be written in code :rtype: str
entailment
def generate_lbryd_wrapper(url=LBRY_API_RAW_JSON_URL, read_file=__LBRYD_BASE_FPATH__, write_file=LBRYD_FPATH): """ Generates the actual functions for lbryd_api.py based on lbry's documentation :param str url: URL to the documentation we need to obtain, pybry.constants.LBRY_API_RAW_JSON_URL by default ...
Generates the actual functions for lbryd_api.py based on lbry's documentation :param str url: URL to the documentation we need to obtain, pybry.constants.LBRY_API_RAW_JSON_URL by default :param str read_file: This is the path to the file from which we will be reading :param str write_file: Path from p...
entailment
def load_nii(strPathIn, varSzeThr=5000.0): """ Load nii file. Parameters ---------- strPathIn : str Path to nii file to load. varSzeThr : float If the nii file is larger than this threshold (in MB), the file is loaded volume-by-volume in order to prevent memory overflow....
Load nii file. Parameters ---------- strPathIn : str Path to nii file to load. varSzeThr : float If the nii file is larger than this threshold (in MB), the file is loaded volume-by-volume in order to prevent memory overflow. Default threshold is 1000 MB. Returns ...
entailment
def load_res_prm(lstFunc, lstFlsMsk=None): """Load result parameters from multiple nii files, with optional mask. Parameters ---------- lstFunc : list, list of str with file names of 3D or 4D nii files lstFlsMsk : list, optional list of str with paths to 3D nii files that can act as...
Load result parameters from multiple nii files, with optional mask. Parameters ---------- lstFunc : list, list of str with file names of 3D or 4D nii files lstFlsMsk : list, optional list of str with paths to 3D nii files that can act as mask/s Returns ------- lstPrmAry : li...
entailment
def export_nii(ary2dNii, lstNiiNames, aryLgcMsk, aryLgcVar, tplNiiShp, aryAff, hdrMsk, outFormat='3D'): """ Export nii file(s). Parameters ---------- ary2dNii : numpy array Numpy array with results to be exported to nii. lstNiiNames : list List that contains strin...
Export nii file(s). Parameters ---------- ary2dNii : numpy array Numpy array with results to be exported to nii. lstNiiNames : list List that contains strings with the complete file names. aryLgcMsk : numpy array If the nii file is larger than this threshold (in MB), the fil...
entailment
def joinRes(lstPrfRes, varPar, idxPos, inFormat='1D'): """Join results from different processing units (here cores). Parameters ---------- lstPrfRes : list Output of results from parallelization. varPar : integer, positive Number of cores that were used during parallelization id...
Join results from different processing units (here cores). Parameters ---------- lstPrfRes : list Output of results from parallelization. varPar : integer, positive Number of cores that were used during parallelization idxPos : integer, positive List position index that we e...
entailment
def cmp_res_R2(lstRat, lstNiiNames, strPathOut, strPathMdl, lgcSveMdlTc=True, lgcDel=False, strNmeExt=''): """"Compare results for different exponents and create winner nii. Parameters ---------- lstRat : list List of floats containing the ratios that were tested for surround ...
Compare results for different exponents and create winner nii. Parameters ---------- lstRat : list List of floats containing the ratios that were tested for surround suppression. lstNiiNames : list List of names of the different pRF maps (e.g. xpos, ypos, SD) strPathOut : st...
entailment
def map_crt_to_pol(aryXCrds, aryYrds): """Remap coordinates from cartesian to polar Parameters ---------- aryXCrds : 1D numpy array Array with x coordinate values. aryYrds : 1D numpy array Array with y coordinate values. Returns ------- aryTht : 1D numpy array A...
Remap coordinates from cartesian to polar Parameters ---------- aryXCrds : 1D numpy array Array with x coordinate values. aryYrds : 1D numpy array Array with y coordinate values. Returns ------- aryTht : 1D numpy array Angle of coordinates aryRad : 1D numpy arra...
entailment
def map_pol_to_crt(aryTht, aryRad): """Remap coordinates from polar to cartesian Parameters ---------- aryTht : 1D numpy array Angle of coordinates aryRad : 1D numpy array Radius of coordinates. Returns ------- aryXCrds : 1D numpy array Array with x coordinate v...
Remap coordinates from polar to cartesian Parameters ---------- aryTht : 1D numpy array Angle of coordinates aryRad : 1D numpy array Radius of coordinates. Returns ------- aryXCrds : 1D numpy array Array with x coordinate values. aryYrds : 1D numpy array ...
entailment
def find_near_pol_ang(aryEmpPlrAng, aryExpPlrAng): """Return index of nearest expected polar angle. Parameters ---------- aryEmpPlrAng : 1D numpy array Empirically found polar angle estimates aryExpPlrAng : 1D numpy array Theoretically expected polar angle estimates Returns ...
Return index of nearest expected polar angle. Parameters ---------- aryEmpPlrAng : 1D numpy array Empirically found polar angle estimates aryExpPlrAng : 1D numpy array Theoretically expected polar angle estimates Returns ------- aryXCrds : 1D numpy array Indices of ...
entailment
def rmp_rng(aryVls, varNewMin, varNewMax, varOldThrMin=None, varOldAbsMax=None): """Remap values in an array from one range to another. Parameters ---------- aryVls : 1D numpy array Array with values that need to be remapped. varNewMin : float Desired minimum value of ne...
Remap values in an array from one range to another. Parameters ---------- aryVls : 1D numpy array Array with values that need to be remapped. varNewMin : float Desired minimum value of new, remapped array. varNewMax : float Desired maximum value of new, remapped array. v...
entailment
def rmp_deg_pixel_xys(vecX, vecY, vecPrfSd, tplPngSize, varExtXmin, varExtXmax, varExtYmin, varExtYmax): """Remap x, y, sigma parameters from degrees to pixel. Parameters ---------- vecX : 1D numpy array Array with possible x parametrs in degree vecY : 1D numpy array ...
Remap x, y, sigma parameters from degrees to pixel. Parameters ---------- vecX : 1D numpy array Array with possible x parametrs in degree vecY : 1D numpy array Array with possible y parametrs in degree vecPrfSd : 1D numpy array Array with possible sd parametrs in degree ...
entailment
def cnvl_2D_gauss(idxPrc, aryMdlParamsChnk, arySptExpInf, tplPngSize, queOut, strCrd='crt'): """Spatially convolve input with 2D Gaussian model. Parameters ---------- idxPrc : int Process ID of the process calling this function (for CPU multi-threading). In GPU version...
Spatially convolve input with 2D Gaussian model. 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). aryMdlParamsChnk : 2d numpy array, shape [n_models, n_mode...
entailment
def process(self, checksum, revision=None): """ Process a new revision and detect a revert if it occurred. Note that you can pass whatever you like as `revision` and it will be returned in the case that a revert occurs. :Parameters: checksum : str An...
Process a new revision and detect a revert if it occurred. Note that you can pass whatever you like as `revision` and it will be returned in the case that a revert occurs. :Parameters: checksum : str Any identity-machable string-based hash of revision content ...
entailment
def main(): """pyprf_feature entry point.""" # %% Print Welcome message strWelcome = 'pyprf_feature ' + __version__ strDec = '=' * len(strWelcome) print(strDec + '\n' + strWelcome + '\n' + strDec) # %% Get list of input arguments # Create parser object: objParser = argparse.ArgumentP...
pyprf_feature entry point.
entailment
def funcSmthSpt(aryFuncChnk, varSdSmthSpt): """Apply spatial smoothing to the input data. Parameters ---------- aryFuncChnk : np.array TODO varSdSmthSpt : float (?) Extent of smoothing. Returns ------- aryFuncChnk : np.array Smoothed data. """ varNdim = a...
Apply spatial smoothing to the input data. Parameters ---------- aryFuncChnk : np.array TODO varSdSmthSpt : float (?) Extent of smoothing. Returns ------- aryFuncChnk : np.array Smoothed data.
entailment
def funcSmthTmp(aryFuncChnk, varSdSmthTmp): """Apply temporal smoothing to fMRI data & pRF time course models. Parameters ---------- aryFuncChnk : np.array TODO varSdSmthTmp : float (?) extend of smoothing Returns ------- aryFuncChnk : np.array TODO """ ...
Apply temporal smoothing to fMRI data & pRF time course models. Parameters ---------- aryFuncChnk : np.array TODO varSdSmthTmp : float (?) extend of smoothing Returns ------- aryFuncChnk : np.array TODO
entailment
def prep_models(aryPrfTc, varSdSmthTmp=2.0, lgcPrint=True): """ Prepare pRF model time courses. Parameters ---------- aryPrfTc : np.array 4D numpy array with pRF time course models, with following dimensions: `aryPrfTc[x-position, y-position, SD, volume]`. varSdSmthTmp : float ...
Prepare pRF model time courses. Parameters ---------- aryPrfTc : np.array 4D numpy array with pRF time course models, with following dimensions: `aryPrfTc[x-position, y-position, SD, volume]`. varSdSmthTmp : float Extent of temporal smoothing that is applied to functional data a...
entailment
def prep_func(strPathNiiMask, lstPathNiiFunc, varAvgThr=100., varVarThr=0.0001, strPrePro='demean'): """ Load & prepare functional data. Parameters ---------- strPathNiiMask: str Path to mask used to restrict pRF model finding. Only voxels with a value greater than zer...
Load & prepare functional data. Parameters ---------- strPathNiiMask: str Path to mask used to restrict pRF model finding. Only voxels with a value greater than zero in the mask are considered. lstPathNiiFunc : list List of paths of functional data (nii files). varAvgThr : f...
entailment
def get(self,style): """ what's the value of a style at the current stack level""" level = len(self.stack) -1 while level >= 0: if style in self.stack[level]: return self.stack[level][style] else: level = level - 1 return None
what's the value of a style at the current stack level
entailment
def enforce_type(self, attr, val): """converts a value to the attribute's type""" if not attr in self.types: return utfstr(val) elif self.types[attr] == 'int': return int(float(val)) elif self.types[attr] == 'float': return float(val) else: ...
converts a value to the attribute's type
entailment
def push(self, style={}): """push a new level on the stack with a style dictionnary containing style:value pairs""" _style = {} for attr in style: if attr in self.cmds and not style[attr] in self.cmds[attr]: print 'WARNING: ESC/POS PRINTING: ignoring invalid value: '+...
push a new level on the stack with a style dictionnary containing style:value pairs
entailment
def set(self, style={}): """overrides style values at the current stack level""" _style = {} for attr in style: if attr in self.cmds and not style[attr] in self.cmds[attr]: print 'WARNING: ESC/POS PRINTING: ignoring invalid value: '+utfstr(style[attr])+' for style: '+...
overrides style values at the current stack level
entailment
def to_escpos(self): """ converts the current style to an escpos command string """ cmd = '' ordered_cmds = self.cmds.keys() ordered_cmds.sort(lambda x,y: cmp(self.cmds[x]['_order'], self.cmds[y]['_order'])) for style in ordered_cmds: cmd += self.cmds[style][self.get(...
converts the current style to an escpos command string
entailment