prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>setup_pkgresource.py<|end_file_name|><|fim▁begin|>def _setup_pkgresources():
import pkg_resources
import os
import plistlib
pl = plistlib.readPlist(os.path.join(
os.path.dirname(os.getenv('RESOURCEPATH')), "Info.plist"))
appname = pl.get('CFBundleIdentifier')
if appname is ... | appname = pl['CFBundleDisplayName'] |
<|file_name|>setup_pkgresource.py<|end_file_name|><|fim▁begin|>def <|fim_middle|>():
import pkg_resources
import os
import plistlib
pl = plistlib.readPlist(os.path.join(
os.path.dirname(os.getenv('RESOURCEPATH')), "Info.plist"))
appname = pl.get('CFBundleIdentifier')
if appname is None:... | _setup_pkgresources |
<|file_name|>output2csv.py<|end_file_name|><|fim▁begin|>import os, re, csv
# regular expressions for capturing the interesting quantities
noise_pattern = 'noise: \[(.+)\]'
res_pattern = '^([0-9.]+$)'
search_dir = "output"
results_file = '../results.csv'
os.chdir( search_dir )
files = filter( os.path.isfile, os.listd... | |
<|file_name|>extensions.py<|end_file_name|><|fim▁begin|>#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
<|file_name|>extensions.py<|end_file_name|><|fim▁begin|>#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | """extensions resource"""
extension_links = [common_types.Link]
"""This attribute contains Links to extension resources that contain
information about the extensions supported by this Platform."""
def __init__(self, **kwds):
# LOG.debug("extensions constructor: %s" % kwds)
super(Ex... |
<|file_name|>extensions.py<|end_file_name|><|fim▁begin|>#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | super(Extensions, self).__init__(**kwds) |
<|file_name|>extensions.py<|end_file_name|><|fim▁begin|>#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | __init__ |
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | #GUI.dlgOk(str( jsp.count ))
|
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | DETVIDEXT and isVidExt(getTitle(idx)) : return False
return True if getLi('Property(IsPlayable)',idx) in ('false', Empty) and not getFname(idx) else False
|
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | r itm in TAG_PAR_VIDEOSEXT:
if name.endswith(itm) : return True
return False
|
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | tmList = eval(xbmc.executeJSONRPC(_listdircmd % (dirPath)))['result']['files']
_jsp = struct()
_jsp.link = dirPath
_jsp.name = srcName
_jsp.itmList = _itmList
_jsp.count = len(_itmList)
return _jsp
|
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | jsp.itmList[idx]['filetype'] != 'folder' : return False
return True
|
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | f __init__(self, dirPath=Empty, srcName=Empty):
if not dirPath : self.norm_init()
else : self.jsp_init (dirPath, srcName)
def jsp_init(self, dirPath, srcName):
jsp = getJsp(dirPath, srcName)
#import resources.lib.gui as GUI
#GUI.dlgOk(str( jsp.cou... |
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | not dirPath : self.norm_init()
else : self.jsp_init (dirPath, srcName)
|
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | p = getJsp(dirPath, srcName)
#import resources.lib.gui as GUI
#GUI.dlgOk(str( jsp.count ))
## Current jsp data ...
self.vidFolderNameDef = Empty
self.vidCPath = jsp.link
self.vidCName = jsp.name
self.vidIsEmpty = True
sel... |
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | lf.vidFolderNameDef = Empty
self.vidCurr = getTitleF()
self.vidPath = getPath()
self.vidIsFolder = isFolder()
self.vidFPath = getFolpath()
self.vidLink = getLink()
self.vidCPath = getCpath()
self.vidCName ... |
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | lf.vidListItems = [itm for idx, itm in enumerate(self.vidListItemsRaw) if idx in manlist]
|
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | lf.vidListItems.reverse()
self.vidListItemsRaw.reverse()
|
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | xts = False
retList = []
for itm in self.vidListItems:
if itm[0] == self.vidCurr : nexts = True; continue
if not nexts : continue
retList.append(itm[1])
return retList
|
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | Folder ( |
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | VidExt(n |
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | tJsp(d |
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | p_isFolder(j |
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | init__(s |
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | p_init(s |
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | rm_init(s |
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | tmanually(s |
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | verse(s |
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | tOnlyNexts(s |
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | turn False
|
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | turn True
|
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | turn False
|
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | lf.norm_init()
|
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | lf.jsp_init (dirPath, srcName)
|
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | ntinue
|
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | lf.vidIsEmpty = False
## Set as default first nofolder item ...
self.vidFolderNameDef = self.vidListItems[0][0]
|
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | lf.vidFolderNameDef = self.vidCurr
|
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | ntinue
|
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | lf.vidIsEmpty = False
## Set as default first nofolder item, if current item is a folder ...
if self.vidFolderNameDef == Empty : self.vidFolderNameDef = self.vidListItems[0][0]
|
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | lf.vidFolderNameDef = self.vidListItems[0][0]
|
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | xts = True; continue
|
<|file_name|>li2_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | ntinue
|
<|file_name|>test_DelEntry.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
##BOILERPLATE_COPYRIGHT
##BOILERPLATE_COPYRIGHT_END
'''
import unittest, copy
from testRoot import RootClass
from noink.user_db import UserDB
from noink.entry_db import EntryDB
class AddEntry(RootClass):
def test_AddEntry(s... | title = 'Little Buttercup'
entry = 'There once was a man from Nantucket,' + \
'who kept his wife in a Bucket.' + \ |
<|file_name|>test_DelEntry.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
##BOILERPLATE_COPYRIGHT
##BOILERPLATE_COPYRIGHT_END
'''
import unittest, copy
from testRoot import RootClass
from noink.user_db import UserDB
from noink.entry_db import EntryDB
class AddEntry(RootClass):
<|fim_middle|>
if... | def test_AddEntry(self):
userDB = UserDB()
entryDB = EntryDB()
u = userDB.add("jontest", "pass", "Jon Q. Testuser")
title = 'Little Buttercup'
entry = 'There once was a man from Nantucket,' + \
'who kept his wife in a Bucket.' + \
"Wait... how'... |
<|file_name|>test_DelEntry.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
##BOILERPLATE_COPYRIGHT
##BOILERPLATE_COPYRIGHT_END
'''
import unittest, copy
from testRoot import RootClass
from noink.user_db import UserDB
from noink.entry_db import EntryDB
class AddEntry(RootClass):
def test_AddEntry(s... | userDB = UserDB()
entryDB = EntryDB()
u = userDB.add("jontest", "pass", "Jon Q. Testuser")
title = 'Little Buttercup'
entry = 'There once was a man from Nantucket,' + \
'who kept his wife in a Bucket.' + \
"Wait... how'd she fit in that bucket anyw... |
<|file_name|>test_DelEntry.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
##BOILERPLATE_COPYRIGHT
##BOILERPLATE_COPYRIGHT_END
'''
import unittest, copy
from testRoot import RootClass
from noink.user_db import UserDB
from noink.entry_db import EntryDB
class AddEntry(RootClass):
def test_AddEntry(s... | unittest.main() |
<|file_name|>test_DelEntry.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
##BOILERPLATE_COPYRIGHT
##BOILERPLATE_COPYRIGHT_END
'''
import unittest, copy
from testRoot import RootClass
from noink.user_db import UserDB
from noink.entry_db import EntryDB
class AddEntry(RootClass):
def <|fim_middle|>(... | test_AddEntry |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from .atomicparsley import AtomicParsleyPP
from .ffmpeg import (
FFmpegPostProcessor,
FFmpegAudioFixPP,
FFmpegEmbedSubtitlePP,
FFmpegExtractAudioPP,
FFmpegFixupStretchedPP,
FFmpegMergerPP,
FFmpegMe... | 'FFmpegMetadataPP',
'FFmpegPostProcessor',
'FFmpegVideoConvertorPP',
'XAttrMetadataPP', |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from .atomicparsley import AtomicParsleyPP
from .ffmpeg import (
FFmpegPostProcessor,
FFmpegAudioFixPP,
FFmpegEmbedSubtitlePP,
FFmpegExtractAudioPP,
FFmpegFixupStretchedPP,
FFmpegMergerPP,
FFmpegMe... | return globals()[key + 'PP'] |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from .atomicparsley import AtomicParsleyPP
from .ffmpeg import (
FFmpegPostProcessor,
FFmpegAudioFixPP,
FFmpegEmbedSubtitlePP,
FFmpegExtractAudioPP,
FFmpegFixupStretchedPP,
FFmpegMergerPP,
FFmpegMe... | get_postprocessor |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | # The output streams a, b, c, d obtained by |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | print "example_1"
print "op(f, x): f is a function from a list to a list"
print "x is a stream \n"
# FUNCTIONS FROM LIST TO LIST
# This example uses the following list operators:
# functions from a list to a list.
# f, g, h, r
# Example A: function using list comprehension
def f(... |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | return [w*w for w in lst] |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | return w > threshold |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | return filter(predicate, lst) |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | return w**n |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | return map(power, lst) |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | result = []
for w in lst:
if w%n == 0: result.append(w/n)
return result |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | return op(f,x) |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | return op(g,x) |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | example_1() |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | if __package__ is None:
import sys
from os import path
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) ) |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | import sys
from os import path
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) ) |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | result.append(w/n) |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | main() |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | example_1 |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | f |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | predicate |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | g |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | power |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | h |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | r |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | F |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | G |
<|file_name|>ExamplesOpNoState.py<|end_file_name|><|fim▁begin|>"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agent... | main |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
<|fim_middle|>
<|fim▁end|> | def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
# Hijack reset so it doesn't call into Pygame during the tests.
self.reset_count = 0
self.mda.reset = self.reset_testable
def reset_tes... |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
<|fim_middle|>
def reset_testable(self):
self.reset_count += 1
def test_ports_... | self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
# Hijack reset so it doesn't call into Pygame during the tests.
self.reset_count = 0
self.mda.reset = self.reset_testable |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | self.reset_count += 1 |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | self.assertEqual(self.mda.get_ports_list(), [0x03B0, 0x03B1, 0x03B2, 0x03B3,
0x03B4, 0x03B5, 0x03B6, 0x03B7,
0x03B8, 0x03B9, 0x03BA, 0x03BB]) |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | self.assertEqual(self.mda.get_memory_size(), 4096) |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | self.assertEqual(self.mda.control_reg, 0x00)
self.assertEqual(self.mda.control_reg, 0x00)
self.assertEqual(self.mda.screen, None)
self.assertEqual(self.mda.char_generator, self.cg)
self.assertEqual(len(self.mda.video_ram), 4096) |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | self.mda.mem_write_byte(0x0000, 0x41)
self.assertEqual(self.mda.video_ram[0x0000], 0x41) |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | self.mda.mem_write_byte(0x0000, 0x41)
self.assertEqual(self.cg.last_blit, (None, (0, 0), 0x41, MDA_GREEN, MDA_BLACK)) |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | self.mda.mem_write_byte(3998, 0xFF)
self.assertEqual(self.cg.last_blit, (None, (711, 336), 0xFF, MDA_GREEN, MDA_BLACK)) |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | self.mda.mem_write_byte(3998, 0xFF)
self.assertEqual(self.cg.last_blit, (None, (711, 336), 0xFF, MDA_GREEN, MDA_BLACK))
self.mda.mem_write_byte(3999, MDA_ATTR_INTENSITY)
self.assertEqual(self.cg.last_blit, (None, (711, 336), 0xFF, MDA_BRIGHT_GREEN, MDA_BLACK)) |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | self.mda.mem_write_byte(3999, MDA_ATTR_INTENSITY)
self.assertEqual(self.cg.last_blit, (None, (711, 336), 0x00, MDA_BRIGHT_GREEN, MDA_BLACK))
self.mda.mem_write_byte(3998, 0xFF)
self.assertEqual(self.cg.last_blit, (None, (711, 336), 0xFF, MDA_BRIGHT_GREEN, MDA_BLACK)) |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | self.mda.mem_write_byte(4000, 0xFF)
self.assertEqual(self.cg.last_blit, None) |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | self.mda.video_ram[77] = 0xA5
self.assertEqual(self.mda.mem_read_byte(77), 0xA5) |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | self.assertEqual(self.mda.mem_read_byte(4000), 0x00) |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | self.assertEqual(self.reset_count, 0)
self.mda.io_write_byte(0x3B8, 0x01)
self.assertEqual(self.reset_count, 1)
# Second write shouldn't call reset again.
self.mda.io_write_byte(0x3B8, 0x01)
self.assertEqual(self.reset_count, 1) |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | self.mda.mem_write_word(0x0000, 0x0841) # 'A' with intensity.
self.assertEqual(self.mda.video_ram[0x0000], 0x41)
self.assertEqual(self.mda.video_ram[0x0001], 0x08)
self.assertEqual(self.cg.last_blit, (None, (0, 0), 0x41, MDA_BRIGHT_GREEN, MDA_BLACK)) |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | self.mda.mem_write_word(3998, 0x085A) # 'Z' with intensity.
self.assertEqual(self.mda.video_ram[3998], 0x5A)
self.assertEqual(self.mda.video_ram[3999], 0x08)
self.assertEqual(self.cg.last_blit, (None, (711, 336), 0x5A, MDA_BRIGHT_GREEN, MDA_BLACK)) |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | self.mda.mem_write_word(3999, 0xFF08) # 'Z' with intensity.
self.assertEqual(self.mda.video_ram[3998], 0x00) # Should be unmodified.
self.assertEqual(self.mda.video_ram[3999], 0x08)
self.assertEqual(self.cg.last_blit, (None, (711, 336), 0x00, MDA_BRIGHT_GREEN, MDA_BLACK)) |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | self.mda.video_ram[0x0000] = 0x41
self.mda.video_ram[0x0001] = 0x08
self.assertEqual(self.mda.mem_read_word(0x0000), 0x0841) |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | self.mda.video_ram[3998] = 0x12
self.mda.video_ram[3999] = 0x34
self.assertEqual(self.mda.mem_read_word(3999), 0x0034) |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | self.assertEqual(self.mda.io_read_byte(0x3BA), 0xF0)
self.assertEqual(self.mda.io_read_byte(0x3BA), 0xF1)
self.assertEqual(self.mda.io_read_byte(0x3BA), 0xF0) |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | self.assertEqual(self.mda.current_pixel, [0, 0])
self.mda.io_read_byte(0x3BA)
self.assertEqual(self.mda.current_pixel, [1, 0]) |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | self.mda.current_pixel = [719, 0]
self.mda.io_read_byte(0x3BA)
self.assertEqual(self.mda.current_pixel, [0, 1]) |
<|file_name|>test_mda.py<|end_file_name|><|fim▁begin|>import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
... | self.mda.current_pixel = [719, 349]
self.mda.io_read_byte(0x3BA)
self.assertEqual(self.mda.current_pixel, [0, 0]) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.