repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
project-ncl/pnc-cli
pnc_cli/bpmbuildconfigurations.py
wait_for_repo_creation
def wait_for_repo_creation(task_id, retry=30): """ Using polling check if the task finished """ success_event_types = ("RC_CREATION_SUCCESS", ) error_event_types = ("RC_REPO_CREATION_ERROR", "RC_REPO_CLONE_ERROR", "RC_CREATION_ERROR") while retry > 0: bpm_task = get_bpm_task_by_id(task_...
python
def wait_for_repo_creation(task_id, retry=30): """ Using polling check if the task finished """ success_event_types = ("RC_CREATION_SUCCESS", ) error_event_types = ("RC_REPO_CREATION_ERROR", "RC_REPO_CLONE_ERROR", "RC_CREATION_ERROR") while retry > 0: bpm_task = get_bpm_task_by_id(task_...
[ "def", "wait_for_repo_creation", "(", "task_id", ",", "retry", "=", "30", ")", ":", "success_event_types", "=", "(", "\"RC_CREATION_SUCCESS\"", ",", ")", "error_event_types", "=", "(", "\"RC_REPO_CREATION_ERROR\"", ",", "\"RC_REPO_CLONE_ERROR\"", ",", "\"RC_CREATION_ERR...
Using polling check if the task finished
[ "Using", "polling", "check", "if", "the", "task", "finished" ]
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/bpmbuildconfigurations.py#L91-L111
SmartTeleMax/iktomi
iktomi/utils/i18n.py
M_.count
def count(self): ''' A count based on `count_field` and `format_args`. ''' args = self.format_args if args is None or \ (isinstance(args, dict) and self.count_field not in args): raise TypeError("count is required") return args[self.count_field...
python
def count(self): ''' A count based on `count_field` and `format_args`. ''' args = self.format_args if args is None or \ (isinstance(args, dict) and self.count_field not in args): raise TypeError("count is required") return args[self.count_field...
[ "def", "count", "(", "self", ")", ":", "args", "=", "self", ".", "format_args", "if", "args", "is", "None", "or", "(", "isinstance", "(", "args", ",", "dict", ")", "and", "self", ".", "count_field", "not", "in", "args", ")", ":", "raise", "TypeError"...
A count based on `count_field` and `format_args`.
[ "A", "count", "based", "on", "count_field", "and", "format_args", "." ]
train
https://github.com/SmartTeleMax/iktomi/blob/80bc0f1408d63efe7f5844367d1f6efba44b35f2/iktomi/utils/i18n.py#L51-L59
project-ncl/pnc-cli
pnc_cli/archives.py
generate_sources_zip
def generate_sources_zip(milestone_id=None, output=None): """ Generate a sources archive for given milestone id. """ if not is_input_valid(milestone_id, output): logging.error("invalid input") return 1 create_work_dir(output) download_sources_artifacts(milestone_id, output) ...
python
def generate_sources_zip(milestone_id=None, output=None): """ Generate a sources archive for given milestone id. """ if not is_input_valid(milestone_id, output): logging.error("invalid input") return 1 create_work_dir(output) download_sources_artifacts(milestone_id, output) ...
[ "def", "generate_sources_zip", "(", "milestone_id", "=", "None", ",", "output", "=", "None", ")", ":", "if", "not", "is_input_valid", "(", "milestone_id", ",", "output", ")", ":", "logging", ".", "error", "(", "\"invalid input\"", ")", "return", "1", "create...
Generate a sources archive for given milestone id.
[ "Generate", "a", "sources", "archive", "for", "given", "milestone", "id", "." ]
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/archives.py#L19-L28
project-ncl/pnc-cli
pnc_cli/repositoryconfigurations.py
get_repository_configuration
def get_repository_configuration(id): """ Retrieve a specific RepositoryConfiguration """ response = utils.checked_api_call(pnc_api.repositories, 'get_specific', id=id) if response: return response.content
python
def get_repository_configuration(id): """ Retrieve a specific RepositoryConfiguration """ response = utils.checked_api_call(pnc_api.repositories, 'get_specific', id=id) if response: return response.content
[ "def", "get_repository_configuration", "(", "id", ")", ":", "response", "=", "utils", ".", "checked_api_call", "(", "pnc_api", ".", "repositories", ",", "'get_specific'", ",", "id", "=", "id", ")", "if", "response", ":", "return", "response", ".", "content" ]
Retrieve a specific RepositoryConfiguration
[ "Retrieve", "a", "specific", "RepositoryConfiguration" ]
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/repositoryconfigurations.py#L11-L18
project-ncl/pnc-cli
pnc_cli/repositoryconfigurations.py
update_repository_configuration
def update_repository_configuration(id, external_repository=None, prebuild_sync=None): """ Update an existing RepositoryConfiguration with new information """ to_update_id = id rc_to_update = pnc_api.repositories.get_specific(id=to_update_id).content if external_repository is None: ext...
python
def update_repository_configuration(id, external_repository=None, prebuild_sync=None): """ Update an existing RepositoryConfiguration with new information """ to_update_id = id rc_to_update = pnc_api.repositories.get_specific(id=to_update_id).content if external_repository is None: ext...
[ "def", "update_repository_configuration", "(", "id", ",", "external_repository", "=", "None", ",", "prebuild_sync", "=", "None", ")", ":", "to_update_id", "=", "id", "rc_to_update", "=", "pnc_api", ".", "repositories", ".", "get_specific", "(", "id", "=", "to_up...
Update an existing RepositoryConfiguration with new information
[ "Update", "an", "existing", "RepositoryConfiguration", "with", "new", "information" ]
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/repositoryconfigurations.py#L24-L46
project-ncl/pnc-cli
pnc_cli/repositoryconfigurations.py
list_repository_configurations
def list_repository_configurations(page_size=200, page_index=0, sort="", q=""): """ List all RepositoryConfigurations """ response = utils.checked_api_call(pnc_api.repositories, 'get_all', page_size=page_size, page_index=page_index, sort=sort, q=q) if response: return utils.format_json_list(...
python
def list_repository_configurations(page_size=200, page_index=0, sort="", q=""): """ List all RepositoryConfigurations """ response = utils.checked_api_call(pnc_api.repositories, 'get_all', page_size=page_size, page_index=page_index, sort=sort, q=q) if response: return utils.format_json_list(...
[ "def", "list_repository_configurations", "(", "page_size", "=", "200", ",", "page_index", "=", "0", ",", "sort", "=", "\"\"", ",", "q", "=", "\"\"", ")", ":", "response", "=", "utils", ".", "checked_api_call", "(", "pnc_api", ".", "repositories", ",", "'ge...
List all RepositoryConfigurations
[ "List", "all", "RepositoryConfigurations" ]
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/repositoryconfigurations.py#L52-L58
project-ncl/pnc-cli
pnc_cli/repositoryconfigurations.py
search_repository_configuration
def search_repository_configuration(url, page_size=10, page_index=0, sort=""): """ Search for Repository Configurations based on internal or external url """ content = search_repository_configuration_raw(url, page_size, page_index, sort) if content: return utils.format_json_list(content)
python
def search_repository_configuration(url, page_size=10, page_index=0, sort=""): """ Search for Repository Configurations based on internal or external url """ content = search_repository_configuration_raw(url, page_size, page_index, sort) if content: return utils.format_json_list(content)
[ "def", "search_repository_configuration", "(", "url", ",", "page_size", "=", "10", ",", "page_index", "=", "0", ",", "sort", "=", "\"\"", ")", ":", "content", "=", "search_repository_configuration_raw", "(", "url", ",", "page_size", ",", "page_index", ",", "so...
Search for Repository Configurations based on internal or external url
[ "Search", "for", "Repository", "Configurations", "based", "on", "internal", "or", "external", "url" ]
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/repositoryconfigurations.py#L64-L70
project-ncl/pnc-cli
pnc_cli/repositoryconfigurations.py
search_repository_configuration_raw
def search_repository_configuration_raw(url, page_size=10, page_index=0, sort=""): """ Search for Repository Configurations based on internal or external url """ response = utils.checked_api_call(pnc_api.repositories, 'search', page_size=page_size, page_index=page_index, sort=sort, search=url) if re...
python
def search_repository_configuration_raw(url, page_size=10, page_index=0, sort=""): """ Search for Repository Configurations based on internal or external url """ response = utils.checked_api_call(pnc_api.repositories, 'search', page_size=page_size, page_index=page_index, sort=sort, search=url) if re...
[ "def", "search_repository_configuration_raw", "(", "url", ",", "page_size", "=", "10", ",", "page_index", "=", "0", ",", "sort", "=", "\"\"", ")", ":", "response", "=", "utils", ".", "checked_api_call", "(", "pnc_api", ".", "repositories", ",", "'search'", "...
Search for Repository Configurations based on internal or external url
[ "Search", "for", "Repository", "Configurations", "based", "on", "internal", "or", "external", "url" ]
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/repositoryconfigurations.py#L72-L78
project-ncl/pnc-cli
pnc_cli/repositoryconfigurations.py
match_repository_configuration
def match_repository_configuration(url, page_size=10, page_index=0, sort=""): """ Search for Repository Configurations based on internal or external url with exact match """ content = match_repository_configuration_raw(url, page_size, page_index, sort) if content: return utils.format_json_li...
python
def match_repository_configuration(url, page_size=10, page_index=0, sort=""): """ Search for Repository Configurations based on internal or external url with exact match """ content = match_repository_configuration_raw(url, page_size, page_index, sort) if content: return utils.format_json_li...
[ "def", "match_repository_configuration", "(", "url", ",", "page_size", "=", "10", ",", "page_index", "=", "0", ",", "sort", "=", "\"\"", ")", ":", "content", "=", "match_repository_configuration_raw", "(", "url", ",", "page_size", ",", "page_index", ",", "sort...
Search for Repository Configurations based on internal or external url with exact match
[ "Search", "for", "Repository", "Configurations", "based", "on", "internal", "or", "external", "url", "with", "exact", "match" ]
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/repositoryconfigurations.py#L84-L90
SmartTeleMax/iktomi
iktomi/forms/form.py
Form.render
def render(self): '''Proxy method to form's environment render method''' return self.env.template.render(self.template, form=self)
python
def render(self): '''Proxy method to form's environment render method''' return self.env.template.render(self.template, form=self)
[ "def", "render", "(", "self", ")", ":", "return", "self", ".", "env", ".", "template", ".", "render", "(", "self", ".", "template", ",", "form", "=", "self", ")" ]
Proxy method to form's environment render method
[ "Proxy", "method", "to", "form", "s", "environment", "render", "method" ]
train
https://github.com/SmartTeleMax/iktomi/blob/80bc0f1408d63efe7f5844367d1f6efba44b35f2/iktomi/forms/form.py#L64-L66
SmartTeleMax/iktomi
iktomi/forms/form.py
Form.accept
def accept(self, data): ''' Try to accpet MultiDict-like object and return if it is valid. ''' self.raw_data = MultiDict(data) self.errors = {} for field in self.fields: if field.writable: self.python_data.update(field.accept()) els...
python
def accept(self, data): ''' Try to accpet MultiDict-like object and return if it is valid. ''' self.raw_data = MultiDict(data) self.errors = {} for field in self.fields: if field.writable: self.python_data.update(field.accept()) els...
[ "def", "accept", "(", "self", ",", "data", ")", ":", "self", ".", "raw_data", "=", "MultiDict", "(", "data", ")", "self", ".", "errors", "=", "{", "}", "for", "field", "in", "self", ".", "fields", ":", "if", "field", ".", "writable", ":", "self", ...
Try to accpet MultiDict-like object and return if it is valid.
[ "Try", "to", "accpet", "MultiDict", "-", "like", "object", "and", "return", "if", "it", "is", "valid", "." ]
train
https://github.com/SmartTeleMax/iktomi/blob/80bc0f1408d63efe7f5844367d1f6efba44b35f2/iktomi/forms/form.py#L73-L88
SmartTeleMax/iktomi
iktomi/forms/form.py
Form.get_data
def get_data(self, compact=True): ''' Returns data representing current state of the form. While Form.raw_data may contain alien fields and invalid data, this method returns only valid fields that belong to this form only. It's designed to pass somewhere current state of the form...
python
def get_data(self, compact=True): ''' Returns data representing current state of the form. While Form.raw_data may contain alien fields and invalid data, this method returns only valid fields that belong to this form only. It's designed to pass somewhere current state of the form...
[ "def", "get_data", "(", "self", ",", "compact", "=", "True", ")", ":", "data", "=", "MultiDict", "(", ")", "for", "field", "in", "self", ".", "fields", ":", "raw_value", "=", "field", ".", "from_python", "(", "self", ".", "python_data", "[", "field", ...
Returns data representing current state of the form. While Form.raw_data may contain alien fields and invalid data, this method returns only valid fields that belong to this form only. It's designed to pass somewhere current state of the form (as query string or by other means).
[ "Returns", "data", "representing", "current", "state", "of", "the", "form", ".", "While", "Form", ".", "raw_data", "may", "contain", "alien", "fields", "and", "invalid", "data", "this", "method", "returns", "only", "valid", "fields", "that", "belong", "to", ...
train
https://github.com/SmartTeleMax/iktomi/blob/80bc0f1408d63efe7f5844367d1f6efba44b35f2/iktomi/forms/form.py#L106-L120
project-ncl/pnc-cli
pnc_cli/swagger_client/apis/buildconfigurationsets_api.py
BuildconfigurationsetsApi.add_configuration
def add_configuration(self, id, **kwargs): """ Adds a configuration to the Specified Set This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. ...
python
def add_configuration(self, id, **kwargs): """ Adds a configuration to the Specified Set This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. ...
[ "def", "add_configuration", "(", "self", ",", "id", ",", "*", "*", "kwargs", ")", ":", "kwargs", "[", "'_return_http_data_only'", "]", "=", "True", "if", "kwargs", ".", "get", "(", "'callback'", ")", ":", "return", "self", ".", "add_configuration_with_http_i...
Adds a configuration to the Specified Set This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(res...
[ "Adds", "a", "configuration", "to", "the", "Specified", "Set", "This", "method", "makes", "a", "synchronous", "HTTP", "request", "by", "default", ".", "To", "make", "an", "asynchronous", "HTTP", "request", "please", "define", "a", "callback", "function", "to",...
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/swagger_client/apis/buildconfigurationsets_api.py#L42-L67
project-ncl/pnc-cli
pnc_cli/swagger_client/apis/buildconfigurationsets_api.py
BuildconfigurationsetsApi.build
def build(self, id, **kwargs): """ Builds the Configurations for the Specified Set This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> de...
python
def build(self, id, **kwargs): """ Builds the Configurations for the Specified Set This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> de...
[ "def", "build", "(", "self", ",", "id", ",", "*", "*", "kwargs", ")", ":", "kwargs", "[", "'_return_http_data_only'", "]", "=", "True", "if", "kwargs", ".", "get", "(", "'callback'", ")", ":", "return", "self", ".", "build_with_http_info", "(", "id", "...
Builds the Configurations for the Specified Set This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> ppri...
[ "Builds", "the", "Configurations", "for", "the", "Specified", "Set", "This", "method", "makes", "a", "synchronous", "HTTP", "request", "by", "default", ".", "To", "make", "an", "asynchronous", "HTTP", "request", "please", "define", "a", "callback", "function", ...
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/swagger_client/apis/buildconfigurationsets_api.py#L152-L181
project-ncl/pnc-cli
pnc_cli/swagger_client/apis/buildconfigurationsets_api.py
BuildconfigurationsetsApi.build_versioned
def build_versioned(self, id, **kwargs): """ Builds the configurations for the Specified Set with an option to specify exact revision of a BC This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function ...
python
def build_versioned(self, id, **kwargs): """ Builds the configurations for the Specified Set with an option to specify exact revision of a BC This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function ...
[ "def", "build_versioned", "(", "self", ",", "id", ",", "*", "*", "kwargs", ")", ":", "kwargs", "[", "'_return_http_data_only'", "]", "=", "True", "if", "kwargs", ".", "get", "(", "'callback'", ")", ":", "return", "self", ".", "build_versioned_with_http_info"...
Builds the configurations for the Specified Set with an option to specify exact revision of a BC This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def ...
[ "Builds", "the", "configurations", "for", "the", "Specified", "Set", "with", "an", "option", "to", "specify", "exact", "revision", "of", "a", "BC", "This", "method", "makes", "a", "synchronous", "HTTP", "request", "by", "default", ".", "To", "make", "an", ...
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/swagger_client/apis/buildconfigurationsets_api.py#L278-L308
project-ncl/pnc-cli
pnc_cli/swagger_client/apis/buildconfigurationsets_api.py
BuildconfigurationsetsApi.delete_specific
def delete_specific(self, id, **kwargs): """ Removes a specific Build Configuration Set This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >...
python
def delete_specific(self, id, **kwargs): """ Removes a specific Build Configuration Set This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >...
[ "def", "delete_specific", "(", "self", ",", "id", ",", "*", "*", "kwargs", ")", ":", "kwargs", "[", "'_return_http_data_only'", "]", "=", "True", "if", "kwargs", ".", "get", "(", "'callback'", ")", ":", "return", "self", ".", "delete_specific_with_http_info"...
Removes a specific Build Configuration Set This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(re...
[ "Removes", "a", "specific", "Build", "Configuration", "Set", "This", "method", "makes", "a", "synchronous", "HTTP", "request", "by", "default", ".", "To", "make", "an", "asynchronous", "HTTP", "request", "please", "define", "a", "callback", "function", "to", "...
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/swagger_client/apis/buildconfigurationsets_api.py#L511-L535
project-ncl/pnc-cli
pnc_cli/swagger_client/apis/buildconfigurationsets_api.py
BuildconfigurationsetsApi.get_all_build_config_set_records
def get_all_build_config_set_records(self, id, **kwargs): """ Get all build config set execution records associated with this build config set, returns empty list if none are found This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, ple...
python
def get_all_build_config_set_records(self, id, **kwargs): """ Get all build config set execution records associated with this build config set, returns empty list if none are found This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, ple...
[ "def", "get_all_build_config_set_records", "(", "self", ",", "id", ",", "*", "*", "kwargs", ")", ":", "kwargs", "[", "'_return_http_data_only'", "]", "=", "True", "if", "kwargs", ".", "get", "(", "'callback'", ")", ":", "return", "self", ".", "get_all_build_...
Get all build config set execution records associated with this build config set, returns empty list if none are found This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the resp...
[ "Get", "all", "build", "config", "set", "execution", "records", "associated", "with", "this", "build", "config", "set", "returns", "empty", "list", "if", "none", "are", "found", "This", "method", "makes", "a", "synchronous", "HTTP", "request", "by", "default",...
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/swagger_client/apis/buildconfigurationsets_api.py#L732-L760
project-ncl/pnc-cli
pnc_cli/swagger_client/apis/buildconfigurationsets_api.py
BuildconfigurationsetsApi.get_build_records
def get_build_records(self, id, **kwargs): """ Gets all build records associated with the contained build configurations This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when ...
python
def get_build_records(self, id, **kwargs): """ Gets all build records associated with the contained build configurations This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when ...
[ "def", "get_build_records", "(", "self", ",", "id", ",", "*", "*", "kwargs", ")", ":", "kwargs", "[", "'_return_http_data_only'", "]", "=", "True", "if", "kwargs", ".", "get", "(", "'callback'", ")", ":", "return", "self", ".", "get_build_records_with_http_i...
Gets all build records associated with the contained build configurations This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(respo...
[ "Gets", "all", "build", "records", "associated", "with", "the", "contained", "build", "configurations", "This", "method", "makes", "a", "synchronous", "HTTP", "request", "by", "default", ".", "To", "make", "an", "asynchronous", "HTTP", "request", "please", "defi...
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/swagger_client/apis/buildconfigurationsets_api.py#L854-L882
project-ncl/pnc-cli
pnc_cli/swagger_client/apis/buildconfigurationsets_api.py
BuildconfigurationsetsApi.get_configurations
def get_configurations(self, id, **kwargs): """ Gets the Configurations for the Specified Set This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. ...
python
def get_configurations(self, id, **kwargs): """ Gets the Configurations for the Specified Set This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. ...
[ "def", "get_configurations", "(", "self", ",", "id", ",", "*", "*", "kwargs", ")", ":", "kwargs", "[", "'_return_http_data_only'", "]", "=", "True", "if", "kwargs", ".", "get", "(", "'callback'", ")", ":", "return", "self", ".", "get_configurations_with_http...
Gets the Configurations for the Specified Set This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint...
[ "Gets", "the", "Configurations", "for", "the", "Specified", "Set", "This", "method", "makes", "a", "synchronous", "HTTP", "request", "by", "default", ".", "To", "make", "an", "asynchronous", "HTTP", "request", "please", "define", "a", "callback", "function", "...
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/swagger_client/apis/buildconfigurationsets_api.py#L976-L1004
project-ncl/pnc-cli
pnc_cli/swagger_client/apis/buildconfigurationsets_api.py
BuildconfigurationsetsApi.remove_configuration
def remove_configuration(self, id, config_id, **kwargs): """ Removes a configuration from the specified config set This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiv...
python
def remove_configuration(self, id, config_id, **kwargs): """ Removes a configuration from the specified config set This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiv...
[ "def", "remove_configuration", "(", "self", ",", "id", ",", "config_id", ",", "*", "*", "kwargs", ")", ":", "kwargs", "[", "'_return_http_data_only'", "]", "=", "True", "if", "kwargs", ".", "get", "(", "'callback'", ")", ":", "return", "self", ".", "remo...
Removes a configuration from the specified config set This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> ...
[ "Removes", "a", "configuration", "from", "the", "specified", "config", "set", "This", "method", "makes", "a", "synchronous", "HTTP", "request", "by", "default", ".", "To", "make", "an", "asynchronous", "HTTP", "request", "please", "define", "a", "callback", "f...
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/swagger_client/apis/buildconfigurationsets_api.py#L1204-L1229
project-ncl/pnc-cli
pnc_cli/swagger_client/apis/buildconfigurationsets_api.py
BuildconfigurationsetsApi.update_configurations
def update_configurations(self, id, **kwargs): """ This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pp...
python
def update_configurations(self, id, **kwargs): """ This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pp...
[ "def", "update_configurations", "(", "self", ",", "id", ",", "*", "*", "kwargs", ")", ":", "kwargs", "[", "'_return_http_data_only'", "]", "=", "True", "if", "kwargs", ".", "get", "(", "'callback'", ")", ":", "return", "self", ".", "update_configurations_wit...
This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.update_configur...
[ "This", "method", "makes", "a", "synchronous", "HTTP", "request", "by", "default", ".", "To", "make", "an", "asynchronous", "HTTP", "request", "please", "define", "a", "callback", "function", "to", "be", "invoked", "when", "receiving", "the", "response", ".", ...
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/swagger_client/apis/buildconfigurationsets_api.py#L1427-L1450
twisted/epsilon
epsilon/hotfixes/plugin_package_paths.py
pluginPackagePaths
def pluginPackagePaths(name): """ Return a list of additional directories which should be searched for modules to be included as part of the named plugin package. @type name: C{str} @param name: The fully-qualified Python name of a plugin package, eg C{'twisted.plugins'}. @rtype: C{lis...
python
def pluginPackagePaths(name): """ Return a list of additional directories which should be searched for modules to be included as part of the named plugin package. @type name: C{str} @param name: The fully-qualified Python name of a plugin package, eg C{'twisted.plugins'}. @rtype: C{lis...
[ "def", "pluginPackagePaths", "(", "name", ")", ":", "package", "=", "name", ".", "split", "(", "'.'", ")", "# Note that this may include directories which do not exist. It may be", "# preferable to remove such directories at this point, rather than allow", "# them to be searched lat...
Return a list of additional directories which should be searched for modules to be included as part of the named plugin package. @type name: C{str} @param name: The fully-qualified Python name of a plugin package, eg C{'twisted.plugins'}. @rtype: C{list} of C{str} @return: The absolute pat...
[ "Return", "a", "list", "of", "additional", "directories", "which", "should", "be", "searched", "for", "modules", "to", "be", "included", "as", "part", "of", "the", "named", "plugin", "package", "." ]
train
https://github.com/twisted/epsilon/blob/e85fa985a41983ef06e1d3bb26639181e1f78b24/epsilon/hotfixes/plugin_package_paths.py#L9-L37
SmartTeleMax/iktomi
iktomi/utils/storage.py
storage_method
def storage_method(func): '''Calls decorated method with VersionedStorage as self''' def wrap(self, *args, **kwargs): return func(self._root_storage, *args, **kwargs) return wrap
python
def storage_method(func): '''Calls decorated method with VersionedStorage as self''' def wrap(self, *args, **kwargs): return func(self._root_storage, *args, **kwargs) return wrap
[ "def", "storage_method", "(", "func", ")", ":", "def", "wrap", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "func", "(", "self", ".", "_root_storage", ",", "*", "args", ",", "*", "*", "kwargs", ")", "return", "wrap" ]
Calls decorated method with VersionedStorage as self
[ "Calls", "decorated", "method", "with", "VersionedStorage", "as", "self" ]
train
https://github.com/SmartTeleMax/iktomi/blob/80bc0f1408d63efe7f5844367d1f6efba44b35f2/iktomi/utils/storage.py#L102-L106
SmartTeleMax/iktomi
iktomi/templates/jinja2/__init__.py
TemplateEngine.render
def render(self, template_name, **kw): 'Interface method called from `Template.render`' return self.env.get_template(template_name).render(**kw)
python
def render(self, template_name, **kw): 'Interface method called from `Template.render`' return self.env.get_template(template_name).render(**kw)
[ "def", "render", "(", "self", ",", "template_name", ",", "*", "*", "kw", ")", ":", "return", "self", ".", "env", ".", "get_template", "(", "template_name", ")", ".", "render", "(", "*", "*", "kw", ")" ]
Interface method called from `Template.render`
[ "Interface", "method", "called", "from", "Template", ".", "render" ]
train
https://github.com/SmartTeleMax/iktomi/blob/80bc0f1408d63efe7f5844367d1f6efba44b35f2/iktomi/templates/jinja2/__init__.py#L36-L38
project-ncl/pnc-cli
pnc_cli/swagger_client/apis/runningbuildrecords_api.py
RunningbuildrecordsApi.cancel_all_builds_in_group
def cancel_all_builds_in_group(self, id, **kwargs): """ Cancel all builds running in the build group This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the respon...
python
def cancel_all_builds_in_group(self, id, **kwargs): """ Cancel all builds running in the build group This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the respon...
[ "def", "cancel_all_builds_in_group", "(", "self", ",", "id", ",", "*", "*", "kwargs", ")", ":", "kwargs", "[", "'_return_http_data_only'", "]", "=", "True", "if", "kwargs", ".", "get", "(", "'callback'", ")", ":", "return", "self", ".", "cancel_all_builds_in...
Cancel all builds running in the build group This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(...
[ "Cancel", "all", "builds", "running", "in", "the", "build", "group", "This", "method", "makes", "a", "synchronous", "HTTP", "request", "by", "default", ".", "To", "make", "an", "asynchronous", "HTTP", "request", "please", "define", "a", "callback", "function",...
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/swagger_client/apis/runningbuildrecords_api.py#L42-L66
project-ncl/pnc-cli
pnc_cli/swagger_client/apis/runningbuildrecords_api.py
RunningbuildrecordsApi.get_all_for_bc
def get_all_for_bc(self, id, **kwargs): """ Gets running Build Records for a specific Build Configuration. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the ...
python
def get_all_for_bc(self, id, **kwargs): """ Gets running Build Records for a specific Build Configuration. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the ...
[ "def", "get_all_for_bc", "(", "self", ",", "id", ",", "*", "*", "kwargs", ")", ":", "kwargs", "[", "'_return_http_data_only'", "]", "=", "True", "if", "kwargs", ".", "get", "(", "'callback'", ")", ":", "return", "self", ".", "get_all_for_bc_with_http_info", ...
Gets running Build Records for a specific Build Configuration. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): ...
[ "Gets", "running", "Build", "Records", "for", "a", "specific", "Build", "Configuration", ".", "This", "method", "makes", "a", "synchronous", "HTTP", "request", "by", "default", ".", "To", "make", "an", "asynchronous", "HTTP", "request", "please", "define", "a"...
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/swagger_client/apis/runningbuildrecords_api.py#L263-L290
project-ncl/pnc-cli
pnc_cli/swagger_client/apis/runningbuildrecords_api.py
RunningbuildrecordsApi.get_all_for_bc_set_record
def get_all_for_bc_set_record(self, id, **kwargs): """ Gets running Build Records for a specific Build Configuration Set Record. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invok...
python
def get_all_for_bc_set_record(self, id, **kwargs): """ Gets running Build Records for a specific Build Configuration Set Record. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invok...
[ "def", "get_all_for_bc_set_record", "(", "self", ",", "id", ",", "*", "*", "kwargs", ")", ":", "kwargs", "[", "'_return_http_data_only'", "]", "=", "True", "if", "kwargs", ".", "get", "(", "'callback'", ")", ":", "return", "self", ".", "get_all_for_bc_set_re...
Gets running Build Records for a specific Build Configuration Set Record. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(respo...
[ "Gets", "running", "Build", "Records", "for", "a", "specific", "Build", "Configuration", "Set", "Record", ".", "This", "method", "makes", "a", "synchronous", "HTTP", "request", "by", "default", ".", "To", "make", "an", "asynchronous", "HTTP", "request", "pleas...
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/swagger_client/apis/runningbuildrecords_api.py#L381-L408
scholrly/orcid-python
orcid/utils.py
dictmapper
def dictmapper(typename, mapping): """ A factory to create `namedtuple`-like classes from a field-to-dict-path mapping:: Person = dictmapper({'person':('person','name')}) example_dict = {'person':{'name':'John'}} john = Person(example_dict) assert john.name == 'John' If...
python
def dictmapper(typename, mapping): """ A factory to create `namedtuple`-like classes from a field-to-dict-path mapping:: Person = dictmapper({'person':('person','name')}) example_dict = {'person':{'name':'John'}} john = Person(example_dict) assert john.name == 'John' If...
[ "def", "dictmapper", "(", "typename", ",", "mapping", ")", ":", "def", "init", "(", "self", ",", "d", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "\"\"\"\n Initialize `dictmapper` classes with a dict to back getters.\n \"\"\"", "self", ".", ...
A factory to create `namedtuple`-like classes from a field-to-dict-path mapping:: Person = dictmapper({'person':('person','name')}) example_dict = {'person':{'name':'John'}} john = Person(example_dict) assert john.name == 'John' If a function is specified as a mapping value ins...
[ "A", "factory", "to", "create", "namedtuple", "-", "like", "classes", "from", "a", "field", "-", "to", "-", "dict", "-", "path", "mapping", "::" ]
train
https://github.com/scholrly/orcid-python/blob/71311ca708689740e99d447716d6f22f1291f6f8/orcid/utils.py#L7-L40
CivicSpleen/ambry
ambry/library/__init__.py
Library.ctor_args
def ctor_args(self): """Return arguments for constructing a copy""" return dict( config=self._config, search=self._search, echo=self._echo, read_only=self.read_only )
python
def ctor_args(self): """Return arguments for constructing a copy""" return dict( config=self._config, search=self._search, echo=self._echo, read_only=self.read_only )
[ "def", "ctor_args", "(", "self", ")", ":", "return", "dict", "(", "config", "=", "self", ".", "_config", ",", "search", "=", "self", ".", "_search", ",", "echo", "=", "self", ".", "_echo", ",", "read_only", "=", "self", ".", "read_only", ")" ]
Return arguments for constructing a copy
[ "Return", "arguments", "for", "constructing", "a", "copy" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L116-L124
CivicSpleen/ambry
ambry/library/__init__.py
Library.sync_config
def sync_config(self, force=False): """Sync the file config into the library proxy data in the root dataset """ from ambry.library.config import LibraryConfigSyncProxy lcsp = LibraryConfigSyncProxy(self) lcsp.sync(force=force)
python
def sync_config(self, force=False): """Sync the file config into the library proxy data in the root dataset """ from ambry.library.config import LibraryConfigSyncProxy lcsp = LibraryConfigSyncProxy(self) lcsp.sync(force=force)
[ "def", "sync_config", "(", "self", ",", "force", "=", "False", ")", ":", "from", "ambry", ".", "library", ".", "config", "import", "LibraryConfigSyncProxy", "lcsp", "=", "LibraryConfigSyncProxy", "(", "self", ")", "lcsp", ".", "sync", "(", "force", "=", "f...
Sync the file config into the library proxy data in the root dataset
[ "Sync", "the", "file", "config", "into", "the", "library", "proxy", "data", "in", "the", "root", "dataset" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L138-L142
CivicSpleen/ambry
ambry/library/__init__.py
Library.init_debug
def init_debug(self): """Initialize debugging features, such as a handler for USR2 to print a trace""" import signal def debug_trace(sig, frame): """Interrupt running process, and provide a python prompt for interactive debugging.""" self.log('Trace signal r...
python
def init_debug(self): """Initialize debugging features, such as a handler for USR2 to print a trace""" import signal def debug_trace(sig, frame): """Interrupt running process, and provide a python prompt for interactive debugging.""" self.log('Trace signal r...
[ "def", "init_debug", "(", "self", ")", ":", "import", "signal", "def", "debug_trace", "(", "sig", ",", "frame", ")", ":", "\"\"\"Interrupt running process, and provide a python prompt for interactive\n debugging.\"\"\"", "self", ".", "log", "(", "'Trace signal re...
Initialize debugging features, such as a handler for USR2 to print a trace
[ "Initialize", "debugging", "features", "such", "as", "a", "handler", "for", "USR2", "to", "print", "a", "trace" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L144-L155
CivicSpleen/ambry
ambry/library/__init__.py
Library.resolve_object_number
def resolve_object_number(self, ref): """Resolve a variety of object numebrs to a dataset number""" if not isinstance(ref, ObjectNumber): on = ObjectNumber.parse(ref) else: on = ref ds_on = on.as_dataset return ds_on
python
def resolve_object_number(self, ref): """Resolve a variety of object numebrs to a dataset number""" if not isinstance(ref, ObjectNumber): on = ObjectNumber.parse(ref) else: on = ref ds_on = on.as_dataset return ds_on
[ "def", "resolve_object_number", "(", "self", ",", "ref", ")", ":", "if", "not", "isinstance", "(", "ref", ",", "ObjectNumber", ")", ":", "on", "=", "ObjectNumber", ".", "parse", "(", "ref", ")", "else", ":", "on", "=", "ref", "ds_on", "=", "on", ".",...
Resolve a variety of object numebrs to a dataset number
[ "Resolve", "a", "variety", "of", "object", "numebrs", "to", "a", "dataset", "number" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L157-L167
CivicSpleen/ambry
ambry/library/__init__.py
Library.dataset
def dataset(self, ref, load_all=False, exception=True): """Return all datasets""" return self.database.dataset(ref, load_all=load_all, exception=exception)
python
def dataset(self, ref, load_all=False, exception=True): """Return all datasets""" return self.database.dataset(ref, load_all=load_all, exception=exception)
[ "def", "dataset", "(", "self", ",", "ref", ",", "load_all", "=", "False", ",", "exception", "=", "True", ")", ":", "return", "self", ".", "database", ".", "dataset", "(", "ref", ",", "load_all", "=", "load_all", ",", "exception", "=", "exception", ")" ...
Return all datasets
[ "Return", "all", "datasets" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L235-L237
CivicSpleen/ambry
ambry/library/__init__.py
Library.new_bundle
def new_bundle(self, assignment_class=None, **kwargs): """ Create a new bundle, with the same arguments as creating a new dataset :param assignment_class: String. assignment class to use for fetching a number, if one is not specified in kwargs :param kwargs: :return: ...
python
def new_bundle(self, assignment_class=None, **kwargs): """ Create a new bundle, with the same arguments as creating a new dataset :param assignment_class: String. assignment class to use for fetching a number, if one is not specified in kwargs :param kwargs: :return: ...
[ "def", "new_bundle", "(", "self", ",", "assignment_class", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "not", "(", "'id'", "in", "kwargs", "and", "bool", "(", "kwargs", "[", "'id'", "]", ")", ")", "or", "assignment_class", "is", "not", "Non...
Create a new bundle, with the same arguments as creating a new dataset :param assignment_class: String. assignment class to use for fetching a number, if one is not specified in kwargs :param kwargs: :return:
[ "Create", "a", "new", "bundle", "with", "the", "same", "arguments", "as", "creating", "a", "new", "dataset" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L239-L270
CivicSpleen/ambry
ambry/library/__init__.py
Library.new_from_bundle_config
def new_from_bundle_config(self, config): """ Create a new bundle, or link to an existing one, based on the identity in config data. :param config: A Dict form of a bundle.yaml file :return: """ identity = Identity.from_dict(config['identity']) ds = self._db.dat...
python
def new_from_bundle_config(self, config): """ Create a new bundle, or link to an existing one, based on the identity in config data. :param config: A Dict form of a bundle.yaml file :return: """ identity = Identity.from_dict(config['identity']) ds = self._db.dat...
[ "def", "new_from_bundle_config", "(", "self", ",", "config", ")", ":", "identity", "=", "Identity", ".", "from_dict", "(", "config", "[", "'identity'", "]", ")", "ds", "=", "self", ".", "_db", ".", "dataset", "(", "identity", ".", "vid", ",", "exception"...
Create a new bundle, or link to an existing one, based on the identity in config data. :param config: A Dict form of a bundle.yaml file :return:
[ "Create", "a", "new", "bundle", "or", "link", "to", "an", "existing", "one", "based", "on", "the", "identity", "in", "config", "data", "." ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L272-L294
CivicSpleen/ambry
ambry/library/__init__.py
Library.bundle
def bundle(self, ref, capture_exceptions=False): """Return a bundle build on a dataset, with the given vid or id reference""" from ..orm.exc import NotFoundError if isinstance(ref, Dataset): ds = ref else: try: ds = self._db.dataset(ref) ...
python
def bundle(self, ref, capture_exceptions=False): """Return a bundle build on a dataset, with the given vid or id reference""" from ..orm.exc import NotFoundError if isinstance(ref, Dataset): ds = ref else: try: ds = self._db.dataset(ref) ...
[ "def", "bundle", "(", "self", ",", "ref", ",", "capture_exceptions", "=", "False", ")", ":", "from", ".", ".", "orm", ".", "exc", "import", "NotFoundError", "if", "isinstance", "(", "ref", ",", "Dataset", ")", ":", "ds", "=", "ref", "else", ":", "try...
Return a bundle build on a dataset, with the given vid or id reference
[ "Return", "a", "bundle", "build", "on", "a", "dataset", "with", "the", "given", "vid", "or", "id", "reference" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L296-L321
CivicSpleen/ambry
ambry/library/__init__.py
Library.partition
def partition(self, ref, localize=False): """ Finds partition by ref and converts to bundle partition. :param ref: A partition reference :param localize: If True, copy a remote partition to local filesystem. Defaults to False :raises: NotFoundError: if partition with given ref not found...
python
def partition(self, ref, localize=False): """ Finds partition by ref and converts to bundle partition. :param ref: A partition reference :param localize: If True, copy a remote partition to local filesystem. Defaults to False :raises: NotFoundError: if partition with given ref not found...
[ "def", "partition", "(", "self", ",", "ref", ",", "localize", "=", "False", ")", ":", "if", "not", "ref", ":", "raise", "NotFoundError", "(", "\"No partition for empty ref\"", ")", "try", ":", "on", "=", "ObjectNumber", ".", "parse", "(", "ref", ")", "ds...
Finds partition by ref and converts to bundle partition. :param ref: A partition reference :param localize: If True, copy a remote partition to local filesystem. Defaults to False :raises: NotFoundError: if partition with given ref not found. :return: orm.Partition: found partition.
[ "Finds", "partition", "by", "ref", "and", "converts", "to", "bundle", "partition", "." ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L336-L377
CivicSpleen/ambry
ambry/library/__init__.py
Library.table
def table(self, ref): """ Finds table by ref and returns it. Args: ref (str): id, vid (versioned id) or name of the table Raises: NotFoundError: if table with given ref not found. Returns: orm.Table """ try: obj_number ...
python
def table(self, ref): """ Finds table by ref and returns it. Args: ref (str): id, vid (versioned id) or name of the table Raises: NotFoundError: if table with given ref not found. Returns: orm.Table """ try: obj_number ...
[ "def", "table", "(", "self", ",", "ref", ")", ":", "try", ":", "obj_number", "=", "ObjectNumber", ".", "parse", "(", "ref", ")", "ds_obj_number", "=", "obj_number", ".", "as_dataset", "dataset", "=", "self", ".", "_db", ".", "dataset", "(", "ds_obj_numbe...
Finds table by ref and returns it. Args: ref (str): id, vid (versioned id) or name of the table Raises: NotFoundError: if table with given ref not found. Returns: orm.Table
[ "Finds", "table", "by", "ref", "and", "returns", "it", "." ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L379-L409
CivicSpleen/ambry
ambry/library/__init__.py
Library.remove
def remove(self, bundle): """ Removes a bundle from the library and deletes the configuration for it from the library database.""" from six import string_types if isinstance(bundle, string_types): bundle = self.bundle(bundle) self.database.remove_dataset(bundle.data...
python
def remove(self, bundle): """ Removes a bundle from the library and deletes the configuration for it from the library database.""" from six import string_types if isinstance(bundle, string_types): bundle = self.bundle(bundle) self.database.remove_dataset(bundle.data...
[ "def", "remove", "(", "self", ",", "bundle", ")", ":", "from", "six", "import", "string_types", "if", "isinstance", "(", "bundle", ",", "string_types", ")", ":", "bundle", "=", "self", ".", "bundle", "(", "bundle", ")", "self", ".", "database", ".", "r...
Removes a bundle from the library and deletes the configuration for it from the library database.
[ "Removes", "a", "bundle", "from", "the", "library", "and", "deletes", "the", "configuration", "for", "it", "from", "the", "library", "database", "." ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L411-L419
CivicSpleen/ambry
ambry/library/__init__.py
Library.duplicate
def duplicate(self, b): """Duplicate a bundle, with a higher version number. This only copies the files, under the theory that the bundle can be rebuilt from them. """ on = b.identity.on on.revision = on.revision + 1 try: extant = self.bundle(str(on)) ...
python
def duplicate(self, b): """Duplicate a bundle, with a higher version number. This only copies the files, under the theory that the bundle can be rebuilt from them. """ on = b.identity.on on.revision = on.revision + 1 try: extant = self.bundle(str(on)) ...
[ "def", "duplicate", "(", "self", ",", "b", ")", ":", "on", "=", "b", ".", "identity", ".", "on", "on", ".", "revision", "=", "on", ".", "revision", "+", "1", "try", ":", "extant", "=", "self", ".", "bundle", "(", "str", "(", "on", ")", ")", "...
Duplicate a bundle, with a higher version number. This only copies the files, under the theory that the bundle can be rebuilt from them.
[ "Duplicate", "a", "bundle", "with", "a", "higher", "version", "number", "." ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L442-L488
CivicSpleen/ambry
ambry/library/__init__.py
Library.checkin_bundle
def checkin_bundle(self, db_path, replace=True, cb=None): """Add a bundle, as a Sqlite file, to this library""" from ambry.orm.exc import NotFoundError db = Database('sqlite:///{}'.format(db_path)) db.open() if len(db.datasets) == 0: raise NotFoundError("Did not get...
python
def checkin_bundle(self, db_path, replace=True, cb=None): """Add a bundle, as a Sqlite file, to this library""" from ambry.orm.exc import NotFoundError db = Database('sqlite:///{}'.format(db_path)) db.open() if len(db.datasets) == 0: raise NotFoundError("Did not get...
[ "def", "checkin_bundle", "(", "self", ",", "db_path", ",", "replace", "=", "True", ",", "cb", "=", "None", ")", ":", "from", "ambry", ".", "orm", ".", "exc", "import", "NotFoundError", "db", "=", "Database", "(", "'sqlite:///{}'", ".", "format", "(", "...
Add a bundle, as a Sqlite file, to this library
[ "Add", "a", "bundle", "as", "a", "Sqlite", "file", "to", "this", "library" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L490-L528
CivicSpleen/ambry
ambry/library/__init__.py
Library.send_to_remote
def send_to_remote(self, b, no_partitions=False): """ Copy a bundle to a new Sqlite file, then store the file on the remote. :param b: The bundle :return: """ raise DeprecationWarning("Don't use any more?") from ambry.bundle.process import call_interval ...
python
def send_to_remote(self, b, no_partitions=False): """ Copy a bundle to a new Sqlite file, then store the file on the remote. :param b: The bundle :return: """ raise DeprecationWarning("Don't use any more?") from ambry.bundle.process import call_interval ...
[ "def", "send_to_remote", "(", "self", ",", "b", ",", "no_partitions", "=", "False", ")", ":", "raise", "DeprecationWarning", "(", "\"Don't use any more?\"", ")", "from", "ambry", ".", "bundle", ".", "process", "import", "call_interval", "remote_name", "=", "self...
Copy a bundle to a new Sqlite file, then store the file on the remote. :param b: The bundle :return:
[ "Copy", "a", "bundle", "to", "a", "new", "Sqlite", "file", "then", "store", "the", "file", "on", "the", "remote", "." ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L530-L602
CivicSpleen/ambry
ambry/library/__init__.py
Library.checkin_remote_bundle
def checkin_remote_bundle(self, ref, remote=None): """ Checkin a remote bundle to this library. :param ref: Any bundle reference :param remote: If specified, use this remote. If not, search for the reference in cached directory listings :param cb: A one argument progress cal...
python
def checkin_remote_bundle(self, ref, remote=None): """ Checkin a remote bundle to this library. :param ref: Any bundle reference :param remote: If specified, use this remote. If not, search for the reference in cached directory listings :param cb: A one argument progress cal...
[ "def", "checkin_remote_bundle", "(", "self", ",", "ref", ",", "remote", "=", "None", ")", ":", "if", "not", "remote", ":", "remote", ",", "vname", "=", "self", ".", "find_remote_bundle", "(", "ref", ")", "if", "vname", ":", "ref", "=", "vname", "else",...
Checkin a remote bundle to this library. :param ref: Any bundle reference :param remote: If specified, use this remote. If not, search for the reference in cached directory listings :param cb: A one argument progress callback :return:
[ "Checkin", "a", "remote", "bundle", "to", "this", "library", "." ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L627-L653
CivicSpleen/ambry
ambry/library/__init__.py
Library._checkin_remote_bundle
def _checkin_remote_bundle(self, remote, ref): """ Checkin a remote bundle from a remote :param remote: a Remote object :param ref: Any bundle reference :return: The vid of the loaded bundle """ from ambry.bundle.process import call_interval from ambry.orm...
python
def _checkin_remote_bundle(self, remote, ref): """ Checkin a remote bundle from a remote :param remote: a Remote object :param ref: Any bundle reference :return: The vid of the loaded bundle """ from ambry.bundle.process import call_interval from ambry.orm...
[ "def", "_checkin_remote_bundle", "(", "self", ",", "remote", ",", "ref", ")", ":", "from", "ambry", ".", "bundle", ".", "process", "import", "call_interval", "from", "ambry", ".", "orm", ".", "exc", "import", "NotFoundError", "from", "ambry", ".", "orm", "...
Checkin a remote bundle from a remote :param remote: a Remote object :param ref: Any bundle reference :return: The vid of the loaded bundle
[ "Checkin", "a", "remote", "bundle", "from", "a", "remote", ":", "param", "remote", ":", "a", "Remote", "object", ":", "param", "ref", ":", "Any", "bundle", "reference", ":", "return", ":", "The", "vid", "of", "the", "loaded", "bundle" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L655-L712
CivicSpleen/ambry
ambry/library/__init__.py
Library.remotes
def remotes(self): """Return the names and URLs of the remotes""" from ambry.orm import Remote for r in self.database.session.query(Remote).all(): if not r.short_name: continue yield self.remote(r.short_name)
python
def remotes(self): """Return the names and URLs of the remotes""" from ambry.orm import Remote for r in self.database.session.query(Remote).all(): if not r.short_name: continue yield self.remote(r.short_name)
[ "def", "remotes", "(", "self", ")", ":", "from", "ambry", ".", "orm", "import", "Remote", "for", "r", "in", "self", ".", "database", ".", "session", ".", "query", "(", "Remote", ")", ".", "all", "(", ")", ":", "if", "not", "r", ".", "short_name", ...
Return the names and URLs of the remotes
[ "Return", "the", "names", "and", "URLs", "of", "the", "remotes" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L715-L722
CivicSpleen/ambry
ambry/library/__init__.py
Library._remote
def _remote(self, name): """Return a remote for which 'name' matches the short_name or url """ from ambry.orm import Remote from sqlalchemy import or_ from ambry.orm.exc import NotFoundError from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound if not name.s...
python
def _remote(self, name): """Return a remote for which 'name' matches the short_name or url """ from ambry.orm import Remote from sqlalchemy import or_ from ambry.orm.exc import NotFoundError from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound if not name.s...
[ "def", "_remote", "(", "self", ",", "name", ")", ":", "from", "ambry", ".", "orm", "import", "Remote", "from", "sqlalchemy", "import", "or_", "from", "ambry", ".", "orm", ".", "exc", "import", "NotFoundError", "from", "sqlalchemy", ".", "orm", ".", "exc"...
Return a remote for which 'name' matches the short_name or url
[ "Return", "a", "remote", "for", "which", "name", "matches", "the", "short_name", "or", "url" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L724-L749
CivicSpleen/ambry
ambry/library/__init__.py
Library._find_remote_bundle
def _find_remote_bundle(self, ref, remote_service_type='s3'): """ Locate a bundle, by any reference, among the configured remotes. The routine will only look in the cache directory lists stored in the remotes, which must be updated to be current. :param ref: :return: (re...
python
def _find_remote_bundle(self, ref, remote_service_type='s3'): """ Locate a bundle, by any reference, among the configured remotes. The routine will only look in the cache directory lists stored in the remotes, which must be updated to be current. :param ref: :return: (re...
[ "def", "_find_remote_bundle", "(", "self", ",", "ref", ",", "remote_service_type", "=", "'s3'", ")", ":", "for", "r", "in", "self", ".", "remotes", ":", "if", "remote_service_type", "and", "r", ".", "service", "!=", "remote_service_type", ":", "continue", "i...
Locate a bundle, by any reference, among the configured remotes. The routine will only look in the cache directory lists stored in the remotes, which must be updated to be current. :param ref: :return: (remote,vname) or (None,None) if the ref is not found
[ "Locate", "a", "bundle", "by", "any", "reference", "among", "the", "configured", "remotes", ".", "The", "routine", "will", "only", "look", "in", "the", "cache", "directory", "lists", "stored", "in", "the", "remotes", "which", "must", "be", "updated", "to", ...
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L825-L847
CivicSpleen/ambry
ambry/library/__init__.py
Library.find_remote_bundle
def find_remote_bundle(self, ref, try_harder=None): """ Locate a bundle, by any reference, among the configured remotes. The routine will only look in the cache directory lists stored in the remotes, which must be updated to be current. :param vid: A bundle or partition reference, vid, ...
python
def find_remote_bundle(self, ref, try_harder=None): """ Locate a bundle, by any reference, among the configured remotes. The routine will only look in the cache directory lists stored in the remotes, which must be updated to be current. :param vid: A bundle or partition reference, vid, ...
[ "def", "find_remote_bundle", "(", "self", ",", "ref", ",", "try_harder", "=", "None", ")", ":", "from", "ambry", ".", "identity", "import", "ObjectNumber", "remote", ",", "vid", "=", "self", ".", "_find_remote_bundle", "(", "ref", ")", "if", "remote", ":",...
Locate a bundle, by any reference, among the configured remotes. The routine will only look in the cache directory lists stored in the remotes, which must be updated to be current. :param vid: A bundle or partition reference, vid, or name :param try_harder: If the reference isn't found, try par...
[ "Locate", "a", "bundle", "by", "any", "reference", "among", "the", "configured", "remotes", ".", "The", "routine", "will", "only", "look", "in", "the", "cache", "directory", "lists", "stored", "in", "the", "remotes", "which", "must", "be", "updated", "to", ...
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L849-L882
CivicSpleen/ambry
ambry/library/__init__.py
Library.account
def account(self, url): """ Return accounts references for the given account id. :param account_id: :param accounts_password: The password for decrypting the secret :return: """ from sqlalchemy.orm.exc import NoResultFound from ambry.orm.exc import NotFoun...
python
def account(self, url): """ Return accounts references for the given account id. :param account_id: :param accounts_password: The password for decrypting the secret :return: """ from sqlalchemy.orm.exc import NoResultFound from ambry.orm.exc import NotFoun...
[ "def", "account", "(", "self", ",", "url", ")", ":", "from", "sqlalchemy", ".", "orm", ".", "exc", "import", "NoResultFound", "from", "ambry", ".", "orm", ".", "exc", "import", "NotFoundError", "from", "ambry", ".", "util", "import", "parse_url_to_dict", "...
Return accounts references for the given account id. :param account_id: :param accounts_password: The password for decrypting the secret :return:
[ "Return", "accounts", "references", "for", "the", "given", "account", "id", ".", ":", "param", "account_id", ":", ":", "param", "accounts_password", ":", "The", "password", "for", "decrypting", "the", "secret", ":", "return", ":" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L897-L925
CivicSpleen/ambry
ambry/library/__init__.py
Library.accounts
def accounts(self): """ Return an account reference :param account_id: :param accounts_password: The password for decrypting the secret :return: """ d = {} if False and not self._account_password: from ambry.dbexceptions import ConfigurationEr...
python
def accounts(self): """ Return an account reference :param account_id: :param accounts_password: The password for decrypting the secret :return: """ d = {} if False and not self._account_password: from ambry.dbexceptions import ConfigurationEr...
[ "def", "accounts", "(", "self", ")", ":", "d", "=", "{", "}", "if", "False", "and", "not", "self", ".", "_account_password", ":", "from", "ambry", ".", "dbexceptions", "import", "ConfigurationError", "raise", "ConfigurationError", "(", "\"Can't access accounts w...
Return an account reference :param account_id: :param accounts_password: The password for decrypting the secret :return:
[ "Return", "an", "account", "reference", ":", "param", "account_id", ":", ":", "param", "accounts_password", ":", "The", "password", "for", "decrypting", "the", "secret", ":", "return", ":" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L937-L960
CivicSpleen/ambry
ambry/library/__init__.py
Library.number
def number(self, assignment_class=None, namespace='d'): """ Return a new number. :param assignment_class: Determines the length of the number. Possible values are 'authority' (3 characters) , 'registered' (5) , 'unregistered' (7) and 'self' (9). Self assigned numbers are random and...
python
def number(self, assignment_class=None, namespace='d'): """ Return a new number. :param assignment_class: Determines the length of the number. Possible values are 'authority' (3 characters) , 'registered' (5) , 'unregistered' (7) and 'self' (9). Self assigned numbers are random and...
[ "def", "number", "(", "self", ",", "assignment_class", "=", "None", ",", "namespace", "=", "'d'", ")", ":", "if", "assignment_class", "==", "'self'", ":", "# When 'self' is explicit, don't look for number server config", "return", "str", "(", "DatasetNumber", "(", "...
Return a new number. :param assignment_class: Determines the length of the number. Possible values are 'authority' (3 characters) , 'registered' (5) , 'unregistered' (7) and 'self' (9). Self assigned numbers are random and acquired locally, while the other assignment classes use the nu...
[ "Return", "a", "new", "number", "." ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L995-L1060
CivicSpleen/ambry
ambry/library/__init__.py
Library.edit_history
def edit_history(self): """Return config record information about the most recent bundle accesses and operations""" ret = self._db.session\ .query(Config)\ .filter(Config.type == 'buildstate')\ .filter(Config.group == 'access')\ .filter(Config.key == 'las...
python
def edit_history(self): """Return config record information about the most recent bundle accesses and operations""" ret = self._db.session\ .query(Config)\ .filter(Config.type == 'buildstate')\ .filter(Config.group == 'access')\ .filter(Config.key == 'las...
[ "def", "edit_history", "(", "self", ")", ":", "ret", "=", "self", ".", "_db", ".", "session", ".", "query", "(", "Config", ")", ".", "filter", "(", "Config", ".", "type", "==", "'buildstate'", ")", ".", "filter", "(", "Config", ".", "group", "==", ...
Return config record information about the most recent bundle accesses and operations
[ "Return", "config", "record", "information", "about", "the", "most", "recent", "bundle", "accesses", "and", "operations" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L1062-L1072
CivicSpleen/ambry
ambry/library/__init__.py
Library.import_bundles
def import_bundles(self, dir, detach=False, force=False): """ Import bundles from a directory :param dir: :return: """ import yaml fs = fsopendir(dir) bundles = [] for f in fs.walkfiles(wildcard='bundle.yaml'): self.logger.info('V...
python
def import_bundles(self, dir, detach=False, force=False): """ Import bundles from a directory :param dir: :return: """ import yaml fs = fsopendir(dir) bundles = [] for f in fs.walkfiles(wildcard='bundle.yaml'): self.logger.info('V...
[ "def", "import_bundles", "(", "self", ",", "dir", ",", "detach", "=", "False", ",", "force", "=", "False", ")", ":", "import", "yaml", "fs", "=", "fsopendir", "(", "dir", ")", "bundles", "=", "[", "]", "for", "f", "in", "fs", ".", "walkfiles", "(",...
Import bundles from a directory :param dir: :return:
[ "Import", "bundles", "from", "a", "directory" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L1106-L1161
CivicSpleen/ambry
ambry/library/__init__.py
Library.process_pool
def process_pool(self, limited_run=False): """Return a pool for multiprocess operations, sized either to the number of CPUS, or a configured value""" from multiprocessing import cpu_count from ambry.bundle.concurrent import Pool, init_library if self.processes: cpus = self....
python
def process_pool(self, limited_run=False): """Return a pool for multiprocess operations, sized either to the number of CPUS, or a configured value""" from multiprocessing import cpu_count from ambry.bundle.concurrent import Pool, init_library if self.processes: cpus = self....
[ "def", "process_pool", "(", "self", ",", "limited_run", "=", "False", ")", ":", "from", "multiprocessing", "import", "cpu_count", "from", "ambry", ".", "bundle", ".", "concurrent", "import", "Pool", ",", "init_library", "if", "self", ".", "processes", ":", "...
Return a pool for multiprocess operations, sized either to the number of CPUS, or a configured value
[ "Return", "a", "pool", "for", "multiprocess", "operations", "sized", "either", "to", "the", "number", "of", "CPUS", "or", "a", "configured", "value" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/__init__.py#L1163-L1177
CivicSpleen/ambry
ambry/etl/codegen.py
file_loc
def file_loc(): """Return file and line number""" import sys import inspect try: raise Exception except: file_ = '.../' + '/'.join((inspect.currentframe().f_code.co_filename.split('/'))[-3:]) line_ = sys.exc_info()[2].tb_frame.f_back.f_lineno return "{}:{}".format(fil...
python
def file_loc(): """Return file and line number""" import sys import inspect try: raise Exception except: file_ = '.../' + '/'.join((inspect.currentframe().f_code.co_filename.split('/'))[-3:]) line_ = sys.exc_info()[2].tb_frame.f_back.f_lineno return "{}:{}".format(fil...
[ "def", "file_loc", "(", ")", ":", "import", "sys", "import", "inspect", "try", ":", "raise", "Exception", "except", ":", "file_", "=", "'.../'", "+", "'/'", ".", "join", "(", "(", "inspect", ".", "currentframe", "(", ")", ".", "f_code", ".", "co_filena...
Return file and line number
[ "Return", "file", "and", "line", "number" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/etl/codegen.py#L12-L21
CivicSpleen/ambry
ambry/etl/codegen.py
make_row_processors
def make_row_processors(bundle, source_headers, dest_table, env): """ Make multiple row processors for all of the columns in a table. :param source_headers: :return: """ dest_headers = [c.name for c in dest_table.columns] row_processors = [] out = [file_header] transforms = lis...
python
def make_row_processors(bundle, source_headers, dest_table, env): """ Make multiple row processors for all of the columns in a table. :param source_headers: :return: """ dest_headers = [c.name for c in dest_table.columns] row_processors = [] out = [file_header] transforms = lis...
[ "def", "make_row_processors", "(", "bundle", ",", "source_headers", ",", "dest_table", ",", "env", ")", ":", "dest_headers", "=", "[", "c", ".", "name", "for", "c", "in", "dest_table", ".", "columns", "]", "row_processors", "=", "[", "]", "out", "=", "["...
Make multiple row processors for all of the columns in a table. :param source_headers: :return:
[ "Make", "multiple", "row", "processors", "for", "all", "of", "the", "columns", "in", "a", "table", "." ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/etl/codegen.py#L84-L202
CivicSpleen/ambry
ambry/etl/codegen.py
calling_code
def calling_code(f, f_name=None, raise_for_missing=True): """Return the code string for calling a function. """ import inspect from ambry.dbexceptions import ConfigurationError if inspect.isclass(f): try: args = inspect.getargspec(f.__init__).args except TypeError as e: ...
python
def calling_code(f, f_name=None, raise_for_missing=True): """Return the code string for calling a function. """ import inspect from ambry.dbexceptions import ConfigurationError if inspect.isclass(f): try: args = inspect.getargspec(f.__init__).args except TypeError as e: ...
[ "def", "calling_code", "(", "f", ",", "f_name", "=", "None", ",", "raise_for_missing", "=", "True", ")", ":", "import", "inspect", "from", "ambry", ".", "dbexceptions", "import", "ConfigurationError", "if", "inspect", ".", "isclass", "(", "f", ")", ":", "t...
Return the code string for calling a function.
[ "Return", "the", "code", "string", "for", "calling", "a", "function", "." ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/etl/codegen.py#L204-L231
CivicSpleen/ambry
ambry/etl/codegen.py
make_stack
def make_stack(env, stage, segment): """For each transform segment, create the code in the try/except block with the assignements for pipes in the segment """ import string import random from ambry.valuetype import ValueType column = segment['column'] def make_line(column, t): pre...
python
def make_stack(env, stage, segment): """For each transform segment, create the code in the try/except block with the assignements for pipes in the segment """ import string import random from ambry.valuetype import ValueType column = segment['column'] def make_line(column, t): pre...
[ "def", "make_stack", "(", "env", ",", "stage", ",", "segment", ")", ":", "import", "string", "import", "random", "from", "ambry", ".", "valuetype", "import", "ValueType", "column", "=", "segment", "[", "'column'", "]", "def", "make_line", "(", "column", ",...
For each transform segment, create the code in the try/except block with the assignements for pipes in the segment
[ "For", "each", "transform", "segment", "create", "the", "code", "in", "the", "try", "/", "except", "block", "with", "the", "assignements", "for", "pipes", "in", "the", "segment" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/etl/codegen.py#L234-L307
CivicSpleen/ambry
ambry/etl/codegen.py
rewrite_tg
def rewrite_tg(env, tg_name, code): """Re-write a transform generating function pipe specification by extracting the tranform generating part, and replacing it with the generated transform. so: tgen(a,b,c).foo.bar becomes: tg = tgen(a,b,c) tg.foo.bar """ visitor = Replac...
python
def rewrite_tg(env, tg_name, code): """Re-write a transform generating function pipe specification by extracting the tranform generating part, and replacing it with the generated transform. so: tgen(a,b,c).foo.bar becomes: tg = tgen(a,b,c) tg.foo.bar """ visitor = Replac...
[ "def", "rewrite_tg", "(", "env", ",", "tg_name", ",", "code", ")", ":", "visitor", "=", "ReplaceTG", "(", "env", ",", "tg_name", ")", "assert", "visitor", ".", "tg_name", "tree", "=", "visitor", ".", "visit", "(", "ast", ".", "parse", "(", "code", ")...
Re-write a transform generating function pipe specification by extracting the tranform generating part, and replacing it with the generated transform. so: tgen(a,b,c).foo.bar becomes: tg = tgen(a,b,c) tg.foo.bar
[ "Re", "-", "write", "a", "transform", "generating", "function", "pipe", "specification", "by", "extracting", "the", "tranform", "generating", "part", "and", "replacing", "it", "with", "the", "generated", "transform", ".", "so", ":" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/etl/codegen.py#L425-L454
flaviogrossi/sockjs-cyclone
sockjs/cyclone/utils.py
PriorityQueue.push
def push(self, el): """ Put a new element in the queue. """ count = next(self.counter) heapq.heappush(self._queue, (el, count))
python
def push(self, el): """ Put a new element in the queue. """ count = next(self.counter) heapq.heappush(self._queue, (el, count))
[ "def", "push", "(", "self", ",", "el", ")", ":", "count", "=", "next", "(", "self", ".", "counter", ")", "heapq", ".", "heappush", "(", "self", ".", "_queue", ",", "(", "el", ",", "count", ")", ")" ]
Put a new element in the queue.
[ "Put", "a", "new", "element", "in", "the", "queue", "." ]
train
https://github.com/flaviogrossi/sockjs-cyclone/blob/d3ca053ec1aa1e85f652347bff562c2319be37a2/sockjs/cyclone/utils.py#L38-L41
CivicSpleen/ambry
ambry/orm/partition.py
PartitionDisplay.geo_description
def geo_description(self): """Return a description of the geographic extents, using the largest scale space and grain coverages""" sc = self._p.space_coverage gc = self._p.grain_coverage if sc and gc: if parse_to_gvid(gc[0]).level == 'state' and parse_to_gvid(sc[0])...
python
def geo_description(self): """Return a description of the geographic extents, using the largest scale space and grain coverages""" sc = self._p.space_coverage gc = self._p.grain_coverage if sc and gc: if parse_to_gvid(gc[0]).level == 'state' and parse_to_gvid(sc[0])...
[ "def", "geo_description", "(", "self", ")", ":", "sc", "=", "self", ".", "_p", ".", "space_coverage", "gc", "=", "self", ".", "_p", ".", "grain_coverage", "if", "sc", "and", "gc", ":", "if", "parse_to_gvid", "(", "gc", "[", "0", "]", ")", ".", "lev...
Return a description of the geographic extents, using the largest scale space and grain coverages
[ "Return", "a", "description", "of", "the", "geographic", "extents", "using", "the", "largest", "scale", "space", "and", "grain", "coverages" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L56-L75
CivicSpleen/ambry
ambry/orm/partition.py
PartitionDisplay.time_description
def time_description(self): """String description of the year or year range""" tc = [t for t in self._p.time_coverage if t] if not tc: return '' mn = min(tc) mx = max(tc) if not mn and not mx: return '' elif mn == mx: return...
python
def time_description(self): """String description of the year or year range""" tc = [t for t in self._p.time_coverage if t] if not tc: return '' mn = min(tc) mx = max(tc) if not mn and not mx: return '' elif mn == mx: return...
[ "def", "time_description", "(", "self", ")", ":", "tc", "=", "[", "t", "for", "t", "in", "self", ".", "_p", ".", "time_coverage", "if", "t", "]", "if", "not", "tc", ":", "return", "''", "mn", "=", "min", "(", "tc", ")", "mx", "=", "max", "(", ...
String description of the year or year range
[ "String", "description", "of", "the", "year", "or", "year", "range" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L78-L94
CivicSpleen/ambry
ambry/orm/partition.py
PartitionDisplay.sub_description
def sub_description(self): """Time and space dscription""" gd = self.geo_description td = self.time_description if gd and td: return '{}, {}. {} Rows.'.format(gd, td, self._p.count) elif gd: return '{}. {} Rows.'.format(gd, self._p.count) elif td:...
python
def sub_description(self): """Time and space dscription""" gd = self.geo_description td = self.time_description if gd and td: return '{}, {}. {} Rows.'.format(gd, td, self._p.count) elif gd: return '{}. {} Rows.'.format(gd, self._p.count) elif td:...
[ "def", "sub_description", "(", "self", ")", ":", "gd", "=", "self", ".", "geo_description", "td", "=", "self", ".", "time_description", "if", "gd", "and", "td", ":", "return", "'{}, {}. {} Rows.'", ".", "format", "(", "gd", ",", "td", ",", "self", ".", ...
Time and space dscription
[ "Time", "and", "space", "dscription" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L97-L109
CivicSpleen/ambry
ambry/orm/partition.py
Partition.identity
def identity(self): """Return this partition information as a PartitionId.""" if self.dataset is None: # The relationship will be null until the object is committed s = object_session(self) ds = s.query(Dataset).filter(Dataset.id_ == self.d_id).one() else: ...
python
def identity(self): """Return this partition information as a PartitionId.""" if self.dataset is None: # The relationship will be null until the object is committed s = object_session(self) ds = s.query(Dataset).filter(Dataset.id_ == self.d_id).one() else: ...
[ "def", "identity", "(", "self", ")", ":", "if", "self", ".", "dataset", "is", "None", ":", "# The relationship will be null until the object is committed", "s", "=", "object_session", "(", "self", ")", "ds", "=", "s", ".", "query", "(", "Dataset", ")", ".", ...
Return this partition information as a PartitionId.
[ "Return", "this", "partition", "information", "as", "a", "PartitionId", "." ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L202-L228
CivicSpleen/ambry
ambry/orm/partition.py
Partition.set_coverage
def set_coverage(self, stats): """"Extract time space and grain coverage from the stats and store them in the partition""" from ambry.util.datestimes import expand_to_years scov = set() tcov = set() grains = set() def summarize_maybe(gvid): try: ...
python
def set_coverage(self, stats): """"Extract time space and grain coverage from the stats and store them in the partition""" from ambry.util.datestimes import expand_to_years scov = set() tcov = set() grains = set() def summarize_maybe(gvid): try: ...
[ "def", "set_coverage", "(", "self", ",", "stats", ")", ":", "from", "ambry", ".", "util", ".", "datestimes", "import", "expand_to_years", "scov", "=", "set", "(", ")", "tcov", "=", "set", "(", ")", "grains", "=", "set", "(", ")", "def", "summarize_mayb...
Extract time space and grain coverage from the stats and store them in the partition
[ "Extract", "time", "space", "and", "grain", "coverage", "from", "the", "stats", "and", "store", "them", "in", "the", "partition" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L282-L397
CivicSpleen/ambry
ambry/orm/partition.py
Partition.detail_dict
def detail_dict(self): """A more detailed dict that includes the descriptions, sub descriptions, table and columns.""" d = self.dict def aug_col(c): d = c.dict d['stats'] = [s.dict for s in c.stats] return d d['table'] = self.table.dict ...
python
def detail_dict(self): """A more detailed dict that includes the descriptions, sub descriptions, table and columns.""" d = self.dict def aug_col(c): d = c.dict d['stats'] = [s.dict for s in c.stats] return d d['table'] = self.table.dict ...
[ "def", "detail_dict", "(", "self", ")", ":", "d", "=", "self", ".", "dict", "def", "aug_col", "(", "c", ")", ":", "d", "=", "c", ".", "dict", "d", "[", "'stats'", "]", "=", "[", "s", ".", "dict", "for", "s", "in", "c", ".", "stats", "]", "r...
A more detailed dict that includes the descriptions, sub descriptions, table and columns.
[ "A", "more", "detailed", "dict", "that", "includes", "the", "descriptions", "sub", "descriptions", "table", "and", "columns", "." ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L420-L434
CivicSpleen/ambry
ambry/orm/partition.py
Partition.local_datafile
def local_datafile(self): """Return the datafile for this partition, from the build directory, the remote, or the warehouse""" from ambry_sources import MPRowsFile from fs.errors import ResourceNotFoundError from ambry.orm.exc import NotFoundError try: return MPRowsF...
python
def local_datafile(self): """Return the datafile for this partition, from the build directory, the remote, or the warehouse""" from ambry_sources import MPRowsFile from fs.errors import ResourceNotFoundError from ambry.orm.exc import NotFoundError try: return MPRowsF...
[ "def", "local_datafile", "(", "self", ")", ":", "from", "ambry_sources", "import", "MPRowsFile", "from", "fs", ".", "errors", "import", "ResourceNotFoundError", "from", "ambry", ".", "orm", ".", "exc", "import", "NotFoundError", "try", ":", "return", "MPRowsFile...
Return the datafile for this partition, from the build directory, the remote, or the warehouse
[ "Return", "the", "datafile", "for", "this", "partition", "from", "the", "build", "directory", "the", "remote", "or", "the", "warehouse" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L598-L609
CivicSpleen/ambry
ambry/orm/partition.py
Partition.remote
def remote(self): """ Return the remote for this partition :return: """ from ambry.exc import NotFoundError ds = self.dataset if 'remote_name' not in ds.data: raise NotFoundError('Could not determine remote for partition: {}'.format(self.identity.f...
python
def remote(self): """ Return the remote for this partition :return: """ from ambry.exc import NotFoundError ds = self.dataset if 'remote_name' not in ds.data: raise NotFoundError('Could not determine remote for partition: {}'.format(self.identity.f...
[ "def", "remote", "(", "self", ")", ":", "from", "ambry", ".", "exc", "import", "NotFoundError", "ds", "=", "self", ".", "dataset", "if", "'remote_name'", "not", "in", "ds", ".", "data", ":", "raise", "NotFoundError", "(", "'Could not determine remote for parti...
Return the remote for this partition :return:
[ "Return", "the", "remote", "for", "this", "partition" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L612-L626
CivicSpleen/ambry
ambry/orm/partition.py
Partition.is_local
def is_local(self): """Return true is the partition file is local""" from ambry.orm.exc import NotFoundError try: if self.local_datafile.exists: return True except NotFoundError: pass return False
python
def is_local(self): """Return true is the partition file is local""" from ambry.orm.exc import NotFoundError try: if self.local_datafile.exists: return True except NotFoundError: pass return False
[ "def", "is_local", "(", "self", ")", ":", "from", "ambry", ".", "orm", ".", "exc", "import", "NotFoundError", "try", ":", "if", "self", ".", "local_datafile", ".", "exists", ":", "return", "True", "except", "NotFoundError", ":", "pass", "return", "False" ]
Return true is the partition file is local
[ "Return", "true", "is", "the", "partition", "file", "is", "local" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L659-L668
CivicSpleen/ambry
ambry/orm/partition.py
Partition.localize
def localize(self, ps=None): """Copy a non-local partition file to the local build directory""" from filelock import FileLock from ambry.util import ensure_dir_exists from ambry_sources import MPRowsFile from fs.errors import ResourceNotFoundError if self.is_local: ...
python
def localize(self, ps=None): """Copy a non-local partition file to the local build directory""" from filelock import FileLock from ambry.util import ensure_dir_exists from ambry_sources import MPRowsFile from fs.errors import ResourceNotFoundError if self.is_local: ...
[ "def", "localize", "(", "self", ",", "ps", "=", "None", ")", ":", "from", "filelock", "import", "FileLock", "from", "ambry", ".", "util", "import", "ensure_dir_exists", "from", "ambry_sources", "import", "MPRowsFile", "from", "fs", ".", "errors", "import", "...
Copy a non-local partition file to the local build directory
[ "Copy", "a", "non", "-", "local", "partition", "file", "to", "the", "local", "build", "directory" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L670-L742
CivicSpleen/ambry
ambry/orm/partition.py
Partition.reader
def reader(self): from ambry.orm.exc import NotFoundError from fs.errors import ResourceNotFoundError """The reader for the datafile""" try: return self.datafile.reader except ResourceNotFoundError: raise NotFoundError("Failed to find partition file, '{}'...
python
def reader(self): from ambry.orm.exc import NotFoundError from fs.errors import ResourceNotFoundError """The reader for the datafile""" try: return self.datafile.reader except ResourceNotFoundError: raise NotFoundError("Failed to find partition file, '{}'...
[ "def", "reader", "(", "self", ")", ":", "from", "ambry", ".", "orm", ".", "exc", "import", "NotFoundError", "from", "fs", ".", "errors", "import", "ResourceNotFoundError", "try", ":", "return", "self", ".", "datafile", ".", "reader", "except", "ResourceNotFo...
The reader for the datafile
[ "The", "reader", "for", "the", "datafile" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L745-L754
CivicSpleen/ambry
ambry/orm/partition.py
Partition.select
def select(self, predicate=None, headers=None): """ Select rows from the reader using a predicate to select rows and and itemgetter to return a subset of elements :param predicate: If defined, a callable that is called for each row, and if it returns true, the row is included in ...
python
def select(self, predicate=None, headers=None): """ Select rows from the reader using a predicate to select rows and and itemgetter to return a subset of elements :param predicate: If defined, a callable that is called for each row, and if it returns true, the row is included in ...
[ "def", "select", "(", "self", ",", "predicate", "=", "None", ",", "headers", "=", "None", ")", ":", "# FIXME; in Python 3, use yield from", "with", "self", ".", "reader", "as", "r", ":", "for", "row", "in", "r", ".", "select", "(", "predicate", ",", "hea...
Select rows from the reader using a predicate to select rows and and itemgetter to return a subset of elements :param predicate: If defined, a callable that is called for each row, and if it returns true, the row is included in the output. :param headers: If defined, a list or tuple of h...
[ "Select", "rows", "from", "the", "reader", "using", "a", "predicate", "to", "select", "rows", "and", "and", "itemgetter", "to", "return", "a", "subset", "of", "elements", ":", "param", "predicate", ":", "If", "defined", "a", "callable", "that", "is", "call...
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L756-L778
CivicSpleen/ambry
ambry/orm/partition.py
Partition.analysis
def analysis(self): """Return an AnalysisPartition proxy, which wraps this partition to provide acess to dataframes, shapely shapes and other analysis services""" if isinstance(self, PartitionProxy): return AnalysisPartition(self._obj) else: return AnalysisPartiti...
python
def analysis(self): """Return an AnalysisPartition proxy, which wraps this partition to provide acess to dataframes, shapely shapes and other analysis services""" if isinstance(self, PartitionProxy): return AnalysisPartition(self._obj) else: return AnalysisPartiti...
[ "def", "analysis", "(", "self", ")", ":", "if", "isinstance", "(", "self", ",", "PartitionProxy", ")", ":", "return", "AnalysisPartition", "(", "self", ".", "_obj", ")", "else", ":", "return", "AnalysisPartition", "(", "self", ")" ]
Return an AnalysisPartition proxy, which wraps this partition to provide acess to dataframes, shapely shapes and other analysis services
[ "Return", "an", "AnalysisPartition", "proxy", "which", "wraps", "this", "partition", "to", "provide", "acess", "to", "dataframes", "shapely", "shapes", "and", "other", "analysis", "services" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L790-L796
CivicSpleen/ambry
ambry/orm/partition.py
Partition.measuredim
def measuredim(self): """Return a MeasureDimension proxy, which wraps the partition to provide access to columns in terms of measures and dimensions""" if isinstance(self, PartitionProxy): return MeasureDimensionPartition(self._obj) else: return MeasureDimensionP...
python
def measuredim(self): """Return a MeasureDimension proxy, which wraps the partition to provide access to columns in terms of measures and dimensions""" if isinstance(self, PartitionProxy): return MeasureDimensionPartition(self._obj) else: return MeasureDimensionP...
[ "def", "measuredim", "(", "self", ")", ":", "if", "isinstance", "(", "self", ",", "PartitionProxy", ")", ":", "return", "MeasureDimensionPartition", "(", "self", ".", "_obj", ")", "else", ":", "return", "MeasureDimensionPartition", "(", "self", ")" ]
Return a MeasureDimension proxy, which wraps the partition to provide access to columns in terms of measures and dimensions
[ "Return", "a", "MeasureDimension", "proxy", "which", "wraps", "the", "partition", "to", "provide", "access", "to", "columns", "in", "terms", "of", "measures", "and", "dimensions" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L799-L806
CivicSpleen/ambry
ambry/orm/partition.py
Partition.update_id
def update_id(self, sequence_id=None): """Alter the sequence id, and all of the names and ids derived from it. This often needs to be done after an IntegrityError in a multiprocessing run""" if sequence_id: self.sequence_id = sequence_id self._set_ids(force=True) i...
python
def update_id(self, sequence_id=None): """Alter the sequence id, and all of the names and ids derived from it. This often needs to be done after an IntegrityError in a multiprocessing run""" if sequence_id: self.sequence_id = sequence_id self._set_ids(force=True) i...
[ "def", "update_id", "(", "self", ",", "sequence_id", "=", "None", ")", ":", "if", "sequence_id", ":", "self", ".", "sequence_id", "=", "sequence_id", "self", ".", "_set_ids", "(", "force", "=", "True", ")", "if", "self", ".", "dataset", ":", "self", "....
Alter the sequence id, and all of the names and ids derived from it. This often needs to be done after an IntegrityError in a multiprocessing run
[ "Alter", "the", "sequence", "id", "and", "all", "of", "the", "names", "and", "ids", "derived", "from", "it", ".", "This", "often", "needs", "to", "be", "done", "after", "an", "IntegrityError", "in", "a", "multiprocessing", "run" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L810-L820
CivicSpleen/ambry
ambry/orm/partition.py
Partition._update_names
def _update_names(self): """Update the derived names""" d = dict( table=self.table_name, time=self.time, space=self.space, grain=self.grain, variant=self.variant, segment=self.segment ) assert self.dataset ...
python
def _update_names(self): """Update the derived names""" d = dict( table=self.table_name, time=self.time, space=self.space, grain=self.grain, variant=self.variant, segment=self.segment ) assert self.dataset ...
[ "def", "_update_names", "(", "self", ")", ":", "d", "=", "dict", "(", "table", "=", "self", ".", "table_name", ",", "time", "=", "self", ".", "time", ",", "space", "=", "self", ".", "space", ",", "grain", "=", "self", ".", "grain", ",", "variant", ...
Update the derived names
[ "Update", "the", "derived", "names" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L841-L860
CivicSpleen/ambry
ambry/orm/partition.py
Partition.before_insert
def before_insert(mapper, conn, target): """event.listen method for Sqlalchemy to set the sequence for this object and create an ObjectNumber value for the id_""" target._set_ids() if target.name and target.vname and target.cache_key and target.fqname and not target.dataset: ...
python
def before_insert(mapper, conn, target): """event.listen method for Sqlalchemy to set the sequence for this object and create an ObjectNumber value for the id_""" target._set_ids() if target.name and target.vname and target.cache_key and target.fqname and not target.dataset: ...
[ "def", "before_insert", "(", "mapper", ",", "conn", ",", "target", ")", ":", "target", ".", "_set_ids", "(", ")", "if", "target", ".", "name", "and", "target", ".", "vname", "and", "target", ".", "cache_key", "and", "target", ".", "fqname", "and", "not...
event.listen method for Sqlalchemy to set the sequence for this object and create an ObjectNumber value for the id_
[ "event", ".", "listen", "method", "for", "Sqlalchemy", "to", "set", "the", "sequence", "for", "this", "object", "and", "create", "an", "ObjectNumber", "value", "for", "the", "id_" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L863-L872
CivicSpleen/ambry
ambry/orm/partition.py
AnalysisPartition.dataframe
def dataframe(self, predicate=None, filtered_columns=None, columns=None, df_class=None): """Return the partition as a Pandas dataframe :param predicate: If defined, a callable that is called for each row, and if it returns true, the row is included in the output. :param filtered_column...
python
def dataframe(self, predicate=None, filtered_columns=None, columns=None, df_class=None): """Return the partition as a Pandas dataframe :param predicate: If defined, a callable that is called for each row, and if it returns true, the row is included in the output. :param filtered_column...
[ "def", "dataframe", "(", "self", ",", "predicate", "=", "None", ",", "filtered_columns", "=", "None", ",", "columns", "=", "None", ",", "df_class", "=", "None", ")", ":", "from", "operator", "import", "itemgetter", "from", "ambry", ".", "pands", "import", ...
Return the partition as a Pandas dataframe :param predicate: If defined, a callable that is called for each row, and if it returns true, the row is included in the output. :param filtered_columns: If defined, the value is a dict of column names and associated values. Only rows where al...
[ "Return", "the", "partition", "as", "a", "Pandas", "dataframe" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L923-L985
CivicSpleen/ambry
ambry/orm/partition.py
AnalysisPartition.shapes
def shapes(self, simplify=None, predicate=None): """ Return geodata as a list of Shapely shapes :param simplify: Integer or None. Simplify the geometry to a tolerance, in the units of the geometry. :param predicate: A single-argument function to select which records to include in the ou...
python
def shapes(self, simplify=None, predicate=None): """ Return geodata as a list of Shapely shapes :param simplify: Integer or None. Simplify the geometry to a tolerance, in the units of the geometry. :param predicate: A single-argument function to select which records to include in the ou...
[ "def", "shapes", "(", "self", ",", "simplify", "=", "None", ",", "predicate", "=", "None", ")", ":", "from", "shapely", ".", "wkt", "import", "loads", "if", "not", "predicate", ":", "predicate", "=", "lambda", "row", ":", "True", "if", "simplify", ":",...
Return geodata as a list of Shapely shapes :param simplify: Integer or None. Simplify the geometry to a tolerance, in the units of the geometry. :param predicate: A single-argument function to select which records to include in the output. :return: A list of Shapely objects
[ "Return", "geodata", "as", "a", "list", "of", "Shapely", "shapes" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L1022-L1040
CivicSpleen/ambry
ambry/orm/partition.py
AnalysisPartition.patches
def patches(self, basemap, simplify=None, predicate=None, args_f=None, **kwargs): """ Return geodata as a list of Matplotlib patches :param basemap: A mpl_toolkits.basemap.Basemap :param simplify: Integer or None. Simplify the geometry to a tolerance, in the units of the geometry. ...
python
def patches(self, basemap, simplify=None, predicate=None, args_f=None, **kwargs): """ Return geodata as a list of Matplotlib patches :param basemap: A mpl_toolkits.basemap.Basemap :param simplify: Integer or None. Simplify the geometry to a tolerance, in the units of the geometry. ...
[ "def", "patches", "(", "self", ",", "basemap", ",", "simplify", "=", "None", ",", "predicate", "=", "None", ",", "args_f", "=", "None", ",", "*", "*", "kwargs", ")", ":", "from", "descartes", "import", "PolygonPatch", "from", "shapely", ".", "wkt", "im...
Return geodata as a list of Matplotlib patches :param basemap: A mpl_toolkits.basemap.Basemap :param simplify: Integer or None. Simplify the geometry to a tolerance, in the units of the geometry. :param predicate: A single-argument function to select which records to include in the output. ...
[ "Return", "geodata", "as", "a", "list", "of", "Matplotlib", "patches" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L1042-L1087
CivicSpleen/ambry
ambry/orm/partition.py
MeasureDimensionPartition.measures
def measures(self): """Iterate over all measures""" from ambry.valuetype.core import ROLE return [c for c in self.columns if c.role == ROLE.MEASURE]
python
def measures(self): """Iterate over all measures""" from ambry.valuetype.core import ROLE return [c for c in self.columns if c.role == ROLE.MEASURE]
[ "def", "measures", "(", "self", ")", ":", "from", "ambry", ".", "valuetype", ".", "core", "import", "ROLE", "return", "[", "c", "for", "c", "in", "self", ".", "columns", "if", "c", ".", "role", "==", "ROLE", ".", "MEASURE", "]" ]
Iterate over all measures
[ "Iterate", "over", "all", "measures" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L1133-L1137
CivicSpleen/ambry
ambry/orm/partition.py
MeasureDimensionPartition.measure
def measure(self, vid): """Return a measure, given its vid or another reference""" from ambry.orm import Column if isinstance(vid, PartitionColumn): return vid elif isinstance(vid, Column): return PartitionColumn(vid) else: return PartitionCo...
python
def measure(self, vid): """Return a measure, given its vid or another reference""" from ambry.orm import Column if isinstance(vid, PartitionColumn): return vid elif isinstance(vid, Column): return PartitionColumn(vid) else: return PartitionCo...
[ "def", "measure", "(", "self", ",", "vid", ")", ":", "from", "ambry", ".", "orm", "import", "Column", "if", "isinstance", "(", "vid", ",", "PartitionColumn", ")", ":", "return", "vid", "elif", "isinstance", "(", "vid", ",", "Column", ")", ":", "return"...
Return a measure, given its vid or another reference
[ "Return", "a", "measure", "given", "its", "vid", "or", "another", "reference" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L1139-L1149
CivicSpleen/ambry
ambry/orm/partition.py
MeasureDimensionPartition.dataframe
def dataframe(self, measure, p_dim, s_dim=None, filters={}, df_class=None): """ Return a dataframe with a sumse of the columns of the partition, including a measure and one or two dimensions. FOr dimensions that have labels, the labels are included The returned dataframe will have extra...
python
def dataframe(self, measure, p_dim, s_dim=None, filters={}, df_class=None): """ Return a dataframe with a sumse of the columns of the partition, including a measure and one or two dimensions. FOr dimensions that have labels, the labels are included The returned dataframe will have extra...
[ "def", "dataframe", "(", "self", ",", "measure", ",", "p_dim", ",", "s_dim", "=", "None", ",", "filters", "=", "{", "}", ",", "df_class", "=", "None", ")", ":", "import", "numpy", "as", "np", "measure", "=", "self", ".", "measure", "(", "measure", ...
Return a dataframe with a sumse of the columns of the partition, including a measure and one or two dimensions. FOr dimensions that have labels, the labels are included The returned dataframe will have extra properties to describe the conversion: * plot_axes: List of dimension names for the fi...
[ "Return", "a", "dataframe", "with", "a", "sumse", "of", "the", "columns", "of", "the", "partition", "including", "a", "measure", "and", "one", "or", "two", "dimensions", ".", "FOr", "dimensions", "that", "have", "labels", "the", "labels", "are", "included" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L1178-L1328
CivicSpleen/ambry
ambry/orm/partition.py
MeasureDimensionPartition.dimension_set
def dimension_set(self, p_dim, s_dim=None, dimensions=None, extant=set()): """ Return a dict that describes the combination of one or two dimensions, for a plot :param p_dim: :param s_dim: :param dimensions: :param extant: :return: """ if not dim...
python
def dimension_set(self, p_dim, s_dim=None, dimensions=None, extant=set()): """ Return a dict that describes the combination of one or two dimensions, for a plot :param p_dim: :param s_dim: :param dimensions: :param extant: :return: """ if not dim...
[ "def", "dimension_set", "(", "self", ",", "p_dim", ",", "s_dim", "=", "None", ",", "dimensions", "=", "None", ",", "extant", "=", "set", "(", ")", ")", ":", "if", "not", "dimensions", ":", "dimensions", "=", "self", ".", "primary_dimensions", "key", "=...
Return a dict that describes the combination of one or two dimensions, for a plot :param p_dim: :param s_dim: :param dimensions: :param extant: :return:
[ "Return", "a", "dict", "that", "describes", "the", "combination", "of", "one", "or", "two", "dimensions", "for", "a", "plot" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L1330-L1385
CivicSpleen/ambry
ambry/orm/partition.py
PartitionColumn.label
def label(self): """"Return first child that of the column that is marked as a label""" for c in self.table.columns: if c.parent == self.name and 'label' in c.valuetype: return PartitionColumn(c, self._partition)
python
def label(self): """"Return first child that of the column that is marked as a label""" for c in self.table.columns: if c.parent == self.name and 'label' in c.valuetype: return PartitionColumn(c, self._partition)
[ "def", "label", "(", "self", ")", ":", "for", "c", "in", "self", ".", "table", ".", "columns", ":", "if", "c", ".", "parent", "==", "self", ".", "name", "and", "'label'", "in", "c", ".", "valuetype", ":", "return", "PartitionColumn", "(", "c", ",",...
Return first child that of the column that is marked as a label
[ "Return", "first", "child", "that", "of", "the", "column", "that", "is", "marked", "as", "a", "label" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L1440-L1444
CivicSpleen/ambry
ambry/orm/partition.py
PartitionColumn.value_labels
def value_labels(self): """Return a map of column code values mapped to labels, for columns that have a label column If the column is not assocaited with a label column, it returns an identity map. WARNING! This reads the whole partition, so it is really slow """ from operato...
python
def value_labels(self): """Return a map of column code values mapped to labels, for columns that have a label column If the column is not assocaited with a label column, it returns an identity map. WARNING! This reads the whole partition, so it is really slow """ from operato...
[ "def", "value_labels", "(", "self", ")", ":", "from", "operator", "import", "itemgetter", "card", "=", "self", ".", "pstats", ".", "nuniques", "if", "self", ".", "label", ":", "ig", "=", "itemgetter", "(", "self", ".", "name", ",", "self", ".", "label"...
Return a map of column code values mapped to labels, for columns that have a label column If the column is not assocaited with a label column, it returns an identity map. WARNING! This reads the whole partition, so it is really slow
[ "Return", "a", "map", "of", "column", "code", "values", "mapped", "to", "labels", "for", "columns", "that", "have", "a", "label", "column" ]
train
https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/orm/partition.py#L1447-L1478
project-ncl/pnc-cli
pnc_cli/buildconfigurationsets.py
list_build_configuration_sets
def list_build_configuration_sets(page_size=200, page_index=0, sort="", q=""): """ List all build configuration sets """ data = list_build_configuration_sets_raw(page_size, page_index, sort, q) if data: return utils.format_json_list(data)
python
def list_build_configuration_sets(page_size=200, page_index=0, sort="", q=""): """ List all build configuration sets """ data = list_build_configuration_sets_raw(page_size, page_index, sort, q) if data: return utils.format_json_list(data)
[ "def", "list_build_configuration_sets", "(", "page_size", "=", "200", ",", "page_index", "=", "0", ",", "sort", "=", "\"\"", ",", "q", "=", "\"\"", ")", ":", "data", "=", "list_build_configuration_sets_raw", "(", "page_size", ",", "page_index", ",", "sort", ...
List all build configuration sets
[ "List", "all", "build", "configuration", "sets" ]
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/buildconfigurationsets.py#L35-L41
project-ncl/pnc-cli
pnc_cli/buildconfigurationsets.py
create_build_configuration_set_raw
def create_build_configuration_set_raw(**kwargs): """ Create a new BuildConfigurationSet. """ config_set = _create_build_config_set_object(**kwargs) response = utils.checked_api_call(pnc_api.build_group_configs, 'create_new', body=config_set) if response: return response.content
python
def create_build_configuration_set_raw(**kwargs): """ Create a new BuildConfigurationSet. """ config_set = _create_build_config_set_object(**kwargs) response = utils.checked_api_call(pnc_api.build_group_configs, 'create_new', body=config_set) if response: return response.content
[ "def", "create_build_configuration_set_raw", "(", "*", "*", "kwargs", ")", ":", "config_set", "=", "_create_build_config_set_object", "(", "*", "*", "kwargs", ")", "response", "=", "utils", ".", "checked_api_call", "(", "pnc_api", ".", "build_group_configs", ",", ...
Create a new BuildConfigurationSet.
[ "Create", "a", "new", "BuildConfigurationSet", "." ]
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/buildconfigurationsets.py#L44-L51
project-ncl/pnc-cli
pnc_cli/buildconfigurationsets.py
get_build_configuration_set_raw
def get_build_configuration_set_raw(id=None, name=None): """ Get a specific BuildConfigurationSet by name or ID """ found_id = common.set_id(pnc_api.build_group_configs, id, name) response = utils.checked_api_call(pnc_api.build_group_configs, 'get_specific', id=found_id) if response: ret...
python
def get_build_configuration_set_raw(id=None, name=None): """ Get a specific BuildConfigurationSet by name or ID """ found_id = common.set_id(pnc_api.build_group_configs, id, name) response = utils.checked_api_call(pnc_api.build_group_configs, 'get_specific', id=found_id) if response: ret...
[ "def", "get_build_configuration_set_raw", "(", "id", "=", "None", ",", "name", "=", "None", ")", ":", "found_id", "=", "common", ".", "set_id", "(", "pnc_api", ".", "build_group_configs", ",", "id", ",", "name", ")", "response", "=", "utils", ".", "checked...
Get a specific BuildConfigurationSet by name or ID
[ "Get", "a", "specific", "BuildConfigurationSet", "by", "name", "or", "ID" ]
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/buildconfigurationsets.py#L69-L76
project-ncl/pnc-cli
pnc_cli/buildconfigurationsets.py
get_build_configuration_set
def get_build_configuration_set(id=None, name=None): """ Get a specific BuildConfigurationSet by name or ID """ content = get_build_configuration_set_raw(id, name) if content: return utils.format_json(content)
python
def get_build_configuration_set(id=None, name=None): """ Get a specific BuildConfigurationSet by name or ID """ content = get_build_configuration_set_raw(id, name) if content: return utils.format_json(content)
[ "def", "get_build_configuration_set", "(", "id", "=", "None", ",", "name", "=", "None", ")", ":", "content", "=", "get_build_configuration_set_raw", "(", "id", ",", "name", ")", "if", "content", ":", "return", "utils", ".", "format_json", "(", "content", ")"...
Get a specific BuildConfigurationSet by name or ID
[ "Get", "a", "specific", "BuildConfigurationSet", "by", "name", "or", "ID" ]
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/buildconfigurationsets.py#L80-L86
project-ncl/pnc-cli
pnc_cli/buildconfigurationsets.py
update_build_configuration_set
def update_build_configuration_set(id, **kwargs): """ Update a BuildConfigurationSet """ data = update_build_configuration_set_raw(id, **kwargs) if data: return utils.format_json(data)
python
def update_build_configuration_set(id, **kwargs): """ Update a BuildConfigurationSet """ data = update_build_configuration_set_raw(id, **kwargs) if data: return utils.format_json(data)
[ "def", "update_build_configuration_set", "(", "id", ",", "*", "*", "kwargs", ")", ":", "data", "=", "update_build_configuration_set_raw", "(", "id", ",", "*", "*", "kwargs", ")", "if", "data", ":", "return", "utils", ".", "format_json", "(", "data", ")" ]
Update a BuildConfigurationSet
[ "Update", "a", "BuildConfigurationSet" ]
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/buildconfigurationsets.py#L107-L113
project-ncl/pnc-cli
pnc_cli/buildconfigurationsets.py
build_set_raw
def build_set_raw(id=None, name=None, tempbuild=False, timestamp_alignment=False, force=False, rebuild_mode=common.REBUILD_MODES_DEFAULT, **kwargs): """ Start a build of the given BuildConfigurationSet """ logging.debug("temp_build: " + str(tempbuild...
python
def build_set_raw(id=None, name=None, tempbuild=False, timestamp_alignment=False, force=False, rebuild_mode=common.REBUILD_MODES_DEFAULT, **kwargs): """ Start a build of the given BuildConfigurationSet """ logging.debug("temp_build: " + str(tempbuild...
[ "def", "build_set_raw", "(", "id", "=", "None", ",", "name", "=", "None", ",", "tempbuild", "=", "False", ",", "timestamp_alignment", "=", "False", ",", "force", "=", "False", ",", "rebuild_mode", "=", "common", ".", "REBUILD_MODES_DEFAULT", ",", "*", "*",...
Start a build of the given BuildConfigurationSet
[ "Start", "a", "build", "of", "the", "given", "BuildConfigurationSet" ]
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/buildconfigurationsets.py#L134-L171
project-ncl/pnc-cli
pnc_cli/buildconfigurationsets.py
build_set
def build_set(id=None, name=None, temporary_build=False, timestamp_alignment=False, force=False, rebuild_mode=common.REBUILD_MODES_DEFAULT, **kwargs): """ Start a build of the given BuildConfigurationSet """ content = build_set_raw(id, name, temporary_build, tim...
python
def build_set(id=None, name=None, temporary_build=False, timestamp_alignment=False, force=False, rebuild_mode=common.REBUILD_MODES_DEFAULT, **kwargs): """ Start a build of the given BuildConfigurationSet """ content = build_set_raw(id, name, temporary_build, tim...
[ "def", "build_set", "(", "id", "=", "None", ",", "name", "=", "None", ",", "temporary_build", "=", "False", ",", "timestamp_alignment", "=", "False", ",", "force", "=", "False", ",", "rebuild_mode", "=", "common", ".", "REBUILD_MODES_DEFAULT", ",", "*", "*...
Start a build of the given BuildConfigurationSet
[ "Start", "a", "build", "of", "the", "given", "BuildConfigurationSet" ]
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/buildconfigurationsets.py#L182-L190
project-ncl/pnc-cli
pnc_cli/buildconfigurationsets.py
list_build_configurations_for_set
def list_build_configurations_for_set(id=None, name=None, page_size=200, page_index=0, sort="", q=""): """ List all build configurations in a given BuildConfigurationSet. """ content = list_build_configurations_for_set_raw(id, name, page_size, page_index, sort, q) if content: return utils.fo...
python
def list_build_configurations_for_set(id=None, name=None, page_size=200, page_index=0, sort="", q=""): """ List all build configurations in a given BuildConfigurationSet. """ content = list_build_configurations_for_set_raw(id, name, page_size, page_index, sort, q) if content: return utils.fo...
[ "def", "list_build_configurations_for_set", "(", "id", "=", "None", ",", "name", "=", "None", ",", "page_size", "=", "200", ",", "page_index", "=", "0", ",", "sort", "=", "\"\"", ",", "q", "=", "\"\"", ")", ":", "content", "=", "list_build_configurations_f...
List all build configurations in a given BuildConfigurationSet.
[ "List", "all", "build", "configurations", "in", "a", "given", "BuildConfigurationSet", "." ]
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/buildconfigurationsets.py#L206-L212
project-ncl/pnc-cli
pnc_cli/buildconfigurationsets.py
add_build_configuration_to_set
def add_build_configuration_to_set( set_id=None, set_name=None, config_id=None, config_name=None): """ Add a build configuration to an existing BuildConfigurationSet """ content = add_build_configuration_to_set_raw(set_id, set_name, config_id, config_name) if content: return utils.fo...
python
def add_build_configuration_to_set( set_id=None, set_name=None, config_id=None, config_name=None): """ Add a build configuration to an existing BuildConfigurationSet """ content = add_build_configuration_to_set_raw(set_id, set_name, config_id, config_name) if content: return utils.fo...
[ "def", "add_build_configuration_to_set", "(", "set_id", "=", "None", ",", "set_name", "=", "None", ",", "config_id", "=", "None", ",", "config_name", "=", "None", ")", ":", "content", "=", "add_build_configuration_to_set_raw", "(", "set_id", ",", "set_name", ","...
Add a build configuration to an existing BuildConfigurationSet
[ "Add", "a", "build", "configuration", "to", "an", "existing", "BuildConfigurationSet" ]
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/buildconfigurationsets.py#L235-L242
project-ncl/pnc-cli
pnc_cli/buildconfigurationsets.py
list_build_records_for_set
def list_build_records_for_set(id=None, name=None, page_size=200, page_index=0, sort="", q=""): """ List all build records for a BuildConfigurationSet """ content = list_build_records_for_set_raw(id, name, page_size, page_index, sort, q) if content: return utils.format_json_list(content)
python
def list_build_records_for_set(id=None, name=None, page_size=200, page_index=0, sort="", q=""): """ List all build records for a BuildConfigurationSet """ content = list_build_records_for_set_raw(id, name, page_size, page_index, sort, q) if content: return utils.format_json_list(content)
[ "def", "list_build_records_for_set", "(", "id", "=", "None", ",", "name", "=", "None", ",", "page_size", "=", "200", ",", "page_index", "=", "0", ",", "sort", "=", "\"\"", ",", "q", "=", "\"\"", ")", ":", "content", "=", "list_build_records_for_set_raw", ...
List all build records for a BuildConfigurationSet
[ "List", "all", "build", "records", "for", "a", "BuildConfigurationSet" ]
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/buildconfigurationsets.py#L282-L288
project-ncl/pnc-cli
pnc_cli/buildconfigurationsets.py
list_build_set_records
def list_build_set_records(id=None, name=None, page_size=200, page_index=0, sort="", q=""): """ List all build set records for a BuildConfigurationSet """ content = list_build_set_records_raw(id, name, page_size, page_index, sort, q) if content: return utils.format_json_list(content)
python
def list_build_set_records(id=None, name=None, page_size=200, page_index=0, sort="", q=""): """ List all build set records for a BuildConfigurationSet """ content = list_build_set_records_raw(id, name, page_size, page_index, sort, q) if content: return utils.format_json_list(content)
[ "def", "list_build_set_records", "(", "id", "=", "None", ",", "name", "=", "None", ",", "page_size", "=", "200", ",", "page_index", "=", "0", ",", "sort", "=", "\"\"", ",", "q", "=", "\"\"", ")", ":", "content", "=", "list_build_set_records_raw", "(", ...
List all build set records for a BuildConfigurationSet
[ "List", "all", "build", "set", "records", "for", "a", "BuildConfigurationSet" ]
train
https://github.com/project-ncl/pnc-cli/blob/3dc149bf84928f60a8044ac50b58bbaddd451902/pnc_cli/buildconfigurationsets.py#L304-L310
twisted/epsilon
epsilon/react.py
react
def react(reactor, main, argv): """ Call C{main} and run the reactor until the L{Deferred} it returns fires. @param reactor: An unstarted L{IReactorCore} provider which will be run and later stopped. @param main: A callable which returns a L{Deferred}. It should take as many arguments...
python
def react(reactor, main, argv): """ Call C{main} and run the reactor until the L{Deferred} it returns fires. @param reactor: An unstarted L{IReactorCore} provider which will be run and later stopped. @param main: A callable which returns a L{Deferred}. It should take as many arguments...
[ "def", "react", "(", "reactor", ",", "main", ",", "argv", ")", ":", "stopping", "=", "[", "]", "reactor", ".", "addSystemEventTrigger", "(", "'before'", ",", "'shutdown'", ",", "stopping", ".", "append", ",", "True", ")", "finished", "=", "main", "(", ...
Call C{main} and run the reactor until the L{Deferred} it returns fires. @param reactor: An unstarted L{IReactorCore} provider which will be run and later stopped. @param main: A callable which returns a L{Deferred}. It should take as many arguments as there are elements in the list C{argv}. ...
[ "Call", "C", "{", "main", "}", "and", "run", "the", "reactor", "until", "the", "L", "{", "Deferred", "}", "it", "returns", "fires", "." ]
train
https://github.com/twisted/epsilon/blob/e85fa985a41983ef06e1d3bb26639181e1f78b24/epsilon/react.py#L11-L33
edoburu/django-any-urlfield
any_urlfield/models/fields.py
AnyUrlField.register_model
def register_model(cls, ModelClass, form_field=None, widget=None, title=None, prefix=None): """ Register a model to use in the URL field. This function needs to be called once for every model that should be selectable in the URL field. :param ModelClass: The model to register. ...
python
def register_model(cls, ModelClass, form_field=None, widget=None, title=None, prefix=None): """ Register a model to use in the URL field. This function needs to be called once for every model that should be selectable in the URL field. :param ModelClass: The model to register. ...
[ "def", "register_model", "(", "cls", ",", "ModelClass", ",", "form_field", "=", "None", ",", "widget", "=", "None", ",", "title", "=", "None", ",", "prefix", "=", "None", ")", ":", "cls", ".", "_static_registry", ".", "register", "(", "ModelClass", ",", ...
Register a model to use in the URL field. This function needs to be called once for every model that should be selectable in the URL field. :param ModelClass: The model to register. :param form_field: The form field class used to render the field. This can be a lambda for lazy evaluati...
[ "Register", "a", "model", "to", "use", "in", "the", "URL", "field", "." ]
train
https://github.com/edoburu/django-any-urlfield/blob/8d7d36c8a1fc251930f6dbdcc8b5b5151d20e3ab/any_urlfield/models/fields.py#L59-L72
edoburu/django-any-urlfield
any_urlfield/models/fields.py
AnyUrlField.resolve_objects
def resolve_objects(cls, objects, skip_cached_urls=False): """ Make sure all AnyUrlValue objects from a set of objects is resolved in bulk. This avoids making a query per item. :param objects: A list or queryset of models. :param skip_cached_urls: Whether to avoid prefetching da...
python
def resolve_objects(cls, objects, skip_cached_urls=False): """ Make sure all AnyUrlValue objects from a set of objects is resolved in bulk. This avoids making a query per item. :param objects: A list or queryset of models. :param skip_cached_urls: Whether to avoid prefetching da...
[ "def", "resolve_objects", "(", "cls", ",", "objects", ",", "skip_cached_urls", "=", "False", ")", ":", "# Allow the queryset or list to consist of multiple models.", "# This supports querysets from django-polymorphic too.", "queryset", "=", "list", "(", "objects", ")", "any_u...
Make sure all AnyUrlValue objects from a set of objects is resolved in bulk. This avoids making a query per item. :param objects: A list or queryset of models. :param skip_cached_urls: Whether to avoid prefetching data that has it's URL cached.
[ "Make", "sure", "all", "AnyUrlValue", "objects", "from", "a", "set", "of", "objects", "is", "resolved", "in", "bulk", ".", "This", "avoids", "making", "a", "query", "per", "item", "." ]
train
https://github.com/edoburu/django-any-urlfield/blob/8d7d36c8a1fc251930f6dbdcc8b5b5151d20e3ab/any_urlfield/models/fields.py#L137-L157