repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
partition
stringclasses
1 value
acutesoftware/AIKIF
aikif/lib/cls_file.py
TextFile.count_lines_in_file
def count_lines_in_file(self, fname=''): """ you wont believe what this method does """ i = 0 if fname == '': fname = self.fullname try: #with open(fname, encoding="utf8") as f: with codecs.open(fname, "r",encoding='utf8', errors='ignore') as f: ...
python
def count_lines_in_file(self, fname=''): """ you wont believe what this method does """ i = 0 if fname == '': fname = self.fullname try: #with open(fname, encoding="utf8") as f: with codecs.open(fname, "r",encoding='utf8', errors='ignore') as f: ...
[ "def", "count_lines_in_file", "(", "self", ",", "fname", "=", "''", ")", ":", "i", "=", "0", "if", "fname", "==", "''", ":", "fname", "=", "self", ".", "fullname", "try", ":", "with", "codecs", ".", "open", "(", "fname", ",", "\"r\"", ",", "encodin...
you wont believe what this method does
[ "you", "wont", "believe", "what", "this", "method", "does" ]
fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03
https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/lib/cls_file.py#L109-L122
train
acutesoftware/AIKIF
aikif/lib/cls_file.py
TextFile.count_lines_of_code
def count_lines_of_code(self, fname=''): """ counts non blank lines """ if fname == '': fname = self.fullname loc = 0 try: with open(fname) as f: for l in f: if l.strip() != '': loc += 1 r...
python
def count_lines_of_code(self, fname=''): """ counts non blank lines """ if fname == '': fname = self.fullname loc = 0 try: with open(fname) as f: for l in f: if l.strip() != '': loc += 1 r...
[ "def", "count_lines_of_code", "(", "self", ",", "fname", "=", "''", ")", ":", "if", "fname", "==", "''", ":", "fname", "=", "self", ".", "fullname", "loc", "=", "0", "try", ":", "with", "open", "(", "fname", ")", "as", "f", ":", "for", "l", "in",...
counts non blank lines
[ "counts", "non", "blank", "lines" ]
fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03
https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/lib/cls_file.py#L124-L137
train
acutesoftware/AIKIF
aikif/lib/cls_file.py
TextFile.get_file_sample
def get_file_sample(self, numLines=10): """ retrieve a sample of the file """ res = '' try: with open(self.fullname, 'r') as f: for line_num, line in enumerate(f): res += str(line_num).zfill(5) + ' ' + line if line_num >= numLi...
python
def get_file_sample(self, numLines=10): """ retrieve a sample of the file """ res = '' try: with open(self.fullname, 'r') as f: for line_num, line in enumerate(f): res += str(line_num).zfill(5) + ' ' + line if line_num >= numLi...
[ "def", "get_file_sample", "(", "self", ",", "numLines", "=", "10", ")", ":", "res", "=", "''", "try", ":", "with", "open", "(", "self", ".", "fullname", ",", "'r'", ")", "as", "f", ":", "for", "line_num", ",", "line", "in", "enumerate", "(", "f", ...
retrieve a sample of the file
[ "retrieve", "a", "sample", "of", "the", "file" ]
fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03
https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/lib/cls_file.py#L140-L152
train
acutesoftware/AIKIF
aikif/lib/cls_file.py
TextFile.append_text
def append_text(self, txt): """ adds a line of text to a file """ with open(self.fullname, "a") as myfile: myfile.write(txt)
python
def append_text(self, txt): """ adds a line of text to a file """ with open(self.fullname, "a") as myfile: myfile.write(txt)
[ "def", "append_text", "(", "self", ",", "txt", ")", ":", "with", "open", "(", "self", ".", "fullname", ",", "\"a\"", ")", "as", "myfile", ":", "myfile", ".", "write", "(", "txt", ")" ]
adds a line of text to a file
[ "adds", "a", "line", "of", "text", "to", "a", "file" ]
fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03
https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/lib/cls_file.py#L155-L158
train
acutesoftware/AIKIF
aikif/lib/cls_file.py
TextFile.load_file_to_string
def load_file_to_string(self): """ load a file to a string """ try: with open(self.fullname, 'r') as f: txt = f.read() return txt except IOError: return ''
python
def load_file_to_string(self): """ load a file to a string """ try: with open(self.fullname, 'r') as f: txt = f.read() return txt except IOError: return ''
[ "def", "load_file_to_string", "(", "self", ")", ":", "try", ":", "with", "open", "(", "self", ".", "fullname", ",", "'r'", ")", "as", "f", ":", "txt", "=", "f", ".", "read", "(", ")", "return", "txt", "except", "IOError", ":", "return", "''" ]
load a file to a string
[ "load", "a", "file", "to", "a", "string" ]
fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03
https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/lib/cls_file.py#L172-L179
train
acutesoftware/AIKIF
aikif/lib/cls_file.py
TextFile.load_file_to_list
def load_file_to_list(self): """ load a file to a list """ lst = [] try: with open(self.fullname, 'r') as f: for line in f: lst.append(line) return lst except IOError: return lst
python
def load_file_to_list(self): """ load a file to a list """ lst = [] try: with open(self.fullname, 'r') as f: for line in f: lst.append(line) return lst except IOError: return lst
[ "def", "load_file_to_list", "(", "self", ")", ":", "lst", "=", "[", "]", "try", ":", "with", "open", "(", "self", ".", "fullname", ",", "'r'", ")", "as", "f", ":", "for", "line", "in", "f", ":", "lst", ".", "append", "(", "line", ")", "return", ...
load a file to a list
[ "load", "a", "file", "to", "a", "list" ]
fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03
https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/lib/cls_file.py#L181-L190
train
acutesoftware/AIKIF
aikif/web_app/page_programs.py
get_program_list
def get_program_list(): """ get a HTML formatted view of all Python programs in all subfolders of AIKIF, including imports and lists of functions and classes """ colList = ['FileName','FileSize','Functions', 'Imports'] txt = '<TABLE width=90% border=0>' txt += format_file_table_header(c...
python
def get_program_list(): """ get a HTML formatted view of all Python programs in all subfolders of AIKIF, including imports and lists of functions and classes """ colList = ['FileName','FileSize','Functions', 'Imports'] txt = '<TABLE width=90% border=0>' txt += format_file_table_header(c...
[ "def", "get_program_list", "(", ")", ":", "colList", "=", "[", "'FileName'", ",", "'FileSize'", ",", "'Functions'", ",", "'Imports'", "]", "txt", "=", "'<TABLE width=90% border=0>'", "txt", "+=", "format_file_table_header", "(", "colList", ")", "fl", "=", "web",...
get a HTML formatted view of all Python programs in all subfolders of AIKIF, including imports and lists of functions and classes
[ "get", "a", "HTML", "formatted", "view", "of", "all", "Python", "programs", "in", "all", "subfolders", "of", "AIKIF", "including", "imports", "and", "lists", "of", "functions", "and", "classes" ]
fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03
https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/web_app/page_programs.py#L32-L49
train
acutesoftware/AIKIF
aikif/web_app/page_programs.py
get_subfolder
def get_subfolder(txt): """ extracts a displayable subfolder name from full filename """ root_folder = os.sep + 'aikif' + os.sep ndx = txt.find(root_folder, 1) return txt[ndx:].replace('__init__.py', '')
python
def get_subfolder(txt): """ extracts a displayable subfolder name from full filename """ root_folder = os.sep + 'aikif' + os.sep ndx = txt.find(root_folder, 1) return txt[ndx:].replace('__init__.py', '')
[ "def", "get_subfolder", "(", "txt", ")", ":", "root_folder", "=", "os", ".", "sep", "+", "'aikif'", "+", "os", ".", "sep", "ndx", "=", "txt", ".", "find", "(", "root_folder", ",", "1", ")", "return", "txt", "[", "ndx", ":", "]", ".", "replace", "...
extracts a displayable subfolder name from full filename
[ "extracts", "a", "displayable", "subfolder", "name", "from", "full", "filename" ]
fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03
https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/web_app/page_programs.py#L51-L57
train
acutesoftware/AIKIF
aikif/web_app/page_programs.py
get_functions
def get_functions(fname): """ get a list of functions from a Python program """ txt = '' with open(fname, 'r') as f: for line in f: if line.strip()[0:4] == 'def ': txt += '<PRE>' + strip_text_after_string(strip_text_after_string(line, '#')[4:], ':') + '</PRE>\n' ...
python
def get_functions(fname): """ get a list of functions from a Python program """ txt = '' with open(fname, 'r') as f: for line in f: if line.strip()[0:4] == 'def ': txt += '<PRE>' + strip_text_after_string(strip_text_after_string(line, '#')[4:], ':') + '</PRE>\n' ...
[ "def", "get_functions", "(", "fname", ")", ":", "txt", "=", "''", "with", "open", "(", "fname", ",", "'r'", ")", "as", "f", ":", "for", "line", "in", "f", ":", "if", "line", ".", "strip", "(", ")", "[", "0", ":", "4", "]", "==", "'def '", ":"...
get a list of functions from a Python program
[ "get", "a", "list", "of", "functions", "from", "a", "Python", "program" ]
fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03
https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/web_app/page_programs.py#L95-L104
train
acutesoftware/AIKIF
aikif/web_app/page_programs.py
strip_text_after_string
def strip_text_after_string(txt, junk): """ used to strip any poorly documented comments at the end of function defs """ if junk in txt: return txt[:txt.find(junk)] else: return txt
python
def strip_text_after_string(txt, junk): """ used to strip any poorly documented comments at the end of function defs """ if junk in txt: return txt[:txt.find(junk)] else: return txt
[ "def", "strip_text_after_string", "(", "txt", ",", "junk", ")", ":", "if", "junk", "in", "txt", ":", "return", "txt", "[", ":", "txt", ".", "find", "(", "junk", ")", "]", "else", ":", "return", "txt" ]
used to strip any poorly documented comments at the end of function defs
[ "used", "to", "strip", "any", "poorly", "documented", "comments", "at", "the", "end", "of", "function", "defs" ]
fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03
https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/web_app/page_programs.py#L106-L111
train
acutesoftware/AIKIF
aikif/web_app/page_programs.py
get_imports
def get_imports(fname): """ get a list of imports from a Python program """ txt = '' with open(fname, 'r') as f: for line in f: if line[0:6] == 'import': txt += '<PRE>' + strip_text_after_string(line[7:], ' as ') + '</PRE>\n' return txt + '<BR>'
python
def get_imports(fname): """ get a list of imports from a Python program """ txt = '' with open(fname, 'r') as f: for line in f: if line[0:6] == 'import': txt += '<PRE>' + strip_text_after_string(line[7:], ' as ') + '</PRE>\n' return txt + '<BR>'
[ "def", "get_imports", "(", "fname", ")", ":", "txt", "=", "''", "with", "open", "(", "fname", ",", "'r'", ")", "as", "f", ":", "for", "line", "in", "f", ":", "if", "line", "[", "0", ":", "6", "]", "==", "'import'", ":", "txt", "+=", "'<PRE>'", ...
get a list of imports from a Python program
[ "get", "a", "list", "of", "imports", "from", "a", "Python", "program" ]
fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03
https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/web_app/page_programs.py#L113-L120
train
acutesoftware/AIKIF
aikif/agents/learn/dummy_learn_1.py
main
def main(arg1=55, arg2='test', arg3=None): """ This is a sample program to show how a learning agent can be logged using AIKIF. The idea is that this main function is your algorithm, which will run until it finds a successful result. The result is returned and the time taken is logged. ...
python
def main(arg1=55, arg2='test', arg3=None): """ This is a sample program to show how a learning agent can be logged using AIKIF. The idea is that this main function is your algorithm, which will run until it finds a successful result. The result is returned and the time taken is logged. ...
[ "def", "main", "(", "arg1", "=", "55", ",", "arg2", "=", "'test'", ",", "arg3", "=", "None", ")", ":", "print", "(", "'Starting dummy AI algorithm with :'", ",", "arg1", ",", "arg2", ",", "arg3", ")", "if", "arg3", "is", "None", ":", "arg3", "=", "["...
This is a sample program to show how a learning agent can be logged using AIKIF. The idea is that this main function is your algorithm, which will run until it finds a successful result. The result is returned and the time taken is logged. There can optionally be have additional functions ...
[ "This", "is", "a", "sample", "program", "to", "show", "how", "a", "learning", "agent", "can", "be", "logged", "using", "AIKIF", ".", "The", "idea", "is", "that", "this", "main", "function", "is", "your", "algorithm", "which", "will", "run", "until", "it"...
fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03
https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/agents/learn/dummy_learn_1.py#L5-L23
train
acutesoftware/AIKIF
aikif/dataTools/if_redis.py
redis_server.get
def get(self, key): """ get a set of keys from redis """ res = self.connection.get(key) print(res) return res
python
def get(self, key): """ get a set of keys from redis """ res = self.connection.get(key) print(res) return res
[ "def", "get", "(", "self", ",", "key", ")", ":", "res", "=", "self", ".", "connection", ".", "get", "(", "key", ")", "print", "(", "res", ")", "return", "res" ]
get a set of keys from redis
[ "get", "a", "set", "of", "keys", "from", "redis" ]
fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03
https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/dataTools/if_redis.py#L108-L112
train
Nachtfeuer/pipeline
spline/components/packer.py
Packer.creator
def creator(_, config): """Creator function for creating an instance of a Packer image script.""" packer_script = render(config.script, model=config.model, env=config.env, variables=config.variables, item=config.item) filename = "packer.dry.run.see.comment" ...
python
def creator(_, config): """Creator function for creating an instance of a Packer image script.""" packer_script = render(config.script, model=config.model, env=config.env, variables=config.variables, item=config.item) filename = "packer.dry.run.see.comment" ...
[ "def", "creator", "(", "_", ",", "config", ")", ":", "packer_script", "=", "render", "(", "config", ".", "script", ",", "model", "=", "config", ".", "model", ",", "env", "=", "config", ".", "env", ",", "variables", "=", "config", ".", "variables", ",...
Creator function for creating an instance of a Packer image script.
[ "Creator", "function", "for", "creating", "an", "instance", "of", "a", "Packer", "image", "script", "." ]
04ca18c4e95e4349532bb45b768206393e1f2c13
https://github.com/Nachtfeuer/pipeline/blob/04ca18c4e95e4349532bb45b768206393e1f2c13/spline/components/packer.py#L37-L57
train
wanadev/pyguetzli
pyguetzli/guetzli.py
process_jpeg_bytes
def process_jpeg_bytes(bytes_in, quality=DEFAULT_JPEG_QUALITY): """Generates an optimized JPEG from JPEG-encoded bytes. :param bytes_in: the input image's bytes :param quality: the output JPEG quality (default 95) :returns: Optimized JPEG bytes :rtype: bytes :raises ValueError: Guetzli was no...
python
def process_jpeg_bytes(bytes_in, quality=DEFAULT_JPEG_QUALITY): """Generates an optimized JPEG from JPEG-encoded bytes. :param bytes_in: the input image's bytes :param quality: the output JPEG quality (default 95) :returns: Optimized JPEG bytes :rtype: bytes :raises ValueError: Guetzli was no...
[ "def", "process_jpeg_bytes", "(", "bytes_in", ",", "quality", "=", "DEFAULT_JPEG_QUALITY", ")", ":", "bytes_out_p", "=", "ffi", ".", "new", "(", "\"char**\"", ")", "bytes_out_p_gc", "=", "ffi", ".", "gc", "(", "bytes_out_p", ",", "lib", ".", "guetzli_free_byte...
Generates an optimized JPEG from JPEG-encoded bytes. :param bytes_in: the input image's bytes :param quality: the output JPEG quality (default 95) :returns: Optimized JPEG bytes :rtype: bytes :raises ValueError: Guetzli was not able to decode the image (the image is probab...
[ "Generates", "an", "optimized", "JPEG", "from", "JPEG", "-", "encoded", "bytes", "." ]
4e0c221f5e8f23adb38505c3c1c5a09294b7ee98
https://github.com/wanadev/pyguetzli/blob/4e0c221f5e8f23adb38505c3c1c5a09294b7ee98/pyguetzli/guetzli.py#L13-L46
train
wanadev/pyguetzli
pyguetzli/guetzli.py
process_rgb_bytes
def process_rgb_bytes(bytes_in, width, height, quality=DEFAULT_JPEG_QUALITY): """Generates an optimized JPEG from RGB bytes. :param bytes bytes_in: the input image's bytes :param int width: the width of the input image :param int height: the height of the input image :param int quality: the output ...
python
def process_rgb_bytes(bytes_in, width, height, quality=DEFAULT_JPEG_QUALITY): """Generates an optimized JPEG from RGB bytes. :param bytes bytes_in: the input image's bytes :param int width: the width of the input image :param int height: the height of the input image :param int quality: the output ...
[ "def", "process_rgb_bytes", "(", "bytes_in", ",", "width", ",", "height", ",", "quality", "=", "DEFAULT_JPEG_QUALITY", ")", ":", "if", "len", "(", "bytes_in", ")", "!=", "width", "*", "height", "*", "3", ":", "raise", "ValueError", "(", "\"bytes_in length is...
Generates an optimized JPEG from RGB bytes. :param bytes bytes_in: the input image's bytes :param int width: the width of the input image :param int height: the height of the input image :param int quality: the output JPEG quality (default 95) :returns: Optimized JPEG bytes :rtype: bytes ...
[ "Generates", "an", "optimized", "JPEG", "from", "RGB", "bytes", "." ]
4e0c221f5e8f23adb38505c3c1c5a09294b7ee98
https://github.com/wanadev/pyguetzli/blob/4e0c221f5e8f23adb38505c3c1c5a09294b7ee98/pyguetzli/guetzli.py#L49-L90
train
Nachtfeuer/pipeline
spline/tools/decorators.py
singleton
def singleton(the_class): """ Decorator for a class to make a singleton out of it. @type the_class: class @param the_class: the class that should work as a singleton @rtype: decorator @return: decorator """ class_instances = {} def get_instance(*args, **kwargs): """ ...
python
def singleton(the_class): """ Decorator for a class to make a singleton out of it. @type the_class: class @param the_class: the class that should work as a singleton @rtype: decorator @return: decorator """ class_instances = {} def get_instance(*args, **kwargs): """ ...
[ "def", "singleton", "(", "the_class", ")", ":", "class_instances", "=", "{", "}", "def", "get_instance", "(", "*", "args", ",", "**", "kwargs", ")", ":", "key", "=", "(", "the_class", ",", "args", ",", "str", "(", "kwargs", ")", ")", "if", "key", "...
Decorator for a class to make a singleton out of it. @type the_class: class @param the_class: the class that should work as a singleton @rtype: decorator @return: decorator
[ "Decorator", "for", "a", "class", "to", "make", "a", "singleton", "out", "of", "it", "." ]
04ca18c4e95e4349532bb45b768206393e1f2c13
https://github.com/Nachtfeuer/pipeline/blob/04ca18c4e95e4349532bb45b768206393e1f2c13/spline/tools/decorators.py#L25-L53
train
acutesoftware/AIKIF
aikif/toolbox/game_board_utils.py
build_board_2048
def build_board_2048(): """ builds a 2048 starting board Printing Grid 0 0 0 2 0 0 4 0 0 0 0 0 0 0 0 0 """ grd = Grid(4,4, [2,4]) grd.new_tile() grd.new_tile() print(grd) return grd
python
def build_board_2048(): """ builds a 2048 starting board Printing Grid 0 0 0 2 0 0 4 0 0 0 0 0 0 0 0 0 """ grd = Grid(4,4, [2,4]) grd.new_tile() grd.new_tile() print(grd) return grd
[ "def", "build_board_2048", "(", ")", ":", "grd", "=", "Grid", "(", "4", ",", "4", ",", "[", "2", ",", "4", "]", ")", "grd", ".", "new_tile", "(", ")", "grd", ".", "new_tile", "(", ")", "print", "(", "grd", ")", "return", "grd" ]
builds a 2048 starting board Printing Grid 0 0 0 2 0 0 4 0 0 0 0 0 0 0 0 0
[ "builds", "a", "2048", "starting", "board", "Printing", "Grid", "0", "0", "0", "2", "0", "0", "4", "0", "0", "0", "0", "0", "0", "0", "0", "0" ]
fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03
https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/toolbox/game_board_utils.py#L10-L23
train
acutesoftware/AIKIF
aikif/toolbox/game_board_utils.py
build_board_checkers
def build_board_checkers(): """ builds a checkers starting board Printing Grid 0 B 0 B 0 B 0 B B 0 B 0 B 0 B 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
python
def build_board_checkers(): """ builds a checkers starting board Printing Grid 0 B 0 B 0 B 0 B B 0 B 0 B 0 B 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
[ "def", "build_board_checkers", "(", ")", ":", "grd", "=", "Grid", "(", "8", ",", "8", ",", "[", "\"B\"", ",", "\"W\"", "]", ")", "for", "c", "in", "range", "(", "4", ")", ":", "grd", ".", "set_tile", "(", "0", ",", "(", "c", "*", "2", ")", ...
builds a checkers starting board Printing Grid 0 B 0 B 0 B 0 B B 0 B 0 B 0 B 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
[ "builds", "a", "checkers", "starting", "board", "Printing", "Grid", "0", "B", "0", "B", "0", "B", "0", "B", "B", "0", "B", "0", "B", "0", "B", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"...
fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03
https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/toolbox/game_board_utils.py#L25-L45
train
acutesoftware/AIKIF
aikif/toolbox/game_board_utils.py
TEST
def TEST(): """ tests for this module """ grd = Grid(4,4, [2,4]) grd.new_tile() grd.new_tile() print(grd) print("There are ", grd.count_blank_positions(), " blanks in grid 1\n") grd2 = Grid(5,5, ['A','B']) grd2.new_tile(26) print(grd2) build_board_checkers() print("There ar...
python
def TEST(): """ tests for this module """ grd = Grid(4,4, [2,4]) grd.new_tile() grd.new_tile() print(grd) print("There are ", grd.count_blank_positions(), " blanks in grid 1\n") grd2 = Grid(5,5, ['A','B']) grd2.new_tile(26) print(grd2) build_board_checkers() print("There ar...
[ "def", "TEST", "(", ")", ":", "grd", "=", "Grid", "(", "4", ",", "4", ",", "[", "2", ",", "4", "]", ")", "grd", ".", "new_tile", "(", ")", "grd", ".", "new_tile", "(", ")", "print", "(", "grd", ")", "print", "(", "\"There are \"", ",", "grd",...
tests for this module
[ "tests", "for", "this", "module" ]
fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03
https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/aikif/toolbox/game_board_utils.py#L47-L60
train
masci/django-appengine-toolkit
appengine_toolkit/storage.py
GoogleCloudStorage.url
def url(self, name): """ Ask blobstore api for an url to directly serve the file """ key = blobstore.create_gs_key('/gs' + name) return images.get_serving_url(key)
python
def url(self, name): """ Ask blobstore api for an url to directly serve the file """ key = blobstore.create_gs_key('/gs' + name) return images.get_serving_url(key)
[ "def", "url", "(", "self", ",", "name", ")", ":", "key", "=", "blobstore", ".", "create_gs_key", "(", "'/gs'", "+", "name", ")", "return", "images", ".", "get_serving_url", "(", "key", ")" ]
Ask blobstore api for an url to directly serve the file
[ "Ask", "blobstore", "api", "for", "an", "url", "to", "directly", "serve", "the", "file" ]
9ffe8b05a263889787fb34a3e28ebc66b1f0a1d2
https://github.com/masci/django-appengine-toolkit/blob/9ffe8b05a263889787fb34a3e28ebc66b1f0a1d2/appengine_toolkit/storage.py#L74-L79
train
Nachtfeuer/pipeline
spline/components/stage.py
Stage.process
def process(self, stage): """Processing one stage.""" self.logger.info("Processing pipeline stage '%s'", self.title) output = [] for entry in stage: key = list(entry.keys())[0] if key == "env": self.pipeline.data.env_list[1].update(entry[key]) ...
python
def process(self, stage): """Processing one stage.""" self.logger.info("Processing pipeline stage '%s'", self.title) output = [] for entry in stage: key = list(entry.keys())[0] if key == "env": self.pipeline.data.env_list[1].update(entry[key]) ...
[ "def", "process", "(", "self", ",", "stage", ")", ":", "self", ".", "logger", ".", "info", "(", "\"Processing pipeline stage '%s'\"", ",", "self", ".", "title", ")", "output", "=", "[", "]", "for", "entry", "in", "stage", ":", "key", "=", "list", "(", ...
Processing one stage.
[ "Processing", "one", "stage", "." ]
04ca18c4e95e4349532bb45b768206393e1f2c13
https://github.com/Nachtfeuer/pipeline/blob/04ca18c4e95e4349532bb45b768206393e1f2c13/spline/components/stage.py#L47-L69
train
budacom/trading-bots
trading_bots/contrib/clients.py
MarketClient.trading_fees
def trading_fees(self) -> TradingFees: """Fetch trading fees.""" return self._fetch('trading fees', self.market.code)(self._trading_fees)()
python
def trading_fees(self) -> TradingFees: """Fetch trading fees.""" return self._fetch('trading fees', self.market.code)(self._trading_fees)()
[ "def", "trading_fees", "(", "self", ")", "->", "TradingFees", ":", "return", "self", ".", "_fetch", "(", "'trading fees'", ",", "self", ".", "market", ".", "code", ")", "(", "self", ".", "_trading_fees", ")", "(", ")" ]
Fetch trading fees.
[ "Fetch", "trading", "fees", "." ]
8cb68bb8d0b5f822108db1cc5dae336e3d3c3452
https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/contrib/clients.py#L202-L204
train
budacom/trading-bots
trading_bots/contrib/clients.py
MarketClient.fetch_ticker
def fetch_ticker(self) -> Ticker: """Fetch the market ticker.""" return self._fetch('ticker', self.market.code)(self._ticker)()
python
def fetch_ticker(self) -> Ticker: """Fetch the market ticker.""" return self._fetch('ticker', self.market.code)(self._ticker)()
[ "def", "fetch_ticker", "(", "self", ")", "->", "Ticker", ":", "return", "self", ".", "_fetch", "(", "'ticker'", ",", "self", ".", "market", ".", "code", ")", "(", "self", ".", "_ticker", ")", "(", ")" ]
Fetch the market ticker.
[ "Fetch", "the", "market", "ticker", "." ]
8cb68bb8d0b5f822108db1cc5dae336e3d3c3452
https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/contrib/clients.py#L210-L212
train
budacom/trading-bots
trading_bots/contrib/clients.py
MarketClient.fetch_order_book
def fetch_order_book(self) -> OrderBook: """Fetch the order book.""" return self._fetch('order book', self.market.code)(self._order_book)()
python
def fetch_order_book(self) -> OrderBook: """Fetch the order book.""" return self._fetch('order book', self.market.code)(self._order_book)()
[ "def", "fetch_order_book", "(", "self", ")", "->", "OrderBook", ":", "return", "self", ".", "_fetch", "(", "'order book'", ",", "self", ".", "market", ".", "code", ")", "(", "self", ".", "_order_book", ")", "(", ")" ]
Fetch the order book.
[ "Fetch", "the", "order", "book", "." ]
8cb68bb8d0b5f822108db1cc5dae336e3d3c3452
https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/contrib/clients.py#L232-L234
train
budacom/trading-bots
trading_bots/contrib/clients.py
MarketClient.fetch_trades_since
def fetch_trades_since(self, since: int) -> List[Trade]: """Fetch trades since given timestamp.""" return self._fetch_since('trades', self.market.code)(self._trades_since)(since)
python
def fetch_trades_since(self, since: int) -> List[Trade]: """Fetch trades since given timestamp.""" return self._fetch_since('trades', self.market.code)(self._trades_since)(since)
[ "def", "fetch_trades_since", "(", "self", ",", "since", ":", "int", ")", "->", "List", "[", "Trade", "]", ":", "return", "self", ".", "_fetch_since", "(", "'trades'", ",", "self", ".", "market", ".", "code", ")", "(", "self", ".", "_trades_since", ")",...
Fetch trades since given timestamp.
[ "Fetch", "trades", "since", "given", "timestamp", "." ]
8cb68bb8d0b5f822108db1cc5dae336e3d3c3452
https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/contrib/clients.py#L241-L243
train
budacom/trading-bots
trading_bots/contrib/clients.py
WalletClient.fetch_deposits
def fetch_deposits(self, limit: int) -> List[Deposit]: """Fetch latest deposits, must provide a limit.""" return self._transactions(self._deposits, 'deposits', limit)
python
def fetch_deposits(self, limit: int) -> List[Deposit]: """Fetch latest deposits, must provide a limit.""" return self._transactions(self._deposits, 'deposits', limit)
[ "def", "fetch_deposits", "(", "self", ",", "limit", ":", "int", ")", "->", "List", "[", "Deposit", "]", ":", "return", "self", ".", "_transactions", "(", "self", ".", "_deposits", ",", "'deposits'", ",", "limit", ")" ]
Fetch latest deposits, must provide a limit.
[ "Fetch", "latest", "deposits", "must", "provide", "a", "limit", "." ]
8cb68bb8d0b5f822108db1cc5dae336e3d3c3452
https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/contrib/clients.py#L292-L294
train
budacom/trading-bots
trading_bots/contrib/clients.py
WalletClient.fetch_deposits_since
def fetch_deposits_since(self, since: int) -> List[Deposit]: """Fetch all deposits since the given timestamp.""" return self._transactions_since(self._deposits_since, 'deposits', since)
python
def fetch_deposits_since(self, since: int) -> List[Deposit]: """Fetch all deposits since the given timestamp.""" return self._transactions_since(self._deposits_since, 'deposits', since)
[ "def", "fetch_deposits_since", "(", "self", ",", "since", ":", "int", ")", "->", "List", "[", "Deposit", "]", ":", "return", "self", ".", "_transactions_since", "(", "self", ".", "_deposits_since", ",", "'deposits'", ",", "since", ")" ]
Fetch all deposits since the given timestamp.
[ "Fetch", "all", "deposits", "since", "the", "given", "timestamp", "." ]
8cb68bb8d0b5f822108db1cc5dae336e3d3c3452
https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/contrib/clients.py#L304-L306
train
budacom/trading-bots
trading_bots/contrib/clients.py
WalletClient.fetch_withdrawals
def fetch_withdrawals(self, limit: int) -> List[Withdrawal]: """Fetch latest withdrawals, must provide a limit.""" return self._transactions(self._withdrawals, 'withdrawals', limit)
python
def fetch_withdrawals(self, limit: int) -> List[Withdrawal]: """Fetch latest withdrawals, must provide a limit.""" return self._transactions(self._withdrawals, 'withdrawals', limit)
[ "def", "fetch_withdrawals", "(", "self", ",", "limit", ":", "int", ")", "->", "List", "[", "Withdrawal", "]", ":", "return", "self", ".", "_transactions", "(", "self", ".", "_withdrawals", ",", "'withdrawals'", ",", "limit", ")" ]
Fetch latest withdrawals, must provide a limit.
[ "Fetch", "latest", "withdrawals", "must", "provide", "a", "limit", "." ]
8cb68bb8d0b5f822108db1cc5dae336e3d3c3452
https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/contrib/clients.py#L313-L315
train
budacom/trading-bots
trading_bots/contrib/clients.py
WalletClient.fetch_withdrawals_since
def fetch_withdrawals_since(self, since: int) -> List[Withdrawal]: """Fetch all withdrawals since the given timestamp.""" return self._transactions_since(self._withdrawals_since, 'withdrawals', since)
python
def fetch_withdrawals_since(self, since: int) -> List[Withdrawal]: """Fetch all withdrawals since the given timestamp.""" return self._transactions_since(self._withdrawals_since, 'withdrawals', since)
[ "def", "fetch_withdrawals_since", "(", "self", ",", "since", ":", "int", ")", "->", "List", "[", "Withdrawal", "]", ":", "return", "self", ".", "_transactions_since", "(", "self", ".", "_withdrawals_since", ",", "'withdrawals'", ",", "since", ")" ]
Fetch all withdrawals since the given timestamp.
[ "Fetch", "all", "withdrawals", "since", "the", "given", "timestamp", "." ]
8cb68bb8d0b5f822108db1cc5dae336e3d3c3452
https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/contrib/clients.py#L325-L327
train
budacom/trading-bots
trading_bots/contrib/clients.py
WalletClient.request_withdrawal
def request_withdrawal(self, amount: Number, address: str, subtract_fee: bool=False, **params) -> Withdrawal: """Request a withdrawal.""" self.log.debug(f'Requesting {self.currency} withdrawal from {self.name} to {address}') amount = self._parse_money(amount) if self.dry_run: ...
python
def request_withdrawal(self, amount: Number, address: str, subtract_fee: bool=False, **params) -> Withdrawal: """Request a withdrawal.""" self.log.debug(f'Requesting {self.currency} withdrawal from {self.name} to {address}') amount = self._parse_money(amount) if self.dry_run: ...
[ "def", "request_withdrawal", "(", "self", ",", "amount", ":", "Number", ",", "address", ":", "str", ",", "subtract_fee", ":", "bool", "=", "False", ",", "**", "params", ")", "->", "Withdrawal", ":", "self", ".", "log", ".", "debug", "(", "f'Requesting {s...
Request a withdrawal.
[ "Request", "a", "withdrawal", "." ]
8cb68bb8d0b5f822108db1cc5dae336e3d3c3452
https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/contrib/clients.py#L346-L363
train
budacom/trading-bots
trading_bots/contrib/clients.py
TradingClient.fetch_order
def fetch_order(self, order_id: str) -> Order: """Fetch an order by ID.""" return self._fetch(f'order id={order_id}', exc=OrderNotFound)(self._order)(order_id)
python
def fetch_order(self, order_id: str) -> Order: """Fetch an order by ID.""" return self._fetch(f'order id={order_id}', exc=OrderNotFound)(self._order)(order_id)
[ "def", "fetch_order", "(", "self", ",", "order_id", ":", "str", ")", "->", "Order", ":", "return", "self", ".", "_fetch", "(", "f'order id={order_id}'", ",", "exc", "=", "OrderNotFound", ")", "(", "self", ".", "_order", ")", "(", "order_id", ")" ]
Fetch an order by ID.
[ "Fetch", "an", "order", "by", "ID", "." ]
8cb68bb8d0b5f822108db1cc5dae336e3d3c3452
https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/contrib/clients.py#L410-L412
train
budacom/trading-bots
trading_bots/contrib/clients.py
TradingClient.fetch_open_orders
def fetch_open_orders(self, limit: int) -> List[Order]: """Fetch latest open orders, must provide a limit.""" return self._fetch_orders_limit(self._open_orders, limit)
python
def fetch_open_orders(self, limit: int) -> List[Order]: """Fetch latest open orders, must provide a limit.""" return self._fetch_orders_limit(self._open_orders, limit)
[ "def", "fetch_open_orders", "(", "self", ",", "limit", ":", "int", ")", "->", "List", "[", "Order", "]", ":", "return", "self", ".", "_fetch_orders_limit", "(", "self", ".", "_open_orders", ",", "limit", ")" ]
Fetch latest open orders, must provide a limit.
[ "Fetch", "latest", "open", "orders", "must", "provide", "a", "limit", "." ]
8cb68bb8d0b5f822108db1cc5dae336e3d3c3452
https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/contrib/clients.py#L424-L426
train
budacom/trading-bots
trading_bots/contrib/clients.py
TradingClient.fetch_closed_orders
def fetch_closed_orders(self, limit: int) -> List[Order]: """Fetch latest closed orders, must provide a limit.""" return self._fetch_orders_limit(self._closed_orders, limit)
python
def fetch_closed_orders(self, limit: int) -> List[Order]: """Fetch latest closed orders, must provide a limit.""" return self._fetch_orders_limit(self._closed_orders, limit)
[ "def", "fetch_closed_orders", "(", "self", ",", "limit", ":", "int", ")", "->", "List", "[", "Order", "]", ":", "return", "self", ".", "_fetch_orders_limit", "(", "self", ".", "_closed_orders", ",", "limit", ")" ]
Fetch latest closed orders, must provide a limit.
[ "Fetch", "latest", "closed", "orders", "must", "provide", "a", "limit", "." ]
8cb68bb8d0b5f822108db1cc5dae336e3d3c3452
https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/contrib/clients.py#L436-L438
train
budacom/trading-bots
trading_bots/contrib/clients.py
TradingClient.fetch_closed_orders_since
def fetch_closed_orders_since(self, since: int) -> List[Order]: """Fetch closed orders since the given timestamp.""" return self._fetch_orders_since(self._closed_orders_since, since)
python
def fetch_closed_orders_since(self, since: int) -> List[Order]: """Fetch closed orders since the given timestamp.""" return self._fetch_orders_since(self._closed_orders_since, since)
[ "def", "fetch_closed_orders_since", "(", "self", ",", "since", ":", "int", ")", "->", "List", "[", "Order", "]", ":", "return", "self", ".", "_fetch_orders_since", "(", "self", ".", "_closed_orders_since", ",", "since", ")" ]
Fetch closed orders since the given timestamp.
[ "Fetch", "closed", "orders", "since", "the", "given", "timestamp", "." ]
8cb68bb8d0b5f822108db1cc5dae336e3d3c3452
https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/contrib/clients.py#L448-L450
train
budacom/trading-bots
trading_bots/contrib/clients.py
TradingClient.cancel_order
def cancel_order(self, order_id: str) -> str: """Cancel an order by ID.""" self.log.debug(f'Canceling order id={order_id} on {self.name}') if self.dry_run: # Don't cancel if dry run self.log.warning(f'DRY RUN: Order cancelled on {self.name}: id={order_id}') return order...
python
def cancel_order(self, order_id: str) -> str: """Cancel an order by ID.""" self.log.debug(f'Canceling order id={order_id} on {self.name}') if self.dry_run: # Don't cancel if dry run self.log.warning(f'DRY RUN: Order cancelled on {self.name}: id={order_id}') return order...
[ "def", "cancel_order", "(", "self", ",", "order_id", ":", "str", ")", "->", "str", ":", "self", ".", "log", ".", "debug", "(", "f'Canceling order id={order_id} on {self.name}'", ")", "if", "self", ".", "dry_run", ":", "self", ".", "log", ".", "warning", "(...
Cancel an order by ID.
[ "Cancel", "an", "order", "by", "ID", "." ]
8cb68bb8d0b5f822108db1cc5dae336e3d3c3452
https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/contrib/clients.py#L456-L470
train
budacom/trading-bots
trading_bots/contrib/clients.py
TradingClient.cancel_orders
def cancel_orders(self, order_ids: List[str]) -> List[str]: """Cancel multiple orders by a list of IDs.""" orders_to_cancel = order_ids self.log.debug(f'Canceling orders on {self.name}: ids={orders_to_cancel}') cancelled_orders = [] if self.dry_run: # Don't cancel if dry run ...
python
def cancel_orders(self, order_ids: List[str]) -> List[str]: """Cancel multiple orders by a list of IDs.""" orders_to_cancel = order_ids self.log.debug(f'Canceling orders on {self.name}: ids={orders_to_cancel}') cancelled_orders = [] if self.dry_run: # Don't cancel if dry run ...
[ "def", "cancel_orders", "(", "self", ",", "order_ids", ":", "List", "[", "str", "]", ")", "->", "List", "[", "str", "]", ":", "orders_to_cancel", "=", "order_ids", "self", ".", "log", ".", "debug", "(", "f'Canceling orders on {self.name}: ids={orders_to_cancel}'...
Cancel multiple orders by a list of IDs.
[ "Cancel", "multiple", "orders", "by", "a", "list", "of", "IDs", "." ]
8cb68bb8d0b5f822108db1cc5dae336e3d3c3452
https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/contrib/clients.py#L476-L501
train
budacom/trading-bots
trading_bots/contrib/clients.py
TradingClient.cancel_all_orders
def cancel_all_orders(self) -> List[str]: """Cancel all open orders.""" order_ids = [o.id for o in self.fetch_all_open_orders()] return self.cancel_orders(order_ids)
python
def cancel_all_orders(self) -> List[str]: """Cancel all open orders.""" order_ids = [o.id for o in self.fetch_all_open_orders()] return self.cancel_orders(order_ids)
[ "def", "cancel_all_orders", "(", "self", ")", "->", "List", "[", "str", "]", ":", "order_ids", "=", "[", "o", ".", "id", "for", "o", "in", "self", ".", "fetch_all_open_orders", "(", ")", "]", "return", "self", ".", "cancel_orders", "(", "order_ids", ")...
Cancel all open orders.
[ "Cancel", "all", "open", "orders", "." ]
8cb68bb8d0b5f822108db1cc5dae336e3d3c3452
https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/contrib/clients.py#L503-L506
train
budacom/trading-bots
trading_bots/contrib/clients.py
TradingClient.min_order_amount
def min_order_amount(self) -> Money: """Minimum amount to place an order.""" return self._fetch('minimum order amount', self.market.code)(self._min_order_amount)()
python
def min_order_amount(self) -> Money: """Minimum amount to place an order.""" return self._fetch('minimum order amount', self.market.code)(self._min_order_amount)()
[ "def", "min_order_amount", "(", "self", ")", "->", "Money", ":", "return", "self", ".", "_fetch", "(", "'minimum order amount'", ",", "self", ".", "market", ".", "code", ")", "(", "self", ".", "_min_order_amount", ")", "(", ")" ]
Minimum amount to place an order.
[ "Minimum", "amount", "to", "place", "an", "order", "." ]
8cb68bb8d0b5f822108db1cc5dae336e3d3c3452
https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/contrib/clients.py#L517-L519
train
budacom/trading-bots
trading_bots/contrib/clients.py
TradingClient.place_market_order
def place_market_order(self, side: Side, amount: Number) -> Order: """Place a market order.""" return self.place_order(side, OrderType.MARKET, amount)
python
def place_market_order(self, side: Side, amount: Number) -> Order: """Place a market order.""" return self.place_order(side, OrderType.MARKET, amount)
[ "def", "place_market_order", "(", "self", ",", "side", ":", "Side", ",", "amount", ":", "Number", ")", "->", "Order", ":", "return", "self", ".", "place_order", "(", "side", ",", "OrderType", ".", "MARKET", ",", "amount", ")" ]
Place a market order.
[ "Place", "a", "market", "order", "." ]
8cb68bb8d0b5f822108db1cc5dae336e3d3c3452
https://github.com/budacom/trading-bots/blob/8cb68bb8d0b5f822108db1cc5dae336e3d3c3452/trading_bots/contrib/clients.py#L552-L554
train
BD2KGenomics/protect
attic/encrypt_files_in_dir_to_s3.py
main
def main(): """ This is the main module for the script. The script will accept a file, or a directory, and then encrypt it with a provided key before pushing it to S3 into a specified bucket. """ parser = argparse.ArgumentParser(description=main.__doc__, add_help=True) parser.add_argument('-M',...
python
def main(): """ This is the main module for the script. The script will accept a file, or a directory, and then encrypt it with a provided key before pushing it to S3 into a specified bucket. """ parser = argparse.ArgumentParser(description=main.__doc__, add_help=True) parser.add_argument('-M',...
[ "def", "main", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "main", ".", "__doc__", ",", "add_help", "=", "True", ")", "parser", ".", "add_argument", "(", "'-M'", ",", "'--master_key'", ",", "dest", "=", "'mas...
This is the main module for the script. The script will accept a file, or a directory, and then encrypt it with a provided key before pushing it to S3 into a specified bucket.
[ "This", "is", "the", "main", "module", "for", "the", "script", ".", "The", "script", "will", "accept", "a", "file", "or", "a", "directory", "and", "then", "encrypt", "it", "with", "a", "provided", "key", "before", "pushing", "it", "to", "S3", "into", "...
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/encrypt_files_in_dir_to_s3.py#L157-L190
train
BD2KGenomics/protect
attic/encrypt_files_in_dir_to_s3.py
BucketInfo._get_bucket_endpoint
def _get_bucket_endpoint(self): """ Queries S3 to identify the region hosting the provided bucket. """ conn = S3Connection() bucket = conn.lookup(self.bucket_name) if not bucket: # TODO: Make the bucket here? raise InputParameterError('The provided...
python
def _get_bucket_endpoint(self): """ Queries S3 to identify the region hosting the provided bucket. """ conn = S3Connection() bucket = conn.lookup(self.bucket_name) if not bucket: # TODO: Make the bucket here? raise InputParameterError('The provided...
[ "def", "_get_bucket_endpoint", "(", "self", ")", ":", "conn", "=", "S3Connection", "(", ")", "bucket", "=", "conn", ".", "lookup", "(", "self", ".", "bucket_name", ")", "if", "not", "bucket", ":", "raise", "InputParameterError", "(", "'The provided bucket %s d...
Queries S3 to identify the region hosting the provided bucket.
[ "Queries", "S3", "to", "identify", "the", "region", "hosting", "the", "provided", "bucket", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/attic/encrypt_files_in_dir_to_s3.py#L82-L92
train
BD2KGenomics/protect
src/protect/alignment/rna.py
align_rna
def align_rna(job, fastqs, univ_options, star_options): """ A wrapper for the entire rna alignment subgraph. :param list fastqs: The input fastqs for alignment :param dict univ_options: Dict of universal options used by almost all tools :param dict star_options: Options specific to star :return...
python
def align_rna(job, fastqs, univ_options, star_options): """ A wrapper for the entire rna alignment subgraph. :param list fastqs: The input fastqs for alignment :param dict univ_options: Dict of universal options used by almost all tools :param dict star_options: Options specific to star :return...
[ "def", "align_rna", "(", "job", ",", "fastqs", ",", "univ_options", ",", "star_options", ")", ":", "star", "=", "job", ".", "wrapJobFn", "(", "run_star", ",", "fastqs", ",", "univ_options", ",", "star_options", ",", "cores", "=", "star_options", "[", "'n'"...
A wrapper for the entire rna alignment subgraph. :param list fastqs: The input fastqs for alignment :param dict univ_options: Dict of universal options used by almost all tools :param dict star_options: Options specific to star :return: Dict containing input bam and the generated index (.bam.bai) :...
[ "A", "wrapper", "for", "the", "entire", "rna", "alignment", "subgraph", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/alignment/rna.py#L39-L58
train
BD2KGenomics/protect
src/protect/alignment/rna.py
run_star
def run_star(job, fastqs, univ_options, star_options): """ Align a pair of fastqs with STAR. :param list fastqs: The input fastqs for alignment :param dict univ_options: Dict of universal options used by almost all tools :param dict star_options: Options specific to star :return: Dict containin...
python
def run_star(job, fastqs, univ_options, star_options): """ Align a pair of fastqs with STAR. :param list fastqs: The input fastqs for alignment :param dict univ_options: Dict of universal options used by almost all tools :param dict star_options: Options specific to star :return: Dict containin...
[ "def", "run_star", "(", "job", ",", "fastqs", ",", "univ_options", ",", "star_options", ")", ":", "assert", "star_options", "[", "'type'", "]", "in", "(", "'star'", ",", "'starlong'", ")", "work_dir", "=", "os", ".", "getcwd", "(", ")", "input_files", "=...
Align a pair of fastqs with STAR. :param list fastqs: The input fastqs for alignment :param dict univ_options: Dict of universal options used by almost all tools :param dict star_options: Options specific to star :return: Dict containing output genome bam, genome bai, and transcriptome bam ...
[ "Align", "a", "pair", "of", "fastqs", "with", "STAR", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/alignment/rna.py#L61-L138
train
BD2KGenomics/protect
src/protect/alignment/rna.py
sort_and_index_star
def sort_and_index_star(job, star_bams, univ_options, star_options): """ A wrapper for sorting and indexing the genomic star bam generated by run_star. It is required since run_star returns a dict of 2 bams :param dict star_bams: The bams from run_star :param dict univ_options: Dict of universal op...
python
def sort_and_index_star(job, star_bams, univ_options, star_options): """ A wrapper for sorting and indexing the genomic star bam generated by run_star. It is required since run_star returns a dict of 2 bams :param dict star_bams: The bams from run_star :param dict univ_options: Dict of universal op...
[ "def", "sort_and_index_star", "(", "job", ",", "star_bams", ",", "univ_options", ",", "star_options", ")", ":", "star_options", "[", "'samtools'", "]", "[", "'n'", "]", "=", "star_options", "[", "'n'", "]", "sort", "=", "job", ".", "wrapJobFn", "(", "sort_...
A wrapper for sorting and indexing the genomic star bam generated by run_star. It is required since run_star returns a dict of 2 bams :param dict star_bams: The bams from run_star :param dict univ_options: Dict of universal options used by almost all tools :param dict star_options: Options specific to ...
[ "A", "wrapper", "for", "sorting", "and", "indexing", "the", "genomic", "star", "bam", "generated", "by", "run_star", ".", "It", "is", "required", "since", "run_star", "returns", "a", "dict", "of", "2", "bams" ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/alignment/rna.py#L141-L169
train
drslump/pyshould
pyshould/expectation.py
Expectation.reset
def reset(self): """ Resets the state of the expression """ self.expr = [] self.matcher = None self.last_matcher = None self.description = None
python
def reset(self): """ Resets the state of the expression """ self.expr = [] self.matcher = None self.last_matcher = None self.description = None
[ "def", "reset", "(", "self", ")", ":", "self", ".", "expr", "=", "[", "]", "self", ".", "matcher", "=", "None", "self", ".", "last_matcher", "=", "None", "self", ".", "description", "=", "None" ]
Resets the state of the expression
[ "Resets", "the", "state", "of", "the", "expression" ]
7210859d4c84cfbaa64f91b30c2a541aea788ddf
https://github.com/drslump/pyshould/blob/7210859d4c84cfbaa64f91b30c2a541aea788ddf/pyshould/expectation.py#L44-L49
train
drslump/pyshould
pyshould/expectation.py
Expectation.clone
def clone(self): """ Clone this expression """ from copy import copy clone = copy(self) clone.expr = copy(self.expr) clone.factory = False return clone
python
def clone(self): """ Clone this expression """ from copy import copy clone = copy(self) clone.expr = copy(self.expr) clone.factory = False return clone
[ "def", "clone", "(", "self", ")", ":", "from", "copy", "import", "copy", "clone", "=", "copy", "(", "self", ")", "clone", ".", "expr", "=", "copy", "(", "self", ".", "expr", ")", "clone", ".", "factory", "=", "False", "return", "clone" ]
Clone this expression
[ "Clone", "this", "expression" ]
7210859d4c84cfbaa64f91b30c2a541aea788ddf
https://github.com/drslump/pyshould/blob/7210859d4c84cfbaa64f91b30c2a541aea788ddf/pyshould/expectation.py#L51-L57
train
drslump/pyshould
pyshould/expectation.py
Expectation.resolve
def resolve(self, value=None): """ Resolve the current expression against the supplied value """ # If we still have an uninitialized matcher init it now if self.matcher: self._init_matcher() # Evaluate the current set of matchers forming the expression matcher = sel...
python
def resolve(self, value=None): """ Resolve the current expression against the supplied value """ # If we still have an uninitialized matcher init it now if self.matcher: self._init_matcher() # Evaluate the current set of matchers forming the expression matcher = sel...
[ "def", "resolve", "(", "self", ",", "value", "=", "None", ")", ":", "if", "self", ".", "matcher", ":", "self", ".", "_init_matcher", "(", ")", "matcher", "=", "self", ".", "evaluate", "(", ")", "try", ":", "value", "=", "self", ".", "_transform", "...
Resolve the current expression against the supplied value
[ "Resolve", "the", "current", "expression", "against", "the", "supplied", "value" ]
7210859d4c84cfbaa64f91b30c2a541aea788ddf
https://github.com/drslump/pyshould/blob/7210859d4c84cfbaa64f91b30c2a541aea788ddf/pyshould/expectation.py#L81-L100
train
drslump/pyshould
pyshould/expectation.py
Expectation._assertion
def _assertion(self, matcher, value): """ Perform the actual assertion for the given matcher and value. Override this method to apply a special configuration when performing the assertion. If the assertion fails it should raise an AssertionError. """ # To support the synt...
python
def _assertion(self, matcher, value): """ Perform the actual assertion for the given matcher and value. Override this method to apply a special configuration when performing the assertion. If the assertion fails it should raise an AssertionError. """ # To support the synt...
[ "def", "_assertion", "(", "self", ",", "matcher", ",", "value", ")", ":", "if", "isinstance", "(", "value", ",", "Expectation", ")", ":", "assertion", "=", "value", ".", "_assertion", ".", "__get__", "(", "self", ",", "Expectation", ")", "assertion", "("...
Perform the actual assertion for the given matcher and value. Override this method to apply a special configuration when performing the assertion. If the assertion fails it should raise an AssertionError.
[ "Perform", "the", "actual", "assertion", "for", "the", "given", "matcher", "and", "value", ".", "Override", "this", "method", "to", "apply", "a", "special", "configuration", "when", "performing", "the", "assertion", ".", "If", "the", "assertion", "fails", "it"...
7210859d4c84cfbaa64f91b30c2a541aea788ddf
https://github.com/drslump/pyshould/blob/7210859d4c84cfbaa64f91b30c2a541aea788ddf/pyshould/expectation.py#L102-L114
train
drslump/pyshould
pyshould/expectation.py
Expectation._transform
def _transform(self, value): """ Applies any defined transformation to the given value """ if self.transform: try: value = self.transform(value) except: import sys exc_type, exc_obj, exc_tb = sys.exc_info() r...
python
def _transform(self, value): """ Applies any defined transformation to the given value """ if self.transform: try: value = self.transform(value) except: import sys exc_type, exc_obj, exc_tb = sys.exc_info() r...
[ "def", "_transform", "(", "self", ",", "value", ")", ":", "if", "self", ".", "transform", ":", "try", ":", "value", "=", "self", ".", "transform", "(", "value", ")", "except", ":", "import", "sys", "exc_type", ",", "exc_obj", ",", "exc_tb", "=", "sys...
Applies any defined transformation to the given value
[ "Applies", "any", "defined", "transformation", "to", "the", "given", "value" ]
7210859d4c84cfbaa64f91b30c2a541aea788ddf
https://github.com/drslump/pyshould/blob/7210859d4c84cfbaa64f91b30c2a541aea788ddf/pyshould/expectation.py#L116-L128
train
drslump/pyshould
pyshould/expectation.py
Expectation.evaluate
def evaluate(self): """ Converts the current expression into a single matcher, applying coordination operators to operands according to their binding rules """ # Apply Shunting Yard algorithm to convert the infix expression # into Reverse Polish Notation. Since we have a ver...
python
def evaluate(self): """ Converts the current expression into a single matcher, applying coordination operators to operands according to their binding rules """ # Apply Shunting Yard algorithm to convert the infix expression # into Reverse Polish Notation. Since we have a ver...
[ "def", "evaluate", "(", "self", ")", ":", "ops", "=", "[", "]", "rpn", "=", "[", "]", "for", "token", "in", "self", ".", "expr", ":", "if", "isinstance", "(", "token", ",", "int", ")", ":", "while", "len", "(", "ops", ")", "and", "token", "<=",...
Converts the current expression into a single matcher, applying coordination operators to operands according to their binding rules
[ "Converts", "the", "current", "expression", "into", "a", "single", "matcher", "applying", "coordination", "operators", "to", "operands", "according", "to", "their", "binding", "rules" ]
7210859d4c84cfbaa64f91b30c2a541aea788ddf
https://github.com/drslump/pyshould/blob/7210859d4c84cfbaa64f91b30c2a541aea788ddf/pyshould/expectation.py#L130-L186
train
drslump/pyshould
pyshould/expectation.py
Expectation._find_matcher
def _find_matcher(self, alias): """ Finds a matcher based on the given alias or raises an error if no matcher could be found. """ matcher = lookup(alias) if not matcher: msg = 'Matcher "%s" not found' % alias # Try to find similarly named matchers to ...
python
def _find_matcher(self, alias): """ Finds a matcher based on the given alias or raises an error if no matcher could be found. """ matcher = lookup(alias) if not matcher: msg = 'Matcher "%s" not found' % alias # Try to find similarly named matchers to ...
[ "def", "_find_matcher", "(", "self", ",", "alias", ")", ":", "matcher", "=", "lookup", "(", "alias", ")", "if", "not", "matcher", ":", "msg", "=", "'Matcher \"%s\" not found'", "%", "alias", "similar", "=", "suggest", "(", "alias", ",", "max", "=", "3", ...
Finds a matcher based on the given alias or raises an error if no matcher could be found.
[ "Finds", "a", "matcher", "based", "on", "the", "given", "alias", "or", "raises", "an", "error", "if", "no", "matcher", "could", "be", "found", "." ]
7210859d4c84cfbaa64f91b30c2a541aea788ddf
https://github.com/drslump/pyshould/blob/7210859d4c84cfbaa64f91b30c2a541aea788ddf/pyshould/expectation.py#L188-L206
train
drslump/pyshould
pyshould/expectation.py
Expectation._init_matcher
def _init_matcher(self, *args, **kwargs): """ Executes the current matcher appending it to the expression """ # If subject-less expectation are provided as arguments convert them # to plain Hamcrest matchers in order to allow complex compositions fn = lambda x: x.evaluate() if isinstanc...
python
def _init_matcher(self, *args, **kwargs): """ Executes the current matcher appending it to the expression """ # If subject-less expectation are provided as arguments convert them # to plain Hamcrest matchers in order to allow complex compositions fn = lambda x: x.evaluate() if isinstanc...
[ "def", "_init_matcher", "(", "self", ",", "*", "args", ",", "**", "kwargs", ")", ":", "fn", "=", "lambda", "x", ":", "x", ".", "evaluate", "(", ")", "if", "isinstance", "(", "x", ",", "Expectation", ")", "else", "x", "args", "=", "[", "fn", "(", ...
Executes the current matcher appending it to the expression
[ "Executes", "the", "current", "matcher", "appending", "it", "to", "the", "expression" ]
7210859d4c84cfbaa64f91b30c2a541aea788ddf
https://github.com/drslump/pyshould/blob/7210859d4c84cfbaa64f91b30c2a541aea788ddf/pyshould/expectation.py#L208-L220
train
drslump/pyshould
pyshould/expectation.py
Expectation.described_as
def described_as(self, description, *args): """ Specify a custom message for the matcher """ if len(args): description = description.format(*args) self.description = description return self
python
def described_as(self, description, *args): """ Specify a custom message for the matcher """ if len(args): description = description.format(*args) self.description = description return self
[ "def", "described_as", "(", "self", ",", "description", ",", "*", "args", ")", ":", "if", "len", "(", "args", ")", ":", "description", "=", "description", ".", "format", "(", "*", "args", ")", "self", ".", "description", "=", "description", "return", "...
Specify a custom message for the matcher
[ "Specify", "a", "custom", "message", "for", "the", "matcher" ]
7210859d4c84cfbaa64f91b30c2a541aea788ddf
https://github.com/drslump/pyshould/blob/7210859d4c84cfbaa64f91b30c2a541aea788ddf/pyshould/expectation.py#L222-L227
train
bkg/django-spillway
spillway/carto.py
make_dbsource
def make_dbsource(**kwargs): """Returns a mapnik PostGIS or SQLite Datasource.""" if 'spatialite' in connection.settings_dict.get('ENGINE'): kwargs.setdefault('file', connection.settings_dict['NAME']) return mapnik.SQLite(wkb_format='spatialite', **kwargs) names = (('dbname', 'NAME'), ('user...
python
def make_dbsource(**kwargs): """Returns a mapnik PostGIS or SQLite Datasource.""" if 'spatialite' in connection.settings_dict.get('ENGINE'): kwargs.setdefault('file', connection.settings_dict['NAME']) return mapnik.SQLite(wkb_format='spatialite', **kwargs) names = (('dbname', 'NAME'), ('user...
[ "def", "make_dbsource", "(", "**", "kwargs", ")", ":", "if", "'spatialite'", "in", "connection", ".", "settings_dict", ".", "get", "(", "'ENGINE'", ")", ":", "kwargs", ".", "setdefault", "(", "'file'", ",", "connection", ".", "settings_dict", "[", "'NAME'", ...
Returns a mapnik PostGIS or SQLite Datasource.
[ "Returns", "a", "mapnik", "PostGIS", "or", "SQLite", "Datasource", "." ]
c488a62642430b005f1e0d4a19e160d8d5964b67
https://github.com/bkg/django-spillway/blob/c488a62642430b005f1e0d4a19e160d8d5964b67/spillway/carto.py#L10-L21
train
bkg/django-spillway
spillway/carto.py
Map.layer
def layer(self, queryset, stylename=None): """Returns a map Layer. Arguments: queryset -- QuerySet for Layer Keyword args: stylename -- str name of style to apply """ cls = RasterLayer if hasattr(queryset, 'image') else VectorLayer layer = cls(queryset, s...
python
def layer(self, queryset, stylename=None): """Returns a map Layer. Arguments: queryset -- QuerySet for Layer Keyword args: stylename -- str name of style to apply """ cls = RasterLayer if hasattr(queryset, 'image') else VectorLayer layer = cls(queryset, s...
[ "def", "layer", "(", "self", ",", "queryset", ",", "stylename", "=", "None", ")", ":", "cls", "=", "RasterLayer", "if", "hasattr", "(", "queryset", ",", "'image'", ")", "else", "VectorLayer", "layer", "=", "cls", "(", "queryset", ",", "style", "=", "st...
Returns a map Layer. Arguments: queryset -- QuerySet for Layer Keyword args: stylename -- str name of style to apply
[ "Returns", "a", "map", "Layer", "." ]
c488a62642430b005f1e0d4a19e160d8d5964b67
https://github.com/bkg/django-spillway/blob/c488a62642430b005f1e0d4a19e160d8d5964b67/spillway/carto.py#L56-L72
train
bkg/django-spillway
spillway/carto.py
Map.zoom_bbox
def zoom_bbox(self, bbox): """Zoom map to geometry extent. Arguments: bbox -- OGRGeometry polygon to zoom map extent """ try: bbox.transform(self.map.srs) except gdal.GDALException: pass else: self.map.zoom_to_box(mapnik.Box2d(...
python
def zoom_bbox(self, bbox): """Zoom map to geometry extent. Arguments: bbox -- OGRGeometry polygon to zoom map extent """ try: bbox.transform(self.map.srs) except gdal.GDALException: pass else: self.map.zoom_to_box(mapnik.Box2d(...
[ "def", "zoom_bbox", "(", "self", ",", "bbox", ")", ":", "try", ":", "bbox", ".", "transform", "(", "self", ".", "map", ".", "srs", ")", "except", "gdal", ".", "GDALException", ":", "pass", "else", ":", "self", ".", "map", ".", "zoom_to_box", "(", "...
Zoom map to geometry extent. Arguments: bbox -- OGRGeometry polygon to zoom map extent
[ "Zoom", "map", "to", "geometry", "extent", "." ]
c488a62642430b005f1e0d4a19e160d8d5964b67
https://github.com/bkg/django-spillway/blob/c488a62642430b005f1e0d4a19e160d8d5964b67/spillway/carto.py#L79-L90
train
bkg/django-spillway
spillway/carto.py
Layer.style
def style(self): """Returns a default Style.""" style = mapnik.Style() rule = mapnik.Rule() self._symbolizer = self.symbolizer() rule.symbols.append(self._symbolizer) style.rules.append(rule) return style
python
def style(self): """Returns a default Style.""" style = mapnik.Style() rule = mapnik.Rule() self._symbolizer = self.symbolizer() rule.symbols.append(self._symbolizer) style.rules.append(rule) return style
[ "def", "style", "(", "self", ")", ":", "style", "=", "mapnik", ".", "Style", "(", ")", "rule", "=", "mapnik", ".", "Rule", "(", ")", "self", ".", "_symbolizer", "=", "self", ".", "symbolizer", "(", ")", "rule", ".", "symbols", ".", "append", "(", ...
Returns a default Style.
[ "Returns", "a", "default", "Style", "." ]
c488a62642430b005f1e0d4a19e160d8d5964b67
https://github.com/bkg/django-spillway/blob/c488a62642430b005f1e0d4a19e160d8d5964b67/spillway/carto.py#L99-L106
train
BD2KGenomics/protect
src/protect/mutation_calling/fusion.py
wrap_fusion
def wrap_fusion(job, fastqs, star_output, univ_options, star_fusion_options, fusion_inspector_options): """ A wrapper for run_fusion using the results from cutadapt and star as input. :param tuple fastqs: RNA-Seq FASTQ Filestor...
python
def wrap_fusion(job, fastqs, star_output, univ_options, star_fusion_options, fusion_inspector_options): """ A wrapper for run_fusion using the results from cutadapt and star as input. :param tuple fastqs: RNA-Seq FASTQ Filestor...
[ "def", "wrap_fusion", "(", "job", ",", "fastqs", ",", "star_output", ",", "univ_options", ",", "star_fusion_options", ",", "fusion_inspector_options", ")", ":", "if", "not", "star_fusion_options", "[", "'run'", "]", ":", "job", ".", "fileStore", ".", "logToMaste...
A wrapper for run_fusion using the results from cutadapt and star as input. :param tuple fastqs: RNA-Seq FASTQ Filestore IDs :param dict star_output: Dictionary containing STAR output files :param dict univ_options: universal arguments used by almost all tools :param dict star_fusion_options: STAR-Fusi...
[ "A", "wrapper", "for", "run_fusion", "using", "the", "results", "from", "cutadapt", "and", "star", "as", "input", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/fusion.py#L38-L70
train
BD2KGenomics/protect
src/protect/mutation_calling/fusion.py
parse_star_fusion
def parse_star_fusion(infile): """ Parses STAR-Fusion format and returns an Expando object with basic features :param str infile: path to STAR-Fusion prediction file :return: Fusion prediction attributes :rtype: bd2k.util.expando.Expando """ reader = csv.reader(infile, delimiter='\t') h...
python
def parse_star_fusion(infile): """ Parses STAR-Fusion format and returns an Expando object with basic features :param str infile: path to STAR-Fusion prediction file :return: Fusion prediction attributes :rtype: bd2k.util.expando.Expando """ reader = csv.reader(infile, delimiter='\t') h...
[ "def", "parse_star_fusion", "(", "infile", ")", ":", "reader", "=", "csv", ".", "reader", "(", "infile", ",", "delimiter", "=", "'\\t'", ")", "header", "=", "reader", ".", "next", "(", ")", "header", "=", "{", "key", ":", "index", "for", "index", ","...
Parses STAR-Fusion format and returns an Expando object with basic features :param str infile: path to STAR-Fusion prediction file :return: Fusion prediction attributes :rtype: bd2k.util.expando.Expando
[ "Parses", "STAR", "-", "Fusion", "format", "and", "returns", "an", "Expando", "object", "with", "basic", "features" ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/fusion.py#L235-L252
train
BD2KGenomics/protect
src/protect/mutation_calling/fusion.py
get_transcripts
def get_transcripts(transcript_file): """ Parses FusionInspector transcript file and returns dictionary of sequences :param str transcript_file: path to transcript FASTA :return: de novo assembled transcripts :rtype: dict """ with open(transcript_file, 'r') as fa: transcripts = {} ...
python
def get_transcripts(transcript_file): """ Parses FusionInspector transcript file and returns dictionary of sequences :param str transcript_file: path to transcript FASTA :return: de novo assembled transcripts :rtype: dict """ with open(transcript_file, 'r') as fa: transcripts = {} ...
[ "def", "get_transcripts", "(", "transcript_file", ")", ":", "with", "open", "(", "transcript_file", ",", "'r'", ")", "as", "fa", ":", "transcripts", "=", "{", "}", "regex_s", "=", "r\"(?P<ID>TRINITY.*)\\s(?P<fusion>.*--.*):(?P<left_start>\\d+)-(?P<right_start>\\d+)\"", ...
Parses FusionInspector transcript file and returns dictionary of sequences :param str transcript_file: path to transcript FASTA :return: de novo assembled transcripts :rtype: dict
[ "Parses", "FusionInspector", "transcript", "file", "and", "returns", "dictionary", "of", "sequences" ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/fusion.py#L255-L284
train
BD2KGenomics/protect
src/protect/mutation_calling/fusion.py
split_fusion_transcript
def split_fusion_transcript(annotation_path, transcripts): """ Finds the breakpoint in the fusion transcript and splits the 5' donor from the 3' acceptor :param str annotation_path: Path to transcript annotation file :param dict transcripts: Dictionary of fusion transcripts :return: 5' donor sequen...
python
def split_fusion_transcript(annotation_path, transcripts): """ Finds the breakpoint in the fusion transcript and splits the 5' donor from the 3' acceptor :param str annotation_path: Path to transcript annotation file :param dict transcripts: Dictionary of fusion transcripts :return: 5' donor sequen...
[ "def", "split_fusion_transcript", "(", "annotation_path", ",", "transcripts", ")", ":", "annotation", "=", "collections", ".", "defaultdict", "(", "dict", ")", "forward", "=", "'ACGTN'", "reverse", "=", "'TGCAN'", "trans", "=", "string", ".", "maketrans", "(", ...
Finds the breakpoint in the fusion transcript and splits the 5' donor from the 3' acceptor :param str annotation_path: Path to transcript annotation file :param dict transcripts: Dictionary of fusion transcripts :return: 5' donor sequences and 3' acceptor sequences :rtype: tuple
[ "Finds", "the", "breakpoint", "in", "the", "fusion", "transcript", "and", "splits", "the", "5", "donor", "from", "the", "3", "acceptor" ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/fusion.py#L287-L352
train
BD2KGenomics/protect
src/protect/mutation_calling/fusion.py
get_gene_ids
def get_gene_ids(fusion_bed): """ Parses FusionInspector bed file to ascertain the ENSEMBL gene ids :param str fusion_bed: path to fusion annotation :return: dict """ with open(fusion_bed, 'r') as f: gene_to_id = {} regex = re.compile(r'(?P<gene>ENSG\d*)') for line in f:...
python
def get_gene_ids(fusion_bed): """ Parses FusionInspector bed file to ascertain the ENSEMBL gene ids :param str fusion_bed: path to fusion annotation :return: dict """ with open(fusion_bed, 'r') as f: gene_to_id = {} regex = re.compile(r'(?P<gene>ENSG\d*)') for line in f:...
[ "def", "get_gene_ids", "(", "fusion_bed", ")", ":", "with", "open", "(", "fusion_bed", ",", "'r'", ")", "as", "f", ":", "gene_to_id", "=", "{", "}", "regex", "=", "re", ".", "compile", "(", "r'(?P<gene>ENSG\\d*)'", ")", "for", "line", "in", "f", ":", ...
Parses FusionInspector bed file to ascertain the ENSEMBL gene ids :param str fusion_bed: path to fusion annotation :return: dict
[ "Parses", "FusionInspector", "bed", "file", "to", "ascertain", "the", "ENSEMBL", "gene", "ids" ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/fusion.py#L355-L371
train
BD2KGenomics/protect
src/protect/mutation_calling/fusion.py
reformat_star_fusion_output
def reformat_star_fusion_output(job, fusion_annot, fusion_file, transcript_file, transcript_gff_file, univ_options): """ Writes STAR-Fusion results in T...
python
def reformat_star_fusion_output(job, fusion_annot, fusion_file, transcript_file, transcript_gff_file, univ_options): """ Writes STAR-Fusion results in T...
[ "def", "reformat_star_fusion_output", "(", "job", ",", "fusion_annot", ",", "fusion_file", ",", "transcript_file", ",", "transcript_gff_file", ",", "univ_options", ")", ":", "input_files", "=", "{", "'results.tsv'", ":", "fusion_file", ",", "'fusion.bed'", ":", "fus...
Writes STAR-Fusion results in Transgene BEDPE format :param toil.fileStore.FileID fusion_annot: Fusion annotation :param toil.fileStore.FileID fusion_file: STAR-fusion prediction file :param toil.fileStore.FileID transcript_file: Fusion transcript FASTA file :param toil.fileStore.FileID transcript_gff_...
[ "Writes", "STAR", "-", "Fusion", "results", "in", "Transgene", "BEDPE", "format" ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/fusion.py#L374-L467
train
BD2KGenomics/protect
src/protect/pipeline/ProTECT.py
_ensure_patient_group_is_ok
def _ensure_patient_group_is_ok(patient_object, patient_name=None): """ Ensure that the provided entries for the patient groups is formatted properly. :param set|dict patient_object: The values passed to the samples patient group :param str patient_name: Optional name for the set :raises ParameterE...
python
def _ensure_patient_group_is_ok(patient_object, patient_name=None): """ Ensure that the provided entries for the patient groups is formatted properly. :param set|dict patient_object: The values passed to the samples patient group :param str patient_name: Optional name for the set :raises ParameterE...
[ "def", "_ensure_patient_group_is_ok", "(", "patient_object", ",", "patient_name", "=", "None", ")", ":", "from", "protect", ".", "addons", ".", "common", "import", "TCGAToGTEx", "assert", "isinstance", "(", "patient_object", ",", "(", "set", ",", "dict", ")", ...
Ensure that the provided entries for the patient groups is formatted properly. :param set|dict patient_object: The values passed to the samples patient group :param str patient_name: Optional name for the set :raises ParameterError: If required entry doesnt exist
[ "Ensure", "that", "the", "provided", "entries", "for", "the", "patient", "groups", "is", "formatted", "properly", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/pipeline/ProTECT.py#L94-L148
train
BD2KGenomics/protect
src/protect/pipeline/ProTECT.py
_add_default_entries
def _add_default_entries(input_dict, defaults_dict): """ Add the entries in defaults dict into input_dict if they don't exist in input_dict This is based on the accepted answer at http://stackoverflow.com/questions/3232943/update-value-of-a-nested-dictionary-of-varying-depth :param dict input_dict...
python
def _add_default_entries(input_dict, defaults_dict): """ Add the entries in defaults dict into input_dict if they don't exist in input_dict This is based on the accepted answer at http://stackoverflow.com/questions/3232943/update-value-of-a-nested-dictionary-of-varying-depth :param dict input_dict...
[ "def", "_add_default_entries", "(", "input_dict", ",", "defaults_dict", ")", ":", "for", "key", ",", "value", "in", "defaults_dict", ".", "iteritems", "(", ")", ":", "if", "key", "==", "'patients'", ":", "print", "(", "'Cannot default `patients`.'", ")", "cont...
Add the entries in defaults dict into input_dict if they don't exist in input_dict This is based on the accepted answer at http://stackoverflow.com/questions/3232943/update-value-of-a-nested-dictionary-of-varying-depth :param dict input_dict: The dict to be updated :param dict defaults_dict: Dict cont...
[ "Add", "the", "entries", "in", "defaults", "dict", "into", "input_dict", "if", "they", "don", "t", "exist", "in", "input_dict" ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/pipeline/ProTECT.py#L151-L180
train
BD2KGenomics/protect
src/protect/pipeline/ProTECT.py
_process_group
def _process_group(input_group, required_group, groupname, append_subgroups=None): """ Process one group from the input yaml. Ensure it has the required entries. If there is a subgroup that should be processed and then appended to the rest of the subgroups in that group, handle it accordingly. :p...
python
def _process_group(input_group, required_group, groupname, append_subgroups=None): """ Process one group from the input yaml. Ensure it has the required entries. If there is a subgroup that should be processed and then appended to the rest of the subgroups in that group, handle it accordingly. :p...
[ "def", "_process_group", "(", "input_group", ",", "required_group", ",", "groupname", ",", "append_subgroups", "=", "None", ")", ":", "if", "append_subgroups", "is", "None", ":", "append_subgroups", "=", "[", "]", "tool_options", "=", "{", "}", "for", "key", ...
Process one group from the input yaml. Ensure it has the required entries. If there is a subgroup that should be processed and then appended to the rest of the subgroups in that group, handle it accordingly. :param dict input_group: The dict of values of the input group :param dict required_group: Th...
[ "Process", "one", "group", "from", "the", "input", "yaml", ".", "Ensure", "it", "has", "the", "required", "entries", ".", "If", "there", "is", "a", "subgroup", "that", "should", "be", "processed", "and", "then", "appended", "to", "the", "rest", "of", "th...
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/pipeline/ProTECT.py#L183-L211
train
BD2KGenomics/protect
src/protect/pipeline/ProTECT.py
get_fastq_2
def get_fastq_2(job, patient_id, sample_type, fastq_1): """ For a path to a fastq_1 file, return a fastq_2 file with the same prefix and naming scheme. :param str patient_id: The patient_id :param str sample_type: The sample type of the file :param str fastq_1: The path to the fastq_1 file :ret...
python
def get_fastq_2(job, patient_id, sample_type, fastq_1): """ For a path to a fastq_1 file, return a fastq_2 file with the same prefix and naming scheme. :param str patient_id: The patient_id :param str sample_type: The sample type of the file :param str fastq_1: The path to the fastq_1 file :ret...
[ "def", "get_fastq_2", "(", "job", ",", "patient_id", ",", "sample_type", ",", "fastq_1", ")", ":", "prefix", ",", "extn", "=", "fastq_1", ",", "'temp'", "final_extn", "=", "''", "while", "extn", ":", "prefix", ",", "extn", "=", "os", ".", "path", ".", ...
For a path to a fastq_1 file, return a fastq_2 file with the same prefix and naming scheme. :param str patient_id: The patient_id :param str sample_type: The sample type of the file :param str fastq_1: The path to the fastq_1 file :return: The path to the fastq_2 file :rtype: str
[ "For", "a", "path", "to", "a", "fastq_1", "file", "return", "a", "fastq_2", "file", "with", "the", "same", "prefix", "and", "naming", "scheme", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/pipeline/ProTECT.py#L214-L241
train
BD2KGenomics/protect
src/protect/pipeline/ProTECT.py
parse_config_file
def parse_config_file(job, config_file, max_cores=None): """ Parse the config file and spawn a ProTECT job for every input sample. :param str config_file: Path to the input config file :param int max_cores: The maximum cores to use for any single high-compute job. """ sample_set, univ_options, ...
python
def parse_config_file(job, config_file, max_cores=None): """ Parse the config file and spawn a ProTECT job for every input sample. :param str config_file: Path to the input config file :param int max_cores: The maximum cores to use for any single high-compute job. """ sample_set, univ_options, ...
[ "def", "parse_config_file", "(", "job", ",", "config_file", ",", "max_cores", "=", "None", ")", ":", "sample_set", ",", "univ_options", ",", "processed_tool_inputs", "=", "_parse_config_file", "(", "job", ",", "config_file", ",", "max_cores", ")", "for", "patien...
Parse the config file and spawn a ProTECT job for every input sample. :param str config_file: Path to the input config file :param int max_cores: The maximum cores to use for any single high-compute job.
[ "Parse", "the", "config", "file", "and", "spawn", "a", "ProTECT", "job", "for", "every", "input", "sample", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/pipeline/ProTECT.py#L436-L449
train
BD2KGenomics/protect
src/protect/pipeline/ProTECT.py
get_all_tool_inputs
def get_all_tool_inputs(job, tools, outer_key='', mutation_caller_list=None): """ Iterate through all the tool options and download required files from their remote locations. :param dict tools: A dict of dicts of all tools, and their options :param str outer_key: If this is being called recursively, w...
python
def get_all_tool_inputs(job, tools, outer_key='', mutation_caller_list=None): """ Iterate through all the tool options and download required files from their remote locations. :param dict tools: A dict of dicts of all tools, and their options :param str outer_key: If this is being called recursively, w...
[ "def", "get_all_tool_inputs", "(", "job", ",", "tools", ",", "outer_key", "=", "''", ",", "mutation_caller_list", "=", "None", ")", ":", "for", "tool", "in", "tools", ":", "for", "option", "in", "tools", "[", "tool", "]", ":", "if", "isinstance", "(", ...
Iterate through all the tool options and download required files from their remote locations. :param dict tools: A dict of dicts of all tools, and their options :param str outer_key: If this is being called recursively, what was the outer dict called? :param list mutation_caller_list: A list of mutation ca...
[ "Iterate", "through", "all", "the", "tool", "options", "and", "download", "required", "files", "from", "their", "remote", "locations", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/pipeline/ProTECT.py#L740-L774
train
BD2KGenomics/protect
src/protect/pipeline/ProTECT.py
get_pipeline_inputs
def get_pipeline_inputs(job, input_flag, input_file, encryption_key=None, per_file_encryption=False, gdc_download_token=None): """ Get the input file from s3 or disk and write to file store. :param str input_flag: The name of the flag :param str input_file: The value passed in t...
python
def get_pipeline_inputs(job, input_flag, input_file, encryption_key=None, per_file_encryption=False, gdc_download_token=None): """ Get the input file from s3 or disk and write to file store. :param str input_flag: The name of the flag :param str input_file: The value passed in t...
[ "def", "get_pipeline_inputs", "(", "job", ",", "input_flag", ",", "input_file", ",", "encryption_key", "=", "None", ",", "per_file_encryption", "=", "False", ",", "gdc_download_token", "=", "None", ")", ":", "work_dir", "=", "os", ".", "getcwd", "(", ")", "j...
Get the input file from s3 or disk and write to file store. :param str input_flag: The name of the flag :param str input_file: The value passed in the config file :param str encryption_key: Path to the encryption key if encrypted with sse-c :param bool per_file_encryption: If encrypted, was the file en...
[ "Get", "the", "input", "file", "from", "s3", "or", "disk", "and", "write", "to", "file", "store", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/pipeline/ProTECT.py#L777-L806
train
BD2KGenomics/protect
src/protect/pipeline/ProTECT.py
prepare_samples
def prepare_samples(job, patient_dict, univ_options): """ Obtain the input files for the patient and write them to the file store. :param dict patient_dict: The input fastq dict patient_dict: |- 'tumor_dna_fastq_[12]' OR 'tumor_dna_bam': str |- 'tumor_rna_fastq_[12]...
python
def prepare_samples(job, patient_dict, univ_options): """ Obtain the input files for the patient and write them to the file store. :param dict patient_dict: The input fastq dict patient_dict: |- 'tumor_dna_fastq_[12]' OR 'tumor_dna_bam': str |- 'tumor_rna_fastq_[12]...
[ "def", "prepare_samples", "(", "job", ",", "patient_dict", ",", "univ_options", ")", ":", "job", ".", "fileStore", ".", "logToMaster", "(", "'Downloading Inputs for %s'", "%", "univ_options", "[", "'patient'", "]", ")", "output_dict", "=", "{", "}", "for", "in...
Obtain the input files for the patient and write them to the file store. :param dict patient_dict: The input fastq dict patient_dict: |- 'tumor_dna_fastq_[12]' OR 'tumor_dna_bam': str |- 'tumor_rna_fastq_[12]' OR 'tumor_rna_bam': str |- 'normal_dna_fastq_[12]...
[ "Obtain", "the", "input", "files", "for", "the", "patient", "and", "write", "them", "to", "the", "file", "store", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/pipeline/ProTECT.py#L809-L845
train
BD2KGenomics/protect
src/protect/pipeline/ProTECT.py
get_patient_bams
def get_patient_bams(job, patient_dict, sample_type, univ_options, bwa_options, mutect_options): """ Convenience function to return the bam and its index in the correct format for a sample type. :param dict patient_dict: dict of patient info :param str sample_type: 'tumor_rna', 'tumor_dna', 'normal_dna...
python
def get_patient_bams(job, patient_dict, sample_type, univ_options, bwa_options, mutect_options): """ Convenience function to return the bam and its index in the correct format for a sample type. :param dict patient_dict: dict of patient info :param str sample_type: 'tumor_rna', 'tumor_dna', 'normal_dna...
[ "def", "get_patient_bams", "(", "job", ",", "patient_dict", ",", "sample_type", ",", "univ_options", ",", "bwa_options", ",", "mutect_options", ")", ":", "output_dict", "=", "{", "}", "if", "'dna'", "in", "sample_type", ":", "sample_info", "=", "'fix_pg_sorted'"...
Convenience function to return the bam and its index in the correct format for a sample type. :param dict patient_dict: dict of patient info :param str sample_type: 'tumor_rna', 'tumor_dna', 'normal_dna' :param dict univ_options: Dict of universal options used by almost all tools :param dict bwa_option...
[ "Convenience", "function", "to", "return", "the", "bam", "and", "its", "index", "in", "the", "correct", "format", "for", "a", "sample", "type", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/pipeline/ProTECT.py#L860-L901
train
BD2KGenomics/protect
src/protect/pipeline/ProTECT.py
get_patient_vcf
def get_patient_vcf(job, patient_dict): """ Convenience function to get the vcf from the patient dict :param dict patient_dict: dict of patient info :return: The vcf :rtype: toil.fileStore.FileID """ temp = job.fileStore.readGlobalFile(patient_dict['mutation_vcf'], ...
python
def get_patient_vcf(job, patient_dict): """ Convenience function to get the vcf from the patient dict :param dict patient_dict: dict of patient info :return: The vcf :rtype: toil.fileStore.FileID """ temp = job.fileStore.readGlobalFile(patient_dict['mutation_vcf'], ...
[ "def", "get_patient_vcf", "(", "job", ",", "patient_dict", ")", ":", "temp", "=", "job", ".", "fileStore", ".", "readGlobalFile", "(", "patient_dict", "[", "'mutation_vcf'", "]", ",", "os", ".", "path", ".", "join", "(", "os", ".", "getcwd", "(", ")", ...
Convenience function to get the vcf from the patient dict :param dict patient_dict: dict of patient info :return: The vcf :rtype: toil.fileStore.FileID
[ "Convenience", "function", "to", "get", "the", "vcf", "from", "the", "patient", "dict" ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/pipeline/ProTECT.py#L904-L919
train
BD2KGenomics/protect
src/protect/pipeline/ProTECT.py
get_patient_mhc_haplotype
def get_patient_mhc_haplotype(job, patient_dict): """ Convenience function to get the mhc haplotype from the patient dict :param dict patient_dict: dict of patient info :return: The MHCI and MHCII haplotypes :rtype: toil.fileStore.FileID """ haplotype_archive = job.fileStore.readGlobalFile(...
python
def get_patient_mhc_haplotype(job, patient_dict): """ Convenience function to get the mhc haplotype from the patient dict :param dict patient_dict: dict of patient info :return: The MHCI and MHCII haplotypes :rtype: toil.fileStore.FileID """ haplotype_archive = job.fileStore.readGlobalFile(...
[ "def", "get_patient_mhc_haplotype", "(", "job", ",", "patient_dict", ")", ":", "haplotype_archive", "=", "job", ".", "fileStore", ".", "readGlobalFile", "(", "patient_dict", "[", "'hla_haplotype_files'", "]", ")", "haplotype_archive", "=", "untargz", "(", "haplotype...
Convenience function to get the mhc haplotype from the patient dict :param dict patient_dict: dict of patient info :return: The MHCI and MHCII haplotypes :rtype: toil.fileStore.FileID
[ "Convenience", "function", "to", "get", "the", "mhc", "haplotype", "from", "the", "patient", "dict" ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/pipeline/ProTECT.py#L940-L954
train
BD2KGenomics/protect
src/protect/pipeline/ProTECT.py
get_patient_expression
def get_patient_expression(job, patient_dict): """ Convenience function to get the expression from the patient dict :param dict patient_dict: dict of patient info :return: The gene and isoform expression :rtype: toil.fileStore.FileID """ expression_archive = job.fileStore.readGlobalFile(pat...
python
def get_patient_expression(job, patient_dict): """ Convenience function to get the expression from the patient dict :param dict patient_dict: dict of patient info :return: The gene and isoform expression :rtype: toil.fileStore.FileID """ expression_archive = job.fileStore.readGlobalFile(pat...
[ "def", "get_patient_expression", "(", "job", ",", "patient_dict", ")", ":", "expression_archive", "=", "job", ".", "fileStore", ".", "readGlobalFile", "(", "patient_dict", "[", "'expression_files'", "]", ")", "expression_archive", "=", "untargz", "(", "expression_ar...
Convenience function to get the expression from the patient dict :param dict patient_dict: dict of patient info :return: The gene and isoform expression :rtype: toil.fileStore.FileID
[ "Convenience", "function", "to", "get", "the", "expression", "from", "the", "patient", "dict" ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/pipeline/ProTECT.py#L957-L971
train
BD2KGenomics/protect
src/protect/pipeline/ProTECT.py
generate_config_file
def generate_config_file(): """ Generate a config file for a ProTECT run on hg19. :return: None """ shutil.copy(os.path.join(os.path.dirname(__file__), 'input_parameters.yaml'), os.path.join(os.getcwd(), 'ProTECT_config.yaml'))
python
def generate_config_file(): """ Generate a config file for a ProTECT run on hg19. :return: None """ shutil.copy(os.path.join(os.path.dirname(__file__), 'input_parameters.yaml'), os.path.join(os.getcwd(), 'ProTECT_config.yaml'))
[ "def", "generate_config_file", "(", ")", ":", "shutil", ".", "copy", "(", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "dirname", "(", "__file__", ")", ",", "'input_parameters.yaml'", ")", ",", "os", ".", "path", ".", "join", "(", "os...
Generate a config file for a ProTECT run on hg19. :return: None
[ "Generate", "a", "config", "file", "for", "a", "ProTECT", "run", "on", "hg19", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/pipeline/ProTECT.py#L974-L981
train
BD2KGenomics/protect
src/protect/pipeline/ProTECT.py
main
def main(): """ This is the main function for ProTECT. """ parser = argparse.ArgumentParser(prog='ProTECT', description='Prediction of T-Cell Epitopes for Cancer Therapy', epilog='Contact Arjun Rao (aarao@ucsc.edu) if you encounte...
python
def main(): """ This is the main function for ProTECT. """ parser = argparse.ArgumentParser(prog='ProTECT', description='Prediction of T-Cell Epitopes for Cancer Therapy', epilog='Contact Arjun Rao (aarao@ucsc.edu) if you encounte...
[ "def", "main", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "prog", "=", "'ProTECT'", ",", "description", "=", "'Prediction of T-Cell Epitopes for Cancer Therapy'", ",", "epilog", "=", "'Contact Arjun Rao (aarao@ucsc.edu) if you encounter '", "'an...
This is the main function for ProTECT.
[ "This", "is", "the", "main", "function", "for", "ProTECT", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/pipeline/ProTECT.py#L984-L1026
train
jinglemansweep/lcdproc
lcdproc/server.py
Server.poll
def poll(self): """ Poll Check for a non-response string generated by LCDd and return any string read. LCDd generates strings for key presses, menu events & screen visibility changes. """ if select.select([self.tn], [], [], 0) == ([self.tn], [], []): ...
python
def poll(self): """ Poll Check for a non-response string generated by LCDd and return any string read. LCDd generates strings for key presses, menu events & screen visibility changes. """ if select.select([self.tn], [], [], 0) == ([self.tn], [], []): ...
[ "def", "poll", "(", "self", ")", ":", "if", "select", ".", "select", "(", "[", "self", ".", "tn", "]", ",", "[", "]", ",", "[", "]", ",", "0", ")", "==", "(", "[", "self", ".", "tn", "]", ",", "[", "]", ",", "[", "]", ")", ":", "respons...
Poll Check for a non-response string generated by LCDd and return any string read. LCDd generates strings for key presses, menu events & screen visibility changes.
[ "Poll", "Check", "for", "a", "non", "-", "response", "string", "generated", "by", "LCDd", "and", "return", "any", "string", "read", ".", "LCDd", "generates", "strings", "for", "key", "presses", "menu", "events", "&", "screen", "visibility", "changes", "." ]
973628fc326177c9deaf3f2e1a435159eb565ae0
https://github.com/jinglemansweep/lcdproc/blob/973628fc326177c9deaf3f2e1a435159eb565ae0/lcdproc/server.py#L61-L74
train
APSL/django-kaio
kaio/management/commands/generate_ini.py
module_to_dict
def module_to_dict(module, omittable=lambda k: k.startswith('_')): """ Converts a module namespace to a Python dictionary. Used by get_settings_diff. """ return dict([(k, repr(v)) for k, v in module.__dict__.items() if not omittable(k)])
python
def module_to_dict(module, omittable=lambda k: k.startswith('_')): """ Converts a module namespace to a Python dictionary. Used by get_settings_diff. """ return dict([(k, repr(v)) for k, v in module.__dict__.items() if not omittable(k)])
[ "def", "module_to_dict", "(", "module", ",", "omittable", "=", "lambda", "k", ":", "k", ".", "startswith", "(", "'_'", ")", ")", ":", "return", "dict", "(", "[", "(", "k", ",", "repr", "(", "v", ")", ")", "for", "k", ",", "v", "in", "module", "...
Converts a module namespace to a Python dictionary. Used by get_settings_diff.
[ "Converts", "a", "module", "namespace", "to", "a", "Python", "dictionary", ".", "Used", "by", "get_settings_diff", "." ]
b74b109bcfba31d973723bc419e2c95d190b80b7
https://github.com/APSL/django-kaio/blob/b74b109bcfba31d973723bc419e2c95d190b80b7/kaio/management/commands/generate_ini.py#L15-L19
train
BD2KGenomics/protect
src/protect/mutation_annotation/snpeff.py
run_snpeff
def run_snpeff(job, merged_mutation_file, univ_options, snpeff_options): """ Run snpeff on an input vcf. :param toil.fileStore.FileID merged_mutation_file: fsID for input vcf :param dict univ_options: Dict of universal options used by almost all tools :param dict snpeff_options: Options specific to...
python
def run_snpeff(job, merged_mutation_file, univ_options, snpeff_options): """ Run snpeff on an input vcf. :param toil.fileStore.FileID merged_mutation_file: fsID for input vcf :param dict univ_options: Dict of universal options used by almost all tools :param dict snpeff_options: Options specific to...
[ "def", "run_snpeff", "(", "job", ",", "merged_mutation_file", ",", "univ_options", ",", "snpeff_options", ")", ":", "work_dir", "=", "os", ".", "getcwd", "(", ")", "input_files", "=", "{", "'merged_mutations.vcf'", ":", "merged_mutation_file", ",", "'snpeff_index....
Run snpeff on an input vcf. :param toil.fileStore.FileID merged_mutation_file: fsID for input vcf :param dict univ_options: Dict of universal options used by almost all tools :param dict snpeff_options: Options specific to snpeff :return: fsID for the snpeffed vcf :rtype: toil.fileStore.FileID
[ "Run", "snpeff", "on", "an", "input", "vcf", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_annotation/snpeff.py#L32-L69
train
paypal/baler
baler/baler.py
paths_in_directory
def paths_in_directory(input_directory): """ Generate a list of all files in input_directory, each as a list containing path components. """ paths = [] for base_path, directories, filenames in os.walk(input_directory): relative_path = os.path.relpath(base_path, input_directory) path_...
python
def paths_in_directory(input_directory): """ Generate a list of all files in input_directory, each as a list containing path components. """ paths = [] for base_path, directories, filenames in os.walk(input_directory): relative_path = os.path.relpath(base_path, input_directory) path_...
[ "def", "paths_in_directory", "(", "input_directory", ")", ":", "paths", "=", "[", "]", "for", "base_path", ",", "directories", ",", "filenames", "in", "os", ".", "walk", "(", "input_directory", ")", ":", "relative_path", "=", "os", ".", "path", ".", "relpa...
Generate a list of all files in input_directory, each as a list containing path components.
[ "Generate", "a", "list", "of", "all", "files", "in", "input_directory", "each", "as", "a", "list", "containing", "path", "components", "." ]
db4f09dd2c7729b2df5268c87ad3b4cb43396abf
https://github.com/paypal/baler/blob/db4f09dd2c7729b2df5268c87ad3b4cb43396abf/baler/baler.py#L22-L41
train
BD2KGenomics/protect
src/protect/addons/assess_car_t_validity.py
run_car_t_validity_assessment
def run_car_t_validity_assessment(job, rsem_files, univ_options, reports_options): """ A wrapper for assess_car_t_validity. :param dict rsem_files: Results from running rsem :param dict univ_options: Dict of universal options used by almost all tools :param dict reports_options: Options specific to...
python
def run_car_t_validity_assessment(job, rsem_files, univ_options, reports_options): """ A wrapper for assess_car_t_validity. :param dict rsem_files: Results from running rsem :param dict univ_options: Dict of universal options used by almost all tools :param dict reports_options: Options specific to...
[ "def", "run_car_t_validity_assessment", "(", "job", ",", "rsem_files", ",", "univ_options", ",", "reports_options", ")", ":", "return", "job", ".", "addChildJobFn", "(", "assess_car_t_validity", ",", "rsem_files", "[", "'rsem.genes.results'", "]", ",", "univ_options",...
A wrapper for assess_car_t_validity. :param dict rsem_files: Results from running rsem :param dict univ_options: Dict of universal options used by almost all tools :param dict reports_options: Options specific to reporting modules :return: The results of running assess_car_t_validity :rtype: toil.f...
[ "A", "wrapper", "for", "assess_car_t_validity", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/addons/assess_car_t_validity.py#L25-L36
train
BD2KGenomics/protect
src/protect/alignment/dna.py
align_dna
def align_dna(job, fastqs, sample_type, univ_options, bwa_options): """ A wrapper for the entire dna alignment subgraph. :param list fastqs: The input fastqs for alignment :param str sample_type: Description of the sample to inject into the filename :param dict univ_options: Dict of universal optio...
python
def align_dna(job, fastqs, sample_type, univ_options, bwa_options): """ A wrapper for the entire dna alignment subgraph. :param list fastqs: The input fastqs for alignment :param str sample_type: Description of the sample to inject into the filename :param dict univ_options: Dict of universal optio...
[ "def", "align_dna", "(", "job", ",", "fastqs", ",", "sample_type", ",", "univ_options", ",", "bwa_options", ")", ":", "bwa", "=", "job", ".", "wrapJobFn", "(", "run_bwa", ",", "fastqs", ",", "sample_type", ",", "univ_options", ",", "bwa_options", ",", "dis...
A wrapper for the entire dna alignment subgraph. :param list fastqs: The input fastqs for alignment :param str sample_type: Description of the sample to inject into the filename :param dict univ_options: Dict of universal options used by almost all tools :param dict bwa_options: Options specific to bwa...
[ "A", "wrapper", "for", "the", "entire", "dna", "alignment", "subgraph", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/alignment/dna.py#L54-L103
train
BD2KGenomics/protect
src/protect/alignment/dna.py
run_bwa
def run_bwa(job, fastqs, sample_type, univ_options, bwa_options): """ Align a pair of fastqs with bwa. :param list fastqs: The input fastqs for alignment :param str sample_type: Description of the sample to inject into the filename :param dict univ_options: Dict of universal options used by almost ...
python
def run_bwa(job, fastqs, sample_type, univ_options, bwa_options): """ Align a pair of fastqs with bwa. :param list fastqs: The input fastqs for alignment :param str sample_type: Description of the sample to inject into the filename :param dict univ_options: Dict of universal options used by almost ...
[ "def", "run_bwa", "(", "job", ",", "fastqs", ",", "sample_type", ",", "univ_options", ",", "bwa_options", ")", ":", "work_dir", "=", "os", ".", "getcwd", "(", ")", "input_files", "=", "{", "'dna_1.fastq'", ":", "fastqs", "[", "0", "]", ",", "'dna_2.fastq...
Align a pair of fastqs with bwa. :param list fastqs: The input fastqs for alignment :param str sample_type: Description of the sample to inject into the filename :param dict univ_options: Dict of universal options used by almost all tools :param dict bwa_options: Options specific to bwa :return: fs...
[ "Align", "a", "pair", "of", "fastqs", "with", "bwa", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/alignment/dna.py#L106-L147
train
BD2KGenomics/protect
src/protect/alignment/dna.py
bam_conversion
def bam_conversion(job, samfile, sample_type, univ_options, samtools_options): """ Convert a sam to a bam. :param dict samfile: The input sam file :param str sample_type: Description of the sample to inject into the filename :param dict univ_options: Dict of universal options used by almost all too...
python
def bam_conversion(job, samfile, sample_type, univ_options, samtools_options): """ Convert a sam to a bam. :param dict samfile: The input sam file :param str sample_type: Description of the sample to inject into the filename :param dict univ_options: Dict of universal options used by almost all too...
[ "def", "bam_conversion", "(", "job", ",", "samfile", ",", "sample_type", ",", "univ_options", ",", "samtools_options", ")", ":", "work_dir", "=", "os", ".", "getcwd", "(", ")", "input_files", "=", "{", "sample_type", "+", "'.sam'", ":", "samfile", "}", "in...
Convert a sam to a bam. :param dict samfile: The input sam file :param str sample_type: Description of the sample to inject into the filename :param dict univ_options: Dict of universal options used by almost all tools :param dict samtools_options: Options specific to samtools :return: fsID for the...
[ "Convert", "a", "sam", "to", "a", "bam", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/alignment/dna.py#L150-L179
train
BD2KGenomics/protect
src/protect/alignment/dna.py
fix_bam_header
def fix_bam_header(job, bamfile, sample_type, univ_options, samtools_options, retained_chroms=None): """ Fix the bam header to remove the command line call. Failing to do this causes Picard to reject the bam. :param dict bamfile: The input bam file :param str sample_type: Description of the sample...
python
def fix_bam_header(job, bamfile, sample_type, univ_options, samtools_options, retained_chroms=None): """ Fix the bam header to remove the command line call. Failing to do this causes Picard to reject the bam. :param dict bamfile: The input bam file :param str sample_type: Description of the sample...
[ "def", "fix_bam_header", "(", "job", ",", "bamfile", ",", "sample_type", ",", "univ_options", ",", "samtools_options", ",", "retained_chroms", "=", "None", ")", ":", "if", "retained_chroms", "is", "None", ":", "retained_chroms", "=", "[", "]", "work_dir", "=",...
Fix the bam header to remove the command line call. Failing to do this causes Picard to reject the bam. :param dict bamfile: The input bam file :param str sample_type: Description of the sample to inject into the filename :param dict univ_options: Dict of universal options used by almost all tools ...
[ "Fix", "the", "bam", "header", "to", "remove", "the", "command", "line", "call", ".", "Failing", "to", "do", "this", "causes", "Picard", "to", "reject", "the", "bam", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/alignment/dna.py#L182-L230
train
BD2KGenomics/protect
src/protect/alignment/dna.py
add_readgroups
def add_readgroups(job, bamfile, sample_type, univ_options, picard_options): """ Add read groups to the bam. :param dict bamfile: The input bam file :param str sample_type: Description of the sample to inject into the filename :param dict univ_options: Dict of universal options used by almost all t...
python
def add_readgroups(job, bamfile, sample_type, univ_options, picard_options): """ Add read groups to the bam. :param dict bamfile: The input bam file :param str sample_type: Description of the sample to inject into the filename :param dict univ_options: Dict of universal options used by almost all t...
[ "def", "add_readgroups", "(", "job", ",", "bamfile", ",", "sample_type", ",", "univ_options", ",", "picard_options", ")", ":", "work_dir", "=", "os", ".", "getcwd", "(", ")", "input_files", "=", "{", "sample_type", "+", "'.bam'", ":", "bamfile", "}", "get_...
Add read groups to the bam. :param dict bamfile: The input bam file :param str sample_type: Description of the sample to inject into the filename :param dict univ_options: Dict of universal options used by almost all tools :param dict picard_options: Options specific to picard :return: fsID for the...
[ "Add", "read", "groups", "to", "the", "bam", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/alignment/dna.py#L233-L267
train
nepalicalendar/nepalicalendar-py
nepalicalendar/nepcal.py
NepCal.weekday
def weekday(cls, year, month, day): """Returns the weekday of the date. 0 = aaitabar""" return NepDate.from_bs_date(year, month, day).weekday()
python
def weekday(cls, year, month, day): """Returns the weekday of the date. 0 = aaitabar""" return NepDate.from_bs_date(year, month, day).weekday()
[ "def", "weekday", "(", "cls", ",", "year", ",", "month", ",", "day", ")", ":", "return", "NepDate", ".", "from_bs_date", "(", "year", ",", "month", ",", "day", ")", ".", "weekday", "(", ")" ]
Returns the weekday of the date. 0 = aaitabar
[ "Returns", "the", "weekday", "of", "the", "date", ".", "0", "=", "aaitabar" ]
a589c28b8e085049f30a7287753476b59eca6f50
https://github.com/nepalicalendar/nepalicalendar-py/blob/a589c28b8e085049f30a7287753476b59eca6f50/nepalicalendar/nepcal.py#L24-L26
train
nepalicalendar/nepalicalendar-py
nepalicalendar/nepcal.py
NepCal.monthrange
def monthrange(cls, year, month): """Returns the number of days in a month""" functions.check_valid_bs_range(NepDate(year, month, 1)) return values.NEPALI_MONTH_DAY_DATA[year][month - 1]
python
def monthrange(cls, year, month): """Returns the number of days in a month""" functions.check_valid_bs_range(NepDate(year, month, 1)) return values.NEPALI_MONTH_DAY_DATA[year][month - 1]
[ "def", "monthrange", "(", "cls", ",", "year", ",", "month", ")", ":", "functions", ".", "check_valid_bs_range", "(", "NepDate", "(", "year", ",", "month", ",", "1", ")", ")", "return", "values", ".", "NEPALI_MONTH_DAY_DATA", "[", "year", "]", "[", "month...
Returns the number of days in a month
[ "Returns", "the", "number", "of", "days", "in", "a", "month" ]
a589c28b8e085049f30a7287753476b59eca6f50
https://github.com/nepalicalendar/nepalicalendar-py/blob/a589c28b8e085049f30a7287753476b59eca6f50/nepalicalendar/nepcal.py#L29-L32
train
nepalicalendar/nepalicalendar-py
nepalicalendar/nepcal.py
NepCal.itermonthdays
def itermonthdays(cls, year, month): """Similar to itermonthdates but returns day number instead of NepDate object """ for day in NepCal.itermonthdates(year, month): if day.month == month: yield day.day else: yield 0
python
def itermonthdays(cls, year, month): """Similar to itermonthdates but returns day number instead of NepDate object """ for day in NepCal.itermonthdates(year, month): if day.month == month: yield day.day else: yield 0
[ "def", "itermonthdays", "(", "cls", ",", "year", ",", "month", ")", ":", "for", "day", "in", "NepCal", ".", "itermonthdates", "(", "year", ",", "month", ")", ":", "if", "day", ".", "month", "==", "month", ":", "yield", "day", ".", "day", "else", ":...
Similar to itermonthdates but returns day number instead of NepDate object
[ "Similar", "to", "itermonthdates", "but", "returns", "day", "number", "instead", "of", "NepDate", "object" ]
a589c28b8e085049f30a7287753476b59eca6f50
https://github.com/nepalicalendar/nepalicalendar-py/blob/a589c28b8e085049f30a7287753476b59eca6f50/nepalicalendar/nepcal.py#L65-L72
train
nepalicalendar/nepalicalendar-py
nepalicalendar/nepcal.py
NepCal.itermonthdays2
def itermonthdays2(cls, year, month): """Similar to itermonthdays2 but returns tuples of day and weekday. """ for day in NepCal.itermonthdates(year, month): if day.month == month: yield (day.day, day.weekday()) else: yield (0, day.weekday()...
python
def itermonthdays2(cls, year, month): """Similar to itermonthdays2 but returns tuples of day and weekday. """ for day in NepCal.itermonthdates(year, month): if day.month == month: yield (day.day, day.weekday()) else: yield (0, day.weekday()...
[ "def", "itermonthdays2", "(", "cls", ",", "year", ",", "month", ")", ":", "for", "day", "in", "NepCal", ".", "itermonthdates", "(", "year", ",", "month", ")", ":", "if", "day", ".", "month", "==", "month", ":", "yield", "(", "day", ".", "day", ",",...
Similar to itermonthdays2 but returns tuples of day and weekday.
[ "Similar", "to", "itermonthdays2", "but", "returns", "tuples", "of", "day", "and", "weekday", "." ]
a589c28b8e085049f30a7287753476b59eca6f50
https://github.com/nepalicalendar/nepalicalendar-py/blob/a589c28b8e085049f30a7287753476b59eca6f50/nepalicalendar/nepcal.py#L75-L82
train
nepalicalendar/nepalicalendar-py
nepalicalendar/nepcal.py
NepCal.monthdatescalendar
def monthdatescalendar(cls, year, month): """ Returns a list of week in a month. A week is a list of NepDate objects """ weeks = [] week = [] for day in NepCal.itermonthdates(year, month): week.append(day) if len(week) == 7: weeks.append(week) ...
python
def monthdatescalendar(cls, year, month): """ Returns a list of week in a month. A week is a list of NepDate objects """ weeks = [] week = [] for day in NepCal.itermonthdates(year, month): week.append(day) if len(week) == 7: weeks.append(week) ...
[ "def", "monthdatescalendar", "(", "cls", ",", "year", ",", "month", ")", ":", "weeks", "=", "[", "]", "week", "=", "[", "]", "for", "day", "in", "NepCal", ".", "itermonthdates", "(", "year", ",", "month", ")", ":", "week", ".", "append", "(", "day"...
Returns a list of week in a month. A week is a list of NepDate objects
[ "Returns", "a", "list", "of", "week", "in", "a", "month", ".", "A", "week", "is", "a", "list", "of", "NepDate", "objects" ]
a589c28b8e085049f30a7287753476b59eca6f50
https://github.com/nepalicalendar/nepalicalendar-py/blob/a589c28b8e085049f30a7287753476b59eca6f50/nepalicalendar/nepcal.py#L85-L96
train
nepalicalendar/nepalicalendar-py
nepalicalendar/nepcal.py
NepCal.monthdayscalendar
def monthdayscalendar(cls, year, month): """Return a list of the weeks in the month month of the year as full weeks. Weeks are lists of seven day numbers.""" weeks = [] week = [] for day in NepCal.itermonthdays(year, month): week.append(day) if len(week) =...
python
def monthdayscalendar(cls, year, month): """Return a list of the weeks in the month month of the year as full weeks. Weeks are lists of seven day numbers.""" weeks = [] week = [] for day in NepCal.itermonthdays(year, month): week.append(day) if len(week) =...
[ "def", "monthdayscalendar", "(", "cls", ",", "year", ",", "month", ")", ":", "weeks", "=", "[", "]", "week", "=", "[", "]", "for", "day", "in", "NepCal", ".", "itermonthdays", "(", "year", ",", "month", ")", ":", "week", ".", "append", "(", "day", ...
Return a list of the weeks in the month month of the year as full weeks. Weeks are lists of seven day numbers.
[ "Return", "a", "list", "of", "the", "weeks", "in", "the", "month", "month", "of", "the", "year", "as", "full", "weeks", ".", "Weeks", "are", "lists", "of", "seven", "day", "numbers", "." ]
a589c28b8e085049f30a7287753476b59eca6f50
https://github.com/nepalicalendar/nepalicalendar-py/blob/a589c28b8e085049f30a7287753476b59eca6f50/nepalicalendar/nepcal.py#L99-L111
train
nepalicalendar/nepalicalendar-py
nepalicalendar/nepcal.py
NepCal.monthdays2calendar
def monthdays2calendar(cls, year, month): """ Return a list of the weeks in the month month of the year as full weeks. Weeks are lists of seven tuples of day numbers and weekday numbers. """ weeks = [] week = [] for day in NepCal.itermonthdays2(year, month): week.appe...
python
def monthdays2calendar(cls, year, month): """ Return a list of the weeks in the month month of the year as full weeks. Weeks are lists of seven tuples of day numbers and weekday numbers. """ weeks = [] week = [] for day in NepCal.itermonthdays2(year, month): week.appe...
[ "def", "monthdays2calendar", "(", "cls", ",", "year", ",", "month", ")", ":", "weeks", "=", "[", "]", "week", "=", "[", "]", "for", "day", "in", "NepCal", ".", "itermonthdays2", "(", "year", ",", "month", ")", ":", "week", ".", "append", "(", "day"...
Return a list of the weeks in the month month of the year as full weeks. Weeks are lists of seven tuples of day numbers and weekday numbers.
[ "Return", "a", "list", "of", "the", "weeks", "in", "the", "month", "month", "of", "the", "year", "as", "full", "weeks", ".", "Weeks", "are", "lists", "of", "seven", "tuples", "of", "day", "numbers", "and", "weekday", "numbers", "." ]
a589c28b8e085049f30a7287753476b59eca6f50
https://github.com/nepalicalendar/nepalicalendar-py/blob/a589c28b8e085049f30a7287753476b59eca6f50/nepalicalendar/nepcal.py#L114-L126
train
BD2KGenomics/protect
src/protect/mutation_calling/somaticsniper.py
run_somaticsniper_with_merge
def run_somaticsniper_with_merge(job, tumor_bam, normal_bam, univ_options, somaticsniper_options): """ A wrapper for the the entire SomaticSniper sub-graph. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict normal_bam: Dict of bam and bai for normal DNA-Seq :param dict univ_o...
python
def run_somaticsniper_with_merge(job, tumor_bam, normal_bam, univ_options, somaticsniper_options): """ A wrapper for the the entire SomaticSniper sub-graph. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict normal_bam: Dict of bam and bai for normal DNA-Seq :param dict univ_o...
[ "def", "run_somaticsniper_with_merge", "(", "job", ",", "tumor_bam", ",", "normal_bam", ",", "univ_options", ",", "somaticsniper_options", ")", ":", "spawn", "=", "job", ".", "wrapJobFn", "(", "run_somaticsniper", ",", "tumor_bam", ",", "normal_bam", ",", "univ_op...
A wrapper for the the entire SomaticSniper sub-graph. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict normal_bam: Dict of bam and bai for normal DNA-Seq :param dict univ_options: Dict of universal options used by almost all tools :param dict somaticsniper_options: Options speci...
[ "A", "wrapper", "for", "the", "the", "entire", "SomaticSniper", "sub", "-", "graph", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/somaticsniper.py#L50-L64
train
BD2KGenomics/protect
src/protect/mutation_calling/somaticsniper.py
run_somaticsniper
def run_somaticsniper(job, tumor_bam, normal_bam, univ_options, somaticsniper_options, split=True): """ Run the SomaticSniper subgraph on the DNA bams. Optionally split the results into per-chromosome vcfs. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict normal_bam: Dict o...
python
def run_somaticsniper(job, tumor_bam, normal_bam, univ_options, somaticsniper_options, split=True): """ Run the SomaticSniper subgraph on the DNA bams. Optionally split the results into per-chromosome vcfs. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict normal_bam: Dict o...
[ "def", "run_somaticsniper", "(", "job", ",", "tumor_bam", ",", "normal_bam", ",", "univ_options", ",", "somaticsniper_options", ",", "split", "=", "True", ")", ":", "if", "somaticsniper_options", "[", "'chromosomes'", "]", ":", "chromosomes", "=", "somaticsniper_o...
Run the SomaticSniper subgraph on the DNA bams. Optionally split the results into per-chromosome vcfs. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict normal_bam: Dict of bam and bai for normal DNA-Seq :param dict univ_options: Dict of universal options used by almost all tool...
[ "Run", "the", "SomaticSniper", "subgraph", "on", "the", "DNA", "bams", ".", "Optionally", "split", "the", "results", "into", "per", "-", "chromosome", "vcfs", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/somaticsniper.py#L67-L123
train
BD2KGenomics/protect
src/protect/mutation_calling/somaticsniper.py
run_somaticsniper_full
def run_somaticsniper_full(job, tumor_bam, normal_bam, univ_options, somaticsniper_options): """ Run SomaticSniper on the DNA bams. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict normal_bam: Dict of bam and bai for normal DNA-Seq :param dict univ_options: Dict of universal...
python
def run_somaticsniper_full(job, tumor_bam, normal_bam, univ_options, somaticsniper_options): """ Run SomaticSniper on the DNA bams. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict normal_bam: Dict of bam and bai for normal DNA-Seq :param dict univ_options: Dict of universal...
[ "def", "run_somaticsniper_full", "(", "job", ",", "tumor_bam", ",", "normal_bam", ",", "univ_options", ",", "somaticsniper_options", ")", ":", "work_dir", "=", "os", ".", "getcwd", "(", ")", "input_files", "=", "{", "'tumor.bam'", ":", "tumor_bam", "[", "'tumo...
Run SomaticSniper on the DNA bams. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict normal_bam: Dict of bam and bai for normal DNA-Seq :param dict univ_options: Dict of universal options used by almost all tools :param dict somaticsniper_options: Options specific to SomaticSnipe...
[ "Run", "SomaticSniper", "on", "the", "DNA", "bams", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/somaticsniper.py#L126-L165
train
BD2KGenomics/protect
src/protect/mutation_calling/somaticsniper.py
filter_somaticsniper
def filter_somaticsniper(job, tumor_bam, somaticsniper_output, tumor_pileup, univ_options, somaticsniper_options): """ Filter SomaticSniper calls. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param toil.fileStore.FileID somaticsniper_output: SomaticSniper outpu...
python
def filter_somaticsniper(job, tumor_bam, somaticsniper_output, tumor_pileup, univ_options, somaticsniper_options): """ Filter SomaticSniper calls. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param toil.fileStore.FileID somaticsniper_output: SomaticSniper outpu...
[ "def", "filter_somaticsniper", "(", "job", ",", "tumor_bam", ",", "somaticsniper_output", ",", "tumor_pileup", ",", "univ_options", ",", "somaticsniper_options", ")", ":", "work_dir", "=", "os", ".", "getcwd", "(", ")", "input_files", "=", "{", "'tumor.bam'", ":...
Filter SomaticSniper calls. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param toil.fileStore.FileID somaticsniper_output: SomaticSniper output vcf :param toil.fileStore.FileID tumor_pileup: Pileup generated for the tumor bam :param dict univ_options: Dict of universal options used by ...
[ "Filter", "SomaticSniper", "calls", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/somaticsniper.py#L168-L243
train
BD2KGenomics/protect
src/protect/mutation_calling/somaticsniper.py
run_pileup
def run_pileup(job, tumor_bam, univ_options, somaticsniper_options): """ Runs a samtools pileup on the tumor bam. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict univ_options: Dict of universal options used by almost all tools :param dict somaticsniper_options: Options spec...
python
def run_pileup(job, tumor_bam, univ_options, somaticsniper_options): """ Runs a samtools pileup on the tumor bam. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict univ_options: Dict of universal options used by almost all tools :param dict somaticsniper_options: Options spec...
[ "def", "run_pileup", "(", "job", ",", "tumor_bam", ",", "univ_options", ",", "somaticsniper_options", ")", ":", "work_dir", "=", "os", ".", "getcwd", "(", ")", "input_files", "=", "{", "'tumor.bam'", ":", "tumor_bam", "[", "'tumor_dna_fix_pg_sorted.bam'", "]", ...
Runs a samtools pileup on the tumor bam. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict univ_options: Dict of universal options used by almost all tools :param dict somaticsniper_options: Options specific to SomaticSniper :return: fsID for the pileup file :rtype: toil.file...
[ "Runs", "a", "samtools", "pileup", "on", "the", "tumor", "bam", "." ]
06310682c50dcf8917b912c8e551299ff7ee41ce
https://github.com/BD2KGenomics/protect/blob/06310682c50dcf8917b912c8e551299ff7ee41ce/src/protect/mutation_calling/somaticsniper.py#L261-L294
train