prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>test_sync.py<|end_file_name|><|fim▁begin|>"""Test class for Custom Sync UI
:Requirement: Sync
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Repositories
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string
from nailgun import entities
... | :id: 00fb0b04-0293-42c2-92fa-930c75acee89
|
<|file_name|>test_sync.py<|end_file_name|><|fim▁begin|>"""Test class for Custom Sync UI
:Requirement: Sync
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Repositories
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string
from nailgun import entities
... | return entities.Organization().create() |
<|file_name|>test_sync.py<|end_file_name|><|fim▁begin|>"""Test class for Custom Sync UI
:Requirement: Sync
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Repositories
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string
from nailgun import entities
... | return entities.Product(organization=module_org).create() |
<|file_name|>test_sync.py<|end_file_name|><|fim▁begin|>"""Test class for Custom Sync UI
:Requirement: Sync
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Repositories
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string
from nailgun import entities
... | org = entities.Organization().create()
manifests.upload_manifest_locked(org.id)
return org |
<|file_name|>test_sync.py<|end_file_name|><|fim▁begin|>"""Test class for Custom Sync UI
:Requirement: Sync
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Repositories
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string
from nailgun import entities
... | """Create Content Custom Sync with minimal input parameters
:id: 00fb0b04-0293-42c2-92fa-930c75acee89
:expectedresults: Sync procedure is successful
:CaseImportance: Critical
"""
repo = entities.Repository(
url=FAKE_1_YUM_REPO, product=module_custom_product).create()
with session:... |
<|file_name|>test_sync.py<|end_file_name|><|fim▁begin|>"""Test class for Custom Sync UI
:Requirement: Sync
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Repositories
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string
from nailgun import entities
... | """Create Content RedHat Sync with two repos.
:id: e30f6509-0b65-4bcc-a522-b4f3089d3911
:expectedresults: Sync procedure for RedHat Repos is successful
:CaseLevel: Integration
"""
repos = (
SatelliteCapsuleRepository(cdn=True),
RHELCloudFormsTools(cdn=True)
)
distros =... |
<|file_name|>test_sync.py<|end_file_name|><|fim▁begin|>"""Test class for Custom Sync UI
:Requirement: Sync
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Repositories
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string
from nailgun import entities
... | """Create custom ostree repository and sync it.
:id: e4119b9b-0356-4661-a3ec-e5807224f7d2
:expectedresults: ostree repo should be synced successfully
:CaseLevel: Integration
"""
repo = entities.Repository(
content_type='ostree',
url=FEDORA27_OSTREE_REPO,
product=module... |
<|file_name|>test_sync.py<|end_file_name|><|fim▁begin|>"""Test class for Custom Sync UI
:Requirement: Sync
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Repositories
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string
from nailgun import entities
... | """Sync CDN based ostree repository.
:id: 4d28fff0-5fda-4eee-aa0c-c5af02c31de5
:Steps:
1. Import a valid manifest
2. Enable the OStree repo and sync it
:expectedresults: ostree repo should be synced successfully from CDN
:CaseLevel: Integration
"""
enable_rhrepo_and_fetch... |
<|file_name|>test_sync.py<|end_file_name|><|fim▁begin|>"""Test class for Custom Sync UI
:Requirement: Sync
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Repositories
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string
from nailgun import entities
... | """Create custom docker repo and sync it via the sync status page.
:id: 00b700f4-7e52-48ed-98b2-e49b3be102f2
:expectedresults: Sync procedure for specific docker repository is
successful
:CaseLevel: Integration
"""
product = entities.Product(organization=module_org).create()
repo_... |
<|file_name|>test_sync.py<|end_file_name|><|fim▁begin|>"""Test class for Custom Sync UI
:Requirement: Sync
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Repositories
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string
from nailgun import entities
... | module_org |
<|file_name|>test_sync.py<|end_file_name|><|fim▁begin|>"""Test class for Custom Sync UI
:Requirement: Sync
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Repositories
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string
from nailgun import entities
... | module_custom_product |
<|file_name|>test_sync.py<|end_file_name|><|fim▁begin|>"""Test class for Custom Sync UI
:Requirement: Sync
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Repositories
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string
from nailgun import entities
... | module_org_with_manifest |
<|file_name|>test_sync.py<|end_file_name|><|fim▁begin|>"""Test class for Custom Sync UI
:Requirement: Sync
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Repositories
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string
from nailgun import entities
... | test_positive_sync_custom_repo |
<|file_name|>test_sync.py<|end_file_name|><|fim▁begin|>"""Test class for Custom Sync UI
:Requirement: Sync
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Repositories
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string
from nailgun import entities
... | test_positive_sync_rh_repos |
<|file_name|>test_sync.py<|end_file_name|><|fim▁begin|>"""Test class for Custom Sync UI
:Requirement: Sync
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Repositories
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string
from nailgun import entities
... | test_positive_sync_custom_ostree_repo |
<|file_name|>test_sync.py<|end_file_name|><|fim▁begin|>"""Test class for Custom Sync UI
:Requirement: Sync
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Repositories
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string
from nailgun import entities
... | test_positive_sync_rh_ostree_repo |
<|file_name|>test_sync.py<|end_file_name|><|fim▁begin|>"""Test class for Custom Sync UI
:Requirement: Sync
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Repositories
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string
from nailgun import entities
... | test_positive_sync_docker_via_sync_status |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from timeline import views
urlpatterns = [
url(r'^$', views.timelines, name='timelines'),
]<|fim▁end|> | from django.conf.urls import url
|
<|file_name|>ndvi.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Version 0.1
# NDVI automated acquisition and calculation by Vladyslav Popov
# Using landsat-util, source: https://github.com/developmentseed/landsat-util
# Uses Amazon Web Services Public Dataset (Lansat 8)
# Script should be run every day... | |
<|file_name|>ndvi.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Version 0.1
# NDVI automated acquisition and calculation by Vladyslav Popov
# Using landsat-util, source: https://github.com/developmentseed/landsat-util
# Uses Amazon Web Services Public Dataset (Lansat 8)
# Script should be run every day... | os.makedirs(temp_folder) |
<|file_name|>ndvi.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Version 0.1
# NDVI automated acquisition and calculation by Vladyslav Popov
# Using landsat-util, source: https://github.com/developmentseed/landsat-util
# Uses Amazon Web Services Public Dataset (Lansat 8)
# Script should be run every day... | os.makedirs(scene_folder) |
<|file_name|>ndvi.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Version 0.1
# NDVI automated acquisition and calculation by Vladyslav Popov
# Using landsat-util, source: https://github.com/developmentseed/landsat-util
# Uses Amazon Web Services Public Dataset (Lansat 8)
# Script should be run every day... | break |
<|file_name|>ndvi.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Version 0.1
# NDVI automated acquisition and calculation by Vladyslav Popov
# Using landsat-util, source: https://github.com/developmentseed/landsat-util
# Uses Amazon Web Services Public Dataset (Lansat 8)
# Script should be run every day... | break |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
from django.shortcuts import redirect, render_to_response
from django.template.context import RequestContext
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
#... | "title": "License", |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
from django.shortcuts import redirect, render_to_response
from django.template.context import RequestContext
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
#... | return redirect('/blog/', permanent=False) |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
from django.shortcuts import redirect, render_to_response
from django.template.context import RequestContext
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
#... | slicense = """
Copyright (c) 2012-2013 Justin Crawford <Justasic@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the abo... |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
from django.shortcuts import redirect, render_to_response
from django.template.context import RequestContext
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
#... | to_blog |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
from django.shortcuts import redirect, render_to_response
from django.template.context import RequestContext
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
#... | sslicense |
<|file_name|>one_D_helmholtz.py<|end_file_name|><|fim▁begin|>from numpy import array, zeros, ones, sqrt, ravel, mod, random, inner, conjugate
from scipy.sparse import csr_matrix, csc_matrix, coo_matrix, bmat, eye
from scipy import rand, mat, real, imag, linspace, hstack, vstack, exp, cos, sin, pi
from pyamg.util.linalg... | returns
-------
Applies minimization algorithm to find numerically lowest energy wavenumber |
<|file_name|>one_D_helmholtz.py<|end_file_name|><|fim▁begin|>from numpy import array, zeros, ones, sqrt, ravel, mod, random, inner, conjugate
from scipy.sparse import csr_matrix, csc_matrix, coo_matrix, bmat, eye
from scipy import rand, mat, real, imag, linspace, hstack, vstack, exp, cos, sin, pi
from pyamg.util.linalg... | '''
parameters
----------
A {matrix}
1D Helmholtz Operator
omega {scalar}
Wavenumber used to discretize Helmholtz problem
x {array}
1D mesh for the problem
tol {scalar}
minimization tolerance
maxit {integer}
maximum iters for minimization algorith... |
<|file_name|>one_D_helmholtz.py<|end_file_name|><|fim▁begin|>from numpy import array, zeros, ones, sqrt, ravel, mod, random, inner, conjugate
from scipy.sparse import csr_matrix, csc_matrix, coo_matrix, bmat, eye
from scipy import rand, mat, real, imag, linspace, hstack, vstack, exp, cos, sin, pi
from pyamg.util.linalg... | c = cos((omega+alpha)*x)
Ac = (A*c)[1:-1]
return norm(Ac)/norm(c[1:-1]) |
<|file_name|>one_D_helmholtz.py<|end_file_name|><|fim▁begin|>from numpy import array, zeros, ones, sqrt, ravel, mod, random, inner, conjugate
from scipy.sparse import csr_matrix, csc_matrix, coo_matrix, bmat, eye
from scipy import rand, mat, real, imag, linspace, hstack, vstack, exp, cos, sin, pi
from pyamg.util.linalg... | '''
parameters
----------
h {int}
Number of grid spacings for 1-D Helmholtz
omega {float}
Defines Helmholtz wave number
nplane_waves {int}
Defines the number of planewaves used for the near null-space modes, B.
1: B = [ exp(ikx) ]
2: B = [ real(exp(ikx)),... |
<|file_name|>one_D_helmholtz.py<|end_file_name|><|fim▁begin|>from numpy import array, zeros, ones, sqrt, ravel, mod, random, inner, conjugate
from scipy.sparse import csr_matrix, csc_matrix, coo_matrix, bmat, eye
from scipy import rand, mat, real, imag, linspace, hstack, vstack, exp, cos, sin, pi
from pyamg.util.linalg... | B[:,0] = exp(1.0j*(omega+shift)*vertices[:,0]) |
<|file_name|>one_D_helmholtz.py<|end_file_name|><|fim▁begin|>from numpy import array, zeros, ones, sqrt, ravel, mod, random, inner, conjugate
from scipy.sparse import csr_matrix, csc_matrix, coo_matrix, bmat, eye
from scipy import rand, mat, real, imag, linspace, hstack, vstack, exp, cos, sin, pi
from pyamg.util.linalg... | B[:,0] = cos((omega+shift)*vertices[:,0])
B[:,1] = sin((omega+shift)*vertices[:,0]) |
<|file_name|>one_D_helmholtz.py<|end_file_name|><|fim▁begin|>from numpy import array, zeros, ones, sqrt, ravel, mod, random, inner, conjugate
from scipy.sparse import csr_matrix, csc_matrix, coo_matrix, bmat, eye
from scipy import rand, mat, real, imag, linspace, hstack, vstack, exp, cos, sin, pi
from pyamg.util.linalg... | min_wave |
<|file_name|>one_D_helmholtz.py<|end_file_name|><|fim▁begin|>from numpy import array, zeros, ones, sqrt, ravel, mod, random, inner, conjugate
from scipy.sparse import csr_matrix, csc_matrix, coo_matrix, bmat, eye
from scipy import rand, mat, real, imag, linspace, hstack, vstack, exp, cos, sin, pi
from pyamg.util.linalg... | obj_fcn |
<|file_name|>one_D_helmholtz.py<|end_file_name|><|fim▁begin|>from numpy import array, zeros, ones, sqrt, ravel, mod, random, inner, conjugate
from scipy.sparse import csr_matrix, csc_matrix, coo_matrix, bmat, eye
from scipy import rand, mat, real, imag, linspace, hstack, vstack, exp, cos, sin, pi
from pyamg.util.linalg... | one_D_helmholtz |
<|file_name|>query.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# 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 2 of the License, or (at your
# option) any later versio... | # to ensure your cached credentials are up to date. See update.py for |
<|file_name|>typogrify.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from jinja2 import Markup
from rstblog.programs import RSTProgram
import typogrify
<|fim▁hole|>class TypogrifyRSTProgram(RSTProgram):
def get_fragments(self):
if self._fragment_cache is not None:
ret... | |
<|file_name|>typogrify.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from jinja2 import Markup
from rstblog.programs import RSTProgram
import typogrify
class TypogrifyRSTProgram(RSTProgram):
<|fim_middle|>
def setup(builder):
builder.programs['rst'] = TypogrifyRSTProgram<|fim▁end... | def get_fragments(self):
if self._fragment_cache is not None:
return self._fragment_cache
with self.context.open_source_file() as f:
self.get_header(f)
rv = self.context.render_rst(f.read().decode('utf-8'))
rv['fragment'] = Markup(typogrify.typogrify(rv['f... |
<|file_name|>typogrify.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from jinja2 import Markup
from rstblog.programs import RSTProgram
import typogrify
class TypogrifyRSTProgram(RSTProgram):
def get_fragments(self):
<|fim_middle|>
def setup(builder):
builder.programs['rst... | if self._fragment_cache is not None:
return self._fragment_cache
with self.context.open_source_file() as f:
self.get_header(f)
rv = self.context.render_rst(f.read().decode('utf-8'))
rv['fragment'] = Markup(typogrify.typogrify(rv['fragment']))
self._fra... |
<|file_name|>typogrify.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from jinja2 import Markup
from rstblog.programs import RSTProgram
import typogrify
class TypogrifyRSTProgram(RSTProgram):
def get_fragments(self):
if self._fragment_cache is not None:
return self._f... | builder.programs['rst'] = TypogrifyRSTProgram |
<|file_name|>typogrify.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from jinja2 import Markup
from rstblog.programs import RSTProgram
import typogrify
class TypogrifyRSTProgram(RSTProgram):
def get_fragments(self):
if self._fragment_cache is not None:
<|... | return self._fragment_cache |
<|file_name|>typogrify.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from jinja2 import Markup
from rstblog.programs import RSTProgram
import typogrify
class TypogrifyRSTProgram(RSTProgram):
def <|fim_middle|>(self):
if self._fragment_cache is not None:
return self._... | get_fragments |
<|file_name|>typogrify.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from jinja2 import Markup
from rstblog.programs import RSTProgram
import typogrify
class TypogrifyRSTProgram(RSTProgram):
def get_fragments(self):
if self._fragment_cache is not None:
return self._f... | setup |
<|file_name|>prefixed_command_runner.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import os
import os.path
import subprocess
from pre_commit.util import cmd_output
class PrefixedCommandRunner(object):
"""A PrefixedCommandRunner allows you to run subprocess commands with<|fim▁hole|>
... | comand substitution. |
<|file_name|>prefixed_command_runner.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import os
import os.path
import subprocess
from pre_commit.util import cmd_output
class PrefixedCommandRunner(object):
<|fim_middle|>
<|fim▁end|> | """A PrefixedCommandRunner allows you to run subprocess commands with
comand substitution.
For instance:
PrefixedCommandRunner('/tmp/foo').run(['{prefix}foo.sh', 'bar', 'baz'])
will run ['/tmp/foo/foo.sh', 'bar', 'baz']
"""
def __init__(
self,
prefix_dir,
... |
<|file_name|>prefixed_command_runner.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import os
import os.path
import subprocess
from pre_commit.util import cmd_output
class PrefixedCommandRunner(object):
"""A PrefixedCommandRunner allows you to run subprocess commands with
comand sub... | self.prefix_dir = prefix_dir.rstrip(os.sep) + os.sep
self.__popen = popen
self.__makedirs = makedirs |
<|file_name|>prefixed_command_runner.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import os
import os.path
import subprocess
from pre_commit.util import cmd_output
class PrefixedCommandRunner(object):
"""A PrefixedCommandRunner allows you to run subprocess commands with
comand sub... | if not os.path.exists(self.prefix_dir):
self.__makedirs(self.prefix_dir) |
<|file_name|>prefixed_command_runner.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import os
import os.path
import subprocess
from pre_commit.util import cmd_output
class PrefixedCommandRunner(object):
"""A PrefixedCommandRunner allows you to run subprocess commands with
comand sub... | self._create_path_if_not_exists()
replaced_cmd = [
part.replace('{prefix}', self.prefix_dir) for part in cmd
]
return cmd_output(*replaced_cmd, __popen=self.__popen, **kwargs) |
<|file_name|>prefixed_command_runner.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import os
import os.path
import subprocess
from pre_commit.util import cmd_output
class PrefixedCommandRunner(object):
"""A PrefixedCommandRunner allows you to run subprocess commands with
comand sub... | path = os.path.join(self.prefix_dir, *parts)
return os.path.normpath(path) |
<|file_name|>prefixed_command_runner.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import os
import os.path
import subprocess
from pre_commit.util import cmd_output
class PrefixedCommandRunner(object):
"""A PrefixedCommandRunner allows you to run subprocess commands with
comand sub... | return os.path.exists(self.path(*parts)) |
<|file_name|>prefixed_command_runner.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import os
import os.path
import subprocess
from pre_commit.util import cmd_output
class PrefixedCommandRunner(object):
"""A PrefixedCommandRunner allows you to run subprocess commands with
comand sub... | """Constructs a new command runner from an existing one by appending
`path_end` to the command runner's prefix directory.
"""
return cls(
command_runner.path(path_end),
popen=command_runner.__popen,
makedirs=command_runner.__makedirs,
) |
<|file_name|>prefixed_command_runner.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import os
import os.path
import subprocess
from pre_commit.util import cmd_output
class PrefixedCommandRunner(object):
"""A PrefixedCommandRunner allows you to run subprocess commands with
comand sub... | self.__makedirs(self.prefix_dir) |
<|file_name|>prefixed_command_runner.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import os
import os.path
import subprocess
from pre_commit.util import cmd_output
class PrefixedCommandRunner(object):
"""A PrefixedCommandRunner allows you to run subprocess commands with
comand sub... | __init__ |
<|file_name|>prefixed_command_runner.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import os
import os.path
import subprocess
from pre_commit.util import cmd_output
class PrefixedCommandRunner(object):
"""A PrefixedCommandRunner allows you to run subprocess commands with
comand sub... | _create_path_if_not_exists |
<|file_name|>prefixed_command_runner.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import os
import os.path
import subprocess
from pre_commit.util import cmd_output
class PrefixedCommandRunner(object):
"""A PrefixedCommandRunner allows you to run subprocess commands with
comand sub... | run |
<|file_name|>prefixed_command_runner.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import os
import os.path
import subprocess
from pre_commit.util import cmd_output
class PrefixedCommandRunner(object):
"""A PrefixedCommandRunner allows you to run subprocess commands with
comand sub... | path |
<|file_name|>prefixed_command_runner.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import os
import os.path
import subprocess
from pre_commit.util import cmd_output
class PrefixedCommandRunner(object):
"""A PrefixedCommandRunner allows you to run subprocess commands with
comand sub... | exists |
<|file_name|>prefixed_command_runner.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import os
import os.path
import subprocess
from pre_commit.util import cmd_output
class PrefixedCommandRunner(object):
"""A PrefixedCommandRunner allows you to run subprocess commands with
comand sub... | from_command_runner |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import pkg_resources
from gosa.common.compone... | @staticmethod |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import pkg_resources
from gosa.common.compone... | instance = None
backends = {}
uuidAttr = "entryUUID"
__index = None
def __init__(self):
# Load available backends
for entry in pkg_resources.iter_entry_points("gosa.object.backend"):
clazz = entry.load()
ObjectBackendRegistry.backends[clazz.__name__] = clazz(... |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import pkg_resources
from gosa.common.compone... | for entry in pkg_resources.iter_entry_points("gosa.object.backend"):
clazz = entry.load()
ObjectBackendRegistry.backends[clazz.__name__] = clazz() |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import pkg_resources
from gosa.common.compone... | uuid = ObjectBackendRegistry.backends[backend].dn2uuid(dn)
if uuid is None and from_db_only is True:
# fallback to db
if self.__index is None:
self.__index = PluginRegistry.getInstance("ObjectIndex")
res = self.__index.search({'dn': dn}, {'uuid': 1})
... |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import pkg_resources
from gosa.common.compone... | dn = ObjectBackendRegistry.backends[backend].uuid2dn(uuid)
if dn is None and from_db_only is True:
# fallback to db
if self.__index is None:
self.__index = PluginRegistry.getInstance("ObjectIndex")
res = self.__index.search({'uuid': uuid}, {'dn': 1})
... |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import pkg_resources
from gosa.common.compone... | return ObjectBackendRegistry.backends[backend].get_timestamps(dn) |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import pkg_resources
from gosa.common.compone... | if not ObjectBackendRegistry.instance:
ObjectBackendRegistry.instance = ObjectBackendRegistry()
return ObjectBackendRegistry.instance |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import pkg_resources
from gosa.common.compone... | if not name in ObjectBackendRegistry.backends:
raise ValueError(C.make_error("BACKEND_NOT_FOUND", name))
return ObjectBackendRegistry.backends[name] |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import pkg_resources
from gosa.common.compone... | __init__ |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import pkg_resources
from gosa.common.compone... | dn2uuid |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import pkg_resources
from gosa.common.compone... | uuid2dn |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import pkg_resources
from gosa.common.compone... | get_timestamps |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import pkg_resources
from gosa.common.compone... | getInstance |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import pkg_resources
from gosa.common.compone... | getBackend |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import pkg_resources
from gosa.common.compone... | if self.__index is None:
self.__index = PluginRegistry.getInstance("ObjectIndex")
res = self.__index.search({'dn': dn}, {'uuid': 1})
if len(res) == 1:
uuid = res[0]['_uuid'] |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import pkg_resources
from gosa.common.compone... | self.__index = PluginRegistry.getInstance("ObjectIndex") |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import pkg_resources
from gosa.common.compone... | uuid = res[0]['_uuid'] |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import pkg_resources
from gosa.common.compone... | if self.__index is None:
self.__index = PluginRegistry.getInstance("ObjectIndex")
res = self.__index.search({'uuid': uuid}, {'dn': 1})
if len(res) == 1:
dn = res[0]['dn'] |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import pkg_resources
from gosa.common.compone... | self.__index = PluginRegistry.getInstance("ObjectIndex") |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import pkg_resources
from gosa.common.compone... | dn = res[0]['dn'] |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import pkg_resources
from gosa.common.compone... | ObjectBackendRegistry.instance = ObjectBackendRegistry() |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import pkg_resources
from gosa.common.compone... | raise ValueError(C.make_error("BACKEND_NOT_FOUND", name)) |
<|file_name|>teamqueue.py<|end_file_name|><|fim▁begin|>################################################################<|fim▁hole|># modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# ... | # LiveQ - An interactive volunteering computing batch system
# Copyright (C) 2013 Ioannis Charalampidis
#
# This program is free software; you can redistribute it and/or |
<|file_name|>teamqueue.py<|end_file_name|><|fim▁begin|>################################################################
# LiveQ - An interactive volunteering computing batch system
# Copyright (C) 2013 Ioannis Charalampidis
#
# This program is free software; you can redistribute it and/or
# modify it under the terms o... | """
This should be called periodically to check and schedule jobs pending for the
particular team
"""
pass |
<|file_name|>teamqueue.py<|end_file_name|><|fim▁begin|>################################################################
# LiveQ - An interactive volunteering computing batch system
# Copyright (C) 2013 Ioannis Charalampidis
#
# This program is free software; you can redistribute it and/or
# modify it under the terms o... | processTeamQueue |
<|file_name|>md5.py<|end_file_name|><|fim▁begin|>from __future__ import with_statement
from fabric.api import task
<|fim▁hole|>
@task
def md5():
"""
Check MD5 sums (unavailable, empty, with content)
"""
import hashlib
from fabric.api import cd, hide, run, settings
import fabtools
with cd... | |
<|file_name|>md5.py<|end_file_name|><|fim▁begin|>from __future__ import with_statement
from fabric.api import task
@task
def md5():
<|fim_middle|>
<|fim▁end|> | """
Check MD5 sums (unavailable, empty, with content)
"""
import hashlib
from fabric.api import cd, hide, run, settings
import fabtools
with cd('/tmp'):
run('touch f1')
assert fabtools.files.md5sum('f1') == hashlib.md5('').hexdigest()
run('echo -n hello > f2')
... |
<|file_name|>md5.py<|end_file_name|><|fim▁begin|>from __future__ import with_statement
from fabric.api import task
@task
def <|fim_middle|>():
"""
Check MD5 sums (unavailable, empty, with content)
"""
import hashlib
from fabric.api import cd, hide, run, settings
import fabtools
with cd... | md5 |
<|file_name|>test_model.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.4
#
# Copyright 2010 Google Inc.
#
# 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/lice... | if __name__ == '__main__':
unittest.main() |
<|file_name|>test_model.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.4
#
# Copyright 2010 Google Inc.
#
# 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/lice... | def test_patch(self):
for (msg, orig, mod, expected_patch) in TEST_CASES:
self.assertEqual(expected_patch, makepatch(orig, mod), msg=msg) |
<|file_name|>test_model.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.4
#
# Copyright 2010 Google Inc.
#
# 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/lice... | for (msg, orig, mod, expected_patch) in TEST_CASES:
self.assertEqual(expected_patch, makepatch(orig, mod), msg=msg) |
<|file_name|>test_model.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.4
#
# Copyright 2010 Google Inc.
#
# 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/lice... | unittest.main() |
<|file_name|>test_model.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.4
#
# Copyright 2010 Google Inc.
#
# 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/lice... | test_patch |
<|file_name|>Zested.py<|end_file_name|><|fim▁begin|><|fim▁hole|>#!/usr/bin/env python3
from zested.main import main
if __name__ == "__main__":
main()<|fim▁end|> | |
<|file_name|>Zested.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
from zested.main import main
if __name__ == "__main__":
<|fim_middle|>
<|fim▁end|> | main() |
<|file_name|>navclass.py<|end_file_name|><|fim▁begin|>from django.template import Library, Node, resolve_variable, TemplateSyntaxError
from django.core.urlresolvers import reverse
register = Library()
@register.simple_tag
def active(request, pattern):<|fim▁hole|> return 'active'
return ''<|fim▁end|> | import re
if re.search(pattern, request.get_full_path()): |
<|file_name|>navclass.py<|end_file_name|><|fim▁begin|>from django.template import Library, Node, resolve_variable, TemplateSyntaxError
from django.core.urlresolvers import reverse
register = Library()
@register.simple_tag
def active(request, pattern):
<|fim_middle|>
<|fim▁end|> | import re
if re.search(pattern, request.get_full_path()):
return 'active'
return '' |
<|file_name|>navclass.py<|end_file_name|><|fim▁begin|>from django.template import Library, Node, resolve_variable, TemplateSyntaxError
from django.core.urlresolvers import reverse
register = Library()
@register.simple_tag
def active(request, pattern):
import re
if re.search(pattern, request.get_full_path(... | return 'active' |
<|file_name|>navclass.py<|end_file_name|><|fim▁begin|>from django.template import Library, Node, resolve_variable, TemplateSyntaxError
from django.core.urlresolvers import reverse
register = Library()
@register.simple_tag
def <|fim_middle|>(request, pattern):
import re
if re.search(pattern, request.get_fu... | active |
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of CERN Document Server.
# Copyright (C) 2016, 2019 CERN.
#
# CERN Document Server 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... | import shutil
import tempfile
import uuid |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.