prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>configure.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import glob, os, sys import sipconfig from PyQt4 import pyqtconfig def get_diana_version(): depends = filter(lambda line: line.startswith("Depends:"), open("debian/control").readlines()) for line in depends...
makefile.extra_include_dirs += [ diana_inc_dir, os.path.join(diana_inc_dir, "PaintGL"), metlibs_inc_dir, qt_pkg_dir+"/include" ] makefile.extra_lib_dirs += [diana_lib_dir, qt_pkg_dir+"/lib"] ...
<|file_name|>configure.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import glob, os, sys import sipconfig from PyQt4 import pyqtconfig def get_diana_version(): depends = filter(lambda line: line.startswith("Depends:"), open("debian/control").readlines()) for line in depends...
makefile.extra_include_dirs.append(diana_inc_dir) makefile.extra_include_dirs.append("/usr/include/metlibs") makefile.extra_lib_dirs += [diana_lib_dir, "/usr/lib", metlibs_lib_dir, qt_pkg_dir+"/lib"] makefile.extra_lflags += ["-Wl,-rpath="+diana_lib_dir, "-W...
<|file_name|>configure.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import glob, os, sys import sipconfig from PyQt4 import pyqtconfig def get_diana_version(): depends = filter(lambda line: line.startswith("Depends:"), open("debian/control").readlines()) for line in depends...
sys.stderr.write("Failed to find version information for Diana (%s) " "or python-diana (%s)\n" % (repr(diana_version), repr(python_diana_version))) sys.exit(1)
<|file_name|>configure.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import glob, os, sys import sipconfig from PyQt4 import pyqtconfig def <|fim_middle|>(): depends = filter(lambda line: line.startswith("Depends:"), open("debian/control").readlines()) for line in depends: ...
get_diana_version
<|file_name|>configure.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import glob, os, sys import sipconfig from PyQt4 import pyqtconfig def get_diana_version(): depends = filter(lambda line: line.startswith("Depends:"), open("debian/control").readlines()) for line in depends...
get_python_diana_version
<|file_name|>problem_94.py<|end_file_name|><|fim▁begin|>"""94. Binary Tree Inorder Traversal https://leetcode.com/problems/binary-tree-inorder-traversal/ Given a binary tree, return the in-order traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,3,2] Follow up: Rec...
return [] ans = [] ans += self.recursive_inorder_traversal(root.left)
<|file_name|>problem_94.py<|end_file_name|><|fim▁begin|>"""94. Binary Tree Inorder Traversal https://leetcode.com/problems/binary-tree-inorder-traversal/ Given a binary tree, return the in-order traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,3,2] Follow up: Rec...
def iterative_inorder_traversal(self, root: TreeNode) -> List[int]: """ iterative traversal """ ans = [] stack = [] while root or stack: if root: stack.append(root) root = root.left else: root = s...
<|file_name|>problem_94.py<|end_file_name|><|fim▁begin|>"""94. Binary Tree Inorder Traversal https://leetcode.com/problems/binary-tree-inorder-traversal/ Given a binary tree, return the in-order traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,3,2] Follow up: Rec...
""" iterative traversal """ ans = [] stack = [] while root or stack: if root: stack.append(root) root = root.left else: root = stack.pop() ans.append(root.val) root = r...
<|file_name|>problem_94.py<|end_file_name|><|fim▁begin|>"""94. Binary Tree Inorder Traversal https://leetcode.com/problems/binary-tree-inorder-traversal/ Given a binary tree, return the in-order traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,3,2] Follow up: Rec...
""" recursive traversal, process left if needed, then val, at last right """ if not root: return [] ans = [] ans += self.recursive_inorder_traversal(root.left) ans.append(root.val) ans += self.recursive_inorder_traversal(root.right) ret...
<|file_name|>problem_94.py<|end_file_name|><|fim▁begin|>"""94. Binary Tree Inorder Traversal https://leetcode.com/problems/binary-tree-inorder-traversal/ Given a binary tree, return the in-order traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,3,2] Follow up: Rec...
stack.append(root) root = root.left
<|file_name|>problem_94.py<|end_file_name|><|fim▁begin|>"""94. Binary Tree Inorder Traversal https://leetcode.com/problems/binary-tree-inorder-traversal/ Given a binary tree, return the in-order traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,3,2] Follow up: Rec...
root = stack.pop() ans.append(root.val) root = root.right
<|file_name|>problem_94.py<|end_file_name|><|fim▁begin|>"""94. Binary Tree Inorder Traversal https://leetcode.com/problems/binary-tree-inorder-traversal/ Given a binary tree, return the in-order traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,3,2] Follow up: Rec...
return []
<|file_name|>problem_94.py<|end_file_name|><|fim▁begin|>"""94. Binary Tree Inorder Traversal https://leetcode.com/problems/binary-tree-inorder-traversal/ Given a binary tree, return the in-order traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,3,2] Follow up: Rec...
iterative_inorder_traversal
<|file_name|>problem_94.py<|end_file_name|><|fim▁begin|>"""94. Binary Tree Inorder Traversal https://leetcode.com/problems/binary-tree-inorder-traversal/ Given a binary tree, return the in-order traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,3,2] Follow up: Rec...
recursive_inorder_traversal
<|file_name|>card.py<|end_file_name|><|fim▁begin|># img # trigger = attributes[12] # http://ws-tcg.com/en/cardlist # edit import os import requests import sqlite3 def get_card(browser): attributes = browser.find_elements_by_xpath('//table[@class="status"]/tbody/tr/td') image = attributes[0].find_element_by...
if attributes[5].find_element_by_xpath('./img').get_attribute("src") == "http://ws-tcg.com/en/cardlist/partimages/w.gif": side = "Weiß"
<|file_name|>card.py<|end_file_name|><|fim▁begin|># img # trigger = attributes[12] # http://ws-tcg.com/en/cardlist # edit import os import requests import sqlite3 def get_card(browser): <|fim_middle|> <|fim▁end|>
attributes = browser.find_elements_by_xpath('//table[@class="status"]/tbody/tr/td') image = attributes[0].find_element_by_xpath('./img').get_attribute('src') if attributes[1].find_element_by_xpath('./span[@class="kana"]').text: card_name = attributes[1].find_element_by_xpath('./span[@class="kana"]...
<|file_name|>card.py<|end_file_name|><|fim▁begin|># img # trigger = attributes[12] # http://ws-tcg.com/en/cardlist # edit import os import requests import sqlite3 def get_card(browser): attributes = browser.find_elements_by_xpath('//table[@class="status"]/tbody/tr/td') image = attributes[0].find_element_by...
card_name = attributes[1].find_element_by_xpath('./span[@class="kana"]').text
<|file_name|>card.py<|end_file_name|><|fim▁begin|># img # trigger = attributes[12] # http://ws-tcg.com/en/cardlist # edit import os import requests import sqlite3 def get_card(browser): attributes = browser.find_elements_by_xpath('//table[@class="status"]/tbody/tr/td') image = attributes[0].find_element_by...
card_name = None
<|file_name|>card.py<|end_file_name|><|fim▁begin|># img # trigger = attributes[12] # http://ws-tcg.com/en/cardlist # edit import os import requests import sqlite3 def get_card(browser): attributes = browser.find_elements_by_xpath('//table[@class="status"]/tbody/tr/td') image = attributes[0].find_element_by...
side = "Weiß"
<|file_name|>card.py<|end_file_name|><|fim▁begin|># img # trigger = attributes[12] # http://ws-tcg.com/en/cardlist # edit import os import requests import sqlite3 def get_card(browser): attributes = browser.find_elements_by_xpath('//table[@class="status"]/tbody/tr/td') image = attributes[0].find_element_by...
ide = "Schwarz"
<|file_name|>card.py<|end_file_name|><|fim▁begin|># img # trigger = attributes[12] # http://ws-tcg.com/en/cardlist # edit import os import requests import sqlite3 def get_card(browser): attributes = browser.find_elements_by_xpath('//table[@class="status"]/tbody/tr/td') image = attributes[0].find_element_by...
ide = None
<|file_name|>card.py<|end_file_name|><|fim▁begin|># img # trigger = attributes[12] # http://ws-tcg.com/en/cardlist # edit import os import requests import sqlite3 def get_card(browser): attributes = browser.find_elements_by_xpath('//table[@class="status"]/tbody/tr/td') image = attributes[0].find_element_by...
olor = "Yellow"
<|file_name|>card.py<|end_file_name|><|fim▁begin|># img # trigger = attributes[12] # http://ws-tcg.com/en/cardlist # edit import os import requests import sqlite3 def get_card(browser): attributes = browser.find_elements_by_xpath('//table[@class="status"]/tbody/tr/td') image = attributes[0].find_element_by...
olor = "Green"
<|file_name|>card.py<|end_file_name|><|fim▁begin|># img # trigger = attributes[12] # http://ws-tcg.com/en/cardlist # edit import os import requests import sqlite3 def get_card(browser): attributes = browser.find_elements_by_xpath('//table[@class="status"]/tbody/tr/td') image = attributes[0].find_element_by...
olor = "Red"
<|file_name|>card.py<|end_file_name|><|fim▁begin|># img # trigger = attributes[12] # http://ws-tcg.com/en/cardlist # edit import os import requests import sqlite3 def get_card(browser): attributes = browser.find_elements_by_xpath('//table[@class="status"]/tbody/tr/td') image = attributes[0].find_element_by...
olor = "Blue"
<|file_name|>card.py<|end_file_name|><|fim▁begin|># img # trigger = attributes[12] # http://ws-tcg.com/en/cardlist # edit import os import requests import sqlite3 def get_card(browser): attributes = browser.find_elements_by_xpath('//table[@class="status"]/tbody/tr/td') image = attributes[0].find_element_by...
olor = None
<|file_name|>card.py<|end_file_name|><|fim▁begin|># img # trigger = attributes[12] # http://ws-tcg.com/en/cardlist # edit import os import requests import sqlite3 def get_card(browser): attributes = browser.find_elements_by_xpath('//table[@class="status"]/tbody/tr/td') image = attributes[0].find_element_by...
s.makedirs("images")
<|file_name|>card.py<|end_file_name|><|fim▁begin|># img # trigger = attributes[12] # http://ws-tcg.com/en/cardlist # edit import os import requests import sqlite3 def get_card(browser): attributes = browser.find_elements_by_xpath('//table[@class="status"]/tbody/tr/td') image = attributes[0].find_element_by...
s.makedirs("images/" + card_no.split("/")[0])
<|file_name|>card.py<|end_file_name|><|fim▁begin|># img # trigger = attributes[12] # http://ws-tcg.com/en/cardlist # edit import os import requests import sqlite3 def get_card(browser): attributes = browser.find_elements_by_xpath('//table[@class="status"]/tbody/tr/td') image = attributes[0].find_element_by...
ith open("images/" + card_no + ".jpg", 'wb') as f: for chunk in r: f.write(chunk)
<|file_name|>card.py<|end_file_name|><|fim▁begin|># img # trigger = attributes[12] # http://ws-tcg.com/en/cardlist # edit import os import requests import sqlite3 def <|fim_middle|>(browser): attributes = browser.find_elements_by_xpath('//table[@class="status"]/tbody/tr/td') image = attributes[0].find_elem...
get_card
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
""" self.as_written : the code as it appears in the file, including \MyMacro, including the backslash. self.position : the position at which this occurrence appears. Example, if we look at the LatexCode Hello word, \MyMacro{first} and then \MyMacro{second} the first occur...
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
self.arguments = arguments self.number_of_arguments = len(arguments) self.name = name self.as_written = as_written self.arguments_list = arguments self.position = position
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
r""" Return the way the arguments are separated in as_written. Example, if we have \MyMacro<space>{A}<tab>{B} {C}, we return the list ["<space>","tab","\n"] The following has to be true: self.as_written == self.name+self.configuration()[0]+self....
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
r""" Apply the function <func> to the <n>th argument of self. Then return a new object. """ n=num-1 # Internally, the arguments are numbered from 0. arguments=self.arguments_list configuration=self.configuration() arguments[n]=func(arguments[n]) new_te...
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
return globals()["Occurrence_"+self.name[1:]](self) # We have to remove the initial "\" in the name of the macro.
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
return self.arguments[a]
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
return self.as_written
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
r""" takes an occurrence of \newlabel and creates an object which contains the information. In the self.section_name we remove "\relax" from the string. """ def __init__(self,occurrence): self.occurrence = occurrence self.arguments = self.occurrence.arguments if len(self.arg...
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
self.occurrence = occurrence self.arguments = self.occurrence.arguments if len(self.arguments) == 0 : self.name = "Non interesting; probably the definition" self.listoche = [None,None,None,None,None] self.value,self.page,self.section_name,self.fourth,self.fift...
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
def __init__(self,Occurrence): self.directory=Occurrence[0]
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
self.directory=Occurrence[0]
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
def __init__(self,occurrence): self.label = occurrence[0] def entry(self,codeBibtex): return codeBibtex[self.label]
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
self.label = occurrence[0]
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
return codeBibtex[self.label]
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
def __init__(self,occurrence): self.occurrence = occurrence self.number_of_arguments = 0 if self.occurrence[1][1] == "[]": self.number_of_arguments = self.occurrence[1][0] self.name = self.occurrence[0][0]#[0] self.definition = self.occurrence[-1][0]
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
self.occurrence = occurrence self.number_of_arguments = 0 if self.occurrence[1][1] == "[]": self.number_of_arguments = self.occurrence[1][0] self.name = self.occurrence[0][0]#[0] self.definition = self.occurrence[-1][0]
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
def __init__(self,occurrence): self.occurrence=occurrence self.label=self.occurrence.arguments[0]
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
self.occurrence=occurrence self.label=self.occurrence.arguments[0]
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
def __init__(self,occurrence): self.occurrence=occurrence self.label=self.occurrence.arguments[0]
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
self.occurrence=occurrence self.label=self.occurrence.arguments[0]
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
def __init__(self,occurrence): self.occurrence=occurrence self.label=self.occurrence.arguments[0]
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
self.occurrence=occurrence self.label=self.occurrence.arguments[0]
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
def __init__(self,occurrence): Occurrence.__init__(self,occurrence.name,occurrence.arguments,as_written=occurrence.as_written,position=occurrence.position) self.occurrence = occurrence self.filename = self.occurrence[0] self.input_paths=InputPaths() self._file_content=None ...
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
Occurrence.__init__(self,occurrence.name,occurrence.arguments,as_written=occurrence.as_written,position=occurrence.position) self.occurrence = occurrence self.filename = self.occurrence[0] self.input_paths=InputPaths() self._file_content=None # Make file_content "lazy"
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
r""" return the content of the file corresponding to this occurrence of \input. This is not recursive. - 'input_path' is the list of paths in which we can search for files. See the macro `\addInputPath` in the file https://github.com/LaurentClaessens/mazhe/blob/...
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
print("Error : length of the configuration list has to be the same as the number of arguments") raise ValueError
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
self.name = "Non interesting; probably the definition" self.listoche = [None,None,None,None,None] self.value,self.page,self.section_name,self.fourth,self.fifth=(None,None,None,None,None)
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
self.name = self.arguments[0][0] self.listoche = [a[0] for a in SearchArguments(self.arguments[1][0],5)[0]] self.value = self.listoche[0] self.page = self.listoche[1] self.section_name = self.listoche[2].replace(r"\relax","") self.fourth = self.lis...
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
self.number_of_arguments = self.occurrence[1][0]
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
return self._file_content
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
raise # Just to know who should do something like that
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
strict_filename=filename+".tex"
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
__init__
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
configuration
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
change_argument
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
analyse
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
__getitem__
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
__str__
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
__init__
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
__init__
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
__init__
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
entry
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
__init__
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
__init__
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
__init__
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
__init__
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
__init__
<|file_name|>Occurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
file_content
<|file_name|>sample_input_reader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Sample Input Reader for map job.""" import random import string import time from mapreduce import context from mapreduce import errors from mapreduce import operation from mapreduce.api import map_job # pylint: disable=invalid-n...
count = params[cls.COUNT] string_length = params.get(cls.STRING_LENGTH, cls._DEFAULT_STRING_LENGTH)
<|file_name|>sample_input_reader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Sample Input Reader for map job.""" import random import string import time from mapreduce import context from mapreduce import errors from mapreduce import operation from mapreduce.api import map_job # pylint: disable=invalid-n...
"""A sample InputReader that generates random strings as output. Primary usage is to as an example InputReader that can be use for test purposes. """ # Total number of entries this reader should generate. COUNT = "count" # Length of the generated strings. STRING_LENGTH = "string_length" # The defaul...
<|file_name|>sample_input_reader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Sample Input Reader for map job.""" import random import string import time from mapreduce import context from mapreduce import errors from mapreduce import operation from mapreduce.api import map_job # pylint: disable=invalid-n...
"""Initialize input reader. Args: count: number of entries this shard should generate. string_length: the length of generated random strings. """ self._count = count self._string_length = string_length
<|file_name|>sample_input_reader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Sample Input Reader for map job.""" import random import string import time from mapreduce import context from mapreduce import errors from mapreduce import operation from mapreduce.api import map_job # pylint: disable=invalid-n...
ctx = context.get() while self._count: self._count -= 1 start_time = time.time() content = "".join(random.choice(string.ascii_lowercase) for _ in range(self._string_length)) if ctx: operation.counters.Increment( COUNTER_IO_READ_MSEC, int((time...
<|file_name|>sample_input_reader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Sample Input Reader for map job.""" import random import string import time from mapreduce import context from mapreduce import errors from mapreduce import operation from mapreduce.api import map_job # pylint: disable=invalid-n...
"""Inherit docs.""" return cls(state[cls.COUNT], state[cls.STRING_LENGTH])
<|file_name|>sample_input_reader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Sample Input Reader for map job.""" import random import string import time from mapreduce import context from mapreduce import errors from mapreduce import operation from mapreduce.api import map_job # pylint: disable=invalid-n...
"""Inherit docs.""" return {self.COUNT: self._count, self.STRING_LENGTH: self._string_length}
<|file_name|>sample_input_reader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Sample Input Reader for map job.""" import random import string import time from mapreduce import context from mapreduce import errors from mapreduce import operation from mapreduce.api import map_job # pylint: disable=invalid-n...
"""Inherit docs.""" params = job_config.input_reader_params count = params[cls.COUNT] string_length = params.get(cls.STRING_LENGTH, cls._DEFAULT_STRING_LENGTH) shard_count = job_config.shard_count count_per_shard = count // shard_count mr_input_readers = [ cls(count_per_shard, stri...
<|file_name|>sample_input_reader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Sample Input Reader for map job.""" import random import string import time from mapreduce import context from mapreduce import errors from mapreduce import operation from mapreduce.api import map_job # pylint: disable=invalid-n...
"""Inherit docs.""" super(SampleInputReader, cls).validate(job_config) params = job_config.input_reader_params # Validate count. if cls.COUNT not in params: raise errors.BadReaderParamsError("Must specify %s" % cls.COUNT) if not isinstance(params[cls.COUNT], int): raise errors.BadRe...
<|file_name|>sample_input_reader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Sample Input Reader for map job.""" import random import string import time from mapreduce import context from mapreduce import errors from mapreduce import operation from mapreduce.api import map_job # pylint: disable=invalid-n...
operation.counters.Increment( COUNTER_IO_READ_MSEC, int((time.time() - start_time) * 1000))(ctx) operation.counters.Increment(COUNTER_IO_READ_BYTES, len(content))(ctx)
<|file_name|>sample_input_reader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Sample Input Reader for map job.""" import random import string import time from mapreduce import context from mapreduce import errors from mapreduce import operation from mapreduce.api import map_job # pylint: disable=invalid-n...
mr_input_readers.append(cls(left, string_length))
<|file_name|>sample_input_reader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Sample Input Reader for map job.""" import random import string import time from mapreduce import context from mapreduce import errors from mapreduce import operation from mapreduce.api import map_job # pylint: disable=invalid-n...
raise errors.BadReaderParamsError("Must specify %s" % cls.COUNT)
<|file_name|>sample_input_reader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Sample Input Reader for map job.""" import random import string import time from mapreduce import context from mapreduce import errors from mapreduce import operation from mapreduce.api import map_job # pylint: disable=invalid-n...
raise errors.BadReaderParamsError("%s should be an int but is %s" % (cls.COUNT, type(params[cls.COUNT])))
<|file_name|>sample_input_reader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Sample Input Reader for map job.""" import random import string import time from mapreduce import context from mapreduce import errors from mapreduce import operation from mapreduce.api import map_job # pylint: disable=invalid-n...
raise errors.BadReaderParamsError("%s should be a positive int")
<|file_name|>sample_input_reader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Sample Input Reader for map job.""" import random import string import time from mapreduce import context from mapreduce import errors from mapreduce import operation from mapreduce.api import map_job # pylint: disable=invalid-n...
raise errors.BadReaderParamsError("%s should be a positive int " "but is %s" % (cls.STRING_LENGTH, params[cls.STRING_LENGTH]))
<|file_name|>sample_input_reader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Sample Input Reader for map job.""" import random import string import time from mapreduce import context from mapreduce import errors from mapreduce import operation from mapreduce.api import map_job # pylint: disable=invalid-n...
__init__
<|file_name|>sample_input_reader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Sample Input Reader for map job.""" import random import string import time from mapreduce import context from mapreduce import errors from mapreduce import operation from mapreduce.api import map_job # pylint: disable=invalid-n...
__iter__
<|file_name|>sample_input_reader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Sample Input Reader for map job.""" import random import string import time from mapreduce import context from mapreduce import errors from mapreduce import operation from mapreduce.api import map_job # pylint: disable=invalid-n...
from_json
<|file_name|>sample_input_reader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Sample Input Reader for map job.""" import random import string import time from mapreduce import context from mapreduce import errors from mapreduce import operation from mapreduce.api import map_job # pylint: disable=invalid-n...
to_json
<|file_name|>sample_input_reader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Sample Input Reader for map job.""" import random import string import time from mapreduce import context from mapreduce import errors from mapreduce import operation from mapreduce.api import map_job # pylint: disable=invalid-n...
split_input
<|file_name|>sample_input_reader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Sample Input Reader for map job.""" import random import string import time from mapreduce import context from mapreduce import errors from mapreduce import operation from mapreduce.api import map_job # pylint: disable=invalid-n...
validate
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """urls.py: messages extends""" <|fim▁hole|> url(r'^mark_read/all/$', message_mark_all_read, name='message_mark_all_read'), ]<|fim▁end|>
from django.conf.urls import url from messages_extends.views import message_mark_all_read, message_mark_read urlpatterns = [ url(r'^mark_read/(?P<message_id>\d+)/$', message_mark_read, name='message_mark_read'),