function
stringlengths
11
56k
repo_name
stringlengths
5
60
features
list
def setup(r): #don't create foo r.Create('/foo3', contents=r.fileText) r.Transient('/foo3')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(self): # NormalizeInterpreterPaths not the purpose of these tests, # and dealing with it running would make tests needlessly # and uselessly more verbose. del self.NormalizeInterpreterPaths self.Create('libhello.c', contents='''
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): del r.NormalizeInterpreterPaths r.Create('%(essentialbindir)s/bash', mode=0755) r.Create('%(essentialbindir)s/conflict', mode=0755) r.Provides('file', '%(essentialbindir)s/(ba)?sh') if Use.ssl: # turn on this use flag; we use this in the tests for flavor...
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): del r.NormalizeInterpreterPaths r.Create('%(essentialbindir)s/conflict', mode=0755) if Use.ssl: # turn on this use flag; we use this in the tests for flavor # dependent resolution pass
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): del r.NormalizeInterpreterPaths r.Create('%(essentialbindir)s/script', mode=0755, contents = '#!/bin/bash')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): del r.NormalizeInterpreterPaths r.Create('%(essentiallibdir)s/empty', mode=0644) r.Requires('bash:runtime', '%(essentiallibdir)s/empty')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('%(sysconfdir)s/gconf/schemas/foo') r.Install('/bin/true', '%(bindir)s/gconftool-2', mode=0755) self.ComponentSpec('runtime', '%(sysconfdir)s/')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(self): self.Run('''
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(self): self.Create("/etc/foo1", contents = "text1") self.Ownership(self.owner, self.group, '.*') self.ComponentSpec('runtime', '%(sysconfdir)s/')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(self): self.Create("/etc/foo1.1", contents = "text1.1") self.Ownership(self.owner, self.group, '.*') self.ComponentSpec('runtime', '%(sysconfdir)s/')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(self): self.Create("/etc/foo1.2", contents = "text1.2") self.Ownership(self.owner, self.group, '.*') self.ComponentSpec('runtime', '%(sysconfdir)s/')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(self): self.Create("/etc/foo1.3", contents = "text1.3") self.Ownership(self.owner, self.group, '.*') self.ComponentSpec('runtime', '%(sysconfdir)s/')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(self): self.Create("/etc/foo2", contents = "text2") self.Ownership(self.owner, self.group, '.*') self.ComponentSpec('runtime', '%(sysconfdir)s/')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(self): self.Create("/etc/foo2.1", contents = "text2.1") self.Ownership(self.owner, self.group, '.*') self.ComponentSpec('runtime', '%(sysconfdir)s/')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Run('''
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Run('''
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Run('''
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Run('''
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Run('''
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Run('''
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Run('''
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('%(tagdescriptiondir)s/foo', contents='''file %(taghandlerdir)s/foo
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create(r.paths[0], contents=r.initialFileText) for path in r.paths[1:]: if r.hard: r.Run("ln %%(destdir)s/%s %%(destdir)s/%s" % (r.paths[0], path)) else: r.Run("ln -s %s %%(destdir)s/%s" % (r.paths[0], path))
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create(r.paths[0], contents=r.initialFileText) r.Run("ln %%(destdir)s/%s %%(destdir)s/%s" % (r.paths[0], r.paths[1])) r.Create(r.paths[2], contents=r.initialFileText) r.Run("ln %%(destdir)s/%s %%(destdir)s/%s" % (r.pat...
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): for path in r.paths: r.Create(path, contents=r.fileText) r.ComponentSpec('runtime', '%(sysconfdir)s/')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/usr/bin/test', mode=0755) r.Requires('bar:foo', '/usr/bin/test')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/usr/bin/a', mode=0755)
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/usr/bin/b', mode=0755) r.Requires('a:runtime', '/usr/bin/b')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create("/etc/foo", contents = "text 1") r.ComponentSpec('runtime', '%(sysconfdir)s/')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create("/etc/foo", contents = "text 2") r.ComponentSpec('runtime', '%(sysconfdir)s/')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): %(flavor)s r.Create('/usr/bin/test%(num)s',contents='''\
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def createRecipe(num, requires=[], fail=False, content='', packageSpecs=[], subPackages = [], version='1.0', localflags=[], flags=[], header='', fileContents='', tag=None, binary=False): reqList = [] for req in requires: reqList.append("'test%d:runtime...
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('%(essentialbindir)s/foo', mode=0755, contents = 'some text')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Run("mkdir %(destdir)s%(essentialbindir)s") r.Run("ln -s foo %(destdir)s%(essentialbindir)s/foo")
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): if Use.readline: r.Create("/etc/readline", contents = "text 1") if Use.ssl: r.Create("/etc/ssl", contents = "text 1") if not Use.ssl and not Use.readline: r.Create("/etc/none", contents = "text 1") r.ComponentSpec('runtime', '%(sysconfdi...
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): if Use.readline: r.Create("/etc/readline", contents = "text 1") if Use.ssl: r.Create("/etc/ssl", contents = "text 1") if not Use.ssl and not Use.readline: r.Create("/etc/none", contents = "text 1") r.ComponentSpec('runtime', '%(sysconfdi...
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.addSource('localfile')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.addSource('distcc-2.9.tar.bz2') r.addSource('localfile')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.addSource('multilib-sample.tar.bz2') r.addSource('localfile')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.addSource('multilib-sample.tar.bz2') r.addSource('localfile') r.Create('/foo')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.addSource('distcache-1.4.5.tar.bz2') r.Create('/foo')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.addSource('distcache-1.4.5.tar.bz2', rpm='distcache-1.4.5-2.src.rpm') r.Create('/bar')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/etc/config', contents='test 123') r.ComponentSpec('runtime', '%(sysconfdir)s/')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/etc/config') r.ComponentSpec('runtime', '%(sysconfdir)s/')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/etc/config') r.ComponentSpec('runtime', '%(sysconfdir)s/')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/etc/blah') r.ComponentSpec('runtime', '%(sysconfdir)s/')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/etc/config', contents='test 123') r.ComponentSpec('runtime', '%(sysconfdir)s/')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/etc/foo', contents='test 234') r.Symlink('foo', '/etc/config') r.ComponentSpec('runtime', '%(sysconfdir)s/')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/usr/share/man/man1/bar.1', contents='test 234') r.Symlink('bar.1', '/usr/share/man/man1/foo.1')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/usr/share/man/man1/foo.1', contents='test 123')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/etc/first', 'unchanged') r.ComponentSpec('runtime', '%(sysconfdir)s/')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/etc/second', 'unchanged') r.ComponentSpec('runtime', '%(sysconfdir)s/')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create("/lib/1") r.Create("/lib/first") r.Create("/lib/non-utf8" + '\200') r.NonUTF8Filenames(exceptions="/lib/non-utf8" + '\200')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create("/lib/1") r.Create("/lib/2")
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create("/lib/1") r.Create("/lib/2") r.Create("/lib/3")
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create("/lib/1") r.Create("/lib/2") r.Create("/lib/3") r.Create("/lib/4")
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('%(libdir)s/libfoo.so.1') r.Provides('file', '%(libdir)s/libfoo.so.1')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('%(libdir)s/libfoo.so.2') r.Provides('file', '%(libdir)s/libfoo.so.2')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('%(bindir)s/bar', mode=0755) r.Requires('%(libdir)s/libfoo.so.1' %r.macros, '%(bindir)s/bar')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('%(bindir)s/baz', mode=0755) r.Requires('%(libdir)s/libfoo.so.2' %r.macros, '%(bindir)s/baz')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Run('mkdir test; echo -e \#\!/bin/notthere\\nhi > test/foo; chmod 755 test/foo') r.TestSuite('test', autoBuildMakeDependencies=False) r.Create('/etc/foo') r.ComponentSpec('runtime', '%(sysconfdir)s/')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(self): self.Requires('other') self.addTrove('test:runtime')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/foo', contents='initialtransientcontents') r.Transient('/foo')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/foo', contents='initialregularcontents')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/foo', contents='initialconfigcontents') r.Config('/foo') r.ComponentSpec('runtime', '/foo')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/foo', contents='initialrecipecontents') r.InitialContents('/foo')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/foo', contents='secondrecipecontents') r.InitialContents('/foo')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/etc/other', contents='secondrecipecontents') r.Requires('test:config', '/etc/other') r.ComponentSpec('runtime', '%(sysconfdir)s/')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(self): self.addTrove('test1', '1.0')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(self): self.addTrove('test1', '1.1')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(self): self.startGroup('group-test2', checkPathConflicts=False, groupName='group-test') self.addTrove('test1', '1.0') self.startGroup('group-test3', groupName='group-test') self.addTrove('test2', '1.0')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.User('%(user)s', %(uid)s)
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.addTrove('synctrove', '1', byDefault=False)
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.addTrove('synctrove', '2', byDefault=False)
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/usr/share/foo1') r.Create('%(debugsrcdir)s/%(name)s-%(version)s/foo1')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/usr/share/foo2') r.Create('%(debugsrcdir)s/%(name)s-%(version)s/foo2')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): if Use.readline: pass r.Create('/usr/share/foo2') r.Create('%(debugsrcdir)s/%(name)s-%(version)s/foo2')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/usr/share/foo2')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/usr/share/foo2') r.addSource('newsource') r.Install('newsource', '/usr/share/foo3')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.Create('/foo', contents='simple')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(self): self.add("test", "@rpl:linux") self.createGroup('group-second') self.createGroup('group-third') self.add("test", "@rpl:linux", groupName = ['group-second', 'group-third']) # add group-second to group-first self.addNewGroup('group-sec...
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): r.addSource('distcc-2.9.tar.bz2')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def setup(r): if Use.ffff: r.Create('/foo', contents='simple') else: r.Create('/bar', contents='simple')
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def getRecipeClass(self): class Subclass(PackageRecipe): internalAbstractBaseClass = True name = "subclass" version = "1.0" return Subclass
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def getRecipeClass(self): clearBuildRequires() f = self.openSourceFile('VERSION') readVersion = f.read()[:-1] f.close() class RealRecipe(PackageRecipe): name = self.packageName version = readVersion def setup(r): if False: ...
sassoftware/conary
[ 47, 9, 47, 4, 1396904066 ]
def initial(self, request, *args, **kwargs): if not can_access_editor(request): raise PermissionDenied return super().initial(request, *args, **kwargs)
c3nav/c3nav
[ 137, 31, 137, 17, 1461327231 ]
def wrapper(func): func = api_etag(**outkwargs)(func) @wraps(func) def wrapped_func(self, request, *args, **kwargs): try: changeset = request.changeset except AttributeError: changeset = ChangeSet.get_for_request(request) r...
c3nav/c3nav
[ 137, 31, 137, 17, 1461327231 ]
def _get_level_geometries(level): buildings = level.buildings.all() buildings_geom = cascaded_union([building.geometry for building in buildings]) spaces = {space.pk: space for space in level.spaces.all()} holes_geom = [] for space in spaces.values(): if space.outside...
c3nav/c3nav
[ 137, 31, 137, 17, 1461327231 ]
def _get_levels_pk(request, level): # noinspection PyPep8Naming Level = request.changeset.wrap_model('Level') levels_under = () levels_on_top = () lower_level = level.lower(Level).first() primary_levels = (level,) + ((lower_level,) if lower_level else ()) secondar...
c3nav/c3nav
[ 137, 31, 137, 17, 1461327231 ]
def area_sorting_func(area): groups = tuple(area.groups.all()) if not groups: return (0, 0, 0) return (1, groups[0].category.priority, groups[0].hierarchy, groups[0].priority)
c3nav/c3nav
[ 137, 31, 137, 17, 1461327231 ]
def geometries(self, request, update_cache_key, update_cache_key_match, *args, **kwargs): Level = request.changeset.wrap_model('Level') Space = request.changeset.wrap_model('Space') Column = request.changeset.wrap_model('Column') Hole = request.changeset.wrap_model('Hole') Altitu...
c3nav/c3nav
[ 137, 31, 137, 17, 1461327231 ]
def geometrystyles(self, request, *args, **kwargs): return Response({ 'building': '#aaaaaa', 'space': '#eeeeee', 'hole': 'rgba(255, 0, 0, 0.3)', 'door': '#ffffff', 'area': '#55aaff', 'stair': '#a000a0', 'ramp': 'rgba(160, 0, 160...
c3nav/c3nav
[ 137, 31, 137, 17, 1461327231 ]
def bounds(self, request, *args, **kwargs): return Response({ 'bounds': Source.max_bounds(), })
c3nav/c3nav
[ 137, 31, 137, 17, 1461327231 ]
def post_or_delete(self, request, *args, **kwargs): # django-rest-framework doesn't automatically do this for logged out requests SessionAuthentication().enforce_csrf(request) return self.retrieve(request, *args, **kwargs)
c3nav/c3nav
[ 137, 31, 137, 17, 1461327231 ]
def resolved(self): resolved = None path = self.kwargs.get('path', '') if path: try: resolved = resolve('/editor/'+path+'/') except Resolver404: pass if not resolved: try: resolved = resolve('/editor/'+p...
c3nav/c3nav
[ 137, 31, 137, 17, 1461327231 ]
def get_queryset(self): return ChangeSet.qs_for_request(self.request).select_related('last_update', 'last_state_update', 'last_change')
c3nav/c3nav
[ 137, 31, 137, 17, 1461327231 ]
def list(self, request, *args, **kwargs): return self._list(request, self.get_queryset())
c3nav/c3nav
[ 137, 31, 137, 17, 1461327231 ]
def user(self, request, *args, **kwargs): return self._list(request, self.get_queryset().filter(author=request.user))
c3nav/c3nav
[ 137, 31, 137, 17, 1461327231 ]
def reviewing(self, request, *args, **kwargs): return self._list(request, self.get_queryset().filter( assigned_to=request.user, state='review' ))
c3nav/c3nav
[ 137, 31, 137, 17, 1461327231 ]
def pending_review(self, request, *args, **kwargs): return self._list(request, self.get_queryset().filter( state__in=('proposed', 'reproposed'), ))
c3nav/c3nav
[ 137, 31, 137, 17, 1461327231 ]